#!/usr/bin/env bash set -euo pipefail umask 077 ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" PROXY_PID="" cleanup() { local status=$? trap - EXIT if ! node "$ROOT_DIR/scripts/qa/full-local-environment.mjs" complete; then status=1; fi if [[ -n "$PROXY_PID" ]]; then kill "$PROXY_PID" 2>/dev/null || true wait "$PROXY_PID" 2>/dev/null || true fi exit "$status" } trap cleanup EXIT trap 'exit 130' INT trap 'exit 143' TERM ip link set lo up ip link add qaonline type veth peer name qapeer ip addr add 192.0.2.1/30 dev qaonline ip addr add 192.0.2.2/30 dev qapeer ip link set qaonline up ip link set qapeer up # Both veth ends live here; this route has no gateway or path to the host. # GLib/WebKit needs a link default route to report native network availability. ip route add default dev qaonline scope link node "$ROOT_DIR/scripts/qa/full-local-environment.mjs" initialize node "$ROOT_DIR/scripts/qa/browser-environment-probe.mjs" native mkdir "$QA_MANAGED_SCRATCH/tmp" "$QA_MANAGED_SCRATCH/storage" export TMPDIR="$QA_MANAGED_SCRATCH/tmp" STORAGE_DIR="$QA_MANAGED_SCRATCH/storage" # Force smoke-test to create its own synthetic fallback, never read a shared /tmp sample. export SAMPLE_FILE="$QA_MANAGED_SCRATCH/tmp/synthetic-smoke-input.pdf" python3 "$ROOT_DIR/scripts/qa/local-postgres-proxy.py" "$QA_MANAGED_SOCKET/.s.PGSQL.5432" & PROXY_PID=$! node "$ROOT_DIR/scripts/qa/full-local-environment.mjs" verify bash "$ROOT_DIR/scripts/qa/run-web-gates.sh" "$1"