summaryrefslogtreecommitdiffstats
path: root/tests/ts/mount
diff options
context:
space:
mode:
authorRuediger Meier2018-03-09 18:27:44 +0100
committerKarel Zak2018-03-19 11:46:11 +0100
commitec182d8b9da7596809aab9aab4fc931e9ccb7494 (patch)
tree5b5127ff66d0d027da6238e105eb3dfa5bbfc3b3 /tests/ts/mount
parenttests: handle xargs errors and invalid args (diff)
downloadkernel-qcow2-util-linux-ec182d8b9da7596809aab9aab4fc931e9ccb7494.tar.gz
kernel-qcow2-util-linux-ec182d8b9da7596809aab9aab4fc931e9ccb7494.tar.xz
kernel-qcow2-util-linux-ec182d8b9da7596809aab9aab4fc931e9ccb7494.zip
tests: fix grep expressions for devices
ts_is_mounted "/dev/loop1" returned true if /dev/loop17 was mounted. A very annoying source of sporadic failures since many years. This issue became more visible since running the checks in parallel, which increases the probability to get bigger loop device numbers. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'tests/ts/mount')
-rwxr-xr-xtests/ts/mount/devname4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/ts/mount/devname b/tests/ts/mount/devname
index 65a1ba217..4db878bb6 100755
--- a/tests/ts/mount/devname
+++ b/tests/ts/mount/devname
@@ -48,12 +48,12 @@ $TS_CMD_MOUNT $DEVICE $TS_MOUNTPOINT >> $TS_OUTPUT 2>&1
ts_is_mounted $DEVICE || ts_die "Cannot find $DEVICE in /proc/mounts"
-grep -q $DEVICE $MTAB_FILE ||
+grep -q "\(^\| \)$DEVICE " $MTAB_FILE ||
echo "mount failed: cannot find $DEVICE in $MTAB_FILE" >> $TS_OUTPUT 2>&1
$TS_CMD_UMOUNT $DEVICE || ts_die "Cannot umount $DEVICE"
-grep -q $DEVICE $MTAB_FILE &&
+grep -q "\(^\| \)$DEVICE " $MTAB_FILE &&
echo "umount failed: found $DEVICE in $MTAB_FILE" >> $TS_OUTPUT 2>&1
ts_log "Success"