Merge "dpdk: add function to set mtu to dpdk interfaces"
This commit is contained in:
commit
08c7f0345e
|
@ -768,6 +768,12 @@ def dpdk_set_bond_config(bond_name, config):
|
||||||
subprocess.check_call(cmd)
|
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():
|
def enable_nova_metadata():
|
||||||
return use_dvr() or enable_local_dhcp()
|
return use_dvr() or enable_local_dhcp()
|
||||||
|
|
||||||
|
|
|
@ -726,6 +726,12 @@ class TestNeutronOVSUtils(CharmTestCase):
|
||||||
_late_init=True,
|
_late_init=True,
|
||||||
_test_bonds=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.object(nutils, 'use_dvr')
|
||||||
@patch('charmhelpers.contrib.openstack.context.config')
|
@patch('charmhelpers.contrib.openstack.context.config')
|
||||||
def test_configure_ovs_enable_ipfix(self, mock_config, mock_use_dvr):
|
def test_configure_ovs_enable_ipfix(self, mock_config, mock_use_dvr):
|
||||||
|
|
Loading…
Reference in New Issue