mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Run custom servers as Python modules
Use `python -m` for running the custom servers. This allows the use of relative imports in the server modules and in turn linting the modules.
This commit is contained in:
parent
b3d13387f6
commit
407df9599c
12 changed files with 17 additions and 12 deletions
|
|
@ -22,7 +22,7 @@ from isctest.asyncserver import (
|
|||
ResponseAction,
|
||||
)
|
||||
|
||||
from bailiwick_ans import ResponseSpoofer, spoofing_server
|
||||
from ..bailiwick_ans import ResponseSpoofer, spoofing_server
|
||||
|
||||
ATTACKER_IP = "10.53.0.3"
|
||||
TTL = 3600
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ from isctest.asyncserver import (
|
|||
ResponseAction,
|
||||
)
|
||||
|
||||
from bailiwick_ans import ResponseSpoofer, spoofing_server
|
||||
from ..bailiwick_ans import ResponseSpoofer, spoofing_server
|
||||
|
||||
ATTACKER_IP = "10.53.0.3"
|
||||
TTL = 3600
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
# See the COPYRIGHT file distributed with this work for additional
|
||||
# information regarding copyright ownership.
|
||||
|
||||
from cookie_ans import cookie_server
|
||||
from ..cookie_ans import cookie_server
|
||||
|
||||
|
||||
def main() -> None:
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
# See the COPYRIGHT file distributed with this work for additional
|
||||
# information regarding copyright ownership.
|
||||
|
||||
from cookie_ans import cookie_server
|
||||
from ..cookie_ans import cookie_server
|
||||
|
||||
|
||||
def main() -> None:
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ from isctest.asyncserver import (
|
|||
ResponseAction,
|
||||
)
|
||||
|
||||
from qmin_ans import (
|
||||
from ..qmin_ans import (
|
||||
DelayedResponseHandler,
|
||||
EntRcodeChanger,
|
||||
QueryLogHandler,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import dns.rcode
|
|||
|
||||
from isctest.asyncserver import AsyncDnsServer
|
||||
|
||||
from qmin_ans import DelayedResponseHandler, EntRcodeChanger, QueryLogHandler
|
||||
from ..qmin_ans import DelayedResponseHandler, EntRcodeChanger, QueryLogHandler
|
||||
|
||||
|
||||
class QueryLogger(QueryLogHandler):
|
||||
|
|
|
|||
|
|
@ -24,7 +24,12 @@ from isctest.asyncserver import (
|
|||
ResponseAction,
|
||||
)
|
||||
|
||||
from qmin_ans import DelayedResponseHandler, EntRcodeChanger, QueryLogHandler, log_query
|
||||
from ..qmin_ans import (
|
||||
DelayedResponseHandler,
|
||||
EntRcodeChanger,
|
||||
QueryLogHandler,
|
||||
log_query,
|
||||
)
|
||||
|
||||
|
||||
class QueryLogger(QueryLogHandler):
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ from isctest.asyncserver import (
|
|||
ResponseHandler,
|
||||
)
|
||||
|
||||
from resolver_ans import rrset, soa_rrset
|
||||
from ..resolver_ans import rrset, soa_rrset
|
||||
|
||||
|
||||
class EdnsWithOptionsFormerrHandler(ResponseHandler):
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ from isctest.asyncserver import (
|
|||
ResponseHandler,
|
||||
)
|
||||
|
||||
from resolver_ans import (
|
||||
from ..resolver_ans import (
|
||||
DelegationHandler,
|
||||
Gl6412AHandler,
|
||||
Gl6412Handler,
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ from isctest.asyncserver import (
|
|||
ResponseHandler,
|
||||
)
|
||||
|
||||
from resolver_ans import (
|
||||
from ..resolver_ans import (
|
||||
DelegationHandler,
|
||||
Gl6412AHandler,
|
||||
Gl6412Handler,
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ from isctest.asyncserver import (
|
|||
StaticResponseHandler,
|
||||
)
|
||||
|
||||
from resolver_ans import rrset
|
||||
from ..resolver_ans import rrset
|
||||
|
||||
|
||||
class HeaderOnlyHandler(ResponseHandler):
|
||||
|
|
|
|||
|
|
@ -325,7 +325,7 @@ sub construct_ans_command {
|
|||
|
||||
if (-e "$testdir/$server/ans.py") {
|
||||
$ENV{'PYTHONPATH'} = $testdir . ":" . $srcdir;
|
||||
$command = "$PYTHON -u ans.py 10.53.0.$n $queryport";
|
||||
$command = "$PYTHON -u -m $test.$server.ans 10.53.0.$n $queryport";
|
||||
} elsif (-e "$testdir/$server/ans.pl") {
|
||||
$command = "$PERL ans.pl";
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue