summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
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