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).
This commit is contained in:
2026-07-20 11:23:33 +09:00
parent ee1da17617
commit 5c6cd18599
+6 -3
View File
@@ -16,7 +16,9 @@
# proof style. Proof markers come straight from
# local/recipes/drivers/uhcid/source/src/main.rs:
# "UHCI USB 1.1 at <pci_path>" (main.rs:487 — controller bound)
# "uhcid: controller initialized, polling ports" (main.rs:535 — init done)
# "uhcid: <name> 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 <n> connect detected" (main.rs:545 — port event)
# "uhcid: port <n> device <vid>:<pid> class <c>" (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: <name> 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