summaryrefslogtreecommitdiffstats
path: root/test/network
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-10-17 09:01:04 -0500
committerLuke Kanies <luke@madstop.com>2008-10-17 09:01:04 -0500
commit8aee40de69e6fe8d67ab58a2e223443b15820584 (patch)
tree89e230df3b43302a542f2cb6869f63e2fb93f6d8 /test/network
parent1b517d2fb048603bd1743a662bde74e8ae4b13dc (diff)
parenta74ec60d33dee1c592ec858faeccc23d7a7b79f3 (diff)
downloadpuppet-8aee40de69e6fe8d67ab58a2e223443b15820584.tar.gz
puppet-8aee40de69e6fe8d67ab58a2e223443b15820584.tar.xz
puppet-8aee40de69e6fe8d67ab58a2e223443b15820584.zip
Merge branch '0.24.x' Removed the 'after' blocks that call Type.clear,
since that method is deprecated. Conflicts: CHANGELOG bin/puppetca lib/puppet/file_serving/fileset.rb lib/puppet/network/xmlrpc/client.rb lib/puppet/type/file/selcontext.rb spec/unit/file_serving/metadata.rb spec/unit/type/file.rb
Diffstat (limited to 'test/network')
-rwxr-xr-xtest/network/client/master.rb8
-rwxr-xr-xtest/network/handler/fileserver.rb8
-rwxr-xr-xtest/network/handler/master.rb4
3 files changed, 13 insertions, 7 deletions
diff --git a/test/network/client/master.rb b/test/network/client/master.rb
index 24c7b6374..e27b7a3a2 100755
--- a/test/network/client/master.rb
+++ b/test/network/client/master.rb
@@ -402,12 +402,9 @@ end
client.send(:splay)
end
- time = Puppet::Util::Storage.cache(:configuration)[:splay_time]
- assert(time, "Splay time was not cached")
-
# Now try it again
client = mkclient
- client.expects(:sleep).with(time)
+ client.expects(:sleep)
assert_nothing_raised("Failed to call sleep when splay is true with a cached value") do
client.send(:splay)
@@ -419,8 +416,7 @@ end
assert_equal(facts["environment"], Puppet[:environment], "Did not add environment to client facts")
# Now set it to a real value
- Puppet[:environments] = "something,else"
- Puppet[:environment] = "something"
+ Puppet[:environment] = "something"
facts = Puppet::Network::Client::Master.facts
assert_equal(facts["environment"], Puppet[:environment], "Did not add environment to client facts")
end
diff --git a/test/network/handler/fileserver.rb b/test/network/handler/fileserver.rb
index b3a9aef2b..1046617ec 100755
--- a/test/network/handler/fileserver.rb
+++ b/test/network/handler/fileserver.rb
@@ -433,6 +433,14 @@ class TestFileServer < Test::Unit::TestCase
assert_nil(retval, "Description of non-existent mounts returned a value")
end
+ def test_describe_does_not_fail_when_mount_does_not_find_file
+ server = Puppet::Network::Handler.fileserver.new(:Local => true, :Config => false)
+
+ assert_nothing_raised("Failed when describing missing plugins") do
+ server.describe "/plugins"
+ end
+ end
+
# test that our config file is parsing and working as planned
def test_configfile
server = nil
diff --git a/test/network/handler/master.rb b/test/network/handler/master.rb
index bbdc021b9..0de38414a 100755
--- a/test/network/handler/master.rb
+++ b/test/network/handler/master.rb
@@ -25,7 +25,9 @@ class TestMaster < Test::Unit::TestCase
now1 = mock 'now1'
Time.expects(:now).returns(now1)
- assert_equal(@master.freshness, now1, "Did not return current time as freshness")
+ now1.expects(:to_i).returns 10
+
+ assert_equal(@master.freshness, 10, "Did not return current time as freshness")
end
def test_hostname_is_used_if_client_is_missing