From 3aeee79096e7a3c4f1467228d5cbee6986866400 Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Sun, 25 Jan 2009 14:38:44 -0800 Subject: s3 make test: Add the ability to specify a custom smb.conf for make test - Adds new -c option to selftest.sh that when specified adds a line to make test's server.conf: "include " - Adds getopts processing to selftest.sh - Changes selftest.sh shrdir arg to use -s - Changes selftest.sh smbtorture4_path arg to use -t - Adds configure option --with-selftest-custom-conf= - Updates Makefile.in to take advantage of the new/changed parameters --- source3/script/tests/selftest.sh | 55 ++++++++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 11 deletions(-) (limited to 'source3/script') diff --git a/source3/script/tests/selftest.sh b/source3/script/tests/selftest.sh index 94fd791b51..ea2260d32d 100755 --- a/source3/script/tests/selftest.sh +++ b/source3/script/tests/selftest.sh @@ -1,17 +1,44 @@ #!/bin/sh -if [ $# != 3 -a $# != 4 ]; then - echo "$0 []" +if [ $# -lt 2 ]; then + echo "$0 [-t ] [-s ] " \ + "[-c ]" exit 1 fi -SMBTORTURE4=$3 -SUBTESTS=$2 +## +## Setup the required args +## +DIRECTORY=$1; shift; +SUBTESTS=$1; shift; + +## +## Parse oprtional args +## +while getopts s:c:t: f +do + case $f in + t) SMBTORTURE4=$OPTARG;; + s) ALT_SHRDIR_ARG=$OPTARG;; + c) CUSTOM_CONF_ARG=$OPTARG;; + esac +done + +echo "Running selftest with the following" +echo "Selftest Directory:\t\t$DIRECTORY" +echo "Subtests to Run:\t\t$SUBTESTS" +echo "smbtorture4 Path:\t\t$SMBTORTURE4" +echo "Alternative Share Dir:\t\t$ALT_SHRDIR_ARG" +echo "Custom Configuration:\t\t$CUSTOM_CONF_ARG" + +if [ $CUSTOM_CONF_ARG ]; then + INCLUDE_CUSTOM_CONF="include = $CUSTOM_CONF_ARG" +fi ## ## create the test directory ## -PREFIX=`echo $1 | sed s+//+/+` +PREFIX=`echo $DIRECTORY | sed s+//+/+` mkdir -p $PREFIX || exit $? OLD_PWD=`pwd` cd $PREFIX || exit $? @@ -68,8 +95,10 @@ export WINBINDD_SOCKET_DIR WINBINDD_PRIV_PIPE_DIR PATH=bin:$PATH export PATH -SAMBA4BINDIR=`dirname $SMBTORTURE4` -SAMBA4SHAREDDIR="$SAMBA4BINDIR/shared" +if [ $SMBTORTRE4 ]; then + SAMBA4BINDIR=`dirname $SMBTORTURE4` + SAMBA4SHAREDDIR="$SAMBA4BINDIR/shared" +fi export SAMBA4SHAREDDIR export SMBTORTURE4 @@ -116,8 +145,8 @@ chmod 755 $WINBINDD_SOCKET_DIR ## ## Create an alternate shrdir if one was specified. ## -if [ $# = 4 ]; then - ALT_SHRDIR=`echo $4 | sed s+//+/+` +if [ $ALT_SHRDIR_ARG ]; then + ALT_SHRDIR=`echo $ALT_SHRDIR_ARG | sed s+//+/+` mkdir -p $ALT_SHRDIR || exit $? OLD_PWD=`pwd` cd $ALT_SHRDIR || exit $? @@ -200,8 +229,6 @@ cat >$SERVERCONFFILE<$SERVERCONFFILE<