ext stores extended attributes in a way that makes all the numbers in
the test incorrect. For now, just disable the test in that case.
---
 tests/du.test | 9 +++++++++
 1 file changed, 9 insertions(+)
From 3ab7fb58e4d976a8634f3e8efac09714e019019d Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Mon, 5 Aug 2019 10:38:32 -0700
Subject: [PATCH] du: disable the tests if we have SELinux.

ext stores extended attributes in a way that makes all the numbers in
the test incorrect. For now, just disable the test in that case.
---
 tests/du.test | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests/du.test b/tests/du.test
index a0960743..ae610256 100755
--- a/tests/du.test
+++ b/tests/du.test
@@ -2,6 +2,15 @@
 
 [ -f testing.sh ] && . testing.sh
 
+# ext stores extended attributes in a way that makes all the numbers in the
+# tests below incorrect.
+# TODO: include a read-only ext file system that we can mount for the tests?
+if [ "$(stat --format %C . 2>/dev/null)" != "?" ]; then
+  echo "$SHOWSKIP: du (SELinux extended attributes present)"
+  return 2>/dev/null
+  exit
+fi
+
 #testing "name" "command" "result" "infile" "stdin"
 
 # we only test with -k since getting POSIX version is variable
-- 
2.22.0.770.g0f2c4a37fd-goog

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to