xref: /netbsd-src/external/mpl/bind/dist/bin/tests/system/dnssec/prereq.sh (revision dd3ee07da436799d8de85f3055253118b76bf345)
1#!/bin/sh
2#
3# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
4#
5# This Source Code Form is subject to the terms of the Mozilla Public
6# License, v. 2.0. If a copy of the MPL was not distributed with this
7# file, you can obtain one at https://mozilla.org/MPL/2.0/.
8#
9# See the COPYRIGHT file distributed with this work for additional
10# information regarding copyright ownership.
11
12# shellcheck source=conf.sh
13. "$SYSTEMTESTTOP/conf.sh"
14
15set -e
16
17if test -n "$PYTHON"
18then
19    if $PYTHON -c "import dns" 2> /dev/null
20    then
21        :
22    else
23        echo_i "This test requires the dnspython module." >&2
24        exit 1
25    fi
26else
27    echo_i "This test requires Python and the dnspython module." >&2
28    exit 1
29fi
30
31if "$PERL" -e 'use Net::DNS;' 2>/dev/null
32then
33    # shellcheck disable=SC2016
34    if "$PERL" -e 'use Net::DNS; die if ($Net::DNS::VERSION >= 0.69 && $Net::DNS::VERSION <= 0.70);' 2>/dev/null
35    then
36        :
37    else
38        echo_i "Net::DNS versions 0.69 to 0.70 have bugs that cause this test to fail: please update." >&2
39        exit 1
40    fi
41fi
42
43exit 0
44