Prevent 80-test_cmp_http from accidentally killing perl in error.

If there is an issue with setting up the test environment in this test,
pid is not set so stop_server kills the perl process. A guard has been
added to prevent this situation.

Fixes: #22014

Signed-off-by: Randall S. Becker <randall.becker@nexbridge.ca>

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22015)
This commit is contained in:
Randall S. Becker 2023-09-07 20:42:10 +01:00 committed by Pauli
parent 9a41a3c6a4
commit c499cbc323
1 changed files with 1 additions and 1 deletions

View File

@ -314,7 +314,7 @@ sub start_server {
$server_host = "127.0.0.1" if $server_host eq "0.0.0.0";
}
unless ($server_port > 0) {
stop_server($server_name, $pid);
stop_server($server_name, $pid) if $pid;
print "Cannot get expected output from the $server_name server";
return 0;
}