mirror of
https://github.com/curl/curl.git
synced 2026-08-05 20:06:15 +03:00
pytest: test threaded resolver
Add `resolv-threaded` to curlinfo to detect use of the threaded resolver correctly even with c-ares linked to https-rr. Run test_21_05 exactly when threaded resolver is built. Closes #21287
This commit is contained in:
parent
879209fc88
commit
a483128b01
3 changed files with 14 additions and 2 deletions
|
|
@ -34,7 +34,7 @@
|
|||
#include "multihandle.h" /* for ENABLE_WAKEUP */
|
||||
#include "tool_xattr.h" /* for USE_XATTR */
|
||||
#include "curl_sha512_256.h" /* for CURL_HAVE_SHA512_256 */
|
||||
#include "asyn.h" /* for USE_RESOLV_ARES */
|
||||
#include "asyn.h" /* for USE_RESOLV_ARES, USE_RESOLV_THREADED */
|
||||
#include "fake_addrinfo.h" /* for USE_FAKE_GETADDRINFO */
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -143,6 +143,13 @@ static const char *disabled[] = {
|
|||
"OFF"
|
||||
#else
|
||||
"ON"
|
||||
#endif
|
||||
,
|
||||
"resolv-threaded: "
|
||||
#ifndef USE_RESOLV_THREADED
|
||||
"OFF"
|
||||
#else
|
||||
"ON"
|
||||
#endif
|
||||
,
|
||||
"typecheck: "
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class TestResolve:
|
|||
assert os.path.exists(dfiles[1])
|
||||
|
||||
# use .invalid host name, parallel, single resolve thread
|
||||
@pytest.mark.skipif(condition=Env.curl_uses_lib('c-ares'), reason="c-ares resolver skipped")
|
||||
@pytest.mark.skipif(condition=not Env.curl_resolv_threaded(), reason="no threaded resolver")
|
||||
def test_21_05_resolv_single_thread(self, env: Env, httpd, nghttpx):
|
||||
count = 10
|
||||
delay_ms = 50
|
||||
|
|
|
|||
|
|
@ -165,6 +165,7 @@ class EnvConfig:
|
|||
self.curl_is_verbose = 'verbose-strings: ON' in p.stdout
|
||||
self.curl_can_cert_status = 'cert-status: ON' in p.stdout
|
||||
self.curl_override_dns = 'override-dns: ON' in p.stdout
|
||||
self.curl_resolv_threaded = 'resolv-threaded: ON' in p.stdout
|
||||
|
||||
self.ports = {}
|
||||
|
||||
|
|
@ -515,6 +516,10 @@ class Env:
|
|||
def curl_override_dns() -> bool:
|
||||
return Env.CONFIG.curl_override_dns
|
||||
|
||||
@staticmethod
|
||||
def curl_resolv_threaded() -> bool:
|
||||
return Env.CONFIG.curl_resolv_threaded
|
||||
|
||||
@staticmethod
|
||||
def curl_can_early_data() -> bool:
|
||||
if Env.curl_uses_lib('gnutls'):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue