Merge "dpdk: add function to set mtu to dpdk interfaces"

This commit is contained in:
Zuul 2019-05-17 07:50:55 +00:00 committed by Gerrit Code Review
commit 08c7f0345e
2 changed files with 12 additions and 0 deletions

View File

@ -768,6 +768,12 @@ def dpdk_set_bond_config(bond_name, config):
subprocess.check_call(cmd)
def dpdk_set_mtu_request(port, mtu):
cmd = ["ovs-vsctl", "set", "Interface", port,
"mtu_request={}".format(mtu)]
subprocess.check_call(cmd)
def enable_nova_metadata():
return use_dvr() or enable_local_dhcp()

View File

@ -726,6 +726,12 @@ class TestNeutronOVSUtils(CharmTestCase):
_late_init=True,
_test_bonds=True)
@patch.object(nutils, 'subprocess')
def test_dpdk_set_mtu_request(self, mock_subprocess):
nutils.dpdk_set_mtu_request("dpdk1", 9000)
mock_subprocess.check_call.assert_called_once_with(
['ovs-vsctl', 'set', 'Interface', 'dpdk1', 'mtu_request=9000'])
@patch.object(nutils, 'use_dvr')
@patch('charmhelpers.contrib.openstack.context.config')
def test_configure_ovs_enable_ipfix(self, mock_config, mock_use_dvr):