From: Petr Špaček Date: Fri, 23 May 2025 15:37:19 +0000 (+0200) Subject: Use Pytest mark to guard dnstap features X-Git-Tag: v9.21.9~36^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=889b36016718bbb61167b46f9483113688b76c0d;p=thirdparty%2Fbind9.git Use Pytest mark to guard dnstap features --- diff --git a/bin/tests/system/dnstap/prereq.sh b/bin/tests/system/dnstap/prereq.sh deleted file mode 100644 index 747f4489828..00000000000 --- a/bin/tests/system/dnstap/prereq.sh +++ /dev/null @@ -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 diff --git a/bin/tests/system/dnstap/tests_dnstap.py b/bin/tests/system/dnstap/tests_dnstap.py index a5ff505c0f7..258d2b5f892 100644 --- a/bin/tests/system/dnstap/tests_dnstap.py +++ b/bin/tests/system/dnstap/tests_dnstap.py @@ -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): diff --git a/bin/tests/system/dnstap/tests_sh_dnstap.py b/bin/tests/system/dnstap/tests_sh_dnstap.py index 5d4d7a9e9e9..10d9a4111b2 100644 --- a/bin/tests/system/dnstap/tests_sh_dnstap.py +++ b/bin/tests/system/dnstap/tests_sh_dnstap.py @@ -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):