dts: add sudo to linux link up

Message ID 20250130135303.704494-1-probb@iol.unh.edu (mailing list archive)
State Accepted, archived
Delegated to: Paul Szczepanek
Headers
Series dts: add sudo to linux link up |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation warning apply patch failure
ci/Intel-compilation warning apply issues
ci/iol-testing warning apply patch failure

Commit Message

Patrick Robb Jan. 30, 2025, 1:53 p.m. UTC
Fixes: 41d133d6c62f ("dts: automatically bring up link on interfaces")
Cc: probb@iol.unh.edu

Signed-off-by: Patrick Robb <probb@iol.unh.edu>
---
 dts/framework/testbed_model/linux_session.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Luca Vizzarro Jan. 30, 2025, 2:11 p.m. UTC | #1
Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
  

Patch

diff --git a/dts/framework/testbed_model/linux_session.py b/dts/framework/testbed_model/linux_session.py
index e77fe9b692..8d568e2466 100644
--- a/dts/framework/testbed_model/linux_session.py
+++ b/dts/framework/testbed_model/linux_session.py
@@ -169,7 +169,7 @@  def update_ports(self, ports: list[Port]) -> None:
     def bring_up_link(self, ports: list[Port]) -> None:
         """Overrides :meth:`~.os_session.OSSession.bring_up_link`."""
         for port in ports:
-            self.send_command(f"ip link set dev {port.logical_name} up")
+            self.send_command(f"ip link set dev {port.logical_name} up", privileged=True, verify=True)
 
     def _get_lshw_info(self) -> list[LshwOutput]:
         output = self.send_command("lshw -quiet -json -C network", verify=True)