Home | History | Annotate | Line # | Download | only in database
      1      1.1  christos # Copyright (C) Internet Systems Consortium, Inc. ("ISC")
      2      1.1  christos #
      3      1.1  christos # SPDX-License-Identifier: MPL-2.0
      4      1.1  christos #
      5      1.1  christos # This Source Code Form is subject to the terms of the Mozilla Public
      6      1.1  christos # License, v. 2.0.  If a copy of the MPL was not distributed with this
      7      1.1  christos # file, you can obtain one at https://mozilla.org/MPL/2.0/.
      8      1.1  christos #
      9      1.1  christos # See the COPYRIGHT file distributed with this work for additional
     10      1.1  christos # information regarding copyright ownership.
     11      1.1  christos 
     12  1.1.1.3  christos import dns
     13      1.1  christos 
     14  1.1.1.3  christos import isctest
     15      1.1  christos 
     16      1.1  christos 
     17  1.1.1.3  christos def test_database(ns1, templates):
     18  1.1.1.3  christos     msg = isctest.query.create("database.", "SOA")
     19      1.1  christos 
     20      1.1  christos     # checking pre reload zone
     21      1.1  christos     res = isctest.query.tcp(msg, "10.53.0.1")
     22      1.1  christos     assert res.answer[0] == dns.rrset.from_text(
     23      1.1  christos         "database.",
     24      1.1  christos         86400,
     25      1.1  christos         "IN",
     26      1.1  christos         "SOA",
     27      1.1  christos         "localhost. hostmaster.isc.org. 0 28800 7200 604800 86400",
     28      1.1  christos     )
     29      1.1  christos 
     30      1.1  christos     templates.render("ns1/named.conf", {"rname": "marka.isc.org."})
     31  1.1.1.3  christos     with ns1.watch_log_from_here() as watcher:
     32  1.1.1.3  christos         ns1.rndc("reload")
     33  1.1.1.2  christos         watcher.wait_for_line("all zones loaded")
     34      1.1  christos 
     35      1.1  christos     # checking post reload zone
     36      1.1  christos     res = isctest.query.tcp(msg, "10.53.0.1")
     37      1.1  christos     assert res.answer[0] == dns.rrset.from_text(
     38      1.1  christos         "database.",
     39      1.1  christos         86400,
     40      1.1  christos         "IN",
     41      1.1  christos         "SOA",
     42      1.1  christos         "localhost. marka.isc.org. 0 28800 7200 604800 86400",
     43      1.1  christos     )
     44