]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: use stdbuf when stderr and stdout is randomly ordered
authorRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 1 Jun 2017 01:17:25 +0000 (03:17 +0200)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 1 Jun 2017 08:28:02 +0000 (10:28 +0200)
glibc seems to flush stdout before stderr.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
.travis-functions.sh
tests/expected/misc/swaplabel
tests/expected/rename/exit_codes
tests/ts/misc/swaplabel
tests/ts/rename/exit_codes

index 898f57b84a8e4841aaa3a004f4dbabe9a5e32e75..013195f5ce4343019fafcff35d252657a7f39346 100755 (executable)
@@ -125,7 +125,7 @@ function osx_prepare_check
 
        # symlink minimally needed gnu commands into PATH
        mkdir ~/bin
-       for cmd in readlink seq truncate find xargs tar sed; do
+       for cmd in readlink seq stdbuf truncate find xargs tar sed; do
                ln -s /usr/local/bin/g$cmd $HOME/bin/$cmd
        done
        hash -r
index 172f876afa7e383b4e51bdfd32d7d76d2d447c93..790a28c6cfeb1d1b779698e6cd6a3e35e8850fdd 100644 (file)
@@ -1,7 +1,7 @@
 mkswap: error: swap area needs to be at least 10 pages
 mkswap: <swapfile>: insecure permissions <perm>, 0600 suggested.
-mkswap: Label was truncated.
 Setting up swapspace version 1, size = 9 pages (9xPGSZ bytes)
+mkswap: Label was truncated.
 LABEL=1234567890abcde, UUID=12345678-abcd-abcd-abcd-1234567890ab
 LABEL: 1234567890abcde
 UUID:  12345678-abcd-abcd-abcd-1234567890ab
index c577817883e01715147bc3caacca54fadf4263e8..3d53010b2df1623a1bf434cc34de6b50d324ed48 100644 (file)
@@ -2,6 +2,6 @@ RENAME_EXIT_NOTHING: 4
 `rename_exit_codes.1' -> `rename_exit_values.1'
 `rename_exit_codes.2' -> `rename_exit_values.2'
 EXIT_SUCCESS: 0
-rename: rename_exit_values.2: rename to rename_exit_codes.2 failed: Is a directory
 `rename_exit_values.1' -> `rename_exit_codes.1'
+rename: rename_exit_values.2: rename to rename_exit_codes.2 failed: Is a directory
 RENAME_EXIT_SOMEOK: 2
index 64630450873b80b18f44cc91cf3d540ee2d93820..f934b2179d3b6829a93a606d8edba44e826eefcf 100755 (executable)
@@ -20,6 +20,7 @@ ts_init "$*"
 
 ts_check_test_command "$TS_CMD_MKSWAP"
 ts_check_test_command "$TS_CMD_SWAPLABEL"
+ts_check_prog "stdbuf"
 
 # fallocate does not work on most file systems
 function fallocate_or_skip()
@@ -49,7 +50,7 @@ $TS_CMD_MKSWAP \
 
 rm -f $IMAGE
 fallocate_or_skip $MIN_SWAP_SIZE $IMAGE
-$TS_CMD_MKSWAP \
+stdbuf -oL -eL $TS_CMD_MKSWAP \
        --label 1234567890abcdef \
        --uuid 12345678-abcd-abcd-abcd-1234567890ab \
        $IMAGE 2>&1 |\
index 37028162b006753612270ca0391896f5ab7073fe..3d46120ac9f5200e7817fbaeb60feed98b48c679 100755 (executable)
@@ -22,6 +22,7 @@ TS_DESC="exit codes"
 ts_init "$*"
 
 ts_check_test_command "$TS_CMD_RENAME"
+ts_check_prog "stdbuf"
 ts_cd "$TS_OUTDIR"
 
 touch rename_exit_codes.{1..2}
@@ -32,7 +33,7 @@ $TS_CMD_RENAME -v codes values rename_exit_codes.? >> $TS_OUTPUT 2>&1
 echo "EXIT_SUCCESS: $?" >> $TS_OUTPUT
 
 mkdir rename_exit_codes.2
-$TS_CMD_RENAME -v values codes rename_exit_values.? >> $TS_OUTPUT 2>&1
+stdbuf -oL -eL $TS_CMD_RENAME -v values codes rename_exit_values.? >> $TS_OUTPUT 2>&1
 echo "RENAME_EXIT_SOMEOK: $?" >> $TS_OUTPUT
 
 rmdir rename_exit_codes.2