tests: Rename python/samba/tests/libsmb.py
[Samba.git] / testprogs / blackbox / test_special_group.sh
blob00b5dde5670bb8cfd3dbc2ca593f297ae7144176
1 #!/bin/sh
3 if [ $# -lt 1 ]; then
4 cat <<EOF
5 Usage: $0 PREFIX
6 EOF
7 exit 1
8 fi
10 PREFIX_ABS="$1"
11 shift 1
13 failed=0
15 . $(dirname $0)/subunit.sh
16 . $(dirname $0)/common_test_fns.inc
18 OLD_RELEASE="release-4-5-0-pre1"
19 old_release_dir="$SRCDIR_ABS/source4/selftest/provisions/$OLD_RELEASE"
21 samba_tdbrestore="tdbrestore"
22 if [ -x "$BINDIR/tdbrestore" ]; then
23 samba_tdbrestore="$BINDIR/tdbrestore"
26 samba_undump="$SRCDIR_ABS/source4/selftest/provisions/undump.sh"
28 cleanup_output_directories()
30 remove_directory $PREFIX_ABS/$OLD_RELEASE
33 undump_old()
35 $samba_undump $old_release_dir $PREFIX_ABS/$OLD_RELEASE $samba_tdbrestore
38 add_special_group()
40 $PYTHON $BINDIR/samba-tool group add 'protected users' --special -H tdb://$PREFIX_ABS/$OLD_RELEASE/private/sam.ldb
43 # double-check we cleaned up from the last test run
44 cleanup_output_directories
46 testit $OLD_RELEASE undump_old || failed=$(expr $failed + 1)
48 testit "add_special_group" add_special_group || failed=$(expr $failed + 1)
50 testit_expect_failure_grep "add_duplicate_special_group" "Failed to add group.*already exists" add_special_group || failed=$(expr $failed + 1)
52 cleanup_output_directories
54 exit $failed