diff options
author | Juha Kosonen <juha.kosonen@nokia.com> | 2016-03-15 12:20:17 +0000 |
---|---|---|
committer | Morgan Richomme <morgan.richomme@orange.com> | 2016-03-15 13:17:56 +0000 |
commit | b746008d169721c2a93279f1604a2a72a71e8ede (patch) | |
tree | 52df2e608b007eec1e537d831c51e6c6baefc7de | |
parent | 2a3fe5315c2539c2508b60da81247dbeb7ebb8ed (diff) |
Add exception handling for output processing
Handle the exception if parsed result in report cannot be converted to a
numeric value.
JIRA: FUNCTEST-149
Change-Id: Ibb259abdaa800761ee8dd2270c6bc2529081242d
Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
(cherry picked from commit d9d32a3f3f45b4f9008201e82235b33910e0f7f6)
-rwxr-xr-x | testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py index 5f5cd62f1..2137e9493 100755 --- a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py +++ b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py @@ -255,10 +255,17 @@ def get_output(proc, test_name): nb_tests += 1 elif "| total" in line: percentage = ((line.split('|')[8]).strip(' ')).strip('%') - success += float(percentage) + try: + success += float(percentage) + except ValueError: + logger.info('Percentage error: %s, %s' % (percentage, line)) nb_totals += 1 elif "Full duration" in line: - overall_duration += float(line.split(': ')[1]) + duration = line.split(': ')[1] + try: + overall_duration += float(duration) + except ValueError: + logger.info('Duration error: %s, %s' % (duration, line)) overall_duration="{:10.2f}".format(overall_duration) if nb_totals == 0: |