]> err.no Git - util-linux/commitdiff
tests: add more variants to {mount,fstab}-by-{label,uuid,devname}
authorKarel Zak <kzak@redhat.com>
Mon, 28 May 2007 13:15:55 +0000 (15:15 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 30 May 2007 08:48:06 +0000 (10:48 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/ts-fstab-devname
tests/ts-fstab-label
tests/ts-fstab-uuid
tests/ts-mount-label
tests/ts-mount-uuid

index 09edc101ffa3d2f6803e2a59df039d76ebbdd2a8..30e2414ac35dc9f7a6e2816e93364337e1f7bbc6 100755 (executable)
@@ -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
index 9d922b498fbc72cb7637971ea483c1786f42f8c4..8edb342fb44dbf744f3575f788df1273586ca185 100755 (executable)
@@ -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
index 8e566a18414d711207d272a2da6b76279f3903d4..0cd7f4dbbbb904f76ebd8f90dd4d5d8b8af8602c 100755 (executable)
@@ -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
index c6a841eab61ae8ec7d49001c819eb83584e3c05a..2861d531ea4de233356d55cf703db40c0aa03934 100755 (executable)
@@ -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
 
index 4c9687173e6f62ef88f804e96311ae3a247e3e2c..cb004e917fa56720760dd8c51006b25e94a976b4 100755 (executable)
@@ -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