diff options
author | Ruediger Meier | 2015-04-21 10:41:01 +0200 |
---|---|---|
committer | Ruediger Meier | 2015-04-21 14:58:30 +0200 |
commit | fffe5f7c72121c054645c60c0bb49f653bb7142e (patch) | |
tree | ffe8d9702ce1cc879d2a1d79ec08cc52e40d93f5 | |
parent | tests: loop tests, don't call ts_die() with DEVICE parameter (diff) | |
download | kernel-qcow2-util-linux-fffe5f7c72121c054645c60c0bb49f653bb7142e.tar.gz kernel-qcow2-util-linux-fffe5f7c72121c054645c60c0bb49f653bb7142e.tar.xz kernel-qcow2-util-linux-fffe5f7c72121c054645c60c0bb49f653bb7142e.zip |
tests: never use -o pipefail
It was hard to find out that pipefail was the reason why our
test-suite could have random failures for aribtrary tests,
for example the ones which are using ts_device_has_uuid() or
ts_mount().
Bash's pipefall option is evil! It may return error for such a
simple line like this one
$ echo -e "xxx\nyyy" | grep -q "xxx"
because the left echo command will get SIGPIPE when grep exits after
the first match. So the command line above could return an error
eventhough it does exactly what we want.
This patch removes any pipefail from our tests. The funny thing is
that I couldn't find any case where we relied on this feature anyway.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
48 files changed, 0 insertions, 85 deletions
diff --git a/tests/ts/blkdiscard/offsets b/tests/ts/blkdiscard/offsets index a1c899547..eb0097ec8 100755 --- a/tests/ts/blkdiscard/offsets +++ b/tests/ts/blkdiscard/offsets @@ -26,8 +26,6 @@ ts_check_test_command "$TS_CMD_BLKDISCARD" ts_skip_nonroot ts_check_losetup -set -o pipefail - ORIGPWD=$(pwd) IMAGE_NAME="${TS_TESTNAME}-loop.img" IMAGE_PATH="$TS_OUTDIR/$IMAGE_NAME" diff --git a/tests/ts/blkid/md-raid0-whole b/tests/ts/blkid/md-raid0-whole index e8b92320e..cbfb1eb7c 100755 --- a/tests/ts/blkid/md-raid0-whole +++ b/tests/ts/blkid/md-raid0-whole @@ -29,8 +29,6 @@ ts_skip_nonroot ts_check_losetup ts_check_prog "mdadm" -set -o pipefail - ts_log "Initialize devices" IMGNAME="${TS_OUTDIR}/${TS_TESTNAME}" diff --git a/tests/ts/blkid/md-raid1-whole b/tests/ts/blkid/md-raid1-whole index bd5f628a9..76ff8f838 100755 --- a/tests/ts/blkid/md-raid1-whole +++ b/tests/ts/blkid/md-raid1-whole @@ -29,8 +29,6 @@ ts_skip_nonroot ts_check_losetup ts_check_prog "mdadm" -set -o pipefail - ts_log "Initialize devices" IMGNAME="${TS_OUTDIR}/${TS_TESTNAME}" diff --git a/tests/ts/cal/1m b/tests/ts/cal/1m index 295758aad..9f691e137 100755 --- a/tests/ts/cal/1m +++ b/tests/ts/cal/1m @@ -24,7 +24,6 @@ ts_init "$*" ts_check_test_command "$TS_CMD_CAL" -set -o pipefail export TERM=linux USETERM=$( ts_has_option "useterm" "$*" ) diff --git a/tests/ts/cal/1mw b/tests/ts/cal/1mw index 66649487a..3234a6adb 100755 --- a/tests/ts/cal/1mw +++ b/tests/ts/cal/1mw @@ -24,7 +24,6 @@ ts_init "$*" ts_check_test_command "$TS_CMD_CAL" -set -o pipefail export TERM=linux USETERM=$( ts_has_option "useterm" "$*" ) diff --git a/tests/ts/cal/3m b/tests/ts/cal/3m index 50f284ec2..baa9ba314 100755 --- a/tests/ts/cal/3m +++ b/tests/ts/cal/3m @@ -23,7 +23,6 @@ ts_init "$*" ts_check_test_command "$TS_CMD_CAL" -set -o pipefail export TERM=linux USETERM=$( ts_has_option "useterm" "$*" ) diff --git a/tests/ts/cal/3mw b/tests/ts/cal/3mw index 5ea951e49..cb3905b18 100755 --- a/tests/ts/cal/3mw +++ b/tests/ts/cal/3mw @@ -23,8 +23,6 @@ ts_init "$*" ts_check_test_command "$TS_CMD_CAL" -set -o pipefail - USETERM=$( ts_has_option "useterm" "$*" ) MYTIME="27 09 2006" diff --git a/tests/ts/cal/bigyear b/tests/ts/cal/bigyear index b5e415ca1..5dced2a0f 100755 --- a/tests/ts/cal/bigyear +++ b/tests/ts/cal/bigyear @@ -20,7 +20,6 @@ ts_init "$*" ts_check_test_command "$TS_CMD_CAL" -set -o pipefail export TERM=linux USETERM=$( ts_has_option "useterm" "$*" ) diff --git a/tests/ts/cal/bigyearw b/tests/ts/cal/bigyearw index 75a18ddee..2ce9fc73d 100755 --- a/tests/ts/cal/bigyearw +++ b/tests/ts/cal/bigyearw @@ -20,7 +20,6 @@ ts_init "$*" ts_check_test_command "$TS_CMD_CAL" -set -o pipefail export TERM=linux USETERM=$( ts_has_option "useterm" "$*" ) diff --git a/tests/ts/cal/color b/tests/ts/cal/color index 44e9381e2..00e9c188a 100755 --- a/tests/ts/cal/color +++ b/tests/ts/cal/color @@ -25,8 +25,6 @@ ts_check_test_command "$TS_CMD_CAL" # --color output depends on terminal type export TERM=linux -set -o pipefail - USETERM=$( ts_has_option "useterm" "$*" ) [ "$USETERM" == "yes" ] && TS_VERBOSE="yes" diff --git a/tests/ts/cal/colorw b/tests/ts/cal/colorw index 0092e133e..8e8ba0139 100755 --- a/tests/ts/cal/colorw +++ b/tests/ts/cal/colorw @@ -25,8 +25,6 @@ ts_check_test_command "$TS_CMD_CAL" # --color output depends on terminal type export TERM=linux -set -o pipefail - USETERM=$( ts_has_option "useterm" "$*" ) [ "$USETERM" == "yes" ] && TS_VERBOSE="yes" diff --git a/tests/ts/cal/sep1752 b/tests/ts/cal/sep1752 index fa57b9b8b..8db7e3cac 100755 --- a/tests/ts/cal/sep1752 +++ b/tests/ts/cal/sep1752 @@ -20,7 +20,6 @@ ts_init "$*" ts_check_test_command "$TS_CMD_CAL" -set -o pipefail export TERM=linux USETERM=$( ts_has_option "useterm" "$*" ) diff --git a/tests/ts/cal/sep1752w b/tests/ts/cal/sep1752w index b229e8369..d2d0d3166 100755 --- a/tests/ts/cal/sep1752w +++ b/tests/ts/cal/sep1752w @@ -20,7 +20,6 @@ ts_init "$*" ts_check_test_command "$TS_CMD_CAL" -set -o pipefail export TERM=linux USETERM=$( ts_has_option "useterm" "$*" ) diff --git a/tests/ts/cal/weekarg b/tests/ts/cal/weekarg index a7987051c..55dc327e2 100755 --- a/tests/ts/cal/weekarg +++ b/tests/ts/cal/weekarg @@ -23,7 +23,6 @@ ts_init "$*" ts_check_test_command "$TS_CMD_CAL" -set -o pipefail export TERM=linux USETERM=$( ts_has_option "useterm" "$*" ) diff --git a/tests/ts/cal/weeknum b/tests/ts/cal/weeknum index 0bea00de1..3a8f376e6 100755 --- a/tests/ts/cal/weeknum +++ b/tests/ts/cal/weeknum @@ -23,7 +23,6 @@ ts_init "$*" ts_check_test_command "$TS_CMD_CAL" -set -o pipefail export TERM=linux USETERM=$( ts_has_option "useterm" "$*" ) diff --git a/tests/ts/cal/year b/tests/ts/cal/year index 1204b5ffb..77e847e28 100755 --- a/tests/ts/cal/year +++ b/tests/ts/cal/year @@ -23,7 +23,6 @@ ts_init "$*" ts_check_test_command "$TS_CMD_CAL" -set -o pipefail export TERM=linux USETERM=$( ts_has_option "useterm" "$*" ) diff --git a/tests/ts/cal/yearw b/tests/ts/cal/yearw index c05b1c2b7..2f5d2c40c 100755 --- a/tests/ts/cal/yearw +++ b/tests/ts/cal/yearw @@ -23,7 +23,6 @@ ts_init "$*" ts_check_test_command "$TS_CMD_CAL" -set -o pipefail export TERM=linux USETERM=$( ts_has_option "useterm" "$*" ) diff --git a/tests/ts/cramfs/doubles b/tests/ts/cramfs/doubles index 43fc60330..c815b2750 100755 --- a/tests/ts/cramfs/doubles +++ b/tests/ts/cramfs/doubles @@ -28,8 +28,6 @@ ts_check_test_command "$TS_CMD_UMOUNT" ts_skip_nonroot ts_check_losetup -set -o pipefail - ORIGPWD=$(pwd) IMAGE_NAME="${TS_TESTNAME}.img" IMAGE_PATH="$TS_OUTDIR/$IMAGE_NAME" diff --git a/tests/ts/cramfs/fsck-endianness b/tests/ts/cramfs/fsck-endianness index 87addef76..1ea8f5123 100755 --- a/tests/ts/cramfs/fsck-endianness +++ b/tests/ts/cramfs/fsck-endianness @@ -26,8 +26,6 @@ ts_check_test_command "$TS_CMD_FSCKCRAMFS" ts_skip_nonroot -set -o pipefail - IMAGE_LITTLE="$TS_SELF/cramfs-little.img" #Known good little endian image IMAGE_BIG="$TS_SELF/cramfs-big.img" #Known good big endian image diff --git a/tests/ts/cramfs/mkfs b/tests/ts/cramfs/mkfs index eff9d455c..c4abb7977 100755 --- a/tests/ts/cramfs/mkfs +++ b/tests/ts/cramfs/mkfs @@ -28,8 +28,6 @@ ts_check_test_command "$TS_CMD_UMOUNT" ts_skip_nonroot ts_check_losetup -set -o pipefail - ORIGPWD=$(pwd) IMAGE_NAME="${TS_TESTNAME}-loop.img" IMAGE_PATH="$TS_OUTDIR/$IMAGE_NAME" diff --git a/tests/ts/cramfs/mkfs-endianness b/tests/ts/cramfs/mkfs-endianness index 34d6bbfcc..e6707ca66 100755 --- a/tests/ts/cramfs/mkfs-endianness +++ b/tests/ts/cramfs/mkfs-endianness @@ -25,8 +25,6 @@ ts_check_test_command "$TS_CMD_MKCRAMFS" ts_skip_nonroot -set -o pipefail - IMAGE_DATA="$TS_OUTDIR/${TS_TESTNAME}-data" IMAGE_CREATED="$TS_OUTDIR/${TS_TESTNAME}-cramfs.img" #Image created during the test and compared against the known images. diff --git a/tests/ts/fsck/ismounted b/tests/ts/fsck/ismounted index 25bcff9e4..8edda4b6e 100755 --- a/tests/ts/fsck/ismounted +++ b/tests/ts/fsck/ismounted @@ -27,8 +27,6 @@ ts_check_prog "mkfs.ext3" ts_skip_nonroot ts_check_losetup -set -o pipefail - > $TS_OUTPUT ts_device_init diff --git a/tests/ts/minix/fsck b/tests/ts/minix/fsck index f64d83cfe..7a0bb8417 100755 --- a/tests/ts/minix/fsck +++ b/tests/ts/minix/fsck @@ -25,8 +25,6 @@ ts_check_test_command "$TS_CMD_MKMINIX" ts_skip_nonroot ts_check_losetup -set -o pipefail - IMAGE="$TS_OUTDIR/${TS_TESTNAME}-loop.img" ts_device_init DEVICE=$TS_LODEV diff --git a/tests/ts/minix/mkfs b/tests/ts/minix/mkfs index 387213536..bbb38e459 100755 --- a/tests/ts/minix/mkfs +++ b/tests/ts/minix/mkfs @@ -25,8 +25,6 @@ ts_check_test_command "$TS_CMD_MKMINIX" ts_skip_nonroot ts_check_losetup -set -o pipefail - IMAGE="$TS_OUTDIR/${TS_TESTNAME}-loop.img" ts_device_init DEVICE=$TS_LODEV diff --git a/tests/ts/mount/devname b/tests/ts/mount/devname index f4bfebd0f..2ba5effb6 100755 --- a/tests/ts/mount/devname +++ b/tests/ts/mount/devname @@ -29,8 +29,6 @@ ts_check_prog "mkfs.ext3" ts_skip_nonroot ts_check_losetup -set -o pipefail - ts_device_init DEVICE=$TS_LODEV diff --git a/tests/ts/mount/fslists b/tests/ts/mount/fslists index 28bba6c48..599173002 100755 --- a/tests/ts/mount/fslists +++ b/tests/ts/mount/fslists @@ -29,8 +29,6 @@ ts_check_prog "mkfs.ext3" ts_skip_nonroot ts_check_losetup -set -o pipefail - ts_device_init DEVICE=$TS_LODEV diff --git a/tests/ts/mount/fstab-broken b/tests/ts/mount/fstab-broken index 57d5d2d4f..f67d35cb1 100755 --- a/tests/ts/mount/fstab-broken +++ b/tests/ts/mount/fstab-broken @@ -27,8 +27,6 @@ ts_check_test_command "$TS_CMD_FINDMNT" ts_skip_nonroot -set -o pipefail - # Let's use the same mountpoint for all subtests MNT=$TS_MOUNTPOINT mkdir -p $MNT diff --git a/tests/ts/mount/fstab-devname b/tests/ts/mount/fstab-devname index a80934330..05704969b 100755 --- a/tests/ts/mount/fstab-devname +++ b/tests/ts/mount/fstab-devname @@ -28,8 +28,6 @@ ts_check_prog "mkfs.ext3" ts_skip_nonroot ts_check_losetup -set -o pipefail - ts_device_init DEVICE=$TS_LODEV diff --git a/tests/ts/mount/fstab-devname2label b/tests/ts/mount/fstab-devname2label index 8519b498c..f55d2056b 100755 --- a/tests/ts/mount/fstab-devname2label +++ b/tests/ts/mount/fstab-devname2label @@ -29,8 +29,6 @@ ts_check_prog "mkfs.ext3" ts_skip_nonroot ts_check_losetup -set -o pipefail - ts_device_init DEVICE=$TS_LODEV diff --git a/tests/ts/mount/fstab-devname2uuid b/tests/ts/mount/fstab-devname2uuid index 31bb3d053..66d9046dc 100755 --- a/tests/ts/mount/fstab-devname2uuid +++ b/tests/ts/mount/fstab-devname2uuid @@ -28,8 +28,6 @@ ts_check_prog "mkfs.ext3" ts_skip_nonroot ts_check_losetup -set -o pipefail - ts_device_init DEVICE=$TS_LODEV diff --git a/tests/ts/mount/fstab-label b/tests/ts/mount/fstab-label index 2c925fb09..e0d819b9a 100755 --- a/tests/ts/mount/fstab-label +++ b/tests/ts/mount/fstab-label @@ -29,8 +29,6 @@ ts_check_prog "mkfs.ext3" ts_skip_nonroot ts_check_losetup -set -o pipefail - ts_device_init DEVICE=$TS_LODEV diff --git a/tests/ts/mount/fstab-label2devname b/tests/ts/mount/fstab-label2devname index 4cb34d764..6bb23a5f9 100755 --- a/tests/ts/mount/fstab-label2devname +++ b/tests/ts/mount/fstab-label2devname @@ -29,8 +29,6 @@ ts_check_prog "mkfs.ext3" ts_skip_nonroot ts_check_losetup -set -o pipefail - ts_device_init DEVICE=$TS_LODEV diff --git a/tests/ts/mount/fstab-label2uuid b/tests/ts/mount/fstab-label2uuid index a02ba41f8..08a2927bf 100755 --- a/tests/ts/mount/fstab-label2uuid +++ b/tests/ts/mount/fstab-label2uuid @@ -30,8 +30,6 @@ ts_check_prog "mkfs.ext3" ts_skip_nonroot ts_check_losetup -set -o pipefail - ts_device_init DEVICE=$TS_LODEV diff --git a/tests/ts/mount/fstab-none b/tests/ts/mount/fstab-none index 082afe905..b90008f00 100755 --- a/tests/ts/mount/fstab-none +++ b/tests/ts/mount/fstab-none @@ -12,8 +12,6 @@ ts_check_test_command "$TS_CMD_FINDMNT" ts_skip_nonroot -set -o pipefail - ts_fstab_add "none" "$TS_MOUNTPOINT" "tmpfs" "rw,nosuid,nodev,relatime" mkdir -p $TS_MOUNTPOINT diff --git a/tests/ts/mount/fstab-symlink b/tests/ts/mount/fstab-symlink index 2579c85af..bf00e1355 100755 --- a/tests/ts/mount/fstab-symlink +++ b/tests/ts/mount/fstab-symlink @@ -29,8 +29,6 @@ ts_check_prog "mkfs.ext3" ts_skip_nonroot ts_check_losetup -set -o pipefail - LINKNAME="$TS_OUTDIR/${TS_TESTNAME}_lnk" ts_device_init diff --git a/tests/ts/mount/fstab-uuid b/tests/ts/mount/fstab-uuid index e3bb1e7f5..6d7c5bf3c 100755 --- a/tests/ts/mount/fstab-uuid +++ b/tests/ts/mount/fstab-uuid @@ -28,8 +28,6 @@ ts_check_prog "mkfs.ext3" ts_skip_nonroot ts_check_losetup -set -o pipefail - ts_device_init DEVICE=$TS_LODEV diff --git a/tests/ts/mount/fstab-uuid2devname b/tests/ts/mount/fstab-uuid2devname index ac0b932e3..6c9009720 100755 --- a/tests/ts/mount/fstab-uuid2devname +++ b/tests/ts/mount/fstab-uuid2devname @@ -28,8 +28,6 @@ ts_check_prog "mkfs.ext3" ts_skip_nonroot ts_check_losetup -set -o pipefail - ts_device_init DEVICE=$TS_LODEV diff --git a/tests/ts/mount/fstab-uuid2label b/tests/ts/mount/fstab-uuid2label index edcdc0c53..77895e31c 100755 --- a/tests/ts/mount/fstab-uuid2label +++ b/tests/ts/mount/fstab-uuid2label @@ -29,8 +29,6 @@ ts_check_prog "mkfs.ext3" ts_skip_nonroot ts_check_losetup -set -o pipefail - ts_device_init DEVICE=$TS_LODEV diff --git a/tests/ts/mount/label b/tests/ts/mount/label index 2becdb589..5e935c032 100755 --- a/tests/ts/mount/label +++ b/tests/ts/mount/label @@ -30,8 +30,6 @@ ts_check_prog "mkfs.ext3" ts_skip_nonroot ts_check_losetup -set -o pipefail - ts_device_init DEVICE=$TS_LODEV diff --git a/tests/ts/mount/regfile b/tests/ts/mount/regfile index fd908356d..8278e84b1 100755 --- a/tests/ts/mount/regfile +++ b/tests/ts/mount/regfile @@ -16,8 +16,6 @@ ts_check_prog "mkfs.ext3" ts_skip_nonroot ts_check_losetup -set -o pipefail - IMAGE=$(ts_image_init) mkfs.ext3 -F $IMAGE &> /dev/null || ts_die "Cannot make ext3 on $IMAGE" diff --git a/tests/ts/mount/rlimit b/tests/ts/mount/rlimit index 223f717dd..5e6880c4f 100755 --- a/tests/ts/mount/rlimit +++ b/tests/ts/mount/rlimit @@ -39,8 +39,6 @@ ts_check_losetup [ -L /etc/mtab ] && ts_skip "mtab is symlink" [ "$(stat --format '%s' /etc/mtab)" -gt "1024" ] || ts_skip "mtab is too small" -set -o pipefail - function mtab_checksum() { md5sum /etc/mtab | awk '{printf $1}' diff --git a/tests/ts/mount/uuid b/tests/ts/mount/uuid index 4dec89a79..6af358c7d 100755 --- a/tests/ts/mount/uuid +++ b/tests/ts/mount/uuid @@ -28,8 +28,6 @@ ts_check_prog "mkfs.ext3" ts_skip_nonroot ts_check_losetup -set -o pipefail - ts_device_init DEVICE=$TS_LODEV diff --git a/tests/ts/script/race b/tests/ts/script/race index a1e35b8f2..02c8187d6 100755 --- a/tests/ts/script/race +++ b/tests/ts/script/race @@ -33,8 +33,6 @@ TS_KNOWN_FAIL="yes" bingofile="$TS_OUTDIR/${TS_TESTNAME}-bingo" -set -o pipefail - count=1000 for i in `seq 1 $count`; do $TS_CMD_SCRIPT -q -c "printf 'Bingo\n'" $bingofile diff --git a/tests/ts/swapon/devname b/tests/ts/swapon/devname index e1ae4f5a4..a4cf99f41 100755 --- a/tests/ts/swapon/devname +++ b/tests/ts/swapon/devname @@ -28,8 +28,6 @@ ts_check_test_command "$TS_CMD_SWAPOFF" ts_skip_nonroot ts_check_losetup -set -o pipefail - ts_device_init DEVICE=$TS_LODEV diff --git a/tests/ts/swapon/fixpgsz b/tests/ts/swapon/fixpgsz index b1f4035fd..2e1aa57d3 100755 --- a/tests/ts/swapon/fixpgsz +++ b/tests/ts/swapon/fixpgsz @@ -13,8 +13,6 @@ ts_check_test_command "$TS_CMD_SWAPOFF" ts_skip_nonroot ts_check_losetup -set -o pipefail - PAGESIZE=$($TS_HELPER_SYSINFO pagesize) # diff --git a/tests/ts/swapon/fixsig b/tests/ts/swapon/fixsig index 3d1bf6355..6fceb79f8 100755 --- a/tests/ts/swapon/fixsig +++ b/tests/ts/swapon/fixsig @@ -13,8 +13,6 @@ ts_check_test_command "$TS_CMD_SWAPOFF" ts_skip_nonroot ts_check_losetup -set -o pipefail - PAGESIZE=$($TS_HELPER_SYSINFO pagesize) # diff --git a/tests/ts/swapon/label b/tests/ts/swapon/label index 2018f9cfb..187ccf9c6 100755 --- a/tests/ts/swapon/label +++ b/tests/ts/swapon/label @@ -29,8 +29,6 @@ ts_check_test_command "$TS_CMD_SWAPOFF" ts_skip_nonroot ts_check_losetup -set -o pipefail - ts_device_init DEVICE=$TS_LODEV diff --git a/tests/ts/swapon/uuid b/tests/ts/swapon/uuid index 65d019c29..2a8d78f30 100755 --- a/tests/ts/swapon/uuid +++ b/tests/ts/swapon/uuid @@ -28,8 +28,6 @@ ts_check_test_command "$TS_CMD_SWAPOFF" ts_skip_nonroot ts_check_losetup -set -o pipefail - ts_device_init DEVICE=$TS_LODEV |