r6577: Make test works without installation now.
authorJelmer Vernooij <jelmer@samba.org>
Mon, 2 May 2005 15:19:25 +0000 (15:19 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:16:27 +0000 (13:16 -0500)
Running as a non-root user using socket_wrapper is possible by simple
export SOCKET_WRAPPER_DIR before running 'make test'

source/build/smb_build/makefile.pm
source/librpc/idl/epmapper.idl
source/librpc/idl/rot.idl
source/script/tests/selftest.sh

index bc5690ddf31f947ef5fba6125cc284158311bb4e..3b36a94334a8962ceb2f4c77e17ae22f50655aa6 100644 (file)
@@ -151,14 +151,8 @@ pch_clean:
 basics: idl proto_exists
 
 test: all
-       ./script/tests/selftest.sh $(prefix)
+       ./script/tests/selftest.sh `pwd`/prefix-test
        
-export SOCKET_WRAPPER_DIR=$(shell pwd)/sockdir
-
-test-swrap: all
-       mkdir -p $(SOCKET_WRAPPER_DIR)
-       ./script/tests/selftest.sh $(prefix)
-
 __EOD__
 
        return $output;
index a35b9c47a37abf2a1d6bde146899a18a6ab1e6e5..7881e47fe67fdfccf62e2fe01c1f3baee4b1626f 100644 (file)
@@ -12,7 +12,7 @@ http://www.opengroup.org/onlinepubs/9629399/chap6.htm#tagcjh_11_02_03_01: bindin
  uuid("e1af8308-5d1f-11c9-91a4-08002b14a0fa"), 
  version(3.0), 
  endpoint("ncacn_np:[\\pipe\\epmapper]", "ncacn_ip_tcp:[135]", 
-                 "ncalrpc:[EPMAPPER]", "ncacn_unix_stream:[/tmp/epmapper]"),
+                 "ncalrpc:[EPMAPPER]"),
  helpstring("EndPoint Mapper"),
  pointer_default(unique)
 ]
index aa257dcf2fef3fc2fb548077677e8b7993cc2d35..fd9fd42467656079d3f314d52f3741f77cdae448 100644 (file)
@@ -6,7 +6,7 @@
     pointer_default(unique),
        depends(orpc),
        endpoint("ncacn_np:[\\pipe\\epmapper]", "ncacn_ip_tcp:[135]", 
-                 "ncalrpc:[EPMAPPER]", "ncacn_unix_stream:[/tmp/epmapper]")
+                 "ncalrpc:[EPMAPPER]")
 ] interface rot
 {
        WERROR rot_add (
index a52f38b3b1b8aca5b69dd801803a4cbe16fb2f63..d1a60c02e89fa55b2657210fcbe70cb65cfe1a2e 100755 (executable)
@@ -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`