aboutsummaryrefslogtreecommitdiff
path: root/plugins/tests/check_http.t
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/tests/check_http.t')
-rwxr-xr-xplugins/tests/check_http.t17
1 files changed, 11 insertions, 6 deletions
diff --git a/plugins/tests/check_http.t b/plugins/tests/check_http.t
index 2f051fad..188f5e75 100755
--- a/plugins/tests/check_http.t
+++ b/plugins/tests/check_http.t
@@ -91,6 +91,8 @@ if ($pid) {
exit;
}
} else {
+ # closing the connection after -C cert checks make the daemon exit with a sigpipe otherwise
+ local $SIG{'PIPE'} = 'IGNORE';
my $d = HTTP::Daemon::SSL->new(
LocalPort => $port_https,
LocalAddr => "127.0.0.1",
@@ -102,8 +104,6 @@ if ($pid) {
exit;
}
}
- # give our webservers some time to startup
- sleep(1);
} else {
# Child
#print "child\n";
@@ -116,6 +116,9 @@ if ($pid) {
exit;
}
+# give our webservers some time to startup
+sleep(3);
+
# Run the same server on http and https
sub run_server {
my $d = shift;
@@ -414,22 +417,24 @@ sub run_common_tests {
# stickyport - on full urlS port is set back to 80 otherwise
$cmd = "$command -f stickyport -u /redir_external -t 5 -s redirected";
+ alarm(2);
eval {
local $SIG{ALRM} = sub { die "alarm\n" };
- alarm(2);
$result = NPTest->testCmd( $cmd );
- alarm(0); };
+ };
isnt( $@, "alarm\n", $cmd );
+ alarm(0);
is( $result->return_code, 0, $cmd );
# Let's hope there won't be any web server on :80 returning "redirected"!
$cmd = "$command -f sticky -u /redir_external -t 5 -s redirected";
+ alarm(2);
eval {
local $SIG{ALRM} = sub { die "alarm\n" };
- alarm(2);
$result = NPTest->testCmd( $cmd );
- alarm(0); };
+ };
isnt( $@, "alarm\n", $cmd );
+ alarm(0);
isnt( $result->return_code, 0, $cmd );
# Test an external address - timeout