diff options
author | Karel Zak | 2007-05-16 02:07:07 +0200 |
---|---|---|
committer | Karel Zak | 2007-05-18 13:09:12 +0200 |
commit | 064b8c3842cf347cdf203f7b2d4f4b82f4eeaaa2 (patch) | |
tree | fc46a4602cd8565ea22e32d939c5ec5f26085115 /tests/functions.sh | |
parent | tests: code refactoring -- new ts_device_init function (diff) | |
download | kernel-qcow2-util-linux-064b8c3842cf347cdf203f7b2d4f4b82f4eeaaa2.tar.gz kernel-qcow2-util-linux-064b8c3842cf347cdf203f7b2d4f4b82f4eeaaa2.tar.xz kernel-qcow2-util-linux-064b8c3842cf347cdf203f7b2d4f4b82f4eeaaa2.zip |
tests: code refactoring -- new ts_udev_loop_support function
The patch moves generic and duplicated code to a new
ts_udev_loop_support function.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests/functions.sh')
-rw-r--r-- | tests/functions.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/functions.sh b/tests/functions.sh index 86abfb4e9..6c0658b1b 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -99,4 +99,16 @@ function ts_device_deinit { rm -f "$IMAGE" &> /dev/null fi } + +function ts_udev_loop_support { + ldd $TS_CMD_MOUNT | grep -q 'libvolume_id' 2>&1 >> $TS_OUTPUT + if [ "$?" == "0" ]; then + HAS_VOLUMEID="yes" + fi + if [ -n "$HAS_VOLUMEID" ] && [ ! -L "/dev/disk/by-label/$1" ]; then + return 1 + fi + return 0 +} + |