mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-22 10:10:14 -04:00
Fix vulture warnings and tweak ignore lists
Run vulture on the whole repository, fix most errors in previously unchecked code, adjust ignore lists.
This commit is contained in:
parent
19076c0d4d
commit
57ecaee95d
8 changed files with 33 additions and 27 deletions
|
|
@ -42,7 +42,6 @@ isctest.vars.init_vars()
|
|||
# ----------------------- Globals definition -----------------------------
|
||||
|
||||
FILE_DIR = os.path.abspath(Path(__file__).parent)
|
||||
ENV_RE = Re(b"([^=]+)=(.*)")
|
||||
PRIORITY_TESTS = [
|
||||
# Tests that are scheduled first. Speeds up parallel execution.
|
||||
"rpz/",
|
||||
|
|
|
|||
|
|
@ -913,7 +913,7 @@ def test_kasp_default(ns3):
|
|||
ns3.rndc(f"loadkeys {zone}")
|
||||
watcher.wait_for_line(f"zone {zone}/IN (signed): {expectmsg}")
|
||||
# Nothing has changed.
|
||||
expected[0].private = False # noqa
|
||||
expected[0].private = False
|
||||
isctest.kasp.check_dnssec_verify(ns3, zone)
|
||||
isctest.kasp.check_keys(zone, keys, expected)
|
||||
isctest.kasp.check_keytimes(keys, expected)
|
||||
|
|
|
|||
|
|
@ -552,8 +552,8 @@ def test_multisigner(ns2, ns3, ns4):
|
|||
# Add DNSKEY to RRset.
|
||||
newprops = [f"zsk unlimited {ALGORITHM} {SIZE}"]
|
||||
extra = isctest.kasp.policy_to_properties(ttl=TTL, keys=newprops)
|
||||
extra[0].private = False # noqa
|
||||
extra[0].legacy = True # noqa
|
||||
extra[0].private = False
|
||||
extra[0].legacy = True
|
||||
|
||||
check_add_zsk(ns3, zone, keys3, expected3, [zsks4[0]], extra)
|
||||
check_add_zsk(ns4, zone, keys4, expected4, [zsks3[0]], extra)
|
||||
|
|
@ -567,8 +567,8 @@ def test_multisigner(ns2, ns3, ns4):
|
|||
# Add CDNSKEY RRset.
|
||||
newprops = [f"ksk unlimited {ALGORITHM} {SIZE}"]
|
||||
extra = isctest.kasp.policy_to_properties(ttl=TTL, keys=newprops)
|
||||
extra[0].private = False # noqa
|
||||
extra[0].legacy = True # noqa
|
||||
extra[0].private = False
|
||||
extra[0].legacy = True
|
||||
|
||||
check_add_cdnskey(ns3, zone, keys3, expected3, [ksks4[0]], extra)
|
||||
check_add_cdnskey(ns4, zone, keys4, expected4, [ksks3[0]], extra)
|
||||
|
|
@ -660,8 +660,8 @@ def test_multisigner_secondary(ns2, ns3, ns4, ns5):
|
|||
# Add DNSKEY to RRset.
|
||||
newprops = [f"zsk unlimited {ALGORITHM} {SIZE}"]
|
||||
extra = isctest.kasp.policy_to_properties(ttl=TTL, keys=newprops)
|
||||
extra[0].private = False # noqa
|
||||
extra[0].legacy = True # noqa
|
||||
extra[0].private = False
|
||||
extra[0].legacy = True
|
||||
|
||||
check_add_zsk(ns3, zone, keys3, expected3, [zsks4[0]], extra, primary=ns5)
|
||||
check_add_zsk(ns4, zone, keys4, expected4, [zsks3[0]], extra, primary=ns5)
|
||||
|
|
@ -677,8 +677,8 @@ def test_multisigner_secondary(ns2, ns3, ns4, ns5):
|
|||
# Add CDNSKEY RRset.
|
||||
newprops = [f"ksk unlimited {ALGORITHM} {SIZE}"]
|
||||
extra = isctest.kasp.policy_to_properties(ttl=TTL, keys=newprops)
|
||||
extra[0].private = False # noqa
|
||||
extra[0].legacy = True # noqa
|
||||
extra[0].private = False
|
||||
extra[0].legacy = True
|
||||
|
||||
check_add_cdnskey(ns3, zone, keys3, expected3, [ksks4[0]], extra, primary=ns5)
|
||||
check_add_cdnskey(ns4, zone, keys4, expected4, [ksks3[0]], extra, primary=ns5)
|
||||
|
|
|
|||
|
|
@ -123,8 +123,8 @@ def check_nsec3_case(server, params, nsec3=True):
|
|||
if "external-keys" in params:
|
||||
expected2 = isctest.kasp.policy_to_properties(ttl, keys=params["external-keys"])
|
||||
for ek in expected2:
|
||||
ek.private = False # noqa
|
||||
ek.legacy = True # noqa
|
||||
ek.private = False
|
||||
ek.legacy = True
|
||||
expected = expected + expected2
|
||||
assert "external-keydir" in params
|
||||
extkeys = isctest.kasp.keydir_to_keylist(zone, params["external-keydir"])
|
||||
|
|
|
|||
|
|
@ -145,8 +145,8 @@ def test_rollover_multisigner(ns3, alg, size):
|
|||
|
||||
newprops = [f"zsk unlimited {alg} {size} tag-range:0-32767"]
|
||||
expected2 = isctest.kasp.policy_to_properties(ttl, newprops)
|
||||
expected2[0].private = False # noqa
|
||||
expected2[0].legacy = True # noqa
|
||||
expected2[0].private = False
|
||||
expected2[0].legacy = True
|
||||
expected = expected + expected2
|
||||
|
||||
ownkeys = isctest.kasp.keydir_to_keylist(zone, ns3.identifier)
|
||||
|
|
@ -169,8 +169,8 @@ def test_rollover_multisigner(ns3, alg, size):
|
|||
newkeys = isctest.kasp.keystr_to_keylist(out)
|
||||
newprops = [f"zsk unlimited {alg} {size} tag-range:0-32767"]
|
||||
expected2 = isctest.kasp.policy_to_properties(ttl, newprops)
|
||||
expected2[0].private = False # noqa
|
||||
expected2[0].legacy = True # noqa
|
||||
expected2[0].private = False
|
||||
expected2[0].legacy = True
|
||||
expected = expected + expected2
|
||||
|
||||
dnskey = newkeys[0].dnskey
|
||||
|
|
|
|||
|
|
@ -9,6 +9,4 @@
|
|||
# See the COPYRIGHT file distributed with this work for additional
|
||||
# information regarding copyright ownership.
|
||||
|
||||
transfers_complete # unused function (cipher-suites/tests_cipher_suites.py:31)
|
||||
transfers_complete # unused variable (cipher-suites/tests_cipher_suites.py:86)
|
||||
token_init_and_cleanup # unused function (keyfromlabel/tests_keyfromlabel.py:43)
|
||||
transfers_complete # unused function (cipher-suites/tests_cipher_suites.py:82)
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ def lines_containing(lines, string):
|
|||
return [l for l in lines if bytes(string, "utf-8") in l]
|
||||
|
||||
|
||||
changes_issue_or_mr_id_regex = re.compile(rb"\[(GL [#!]|RT #)[0-9]+\]")
|
||||
rdata_regex = re.compile(r"lib/dns/rdata/")
|
||||
|
||||
# Source: https://docs.gitlab.com/user/project/issues/managing_issues/#default-closing-pattern
|
||||
|
|
|
|||
|
|
@ -56,19 +56,29 @@ source-roots = [
|
|||
|
||||
[tool.vulture]
|
||||
paths = [
|
||||
"bin/tests/system/",
|
||||
".",
|
||||
]
|
||||
exclude = [
|
||||
"*ans.py",
|
||||
"conftest.py",
|
||||
"re_compile_checker.py",
|
||||
"contrib",
|
||||
"*doc/arm/_ext/*conf.py",
|
||||
"doc/arm/conf.py",
|
||||
"doc/man/conf.py",
|
||||
"isctest",
|
||||
"re_compile_checker.py",
|
||||
]
|
||||
ignore_decorators = [
|
||||
"@pytest.fixture",
|
||||
]
|
||||
ignore_names = [
|
||||
"after_servers_start",
|
||||
"bootstrap",
|
||||
"pytestmark",
|
||||
"autouse_*",
|
||||
"pytest*",
|
||||
# attributes of `isctest.kasp.KeyProperties` set but later not read in:
|
||||
# - bin/tests/system/kasp/tests_kasp.py
|
||||
# - bin/tests/system/multisigner/tests_multisigner.py
|
||||
# - bin/tests/system/nsec3/common.py
|
||||
# - bin/tests/system/rollover-multisigner/tests_rollover_multisigner.py
|
||||
"private",
|
||||
"legacy",
|
||||
]
|
||||
|
||||
[tool.ruff]
|
||||
|
|
|
|||
Loading…
Reference in a new issue