source: mod_gnutls/debian/patches/0005-Check-if-flock-supports-verbose.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: 2.5 KB
  • configure.ac

    From: Thomas Klute <thomas2.klute@uni-dortmund.de>
    Date: Wed, 8 Feb 2017 13:27:17 +0100
    Subject: Check if flock supports --verbose
    
    Some old versions of flock do not support the --verbose option, namely
    the one in Debian Jessie. Check for support at configure time and
    enable the option only if available.
    ---
     configure.ac            | 12 +++++++++++-
     test/proxy_backend.bash |  2 +-
     test/runtests           |  2 +-
     3 files changed, 13 insertions(+), 3 deletions(-)
    
    diff --git a/configure.ac b/configure.ac
    index 0577435..425f2b8 100644
    a b AS_IF([test "${FLOCK}" != "no"], 
    8383        lockfile="$(mktemp)"
    8484        AS_IF([${FLOCK} --timeout 1 ${lockfile} true >&AS_MESSAGE_LOG_FD 2>&1],
    8585              [flock_works="yes"], [flock_works="no"])
    86         rm "${lockfile}"
    8786        AC_MSG_RESULT([$flock_works])
     87        # Old versions of flock do not support --verbose. They fail
     88        # without executing the command but still return 0. Check for
     89        # this behavior by testing if the rm command was executed.
     90        AC_MSG_CHECKING([whether ${FLOCK} supports --verbose])
     91        testfile="$(mktemp)"
     92        AS_IF([${FLOCK} --verbose --timeout 1 ${lockfile} rm "${testfile}" \
     93                        >&AS_MESSAGE_LOG_FD 2>&1; test ! -e "${testfile}"],
     94              [flock_verbose="yes"; FLOCK="${FLOCK} --verbose"],
     95              [flock_verbose="no"; rm "${testfile}"])
     96        AC_MSG_RESULT([$flock_verbose])
     97        rm "${lockfile}"
    8898      ],
    8999      [flock_works="no"])
    90100# disable flock if requested by user or it doesn't support timeout
  • test/proxy_backend.bash

    diff --git a/test/proxy_backend.bash b/test/proxy_backend.bash
    index 5b1bafe..c2d8507 100644
    a b function backend_apache 
    3737                         "locking."
    3838                    flock_cmd=""
    3939                elif [ -n "${lockfile}" ]; then
    40                     flock_cmd="${FLOCK} --verbose -w ${TEST_LOCK_WAIT} ${lockfile}"
     40                    flock_cmd="${FLOCK} -w ${TEST_LOCK_WAIT} ${lockfile}"
    4141                else
    4242                    echo "Locking disabled, using wait based on proxy PID file."
    4343                    wait_pid_gone "${BACKEND_PID}"
  • test/runtests

    diff --git a/test/runtests b/test/runtests
    index 718b27f..c1ff135 100755
    a b if [ -n "${USE_TEST_NAMESPACE}" ]; then 
    159159    echo "Using namespaces to isolate tests, no need for locking."
    160160    flock_cmd=""
    161161elif [ -n "${TEST_LOCK}" ]; then
    162     flock_cmd="${FLOCK} --verbose -w ${TEST_LOCK_WAIT} $(realpath ${TEST_LOCK})"
     162    flock_cmd="${FLOCK} -w ${TEST_LOCK_WAIT} $(realpath ${TEST_LOCK})"
    163163else
    164164    echo "Locking disabled, using wait based on Apache PID file."
    165165    wait_pid_gone "${TEST_PID}"
Note: See TracBrowser for help on using the repository browser.