]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/vsock: make wait_for_listener() work even if pipefail is on
authorBobby Eshleman <bobbyeshleman@meta.com>
Sat, 8 Nov 2025 16:00:53 +0000 (08:00 -0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 12 Nov 2025 14:19:38 +0000 (06:19 -0800)
commit2ed3ce7efbd2854fb7eb76627ccec92362b2345b
tree4f11262222406b7c14df16ce61a566fa3940e475
parentd9cac93cd1bed31724f55857b934bcbbc8313b59
selftests/vsock: make wait_for_listener() work even if pipefail is on

Rewrite wait_for_listener()'s pattern matching to avoid tripping the
if-condition when pipefail is on.

awk doesn't gracefully handle SIGPIPE with a non-zero exit code, so grep
exiting upon finding a match causes false-positives when the pipefail
option is used (grep exits, SIGPIPE emits, and awk complains with a
non-zero exit code). Instead, move all of the pattern matching into awk
so that SIGPIPE cannot happen and the correct exit code is returned.

Signed-off-by: Bobby Eshleman <bobbyeshleman@meta.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://patch.msgid.link/20251108-vsock-selftests-fixes-and-improvements-v4-2-d5e8d6c87289@meta.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/vsock/vmtest.sh