From 96bacd7d8ffb9c05672c0a1fc6e68d19e4a6793a Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Sat, 8 Apr 2017 13:38:45 +0200 Subject: Modify TestCase constructor attributes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every feature/testcase now allows receiving the data defined in testcases.yaml as args (name is renamed to case_name). From the time being, only project and case names are handled. Next pending patches will add criteria, cmd and repo to this list. It keeps the default values for case names except for features which will be aggregated into Feature. Change-Id: Id742d100b8183d7f10894c24ae6879d1b2b60ac9 Signed-off-by: Cédric Ollivier --- functest/opnfv_tests/openstack/snaps/api_check.py | 6 ++++-- functest/opnfv_tests/openstack/snaps/connection_check.py | 6 ++++-- functest/opnfv_tests/openstack/snaps/health_check.py | 6 ++++-- functest/opnfv_tests/openstack/snaps/smoke.py | 6 ++++-- functest/opnfv_tests/openstack/snaps/snaps_test_runner.py | 4 ++-- 5 files changed, 18 insertions(+), 10 deletions(-) (limited to 'functest/opnfv_tests/openstack/snaps') diff --git a/functest/opnfv_tests/openstack/snaps/api_check.py b/functest/opnfv_tests/openstack/snaps/api_check.py index dea1ca75..bceb7c1d 100644 --- a/functest/opnfv_tests/openstack/snaps/api_check.py +++ b/functest/opnfv_tests/openstack/snaps/api_check.py @@ -20,8 +20,10 @@ class ApiCheck(SnapsTestRunner): that exercise many of the OpenStack APIs within Keystone, Glance, Neutron, and Nova """ - def __init__(self, case_name="api_check"): - super(ApiCheck, self).__init__(case_name) + def __init__(self, **kwargs): + if "case_name" not in kwargs: + kwargs["case_name"] = "api_check" + super(ApiCheck, self).__init__(**kwargs) self.suite = unittest.TestSuite() diff --git a/functest/opnfv_tests/openstack/snaps/connection_check.py b/functest/opnfv_tests/openstack/snaps/connection_check.py index 57b74d4c..0607beb3 100644 --- a/functest/opnfv_tests/openstack/snaps/connection_check.py +++ b/functest/opnfv_tests/openstack/snaps/connection_check.py @@ -20,8 +20,10 @@ class ConnectionCheck(SnapsTestRunner): that simply obtain the different OpenStack clients and may perform simple queries """ - def __init__(self, case_name="connection_check"): - super(ConnectionCheck, self).__init__(case_name) + def __init__(self, **kwargs): + if "case_name" not in kwargs: + kwargs["case_name"] = "connection_check" + super(ConnectionCheck, self).__init__(**kwargs) self.suite = unittest.TestSuite() diff --git a/functest/opnfv_tests/openstack/snaps/health_check.py b/functest/opnfv_tests/openstack/snaps/health_check.py index 6b3cfdd0..245f5052 100644 --- a/functest/opnfv_tests/openstack/snaps/health_check.py +++ b/functest/opnfv_tests/openstack/snaps/health_check.py @@ -21,8 +21,10 @@ class HealthCheck(SnapsTestRunner): creates a VM with a single port with an IPv4 address that is assigned by DHCP. This test then validates the expected IP with the actual """ - def __init__(self, case_name="snaps_health_check"): - super(HealthCheck, self).__init__(case_name) + def __init__(self, **kwargs): + if "case_name" not in kwargs: + kwargs["case_name"] = "snaps_health_check" + super(HealthCheck, self).__init__(**kwargs) self.suite = unittest.TestSuite() diff --git a/functest/opnfv_tests/openstack/snaps/smoke.py b/functest/opnfv_tests/openstack/snaps/smoke.py index 63d5c122..ceead6bb 100644 --- a/functest/opnfv_tests/openstack/snaps/smoke.py +++ b/functest/opnfv_tests/openstack/snaps/smoke.py @@ -21,8 +21,10 @@ class SnapsSmoke(SnapsTestRunner): that exercise many of the OpenStack APIs within Keystone, Glance, Neutron, and Nova """ - def __init__(self, case_name="snaps_smoke"): - super(SnapsSmoke, self).__init__(case_name) + def __init__(self, **kwargs): + if "case_name" not in kwargs: + kwargs["case_name"] = "snaps_smoke" + super(SnapsSmoke, self).__init__(**kwargs) self.suite = unittest.TestSuite() use_fip = CONST.snaps_use_floating_ips diff --git a/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py b/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py index 044a0bb0..2068852e 100644 --- a/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py +++ b/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py @@ -19,8 +19,8 @@ class SnapsTestRunner(PyTestSuiteRunner): creates a VM with a single port with an IPv4 address that is assigned by DHCP. This test then validates the expected IP with the actual """ - def __init__(self, case_name=''): - super(SnapsTestRunner, self).__init__(case_name) + def __init__(self, **kwargs): + super(SnapsTestRunner, self).__init__(**kwargs) self.ext_net_name = snaps_utils.get_ext_net_name() self.logger = ft_logger.Logger(self.project_name).getLogger() -- cgit 1.2.3-korg