s3-selftest unconditionaly include subunit.sh
[kai/samba.git] / source3 / script / tests / test_net_misc.sh
1 #!/bin/sh
2
3 # various tests for the "net" command
4
5 if [ $# -lt 3 ]; then
6 cat <<EOF
7 Usage: test_net_misc.sh SCRIPTDIR SERVERCONFFILE CONFIGURATION
8 EOF
9 exit 1;
10 fi
11
12 SCRIPTDIR="$1"
13 SERVERCONFFILE="$2"
14 CONFIGURATION="$3"
15
16 NET="$VALGRIND ${NET:-$BINDIR/net} $CONFIGURATION"
17
18 NETTIME="${NET} time"
19 NETLOOKUP="${NET} lookup"
20
21 incdir=`dirname $0`/../../../testprogs/blackbox
22 . $incdir/subunit.sh
23
24 failed=0
25
26 test_time()
27 {
28         PARAM="$1"
29
30         ${NETTIME} -S ${SERVER} ${PARAM}
31 }
32
33 test_lookup()
34 {
35         PARAM="$1"
36
37         ${NETLOOKUP} ${PARAM}
38 }
39
40 testit "get the time" \
41         test_time || \
42         failed=`expr $failed + 1`
43
44 testit "get the system time" \
45         test_time system || \
46         failed=`expr $failed + 1`
47
48 testit "get the time zone" \
49         test_time zone || \
50         failed=`expr $failed + 1`
51
52 testit "lookup the PDC" \
53         test_lookup pdc || \
54         failed=`expr $failed + 1`
55
56 testit "lookup the master browser" \
57         test_lookup master || \
58         failed=`expr $failed + 1`
59
60 testok $0 $failed
61