diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-07-31 22:25:59 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-07-31 22:25:59 +0000 |
| commit | f974ffc950235e55274a3abf4bc360af4557d5c8 (patch) | |
| tree | a87e84d06c3c53b7667700a102934fc9bc05467c /test/server | |
| parent | eb8c6878c37bf32dc2a7079ce1b0b959774d6fde (diff) | |
| download | puppet-f974ffc950235e55274a3abf4bc360af4557d5c8.tar.gz puppet-f974ffc950235e55274a3abf4bc360af4557d5c8.tar.xz puppet-f974ffc950235e55274a3abf4bc360af4557d5c8.zip | |
Fixing the master server so that it always uses the Facter hostname, not the cert or IP hostname.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1433 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/server')
| -rw-r--r-- | test/server/master.rb | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/server/master.rb b/test/server/master.rb index 18e23311c..dd2b283bd 100644 --- a/test/server/master.rb +++ b/test/server/master.rb @@ -195,6 +195,45 @@ class TestMaster < Test::Unit::TestCase assert(facts.include?(fact), "Fact %s was not set" % fact) end end + + # Make sure we're using the facter hostname + def test_facterhostname_in_getconfig + master = nil + file = tempfile() + #@createdfile = File.join(tmpdir(), self.class.to_s + "manifesttesting" + + # "_" + @method_name) + nope = tempfile() + yep = tempfile() + + fakename = "y4yn3ss" + realname = Facter["hostname"].value + + File.open(file, "w") { |f| + f.puts %{ + node #{fakename} { file { "#{nope}": ensure => file, mode => 755 } } + node #{realname} { file { "#{yep}": ensure => file, mode => 755 } } +} + } + # create our master + assert_nothing_raised() { + # this is the default server setup + master = Puppet::Server::Master.new( + :Manifest => file, + :UseNodes => true, + :Local => true + ) + } + + result = nil + assert_nothing_raised { + result = master.getconfig({"hostname" => realname}, "yaml", fakename, "127.0.0.1") + } + + result = result.flatten + + assert(result.find { |obj| obj.name == yep }, + "Could not find correct file") + end end # $Id$ |
