diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-07-11 16:12:57 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-07-11 17:32:40 +0200 |
commit | 4fb7e1330137fb77ed1b29bbc7c1491b6e12d9b6 (patch) | |
tree | 2790681584dd8743d58f2767be6dd41f8cc19a9c | |
parent | f83c5fc1f0ecd3b93a39b3cf90ed9cd478cb37a6 (diff) |
Check the status of inherited steps
Change-Id: If63c228f2844194279b560515f4ab24a4ee88be0
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
-rw-r--r-- | functest/core/singlevm.py | 7 | ||||
-rw-r--r-- | functest/opnfv_tests/openstack/rally/rally.py | 3 | ||||
-rw-r--r-- | functest/opnfv_tests/openstack/tempest/tempest.py | 3 | ||||
-rw-r--r-- | functest/opnfv_tests/openstack/vping/vping_userdata.py | 3 | ||||
-rw-r--r-- | functest/tests/unit/openstack/tempest/test_tempest.py | 5 |
5 files changed, 15 insertions, 6 deletions
diff --git a/functest/core/singlevm.py b/functest/core/singlevm.py index 61c74fd60..23f453722 100644 --- a/functest/core/singlevm.py +++ b/functest/core/singlevm.py @@ -168,13 +168,15 @@ class VmReady1(tenantnetwork.TenantNetwork1): status = testcase.TestCase.EX_RUN_ERROR try: assert self.cloud - super(VmReady1, self).run(**kwargs) + assert super(VmReady1, self).run( + **kwargs) == testcase.TestCase.EX_OK self.image = self.publish_image() self.flavor = self.create_flavor() self.result = 100 status = testcase.TestCase.EX_OK except Exception: # pylint: disable=broad-except self.__logger.exception('Cannot run %s', self.case_name) + self.result = 0 finally: self.stop_time = time.time() return status @@ -346,7 +348,8 @@ class SingleVm1(VmReady1): status = testcase.TestCase.EX_RUN_ERROR try: assert self.cloud - super(SingleVm1, self).run(**kwargs) + assert super(SingleVm1, self).run( + **kwargs) == testcase.TestCase.EX_OK self.result = 0 self.prepare() self.sshvm = self.boot_vm( diff --git a/functest/opnfv_tests/openstack/rally/rally.py b/functest/opnfv_tests/openstack/rally/rally.py index e193b83ef..49379e991 100644 --- a/functest/opnfv_tests/openstack/rally/rally.py +++ b/functest/opnfv_tests/openstack/rally/rally.py @@ -494,7 +494,8 @@ class RallyBase(singlevm.VmReady1): """Run testcase.""" self.start_time = time.time() try: - super(RallyBase, self).run(**kwargs) + assert super(RallyBase, self).run( + **kwargs) == testcase.TestCase.EX_OK conf_utils.create_rally_deployment() self._prepare_env() self._run_tests() diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py index ea82d2307..168e28907 100644 --- a/functest/opnfv_tests/openstack/tempest/tempest.py +++ b/functest/opnfv_tests/openstack/tempest/tempest.py @@ -286,7 +286,8 @@ class TempestCommon(singlevm.VmReady1): def run(self, **kwargs): self.start_time = time.time() try: - super(TempestCommon, self).run(**kwargs) + assert super(TempestCommon, self).run( + **kwargs) == testcase.TestCase.EX_OK self.update_rally_regex() self.configure(**kwargs) self.generate_test_list(**kwargs) diff --git a/functest/opnfv_tests/openstack/vping/vping_userdata.py b/functest/opnfv_tests/openstack/vping/vping_userdata.py index c3de0b8b6..3b0a1a9e1 100644 --- a/functest/opnfv_tests/openstack/vping/vping_userdata.py +++ b/functest/opnfv_tests/openstack/vping/vping_userdata.py @@ -39,7 +39,8 @@ class VPingUserdata(singlevm.VmReady2): """ try: assert self.cloud - super(VPingUserdata, self).run() + assert super(VPingUserdata, self).run( + **kwargs) == testcase.TestCase.EX_OK self.result = 0 self.vm1 = self.boot_vm() self.vm2 = self.boot_vm( diff --git a/functest/tests/unit/openstack/tempest/test_tempest.py b/functest/tests/unit/openstack/tempest/test_tempest.py index 3dd05abb6..23dcd6c75 100644 --- a/functest/tests/unit/openstack/tempest/test_tempest.py +++ b/functest/tests/unit/openstack/tempest/test_tempest.py @@ -248,7 +248,9 @@ class OSTempestTesting(unittest.TestCase): side_effect=Exception): self._test_run(testcase.TestCase.EX_RUN_ERROR) - def test_run(self): + @mock.patch('functest.opnfv_tests.openstack.tempest.tempest.TempestCommon.' + 'run', return_value=testcase.TestCase.EX_OK) + def test_run(self, *args): with mock.patch.object(self.tempestcommon, 'update_rally_regex'), \ mock.patch.object(self.tempestcommon, 'generate_test_list'), \ mock.patch.object(self.tempestcommon, @@ -258,6 +260,7 @@ class OSTempestTesting(unittest.TestCase): 'parse_verifier_result'), \ mock.patch.object(self.tempestcommon, 'generate_report'): self._test_run(testcase.TestCase.EX_OK) + args[0].assert_called_once_with() if __name__ == "__main__": |