summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-12-10 12:16:08 -0600
committerLuke Kanies <luke@madstop.com>2007-12-10 12:16:08 -0600
commitae33e57d1bb94827f488374a7dba8a96fa8e541f (patch)
tree471a42b819a3c64978497d04580ef14b5ccbc76e /test
parent9ad7d1a7255a89383bc2b8c6b72c79bc050945a3 (diff)
downloadpuppet-ae33e57d1bb94827f488374a7dba8a96fa8e541f.tar.gz
puppet-ae33e57d1bb94827f488374a7dba8a96fa8e541f.tar.xz
puppet-ae33e57d1bb94827f488374a7dba8a96fa8e541f.zip
Fixing #923 (again). The host storage method was not
correctly searching for the host, so it was creating a new host on each run, which is what was causing the conflict.
Diffstat (limited to 'test')
-rwxr-xr-xtest/rails/host.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/rails/host.rb b/test/rails/host.rb
index 5853e8219..582bebcb2 100755
--- a/test/rails/host.rb
+++ b/test/rails/host.rb
@@ -51,8 +51,7 @@ class TestRailsHost < PuppetTest::TestCase
}
# Now collect our facts
- facts = {"hostname" => Facter.value(:hostname), "test1" => "funtest",
- "ipaddress" => Facter.value(:ipaddress)}
+ facts = {"hostname" => "myhost", "test1" => "funtest", "ipaddress" => "192.168.0.1"}
# Now try storing our crap
host = nil
@@ -120,13 +119,15 @@ class TestRailsHost < PuppetTest::TestCase
facts["test3"] = "funtest"
facts["test1"] = "changedfact"
facts.delete("ipaddress")
- host = nil
node = mknode(facts["hostname"])
node.parameters = facts
+ newhost = nil
assert_nothing_raised {
- host = Puppet::Rails::Host.store(node, resources)
+ newhost = Puppet::Rails::Host.store(node, resources)
}
+ assert_equal(host.id, newhost.id, "Created new host instance)")
+
# Make sure it sets the last_compile time
assert_nothing_raised do
assert_instance_of(Time, host.last_compile, "did not set last_compile")