From 3170a7b3dfbe88293b200c459a85f3e2947af266 Mon Sep 17 00:00:00 2001 From: Frode Nordahl Date: Mon, 13 Oct 2025 07:30:26 +0000 Subject: [PATCH] ovn: Add test for OVS configuration part of hardware offload. Signed-off-by: Frode Nordahl --- zaza/openstack/charm_tests/ovn/tests.py | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/zaza/openstack/charm_tests/ovn/tests.py b/zaza/openstack/charm_tests/ovn/tests.py index 8974a64..2c4c05f 100644 --- a/zaza/openstack/charm_tests/ovn/tests.py +++ b/zaza/openstack/charm_tests/ovn/tests.py @@ -319,6 +319,37 @@ class ChassisCharmOperationTest(BaseCharmOperationTest): self.test_config[ 'target_deploy_status'] = stored_target_deploy_status + def test_enable_hardware_offload(self): + """Confirm that chassis can configure OVS hardware offload.""" + with self.config_change( + {'enable-hardware-offload': 'false'}, + {'enable-hardware-offload': 'true'}): + for unit in zaza.model.get_units(self.application_name): + for expected_key, expected_value in ( + ('hw-offload', '"true"'), + ('max-idle', '"30000"')): + self.assertEqual( + zaza.model.run_on_unit( + unit.entity_id, + 'ovs-vsctl get open-vswitch . other_config:{}' + .format(expected_key) + )['Stdout'].rstrip(), + expected_value) + logging.info( + '{}: "{}" set to "{}"' + .format(unit.entity_id, expected_key, expected_value)) + for unit in zaza.model.get_units(self.application_name): + for expected_key in ('hw-offload', 'max-idle'): + self.assertEqual( + zaza.model.run_on_unit( + unit.entity_id, + 'ovs-vsctl get open-vswitch . ' + 'other_config:{}'.format(expected_key))['Code'], + '1') + logging.info( + '{}: "{}" no longer present' + .format(unit.entity_id, expected_key)) + class DPDKTest(test_utils.BaseCharmTest): """DPDK-related tests."""