From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eva Kurchatova Date: Fri, 21 Aug 2026 18:13:56 +0300 Subject: [Devel] [PATCH vz10] selftests/connector: make proc_filter terminate on its own Message-ID: <20260821151357.795211-1-eva.kurchatova@virtuozzo.com> List-Id: proc_filter listens for process events until it is interrupted, so under the harness it always runs into the timeout. Generate one event, stop after five seconds, and fail if nothing was received. https://virtuozzo.atlassian.net/browse/VSTOR-142450 Feature: fix selftests Signed-off-by: Eva Kurchatova --- tools/testing/selftests/connector/proc_filter.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/connector/proc_filter.c b/tools/testing/selftests/connector/proc_filter.c index 4a825b997666..f269b0b67db6 100644 --- a/tools/testing/selftests/connector/proc_filter.c +++ b/tools/testing/selftests/connector/proc_filter.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include "../kselftest.h" @@ -279,6 +280,16 @@ int main(int argc, char *argv[]) exit(1); } + /* + * Generate one event to observe and stop listening shortly after, + * so that the test terminates on its own. + */ + signal(SIGALRM, sigint); + alarm(5); + if (fork() == 0) + _exit(0); + wait(NULL); + while (!interrupted) { err = handle_events(epoll_fd, &proc_ev); if (err < 0) { @@ -306,5 +317,5 @@ int main(int argc, char *argv[]) close(nl_sock); printf("Done total count: %d\n", tcount); - exit(0); + exit(tcount > 0 ? KSFT_PASS : KSFT_FAIL); } -- 2.55.0