summaryrefslogtreecommitdiffstats
path: root/test/client
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-10-09 22:51:55 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-10-09 22:51:55 +0000
commitb5344f2acbf447be853af78f34a4b1562ae060f2 (patch)
tree01094480b5eaa63e3792b9b489b102dbab3793e7 /test/client
parent8f9264bcc30312cc927eac72c66415eae7b69e88 (diff)
downloadpuppet-b5344f2acbf447be853af78f34a4b1562ae060f2.tar.gz
puppet-b5344f2acbf447be853af78f34a4b1562ae060f2.tar.xz
puppet-b5344f2acbf447be853af78f34a4b1562ae060f2.zip
Fixing the problem reported by Adnet Ghislain where facts do not load on later runs.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1757 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/client')
-rw-r--r--test/client/master.rb19
1 files changed, 17 insertions, 2 deletions
diff --git a/test/client/master.rb b/test/client/master.rb
index c2277b8e4..096918918 100644
--- a/test/client/master.rb
+++ b/test/client/master.rb
@@ -190,6 +190,7 @@ end
def test_getfacts
Puppet[:factsource] = tempfile()
Dir.mkdir(Puppet[:factsource])
+ hostname = Facter.value(:hostname)
myfact = File.join(Puppet[:factsource], "myfact.rb")
File.open(myfact, "w") do |f|
@@ -207,7 +208,9 @@ end
assert(File.exists?(destfile), "Did not get fact")
- assert_equal("yayness", Facter["myfact"].value,
+ assert_equal(hostname, Facter.value(:hostname),
+ "Lost value to hostname")
+ assert_equal("yayness", Facter.value(:myfact),
"Did not get correct fact value")
# Now modify the file and make sure the type is replaced
@@ -222,8 +225,20 @@ end
Puppet::Client::MasterClient.getfacts
}
- assert_equal("funtest", Facter["myfact"].value,
+ assert_equal("funtest", Facter.value(:myfact),
"Did not reload fact")
+ assert_equal(hostname, Facter.value(:hostname),
+ "Lost value to hostname")
+
+ # Now run it again and make sure the fact still loads
+ assert_nothing_raised {
+ Puppet::Client::MasterClient.getfacts
+ }
+
+ assert_equal("funtest", Facter.value(:myfact),
+ "Did not reload fact")
+ assert_equal(hostname, Facter.value(:hostname),
+ "Lost value to hostname")
end
# Make sure we load all facts on startup.