summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2025-08-11 16:13:31 -0700
committerJakub Kicinski <kuba@kernel.org>2025-08-12 18:27:42 -0700
commita94e9cf79ceee04c3e2d042fdf417b8c235c6117 (patch)
tree61546beba80ea7e3e71d4908573a6dd687b4689b
parent27e5b560a86e479bef247a1327182d155ed0bad6 (diff)
selftests: drv-net: devmem: remove sudo from system() calls
The general expectations for network HW selftests is that they will be run as root. sudo doesn't seem to work on NIPA VMs. While it's probably something solvable in the setup I think we should remove the sudos. devmem is the only networking test using sudo. Reviewed-by: Joe Damato <joe@dama.to> Reviewed-by: Mina Almasry <almasrymina@google.com> Acked-by: Stanislav Fomichev <sdf@fomichev.me> Link: https://patch.msgid.link/20250811231334.561137-3-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--tools/testing/selftests/drivers/net/hw/ncdevmem.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/testing/selftests/drivers/net/hw/ncdevmem.c b/tools/testing/selftests/drivers/net/hw/ncdevmem.c
index 72f828021f83..be937542b4c0 100644
--- a/tools/testing/selftests/drivers/net/hw/ncdevmem.c
+++ b/tools/testing/selftests/drivers/net/hw/ncdevmem.c
@@ -287,10 +287,10 @@ static int reset_flow_steering(void)
* the exit status.
*/
- run_command("sudo ethtool -K %s ntuple off >&2", ifname);
- run_command("sudo ethtool -K %s ntuple on >&2", ifname);
+ run_command("ethtool -K %s ntuple off >&2", ifname);
+ run_command("ethtool -K %s ntuple on >&2", ifname);
run_command(
- "sudo ethtool -n %s | grep 'Filter:' | awk '{print $2}' | xargs -n1 ethtool -N %s delete >&2",
+ "ethtool -n %s | grep 'Filter:' | awk '{print $2}' | xargs -n1 ethtool -N %s delete >&2",
ifname, ifname);
return 0;
}
@@ -351,12 +351,12 @@ static int configure_headersplit(bool on)
static int configure_rss(void)
{
- return run_command("sudo ethtool -X %s equal %d >&2", ifname, start_queue);
+ return run_command("ethtool -X %s equal %d >&2", ifname, start_queue);
}
static int configure_channels(unsigned int rx, unsigned int tx)
{
- return run_command("sudo ethtool -L %s rx %u tx %u", ifname, rx, tx);
+ return run_command("ethtool -L %s rx %u tx %u", ifname, rx, tx);
}
static int configure_flow_steering(struct sockaddr_in6 *server_sin)
@@ -374,7 +374,7 @@ static int configure_flow_steering(struct sockaddr_in6 *server_sin)
}
/* Try configure 5-tuple */
- if (run_command("sudo ethtool -N %s flow-type %s %s %s dst-ip %s %s %s dst-port %s queue %d >&2",
+ if (run_command("ethtool -N %s flow-type %s %s %s dst-ip %s %s %s dst-port %s queue %d >&2",
ifname,
type,
client_ip ? "src-ip" : "",
@@ -384,7 +384,7 @@ static int configure_flow_steering(struct sockaddr_in6 *server_sin)
client_ip ? port : "",
port, start_queue))
/* If that fails, try configure 3-tuple */
- if (run_command("sudo ethtool -N %s flow-type %s dst-ip %s dst-port %s queue %d >&2",
+ if (run_command("ethtool -N %s flow-type %s dst-ip %s dst-port %s queue %d >&2",
ifname,
type,
server_addr,