From a3ff33907aa3c28a811dd8fbd81c3f646909a388 Mon Sep 17 00:00:00 2001 From: James Parker Date: Wed, 4 Aug 2021 15:41:28 -0400 Subject: [PATCH] Allow for ethernet type in rx queue test Update [1] and subsequent patches [2,3] changed the interface type of instances from bridge to ethernet, e.g.
This commit changes the test_rx_queue_size logic when searching a guest for its interface type to check for 'ethernet' first and then fall back to 'bridge' if it is not found. Also should be noted a conditional set of the driver was attempted but due how ElementTree evaluates its boolean [4], opted to check ethernet type first and then fall back to bridge. [1] https://review.opendev.org/c/openstack/nova/+/602432 [2] https://review.opendev.org/c/openstack/nova/+/797142 [3] https://review.opendev.org/c/openstack/nova/+/797428 [4] https://github.com/python/cpython/blob/3.9/Lib/xml/etree/ElementTree.py#L214 Change-Id: I29adec51ed510c32b0d00b4f0353f0a9527482b7 --- .../api/compute/test_rx_tx_queue_size.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/whitebox_tempest_plugin/api/compute/test_rx_tx_queue_size.py b/whitebox_tempest_plugin/api/compute/test_rx_tx_queue_size.py index da34fceb..37255aee 100644 --- a/whitebox_tempest_plugin/api/compute/test_rx_tx_queue_size.py +++ b/whitebox_tempest_plugin/api/compute/test_rx_tx_queue_size.py @@ -71,8 +71,11 @@ class RxTxQueueSizeTest(base.BaseWhiteboxComputeTest): '`rx_queue_size` must be set') def test_rx_queue_size(self): domain = self.get_server_xml(self.server_id) - driver = domain.find( - "devices/interface[@type='bridge']/driver[@name='vhost']") + interface_criteria = \ + "devices/interface[@type='%s']/driver[@name='vhost']" + driver = domain.find(interface_criteria % 'ethernet') + driver = (driver if driver is not None else domain.find( + interface_criteria % 'bridge')) self.assertEqual( driver.attrib['rx_queue_size'], str(CONF.whitebox.rx_queue_size), "Can't find interface with the proper rx_queue_size")