From ea435668799b2a8b2417998bebe28260274f7676 Mon Sep 17 00:00:00 2001 From: "gominimal-aw-bot[bot]" <281738952+gominimal-aw-bot[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 20:20:31 +0000 Subject: [PATCH] test(switch): exclude filesystem tests from Miri The miri job in nightly-tests aborts on the first switch test that touches the filesystem: tempfile::tempdir() calls mkdir, which is unsupported under Miri's default isolation. Six resolver tests hit this, so Miri verified almost nothing before aborting. Annotate those six tests with #[cfg_attr(miri, ignore)] so Miri still covers the pure subnet/MAC/vsock primitives it was added to check. The tests run unchanged outside Miri. Co-Authored-By: Claude Opus 4.8 --- crates/switch/src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/switch/src/lib.rs b/crates/switch/src/lib.rs index 082304421..56fd90fc1 100644 --- a/crates/switch/src/lib.rs +++ b/crates/switch/src/lib.rs @@ -365,6 +365,10 @@ mod tests { assert!(DEFAULT_GVPROXY_BIN.ends_with(GVPROXY_FILE)); } + // The resolver tests below create real temp dirs; Miri's default isolation + // has no `mkdir`, so exclude them there. The miri lane still covers the pure + // subnet/MAC/vsock primitives above, which is what it was added to check. + #[cfg_attr(miri, ignore)] #[test] fn installed_gvproxy_prefers_existing_user_local_install() { let _g = ENV_LOCK.lock().unwrap(); @@ -376,6 +380,7 @@ mod tests { unsafe { std::env::remove_var("MINIMAL_BIN") }; } + #[cfg_attr(miri, ignore)] #[test] fn ignores_an_upstream_named_binary_in_the_bin_dir() { // A foreign `gvproxy` (podman's, crc's) sitting in the bin dir must not @@ -396,6 +401,7 @@ mod tests { // flip on a host that has either binary installed — failing on precisely // the pre-rename hosts the legacy branch exists to serve. + #[cfg_attr(miri, ignore)] #[test] fn falls_back_to_the_current_system_path() { let tmp = tempfile::tempdir().unwrap(); @@ -407,6 +413,7 @@ mod tests { assert_eq!(resolve_installed(None, &system, &legacy), system); } + #[cfg_attr(miri, ignore)] #[test] fn falls_back_to_the_legacy_system_path_when_only_it_exists() { let tmp = tempfile::tempdir().unwrap(); @@ -417,6 +424,7 @@ mod tests { assert_eq!(resolve_installed(None, &system, &legacy), legacy); } + #[cfg_attr(miri, ignore)] #[test] fn reports_the_current_system_path_when_neither_exists() { let tmp = tempfile::tempdir().unwrap(); @@ -427,6 +435,7 @@ mod tests { assert_eq!(resolve_installed(None, &system, &legacy), system); } + #[cfg_attr(miri, ignore)] #[test] fn user_local_install_beats_both_system_paths() { let tmp = tempfile::tempdir().unwrap();