From 49a7e57f112d855b0609721b6082b15a94417380 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Tue, 23 May 2017 20:58:42 +0200 Subject: Define create_snapshot() and clean() in TestCase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They replace the former calls in run_tests which are not suitable for all test cases. Now any test case can define how to clean its resources. If the snapshot cannot be created, the test case is considered as failed. Only a message is printed if any failure during cleaning. It also defines a new class called OSGCTestCase useful for test cases which don't clean their OpenStack resources. All test cases located in opnfv_tests/openstack inherit from it to keep the global behavior unchanged. It also deletes exit instructions in openstack_clean and openstack_snapshot, removes clean flags in testcases.yaml and updates the related utils. All Docs are modified as well. JIRA: FUNCTEST-438 Change-Id: I8938e6255708012380389763a24059ace4ce45d8 Signed-off-by: Cédric Ollivier --- functest/opnfv_tests/openstack/vping/vping_base.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'functest/opnfv_tests/openstack/vping') diff --git a/functest/opnfv_tests/openstack/vping/vping_base.py b/functest/opnfv_tests/openstack/vping/vping_base.py index 8e71bf82..099f26b7 100644 --- a/functest/opnfv_tests/openstack/vping/vping_base.py +++ b/functest/opnfv_tests/openstack/vping/vping_base.py @@ -13,7 +13,7 @@ import os import time import uuid -from functest.core.testcase import TestCase +from functest.core import testcase from functest.utils import functest_utils from functest.utils.constants import CONST @@ -24,7 +24,7 @@ from snaps.openstack.tests import openstack_tests from snaps.openstack.utils import deploy_utils, nova_utils -class VPingBase(TestCase): +class VPingBase(testcase.OSGCTestCase): """ Base class for vPing tests that check connectivity between two VMs shared @@ -152,12 +152,12 @@ class VPingBase(TestCase): else: raise Exception('VMs never became active') - if result == TestCase.EX_RUN_ERROR: - return TestCase.EX_RUN_ERROR + if result == testcase.TestCase.EX_RUN_ERROR: + return testcase.TestCase.EX_RUN_ERROR self.stop_time = time.time() self.result = 100 - return TestCase.EX_OK + return testcase.TestCase.EX_OK def _cleanup(self): """ -- cgit 1.2.3-korg