summaryrefslogtreecommitdiffstats
path: root/test/network/handler
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-19 16:42:41 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-19 16:42:41 +0000
commite2c5dbb2cc022034a54b1207310eff43be93ce85 (patch)
tree53c71082cf67f6847f8611fcd5f09fb11c9a8d37 /test/network/handler
parent92bad78a6aebb9abeac8e734b5ce56b88e21cdda (diff)
downloadpuppet-e2c5dbb2cc022034a54b1207310eff43be93ce85.tar.gz
puppet-e2c5dbb2cc022034a54b1207310eff43be93ce85.tar.xz
puppet-e2c5dbb2cc022034a54b1207310eff43be93ce85.zip
Another round of bug-fixes, prompted by test logs from David Schmitt
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2316 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/network/handler')
-rwxr-xr-xtest/network/handler/master.rb15
-rwxr-xr-xtest/network/handler/runner.rb5
2 files changed, 14 insertions, 6 deletions
diff --git a/test/network/handler/master.rb b/test/network/handler/master.rb
index eb3db0959..7e1a32396 100755
--- a/test/network/handler/master.rb
+++ b/test/network/handler/master.rb
@@ -97,6 +97,10 @@ class TestMaster < Test::Unit::TestCase
Puppet[:filetimeout] = 15
manifest = mktestmanifest()
+ facts = Puppet::Network::Client.master.facts
+ # Store them, so we don't determine frshness based on facts.
+ Puppet::Util::Storage.cache(:configuration)[:facts] = facts
+
file2 = @createdfile + "2"
@@tmpfiles << file2
@@ -117,7 +121,8 @@ class TestMaster < Test::Unit::TestCase
assert(client, "did not create master client")
# The client doesn't have a config, so it can't be up to date
- assert(! client.fresh?, "Client is incorrectly up to date")
+ assert(! client.fresh?(facts),
+ "Client is incorrectly up to date")
Puppet.config.use(:puppet)
assert_nothing_raised {
@@ -126,7 +131,7 @@ class TestMaster < Test::Unit::TestCase
}
# Now it should be up to date
- assert(client.fresh?, "Client is not up to date")
+ assert(client.fresh?(facts), "Client is not up to date")
# Cache this value for later
parse1 = master.freshness
@@ -145,7 +150,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(client.fresh?, "Client is not up to date")
+ assert(client.fresh?(facts), "Client is not up to date")
# Then eliminate it
Puppet[:filetimeout] = 0
@@ -153,14 +158,14 @@ 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(! client.fresh?, "Client is incorrectly up to date")
+ assert(! client.fresh?(facts), "Client is incorrectly up to date")
# Retrieve and apply the new config
assert_nothing_raised {
client.getconfig
client.apply
}
- assert(client.fresh?, "Client is not up to date")
+ assert(client.fresh?(facts), "Client is not up to date")
assert(FileTest.exists?(file2), "Second file %s does not exist" % file2)
end
diff --git a/test/network/handler/runner.rb b/test/network/handler/runner.rb
index 5c3acde2b..b6df9bab9 100755
--- a/test/network/handler/runner.rb
+++ b/test/network/handler/runner.rb
@@ -36,10 +36,13 @@ class TestHandlerRunner < Test::Unit::TestCase
# Okay, make our manifest
file = tempfile()
created = tempfile()
+ # We specify the schedule here, because I was having problems with
+ # using default schedules.
File.open(file, "w") do |f|
f.puts %{
class yayness {
- file { "#{created}": ensure => file, schedule => weekly }
+ schedule { "yayness": period => weekly }
+ file { "#{created}": ensure => file, schedule => yayness }
}
include yayness