]> err.no Git - util-linux/commitdiff
tests: remove vol_id from tests
authorKarel Zak <kzak@redhat.com>
Fri, 4 Dec 2009 19:30:16 +0000 (20:30 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 4 Dec 2009 19:30:16 +0000 (20:30 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
14 files changed:
configure.ac
tests/commands.sh.in
tests/functions.sh
tests/ts/cramfs/mkfs
tests/ts/mount/fstab-label
tests/ts/mount/fstab-label2devname
tests/ts/mount/fstab-label2uuid
tests/ts/mount/fstab-uuid
tests/ts/mount/fstab-uuid2devname
tests/ts/mount/fstab-uuid2label
tests/ts/mount/label
tests/ts/mount/uuid
tests/ts/swapon/label
tests/ts/swapon/uuid

index 18e46695bb836658cee4e5c1bc66e68a858f4c2b..acd932bc95654e54c810dad21fdac62fab3454bd 100644 (file)
@@ -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
 
index 70084cd063803b52b1df5d0caa2e8e4c3f8d293e..8399738c8e476c80bf323e8973612a82ffae513d 100644 (file)
@@ -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
index e8a2ceb69ec6b82baa6ae2d80f9a2f7e37035baf..eb9a878d7689d1911a3b427ada8529d39b083624 100644 (file)
@@ -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 {
index 98e5172c1ad6f0adaf2ea4ebf096306037dbd930..eb85c55cf29baabe358d1a90b1eb8e367b6f2ed3 100755 (executable)
@@ -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
 
index 375a1ba72bd46ec9efd3316cefdf58d498de6fb1..21903830d23f090b8d97e781c5b3b28c410f22a5 100755 (executable)
@@ -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"
index f53de4fb225c7a75f78cb9ce79c14329ac6fcb33..6ae9bffb5d53acccd8f7f2bb9367a5b77d245693 100755 (executable)
@@ -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"
index 1c90c2edafd17ee2ff9ec344117c46f96cc06563..f74cdf2924126ba475870d39fd5b4ea7064f6210 100755 (executable)
@@ -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)
index 7f78e45e3af6950789fe6777596f7241a3cfd39f..73b59dcc44c565e952243ddd7ac816823c0c38bd 100755 (executable)
@@ -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"
index b1d2e7773c44ad919e0ffd7b25cc30992bae4674..a013d2eb1114f9406694b4936644645440c477af 100755 (executable)
@@ -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"
index 7b21dfa22356e12a2c15ec23d77d783397daf34c..94fb51767a8e5e42305a5c6f5170263cf7f849b5 100755 (executable)
@@ -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)
index 05df26ac7f330d4df33a77c7961c37cf1a8f87ad..c880e4b3b5f0eb3e57d7410ed5e4d33251d70327 100755 (executable)
@@ -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)
index e46110318553b02021a1ed9e759cd16c6ff3d43e..79842306c5be8543518744691e5c034085641584 100755 (executable)
@@ -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)
index 5a5e2650d7369b31defe1f434baa688c061fb2dc..ec0de66f38d40d09503bba4bbdec06b9351a9c91 100755 (executable)
@@ -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
 
index 373afd3cd3752da4b6cea37fc31a4884e890e7f4..3c015d9e0a62eda01ae3f8e5224e0ab13038fc85 100755 (executable)
@@ -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