[PATCH] dts: add sudo to linux link up

Luca Vizzarro Luca.Vizzarro at arm.com
Thu Jan 30 09:15:39 CET 2025


Hi Patrick,

thank you for the prompt fix!

On 29/01/2025 22:08, Patrick Robb wrote:
> Fixes: 41d133d6c62f ("dts: automatically bring up link on interfaces")
> Cc: probb at iol.unh.edu
> 
> Signed-off-by: Patrick Robb <probb at iol.unh.edu>
> ---
>   dts/framework/testbed_model/linux_session.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/dts/framework/testbed_model/linux_session.py b/dts/framework/testbed_model/linux_session.py
> index e77fe9b692..d811d002ca 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"sudo ip link set dev {port.logical_name} up", verify=True)

sudo should be performed with `privileged`:

     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)




More information about the dev mailing list