diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-01-31 02:07:56 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-01-31 02:07:56 +0000 |
| commit | 30bf65f82bb1e2a1bc19ef0c576117427bf10b03 (patch) | |
| tree | def1d15fe67f1dba3ce958dde5033dc028f8004e /test | |
| parent | d5af359e52559efecccdf807ea5dfef8230f7cd3 (diff) | |
Fixing a significant performance bug in file recursion, and trying to help performance a bit in attribute handling on types
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@862 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
| -rw-r--r-- | test/types/file.rb | 12 | ||||
| -rwxr-xr-x | test/types/filesources.rb | 20 |
2 files changed, 10 insertions, 22 deletions
diff --git a/test/types/file.rb b/test/types/file.rb index a54b78e12..9b2b1653a 100644 --- a/test/types/file.rb +++ b/test/types/file.rb @@ -427,7 +427,7 @@ class TestFile < Test::Unit::TestCase } assert_nothing_raised { - dir.retrieve + dir.evaluate } subobj = nil @@ -435,18 +435,18 @@ class TestFile < Test::Unit::TestCase subobj = Puppet.type(:file)[subdir] } - assert(subobj, "Could not retrieve subdir object") + assert(subobj, "Could not retrieve %s object" % subdir) File.open(tmpfile, "w") { |f| f.puts "yayness" } - dir.retrieve + dir.evaluate file = nil assert_nothing_raised { file = Puppet.type(:file)[tmpfile] } - assert(file, "Could not retrieve file object") + assert(file, "Could not retrieve %s object" % tmpfile) end @@ -560,7 +560,7 @@ class TestFile < Test::Unit::TestCase assert_nil(obj, "Retrieved removed object") end - def test_zpath + def test_path dir = tempfile() path = File.join(dir, "and", "a", "sub", "dir") @@ -581,7 +581,7 @@ class TestFile < Test::Unit::TestCase } assert_nothing_raised { - dirobj.retrieve + dirobj.evaluate } assert_nothing_raised { diff --git a/test/types/filesources.rb b/test/types/filesources.rb index e08fa268c..3d020d628 100755 --- a/test/types/filesources.rb +++ b/test/types/filesources.rb @@ -55,11 +55,11 @@ class TestFileSources < Test::Unit::TestCase } child = nil assert_nothing_raised { - child = file.newchild("childtest") + child = file.newchild("childtest", true) } assert(child) assert_raise(Puppet::DevError) { - file.newchild(File.join(path,"childtest")) + file.newchild(File.join(path,"childtest"), true) } end @@ -114,18 +114,9 @@ class TestFileSources < Test::Unit::TestCase "source" => fromdir ) } - comp = Puppet.type(:component).create( - :name => "component" - ) - comp.push tofile - assert_nothing_raised { - trans = comp.evaluate - } - assert_nothing_raised { - trans.evaluate - } + assert_apply(tofile) - assert(FileTest.exists?(todir)) + assert(FileTest.exists?(todir), "Created dir %s does not exist" % todir) Puppet::Type.allclear end @@ -369,9 +360,6 @@ class TestFileSources < Test::Unit::TestCase server = nil basedir = tempfile() @@tmpfiles << basedir - if File.exists?(basedir) - system("rm -rf %s" % basedir) - end Dir.mkdir(basedir) mounts = { |
