Line | |
---|
1 | #!/bin/sh
|
---|
2 | # Blackbox tests for nmblookup
|
---|
3 |
|
---|
4 | NETBIOSNAME=$1
|
---|
5 | NETBIOSALIAS=$2
|
---|
6 | SERVER=$3
|
---|
7 | SERVER_IP=$4
|
---|
8 | shift 4
|
---|
9 | TORTURE_OPTIONS=$*
|
---|
10 |
|
---|
11 | failed=0
|
---|
12 |
|
---|
13 | testit() {
|
---|
14 | name="$1"
|
---|
15 | shift
|
---|
16 | cmdline="$*"
|
---|
17 | echo "test: $name"
|
---|
18 | $cmdline
|
---|
19 | status=$?
|
---|
20 | if [ x$status = x0 ]; then
|
---|
21 | echo "success: $name"
|
---|
22 | else
|
---|
23 | echo "failure: $name"
|
---|
24 | failed=`expr $failed + 1`
|
---|
25 | fi
|
---|
26 | return $status
|
---|
27 | }
|
---|
28 |
|
---|
29 | samba4bindir="$BUILDDIR/bin"
|
---|
30 | nmblookup="$samba4bindir/nmblookup$EXEEXT"
|
---|
31 |
|
---|
32 | testit "nmblookup -U \$SERVER_IP \$SERVER" $nmblookup $TORTURE_OPTIONS -U $SERVER_IP $SERVER
|
---|
33 | testit "nmblookup -U \$SERVER_IP \$NETBIOSNAME" $nmblookup $TORTURE_OPTIONS -U $SERVER_IP $NETBIOSNAME
|
---|
34 | testit "nmblookup -U \$SERVER_IP \$NETBIOSALIAS" $nmblookup $TORTURE_OPTIONS -U $SERVER_IP $NETBIOSALIAS
|
---|
35 | testit "nmblookup \$SERVER" $nmblookup $TORTURE_OPTIONS $SERVER
|
---|
36 | testit "nmblookup \$NETBIOSNAME" $nmblookup $TORTURE_OPTIONS $NETBIOSNAME
|
---|
37 | testit "nmblookup \$NETBIOSALIAS" $nmblookup $TORTURE_OPTIONS $NETBIOSALIAS
|
---|
38 |
|
---|
39 | exit $failed
|
---|
Note:
See
TracBrowser
for help on using the repository browser.