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.