commit 8c956d25b7ae76b92b59a8c7ce0fe47d1385808c from: Alexander Barton date: Fri Sep 20 15:18:56 2002 UTC - Backports aus CVS-HEAD: neues Script getpid.sh ermittelt nun die PID. commit - 9f9f6767160243892938ec3dc836420c7b0b71bc commit + 8c956d25b7ae76b92b59a8c7ce0fe47d1385808c blob - 271aeb292ec12e646519f7bc2fd040c6cfffa81b blob + fd79811ac57ab076c9ea8bab4318e44ff23711dd --- src/testsuite/Makefile.am +++ src/testsuite/Makefile.am @@ -9,7 +9,7 @@ # Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste # der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. # -# $Id: Makefile.am,v 1.3 2002/09/12 02:26:17 alex Exp $ +# $Id: Makefile.am,v 1.3.2.1 2002/09/20 15:18:56 alex Exp $ # AUTOMAKE_OPTIONS = ../portab/ansi2knr @@ -17,21 +17,23 @@ AUTOMAKE_OPTIONS = ../portab/ansi2knr INCLUDES = -I$(srcdir)/../portab EXTRA_DIST = \ + getpid.sh \ start-server.sh stop-server.sh tests.sh stress-server.sh \ connect-test.e channel-test.e mode-test.e \ stress-A.e stress-B.e check-idle.e \ ngircd-test.conf clean-local: - rm -rf logs tests *-test ngircd-test.log ngircd-test.motd ngircd-TEST procs.tmp + rm -rf logs tests *-test ngircd-test.log ngircd-test.motd \ + ngircd-TEST* procs.tmp maintainer-clean-local: rm -f Makefile Makefile.in -check_SCRIPTS = ngircd-TEST tests.sh +check_SCRIPTS = ngircd-TEST-Binary tests.sh -ngircd-TEST: - ln -s ../ngircd/ngircd ngircd-TEST +ngircd-TEST-Binary: + cp ../ngircd/ngircd ngircd-TEST connect-test: tests.sh ln -s $(srcdir)/tests.sh connect-test blob - 2cf6280e67ea5ebe1ecd5261df9e6c7e8ccb38c0 blob + acd7a6310632385651122d9fbd2c9cd8bd7f79aa --- src/testsuite/start-server.sh +++ src/testsuite/start-server.sh @@ -1,22 +1,30 @@ #!/bin/sh # ngIRCd Test Suite -# $Id: start-server.sh,v 1.5.2.2 2002/09/20 13:55:51 alex Exp $ +# $Id: start-server.sh,v 1.5.2.3 2002/09/20 15:18:56 alex Exp $ echo " starting server ..." -rm -rf logs +# alte Logfiles loeschen +rm -rf logs *.log +# pruefen, ob getpid.sh gueltige PID's liefert. Wenn dem nicht so ist, +# wird kein ngIRCd gestartet, da dieser ansonsten nicht mehr am Ende +# des Testlaufs beendet werden koennte! +./getpid.sh make > /dev/null 2>&1 +if [ $? -ne 0 ]; then + echo " error: getpid.sh FAILED!" + exit 1 +fi + +# MOTD fuer Test-Server erzeugen echo "This is an ngIRCd Test Server" > ngircd-test.motd +# Test-Server starten ... ./ngircd-TEST -np -f ${srcdir}/ngircd-test.conf > ngircd-test.log 2>&1 & sleep 1 -PS_FLAGS=-f; PS_PIDCOL=2 -ps $PS_FLAGS > /dev/null 2>&1 -if [ $? -ne 0 ]; then PS_FLAGS=a; PS_PIDCOL=1; fi - -ps $PS_FLAGS > procs.tmp -pid=`cat procs.tmp | grep ngircd-TEST | awk "{ print \\\$$PS_PIDCOL }"` +# validieren, dass Server laeuft +pid=`./getpid.sh ngircd-TEST` [ -n "$pid" ] && kill -0 $pid > /dev/null 2>&1 || exit 1 # -eof- blob - ac9540d0f13e459a51489274cf6e5c145949bed2 blob + 774e01610ec26d7921ae78c60047e9a12fbdfe0a --- src/testsuite/stop-server.sh +++ src/testsuite/stop-server.sh @@ -1,15 +1,15 @@ #!/bin/sh # ngIRCd Test Suite -# $Id: stop-server.sh,v 1.4.2.2 2002/09/20 13:55:51 alex Exp $ +# $Id: stop-server.sh,v 1.4.2.3 2002/09/20 15:18:56 alex Exp $ echo " stopping server ..." -PS_FLAGS=-f; PS_PIDCOL=2 -ps $PS_FLAGS > /dev/null 2>&1 -if [ $? -ne 0 ]; then PS_FLAGS=a; PS_PIDCOL=1; fi +# Test-Server stoppen ... +pid=`./getpid.sh ngircd-TEST` +[ -n "$pid" ] && kill $pid > /dev/null 2>&1 || exit 1 +sleep 1 -ps $PS_FLAGS > procs.tmp -pid=`cat procs.tmp | grep ngircd-TEST | awk "{ print \\\$$PS_PIDCOL }"` -[ -n "$pid" ] && kill -0 $pid > /dev/null 2>&1 || exit 1 +# jetzt duerfte der Prozess nicht mehr laufen +kill -0 $pid > /dev/null 2>&1 && exit 1 || exit 0 # -eof-