5 Usage: demote.sh PREFIX RELEASE
15 .
`dirname $0`/subunit.sh
16 .
`dirname $0`/common_test_fns.inc
18 samba_tree_dir
="$SRCDIR_ABS/source4/selftest/provisions/multi-dc-samba-master-c596ac6"
20 samba_tdbrestore
="tdbrestore"
21 if [ -x $BINDIR/tdbrestore
]; then
22 samba_tdbrestore
="$BINDIR/tdbrestore"
25 # The undump script and the provision data is not part of release tarballs,
26 # skip the tests in this case!
27 samba_undump
="$SRCDIR_ABS/source4/selftest/provisions/undump.sh"
28 if [ ! -x $samba_undump ] ||
[ ! -d $samba_tree_dir ]; then
29 subunit_start_test
"undump"
30 subunit_skip_test
"undump" <<EOF
33 subunit_start_test
"undump"
34 subunit_skip_test
"undump" <<EOF
35 Skipping tests - no provision!
38 subunit_start_test
"demote-q-0-0"
39 subunit_skip_test
"demote-q-0-0" <<EOF
40 Skipping tests - no provision!
42 subunit_start_test
"demote-q-0-1"
43 subunit_skip_test
"demote-q-0-1" <<EOF
44 Skipping tests - no provision!
46 subunit_start_test
"demote-q-1-0"
47 subunit_skip_test
"demote-q-1-0" <<EOF
48 Skipping tests - no provision!
50 subunit_start_test
"demote-q-1-1"
51 subunit_skip_test
"demote-q-1-1" <<EOF
52 Skipping tests - no provision!
59 $SRCDIR_ABS/source4/selftest
/provisions
/undump.sh
$samba_tree_dir $PREFIX_ABS $samba_tdbrestore
63 $PYTHON $BINDIR/samba-tool domain demote
-H tdb
://$PREFIX_ABS/private
/sam.ldb
--remove-other-dead-server=$1
66 remove_directory
$PREFIX_ABS
68 testit
"undump" undump || failed
=`expr $failed + 1`
69 testit
"demote-q-0-0" demote
"q-0-0" || failed
=`expr $failed + 1`
70 # The database was copied of q-0-1 so this will fail
71 # as we can't remove our own name
72 testit_expect_failure
"demote-q-0-1" demote
"q-0-1" || failed
=`expr $failed + 1`
73 testit
"demote-q-1-0" demote
"q-1-0" || failed
=`expr $failed + 1`
74 testit
"demote-q-1-1" demote
"q-1-1" || failed
=`expr $failed + 1`
76 remove_directory
$PREFIX_ABS