summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2005-07-11 22:40:35 +0000
committerLuke Kanies <luke@madstop.com>2005-07-11 22:40:35 +0000
commit81777002df44d361ec5ca2b05cab861bc2b726da (patch)
treed16d7480e52379f0756b654bfdd84e158c18493e /test
parent01a9905c0c20320a27a646bd7414384be783fdcb (diff)
downloadpuppet-81777002df44d361ec5ca2b05cab861bc2b726da.tar.gz
puppet-81777002df44d361ec5ca2b05cab861bc2b726da.tar.xz
puppet-81777002df44d361ec5ca2b05cab861bc2b726da.zip
hopefully, finally resolving recursive file creation problems
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@363 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rw-r--r--test/types/tc_file.rb73
1 files changed, 45 insertions, 28 deletions
diff --git a/test/types/tc_file.rb b/test/types/tc_file.rb
index fb95bfbb6..6fd502fef 100644
--- a/test/types/tc_file.rb
+++ b/test/types/tc_file.rb
@@ -20,7 +20,7 @@ class TestFile < Test::Unit::TestCase
Puppet[:statefile] = "/var/tmp/puppetstate"
assert_nothing_raised() {
@file = Puppet::Type::PFile.new(
- :path => @path
+ :name => @path
)
}
end
@@ -30,6 +30,17 @@ class TestFile < Test::Unit::TestCase
system("rm -f %s" % Puppet[:statefile])
end
+ def initstorage
+ Puppet::Storage.init
+ Puppet::Storage.load
+ end
+
+ def clearstorage
+ Puppet::Storage.store
+ Puppet::Storage.clear
+ initstorage()
+ end
+
def test_owner
[Process.uid,%x{whoami}.chomp].each { |user|
assert_nothing_raised() {
@@ -85,7 +96,7 @@ class TestFile < Test::Unit::TestCase
file =nil
assert_nothing_raised() {
file = Puppet::Type::PFile.new(
- :path => path,
+ :name => path,
:create => true
)
}
@@ -126,7 +137,7 @@ class TestFile < Test::Unit::TestCase
}
end
- def test_xchecksums
+ def test_checksums
types = %w{md5 md5lite timestamp ctime}
files = %w{/tmp/sumtest}
assert_nothing_raised() {
@@ -150,7 +161,7 @@ class TestFile < Test::Unit::TestCase
# okay, we now know that we have a file...
assert_nothing_raised() {
file = Puppet::Type::PFile.new(
- :path => path,
+ :name => path,
:checksum => type
)
}
@@ -177,7 +188,7 @@ class TestFile < Test::Unit::TestCase
# now recreate the file
assert_nothing_raised() {
file = Puppet::Type::PFile.new(
- :path => path,
+ :name => path,
:checksum => type
)
}
@@ -204,31 +215,37 @@ class TestFile < Test::Unit::TestCase
end
def cyclefile(path)
- file = nil
- changes = nil
- comp = nil
- trans = nil
- assert_nothing_raised {
- file = Puppet::Type::PFile.new(
- :path => path,
- :recurse => true,
- :checksum => "md5"
+ # i had problems with using :name instead of :path
+ [:name,:path].each { |param|
+ file = nil
+ changes = nil
+ comp = nil
+ trans = nil
+
+ initstorage
+ assert_nothing_raised {
+ file = Puppet::Type::PFile.new(
+ param => path,
+ :recurse => true,
+ :checksum => "md5"
+ )
+ }
+ comp = Puppet::Component.new(
+ :name => "component"
)
+ comp.push file
+ assert_nothing_raised {
+ trans = comp.evaluate
+ }
+ assert_nothing_raised {
+ trans.evaluate
+ }
+ #assert_nothing_raised {
+ # file.sync
+ #}
+ clearstorage
+ Puppet::Type.allclear
}
- comp = Puppet::Component.new(
- :name => "component"
- )
- comp.push file
- assert_nothing_raised {
- trans = comp.evaluate
- }
- assert_nothing_raised {
- trans.evaluate
- }
- #assert_nothing_raised {
- # file.sync
- #}
- Puppet::Type.allclear
end
def test_recursion