diff options
-rw-r--r-- | ci/testcases.yaml | 4 | ||||
-rw-r--r-- | docker/Dockerfile | 2 | ||||
-rwxr-xr-x | testcases/Controllers/ODL/OpenDaylightTesting.py | 2 | ||||
-rwxr-xr-x | testcases/OpenStack/tempest/run_tempest.py | 2 | ||||
-rw-r--r-- | utils/functest_utils.py | 49 |
5 files changed, 43 insertions, 16 deletions
diff --git a/ci/testcases.yaml b/ci/testcases.yaml index 11056708d..7b7a7d14d 100644 --- a/ci/testcases.yaml +++ b/ci/testcases.yaml @@ -130,7 +130,7 @@ tiers: description: >- Test suite from Doctor project. dependencies: - installer: 'apex' + installer: '(apex)|(fuel)' scenario: '' - @@ -151,7 +151,7 @@ tiers: Simple security Scan dependencies: installer: 'apex' - scenario: 'disable' + scenario: '' - name: copper diff --git a/docker/Dockerfile b/docker/Dockerfile index a14bdc44e..b27b881a9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -73,7 +73,7 @@ RUN git clone https://gerrit.opnfv.org/gerrit/functest ${repos_dir}/functest RUN git clone https://gerrit.opnfv.org/gerrit/releng ${repos_dir}/releng RUN git clone https://gerrit.opnfv.org/gerrit/doctor ${repos_dir}/doctor RUN git clone -b 0.5.0 https://github.com/openstack/rally.git ${repos_dir}/rally -RUN git clone https://github.com/openstack/tempest.git ${repos_dir}/tempest +RUN git clone -b 12.1.0 https://github.com/openstack/tempest.git ${repos_dir}/tempest RUN git clone https://git.opendaylight.org/gerrit/p/integration/test.git ${repos_dir}/odl_test RUN git clone -b stable https://github.com/boucherv-orange/clearwater-live-test ${repos_dir}/vims-test RUN git clone https://github.com/openstack/networking-bgpvpn ${repos_dir}/bgpvpn diff --git a/testcases/Controllers/ODL/OpenDaylightTesting.py b/testcases/Controllers/ODL/OpenDaylightTesting.py index 2806b4f22..d3bc0978b 100755 --- a/testcases/Controllers/ODL/OpenDaylightTesting.py +++ b/testcases/Controllers/ODL/OpenDaylightTesting.py @@ -133,7 +133,7 @@ class ODLTestCases: details['description'] = result.suite.name details['tests'] = visitor.get_data() if not ft_utils.push_results_to_db( - "functest", "odl", None, start_time, stop_time, + "functest", "odl", cls.logger, start_time, stop_time, result.suite.status, details): cls.logger.error("Cannot push ODL results to DB") return False diff --git a/testcases/OpenStack/tempest/run_tempest.py b/testcases/OpenStack/tempest/run_tempest.py index c143fffae..7d023f5df 100755 --- a/testcases/OpenStack/tempest/run_tempest.py +++ b/testcases/OpenStack/tempest/run_tempest.py @@ -423,6 +423,7 @@ def main(): os.makedirs(TEMPEST_RESULTS_DIR) deployment_dir = ft_utils.get_deployment_dir(logger) + create_tempest_resources() if "" == args.conf: MODE = "" @@ -430,7 +431,6 @@ def main(): else: MODE = " --tempest-config " + args.conf - create_tempest_resources() generate_test_list(deployment_dir, args.mode) apply_tempest_blacklist() diff --git a/utils/functest_utils.py b/utils/functest_utils.py index 807a671a3..4d5004cbe 100644 --- a/utils/functest_utils.py +++ b/utils/functest_utils.py @@ -214,24 +214,51 @@ def push_results_to_db(project, case_name, logger, "build_tag": build_tag, "start_date": test_start, "stop_date": test_stop, "details": details} + error = None headers = {'Content-Type': 'application/json'} try: r = requests.post(url, data=json.dumps(params), headers=headers) if logger: logger.debug(r) r.raise_for_status() + except requests.RequestException as exc: + if 'r' in locals(): + error = ("Pushing Result to DB(%s) failed: %s" % + (r.url, r.content)) + else: + error = ("Pushing Result to DB(%s) failed: %s" % (url, exc)) + except Exception as e: + error = ("Error [push_results_to_db(" + "DB: '%(db)s', " + "project: '%(project)s', " + "case: '%(case)s', " + "pod: '%(pod)s', " + "version: '%(v)s', " + "scenario: '%(s)s', " + "criteria: '%(c)s', " + "build_tag: '%(t)s', " + "details: '%(d)s')]: " + "%(error)s" % + { + 'db': url, + 'project': project, + 'case': case_name, + 'pod': pod_name, + 'v': version, + 's': scenario, + 'c': criteria, + 't': build_tag, + 'd': details, + 'error': e + }) + finally: + if error: + if logger: + logger.error(error) + else: + print error + return False return True - except requests.RequestException: - if logger: - logger.error("Pushing Result to DB(%s) failed: %s" % - (r.url, r.content)) - return False - except Exception, e: - print("Error [push_results_to_db('%s', '%s', '%s', '%s'," - "'%s', '%s', '%s', '%s', '%s')]:" % - (url, project, case_name, pod_name, version, - scenario, criteria, build_tag, details)), e - return False def get_resolvconf_ns(): |