mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
chmod: match GNU error
Related to #2260 Signed-off-by: Dean Li <deantvv@gmail.com>
This commit is contained in:
parent
c08eae8e9a
commit
fe25b51a66
2 changed files with 23 additions and 1 deletions
|
@ -282,6 +282,26 @@ fn test_chmod_reference_file() {
|
|||
run_single_test(&tests[0], at, ucmd);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_permission_denied() {
|
||||
let scene = TestScenario::new(util_name!());
|
||||
let at = &scene.fixtures;
|
||||
|
||||
at.mkdir("d/");
|
||||
at.mkdir("d/no-x");
|
||||
at.mkdir("d/no-x/y");
|
||||
|
||||
scene.ucmd().arg("u=rw").arg("d/no-x").succeeds();
|
||||
|
||||
scene
|
||||
.ucmd()
|
||||
.arg("-R")
|
||||
.arg("o=r")
|
||||
.arg("d")
|
||||
.fails()
|
||||
.stderr_is("chmod: 'd/no-x/y': Permission denied");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_chmod_recursive() {
|
||||
let _guard = UMASK_MUTEX.lock();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue