toybox icon indicating copy to clipboard operation
toybox copied to clipboard

du test FAIL on tmpfs

Open frikiluser opened this issue 4 years ago • 2 comments

Hi,

When running make tests on /tmp (tmpfs) I've found that first du test FAILs.

FAIL: du (no options)
echo -ne '' | du -k du_test
--- expected    2021-10-28 09:24:55.328840721 +0000
+++ actual      2021-10-28 09:24:55.332840738 +0000
@@ -1,2 +1,2 @@
-4      du_test/test
-8      du_test
+0      du_test/test
+0      du_test

I think it's not a big surprise that different filesystems reports different file sizes in that situation as the test ifself skips on Darwin.

PS: Coreutils du also report 0 for empty dirs on tmpfs.

Hope it helps. Regards,

frikiluser avatar Oct 28 '21 09:10 frikiluser

Still can be reproduced building toybox on /tmp/ (Debian Sid).

May be it can be skipped like this:

if [ "$(stat --format %b . 2>/dev/null)" != "0" ]; then
  echo "$SHOWSKIP: du (tmpfs-like filesystem)"
  return 2>/dev/null
  exit
fi

Regards,

frikiluser avatar Aug 19 '22 00:08 frikiluser

The "extended attributes present" test at the start isn't ideal either. I'm working to get the test suite running under mkroot, and this is one of the the tests I have slated to redo in that environment.

P.S. several tests are also broken under macos, ala http://lists.landley.net/pipermail/toybox-landley.net/2022-July/029058.html

landley avatar Aug 19 '22 10:08 landley