diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2005-10-25 19:49:22 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2005-10-25 19:49:22 +0000 |
| commit | a8645a4330b91932c5658eeffa01b446e2ee657a (patch) | |
| tree | 726f1be551ed0e70783015186a9dbfea0184a7af /test | |
| parent | df8dbbacb09b69c97aee0b76668fd3e56860eb38 (diff) | |
| download | puppet-a8645a4330b91932c5658eeffa01b446e2ee657a.tar.gz puppet-a8645a4330b91932c5658eeffa01b446e2ee657a.tar.xz puppet-a8645a4330b91932c5658eeffa01b446e2ee657a.zip | |
Further small bug fixes towards running puppet on my network
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@729 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
| -rwxr-xr-x | test/language/interpreter.rb | 42 | ||||
| -rwxr-xr-x | test/puppet/utiltest.rb (renamed from test/puppet/util.rb) | 0 |
2 files changed, 42 insertions, 0 deletions
diff --git a/test/language/interpreter.rb b/test/language/interpreter.rb index a37d0d95a..9dbf8dc99 100755 --- a/test/language/interpreter.rb +++ b/test/language/interpreter.rb @@ -17,6 +17,18 @@ class TestInterpreter < Test::Unit::TestCase include TestPuppet AST = Puppet::Parser::AST + # create a simple manifest that uses nodes to create a file + def mknodemanifest(node, file) + createdfile = tempfile() + + File.open(file, "w") { |f| + f.puts "node %s { file { \"%s\": create => true, mode => 755 } }\n" % + [node, createdfile] + } + + return [file, createdfile] + end + def test_simple file = tempfile() File.open(file, "w") { |f| @@ -26,4 +38,34 @@ class TestInterpreter < Test::Unit::TestCase Puppet::Parser::Interpreter.new(:Manifest => file) } end + + def test_reloadfiles + hostname = Facter["hostname"].value + + file = tempfile() + + # Create a first version + createdfile = mknodemanifest(hostname, file) + + interp = nil + assert_nothing_raised { + interp = Puppet::Parser::Interpreter.new(:Manifest => file) + } + + config = nil + assert_nothing_raised { + config = interp.run(hostname, {}) + } + sleep(1) + + # Now create a new file + createdfile = mknodemanifest(hostname, file) + + newconfig = nil + assert_nothing_raised { + newconfig = interp.run(hostname, {}) + } + + assert(config != newconfig, "Configs are somehow the same") + end end diff --git a/test/puppet/util.rb b/test/puppet/utiltest.rb index 64eb07d17..64eb07d17 100755 --- a/test/puppet/util.rb +++ b/test/puppet/utiltest.rb |
