From 064b8c3842cf347cdf203f7b2d4f4b82f4eeaaa2 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 16 May 2007 02:07:07 +0200 Subject: 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 --- tests/functions.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/functions.sh') 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 +} + -- cgit v1.2.3-55-g7522