summaryrefslogtreecommitdiff
path: root/source3/script/tests
diff options
context:
space:
mode:
Diffstat (limited to 'source3/script/tests')
-rwxr-xr-xsource3/script/tests/selftest.sh14
-rw-r--r--source3/script/tests/test_functions.sh57
2 files changed, 70 insertions, 1 deletions
diff --git a/source3/script/tests/selftest.sh b/source3/script/tests/selftest.sh
index 0801ec5c2c..dc9b4c2cb8 100755
--- a/source3/script/tests/selftest.sh
+++ b/source3/script/tests/selftest.sh
@@ -52,6 +52,8 @@ 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
@@ -62,6 +64,7 @@ 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
@@ -92,7 +95,10 @@ fi
##
echo -n "CREATE TEST ENVIRONMENT IN '$PREFIX'"...
/bin/rm -rf $PREFIX/*
-mkdir -p $PRIVATEDIR $LIBDIR $PIDDIR $LOCKDIR $LOGDIR $SOCKET_WRAPPER_DIR
+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
@@ -153,6 +159,10 @@ cat >$SERVERCONFFILE<<EOF
printing = bsd
printcap name = /dev/null
+ winbindd:socket dir = $WINBINDD_SOCKET_DIR
+ idmap uid = 100000-200000
+ idmap gid = 100000-200000
+
# min receivefile size = 4000
[tmp]
@@ -204,6 +214,8 @@ SERVER_TEST_FIFO="$PREFIX/server_test.fifo"
export SERVER_TEST_FIFO
NMBD_TEST_LOG="$PREFIX/nmbd_test.log"
export NMBD_TEST_LOG
+WINBINDD_TEST_LOG="$PREFIX/winbindd_test.log"
+export WINBINDD_TEST_LOG
SMBD_TEST_LOG="$PREFIX/smbd_test.log"
export SMBD_TEST_LOG
diff --git a/source3/script/tests/test_functions.sh b/source3/script/tests/test_functions.sh
index 1cc9ea1264..d707c30960 100644
--- a/source3/script/tests/test_functions.sh
+++ b/source3/script/tests/test_functions.sh
@@ -4,6 +4,9 @@ samba3_stop_sig_term() {
kill -USR1 `cat $PIDDIR/timelimit.nmbd.pid` >/dev/null 2>&1 || \
kill -ALRM `cat $PIDDIR/timelimit.nmbd.pid` || RET=$?
+ kill -USR1 `cat $PIDDIR/timelimit.winbindd.pid` >/dev/null 2>&1 || \
+ kill -ALRM `cat $PIDDIR/timelimit.winbindd.pid` || RET=$?
+
kill -USR1 `cat $PIDDIR/timelimit.smbd.pid` >/dev/null 2>&1 || \
kill -ALRM `cat $PIDDIR/timelimit.smbd.pid` || RET=$?
@@ -12,6 +15,7 @@ samba3_stop_sig_term() {
samba3_stop_sig_kill() {
kill -ALRM `cat $PIDDIR/timelimit.nmbd.pid` >/dev/null 2>&1
+ kill -ALRM `cat $PIDDIR/timelimit.winbindd.pid` >/dev/null 2>&1
kill -ALRM `cat $PIDDIR/timelimit.smbd.pid` >/dev/null 2>&1
return 0;
}
@@ -69,6 +73,38 @@ samba3_check_or_start() {
) || exit $? &) 2>/dev/null || exit $?
echo "DONE"
+ rm -f $WINBINDD_TEST_LOG
+ echo -n "STARTING WINBINDD..."
+ ((
+ if test x"$WINBINDD_MAXTIME" = x; then
+ WINBINDD_MAXTIME=2700
+ fi
+ MAKE_TEST_BINARY=$BINDIR/winbindd
+ export MAKE_TEST_BINARY
+ timelimit $WINBINDD_MAXTIME $WINBINDD_VALGRIND $BINDIR/winbindd -F -S --no-process-group -d0 -s $SERVERCONFFILE > $WINBINDD_TEST_LOG 2>&1 &
+ TIMELIMIT_WINBINDD_PID=$!
+ MAKE_TEST_BINARY=
+ echo $TIMELIMIT_WINBINDD_PID > $PIDDIR/timelimit.winbindd.pid
+ wait $TIMELIMIT_WINBINDD_PID
+ ret=$?;
+ rm -f $SERVER_TEST_FIFO
+ if [ -n "$SOCKET_WRAPPER_DIR" -a -d "$SOCKET_WRAPPER_DIR" ]; then
+ rm -f $SOCKET_WRAPPER_DIR/*
+ fi
+ if [ x"$ret" = x"0" ];then
+ echo "winbindd exits with status $ret";
+ echo "winbindd exits with status $ret" >>$WINBINDD_TEST_LOG;
+ elif [ x"$ret" = x"137" ];then
+ echo "winbindd got SIGXCPU and exits with status $ret!"
+ echo "winbindd got SIGXCPU and exits with status $ret!">>$WINBINDD_TEST_LOG;
+ else
+ echo "winbindd failed with status $ret!"
+ echo "winbindd failed with status $ret!">>$WINBINDD_TEST_LOG;
+ fi
+ exit $ret;
+ ) || exit $? &) 2>/dev/null || exit $?
+ echo "DONE"
+
rm -f $SMBD_TEST_LOG
echo -n "STARTING SMBD..."
((
@@ -113,6 +149,15 @@ samba3_nmbd_test_log() {
return 1;
}
+samba3_winbindd_test_log() {
+ if [ -n "$WINBINDD_TEST_LOG" ];then
+ if [ -r "$WINBINDD_TEST_LOG" ];then
+ return 0;
+ fi
+ fi
+ return 1;
+}
+
samba3_smbd_test_log() {
if [ -n "$SMBD_TEST_LOG" ];then
if [ -r "$SMBD_TEST_LOG" ];then
@@ -155,6 +200,9 @@ testit() {
if [ -z "$nmbd_log_size" ]; then
nmbd_log_size=`wc -l < $NMBD_TEST_LOG`;
fi
+ if [ -z "$winbindd_log_size" ]; then
+ winbindd_log_size=`wc -l < $WINBINDD_TEST_LOG`;
+ fi
if [ -z "$smbd_log_size" ]; then
smbd_log_size=`wc -l < $SMBD_TEST_LOG`;
fi
@@ -202,6 +250,15 @@ testit() {
nmbd_log_size=$new_log_size;
}
}
+ samba3_winbindd_test_log && {
+ new_log_size=`wc -l < $WINBINDD_TEST_LOG`;
+ test "$new_log_size" = "$winbindd_log_size" || {
+ echo "WINBINDD OUTPUT:";
+ incr_log_size=`expr $new_log_size - $winbindd_log_size`;
+ tail -$incr_log_size $WINBINDD_TEST_LOG;
+ winbindd_log_size=$new_log_size;
+ }
+ }
samba3_smbd_test_log && {
new_log_size=`wc -l < $SMBD_TEST_LOG`;
test "$new_log_size" = "$smbd_log_size" || {