summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-01-15 19:41:38 -0800
committerLuke Kanies <luke@madstop.com>2008-01-15 19:41:38 -0800
commit4165edaeb71ee2883b1bb85ff39a52d5628b259f (patch)
treeaf3392f3d72d46c279d531ff4837161260dd91d6 /test
parentcfda651f88d12249f29706d2bedbfddce7a2e6f7 (diff)
downloadpuppet-4165edaeb71ee2883b1bb85ff39a52d5628b259f.tar.gz
puppet-4165edaeb71ee2883b1bb85ff39a52d5628b259f.tar.xz
puppet-4165edaeb71ee2883b1bb85ff39a52d5628b259f.zip
More fixes to the testing.
Diffstat (limited to 'test')
-rwxr-xr-xtest/ral/types/sshkey.rb18
-rwxr-xr-xtest/ral/types/yumrepo.rb4
2 files changed, 9 insertions, 13 deletions
diff --git a/test/ral/types/sshkey.rb b/test/ral/types/sshkey.rb
index c68e4a271..333bc377d 100755
--- a/test/ral/types/sshkey.rb
+++ b/test/ral/types/sshkey.rb
@@ -102,18 +102,17 @@ class TestSSHKey < Test::Unit::TestCase
def test_moddingkey
key = mkkey()
- assert_events([:sshkey_created], key)
+ @catalog.apply
key.retrieve
aliases = %w{madstop kirby yayness}
key[:alias] = aliases
- assert_events([:sshkey_changed], key)
+ @catalog.apply
aliases.each do |name|
- assert_equal(key, @catalog.resource(:sshkey, name),
- "alias was not set")
+ assert_equal(key.object_id, @catalog.resource(:sshkey, name).object_id, "alias %s was not set" % name)
end
end
@@ -182,16 +181,9 @@ class TestSSHKey < Test::Unit::TestCase
# Verify we can retrieve that info
assert_nothing_raised("Could not retrieve after second write") {
- newkey.provider.class.prefetch
- newkey.retrieve
+ newkey.provider.prefetch
}
- # And verify that we have data for everything
- names.each { |name|
- key = @catalog.resource(:sshkey, name)
- assert(key, "Could not retrieve key for %s" % name)
- assert(key.provider.exists?, "key %s is missing" % name)
- }
+ assert(newkey.provider.exists?, "Did not see key in file")
end
end
-
diff --git a/test/ral/types/yumrepo.rb b/test/ral/types/yumrepo.rb
index 899a02135..65c4cb50c 100755
--- a/test/ral/types/yumrepo.rb
+++ b/test/ral/types/yumrepo.rb
@@ -19,6 +19,10 @@ class TestYumRepo < Test::Unit::TestCase
Puppet.type(:yumrepo).yumconf = @yumconf
end
+ def teardown
+ Puppet.type(:yumrepo).clear
+ end
+
# Modify one existing section
def test_modify
copy_datafiles