diff options
author | Dominic Maraglia <dominic@puppetlabs.com> | 2011-06-10 14:27:39 -0700 |
---|---|---|
committer | Dominic Maraglia <dominic@puppetlabs.com> | 2011-06-10 14:27:39 -0700 |
commit | 381fa409207a1b0d26e7e55ea8cbe45a7e132fdf (patch) | |
tree | 46fd736d794dbb1bdd04d099fc1f84332916c689 /acceptance | |
parent | 01c11424b61163fae71de3611a5166c894601937 (diff) | |
download | puppet-381fa409207a1b0d26e7e55ea8cbe45a7e132fdf.tar.gz puppet-381fa409207a1b0d26e7e55ea8cbe45a7e132fdf.tar.xz puppet-381fa409207a1b0d26e7e55ea8cbe45a7e132fdf.zip |
(#6418) Make test 64118 more portable
Test used a bash command negation to negate the a grep:
'! grep ensure.*directory /var/opt/lib/pe-puppet/state/state.yaml'
which only works on newer bash shells only. Removed the shell
negation and use the harnesses ":acceptable_exit_codes" parameter.
Diffstat (limited to 'acceptance')
-rw-r--r-- | acceptance/tests/ticket_6418_file_recursion_and_audit.rb | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/acceptance/tests/ticket_6418_file_recursion_and_audit.rb b/acceptance/tests/ticket_6418_file_recursion_and_audit.rb index f0a55d029..b21e57ddb 100644 --- a/acceptance/tests/ticket_6418_file_recursion_and_audit.rb +++ b/acceptance/tests/ticket_6418_file_recursion_and_audit.rb @@ -2,11 +2,9 @@ # # AffectedVersion: 2.6.0-2.6.5 # FixedVersion: -# test_name "#6418: file recursion and audit" -on agents, "rm -f /var/lib/puppet/state/state.yaml " manifest = %q{ file { "/tmp/6418": ensure => directory } file { "/tmp/6418/dir": ensure => directory} @@ -17,6 +15,19 @@ manifest = %q{ File["/tmp/6418"] -> File["/tmp/6418/dir"] -> File["/tmp/6418/dir/dir"] -> File["/tmp/6418/dir/dir/dir"] -> File["/tmp/6418-copy"] } +step "Query agent for statefile" +agent=agents.first +on agent, puppet_agent('--configprint statefile') +statefile=stdout.chomp + +step "Remove the statefile on all Agents" +on agents, "rm -f #{statefile}" + step "Apply the manifest" apply_manifest_on agents, manifest -on agents, "! grep ensure.*directory /var/lib/puppet/state/state.yaml" + + +step "Verify corecct file recursion and audit state" +agents.each do |agent| + on(agent, "grep ensure.*directory #{statefile}", :acceptable_exit_codes => [ 1 ]) +end |