diff options
author | Linda Wang <wangwulin@huawei.com> | 2018-02-26 09:19:59 +0000 |
---|---|---|
committer | Linda Wang <wangwulin@huawei.com> | 2018-02-27 07:28:50 +0000 |
commit | 86fba65c64321fee0385634298949a653dfbb454 (patch) | |
tree | e28cf201480b7825a0a29f35ff7c92758d52bb40 | |
parent | 43b29ad7ed13cd9bbcc2316b3809ba64a45ea42d (diff) |
Update the way of running tempest
Use 'tempest run' instead of 'run_tempest.sh', which has
been removed by tempest 16.0.0
Also, 'tempest.py' has been renamed to 'run_tempest.py', to
avoid package importing conflict
Change-Id: I61e802e0381d1f33281610e98d05813c9b96faf9
Signed-off-by: Linda Wang <wangwulin@huawei.com>
-rw-r--r-- | sdnvpn/test/functest/config.yaml | 2 | ||||
-rw-r--r-- | sdnvpn/test/functest/run_tempest.py (renamed from sdnvpn/test/functest/tempest.py) | 23 |
2 files changed, 18 insertions, 7 deletions
diff --git a/sdnvpn/test/functest/config.yaml b/sdnvpn/test/functest/config.yaml index a5f4782..d719453 100644 --- a/sdnvpn/test/functest/config.yaml +++ b/sdnvpn/test/functest/config.yaml @@ -2,7 +2,7 @@ defaults: flavor: m1.tiny # adapt to your environment testcases: - sdnvpn.test.functest.tempest: + sdnvpn.test.functest.run_tempest: enabled: true description: Neutron BGPVPN tests in tempest diff --git a/sdnvpn/test/functest/tempest.py b/sdnvpn/test/functest/run_tempest.py index d34af0b..d52cbff 100644 --- a/sdnvpn/test/functest/tempest.py +++ b/sdnvpn/test/functest/run_tempest.py @@ -20,8 +20,13 @@ logger = logging.getLogger('sdnvpn-tempest') def main(): - verifier_repo_dir = tempest_utils.get_verifier_repo_dir(None) - src_tempest_dir = tempest_utils.get_verifier_deployment_dir(None, None) + verifier_id = tempest_utils.get_verifier_id() + verifier_repo_dir = tempest_utils.get_verifier_repo_dir( + verifier_id) + deployment_id = tempest_utils.get_verifier_deployment_id() + src_tempest_dir = tempest_utils.get_verifier_deployment_dir( + verifier_id, deployment_id) + if not src_tempest_dir: logger.error("Rally deployment not found.") @@ -30,7 +35,8 @@ def main(): tempest_utils.configure_verifier(src_tempest_dir) src_tempest_conf = os.path.join(src_tempest_dir, 'tempest.conf') - bgpvpn_tempest_conf = src_tempest_dir + '/bgpvpn_tempest.conf' + bgpvpn_tempest_conf = os.path.join(src_tempest_dir, 'bgpvpn_tempest.conf') + bgpvpn_tempest_list = os.path.join(src_tempest_dir, 'tempest_list.txt') if not os.path.isfile(src_tempest_conf): logger.error("tempest.conf not found in %s." % src_tempest_conf) @@ -45,9 +51,14 @@ def main(): with open(bgpvpn_tempest_conf, 'wb') as tempest_conf: config.write(tempest_conf) - cmd_line = (verifier_repo_dir + - "/run_tempest.sh -C %s -t -N -- " - "networking_bgpvpn_tempest" % bgpvpn_tempest_conf) + cmd = ("cd {0};" + "testr list-tests networking_bgpvpn_tempest > {1};" + "cd -;".format(verifier_repo_dir, bgpvpn_tempest_list)) + logger.info("Generating bgpvpn tempest list: %s" % cmd) + os.popen(cmd) + + cmd_line = ("tempest run --config-file {0} -t --whitelist-file {1}" + .format(bgpvpn_tempest_conf, bgpvpn_tempest_list)) logger.info("Executing: %s" % cmd_line) cmd = os.popen(cmd_line) output = cmd.read() |