From e38e975265cd4a8eab8126164ee306c7fe93eda7 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 28 May 2007 15:15:55 +0200 Subject: [PATCH] tests: add more variants to {mount,fstab}-by-{label,uuid,devname} Signed-off-by: Karel Zak --- tests/ts-fstab-devname | 16 +++++++++++----- tests/ts-fstab-label | 17 +++++++++++++++-- tests/ts-fstab-uuid | 17 +++++++++++++++-- tests/ts-mount-label | 12 +++++++++--- tests/ts-mount-uuid | 12 +++++++++--- 5 files changed, 59 insertions(+), 15 deletions(-) diff --git a/tests/ts-fstab-devname b/tests/ts-fstab-devname index 09edc101..30e2414a 100755 --- a/tests/ts-fstab-devname +++ b/tests/ts-fstab-devname @@ -19,7 +19,7 @@ . functions.sh TS_COMPONENT="fstab" -TS_DESC="label" +TS_DESC="devname" ts_init "$1" ts_skip_nonroot @@ -29,7 +29,7 @@ set -o pipefail DEVICE=$(ts_device_init) [ "$?" == 0 ] || ts_die "Cannot init device" -mkfs.ext3 $DEVICE &> /dev/null +mkfs.ext3 $DEVICE &> /dev/null [ "$?" == "0" ] || ts_die "Cannot make ext3 on $DEVICE" $DEVICE ts_device_has "TYPE" "ext3" $DEVICE @@ -39,13 +39,19 @@ ts_device_has "TYPE" "ext3" $DEVICE ts_fstab_add $DEVICE +# variant A) $TS_CMD_MOUNT $TS_MOUNTPOINT 2>&1 >> $TS_OUTPUT - grep -q $DEVICE /proc/mounts -[ "$?" == "0" ] || ts_die "Cannot found $DEVICE in /proc/mounts" $DEVICE +[ "$?" == "0" ] || ts_die "A) Cannot found $DEVICE in /proc/mounts" $DEVICE +$TS_CMD_UMOUNT $DEVICE +[ "$?" == "0" ] || ts_die "A) Cannot umount $DEVICE" $DEVICE +# variant B) +$TS_CMD_MOUNT $DEVICE 2>&1 >> $TS_OUTPUT +grep -q $DEVICE /proc/mounts +[ "$?" == "0" ] || ts_die "B) Cannot found $DEVICE in /proc/mounts" $DEVICE $TS_CMD_UMOUNT $DEVICE -[ "$?" == "0" ] || ts_die "Cannot umount $DEVICE" $DEVICE +[ "$?" == "0" ] || ts_die "B) Cannot umount $DEVICE" $DEVICE ts_device_deinit $DEVICE ts_fstab_clean diff --git a/tests/ts-fstab-label b/tests/ts-fstab-label index 9d922b49..8edb342f 100755 --- a/tests/ts-fstab-label +++ b/tests/ts-fstab-label @@ -44,13 +44,26 @@ ts_udev_dev_support "by-label" $LABEL ts_fstab_add "LABEL=$LABEL" +# variant A) $TS_CMD_MOUNT $TS_MOUNTPOINT 2>&1 >> $TS_OUTPUT +grep -q $DEVICE /proc/mounts +[ "$?" == "0" ] || ts_die "A) Cannot found $DEVICE in /proc/mounts" $DEVICE +$TS_CMD_UMOUNT $DEVICE +[ "$?" == "0" ] || ts_die "A) Cannot umount $DEVICE" $DEVICE +# variant B) +$TS_CMD_MOUNT -L $LABEL 2>&1 >> $TS_OUTPUT grep -q $DEVICE /proc/mounts -[ "$?" == "0" ] || ts_die "Cannot found $DEVICE in /proc/mounts" $DEVICE +[ "$?" == "0" ] || ts_die "B) Cannot found $DEVICE in /proc/mounts" $DEVICE +$TS_CMD_UMOUNT $DEVICE +[ "$?" == "0" ] || ts_die "B) Cannot umount $DEVICE" $DEVICE +# variant C) +$TS_CMD_MOUNT LABEL=$LABEL 2>&1 >> $TS_OUTPUT +grep -q $DEVICE /proc/mounts +[ "$?" == "0" ] || ts_die "C) Cannot found $DEVICE in /proc/mounts" $DEVICE $TS_CMD_UMOUNT $DEVICE -[ "$?" == "0" ] || ts_die "Cannot umount $DEVICE" $DEVICE +[ "$?" == "0" ] || ts_die "C) Cannot umount $DEVICE" $DEVICE ts_device_deinit $DEVICE ts_fstab_clean diff --git a/tests/ts-fstab-uuid b/tests/ts-fstab-uuid index 8e566a18..0cd7f4db 100755 --- a/tests/ts-fstab-uuid +++ b/tests/ts-fstab-uuid @@ -44,13 +44,26 @@ ts_udev_dev_support "by-uuid" $UUID ts_fstab_add "UUID=$UUID" +# varian A) $TS_CMD_MOUNT $TS_MOUNTPOINT 2>&1 >> $TS_OUTPUT +grep -q $DEVICE /proc/mounts +[ "$?" == "0" ] || ts_die "A) Cannot found $DEVICE in /proc/mounts" $DEVICE +$TS_CMD_UMOUNT $DEVICE +[ "$?" == "0" ] || ts_die "A) Cannot umount $DEVICE" $DEVICE +# varian B) +$TS_CMD_MOUNT -U $UUID 2>&1 >> $TS_OUTPUT grep -q $DEVICE /proc/mounts -[ "$?" == "0" ] || ts_die "Cannot found $DEVICE in /proc/mounts" $DEVICE +[ "$?" == "0" ] || ts_die "B) Cannot found $DEVICE in /proc/mounts" $DEVICE +$TS_CMD_UMOUNT $DEVICE +[ "$?" == "0" ] || ts_die "B) Cannot umount $DEVICE" $DEVICE +# varian C) +$TS_CMD_MOUNT UUID=$UUID 2>&1 >> $TS_OUTPUT +grep -q $DEVICE /proc/mounts +[ "$?" == "0" ] || ts_die "C) Cannot found $DEVICE in /proc/mounts" $DEVICE $TS_CMD_UMOUNT $DEVICE -[ "$?" == "0" ] || ts_die "Cannot umount $DEVICE" $DEVICE +[ "$?" == "0" ] || ts_die "C) Cannot umount $DEVICE" $DEVICE ts_device_deinit $DEVICE ts_fstab_clean diff --git a/tests/ts-mount-label b/tests/ts-mount-label index c6a841ea..2861d531 100755 --- a/tests/ts-mount-label +++ b/tests/ts-mount-label @@ -42,13 +42,19 @@ ts_udev_dev_support "by-label" $LABEL [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT +# variant A) $TS_CMD_MOUNT -L $LABEL $TS_MOUNTPOINT 2>&1 >> $TS_OUTPUT - grep -q $DEVICE /proc/mounts -[ "$?" == "0" ] || ts_die "Cannot found $DEVICE in /proc/mounts" $DEVICE +[ "$?" == "0" ] || ts_die "A) Cannot found $DEVICE in /proc/mounts" $DEVICE +$TS_CMD_UMOUNT $DEVICE +[ "$?" == "0" ] || ts_die "A) Cannot umount $DEVICE" $DEVICE +# variant B) +$TS_CMD_MOUNT LABEL=$LABEL $TS_MOUNTPOINT 2>&1 >> $TS_OUTPUT +grep -q $DEVICE /proc/mounts +[ "$?" == "0" ] || ts_die "B) Cannot found $DEVICE in /proc/mounts" $DEVICE $TS_CMD_UMOUNT $DEVICE -[ "$?" == "0" ] || ts_die "Cannot umount $DEVICE" $DEVICE +[ "$?" == "0" ] || ts_die "B) Cannot umount $DEVICE" $DEVICE ts_device_deinit $DEVICE diff --git a/tests/ts-mount-uuid b/tests/ts-mount-uuid index 4c968717..cb004e91 100755 --- a/tests/ts-mount-uuid +++ b/tests/ts-mount-uuid @@ -42,13 +42,19 @@ ts_udev_dev_support "by-uuid" $UUID [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT +# variant A) $TS_CMD_MOUNT -U $UUID $TS_MOUNTPOINT 2>&1 >> $TS_OUTPUT - grep -q $DEVICE /proc/mounts -[ "$?" == "0" ] || ts_die "Cannot found $DEVICE in /proc/mounts" $DEVICE +[ "$?" == "0" ] || ts_die "A) Cannot found $DEVICE in /proc/mounts" $DEVICE +$TS_CMD_UMOUNT $DEVICE +[ "$?" == "0" ] || ts_die "A) Cannot umount $DEVICE" $DEVICE +# variant B) +$TS_CMD_MOUNT UUID=$UUID $TS_MOUNTPOINT 2>&1 >> $TS_OUTPUT +grep -q $DEVICE /proc/mounts +[ "$?" == "0" ] || ts_die "B) Cannot found $DEVICE in /proc/mounts" $DEVICE $TS_CMD_UMOUNT $DEVICE -[ "$?" == "0" ] || ts_die "Cannot umount $DEVICE" $DEVICE +[ "$?" == "0" ] || ts_die "B) Cannot umount $DEVICE" $DEVICE ts_device_deinit $DEVICE -- 2.39.5