summaryrefslogtreecommitdiffstats
path: root/test/network/client
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-09-06 20:50:26 -0500
committerLuke Kanies <luke@madstop.com>2007-09-06 20:50:26 -0500
commitcaad11a9d15210017f75918b50184bc12f2cc1d0 (patch)
tree27e3262179eb45017ef27b93b2ce492c321cf331 /test/network/client
parent7abc78ad25979c62b585127a8f2a32c55e96819f (diff)
downloadpuppet-caad11a9d15210017f75918b50184bc12f2cc1d0.tar.gz
puppet-caad11a9d15210017f75918b50184bc12f2cc1d0.tar.xz
puppet-caad11a9d15210017f75918b50184bc12f2cc1d0.zip
Fixing some broken tests in the master client, and adding a test for #800 but it is unfortunately disabled because we cannot realistically fix it using the current design. It will be easy after the REST refactor, though.
Diffstat (limited to 'test/network/client')
-rwxr-xr-xtest/network/client/master.rb53
1 files changed, 30 insertions, 23 deletions
diff --git a/test/network/client/master.rb b/test/network/client/master.rb
index 7896d4019..a29254d16 100755
--- a/test/network/client/master.rb
+++ b/test/network/client/master.rb
@@ -45,30 +45,23 @@ class TestMasterClient < Test::Unit::TestCase
@master = Puppet::Network::Client.master
end
- def mkmaster(file = nil)
- master = nil
-
- file ||= mktestmanifest()
+ def mkmaster(options = {})
+ options[:UseNodes] = false
+ options[:Local] = true
+ unless options[:Code]
+ options[:Manifest] ||= mktestmanifest
+ end
# create our master
- assert_nothing_raised() {
- # this is the default server setup
- master = Puppet::Network::Handler.master.new(
- :Manifest => file,
- :UseNodes => false,
- :Local => true
- )
- }
+ # this is the default server setup
+ master = Puppet::Network::Handler.master.new(options)
return master
end
def mkclient(master = nil)
master ||= mkmaster()
- client = nil
- assert_nothing_raised() {
- client = Puppet::Network::Client.master.new(
- :Master => master
- )
- }
+ client = Puppet::Network::Client.master.new(
+ :Master => master
+ )
return client
end
@@ -183,7 +176,7 @@ class TestMasterClient < Test::Unit::TestCase
FileUtils.mkdir_p(Puppet[:statedir])
manifest = mktestmanifest
- master = mkmaster(manifest)
+ master = mkmaster(:Manifest => manifest)
client = mkclient(master)
@@ -448,7 +441,7 @@ end
manifest = tempfile()
File.open(manifest, "w") { |f| f.puts "file { '#{file}': content => yay }" }
- driver = mkmaster(manifest)
+ driver = mkmaster(:Manifest => manifest)
driver.local = false
master = mkclient(driver)
@@ -532,7 +525,6 @@ end
master.local = false
driver = master.send(:instance_variable_get, "@driver")
driver.local = false
- driver.send(:config_handler).local = false
# Retrieve the configuration
master.getconfig
@@ -720,6 +712,21 @@ end
client.run
end
end
-end
-# $Id$
+ # #800 -- we cannot fix this using the current design.
+ def disabled_test_invalid_relationships_do_not_get_cached
+ # Make a master with an invalid relationship
+ master = mkmaster :Code => "notify { one: require => File[yaytest] }"
+ master.local = false # so it gets cached
+ client = mkclient(master)
+ client.local = false
+
+ client.getconfig
+ # Doesn't throw an exception, but definitely fails.
+ client.apply
+
+ # Make sure the config is not cached.
+ config = Puppet.config[:localconfig] + ".yaml"
+ assert(! File.exists?(config), "Cached an invalid configuration")
+ end
+end