Remove building with NOCRYPTO option
[minix.git] / external / bsd / bind / dist / bin / tests / system / run.sh
blob9e1e5c21205f512c0a5ea61a5036f61bbdbf0059
1 #!/bin/sh
3 # Copyright (C) 2004, 2007, 2010, 2012, 2014 Internet Systems Consortium, Inc. ("ISC")
4 # Copyright (C) 2000, 2001 Internet Software Consortium.
6 # Permission to use, copy, modify, and/or distribute this software for any
7 # purpose with or without fee is hereby granted, provided that the above
8 # copyright notice and this permission notice appear in all copies.
10 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
11 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
13 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 # PERFORMANCE OF THIS SOFTWARE.
19 # Run a system test.
22 SYSTEMTESTTOP=.
23 . $SYSTEMTESTTOP/conf.sh
25 stopservers=true
27 case $1 in
28 --keep) stopservers=false; shift ;;
29 esac
31 test $# -gt 0 || { echo "usage: $0 [--keep] test-directory" >&2; exit 1; }
33 test=$1
34 shift
36 test -d $test || { echo "$0: $test: no such test" >&2; exit 1; }
38 echo "S:$test:`date`" >&2
39 echo "T:$test:1:A" >&2
40 echo "A:System test $test" >&2
42 if [ x${PERL:+set} = x ]
43 then
44 echo "I:Perl not available. Skipping test." >&2
45 echo "R:UNTESTED" >&2
46 echo "E:$test:`date`" >&2
47 exit 0;
50 $PERL testsock.pl || {
51 echo "I:Network interface aliases not set up. Skipping test." >&2;
52 echo "R:UNTESTED" >&2;
53 echo "E:$test:`date`" >&2;
54 exit 0;
58 # Check for test-specific prerequisites.
59 test ! -f $test/prereq.sh || ( cd $test && $SHELL prereq.sh "$@" )
60 result=$?
62 if [ $result -eq 0 ]; then
63 : prereqs ok
64 else
65 echo "I:Prerequisites for $test missing, skipping test." >&2
66 [ $result -eq 255 ] && echo "R:SKIPPED" || echo "R:UNTESTED"
67 echo "E:$test:`date`" >&2
68 exit 0
71 # Check for PKCS#11 support
73 test ! -f $test/usepkcs11 || $SHELL cleanpkcs11.sh
74 then
75 : pkcs11 ok
76 else
77 echo "I:Need PKCS#11 for $test, skipping test." >&2
78 echo "R:PKCS11ONLY" >&2
79 echo "E:$test:`date`" >&2
80 exit 0
83 # Set up any dynamically generated test data
84 if test -f $test/setup.sh
85 then
86 ( cd $test && $SHELL setup.sh "$@" )
89 # Start name servers running
90 $PERL start.pl $test || exit 1
92 # Run the tests
93 ( cd $test ; $SHELL tests.sh )
95 status=$?
97 if $stopservers
98 then
100 else
101 exit $status
104 # Shutdown
105 $PERL stop.pl $test
107 status=`expr $status + $?`
109 if [ $status != 0 ]; then
110 echo "R:FAIL"
111 # Don't clean up - we need the evidence.
112 find . -name core -exec chmod 0644 '{}' \;
113 else
114 echo "R:PASS"
116 # Clean up.
117 rm -f $SYSTEMTESTTOP/random.data
118 if test -f $test/clean.sh
119 then
120 ( cd $test && $SHELL clean.sh "$@" )
124 echo "E:$test:`date`"
126 exit $status