Skip to content

Commit

Permalink
add read access test when root readonly is false
Browse files Browse the repository at this point in the history
Signed-off-by: sat0ken <[email protected]>
  • Loading branch information
sat0ken committed Nov 24, 2024
1 parent db6dc3c commit 6171950
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions tests/contest/runtimetest/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -568,24 +568,31 @@ pub fn test_validate_root_readonly(spec: &Spec) {
}
if let Err(e) = test_dir_read_access("/") {
let errno = Errno::from_raw(e.raw_os_error().unwrap());
if errno == Errno::EROFS {
/* This is expected */
} else {
if errno {

Check failure on line 571 in tests/contest/runtimetest/src/tests.rs

View workflow job for this annotation

GitHub Actions / tests (x86_64, gnu)

mismatched types

Check failure on line 571 in tests/contest/runtimetest/src/tests.rs

View workflow job for this annotation

GitHub Actions / check (x86_64, musl)

mismatched types

Check failure on line 571 in tests/contest/runtimetest/src/tests.rs

View workflow job for this annotation

GitHub Actions / oci-validation-rust (x86_64, musl)

mismatched types
eprintln!(
"readonly root filesystem, error in testing read access for path /, error: {}",
"readonly root filesystem, but error in testing read access for path /, error: {}",
errno
);
}
}
} else if let Err(e) = test_dir_write_access("/") {
if e.raw_os_error().is_some() {
} else {
if let Err(e) = test_dir_write_access("/") {
let errno = Errno::from_raw(e.raw_os_error().unwrap());
eprintln!(
"readt only root filesystem is false but write access for path / is err, error: {}",
errno
);
} else {
/* This is expected */
if errno {

Check failure on line 581 in tests/contest/runtimetest/src/tests.rs

View workflow job for this annotation

GitHub Actions / tests (x86_64, gnu)

mismatched types

Check failure on line 581 in tests/contest/runtimetest/src/tests.rs

View workflow job for this annotation

GitHub Actions / check (x86_64, musl)

mismatched types

Check failure on line 581 in tests/contest/runtimetest/src/tests.rs

View workflow job for this annotation

GitHub Actions / oci-validation-rust (x86_64, musl)

mismatched types
eprintln!(
"readonly root filesystem is false, but error in testing write access for path /, error: {}",
errno
);
}
}
if let Err(e) = test_dir_read_access("/") {
let errno = Errno::from_raw(e.raw_os_error().unwrap());
if errno {

Check failure on line 590 in tests/contest/runtimetest/src/tests.rs

View workflow job for this annotation

GitHub Actions / tests (x86_64, gnu)

mismatched types

Check failure on line 590 in tests/contest/runtimetest/src/tests.rs

View workflow job for this annotation

GitHub Actions / check (x86_64, musl)

mismatched types

Check failure on line 590 in tests/contest/runtimetest/src/tests.rs

View workflow job for this annotation

GitHub Actions / oci-validation-rust (x86_64, musl)

mismatched types
eprintln!(
"readonly root filesystem is false, but error in testing read access for path /, error: {}",
errno
);
}
}
}
}
Expand Down

0 comments on commit 6171950

Please sign in to comment.