mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-09 12:28:19 -04:00
Make all tests that hit the network disabled by default
To run only these tests, run test/regress with @live_net. To run all tests, run test/regress with @all.
This commit is contained in:
parent
ef7c4f7956
commit
f2cea873bb
@ -1832,10 +1832,10 @@ end:
|
|||||||
|
|
||||||
struct testcase_t dns_testcases[] = {
|
struct testcase_t dns_testcases[] = {
|
||||||
DNS_LEGACY(server, TT_FORK|TT_NEED_BASE),
|
DNS_LEGACY(server, TT_FORK|TT_NEED_BASE),
|
||||||
DNS_LEGACY(gethostbyname, TT_FORK|TT_NEED_BASE|TT_NEED_DNS),
|
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),
|
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),
|
DNS_LEGACY(gethostbyaddr, TT_FORK|TT_NEED_BASE|TT_NEED_DNS|TT_OFF_BY_DEFAULT),
|
||||||
{ "resolve_reverse", dns_resolve_reverse, TT_FORK, NULL, NULL },
|
{ "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", dns_search_test, TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
|
||||||
{ "search_cancel", dns_search_cancel_test,
|
{ "search_cancel", dns_search_cancel_test,
|
||||||
TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
|
TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
|
||||||
|
@ -386,6 +386,19 @@ struct testgroup_t testgroups[] = {
|
|||||||
END_OF_GROUPS
|
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
|
int
|
||||||
main(int argc, const char **argv)
|
main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
@ -413,6 +426,8 @@ main(int argc, const char **argv)
|
|||||||
evthread_enable_lock_debuging();
|
evthread_enable_lock_debuging();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
tinytest_set_aliases(testaliases);
|
||||||
|
|
||||||
if (tinytest_main(argc,argv,testgroups))
|
if (tinytest_main(argc,argv,testgroups))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
@ -887,11 +887,6 @@ test_evutil_getaddrinfo(void *arg)
|
|||||||
{
|
{
|
||||||
struct evutil_addrinfo *ai = NULL, *a;
|
struct evutil_addrinfo *ai = NULL, *a;
|
||||||
struct evutil_addrinfo hints;
|
struct evutil_addrinfo hints;
|
||||||
|
|
||||||
struct sockaddr_in6 *sin6;
|
|
||||||
struct sockaddr_in *sin;
|
|
||||||
char buf[128];
|
|
||||||
const char *cp;
|
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
/* Try using it as a pton. */
|
/* Try using it as a pton. */
|
||||||
@ -1018,6 +1013,23 @@ test_evutil_getaddrinfo(void *arg)
|
|||||||
ai = NULL;
|
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. */
|
/* Now do some actual lookups. */
|
||||||
memset(&hints, 0, sizeof(hints));
|
memset(&hints, 0, sizeof(hints));
|
||||||
hints.ai_family = PF_INET;
|
hints.ai_family = PF_INET;
|
||||||
@ -1318,6 +1330,7 @@ struct testcase_t util_testcases[] = {
|
|||||||
{ "integers", test_evutil_integers, 0, NULL, NULL },
|
{ "integers", test_evutil_integers, 0, NULL, NULL },
|
||||||
{ "rand", test_evutil_rand, TT_FORK, NULL, NULL },
|
{ "rand", test_evutil_rand, TT_FORK, NULL, NULL },
|
||||||
{ "getaddrinfo", test_evutil_getaddrinfo, 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
|
#ifdef _WIN32
|
||||||
{ "loadsyslib", test_evutil_loadsyslib, TT_FORK, NULL, NULL },
|
{ "loadsyslib", test_evutil_loadsyslib, TT_FORK, NULL, NULL },
|
||||||
#endif
|
#endif
|
||||||
|
@ -4,6 +4,7 @@ BACKENDS="EVPORT KQUEUE EPOLL DEVPOLL POLL SELECT WIN32"
|
|||||||
TESTS="test-eof test-weof test-time test-changelist test-fdleak"
|
TESTS="test-eof test-weof test-time test-changelist test-fdleak"
|
||||||
FAILED=no
|
FAILED=no
|
||||||
TEST_OUTPUT_FILE=${TEST_OUTPUT_FILE:-/dev/null}
|
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,
|
# /bin/echo is a little more likely to support -n than sh's builtin echo,
|
||||||
# printf is even more likely
|
# printf is even more likely
|
||||||
@ -94,9 +95,9 @@ run_tests () {
|
|||||||
announce_n " regress: "
|
announce_n " regress: "
|
||||||
if test "$TEST_OUTPUT_FILE" = "/dev/null" ;
|
if test "$TEST_OUTPUT_FILE" = "/dev/null" ;
|
||||||
then
|
then
|
||||||
$TEST_DIR/regress --quiet
|
$TEST_DIR/regress --quiet $REGRESS_ARGS
|
||||||
else
|
else
|
||||||
$TEST_DIR/regress >>"$TEST_OUTPUT_FILE"
|
$TEST_DIR/regress $REGRESS_ARGS >>"$TEST_OUTPUT_FILE"
|
||||||
fi
|
fi
|
||||||
if test "$?" = "0" ;
|
if test "$?" = "0" ;
|
||||||
then
|
then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user