Skip to content

Commit

Permalink
[FILE-6332] Enable testing for UUID usage with blkid command
Browse files Browse the repository at this point in the history
  • Loading branch information
mboelen committed Jul 30, 2016
1 parent 220476d commit c74c572
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions include/tests_filesystems
Expand Up @@ -221,21 +221,21 @@
REAL=""
UUID=""
LogText "Swap partition found: ${I}"
# YYY Add a test if partition is not a normal partition (e.g. UUID=)
# TODO Add a test if partition is not a normal partition (e.g. UUID=)
# Can be ^/dev/mapper/vg-name_lv-name
# Can be ^/dev/partition

# Can be ^UUID=uuid --> /dev/disk/by-uuid/<uuid>
# Test for UUID usage (e.g. UUID=uuid --> /dev/disk/by-uuid/<uuid>)
HAS_UUID=`echo ${I} | grep "^UUID="`
if [ ! "${HAS_UUID}" = "" ]; then
UUID=`echo ${HAS_UUID} | awk -F= '{ print $2 }'`
LogText "Result: Using ${UUID} as UUID"
if [ ! "${BLKIDBINARYx}" = "" ]; then
FIND2=`${BLKIDBINARY} | awk '{ if ($2=="UUID=\"${UUID}\"") print $1 }' | sed 's/:$//'`
if [ ! "${BLKIDBINARY}" = "" ]; then
FIND2=$(${BLKIDBINARY} | awk '{ if ($2=="UUID=\"${UUID}\"") print $1 }' | sed 's/:$//')
if [ ! "${FIND2}" = "" ]; then
REAL="${FIND2}"
REAL="${FIND2}"
fi
else
else
LogText "Result: blkid binary not found, trying by checking device listing"
sFILE=""
if [ -L /dev/disk/by-uuid/${UUID} ]; then
Expand All @@ -245,7 +245,7 @@
REAL="${sFILE}"
LogText "Result: disk is ${REAL}"
fi
else
else
LogText "Result: no symlink found to /dev/disk/by-uuid/${UUID}"
fi
fi
Expand Down

0 comments on commit c74c572

Please sign in to comment.