Skip to contentSkip to conversation

test: set LD_LIBRARY_PATH to all dirs with *.so

PATCH New Tony Asleson 1 participant 2 messages Oct 26, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 test: set LD_LIBRARY_PATH to all dirs with *.so

Instead of manually editing entries, add all the
directories which contain shared objects.

---
 test/lib/utils.sh |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
test/lib/utils.sh +5 -5
index 70d9f66..ab5abc1 100644
@@ -204,11 +204,11 @@ test -n "${abs_top_builddir+varset}" || . lib/paths || die "you must run make fi
 case "$PATH" in
 *"$abs_top_builddir/test/lib"*) ;;
 *)
-        PATH="$abs_top_builddir/test/lib":$PATH
-        for d in daemons/dmeventd/plugins/mirror daemons/dmeventd/plugins/snapshot \
-                daemons/dmeventd/plugins/lvm2 daemons/dmeventd liblvm tools libdm; do
-                LD_LIBRARY_PATH="$abs_top_builddir/$d":$LD_LIBRARY_PATH
-        done
+	PATH="$abs_top_builddir/test/lib":"$abs_top_builddir/test/api":$PATH
+	for i in `find $abs_top_builddir -name \*.so`; do
+		p=`dirname $i`
+		LD_LIBRARY_PATH="$p":$LD_LIBRARY_PATH
+	done
         export PATH LD_LIBRARY_PATH ;;
 esac
 
Signature · 1 line
1.7.1
#1 lore raw

PATCH 2/2 python-lvm: Initial check-in of python-lvm unit test case.

---
 test/api/pytest.sh          |   27 +++
 test/api/python_lvm_unit.py |  375 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 402 insertions(+), 0 deletions(-)
 create mode 100644 test/api/pytest.sh
 create mode 100755 test/api/python_lvm_unit.py
test/api/pytest.sh new file +27 -0
new file mode 100644
index 0000000..ad99624
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Copyright (C) 2012 Red Hat, Inc. All rights reserved.
+#
+# This file is part of LVM2.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+
+. lib/test
+
+aux prepare_vg 1
+lvcreate -n test -l 5 $vg
+
+#Locate the python binding library to use.
+python_lib=`find $abs_top_builddir -name lvm.so`
+if [ "$python_lib" != "" ]
+then
+	export PYTHONPATH=`dirname $python_lib`:$PYTHONPATH
+	python_lvm_unit.py
+else
+	echo "Unable to test python bindings as library not available"
+fi
test/api/python_lvm_unit.py new file +375 -0

376 lines not on this page · raw message

Signature · 1 line
1.7.1