]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
unit-tests: Add environment variable to skip IPv6 stream tests
authorTobias Brunner <tobias@strongswan.org>
Wed, 16 Mar 2022 15:45:16 +0000 (16:45 +0100)
committerTobias Brunner <tobias@strongswan.org>
Thu, 14 Apr 2022 17:05:45 +0000 (19:05 +0200)
This is an issue e.g. when running tests in default Docker containers.

src/libstrongswan/tests/suites/test_stream.c

index 899306af2188da52d5906f4e152df0dd7b979499..d273cd05789c51a27e0dff318d27760e80bfc388 100644 (file)
@@ -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;