diff options
Diffstat (limited to 'src/testsuite')
| -rw-r--r-- | src/testsuite/.gitignore | 1 | ||||
| -rw-r--r-- | src/testsuite/Makefile.ng (renamed from src/testsuite/Makefile.am) | 21 | ||||
| -rwxr-xr-x | src/testsuite/getpid.sh | 2 | ||||
| -rw-r--r-- | src/testsuite/mode-test.e | 68 | ||||
| -rwxr-xr-x | src/testsuite/stress-server.sh | 7 | ||||
| -rwxr-xr-x | src/testsuite/tests.sh | 12 |
6 files changed, 93 insertions, 18 deletions
diff --git a/src/testsuite/.gitignore b/src/testsuite/.gitignore index 5884a486..b33a08f4 100644 --- a/src/testsuite/.gitignore +++ b/src/testsuite/.gitignore @@ -1,3 +1,4 @@ +Makefile.am T-ngircd1 T-ngircd2 channel-test diff --git a/src/testsuite/Makefile.am b/src/testsuite/Makefile.ng index 9dc76a7d..b906091e 100644 --- a/src/testsuite/Makefile.am +++ b/src/testsuite/Makefile.ng @@ -1,21 +1,20 @@ # # ngIRCd -- The Next Generation IRC Daemon -# Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors. +# Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors # -# Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen -# der GNU General Public License (GPL), wie von der Free Software Foundation -# herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2 -# der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version. -# Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste -# der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# Please read the file COPYING, README and AUTHORS for more information. # -AUTOMAKE_OPTIONS = ../portab/ansi2knr +__ng_Makefile_am_template__ -INCLUDES = -I$(srcdir)/../portab +AM_CPPFLAGS = -I$(srcdir)/../portab EXTRA_DIST = \ - README functions.inc getpid.sh \ + Makefile.ng README functions.inc getpid.sh \ start-server.sh stop-server.sh tests.sh stress-server.sh \ test-loop.sh wait-tests.sh \ channel-test.e connect-test.e check-idle.e invite-test.e \ @@ -32,7 +31,7 @@ clean-local: T-ngircd1 ngircd-test1.motd T-ngircd2 ngircd-test2.motd maintainer-clean-local: - rm -f Makefile Makefile.in + rm -f Makefile Makefile.in Makefile.am check_SCRIPTS = ngircd-TEST-Binary tests.sh diff --git a/src/testsuite/getpid.sh b/src/testsuite/getpid.sh index 19ced762..96ab4746 100755 --- a/src/testsuite/getpid.sh +++ b/src/testsuite/getpid.sh @@ -10,7 +10,7 @@ UNAME=`uname` if [ $UNAME = "FreeBSD" ]; then PS_FLAGS="-a"; PS_PIDCOL="1"; HEAD_FLAGS="-n 1" elif [ $UNAME = "A/UX" ]; then - PS_FLAGS="-ae"; PS_PIDCOL="1"; HEAD_FLAGS="-1" + PS_FLAGS="-af"; PS_PIDCOL="2"; HEAD_FLAGS="-1" elif [ $UNAME = "GNU" ]; then PS_FLAGS="-ax"; PS_PIDCOL="2"; HEAD_FLAGS="-n 1" elif [ $UNAME = "Linux" ]; then diff --git a/src/testsuite/mode-test.e b/src/testsuite/mode-test.e index 260cd03c..44b6e5df 100644 --- a/src/testsuite/mode-test.e +++ b/src/testsuite/mode-test.e @@ -31,6 +31,46 @@ expect { "@* MODE nick :-i" } +send "join #usermode\r" +expect { + timeout { exit 1 } + "@* JOIN :#usermode" +} +expect { + timeout { exit 1 } + "366" +} + +send "mode #usermode +v nick\r" +expect { + timeout { exit 1 } + "@* MODE #usermode +v nick\r" +} + +send "mode #usermode +h nick\r" +expect { + timeout { exit 1 } + "@* MODE #usermode +h nick\r" +} + +send "mode #usermode +a nick\r" +expect { + timeout { exit 1 } + "482 nick" +} + +send "mode #usermode +q nick\r" +expect { + timeout { exit 1 } + "482 nick" +} + +send "mode #usermode -vho nick nick nick\r" +expect { + timeout { exit 1 } + "@* MODE #usermode -vho nick nick nick" +} + send "oper TestOp 123\r" expect { timeout { exit 1 } @@ -47,6 +87,34 @@ expect { "221 nick +o" } +send "mode #usermode +a nick\r" +expect { + timeout { exit 1 } + "@* MODE #usermode +a nick" +} + +send "mode #usermode +q nick\r" +expect { + timeout { exit 1 } + "@* MODE #usermode +q nick" +} + +send "names #usermode\r" +expect { + timeout { exit 1 } + "353 nick = #usermode :~nick" +} +expect { + timeout { exit 1 } + "366 nick #usermode" +} + +send "part #usermode\r" +expect { + timeout { exit 1 } + "@* PART #usermode" +} + send "join #channel\r" expect { timeout { exit 1 } diff --git a/src/testsuite/stress-server.sh b/src/testsuite/stress-server.sh index 0f85958e..15d6df1f 100755 --- a/src/testsuite/stress-server.sh +++ b/src/testsuite/stress-server.sh @@ -1,7 +1,7 @@ #!/bin/sh # # ngIRCd Test Suite -# Copyright (c)2002-2004 by Alexander Barton (alex@barton.de) +# Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -9,8 +9,6 @@ # (at your option) any later version. # Please read the file COPYING, README and AUTHORS for more information. # -# $Id: stress-server.sh,v 1.16 2005/12/30 22:13:21 alex Exp $ -# # detect source directory [ -z "$srcdir" ] && srcdir=`dirname $0` @@ -23,7 +21,8 @@ name=`basename $0` # create directories -mkdir -p logs tests +[ -d logs ] || mkdir logs +[ -d tests ] || mkdir tests # test for required external tools type expect > /dev/null 2>&1 diff --git a/src/testsuite/tests.sh b/src/testsuite/tests.sh index 2bd9ae40..dc184ffc 100755 --- a/src/testsuite/tests.sh +++ b/src/testsuite/tests.sh @@ -1,13 +1,21 @@ #!/bin/sh +# # ngIRCd Test Suite -# $Id: tests.sh,v 1.7 2004/09/06 22:04:06 alex Exp $ +# Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# Please read the file COPYING, README and AUTHORS for more information. +# # detect source directory [ -z "$srcdir" ] && srcdir=`dirname $0` name=`basename $0` test=`echo ${name} | cut -d '.' -f 1` -mkdir -p logs +[ -d logs ] || mkdir logs if [ ! -r "$test" ]; then echo " ${name}: test \"$test\" not found!"; exit 77 |