]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/vsock: use ss to wait for listeners instead of /proc/net
authorBobby Eshleman <bobbyeshleman@meta.com>
Wed, 21 Jan 2026 22:11:48 +0000 (14:11 -0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 27 Jan 2026 09:45:38 +0000 (10:45 +0100)
commit7418f3bb3aa289fbf52f93b551e79ba647371f51
tree91956d7843fbc5a68a64860801fe4f46038cd100
parent4e870ac81df7e9628bdc08ff6f957a42e80582ee
selftests/vsock: use ss to wait for listeners instead of /proc/net

Replace /proc/net parsing with ss(8) for detecting listening sockets in
wait_for_listener() functions and add support for TCP, VSOCK, and Unix
socket protocols.

The previous implementation parsed /proc/net/tcp using awk to detect
listening sockets, but this approach could not support vsock because
vsock does not export socket information to /proc/net/.

Instead, use ss so that we can detect listeners on tcp, vsock, and unix.

The protocol parameter is now required for all wait_for_listener family
functions (wait_for_listener, vm_wait_for_listener,
host_wait_for_listener) to explicitly specify which socket type to wait
for.

ss is added to the dependency check in check_deps().

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Bobby Eshleman <bobbyeshleman@meta.com>
Link: https://patch.msgid.link/20260121-vsock-vmtest-v16-8-2859a7512097@meta.com
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tools/testing/selftests/vsock/vmtest.sh