summaryrefslogtreecommitdiffstats
path: root/test/server
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-01-18 21:30:56 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-01-18 21:30:56 +0000
commit0cb51f3f7fb442b1b915523c93461b9a24febacb (patch)
tree578660289fa846e32450ff36e6ea5d524e7ba180 /test/server
parentf49b1030fc6f81c1776e09d8ce5e9134c828a77a (diff)
Fixing a small checksumming bug, reorganizing the client stuff a bit, and adding freshness checking for the configuration, so the config is recompiled every time nor is it downloaded unless it has been recompiled
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@845 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/server')
-rw-r--r--test/server/master.rb33
1 files changed, 31 insertions, 2 deletions
diff --git a/test/server/master.rb b/test/server/master.rb
index a300a18a4..4ece12a87 100644
--- a/test/server/master.rb
+++ b/test/server/master.rb
@@ -114,7 +114,7 @@ class TestMaster < Test::Unit::TestCase
:File => manifest,
:UseNodes => false,
:Local => true,
- :FileTimeout => 0.5
+ :FileTimeout => 15
)
}
assert_nothing_raised() {
@@ -123,23 +123,52 @@ class TestMaster < Test::Unit::TestCase
)
}
+ # 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_nothing_raised {
client.getconfig
client.apply
}
+ # Now it should be up to date
+ assert(client.fresh?, "Client is not up to date")
+
+ # Cache this value for later
+ parse1 = master.freshness
+
+ # Verify the config got applied
assert(FileTest.exists?(@createdfile),
"Created file %s does not exist" % @createdfile)
- sleep 1
Puppet::Type.allclear
+ sleep 1.5
+ # Create a new manifest
File.open(manifest, "w") { |f|
f.puts "file { \"%s\": ensure => file }\n" % file2
}
+
+ # 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_nothing_raised("Could not resent the file timeout") {
+ master.filetimeout = 0
+ }
+ assert_equal(0, master.filetimeout)
+
+ # 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")
+
+ # Retrieve and apply the new config
assert_nothing_raised {
client.getconfig
client.apply
}
+ assert(client.fresh?, "Client is not up to date")
assert(FileTest.exists?(file2), "Second file %s does not exist" % file2)
end