libmicrohttpd2

HTTP server C library (MHD 2.x, alpha)
Log | Files | Refs | README | LICENSE

zzuf_test_runner.sh (1283B)


      1 #!/bin/sh
      2 # This file is in the public domain.
      3 
      4 # Die on failures, including in particular zzuf finding a crash.
      5 set -eu
      6 
      7 # Our settings, passed into the driver(s) via environment variables.
      8 # We need to force the port so that zzuf knows what to grab.
      9 export MHD_TEST_FORCE_SERVER_PORT=${MHD_TEST_FORCE_SERVER_PORT:-4010}
     10 export MHD_TEST_FORCE_CLIENT_PORT=${MHD_TEST_FORCE_CLIENT_PORT:-4010}
     11 
     12 # This sets the number of iterations of the regular tests we run with
     13 # the fuzzer. Using a higher value than 16 could theoretically yield
     14 # better coverage.
     15 export MHD_TEST_FUZZING=${MHD_TEST_FUZZING:-16}
     16 
     17 # List of tests to fuzz. Note that TLS-based tests do not fuzz well...
     18 TESTS="test_client_server test_authentication test_postparser"
     19 
     20 if ! command -v "${ZZUF:-zzuf}" > /dev/null 2>&1 ;
     21 then
     22   echo "zzuf command missing" 1>&2
     23   exit 77
     24 fi
     25 
     26 for TEST in $TESTS
     27 do
     28     make $TEST
     29     ${ZZUF:-zzuf} \
     30         --ratio=0.001:0.4 \
     31         --autoinc \
     32         --verbose \
     33         --signal \
     34         --ports=${MHD_TEST_FORCE_SERVER_PORT} \
     35         --max-usertime=${MAX_RUNTIME_SEC:-1800} \
     36         --network \
     37         --exclude=. \
     38         --jobs=1 \
     39         ${ZZUF_FLAGS:-} \
     40         ./.libs/$TEST
     41 done
     42 echo ""
     43 echo "****************"
     44 echo "ALL TESTS PASSED"
     45 echo "****************"
     46 exit 0