* [Devel] [PATCH vz10] selftests: connector: make proc_filter terminate on its own
@ 2026-09-01 0:40 Eva Kurchatova
2026-09-02 13:46 ` Konstantin Khorenko
0 siblings, 1 reply; 2+ messages in thread
From: Eva Kurchatova @ 2026-09-01 0:40 UTC (permalink / raw)
To: khorenko; +Cc: devel
proc_filter listens for process events until a signal interrupts it,
so a caller that waits for it to finish waits forever. 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 <eva.kurchatova@virtuozzo.com>
---
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 <strings.h>
#include <errno.h>
#include <signal.h>
+#include <sys/wait.h>
#include <string.h>
#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
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [Devel] [PATCH vz10] selftests: connector: make proc_filter terminate on its own
2026-09-01 0:40 [Devel] [PATCH vz10] selftests: connector: make proc_filter terminate on its own Eva Kurchatova
@ 2026-09-02 13:46 ` Konstantin Khorenko
0 siblings, 0 replies; 2+ messages in thread
From: Konstantin Khorenko @ 2026-09-02 13:46 UTC (permalink / raw)
To: Eva Kurchatova; +Cc: devel
> proc_filter listens for process events until a signal interrupts it,
> so a caller that waits for it to finish waits forever. 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 <eva.kurchatova@virtuozzo.com>
>
> diff --git a/tools/testing/selftests/connector/proc_filter.c b/tools/testing/selftests/connector/proc_filter.c
> index 4a825b997666e..f269b0b67db6c 100644
> --- a/tools/testing/selftests/connector/proc_filter.c
> +++ b/tools/testing/selftests/connector/proc_filter.c
> @@ -14,6 +14,7 @@
> #include <strings.h>
> #include <errno.h>
> #include <signal.h>
> +#include <sys/wait.h>
> #include <string.h>
>
> #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);
> }
AFAIS this is not a test at all, but a monitor developed to grab and show the
events from kernel. A manual monitor which is never run as a real kselftest.
If we would like to write a proper test on this, we need to generate all the
types of events and check that expected events are received - nothing of that
done here.
And adding 1 simple event to make the test pass - i do not think we need such a
test at all.
=> let's disable this test at all and not patch it.
--
Konstantin Khorenko <khorenko@virtuozzo.com>
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-02 13:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-01 0:40 [Devel] [PATCH vz10] selftests: connector: make proc_filter terminate on its own Eva Kurchatova
2026-09-02 13:46 ` Konstantin Khorenko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.