summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Belu <cbelu@cloudbasesolutions.com>2017-09-07 05:11:51 -0700
committerClaudiu Belu <cbelu@cloudbasesolutions.com>2017-09-07 05:18:02 -0700
commitab50a17affc69c69beeff7695652ec784dbaa758 (patch)
treea5561dd3951b0aafb0ae1c8a5e88c98d42620bc9
parent975fe2382dd42cbdcaa9620c3f29693040c6681f (diff)
Fixes tests method resolution
Python allows multiple inheritance, which we use in order to mix and match test scenarios and actions. Python performs method resolution as follows: - checks if the method is defined in the current class. - if not, check parents, left to right. Since all tests have test_base as its left-most parent, all methods are resolved in test_base, which is not the desired behaviour. This affects optional_feature mixin in particular. Change-Id: I19d3bdef85a12ef45b600aa4fc68afd390b96c9f
Notes
Notes (review): Code-Review+2: Claudiu Belu <cbelu@cloudbasesolutions.com> Workflow+1: Claudiu Belu <cbelu@cloudbasesolutions.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 07 Sep 2017 16:44:27 +0000 Reviewed-on: https://review.openstack.org/501709 Project: openstack/oswin-tempest-plugin Branch: refs/heads/master
-rw-r--r--oswin_tempest_plugin/tests/scenario/test_cluster.py6
-rw-r--r--oswin_tempest_plugin/tests/scenario/test_disks.py6
-rw-r--r--oswin_tempest_plugin/tests/scenario/test_qos.py4
-rw-r--r--oswin_tempest_plugin/tests/scenario/test_remotefx.py4
-rw-r--r--oswin_tempest_plugin/tests/scenario/test_secure_boot.py4
-rw-r--r--oswin_tempest_plugin/tests/scenario/test_vnuma.py6
6 files changed, 15 insertions, 15 deletions
diff --git a/oswin_tempest_plugin/tests/scenario/test_cluster.py b/oswin_tempest_plugin/tests/scenario/test_cluster.py
index 92ae778..c6e10be 100644
--- a/oswin_tempest_plugin/tests/scenario/test_cluster.py
+++ b/oswin_tempest_plugin/tests/scenario/test_cluster.py
@@ -29,10 +29,10 @@ CONF = config.CONF
29LOG = logging.getLogger(__name__) 29LOG = logging.getLogger(__name__)
30 30
31 31
32class HyperVClusterTest(test_base.TestBase, 32class HyperVClusterTest(migrate._MigrateMixin,
33 migrate._MigrateMixin,
34 migrate._LiveMigrateMixin, 33 migrate._LiveMigrateMixin,
35 resize._ResizeMixin): 34 resize._ResizeMixin,
35 test_base.TestBase):
36 36
37 """The test suite for the Hyper-V Cluster. 37 """The test suite for the Hyper-V Cluster.
38 38
diff --git a/oswin_tempest_plugin/tests/scenario/test_disks.py b/oswin_tempest_plugin/tests/scenario/test_disks.py
index 9108b98..d78b992 100644
--- a/oswin_tempest_plugin/tests/scenario/test_disks.py
+++ b/oswin_tempest_plugin/tests/scenario/test_disks.py
@@ -62,7 +62,7 @@ class _BaseDiskTestMixin(migrate._MigrateMixin,
62 self._check_resize(flavor, new_flavor['id'], expected_fail=True) 62 self._check_resize(flavor, new_flavor['id'], expected_fail=True)
63 63
64 64
65class VhdDiskTest(test_base.TestBase, _BaseDiskTestMixin): 65class VhdDiskTest(_BaseDiskTestMixin, test_base.TestBase):
66 66
67 _IMAGE_REF = CONF.hyperv.vhd_image_ref 67 _IMAGE_REF = CONF.hyperv.vhd_image_ref
68 _CONF_OPTION_NAME = 'hyperv.vhd_image_ref' 68 _CONF_OPTION_NAME = 'hyperv.vhd_image_ref'
@@ -71,14 +71,14 @@ class VhdDiskTest(test_base.TestBase, _BaseDiskTestMixin):
71 # TODO(claudiub): validate that the images really are VHD / VHDX. 71 # TODO(claudiub): validate that the images really are VHD / VHDX.
72 72
73 73
74class VhdxDiskTest(test_base.TestBase, _BaseDiskTestMixin): 74class VhdxDiskTest(_BaseDiskTestMixin, test_base.TestBase):
75 75
76 _IMAGE_REF = CONF.hyperv.vhdx_image_ref 76 _IMAGE_REF = CONF.hyperv.vhdx_image_ref
77 _CONF_OPTION_NAME = 'hyperv.vhdx_image_ref' 77 _CONF_OPTION_NAME = 'hyperv.vhdx_image_ref'
78 _FLAVOR_SUFFIX = 'vhdx' 78 _FLAVOR_SUFFIX = 'vhdx'
79 79
80 80
81class Generation2DiskTest(test_base.TestBase, _BaseDiskTestMixin): 81class Generation2DiskTest(_BaseDiskTestMixin, test_base.TestBase):
82 82
83 # Generation 2 VMs have been introduced in Windows / Hyper-V Server 2012 R2 83 # Generation 2 VMs have been introduced in Windows / Hyper-V Server 2012 R2
84 _MIN_HYPERV_VERSION = 6003 84 _MIN_HYPERV_VERSION = 6003
diff --git a/oswin_tempest_plugin/tests/scenario/test_qos.py b/oswin_tempest_plugin/tests/scenario/test_qos.py
index 6748b7e..0d39c9a 100644
--- a/oswin_tempest_plugin/tests/scenario/test_qos.py
+++ b/oswin_tempest_plugin/tests/scenario/test_qos.py
@@ -19,8 +19,8 @@ from oswin_tempest_plugin.tests._mixins import optional_feature
19from oswin_tempest_plugin.tests import test_base 19from oswin_tempest_plugin.tests import test_base
20 20
21 21
22class QosTestCase(test_base.TestBase, 22class QosTestCase(optional_feature._OptionalFeatureMixin,
23 optional_feature._OptionalFeatureMixin): 23 test_base.TestBase):
24 """QoS test suite. 24 """QoS test suite.
25 25
26 This test suite will spawn instances with QoS specs. 26 This test suite will spawn instances with QoS specs.
diff --git a/oswin_tempest_plugin/tests/scenario/test_remotefx.py b/oswin_tempest_plugin/tests/scenario/test_remotefx.py
index 5834d21..dbb39a6 100644
--- a/oswin_tempest_plugin/tests/scenario/test_remotefx.py
+++ b/oswin_tempest_plugin/tests/scenario/test_remotefx.py
@@ -20,8 +20,8 @@ from oswin_tempest_plugin.tests import test_base
20CONF = config.CONF 20CONF = config.CONF
21 21
22 22
23class RemoteFxTestCase(test_base.TestBase, 23class RemoteFxTestCase(optional_feature._OptionalFeatureMixin,
24 optional_feature._OptionalFeatureMixin): 24 test_base.TestBase):
25 """RemoteFX test suite. 25 """RemoteFX test suite.
26 26
27 This test suit will spawn instances with RemoteFX enabled. 27 This test suit will spawn instances with RemoteFX enabled.
diff --git a/oswin_tempest_plugin/tests/scenario/test_secure_boot.py b/oswin_tempest_plugin/tests/scenario/test_secure_boot.py
index 5199410..54b319b 100644
--- a/oswin_tempest_plugin/tests/scenario/test_secure_boot.py
+++ b/oswin_tempest_plugin/tests/scenario/test_secure_boot.py
@@ -20,8 +20,8 @@ from oswin_tempest_plugin.tests import test_base
20CONF = config.CONF 20CONF = config.CONF
21 21
22 22
23class SecureBootTestCase(test_base.TestBase, 23class SecureBootTestCase(optional_feature._OptionalFeatureMixin,
24 optional_feature._OptionalFeatureMixin): 24 test_base.TestBase):
25 """Secure boot test suite. 25 """Secure boot test suite.
26 26
27 This test suite will spawn instances requiring secure boot to be 27 This test suite will spawn instances requiring secure boot to be
diff --git a/oswin_tempest_plugin/tests/scenario/test_vnuma.py b/oswin_tempest_plugin/tests/scenario/test_vnuma.py
index e665dca..d7e0ddd 100644
--- a/oswin_tempest_plugin/tests/scenario/test_vnuma.py
+++ b/oswin_tempest_plugin/tests/scenario/test_vnuma.py
@@ -24,12 +24,12 @@ from oswin_tempest_plugin.tests import test_base
24CONF = config.CONF 24CONF = config.CONF
25 25
26 26
27class HyperVvNumaTestCase(test_base.TestBase, 27class HyperVvNumaTestCase(migrate._MigrateMixin,
28 migrate._MigrateMixin,
29 migrate._LiveMigrateMixin, 28 migrate._LiveMigrateMixin,
30 optional_feature._OptionalFeatureMixin, 29 optional_feature._OptionalFeatureMixin,
31 resize._ResizeMixin, 30 resize._ResizeMixin,
32 resize._ResizeNegativeMixin): 31 resize._ResizeNegativeMixin,
32 test_base.TestBase):
33 """Hyper-V vNUMA test suite. 33 """Hyper-V vNUMA test suite.
34 34
35 This test suite will spawn instances requiring NUMA placement. 35 This test suite will spawn instances requiring NUMA placement.