asynciodebian/masterproxy-ticket
Last change
on this file since b47dc70 was
1872744,
checked in by Thomas Klute <thomas2.klute@…>, 3 years ago
|
Test suite: Rename bash function backend_apache to apache_service
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | #!/bin/bash |
---|
2 | |
---|
3 | set -e |
---|
4 | . ${srcdir}/common.bash |
---|
5 | |
---|
6 | function apache_service |
---|
7 | { |
---|
8 | # needed for start and stop |
---|
9 | local dir="${1}" |
---|
10 | local conf="${2}" |
---|
11 | local action="${3}" |
---|
12 | # Needed only for start. The "lockfile" parameter is used as flock |
---|
13 | # lock file or PID file to watch depending on whether FLOCK is |
---|
14 | # set. |
---|
15 | local lockfile="${4}" |
---|
16 | |
---|
17 | TEST_NAME="$(basename "${dir}")" |
---|
18 | ( |
---|
19 | export TEST_NAME |
---|
20 | export srcdir="$(realpath ${srcdir})" |
---|
21 | local flock_cmd="" |
---|
22 | case ${action} in |
---|
23 | start) |
---|
24 | if [ -n "${USE_TEST_NAMESPACE}" ]; then |
---|
25 | echo "Using namespaces to isolate tests, no need for" \ |
---|
26 | "locking." |
---|
27 | elif [ -n "${FLOCK}" ]; then |
---|
28 | flock_cmd="${FLOCK} -w ${TEST_LOCK_WAIT} ${lockfile}" |
---|
29 | else |
---|
30 | echo "Locking disabled, using wait based on proxy PID file." |
---|
31 | wait_pid_gone "${lockfile}" |
---|
32 | fi |
---|
33 | ${flock_cmd} \ |
---|
34 | ${APACHE2} -f "$(realpath ${dir}/${conf})" -k start || return 1 |
---|
35 | ;; |
---|
36 | stop) |
---|
37 | ${APACHE2} -f "$(realpath ${dir}/${conf})" -k stop || return 1 |
---|
38 | ;; |
---|
39 | *) |
---|
40 | echo "${FUNCNAME[0]}: Invalid action \"${action}\"." >&2 |
---|
41 | exit 1 |
---|
42 | ;; |
---|
43 | esac |
---|
44 | ) |
---|
45 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.