]> sourceware.org Git - lvm2.git/commitdiff
test: Check flavour is used and exists
authorMarian Csontos <mcsontos@redhat.com>
Thu, 26 Jul 2018 13:01:50 +0000 (15:01 +0200)
committerMarian Csontos <mcsontos@redhat.com>
Thu, 26 Jul 2018 13:01:50 +0000 (15:01 +0200)
test/lib/inittest.sh

index c48ea132dad8370060958079ddc4c25203bee3fc..967fc1f667d9fc49597670da373f35405eebe128 100644 (file)
@@ -25,6 +25,8 @@ TESTNAME=${0##*/}
 PS4='#${BASH_SOURCE[0]##*/}:${LINENO}+ '
 export TESTNAME PS4
 
+LVM_TEST_FLAVOUR=${LVM_TEST_FLAVOUR-}
+
 LVM_TEST_BACKING_DEVICE=${LVM_TEST_BACKING_DEVICE-}
 LVM_TEST_DEVDIR=${LVM_TEST_DEVDIR-}
 LVM_TEST_NODEBUG=${LVM_TEST_NODEBUG-}
@@ -49,9 +51,9 @@ SKIP_WITH_LVMPOLLD=${SKIP_WITH_LVMPOLLD-}
 SKIP_WITH_LVMLOCKD=${SKIP_WITH_LVMLOCKD-}
 SKIP_ROOT_DM_CHECK=${SKIP_ROOT_DM_CHECK-}
 
-if test -n "$LVM_TEST_FLAVOUR"; then
-       . "lib/flavour-$LVM_TEST_FLAVOUR"
-fi
+test -n "$LVM_TEST_FLAVOUR" || { echo "NOTE: Empty flavour">&2; initskip; }
+test -f "lib/flavour-$LVM_TEST_FLAVOUR" || { echo "NOTE: Flavour '$LVM_TEST_FLAVOUR' does not exist">&2; initskip; }
+. "lib/flavour-$LVM_TEST_FLAVOUR"
 
 test -n "$SKIP_WITHOUT_CLVMD" && test "$LVM_TEST_LOCKING" -ne 3 && initskip
 test -n "$SKIP_WITH_CLVMD" && test "$LVM_TEST_LOCKING" = 3 && initskip
This page took 0.078298 seconds and 5 git commands to generate.