diff options
| author | Luke Kanies <luke@madstop.com> | 2007-11-19 01:36:48 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-11-19 01:36:48 -0600 |
| commit | 2b14f627aca1d5be69cf6606044df4d6e67f6eba (patch) | |
| tree | a20db3a608af483f598f482e743868413da8fd8f /test/network/handler | |
| parent | 9cf477b6cc771eab7bd29d18c49128571e877987 (diff) | |
| download | puppet-2b14f627aca1d5be69cf6606044df4d6e67f6eba.tar.gz puppet-2b14f627aca1d5be69cf6606044df4d6e67f6eba.tar.xz puppet-2b14f627aca1d5be69cf6606044df4d6e67f6eba.zip | |
Reverting the changes I'd made toward removing the global
resources. These are commits:
c19835ce9f8a5138b30a1a32ca741c996b0916d2
9290cc89a2206fb5204578f8e91208857a48b147
ffb4c2dbc7314b364d25e4f7be599ef05b767b44
Diffstat (limited to 'test/network/handler')
| -rwxr-xr-x | test/network/handler/fileserver.rb | 19 | ||||
| -rwxr-xr-x | test/network/handler/resource.rb | 5 |
2 files changed, 10 insertions, 14 deletions
diff --git a/test/network/handler/fileserver.rb b/test/network/handler/fileserver.rb index 8703700ea..3539169dc 100755 --- a/test/network/handler/fileserver.rb +++ b/test/network/handler/fileserver.rb @@ -8,11 +8,6 @@ require 'puppet/network/handler/fileserver' class TestFileServer < Test::Unit::TestCase include PuppetTest - def setup - super - Facter.stubs(:to_hash).returns({}) - end - def mkmount(path = nil) mount = nil name = "yaytest" @@ -151,6 +146,10 @@ class TestFileServer < Test::Unit::TestCase list = server.list(sfile, :ignore, true, false) } + assert_nothing_raised { + file = Puppet.type(:file)[tmpfile] + } + output = "/\tfile" # verify it got listed as a file @@ -944,11 +943,10 @@ allow * end # Now, check that they use Facter info - Facter.stubs(:value).with("hostname").returns("myhost") - Facter.stubs(:value).with("domain").returns("mydomain") - local = "myhost" - domain = "mydomain" + Puppet.notice "The following messages are normal" client = nil + local = Facter["hostname"].value + domain = Facter["domain"].value fqdn = [local, domain].join(".") {"%h" => local, # Short name "%H" => fqdn, # Full name @@ -956,7 +954,6 @@ allow * "%%" => "%", # escape "%o" => "%o" # other }.each do |pat, repl| - Puppet.expects(:notice) check.call(client, pat, repl) end @@ -1135,8 +1132,6 @@ allow * def test_failures # create a server with the file server = nil - Facter.stubs(:[]).with("hostname").returns("myhost") - Facter.stubs(:[]).with("domain").returns("mydomain") config = tempfile [ diff --git a/test/network/handler/resource.rb b/test/network/handler/resource.rb index 247014a47..0d6373160 100755 --- a/test/network/handler/resource.rb +++ b/test/network/handler/resource.rb @@ -3,12 +3,10 @@ require File.dirname(__FILE__) + '/../../lib/puppettest' require 'puppettest' -require 'puppettest/support/utils' require 'base64' require 'cgi' class TestResourceServer < Test::Unit::TestCase - include PuppetTest include PuppetTest::ServerTest def verify_described(type, described) @@ -181,6 +179,9 @@ class TestResourceServer < Test::Unit::TestCase require 'etc' + # Make the example schedules, for testing + Puppet::Type.type(:schedule).mkdefaultschedules + Puppet::Type.eachtype do |type| unless type.respond_to? :instances Puppet.warning "%s does not respond to :instances" % type.name |
