From: Andreas Schneider Date: Tue, 20 Oct 2020 18:47:43 +0000 (+0200) Subject: testprogs: Fix and improve demote-saveddb test X-Git-Tag: talloc-2.3.2~192 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e58ccdaa1a1e5943aa02ecba88d1de0323777041;p=thirdparty%2Fsamba.git testprogs: Fix and improve demote-saveddb test This fixes running `make test` in a release tarball! BUG: https://bugzilla.samba.org/show_bug.cgi?id=14542 Signed-off-by: Andreas Schneider Reviewed-by: Alexander Bokovoy --- diff --git a/testprogs/blackbox/demote-saveddb.sh b/testprogs/blackbox/demote-saveddb.sh index 3d5fabd72e3..d8fccf32011 100755 --- a/testprogs/blackbox/demote-saveddb.sh +++ b/testprogs/blackbox/demote-saveddb.sh @@ -10,58 +10,69 @@ fi PREFIX_ABS="$1" shift 1 -. `dirname $0`/subunit.sh +failed=0 -tree_dir=`dirname $0`/../../source4/selftest/provisions/multi-dc-samba-master-c596ac6 +. `dirname $0`/subunit.sh +. `dirname $0`/common_test_fns.inc -undump() { - if test -x $BINDIR/tdbrestore; - then - `dirname $0`/../../source4/selftest/provisions/undump.sh $tree_dir $PREFIX_ABS $BINDIR/tdbrestore - else - `dirname $0`/../../source4/selftest/provisions/undump.sh $tree_dir $PREFIX_ABS - fi -} +samba_tree_dir="$SRCDIR_ABS/source4/selftest/provisions/multi-dc-samba-master-c596ac6" -demote() { - $PYTHON $BINDIR/samba-tool domain demote -H tdb://$PREFIX_ABS/private/sam.ldb --remove-other-dead-server=$1 -} +samba_tdbrestore="tdbrestore" +if [ -x $BINDIR/tdbrestore ]; then + samba_tdbrestore="$BINDIR/tdbrestore" +fi +# The undump script and the provision data is not part of release tarballs, +# skip the tests in this case! +samba_undump="$SRCDIR_ABS/source4/selftest/provisions/undump.sh" +if [ ! -x $samba_undump ] || [ ! -d $samba_tree_dir ]; then + subunit_start_test "undump" + subunit_skip_test "undump" <