summaryrefslogtreecommitdiff
path: root/source3/script/tests/runtests.sh
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-08-24 03:09:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:01:13 -0500
commit024a46c8fa93a1f219930a329cf7548390a61c2a (patch)
tree158f296378641159b9911a180cdb143549ec5e33 /source3/script/tests/runtests.sh
parentcf08e1ce59c9c2562adeaf07b8be581e74f2eadd (diff)
downloadsamba-024a46c8fa93a1f219930a329cf7548390a61c2a.tar.gz
samba-024a46c8fa93a1f219930a329cf7548390a61c2a.tar.bz2
samba-024a46c8fa93a1f219930a329cf7548390a61c2a.zip
r9562: successfully get the samba 3 smbtorture working (as a test case for infrastructre)
(This used to be commit c64f5666b8d1f9fb617b1cf89d6157a0c3fa9da9)
Diffstat (limited to 'source3/script/tests/runtests.sh')
-rw-r--r--source3/script/tests/runtests.sh40
1 files changed, 39 insertions, 1 deletions
diff --git a/source3/script/tests/runtests.sh b/source3/script/tests/runtests.sh
index e8594f5199..b814ad91e7 100644
--- a/source3/script/tests/runtests.sh
+++ b/source3/script/tests/runtests.sh
@@ -5,6 +5,10 @@ if [ "x$1" == "x" ]; then
exit 1
fi
+if [ $# == 2 ]; then
+ testnum=$2
+fi
+
##
## create the test directory
##
@@ -19,6 +23,9 @@ cd $OLD_PWD
## setup the various environment variables we need
##
+USERNAME=`whoami`
+PASSWORD=test
+
SRCDIR=`pwd`
SCRIPTDIR=$SRCDIR/script/tests
TMPDIR=$PREFIX_ABS/tmp
@@ -35,6 +42,7 @@ PATH=`pwd`/bin:$PATH
export PREFIX_ABS CONFIGURATION CONFFILE PATH SOCKET_WRAPPER_DIR DOMAIN
export PRIVATEDIR LIBDIR PIDDIR LOCKDIR TMPDIR LOGDIR
export SRCDIR SCRIPTDIR
+export USERNAME PASSWORD
##
## create the test directory layout
@@ -42,6 +50,7 @@ export SRCDIR SCRIPTDIR
/bin/rm -rf $PREFIX/*
mkdir -p $PRIVATEDIR $LIBDIR $PIDDIR $LOCKDIR $TMPDIR $LOGDIR $SOCKET_WRAPPER_DIR
+chmod 1777 $TMPDIR
##
## Create the common config include file with the basic settings
@@ -57,17 +66,46 @@ cat >$LIBDIR/common.conf<<EOF
log file = $LOGDIR/log.%m
log level = 0
+ passdb backend = tdbsam
+
interfaces = lo
bind interfaces only = yes
- panic action = $PREFIX_ABS/script/tests/gdb_backtrace /proc/%d/exe %d
+ panic action = $SCRIPTDIR/gdb_backtrace %d
+EOF
+
+cat >$LIBDIR/smb.conf<<EOF
+[global]
+ include = $LIBDIR/common.conf
EOF
+
+##
+## create a test account
+##
+
+(echo $PASSWORD; echo $PASSWORD) | smbpasswd -c $LIBDIR/smb.conf -L -s -a $USERNAME
+
+
##
## ready to go...now loop through the tests
##
+if [ -f $SCRIPTDIR/t_$testnum.sh ]; then
+ testfile=$SCRIPTDIR/t_$testnum.sh
+ echo ">>>>>> Starting test driver `basename $testfile` <<<<<"
+ sh $testfile
+ if [ $? = 0 ]; then
+ echo ">>>>> test ok <<<<<"
+ else
+ echo ">>>>> test failed <<<<<"
+ fi
+
+ exit 0
+fi
+
for testfile in `ls $SCRIPTDIR/t_*sh | sort`; do
+ echo " "
echo ">>>>>> Starting test driver `basename $testfile` <<<<<"
sh $testfile
if [ $? = 0 ]; then