Java's DNS server reads its records from the text file /dns/hosts on every query. dnsHosts.ts ports that reading (DNSServer.leseRecordListe, ResourceRecord, Dateisystem.holeDatei) and keeps in the model the records Java answers: type exactly A, MX or NS, and a name Java accepted. The file stays in the file system as it is. Both oracles read 76 hand-picked hosts files (dns-hosts.cases.txt): the Java oracle through DNSServer.holeResourceRecords (DnsHostsCases), the Swift oracle through TopologyDNSHostsFileCodec (--dns-hosts). The Java view matches Java on every case; the model matches Swift except for 33 named cases in twelve reasons: Java splits at single spaces and LF only, has no comments or "IN", turns a TTL that is no int into 3600, keeps duplicates, and empties names with a leading digit. The Swift dump now carries each server's records; the corpus comparison covers them on 16 files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
76 lines
3.8 KiB
Bash
Executable File
76 lines
3.8 KiB
Bash
Executable File
#!/bin/sh
|
|
# Reads every .fls under corpus/ with Java FILIUS itself and writes
|
|
# corpus/corpus.java.json. Java is the arbiter for the file format (plan §13, M2).
|
|
# Needs a JDK (17+), Maven and xvfb-run: FILIUS opens its main window while
|
|
# loading (Information.reset → JMainFrame), so it needs a display, not headless.
|
|
set -eu
|
|
here="$(cd "$(dirname "$0")" && pwd)"
|
|
root="$(cd "$here/../.." && pwd)"
|
|
commit=6640354
|
|
upstream="$here/.upstream"
|
|
if [ ! -d "$upstream/.git" ]; then
|
|
git clone -q https://gitlab.com/filius1/filius.git "$upstream"
|
|
fi
|
|
if [ "$(git -C "$upstream" rev-parse --short=7 HEAD)" != "$commit" ]; then
|
|
git -C "$upstream" fetch -q origin
|
|
git -C "$upstream" checkout -q "$commit"
|
|
rm -rf "$upstream/target"
|
|
fi
|
|
if [ ! -f "$upstream/target/filius.jar" ]; then
|
|
(cd "$upstream" && mvn -q -DskipTests package dependency:copy-dependencies -DoutputDirectory=target/lib)
|
|
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"
|
|
# 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.
|
|
rm -f "$root/corpus/corpus.java.json"
|
|
HOME="$here/.build/home" xvfb-run -a java -cp "$classpath:$here/.build" FlsOracle \
|
|
"$root/corpus" "$root/corpus/corpus.java.json" 2>&1 | grep -v 'logback\|^$' || true
|
|
test -s "$root/corpus/corpus.java.json"
|
|
|
|
# Getter defaults and static constants for the XMLEncoder references (packages/fls/src/javaDefaults.json).
|
|
defaults="$root/packages/fls/src/javaDefaults.json"
|
|
rm -f "$defaults"
|
|
HOME="$here/.build/home" xvfb-run -a java -cp "$classpath:$here/.build" GetterDefaults "$defaults" \
|
|
filius.gui.netzwerksicht.JSidebarButton#iconTextGap \
|
|
filius.gui.netzwerksicht.JSidebarButton#verticalTextPosition \
|
|
filius.gui.netzwerksicht.JSidebarButton#displayedMnemonicIndex \
|
|
filius.gui.netzwerksicht.JSidebarButton#debugGraphicsOptions \
|
|
filius.gui.netzwerksicht.JSidebarButton#enabled \
|
|
java.lang.ThreadGroup#maxPriority \
|
|
filius.hardware.knoten.Rechner#maxLayerOfOperation \
|
|
filius.hardware.knoten.Notebook#maxLayerOfOperation \
|
|
filius.hardware.knoten.Vermittlungsrechner#maxLayerOfOperation \
|
|
filius.hardware.knoten.Gateway#maxLayerOfOperation \
|
|
filius.software.clientserver.ServerBaustein#port \
|
|
filius.software.dhcp.DHCPServer#port \
|
|
filius.software.dns.DNSServer#port \
|
|
filius.software.rip.RIPServer#port \
|
|
filius.software.www.WebServer#port \
|
|
javax.swing.SwingConstants::CENTER \
|
|
filius.software.clientserver.ServerBaustein#aktiv \
|
|
filius.software.clientserver.ClientBaustein#zielPort \
|
|
filius.software.clientserver.ClientBaustein#zielIPAdresse \
|
|
filius.software.dns.DNSServer#aktiv \
|
|
filius.software.www.WebServer#aktiv \
|
|
filius.software.www.WebServer#useVHost \
|
|
filius.software.dateiaustausch.PeerToPeerAnwendung#maxTeilnehmerZahl \
|
|
2>&1 | grep -v 'logback\|^$' || true
|
|
test -s "$defaults"
|
|
|
|
# IP.ipCheck on hand-picked cases (packages/fls/src/javaIp.ts).
|
|
cases="$root/packages/fls/test/ip-check.cases.txt"
|
|
ipcheck="$root/packages/fls/test/ip-check.java.json"
|
|
rm -f "$ipcheck"
|
|
HOME="$here/.build/home" java -cp "$classpath:$here/.build" IpCheckCases "$cases" "$ipcheck" 2>&1 | grep -v 'logback\|^$' || true
|
|
test -s "$ipcheck"
|
|
|
|
# DNSServer's own reading of /dns/hosts on hand-picked files (packages/fls/src/dnsHosts.ts).
|
|
cases="$root/packages/fls/test/dns-hosts.cases.txt"
|
|
dnshosts="$root/packages/fls/test/dns-hosts.java.json"
|
|
rm -f "$dnshosts"
|
|
HOME="$here/.build/home" xvfb-run -a java -cp "$classpath:$here/.build" DnsHostsCases "$cases" "$dnshosts" 2>&1 | grep -v 'logback\|^$' || true
|
|
test -s "$dnshosts"
|