Tests: Disable 'stdbuf' when TAP autotime is disabled
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 17 Jan 2024 15:50:26 +0000 (10:50 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 29 Feb 2024 20:33:00 +0000 (15:33 -0500)
The 'stdbuf' command is used by default in 'tap-driver.sh' to force line
buffering. It was added to help with TAP autotime output to log files.

However, 'stdbuf' causes issues in our 32-64 integration tests where we
mix 32 and 64 bit binaries. It uses an LD_PRELOAD library that is not
in a multiarch path which results in the following warning message on
stderr when a 32-bit binary is executed on a 64-bit system:

  ERROR: ld.so: object '/usr/libexec/coreutils/libstdbuf.so' from
  LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.

Many of our tests compare the content of stderr to an expected file
which results in their failure.

We already have an environment variable "TAP_AUTOTIME" to disable the
autotime feature, make it disable the use of 'stdbuf' as well.

Change-Id: I307cbfcddd7772f69e8211c51b03fb9a3da8e841
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/utils/tap-driver.sh

index 1e61e1f2870746a8d3aa11f6903f7e8a624235a7..9baa4d923f683758e3a0f6b0cfc2ff3340b8fa18 100755 (executable)
@@ -150,7 +150,11 @@ TIME_SCRIPT="$(realpath -e -- "$(dirname "$0")")/tap/clock"
     # the outputs in the resulting file for half written lines, eg.
     #   ok 93 - Tes# PERROR - xxxx
     #   t some function
-    stdbuf -eL -oL -- "$@"
+    if [ "${TAP_AUTOTIME:-}" != 0 ]; then
+      stdbuf -eL -oL -- "$@"
+    else
+      "$@"
+    fi
     echo $?
   ) | LC_ALL=C ${AM_TAP_AWK-awk} \
         -v me="$me" \
This page took 0.027209 seconds and 4 git commands to generate.