test: F2 acceptance — five of FILIUS' examples run as Java FILIUS runs them
ExampleRun opens an example as FILIUS opens it (SzenarioVerwaltung.laden into the window's lists), starts it as the action mode does, plays a story and writes every card's frames and tables, the calls, the addresses and the RIP tables' changes. examplesJava.test.ts reads the same file with this package's reader and runs it in the core (projectSnapshot, new): routing (internetwork_komplett), DHCP (einfaches_rechnernetz_komplett), DNS (dns_server), NAT (nat_with_mapped_port) and firewall (Internet_Komplett_..._DE) match card by card. Found and fixed: a host's ipForwardingEnabled, which Java saves and obeys, was unknown to the reader, the model, the core, the writer, the export and FlsOracle; and Java's ARP learns only from a request for its own address or a reply. Named Java bugs: a ping without a gateway throws a NullPointerException; a home router drops the answer of a second remote end. Open: Java picks between equally long RIP routes by thread timing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -28,6 +28,7 @@ import {
|
||||
import {
|
||||
decodeJavaBeans,
|
||||
importProject,
|
||||
projectSnapshot,
|
||||
readFlsArchive,
|
||||
readTopology,
|
||||
type FlsApplication,
|
||||
@@ -708,6 +709,45 @@ describe('importProject rules', () => {
|
||||
expect(project.hostWirelessConfigurations.get(withoutNetwork!)).toEqual({ isEnabled: true, ssid: '' });
|
||||
});
|
||||
|
||||
it('runs only the DNS servers that are switched on (projectSnapshot)', () => {
|
||||
const dnsServer = (isActive: boolean): FlsApplication => ({ key: 'dns', javaClass: 'filius.software.dns.DNSServer', source: flsNode('Rechner').source, isActive });
|
||||
const project = importProject(
|
||||
topology({
|
||||
nodes: [
|
||||
flsNode('Rechner', { interfaces: [nic('10.0.0.1')], system: { applications: [dnsServer(true)] } }),
|
||||
flsNode('Rechner', { interfaces: [nic('10.0.0.2')], system: { applications: [dnsServer(false)] } }),
|
||||
],
|
||||
}),
|
||||
counter(),
|
||||
);
|
||||
const [on, off] = project.graph.nodes.map((node) => node.id);
|
||||
|
||||
expect([...project.dnsServerConfigurations.keys()]).toEqual([on, off]);
|
||||
expect([...projectSnapshot(project).dnsServerConfigurationsByNodeId.keys()]).toEqual([on]);
|
||||
});
|
||||
|
||||
it("keeps a node's IP forwarding where it differs from its kind's: a host that forwards, a router that does not", () => {
|
||||
const system = (ipForwardingEnabled: boolean) => ({ manualRoutes: [], ipForwardingEnabled });
|
||||
const project = importProject(
|
||||
topology({
|
||||
nodes: [
|
||||
flsNode('Rechner', { interfaces: [nic('10.0.0.1')], system: system(true) }),
|
||||
flsNode('Notebook', { interfaces: [nic('10.0.0.2')], system: system(false) }),
|
||||
flsNode('Vermittlungsrechner', { portCount: 2, interfaces: [nic('10.0.0.3'), nic('10.1.0.3')], system: system(true) }),
|
||||
flsNode('Vermittlungsrechner', { portCount: 2, interfaces: [nic('10.0.0.4'), nic('10.1.0.4')], system: system(false) }),
|
||||
],
|
||||
}),
|
||||
counter(),
|
||||
);
|
||||
const [pc, notebook, router, quietRouter] = project.graph.nodes.map((node) => node.id);
|
||||
|
||||
expect([...project.ipForwardingByNodeId]).toEqual([
|
||||
[pc, true],
|
||||
[quietRouter, false],
|
||||
]);
|
||||
expect([notebook, router].some((id) => project.ipForwardingByNodeId.has(id!))).toBe(false);
|
||||
});
|
||||
|
||||
it('takes DHCP settings for hosts and home routers, trimmed, and only when they are not the defaults', () => {
|
||||
const defaults = { isActive: false, lowerBound: '0.0.0.0', upperBound: '0.0.0.0', gateway: '0.0.0.0', dnsServer: '0.0.0.0', useOwnSettings: false, staticAssignedAddresses: [] };
|
||||
const project = importProject(
|
||||
|
||||
Reference in New Issue
Block a user