Skip to content

Commit 8ceeef2

Browse files
Stanislav Fomichevdavem330
authored andcommitted
selftests: ncdevmem: add tx test with multiple IOVs
Use prime 3 for length to make offset slowly drift away. Signed-off-by: Stanislav Fomichev <[email protected]> Acked-by: Mina Almasry <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 61f24c6 commit 8ceeef2

File tree

1 file changed

+16
-1
lines changed
  • tools/testing/selftests/drivers/net/hw

1 file changed

+16
-1
lines changed

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,27 @@ def check_tx(cfg) -> None:
4949
ksft_eq(socat.stdout.strip(), "hello\nworld")
5050

5151

52+
@ksft_disruptive
53+
def check_tx_chunks(cfg) -> None:
54+
cfg.require_ipver("6")
55+
require_devmem(cfg)
56+
57+
port = rand_port()
58+
listen_cmd = f"socat -U - TCP6-LISTEN:{port}"
59+
60+
with bkg(listen_cmd, exit_wait=True) as socat:
61+
wait_port_listen(port)
62+
cmd(f"echo -e \"hello\\nworld\"| {cfg.bin_remote} -f {cfg.ifname} -s {cfg.addr_v['6']} -p {port} -z 3", host=cfg.remote, shell=True)
63+
64+
ksft_eq(socat.stdout.strip(), "hello\nworld")
65+
66+
5267
def main() -> None:
5368
with NetDrvEpEnv(__file__) as cfg:
5469
cfg.bin_local = path.abspath(path.dirname(__file__) + "/ncdevmem")
5570
cfg.bin_remote = cfg.remote.deploy(cfg.bin_local)
5671

57-
ksft_run([check_rx, check_tx],
72+
ksft_run([check_rx, check_tx, check_tx_chunks],
5873
args=(cfg, ))
5974
ksft_exit()
6075

0 commit comments

Comments
 (0)