+++ /dev/null
-#!/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
-
-if ! ${PERL} -MNet::DNS -e ''; then
- echo_i "perl Net::DNS module is required"
- exit 1
-fi
-
-exit 0
import pytest
-pytestmark = pytest.mark.extra_artifacts(
+import isctest.mark
+
+EXTRA_ARTIFACTS = pytest.mark.extra_artifacts(
[
"dig.out.*",
"wait_for_message.*",
]
)
+pytestmark = [
+ isctest.mark.requires_net_dns,
+ EXTRA_ARTIFACTS,
+]
+
def test_fetchlimit(run_tests_sh):
run_tests_sh()
import platform
import shutil
import socket
+import subprocess
import pytest
)
+def _perl_module_available(module: str) -> bool:
+ perl = os.environ.get("PERL", "perl")
+ try:
+ subprocess.run(
+ [perl, f"-M{module}", "-e", ""],
+ check=True,
+ stdout=subprocess.DEVNULL,
+ stderr=subprocess.DEVNULL,
+ )
+ except (subprocess.CalledProcessError, FileNotFoundError):
+ return False
+ return True
+
+
+requires_net_dns = pytest.mark.skipif(
+ not _perl_module_available("Net::DNS"),
+ reason="Perl Net::DNS module is required",
+)
+
+requires_net_dns_nameserver = pytest.mark.skipif(
+ not _perl_module_available("Net::DNS::Nameserver"),
+ reason="Perl Net::DNS::Nameserver module is required",
+)
+
+requires_time_hires = pytest.mark.skipif(
+ not _perl_module_available("Time::HiRes"),
+ reason="Perl Time::HiRes module is required",
+)
+
+
def is_host_freebsd(*_):
return platform.system() == "FreeBSD"
+++ /dev/null
-#!/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
-
-if ! ${PERL} -MNet::DNS -e ''; then
- echo_i "perl Net::DNS module is required"
- exit 1
-fi
-
-exit 0
import pytest
-pytestmark = pytest.mark.extra_artifacts(
+import isctest.mark
+
+EXTRA_ARTIFACTS = pytest.mark.extra_artifacts(
[
"Kxxx*",
"dig.out.*",
]
)
+pytestmark = [
+ isctest.mark.requires_net_dns,
+ EXTRA_ARTIFACTS,
+]
+
MAX_RUNS = 2 if platform.system() == "FreeBSD" else 1 # GL#3846
+++ /dev/null
-#!/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
-
-if ! ${PERL} -MNet::DNS -e ''; then
- echo_i "perl Net::DNS module is required"
- exit 1
-fi
-
-if ! ${PERL} -MNet::DNS::Nameserver -e ''; then
- echo_i "perl Net::DNS::Nameserver module is required"
- exit 1
-fi
-
-exit 0
import pytest
-pytestmark = pytest.mark.extra_artifacts(
+import isctest.mark
+
+EXTRA_ARTIFACTS = pytest.mark.extra_artifacts(
[
"dig.out.*",
"dsset-signed.",
]
)
+pytestmark = [
+ isctest.mark.requires_net_dns,
+ isctest.mark.requires_net_dns_nameserver,
+ EXTRA_ARTIFACTS,
+]
+
# The reclimit is known to be quite unstable. GL #1587
@pytest.mark.flaky(max_runs=2)
+++ /dev/null
-#!/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
-
-if ! ${PERL} -MTime::HiRes -e ''; then
- echo_i "perl Time::HiRes module is required"
- exit 1
-fi
-
-exit 0
import pytest
-pytestmark = pytest.mark.extra_artifacts(
+import isctest.mark
+
+EXTRA_ARTIFACTS = pytest.mark.extra_artifacts(
[
"dig.out.*",
"expired.test*",
]
)
+pytestmark = [
+ isctest.mark.requires_net_dns,
+ isctest.mark.requires_time_hires,
+ EXTRA_ARTIFACTS,
+]
+
@pytest.mark.flaky(max_runs=2)
def test_serve_stale(run_tests_sh):