From 185cdb0971e0b19a4be818eaf13c2c7731d421db Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Wed, 7 Oct 2026 19:54:59 +0200 Subject: 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. --- scripts/check-qemu-install | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'scripts') 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) -- cgit v1.2.3