Skip to content

Commit faa6099

Browse files
committed
Merge branch 'selftests-drv-net-fix-and-improve-command-requirement-checking'
Gal Pressman says: ==================== selftests: drv-net: Fix and improve command requirement checking This series fixes remote command checking and cleans up command requirement calls across tests. The first patch fixes require_cmd() incorrectly checking commands locally even when remote=True was specified due to a missing host parameter. The second patch makes require_cmd() usage explicit about local/remote requirements, avoiding unnecessary test failures and consolidating duplicate calls. ==================== Link: https://patch.msgid.link/20250723135454.649342-1-gal@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 4335012 + d74cd9a commit faa6099

File tree

6 files changed

+6
-7
lines changed

6 files changed

+6
-7
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,7 @@ def main() -> None:
451451
)
452452
if not cfg.pci:
453453
raise KsftSkipEx("Could not get PCI address of the interface")
454-
cfg.require_cmd("iperf3")
455-
cfg.require_cmd("iperf3", remote=True)
454+
cfg.require_cmd("iperf3", local=True, remote=True)
456455

457456
cfg.bw_validator = BandwidthValidator()
458457

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def test_rss_input_xfrm(cfg, ipver):
3232
if multiprocessing.cpu_count() < 2:
3333
raise KsftSkipEx("Need at least two CPUs to test symmetric RSS hash")
3434

35-
cfg.require_cmd("socat", remote=True)
35+
cfg.require_cmd("socat", local=False, remote=True)
3636

3737
if not hasattr(socket, "SO_INCOMING_CPU"):
3838
raise KsftSkipEx("socket.SO_INCOMING_CPU was added in Python 3.11")

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def tcp_sock_get_retrans(sock):
3434

3535

3636
def run_one_stream(cfg, ipver, remote_v4, remote_v6, should_lso):
37-
cfg.require_cmd("socat", remote=True)
37+
cfg.require_cmd("socat", local=False, remote=True)
3838

3939
port = rand_port()
4040
listen_cmd = f"socat -{ipver} -t 2 -u TCP-LISTEN:{port},reuseport /dev/null,ignoreeof"

tools/testing/selftests/drivers/net/lib/py/env.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def require_cmd(self, comm, local=True, remote=False):
259259
if not self._require_cmd(comm, "local"):
260260
raise KsftSkipEx("Test requires command: " + comm)
261261
if remote:
262-
if not self._require_cmd(comm, "remote"):
262+
if not self._require_cmd(comm, "remote", host=self.remote):
263263
raise KsftSkipEx("Test requires (remote) command: " + comm)
264264

265265
def wait_hw_stats_settle(self):

tools/testing/selftests/drivers/net/lib/py/load.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class GenerateTraffic:
99
def __init__(self, env, port=None):
10-
env.require_cmd("iperf3", remote=True)
10+
env.require_cmd("iperf3", local=True, remote=True)
1111

1212
self.env = env
1313

tools/testing/selftests/drivers/net/ping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def _test_v6(cfg) -> None:
3030
cmd("ping -s 65000 -c 1 -W0.5 " + cfg.addr_v["6"], host=cfg.remote)
3131

3232
def _test_tcp(cfg) -> None:
33-
cfg.require_cmd("socat", remote=True)
33+
cfg.require_cmd("socat", local=False, remote=True)
3434

3535
port = rand_port()
3636
listen_cmd = f"socat -{cfg.addr_ipver} -t 2 -u TCP-LISTEN:{port},reuseport STDOUT"

0 commit comments

Comments
 (0)