AtlatestRepositorysigil-nat

sigil-nat / tree / scriptsphantom-nat-check.sh

1#!/usr/bin/env bash
2set -euo pipefail
3cd "$(dirname "$0")/.."
4mkdir -p build/nat
5result="$PWD/build/nat/check-result.txt"
6record_result() {
7 local job_rc=$?
8 printf 'RESULT sigil-nat-check rc=%s\n' "$job_rc" | tee -a "$result"
9}
10trap record_result EXIT
11printf 'RESULT operation=offline-tests-plus-read-only-inspection mapping-requests=0\n' | tee "$result"
12timeout --foreground 30 node --test tools/nat/test-codecs.mjs tools/nat/test-upnp.mjs tools/nat/test-lease.mjs 2>&1 | tee build/nat/tests.log
13node --check tools/nat/external-udp-probe.mjs
14node --check tools/nat/external-udp-probe-from-receipt.mjs
15node --check scripts/phantom-upnp-mapping-check.mjs
16printf 'RESULT offline-tests=PASS\n' | tee -a "$result"
17timeout --foreground 30 node scripts/phantom-nat-inspect.mjs | tee build/nat/inspection.log
18printf 'RESULT read-only-inspection=COMPLETE mapping-requests=0\n' | tee -a "$result"