asynciodebian/masterdebian/stretch-backportsjessie-backportsproxy-ticketupstream
Last change
on this file since cf4e708 was
412ee84,
checked in by Thomas Klute <thomas2.klute@…>, 5 years ago
|
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.
|
-
Property mode set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | #!/bin/bash |
---|
2 | |
---|
3 | set -e |
---|
4 | . ${srcdir}/common.bash |
---|
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 |
---|
15 | : ${BACKEND_PID:="backend.pid"} |
---|
16 | : ${srcdir:="."} |
---|
17 | : ${APACHE2:="apache2"} |
---|
18 | : ${TEST_LOCK_WAIT:="30"} |
---|
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}" |
---|
32 | export srcdir="$(realpath ${srcdir})" |
---|
33 | case $action in |
---|
34 | 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 |
---|
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.