From 407689b672ff02e68691f5214bdf06f512ee7d24 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Tue, 15 Apr 2025 07:27:27 +0000 Subject: [PATCH] [QoS] Check QoS BW limit betweem VMs in different compute nodes This patch is similar to [1]. Since [2][3], the QoS min and max BW rules for LSPs in LS that have associated a physical network (and a localnet port) are defined in the LSP.options dictionary. The QoS values are set in the localnet port interface using "tc" commands. By default, now the migration tests will check the bandwidth limit only when the sender VM and the receiver VM are in different compute nodes. [1]https://review.opendev.org/c/x/whitebox-neutron-tempest-plugin/+/942567 [2]https://review.opendev.org/c/openstack/neutron/+/934418 [3]https://github.com/ovn-org/ovn/commit/87514ac04271e87c3ad011599378d22ab6bed43c Closes-Bug: #2107368 Change-Id: I5f234109a31ff98a68132dd757fcd9f7dc6c0322 --- .../tests/scenario/test_qos.py | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/whitebox_neutron_tempest_plugin/tests/scenario/test_qos.py b/whitebox_neutron_tempest_plugin/tests/scenario/test_qos.py index b954b69..7f4b829 100644 --- a/whitebox_neutron_tempest_plugin/tests/scenario/test_qos.py +++ b/whitebox_neutron_tempest_plugin/tests/scenario/test_qos.py @@ -796,9 +796,12 @@ class QosBaseTest(test_qos.QoSTestMixin, base.TrafficFlowTest): block_migration = (CONF.compute_feature_enabled. block_migration_for_live_migration) + vm_host = { + 'sender': self.get_host_for_server( + vms['sender']['id']).split('.')[0], + 'receiver': self.get_host_for_server( + vms['receiver']['id']).split('.')[0]} for role in 'sender', 'receiver': - vms_host = self.get_host_for_server( - vms[role]['id']).split('.')[0] if migration_method == 'cold-migration': self.os_admin.servers_client.migrate_server(vms[role]['id']) waiters.wait_for_server_status(self.os_admin.servers_client, @@ -818,19 +821,22 @@ class QosBaseTest(test_qos.QoSTestMixin, base.TrafficFlowTest): % migration_method) self.wait_for_server_active(vms[role]) - vms_new_host = self.get_host_for_server( + vm_new_host = self.get_host_for_server( vms[role]['id']).split('.')[0] - self.assertNotEqual(vms_host, vms_new_host, + self.assertNotEqual(vm_host[role], vm_new_host, '%s vm did not migrate' % role) + vm_host[role] = vm_new_host LOG.debug("Validating server '%s'", role) # Validate that traffic that reach destination host is still marked self._validate_traffic_marked( dscp_mark, vms['sender'], vms['receiver']) - # Make sure that bw limit still works after migration - self._validate_bw_limit( - bw_limit=max_kbps * 1000, client=vms['sender'], - server=vms['receiver']) + # Make sure that bw limit still works after migration, but only if + # sender VM and receiver VM are in different hosts. + if vm_host['sender'] != vm_host['receiver']: + self._validate_bw_limit( + bw_limit=max_kbps * 1000, client=vms['sender'], + server=vms['receiver']) def _check_dscp_inheritance(self): src_server, dst_server = self._create_vms_by_topology(ipv6=True)