From: Azat Khuzhin Date: Thu, 24 Mar 2016 07:27:24 +0000 (+0300) Subject: test/http: cover NS timed out during request cancellations separatelly X-Git-Tag: release-2.1.6-beta~52^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0c343afea98a6ab6c55aa3ddf5d69d41ff83ba8a;p=libevent test/http: cover NS timed out during request cancellations separatelly --- diff --git a/test/regress_http.c b/test/regress_http.c index 9cf9ee5a..1906da80 100644 --- a/test/regress_http.c +++ b/test/regress_http.c @@ -1359,6 +1359,7 @@ enum http_cancel_test_type { NO_NS = 4, INACTIVE_SERVER = 8, SERVER_TIMEOUT = 16, + NS_TIMEOUT = 32, }; static void http_cancel_test(void *arg) @@ -1391,7 +1392,10 @@ http_cancel_test(void *arg) evutil_snprintf(address, sizeof(address), "127.0.0.1:%d", portnum); evdns_base_nameserver_ip_add(dns_base, address); - evdns_base_set_option(dns_base, "timeout:", "3"); + + char *timeout = (type & NS_TIMEOUT) ? "6" : "3"; + evdns_base_set_option(dns_base, "timeout:", timeout); + evdns_base_set_option(dns_base, "initial-probe-timeout:", timeout); evdns_base_set_option(dns_base, "attempts:", "1"); } @@ -4523,6 +4527,9 @@ struct testcase_t http_testcases[] = { HTTP_N(cancel_by_host_server_timeout, cancel, BY_HOST | INACTIVE_SERVER | SERVER_TIMEOUT), HTTP_N(cancel_server_timeout, cancel, INACTIVE_SERVER | SERVER_TIMEOUT), HTTP_N(cancel_by_host_no_ns_server_timeout, cancel, BY_HOST | NO_NS | INACTIVE_SERVER | SERVER_TIMEOUT), + HTTP_N(cancel_by_host_ns_timeout, cancel, BY_HOST | NO_NS | NS_TIMEOUT), + HTTP_N(cancel_by_host_ns_timeout_inactive_server, cancel, BY_HOST | NO_NS | NS_TIMEOUT | INACTIVE_SERVER), + HTTP_N(cancel_by_host_ns_timeout_server_timeout, cancel, BY_HOST | NO_NS | NS_TIMEOUT | INACTIVE_SERVER | SERVER_TIMEOUT), HTTP(virtual_host), HTTP(post),