summaryrefslogtreecommitdiffstats
path: root/test/network
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-03-25 18:18:34 -0500
committerLuke Kanies <luke@madstop.com>2008-03-25 18:18:34 -0500
commita8592f1009040ebf30a98268610915cc33bb3f63 (patch)
tree49f61323a8536d58ce332e97b882677f55727df7 /test/network
parente1907798425a7b163ac1b831b0cf11e88985815e (diff)
parent491a69682728818e04b8a20a5d8f4f783ad6ddaf (diff)
downloadpuppet-a8592f1009040ebf30a98268610915cc33bb3f63.tar.gz
puppet-a8592f1009040ebf30a98268610915cc33bb3f63.tar.xz
puppet-a8592f1009040ebf30a98268610915cc33bb3f63.zip
Merge branch '0.24.x'
Conflicts: install.rb lib/puppet/defaults.rb man/man8/puppet.8
Diffstat (limited to 'test/network')
-rwxr-xr-xtest/network/client/client.rb29
-rwxr-xr-xtest/network/client/master.rb29
-rwxr-xr-xtest/network/handler/master.rb4
3 files changed, 33 insertions, 29 deletions
diff --git a/test/network/client/client.rb b/test/network/client/client.rb
index b6b915d31..5f96cac11 100755
--- a/test/network/client/client.rb
+++ b/test/network/client/client.rb
@@ -140,35 +140,6 @@ class TestClient < Test::Unit::TestCase
}
end
- def test_classfile
- Puppet[:code] = "class yaytest {}\n class bootest {}\n include yaytest, bootest"
-
- Puppet::Node::Facts.indirection.stubs(:save)
-
- master = client = nil
- assert_nothing_raised() {
- master = Puppet::Network::Handler.master.new(
- :Local => false
- )
- }
- assert_nothing_raised() {
- client = Puppet::Network::Client.master.new(
- :Master => master
- )
- }
-
- # Fake that it's local, so it creates the class file
- client.local = false
-
- # We can't guarantee class ordering
- client.expects(:setclasses).with do |array|
- array.length == 2 and array.include?("yaytest") and array.include?("bootest")
- end
- assert_nothing_raised {
- client.getconfig
- }
- end
-
def test_client_loading
# Make sure we don't get a failure but that we also get nothing back
assert_nothing_raised do
diff --git a/test/network/client/master.rb b/test/network/client/master.rb
index 28e7b8968..14c7dd852 100755
--- a/test/network/client/master.rb
+++ b/test/network/client/master.rb
@@ -576,4 +576,33 @@ end
# Doesn't throw an exception, but definitely fails.
client.run
end
+
+ def test_classfile
+ Puppet[:code] = "class yaytest {}\n class bootest {}\n include yaytest, bootest"
+
+ Puppet::Node::Facts.indirection.stubs(:save)
+
+ master = client = nil
+ assert_nothing_raised() {
+ master = Puppet::Network::Handler.master.new(
+ :Local => false
+ )
+ }
+ assert_nothing_raised() {
+ client = Puppet::Network::Client.master.new(
+ :Master => master
+ )
+ }
+
+ # Fake that it's local, so it creates the class file
+ client.local = false
+
+ # We can't guarantee class ordering
+ client.expects(:setclasses).with do |array|
+ array.length == 2 and array.include?("yaytest") and array.include?("bootest")
+ end
+ assert_nothing_raised {
+ client.getconfig
+ }
+ end
end
diff --git a/test/network/handler/master.rb b/test/network/handler/master.rb
index 88bfe6b7e..55522237b 100755
--- a/test/network/handler/master.rb
+++ b/test/network/handler/master.rb
@@ -90,11 +90,15 @@ class TestMaster < Test::Unit::TestCase
resname, resip = master.send(:clientname, nil, nil, facts)
assert_equal(facts["hostname"], resname, "Did not use fact hostname when no certname was present")
assert_equal(facts["ipaddress"], resip, "Did not use fact ip when no certname was present")
+ assert_equal(facts["domain"], "fact_domain", "Did not use fact domain when no certname was present")
+ assert_equal(facts["fqdn"], "fact_hostname.fact_domain", "Did not use fact fqdn when no certname was present")
# Now try it with the cert stuff present
resname, resip = master.send(:clientname, certname, certip, facts)
assert_equal(certname, resname, "Did not use cert hostname when certname was present")
assert_equal(certip, resip, "Did not use cert ip when certname was present")
+ assert_equal(facts["domain"], certdomain, "Did not use cert domain when certname was present")
+ assert_equal(facts["fqdn"], certname, "Did not use cert fqdn when certname was present")
# And reset the node_name stuff and make sure we use it.
Puppet[:node_name] = :facter