mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07: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:
@@ -81,11 +81,13 @@ fn test_env_version() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(unix)]
|
||||
fn test_env_permissions() {
|
||||
// Try to execute `empty` in test fixture, that does not have exec permission.
|
||||
new_ucmd!()
|
||||
.arg(".")
|
||||
.arg("./empty")
|
||||
.fails_with_code(126)
|
||||
.stderr_is("env: '.': Permission denied\n");
|
||||
.stderr_is("env: './empty': Permission denied\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Vendored
Reference in New Issue
Block a user