diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-09-19 04:03:01 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-09-19 04:03:01 +0000 |
commit | 94762e1ef4d935d3c1a0c2621e7be7230da21c07 (patch) | |
tree | 09952b41736b7d84713026d103b5a1c6e028aa6b /test/language/interpreter.rb | |
parent | 176d483efa052754f38ab15f1592a630da8d6cb7 (diff) | |
download | puppet-94762e1ef4d935d3c1a0c2621e7be7230da21c07.tar.gz puppet-94762e1ef4d935d3c1a0c2621e7be7230da21c07.tar.xz puppet-94762e1ef4d935d3c1a0c2621e7be7230da21c07.zip |
Trying to fix a bug where files other than site.pp do not get noticed for reparsing
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1621 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/language/interpreter.rb')
-rwxr-xr-x | test/language/interpreter.rb | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/test/language/interpreter.rb b/test/language/interpreter.rb index 51ee1e5f4..36fd5922b 100755 --- a/test/language/interpreter.rb +++ b/test/language/interpreter.rb @@ -349,4 +349,51 @@ class nothernode {} end + + def test_parsedate + Puppet[:filetimeout] = 0 + main = tempfile() + sub = tempfile() + mainfile = tempfile() + subfile = tempfile() + count = 0 + updatemain = proc do + count += 1 + File.open(main, "w") { |f| + f.puts "import '#{sub}' + file { \"#{mainfile}\": content => #{count} } + " + } + end + updatesub = proc do + count += 1 + File.open(sub, "w") { |f| + f.puts "file { \"#{subfile}\": content => #{count} } + " + } + end + + updatemain.call + updatesub.call + + interp = Puppet::Parser::Interpreter.new( + :Manifest => main, + :Local => true + ) + + date = interp.parsedate + + # Now update the site file and make sure we catch it + sleep 1 + updatemain.call + newdate = interp.parsedate + assert(date != newdate, "Parsedate was not updated") + date = newdate + + # And then the subfile + sleep 1 + updatesub.call + newdate = interp.parsedate + assert(date != newdate, "Parsedate was not updated") + end end |