summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2021-06-07 11:44:23 +0200
committerDr. David von Oheimb <dev@ddvo.net>2021-06-09 14:03:16 +0200
commitee1d1db824a68f80c4cbdcbffbd7b4026f57a4f2 (patch)
treefc46711e1a79ad771bd1b4699e0182ff1ab94d52 /test
parentf8ab78f6c2b5faee74c3056d237d418e2f53d6a8 (diff)
80-test_cmp_http.t: Simplify and prevent hangs on server not launching/behaving correctly
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15642)
Diffstat (limited to 'test')
-rw-r--r--test/recipes/80-test_cmp_http.t25
1 files changed, 8 insertions, 17 deletions
diff --git a/test/recipes/80-test_cmp_http.t b/test/recipes/80-test_cmp_http.t
index 9c99226721..bc23347ad7 100644
--- a/test/recipes/80-test_cmp_http.t
+++ b/test/recipes/80-test_cmp_http.t
@@ -276,28 +276,19 @@ sub start_mock_server {
my $pid = open($server_fh, "$cmd|") or die "Trying to $cmd";
print "Pid is: $pid\n";
if ($server_port == 0) {
- # Clear it first
- $server_port = undef;
-
# Find out the actual server port
while (<$server_fh>) {
- print;
+ print "Server output: $_";
+ next if m/using section/;
s/\R$//; # Better chomp
- next unless (/^ACCEPT/);
-
- # $1 may be undefined, which is OK to assign to $server_port,
- # as that gets detected further down.
- /^ACCEPT\s.*:(\d+)$/;
- $server_port = $1;
-
- last;
- }
-
- unless (defined $server_port) {
- stop_mock_server($pid);
- return 0;
+ $server_port = $1 if /^ACCEPT\s.*:(\d+)$/;
+ last; # Do not loop further to prevent hangs on server misbehavior
}
}
+ unless ($server_port > 0) {
+ stop_mock_server($pid);
+ return 0;
+ }
$server_tls = $kur_port = $pbm_port = $server_port;
return $pid;
}