1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

Use the subunit shell library.

This commit is contained in:
Jelmer Vernooij 2008-04-16 14:52:29 +02:00
parent 9b364bf390
commit 49367e044e
9 changed files with 14 additions and 120 deletions

View File

@ -14,40 +14,24 @@ USERNAME=$2
PASSWORD=$3
DOMAIN=$4
. `dirname $0`/subunit.sh
samba4bindir=`dirname $0`/../../source/bin
DD=$samba4bindir/cifsdd
SHARE=tmp
DEBUGLEVEL=1
failed=0
testit() {
name="$1"
shift
cmdline="$*"
echo "test: $name"
$cmdline
status=$?
if [ x$status = x0 ]; then
echo "success: $name"
else
echo "failure: $name"
failed=`expr $failed + 1`
fi
return $status
}
runcopy() {
message="$1"
shift
testit "$message" $VALGRIND $DD $CONFIGURATION --debuglevel=$DEBUGLEVEL -W "$DOMAIN" -U "$USERNAME"%"$PASSWORD" \
"$@"
"$@" || failed=`expr $failed + 1`
}
compare() {
testit "$1" cmp "$2" "$3"
testit "$1" cmp "$2" "$3" || failed=`expr $failed + 1`
}
sourcepath=tempfile.src.$$

View File

@ -20,20 +20,7 @@ failed=0
samba4bindir=`dirname $0`/../../source/bin
gentest=$samba4bindir/gentest
testit() {
name="$1"
shift
cmdline="$*"
echo "test: $name"
$cmdline
status=$?
if [ x$status = x0 ]; then
echo "success: $name"
else
echo "failure: $name"
fi
return $status
}
. `dirname $0`/subunit.sh
cat <<EOF > st/gentest.ignore
all_info.out.fname

View File

@ -25,21 +25,7 @@ samba4kinit=$samba4bindir/samba4kinit
net=$samba4bindir/net
enableaccount="$samba4bindir/smbpython `dirname $0`/../../source/setup/enableaccount"
testit() {
name="$1"
shift
cmdline="$*"
echo "test: $name"
$cmdline
status=$?
if [ x$status = x0 ]; then
echo "success: $name"
else
echo "failure: $name"
fi
return $status
}
. `dirname $0`/subunit.sh
test_smbclient() {
name="$1"

View File

@ -14,6 +14,8 @@ PREFIX=$3
shift 2
options="$*"
. `dirname $0`/subunit.sh
check() {
name="$1"
shift

View File

@ -21,20 +21,7 @@ failed=0
samba4bindir=`dirname $0`/../../source/bin
locktest=$samba4bindir/locktest
testit() {
name="$1"
shift
cmdline="$*"
echo "test: $name"
$cmdline
status=$?
if [ x$status = x0 ]; then
echo "success: $name"
else
echo "failure: $name"
fi
return $status
}
. `dirname $0`/subunit.sh
testit "locktest" $VALGRIND $locktest //$SERVER/test1 //$SERVER/test2 --num-ops=100 -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ || failed=`expr $failed + 1`

View File

@ -21,20 +21,7 @@ failed=0
samba4bindir=`dirname $0`/../../source/bin
masktest=$samba4bindir/masktest
testit() {
name="$1"
shift
cmdline="$*"
echo "test: $name"
$cmdline
status=$?
if [ x$status = x0 ]; then
echo "success: $name"
else
echo "failure: $name"
fi
return $status
}
. `dirname $0`/subunit.sh
testit "masktest" $VALGRIND $masktest //$SERVER/tmp --num-ops=200 --dieonerror -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ || failed=`expr $failed + 1`

View File

@ -4,27 +4,14 @@
# Copyright (C) 2008 Andrew Bartlett
# based on test_smbclient.sh
. `dirname $0`/subunit.sh
failed=0
samba4bindir=`dirname $0`/../../source/bin
ndrdump=$samba4bindir/ndrdump
files=`dirname $0`/ndrdump
testit() {
name="$1"
shift
cmdline="$*"
echo "test: $name"
$cmdline
status=$?
if [ x$status = x0 ]; then
echo "success: $name"
else
echo "failure: $name"
fi
return $status
}
testit "ndrdump with in" $VALGRIND $ndrdump samr samr_CreateUser in $files/samr-CreateUser-in.dat $@ || failed=`expr $failed + 1`
testit "ndrdump with out" $VALGRIND $ndrdump samr samr_CreateUser out $files/samr-CreateUser-out.dat $@ || failed=`expr $failed + 1`
testit "ndrdump with --context-file" $VALGRIND $ndrdump --context-file $files/samr-CreateUser-in.dat samr samr_CreateUser out $files/samr-CreateUser-out.dat $@ || failed=`expr $failed + 1`

View File

@ -21,20 +21,7 @@ failed=0
samba4bindir=`dirname $0`/../../source/bin
smbclient=$samba4bindir/smbclient
testit() {
name="$1"
shift
cmdline="$*"
echo "test: $name"
$cmdline
status=$?
if [ x$status = x0 ]; then
echo "success: $name"
else
echo "failure: $name"
fi
return $status
}
. `dirname $0`/subunit.sh
runcmd() {
name="$1"

View File

@ -17,20 +17,7 @@ failed=0
samba4bindir=`dirname $0`/../../source/bin
wbinfo=$samba4bindir/wbinfo
testit() {
name="$1"
shift
cmdline="$*"
echo "test: $name"
$cmdline
status=$?
if [ x$status = x0 ]; then
echo "success: $name"
else
echo "failure: $name"
fi
return $status
}
. `dirname $0`/subunit.sh
testfail() {
name="$1"