2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-10 11:35:24 +00:00
Files
bind/bin/tests/system/hooks/tests_hooks.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
968 B
Python
Raw Normal View History

Corrected several system test issues - serve-stale: dig wasn't always running in background when it should. some of the serve-stale test cases are based on groups of dig calls running simultaneously in the background: the test pauses and resumes running after 'wait'. in some cases the final call to dig in a group wasn't in the background, and this sometimes caused delays that affected later test results. in another case, a test was simplified and made more reliable by running dig in the foreground removing a sleep. - serve-stale: The extension of the dig timeout period from 10 to 11 seconds in commit 5307bf64ce80 was left undone in a few places and has now been completed. - serve-stale: Resolver-query-timeout was set incorrectly. a comment above a test case in serve-stale/tests.sh says: "We configured a long value of 30 seconds for resolver-query-timeout," but resolver-query-timeout was actually set to 10, not 30. this is now fixed. - rpz: Force retransfer of the fast-expire zone, to ensure it's fully loaded in ns3; previously it could have been left unloaded if ns5 wasn't up yet when ns3 attempted the zone transfer. - statistics: The TCP4SendErr counter is incremented when a TCP dispatch is canceled while sending. depending on test timing, this may have happened by the time the statistics are dumped. worked around by ignoring that stat couunter when checking for errors. - hooks: Add a prereq.sh script to prevent running under TSAN. - zero: Disabled the servfail cache so that SERVFAIL is reported only when there actually is a failure, not repeatedly every time the same query is sent.
2021-09-24 15:45:57 -07:00
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
Corrected several system test issues - serve-stale: dig wasn't always running in background when it should. some of the serve-stale test cases are based on groups of dig calls running simultaneously in the background: the test pauses and resumes running after 'wait'. in some cases the final call to dig in a group wasn't in the background, and this sometimes caused delays that affected later test results. in another case, a test was simplified and made more reliable by running dig in the foreground removing a sleep. - serve-stale: The extension of the dig timeout period from 10 to 11 seconds in commit 5307bf64ce80 was left undone in a few places and has now been completed. - serve-stale: Resolver-query-timeout was set incorrectly. a comment above a test case in serve-stale/tests.sh says: "We configured a long value of 30 seconds for resolver-query-timeout," but resolver-query-timeout was actually set to 10, not 30. this is now fixed. - rpz: Force retransfer of the fast-expire zone, to ensure it's fully loaded in ns3; previously it could have been left unloaded if ns5 wasn't up yet when ns3 attempted the zone transfer. - statistics: The TCP4SendErr counter is incremented when a TCP dispatch is canceled while sending. depending on test timing, this may have happened by the time the statistics are dumped. worked around by ignoring that stat couunter when checking for errors. - hooks: Add a prereq.sh script to prevent running under TSAN. - zero: Disabled the servfail cache so that SERVFAIL is reported only when there actually is a failure, not repeatedly every time the same query is sent.
2021-09-24 15:45:57 -07:00
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import pytest
import isctest
pytest.importorskip("dns")
import dns.message
Corrected several system test issues - serve-stale: dig wasn't always running in background when it should. some of the serve-stale test cases are based on groups of dig calls running simultaneously in the background: the test pauses and resumes running after 'wait'. in some cases the final call to dig in a group wasn't in the background, and this sometimes caused delays that affected later test results. in another case, a test was simplified and made more reliable by running dig in the foreground removing a sleep. - serve-stale: The extension of the dig timeout period from 10 to 11 seconds in commit 5307bf64ce80 was left undone in a few places and has now been completed. - serve-stale: Resolver-query-timeout was set incorrectly. a comment above a test case in serve-stale/tests.sh says: "We configured a long value of 30 seconds for resolver-query-timeout," but resolver-query-timeout was actually set to 10, not 30. this is now fixed. - rpz: Force retransfer of the fast-expire zone, to ensure it's fully loaded in ns3; previously it could have been left unloaded if ns5 wasn't up yet when ns3 attempted the zone transfer. - statistics: The TCP4SendErr counter is incremented when a TCP dispatch is canceled while sending. depending on test timing, this may have happened by the time the statistics are dumped. worked around by ignoring that stat couunter when checking for errors. - hooks: Add a prereq.sh script to prevent running under TSAN. - zero: Disabled the servfail cache so that SERVFAIL is reported only when there actually is a failure, not repeatedly every time the same query is sent.
2021-09-24 15:45:57 -07:00
def test_hooks():
msg = dns.message.make_query("example.com.", "A")
res = isctest.query.udp(msg, "10.53.0.1")
# the test-async plugin changes the status of any positive answer to NOTIMP
isctest.check.notimp(res)
def test_hooks_noextension(ns1, templates):
templates.render("ns1/named.conf", {"noextension": True})
with ns1.watch_log_from_here() as watcher:
ns1.rndc("reload")
watcher.wait_for_line("all zones loaded")
test_hooks()