s3:torture:delete: simplify return code handling, fixing a couple of return codes...
[Samba.git] / source4 / setup / tests / blackbox_spn.sh
blob515a06e437e7d3f78f197b799a7c7a6e0cd21a8c
1 #!/bin/sh
3 if [ $# -lt 1 ]; then
4 cat <<EOF
5 Usage: blackbox_group.sh PREFIX
6 EOF
7 exit 1;
8 fi
10 PREFIX="$1"
11 shift 1
13 . `dirname $0`/../../../testprogs/blackbox/subunit.sh
16 samba_tool="./bin/samba-tool"
18 CONFIG="--configfile=$PREFIX/etc/smb.conf"
20 #creation of two test subjects
21 testit "addspn" $samba_tool spn add FOO/bar Administrator $CONFIG
22 testit "delspn" $samba_tool spn delete FOO/bar $CONFIG
23 testit "readdspn" $samba_tool spn add FOO/bar Administrator $CONFIG
24 testit_expect_failure "failexistingspn" $samba_tool spn add FOO/bar Guest $CONFIG
25 testit "existingspnforce" $samba_tool spn add --force FOO/bar Guest $CONFIG
26 testit_expect_failure "faildelspnnotgooduser" $samba_tool spn delete FOO/bar krbtgt $CONFIG
27 testit_expect_failure "faildelspnmoreoneuser" $samba_tool spn delete FOO/bar $CONFIG
28 testit "deluserspn" $samba_tool spn delete FOO/bar Guest $CONFIG
29 testit "dellastuserspn" $samba_tool spn delete FOO/bar $CONFIG
30 testit_expect_failure "faildelspn" $samba_tool spn delete FOO/bar $CONFIG
31 testit_expect_failure "failaddspn" $samba_tool spn add FOO/bar nonexistinguser $CONFIG
33 exit $failed