1
0
mirror of https://github.com/osmarks/ngircd.git synced 2025-03-13 04:28:10 +00:00

- Backports aus CVS-HEAD: neues Script getpid.sh ermittelt nun die PID.

This commit is contained in:
Alexander Barton 2002-09-20 15:18:56 +00:00
parent 9f9f676716
commit 8c956d25b7
3 changed files with 30 additions and 20 deletions

View File

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

View File

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

View File

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