80-test_cmp_http.t: Improve fuzzing exclusion pattern - fixup!
[openssl.git] / test / recipes / 80-test_cmp_http.t
index e68844ebf1bc9d3d3f7a153481973b6553e965be..7bb720a823667ef41b1cae99e87faf6a4c37b863 100644 (file)
@@ -22,21 +22,21 @@ use lib srctop_dir('Configurations');
 use lib bldtop_dir('.');
 
 plan skip_all => "These tests are not supported in a fuzz build"
-    if config('options') =~ /-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION/;
+    if config('options') =~ /-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION|enable-fuzz-afl/;
 
 plan skip_all => "These tests are not supported in a no-cmp build"
     if disabled("cmp");
 plan skip_all => "These tests are not supported in a no-ec build"
     if disabled("ec");
 
-plan skip_all => "Tests involving local HTTP server not available on Windows or VMS"
-    if $^O =~ /^(VMS|MSWin32)$/;
+plan skip_all => "Tests involving local HTTP server not available on Windows, AIX or VMS"
+    if $^O =~ /^(VMS|MSWin32|AIX)$/;
 plan skip_all => "Tests involving local HTTP server not available in cross-compile builds"
     if defined $ENV{EXE_SHELL};
 plan skip_all => "Tests involving local HTTP server require 'kill' command"
-    if system("which kill");
+    if system("which kill >/dev/null");
 plan skip_all => "Tests involving local HTTP server require 'lsof' command"
-    if system("which lsof"); # this typically excludes Solaris
+    if system("which lsof >/dev/null"); # this typically excludes Solaris
 
 sub chop_dblquot { # chop any leading and trailing '"' (needed for Windows)
     my $str = shift;
@@ -180,6 +180,7 @@ indir data_dir() => sub {
         $server_name = chop_dblquot($server_name);
         load_config($server_name, $server_name);
         {
+          SKIP: {
             my $pid;
             if ($server_name eq "Mock") {
                 indir "Mock" => sub {
@@ -198,6 +199,7 @@ indir data_dir() => sub {
                 };
             };
             stop_mock_server($pid) if $pid;
+          }
         }
     };
 };
@@ -273,12 +275,18 @@ sub start_mock_server {
     my $cmd = "LD_LIBRARY_PATH=$dir DYLD_LIBRARY_PATH=$dir " .
         bldtop_dir($app) . " -config server.cnf $args";
     my $pid = mock_server_pid();
-    return $pid if $pid; # already running
+    if ($pid) {
+        print "Mock server already running with pid=$pid\n";
+        return $pid;
+    }
+    print "Current directory is ".getcwd()."\n";
+    print "Launching mock server listening on port $server_port: $cmd\n";
     return system("$cmd &") == 0 # start in background, check for success
         ? (sleep 1, mock_server_pid()) : 0;
 }
 
 sub stop_mock_server {
     my $pid = $_[0];
+    print "Killing mock server with pid=$pid\n";
     system("kill $pid") if $pid;
 }