diff options
author | Luke Kanies <luke@madstop.com> | 2007-11-27 18:37:46 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2007-11-27 18:37:46 -0600 |
commit | 4e52ffc68045b07a1308ff7a679fb301c937884e (patch) | |
tree | 03d241142f92e7397de8621015174eeab4f7f9f0 /test/network/handler | |
parent | 168fa5f912b0b15dbd3773a23649093e69e3d185 (diff) | |
download | puppet-4e52ffc68045b07a1308ff7a679fb301c937884e.tar.gz puppet-4e52ffc68045b07a1308ff7a679fb301c937884e.tar.xz puppet-4e52ffc68045b07a1308ff7a679fb301c937884e.zip |
Fixing #796 -- the fileserver can now start with no
configuration file (it creates both default mount points
if it does) and puppetmasterd no longer requires the
configuration file to exist.
Diffstat (limited to 'test/network/handler')
-rwxr-xr-x | test/network/handler/fileserver.rb | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/test/network/handler/fileserver.rb b/test/network/handler/fileserver.rb index 962d35e65..233e705c6 100755 --- a/test/network/handler/fileserver.rb +++ b/test/network/handler/fileserver.rb @@ -970,12 +970,16 @@ allow * } dir = tempfile() + Facter.stubs(:value).with(:ipaddress).returns("127.0.0.1") + Facter.stubs(:value).with { |v| v.to_s == "hostname" }.returns("myhost") + Facter.stubs(:value).with { |v| v.to_s == "domain" }.returns("mydomain.com") + Facter.stubs(:value).with(:domain).returns("mydomain.com") ip = Facter.value(:ipaddress) Dir.mkdir(dir) - host = "host.domain.com" + host = "myhost.mydomain.com" { - "%H" => "host.domain.com", "%h" => "host", "%d" => "domain.com" + "%H" => "myhost.mydomain.com", "%h" => "myhost", "%d" => "mydomain.com" }.each do |pattern, string| file = File.join(dir, string) mount = File.join(dir, pattern) @@ -1147,6 +1151,23 @@ allow * } end end + + def test_can_start_without_configuration + Puppet[:fileserverconfig] = tempfile + assert_nothing_raised("Could not create fileserver when configuration is absent") do + server = Puppet::Network::Handler::FileServer.new( + :Local => false + ) + end + end + + def test_creates_default_mounts_when_no_configuration_is_available + Puppet[:fileserverconfig] = tempfile + server = Puppet::Network::Handler::FileServer.new(:Local => false) + + assert(server.mounted?("plugins"), "Did not create default plugins mount when missing configuration file") + assert(server.mounted?("modules"), "Did not create default modules mount when missing configuration file") + end end |