summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2008-02-23 08:41:24 +1100
committerJames Turnbull <james@lovedthanlost.net>2008-02-23 08:41:24 +1100
commit5d35bc5904a09bc07a11039500c59021bafaee7e (patch)
tree5d0980bfb8ce1a2d9d5e244046846617a040a3cb /test
parent7976015389149defd7f135a859ab11b94e6aad11 (diff)
downloadpuppet-5d35bc5904a09bc07a11039500c59021bafaee7e.tar.gz
puppet-5d35bc5904a09bc07a11039500c59021bafaee7e.tar.xz
puppet-5d35bc5904a09bc07a11039500c59021bafaee7e.zip
Fixes #1078 and includes new test
Diffstat (limited to 'test')
-rwxr-xr-xtest/network/client/master.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/network/client/master.rb b/test/network/client/master.rb
index 696d08bfd..67c47fa6d 100755
--- a/test/network/client/master.rb
+++ b/test/network/client/master.rb
@@ -211,6 +211,24 @@ end
"Lost value to hostname")
end
+ # Make sure that setting environment by fact takes precedence to configuration
+ def test_setenvironmentwithfact
+ name = "environment"
+ value = "test_environment"
+
+ Puppet[:filetimeout] = -1
+ Puppet[:factsource] = tempfile()
+ Dir.mkdir(Puppet[:factsource])
+ file = File.join(Puppet[:factsource], "#{name}.rb")
+ File.open(file, "w") do |f|
+ f.puts %{Facter.add("#{name}") do setcode { "#{value}" } end }
+ end
+
+ Puppet::Network::Client.master.getfacts
+
+ assert_equal(value, Puppet::Network::Client.master.facts[name])
+ end
+
# Make sure we load all facts on startup.
def test_loadfacts
dirs = [tempfile(), tempfile()]