diff options
author | Vijayendra Radhakrishna <vradhakrishna@mvista.com> | 2016-12-08 21:19:18 +0530 |
---|---|---|
committer | Vijayendra Radhakrishna <vradhakrishna@mvista.com> | 2016-12-09 19:02:47 +0530 |
commit | 04443eaf16effe54eff8eba35d04bfc1a1960d32 (patch) | |
tree | 755d0272285ccb10a5ad17a4ce7ee63ab1185452 /tests/functest/odl-sfc/run_tests.py | |
parent | d3de20395d79daf9aa6b3c6fd4f9eea80791398e (diff) |
remove dependancy of prepare_odl_sfc.py
Pre setup files below are not required anymore
prepare_odl_sfc.py
compute_presetup_CI.bash
server_presetup_CI.bash
Files are not removed yet.
Change-Id: I26cc8ba1a7c61f84fa06809217963ebd7f6b4b20
Signed-off-by: Vijayendra Radhakrishna <vradhakrishna@mvista.com>
Diffstat (limited to 'tests/functest/odl-sfc/run_tests.py')
-rw-r--r-- | tests/functest/odl-sfc/run_tests.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/functest/odl-sfc/run_tests.py b/tests/functest/odl-sfc/run_tests.py index 96ed9a3f..451ce564 100644 --- a/tests/functest/odl-sfc/run_tests.py +++ b/tests/functest/odl-sfc/run_tests.py @@ -18,6 +18,8 @@ import ovs_utils import functest.utils.functest_logger as ft_logger import functest.utils.functest_utils as ft_utils import yaml +import utils +import SSHUtils as ssh_utils parser = argparse.ArgumentParser() @@ -40,7 +42,33 @@ def push_results(testname, start_time, end_time, criteria, details): details) +def get_tackerc_file(): + rc_file = os.path.join(COMMON_CONFIG.sfc_test_dir, 'tackerc') + if not os.path.exists(rc_file): + logger.info("tackerc file not found, getting it from controller") + ip = utils.get_openstack_node_ips("controller") + ssh_conn = ssh_utils.get_ssh_client(ip[0], 'root', + proxy=COMMON_CONFIG.fuel_proxy) + ssh_utils.get_file(ssh_conn, "tackerc", rc_file) + else: + logger.info("found tackerc file") + + return rc_file + + +def set_tacker_rc_file_env(): + rc_file = get_tackerc_file() + with open(rc_file) as f: + for line in f.readlines(): + if not (line.startswith('#') or len(line) == 1): + filtered = line.strip().split(' ') + kv = filtered[1].split('=') + logger.info("Set shell env %s=%s" % (kv[0], kv[1])) + os.environ[kv[0]] = kv[1].strip("'") + + def main(): + set_tacker_rc_file_env() ovs_logger = ovs_utils.OVSLogger( os.path.join(COMMON_CONFIG.sfc_test_dir, 'ovs-logs'), COMMON_CONFIG.functest_results_dir) |