Skip to content

Commit

Permalink
fix the test coverage issues and resolve the lint errors
Browse files Browse the repository at this point in the history
Signed-off-by: nayuta-ai <nayuta723@gmail.com>
  • Loading branch information
nayuta-ai committed Oct 15, 2024
1 parent 448504e commit d3600be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down
6 changes: 4 additions & 2 deletions tests/contest/runtimetest/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}
}
}

0 comments on commit d3600be

Please sign in to comment.