3 # Run privoxy-regression-test.pl on a configuration extended by
4 # regression-tests.action.
6 # (c) 2018-2022 Roland Rosenfeld <roland@debian.org>
10 if [ -z "$AUTOPKGTEST_TMP" ]; then
11 AUTOPKGTEST_TMP=$(mktemp -d)
14 trap 'rm -rf "$AUTOPKGTEST_TMP"' EXIT
16 CONFIG=$AUTOPKGTEST_TMP/config
17 PIDFILE=$AUTOPKGTEST_TMP/privoxy.pid
18 PRIVOXY=$AUTOPKGTEST_TMP/privoxy
20 cp /usr/sbin/privoxy "$PRIVOXY"
22 http_proxy=http://127.0.0.1:$PORT/
25 OUTFILE=$AUTOPKGTEST_TMP/output
28 echo "#### pass 1: some optiones disabled"
30 sed -e "s/^listen-address.*/listen-address 127.0.0.1:$PORT/" \
31 -e "s%^logdir.*%logdir $AUTOPKGTEST_TMP%" \
32 -e "s/^keep-alive-timeout.*/keep-alive-timeout 21/" \
33 -e "s/^#connection-sharing.*/connection-sharing 0/" \
34 < /usr/share/privoxy/config > "$CONFIG"
35 echo "actionsfile regression-tests.action" >> "$CONFIG"
37 echo "Starting privoxy on port $PORT"
38 $PRIVOXY --pidfile "$PIDFILE" "$CONFIG"
40 /usr/bin/privoxy-regression-test --max-level 200 --show-skipped-tests \
44 echo "#### pass 2 with some more options enabled"
46 sed -e "s/^listen-address.*/listen-address 127.0.0.1:$PORT/" \
47 -e "s%^logdir.*%logdir $AUTOPKGTEST_TMP%" \
48 -e "s/^enable-remote-toggle.*/enable-remote-toggle 1/" \
49 -e "s/^enable-edit-actions.*/enable-edit-actions 1/" \
50 -e "s/^enable-proxy-authentication-forwarding.*/enable-proxy-authentication-forwarding 1/" \
51 -e "s/^keep-alive-timeout.*/keep-alive-timeout 21/" \
52 -e "s/^#connection-sharing.*/connection-sharing 1/" \
53 < /usr/share/privoxy/config > "$CONFIG"
54 echo "actionsfile regression-tests.action" >> "$CONFIG"
56 /usr/bin/privoxy-regression-test --max-level 200 --show-skipped-tests \
57 | tee -a "$OUTFILE" 2>&1
60 echo "Stopping privoxy on port $PORT"
61 kill "$(cat "$PIDFILE")"
63 # Check that 2 passes have both 0 failures:
64 if [ "$(grep -c 'Executed.*, 0 failures' "$OUTFILE")" = 2 ]