Skip to content

Commit

Permalink
tests: skip the SCTP test if SCTP is not supported by the kernel
Browse files Browse the repository at this point in the history
For example, module loading is disabled on Debian build daemons.
(In the vein of c5aa1c3.)

Signed-off-by: Ferenc Wágner <wferi@debian.org>
  • Loading branch information
wferi committed Sep 25, 2019
1 parent 89213e4 commit eba4780
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libknet/tests/api_knet_send.c
Expand Up @@ -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) {
Expand Down

0 comments on commit eba4780

Please sign in to comment.