aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack
diff options
context:
space:
mode:
Diffstat (limited to 'functest/opnfv_tests/openstack')
-rw-r--r--functest/opnfv_tests/openstack/rally/rally.py11
-rw-r--r--functest/opnfv_tests/openstack/tempest/conf_utils.py3
-rw-r--r--functest/opnfv_tests/openstack/tempest/tempest.py17
3 files changed, 26 insertions, 5 deletions
diff --git a/functest/opnfv_tests/openstack/rally/rally.py b/functest/opnfv_tests/openstack/rally/rally.py
index e7cac7af..f984c368 100644
--- a/functest/opnfv_tests/openstack/rally/rally.py
+++ b/functest/opnfv_tests/openstack/rally/rally.py
@@ -94,11 +94,8 @@ class RallyBase(testcase_base.TestcaseBase):
else:
task_args['netid'] = ''
- auth_url = CONST.OS_AUTH_URL
- if auth_url is not None:
- task_args['request_url'] = auth_url.rsplit(":", 1)[0]
- else:
- task_args['request_url'] = ''
+ # get keystone auth endpoint
+ task_args['request_url'] = CONST.OS_AUTH_URL or ''
return task_args
@@ -533,6 +530,10 @@ class RallyBase(testcase_base.TestcaseBase):
return testcase_base.TestcaseBase.EX_RUN_ERROR
self.stop_time = time.time()
+ # If we are here, it means that the test case was successfully executed
+ # criteria is managed by the criteria Field
+ return testcase_base.TestcaseBase.EX_OK
+
class RallySanity(RallyBase):
def __init__(self):
diff --git a/functest/opnfv_tests/openstack/tempest/conf_utils.py b/functest/opnfv_tests/openstack/tempest/conf_utils.py
index 4c5e8663..0c9064a1 100644
--- a/functest/opnfv_tests/openstack/tempest/conf_utils.py
+++ b/functest/opnfv_tests/openstack/tempest/conf_utils.py
@@ -172,6 +172,9 @@ def configure_tempest(deployment_dir, IMAGE_ID=None, FLAVOR_ID=None):
config.write(config_file)
# Copy tempest.conf to /home/opnfv/functest/results/tempest/
+ if not os.path.exists(TEMPEST_RESULTS_DIR):
+ os.makedirs(TEMPEST_RESULTS_DIR)
+
shutil.copyfile(tempest_conf_file,
os.path.join(TEMPEST_RESULTS_DIR, 'tempest.conf'))
diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py
index 2bdbe47f..9c19a147 100644
--- a/functest/opnfv_tests/openstack/tempest/tempest.py
+++ b/functest/opnfv_tests/openstack/tempest/tempest.py
@@ -238,10 +238,23 @@ class TempestCommon(testcase_base.TestcaseBase):
num_success = new_line[2]
elif 'Skipped' in new_line:
num_skipped = new_line[2]
+ elif 'Failures' in new_line:
+ num_failures = new_line[2]
try:
num_executed = int(num_tests) - int(num_skipped)
success_rate = 100 * int(num_success) / int(num_executed)
+ with open(os.path.join(conf_utils.TEMPEST_RESULTS_DIR,
+ "tempest.log"), 'r') as logfile:
+ output = logfile.read()
+
+ error_logs = ""
+ for match in re.findall('(.*?)[. ]*FAILED', output):
+ error_logs += match
+
+ self.details = {"tests": int(num_tests),
+ "failures": int(num_failures),
+ "errors": error_logs}
except Exception:
success_rate = 0
@@ -281,6 +294,10 @@ class TempestCommon(testcase_base.TestcaseBase):
self.stop_time = time.time()
+ # If we are here, it means that the test case was successfully executed
+ # criteria is managed by the criteria Field
+ return testcase_base.TestcaseBase.EX_OK
+
class TempestSmokeSerial(TempestCommon):