Files
mdg-filius/packages/core/test/scenarios/dhcp-no-server.scenario.json
julian.kiedaischandClaude Opus 5.5 396dbacfc5 feat(core): DHCP in the simulation core, as in Swift
engine.ts ports Swift's "DHCP server and automatic client": an active
server listens on port 67 from the start and offers a static assignment
before its range, round from the address after the last one offered;
offers last 10 s, dynamic leases a day, and a server whose offer another
server beat blacklists that address for a while. A client starts as an
event: DISCOVER, OFFER, a check by ARP, DECLINE, REQUEST, ACK or NAK,
2.5 s per wait, and after ten failures its old address back. The snapshot
carries the DHCP settings of clients and servers.

Four scenarios match the Swift engine. One Swift error is named in the
oracle test: a client run directly is advanced a second time, to FINISH,
by the server's answer within its own DISCOVER, and the outer run then
writes back its stale copy of the status (Swift's value types); the
address and every trace agree, only the reported status is wrong in
Swift. Swift's three DHCP engine tests are ported, with tests for
stopping and the message format. 15 mutation probes, 14 caught; the other
concerns the home router, which runs only once NAT is ported.

Two departures from Java remain, to be fixed next: from the event queue
the client's ARP check does not wait, so an address conflict is never
found, and each answer that wakes the client makes it send its state's
message again (a second DISCOVER and REQUEST, the second answered with
NAK). Java waits a round trip and sends once per attempt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 10:17:36 +00:00

122 lines
2.9 KiB
JSON

{
"seed": 44,
"nodes": [
{
"id": "00000000-0000-0000-0000-000000000101",
"kind": "pc",
"ports": [
{
"id": "00000000-0000-0000-0000-000000000111",
"label": "eth0"
}
]
},
{
"id": "00000000-0000-0000-0000-000000000102",
"kind": "pc",
"ports": [
{
"id": "00000000-0000-0000-0000-000000000112",
"label": "eth0"
}
]
},
{
"id": "00000000-0000-0000-0000-000000000103",
"kind": "pc",
"ports": [
{
"id": "00000000-0000-0000-0000-000000000113",
"label": "eth0"
}
]
},
{
"id": "00000000-0000-0000-0000-000000000104",
"kind": "networkSwitch",
"ports": [
{
"id": "00000000-0000-0000-0000-000000000121",
"label": "sw1"
},
{
"id": "00000000-0000-0000-0000-000000000122",
"label": "sw2"
},
{
"id": "00000000-0000-0000-0000-000000000123",
"label": "sw3"
},
{
"id": "00000000-0000-0000-0000-000000000124",
"label": "sw4"
}
]
}
],
"links": [
{
"id": "00000000-0000-0000-0000-00000000F001",
"sourceNode": "00000000-0000-0000-0000-000000000101",
"sourcePort": "00000000-0000-0000-0000-000000000111",
"targetNode": "00000000-0000-0000-0000-000000000104",
"targetPort": "00000000-0000-0000-0000-000000000121"
},
{
"id": "00000000-0000-0000-0000-00000000F002",
"sourceNode": "00000000-0000-0000-0000-000000000102",
"sourcePort": "00000000-0000-0000-0000-000000000112",
"targetNode": "00000000-0000-0000-0000-000000000104",
"targetPort": "00000000-0000-0000-0000-000000000122"
},
{
"id": "00000000-0000-0000-0000-00000000F003",
"sourceNode": "00000000-0000-0000-0000-000000000103",
"sourcePort": "00000000-0000-0000-0000-000000000113",
"targetNode": "00000000-0000-0000-0000-000000000104",
"targetPort": "00000000-0000-0000-0000-000000000123"
}
],
"devices": {
"00000000-0000-0000-0000-000000000101": {
"ip": "192.168.0.10",
"mask": "255.255.255.0"
},
"00000000-0000-0000-0000-000000000102": {
"ip": "169.254.1.2",
"mask": "255.255.0.0"
},
"00000000-0000-0000-0000-000000000103": {
"ip": "192.168.0.30",
"mask": "255.255.255.0"
}
},
"switches": {
"00000000-0000-0000-0000-000000000104": {
"ssid": "lab",
"retention": 5000
}
},
"steps": [
{
"op": "advance",
"to": 10000
},
{
"op": "runDhcp",
"node": "00000000-0000-0000-0000-000000000102"
},
{
"op": "advance",
"to": 60000
},
{
"op": "runDhcp",
"node": "00000000-0000-0000-0000-000000000101"
}
],
"dhcpClients": [
"00000000-0000-0000-0000-000000000102"
]
}