summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-08-23 23:01:18 +0200
committerJulian Andres Klode <jak@debian.org>2016-08-26 22:17:55 +0200
commit144ce9208b39c1bf0d26e8ce071367ee668c0ae2 (patch)
tree6bed5e5fe61cded4e0b6a06ffcdcb073cb9db0f5 /test
parent14e57111df6f8894ed47841b7471837c9d87c264 (diff)
test: Allow stunnel to be used instead of stunnel4
This is needed for Fedora and FreeBSD. Gbp-Dch: ignore
Diffstat (limited to 'test')
-rw-r--r--test/integration/framework13
1 files changed, 9 insertions, 4 deletions
diff --git a/test/integration/framework b/test/integration/framework
index 25cabc9f8..ffcb8af04 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -1296,7 +1296,12 @@ changetowebserver() {
}
changetohttpswebserver() {
- if ! command -v stunnel4 >/dev/null 2>&1; then
+ local stunnel4
+ if command -v stunnel4 >/dev/null 2>&1; then
+ stunnel4=stunnel4
+ elif command -v stunnel >/dev/null 2>&1; then
+ stunnel4=stunnel
+ else
msgdie 'You need to install stunnel4 for https testcases'
fi
if [ ! -e "${TMPWORKINGDIRECTORY}/aptarchive/aptwebserver.pid" ]; then
@@ -1310,14 +1315,14 @@ output = /dev/null
accept = 0
connect = $APTHTTPPORT
" > "${TMPWORKINGDIRECTORY}/stunnel.conf"
- stunnel4 "${TMPWORKINGDIRECTORY}/stunnel.conf"
+ $stunnel4 "${TMPWORKINGDIRECTORY}/stunnel.conf"
waitforpidfile "${TMPWORKINGDIRECTORY}/aptarchive/stunnel.pid"
local PID="$(cat "${TMPWORKINGDIRECTORY}/aptarchive/stunnel.pid")"
if [ -z "$PID" ]; then
- msgdie 'Could not fork stunnel4 successfully'
+ msgdie 'Could not fork $stunnel4 successfully'
fi
addtrap 'prefix' "kill ${PID};"
- APTHTTPSPORT="$(lsof -i -n | awk "/^stunnel4 / && \$2 == \"${PID}\" {print \$9; exit; }" | cut -d':' -f 2)"
+ APTHTTPSPORT="$(lsof -i -n | awk "/^$stunnel4 / && \$2 == \"${PID}\" {print \$9; exit; }" | cut -d':' -f 2)"
webserverconfig 'aptwebserver::port::https' "$APTHTTPSPORT" "https://localhost:${APTHTTPSPORT}"
rewritesourceslist "https://localhost:${APTHTTPSPORT}/"
}