Skip to contentSkip to conversation

master - tests: properly check variables were defined

PATCH Zdenek Kabelac 1 participant 1 message Jul 12, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c4b6df94b4a39335369c439eb3110a06649378e5
Commit:        c4b6df94b4a39335369c439eb3110a06649378e5
Parent:        1daa1cc3a98b8812912875773ad3be1b9b173c4c
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Wed Jul 12 13:51:16 2017 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Wed Jul 12 13:51:16 2017 +0200

tests: properly check variables were defined

When test suite is installed some vars are not defined.

---
 test/api/pytest.sh   |    2 +-
 test/lib/inittest.sh |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
test/api/pytest.sh +1 -1
index ea53dbd..2581768 100644
@@ -30,7 +30,7 @@ aux prepare_dmeventd
 # gdb -ex r --args python FULL_PATH/lvm2/test/api/python_lvm_unit.py -v TestLvm.test_lv_active_inactive
 
 #Locate the python binding library to use.
-if [[ -n "$abs_top_builddir" ]]; then
+if [[ -n "${abs_top_builddir+varset}" ]]; then
   python_lib=($(find "$abs_top_builddir" -name lvm.so))
   if [[ ${#python_lib[*]} -ne 1 ]]; then
     if [[ ${#python_lib[*]} -gt 1 ]]; then
test/lib/inittest.sh +1 -1
index c0f3e6b..f13b386 100644
@@ -91,7 +91,7 @@ cd "$TESTDIR"
 mkdir lib
 
 # Setting up symlink from $i to $TESTDIR/lib
-test -n "$abs_top_builddir" && \
+test -n "${abs_top_builddir+varset}" && \
     find "$abs_top_builddir/daemons/dmeventd/plugins/" -name '*.so' \
     -exec ln -s -t lib "{}" +
 find "$TESTOLDPWD/lib" ! \( -name '*.sh' -o -name '*.[cdo]' \