diff options
| author | Jeremy Spewock <[email protected]> | 2024-03-11 11:44:03 -0400 |
|---|---|---|
| committer | Thomas Monjalon <[email protected]> | 2024-03-15 18:34:18 +0100 |
| commit | ace78563335fa09357a2dfcb79dfb7d3a6477f2e (patch) | |
| tree | 6934728973c2704d86e1bf2770e33702f8a07dc2 /dts/framework/testbed_model/linux_session.py | |
| parent | 885487848d27682b670921dc1f37e1da9d8e5b3d (diff) | |
dts: allow configuring MTU
Adds methods in both os_session and linux session to allow for setting
MTU of port interfaces so that suites that require the sending and
receiving of packets of a specific size, or the rejection of packets
over a certain size, can configure this maximum as needed.
Signed-off-by: Jeremy Spewock <[email protected]>
Reviewed-by: Juraj Linkeš <[email protected]>
Tested-by: Patrick Robb <[email protected]>
Diffstat (limited to 'dts/framework/testbed_model/linux_session.py')
| -rw-r--r-- | dts/framework/testbed_model/linux_session.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/dts/framework/testbed_model/linux_session.py b/dts/framework/testbed_model/linux_session.py index 0ab59cef85..5d24030c3d 100644 --- a/dts/framework/testbed_model/linux_session.py +++ b/dts/framework/testbed_model/linux_session.py @@ -198,6 +198,14 @@ class LinuxSession(PosixSession): verify=True, ) + def configure_port_mtu(self, mtu: int, port: Port) -> None: + """Overrides :meth:`~.os_session.OSSession.configure_port_mtu`.""" + self.send_command( + f"ip link set dev {port.logical_name} mtu {mtu}", + privileged=True, + verify=True, + ) + def configure_ipv4_forwarding(self, enable: bool) -> None: """Overrides :meth:`~.os_session.OSSession.configure_ipv4_forwarding`.""" state = 1 if enable else 0 |
