2 samba3_stop_sig_term
() {
4 kill -USR1 `cat $PIDDIR/timelimit.nmbd.pid` >/dev
/null
2>&1 || \
5 kill -ALRM `cat $PIDDIR/timelimit.nmbd.pid` || RET
=$?
7 kill -USR1 `cat $PIDDIR/timelimit.smbd.pid` >/dev
/null
2>&1 || \
8 kill -ALRM `cat $PIDDIR/timelimit.smbd.pid` || RET
=$?
13 samba3_stop_sig_kill
() {
14 kill -ALRM `cat $PIDDIR/timelimit.nmbd.pid` >/dev
/null
2>&1
15 kill -ALRM `cat $PIDDIR/timelimit.smbd.pid` >/dev
/null
2>&1
19 samba3_check_or_start
() {
20 if [ -n "$SERVER_TEST_FIFO" ];then
22 trap samba3_stop_sig_kill INT QUIT
23 trap samba3_stop_sig_kill TERM
25 if [ -p "$SERVER_TEST_FIFO" ];then
29 if [ -n "$SOCKET_WRAPPER_DIR" ];then
30 if [ -d "$SOCKET_WRAPPER_DIR" ]; then
31 rm -f $SOCKET_WRAPPER_DIR/*
33 mkdir
-p $SOCKET_WRAPPER_DIR
37 rm -f $SERVER_TEST_FIFO
38 mkfifo $SERVER_TEST_FIFO
41 echo -n "STARTING NMBD..."
43 if ! test -n "$NMBD_MAXTIME"; then
46 timelimit
$NMBD_MAXTIME $NMBD_VALGRIND $SRCDIR/bin
/nmbd
-F -S --no-process-group -d0 -s $SERVERCONFFILE > $NMBD_TEST_LOG 2>&1 &
48 echo $TIMELIMIT_NMBD_PID > $PIDDIR/timelimit.nmbd.pid
49 wait $TIMELIMIT_NMBD_PID
51 rm -f $SERVER_TEST_FIFO
52 if [ -n "$SOCKET_WRAPPER_DIR" -a -d "$SOCKET_WRAPPER_DIR" ]; then
53 rm -f $SOCKET_WRAPPER_DIR/*
55 if [ x
"$ret" = x
"0" ];then
56 echo "nmbd exits with status $ret";
57 echo "nmbd exits with status $ret" >>$NMBD_TEST_LOG;
58 elif [ x
"$ret" = x
"137" ];then
59 echo "nmbd got SIGXCPU and exits with status $ret!"
60 echo "nmbd got SIGXCPU and exits with status $ret!">>$NMBD_TEST_LOG;
62 echo "nmbd failed with status $ret!"
63 echo "nmbd failed with status $ret!">>$NMBD_TEST_LOG;
66 ) ||
exit $?
&) 2>/dev
/null ||
exit $?
70 echo -n "STARTING SMBD..."
72 if ! test -n "$SMBD_MAXTIME"; then
75 timelimit
$SMBD_MAXTIME $SMBD_VALGRIND $SRCDIR/bin
/smbd
-F -S --no-process-group -d0 -s $SERVERCONFFILE > $SMBD_TEST_LOG 2>&1 &
77 echo $TIMELIMIT_SMBD_PID > $PIDDIR/timelimit.smbd.pid
78 wait $TIMELIMIT_SMBD_PID
80 rm -f $SERVER_TEST_FIFO
81 if [ -n "$SOCKET_WRAPPER_DIR" -a -d "$SOCKET_WRAPPER_DIR" ]; then
82 rm -f $SOCKET_WRAPPER_DIR/*
84 if [ x
"$ret" = x
"0" ];then
85 echo "smbd exits with status $ret";
86 echo "smbd exits with status $ret" >>$SMBD_TEST_LOG;
87 elif [ x
"$ret" = x
"137" ];then
88 echo "smbd got SIGXCPU and exits with status $ret!"
89 echo "smbd got SIGXCPU and exits with status $ret!">>$SMBD_TEST_LOG;
91 echo "smbd failed with status $ret!"
92 echo "smbd failed with status $ret!">>$SMBD_TEST_LOG;
95 ) ||
exit $?
&) 2>/dev
/null ||
exit $?
101 samba3_nmbd_test_log
() {
102 if [ -n "$NMBD_TEST_LOG" ];then
103 if [ -r "$NMBD_TEST_LOG" ];then
110 samba3_smbd_test_log
() {
111 if [ -n "$SMBD_TEST_LOG" ];then
112 if [ -r "$SMBD_TEST_LOG" ];then
119 samba3_check_only
() {
120 if [ -n "$SERVER_TEST_FIFO" ];then
121 if [ -p "$SERVER_TEST_FIFO" ];then
130 if [ -z "$PREFIX" ]; then
137 TEST_LOG
="$PREFIX/test_log.$$"
138 trap "rm -f $TEST_LOG" EXIT
141 if [ x
"$RUN_FROM_BUILD_FARM" = x
"yes" ];then
142 echo "--==--==--==--==--==--==--==--==--==--==--"
143 echo "Running test $name (level 0 stdout)"
144 echo "--==--==--==--==--==--==--==--==--==--==--"
148 echo "Testing $name ($failed)"
151 samba3_check_only
&& SERVERS_ARE_UP
="yes"
152 if [ x
"$SERVERS_ARE_UP" != x
"yes" ];then
153 if [ x
"$RUN_FROM_BUILD_FARM" = x
"yes" ];then
154 echo "SERVERS are down! Skipping: $cmdline"
155 echo "=========================================="
156 echo "TEST SKIPPED: $name (reason SERVERS are down)"
157 echo "=========================================="
159 echo "TEST SKIPPED: $name (reason SERVERS are down)"
164 ( $cmdline > $TEST_LOG 2>&1 )
166 if [ x
"$status" != x
"0" ]; then
169 samba3_nmbd_test_log
&& echo "NMBD OUTPUT:";
170 samba3_nmbd_test_log
&& cat $NMBD_TEST_LOG;
171 samba3_smbd_test_log
&& echo "SMBD OUTPUT:";
172 samba3_smbd_test_log
&& cat $SMBD_TEST_LOG;
174 if [ x
"$RUN_FROM_BUILD_FARM" = x
"yes" ];then
175 echo "=========================================="
176 echo "TEST FAILED: $name (status $status)"
177 echo "=========================================="
179 echo "TEST FAILED: $cmdline (status $status)"
184 if [ x
"$RUN_FROM_BUILD_FARM" = x
"yes" ];then
185 echo "ALL OK: $cmdline"
186 echo "=========================================="
187 echo "TEST PASSED: $name"
188 echo "=========================================="
197 if [ x
"$failed" = x
"0" ];then
200 echo "$failed TESTS FAILED or SKIPPED ($name)";
209 if [ x
"$failed" = x
"0" ];then
210 echo "TEST STATUS: $failed";
212 echo "TEST STATUS: $failed";
217 if [ -z "$VALGRIND" ]; then