2 # Bootstrap Samba and run a number of tests against it.
10 if test -z "$ROOT"; then
13 if test -z "$ROOT"; then
25 PREFIX=`echo $PREFIX | sed s+//+/+`
28 # allow selection of the test lists
31 if [ $TESTS = "all" ]; then
37 mkdir -p $PREFIX || exit $?
44 TMPDIR=$PREFIX_ABS/tmp
45 LIBDIR=$PREFIX_ABS/lib
46 PIDDIR=$PREFIX_ABS/pid
47 CONFFILE=$LIBDIR/smb.conf
48 PRIVATEDIR=$PREFIX_ABS/private
49 NCALRPCDIR=$PREFIX_ABS/ncalrpc
50 LOCKDIR=$PREFIX_ABS/lockdir
51 TLSDIR=$PRIVATEDIR/tls
52 CONFIGURATION="--configfile=$CONFFILE"
56 SMBD_TEST_FIFO="$PREFIX/smbd_test.fifo"
58 SMBD_TEST_LOG="$PREFIX/smbd_test.log"
62 if [ x"$DO_SOCKET_WRAPPER" = x"SOCKET_WRAPPER" ];then
63 SOCKET_WRAPPER_DIR="$PREFIX/sw"
64 export SOCKET_WRAPPER_DIR
65 echo "SOCKET_WRAPPER_DIR=$SOCKET_WRAPPER_DIR"
68 # start off with 0 failures
73 . $incdir/test_functions.sh
79 mkdir -p $PRIVATEDIR $LIBDIR $PIDDIR $NCALRPCDIR $LOCKDIR $TMPDIR $TLSDIR
83 netbios name = LOCALHOST
86 private dir = $PRIVATEDIR
87 pid directory = $PIDDIR
88 ncalrpc dir = $NCALRPCDIR
90 setup directory = $SRCDIR/setup
91 js include = $SRCDIR/scripting/libjs
92 name resolve order = bcast
94 tls enabled = $TLS_ENABLED
95 panic action = $SRCDIR/script/gdb_backtrace %PID% %PROG%
103 ntvfs handler = posix
104 posix:sharedelay = 100000
105 posix:eadb = $LOCKDIR/eadb.tdb
110 cifs:server = localhost
111 cifs:user = $USERNAME
112 cifs:password = $PASSWORD
113 cifs:domain = $DOMAIN
117 ./setup/provision $CONFIGURATION --quiet --domain $DOMAIN --realm $REALM \
118 --adminpass $PASSWORD --root=$ROOT || exit 1
120 if [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then
121 CONFIGURATION="$CONFIGURATION --option=\"torture:progress=no\""
126 # ensure any one smbtorture call doesn't run too long
127 TORTURE_OPTIONS="--maximum-runtime=300 $CONFIGURATION"
128 export TORTURE_OPTIONS
133 # give time for nbt server to register its names
134 echo delaying for nbt name registration
136 bin/nmblookup -U localhost localhost
140 . script/tests/tests_$TESTS.sh
145 kill `cat $PIDDIR/smbd.pid`
148 echo "START: $START ($0)";
149 echo "END: $END ($0)";
151 # if there were any valgrind failures, show them
152 count=`find $PREFIX -name 'valgrind.log*' | wc -l`
153 if [ "$count" != 0 ]; then
154 for f in $PREFIX/valgrind.log*; do
156 echo "VALGRIND FAILURE";
157 failed=`expr $failed + 1`
163 teststatus $0 $failed