From 94762e1ef4d935d3c1a0c2621e7be7230da21c07 Mon Sep 17 00:00:00 2001 From: luke Date: Tue, 19 Sep 2006 04:03:01 +0000 Subject: 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 --- test/language/interpreter.rb | 47 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'test/language/interpreter.rb') 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 -- cgit