diff --git a/acceptance/tests/resource/file/symbolic_modes.rb b/acceptance/tests/resource/file/symbolic_modes.rb index 3d088eebc..46c61ca35 100644 --- a/acceptance/tests/resource/file/symbolic_modes.rb +++ b/acceptance/tests/resource/file/symbolic_modes.rb @@ -1,115 +1,114 @@ test_name "file resource: symbolic modes" def validate(path, mode) "ruby -e 'exit (File::Stat.new(#{path.inspect}).mode & 0777 == #{mode})'" end -def tmpfile(what) - "/tmp/symbolic-mode-#{what}-" + - "#{Time.now.strftime("%Y%m%d")}-#{$$}-" + - "#{rand(0x100000000).to_s(36)}.test" -end +agents.each do |agent| + if agent['platform'].include?('windows') + Log.warn("Pending: this does not currently work on Windows") + next + end -# Generate some standard, remote-safe names for our scratch content, and make -# sure that they exist already. Don't need to care about modes or owners, as -# we reset anything that matters inside the test loop. -file = tmpfile('file') -dir = tmpfile('dir') + user = agent['user'] + group = agent['group'] || user + file = agent.tmpfile('symbolic-mode-file') + dir = agent.tmpdir('symbolic-mode-dir') -on agents, "touch #{file} ; mkdir #{dir}" + on(agent, "touch #{file} ; mkdir -p #{dir}") # Infrastructure for a nice, table driven test. Yum. # # For your reference: # 4000 the set-user-ID-on-execution bit # 2000 the set-group-ID-on-execution bit # 1000 the sticky bit # 0400 Allow read by owner. # 0200 Allow write by owner. # 0100 For files, allow execution by owner. For directories, allow the # owner to search in the directory. # 0040 Allow read by group members. # 0020 Allow write by group members. # 0010 For files, allow execution by group members. For directories, allow # group members to search in the directory. # 0004 Allow read by others. # 0002 Allow write by others. # 0001 For files, allow execution by others. For directories allow others # to search in the directory. # # fields are: start_mode, symbolic_mode, file_mode, dir_mode # start_mode is passed to chmod on the target platform # symbolic_mode is the mode set in our test # the file and dir mode values are the numeric resultant values we should get tests = <