1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

make test: start winbindd

metze
This commit is contained in:
Stefan Metzmacher 2007-10-24 13:18:42 +02:00
parent bb125f3e08
commit 8ad4287cca
3 changed files with 71 additions and 1 deletions

View File

@ -2049,6 +2049,7 @@ test: all torture timelimit
valgrindtest: all torture timelimit
@echo Running Test suite with valgrind
@NMBD_VALGRIND="xterm -n nmbd -e valgrind -q --db-attach=yes --num-callers=30" \
WINBINDD_VALGRIND="xterm -n winbindd -e valgrind -q --db-attach=yes --num-callers=30" \
SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/st/valgrind.log" \
PERL="$(PERL)" $(srcdir)/script/tests/selftest.sh ${selftest_prefix}/st all "${smbtorture4_path}"

View File

@ -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

View File

@ -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" || {