aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-09-04 23:27:50 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2017-09-04 23:33:00 +0200
commiteb2fbb1315e6489dd159c8227030d035bdeb1864 (patch)
tree436448e3991c7a285598f1b37cd75373e6ac40b6
parentb5ac0a412e1958cdff581d14b818bf042293267f (diff)
Find lib and config files related to Domino packageopnfv-5.0.RC1opnfv-5.0.0
As Functest installs Domino via package run_multinode.sh should get them via the install dir. domino_cli.py detects if lib is installed via packages too. Otherwise the default behavior is unchanged. Change-Id: Ic11129a88e99538dfd5e43cebe7ccf8bba2d2410 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
-rwxr-xr-xdomino_cli.py7
-rwxr-xr-xtests/run_multinode.sh13
2 files changed, 13 insertions, 7 deletions
diff --git a/domino_cli.py b/domino_cli.py
index 5cb0b1c..e1bbfbb 100755
--- a/domino_cli.py
+++ b/domino_cli.py
@@ -13,8 +13,13 @@
import sys, glob, getopt
import getopt
+import pkg_resources
-sys.path.insert(0, glob.glob('./lib')[0])
+try:
+ dir = pkg_resources.resource_filename('lib','.')
+except ImportError:
+ dir = './lib'
+sys.path.insert(0, glob.glob(dir)[0])
from dominoCLI import DominoClientCLI
from dominoCLI.ttypes import *
diff --git a/tests/run_multinode.sh b/tests/run_multinode.sh
index 5ccdf65..235eaf1 100755
--- a/tests/run_multinode.sh
+++ b/tests/run_multinode.sh
@@ -17,12 +17,13 @@ CLIENT1_CLIPORT=9100
CLIENT2_CLIPORT=9200
LOGLEVEL=DEBUG
-toscafile_test1=./tosca-templates/tosca_helloworld_nfv.yaml
-test1_reffile1=./tests/refdata/test1_client1.ref
-test1_reffile2=./tests/refdata/test1_client2.ref
-client1_log=./tests/logdata/client1.log
-client2_log=./tests/logdata/client2.log
-server_log=./tests/logdata/server.log
+dir=$(python -c "import sysconfig; print sysconfig.get_path('platlib')")
+toscafile_test1=${dir}/tosca-templates/tosca_helloworld_nfv.yaml
+test1_reffile1=${dir}/tests/refdata/test1_client1.ref
+test1_reffile2=${dir}/tests/refdata/test1_client2.ref
+client1_log=${dir}/tests/logdata/client1.log
+client2_log=${dir}/tests/logdata/client2.log
+server_log=${dir}/tests/logdata/server.log
start_server() {