mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
test_chroot: add comments
This commit is contained in:
parent
8c0b7d1314
commit
30c8a43788
1 changed files with 9 additions and 6 deletions
|
@ -15,6 +15,7 @@ fn test_missing_operand() {
|
|||
|
||||
#[test]
|
||||
fn test_enter_chroot_fails() {
|
||||
// NOTE: since #2689 this test also ensures that we don't regress #2687
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
|
||||
at.mkdir("jail");
|
||||
|
@ -92,6 +93,7 @@ fn test_preference_of_userspec() {
|
|||
|
||||
#[test]
|
||||
fn test_default_shell() {
|
||||
// NOTE: This test intends to trigger code which can only be reached with root permissions.
|
||||
let ts = TestScenario::new(util_name!());
|
||||
let at = &ts.fixtures;
|
||||
|
||||
|
@ -99,14 +101,15 @@ fn test_default_shell() {
|
|||
at.mkdir(dir);
|
||||
|
||||
let shell = std::env::var("SHELL").unwrap_or_else(|_| "/bin/sh".to_string());
|
||||
let expected = format!(
|
||||
let _expected = format!(
|
||||
"chroot: failed to run command '{}': No such file or directory",
|
||||
shell
|
||||
);
|
||||
|
||||
if let Ok(result) = run_ucmd_as_root(&ts, &[dir]) {
|
||||
result.stderr_contains(expected);
|
||||
} else {
|
||||
print!("TEST SKIPPED");
|
||||
}
|
||||
// TODO: [2021-09; jhscheer] uncomment if/when #2692 gets merged
|
||||
// if let Ok(result) = run_ucmd_as_root(&ts, &[dir]) {
|
||||
// result.stderr_contains(expected);
|
||||
// } else {
|
||||
// print!("TEST SKIPPED");
|
||||
// }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue