diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-03-19 01:42:10 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-03-19 01:42:10 +0000 |
| commit | 5f7ae353a0ca9cadaf8fdc8803e1227ee6583d25 (patch) | |
| tree | 840d708a742ab0234be7f55f3cf478a526a5f6a3 /test | |
| parent | a2a9d93fd3f9de6d4c6d13ca8d99c2d496a39e40 (diff) | |
| download | puppet-5f7ae353a0ca9cadaf8fdc8803e1227ee6583d25.tar.gz puppet-5f7ae353a0ca9cadaf8fdc8803e1227ee6583d25.tar.xz puppet-5f7ae353a0ca9cadaf8fdc8803e1227ee6583d25.zip | |
Fixing #519. The facts are now cached in the state file and changes to them force a recompile.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2303 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
| -rwxr-xr-x | test/network/client/master.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/network/client/master.rb b/test/network/client/master.rb index 593c331ce..12f25820a 100755 --- a/test/network/client/master.rb +++ b/test/network/client/master.rb @@ -567,6 +567,35 @@ end assert(! @logs.detect { |l| l.message =~ /Could not load/}, "Tried to load cache when it is non-existent") end + + # #519 - cache the facts so that we notice if they change. + def test_factchanges_cause_recompile + $value = "one" + Facter.add(:testfact) do + setcode { $value } + end + assert_equal("one", Facter.value(:testfact), "fact was not set correctly") + master = mkclient + master.local = false + driver = master.send(:instance_variable_get, "@driver") + driver.local = false + + assert_nothing_raised("Could not compile config") do + master.getconfig + end + + $value = "two" + Facter.clear + Facter.loadfacts + Facter.add(:testfact) do + setcode { $value } + end + assert_equal("two", Facter.value(:testfact), "fact did not change") + + assert(master.facts_changed?, "master does not think facts changed") + assert(! master.fresh?, "master is considered fresh after facts changed") + + end end # $Id$ |
