]> git.proxmox.com Git - mirror_kronosnet.git/commitdiff
tests: skip the SCTP test if SCTP is not supported by the kernel
authorFerenc Wágner <wferi@debian.org>
Wed, 3 Apr 2019 08:26:11 +0000 (10:26 +0200)
committerFerenc Wágner <wferi@debian.org>
Wed, 25 Sep 2019 06:24:02 +0000 (08:24 +0200)
For example, module loading is disabled on Debian build daemons.
(In the vein of c5aa1c3343703455b480cef5c173f471e1bb020f.)

Signed-off-by: Ferenc Wágner <wferi@debian.org>
libknet/tests/api_knet_send.c

index 50469ee30dfede6664d37502b2919cd43ca21b58..c2166efe272170b732e6ff1408b866791a91e36e 100644 (file)
@@ -181,12 +181,13 @@ static void test(uint8_t transport)
        }
 
        if (knet_link_set_config(knet_h, 1, 0, transport, &lo, &lo, 0) < 0) {
+               int exit_status = transport == KNET_TRANSPORT_SCTP && errno == EPROTONOSUPPORT ? SKIP : FAIL;
                printf("Unable to configure link: %s\n", strerror(errno));
                knet_host_remove(knet_h, 1);
                knet_handle_free(knet_h);
                flush_logs(logfds[0], stdout);
                close_logpipes(logfds);
-               exit(FAIL);
+               exit(exit_status);
        }
 
        if (knet_link_set_enable(knet_h, 1, 0, 1) < 0) {