diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | tests/tcp6.c | 78 |
2 files changed, 0 insertions, 79 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4e1d2331..62b64167 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -132,7 +132,6 @@ add_nng_test(nonblock 60) add_nng_test(scalability 20 ON) add_nng_test(synch 5) add_nng_test(tcpsupp 10) -add_nng_test(tcp6 60) add_nng_test(ws 30) add_nng_test(wss 30) add_nng_test1(zt 60 NNG_TRANSPORT_ZEROTIER) diff --git a/tests/tcp6.c b/tests/tcp6.c deleted file mode 100644 index a3ce919b..00000000 --- a/tests/tcp6.c +++ /dev/null @@ -1,78 +0,0 @@ -// -// Copyright 2022 Staysail Systems, Inc. <info@staystail.tech> -// Copyright 2018 Capitar IT Group BV <info@capitar.com> -// -// This software is supplied under the terms of the MIT License, a -// copy of which should be located in the distribution where this -// file was obtained (LICENSE.txt). A copy of the license may also be -// found online at https://opensource.org/licenses/MIT. -// - -// TCP tests for IPv6. - -#include <nng/nng.h> -#include <nng/protocol/pair1/pair.h> - -#include "convey.h" -#include "core/nng_impl.h" -#include "trantest.h" - -#include "stubs.h" - -static int -has_v6(void) -{ - nng_sockaddr sa; - nni_plat_udp *u; - int rv; - - sa.s_in6.sa_family = NNG_AF_INET6; - sa.s_in6.sa_port = 0; - memset(sa.s_in6.sa_addr, 0, 16); - sa.s_in6.sa_addr[15] = 1; - - rv = nni_plat_udp_open(&u, &sa); - if (rv == 0) { - nni_plat_udp_close(u); - } - return (rv == 0 ? 1 : 0); -} - -static int -check_props_v6(nng_msg *msg) -{ - nng_pipe p; - uint8_t loopback[16]; - - memset(loopback, 0, sizeof(loopback)); - loopback[15] = 1; - - // IPv6 Local address property works - nng_sockaddr la; - p = nng_msg_get_pipe(msg); - So(nng_pipe_id(p) > 0); - So(nng_pipe_get_addr(p, NNG_OPT_LOCADDR, &la) == 0); - So(la.s_family == NNG_AF_INET6); - // So(la.s_in.sa_port == (trantest_port - 1)); - So(la.s_in6.sa_port != 0); - So(memcmp(la.s_in6.sa_addr, loopback, 16) == 0); - - // IPv6 Remote address property works - nng_sockaddr ra; - p = nng_msg_get_pipe(msg); - So(nng_pipe_id(p) > 0); - So(nng_pipe_get_addr(p, NNG_OPT_REMADDR, &ra) == 0); - So(ra.s_family == NNG_AF_INET6); - So(ra.s_in6.sa_port != 0); - So(memcmp(ra.s_in6.sa_addr, loopback, 16) == 0); - - return (0); -} - -TestMain("TCP (IPv6) Transport", { - if (has_v6()) { - trantest_test_extended("tcp://[::1]:", check_props_v6); - } else { - SkipSo("IPv6 not available"); - } -}) |
