From: Andreas Schneider Date: Wed, 21 Oct 2020 15:35:34 +0000 (+0200) Subject: testprogs: Fix and improve runtime-links test X-Git-Tag: talloc-2.3.2~190 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a9765084f11eae991516f150d1cd1c2370854ec7;p=thirdparty%2Fsamba.git testprogs: Fix and improve runtime-links 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/common-links.sh b/testprogs/blackbox/common-links.sh index ee7310b5108..363234ae11c 100644 --- a/testprogs/blackbox/common-links.sh +++ b/testprogs/blackbox/common-links.sh @@ -1,4 +1,4 @@ -release_dir=`dirname $0`/../../source4/selftest/provisions/$RELEASE +release_dir=$SRCDIR_ABS/source4/selftest/provisions/$RELEASE ldbadd="ldbadd" if [ -x "$BINDIR/ldbadd" ]; then @@ -25,13 +25,15 @@ if [ -x "$BINDIR/ldbrename" ]; then ldbrename="$BINDIR/ldbrename" fi +samba_tdbrestore="tdbrestore" +if [ -x "$BINDIR/tdbrestore" ]; then + samba_tdbrestore="$BINDIR/tdbrestore" +fi + +samba_undump="$SRCDIR_ABS/source4/selftest/provisions/undump.sh" + undump() { - if test -x $BINDIR/tdbrestore; - then - `dirname $0`/../../source4/selftest/provisions/undump.sh $release_dir $PREFIX_ABS/$RELEASE $BINDIR/tdbrestore - else - `dirname $0`/../../source4/selftest/provisions/undump.sh $release_dir $PREFIX_ABS/$RELEASE - fi + $samba_undump $release_dir $PREFIX_ABS/$RELEASE $samba_tdbrestore } add_dangling_link() { diff --git a/testprogs/blackbox/runtime-links.sh b/testprogs/blackbox/runtime-links.sh index 344b822f07e..f8de66c60e7 100755 --- a/testprogs/blackbox/runtime-links.sh +++ b/testprogs/blackbox/runtime-links.sh @@ -11,10 +11,28 @@ PREFIX_ABS="$1" RELEASE="$2" shift 2 +failed=0 + . `dirname $0`/subunit.sh . `dirname $0`/common-links.sh +. `dirname $0`/common_test_fns.inc + +if [ ! -x $samba_undump ] || [ ! -d $release_dir ]; then + subunit_start_test $RELEASE + subunit_skip_test $RELEASE <