doc-xml/smbdotconf: fix server [min|max] protocol documentation
[Samba/gebeck_regimport.git] / source4 / utils / tests / test_nmblookup.sh
blob5e4fcfb406944a7c1889eb067adc5dbb053d140e
1 #!/bin/sh
2 # Blackbox tests for nmblookup
4 NETBIOSNAME=$1
5 NETBIOSALIAS=$2
6 SERVER=$3
7 SERVER_IP=$4
8 nmblookup=$5
9 shift 5
10 TORTURE_OPTIONS=$*
12 failed=0
14 testit() {
15 name="$1"
16 shift
17 cmdline="$*"
18 echo "test: $name"
19 $cmdline
20 status=$?
21 if [ x$status = x0 ]; then
22 echo "success: $name"
23 else
24 echo "failure: $name"
25 failed=`expr $failed + 1`
27 return $status
30 testit "nmblookup -U \$SERVER_IP \$SERVER" $nmblookup $TORTURE_OPTIONS -U $SERVER_IP $SERVER
31 testit "nmblookup -U \$SERVER_IP \$NETBIOSNAME" $nmblookup $TORTURE_OPTIONS -U $SERVER_IP $NETBIOSNAME
32 testit "nmblookup -U \$SERVER_IP \$NETBIOSALIAS" $nmblookup $TORTURE_OPTIONS -U $SERVER_IP $NETBIOSALIAS
33 testit "nmblookup \$SERVER" $nmblookup $TORTURE_OPTIONS $SERVER
34 testit "nmblookup \$NETBIOSNAME" $nmblookup $TORTURE_OPTIONS $NETBIOSNAME
35 testit "nmblookup \$NETBIOSALIAS" $nmblookup $TORTURE_OPTIONS $NETBIOSALIAS
37 exit $failed