From: Karel Zak Date: Fri, 4 Dec 2009 19:30:16 +0000 (+0100) Subject: tests: remove vol_id from tests X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=283a8c15988e65e6c4741c7d7739b969e7383203;p=util-linux tests: remove vol_id from tests Signed-off-by: Karel Zak --- diff --git a/configure.ac b/configure.ac index 18e46695..acd932bc 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 70084cd0..8399738c 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 e8a2ceb6..eb9a878d 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 98e5172c..eb85c55c 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 375a1ba7..21903830 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 f53de4fb..6ae9bffb 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 1c90c2ed..f74cdf29 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 7f78e45e..73b59dcc 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 b1d2e777..a013d2eb 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 7b21dfa2..94fb5176 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 05df26ac..c880e4b3 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 e4611031..79842306 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 5a5e2650..ec0de66f 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 373afd3c..3c015d9e 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