diff --git a/whitebox_neutron_tempest_plugin/tests/scenario/base.py b/whitebox_neutron_tempest_plugin/tests/scenario/base.py index b844b27..36f8d33 100644 --- a/whitebox_neutron_tempest_plugin/tests/scenario/base.py +++ b/whitebox_neutron_tempest_plugin/tests/scenario/base.py @@ -715,11 +715,11 @@ class BaseTempestWhiteboxTestCase(base.BaseTempestTestCase): network_id)['network']['provider:segmentation_id'] params['user_data'] = build_user_data(net_vlan) params['config_drive'] = True - if (different_host and CONF.compute.min_compute_nodes > 1): + if (different_host and not self.is_setup_single_compute()): params['scheduler_hints'] = { 'different_host': different_host['id']} server = self.create_server(**params)['server'] - if different_host and CONF.compute.min_compute_nodes > 1: + if different_host and not self.is_setup_single_compute(): if (self.get_host_for_server(different_host['id']) == self.get_host_for_server(server['id'])): raise self.skipException( diff --git a/whitebox_neutron_tempest_plugin/tests/scenario/test_broadcast.py b/whitebox_neutron_tempest_plugin/tests/scenario/test_broadcast.py index 3aad1a5..3210a14 100644 --- a/whitebox_neutron_tempest_plugin/tests/scenario/test_broadcast.py +++ b/whitebox_neutron_tempest_plugin/tests/scenario/test_broadcast.py @@ -133,7 +133,7 @@ class BaseBroadcastTest(object): {'name': self.secgroup['security_group']['name']}], 'name': data_utils.rand_name(server_type) } - if not (CONF.compute.min_compute_nodes > 1): + if self.is_setup_single_compute(): LOG.debug('number of compute nodes is not higher than 1 - ' 'scheduler_hints will not be used') elif scheduler_hints: diff --git a/whitebox_neutron_tempest_plugin/tests/scenario/test_dvr_ovn.py b/whitebox_neutron_tempest_plugin/tests/scenario/test_dvr_ovn.py index 5aed362..5879482 100644 --- a/whitebox_neutron_tempest_plugin/tests/scenario/test_dvr_ovn.py +++ b/whitebox_neutron_tempest_plugin/tests/scenario/test_dvr_ovn.py @@ -342,9 +342,6 @@ class OvnDvrTest(OvnDvrBase): @decorators.idempotent_id('f8fd0fbd-4ad3-4b0b-b805-6c59228bc5d8') @testtools.skipUnless(CONF.compute_feature_enabled.live_migration, 'Live migration is not available.') - @testtools.skipUnless(CONF.compute.min_compute_nodes > 1, - 'Less than 2 compute nodes, skipping multinode ' - 'tests.') @decorators.attr(type='slow') @utils.services('compute', 'network') def test_validate_dvr_connectivity_live_migration_basic(self): @@ -386,6 +383,8 @@ class OvnDvrTest(OvnDvrBase): 7. Repeat steps 3 and 4. """ + if self.is_setup_single_compute(): + raise self.skipException('Test needs more than 1 compute') self._setup() server2 = self._create_server( exclude_hosts=self.exclude_hosts) @@ -487,9 +486,6 @@ class OvnDvrTest(OvnDvrBase): @decorators.idempotent_id('609997ab-bffc-40e5-a858-635099df4db9') @testtools.skipUnless(CONF.compute_feature_enabled.live_migration, 'Live migration is not available.') - @testtools.skipUnless(CONF.compute.min_compute_nodes > 1, - 'Less than 2 compute nodes, skipping multinode ' - 'tests.') @decorators.attr(type='slow') @utils.services('compute', 'network') def test_validate_dvr_connectivity_live_migration_different_networks(self): @@ -498,6 +494,8 @@ class OvnDvrTest(OvnDvrBase): Plase see previous test description for more details """ + if self.is_setup_single_compute(): + raise self.skipException('Test needs more than 1 compute') self.create_security_group( name=data_utils.rand_name('secgroup')) self.create_loginable_secgroup_rule( diff --git a/whitebox_neutron_tempest_plugin/tests/scenario/test_multicast.py b/whitebox_neutron_tempest_plugin/tests/scenario/test_multicast.py index 0341a5c..9b371cc 100644 --- a/whitebox_neutron_tempest_plugin/tests/scenario/test_multicast.py +++ b/whitebox_neutron_tempest_plugin/tests/scenario/test_multicast.py @@ -1044,7 +1044,7 @@ class MulticastTestVlanTransparency(MulticastTestIPv4): {'name': self.secgroup['security_group']['name']}], 'name': data_utils.rand_name('multicast-server-vlan-transparent') } - if (different_host and CONF.compute.min_compute_nodes > 1): + if (different_host and not self.is_setup_single_compute()): params['scheduler_hints'] = { 'different_host': different_host['id']} server = self.create_server(**params)['server'] diff --git a/whitebox_neutron_tempest_plugin/tests/scenario/test_qos.py b/whitebox_neutron_tempest_plugin/tests/scenario/test_qos.py index 7f4b829..c9bd27f 100644 --- a/whitebox_neutron_tempest_plugin/tests/scenario/test_qos.py +++ b/whitebox_neutron_tempest_plugin/tests/scenario/test_qos.py @@ -913,11 +913,10 @@ class QosTestCommon(QosBaseTest): @decorators.idempotent_id('121bd2dd-6d41-4658-8a05-6fdd444381fa') @testtools.skipUnless(CONF.compute_feature_enabled.live_migration, 'Live migration is not available.') - @testtools.skipUnless( - CONF.compute.min_compute_nodes > 1, - 'Less than 2 compute nodes, skipping multinode tests.') @decorators.attr(type='slow') def test_qos_after_live_migration(self): + if self.is_setup_single_compute(): + raise self.skipException('Test needs more than 1 compute') src_server, dst_server = ( self._create_vms_by_topology(different_host=False)) self._test_qos_after_migration( @@ -926,11 +925,10 @@ class QosTestCommon(QosBaseTest): @decorators.idempotent_id('f6e1e433-33b1-4352-bdf3-92dbe9e3f2ee') @testtools.skipUnless(CONF.compute_feature_enabled.cold_migration, 'Cold migration is not available.') - @testtools.skipUnless( - CONF.compute.min_compute_nodes > 1, - 'Less than 2 compute nodes, skipping multinode tests.') @decorators.attr(type='slow') def test_qos_after_cold_migration(self): + if self.is_setup_single_compute(): + raise self.skipException('Test needs more than 1 compute') src_server, dst_server = self._create_vms_by_topology() self._test_qos_after_migration( src_server, dst_server, migration_method='cold-migration') @@ -1025,12 +1023,10 @@ class QosTestExternalNetwork(QosBaseTest): super(QosTestExternalNetwork, self).setUp() self.ensure_external_network_is_shared() - @testtools.skipUnless( - CONF.compute.min_compute_nodes > 1, - 'BW limit rules applied to provider network can only be tested when ' - 'there is more than one compute') @decorators.idempotent_id('c018b96b-47eb-4b5f-b750-e0c857fd86a9') def test_dscp_bwlimit_external_network(self): + if self.is_setup_single_compute(): + raise self.skipException('Test needs more than 1 compute') max_kbps = self.bwlimit_kbps_net dscp_mark = self.dscp_mark_net diff --git a/whitebox_neutron_tempest_plugin/tests/scenario/test_vrrp.py b/whitebox_neutron_tempest_plugin/tests/scenario/test_vrrp.py index 2f7cdab..ffbc6da 100644 --- a/whitebox_neutron_tempest_plugin/tests/scenario/test_vrrp.py +++ b/whitebox_neutron_tempest_plugin/tests/scenario/test_vrrp.py @@ -78,7 +78,7 @@ class VrrpTest(base.BaseTempestTestCaseAdvanced): 'key_name': self.keypair['name'], 'name': name } - if (scheduler_hints and CONF.compute.min_compute_nodes > 1 and + if (scheduler_hints and not self.is_setup_single_compute() and compute.is_scheduler_filter_enabled("DifferentHostFilter")): params['scheduler_hints'] = scheduler_hints vm = self.create_server(networks=[{'port': port['id']}], **params) @@ -176,7 +176,7 @@ class VrrpTest(base.BaseTempestTestCaseAdvanced): if (self._get_vm_host(vm1['server']['id']) == self._get_vm_host(vm2['server']['id']) and - CONF.compute.min_compute_nodes > 1): + not self.is_setup_single_compute()): raise self.skipException( "VMs are running on the same host." "Make sure you have DifferentHostFilter enabled in nova.conf "