diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-10-07 19:54:59 +0200 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2026-10-31 10:51:12 +0100 |
| commit | 185cdb0971e0b19a4be818eaf13c2c7731d421db (patch) | |
| tree | 7c379f829b78d051d21ccbce7d633309ab578362 /scripts | |
| parent | f492d60341e187f01f9f4142094049b1a361eb55 (diff) | |
| download | vyos-build-185cdb0971e0b19a4be818eaf13c2c7731d421db.tar.gz vyos-build-185cdb0971e0b19a4be818eaf13c2c7731d421db.zip | |
Testsuite: T3871: log the hardware a naming decision was taken on
A failing naming testcase showed the outcome but not the input, which left
the interesting cases - a card matched by slot, an adapter order taken from
the firmware - hard to reconstruct from a log alone.
The run now dumps what the machine claims to be once it is up: the DMI vendor
and product, and the SMBIOS tables carrying the onboard device designations.
At every checkpoint it also dumps, per interface, the sysfs attributes the
store reads and the udev properties it anchors a name on.
All of it is read-only and already on the console path, so it costs a few
seconds per run and turns an unreproducible failure into a readable one.
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/check-qemu-install | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install index b09a01f0..0ffd2a5b 100755 --- a/scripts/check-qemu-install +++ b/scripts/check-qemu-install @@ -972,12 +972,43 @@ def verify_radio_has_physical_device(c, log): log.info(f"'{name}' was given physical-device {phy}") +def firmware_diagnostics(c): + """ Dump what the machine claims to be. The store reads the DMI vendor to + decide whether a port label is worth looking at, and the labels + themselves come from SMBIOS type 41 - so when a naming decision looks + wrong, these tables say whether the input was there at all. Static for + the life of the VM, hence once per run. """ + for command in ('cat /sys/class/dmi/id/sys_vendor', + 'cat /sys/class/dmi/id/product_name', + 'sudo dmidecode -t 1', + 'sudo dmidecode -t 41'): + c.sendline(f'{command} 2>/dev/null || true') + c.expect(op_mode_prompt) + + def ifname_diagnostics(c, mapping_file): """ Dump everything needed to reconstruct a naming decision after the fact. Cheap, and the difference between a one-line failure and an unreproducible one. """ + # every sysfs attribute and udev property the store keys a name on - + # repeated per checkpoint because hot-plug changes them + sysfs_dump = ( + 'for d in /sys/class/net/*/device; do [ -e "$d" ] || continue; ' + 'n=$(basename $(dirname $d)); ' + 'echo "$n bus=$(basename $(readlink -f $d)) ' + 'vendor=$(cat $d/vendor 2>/dev/null) ' + 'subsystem_vendor=$(cat $d/subsystem_vendor 2>/dev/null) ' + 'label=$(cat $d/label 2>/dev/null)"; done') + udev_dump = ( + 'for i in /sys/class/net/*; do n=$(basename $i); ' + 'udevadm info -q property -p /sys/class/net/$n 2>/dev/null | ' + 'grep -E "^(DEVTYPE|ID_BUS|ID_PATH|ID_NET_NAME_)" | ' + 'sed "s/^/$n /"; done') + for command in ('show interfaces ethernet', 'ip -br link show', + sysfs_dump, + udev_dump, f'cat {mapping_file}', 'cat /run/vyos-net-name-resolve.json', 'ls /etc/systemd/network/', @@ -1666,6 +1697,7 @@ try: log.info('Running interface naming persistence tests') mapping_file = IFNAME_MAPPING_FILE + firmware_diagnostics(c) if args.vmware: verify_vmware_firmware(c, log) |
