5 Usage: demote-saveddb.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
=$
(system_or_builddir_binary tdbrestore
"${BINDIR}")
22 # The undump script and the provision data is not part of release tarballs,
23 # skip the tests in this case!
24 samba_undump
="$SRCDIR_ABS/source4/selftest/provisions/undump.sh"
25 if [ ! -x $samba_undump ] ||
[ ! -d $samba_tree_dir ]; then
26 subunit_start_test
"undump"
27 subunit_skip_test
"undump" <<EOF
30 subunit_start_test
"undump"
31 subunit_skip_test
"undump" <<EOF
32 Skipping tests - no provision!
35 subunit_start_test
"demote-q-0-0"
36 subunit_skip_test
"demote-q-0-0" <<EOF
37 Skipping tests - no provision!
39 subunit_start_test
"demote-q-0-1"
40 subunit_skip_test
"demote-q-0-1" <<EOF
41 Skipping tests - no provision!
43 subunit_start_test
"demote-q-1-0"
44 subunit_skip_test
"demote-q-1-0" <<EOF
45 Skipping tests - no provision!
47 subunit_start_test
"demote-q-1-1"
48 subunit_skip_test
"demote-q-1-1" <<EOF
49 Skipping tests - no provision!
57 $SRCDIR_ABS/source4/selftest
/provisions
/undump.sh
$samba_tree_dir $PREFIX_ABS $samba_tdbrestore
62 $PYTHON $BINDIR/samba-tool domain demote
-H tdb
://$PREFIX_ABS/private
/sam.ldb
--remove-other-dead-server=$1
65 remove_directory
$PREFIX_ABS
67 testit
"undump" undump || failed
=$
(expr $failed + 1)
68 testit
"demote-q-0-0" demote
"q-0-0" || failed
=$
(expr $failed + 1)
69 # The database was copied of q-0-1 so this will fail
70 # as we can't remove our own name
71 testit_expect_failure
"demote-q-0-1" demote
"q-0-1" || failed
=$
(expr $failed + 1)
72 testit
"demote-q-1-0" demote
"q-1-0" || failed
=$
(expr $failed + 1)
73 testit
"demote-q-1-1" demote
"q-1-1" || failed
=$
(expr $failed + 1)
75 remove_directory
$PREFIX_ABS