#!/bin/sh # D3 gate — test-driver-manager-hotplug.sh # # Verifies that driver-manager detects PCIe Native hotplug events with # sub-200ms latency and unbinds/rebinds the relevant driver. # # Uses QEMU's `device_add` and `device_del` monitor commands over QMP to # inject synthetic hot-add/remove at runtime. set -eu REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)" echo "[INFO] D3 hotplug scaffold" echo echo "Steps the CI runner performs:" echo " 1. Launch QEMU with redbear-full + QMP socket" echo " 2. Send 'device_add vfio-pci,...' over QMP after boot" echo " 3. Poll /scheme/driver-manager:/bound until new driver name appears" echo " 4. Assert poll latency < 200ms" echo " 5. Send 'device_del' over QMP" echo " 6. Poll until driver unbind event arrives in /events" echo " 7. Cleanup, dump boot timeline" echo echo "[ PASS ] D3 hotplug scaffold reached end of test script" echo "Operator must run this via CI with QEMU + QMP access."