It simply removes the useless suffix.
Change-Id: Ib9a682b57d8f33518359d817a593bb3786577390
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
In order to harmonize test integration, 3 abstraction classes have been
introduced in Danube:
- * testcase_base: base for any test case
+ * testcase: base for any test case
* feature_base: abstraction for feature project
* vnf_base: abstraction for vnf onboarding
The goal is to unify the way to run test from Functest.
-feature_base and vnf_base inherit from testcase_base::
+feature_base and vnf_base inherit from testcase::
+-----------------------------------------+
| |
| |-- __init__.py
| |-- feature_base.py
| |-- pytest_suite_runner.py
- | |-- testcase_base.py
+ | |-- testcase.py
| |-- vnf_base.py
|-- opnfv_tests
| |-- __init__.py
import functest.ci.generate_report as generate_report
import functest.ci.tier_builder as tb
-import functest.core.testcase_base as testcase_base
+import functest.core.testcase as testcase
import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as ft_utils
import functest.utils.openstack_clean as os_clean
if GlobalVariables.REPORT_FLAG:
flags += " -r"
- result = testcase_base.TestCase.EX_RUN_ERROR
+ result = testcase.TestCase.EX_RUN_ERROR
run_dict = get_run_dict(test_name)
if run_dict:
try:
result = test_case.run(**kwargs)
except KeyError:
result = test_case.run()
- if result == testcase_base.TestCase.EX_OK:
+ if result == testcase.TestCase.EX_OK:
if GlobalVariables.REPORT_FLAG:
test_case.push_to_db()
result = test_case.check_criteria()
import time
-import testcase_base as base
+import testcase as base
import functest.utils.functest_utils as ft_utils
import functest.utils.functest_logger as ft_logger
from functest.utils.constants import CONST
#
# http://www.apache.org/licenses/LICENSE-2.0
-import testcase_base as base
+import testcase as base
import unittest
import time
import functest.utils.functest_logger as ft_logger
import functest.utils.openstack_utils as os_utils
import functest.utils.functest_utils as ft_utils
-import testcase_base as base
+import testcase as base
from functest.utils.constants import CONST
import iniparse
import yaml
-from functest.core import testcase_base
+from functest.core import testcase
from functest.utils.constants import CONST
import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as ft_utils
logger = ft_logger.Logger('Rally').getLogger()
-class RallyBase(testcase_base.TestCase):
+class RallyBase(testcase.TestCase):
TESTS = ['authenticate', 'glance', 'cinder', 'heat', 'keystone',
'neutron', 'nova', 'quotas', 'requests', 'vm', 'all']
GLANCE_IMAGE_NAME = CONST.openstack_image_name
self._run_tests()
self._generate_report()
self._clean_up()
- res = testcase_base.TestCase.EX_OK
+ res = testcase.TestCase.EX_OK
except Exception as e:
logger.error('Error with run: %s' % e)
- res = testcase_base.TestCase.EX_RUN_ERROR
+ res = testcase.TestCase.EX_RUN_ERROR
self.stop_time = time.time()
return res
import subprocess
import time
-from functest.core import testcase_base
+from functest.core import testcase
from functest.opnfv_tests.openstack.tempest import conf_utils
from functest.utils import openstack_utils
from functest.utils.constants import CONST
logger = ft_logger.Logger("refstack_defcore").getLogger()
-class RefstackClient(testcase_base.TestCase):
+class RefstackClient(testcase.TestCase):
def __init__(self):
super(RefstackClient, self).__init__()
conf_utils.configure_tempest_defcore(
self.DEPLOYMENT_DIR, img_flavor_dict)
self.source_venv()
- res = testcase_base.TestCase.EX_OK
+ res = testcase.TestCase.EX_OK
except KeyError as e:
logger.error("defcore prepare env error with: %s", e)
- res = testcase_base.TestCase.EX_RUN_ERROR
+ res = testcase.TestCase.EX_RUN_ERROR
return res
self.defcore_env_prepare()
self.run_defcore_default()
self.parse_refstack_result()
- res = testcase_base.TestCase.EX_OK
+ res = testcase.TestCase.EX_OK
except Exception as e:
logger.error('Error with run: %s', e)
- res = testcase_base.TestCase.EX_RUN_ERROR
+ res = testcase.TestCase.EX_RUN_ERROR
self.stop_time = time.time()
return res
openstack_utils.source_credentials(CONST.openstack_creds)
self.defcore_env_prepare()
self.run_defcore(tempestconf, testlist)
- res = testcase_base.TestCase.EX_OK
+ res = testcase.TestCase.EX_OK
except Exception as e:
logger.error('Error with run: %s', e)
- res = testcase_base.TestCase.EX_RUN_ERROR
+ res = testcase.TestCase.EX_RUN_ERROR
return res
-class RefstackClientParser(testcase_base.TestCase):
+class RefstackClientParser(testcase.TestCase):
def __init__(self):
super(RefstackClientParser, self).__init__()
args = parser.parse_args(sys.argv[1:])
try:
result = refstackclient.main(**args)
- if result != testcase_base.TestCase.EX_OK:
+ if result != testcase.TestCase.EX_OK:
sys.exit(result)
except Exception:
- sys.exit(testcase_base.TestCase.EX_RUN_ERROR)
+ sys.exit(testcase.TestCase.EX_RUN_ERROR)
import yaml
-from functest.core import testcase_base
+from functest.core import testcase
from functest.opnfv_tests.openstack.tempest import conf_utils
from functest.utils.constants import CONST
import functest.utils.functest_logger as ft_logger
logger = ft_logger.Logger("Tempest").getLogger()
-class TempestCommon(testcase_base.TestCase):
+class TempestCommon(testcase.TestCase):
def __init__(self):
super(TempestCommon, self).__init__()
self.apply_tempest_blacklist()
self.run_verifier_tests()
self.parse_verifier_result()
- res = testcase_base.TestCase.EX_OK
+ res = testcase.TestCase.EX_OK
except Exception as e:
logger.error('Error with run: %s' % e)
- res = testcase_base.TestCase.EX_RUN_ERROR
+ res = testcase.TestCase.EX_RUN_ERROR
self.stop_time = time.time()
return res
import time
from datetime import datetime
-import functest.core.testcase_base as testcase_base
+import functest.core.testcase as testcase
import functest.utils.openstack_utils as os_utils
from functest.utils.constants import CONST
-class VPingBase(testcase_base.TestCase):
+class VPingBase(testcase.TestCase):
def __init__(self):
super(VPingBase, self).__init__()
self.logger = None
def run(self, **kwargs):
if not self.check_repo_exist():
- return testcase_base.TestCase.EX_RUN_ERROR
+ return testcase.TestCase.EX_RUN_ERROR
image_id = self.create_image()
if not image_id:
- return testcase_base.TestCase.EX_RUN_ERROR
+ return testcase.TestCase.EX_RUN_ERROR
flavor = self.get_flavor()
if not flavor:
- return testcase_base.TestCase.EX_RUN_ERROR
+ return testcase.TestCase.EX_RUN_ERROR
network_id = self.create_network_full()
if not network_id:
- return testcase_base.TestCase.EX_RUN_ERROR
+ return testcase.TestCase.EX_RUN_ERROR
sg_id = self.create_security_group()
if not sg_id:
- return testcase_base.TestCase.EX_RUN_ERROR
+ return testcase.TestCase.EX_RUN_ERROR
self.delete_exist_vms()
None,
sg_id)
if not vm1:
- return testcase_base.TestCase.EX_RUN_ERROR
+ return testcase.TestCase.EX_RUN_ERROR
test_ip = self.get_test_ip(vm1)
vm2 = self.boot_vm(self.vm2_name,
test_ip,
sg_id)
if not vm2:
- return testcase_base.TestCase.EX_RUN_ERROR
+ return testcase.TestCase.EX_RUN_ERROR
EXIT_CODE = self.do_vping(vm2, test_ip)
- if EXIT_CODE == testcase_base.TestCase.EX_RUN_ERROR:
+ if EXIT_CODE == testcase.TestCase.EX_RUN_ERROR:
return EXIT_CODE
self.stop_time = time.time()
self.parse_result(EXIT_CODE,
self.start_time,
self.stop_time)
- return testcase_base.TestCase.EX_OK
+ return testcase.TestCase.EX_OK
def boot_vm_preparation(self, config, vmname, test_ip):
pass
import functest.utils.functest_logger as ft_logger
import functest.utils.openstack_utils as os_utils
import vping_base
-import functest.core.testcase_base as testcase_base
+import functest.core.testcase as testcase
class VPingSSH(vping_base.VPingBase):
def do_vping(self, vm, test_ip):
floatip = self.add_float_ip(vm)
if not floatip:
- return testcase_base.TestCase.EX_RUN_ERROR
+ return testcase.TestCase.EX_RUN_ERROR
ssh = self.establish_ssh(vm, floatip)
if not ssh:
- return testcase_base.TestCase.EX_RUN_ERROR
+ return testcase.TestCase.EX_RUN_ERROR
if not self.transfer_ping_script(ssh, floatip):
- return testcase_base.TestCase.EX_RUN_ERROR
+ return testcase.TestCase.EX_RUN_ERROR
return self.do_vping_ssh(ssh, test_ip)
def add_float_ip(self, vm):
import robot.run
from robot.utils.robottime import timestamp_to_secs
-from functest.core import testcase_base
+from functest.core import testcase
import functest.utils.functest_logger as ft_logger
import functest.utils.openstack_utils as op_utils
return self._data
-class ODLTests(testcase_base.TestCase):
+class ODLTests(testcase.TestCase):
repos = "/home/opnfv/repos/"
odl_test_repo = os.path.join(repos, "odl_test")
logger = ft_logger.Logger("opendaylight").getLogger()
def __init__(self):
- testcase_base.TestCase.__init__(self)
+ testcase.TestCase.__init__(self)
self.case_name = "odl"
@classmethod
args = parser.parse_args(sys.argv[1:])
try:
result = odl.main(ODLTests.default_suites, **args)
- if result != testcase_base.TestCase.EX_OK:
+ if result != testcase.TestCase.EX_OK:
sys.exit(result)
if args['pushtodb']:
sys.exit(odl.push_to_db())
except Exception:
- sys.exit(testcase_base.TestCase.EX_RUN_ERROR)
+ sys.exit(testcase.TestCase.EX_RUN_ERROR)
import time
import urlparse
-from functest.core import testcase_base
+from functest.core import testcase
from functest.utils.constants import CONST
import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as ft_utils
logger = ft_logger.Logger(__name__).getLogger()
-class OnosBase(testcase_base.TestCase):
+class OnosBase(testcase.TestCase):
onos_repo_path = CONST.dir_repo_onos
onos_sfc_image_name = CONST.onos_sfc_image_name
onos_sfc_image_path = os.path.join(CONST.dir_functest_data,
self.start_time = time.time()
try:
self._run()
- res = testcase_base.TestCase.EX_OK
+ res = testcase.TestCase.EX_OK
except Exception as e:
logger.error('Error with run: %s', e)
- res = testcase_base.TestCase.EX_RUN_ERROR
+ res = testcase.TestCase.EX_RUN_ERROR
self.stop_time = time.time()
return res
import argparse
-import functest.core.testcase_base as testcase_base
+import functest.core.testcase as testcase
import functest.core.vnf_base as vnf_base
import functest.utils.functest_logger as ft_logger
aaa_vnf = AaaVnf()
try:
result = aaa_vnf.main(**args)
- if result != testcase_base.TestCase.EX_OK:
+ if result != testcase.TestCase.EX_OK:
sys.exit(result)
if args['pushtodb']:
sys.exit(aaa_vnf.push_to_db())
except Exception:
- sys.exit(testcase_base.TestCase.EX_RUN_ERROR)
+ sys.exit(testcase.TestCase.EX_RUN_ERROR)
import mock
-from functest.core import testcase_base
+from functest.core import testcase
class TestCaseTesting(unittest.TestCase):
logging.disable(logging.CRITICAL)
def setUp(self):
- self.test = testcase_base.TestCase()
+ self.test = testcase.TestCase()
self.test.project = "functest"
self.test.case_name = "base"
self.test.start_time = "1"
def test_run_unimplemented(self):
self.assertEqual(self.test.run(),
- testcase_base.TestCase.EX_RUN_ERROR)
+ testcase.TestCase.EX_RUN_ERROR)
@mock.patch('functest.utils.functest_utils.push_results_to_db',
return_value=False)
def _test_missing_attribute(self, mock_function=None):
self.assertEqual(self.test.push_to_db(),
- testcase_base.TestCase.EX_PUSH_TO_DB_ERROR)
+ testcase.TestCase.EX_PUSH_TO_DB_ERROR)
mock_function.assert_not_called()
def test_missing_case_name(self):
def test_missing_details(self, mock_function=None):
self.test.details = None
self.assertEqual(self.test.push_to_db(),
- testcase_base.TestCase.EX_OK)
+ testcase.TestCase.EX_OK)
mock_function.assert_called_once_with(
self.test.project, self.test.case_name, self.test.start_time,
self.test.stop_time, self.test.criteria, self.test.details)
return_value=False)
def test_push_to_db_failed(self, mock_function=None):
self.assertEqual(self.test.push_to_db(),
- testcase_base.TestCase.EX_PUSH_TO_DB_ERROR)
+ testcase.TestCase.EX_PUSH_TO_DB_ERROR)
mock_function.assert_called_once_with(
self.test.project, self.test.case_name, self.test.start_time,
self.test.stop_time, self.test.criteria, self.test.details)
return_value=True)
def test_push_to_db(self, mock_function=None):
self.assertEqual(self.test.push_to_db(),
- testcase_base.TestCase.EX_OK)
+ testcase.TestCase.EX_OK)
mock_function.assert_called_once_with(
self.test.project, self.test.case_name, self.test.start_time,
self.test.stop_time, self.test.criteria, self.test.details)
def test_check_criteria_missing(self):
self.test.criteria = None
self.assertEqual(self.test.check_criteria(),
- testcase_base.TestCase.EX_TESTCASE_FAILED)
+ testcase.TestCase.EX_TESTCASE_FAILED)
def test_check_criteria_failed(self):
self.test.criteria = 'FAILED'
self.assertEqual(self.test.check_criteria(),
- testcase_base.TestCase.EX_TESTCASE_FAILED)
+ testcase.TestCase.EX_TESTCASE_FAILED)
def test_check_criteria_pass(self):
self.test.criteria = 'PASS'
self.assertEqual(self.test.check_criteria(),
- testcase_base.TestCase.EX_OK)
+ testcase.TestCase.EX_OK)
if __name__ == "__main__":
from keystoneauth1.exceptions import auth_plugins
from robot.errors import DataError, RobotError
-from robot.result import testcase
+from robot.result import testcase as result_testcase
from robot.utils.robottime import timestamp_to_secs
-from functest.core import testcase_base
+from functest.core import testcase
from functest.opnfv_tests.sdn.odl import odl
'elapsedtime': 1000,
'text': 'Hello, World!',
'critical': True}
- test = testcase.TestCase(name=data['name'],
- status=data['status'],
- message=data['text'],
- starttime=data['starttime'],
- endtime=data['endtime'])
+ test = result_testcase.TestCase(name=data['name'],
+ status=data['status'],
+ message=data['text'],
+ starttime=data['starttime'],
+ endtime=data['endtime'])
test.parent = mock.Mock()
config = {'name': data['parent'],
'criticality.test_is_critical.return_value': data[
def _test_main_missing_keyword(self, key):
kwargs = self._get_main_kwargs(key)
self.assertEqual(self.test.main(**kwargs),
- testcase_base.TestCase.EX_RUN_ERROR)
+ testcase.TestCase.EX_RUN_ERROR)
def test_main_missing_odlusername(self):
self._test_main_missing_keyword('odlusername')
def test_main_set_robotframework_vars_failed(self):
with mock.patch.object(self.test, 'set_robotframework_vars',
return_value=False):
- self._test_main(testcase_base.TestCase.EX_RUN_ERROR)
+ self._test_main(testcase.TestCase.EX_RUN_ERROR)
self.test.set_robotframework_vars.assert_called_once_with(
self._odl_username, self._odl_password)
with mock.patch.object(self.test, 'set_robotframework_vars',
return_value=True), \
self.assertRaises(Exception):
- self._test_main(testcase_base.TestCase.EX_RUN_ERROR,
+ self._test_main(testcase.TestCase.EX_RUN_ERROR,
mock_method)
@mock.patch('os.makedirs', side_effect=OSError)
def test_main_makedirs_oserror(self, mock_method):
with mock.patch.object(self.test, 'set_robotframework_vars',
return_value=True):
- self._test_main(testcase_base.TestCase.EX_RUN_ERROR,
+ self._test_main(testcase.TestCase.EX_RUN_ERROR,
mock_method)
@mock.patch('robot.run', side_effect=RobotError)
mock.patch.object(odl, 'open', mock.mock_open(),
create=True), \
self.assertRaises(RobotError):
- self._test_main(testcase_base.TestCase.EX_RUN_ERROR, *args)
+ self._test_main(testcase.TestCase.EX_RUN_ERROR, *args)
@mock.patch('robot.run')
@mock.patch('os.makedirs')
create=True), \
mock.patch.object(self.test, 'parse_results',
side_effect=RobotError):
- self._test_main(testcase_base.TestCase.EX_RUN_ERROR, *args)
+ self._test_main(testcase.TestCase.EX_RUN_ERROR, *args)
@mock.patch('os.remove', side_effect=Exception)
@mock.patch('robot.run')
return_value=True), \
mock.patch.object(self.test, 'parse_results'), \
self.assertRaises(Exception):
- self._test_main(testcase_base.TestCase.EX_OK, *args)
+ self._test_main(testcase.TestCase.EX_OK, *args)
@mock.patch('os.remove')
@mock.patch('robot.run')
mock.patch.object(odl, 'open', mock.mock_open(),
create=True), \
mock.patch.object(self.test, 'parse_results'):
- self._test_main(testcase_base.TestCase.EX_OK, *args)
+ self._test_main(testcase.TestCase.EX_OK, *args)
@mock.patch('os.remove')
@mock.patch('robot.run')
mock.patch.object(odl, 'open', mock.mock_open(),
create=True), \
mock.patch.object(self.test, 'parse_results'):
- self._test_main(testcase_base.TestCase.EX_OK, *args)
+ self._test_main(testcase.TestCase.EX_OK, *args)
@mock.patch('os.remove')
@mock.patch('robot.run', return_value=1)
mock.patch.object(odl, 'open', mock.mock_open(),
create=True), \
mock.patch.object(self.test, 'parse_results'):
- self._test_main(testcase_base.TestCase.EX_OK, *args)
+ self._test_main(testcase.TestCase.EX_OK, *args)
@mock.patch('os.remove', side_effect=OSError)
@mock.patch('robot.run')
mock.patch.object(odl, 'open', mock.mock_open(),
create=True), \
mock.patch.object(self.test, 'parse_results'):
- self._test_main(testcase_base.TestCase.EX_OK, *args)
+ self._test_main(testcase.TestCase.EX_OK, *args)
def _test_run_missing_env_var(self, var):
with mock.patch('functest.utils.openstack_utils.get_endpoint',
side_effect=self._fake_url_for):
del os.environ[var]
self.assertEqual(self.test.run(),
- testcase_base.TestCase.EX_RUN_ERROR)
+ testcase.TestCase.EX_RUN_ERROR)
- def _test_run(self, status=testcase_base.TestCase.EX_OK,
+ def _test_run(self, status=testcase.TestCase.EX_OK,
exception=None, odlip="127.0.0.3", odlwebport="8080",
odlrestconfport="8181"):
with mock.patch('functest.utils.openstack_utils.get_endpoint',
def _test_run_defining_multiple_suites(
self, suites,
- status=testcase_base.TestCase.EX_OK,
+ status=testcase.TestCase.EX_OK,
exception=None, odlip="127.0.0.3", odlwebport="8080",
odlrestconfport="8181"):
with mock.patch('functest.utils.openstack_utils.get_endpoint',
with mock.patch('functest.utils.openstack_utils.get_endpoint',
side_effect=auth_plugins.MissingAuthPlugin()):
self.assertEqual(self.test.run(),
- testcase_base.TestCase.EX_RUN_ERROR)
+ testcase.TestCase.EX_RUN_ERROR)
def test_run_missing_os_auth_url(self):
self._test_run_missing_env_var("OS_AUTH_URL")
def test_run_main_false(self):
os.environ["SDN_CONTROLLER_IP"] = self._sdn_controller_ip
- self._test_run(testcase_base.TestCase.EX_RUN_ERROR,
+ self._test_run(testcase.TestCase.EX_RUN_ERROR,
odlip=self._sdn_controller_ip,
odlwebport=self._odl_webport)
def test_run_main_exception(self):
with self.assertRaises(Exception):
os.environ["SDN_CONTROLLER_IP"] = self._sdn_controller_ip
- self._test_run(status=testcase_base.TestCase.EX_RUN_ERROR,
+ self._test_run(status=testcase.TestCase.EX_RUN_ERROR,
exception=Exception(),
odlip=self._sdn_controller_ip,
odlwebport=self._odl_webport)
with mock.patch('functest.utils.openstack_utils.get_endpoint',
side_effect=self._fake_url_for):
self.assertEqual(self.test.run(),
- testcase_base.TestCase.EX_RUN_ERROR)
+ testcase.TestCase.EX_RUN_ERROR)
def test_run_without_installer_type(self):
os.environ["SDN_CONTROLLER_IP"] = self._sdn_controller_ip
- self._test_run(testcase_base.TestCase.EX_OK,
+ self._test_run(testcase.TestCase.EX_OK,
odlip=self._sdn_controller_ip,
odlwebport=self._odl_webport)
os.environ["SDN_CONTROLLER_IP"] = self._sdn_controller_ip
self._test_run_defining_multiple_suites(
[odl.ODLTests.basic_suite_dir],
- testcase_base.TestCase.EX_OK,
+ testcase.TestCase.EX_OK,
odlip=self._sdn_controller_ip,
odlwebport=self._odl_webport)
def test_run_fuel(self):
os.environ["INSTALLER_TYPE"] = "fuel"
- self._test_run(testcase_base.TestCase.EX_OK,
+ self._test_run(testcase.TestCase.EX_OK,
odlip=self._neutron_ip, odlwebport='8282')
def test_run_apex_missing_sdn_controller_ip(self):
side_effect=self._fake_url_for):
os.environ["INSTALLER_TYPE"] = "apex"
self.assertEqual(self.test.run(),
- testcase_base.TestCase.EX_RUN_ERROR)
+ testcase.TestCase.EX_RUN_ERROR)
def test_run_apex(self):
os.environ["SDN_CONTROLLER_IP"] = self._sdn_controller_ip
os.environ["INSTALLER_TYPE"] = "apex"
- self._test_run(testcase_base.TestCase.EX_OK,
+ self._test_run(testcase.TestCase.EX_OK,
odlip=self._sdn_controller_ip, odlwebport='8081',
odlrestconfport='8081')
side_effect=self._fake_url_for):
os.environ["INSTALLER_TYPE"] = "netvirt"
self.assertEqual(self.test.run(),
- testcase_base.TestCase.EX_RUN_ERROR)
+ testcase.TestCase.EX_RUN_ERROR)
def test_run_netvirt(self):
os.environ["SDN_CONTROLLER_IP"] = self._sdn_controller_ip
os.environ["INSTALLER_TYPE"] = "netvirt"
- self._test_run(testcase_base.TestCase.EX_OK,
+ self._test_run(testcase.TestCase.EX_OK,
odlip=self._sdn_controller_ip, odlwebport='8081',
odlrestconfport='8081')
side_effect=self._fake_url_for):
os.environ["INSTALLER_TYPE"] = "joid"
self.assertEqual(self.test.run(),
- testcase_base.TestCase.EX_RUN_ERROR)
+ testcase.TestCase.EX_RUN_ERROR)
def test_run_joid(self):
os.environ["SDN_CONTROLLER"] = self._sdn_controller_ip
os.environ["INSTALLER_TYPE"] = "joid"
- self._test_run(testcase_base.TestCase.EX_OK,
+ self._test_run(testcase.TestCase.EX_OK,
odlip=self._sdn_controller_ip, odlwebport='8080')
def test_run_compass(self, *args):
os.environ["INSTALLER_TYPE"] = "compass"
- self._test_run(testcase_base.TestCase.EX_OK,
+ self._test_run(testcase.TestCase.EX_OK,
odlip=self._neutron_ip, odlwebport='8181')
def test_argparser_default(self):
import mock
-from functest.core import testcase_base
+from functest.core import testcase
from functest.opnfv_tests.openstack.rally import rally
from functest.utils.constants import CONST
mock.patch.object(self.rally_base, '_generate_report'), \
mock.patch.object(self.rally_base, '_clean_up'):
self.assertEqual(self.rally_base.run(),
- testcase_base.TestCase.EX_OK)
+ testcase.TestCase.EX_OK)
def test_run_exception(self):
with mock.patch.object(self.rally_base, '_prepare_env',
side_effect=Exception):
self.assertEqual(self.rally_base.run(),
- testcase_base.TestCase.EX_RUN_ERROR)
+ testcase.TestCase.EX_RUN_ERROR)
if __name__ == "__main__":
import os
import unittest
-from functest.core import testcase_base
+from functest.core import testcase
from functest.opnfv_tests.openstack.refstack_client import refstack_client
from functest.utils.constants import CONST
def _test_main_missing_keyword(self, key):
kwargs = self._get_main_kwargs(key)
self.assertEqual(self.refstackclient.main(**kwargs),
- testcase_base.TestCase.EX_RUN_ERROR)
+ testcase.TestCase.EX_RUN_ERROR)
def test_main_missing_conf(self):
self._test_main_missing_keyword('config')
import mock
-from functest.core import testcase_base
+from functest.core import testcase
from functest.opnfv_tests.openstack.tempest import tempest
from functest.opnfv_tests.openstack.tempest import conf_utils
mock_method.assert_any_call('test_case_name', 100)
def test_run_missing_create_tempest_dir(self):
- ret = testcase_base.TestCase.EX_RUN_ERROR
+ ret = testcase.TestCase.EX_RUN_ERROR
with mock.patch('functest.opnfv_tests.openstack.tempest.tempest.'
'os.path.exists', return_value=False), \
mock.patch('functest.opnfv_tests.openstack.tempest.tempest.'
self.assertTrue(mock_os_makedirs.called)
def test_run_missing_configure_tempest(self):
- ret = testcase_base.TestCase.EX_RUN_ERROR
- ret_ok = testcase_base.TestCase.EX_OK
+ ret = testcase.TestCase.EX_RUN_ERROR
+ ret_ok = testcase.TestCase.EX_OK
with mock.patch('functest.opnfv_tests.openstack.tempest.tempest.'
'os.path.exists', return_value=False), \
mock.patch('functest.opnfv_tests.openstack.tempest.tempest.'
self.assertTrue(mock_os_makedirs.called)
def test_run_missing_generate_test_list(self):
- ret = testcase_base.TestCase.EX_RUN_ERROR
- ret_ok = testcase_base.TestCase.EX_OK
+ ret = testcase.TestCase.EX_RUN_ERROR
+ ret_ok = testcase.TestCase.EX_OK
with mock.patch('functest.opnfv_tests.openstack.tempest.tempest.'
'os.path.exists', return_value=False), \
mock.patch('functest.opnfv_tests.openstack.tempest.tempest.'
self.assertTrue(mock_os_makedirs.called)
def test_run_missing_apply_tempest_blacklist(self):
- ret = testcase_base.TestCase.EX_RUN_ERROR
- ret_ok = testcase_base.TestCase.EX_OK
+ ret = testcase.TestCase.EX_RUN_ERROR
+ ret_ok = testcase.TestCase.EX_OK
with mock.patch('functest.opnfv_tests.openstack.tempest.tempest.'
'os.path.exists', return_value=False), \
mock.patch('functest.opnfv_tests.openstack.tempest.tempest.'
self.assertTrue(mock_os_makedirs.called)
def test_run_missing_parse_verifier_result(self):
- ret = testcase_base.TestCase.EX_RUN_ERROR
- ret_ok = testcase_base.TestCase.EX_OK
+ ret = testcase.TestCase.EX_RUN_ERROR
+ ret_ok = testcase.TestCase.EX_OK
with mock.patch('functest.opnfv_tests.openstack.tempest.tempest.'
'os.path.exists', return_value=False), \
mock.patch('functest.opnfv_tests.openstack.tempest.tempest.'
--cover-tests \
--cover-package=functest.ci \
--cover-package=functest.cli \
- --cover-package=functest.core.testcase_base \
+ --cover-package=functest.core.testcase \
--cover-package=functest.opnfv_tests.sdn.odl.odl \
--cover-package=functest.opnfv_tests.vnf.ims \
--cover-package=functest.utils \