diff options
author | James Turnbull <james@lovedthanlost.net> | 2008-02-23 08:41:24 +1100 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2008-02-23 08:41:24 +1100 |
commit | 5d35bc5904a09bc07a11039500c59021bafaee7e (patch) | |
tree | 5d0980bfb8ce1a2d9d5e244046846617a040a3cb /test | |
parent | 7976015389149defd7f135a859ab11b94e6aad11 (diff) | |
download | puppet-5d35bc5904a09bc07a11039500c59021bafaee7e.tar.gz puppet-5d35bc5904a09bc07a11039500c59021bafaee7e.tar.xz puppet-5d35bc5904a09bc07a11039500c59021bafaee7e.zip |
Fixes #1078 and includes new test
Diffstat (limited to 'test')
-rwxr-xr-x | test/network/client/master.rb | 18 |
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()] |