Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
YamasouA committed Nov 17, 2024
1 parent 6b570a1 commit 3365ecf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/contest/contest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)]
Expand Down
11 changes: 8 additions & 3 deletions tests/contest/contest/src/tests/kill/kill_test.rs
Original file line number Diff line number Diff line change
@@ -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();
Expand Down Expand Up @@ -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")),
},
));
Expand Down Expand Up @@ -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")),
},
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/contest/contest/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -19,4 +20,3 @@ pub mod seccomp;
pub mod seccomp_notify;
pub mod sysctl;
pub mod tlb;
pub mod kill;

0 comments on commit 3365ecf

Please sign in to comment.