diff --git a/test/regress_dns.c b/test/regress_dns.c index ae1fc30a..155e0f55 100644 --- a/test/regress_dns.c +++ b/test/regress_dns.c @@ -1832,10 +1832,10 @@ end: struct testcase_t dns_testcases[] = { DNS_LEGACY(server, TT_FORK|TT_NEED_BASE), - DNS_LEGACY(gethostbyname, TT_FORK|TT_NEED_BASE|TT_NEED_DNS), - DNS_LEGACY(gethostbyname6, TT_FORK|TT_NEED_BASE|TT_NEED_DNS), - DNS_LEGACY(gethostbyaddr, TT_FORK|TT_NEED_BASE|TT_NEED_DNS), - { "resolve_reverse", dns_resolve_reverse, TT_FORK, NULL, NULL }, + DNS_LEGACY(gethostbyname, TT_FORK|TT_NEED_BASE|TT_NEED_DNS|TT_OFF_BY_DEFAULT), + DNS_LEGACY(gethostbyname6, TT_FORK|TT_NEED_BASE|TT_NEED_DNS|TT_OFF_BY_DEFAULT), + DNS_LEGACY(gethostbyaddr, TT_FORK|TT_NEED_BASE|TT_NEED_DNS|TT_OFF_BY_DEFAULT), + { "resolve_reverse", dns_resolve_reverse, TT_FORK|TT_OFF_BY_DEFAULT, NULL, NULL }, { "search", dns_search_test, TT_FORK|TT_NEED_BASE, &basic_setup, NULL }, { "search_cancel", dns_search_cancel_test, TT_FORK|TT_NEED_BASE, &basic_setup, NULL }, diff --git a/test/regress_main.c b/test/regress_main.c index 05e28433..c735b1e5 100644 --- a/test/regress_main.c +++ b/test/regress_main.c @@ -386,6 +386,19 @@ struct testgroup_t testgroups[] = { END_OF_GROUPS }; +const char *alltests[] = { "+..", NULL }; +const char *livenettests[] = { + "+util/getaddrinfo_live", + "+dns/gethostby..", + "+dns/resolve_reverse", + NULL +}; +struct testlist_alias_t testaliases[] = { + { "all", alltests }, + { "live_net", livenettests }, + END_OF_ALIASES +}; + int main(int argc, const char **argv) { @@ -413,6 +426,8 @@ main(int argc, const char **argv) evthread_enable_lock_debuging(); #endif + tinytest_set_aliases(testaliases); + if (tinytest_main(argc,argv,testgroups)) return 1; diff --git a/test/regress_util.c b/test/regress_util.c index 6a6a3942..0f49249c 100644 --- a/test/regress_util.c +++ b/test/regress_util.c @@ -887,11 +887,6 @@ test_evutil_getaddrinfo(void *arg) { struct evutil_addrinfo *ai = NULL, *a; struct evutil_addrinfo hints; - - struct sockaddr_in6 *sin6; - struct sockaddr_in *sin; - char buf[128]; - const char *cp; int r; /* Try using it as a pton. */ @@ -1018,6 +1013,23 @@ test_evutil_getaddrinfo(void *arg) ai = NULL; } +end: + if (ai) + evutil_freeaddrinfo(ai); +} + +static void +test_evutil_getaddrinfo_live(void *arg) +{ + struct evutil_addrinfo *ai = NULL; + struct evutil_addrinfo hints; + + struct sockaddr_in6 *sin6; + struct sockaddr_in *sin; + char buf[128]; + const char *cp; + int r; + /* Now do some actual lookups. */ memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_INET; @@ -1318,6 +1330,7 @@ struct testcase_t util_testcases[] = { { "integers", test_evutil_integers, 0, NULL, NULL }, { "rand", test_evutil_rand, TT_FORK, NULL, NULL }, { "getaddrinfo", test_evutil_getaddrinfo, TT_FORK, NULL, NULL }, + { "getaddrinfo_live", test_evutil_getaddrinfo_live, TT_FORK|TT_OFF_BY_DEFAULT, NULL, NULL }, #ifdef _WIN32 { "loadsyslib", test_evutil_loadsyslib, TT_FORK, NULL, NULL }, #endif diff --git a/test/test.sh b/test/test.sh index 59748c00..d1e7e336 100755 --- a/test/test.sh +++ b/test/test.sh @@ -4,6 +4,7 @@ BACKENDS="EVPORT KQUEUE EPOLL DEVPOLL POLL SELECT WIN32" TESTS="test-eof test-weof test-time test-changelist test-fdleak" FAILED=no TEST_OUTPUT_FILE=${TEST_OUTPUT_FILE:-/dev/null} +REGRESS_ARGS=${REGRESS_ARGS:-} # /bin/echo is a little more likely to support -n than sh's builtin echo, # printf is even more likely @@ -94,9 +95,9 @@ run_tests () { announce_n " regress: " if test "$TEST_OUTPUT_FILE" = "/dev/null" ; then - $TEST_DIR/regress --quiet + $TEST_DIR/regress --quiet $REGRESS_ARGS else - $TEST_DIR/regress >>"$TEST_OUTPUT_FILE" + $TEST_DIR/regress $REGRESS_ARGS >>"$TEST_OUTPUT_FILE" fi if test "$?" = "0" ; then