#!/bin/sh if [ $# != 3 ]; then echo "$0 " exit 1 fi SMBTORTURE4=$3 TESTS=$2 ## ## create the test directory ## PREFIX=`echo $1 | sed s+//+/+` mkdir -p $PREFIX || exit $? OLD_PWD=`pwd` cd $PREFIX || exit $? PREFIX_ABS=`pwd` cd $OLD_PWD if [ -z "$TORTURE_MAXTIME" ]; then TORTURE_MAXTIME=300 fi export TORTURE_MAXTIME ## ## setup the various environment variables we need ## SERVER=localhost2 SERVER_IP=127.0.0.2 USERNAME=`PATH=/usr/ucb:$PATH whoami` USERID=`PATH=/usr/ucb:$PATH id | cut -d ' ' -f1 | sed -e 's/uid=\([0-9]*\).*/\1/g'` GROUPID=`PATH=/usr/ucb:$PATH id | cut -d ' ' -f2 | sed -e 's/gid=\([0-9]*\).*/\1/g'` PASSWORD=test SRCDIR="`dirname $0`/../.." BINDIR="`pwd`/bin" SCRIPTDIR=$SRCDIR/script/tests SHRDIR=$PREFIX_ABS/tmp LIBDIR=$PREFIX_ABS/lib PIDDIR=$PREFIX_ABS/pid CONFFILE=$LIBDIR/client.conf SAMBA4CONFFILE=$LIBDIR/samba4client.conf SERVERCONFFILE=$LIBDIR/server.conf COMMONCONFFILE=$LIBDIR/common.conf PRIVATEDIR=$PREFIX_ABS/private LOCKDIR=$PREFIX_ABS/lockdir LOGDIR=$PREFIX_ABS/logs SOCKET_WRAPPER_DIR=$PREFIX/sw CONFIGURATION="-s $CONFFILE" SAMBA4CONFIGURATION="-s $SAMBA4CONFFILE" NSS_WRAPPER_PASSWD="$PRIVATEDIR/passwd" NSS_WRAPPER_GROUP="$PRIVATEDIR/group" WINBINDD_SOCKET_DIR=$PREFIX_ABS/winbindd WINBINDD_PRIV_PIPE_DIR=$LOCKDIR/winbindd_privileged export PREFIX PREFIX_ABS export CONFIGURATION CONFFILE SAMBA4CONFIGURATION SAMBA4CONFFILE export PATH SOCKET_WRAPPER_DIR DOMAIN export PRIVATEDIR LIBDIR PIDDIR LOCKDIR LOGDIR SERVERCONFFILE export SRCDIR SCRIPTDIR BINDIR export USERNAME PASSWORD export SMBTORTURE4 export SERVER SERVER_IP export NSS_WRAPPER_PASSWD NSS_WRAPPER_GROUP export WINBINDD_SOCKET_DIR WINBINDD_PRIV_PIPE_DIR PATH=bin:$PATH export PATH ## ## verify that we were built with --enable-socket-wrapper ## if test "x`smbd -b | grep SOCKET_WRAPPER`" = "x"; then echo "***" echo "*** You must include --enable-socket-wrapper when compiling Samba" echo "*** in order to execute 'make test'. Exiting...." echo "***" exit 1 fi if test "x`smbd -b | grep NSS_WRAPPER`" = "x"; then echo "***" echo "*** You must include --enable-nss-wrapper when compiling Samba" echo "*** in order to execute 'make test'. Exiting...." echo "***" exit 1 fi ## ## create the test directory layout ## echo -n "CREATE TEST ENVIRONMENT IN '$PREFIX'"... /bin/rm -rf $PREFIX/* mkdir -p $PRIVATEDIR $LIBDIR $PIDDIR $LOCKDIR $LOGDIR mkdir -p $SOCKET_WRAPPER_DIR mkdir -p $WINBINDD_SOCKET_DIR chmod 755 $WINBINDD_SOCKET_DIR mkdir -p $PREFIX_ABS/tmp chmod 777 $PREFIX_ABS/tmp ## ## Create the common config include file with the basic settings ## cat >$COMMONCONFFILE<$CONFFILE<$SAMBA4CONFFILE<$SERVERCONFFILE<