Skip to content

Commit fb477bb

Browse files
authored
Merge pull request #1330 from fnordahl/bug/2116862
ovn: Add test for OVS configuration part of hardware offload.
2 parents 031d04f + 3170a7b commit fb477bb

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

zaza/openstack/charm_tests/ovn/tests.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,37 @@ def test_wrong_bridge_config(self):
319319
self.test_config[
320320
'target_deploy_status'] = stored_target_deploy_status
321321

322+
def test_enable_hardware_offload(self):
323+
"""Confirm that chassis can configure OVS hardware offload."""
324+
with self.config_change(
325+
{'enable-hardware-offload': 'false'},
326+
{'enable-hardware-offload': 'true'}):
327+
for unit in zaza.model.get_units(self.application_name):
328+
for expected_key, expected_value in (
329+
('hw-offload', '"true"'),
330+
('max-idle', '"30000"')):
331+
self.assertEqual(
332+
zaza.model.run_on_unit(
333+
unit.entity_id,
334+
'ovs-vsctl get open-vswitch . other_config:{}'
335+
.format(expected_key)
336+
)['Stdout'].rstrip(),
337+
expected_value)
338+
logging.info(
339+
'{}: "{}" set to "{}"'
340+
.format(unit.entity_id, expected_key, expected_value))
341+
for unit in zaza.model.get_units(self.application_name):
342+
for expected_key in ('hw-offload', 'max-idle'):
343+
self.assertEqual(
344+
zaza.model.run_on_unit(
345+
unit.entity_id,
346+
'ovs-vsctl get open-vswitch . '
347+
'other_config:{}'.format(expected_key))['Code'],
348+
'1')
349+
logging.info(
350+
'{}: "{}" no longer present'
351+
.format(unit.entity_id, expected_key))
352+
322353

323354
class DPDKTest(test_utils.BaseCharmTest):
324355
"""DPDK-related tests."""

0 commit comments

Comments
 (0)