summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rwxr-xr-xspec/integration/bin/puppetmasterd.rb29
1 files changed, 20 insertions, 9 deletions
diff --git a/spec/integration/bin/puppetmasterd.rb b/spec/integration/bin/puppetmasterd.rb
index 27b0f52bf..f1d77eff5 100755
--- a/spec/integration/bin/puppetmasterd.rb
+++ b/spec/integration/bin/puppetmasterd.rb
@@ -16,6 +16,10 @@ describe "puppetmasterd" do
Puppet[:certdnsnames] = "localhost"
@@port = 12345
+
+ Puppet::SSL::Host.instance_eval{
+ @value_cache = {}
+ }
end
after {
@@ -48,7 +52,7 @@ describe "puppetmasterd" do
f.puts { "notify { testing: }" }
end
- args = arguments + addl_args
+ args = arguments + " " + addl_args
bin = File.join(File.dirname(__FILE__), "..", "..", "..", "sbin", "puppetmasterd")
lib = File.join(File.dirname(__FILE__), "..", "..", "..", "lib")
@@ -56,9 +60,22 @@ describe "puppetmasterd" do
end
def stop
- if @pidfile and FileTest.exist?(@pidfile)
+ if @pidfile and File.exist?(@pidfile)
pid = File.read(@pidfile).chomp.to_i
Process.kill(:TERM, pid)
+ 10.times do
+ break unless File.exist?(@pidfile)
+ sleep 1
+ end
+ begin
+ # sigkill and report if process was still running
+ Process.kill(:KILL, pid)
+
+ raise "Process didn't die from SIGTERM after 10 seconds"
+ rescue Errno::ESRCH
+ # process wasn't running. good.
+ end
+
end
end
@@ -73,16 +90,10 @@ describe "puppetmasterd" do
it "should be serving status information over xmlrpc" do
start
- sleep 5
+ sleep 6
client = Puppet::Network::Client.status.new(:Server => "localhost", :Port => @@port)
- FileUtils.mkdir_p(File.dirname(Puppet[:autosign]))
- File.open(Puppet[:autosign], "w") { |f|
- f.puts Puppet[:certname]
- }
-
- client.cert
retval = client.status
retval.should == 1