1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +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:
Stefan Metzmacher 2005-06-09 07:14:39 +00:00 committed by Gerald (Jerry) Carter
parent 32e935c8c6
commit 7931aed30d
7 changed files with 87 additions and 144 deletions

View File

@ -20,16 +20,8 @@ PRIVATEDIR=$PREFIX/private
NCALRPCDIR=$PREFIX/ncalrpc NCALRPCDIR=$PREFIX/ncalrpc
LOCKDIR=$PREFIX/lockdir LOCKDIR=$PREFIX/lockdir
testok() { incdir=`dirname $0`
name=`basename $1` . $incdir/test_functions.sh
failed=$2
if [ x"$failed" = x"0" ];then
echo "ALL OK ($name)";
else
echo "$failed TESTS FAILED ($name)";
fi
exit $failed
}
rm -rf $PREFIX/* rm -rf $PREFIX/*
mkdir -p $PRIVATEDIR $LIBDIR $PIDDIR $NCALRPCDIR $LOCKDIR $TMPDIR mkdir -p $PRIVATEDIR $LIBDIR $PIDDIR $NCALRPCDIR $LOCKDIR $TMPDIR
@ -74,4 +66,4 @@ END=`date`
echo "START: $START ($0)"; echo "START: $START ($0)";
echo "END: $END ($0)"; echo "END: $END ($0)";
testok $0 $failed teststatus $0 $failed

View File

@ -13,28 +13,8 @@ password="$3"
domain="$4" domain="$4"
shift 4 shift 4
testit() { incdir=`dirname $0`
cmdline="$*" . $incdir/test_functions.sh
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
}
failed=0; failed=0;
for I in "ncacn_np:$server" \ 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_np:$server" \
"308FB580-1EB2-11CA-923B-08002B1075A7@ncacn_ip_tcp:$server" "308FB580-1EB2-11CA-923B-08002B1075A7@ncacn_ip_tcp:$server"
do do
echo Testing $I testit "$I" bin/smbtorture "$I" -U"$username"%"$password" -W $domain RPC-ECHO "$*" || failed=`expr $failed + 1`
testit bin/smbtorture "$I" -U"$username"%"$password" -W $domain RPC-ECHO "$*" || failed=`expr $failed + 1`
done done
testok $0 $failed testok $0 $failed

View File

@ -13,29 +13,8 @@ password="$3"
domain="$4" domain="$4"
shift 4 shift 4
testit() { incdir=`dirname $0`
trap "rm -f test.$$" EXIT . $incdir/test_functions.sh
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
}
transports="ncacn_np ncacn_ip_tcp" transports="ncacn_np ncacn_ip_tcp"
if [ $server = "localhost" ]; then 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=yes --option=ntlmssp_client:keyexchange=no" \
"--option=ntlmssp_client:ntlm2=no --option=ntlmssp_client:keyexchange=no --option=torture:echo_TestSleep=no" \ "--option=ntlmssp_client:ntlm2=no --option=ntlmssp_client:keyexchange=no --option=torture:echo_TestSleep=no" \
; do ; do
echo Testing $transport with $bindoptions and $ntlmoptions name="$transport with $bindoptions and $ntlmoptions"
testit bin/smbtorture $transport:"$server[$bindoptions]" $ntlmoptions -U"$username"%"$password" -W $domain RPC-ECHO "$*" || failed=`expr $failed + 1` testit "$name" bin/smbtorture $transport:"$server[$bindoptions]" $ntlmoptions -U"$username"%"$password" -W $domain RPC-ECHO "$*" || failed=`expr $failed + 1`
done done
done done
done done
# separately test the print option - its v slow # separately test the print option - its v slow
echo Testing print option name="[print] option"
testit bin/smbtorture ncacn_np:"$server[print]" -U"$username"%"$password" -W $domain RPC-ECHO "$*" || failed=`expr $failed + 1` testit bin/smbtorture "$name" ncacn_np:"$server[print]" -U"$username"%"$password" -W $domain RPC-ECHO "$*" || failed=`expr $failed + 1`
testok $0 $failed testok $0 $failed

View 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
}

View File

@ -21,30 +21,8 @@ start="$4"
shift 4 shift 4
ADDARGS="$*" ADDARGS="$*"
testit() { incdir=`dirname $0`
trap "rm -f test.$$" EXIT . $incdir/test_functions.sh
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
}
tests="BASE-FDPASS BASE-LOCK1 BASE-LOCK2 BASE-LOCK3 BASE-LOCK4" tests="BASE-FDPASS BASE-LOCK1 BASE-LOCK2 BASE-LOCK3 BASE-LOCK4"
tests="$tests BASE-LOCK5 BASE-LOCK6 BASE-LOCK7 BASE-UNLINK BASE-ATTR" tests="$tests BASE-LOCK5 BASE-LOCK6 BASE-LOCK7 BASE-UNLINK BASE-ATTR"
@ -67,8 +45,8 @@ for t in $tests; do
continue; continue;
fi fi
start="" start=""
echo Testing $t name="$t"
testit $VALGRIND bin/smbtorture $ADDARGS $unc -U"$username"%"$password" $t || failed=`expr $failed + 1` testit "$name" $VALGRIND bin/smbtorture $ADDARGS $unc -U"$username"%"$password" $t || failed=`expr $failed + 1`
done done
testok $0 $failed testok $0 $failed

View File

@ -23,29 +23,8 @@ password="$3"
domain="$4" domain="$4"
shift 4 shift 4
testit() { incdir=`dirname $0`
trap "rm -f test.$$" EXIT . $incdir/test_functions.sh
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
}
failed=0 failed=0
for bindoptions in connect sign seal sign,seal spnego spnego,sign spnego,seal validate padcheck bigendian bigendian,seal; do 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 ;; ncacn_ip_tcp) tests=$ncacn_ip_tcp_tests ;;
esac esac
for t in $tests; do for t in $tests; do
echo Testing $t on $transport with $bindoptions name="$t on $transport with $bindoptions"
testit $VALGRIND bin/smbtorture $transport:"$server[$bindoptions]" -U"$username"%"$password" -W $domain $t "$*" || failed=`expr $failed + 1` testit "$name" $VALGRIND bin/smbtorture $transport:"$server[$bindoptions]" -U"$username"%"$password" -W $domain $t "$*" || failed=`expr $failed + 1`
done done
done done
done done

View File

@ -25,36 +25,15 @@ domain="$4"
realm="$5" realm="$5"
shift 5 shift 5
testit() { incdir=`dirname $0`
trap "rm -f test.$$" EXIT . $incdir/test_functions.sh
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
}
OPTIONS="-U$username%$password -W $domain --option realm=$realm" OPTIONS="-U$username%$password -W $domain --option realm=$realm"
failed=0 failed=0
echo Testing RPC-SPOOLSS on ncacn_np name="RPC-SPOOLSS on ncacn_np"
testit bin/smbtorture ncacn_np:"$server" $OPTIONS RPC-SPOOLSS "$*" || failed=`expr $failed + 1` 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 bindoptions in padcheck connect sign seal spnego,sign spnego,seal validate bigendian; do
for transport in ncacn_ip_tcp ncacn_np; 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 ;; ncacn_ip_tcp) tests=$ncacn_ip_tcp_tests ;;
esac esac
for t in $tests; do for t in $tests; do
echo Testing $t on $transport with $bindoptions name="$t on $transport with $bindoptions"
testit bin/smbtorture $transport:"$server[$bindoptions]" $OPTIONS $t "$*" || failed=`expr $failed + 1` testit "$name" bin/smbtorture $transport:"$server[$bindoptions]" $OPTIONS $t "$*" || failed=`expr $failed + 1`
done done
done done
done done
echo Testing RPC-DRSUAPI on ncacn_ip_tcp with seal name="RPC-DRSUAPI on ncacn_ip_tcp with seal"
testit bin/smbtorture ncacn_ip_tcp:"$server[seal]" $OPTIONS RPC-DRSUAPI "$*" || failed=`expr $failed + 1` testit "$name" 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 name="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` testit "$name" bin/smbtorture ncacn_ip_tcp:"$server[seal,bigendian]" $OPTIONS RPC-DRSUAPI "$*" || failed=`expr $failed + 1`
testok $0 $failed testok $0 $failed