Move blackbox.smbclient to test against the member server.
[kai/samba-autobuild/.git] / source4 / utils / tests / test_net.sh
1 #!/bin/sh
2 # Blackbox tests for net
3
4 SERVER=$1
5 USERNAME=$2
6 PASSWORD=$3
7 DOMAIN=$4
8 shift 4
9
10 failed=0
11
12 samba4bindir=`dirname $0`/../../bin
13 smbclient=$samba4bindir/smbclient
14
15 testit() {
16         name="$1"
17         shift
18         cmdline="$*"
19         echo "test: $name"
20         $cmdline
21         status=$?
22         if [ x$status = x0 ]; then
23                 echo "success: $name"
24         else
25                 echo "failure: $name"
26                 failed=`expr $failed + 1`
27         fi
28         return $status
29 }
30
31 testit "domain join" $VALGRIND bin/net join $DOMAIN $CONFIGURATION  -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ || failed=`expr $failed + 1`
32
33 testit "Test login with --machine-pass without kerberos" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --machine-pass -k no || failed=`expr $failed + 1`
34
35 testit "Test login with --machine-pass and kerberos" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --machine-pass -k yes || failed=`expr $failed + 1`
36
37 exit $failed
38
39