summaryrefslogtreecommitdiff
path: root/source4/script
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-05-02 15:19:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:16:27 -0500
commitbd638ea71c91d8c0a37eb59343ae561a260461c3 (patch)
tree44c22dc038c7d48a02e4ccb712c7160df444c79e /source4/script
parentd70232a747eee67624ea8798e0459674031ead1c (diff)
downloadsamba-bd638ea71c91d8c0a37eb59343ae561a260461c3.tar.gz
samba-bd638ea71c91d8c0a37eb59343ae561a260461c3.tar.bz2
samba-bd638ea71c91d8c0a37eb59343ae561a260461c3.zip
r6577: Make test works without installation now.
Running as a non-root user using socket_wrapper is possible by simple export SOCKET_WRAPPER_DIR before running 'make test' (This used to be commit 6d93fcc407cfd98e42045c65456cfb0c45f0ff1a)
Diffstat (limited to 'source4/script')
-rwxr-xr-xsource4/script/tests/selftest.sh40
1 files changed, 27 insertions, 13 deletions
diff --git a/source4/script/tests/selftest.sh b/source4/script/tests/selftest.sh
index a52f38b3b1..d1a60c02e8 100755
--- a/source4/script/tests/selftest.sh
+++ b/source4/script/tests/selftest.sh
@@ -1,9 +1,9 @@
#!/bin/sh
DOMAIN=SAMBADOMAIN
+USERNAME=administrator
REALM=$DOMAIN
PASSWORD=penguin
SRCDIR=`pwd`
-TMPDIR=$PREFIX/tmp
if [ $# -lt 1 ]
then
@@ -12,26 +12,40 @@ then
fi
PREFIX=$1
+TMPDIR=$PREFIX/tmp
+LIBDIR=$PREFIX/lib
+PIDDIR=$PREFIX/pid
+CONFFILE=$LIBDIR/smb.conf
+PRIVATEDIR=$PREFIX/private
+NCALRPCDIR=$PREFIX/ncalrpc
+LOCKDIR=$PREFIX/lockdir
-rm -f $PREFIX/private/*
-./setup/provision.pl --quiet --outputdir $PREFIX/private --domain $DOMAIN --realm $REALM --adminpass $PASSWORD
+mkdir -p $PRIVATEDIR $LIBDIR $PIDDIR $NCALRPCDIR $LOCKDIR $TMPDIR
+rm -f $PRIVATEDIR/*
+./setup/provision.pl --quiet --outputdir $PRIVATEDIR --domain $DOMAIN --realm $REALM --adminpass $PASSWORD
-cat >$PREFIX/lib/smb.conf <<EOF
+cat >$CONFFILE<<EOF
[global]
workgroup = $DOMAIN
+ realm = $REALM
+ private dir = $PRIVATEDIR
+ pid directory = $PIDDIR
+ ncalrpc dir = $NCALRPCDIR
+ lock dir = $LOCKDIR
+ sam database = tdb://$PRIVATEDIR/sam.ldb
[tmp]
path = $TMPDIR
read only = no
EOF
-export SOCKET_WRAPPER_DIR
-cd $PREFIX
-./sbin/smbd
+ADDARG="-s $CONFFILE"
+
+$SRCDIR/bin/smbd -s $CONFFILE -M single || exit 1
sleep 2
-$SRCDIR/script/tests/test_rpc.sh localhost administrator $PASSWORD $DOMAIN || exit 1
-$SRCDIR/script/tests/test_binding_string.sh localhost administrator $PASSWORD $DOMAIN || exit 1
-$SRCDIR/script/tests/test_echo.sh localhost administrator $PASSWORD $DOMAIN || exit 1
-$SRCDIR/script/tests/test_posix.sh //localhost/tmp administrator $PASSWORD || exit 1
-$PREFIX/bin/smbtorture ncalrpc: LOCAL-* || exit 1
-kill `cat $PREFIX/var/locks/smbd.pid`
+$SRCDIR/script/tests/test_rpc.sh localhost $USERNAME $PASSWORD $DOMAIN $ADDARG || exit 1
+$SRCDIR/script/tests/test_binding_string.sh localhost $USERNAME $PASSWORD $DOMAIN $ADDARG || exit 1
+$SRCDIR/script/tests/test_echo.sh localhost $USERNAME $PASSWORD $DOMAIN $ADDARG || exit 1
+$SRCDIR/script/tests/test_posix.sh //localhost/tmp $USERNAME $PASSWORD $ADDARG || exit 1
+$SRCDIR/bin/smbtorture $ADDARG ncalrpc: LOCAL-* || exit 1
+kill `cat $PIDDIR/smbd.pid`