librpc: Shorten dcerpc_binding_handle_call a bit
[Samba/vl.git] / source4 / utils / tests / test_samba_tool.sh
blob289a753b6688becab4afffb450fe79ff2b165ea5
1 #!/bin/sh
2 # Blackbox tests for samba-tool
4 SERVER=$1
5 SERVER_IP=$2
6 USERNAME=$3
7 PASSWORD=$4
8 DOMAIN=$5
9 smbclient=$6
10 shift 6
12 failed=0
14 samba4bindir="$BINDIR"
15 samba_tool="$samba4bindir/samba-tool"
17 testit() {
18 name="$1"
19 shift
20 cmdline="$*"
21 echo "test: $name"
22 $cmdline
23 status=$?
24 if [ x$status = x0 ]; then
25 echo "success: $name"
26 else
27 echo "failure: $name"
28 failed=`expr $failed + 1`
30 return $status
33 testit "Test login with --machine-pass without kerberos" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --machine-pass -k no
35 testit "Test login with --machine-pass and kerberos" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --machine-pass -k yes
37 testit "time" $VALGRIND $samba_tool time $SERVER $CONFIGURATION -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@
39 testit "domain level.show" $VALGRIND $samba_tool domain level show
41 testit "domain info" $VALGRIND $samba_tool domain info $SERVER_IP
43 testit "fsmo show" $VALGRIND $samba_tool fsmo show
45 exit $failed