]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: df-P.sh: fix intermittent false failure
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 8 Aug 2024 17:37:48 +0000 (18:37 +0100)
committerPádraig Brady <P@draigBrady.com>
Thu, 8 Aug 2024 17:37:48 +0000 (18:37 +0100)
The test writes to the disk and means the space used changes. If this
crosses a number boundary, the heading spacing can change:

-Filesystem     1024-blocks  Used Available Capacity Mounted on
+Filesystem     1024-blocks   Used Available Capacity Mounted on

* tests/df/df-P.sh: Squash spaces with tr to avoid alignment variations.

tests/df/df-P.sh

index 12fefb6f51724f8551e9c267aa88fc46b682dd9c..b559c3033e0eb35d33ec1cf982c76f72c8b1075b 100755 (executable)
@@ -29,8 +29,8 @@ BLOCK_SIZE=1M df -P . > t2 || fail=1
 # while for 1K, it would be
 # Filesystem         1024-blocks      Used Available Capacity Mounted on
 
-head -n1 t1 > exp || fail=1
-head -n1 t2 > out || fail=1
+head -n1 t1 | tr -s ' ' > exp || framework_failure_
+head -n1 t2 | tr -s ' ' > out || framework_failure_
 
 compare exp out || fail=1