Change in vdsm[master]: unit_tests: Make run_tests_local.sh not be a generated file

asegurap at redhat.com asegurap at redhat.com
Tue May 13 12:17:23 UTC 2014


Antoni Segura Puimedon has uploaded a new change for review.

Change subject: unit_tests: Make run_tests_local.sh not be a generated file
......................................................................

unit_tests: Make run_tests_local.sh not be a generated file

It is perfectly possible to simplify run_tests_local.sh.in so that
it does not use macros and this at the same time will allow for
testing subdirectories to use it.

Change-Id: Ie20647b9a7b447b8ed4082f7cefab2146150594e
Signed-off-by: Antoni S. Puimedon <asegurap at redhat.com>
---
A tests/run_tests_local.sh
D tests/run_tests_local.sh.in
2 files changed, 15 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/32/27632/1

diff --git a/tests/run_tests_local.sh b/tests/run_tests_local.sh
new file mode 100755
index 0000000..b282c10
--- /dev/null
+++ b/tests/run_tests_local.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+if [ -z "$PYTHON_EXE" ]; then
+    ENV_BIN="/usr/bin/env"
+    PYTHON_EXE="python2"
+fi
+
+# The following line is taken from http://stackoverflow.com/a/246128/206009
+# it sets DIR to the path of the directory that contains this bash script
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+if [ ! -f "$DIR/jsonrpc-tests.server.crt" ] || [ ! -f "$DIR/jsonrpc-tests.server.csr" ] || [ ! -f "$DIR/jsonrpc-tests.server.key" ]; then
+    $DIR/makecert.sh
+fi
+
+PYTHONDONTWRITEBYTECODE=1 LC_ALL=C PYTHONPATH="$DIR/../lib:$DIR/../vdsm:$DIR/../client:$DIR/../vdsm_api:$PYTHONPATH" $ENV_BIN "$PYTHON_EXE" $DIR/testrunner.py --local-modules $@
diff --git a/tests/run_tests_local.sh.in b/tests/run_tests_local.sh.in
deleted file mode 100644
index 0a229c0..0000000
--- a/tests/run_tests_local.sh.in
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-if [ -z "$PYTHON_EXE" ]; then
-    PYTHON_EXE="@PYTHON@"
-fi
-
-if [ ! -f @top_srcdir@/tests/jsonrpc-tests.server.crt ] || [ ! -f @top_srcdir@/tests/jsonrpc-tests.server.csr ] || [ ! -f @top_srcdir@/tests/jsonrpc-tests.server.key ]; then
-    @top_srcdir@/tests/makecert.sh
-fi
-
-PYTHONDONTWRITEBYTECODE=1 LC_ALL=C PYTHONPATH="@top_srcdir@/lib:@top_srcdir@/vdsm:@top_srcdir@/client:@top_srcdir@/vdsm_api:$PYTHONPATH" "$PYTHON_EXE" @top_srcdir@/tests/testrunner.py --local-modules $@


-- 
To view, visit http://gerrit.ovirt.org/27632
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie20647b9a7b447b8ed4082f7cefab2146150594e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap at redhat.com>


More information about the vdsm-patches mailing list