File: tests_include_multiplecfg.py

package info (click to toggle)
bind9 1%3A9.20.18-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 43,380 kB
  • sloc: ansic: 315,561; sh: 50,116; python: 23,452; perl: 3,734; makefile: 2,247
file content (39 lines) | stat: -rw-r--r-- 1,133 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# 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 os

import dns.rrset
import pytest

import isctest


@pytest.mark.parametrize(
    "qname",
    [
        "zone1.com.",  # glob include of zone1 config
        "zone2.com.",  # glob include of zone2 config
        "mars.com.",  # checking include of standard file path config
    ],
)
def test_include_multiplecfg(qname):
    msg = isctest.query.create(qname, "A")
    res = isctest.query.tcp(msg, "10.53.0.2")

    isctest.check.noerror(res)

    assert res.answer[0] == dns.rrset.from_text(qname, 86400, "IN", "A", "10.53.0.1")


def test_include_multiplecfg_checkconf():
    """Test that named-checkconf correctly parses glob includes"""
    isctest.run.cmd([os.environ["CHECKCONF"], "named.conf"], cwd="ns2")