[PATCH v4 2/3] dts: add method for bringing link of interface up
Dean Marx
dmarx at iol.unh.edu
Fri Oct 24 20:50:54 CEST 2025
Add set_interface_link_up method to Linux Session class
for setting the link of an interface up. The existing
command most similar to this, bring_up_link, is designed
for use during topology setup within the framework,
whereas the new command is designed for use during
test suite runtime, as is needed for the virtio suite.
Signed-off-by: Dean Marx <dmarx at iol.unh.edu>
---
dts/framework/testbed_model/linux_session.py | 4 ++++
dts/framework/testbed_model/os_session.py | 8 ++++++++
2 files changed, 12 insertions(+)
diff --git a/dts/framework/testbed_model/linux_session.py b/dts/framework/testbed_model/linux_session.py
index 1f11c3e740..bfec2f3339 100644
--- a/dts/framework/testbed_model/linux_session.py
+++ b/dts/framework/testbed_model/linux_session.py
@@ -204,6 +204,10 @@ def bring_up_link(self, ports: Iterable[Port]) -> None:
del self._lshw_net_info
+ def set_interface_link_up(self, name: str) -> None:
+ """Overrides :meth:`~.os_session.OSSession.set_interface_link_up`."""
+ self.send_command(f"ip link set dev {name} up", privileged=True, verify=True)
+
@cached_property
def devbind_script_path(self) -> PurePath:
"""The path to the dpdk-devbind.py script on the node.
diff --git a/dts/framework/testbed_model/os_session.py b/dts/framework/testbed_model/os_session.py
index b41bb42205..4523679dc1 100644
--- a/dts/framework/testbed_model/os_session.py
+++ b/dts/framework/testbed_model/os_session.py
@@ -590,6 +590,14 @@ def bring_up_link(self, ports: Iterable[Port]) -> None:
ports: The ports to apply the link up command to.
"""
+ @abstractmethod
+ def set_interface_link_up(self, name: str) -> None:
+ """Send operating system specific command for bringing up link on specified interface.
+
+ Args:
+ name: String representing logical name of port to apply the link up command to.
+ """
+
@abstractmethod
def configure_port_mtu(self, mtu: int, port: Port) -> None:
"""Configure `mtu` on `port`.
--
2.51.0
More information about the dev
mailing list