diff --git a/fuel_ccp_tests/helpers/post_os_deploy_checks.py b/fuel_ccp_tests/helpers/post_os_deploy_checks.py index c6d44cb..ebfc0a2 100644 --- a/fuel_ccp_tests/helpers/post_os_deploy_checks.py +++ b/fuel_ccp_tests/helpers/post_os_deploy_checks.py @@ -20,7 +20,7 @@ LOG.addHandler(logger.console) # TODO: replace check with deployment status request -def check_pods_status(k8sclient, timeout=1500, namespace='ccp'): +def check_pods_status(k8sclient, timeout=4500, namespace='ccp'): LOG.info("Check pods status") def is_pod_running(cluster, pod_name, namespace=namespace): @@ -45,7 +45,7 @@ def check_pods_status(k8sclient, timeout=1500, namespace='ccp'): # TODO: replace check with deployment status request -def check_jobs_status(k8sclient, timeout=1500, namespace='ccp'): +def check_jobs_status(k8sclient, timeout=4500, namespace='ccp'): LOG.info("Check jobs status") def is_job_successful(cluster, job_name, namespace=namespace): diff --git a/fuel_ccp_tests/tests/system/test_deploy.py b/fuel_ccp_tests/tests/system/test_deploy.py index 5bfd661..2dd1298 100644 --- a/fuel_ccp_tests/tests/system/test_deploy.py +++ b/fuel_ccp_tests/tests/system/test_deploy.py @@ -93,16 +93,16 @@ class TestDeployOpenstack(base_test.SystemBaseTest): "external registry address, " "current value {0}".format(settings.REGISTRY)) ccpcluster.deploy() - post_os_deploy_checks.check_jobs_status(k8s_actions.api) - post_os_deploy_checks.check_pods_status(k8s_actions.api) + post_os_deploy_checks.check_jobs_status(k8s_actions.api, timeout=4500) + post_os_deploy_checks.check_pods_status(k8s_actions.api, timeout=4500) + + # prepare rally rally.prepare() rally.pull_image() rally.run() - post_os_deploy_checks.check_jobs_status(k8s_actions.api, timeout=4500) - LOG.info('Check pods are running') - post_os_deploy_checks.check_pods_status(k8s_actions.api, timeout=4500) - + # run tempest rally.run_tempest() + LOG.info('Storing tests results...') res_file_name = 'result.json' file_prefix = 'results_' + datetime.datetime.now().strftime( @@ -114,9 +114,43 @@ class TestDeployOpenstack(base_test.SystemBaseTest): file_dst) res = json.load(remote.open('/home/{}/rally/result.json'.format( settings.SSH_LOGIN))) + formatted_tc = [] + failed_cases = [res['test_cases'][case] + for case in res['test_cases'] + if res['test_cases'][case]['status'] + in 'fail'] + for case in failed_cases: + if case: + tc = TestCase(case['name']) + tc.add_failure_info(case['traceback']) + formatted_tc.append(tc) - ts = TestSuite("tempest", [TestCase(case) for - case in res['test_cases']]) + skipped_cases = [res['test_cases'][case] + for case in res['test_cases'] + if res['test_cases'][case]['status'] in 'skip'] + for case in skipped_cases: + if case: + tc = TestCase(case['name']) + tc.add_skipped_info(case['reason']) + formatted_tc.append(tc) + + error_cases = [res['test_cases'][case] for case in res['test_cases'] + if res['test_cases'][case]['status'] in 'error'] + + for case in error_cases: + if case: + tc = TestCase(case['name']) + tc.add_error_info(case['traceback']) + formatted_tc.append(tc) + + success = [res['test_cases'][case] for case in res['test_cases'] + if res['test_cases'][case]['status'] in 'success'] + for case in success: + if case: + tc = TestCase(case['name']) + formatted_tc.append(tc) + + ts = TestSuite("tempest", formatted_tc) with open('tempest.xml', 'w') as f: ts.to_file(f, [ts], prettyprint=False) fail_msg = 'Tempest verification fails {}'.format(res)