aboutsummaryrefslogtreecommitdiff
path: root/tests/zt.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-03-04 17:04:11 -0800
committerGarrett D'Amore <garrett@damore.org>2018-03-04 19:42:17 -0800
commit23a38d766780f4749945d84316b4e0a71e707b15 (patch)
tree336cf1bfc7c7e32999653a4c4014232d2b735a3e /tests/zt.c
parent0094f83a9e3b54d6cbfc1ea1885036366b87b991 (diff)
downloadnng-23a38d766780f4749945d84316b4e0a71e707b15.tar.gz
nng-23a38d766780f4749945d84316b4e0a71e707b15.tar.bz2
nng-23a38d766780f4749945d84316b4e0a71e707b15.zip
fixes #262 NNG_OPT_URL should be resolved
This causes TCP, TLS, and ZT endpoints to resolve any wildcards, and even IP addresses, when reporting the listen URL. The dialer URL is reported unresolved. Test cases for this are added as well, and nngcat actually reports this if --verbose is supplied.
Diffstat (limited to 'tests/zt.c')
-rw-r--r--tests/zt.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/zt.c b/tests/zt.c
index c8b7563c..fa662857 100644
--- a/tests/zt.c
+++ b/tests/zt.c
@@ -285,6 +285,20 @@ TestMain("ZeroTier Transport", {
nng_msleep(2000); // to give dialer time to start up
});
- trantest_test_extended("zt://*." NWID ":%u", check_props);
+ // We need to determine our ephemeral ID:
+
+ nng_socket s_test;
+ nng_listener l_test;
+ uint64_t node;
+ char fmt[128];
+
+ So(nng_pair_open(&s_test) == 0);
+ So(nng_listener_create(&l_test, s_test, "zt://*." NWID ":0") == 0);
+ So(nng_listener_start(l_test, 0) == 0);
+ So(nng_listener_getopt_uint64(l_test, NNG_OPT_ZT_NODE, &node) == 0);
+ snprintf(fmt, sizeof(fmt), "zt://%llx." NWID ":%%u", node);
+ nng_listener_close(l_test);
+
+ trantest_test_extended(fmt, check_props);
})