summaryrefslogtreecommitdiffstats
path: root/test/executables
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2005-08-29 20:36:49 +0000
committerLuke Kanies <luke@madstop.com>2005-08-29 20:36:49 +0000
commitcc483678d3b89979286475745b325ae8f348afef (patch)
tree28abbb1f7ebfe529be350498dc2d33070ba0b4bb /test/executables
parent65d13753127cac85a57274e89b0d5d616e63bcb4 (diff)
downloadpuppet-cc483678d3b89979286475745b325ae8f348afef.tar.gz
puppet-cc483678d3b89979286475745b325ae8f348afef.tar.xz
puppet-cc483678d3b89979286475745b325ae8f348afef.zip
I did not have good puppetd tests, so I missed the fact that I was calling the wrong class in puppetd. Fixed.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@597 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/executables')
-rwxr-xr-xtest/executables/tc_puppetd.rb46
1 files changed, 31 insertions, 15 deletions
diff --git a/test/executables/tc_puppetd.rb b/test/executables/tc_puppetd.rb
index 38e382392..0a0556c41 100755
--- a/test/executables/tc_puppetd.rb
+++ b/test/executables/tc_puppetd.rb
@@ -37,15 +37,17 @@ class TestPuppetDExe < Test::Unit::TestCase
}
@@tmppids.each { |pid|
- %x{kill -INT #{pid} 2>/dev/null}
+ %x{kill #{pid} 2>/dev/null}
}
+ stopmaster
end
- def startmaster
- file = File.join($puppetbase, "examples", "code", "head")
+ def startmaster(file, port)
output = nil
+ ssldir = "/tmp/puppetmasterdpuppetdssldirtesting"
+ @@tmpfiles << ssldir
assert_nothing_raised {
- output = %x{puppetmasterd --port #{Puppet[:masterport]} --manifest #{file}}.chomp
+ output = %x{puppetmasterd --port #{port} -a --ssldir #{ssldir} --manifest #{file}}.chomp
}
assert($? == 0, "Puppetmasterd return status was %s" % $?)
@@tmppids << $?.pid
@@ -62,26 +64,40 @@ class TestPuppetDExe < Test::Unit::TestCase
pid = ary[1].to_i
end
}
- assert(pid, "No puppetmasterd pid")
-
- assert_nothing_raised {
- Process.kill("-INT", pid)
- }
+ if pid
+ assert_nothing_raised {
+ Process.kill("-TERM", pid)
+ }
+ end
end
def test_normalstart
- startmaster
+ file = "/tmp/testingmanifest.pp"
+ File.open(file, "w") { |f|
+ f.puts '
+file { "/tmp/puppetdtesting": create => true, mode => 755 }
+'
+ }
+
+ @@tmpfiles << file
+ @@tmpfiles << "/tmp/puppetdtesting"
+ port = 8235
+ startmaster(file, port)
output = nil
+ ssldir = "/tmp/puppetdssldirtesting"
+ @@tmpfiles << ssldir
+ client = Puppet::Client.new(:Server => "localhost")
+ fqdn = client.fqdn.sub(/^\w+\./, "testing.")
assert_nothing_raised {
- output = %x{puppetd --server localhost}.chomp
+ output = %x{puppetd --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_nothing_raised {
- socket = TCPSocket.new("127.0.0.1", Puppet[:masterport])
- socket.close
- }
+ assert(FileTest.exists?("/tmp/puppetdtesting"),
+ "Failed to create config'ed file")
stopmaster
end
end