version 1.1, 2012/02/17 15:09:30
|
version 1.1.1.3, 2021/03/17 00:32:36
|
Line 1
|
Line 1
|
#! /bin/sh |
#! /bin/sh |
|
|
# Copyright (C) 2001, 2002 by Martin Pool <mbp@samba.org> |
# Copyright (C) 2001, 2002 by Martin Pool <mbp@samba.org> |
# Copyright (C) 2003, 2004, 2005, 2006 Wayne Davison | # Copyright (C) 2003-2020 Wayne Davison |
|
|
# This program is free software; you can redistribute it and/or modify |
# This program is free software; you can redistribute it and/or modify |
# it under the terms of the GNU General Public License version |
# it under the terms of the GNU General Public License version |
Line 11
|
Line 11
|
# WITHOUT ANY WARRANTY; without even the implied warranty of |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
# Lesser General Public License for more details. |
# Lesser General Public License for more details. |
# | # |
# You should have received a copy of the GNU Lesser General Public |
# You should have received a copy of the GNU Lesser General Public |
# License along with this program; if not, write to the Free Software |
# License along with this program; if not, write to the Free Software |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
|
|
# ------------------------------------------------------------------------- |
|
|
# rsync top-level test script -- this invokes all the other more |
# rsync top-level test script -- this invokes all the other more |
# detailed tests in order. This script can either be called by `make |
# detailed tests in order. This script can either be called by `make |
# check' or `make installcheck'. `check' runs against the copies of |
# check' or `make installcheck'. `check' runs against the copies of |
# the program and other files in the build directory, and |
# the program and other files in the build directory, and |
# `installcheck' against the installed copy of the program. | # `installcheck' against the installed copy of the program. |
|
|
|
# It can also be called on a single test file using a run like this: |
|
# |
|
# preserve_scratch=yes whichtests=itemize.test ./runtests.sh |
|
|
# In either case we need to also be able to find the source directory, |
# In either case we need to also be able to find the source directory, |
# since we read test scripts and possibly other information from |
# since we read test scripts and possibly other information from |
# there. |
# there. |
Line 47
|
Line 53
|
# build scripts. At the moment we assume we are invoked from the |
# build scripts. At the moment we assume we are invoked from the |
# source directory. |
# source directory. |
|
|
# This script must be invoked from the build directory. | # This script must be invoked from the build directory. |
|
|
# A scratch directory, 'testtmp', is used in the build directory to |
# A scratch directory, 'testtmp', is used in the build directory to |
# hold per-test subdirectories. |
# hold per-test subdirectories. |
Line 57
|
Line 63
|
# Make command line. It's also set by the build farm to give more |
# Make command line. It's also set by the build farm to give more |
# detail for failing builds. |
# detail for failing builds. |
|
|
|
# ------------------------------------------------------------------------- |
|
|
# NOTES FOR TEST CASES: |
# NOTES FOR TEST CASES: |
|
|
# Each test case runs in its own shell. | # Each test case runs in its own shell. |
|
|
# Exit codes from tests: |
# Exit codes from tests: |
|
|
Line 75
|
Line 82
|
|
|
# rsync.fns contains some general setup functions and definitions. |
# rsync.fns contains some general setup functions and definitions. |
|
|
|
# ------------------------------------------------------------------------- |
|
|
# NOTES ON PORTABILITY: |
# NOTES ON PORTABILITY: |
|
|
Line 103
|
Line 111
|
# Don't rely on grep -q, as that doesn't work everywhere -- just redirect |
# Don't rely on grep -q, as that doesn't work everywhere -- just redirect |
# stdout to /dev/null to keep it quiet. |
# stdout to /dev/null to keep it quiet. |
|
|
|
# ------------------------------------------------------------------------- |
|
|
# STILL TO DO: |
# STILL TO DO: |
|
|
Line 141 if [ "x$loglevel" != x ] && [ "$loglevel" -gt 8 ]; the
|
Line 150 if [ "x$loglevel" != x ] && [ "$loglevel" -gt 8 ]; the
|
fi |
fi |
fi |
fi |
|
|
POSIXLY_CORRECT=1 | POSIXLY_CORRECT=1 |
if test x"$TOOLDIR" = x; then |
if test x"$TOOLDIR" = x; then |
TOOLDIR=`pwd` |
TOOLDIR=`pwd` |
fi |
fi |
Line 191 if [ "x$preserve_scratch" = xyes ]; then
|
Line 200 if [ "x$preserve_scratch" = xyes ]; then
|
echo " preserve_scratch=yes" |
echo " preserve_scratch=yes" |
else |
else |
echo " preserve_scratch=no" |
echo " preserve_scratch=no" |
fi | fi |
|
|
# Check if setacl/setfacl is around and if it supports the -k or -s option. |
# Check if setacl/setfacl is around and if it supports the -k or -s option. |
if setacl -k u::7,g::5,o:5 testsuite 2>/dev/null; then |
if setacl -k u::7,g::5,o:5 testsuite 2>/dev/null; then |
Line 232 echo " scratchbase=$scratchbase"
|
Line 241 echo " scratchbase=$scratchbase"
|
[ -d "$scratchbase" ] || mkdir "$scratchbase" |
[ -d "$scratchbase" ] || mkdir "$scratchbase" |
|
|
suitedir="$srcdir/testsuite" |
suitedir="$srcdir/testsuite" |
|
TESTRUN_TIMEOUT=300 |
|
|
export scratchdir suitedir | export scratchdir suitedir TESTRUN_TIMEOUT |
|
|
prep_scratch() { |
prep_scratch() { |
[ -d "$scratchdir" ] && chmod -R u+rwX "$scratchdir" && rm -rf "$scratchdir" |
[ -d "$scratchdir" ] && chmod -R u+rwX "$scratchdir" && rm -rf "$scratchdir" |
mkdir "$scratchdir" |
mkdir "$scratchdir" |
# Get rid of default ACLs and dir-setgid to avoid confusing some tests. |
# Get rid of default ACLs and dir-setgid to avoid confusing some tests. |
$setfacl_nodef "$scratchdir" || true | $setfacl_nodef "$scratchdir" 2>/dev/null || true |
chmod g-s "$scratchdir" |
chmod g-s "$scratchdir" |
case "$srcdir" in |
case "$srcdir" in |
/*) ln -s "$srcdir" "$scratchdir/src" ;; |
/*) ln -s "$srcdir" "$scratchdir/src" ;; |
Line 264 do
|
Line 274 do
|
|
|
prep_scratch |
prep_scratch |
|
|
|
case "$testscript" in |
|
*hardlinks*) TESTRUN_TIMEOUT=600 ;; |
|
*) TESTRUN_TIMEOUT=300 ;; |
|
esac |
|
|
set +e |
set +e |
sh $RUNSHFLAGS "$testscript" >"$scratchdir/test.log" 2>&1 | "$TOOLDIR/"testrun $RUNSHFLAGS "$testscript" >"$scratchdir/test.log" 2>&1 |
result=$? |
result=$? |
set -e |
set -e |
|
|
Line 295 do
|
Line 310 do
|
maybe_discard_scratch |
maybe_discard_scratch |
;; |
;; |
78) |
78) |
# It failed, but we expected that. don't dump out error logs, | # It failed, but we expected that. don't dump out error logs, |
# because most users won't want to see them. But do leave |
# because most users won't want to see them. But do leave |
# the working directory around. |
# the working directory around. |
echo "XFAIL $testbase" |
echo "XFAIL $testbase" |
Line 324 echo '------------------------------------------------
|
Line 339 echo '------------------------------------------------
|
# because -e is set. |
# because -e is set. |
|
|
result=`expr $failed + $missing || true` |
result=`expr $failed + $missing || true` |
|
if [ "$result" = 0 -a "$skipped" -gt "${RSYNC_MAX_SKIPPED:-9999}" ]; then |
|
result=1 |
|
fi |
echo "overall result is $result" |
echo "overall result is $result" |
exit $result |
exit $result |