diff options
| author | Luke Kanies <luke@madstop.com> | 2007-11-18 11:21:22 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-11-18 11:21:22 -0600 |
| commit | c19835ce9f8a5138b30a1a32ca741c996b0916d2 (patch) | |
| tree | 1a7b05839f013cc8a610f7c9493e206606fab977 /test/network/handler | |
| parent | 9290cc89a2206fb5204578f8e91208857a48b147 (diff) | |
| download | puppet-c19835ce9f8a5138b30a1a32ca741c996b0916d2.tar.gz puppet-c19835ce9f8a5138b30a1a32ca741c996b0916d2.tar.xz puppet-c19835ce9f8a5138b30a1a32ca741c996b0916d2.zip | |
Fixed most failing tests, but there are still over thirty failing.
At this point, I'm holding the experiment until after the release,
so I'm committing this for now and will take it back up after 0.24.0
is out.
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, 14 insertions, 10 deletions
diff --git a/test/network/handler/fileserver.rb b/test/network/handler/fileserver.rb index 3539169dc..8703700ea 100755 --- a/test/network/handler/fileserver.rb +++ b/test/network/handler/fileserver.rb @@ -8,6 +8,11 @@ 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" @@ -146,10 +151,6 @@ 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 @@ -943,10 +944,11 @@ allow * end # Now, check that they use Facter info - Puppet.notice "The following messages are normal" + Facter.stubs(:value).with("hostname").returns("myhost") + Facter.stubs(:value).with("domain").returns("mydomain") + local = "myhost" + domain = "mydomain" client = nil - local = Facter["hostname"].value - domain = Facter["domain"].value fqdn = [local, domain].join(".") {"%h" => local, # Short name "%H" => fqdn, # Full name @@ -954,6 +956,7 @@ allow * "%%" => "%", # escape "%o" => "%o" # other }.each do |pat, repl| + Puppet.expects(:notice) check.call(client, pat, repl) end @@ -1132,6 +1135,8 @@ 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 0d6373160..247014a47 100755 --- a/test/network/handler/resource.rb +++ b/test/network/handler/resource.rb @@ -3,10 +3,12 @@ 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) @@ -179,9 +181,6 @@ 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 |
