Skip to content

Commit 3796e54

Browse files
cjubrankuba-moo
authored andcommitted
selftests: drv-net: Set shell=True for sysfs writes in devlink_rate_tc_bw.py
Commit 7c32f7a2d3db ("selftests: net: py: don't default to shell=True") changed the cmd() helper to avoid spawning a shell unless explicitly requested. The devlink_rate_tc_bw test enables SR-IOV by writing to the sriov_numvfs sysfs attribute using redirection. Without shell=True the redirection is not interpreted and the VF device never appears, causing the test to fail. Fix by explicitly passing shell=True in the two places that update sriov_numvfs. Signed-off-by: Carolina Jubran <cjubran@nvidia.com> Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com> Reviewed-by: Nimrod Oren <noren@nvidia.com> Link: https://patch.msgid.link/20251130091938.4109055-5-cjubran@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent cb1acbd commit 3796e54

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/testing/selftests/drivers/net/hw/devlink_rate_tc_bw.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ def setup_vf(cfg, set_tc_mapping=True):
117117
except Exception as exc:
118118
raise KsftSkipEx(f"Failed to enable switchdev mode on {cfg.pci}") from exc
119119
try:
120-
cmd(f"echo 1 > /sys/class/net/{cfg.ifname}/device/sriov_numvfs")
121-
defer(cmd, f"echo 0 > /sys/class/net/{cfg.ifname}/device/sriov_numvfs")
120+
cmd(f"echo 1 > /sys/class/net/{cfg.ifname}/device/sriov_numvfs", shell=True)
121+
defer(cmd, f"echo 0 > /sys/class/net/{cfg.ifname}/device/sriov_numvfs", shell=True)
122122
except Exception as exc:
123123
raise KsftSkipEx(f"Failed to enable SR-IOV on {cfg.ifname}") from exc
124124

0 commit comments

Comments
 (0)