mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 08:50:00 -04:00
Fix pylint's 'invalid-name' errors
Where possible comply with the naming rules. Add exceptions for the
function names used in KASP tests.
(cherry picked from commit 50ed74197c)
This commit is contained in:
parent
7982b2e0c0
commit
50f6dcdc75
12 changed files with 29 additions and 24 deletions
|
|
@ -600,7 +600,7 @@ stages:
|
|||
- cd "$CI_PROJECT_DIR"
|
||||
- *find_python
|
||||
- >
|
||||
"$PYTHON" bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit_system.xml
|
||||
"$PYTHON" bin/tests/convert_trs_to_junit.py . > "$CI_PROJECT_DIR"/junit_system.xml
|
||||
- *git_clone_bind9-qa
|
||||
- >
|
||||
"$PYTHON" "$CI_PROJECT_DIR"/bind9-qa/ci/postprocess_junit_files.py "$CI_PROJECT_DIR"/junit_system.xml --output "$CI_PROJECT_DIR"/junit.xml
|
||||
|
|
@ -632,7 +632,7 @@ stages:
|
|||
- *find_python
|
||||
- *git_clone_bind9-qa
|
||||
- >
|
||||
"$PYTHON" "$CI_PROJECT_DIR"/bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit_unit.xml
|
||||
"$PYTHON" "$CI_PROJECT_DIR"/bin/tests/convert_trs_to_junit.py . > "$CI_PROJECT_DIR"/junit_unit.xml
|
||||
- >
|
||||
"$PYTHON" "$CI_PROJECT_DIR"/bind9-qa/ci/postprocess_junit_files.py "$CI_PROJECT_DIR"/junit_unit.xml --output "$CI_PROJECT_DIR"/junit.xml
|
||||
- (exit $RET)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
include $(top_srcdir)/Makefile.top
|
||||
|
||||
EXTRA_DIST = convert-trs-to-junit.py
|
||||
EXTRA_DIST = convert_trs_to_junit.py
|
||||
|
||||
SUBDIRS = system
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ def junit_to_trs(junit_xml):
|
|||
testcases = root.findall(".//testcase")
|
||||
|
||||
if len(testcases) < 1:
|
||||
print(":test-result: ERROR convert-junit-to-trs.py")
|
||||
print(":test-result: ERROR convert_junit_to_trs.py")
|
||||
return 99
|
||||
|
||||
has_fail = False
|
||||
|
|
@ -146,7 +146,7 @@ else
|
|||
fi
|
||||
|
||||
# Run junit to trs converter script.
|
||||
./convert-junit-to-trs.py $junit_file >$trs_file
|
||||
./convert_junit_to_trs.py $junit_file >$trs_file
|
||||
estatus=$?
|
||||
|
||||
if test $enable_hard_errors = no && test $estatus -eq 99; then
|
||||
|
|
|
|||
|
|
@ -84,24 +84,24 @@ def Iret(config, zsk=True, ksk=False, rollover=True, smooth=True):
|
|||
sign_delay = config["signatures-validity"] - config["signatures-refresh"]
|
||||
safety_interval = config["retire-safety"]
|
||||
|
||||
iretKSK = timedelta(0)
|
||||
iret_ksk = timedelta(0)
|
||||
if ksk:
|
||||
# KSK: Double-KSK Method: Iret = DprpP + TTLds
|
||||
iretKSK = (
|
||||
iret_ksk = (
|
||||
config["parent-propagation-delay"] + config["ds-ttl"] + safety_interval
|
||||
)
|
||||
|
||||
iretZSK = timedelta(0)
|
||||
iret_zsk = timedelta(0)
|
||||
if zsk:
|
||||
# ZSK: Pre-Publication Method: Iret = Dsgn + Dprp + TTLsig
|
||||
iretZSK = (
|
||||
iret_zsk = (
|
||||
sign_delay
|
||||
+ config["zone-propagation-delay"]
|
||||
+ config["max-zone-ttl"]
|
||||
+ safety_interval
|
||||
)
|
||||
|
||||
return max(iretKSK, iretZSK)
|
||||
return max(iret_ksk, iret_zsk)
|
||||
|
||||
|
||||
@total_ordering
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import dns.rcode
|
|||
import isctest
|
||||
|
||||
# ISO datetime format without msec
|
||||
fmt = "%Y-%m-%dT%H:%M:%SZ"
|
||||
FMT = "%Y-%m-%dT%H:%M:%SZ"
|
||||
|
||||
# The constants were taken from BIND 9 source code (lib/dns/zone.c)
|
||||
max_refresh = timedelta(seconds=2419200) # 4 weeks
|
||||
|
|
@ -29,7 +29,7 @@ max_expires = timedelta(seconds=14515200) # 24 weeks
|
|||
dayzero = datetime.utcfromtimestamp(0).replace(microsecond=0)
|
||||
|
||||
# Wait for the secondary zone files to appear to extract their mtime
|
||||
max_secondary_zone_waittime_sec = 5
|
||||
MAX_SECONDARY_ZONE_WAITTIME_SEC = 5
|
||||
|
||||
|
||||
# Generic helper functions
|
||||
|
|
@ -45,7 +45,7 @@ def check_refresh(refresh, min_time, max_time):
|
|||
|
||||
def check_loaded(loaded, expected, now):
|
||||
# Sanity check the zone timers values
|
||||
assert (loaded - expected).total_seconds() < max_secondary_zone_waittime_sec
|
||||
assert (loaded - expected).total_seconds() < MAX_SECONDARY_ZONE_WAITTIME_SEC
|
||||
assert loaded <= now
|
||||
|
||||
|
||||
|
|
@ -97,7 +97,7 @@ def test_zone_timers_secondary(fetch_zones, load_timers, **kwargs):
|
|||
zonedir = kwargs["zonedir"]
|
||||
|
||||
# If any one of the zone files isn't ready, then retry until timeout.
|
||||
tries = max_secondary_zone_waittime_sec
|
||||
tries = MAX_SECONDARY_ZONE_WAITTIME_SEC
|
||||
while tries >= 0:
|
||||
zones = fetch_zones(statsip, statsport)
|
||||
again = False
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ def load_timers_json(zone, primary=True):
|
|||
|
||||
# Check if the primary zone timer exists
|
||||
assert "loaded" in zone
|
||||
loaded = datetime.strptime(zone["loaded"], generic.fmt)
|
||||
loaded = datetime.strptime(zone["loaded"], generic.FMT)
|
||||
|
||||
if primary:
|
||||
# Check if the secondary zone timers does not exist
|
||||
|
|
@ -78,8 +78,8 @@ def load_timers_json(zone, primary=True):
|
|||
else:
|
||||
assert "expires" in zone
|
||||
assert "refresh" in zone
|
||||
expires = datetime.strptime(zone["expires"], generic.fmt)
|
||||
refresh = datetime.strptime(zone["refresh"], generic.fmt)
|
||||
expires = datetime.strptime(zone["expires"], generic.FMT)
|
||||
refresh = datetime.strptime(zone["refresh"], generic.FMT)
|
||||
|
||||
return (name, loaded, expires, refresh)
|
||||
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ def load_timers_xml(zone, primary=True):
|
|||
|
||||
loaded_el = zone.find("loaded")
|
||||
assert loaded_el is not None
|
||||
loaded = datetime.strptime(loaded_el.text, generic.fmt)
|
||||
loaded = datetime.strptime(loaded_el.text, generic.FMT)
|
||||
|
||||
expires_el = zone.find("expires")
|
||||
refresh_el = zone.find("refresh")
|
||||
|
|
@ -107,8 +107,8 @@ def load_timers_xml(zone, primary=True):
|
|||
else:
|
||||
assert expires_el is not None
|
||||
assert refresh_el is not None
|
||||
expires = datetime.strptime(expires_el.text, generic.fmt)
|
||||
refresh = datetime.strptime(refresh_el.text, generic.fmt)
|
||||
expires = datetime.strptime(expires_el.text, generic.FMT)
|
||||
refresh = datetime.strptime(refresh_el.text, generic.FMT)
|
||||
|
||||
return (name, loaded, expires, refresh)
|
||||
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@
|
|||
# Set up test data for zone transfer quota tests.
|
||||
#
|
||||
|
||||
zones = 300
|
||||
ZONES = 300
|
||||
|
||||
for z in range(zones):
|
||||
for z in range(ZONES):
|
||||
zn = f"zone{z:06d}.example"
|
||||
with open(f"ns1/{zn}.db", "w", encoding="utf-8") as f:
|
||||
f.write("""$TTL 300
|
||||
|
|
@ -35,7 +35,7 @@ xyzzy A 10.0.0.2
|
|||
with open("ns1/zones.conf", "w", encoding="utf-8") as priconf, open(
|
||||
"ns2/zones.conf", "w", encoding="utf-8"
|
||||
) as secconf:
|
||||
for z in range(zones):
|
||||
for z in range(ZONES):
|
||||
zn = f"zone{z:06d}.example"
|
||||
priconf.write(f'zone "{zn}" {{ type primary; file "{zn}.db"; }};\n')
|
||||
secconf.write(
|
||||
|
|
|
|||
|
|
@ -9,13 +9,18 @@
|
|||
# See the COPYRIGHT file distributed with this work for additional
|
||||
# information regarding copyright ownership.
|
||||
|
||||
[tool.pylint.basic]
|
||||
good-names-rgxs = [
|
||||
# Allow names from KASP tests
|
||||
"I(pub|ret)C?",
|
||||
"T(act|pub|ret|rem|sbm)N1?",
|
||||
]
|
||||
[tool.pylint.imports]
|
||||
deprecated-modules = [
|
||||
"dns.resolver",
|
||||
]
|
||||
[tool.pylint.messages_control]
|
||||
disable = [
|
||||
"C0103", # invalid-name
|
||||
"C0114", # missing-module-docstring
|
||||
"C0115", # missing-class-docstring
|
||||
"C0116", # missing-function-docstring
|
||||
|
|
|
|||
Loading…
Reference in a new issue