mirror of
https://github.com/curl/curl.git
synced 2026-08-25 14:23:39 +03:00
badwords: fix issues found in tests
There remain some false positives, hits in test data, and `dir` use, around 100 issues in total. There is no plan to enforce badwords on tests. Also: - badwords.txt: let a few `manpage[s]` occurrences through (in Perl code). Closes #19541
This commit is contained in:
parent
f0de14168a
commit
a87383828e
247 changed files with 594 additions and 595 deletions
|
|
@ -845,7 +845,7 @@ def print_file(filename):
|
|||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(prog='scorecard', description="""
|
||||
Run a range of tests to give a scorecard for a HTTP protocol
|
||||
Run a range of tests to give a scorecard for an HTTP protocol
|
||||
'h3' or 'h2' implementation in curl.
|
||||
""")
|
||||
parser.add_argument("-v", "--verbose", action='count', default=1,
|
||||
|
|
|
|||
|
|
@ -716,7 +716,7 @@ class TestDownload:
|
|||
if proto == 'h3' and env.curl_uses_lib('quiche'):
|
||||
pytest.skip("quiche fails from 16k onwards")
|
||||
curl = CurlClient(env=env)
|
||||
# url is longer than 'url_len'
|
||||
# 'url' is longer than 'url_len'
|
||||
url = f'https://{env.authority_for(env.domain1, proto)}/data.json?{"x"*(url_junk)}'
|
||||
r = curl.http_download(urls=[url], alpn_proto=proto)
|
||||
if url_junk <= 1024:
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ class TestProxy:
|
|||
@pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug")
|
||||
@pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings")
|
||||
def test_10_10_reuse_proxy(self, env: Env, httpd, nghttpx_fwd, tunnel):
|
||||
# url twice via https: proxy separated with '--next', will reuse
|
||||
# URL twice via https: proxy separated with '--next', will reuse
|
||||
if tunnel == 'h2' and not env.curl_uses_lib('nghttp2'):
|
||||
pytest.skip('only supported with nghttp2')
|
||||
if env.curl_uses_lib('mbedtls') and \
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ class TestSSLUse:
|
|||
else:
|
||||
assert djson['SSL_SESSION_RESUMED'] == exp_resumed, f'{i}: {djson}\n{r.dump_logs()}'
|
||||
|
||||
# use host name with trailing dot, verify handshake
|
||||
# use hostname with trailing dot, verify handshake
|
||||
@pytest.mark.parametrize("proto", Env.http_protos())
|
||||
def test_17_03_trailing_dot(self, env: Env, proto, httpd, nghttpx):
|
||||
curl = CurlClient(env=env)
|
||||
|
|
@ -128,7 +128,7 @@ class TestSSLUse:
|
|||
# the SNI the server received is without trailing dot
|
||||
assert r.json['SSL_TLS_SNI'] == env.domain1, f'{r.json}'
|
||||
|
||||
# use host name with double trailing dot, verify handshake
|
||||
# use hostname with double trailing dot, verify handshake
|
||||
@pytest.mark.parametrize("proto", Env.http_protos())
|
||||
def test_17_04_double_dot(self, env: Env, proto, httpd, nghttpx):
|
||||
curl = CurlClient(env=env)
|
||||
|
|
@ -404,7 +404,7 @@ class TestSSLUse:
|
|||
reused_session = True
|
||||
assert reused_session, f'{r}\n{r.dump_logs()}'
|
||||
|
||||
# use host name server has no certificate for
|
||||
# use hostname server has no certificate for
|
||||
@pytest.mark.parametrize("proto", Env.http_protos())
|
||||
def test_17_11_wrong_host(self, env: Env, proto, httpd, nghttpx):
|
||||
curl = CurlClient(env=env)
|
||||
|
|
@ -413,7 +413,7 @@ class TestSSLUse:
|
|||
r = curl.http_get(url=url, alpn_proto=proto)
|
||||
assert r.exit_code == 60, f'{r}'
|
||||
|
||||
# use host name server has no cert for with --insecure
|
||||
# use hostname server has no cert for with --insecure
|
||||
@pytest.mark.parametrize("proto", Env.http_protos())
|
||||
def test_17_12_insecure(self, env: Env, proto, httpd, nghttpx):
|
||||
curl = CurlClient(env=env)
|
||||
|
|
|
|||
|
|
@ -165,10 +165,10 @@ class Caddy:
|
|||
def _write_config(self):
|
||||
domain1 = self.env.domain1
|
||||
creds1 = self.env.get_credentials(domain1)
|
||||
assert creds1 # convince pytype this isn't None
|
||||
assert creds1 # convince pytype this is not None
|
||||
domain2 = self.env.domain2
|
||||
creds2 = self.env.get_credentials(domain2)
|
||||
assert creds2 # convince pytype this isn't None
|
||||
assert creds2 # convince pytype this is not None
|
||||
self._mkpath(self._docs_dir)
|
||||
self._mkpath(self._tmp_dir)
|
||||
with open(os.path.join(self._docs_dir, 'data.json'), 'w') as fd:
|
||||
|
|
|
|||
|
|
@ -100,9 +100,9 @@ class Httpd:
|
|||
raise Exception(f'{env.apxs} failed to query libexecdir: {p}')
|
||||
self._mods_dir = p.stdout.strip()
|
||||
if self._mods_dir is None:
|
||||
raise Exception('apache modules dir cannot be found')
|
||||
raise Exception('apache modules directory cannot be found')
|
||||
if not os.path.exists(self._mods_dir):
|
||||
raise Exception(f'apache modules dir does not exist: {self._mods_dir}')
|
||||
raise Exception(f'apache modules directory does not exist: {self._mods_dir}')
|
||||
self._maybe_running = False
|
||||
self.ports = {}
|
||||
self._rmf(self._error_log)
|
||||
|
|
@ -260,17 +260,17 @@ class Httpd:
|
|||
domain1 = self.env.domain1
|
||||
domain1brotli = self.env.domain1brotli
|
||||
creds1 = self.env.get_credentials(self._domain1_cred_name)
|
||||
assert creds1 # convince pytype this isn't None
|
||||
assert creds1 # convince pytype this is not None
|
||||
self._loaded_domain1_cred_name = self._domain1_cred_name
|
||||
domain2 = self.env.domain2
|
||||
creds2 = self.env.get_credentials(domain2)
|
||||
assert creds2 # convince pytype this isn't None
|
||||
assert creds2 # convince pytype this is not None
|
||||
exp_domain = self.env.expired_domain
|
||||
exp_creds = self.env.get_credentials(exp_domain)
|
||||
assert exp_creds # convince pytype this isn't None
|
||||
assert exp_creds # convince pytype this is not None
|
||||
proxy_domain = self.env.proxy_domain
|
||||
proxy_creds = self.env.get_credentials(proxy_domain)
|
||||
assert proxy_creds # convince pytype this isn't None
|
||||
assert proxy_creds # convince pytype this is not None
|
||||
self._mkpath(self._conf_dir)
|
||||
self._mkpath(self._docs_dir)
|
||||
self._mkpath(self._logs_dir)
|
||||
|
|
|
|||
|
|
@ -45,10 +45,10 @@ static int curltest_sslinfo_handler(request_rec *r);
|
|||
AP_DECLARE_MODULE(curltest) =
|
||||
{
|
||||
STANDARD20_MODULE_STUFF,
|
||||
NULL, /* func to create per dir config */
|
||||
NULL, /* func to merge per dir config */
|
||||
NULL, /* func to create per server config */
|
||||
NULL, /* func to merge per server config */
|
||||
NULL, /* func to create per-directory config */
|
||||
NULL, /* func to merge per-directory config */
|
||||
NULL, /* func to create per-server config */
|
||||
NULL, /* func to merge per-server config */
|
||||
NULL, /* command handlers */
|
||||
curltest_hooks,
|
||||
#ifdef AP_MODULE_FLAG_NONE
|
||||
|
|
@ -398,7 +398,7 @@ static int curltest_tweak_handler(request_rec *r)
|
|||
}
|
||||
}
|
||||
else if(!strcmp("id", arg)) {
|
||||
/* just an id for repeated requests with curl's url globbing */
|
||||
/* just an id for repeated requests with curl's URL globbing */
|
||||
request_id = val;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -606,7 +606,7 @@ static int curltest_put_handler(request_rec *r)
|
|||
*s = '\0';
|
||||
val = s + 1;
|
||||
if(!strcmp("id", arg)) {
|
||||
/* just an id for repeated requests with curl's url globbing */
|
||||
/* just an id for repeated requests with curl's URL globbing */
|
||||
request_id = val;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -804,7 +804,7 @@ static int curltest_sslinfo_handler(request_rec *r)
|
|||
*s = '\0';
|
||||
val = s + 1;
|
||||
if(!strcmp("id", arg)) {
|
||||
/* just an id for repeated requests with curl's url globbing */
|
||||
/* just an id for repeated requests with curl's URL globbing */
|
||||
request_id = val;
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ class NghttpxQuic(Nghttpx):
|
|||
if self._process:
|
||||
self.stop()
|
||||
creds = self.env.get_credentials(self._cred_name)
|
||||
assert creds # convince pytype this isn't None
|
||||
assert creds # convince pytype this is not None
|
||||
self._loaded_cred_name = self._cred_name
|
||||
args = [self._cmd, f'--frontend=*,{self._port};tls']
|
||||
if self.supports_h3():
|
||||
|
|
@ -297,7 +297,7 @@ class NghttpxFwd(Nghttpx):
|
|||
if self._process:
|
||||
self.stop()
|
||||
creds = self.env.get_credentials(self._cred_name)
|
||||
assert creds # convince pytype this isn't None
|
||||
assert creds # convince pytype this is not None
|
||||
self._loaded_cred_name = self._cred_name
|
||||
args = [
|
||||
self._cmd,
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ class VsFTPD:
|
|||
]
|
||||
if self._with_ssl:
|
||||
creds = self.env.get_credentials(self.domain)
|
||||
assert creds # convince pytype this isn't None
|
||||
assert creds # convince pytype this is not None
|
||||
conf.extend([
|
||||
'ssl_enable=YES',
|
||||
'debug_ssl=YES',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue