Changeset b28158c in mod_gnutls
- Timestamp:
- Oct 11, 2017, 2:25:39 AM (5 years ago)
- Branches:
- asyncio, debian/master, debian/stretch-backports, main, master, proxy-ticket, upstream
- Children:
- 1872744
- Parents:
- c9e4709
- Location:
- test
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
test/runtests
rc9e4709 rb28158c 7 7 set -e 8 8 . ${srcdir}/common.bash 9 . ${srcdir}/proxy_backend.bash 9 10 netns_reexec ${@} 10 11 … … 17 18 testid=${srcdir}/tests/"$(printf "%02d" "$testid")"_* 18 19 fi 20 testdir="$(realpath ${testid})" 19 21 20 22 BADVARS=0 … … 100 102 function apache_down_err() { 101 103 printf "FAILURE: %s\n" "$TEST_NAME" 102 ${APACHE2} -f "${t }/apache.conf" -k stop || true104 ${APACHE2} -f "${testdir}/apache.conf" -k stop || true 103 105 if [ -e output ]; then 104 106 printf "\ngnutls-cli outputs:\n" 105 107 diff_output_filter_headers "output" "$output" || true 108 fi 109 110 if [ -r "${testdir}/backend.conf" ]; then 111 backend_apache "${testdir}" "backend.conf" stop || true 106 112 fi 107 113 … … 151 157 fi 152 158 153 t="$(realpath ${testid})"154 159 export srcdir="$(realpath ${srcdir})" 155 export TEST_NAME="$(basename "$ t")"160 export TEST_NAME="$(basename "${testdir}")" 156 161 output="outputs/${TEST_NAME}.output" 157 162 rm -f "$output" 158 163 159 if [ -e ${t }/fail.* ]; then164 if [ -e ${testdir}/fail.* ]; then 160 165 EXPECTED_FAILURE="$(printf " (expected: %s)" fail.*)" 161 166 else … … 173 178 fi 174 179 175 if ! ${flock_cmd} ${APACHE2} -f "${t}/apache.conf" -k start; then 176 if [ -e "${t}/fail.server" ]; then 180 echo "${testdir}/backend.conf" 181 if [ -r "${testdir}/backend.conf" ]; then 182 backend_apache "${testdir}" "backend.conf" start "${BACKEND_LOCK}" 183 fi 184 185 if ! ${flock_cmd} ${APACHE2} -f "${testdir}/apache.conf" -k start; then 186 if [ -e "${testdir}/fail.server" ]; then 177 187 echo "Apache HTTPD failed to start as expected." 178 188 exit 0 … … 206 216 # end with CRLF as required by RFC 7230, Section 3.1.1 regardless of 207 217 # the line ends in the input file. 208 if (sed -r "s/__HOSTNAME__/${TEST_HOST}/;s/\r?$/\r/" <${t }/input && \218 if (sed -r "s/__HOSTNAME__/${TEST_HOST}/;s/\r?$/\r/" <${testdir}/input && \ 209 219 run_with_pidfile "${sleep_pidfile}" sleep "${TEST_QUERY_TIMEOUT}" &) | \ 210 gnutls-cli -p "${TEST_PORT}" $(cat ${t }/gnutls-cli.args) "${TEST_HOST}" \220 gnutls-cli -p "${TEST_PORT}" $(cat ${testdir}/gnutls-cli.args) "${TEST_HOST}" \ 211 221 | tee "$output" && test "${PIPESTATUS[1]}" -eq 0; 212 222 then 213 if [ -e ${t }/fail* ]; then214 printf "%s should have failed but succeeded\n" "$(basename "$t ")" >&2223 if [ -e ${testdir}/fail* ]; then 224 printf "%s should have failed but succeeded\n" "$(basename "$testdir")" >&2 215 225 exit 1 216 226 fi 217 227 else 218 if [ ! -e ${t }/fail* ]; then219 printf "%s should have succeeded but failed\n" "$(basename "$t ")" >&2228 if [ ! -e ${testdir}/fail* ]; then 229 printf "%s should have succeeded but failed\n" "$(basename "$testdir")" >&2 220 230 exit 1 221 231 fi … … 225 235 unset sleep_pidfile 226 236 227 if [ -e ${t }/output ] ; then228 diff_output_filter_headers "${t }/output" "$output" >&2237 if [ -e ${testdir}/output ] ; then 238 diff_output_filter_headers "${testdir}/output" "$output" >&2 229 239 fi 230 240 if [ -n "${USE_MSVA}" ]; then … … 233 243 trap - EXIT 234 244 fi 235 ${APACHE2} -f "${t }/apache.conf" -k stop || [ -e ${t}/fail.server ]245 ${APACHE2} -f "${testdir}/apache.conf" -k stop || [ -e ${testdir}/fail.server ] 236 246 printf "SUCCESS: %s\n" "$TEST_NAME" 247 248 if [ -r "${testdir}/backend.conf" ]; then 249 backend_apache "${testdir}" "backend.conf" stop || true 250 fi 237 251 238 252 if [ -n "${USE_MSVA}" ]; then -
test/test-19_TLS_reverse_proxy.bash
rc9e4709 rb28158c 1 1 #!/bin/bash 2 3 set -e4 : ${srcdir:="."}5 . ${srcdir}/common.bash6 netns_reexec ${@}7 8 testdir="${srcdir}/tests/19_TLS_reverse_proxy"9 . $(dirname ${0})/proxy_backend.bash10 11 function stop_backend12 {13 backend_apache "${testdir}" "backend.conf" stop14 }15 backend_apache "${testdir}" "backend.conf" start "${BACKEND_LOCK}"16 trap stop_backend EXIT17 18 2 ${srcdir}/runtests t-19 19 20 backend_apache "${testdir}" "backend.conf" stop21 trap - EXIT -
test/test-20_TLS_reverse_proxy_client_auth.bash
rc9e4709 rb28158c 1 1 #!/bin/bash 2 3 set -e4 : ${srcdir:="."}5 . ${srcdir}/common.bash6 netns_reexec ${@}7 8 testdir="${srcdir}/tests/20_TLS_reverse_proxy_client_auth"9 . $(dirname ${0})/proxy_backend.bash10 11 function stop_backend12 {13 backend_apache "${testdir}" "backend.conf" stop14 }15 backend_apache "${testdir}" "backend.conf" start "${BACKEND_LOCK}"16 trap stop_backend EXIT17 18 2 ${srcdir}/runtests t-20 19 20 backend_apache "${testdir}" "backend.conf" stop21 trap - EXIT -
test/test-21_TLS_reverse_proxy_wrong_cert.bash
rc9e4709 rb28158c 1 1 #!/bin/bash 2 3 set -e4 : ${srcdir:="."}5 . ${srcdir}/common.bash6 netns_reexec ${@}7 8 testdir="${srcdir}/tests/21_TLS_reverse_proxy_wrong_cert"9 . $(dirname ${0})/proxy_backend.bash10 11 function stop_backend12 {13 backend_apache "${testdir}" "backend.conf" stop14 }15 backend_apache "${testdir}" "backend.conf" start "${BACKEND_LOCK}"16 trap stop_backend EXIT17 18 2 ${srcdir}/runtests t-21 19 20 backend_apache "${testdir}" "backend.conf" stop21 trap - EXIT -
test/test-22_TLS_reverse_proxy_crl_revoke.bash
rc9e4709 rb28158c 1 1 #!/bin/bash 2 3 set -e4 : ${srcdir:="."}5 . ${srcdir}/common.bash6 netns_reexec ${@}7 8 testdir="${srcdir}/tests/22_TLS_reverse_proxy_crl_revoke"9 . $(dirname ${0})/proxy_backend.bash10 11 function stop_backend12 {13 backend_apache "${testdir}" "backend.conf" stop14 }15 backend_apache "${testdir}" "backend.conf" start "${BACKEND_LOCK}"16 trap stop_backend EXIT17 18 2 ${srcdir}/runtests t-22 19 20 backend_apache "${testdir}" "backend.conf" stop21 trap - EXIT -
test/test-23_TLS_reverse_proxy_mismatched_priorities.bash
rc9e4709 rb28158c 1 1 #!/bin/bash 2 3 set -e4 : ${srcdir:="."}5 . ${srcdir}/common.bash6 netns_reexec ${@}7 8 testdir="${srcdir}/tests/23_TLS_reverse_proxy_mismatched_priorities"9 . $(dirname ${0})/proxy_backend.bash10 2 11 3 # This test checks if server and proxy priorities are applied … … 13 5 # back end server is configured not to use TLS 1.2. The proxy request 14 6 # must fail and the client must receive an error message to pass. 15 16 function stop_backend17 {18 backend_apache "${testdir}" "backend.conf" stop19 }20 backend_apache "${testdir}" "backend.conf" start "${BACKEND_LOCK}"21 trap stop_backend EXIT22 23 7 ${srcdir}/runtests t-23 24 25 backend_apache "${testdir}" "backend.conf" stop26 trap - EXIT
Note: See TracChangeset
for help on using the changeset viewer.