s4: add blackbox test for the demote function
[Samba/id10ts.git] / source4 / utils / tests / test_demote.sh
blob3b2b7d2d0ea9db76b828720a4846669b98f02098
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 DC=$6
10 PROV=$7
11 shift 7
13 failed=0
15 samba4bindir="$BINDIR"
16 smbclient="$samba4bindir/smbclient$EXEEXT"
17 samba_tool="$samba4bindir/samba-tool$EXEEXT"
19 testit() {
20 name="$1"
21 shift
22 cmdline="$*"
23 echo "test: $name"
24 $cmdline
25 status=$?
26 if [ x$status = x0 ]; then
27 echo "success: $name"
28 else
29 echo "failure: $name"
30 failed=`expr $failed + 1`
32 return $status
36 testit "demote" $VALGRIND $samba_tool domain demote --server $DC -s $PROV/etc/smb.conf -W "$DOMAIN" -U"$USERNAME%$PASSWORD"
38 exit $failed