Please review pull request #448: Bug/2.7.x/symbolic file mode acceptance test wtf opened by (daniel-pittman)

Description:

The acceptance test for symbolic file modes didn't handle a case when the
initial and target file mode were identical correctly; it expected a message
about a change, which was never delivered.

Signed-off-by: Daniel Pittman [email protected]

  • Opened: Thu Feb 02 22:36:46 UTC 2012
  • Based on: puppetlabs:2.7.x (090b8b1f8467892995e52fe9dd282e0c68315773)
  • Requested merge: daniel-pittman:bug/2.7.x/symbolic-file-mode-acceptance-test-wtf (77f5a487fec07a42db1054e105b7b794dcb7b5af)

Diff follows:

diff --git a/acceptance/tests/resource/file/symbolic_modes.rb b/acceptance/tests/resource/file/symbolic_modes.rb
index 138fe44..3d088ee 100644
--- a/acceptance/tests/resource/file/symbolic_modes.rb
+++ b/acceptance/tests/resource/file/symbolic_modes.rb
@@ -78,8 +78,10 @@ def tmpfile(what)
   step "test mode #{symbolic_mode} works on a file"
   manifest = "file { #{file.inspect}: ensure => file, mode => #{symbolic_mode} }"
   apply_manifest_on(agents, manifest) do
-    assert_match(/mode changed '#{start_mode}' to '#{file_mode}'/, stdout,
-                 "couldn't set file mode to #{symbolic_mode}")
+    unless start_mode == file_mode
+      assert_match(/mode changed '#{start_mode}' to '#{file_mode}'/, stdout,
+                   "couldn't set file mode to #{symbolic_mode}")
+    end
   end
 
   step "validate the mode changes applied to the file"
@@ -93,8 +95,10 @@ def tmpfile(what)
   step "test mode #{symbolic_mode} works on a directory"
   manifest = "file { #{dir.inspect}: ensure => directory, mode => #{symbolic_mode} }"
   apply_manifest_on(agents, manifest) do
-    assert_match(/mode changed '#{start_mode}' to '#{dir_mode}'/, stdout,
-                 "couldn't set dir mode to #{symbolic_mode}")
+    unless start_mode == dir_mode
+      assert_match(/mode changed '#{start_mode}' to '#{dir_mode}'/, stdout,
+                   "couldn't set dir mode to #{symbolic_mode}")
+    end
   end
 
   step "validate the mode changes applied to the dir"

    

--
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