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

- Test-Suite an A/UX angepasst.

This commit is contained in:
Alexander Barton 2002-11-10 14:28:06 +00:00
parent 071686ac6e
commit 797f9170d7
4 changed files with 16 additions and 14 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.8 2002/09/20 15:39:24 alex Exp $
# $Id: Makefile.am,v 1.9 2002/11/10 14:28:06 alex Exp $
#
AUTOMAKE_OPTIONS = ../portab/ansi2knr
@ -25,7 +25,7 @@ EXTRA_DIST = \
clean-local:
rm -rf logs tests *-test ngircd-test.log ngircd-test.motd \
ngircd-TEST* procs.tmp
T-ngircd procs.tmp
maintainer-clean-local:
rm -f Makefile Makefile.in
@ -33,7 +33,7 @@ maintainer-clean-local:
check_SCRIPTS = ngircd-TEST-Binary tests.sh
ngircd-TEST-Binary:
cp ../ngircd/ngircd ngircd-TEST
cp ../ngircd/ngircd T-ngircd
[ -f getpid.sh ] || ln -s $(srcdir)/getpid.sh .
connect-test: tests.sh

View File

@ -1,22 +1,24 @@
#!/bin/sh
# ngIRCd Test Suite
# $Id: getpid.sh,v 1.1 2002/09/20 14:46:55 alex Exp $
# $Id: getpid.sh,v 1.2 2002/11/10 14:28:06 alex Exp $
# wurde ein Name uebergeben?
[ $# -ne 1 ] && exit 1
# Flags fuer "ps" ermitteln
if [ `uname` = "FreeBSD" ]; then
PS_FLAGS=-a; PS_PIDCOL=1
PS_FLAGS="-a"; PS_PIDCOL="1"; HEAD_FLAGS="-n 1"
elif [ `uname` = "A/UX" ]; then
PS_FLAGS="-ae"; PS_PIDCOL="1"; HEAD_FLAGS="-1"
else
PS_FLAGS=-f; PS_PIDCOL=2
PS_FLAGS="-f"; PS_PIDCOL="2"; HEAD_FLAGS="-n 1"
ps $PS_FLAGS > /dev/null 2>&1
if [ $? -ne 0 ]; then PS_FLAGS=a; PS_PIDCOL=1; fi
if [ $? -ne 0 ]; then PS_FLAGS="a"; PS_PIDCOL="1"; fi
fi
# PID ermitteln
ps $PS_FLAGS > procs.tmp
pid=`cat procs.tmp | grep "$1" | awk "{ print \\\$$PS_PIDCOL }" | sort -n | head -n 1`
pid=$( cat procs.tmp | grep "$1" | awk "{print \$$PS_PIDCOL}" | sort -n | head $HEAD_FLAGS )
# ermittelte PID validieren
[ "$pid" -gt 1 ] > /dev/null 2>&1

View File

@ -1,6 +1,6 @@
#!/bin/sh
# ngIRCd Test Suite
# $Id: start-server.sh,v 1.9 2002/09/23 22:07:42 alex Exp $
# $Id: start-server.sh,v 1.10 2002/11/10 14:28:06 alex Exp $
[ -z "$srcdir" ] && srcdir=`dirname $0`
@ -12,7 +12,7 @@ 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
./getpid.sh sh > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo " error: getpid.sh FAILED!"
exit 1
@ -22,11 +22,11 @@ fi
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 &
./T-ngircd -np -f ${srcdir}/ngircd-test.conf > ngircd-test.log 2>&1 &
sleep 1
# validieren, dass Server laeuft
pid=`./getpid.sh ngircd-TEST`
pid=`./getpid.sh T-ngircd`
[ -n "$pid" ] && kill -0 $pid > /dev/null 2>&1 || exit 1
# -eof-

View File

@ -1,13 +1,13 @@
#!/bin/sh
# ngIRCd Test Suite
# $Id: stop-server.sh,v 1.8 2002/09/23 22:07:42 alex Exp $
# $Id: stop-server.sh,v 1.9 2002/11/10 14:28:06 alex Exp $
[ -z "$srcdir" ] && srcdir=`dirname $0`
echo " stopping server ..."
# Test-Server stoppen ...
pid=`./getpid.sh ngircd-TEST`
pid=`./getpid.sh T-ngircd`
[ -n "$pid" ] && kill $pid > /dev/null 2>&1 || exit 1
sleep 1