diff --git a/tests/by-util/test_ls.rs b/tests/by-util/test_ls.rs index 87b3066569a..79a04b268ff 100644 --- a/tests/by-util/test_ls.rs +++ b/tests/by-util/test_ls.rs @@ -3608,9 +3608,13 @@ fn test_ls_dired_complex() { let mut cmd = scene.ucmd(); cmd.arg("--dired").arg("-l").arg("d"); let result = cmd.succeeds(); - // Number of blocks + + // Number of blocks. We run this test only if the default size of a newly created directory is + // 4096 bytes to prevent it from failing where this is not the case (e.g. using tmpfs for /tmp). #[cfg(target_os = "linux")] - result.stdout_contains(" total 4"); + if at.metadata("d/d").len() == 4096 { + result.stdout_contains(" total 4"); + } let output = result.stdout_str().to_string(); println!("Output:\n{}", output);