source: mod_gnutls/debian/patches/0004-Test-suite-Make-timeouts-for-server-locks-and-HTTPS-.patch @ 36663ec

debian/masterdebian/stretch-backports
Last change on this file since 36663ec was 36663ec, checked in by Thomas Klute <thomas2.klute@…>, 4 years ago

Add test suite and compatibility patches from master

Added 0002-Test-suite-Run-flock-with-verbose-to-log-timeouts.patch: test suite fix
Added 0005-Check-if-flock-supports-verbose.patch: test suite fix
Added 0004-Test-suite-Make-timeouts-for-server-locks-and-HTTPS-.patch: test suite fix
Added 0006-Test-suite-Do-not-explicitly-set-the-mutex-type-to-d.patch: test suite fix
Added 0007-Do-not-treat-warnings-about-deprecated-declarations-.patch: GnuTLS 3.5.9 compatibility
Added 0003-Test-suite-Log-if-a-process-to-be-stopped-by-PID-fil.patch: test suite logging

  • Property mode set to 100644
File size: 4.2 KB
  • configure.ac

    From: Thomas Klute <thomas2.klute@uni-dortmund.de>
    Date: Mon, 6 Feb 2017 18:05:25 +0100
    Subject: Test suite: Make timeouts for server locks and HTTPS requests
     configurable
    
    If TEST_LOCK_WAIT or TEST_QUERY_TIMEOUT are provided at configure
    time, their values are stored and used instead of the default.
    ---
     configure.ac     | 10 ++++++++++
     test/Makefile.am |  9 ++-------
     test/README      |  4 ++--
     test/runtests    |  4 ++--
     4 files changed, 16 insertions(+), 11 deletions(-)
    
    diff --git a/configure.ac b/configure.ac
    index e9c455e..0577435 100644
    a b AC_ARG_VAR([TEST_IP], [List of IP addresses to use for server instances \ 
    233233                      enclosed in square brackets.])
    234234AM_SUBST_NOTMAKE(TEST_IP)
    235235
     236: ${TEST_LOCK_WAIT:="30"}
     237: ${TEST_QUERY_TIMEOUT:="30"}
     238AC_ARG_VAR([TEST_LOCK_WAIT], [Timeout in seconds to acquire locks for \
     239                             Apache instances in the test suite, or the \
     240                             previous instance to remove its PID file if \
     241                             flock is not used. Default is 30.])
     242AC_ARG_VAR([TEST_QUERY_TIMEOUT], [Timeout in seconds for HTTPS requests \
     243                                 sent using gnutls-cli in the test suite. \
     244                                 Default is 30.])
     245
    236246dnl Allow user to set SoftHSM PKCS #11 module
    237247AC_ARG_VAR([SOFTHSM_LIB], [Absolute path of the SoftHSM PKCS @%:@11 module to \
    238248                          use. By default the test suite will search common \
  • test/Makefile.am

    diff --git a/test/Makefile.am b/test/Makefile.am
    index affe15c..9fa9c84 100644
    a b EXTRA_DIST = $(apache_data) $(cert_templates) $(shared_identities:=.uid.in) \ 
    198198test_lockfile = ./test.lock
    199199# Lockfile for the proxy backend Apache process (if any)
    200200backend_lockfile = ./backend.lock
    201 # Maximum wait time in seconds for flock to aquire instance lock
    202 # files, or Apache to remove its PID file
    203 lock_wait = 30
    204201
    205202# port for the main Apache server
    206203TEST_PORT ?= 9932
    endif 
    214211TEST_MSVA_MAX_WAIT ?= 10000
    215212# wait loop time for MSVA startup (milliseconds)
    216213TEST_MSVA_WAIT ?= 400
    217 # seconds for the HTTP request to be sent and responded to
    218 TEST_QUERY_DELAY ?= 30
    219214
    220215AM_TESTS_ENVIRONMENT = export APACHE2=@APACHE2@; \
    221216        export AP_LIBEXECDIR=@AP_LIBEXECDIR@; \
    222         export TEST_LOCK_WAIT="$(lock_wait)"; \
     217        export TEST_LOCK_WAIT="@TEST_LOCK_WAIT@"; \
    223218        export TEST_HOST="@TEST_HOST@"; \
    224219        export TEST_PORT="$(TEST_PORT)"; \
    225220        export MSVA_PORT="$(MSVA_PORT)"; \
    226221        export TEST_MSVA_MAX_WAIT="$(TEST_MSVA_MAX_WAIT)"; \
    227222        export TEST_MSVA_WAIT="$(TEST_MSVA_WAIT)"; \
    228         export TEST_QUERY_DELAY="$(TEST_QUERY_DELAY)"; \
     223        export TEST_QUERY_TIMEOUT="@TEST_QUERY_TIMEOUT@"; \
    229224        export BACKEND_HOST="@TEST_HOST@"; \
    230225        export HTTP_CLI="@HTTP_CLI@";
    231226
  • test/README

    diff --git a/test/README b/test/README
    index c49b7db..b377125 100644
    a b on your expected setup (along with the variables that can be passed to 
    129129
    130130 * If a machine is particularly slow or under heavy load, it's
    131131   possible that these tests will fail for timing
    132    reasons. [TEST_QUERY_DELAY (seconds for the HTTP request to be sent
    133    and responded to)]
     132   reasons. [TEST_QUERY_TIMEOUT (timeout for the HTTPS request in
     133   seconds)]
    134134
    135135The first two of these issues are avoided when the tests are isolated
    136136using network namespaces, which is the default (see "Implementation"
  • test/runtests

    diff --git a/test/runtests b/test/runtests
    index 9e98b8d..718b27f 100755
    a b else 
    1818fi
    1919
    2020BADVARS=0
    21 for v in APACHE2 TEST_HOST TEST_PORT TEST_QUERY_DELAY TEST_MSVA_WAIT \
     21for v in APACHE2 TEST_HOST TEST_PORT TEST_QUERY_TIMEOUT TEST_MSVA_WAIT \
    2222                 MSVA_PORT; do
    2323    if [ ! -v "$v" ]; then
    2424        printf "You need to set the %s environment variable\n" "$v" >&2
    sleep_pidfile="$(mktemp mod_gnutls_test-XXXXXX.pid)" 
    216216# end with CRLF as required by RFC 7230, Section 3.1.1 regardless of
    217217# the line ends in the input file.
    218218if (sed -r "s/__HOSTNAME__/${TEST_HOST}/;s/\r?$/\r/" <${t}/input && \
    219            run_with_pidfile "${sleep_pidfile}" sleep "${TEST_QUERY_DELAY}" &) | \
     219           run_with_pidfile "${sleep_pidfile}" sleep "${TEST_QUERY_TIMEOUT}" &) | \
    220220       gnutls-cli -p "${TEST_PORT}" $(cat ${t}/gnutls-cli.args) "${TEST_HOST}" \
    221221       | tee "$output" && test "${PIPESTATUS[1]}" -eq 0;
    222222then
Note: See TracBrowser for help on using the repository browser.