diff options
| author | Michael Peter Christen <mc@yacy.net> | 2026-07-12 00:49:49 +0200 |
|---|---|---|
| committer | Michael Peter Christen <mc@yacy.net> | 2026-07-12 00:49:49 +0200 |
| commit | b2e9142ea9a61af8c6e55a39a392136306dc0312 (patch) | |
| tree | 918e2fc6308b9ed040d8470c21a4731e9766a0a2 /test/proxy-smoke-test.sh | |
| parent | bfddfe5e7ed90a80b4acf9a71a567b61b77cfcc4 (diff) | |
towards a Jetty 9 decoupling baseline for the Jetty 12 migration
Diffstat (limited to 'test/proxy-smoke-test.sh')
| -rwxr-xr-x | test/proxy-smoke-test.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/proxy-smoke-test.sh b/test/proxy-smoke-test.sh new file mode 100755 index 000000000..ccae2227b --- /dev/null +++ b/test/proxy-smoke-test.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env sh + +# Live HTTP proxy and CONNECT contract. The peer must be started with the +# transparent proxy enabled and both targets must be controlled test services. + +set -eu + +proxy=${YACY_SMOKE_PROXY:-} +http_target=${YACY_SMOKE_PROXY_HTTP_TARGET:-} +https_target=${YACY_SMOKE_PROXY_HTTPS_TARGET:-} +[ -n "$proxy" ] && [ -n "$http_target" ] && [ -n "$https_target" ] || { + echo "SKIP: set YACY_SMOKE_PROXY, YACY_SMOKE_PROXY_HTTP_TARGET and YACY_SMOKE_PROXY_HTTPS_TARGET" >&2 + exit 2 +} + +timeout=${YACY_SMOKE_TIMEOUT:-30} +curl --silent --show-error --fail --max-time "$timeout" --proxy "$proxy" \ + --noproxy '' \ + "$http_target" >/dev/null +echo "ok 1 - HTTP proxy traffic" + +# An HTTPS request through an HTTP proxy necessarily establishes a CONNECT tunnel. +curl --silent --show-error --fail --max-time "$timeout" --proxy "$proxy" \ + --noproxy '' \ + "$https_target" >/dev/null +echo "ok 2 - HTTPS CONNECT tunnel" + +echo "PASS: proxy and CONNECT contract" |
