mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
r7421: - move test* functions to a seperate file
- print build farm style output when RUN_FROM_BUILD_FARM=yes
metze
(This used to be commit 7e567a6b69
)
This commit is contained in:
parent
32e935c8c6
commit
7931aed30d
@ -20,16 +20,8 @@ PRIVATEDIR=$PREFIX/private
|
||||
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
|
||||
@ -74,4 +66,4 @@ END=`date`
|
||||
echo "START: $START ($0)";
|
||||
echo "END: $END ($0)";
|
||||
|
||||
testok $0 $failed
|
||||
teststatus $0 $failed
|
||||
|
@ -13,28 +13,8 @@ password="$3"
|
||||
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" \
|
||||
@ -48,8 +28,7 @@ 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
|
||||
|
@ -13,29 +13,8 @@ password="$3"
|
||||
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
|
||||
@ -54,14 +33,14 @@ for transport in $transports; do
|
||||
"--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
|
||||
|
57
source4/script/tests/test_functions.sh
Normal file
57
source4/script/tests/test_functions.sh
Normal file
@ -0,0 +1,57 @@
|
||||
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
|
||||
}
|
@ -21,30 +21,8 @@ start="$4"
|
||||
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"
|
||||
@ -67,8 +45,8 @@ for t in $tests; do
|
||||
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
|
||||
|
@ -23,29 +23,8 @@ password="$3"
|
||||
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
|
||||
@ -56,8 +35,8 @@ for bindoptions in connect sign seal sign,seal spnego spnego,sign spnego,seal va
|
||||
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
|
||||
|
@ -25,36 +25,15 @@ domain="$4"
|
||||
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
|
||||
@ -63,15 +42,15 @@ for bindoptions in padcheck connect sign seal spnego,sign spnego,seal validate b
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user