summaryrefslogtreecommitdiffstats
path: root/test/network/handler
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-08-26 19:03:25 -0500
committerLuke Kanies <luke@madstop.com>2007-08-26 19:03:25 -0500
commit9ea8e6cc8772053548d3438393dd1ead986ed719 (patch)
treeff97f65095d4b5b516dd800dd6197638787cc4dd /test/network/handler
parent51ff72c42447e5b9e05db3b24530a4e628454396 (diff)
downloadpuppet-9ea8e6cc8772053548d3438393dd1ead986ed719.tar.gz
puppet-9ea8e6cc8772053548d3438393dd1ead986ed719.tar.xz
puppet-9ea8e6cc8772053548d3438393dd1ead986ed719.zip
The fileserver now uses an environment-specific module path. I also made various bug fixes around the network tree.
Diffstat (limited to 'test/network/handler')
-rwxr-xr-xtest/network/handler/configuration.rb6
-rwxr-xr-xtest/network/handler/master.rb6
-rwxr-xr-xtest/network/handler/node.rb3
3 files changed, 8 insertions, 7 deletions
diff --git a/test/network/handler/configuration.rb b/test/network/handler/configuration.rb
index 98c3bdcde..a34952208 100755
--- a/test/network/handler/configuration.rb
+++ b/test/network/handler/configuration.rb
@@ -170,9 +170,7 @@ class TestHandlerConfiguration < Test::Unit::TestCase
handler.expects(:details).with(:client).returns(false)
config.expects(:node_handler).returns(handler)
interp = Object.new
- interp.expects(:parsedate).returns(:version)
- config.expects(:interpreter).returns(interp)
- assert_equal(:version, config.version(:client), "Did not return configuration version")
+ assert_instance_of(Bignum, config.version(:client), "Did not return configuration version")
# And then when we find the node.
config = Config.new
@@ -182,7 +180,7 @@ class TestHandlerConfiguration < Test::Unit::TestCase
config.expects(:update_node_check).with(node)
config.expects(:node_handler).returns(handler)
interp = Object.new
- interp.expects(:parsedate).returns(:version)
+ interp.expects(:configuration_version).returns(:version)
config.expects(:interpreter).returns(interp)
assert_equal(:version, config.version(:client), "Did not return configuration version")
end
diff --git a/test/network/handler/master.rb b/test/network/handler/master.rb
index 5ac8cbbbc..a976726ef 100755
--- a/test/network/handler/master.rb
+++ b/test/network/handler/master.rb
@@ -80,7 +80,7 @@ class TestMaster < Test::Unit::TestCase
assert(client.fresh?(facts), "Client is not up to date")
# Cache this value for later
- parse1 = master.freshness
+ parse1 = master.freshness("mynode")
# Verify the config got applied
assert(FileTest.exists?(@createdfile),
@@ -95,7 +95,7 @@ class TestMaster < Test::Unit::TestCase
# Verify that the master doesn't immediately reparse the file; we
# want to wait through the timeout
- assert_equal(parse1, master.freshness, "Master did not wait through timeout")
+ assert_equal(parse1, master.freshness("mynode"), "Master did not wait through timeout")
assert(client.fresh?(facts), "Client is not up to date")
# Then eliminate it
@@ -103,7 +103,7 @@ class TestMaster < Test::Unit::TestCase
# Now make sure the master does reparse
#Puppet.notice "%s vs %s" % [parse1, master.freshness]
- assert(parse1 != master.freshness, "Master did not reparse file")
+ assert(parse1 != master.freshness("mynode"), "Master did not reparse file")
assert(! client.fresh?(facts), "Client is incorrectly up to date")
# Retrieve and apply the new config
diff --git a/test/network/handler/node.rb b/test/network/handler/node.rb
index d5c98fec6..f7cbf6017 100755
--- a/test/network/handler/node.rb
+++ b/test/network/handler/node.rb
@@ -336,6 +336,9 @@ class TestNodeHandler < Test::Unit::TestCase
end
assert_equal(node.object_id, handler.send(:cached?, "yay").object_id, "Did not get node back from the cache")
+ # And that it's returned if we ask for it, instead of creating a new node.
+ assert_equal(node.object_id, handler.details("yay").object_id, "Did not use cached node")
+
# Now set the node's time to be a long time ago
node.time = Time.now - 50000
assert(! handler.send(:cached?, "yay"), "Timed-out node was returned from cache")