diff --git a/src/agent/Cargo.lock b/src/agent/Cargo.lock index 44a4674440..517088b1ec 100644 --- a/src/agent/Cargo.lock +++ b/src/agent/Cargo.lock @@ -546,6 +546,7 @@ dependencies = [ "scopeguard", "serde", "serde_json", + "serial_test", "slog", "slog-scope", "slog-stdlog", diff --git a/src/agent/Cargo.toml b/src/agent/Cargo.toml index 3715da42fc..c4864ef50c 100644 --- a/src/agent/Cargo.toml +++ b/src/agent/Cargo.toml @@ -20,6 +20,7 @@ scan_fmt = "0.2.3" scopeguard = "1.0.0" thiserror = "1.0.26" regex = "1" +serial_test = "0.5.1" # Async helpers async-trait = "0.1.42" diff --git a/src/agent/src/sandbox.rs b/src/agent/src/sandbox.rs index 6829eb2cf5..ddc18c5c9b 100644 --- a/src/agent/src/sandbox.rs +++ b/src/agent/src/sandbox.rs @@ -464,7 +464,10 @@ mod tests { baremount(src, dst, "bind", MsFlags::MS_BIND, "", logger) } + use serial_test::serial; + #[tokio::test] + #[serial] async fn set_sandbox_storage() { let logger = slog::Logger::root(slog::Discard, o!()); let mut s = Sandbox::new(&logger).unwrap(); @@ -499,6 +502,7 @@ mod tests { } #[tokio::test] + #[serial] async fn remove_sandbox_storage() { skip_if_not_root!(); @@ -555,6 +559,7 @@ mod tests { } #[tokio::test] + #[serial] async fn unset_and_remove_sandbox_storage() { skip_if_not_root!(); @@ -606,6 +611,7 @@ mod tests { } #[tokio::test] + #[serial] async fn unset_sandbox_storage() { let logger = slog::Logger::root(slog::Discard, o!()); let mut s = Sandbox::new(&logger).unwrap(); @@ -689,6 +695,7 @@ mod tests { } #[tokio::test] + #[serial] async fn get_container_entry_exist() { skip_if_not_root!(); let logger = slog::Logger::root(slog::Discard, o!()); @@ -702,6 +709,7 @@ mod tests { } #[tokio::test] + #[serial] async fn get_container_no_entry() { let logger = slog::Logger::root(slog::Discard, o!()); let mut s = Sandbox::new(&logger).unwrap(); @@ -711,6 +719,7 @@ mod tests { } #[tokio::test] + #[serial] async fn add_and_get_container() { skip_if_not_root!(); let logger = slog::Logger::root(slog::Discard, o!()); @@ -722,6 +731,7 @@ mod tests { } #[tokio::test] + #[serial] async fn update_shared_pidns() { skip_if_not_root!(); let logger = slog::Logger::root(slog::Discard, o!()); @@ -740,6 +750,7 @@ mod tests { } #[tokio::test] + #[serial] async fn add_guest_hooks() { let logger = slog::Logger::root(slog::Discard, o!()); let mut s = Sandbox::new(&logger).unwrap(); @@ -763,6 +774,7 @@ mod tests { } #[tokio::test] + #[serial] async fn test_sandbox_set_destroy() { let logger = slog::Logger::root(slog::Discard, o!()); let mut s = Sandbox::new(&logger).unwrap(); diff --git a/src/agent/src/watcher.rs b/src/agent/src/watcher.rs index 51e727ae45..b111aa166f 100644 --- a/src/agent/src/watcher.rs +++ b/src/agent/src/watcher.rs @@ -979,7 +979,10 @@ mod tests { ); } + use serial_test::serial; + #[tokio::test] + #[serial] async fn create_tmpfs() { skip_if_not_root!(); @@ -994,6 +997,7 @@ mod tests { } #[tokio::test] + #[serial] async fn spawn_thread() { skip_if_not_root!(); @@ -1023,6 +1027,7 @@ mod tests { } #[tokio::test] + #[serial] async fn verify_container_cleanup_watching() { skip_if_not_root!();