From c3604429d4e4dfb00bc536962dbe3154c938b571 Mon Sep 17 00:00:00 2001 From: Daniel Samson <12231216+daniel-samson@users.noreply.github.com> Date: Sun, 9 Aug 2026 14:09:19 +0100 Subject: [PATCH] =?UTF-8?q?test:=20H3=20=E2=80=94=20a=20nested=20hub=20tre?= =?UTF-8?q?e=20yanked=20whole=20rebuilds=20whole=20(hot-plug=20matrix)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hub -> hub -> keyboard, one device_del of the outer hub: the H2 recursion runs at depth two (the inner hub is torn down as a child, its keyboard first), the keyboard's driver is reaped, and re-adding all three rebinds. --- test/qemu_test.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/qemu_test.py b/test/qemu_test.py index d66334d..3af4112 100644 --- a/test/qemu_test.py +++ b/test/qemu_test.py @@ -1037,6 +1037,30 @@ CASES = [ r"(?=.*device-manager: reaping \S*usb-hid-keyboard[\s\S]*usb-hid-keyboard: ok)" r"(?=.*device-manager: reaping \S*usb-hid-mouse[\s\S]*usb-hid-mouse: ok)", "fail": r"DANOS-TEST-RESULT: FAIL"}, + # Hot-plug matrix H3 (docs/hot-plug-matrix-plan.md): yank a NESTED hub tree. + # hub → hub → keyboard, one device_del of the outer hub — the recursion must + # go two levels (inner hub torn down as a child, ITS keyboard first), the + # keyboard's driver reaped, and re-adding all three rebuilds and rebinds. + {"name": "usb-hub-nested-yank", + "build_case": "usb-hid", + "smp": 4, + "timeout": 150, + "qemu_extra": ["-device", "qemu-xhci,id=xhci2", + "-device", "usb-hub,bus=xhci2.0,port=1,id=ohub", + "-device", "usb-hub,bus=xhci2.0,port=1.1,id=ihub", + "-device", "usb-kbd,bus=xhci2.0,port=1.1.1,id=nkbd"], + "qmp_sequence": [ + {"delay": 8, "command": "device_del", "arguments": {"id": "ohub"}}, + {"delay": 14, "command": "device_add", + "arguments": {"driver": "usb-hub", "bus": "xhci2.0", "port": "1", "id": "ohub2"}}, + {"delay": 17, "command": "device_add", + "arguments": {"driver": "usb-hub", "bus": "xhci2.0", "port": "1.1", "id": "ihub2"}}, + {"delay": 20, "command": "device_add", + "arguments": {"driver": "usb-kbd", "bus": "xhci2.0", "port": "1.1.1", "id": "nkbd2"}}, + ], + "expect": r"(?s)(?=.*hub device slot \d+ disconnected)" + r"(?=.*device-manager: reaping \S*usb-hid-keyboard[\s\S]*usb-hid-keyboard: ok)", + "fail": r"DANOS-TEST-RESULT: FAIL"}, # The kernel VFS root (M-F): the mount table serves the initrd at /system — # path resolution, node status/read (an ELF magic), and directory listing, # asserted kernel-side.