s4 dns: Update prerequisite checking conforming to RFC
[Samba/gebeck_regimport.git] / source4 / utils / tests / test_samba_tool.sh
blobfb8e3e092ff1d63f2a782c680aaf5f98c1fbccdb
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 shift 5
11 failed=0
13 samba4bindir="$BINDIR"
14 smbclient="$samba4bindir/smbclient$EXEEXT"
15 samba_tool="$samba4bindir/samba-tool$EXEEXT"
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 exit $failed