summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-11-08 20:51:44 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-11-08 20:51:44 +0000
commit28c283c73388c3f76e1d715c41ebd82ac35ca9a4 (patch)
treebb54df75b644e779308f4457605f9792f8e4d51f /test
parent744ded30a02883dd8ce5fbf2b847f10acb226d6e (diff)
downloadpuppet-28c283c73388c3f76e1d715c41ebd82ac35ca9a4.tar.gz
puppet-28c283c73388c3f76e1d715c41ebd82ac35ca9a4.tar.xz
puppet-28c283c73388c3f76e1d715c41ebd82ac35ca9a4.zip
Fixing some sticky problems with checksums when just using the "check" metaparam.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1836 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rwxr-xr-xtest/types/file.rb33
1 files changed, 30 insertions, 3 deletions
diff --git a/test/types/file.rb b/test/types/file.rb
index c6cccae81..8c0c50d76 100755
--- a/test/types/file.rb
+++ b/test/types/file.rb
@@ -1505,9 +1505,6 @@ class TestFile < Test::Unit::TestCase
assert(! FileTest.exists?(bfile), "Backed up when told not to")
end
- def test_remove_existing
- end
-
# Make sure we consistently handle backups for all cases.
def test_ensure_with_backups
# We've got three file types, so make sure we can replace any type
@@ -1581,6 +1578,36 @@ class TestFile < Test::Unit::TestCase
end
end
end
+
+ def test_check_checksums
+ dir = tempfile()
+ Dir.mkdir(dir)
+ subdir = File.join(dir, "sub")
+ Dir.mkdir(subdir)
+ file = File.join(dir, "file")
+ File.open(file, "w") { |f| f.puts "yay" }
+
+ obj = Puppet::Type.type(:file).create(
+ :path => dir, :check => :checksum, :recurse => true
+ )
+
+ assert_apply(obj)
+ File.open(file, "w") { |f| f.puts "rah" }
+ sleep 1
+ system("touch %s" % subdir)
+ Puppet::Storage.store
+ Puppet::Storage.load
+ assert_apply(obj)
+ [file, subdir].each do |path|
+ sub = Puppet::Type.type(:file)[path]
+ assert(sub, "did not find obj for %s" % path)
+ sub.retrieve
+
+ assert_nothing_raised do
+ sub.state(:checksum).sync
+ end
+ end
+ end
end
# $Id$