From: Karel Zak Date: Mon, 26 Aug 2013 11:48:40 +0000 (+0200) Subject: tests: minor changes to make tests more portable X-Git-Tag: v2.24-rc1~329 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef2c9e3f5e51cf13ec9cf6738d4f1d695ee32a6f;p=thirdparty%2Futil-linux.git tests: minor changes to make tests more portable Signed-off-by: Karel Zak --- diff --git a/tests/functions.sh b/tests/functions.sh index 361ab70759..7d96886912 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -492,7 +492,7 @@ function ts_scsi_debug_init { modprobe scsi_debug $* [ "$?" == 0 ] || ts_die "Cannot init device" - DEVNAME=$(grep scsi_debug /sys/block/*/device/model | awk -F '/' '{print $4}') + DEVNAME=$(grep --with-filename scsi_debug /sys/block/*/device/model | awk -F '/' '{print $4}') [ "x${DEVNAME}" == "x" ] && ts_die "Cannot find device" DEVICE="/dev/${DEVNAME}" diff --git a/tests/ts/cramfs/mkfs b/tests/ts/cramfs/mkfs index e5fa47ffce..5facfe9a5b 100755 --- a/tests/ts/cramfs/mkfs +++ b/tests/ts/cramfs/mkfs @@ -80,7 +80,7 @@ cd $TS_MOUNTPOINT ts_log "list the image" export TZ='GMT-1' -ls -laR --time-style=long-iso . >> $TS_OUTPUT +ls -laR --time-style=long-iso . | sed 's:\. : :g' >> $TS_OUTPUT echo >> $TS_OUTPUT ts_log "list checksums from new data" diff --git a/tests/ts/libmount/context-utab b/tests/ts/libmount/context-utab index 35851628d8..859fc2bca1 100755 --- a/tests/ts/libmount/context-utab +++ b/tests/ts/libmount/context-utab @@ -85,7 +85,9 @@ grep -q $DEVICE $LIBMOUNT_UTAB && \ echo "umount (mountpoint) failed: found $DEVICE in $LIBMOUNT_UTAB" >> $TS_OUTPUT 2>&1 ts_finalize_subtest + if [ -x "/sbin/mkfs.btrfs" ]; then + $TS_CMD_WIPEFS -a $DEVICE &> /dev/null ts_log "Create filesystem [btrfs]" /sbin/mkfs.btrfs -L "$LABEL" $DEVICE &> /dev/null udevadm settle diff --git a/tests/ts/libmount/context-utab-py b/tests/ts/libmount/context-utab-py index b2c0e2ed0f..40dcba4d98 100755 --- a/tests/ts/libmount/context-utab-py +++ b/tests/ts/libmount/context-utab-py @@ -84,6 +84,7 @@ grep -q $DEVICE $LIBMOUNT_UTAB && \ ts_finalize_subtest if [ -x "/sbin/mkfs.btrfs" ]; then + $TS_CMD_WIPEFS -a $DEVICE &> /dev/null ts_log "Create filesystem [btrfs]" /sbin/mkfs.btrfs -L "$LABEL" $DEVICE &> /dev/null udevadm settle