aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests
diff options
context:
space:
mode:
authorhelenyao <yaohelan@huawei.com>2016-12-01 21:52:43 -0500
committerjose.lausuch <jose.lausuch@ericsson.com>2016-12-02 17:01:19 +0100
commitdc733c31177b0ffdc4c30b9c4801b765909f1c50 (patch)
tree574c2eccbece763723e72d1a23251d3495f939ea /functest/opnfv_tests
parent9e469ae7bb108bc38cbb9fa8e6a81e8f3ff9a1a7 (diff)
Rename TestCasesBase into TestcaseBase
JIRA: FUNCTEST-628 1. rename the TestCasesBase into TestcaseBase 2. updated the module name to testcase_base.py Change-Id: Ic6b5d8209098c136613a2419c3790668fdbd493e Signed-off-by: helenyao <yaohelan@huawei.com>
Diffstat (limited to 'functest/opnfv_tests')
-rwxr-xr-xfunctest/opnfv_tests/features/domino.py8
-rw-r--r--functest/opnfv_tests/features/sdnvpn.py9
-rw-r--r--functest/opnfv_tests/openstack/vping/vping_base.py22
-rw-r--r--functest/opnfv_tests/openstack/vping/vping_ssh.py8
-rwxr-xr-xfunctest/opnfv_tests/sdn/odl/odl.py8
-rw-r--r--functest/opnfv_tests/vnf/rnc/parser.py10
6 files changed, 33 insertions, 32 deletions
diff --git a/functest/opnfv_tests/features/domino.py b/functest/opnfv_tests/features/domino.py
index 4d882e15..45b93e7b 100755
--- a/functest/opnfv_tests/features/domino.py
+++ b/functest/opnfv_tests/features/domino.py
@@ -19,13 +19,13 @@ import os
import sys
import time
-from functest.core import TestCasesBase
+import functest.core.testcase_base as testcase_base
import functest.utils.functest_constants as ft_constants
import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as ft_utils
-class DominoCases(TestCasesBase.TestCasesBase):
+class DominoCases(testcase_base.TestcaseBase):
DOMINO_REPO = \
ft_constants.DOMINO_REPO_DIR
RESULTS_DIR = \
@@ -72,9 +72,9 @@ if __name__ == '__main__':
domino = DominoCases()
try:
result = domino.main(**args)
- if result != TestCasesBase.TestCasesBase.EX_OK:
+ if result != testcase_base.TestcaseBase.EX_OK:
sys.exit(result)
if args['report']:
sys.exit(domino.push_to_db())
except Exception:
- sys.exit(TestCasesBase.TestCasesBase.EX_RUN_ERROR)
+ sys.exit(testcase_base.TestcaseBase.EX_RUN_ERROR)
diff --git a/functest/opnfv_tests/features/sdnvpn.py b/functest/opnfv_tests/features/sdnvpn.py
index 1c07fe14..451299eb 100644
--- a/functest/opnfv_tests/features/sdnvpn.py
+++ b/functest/opnfv_tests/features/sdnvpn.py
@@ -14,13 +14,13 @@ import os
import sys
import time
-from functest.core import TestCasesBase
+import functest.core.testcase_base as testcase_base
import functest.utils.functest_constants as ft_constants
import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as ft_utils
-class SdnVpnTests(TestCasesBase.TestCasesBase):
+class SdnVpnTests(testcase_base.TestcaseBase):
SDNVPN_REPO_TESTS = os.path.join(
ft_constants.SDNVPN_REPO_DIR, "tests/functest")
logger = ft_logger.Logger("sdnvpn").getLogger()
@@ -58,6 +58,7 @@ class SdnVpnTests(TestCasesBase.TestCasesBase):
kwargs = {}
return self.main(**kwargs)
+
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-r", "--report",
@@ -67,9 +68,9 @@ if __name__ == '__main__':
sdnvpn = SdnVpnTests()
try:
result = sdnvpn.main(**args)
- if result != TestCasesBase.TestCasesBase.EX_OK:
+ if result != testcase_base.TestcaseBase.EX_OK:
sys.exit(result)
if args['report']:
sys.exit(sdnvpn.push_to_db())
except Exception:
- sys.exit(TestCasesBase.TestCasesBase.EX_RUN_ERROR)
+ sys.exit(testcase_base.TestcaseBase.EX_RUN_ERROR)
diff --git a/functest/opnfv_tests/openstack/vping/vping_base.py b/functest/opnfv_tests/openstack/vping/vping_base.py
index 00177a22..213b79fc 100644
--- a/functest/opnfv_tests/openstack/vping/vping_base.py
+++ b/functest/opnfv_tests/openstack/vping/vping_base.py
@@ -15,10 +15,10 @@ from datetime import datetime
import functest.utils.functest_utils as ft_utils
import functest.utils.functest_constants as ft_constants
import functest.utils.openstack_utils as os_utils
-from functest.core import TestCasesBase
+import functest.core.testcase_base as testcase_base
-class VPingBase(TestCasesBase.TestCasesBase):
+class VPingBase(testcase_base.TestcaseBase):
def __init__(self):
def get_conf(parameter):
return ft_utils.get_functest_config(parameter)
@@ -55,23 +55,23 @@ class VPingBase(TestCasesBase.TestCasesBase):
def run(self, **kwargs):
if not self.check_repo_exist():
- return TestCasesBase.TestCasesBase.EX_RUN_ERROR
+ return testcase_base.TestcaseBase.EX_RUN_ERROR
image_id = self.create_image()
if not image_id:
- return TestCasesBase.TestCasesBase.EX_RUN_ERROR
+ return testcase_base.TestcaseBase.EX_RUN_ERROR
flavor = self.get_flavor()
if not flavor:
- return TestCasesBase.TestCasesBase.EX_RUN_ERROR
+ return testcase_base.TestcaseBase.EX_RUN_ERROR
network_id = self.create_network_full()
if not network_id:
- return TestCasesBase.TestCasesBase.EX_RUN_ERROR
+ return testcase_base.TestcaseBase.EX_RUN_ERROR
sg_id = self.create_security_group()
if not sg_id:
- return TestCasesBase.TestCasesBase.EX_RUN_ERROR
+ return testcase_base.TestcaseBase.EX_RUN_ERROR
self.delete_exist_vms()
@@ -87,7 +87,7 @@ class VPingBase(TestCasesBase.TestCasesBase):
None,
sg_id)
if not vm1:
- return TestCasesBase.TestCasesBase.EX_RUN_ERROR
+ return testcase_base.TestcaseBase.EX_RUN_ERROR
test_ip = self.get_test_ip(vm1)
vm2 = self.boot_vm(self.vm2_name,
@@ -97,17 +97,17 @@ class VPingBase(TestCasesBase.TestCasesBase):
test_ip,
sg_id)
if not vm2:
- return TestCasesBase.TestCasesBase.EX_RUN_ERROR
+ return testcase_base.TestcaseBase.EX_RUN_ERROR
EXIT_CODE = self.do_vping(vm2, test_ip)
- if EXIT_CODE == TestCasesBase.TestCasesBase.EX_RUN_ERROR:
+ if EXIT_CODE == testcase_base.TestcaseBase.EX_RUN_ERROR:
return EXIT_CODE
self.stop_time = time.time()
self.parse_result(EXIT_CODE,
self.start_time,
self.stop_time)
- return TestCasesBase.TestCasesBase.EX_OK
+ return testcase_base.TestcaseBase.EX_OK
def boot_vm_preparation(self, config, vmname, test_ip):
pass
diff --git a/functest/opnfv_tests/openstack/vping/vping_ssh.py b/functest/opnfv_tests/openstack/vping/vping_ssh.py
index 48913857..8ae590ed 100644
--- a/functest/opnfv_tests/openstack/vping/vping_ssh.py
+++ b/functest/opnfv_tests/openstack/vping/vping_ssh.py
@@ -19,7 +19,7 @@ from scp import SCPClient
import functest.utils.functest_logger as ft_logger
import functest.utils.openstack_utils as os_utils
import vping_base
-from functest.core.TestCasesBase import TestCasesBase
+import functest.core.testcase_base as testcase_base
class VPingSSH(vping_base.VPingBase):
@@ -32,12 +32,12 @@ class VPingSSH(vping_base.VPingBase):
def do_vping(self, vm, test_ip):
floatip = self.add_float_ip(vm)
if not floatip:
- return TestCasesBase.EX_RUN_ERROR
+ return testcase_base.TestcaseBase.EX_RUN_ERROR
ssh = self.establish_ssh(vm, floatip)
if not ssh:
- return TestCasesBase.EX_RUN_ERROR
+ return testcase_base.TestcaseBase.EX_RUN_ERROR
if not self.transfer_ping_script(ssh, floatip):
- return TestCasesBase.EX_RUN_ERROR
+ return testcase_base.TestcaseBase.EX_RUN_ERROR
return self.do_vping_ssh(ssh, test_ip)
def add_float_ip(self, vm):
diff --git a/functest/opnfv_tests/sdn/odl/odl.py b/functest/opnfv_tests/sdn/odl/odl.py
index c3fcb241..95440746 100755
--- a/functest/opnfv_tests/sdn/odl/odl.py
+++ b/functest/opnfv_tests/sdn/odl/odl.py
@@ -20,7 +20,7 @@ from robot.errors import RobotError
import robot.run
from robot.utils.robottime import timestamp_to_secs
-from functest.core import TestCasesBase
+import functest.core.testcase_base as testcase_base
import functest.utils.functest_logger as ft_logger
import functest.utils.openstack_utils as op_utils
import functest.utils.functest_constants as ft_constants
@@ -47,7 +47,7 @@ class ODLResultVisitor(ResultVisitor):
return self._data
-class ODLTests(TestCasesBase.TestCasesBase):
+class ODLTests(testcase_base.TestcaseBase):
repos = ft_constants.REPOS_DIR
odl_test_repo = os.path.join(repos, "odl_test")
@@ -233,9 +233,9 @@ if __name__ == '__main__':
odl = ODLTests()
try:
result = odl.main(**args)
- if result != TestCasesBase.TestCasesBase.EX_OK:
+ if result != testcase_base.TestcaseBase.EX_OK:
sys.exit(result)
if args['pushtodb']:
sys.exit(odl.push_to_db())
except Exception:
- sys.exit(TestCasesBase.TestCasesBase.EX_RUN_ERROR)
+ sys.exit(testcase_base.TestcaseBase.EX_RUN_ERROR)
diff --git a/functest/opnfv_tests/vnf/rnc/parser.py b/functest/opnfv_tests/vnf/rnc/parser.py
index f653220a..a50d4f1e 100644
--- a/functest/opnfv_tests/vnf/rnc/parser.py
+++ b/functest/opnfv_tests/vnf/rnc/parser.py
@@ -20,13 +20,13 @@ import time
import argparse
-import functest.core.TestCasesBase as base
+import functest.core.testcase_base as testcase_base
import functest.utils.functest_constants as ft_constants
import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as ft_utils
-class Parser(base.TestCasesBase):
+class Parser(testcase_base.TestcaseBase):
def __init__(self):
super(Parser, self).__init__()
@@ -34,7 +34,7 @@ class Parser(base.TestCasesBase):
self.case_name = "parser-basics"
self.logger = ft_logger.Logger("parser").getLogger()
self.log_file = os.path.join(
- ft_constants.FUNCTEST_RESULTS_DIR, "parser.log")
+ ft_constants.FUNCTEST_RESULTS_DIR, "parser.log")
def run(self, **kwargs):
cmd = 'cd %s/tests && ./functest_run.sh' % ft_constants.PARSER_REPO_DIR
@@ -71,9 +71,9 @@ if __name__ == '__main__':
parser = Parser()
try:
result = parser.run(**args)
- if result != base.TestCasesBase.EX_OK:
+ if result != testcase_base.TestcaseBase.EX_OK:
sys.exit(result)
if args['report']:
sys.exit(parser.push_to_db())
except Exception:
- sys.exit(base.TestCasesBase.EX_RUN_ERROR)
+ sys.exit(testcase_base.TestcaseBase.EX_RUN_ERROR)