winbindd: as DC we should try to get the target_domain from @SOMETHING part of the...
[Samba.git] / testprogs / blackbox / demote-saveddb.sh
blob3d5fabd72e3659723551b40e42ccb252bb1a0b44
1 #!/bin/sh
3 if [ $# -lt 1 ]; then
4 cat <<EOF
5 Usage: demote.sh PREFIX RELEASE
6 EOF
7 exit 1;
8 fi
10 PREFIX_ABS="$1"
11 shift 1
13 . `dirname $0`/subunit.sh
15 tree_dir=`dirname $0`/../../source4/selftest/provisions/multi-dc-samba-master-c596ac6
17 undump() {
18 if test -x $BINDIR/tdbrestore;
19 then
20 `dirname $0`/../../source4/selftest/provisions/undump.sh $tree_dir $PREFIX_ABS $BINDIR/tdbrestore
21 else
22 `dirname $0`/../../source4/selftest/provisions/undump.sh $tree_dir $PREFIX_ABS
26 demote() {
27 $PYTHON $BINDIR/samba-tool domain demote -H tdb://$PREFIX_ABS/private/sam.ldb --remove-other-dead-server=$1
31 if [ -d $tree_dir ]; then
32 testit "undump" undump
33 testit "demote-q-0-0" demote "q-0-0"
34 # The database was copied of q-0-1 so this will fail
35 # as we can't remove our own name
36 testit_expect_failure "demote-q-0-1" demote "q-0-1"
37 testit "demote-q-1-0" demote "q-1-0"
38 testit "demote-q-1-1" demote "q-1-1"
39 else
40 subunit_start_test "undump"
41 subunit_skip_test "undump" <<EOF
42 no test provision
43 EOF
45 subunit_start_test "demote-q-0-0"
46 subunit_skip_test "demote-q-0-0" <<EOF
47 no test provision
48 EOF
49 subunit_start_test "demote-q-0-1"
50 subunit_skip_test "demote-q-0-1" <<EOF
51 no test provision
52 EOF
53 subunit_start_test "demote-q-1-1"
54 subunit_skip_test "demote-q-0-1" <<EOF
55 no test provision
56 EOF
57 subunit_start_test "demote-q-1-1"
58 subunit_skip_test "demote-q-1-1" <<EOF
59 no test provision
60 EOF
63 if [ -d $PREFIX_ABS ]; then
64 rm -fr $PREFIX_ABS
67 exit $failed