mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
chroot: add a new test to verify that 'chroot / ls -al' works
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// spell-checker:ignore (words) araba newroot userspec chdir
|
||||
// spell-checker:ignore (words) araba newroot userspec chdir pwd's
|
||||
|
||||
use crate::common::util::*;
|
||||
|
||||
@@ -162,3 +162,22 @@ fn test_chroot_skip_chdir() {
|
||||
print!("Test skipped; requires root user");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_chroot_extra_arg() {
|
||||
let ts = TestScenario::new(util_name!());
|
||||
let at = &ts.fixtures;
|
||||
|
||||
let dir = "CHROOT_DIR";
|
||||
at.mkdir(dir);
|
||||
let env_cd = std::env::current_dir().unwrap();
|
||||
// Verify that -P is pwd's and not chroot
|
||||
if let Ok(result) = run_ucmd_as_root(&ts, &[dir, "pwd", "-P"]) {
|
||||
assert_eq!(
|
||||
result.success().no_stderr().stdout_str(),
|
||||
env_cd.to_str().unwrap()
|
||||
);
|
||||
} else {
|
||||
print!("Test skipped; requires root user");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user