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.

Signed-off-by: Dominic Maraglia <[email protected]>
---
 .../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 f0a55d0..b21e57d 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
-- 
1.7.3.5

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to