summaryrefslogtreecommitdiff
path: root/src/tests/test_net_name_resolve.py
AgeCommit message (Collapse)Author
2026-09-09interfaces: T9269: do not run the hw-id naming pass in a containerChristian Breunig
Container interfaces are veth pairs created by the runtime. They have no backing bus device in sysfs, so discover_physical_interfaces() never considers them, and their MAC is assigned by the host and regenerated on every start. A pending node could thus never be resolved. The pass only spent both bounded hardware waits and then asked for an hw-id that would not survive a restart: interface 'eth0' still has no hw-id configured after this boot's naming pass - bind it manually, e.g. ... Returning before write_status() leaves no status file behind, so warn_missing_interface_hardware() in vyos-router stays quiet by itself. setUpModule() pins the detection off for the test module - the build container would otherwise short-circuit every existing main() test.
2026-08-15T3871: never guess a pending node's hardware when ambiguousChristian Breunig
Reported against the previous PCIe/MAC-sorted replacement fill: on a real, already-provisioned box (hw-id from historical probe-order rescan, unrelated to any PCIe/MAC sort), a configured node's address ended up silently applied to a different physical NIC. Deleting one interface's hw-id (keeping its settings) while a different, unrelated interface's config was fully removed in the same boot was enough - the two freed candidates' MAC order didn't match their old name order, so the deterministic sort swapped them. Once written back by the rescan helper, the wrong binding became permanent and self-reinforcing on every later boot. There's no way to verify, from MAC and PCIe position alone, which of several unconfigured candidates is genuinely a given node's own hardware once its hw-id is gone. Restore strict matching: a node only recovers its hw-id automatically when it's the sole pending node of its type this boot and exactly one candidate exists - any other count leaves it pending and reported rather than guessed. A candidate that isn't matched this way is not otherwise held back - it still gets an ordinary, settings-free bootstrap name instead of being lost, just never inherits another node's configuration. This necessarily changes what a combined "delete one interface fully, clear a different one's hw-id" reboot can auto-resolve; the accompanying test-harness change acknowledges that trade-off explicitly.
2026-08-08T3871: make boot-time interface naming deterministic and hw-id awareChristian Breunig
Multi-vendor PCIe NIC systems could lose or rename Ethernet/wireless interfaces on boot, because naming was decided from a single per-device udev event before all hardware had a chance to enumerate. Replace that with one authoritative pass, run once configuration is available during router startup: wait for configured hardware, apply every hw-id binding, and name whatever has none yet by PCIe distance from the root complex and MAC address - the same result every boot. A node with its hw-id deleted (NIC replacement) or its whole configuration removed is treated as an ordinary open slot, filled the same way - recovering its original hardware whenever the interfaces that vacated slots this boot also show up as candidates. Boot now reports any interface still unresolved, and the pass is covered by a new test suite in vyos-build named: make testifname Assisted-by: Claude:claude-sonnet-5