NCALRPCDIR=$PREFIX/ncalrpc
LOCKDIR=$PREFIX/lockdir
-testok() {
- name=`basename $1`
- failed=$2
- if [ x"$failed" = x"0" ];then
- echo "ALL OK ($name)";
- else
- echo "$failed TESTS FAILED ($name)";
- fi
- exit $failed
-}
+incdir=`dirname $0`
+. $incdir/test_functions.sh
rm -rf $PREFIX/*
mkdir -p $PRIVATEDIR $LIBDIR $PIDDIR $NCALRPCDIR $LOCKDIR $TMPDIR
echo "START: $START ($0)";
echo "END: $END ($0)";
-testok $0 $failed
+teststatus $0 $failed
domain="$4"
shift 4
-testit() {
- cmdline="$*"
- if ! $cmdline > test.$$ 2>&1; then
- cat test.$$;
- rm -f test.$$;
- echo "TEST FAILED - $cmdline";
- return 1;
- fi
- rm -f test.$$;
- return 0;
-}
-
-testok() {
- name=`basename $1`
- failed=$2
- if [ x"$failed" = x"0" ];then
- echo "ALL OK ($name)";
- else
- echo "$failed TESTS FAILED ($name)";
- fi
- exit $failed
-}
+incdir=`dirname $0`
+. $incdir/test_functions.sh
failed=0;
for I in "ncacn_np:$server" \
"308FB580-1EB2-11CA-923B-08002B1075A7@ncacn_np:$server" \
"308FB580-1EB2-11CA-923B-08002B1075A7@ncacn_ip_tcp:$server"
do
- echo Testing $I
- testit bin/smbtorture "$I" -U"$username"%"$password" -W $domain RPC-ECHO "$*" || failed=`expr $failed + 1`
+ testit "$I" bin/smbtorture "$I" -U"$username"%"$password" -W $domain RPC-ECHO "$*" || failed=`expr $failed + 1`
done
testok $0 $failed
domain="$4"
shift 4
-testit() {
- trap "rm -f test.$$" EXIT
- cmdline="$*"
- if ! $cmdline > test.$$ 2>&1; then
- cat test.$$;
- rm -f test.$$;
- echo "TEST FAILED - $cmdline";
- return 1;
- fi
- rm -f test.$$;
- return 0;
-}
-
-testok() {
- name=`basename $1`
- failed=$2
- if [ x"$failed" = x"0" ];then
- echo "ALL OK ($name)";
- else
- echo "$failed TESTS FAILED ($name)";
- fi
- exit $failed
-}
+incdir=`dirname $0`
+. $incdir/test_functions.sh
transports="ncacn_np ncacn_ip_tcp"
if [ $server = "localhost" ]; then
"--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:keyexchange=no" \
"--option=ntlmssp_client:ntlm2=no --option=ntlmssp_client:keyexchange=no --option=torture:echo_TestSleep=no" \
; do
- echo Testing $transport with $bindoptions and $ntlmoptions
- testit bin/smbtorture $transport:"$server[$bindoptions]" $ntlmoptions -U"$username"%"$password" -W $domain RPC-ECHO "$*" || failed=`expr $failed + 1`
+ name="$transport with $bindoptions and $ntlmoptions"
+ testit "$name" bin/smbtorture $transport:"$server[$bindoptions]" $ntlmoptions -U"$username"%"$password" -W $domain RPC-ECHO "$*" || failed=`expr $failed + 1`
done
done
done
# separately test the print option - its v slow
-echo Testing print option
-testit bin/smbtorture ncacn_np:"$server[print]" -U"$username"%"$password" -W $domain RPC-ECHO "$*" || failed=`expr $failed + 1`
+name="[print] option"
+testit bin/smbtorture "$name" ncacn_np:"$server[print]" -U"$username"%"$password" -W $domain RPC-ECHO "$*" || failed=`expr $failed + 1`
testok $0 $failed
--- /dev/null
+testit() {
+ name=$1
+ shift 1
+ trap "rm -f test.$$" EXIT
+ cmdline="$*"
+ if [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then
+ echo "--==--==--==--==--==--==--==--==--==--==--"
+ echo "Running test $name (level 0 stdout)"
+ echo "--==--==--==--==--==--==--==--==--==--==--"
+ date
+ else
+ echo "Testing $name"
+ fi
+ ( $cmdline > test.$$ 2>&1 )
+ status=$?
+ if [ x"$status" != x"0" ]; then
+ cat test.$$;
+ rm -f test.$$;
+ if [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then
+ echo "=========================================="
+ echo "TEST FAILED: $name (status $ret)"
+ echo "=========================================="
+ else
+ echo "TEST FAILED: $name (status $ret)"
+ fi
+ return 1;
+ fi
+ rm -f test.$$;
+ if [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then
+ echo "=========================================="
+ echo "TEST PASSED: $name"
+ echo "=========================================="
+ fi
+ return 0;
+}
+
+testok() {
+ name=`basename $1`
+ failed=$2
+ if [ x"$failed" = x"0" ];then
+ :
+ else
+ echo "$failed TESTS FAILED ($name)";
+ fi
+ exit $failed
+}
+
+teststatus() {
+ name=`basename $1`
+ failed=$2
+ if [ x"$failed" = x"0" ];then
+ echo "TEST STATUS: $failed";
+ else
+ echo "TEST STATUS: $failed";
+ fi
+ exit $failed
+}
shift 4
ADDARGS="$*"
-testit() {
- trap "rm -f test.$$" EXIT
-
- cmdline="$*"
- if ! $cmdline > test.$$; then
- cat test.$$;
- rm -f test.$$;
- echo "TEST FAILED - $cmdline";
- return 1;
- fi
- rm -f test.$$;
- return 0;
-}
-
-testok() {
- name=`basename $1`
- failed=$2
- if [ x"$failed" = x"0" ];then
- echo "ALL OK ($name)";
- else
- echo "$failed TESTS FAILED ($name)";
- fi
- exit $failed
-}
+incdir=`dirname $0`
+. $incdir/test_functions.sh
tests="BASE-FDPASS BASE-LOCK1 BASE-LOCK2 BASE-LOCK3 BASE-LOCK4"
tests="$tests BASE-LOCK5 BASE-LOCK6 BASE-LOCK7 BASE-UNLINK BASE-ATTR"
continue;
fi
start=""
- echo Testing $t
- testit $VALGRIND bin/smbtorture $ADDARGS $unc -U"$username"%"$password" $t || failed=`expr $failed + 1`
+ name="$t"
+ testit "$name" $VALGRIND bin/smbtorture $ADDARGS $unc -U"$username"%"$password" $t || failed=`expr $failed + 1`
done
testok $0 $failed
domain="$4"
shift 4
-testit() {
- trap "rm -f test.$$" EXIT
- cmdline="$*"
- if ! $cmdline > test.$$ 2>&1; then
- cat test.$$;
- rm -f test.$$;
- echo "TEST FAILED - $cmdline";
- return 1;
- fi
- rm -f test.$$;
- return 0;
-}
-
-testok() {
- name=`basename $1`
- failed=$2
- if [ x"$failed" = x"0" ];then
- echo "ALL OK ($name)";
- else
- echo "$failed TESTS FAILED ($name)";
- fi
- exit $failed
-}
+incdir=`dirname $0`
+. $incdir/test_functions.sh
failed=0
for bindoptions in connect sign seal sign,seal spnego spnego,sign spnego,seal validate padcheck bigendian bigendian,seal; do
ncacn_ip_tcp) tests=$ncacn_ip_tcp_tests ;;
esac
for t in $tests; do
- echo Testing $t on $transport with $bindoptions
- testit $VALGRIND bin/smbtorture $transport:"$server[$bindoptions]" -U"$username"%"$password" -W $domain $t "$*" || failed=`expr $failed + 1`
+ name="$t on $transport with $bindoptions"
+ testit "$name" $VALGRIND bin/smbtorture $transport:"$server[$bindoptions]" -U"$username"%"$password" -W $domain $t "$*" || failed=`expr $failed + 1`
done
done
done
realm="$5"
shift 5
-testit() {
- trap "rm -f test.$$" EXIT
- cmdline="$*"
- if ! $VALGRIND $cmdline > test.$$ 2>&1; then
- cat test.$$;
- rm -f test.$$;
- echo "TEST FAILED - $cmdline";
- exit 1;
- fi
- rm -f test.$$;
- return 0;
-}
-
-testok() {
- name=`basename $1`
- failed=$2
- if [ x"$failed" = x"0" ];then
- echo "ALL OK ($name)";
- else
- echo "$failed TESTS FAILED ($name)";
- fi
- exit $failed
-}
+incdir=`dirname $0`
+. $incdir/test_functions.sh
OPTIONS="-U$username%$password -W $domain --option realm=$realm"
failed=0
-echo Testing RPC-SPOOLSS on ncacn_np
-testit bin/smbtorture ncacn_np:"$server" $OPTIONS RPC-SPOOLSS "$*" || failed=`expr $failed + 1`
+name="RPC-SPOOLSS on ncacn_np"
+testit "$name" bin/smbtorture ncacn_np:"$server" $OPTIONS RPC-SPOOLSS "$*" || failed=`expr $failed + 1`
for bindoptions in padcheck connect sign seal spnego,sign spnego,seal validate bigendian; do
for transport in ncacn_ip_tcp ncacn_np; do
ncacn_ip_tcp) tests=$ncacn_ip_tcp_tests ;;
esac
for t in $tests; do
- echo Testing $t on $transport with $bindoptions
- testit bin/smbtorture $transport:"$server[$bindoptions]" $OPTIONS $t "$*" || failed=`expr $failed + 1`
+ name="$t on $transport with $bindoptions"
+ testit "$name" bin/smbtorture $transport:"$server[$bindoptions]" $OPTIONS $t "$*" || failed=`expr $failed + 1`
done
done
done
-echo Testing RPC-DRSUAPI on ncacn_ip_tcp with seal
-testit bin/smbtorture ncacn_ip_tcp:"$server[seal]" $OPTIONS RPC-DRSUAPI "$*" || failed=`expr $failed + 1`
-echo Testing RPC-DRSUAPI on ncacn_ip_tcp with seal,bigendian
-testit bin/smbtorture ncacn_ip_tcp:"$server[seal,bigendian]" $OPTIONS RPC-DRSUAPI "$*" || failed=`expr $failed + 1`
+name="RPC-DRSUAPI on ncacn_ip_tcp with seal"
+testit "$name" bin/smbtorture ncacn_ip_tcp:"$server[seal]" $OPTIONS RPC-DRSUAPI "$*" || failed=`expr $failed + 1`
+name="RPC-DRSUAPI on ncacn_ip_tcp with seal,bigendian"
+testit "$name" bin/smbtorture ncacn_ip_tcp:"$server[seal,bigendian]" $OPTIONS RPC-DRSUAPI "$*" || failed=`expr $failed + 1`
testok $0 $failed