test(java-oracle): NatRun records the home router's NAT as Java FILIUS runs it

ScenarioNetwork builds home routers (their first card the WAN port) and
their port forwarding (portForwarding, through GatewayFirmware.setStaticNAT).
NatRun plays six stories on nat-home's network and writes the frames, the
calls and the router's NAT table: a ping, a UDP exchange, the same socket
to a second server (whose answer never reaches the LAN: Java keeps one
entry per LAN endpoint, for the first remote only), a TCP connection out,
a forwarded one in, and pings at the WAN address and past it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-30 19:50:08 +00:00
co-authored by Claude Opus 5.5
parent 37f5d77477
commit 5505e8e8af
11 changed files with 2318 additions and 1 deletions
+12 -1
View File
@@ -21,7 +21,7 @@ if [ ! -f "$upstream/target/filius.jar" ]; then
fi
classpath="$upstream/target/filius.jar:$upstream/target/lib/*"
mkdir -p "$here/.build"
javac -encoding UTF-8 -d "$here/.build" -cp "$classpath" "$here/src/FlsOracle.java" "$here/src/GetterDefaults.java" "$here/src/IpCheckCases.java" "$here/src/DnsHostsCases.java" "$here/src/EmailFileCases.java" "$here/src/BeansDump.java" "$here/src/Base64Cases.java" "$here/src/ScenarioNetwork.java" "$here/src/DhcpRun.java" "$here/src/TcpRun.java" "$here/src/DnsRun.java" "$here/src/ArpRun.java" "$here/src/RipRun.java"
javac -encoding UTF-8 -d "$here/.build" -cp "$classpath" "$here/src/FlsOracle.java" "$here/src/GetterDefaults.java" "$here/src/IpCheckCases.java" "$here/src/DnsHostsCases.java" "$here/src/EmailFileCases.java" "$here/src/BeansDump.java" "$here/src/Base64Cases.java" "$here/src/ScenarioNetwork.java" "$here/src/DhcpRun.java" "$here/src/TcpRun.java" "$here/src/DnsRun.java" "$here/src/ArpRun.java" "$here/src/RipRun.java" "$here/src/NatRun.java"
# FILIUS writes its settings below $HOME; keep them out of the real one.
mkdir -p "$here/.build/home"
# Removed first: a crashed run must not leave the previous result standing.
@@ -152,6 +152,17 @@ for run in address:5000 referral:5000 unknown:5000 unknownInZone:5000 unknownInO
test -s "$output"
done
# NAT as Java FILIUS runs it: nat-home's home router between a LAN PC and two
# WAN hosts (NatRun); frames, calls and the router's NAT table at the end.
for run in pingOut:10000 udpOut:10000 udpTwoRemotes:25000 tcpOut:20000 forward:20000 pingWan:15000; do
story="${run%%:*}"
output="$root/packages/core/test/scenarios/nat-java-$story.java.json"
rm -f "$output"
HOME="$here/.build/home" xvfb-run -a java -cp "$classpath:$here/.build" NatRun \
"$root/packages/core/test/scenarios/nat-home.scenario.json" "$story" "${run##*:}" "$output" 2>&1 | grep -v 'logback\|^$' || true
test -s "$output"
done
# RIP as Java FILIUS runs it: rip-chain's routers, each with the core's seed
# for its pauses (RipRun); frames, table changes and the ping. Real time.
for run in converge:60000 expire:135000; do