diff --git a/tests/contest/contest/src/main.rs b/tests/contest/contest/src/main.rs index f0a089ab3..a204a8100 100644 --- a/tests/contest/contest/src/main.rs +++ b/tests/contest/contest/src/main.rs @@ -16,6 +16,7 @@ use crate::tests::hooks::get_hooks_tests; use crate::tests::hostname::get_hostname_test; use crate::tests::intel_rdt::get_intel_rdt_test; use crate::tests::io_priority::get_io_priority_test; +use crate::tests::kill::get_kill_test; use crate::tests::lifecycle::{ContainerCreate, ContainerLifecycle}; use crate::tests::linux_ns_itype::get_ns_itype_tests; use crate::tests::mounts_recursive::get_mounts_recursive_test; @@ -29,7 +30,6 @@ use crate::tests::seccomp::get_seccomp_test; use crate::tests::seccomp_notify::get_seccomp_notify_test; use crate::tests::sysctl::get_sysctl_test; use crate::tests::tlb::get_tlb_test; -use crate::tests::kill::get_kill_test; use crate::utils::support::{set_runtime_path, set_runtimetest_path}; #[derive(Parser, Debug)] diff --git a/tests/contest/contest/src/tests/kill/kill_test.rs b/tests/contest/contest/src/tests/kill/kill_test.rs index 4edc79ef1..1f9f7514f 100644 --- a/tests/contest/contest/src/tests/kill/kill_test.rs +++ b/tests/contest/contest/src/tests/kill/kill_test.rs @@ -1,6 +1,7 @@ +use anyhow::anyhow; use test_framework::{ConditionalTest, TestGroup, TestResult}; + use crate::tests::lifecycle::ContainerLifecycle; -use anyhow::anyhow; fn run_kill_test_cases() -> TestResult { let mut container = ContainerLifecycle::new(); @@ -39,7 +40,9 @@ fn run_kill_test_cases() -> TestResult { "kill created container", match container.kill() { TestResult::Passed => TestResult::Passed, - TestResult::Failed(_) => TestResult::Failed(anyhow!("Expected success but got failure")), + TestResult::Failed(_) => { + TestResult::Failed(anyhow!("Expected success but got failure")) + } _ => TestResult::Failed(anyhow!("Unexpected test result")), }, )); @@ -75,7 +78,9 @@ fn run_kill_test_cases() -> TestResult { "kill running container", match container.kill() { TestResult::Passed => TestResult::Passed, - TestResult::Failed(_) => TestResult::Failed(anyhow!("Expected success but got failure")), + TestResult::Failed(_) => { + TestResult::Failed(anyhow!("Expected success but got failure")) + } _ => TestResult::Failed(anyhow!("Unexpected test result")), }, )); diff --git a/tests/contest/contest/src/tests/lifecycle/container_lifecycle.rs b/tests/contest/contest/src/tests/lifecycle/container_lifecycle.rs index 639c00c53..231a2ea1b 100644 --- a/tests/contest/contest/src/tests/lifecycle/container_lifecycle.rs +++ b/tests/contest/contest/src/tests/lifecycle/container_lifecycle.rs @@ -33,7 +33,7 @@ impl ContainerLifecycle { } } - pub fn set_id(&mut self, id: &str) { + pub fn set_id(&mut self, id: &str) { self.container_id = id.to_string(); } diff --git a/tests/contest/contest/src/tests/mod.rs b/tests/contest/contest/src/tests/mod.rs index cfd8f9068..5edfe5c25 100644 --- a/tests/contest/contest/src/tests/mod.rs +++ b/tests/contest/contest/src/tests/mod.rs @@ -6,6 +6,7 @@ pub mod hooks; pub mod hostname; pub mod intel_rdt; pub mod io_priority; +pub mod kill; pub mod lifecycle; pub mod linux_ns_itype; pub mod mounts_recursive; @@ -19,4 +20,3 @@ pub mod seccomp; pub mod seccomp_notify; pub mod sysctl; pub mod tlb; -pub mod kill;