From eb2fbb1315e6489dd159c8227030d035bdeb1864 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Mon, 4 Sep 2017 23:27:50 +0200 Subject: Find lib and config files related to Domino package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- domino_cli.py | 7 ++++++- tests/run_multinode.sh | 13 +++++++------ 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() { -- cgit 1.2.3-korg