Skip to content

Commit

Permalink
chg: test: Rewrite database system test to pytest
Browse files Browse the repository at this point in the history
Merge branch 'mnowak/pytest_rewrite_database' into 'main'

See merge request isc-projects/bind9!9156
  • Loading branch information
Mno-hime committed Nov 26, 2024
2 parents 0fa2807 + 8005ad0 commit 4869ebb
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 137 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ trust-anchors { };

zone "database" {
type primary;
database "_builtin empty localhost. hostmaster.isc.org.";
database "_builtin empty localhost. @rname | default('hostmaster.isc.org.')@";
};
43 changes: 0 additions & 43 deletions bin/tests/system/database/ns1/named2.conf.in

This file was deleted.

16 changes: 0 additions & 16 deletions bin/tests/system/database/setup.sh

This file was deleted.

55 changes: 0 additions & 55 deletions bin/tests/system/database/tests.sh

This file was deleted.

41 changes: 41 additions & 0 deletions bin/tests/system/database/tests_database.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 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 isctest

import dns.message


def test_database(servers, templates):
msg = dns.message.make_query("database.", "SOA")

# checking pre reload zone
res = isctest.query.tcp(msg, "10.53.0.1")
assert res.answer[0] == dns.rrset.from_text(
"database.",
86400,
"IN",
"SOA",
"localhost. hostmaster.isc.org. 0 28800 7200 604800 86400",
)

templates.render("ns1/named.conf", {"rname": "marka.isc.org."})
servers["ns1"].rndc("reload")

# checking post reload zone
res = isctest.query.tcp(msg, "10.53.0.1")
assert res.answer[0] == dns.rrset.from_text(
"database.",
86400,
"IN",
"SOA",
"localhost. marka.isc.org. 0 28800 7200 604800 86400",
)
22 changes: 0 additions & 22 deletions bin/tests/system/database/tests_sh_database.py

This file was deleted.

0 comments on commit 4869ebb

Please sign in to comment.