source: mod_gnutls/test/proxy_backend.bash @ 73b0bf0

debian/masterdebian/stretch-backportsjessie-backportsupstream
Last change on this file since 73b0bf0 was 50eab8e, checked in by Thomas Klute <thomas2.klute@…>, 4 years ago

Test suite: Configure max wait time for instance locks from Makefile.am

The increased maximum (30 seconds) should help to avoid false failures
with parallel builds on slow systems.

  • Property mode set to 100644
File size: 909 bytes
Line 
1#!/bin/bash
2
3set -e
4
5if [ -z "${BACKEND_HOST}" ]; then
6    export BACKEND_HOST="localhost"
7fi
8if [ -z "${BACKEND_IP}" ]; then
9    export BACKEND_IP="::1"
10fi
11if [ -z "${BACKEND_PORT}" ]; then
12    export BACKEND_PORT="9934"
13fi
14: ${BACKEND_LOCK:="backend.lock"}
15: ${srcdir:="."}
16: ${APACHE2:="apache2"}
17: ${TEST_LOCK_WAIT:="30"}
18
19function backend_apache
20{
21    dir="${1}"
22    conf="${2}"
23    action="${3}"
24    lockfile="${4}"
25
26    if [ -n "${lockfile}" ]; then
27        flock_cmd="flock -w ${TEST_LOCK_WAIT} ${lockfile}"
28    fi
29
30    TEST_NAME="$(basename "${dir}")"
31    (
32        export TEST_NAME
33        export TEST_IP="${BACKEND_IP}"
34        export TEST_PORT="${BACKEND_PORT}"
35        export srcdir="$(realpath ${srcdir})"
36        case $action in
37            start)
38                ${flock_cmd} \
39                    ${APACHE2} -f "$(realpath ${testdir}/${conf})" -k start || return 1
40                ;;
41            stop)
42                ${APACHE2} -f "$(realpath ${testdir}/${conf})" -k stop || return 1
43                ;;
44        esac
45    )
46}
Note: See TracBrowser for help on using the repository browser.