From: Guus Sliepen Date: Fri, 8 Aug 2014 10:00:41 +0000 (+0200) Subject: Test whether UDP communication is working. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=09d1b540e60d5f7c32e80f24401bc2d468904902;p=meshlink Test whether UDP communication is working. --- diff --git a/test/import-export.c b/test/import-export.c index 17beaaf0..d6498c24 100644 --- a/test/import-export.c +++ b/test/import-export.c @@ -86,6 +86,17 @@ int main(int argc, char *argv[]) { return 1; } + int pmtu = meshlink_get_pmtu(mesh2, meshlink_get_node(mesh2, "bar")); + for(int i = 0; i < 10 && !pmtu; i++) { + sleep(1); + pmtu = meshlink_get_pmtu(mesh2, meshlink_get_node(mesh2, "bar")); + } + + if(!pmtu) { + fprintf(stderr, "UDP communication with bar not possible after 10 seconds\n"); + return 1; + } + // Clean up. meshlink_stop(mesh2); diff --git a/test/invite-join.c b/test/invite-join.c index 4471091c..50b79fb4 100644 --- a/test/invite-join.c +++ b/test/invite-join.c @@ -70,6 +70,17 @@ int main(int argc, char *argv[]) { return 1; } + int pmtu = meshlink_get_pmtu(mesh1, meshlink_get_node(mesh1, "baz")); + for(int i = 0; i < 10 && !pmtu; i++) { + sleep(1); + pmtu = meshlink_get_pmtu(mesh1, meshlink_get_node(mesh1, "baz")); + } + + if(!pmtu) { + fprintf(stderr, "UDP communication with baz not possible after 10 seconds\n"); + return 1; + } + // Clean up. meshlink_stop(mesh2);