AtlatestRepositorysigil-http3
sigil-http3 / tree / scriptsphantom-lifecycle-check.sh
1
#!/usr/bin/env bash2
set -euo pipefail3
cd "$(dirname "$0")/.."4
mkdir -p build/lifecycle/certificate .deps5
lifecycle_result="$PWD/build/lifecycle-result.txt"6
record_result() {7
local job_rc=$?8
printf 'RESULT lifecycle-job rc=%s\n' "$job_rc" | tee -a "$lifecycle_result"9
}10
trap record_result EXIT11
printf 'RESULT lifecycle-fixture=socket-free-not-interop page-host=loopback-https-only\n' | tee "$lifecycle_result"12
if [ ! -e .deps/sigil-quic ]; then bash scripts/prepare-quic.sh; fi13
test "$(git -C .deps/sigil-quic rev-parse HEAD)" = "$(cat quic.rev)"14
openssl_command=(openssl)15
if ! command -v openssl >/dev/null; then16
openssl_command=(guix shell openssl -- openssl)17
fi18
chmod 700 build/lifecycle/certificate19
timeout --foreground 180 "${openssl_command[@]}" genpkey \20
-algorithm EC -pkeyopt ec_paramgen_curve:P-256 -out build/lifecycle/certificate/key.pem21
chmod 600 build/lifecycle/certificate/key.pem22
timeout --foreground 180 "${openssl_command[@]}" req \23
-new -x509 -key build/lifecycle/certificate/key.pem -out build/lifecycle/certificate/cert.pem \24
-days 13 -sha256 -subj /CN=localhost -addext subjectAltName=IP:127.0.0.1,DNS:localhost25
node scripts/prepare-certificate.mjs "$PWD/build/lifecycle/certificate"26
timeout --foreground 60 node --test test/test-echo-lifecycle.mjs test/test-phone-page-host.mjs 2>&1 | tee build/lifecycle-tests.log27
printf 'RESULT lifecycle-checks=PASS page-host-loopback-only no-vpn-deployment\n' | tee -a "$lifecycle_result"