From 5c6cd18599ad749e72b5021a754edeb86080ff9b Mon Sep 17 00:00:00 2001 From: vasilito Date: Mon, 20 Jul 2026 11:23:33 +0900 Subject: [PATCH] tests: fix UHCI proof marker for interpolated controller name The UHCI runtime proof grepped for the literal 'uhcid: controller initialized, polling ports' but uhcid main.rs:535 emits it with ctrl.name interpolated mid-string: info!("uhcid: {} controller initialized, polling ports", ctrl.name); producing e.g. 'uhcid: 0000:00:01.2_uhci controller initialized, polling ports'. The literal grep never matched and the proof would fail 100% of the time at runtime. Fix: grep with a regex anchored on the stable suffix: grep -Eq 'uhcid: .* controller initialized, polling ports' The ohcid, ehcid, usbhidd, and usbscsid markers were re-audited against driver source and are all correct (ohcid main.rs:341 has no interpolation; ehcid main.rs:294 interpolates after the matched comma prefix; all others interpolate at line ends matched by prefix). Only the UHCI init-done marker was broken. Comment header and error echo updated to document the interpolated form and point at main.rs:535 so the regex is not 'simplified' back to a literal. No QEMU runs. bash -n passes. Verified the regex matches the real emitted format and does not cross-match ohcid's identical suffix (the 'uhcid:' prefix anchor disambiguates). --- local/scripts/test-uhci-runtime-qemu.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/local/scripts/test-uhci-runtime-qemu.sh b/local/scripts/test-uhci-runtime-qemu.sh index fecc4ca0ec..1288c881c7 100755 --- a/local/scripts/test-uhci-runtime-qemu.sh +++ b/local/scripts/test-uhci-runtime-qemu.sh @@ -16,7 +16,9 @@ # proof style. Proof markers come straight from # local/recipes/drivers/uhcid/source/src/main.rs: # "UHCI USB 1.1 at " (main.rs:487 — controller bound) -# "uhcid: controller initialized, polling ports" (main.rs:535 — init done) +# "uhcid: controller initialized, polling ports" (main.rs:535 — init +# done; note ctrl.name is interpolated, e.g. "uhcid: uhci0_uhci controller +# initialized, polling ports", so the grep uses a regex, not a literal) # "uhcid: port connect detected" (main.rs:545 — port event) # "uhcid: port device : class " (main.rs:551 — enumerated) @@ -149,9 +151,10 @@ if [[ "$check_mode" -eq 1 ]]; then fi # 2. Frame list allocated and the polling loop started. - if ! grep -q "uhcid: controller initialized, polling ports" "$log_file"; then + if ! grep -Eq 'uhcid: .* controller initialized, polling ports' "$log_file"; then echo "ERROR: uhcid did not finish controller initialization" >&2 - echo " Expected: 'uhcid: controller initialized, polling ports'" >&2 + echo " Expected: 'uhcid: controller initialized, polling ports'" >&2 + echo " (main.rs:535 interpolates ctrl.name, e.g. 'uhcid: uhci0_uhci controller initialized, polling ports')" >&2 echo " See $log_file" >&2 exit 1 fi