pidl:Wireshark Fix the type of array of pointerse to hf_ values
[Samba.git] / testprogs / blackbox / test_special_group.sh
blobf0e86985cf6def6e6b2a470c4d1acdec54a0039c
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=$(system_or_builddir_binary tdbrestore "${BINDIR}")
23 samba_undump="$SRCDIR_ABS/source4/selftest/provisions/undump.sh"
24 if [ ! -x "${samba_undump}" ]; then
25 subunit_start_test "special group"
26 subunit_skip_test "special group" <<EOF
27 Skipping tests - undump.sh is not available in release tarballs
28 EOF
29 exit 0
32 cleanup_output_directories()
34 remove_directory $PREFIX_ABS/$OLD_RELEASE
37 undump_old()
39 $samba_undump $old_release_dir $PREFIX_ABS/$OLD_RELEASE $samba_tdbrestore
42 add_special_group()
44 $PYTHON $BINDIR/samba-tool group add 'protected users' --special -H tdb://$PREFIX_ABS/$OLD_RELEASE/private/sam.ldb
47 # double-check we cleaned up from the last test run
48 cleanup_output_directories
50 testit $OLD_RELEASE undump_old || failed=$(expr $failed + 1)
52 testit "add_special_group" add_special_group || failed=$(expr $failed + 1)
54 testit_expect_failure_grep "add_duplicate_special_group" "Failed to add group.*already exists" add_special_group || failed=$(expr $failed + 1)
56 cleanup_output_directories
58 testok $0 $failed