From: Thomas Weißschuh Date: Mon, 2 Oct 2023 16:17:01 +0000 (+0200) Subject: swapon: (tests) abort test on failing commands X-Git-Tag: v2.40-rc1~213^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3be5c3b8327a07b7b9b62757b6e535ae20651fe8;p=thirdparty%2Futil-linux.git swapon: (tests) abort test on failing commands Signed-off-by: Thomas Weißschuh --- diff --git a/tests/ts/swapon/devname b/tests/ts/swapon/devname index d62b9d9d80..f4f9c16ca5 100755 --- a/tests/ts/swapon/devname +++ b/tests/ts/swapon/devname @@ -36,11 +36,11 @@ $TS_CMD_MKSWAP $DEVICE > /dev/null 2>> $TS_OUTPUT \ ts_device_has "TYPE" "swap" $DEVICE || ts_die "Cannot find swap on $DEVICE" -$TS_CMD_SWAPON $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG +$TS_CMD_SWAPON $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG || ts_die "Swapon failed" grep -q "^$DEVICE\b" /proc/swaps || ts_die "Cannot find $DEVICE in /proc/swaps" -$TS_CMD_SWAPOFF $DEVICE +$TS_CMD_SWAPOFF $DEVICE || ts_die "Swapoff failed" # swapon/mkswap warns if system sets different permissions for loop devices sed --in-place '/insecure permissions .*, 0660 suggested/d' $TS_OUTPUT