selftest: Add test of smbclient --machine-pass against and using both s3 and s4
[kai/samba.git] / source4 / utils / tests / test_smbclient.sh
1 #!/bin/sh
2 # Blackbox tests for smbclient
3
4 SERVER=$1
5 SERVER_IP=$2
6 USERNAME=$3
7 PASSWORD=$4
8 DOMAIN=$5
9 smbclient=$6
10 shift 6
11
12 failed=0
13
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`
26         fi
27         return $status
28 }
29
30 testit "Test login with --machine-pass without kerberos" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --machine-pass -k no
31
32 testit "Test login with --machine-pass and kerberos" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --machine-pass -k yes
33
34 exit $failed