s4:rpc_server: remove unused dcesrv_connection_context->private_date
[samba.git] / testprogs / blackbox / demote-saveddb.sh
1 #!/bin/sh
2
3 if [ $# -lt 1 ]; then
4 cat <<EOF
5 Usage: demote.sh PREFIX RELEASE
6 EOF
7 exit 1;
8 fi
9
10 PREFIX_ABS="$1"
11 shift 1
12
13 . `dirname $0`/subunit.sh
14
15 tree_dir=`dirname $0`/../../source4/selftest/provisions/multi-dc-samba-master-c596ac6
16
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
23        fi
24 }
25
26 demote() {
27        $PYTHON $BINDIR/samba-tool domain demote -H tdb://$PREFIX_ABS/private/sam.ldb --remove-other-dead-server=$1
28 }
29
30
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
44
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
61 fi
62
63 if [ -d $PREFIX_ABS ]; then
64     rm -fr $PREFIX_ABS
65 fi
66
67 exit $failed