From 76ff49b76104dbe0d2c535bbebbb9910fd9c7da0 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 16 Mar 2022 16:45:16 +0100 Subject: [PATCH] unit-tests: Add environment variable to skip IPv6 stream tests This is an issue e.g. when running tests in default Docker containers. --- src/libstrongswan/tests/suites/test_stream.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/libstrongswan/tests/suites/test_stream.c b/src/libstrongswan/tests/suites/test_stream.c index 899306af21..d273cd0578 100644 --- a/src/libstrongswan/tests/suites/test_stream.c +++ b/src/libstrongswan/tests/suites/test_stream.c @@ -245,23 +245,29 @@ Suite *stream_suite_create() { Suite *s; TCase *tc; + int count = countof(services); + + if (getenv("TESTS_NO_IPV6")) + { + count--; + } s = suite_create("stream"); tc = tcase_create("sync"); - tcase_add_loop_test(tc, test_sync, 0, countof(services)); + tcase_add_loop_test(tc, test_sync, 0, count); suite_add_tcase(s, tc); tc = tcase_create("async"); - tcase_add_loop_test(tc, test_async, 0, countof(services)); + tcase_add_loop_test(tc, test_async, 0, count); suite_add_tcase(s, tc); tc = tcase_create("all"); - tcase_add_loop_test(tc, test_all, 0, countof(services)); + tcase_add_loop_test(tc, test_all, 0, count); suite_add_tcase(s, tc); tc = tcase_create("concurrency"); - tcase_add_loop_test(tc, test_concurrency, 0, countof(services)); + tcase_add_loop_test(tc, test_concurrency, 0, count); suite_add_tcase(s, tc); return s; -- 2.47.2