asynciodebian/masterdebian/stretch-backportsjessie-backportsproxy-ticketupstream
Last change
on this file since 67f2f58 was
f87c1b5,
checked in by Thomas Klute <thomas2.klute@…>, 5 years ago
|
Test suite: Run proxy backend servers in parallel if namespaces are enabled
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[f84890d] | 1 | #!/bin/bash |
---|
| 2 | |
---|
| 3 | set -e |
---|
[412ee84] | 4 | . ${srcdir}/common.bash |
---|
[f84890d] | 5 | |
---|
| 6 | if [ -z "${BACKEND_HOST}" ]; then |
---|
| 7 | export BACKEND_HOST="localhost" |
---|
| 8 | fi |
---|
| 9 | if [ -z "${BACKEND_IP}" ]; then |
---|
| 10 | export BACKEND_IP="::1" |
---|
| 11 | fi |
---|
| 12 | if [ -z "${BACKEND_PORT}" ]; then |
---|
| 13 | export BACKEND_PORT="9934" |
---|
| 14 | fi |
---|
[412ee84] | 15 | : ${BACKEND_PID:="backend.pid"} |
---|
[33af2b7] | 16 | : ${srcdir:="."} |
---|
[af7da2d] | 17 | : ${APACHE2:="apache2"} |
---|
[50eab8e] | 18 | : ${TEST_LOCK_WAIT:="30"} |
---|
[f84890d] | 19 | |
---|
| 20 | function backend_apache |
---|
| 21 | { |
---|
| 22 | dir="${1}" |
---|
| 23 | conf="${2}" |
---|
| 24 | action="${3}" |
---|
| 25 | lockfile="${4}" |
---|
| 26 | |
---|
| 27 | TEST_NAME="$(basename "${dir}")" |
---|
| 28 | ( |
---|
| 29 | export TEST_NAME |
---|
| 30 | export TEST_IP="${BACKEND_IP}" |
---|
| 31 | export TEST_PORT="${BACKEND_PORT}" |
---|
[33af2b7] | 32 | export srcdir="$(realpath ${srcdir})" |
---|
[f84890d] | 33 | case $action in |
---|
| 34 | start) |
---|
[f87c1b5] | 35 | if [ -n "${USE_TEST_NAMESPACE}" ]; then |
---|
| 36 | echo "Using namespaces to isolate tests, no need for" \ |
---|
| 37 | "locking." |
---|
| 38 | flock_cmd="" |
---|
| 39 | elif [ -n "${lockfile}" ]; then |
---|
[412ee84] | 40 | flock_cmd="${FLOCK} -w ${TEST_LOCK_WAIT} ${lockfile}" |
---|
| 41 | else |
---|
| 42 | echo "Locking disabled, using wait based on proxy PID file." |
---|
| 43 | wait_pid_gone "${BACKEND_PID}" |
---|
| 44 | flock_cmd="" |
---|
| 45 | fi |
---|
[f84890d] | 46 | ${flock_cmd} \ |
---|
[af7da2d] | 47 | ${APACHE2} -f "$(realpath ${testdir}/${conf})" -k start || return 1 |
---|
[f84890d] | 48 | ;; |
---|
| 49 | stop) |
---|
[af7da2d] | 50 | ${APACHE2} -f "$(realpath ${testdir}/${conf})" -k stop || return 1 |
---|
[f84890d] | 51 | ;; |
---|
| 52 | esac |
---|
| 53 | ) |
---|
| 54 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.