Skip to content

Commit 58bde54

Browse files
committed
test/cp: Fix "No such file or directory" error in test_acl_preserve
Fix a bug in test_acl_preserve that was causing "setfacl: a: No such file or directory" error messages when running with `cargo test --features=cp test_acl_preserve`. Changes: - Use plus_as_string on path1 to generate the correct absolute path - Move the file path generation closer to where it's used for better code organization
1 parent 181885b commit 58bde54

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/by-util/test_cp.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4055,11 +4055,11 @@ fn test_acl_preserve() {
40554055
at.mkdir(path2);
40564056
at.touch(file);
40574057

4058-
let path = at.plus_as_string(file);
4058+
let path1 = at.plus_as_string(path1);
40594059
// calling the command directly. xattr requires some dev packages to be installed
40604060
// and it adds a complex dependency just for a test
40614061
match Command::new("setfacl")
4062-
.args(["-m", "group::rwx", path1])
4062+
.args(["-m", "group::rwx", &path1])
40634063
.status()
40644064
.map(|status| status.code())
40654065
{
@@ -4074,6 +4074,7 @@ fn test_acl_preserve() {
40744074
}
40754075
}
40764076

4077+
let path = at.plus_as_string(file);
40774078
scene.ucmd().args(&["-p", &path, path2]).succeeds();
40784079

40794080
assert!(compare_xattrs(&file, &file_target));

0 commit comments

Comments
 (0)