Changeset 412ee84 in mod_gnutls


Ignore:
Timestamp:
Nov 25, 2015, 7:05:35 PM (3 years ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, master, upstream
Children:
dff57b4
Parents:
a08b25e
Message:

Test suite: Allow the user to disable use of "flock"

Using "flock" causes trouble on some exotic architectures (e.g. Hurd),
so allow disabling it. Running without lock files requires serial
execution of test cases to achieve reliable results.

Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    ra08b25e r412ee84  
    5959AC_MSG_CHECKING([whether to enable SRP functionality])
    6060AC_MSG_RESULT($use_srp)
     61
     62dnl Optionally disable flock
     63AC_ARG_ENABLE(flock,
     64        AS_HELP_STRING([--disable-flock], [Disable use of flock during tests]),
     65        [use_flock=$enableval], [use_flock=yes])
     66dnl If flock is not disabled, make sure it's available
     67if test "$enable_flock" != "no"; then
     68        AC_PATH_PROG([FLOCK], [flock], [no])
     69        use_flock=${FLOCK}
     70fi
     71AM_CONDITIONAL([DISABLE_FLOCK], [test "$enable_flock" = "no"])
    6172
    6273AC_ARG_ENABLE(msva,
  • test/Makefile.am

    ra08b25e r412ee84  
    127127# Lockfile for the main Apache process
    128128test_lockfile = ./test.lock
    129 # Maximum wait time in seconds for flock to aquire instance lock files
     129# Lockfile for the proxy backend Apache process (if any)
     130backend_lockfile = ./backend.lock
     131# Maximum wait time in seconds for flock to aquire instance lock
     132# files, or Apache to remove its PID file
    130133lock_wait = 30
    131134
     
    143146AM_TESTS_ENVIRONMENT = export APACHE2=$(APACHE2); \
    144147        export AP_LIBEXECDIR=$(AP_LIBEXECDIR); \
    145         export TEST_LOCK="$(test_lockfile)"; \
    146148        export TEST_LOCK_WAIT="$(lock_wait)"; \
    147149        export TEST_HOST="$(TEST_HOST)"; \
     
    153155        export BACKEND_HOST="$(TEST_HOST)";
    154156
     157# Without flock tests must not run in parallel. Otherwise set lock files.
     158if DISABLE_FLOCK
     159.NOTPARALLEL:
     160else
     161AM_TESTS_ENVIRONMENT += export FLOCK="$(FLOCK)"; \
     162        export TEST_LOCK="$(test_lockfile)"; \
     163        export BACKEND_LOCK="$(backend_lockfile)";
     164endif
     165
    155166# Echo AM_TESTS_ENVIRONMENT. This can be useful for debugging, e.g. if
    156167# you want to manually run an Apache instance with Valgrind using the
  • test/proxy_backend.bash

    ra08b25e r412ee84  
    22
    33set -e
     4. ${srcdir}/common.bash
    45
    56if [ -z "${BACKEND_HOST}" ]; then
     
    1213    export BACKEND_PORT="9934"
    1314fi
    14 : ${BACKEND_LOCK:="backend.lock"}
     15: ${BACKEND_PID:="backend.pid"}
    1516: ${srcdir:="."}
    1617: ${APACHE2:="apache2"}
     
    2425    lockfile="${4}"
    2526
    26     if [ -n "${lockfile}" ]; then
    27         flock_cmd="flock -w ${TEST_LOCK_WAIT} ${lockfile}"
    28     fi
    29 
    3027    TEST_NAME="$(basename "${dir}")"
    3128    (
     
    3633        case $action in
    3734            start)
     35                if [ -n "${lockfile}" ]; then
     36                    flock_cmd="${FLOCK} -w ${TEST_LOCK_WAIT} ${lockfile}"
     37                else
     38                    echo "Locking disabled, using wait based on proxy PID file."
     39                    wait_pid_gone "${BACKEND_PID}"
     40                    flock_cmd=""
     41                fi
    3842                ${flock_cmd} \
    3943                    ${APACHE2} -f "$(realpath ${testdir}/${conf})" -k start || return 1
  • test/runtests

    ra08b25e r412ee84  
    66
    77set -e
     8. ${srcdir}/common.bash
    89
    910testid="${1##t-}"
     
    1819BADVARS=0
    1920for v in APACHE2 TEST_HOST TEST_PORT TEST_QUERY_DELAY TEST_MSVA_WAIT \
    20                  MSVA_PORT TEST_LOCK; do
     21                 MSVA_PORT; do
    2122    if [ ! -v "$v" ]; then
    2223        printf "You need to set the %s environment variable\n" "$v" >&2
     
    150151fi
    151152
     153TEST_PID="apache2.pid"
    152154# configure locking for the Apache process
    153 flock_cmd="flock -w ${TEST_LOCK_WAIT} $(realpath ${TEST_LOCK})"
     155if [ -n "${TEST_LOCK}" ]; then
     156    flock_cmd="${FLOCK} -w ${TEST_LOCK_WAIT} $(realpath ${TEST_LOCK})"
     157else
     158    echo "Locking disabled, using wait based on Apache PID file."
     159    wait_pid_gone "${TEST_PID}"
     160    flock_cmd=""
     161fi
    154162
    155163t="$(realpath ${testid})"
Note: See TracChangeset for help on using the changeset viewer.