summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2005-07-11 17:37:40 +0000
committerLuke Kanies <luke@madstop.com>2005-07-11 17:37:40 +0000
commit649d59a24cf03387e58fa1d4a151fcf34e409777 (patch)
tree5f7ca422618bd78d29025aa6947d814f0e4908bf /test
parentcb95dc753267205bd5b352434bc5518dcd07e70d (diff)
adding some more tests for recursion plus checksumming, because they are somewhat incompatible for directories
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@353 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rwxr-xr-xtest/types/tc_exec.rb2
-rw-r--r--test/types/tc_file.rb38
2 files changed, 38 insertions, 2 deletions
diff --git a/test/types/tc_exec.rb b/test/types/tc_exec.rb
index 1eada111b..e714caf82 100755
--- a/test/types/tc_exec.rb
+++ b/test/types/tc_exec.rb
@@ -120,7 +120,7 @@ class TestExec < Test::Unit::TestCase
}
end
- def test_xcwdsettings
+ def test_cwdsettings
command = nil
assert_nothing_raised {
command = Puppet::Type::Exec.new(
diff --git a/test/types/tc_file.rb b/test/types/tc_file.rb
index 00f942a33..05d49b367 100644
--- a/test/types/tc_file.rb
+++ b/test/types/tc_file.rb
@@ -126,7 +126,7 @@ class TestFile < Test::Unit::TestCase
}
end
- def test_zchecksums
+ def test_checksums
types = %w{md5 md5lite timestamp ctime}
files = %w{/tmp/sumtest}
types.each { |type|
@@ -185,4 +185,40 @@ class TestFile < Test::Unit::TestCase
}
}
end
+
+ def cyclefile(path)
+ file = nil
+ assert_nothing_raised {
+ file = Puppet::Type::PFile.new(
+ :path => path,
+ :recurse => true,
+ :checksum => "md5"
+ )
+ }
+ assert_nothing_raised {
+ file.retrieve
+ }
+ assert_nothing_raised {
+ file.sync
+ }
+ end
+
+ def test_recursion
+ path = "/tmp/filerecursetest"
+ tmpfile = File.join(path,"testing")
+ system("mkdir -p #{path}")
+ cyclefile(path)
+ Puppet::Type::PFile.clear
+ File.open(tmpfile, File::WRONLY|File::CREAT|File::APPEND) { |of|
+ of.puts "yayness"
+ }
+ cyclefile(path)
+ Puppet::Type::PFile.clear
+ File.open(tmpfile, File::WRONLY|File::APPEND) { |of|
+ of.puts "goodness"
+ }
+ cyclefile(path)
+ Puppet::Type::PFile.clear
+ system("rm -rf #{path}")
+ end
end