mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
chroot: add 'test_default_shell`
This commit is contained in:
parent
94fbe1edef
commit
8db8d8ac4e
1 changed files with 21 additions and 0 deletions
|
@ -89,3 +89,24 @@ fn test_preference_of_userspec() {
|
||||||
println!("result.stdout = {}", result.stdout_str());
|
println!("result.stdout = {}", result.stdout_str());
|
||||||
println!("result.stderr = {}", result.stderr_str());
|
println!("result.stderr = {}", result.stderr_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_default_shell() {
|
||||||
|
let ts = TestScenario::new(util_name!());
|
||||||
|
let at = &ts.fixtures;
|
||||||
|
|
||||||
|
let dir = "CHROOT_DIR";
|
||||||
|
at.mkdir(dir);
|
||||||
|
|
||||||
|
let shell = std::env::var("SHELL").unwrap_or_else(|_| "/bin/sh".to_string());
|
||||||
|
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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue