Skip to content

dpdk-bond-mapping tests for DPDKTest bundle#1342

Draft
PanosKostopoulos wants to merge 1 commit intoopenstack-charmers:masterfrom
PanosKostopoulos:master
Draft

dpdk-bond-mapping tests for DPDKTest bundle#1342
PanosKostopoulos wants to merge 1 commit intoopenstack-charmers:masterfrom
PanosKostopoulos:master

Conversation

@PanosKostopoulos
Copy link
Copy Markdown

DPDK tests for dpdk-bond-mappings ovn-chassis config option. This first iteration includes only PCI addresses, but should include also MAC addresses (the difference is there should be an extra lookup to get the PCI addresses from the mac).

The tests have extended the test_enable_dpdk function, in this first iteration, to avoid a second setup for dpdk. This could be moved (and maybe should) in a seperate test function.

@PanosKostopoulos PanosKostopoulos changed the title first iteration pr dpdk-bond-mapping tests for DPDKTest bundle Apr 20, 2026
Comment on lines +584 to +587
logging.info(
'Verifying bond PCI addresses are whitelisted in dpdk-extra')
self._assert_dpdk_bond_pci_in_eal_args(bond_pci_addresses)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PCI address is put in EAL args regardless of the use of dpdk-bond-mappings configuration option.

How is this a valid assertion?

# self.disable_hugepages_vfio_on_hvs_in_vms()
# self._ovs_br_ex_port_is_system_interface()

def _test_dpdk_bond_mappings_pci_format(self):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this a separate def test_XXX method instead of this covert piggy-backing on existing tests.

The charm code will only actually populate the OVS database with bond configuration when there are more than one interface [0], so you likely need to enable the test harness to add multiple ports to the test VM as well as interrogate the environment and ensure there are enough ports available to run the test.

0: https://github.com/openstack-charmers/charm-layer-ovn/blob/b0cee1d3b1bf7e7fc4236d9b2057419d3411771b/lib/charms/ovn_charm.py#L1324

"""
bond_pci_addresses = []
for unit in zaza.model.get_units(self.application_name):
pci = self._get_br_ex_dpdk_pci_address(unit)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basing input for your test assertion on data provided by the subject under test is not the safe thing to do, you should have the test code independently discover PCI addresses and/or MACs to use as input for the test so that you can accurately measure the output of the program.

Comment thread zaza/openstack/charm_tests/ovn/tests.py Outdated
logging.warning(
'Could not retrieve any PCI addresses for bond mapping test, '
'skipping')
return
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not look safe, we'd likely want to know if this failed by having the test fail.

@PanosKostopoulos PanosKostopoulos force-pushed the master branch 9 times, most recently from 2daaedc to ecd0056 Compare April 24, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants