From 401cb527c6eb4c3705768e3681c4b383ce44f796 Mon Sep 17 00:00:00 2001 From: James Parker Date: Tue, 6 Jun 2023 17:11:16 -0400 Subject: [PATCH] Convert the XML vlan value found from str to int To update that created a vlan ID parameter for SR-IOV (sriov_vlan_id) [1], introduces the parameter as an int. When checking the vlan tag in the guest it will return as a str causing the check to fail e.g.: "testtools.matchers._impl.MismatchError: 2000 != '2000': Interface should have have vlan tag 2000 but instead it is tagged with 2000" Casting the vlan tag found in the XML as an int to ensure the check matches. [1] https://opendev.org/openstack/whitebox-tempest-plugin/commit/f7104a681d2e808642ea65132a2a3ad6997a614f Change-Id: I62f519db8709c23824a0fee1a6ce63ab3bf1f9e2 --- whitebox_tempest_plugin/api/compute/test_sriov.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/whitebox_tempest_plugin/api/compute/test_sriov.py b/whitebox_tempest_plugin/api/compute/test_sriov.py index 019baf00..e649066b 100644 --- a/whitebox_tempest_plugin/api/compute/test_sriov.py +++ b/whitebox_tempest_plugin/api/compute/test_sriov.py @@ -89,10 +89,11 @@ class SRIOVBase(base.BaseWhiteboxComputeTest): :param port: dictionary describing port to find """ interface_vlan = port_xml_element.find("./vlan/tag").get('id', None) + found_vlan = int(interface_vlan) if interface_vlan else None self.assertEqual( - expected_vlan, interface_vlan, 'Interface should have have vlan ' + expected_vlan, found_vlan, 'Interface should have have vlan ' 'tag %s but instead it is tagged with %s' % - (expected_vlan, interface_vlan)) + (expected_vlan, found_vlan)) class SRIOVNumaAffinity(SRIOVBase, numa_helper.NUMAHelperMixin):