const TROUBLESHOOTING_MD: &str = include_str!("../doc/guide/src/troubleshooting.md");
const RUST_INIT_RS: &str = include_str!("../src/vmm/rust_init.rs");
#[test]
fn troubleshooting_send_sys_rdy_doc_matches_emit_fmt() {
assert!(
RUST_INIT_RS.contains("send_sys_rdy failed within boot budget"),
"src/vmm/rust_init.rs must emit a WARN containing \
`send_sys_rdy failed within boot budget`; if you rewrote \
the WARN, update doc/guide/src/troubleshooting.md and this \
test in the same change",
);
assert!(
RUST_INIT_RS.contains(
"https://likewhatevs.github.io/ktstr/guide/troubleshooting.html#send_sys_rdy-timeout"
),
"src/vmm/rust_init.rs must emit the published docs URL \
`https://likewhatevs.github.io/ktstr/guide/troubleshooting.html#send_sys_rdy-timeout`; \
a repo-source path is not clickable from a VM dmesg",
);
for field in [
"port_exists",
"kern_addrs_sent",
"budget_ms",
"elapsed_ms",
"vcpus",
] {
assert!(
RUST_INIT_RS.contains(field),
"src/vmm/rust_init.rs must emit the `{field}` structured \
field in the send_sys_rdy WARN; troubleshooting.md \
documents it",
);
}
assert!(
TROUBLESHOOTING_MD.contains("send_sys_rdy failed within boot budget"),
"troubleshooting.md must quote the WARN message \
`send_sys_rdy failed within boot budget`",
);
assert!(
TROUBLESHOOTING_MD.contains(
"https://likewhatevs.github.io/ktstr/guide/troubleshooting.html#send_sys_rdy-timeout"
),
"troubleshooting.md must show the published docs URL the \
WARN emits, so an operator landing on this section can \
confirm they're at the right page",
);
for field in ["port_exists", "kern_addrs_sent", "budget_ms", "elapsed_ms"] {
assert!(
TROUBLESHOOTING_MD.contains(field),
"troubleshooting.md must document the `{field}` \
diagnostic field from the send_sys_rdy WARN",
);
}
}