Use Pytest mark to guard dnstap features

(cherry picked from commit 889b360167)
This commit is contained in:
Petr Špaček 2025-05-23 17:37:19 +02:00
parent a6e16b76b2
commit 4650a1b065
3 changed files with 29 additions and 40 deletions

View file

@ -1,20 +0,0 @@
#!/bin/sh
# 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.
. ../conf.sh
$FEATURETEST --enable-dnstap || {
echo_i "This test requires dnstap support." >&2
exit 255
}
exit 0

View file

@ -15,19 +15,23 @@ import os
import re
import isctest
import isctest.mark
import pytest
import dns.message
pytest.importorskip("dns", minversion="2.0.0")
pytestmark = pytest.mark.extra_artifacts(
[
"dnstap.out.*",
"ns*/dnstap.out*",
"ns2/example.db",
]
)
pytestmark = [
isctest.mark.with_dnstap,
pytest.mark.extra_artifacts(
[
"dnstap.out.*",
"ns*/dnstap.out*",
"ns2/example.db",
]
),
]
def run_rndc(server, rndc_command):

View file

@ -11,19 +11,24 @@
import pytest
pytestmark = pytest.mark.extra_artifacts(
[
"dig.out*",
"dnstap.hex*",
"dnstap.out*",
"fstrm_capture.out.*",
"nsupdate.out*",
"ydump.out*",
"ns*/dnstap.out*",
"ns2/example.db",
"ns2/example.db.jnl",
]
)
import isctest.mark
pytestmark = [
isctest.mark.with_dnstap,
pytest.mark.extra_artifacts(
[
"dig.out*",
"dnstap.hex*",
"dnstap.out*",
"fstrm_capture.out.*",
"nsupdate.out*",
"ydump.out*",
"ns*/dnstap.out*",
"ns2/example.db",
"ns2/example.db.jnl",
]
),
]
def test_dnstap(run_tests_sh):