aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack/vping/vping_base.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-05-23 20:58:42 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2017-05-30 09:45:59 +0200
commit49a7e57f112d855b0609721b6082b15a94417380 (patch)
tree06ae633c210b9f5857edbdeac94792e7699af720 /functest/opnfv_tests/openstack/vping/vping_base.py
parentbec2511a842a37429b8343dc5f83b11d96dd47b8 (diff)
Define create_snapshot() and clean() in TestCase
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 <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/opnfv_tests/openstack/vping/vping_base.py')
-rw-r--r--functest/opnfv_tests/openstack/vping/vping_base.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/functest/opnfv_tests/openstack/vping/vping_base.py b/functest/opnfv_tests/openstack/vping/vping_base.py
index 8e71bf82c..099f26b7a 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):
"""