From: Tobias Brunner Date: Wed, 16 Mar 2022 15:45:16 +0000 (+0100) Subject: unit-tests: Add environment variable to skip IPv6 stream tests X-Git-Tag: 5.9.6rc1~1^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76ff49b76104dbe0d2c535bbebbb9910fd9c7da0;p=thirdparty%2Fstrongswan.git unit-tests: Add environment variable to skip IPv6 stream tests This is an issue e.g. when running tests in default Docker containers. --- 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;