mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-27 12:13:20 -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.
(cherry picked from commit 407df9599c)
This commit is contained in:
parent
68fb231294
commit
d7f6f258f7
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):
|
||||
|
|
|
|||
|
|
@ -30,7 +30,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 . ":" . $builddir;
|
||||
$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