diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2005-08-29 22:53:44 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2005-08-29 22:53:44 +0000 |
| commit | 8a99636cb9f048bfbbd8b956a15ec84ae68d34f0 (patch) | |
| tree | 6982c84d50c3e195d2cf76286a4112a8d4767533 /test | |
| parent | f65563d3d6eddeeac5f1b14e7b2635776be802a7 (diff) | |
| download | puppet-8a99636cb9f048bfbbd8b956a15ec84ae68d34f0.tar.gz puppet-8a99636cb9f048bfbbd8b956a15ec84ae68d34f0.tar.xz puppet-8a99636cb9f048bfbbd8b956a15ec84ae68d34f0.zip | |
adding a "--noop" option along with a test case for it
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@607 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
| -rwxr-xr-x | test/executables/tc_puppetd.rb | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/test/executables/tc_puppetd.rb b/test/executables/tc_puppetd.rb index 0a0556c41..238133856 100755 --- a/test/executables/tc_puppetd.rb +++ b/test/executables/tc_puppetd.rb @@ -73,14 +73,15 @@ class TestPuppetDExe < Test::Unit::TestCase def test_normalstart file = "/tmp/testingmanifest.pp" + mkfile = "/tmp/puppetdtesting" File.open(file, "w") { |f| - f.puts ' -file { "/tmp/puppetdtesting": create => true, mode => 755 } -' + f.puts %{ +file { "#{mkfile}": create => true, mode => 755 } +} } @@tmpfiles << file - @@tmpfiles << "/tmp/puppetdtesting" + @@tmpfiles << mkfile port = 8235 startmaster(file, port) output = nil @@ -89,15 +90,28 @@ file { "/tmp/puppetdtesting": create => true, mode => 755 } client = Puppet::Client.new(:Server => "localhost") fqdn = client.fqdn.sub(/^\w+\./, "testing.") assert_nothing_raised { - output = %x{puppetd --fqdn #{fqdn} --port #{port} --ssldir #{ssldir} --server localhost}.chomp + output = %x{puppetd --verbose --fqdn #{fqdn} --port #{port} --ssldir #{ssldir} --server localhost}.chomp } sleep 1 assert($? == 0, "Puppetd exited with code %s" % $?) #puts output - assert_equal("", output, "Puppetd produced output %s" % output) + #assert_equal("", output, "Puppetd produced output %s" % output) - assert(FileTest.exists?("/tmp/puppetdtesting"), + assert(FileTest.exists?(mkfile), "Failed to create config'ed file") + + # now verify that --noop works + File.unlink(mkfile) + + assert_nothing_raised { + output = %x{puppetd --noop --fqdn #{fqdn} --port #{port} --ssldir #{ssldir} --server localhost}.chomp + } + sleep 1 + assert($? == 0, "Puppetd exited with code %s" % $?) + + assert(! FileTest.exists?(mkfile), + "Noop created config'ed file") + stopmaster end end |
