1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

test_env: Try to execute an empty file instead of .

For some unclear reason, Android _now_ sometimes returns an
IsADirectory error, instead of PermissionDenied, when trying
to execute `.`.

Since this test really wants to test PermissionDenied, we try
to execute a file in the fixture instead, that doesn't have
exec permission.

Also, limit this test to Unix.

Fixes part of #7542.
This commit is contained in:
Nicolas Boichat 2025-03-23 14:47:05 +01:00
parent 152dada379
commit 7eb873c326
2 changed files with 4 additions and 2 deletions

View file

@ -81,11 +81,13 @@ fn test_env_version() {
} }
#[test] #[test]
#[cfg(unix)]
fn test_env_permissions() { fn test_env_permissions() {
// Try to execute `empty` in test fixture, that does not have exec permission.
new_ucmd!() new_ucmd!()
.arg(".") .arg("./empty")
.fails_with_code(126) .fails_with_code(126)
.stderr_is("env: '.': Permission denied\n"); .stderr_is("env: './empty': Permission denied\n");
} }
#[test] #[test]

0
tests/fixtures/env/empty vendored Normal file
View file