Force result = 0 if exception 85/59685/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Wed, 11 Jul 2018 12:58:36 +0000 (14:58 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Wed, 11 Jul 2018 13:21:42 +0000 (15:21 +0200)
self.result can be positive due to intermediary steps (scenarios).
Else it can return false positives [1].

[1] https://build.opnfv.org/ci/view/functest/job/functest-apex-virtual-suite-master/113/console

Change-Id: Iecadee7f7380fda5273a0668aff1b441647c45aa
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit f83c5fc1f0ecd3b93a39b3cf90ed9cd478cb37a6)

functest/opnfv_tests/openstack/rally/rally.py
functest/opnfv_tests/openstack/tempest/tempest.py

index df73d26..391e394 100644 (file)
@@ -478,6 +478,7 @@ class RallyBase(singlevm.VmReady1):
             res = testcase.TestCase.EX_OK
         except Exception as exc:   # pylint: disable=broad-except
             LOGGER.error('Error with run: %s', exc)
+            self.result = 0
             res = testcase.TestCase.EX_RUN_ERROR
         self.stop_time = time.time()
         return res
index eb34691..1a84f29 100644 (file)
@@ -305,6 +305,7 @@ class TempestCommon(singlevm.VmReady1):
             res = testcase.TestCase.EX_OK
         except Exception:  # pylint: disable=broad-except
             LOGGER.exception('Error with run')
+            self.result = 0
             res = testcase.TestCase.EX_RUN_ERROR
         self.stop_time = time.time()
         return res