Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

du test FAIL on tmpfs #301

Open
frikiluser opened this issue Oct 28, 2021 · 2 comments
Open

du test FAIL on tmpfs #301

frikiluser opened this issue Oct 28, 2021 · 2 comments

Comments

@frikiluser
Copy link

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
Copy link
Author

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,

@landley
Copy link
Owner

landley commented Aug 19, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants