diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-03-19 16:42:41 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-03-19 16:42:41 +0000 |
| commit | e2c5dbb2cc022034a54b1207310eff43be93ce85 (patch) | |
| tree | 53c71082cf67f6847f8611fcd5f09fb11c9a8d37 /test/network | |
| parent | 92bad78a6aebb9abeac8e734b5ce56b88e21cdda (diff) | |
| download | puppet-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')
| -rwxr-xr-x | test/network/client/master.rb | 6 | ||||
| -rwxr-xr-x | test/network/handler/master.rb | 15 | ||||
| -rwxr-xr-x | test/network/handler/runner.rb | 5 |
3 files changed, 18 insertions, 8 deletions
diff --git a/test/network/client/master.rb b/test/network/client/master.rb index 221c2409f..c9f785580 100755 --- a/test/network/client/master.rb +++ b/test/network/client/master.rb @@ -595,8 +595,10 @@ end facts = master.class.facts assert_equal("two", Facter.value(:testfact), "fact did not change") - assert(master.facts_changed?(facts), "master does not think facts changed") - assert(! master.fresh?(facts), "master is considered fresh after facts changed") + assert(master.send(:facts_changed?, facts), + "master does not think facts changed") + assert(! master.fresh?(facts), + "master is considered fresh after facts changed") assert_nothing_raised("Could not recompile when facts changed") do master.getconfig 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 |
