s4:testprogs Operate the blackbox kinit and net tests using the :local config
[ira/wip.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="$BUILDDIR/bin"
13 smbclient="$samba4bindir/smbclient$EXEEXT"
14 net="$samba4bindir/net$EXEEXT"
15
16 testit() {
17         name="$1"
18         shift
19         cmdline="$*"
20         echo "test: $name"
21         $cmdline
22         status=$?
23         if [ x$status = x0 ]; then
24                 echo "success: $name"
25         else
26                 echo "failure: $name"
27                 failed=`expr $failed + 1`
28         fi
29         return $status
30 }
31
32 testit "Test login with --machine-pass without kerberos" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --machine-pass -k no
33
34 testit "Test login with --machine-pass and kerberos" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --machine-pass -k yes
35
36 testit "time" $VALGRIND $net time $SERVER $CONFIGURATION  -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@
37
38 # FIXME: testit "domainlevel.show" $VALGRIND $net domainlevel show $CONFIGURATION
39
40 exit $failed