asynciodebian/masterdebian/stretch-backportsjessie-backportsproxy-ticketupstream
Last change
on this file since 6e6a4e4 was
6e6a4e4,
checked in by Thomas Klute <thomas2.klute@…>, 6 years ago
|
Test case for TLS reverse proxy
This commit adds a simple test for a reverse proxy with TLS on both front end and
back end connections, with both Apache instances using mod_gnutls. The proxy
server checks the back end server's certificate.
A small whitespace issue in base_apache.conf has been found and fixed in the
process of writing the test case.
|
-
Property mode set to
100755
|
File size:
1.1 KB
|
Line | |
---|
1 | #!/bin/bash |
---|
2 | |
---|
3 | set -e |
---|
4 | |
---|
5 | if [ -z "${BACKEND_HOST}" ]; then |
---|
6 | export BACKEND_HOST="localhost" |
---|
7 | fi |
---|
8 | if [ -z "${BACKEND_IP}" ]; then |
---|
9 | export BACKEND_IP="::1" |
---|
10 | fi |
---|
11 | if [ -z "${BACKEND_PORT}" ]; then |
---|
12 | export BACKEND_PORT="9934" |
---|
13 | fi |
---|
14 | |
---|
15 | function backend_apache |
---|
16 | { |
---|
17 | dir="${1}" |
---|
18 | conf="${2}" |
---|
19 | action="${3}" |
---|
20 | lockfile="${4}" |
---|
21 | |
---|
22 | if [ -n "${lockfile}" ]; then |
---|
23 | flock_cmd="flock -w 10 ${lockfile}" |
---|
24 | fi |
---|
25 | |
---|
26 | TEST_NAME="$(basename "${dir}")" |
---|
27 | ( |
---|
28 | export TEST_NAME |
---|
29 | export TEST_IP="${BACKEND_IP}" |
---|
30 | export TEST_PORT="${BACKEND_PORT}" |
---|
31 | case $action in |
---|
32 | start) |
---|
33 | cd "${dir}" |
---|
34 | ${flock_cmd} \ |
---|
35 | /usr/sbin/apache2 -f "$(pwd)/${conf}" -k start || return 1 |
---|
36 | ;; |
---|
37 | stop) |
---|
38 | cd "${dir}" |
---|
39 | /usr/sbin/apache2 -f "$(pwd)/${conf}" -k stop || return 1 |
---|
40 | ;; |
---|
41 | esac |
---|
42 | ) |
---|
43 | } |
---|
44 | |
---|
45 | testdir="./tests/19_TLS_reverse_proxy" |
---|
46 | BACKEND_LOCK="$(realpath ${testdir}/backend.lock)" |
---|
47 | |
---|
48 | function stop_backend |
---|
49 | { |
---|
50 | backend_apache "${dir}" "backend.conf" stop |
---|
51 | } |
---|
52 | backend_apache "${testdir}" "backend.conf" start "${BACKEND_LOCK}" |
---|
53 | trap stop_backend EXIT |
---|
54 | |
---|
55 | make -f TestMakefile t-19 |
---|
56 | |
---|
57 | backend_apache "${testdir}" "backend.conf" stop |
---|
58 | trap - EXIT |
---|
Note: See
TracBrowser
for help on using the repository browser.