From 144ce9208b39c1bf0d26e8ce071367ee668c0ae2 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 23 Aug 2016 23:01:18 +0200 Subject: test: Allow stunnel to be used instead of stunnel4 This is needed for Fedora and FreeBSD. Gbp-Dch: ignore --- test/integration/framework | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'test') 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}/" } -- cgit v1.2.3