1 #!/usr/bin/python3 2 3 # Copyright (C) Internet Systems Consortium, Inc. ("ISC") 4 # 5 # SPDX-License-Identifier: MPL-2.0 6 # 7 # This Source Code Form is subject to the terms of the Mozilla Public 8 # License, v. 2.0. If a copy of the MPL was not distributed with this 9 # file, you can obtain one at https://mozilla.org/MPL/2.0/. 10 # 11 # See the COPYRIGHT file distributed with this work for additional 12 # information regarding copyright ownership. 13 14 import pytest 15 import isctest 16 17 # isctest.asyncserver requires dnspython >= 2.0.0 18 pytest.importorskip("dns", minversion="2.0.0") 19 20 import dns.message 21 22 pytestmark = pytest.mark.extra_artifacts( 23 [ 24 "ans*/ans.run", 25 ] 26 ) 27 28 29 def test_connreset(): 30 msg = dns.message.make_query( 31 "sub.example.", "A", want_dnssec=True, use_edns=0, payload=1232 32 ) 33 res = isctest.query.udp(msg, "10.53.0.2") 34 isctest.check.servfail(res) 35