r7485: - allow test_xxx.sh to run outside of 'make test' by ensuring $PREFIX is setup
authorAndrew Tridgell <tridge@samba.org>
Sat, 11 Jun 2005 04:07:20 +0000 (04:07 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:17:58 +0000 (13:17 -0500)
- use loopback interface only, otherwise nbtd will answer with a real
  ip, which the socket wrapper code will fail to connect to

- enable eadb for posix testing

- sleeping to wait for smbd to start is pointless, as smbd won't start
  till its fifo is opened due to the fifo redirection on stdin

- sleep for a few seconds to allow for nbt server to register names after opening fifo

- use bcast name resolution, so we don't rely on /etc/hosts being right
(This used to be commit 9ce2b9a79ba34705bcd8c32db1e084763702faec)

source4/script/tests/selftest.sh
source4/script/tests/test_functions.sh

index c974decd6c4b8ccae55c800e4813abc5358baf6c..ac3fd71f94765323f7d0bda1d5efed378b09315f 100755 (executable)
@@ -50,12 +50,15 @@ cat >$CONFFILE<<EOF
        ncalrpc dir = $NCALRPCDIR
        lock dir = $LOCKDIR
        sam database = tdb://$PRIVATEDIR/sam.ldb
+       name resolve order = bcast
+       interfaces = lo
 
 [tmp]
        path = $TMPDIR
        read only = no
        ntvfs handler = posix
        posix:sharedelay = 100000
+       posix:eadb = $LOCKDIR/eadb.tdb
 EOF
 
 ADDARG="-s $CONFFILE"
@@ -67,6 +70,10 @@ smbd_check_or_start
 
 START=`date`
 (
+ # give time for nbt server to register its names
+ echo delaying for nbt name registration
+ sleep 4
+
  failed=0
  $SRCDIR/script/tests/test_rpc.sh localhost $USERNAME $PASSWORD $DOMAIN $ADDARG || failed=`expr $failed + $?`
  $SRCDIR/script/tests/test_binding_string.sh localhost $USERNAME $PASSWORD $DOMAIN $ADDARG || failed=`expr $failed + $?`
index a2636b3354f58f09ba3bc604776bb9e540b0dd25..e24e1062b01003572fac55a5c5d1f144bf859b05 100644 (file)
@@ -29,7 +29,6 @@ smbd_check_or_start() {
                        echo "smbd exists with status $ret" >>$SMBD_TEST_LOG;
                        exit $ret;
                ) || exit $? &) 2>/dev/null || exit $?
-               sleep 2
                echo  "DONE"
        fi
        return 0;
@@ -55,7 +54,11 @@ smbd_have_test_log() {
 }
 
 testit() {
-        name=$1
+       if [ -z "$PREFIX" ]; then
+           PREFIX=test_prefix
+           mkdir -p $PREFIX
+       fi
+       name=$1
        shift 1
        SMBD_IS_UP="no"
        TEST_LOG="$PREFIX/test_log.$$"