summaryrefslogtreecommitdiffstats
path: root/tests/by-util/test_ls.rs
diff options
context:
space:
mode:
authorDaniel Hofstetter <daniel.hofstetter@42dh.com>2023-09-22 10:23:01 +0200
committerDaniel Hofstetter <daniel.hofstetter@42dh.com>2023-09-22 10:43:23 +0200
commit0794d1338df62f303e7077e3397acd1873dc2766 (patch)
tree5a093acde4e11df8176602b605fba4dee6fa6fdc /tests/by-util/test_ls.rs
parenta2691c9f4a68a508ae795cf5dbff9b4c0840f338 (diff)
ls: fix test which fails if /tmp uses tmpfs
Diffstat (limited to 'tests/by-util/test_ls.rs')
-rw-r--r--tests/by-util/test_ls.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/by-util/test_ls.rs b/tests/by-util/test_ls.rs
index 87b306656..23dfafa32 100644
--- a/tests/by-util/test_ls.rs
+++ b/tests/by-util/test_ls.rs
@@ -2,7 +2,7 @@
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
-// spell-checker:ignore (words) READMECAREFULLY birthtime doesntexist oneline somebackup lrwx somefile somegroup somehiddenbackup somehiddenfile tabsize aaaaaaaa bbbb cccc dddddddd ncccc neee naaaaa nbcdef nfffff dired subdired
+// spell-checker:ignore (words) READMECAREFULLY birthtime doesntexist oneline somebackup lrwx somefile somegroup somehiddenbackup somehiddenfile tabsize aaaaaaaa bbbb cccc dddddddd ncccc neee naaaaa nbcdef nfffff dired subdired tmpfs
#[cfg(any(unix, feature = "feat_selinux"))]
use crate::common::util::expected_result;
@@ -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);