source: mod_gnutls/test/proxy_backend.bash @ 342e11d

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

Test suite: Remove unnecessary TEST_IP handling for proxy back-end servers

The TEST_IP variable is used only at configure time to generate the
Listen directives in test/apache-conf/listen.conf. It is not needed at
test run time any more.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1#!/bin/bash
2
3set -e
4. ${srcdir}/common.bash
5
6if [ -z "${BACKEND_HOST}" ]; then
7    export BACKEND_HOST="localhost"
8fi
9if [ -z "${BACKEND_PORT}" ]; then
10    export BACKEND_PORT="9934"
11fi
12: ${BACKEND_PID:="backend.pid"}
13: ${srcdir:="."}
14: ${APACHE2:="apache2"}
15: ${TEST_LOCK_WAIT:="30"}
16
17function backend_apache
18{
19    dir="${1}"
20    conf="${2}"
21    action="${3}"
22    lockfile="${4}"
23
24    TEST_NAME="$(basename "${dir}")"
25    (
26        export TEST_NAME
27        export TEST_PORT="${BACKEND_PORT}"
28        export srcdir="$(realpath ${srcdir})"
29        case $action in
30            start)
31                if [ -n "${USE_TEST_NAMESPACE}" ]; then
32                    echo "Using namespaces to isolate tests, no need for" \
33                         "locking."
34                    flock_cmd=""
35                elif [ -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
42                ${flock_cmd} \
43                    ${APACHE2} -f "$(realpath ${testdir}/${conf})" -k start || return 1
44                ;;
45            stop)
46                ${APACHE2} -f "$(realpath ${testdir}/${conf})" -k stop || return 1
47                ;;
48        esac
49    )
50}
Note: See TracBrowser for help on using the repository browser.