xref: /netbsd-src/external/mpl/bind/dist/bin/tests/system/chain/prereq.sh (revision a04395531661c5e8d314125d5ae77d4cbedd5d73)
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
12SYSTEMTESTTOP=..
13. $SYSTEMTESTTOP/conf.sh
14
15if test -n "$PYTHON"
16then
17    if $PYTHON -c "import dns" 2> /dev/null
18    then
19        :
20    else
21        echo_i "This test requires the dnspython module." >&2
22        exit 1
23    fi
24else
25    echo_i "This test requires Python and the dnspython module." >&2
26    exit 1
27fi
28
29if $PERL -e 'use Net::DNS;' 2>/dev/null
30then
31    if $PERL -e 'use Net::DNS; die if ($Net::DNS::VERSION >= 0.69 && $Net::DNS::VERSION <= 0.74);' 2>/dev/null
32    then
33        :
34    else
35        echo_i "Net::DNS versions 0.69 to 0.74 have bugs that cause this test to fail: please update." >&2
36        exit 1
37    fi
38else
39    echo_i "This test requires the perl Net::DNS library." >&2
40    exit 1
41fi
42if $PERL -e 'use Net::DNS::Nameserver;' 2>/dev/null
43then
44	:
45else
46    echo_i "This test requires the Net::DNS::Nameserver library." >&2
47    exit 1
48fi
49