]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests: drv-net: add a way to wait for a local process
authorJakub Kicinski <kuba@kernel.org>
Wed, 19 Feb 2025 23:49:54 +0000 (15:49 -0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 21 Feb 2025 01:58:25 +0000 (17:58 -0800)
commit71477137994f4ac8396504bf98346b316da38157
tree841f02ee36e685553c5587478e905fd965f4c6ce
parentd3726ab45c57d0ba26234e3b9e4d19903b740f97
selftests: drv-net: add a way to wait for a local process

We use wait_port_listen() extensively to wait for a process
we spawned to be ready. Not all processes will open listening
sockets. Add a method of explicitly waiting for a child to
be ready. Pass a FD to the spawned process and wait for it
to write a message to us. FD number is passed via KSFT_READY_FD
env variable.

Similarly use KSFT_WAIT_FD to let the child process for a sign
that we are done and child should exit. Sending a signal to
a child with shell=True can get tricky.

Make use of this method in the queues test to make it less flaky.

Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Acked-by: Joe Damato <jdamato@fastly.com>
Tested-by: Joe Damato <jdamato@fastly.com>
Link: https://patch.msgid.link/20250219234956.520599-6-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/drivers/net/queues.py
tools/testing/selftests/drivers/net/xdp_helper.c
tools/testing/selftests/net/lib/py/utils.py