source: mod_gnutls/test/proxy_backend.bash @ 03295a9

debian/masterdebian/stretch-backportsjessie-backportsupstream
Last change on this file since 03295a9 was 33af2b7, checked in by Thomas Klute <thomas2.klute@…>, 5 years ago

Test suite: Add tests to "dist" target and support VPATH builds

Supporting VPATH builds requires using $srcdir to find non-generated
data rather than fixed relative paths. If test are not called through
the make system, local defaults must be used. Not changing directories
during tests any more makes this easier.

A few files (e.g. templates, generated CRL) have been moved around to
better match the new structure.

  • Property mode set to 100644
File size: 858 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
17function backend_apache
18{
19    dir="${1}"
20    conf="${2}"
21    action="${3}"
22    lockfile="${4}"
23
24    if [ -n "${lockfile}" ]; then
25        flock_cmd="flock -w 10 ${lockfile}"
26    fi
27
28    TEST_NAME="$(basename "${dir}")"
29    (
30        export TEST_NAME
31        export TEST_IP="${BACKEND_IP}"
32        export TEST_PORT="${BACKEND_PORT}"
33        export srcdir="$(realpath ${srcdir})"
34        case $action in
35            start)
36                ${flock_cmd} \
37                    /usr/sbin/apache2 -f "$(realpath ${testdir}/${conf})" -k start || return 1
38                ;;
39            stop)
40                /usr/sbin/apache2 -f "$(realpath ${testdir}/${conf})" -k stop || return 1
41                ;;
42        esac
43    )
44}
Note: See TracBrowser for help on using the repository browser.