diff --git a/test/qemu_test.py b/test/qemu_test.py index b4dfa0a..e6d35c0 100644 --- a/test/qemu_test.py +++ b/test/qemu_test.py @@ -984,6 +984,31 @@ CASES = [ r"[\s\S]*device-manager: delegated device \d+ to /system/drivers/usb-hid-keyboard" r"[\s\S]*usb-hid-keyboard: ok)", "fail": r"DANOS-TEST-RESULT: FAIL"}, + # Hot-plug matrix H1 (docs/hot-plug-matrix-plan.md): ROOT-port unplug and + # replug on the same port. Different teardown path than the hub case + # (tearDownPort, not tearDownHubDevice), and QEMU raises no port-change + # events for root ports — the bus's 250 ms reconcile tick must notice the + # PORTSC change on its own. The ordered tail (removed → reaping → delegated + # → ok) can only be the second generation: every boot device's ok precedes + # the unplug. + {"name": "usb-root-replug", + "build_case": "usb-hid", + "smp": 4, + "timeout": 150, + "qemu_extra": ["-device", "qemu-xhci,id=xhci2", + "-device", "usb-kbd,bus=xhci2.0,port=2,id=rkbd"], + "qmp_sequence": [ + {"delay": 8, "command": "device_del", "arguments": {"id": "rkbd"}}, + {"delay": 14, "command": "device_add", + "arguments": {"driver": "usb-kbd", "bus": "xhci2.0", "port": "2", "id": "rkbd2"}}, + ], + "expect": r"(?s)(?=.*usb-hid-keyboard: ok \(device (\d+)\b" + r"[\s\S]*port \d+ disconnected" + r"[\s\S]*device-manager: child removed" + r"[\s\S]*device-manager: reaping \S*usb-hid-keyboard" + r"[\s\S]*device-manager: delegated device \d+ to /system/drivers/usb-hid-keyboard" + r"[\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.