From b9b1366bf09a1da6e5449265cfde2b47f2620023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 2 Jul 2020 11:20:24 +0200 Subject: [PATCH] Add prereq.sh script to the shutdown system test The shutdown test requires python, pytest and dnspython. --- bin/tests/system/shutdown/prereq.sh | 36 +++++++++++++++++++++++++++++ util/copyrights | 1 + 2 files changed, 37 insertions(+) create mode 100755 bin/tests/system/shutdown/prereq.sh diff --git a/bin/tests/system/shutdown/prereq.sh b/bin/tests/system/shutdown/prereq.sh new file mode 100755 index 0000000000..23a16b5e6e --- /dev/null +++ b/bin/tests/system/shutdown/prereq.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# 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 http://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +SYSTEMTESTTOP=.. +. $SYSTEMTESTTOP/conf.sh + +if test -n "$PYTHON" +then + if $PYTHON -c "import pytest" 2> /dev/null + then + : + else + echo_i "This test requires the pytest framework." >&2 + fi + + if $PYTHON -c "import dns" 2> /dev/null + then + : + else + echo_i "This test requires the dnspython module." >&2 + exit 1 + fi +else + echo_i "This test requires Python, the pytest framework and the dnspython module." >&2 + exit 1 +fi + +exit 0 diff --git a/util/copyrights b/util/copyrights index b34f61d821..82276dd1cb 100644 --- a/util/copyrights +++ b/util/copyrights @@ -963,6 +963,7 @@ ./bin/tests/system/sfcache/tests.sh SH 2014,2016,2017,2018,2019,2020 ./bin/tests/system/shutdown/clean.sh SH 2020 ./bin/tests/system/shutdown/conftest.py PYTHON 2020 +./bin/tests/system/shutdown/prereq.sh SH 2020 ./bin/tests/system/shutdown/setup.sh SH 2020 ./bin/tests/system/shutdown/tests-shutdown.py PYTHON-BIN 2020 ./bin/tests/system/smartsign/clean.sh SH 2010,2012,2014,2016,2018,2019,2020