diff mbox series

coreutils: Fix intermittent ptest issue

Message ID 20240808110338.328403-1-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit ca6f0d81fc7d5e53d216e5131724e826369fd4ae
Headers show
Series coreutils: Fix intermittent ptest issue | expand

Commit Message

Richard Purdie Aug. 8, 2024, 11:03 a.m. UTC
The test writes to the disk and means the space used changes. If this
crosses a number boundary, the heading spacing can change causing a test
failure. This was triggered by a recent gcc upgrade.

Add a fix for this which has been shared with upstream.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 .../coreutils/intermittent-testfailure.patch  | 29 +++++++++++++++++++
 meta/recipes-core/coreutils/coreutils_9.5.bb  |  1 +
 2 files changed, 30 insertions(+)
 create mode 100644 meta/recipes-core/coreutils/coreutils/intermittent-testfailure.patch
diff mbox series

Patch

diff --git a/meta/recipes-core/coreutils/coreutils/intermittent-testfailure.patch b/meta/recipes-core/coreutils/coreutils/intermittent-testfailure.patch
new file mode 100644
index 00000000000..dc1e1592e12
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils/intermittent-testfailure.patch
@@ -0,0 +1,29 @@ 
+tests/df: Fix intermittent test failure
+
+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
+
+The test is to make sure the 1024 blocks element remains the same and
+the spacing doesn't matter. Therefore strip any duplicate spaces using tr.
+
+Upstream-Status: Submitted [https://github.com/coreutils/coreutils/pull/88]
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+Index: coreutils-9.5/tests/df/df-P.sh
+===================================================================
+--- coreutils-9.5.orig/tests/df/df-P.sh
++++ coreutils-9.5/tests/df/df-P.sh
+@@ -20,8 +20,8 @@
+ print_ver_ df
+ 
+ 
+-              df -P . > t1 || fail=1
+-BLOCK_SIZE=1M df -P . > t2 || fail=1
++              df -P . | tr -s ' ' > t1 || fail=1
++BLOCK_SIZE=1M df -P . | tr -s ' ' > t2 || fail=1
+ 
+ # Since file system utilization may be changing, compare only df's header line.
+ # That records the block size.  E.g., for "1M", it would be:
diff --git a/meta/recipes-core/coreutils/coreutils_9.5.bb b/meta/recipes-core/coreutils/coreutils_9.5.bb
index 178dadc3c5f..af0fcdcc4cf 100644
--- a/meta/recipes-core/coreutils/coreutils_9.5.bb
+++ b/meta/recipes-core/coreutils/coreutils_9.5.bb
@@ -16,6 +16,7 @@  inherit autotools gettext texinfo
 SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \
            file://remove-usr-local-lib-from-m4.patch \
            file://0001-local.mk-fix-cross-compiling-problem.patch \
+           file://intermittent-testfailure.patch \
            file://run-ptest \
            "
 SRC_URI[sha256sum] = "cd328edeac92f6a665de9f323c93b712af1858bc2e0d88f3f7100469470a1b8a"