]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix a visual glitch in test_cmp_http.t
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 21 Mar 2025 19:58:57 +0000 (20:58 +0100)
committerTomas Mraz <tomas@openssl.org>
Wed, 2 Apr 2025 17:44:20 +0000 (19:44 +0200)
Kill the shell process after the Mock server is running,
to prevent the shell from printing an error message when
the Mock server is finally killed.

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27158)

test/recipes/80-test_cmp_http.t

index c704cc758e913d5b187b4cf38d7175235d6337a0..8ea33d90c09fbb1f85a48ffd88fe78eb424c95ad 100644 (file)
@@ -274,6 +274,7 @@ sub start_mock_server {
     print "Pid is: $pid\n";
     if ($server_port == 0) {
         # Find out the actual server port
+        my $pid0 = $pid;
         while (<$server_fh>) {
             print "Server output: $_";
             next if m/using section/;
@@ -281,6 +282,11 @@ sub start_mock_server {
             ($server_port, $pid) = ($1, $2) if /^ACCEPT\s.*:(\d+) PID=(\d+)$/;
             last; # Do not loop further to prevent hangs on server misbehavior
         }
+        if ($pid0 != $pid) {
+            # kill the shell process
+            kill('KILL', $pid0);
+            waitpid($pid0, 0);
+        }
     }
     unless ($server_port > 0) {
         stop_mock_server($pid);