forked from kay/RouterOS
M8: Netzwerk-Isolation live verifiziert (manuell + über den Wizard)
Isolation zuerst manuell per SSH nachgebaut (ether5), danach über den
App-Wizard (Experte-Modus, ether4), um die eigentliche Abnahme-
Bedingung ("kompletter Wizard-Durchlauf") zu erfüllen. Dabei drei
App-Bugs gefunden und gefixt:
- Bug 22: neues LAN-/VLAN-Interface wurde nie der defconf-Interface-
Liste "LAN" hinzugefügt, wodurch DNS-Anfragen an den Router selbst
blockiert blieben (Werks-Firewall droppt Input von allem außerhalb
dieser Liste).
- Bug 23: ein voller Wizard-Durchlauf gegen einen bereits konfigurierten
Router brach am ersten nicht-idempotenten Add-Befehl ab
(/ip address, /ip pool, /ip dhcp-server, /ip dhcp-server network).
- Bug 24: ein als eigenes isoliertes Netz konfiguriertes Interface
blieb Bridge-"Slave" (Werks-Bridging), wodurch RouterOS die
generierten Isolationsregeln selbst als ungültig verwarf.
Alle drei in DhcpServerCommandBuilder/SetupViewModel gefixt, 52 Unit-
Tests grün, Isolation+DNS+Internet am echten Gerät bestätigt. M8 auf
live verifiziert gesetzt. Nebenbei zwei veraltete Doku-Stellen zum
Gitea-Remote korrigiert.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YDmUd93KxsYGr2kLTotWnG
This commit is contained in:
@@ -43,12 +43,28 @@ final class RouterOSCommandBuilderTests: XCTestCase {
|
||||
let config = LanDhcpConfig()
|
||||
let commands = config.buildCommands()
|
||||
|
||||
XCTAssertEqual(commands.count, 4)
|
||||
XCTAssertEqual(commands.count, 6)
|
||||
XCTAssertEqual(commands[0].menuPath, "/ip address")
|
||||
XCTAssertEqual(commands[1].menuPath, "/ip pool")
|
||||
XCTAssertEqual(commands[2].menuPath, "/ip dhcp-server")
|
||||
XCTAssertEqual(commands[3].menuPath, "/ip dhcp-server network")
|
||||
XCTAssertEqual(commands[3].arguments["gateway"], "192.168.88.1")
|
||||
XCTAssertEqual(commands[4].menuPath, "/interface list")
|
||||
XCTAssertEqual(commands[4].arguments["name"], "LAN")
|
||||
XCTAssertEqual(commands[5].menuPath, "/interface list member")
|
||||
XCTAssertEqual(commands[5].arguments["list"], "LAN")
|
||||
XCTAssertEqual(commands[5].arguments["interface"], "bridge")
|
||||
}
|
||||
|
||||
func testLanDhcpCommandsDetachInterfaceFromBridgeWhenNotDefaultBridge() {
|
||||
var config = LanDhcpConfig()
|
||||
config.interfaceName = "ether4"
|
||||
let commands = config.buildCommands()
|
||||
|
||||
XCTAssertEqual(commands.count, 7)
|
||||
XCTAssertEqual(commands[0].menuPath, "/interface bridge port")
|
||||
XCTAssertEqual(commands[0].operation, .remove(matchField: "interface", matchValue: "ether4"))
|
||||
XCTAssertEqual(commands[1].menuPath, "/ip address")
|
||||
}
|
||||
|
||||
func testCliLineRendersSortedQuotedArgumentsForAdd() {
|
||||
|
||||
@@ -6,17 +6,21 @@ final class VlanEntryTests: XCTestCase {
|
||||
let vlan = VlanEntry(name: "Gäste", vlanID: 20, parentInterface: "bridge")
|
||||
let commands = vlan.buildCommands()
|
||||
|
||||
XCTAssertEqual(commands.count, 5)
|
||||
XCTAssertEqual(commands.count, 8)
|
||||
XCTAssertEqual(commands[0].menuPath, "/interface vlan")
|
||||
XCTAssertEqual(commands[0].arguments["vlan-id"], "20")
|
||||
XCTAssertEqual(commands[0].arguments["interface"], "bridge")
|
||||
XCTAssertEqual(commands[0].arguments["name"], "vlan20")
|
||||
|
||||
XCTAssertEqual(commands[1].menuPath, "/ip address")
|
||||
XCTAssertEqual(commands[1].arguments["interface"], "vlan20")
|
||||
XCTAssertEqual(commands[2].menuPath, "/ip pool")
|
||||
XCTAssertEqual(commands[3].menuPath, "/ip dhcp-server")
|
||||
XCTAssertEqual(commands[4].menuPath, "/ip dhcp-server network")
|
||||
XCTAssertEqual(commands[1].menuPath, "/interface bridge port")
|
||||
XCTAssertEqual(commands[2].menuPath, "/ip address")
|
||||
XCTAssertEqual(commands[2].arguments["interface"], "vlan20")
|
||||
XCTAssertEqual(commands[3].menuPath, "/ip pool")
|
||||
XCTAssertEqual(commands[4].menuPath, "/ip dhcp-server")
|
||||
XCTAssertEqual(commands[5].menuPath, "/ip dhcp-server network")
|
||||
XCTAssertEqual(commands[6].menuPath, "/interface list")
|
||||
XCTAssertEqual(commands[7].menuPath, "/interface list member")
|
||||
XCTAssertEqual(commands[7].arguments["interface"], "vlan20")
|
||||
}
|
||||
|
||||
func testDefaultAddressesAreDerivedFromVlanID() {
|
||||
|
||||
Reference in New Issue
Block a user