Skip to content

Commit

Permalink
Worked around another IPv6-related test on Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed Mar 17, 2018
1 parent ba8d470 commit 032c5f9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
9 changes: 5 additions & 4 deletions tests/b6b_test_inet_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,10 @@ int main()
"{$global a [$inet.server udp ::1 2924]}",
39);
/* test is broken on Travis CI because IPv6 is not configured */
if (res == B6B_OK) {
if (getenv("TRAVIS"))
assert(res == B6B_ERR);
else {
assert(res == B6B_OK);
s = socket(AF_INET6, SOCK_DGRAM, 0);
assert(s >= 0);
assert(sendto(s,
Expand Down Expand Up @@ -219,9 +222,7 @@ int main()
assert(b6b_list_next(b6b_list_first(interp.fg->_))->o->f > 0);
assert(b6b_list_next(b6b_list_first(interp.fg->_))->o->f < USHRT_MAX);
assert(close(s) == 0);
} else
assert(res == B6B_ERR);

}
b6b_interp_destroy(&interp);

assert(b6b_interp_new_argv(&interp, 0, NULL, B6B_OPT_TRACE));
Expand Down
21 changes: 12 additions & 9 deletions tests/b6b_test_nslookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,18 @@ int main()
assert(!b6b_list_next(b6b_list_first(interp.fg->_)));
b6b_interp_destroy(&interp);

assert(b6b_interp_new_argv(&interp, 0, NULL, B6B_OPT_TRACE));
assert(b6b_call_copy(&interp, "{$nslookup ::1}", 15) == B6B_OK);
assert(b6b_as_list(interp.fg->_));
assert(!b6b_list_empty(interp.fg->_));
assert(b6b_as_str(b6b_list_first(interp.fg->_)->o));
assert(b6b_list_first(interp.fg->_)->o->slen == sizeof("::1") - 1);
assert(strcmp(b6b_list_first(interp.fg->_)->o->s, "::1") == 0);
assert(!b6b_list_next(b6b_list_first(interp.fg->_)));
b6b_interp_destroy(&interp);
/* test is broken on Travis CI because IPv6 is not configured */
if (!getenv("TRAVIS")) {
assert(b6b_interp_new_argv(&interp, 0, NULL, B6B_OPT_TRACE));
assert(b6b_call_copy(&interp, "{$nslookup ::1}", 15) == B6B_OK);
assert(b6b_as_list(interp.fg->_));
assert(!b6b_list_empty(interp.fg->_));
assert(b6b_as_str(b6b_list_first(interp.fg->_)->o));
assert(b6b_list_first(interp.fg->_)->o->slen == sizeof("::1") - 1);
assert(strcmp(b6b_list_first(interp.fg->_)->o->s, "::1") == 0);
assert(!b6b_list_next(b6b_list_first(interp.fg->_)));
b6b_interp_destroy(&interp);
}

assert(b6b_interp_new_argv(&interp, 0, NULL, B6B_OPT_TRACE));
assert(b6b_call_copy(&interp, "{$nslookup localhost}", 21) == B6B_OK);
Expand Down

0 comments on commit 032c5f9

Please sign in to comment.