From d3600be1091db20e0a4cd23580c75975e77366c5 Mon Sep 17 00:00:00 2001 From: nayuta-ai Date: Tue, 15 Oct 2024 23:50:58 +0900 Subject: [PATCH] fix the test coverage issues and resolve the lint errors Signed-off-by: nayuta-ai --- .../contest/src/tests/linux_masked_paths/masked_paths.rs | 5 ++--- tests/contest/runtimetest/src/tests.rs | 6 ++++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/contest/contest/src/tests/linux_masked_paths/masked_paths.rs b/tests/contest/contest/src/tests/linux_masked_paths/masked_paths.rs index 530d5231c..883953c1f 100644 --- a/tests/contest/contest/src/tests/linux_masked_paths/masked_paths.rs +++ b/tests/contest/contest/src/tests/linux_masked_paths/masked_paths.rs @@ -54,9 +54,8 @@ fn check_masked_paths() -> TestResult { test_inside_container(spec, &|bundle_path| { use std::{fs, io}; let test_dir = bundle_path.join(&masked_dir_sub); - - if let Err(e) = fs::create_dir_all(&test_dir) { - bail!(e) + if let Err(e) = fs::create_dir_all(&test_dir) { + bail!(e) } match fs::File::create(test_dir.join("tmp")) { diff --git a/tests/contest/runtimetest/src/tests.rs b/tests/contest/runtimetest/src/tests.rs index d9c9e5013..930d4a98e 100644 --- a/tests/contest/runtimetest/src/tests.rs +++ b/tests/contest/runtimetest/src/tests.rs @@ -551,12 +551,13 @@ pub fn validate_masked_paths(spec: &Spec) { let masked_paths = match linux.masked_paths() { Some(p) => p, None => { - eprintln!("in readonly paths, expected some readonly paths to be set, found none"); + eprintln!("in masked paths, expected some masked paths to be set, found none"); return; } }; if masked_paths.is_empty() { + eprintln!("in masked paths, expected some masked paths to be set, found none"); return; } @@ -572,7 +573,8 @@ pub fn validate_masked_paths(spec: &Spec) { return; } } else { - /* Expected */ + eprintln!("in masked paths, error in testing read access for path {path} : {e:?}"); + return; } } }