From 283a8c15988e65e6c4741c7d7739b969e7383203 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 4 Dec 2009 20:30:16 +0100 Subject: [PATCH] tests: remove vol_id from tests Signed-off-by: Karel Zak --- configure.ac | 2 -- tests/commands.sh.in | 4 --- tests/functions.sh | 40 +++--------------------------- tests/ts/cramfs/mkfs | 3 --- tests/ts/mount/fstab-label | 2 -- tests/ts/mount/fstab-label2devname | 2 -- tests/ts/mount/fstab-label2uuid | 2 -- tests/ts/mount/fstab-uuid | 2 -- tests/ts/mount/fstab-uuid2devname | 2 -- tests/ts/mount/fstab-uuid2label | 2 -- tests/ts/mount/label | 3 --- tests/ts/mount/uuid | 3 --- tests/ts/swapon/label | 2 -- tests/ts/swapon/uuid | 2 -- 14 files changed, 3 insertions(+), 68 deletions(-) diff --git a/configure.ac b/configure.ac index 18e46695b..acd932bc9 100644 --- a/configure.ac +++ b/configure.ac @@ -91,8 +91,6 @@ esac AM_CONDITIONAL([LINUX], test "x$linux_os" = xyes) AC_PATH_PROG(PERL, perl) -AC_PATH_PROG(BLKID, blkid, [], [$PATH:/sbin]) -AC_PATH_PROG(VOLID, vol_id, [], [$PATH:/lib/udev]) AC_SYS_LARGEFILE diff --git a/tests/commands.sh.in b/tests/commands.sh.in index 70084cd06..8399738c8 100644 --- a/tests/commands.sh.in +++ b/tests/commands.sh.in @@ -14,10 +14,6 @@ TS_HELPER_ISMOUNTED="$TOPDIR/lib/test_ismounted" # TODO: use partx TS_HELPER_PARTITIONS="$TOPDIR/shlibs/blkid/samples/partitions" -# external commands -TS_ECMD_BLKID="@BLKID@" -TS_ECMD_VOLID="@VOLID@" - U_L_LIBRARY_PATH="$TOPDIR/shlibs/blkid/src/.libs:$TOPDIR/shlibs/uuid/src/.libs" # paths to commands diff --git a/tests/functions.sh b/tests/functions.sh index e8a2ceb69..eb9a878d7 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -100,7 +100,6 @@ function ts_init_env { TS_MOUNTPOINT="$TS_OUTDIR/${TS_TESTNAME}-mnt" TS_VERBOSE=$(ts_has_option "verbose" "$*") - TS_HAS_VOLUMEID="no" BLKID_FILE="$TS_OUTDIR/${TS_TESTNAME}.blkidtab" @@ -115,11 +114,6 @@ function ts_init_env { export BLKID_FILE - if [ -x $TS_CMD_MOUNT ]; then - ldd $TS_CMD_MOUNT | grep -q 'libvolume_id' &> /dev/null - [ "$?" == "0" ] && TS_HAS_VOLUMEID="yes" - fi - rm -f $TS_OUTPUT touch $TS_OUTPUT @@ -282,44 +276,16 @@ function ts_device_deinit { fi } -function ts_udev_dev_support { - if [ "$TS_HAS_VOLUMEID" == "yes" ] && [ ! -L "/dev/disk/$1/$2" ]; then - return 1 - fi - return 0 -} - function ts_uuid_by_devname { - local DEV="$1" - local UUID="" - if [ -x "$TS_ECMD_BLKID" ]; then - UUID=$($TS_ECMD_BLKID -c /dev/null -w /dev/null -s "UUID" $DEV | sed 's/.*UUID="//g; s/"//g') - elif [ -x "$TS_ECMD_VOLID" ]; then - UUID=$($TS_ECMD_VOLID -u $DEV) - fi - echo $UUID + echo $($TS_CMD_BLKID -p -s UUID -o value $1) } function ts_label_by_devname { - local DEV="$1" - local TYPE="" - if [ -x "$TS_ECMD_BLKID" ]; then - LABEL=$($TS_ECMD_BLKID -c /dev/null -w /dev/null -s "LABEL" $DEV | sed 's/.*LABEL="//g; s/"//g') - elif [ -x "$TS_ECMD_VOLID" ]; then - LABEL=$($TS_ECMD_VOLID -l $DEV) - fi - echo $LABEL + echo $($TS_CMD_BLKID -p -s LABEL -o value $1) } function ts_fstype_by_devname { - local DEV="$1" - local TYPE="" - if [ -x "$TS_ECMD_BLKID" ]; then - TYPE=$($TS_ECMD_BLKID -c /dev/null -w /dev/null -s "TYPE" $DEV | sed 's/.*TYPE="//g; s/"//g') - elif [ -x "$TS_ECMD_VOLID" ]; then - TYPE=$($TS_ECMD_VOLID -t $DEV) - fi - echo $TYPE + echo $($TS_CMD_BLKID -p -s TYPE -o value $1) } function ts_device_has { diff --git a/tests/ts/cramfs/mkfs b/tests/ts/cramfs/mkfs index 98e5172c1..eb85c55cf 100755 --- a/tests/ts/cramfs/mkfs +++ b/tests/ts/cramfs/mkfs @@ -70,9 +70,6 @@ ts_log "check the image" ts_device_has "TYPE" "cramfs" $DEVICE [ "$?" == "0" ] || ts_die "Cannot found cramfs on $DEVICE" $DEVICE -ts_udev_dev_support "by-label" $LABEL -[ "$?" == "0" ] || ts_skip "udev ignores /dev/loop*" $DEVICE - ts_log "mount the image" $TS_CMD_MOUNT -L $LABEL $TS_MOUNTPOINT 2>&1 >> $TS_OUTPUT diff --git a/tests/ts/mount/fstab-label b/tests/ts/mount/fstab-label index 375a1ba72..21903830d 100755 --- a/tests/ts/mount/fstab-label +++ b/tests/ts/mount/fstab-label @@ -33,8 +33,6 @@ mkfs.ext3 -L $LABEL $DEVICE &> /dev/null || ts_die "Cannot make ext3 on $DEVICE" ts_device_has "LABEL" $LABEL $DEVICE \ || ts_die "Cannot found LABEL '$LABEL' on $DEVICE" $DEVICE -ts_udev_dev_support "by-label" $LABEL || ts_skip "udev ignores /dev/loop*" $DEVICE - [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT ts_fstab_add "LABEL=$LABEL" diff --git a/tests/ts/mount/fstab-label2devname b/tests/ts/mount/fstab-label2devname index f53de4fb2..6ae9bffb5 100755 --- a/tests/ts/mount/fstab-label2devname +++ b/tests/ts/mount/fstab-label2devname @@ -33,8 +33,6 @@ mkfs.ext3 -L $LABEL $DEVICE &> /dev/null || ts_die "Cannot make ext3 on $DEVICE" ts_device_has "LABEL" $LABEL $DEVICE \ || ts_die "Cannot found LABEL '$LABEL' on $DEVICE" $DEVICE -ts_udev_dev_support "by-label" $LABEL || ts_skip "udev ignores /dev/loop*" $DEVICE - [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT ts_fstab_add "$DEVICE" diff --git a/tests/ts/mount/fstab-label2uuid b/tests/ts/mount/fstab-label2uuid index 1c90c2eda..f74cdf292 100755 --- a/tests/ts/mount/fstab-label2uuid +++ b/tests/ts/mount/fstab-label2uuid @@ -34,8 +34,6 @@ mkfs.ext3 -L $LABEL $DEVICE &> /dev/null || ts_die "Cannot make ext3 on $DEVICE" ts_device_has "LABEL" $LABEL $DEVICE \ || ts_die "Cannot found LABEL '$LABEL' on $DEVICE" $DEVICE -ts_udev_dev_support "by-label" $LABEL || ts_skip "udev ignores /dev/loop*" $DEVICE - ts_device_has_uuid $DEVICE || ts_die "Cannot found UUID on $DEVICE" $DEVICE UUID=$(ts_uuid_by_devname $DEVICE) diff --git a/tests/ts/mount/fstab-uuid b/tests/ts/mount/fstab-uuid index 7f78e45e3..73b59dcc4 100755 --- a/tests/ts/mount/fstab-uuid +++ b/tests/ts/mount/fstab-uuid @@ -33,8 +33,6 @@ ts_device_has_uuid $DEVICE || ts_die "Cannot found UUID on $DEVICE" $DEVICE UUID=$(ts_uuid_by_devname $DEVICE) -ts_udev_dev_support "by-uuid" $UUID || ts_skip "udev ignores /dev/loop*" $DEVICE - [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT ts_fstab_add "UUID=$UUID" diff --git a/tests/ts/mount/fstab-uuid2devname b/tests/ts/mount/fstab-uuid2devname index b1d2e7773..a013d2eb1 100755 --- a/tests/ts/mount/fstab-uuid2devname +++ b/tests/ts/mount/fstab-uuid2devname @@ -33,8 +33,6 @@ ts_device_has_uuid $DEVICE || ts_die "Cannot found UUID on $DEVICE" $DEVICE UUID=$(ts_uuid_by_devname $DEVICE) -ts_udev_dev_support "by-uuid" $UUID || ts_skip "udev ignores /dev/loop*" $DEVICE - [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT ts_fstab_add "$DEVICE" diff --git a/tests/ts/mount/fstab-uuid2label b/tests/ts/mount/fstab-uuid2label index 7b21dfa22..94fb51767 100755 --- a/tests/ts/mount/fstab-uuid2label +++ b/tests/ts/mount/fstab-uuid2label @@ -33,8 +33,6 @@ mkfs.ext3 -L $LABEL $DEVICE &> /dev/null || ts_die "Cannot make ext3 on $DEVICE" ts_device_has "LABEL" $LABEL $DEVICE \ || ts_die "Cannot found LABEL '$LABEL' on $DEVICE" $DEVICE -ts_udev_dev_support "by-label" $LABEL || ts_skip "udev ignores /dev/loop*" $DEVICE - ts_device_has_uuid $DEVICE || ts_die "Cannot found UUID on $DEVICE" $DEVICE UUID=$(ts_uuid_by_devname $DEVICE) diff --git a/tests/ts/mount/label b/tests/ts/mount/label index 05df26ac7..c880e4b3b 100755 --- a/tests/ts/mount/label +++ b/tests/ts/mount/label @@ -34,9 +34,6 @@ mkfs.ext3 -L $LABEL $DEVICE &> /dev/null || ts_die "Cannot make ext3 on $DEVICE" ts_device_has "LABEL" $LABEL $DEVICE \ || ts_die "Cannot found LABEL '$LABEL' on $DEVICE" $DEVICE -ts_udev_dev_support "by-label" $LABEL \ - || ts_skip "udev ignores /dev/loop*" $DEVICE - [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT # variant A) diff --git a/tests/ts/mount/uuid b/tests/ts/mount/uuid index e46110318..79842306c 100755 --- a/tests/ts/mount/uuid +++ b/tests/ts/mount/uuid @@ -33,9 +33,6 @@ ts_device_has_uuid $DEVICE || ts_die "Cannot found UUID on $DEVICE" $DEVICE UUID=$(ts_uuid_by_devname $DEVICE) -ts_udev_dev_support "by-uuid" $UUID \ - || ts_skip "udev ignores /dev/loop*" $DEVICE - [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT # variant A) diff --git a/tests/ts/swapon/label b/tests/ts/swapon/label index 5a5e2650d..ec0de66f3 100755 --- a/tests/ts/swapon/label +++ b/tests/ts/swapon/label @@ -34,8 +34,6 @@ $TS_CMD_MKSWAP -L $LABEL $DEVICE > /dev/null 2>> $TS_OUTPUT \ ts_device_has "LABEL" $LABEL $DEVICE \ || ts_die "Cannot found LABEL '$LABEL' on $DEVICE" $DEVICE -ts_udev_dev_support "by-label" $LABEL || ts_skip "udev ignores /dev/loop*" $DEVICE - LD_LIBRARY_PATH="$U_L_LIBRARY_PATH" \ $TS_CMD_SWAPON -L $LABEL 2>&1 >> $TS_OUTPUT diff --git a/tests/ts/swapon/uuid b/tests/ts/swapon/uuid index 373afd3cd..3c015d9e0 100755 --- a/tests/ts/swapon/uuid +++ b/tests/ts/swapon/uuid @@ -34,8 +34,6 @@ ts_device_has_uuid $DEVICE || ts_die "Cannot found UUID on $DEVICE" $DEVICE UUID=$(ts_uuid_by_devname $DEVICE) -ts_udev_dev_support "by-uuid" $UUID || ts_skip "udev ignores /dev/loop*" $DEVICE - LD_LIBRARY_PATH="$U_L_LIBRARY_PATH" \ $TS_CMD_SWAPON -U $UUID 2>&1 >> $TS_OUTPUT