diff options
| author | Dana Dahlstrom <dana+70@cs.ucsd.edu> | 2008-02-17 00:00:12 +0000 |
|---|---|---|
| committer | Florian Westphal <fw@strlen.de> | 2008-02-26 23:49:33 +0100 |
| commit | 2f71fbb2a1319d1b0aca4c9564c2e51a88b4a578 (patch) | |
| tree | 52cfbeb9ce84e266f64b1b3cdc24a701b3922e3e /src/testsuite | |
| parent | 1784180bf346b6cbea86dabb0e4fdf592b19b012 (diff) | |
| download | ngircd-2f71fbb2a1319d1b0aca4c9564c2e51a88b4a578.tar.gz ngircd-2f71fbb2a1319d1b0aca4c9564c2e51a88b4a578.zip | |
Include flags in RPL_WHOREPLY messages.
RPL_WHOREPLY messages generated by IRC_WHO don't include flags (*,@,+) that should appear according to this description: http://www.mishscript.de/reference/rawhelp3.htm#raw352 Other IRC servers do include the flags. Modify who-test.e to expose missing flags, modify ngircd-test.conf to accommodate who-test.e, and fix irc-info.c to correct these problems.
Diffstat (limited to 'src/testsuite')
| -rw-r--r-- | src/testsuite/Makefile.am | 12 | ||||
| -rw-r--r-- | src/testsuite/ngircd-test.conf | 3 | ||||
| -rw-r--r-- | src/testsuite/who-away-test.e | 100 | ||||
| -rw-r--r-- | src/testsuite/who-test.e | 162 |
4 files changed, 170 insertions, 107 deletions
diff --git a/src/testsuite/Makefile.am b/src/testsuite/Makefile.am index 58a617ee..6ea9597c 100644 --- a/src/testsuite/Makefile.am +++ b/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.16 2008/02/11 11:06:32 fw Exp $ +# $Id: Makefile.am,v 1.17 2008/02/17 00:00:13 fw Exp $ # AUTOMAKE_OPTIONS = ../portab/ansi2knr @@ -21,7 +21,7 @@ EXTRA_DIST = \ start-server.sh stop-server.sh tests.sh stress-server.sh \ test-loop.sh wait-tests.sh \ connect-test.e channel-test.e mode-test.e \ - who-away-test.e + who-test.e stress-A.e stress-B.e check-idle.e \ ngircd-test.conf @@ -48,9 +48,9 @@ channel-test: tests.sh rm -f channel-test ln -s $(srcdir)/tests.sh channel-test -who-away-test: tests.sh - rm -f who-away-test - ln -s $(srcdir)/tests.sh who-away-test +who-test: tests.sh + rm -f who-test + ln -s $(srcdir)/tests.sh who-test mode-test: tests.sh rm -f mode-test @@ -59,7 +59,7 @@ mode-test: tests.sh TESTS = start-server.sh \ connect-test \ channel-test \ - who-away-test \ + who-test \ mode-test \ stress-server.sh \ stop-server.sh diff --git a/src/testsuite/ngircd-test.conf b/src/testsuite/ngircd-test.conf index 3f0ffe95..5b1fbe33 100644 --- a/src/testsuite/ngircd-test.conf +++ b/src/testsuite/ngircd-test.conf @@ -1,4 +1,4 @@ -# $Id: ngircd-test.conf,v 1.5 2007/11/18 15:07:16 alex Exp $ +# $Id: ngircd-test.conf,v 1.6 2008/02/17 00:00:13 fw Exp $ [Global] Name = ngircd.test.server @@ -9,6 +9,7 @@ MaxConnectionsIP = 0 ServerUID = 1 ServerGID = 1 + OperCanUseMode = yes [Operator] Name = TestOp diff --git a/src/testsuite/who-away-test.e b/src/testsuite/who-away-test.e deleted file mode 100644 index e5e442a0..00000000 --- a/src/testsuite/who-away-test.e +++ /dev/null @@ -1,100 +0,0 @@ -# $Id: who-away-test.e,v 1.1 2008/02/11 11:06:32 fw Exp $ - -spawn telnet localhost 6789 -expect { - timeout { exit 1 } - "Connected" -} - -send "nick nick\r" -send "user user . . :Real Name\r" -expect { - timeout { exit 1 } - "376" -} - -send "who\r" -expect { - timeout { exit 1 } - ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick H :0 Real Name" -} - -send "who 0\r" -expect { - timeout { exit 1 } - ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick H :0 Real Name" -} - -send "who *\r" -expect { - timeout { exit 1 } - ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick H :0 Real Name" -} - -send "away :testing\r" -expect { - timeout { exit 1 } - "306 nick" -} - -send "who localhost\r" -expect { - timeout { exit 1 } - ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick G :0 Real Name" -} - -send "who ngircd.test.server\r" -expect { - timeout { exit 1 } - ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick G :0 Real Name" -} - -send "who Real?Name\r" -expect { - timeout { exit 1 } - ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick G :0 Real Name" -} - -send "who nick\r" -expect { - timeout { exit 1 } - ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick G :0 Real Name" -} - -send "away\r" -expect { - timeout { exit 1 } - "305 nick" -} - -send "who *cal*ho??\r" -expect { - timeout { exit 1 } - ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick H :0 Real Name" -} - -send "who *.server\r" -expect { - timeout { exit 1 } - ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick H :0 Real Name" -} - -send "who Real*me\r" -expect { - timeout { exit 1 } - ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick H :0 Real Name" -} - -send "who n?c?\r" -expect { - timeout { exit 1 } - ":ngircd.test.server 352 nick * ~user localhost ngircd.test.server nick H :0 Real Name" -} - -send "quit\r" -expect { - timeout { exit 1 } - "Connection closed" -} - -# -eof- diff --git a/src/testsuite/who-test.e b/src/testsuite/who-test.e new file mode 100644 index 00000000..c54a190f --- /dev/null +++ b/src/testsuite/who-test.e @@ -0,0 +1,162 @@ +spawn telnet localhost 6789 +expect { + timeout { exit 1 } + "Connected" +} + +send "nick nick\r" +send "user user . . :Real Name\r" +expect { + timeout { exit 1 } + "376" +} + +send "who\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick \* ~user localhost ngircd.test.server nick H :0 Real Name" +} + +send "join #channel\r" +expect { + timeout { exit 1 } + "@* JOIN :#channel" +} + +send "who 0\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick #channel ~user localhost ngircd.test.server nick H@ :0 Real Name" +} + +send "away :testing\r" +expect { + timeout { exit 1 } + "306 nick" +} + +send "who *\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick #channel ~user localhost ngircd.test.server nick G@ :0 Real Name" +} + +send "mode #channel +v nick\r" +expect { + timeout { exit 1 } + "@* MODE #channel +v nick\r" +} + +send "who localhost\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick #channel ~user localhost ngircd.test.server nick G@ :0 Real Name" +} + +send "mode #channel -o nick\r" +expect { + timeout { exit 1 } + "@* MODE #channel -o nick\r" +} + +send "who ngircd.test.server\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick #channel ~user localhost ngircd.test.server nick G+ :0 Real Name" +} + +send "part #channel\r" +expect { + timeout { exit 1 } + "@* PART #channel :nick" +} + +send "who Real?Name\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick \* ~user localhost ngircd.test.server nick G :0 Real Name" +} + +send "oper TestOp 123\r" +expect { + timeout { exit 1 } + "MODE nick :+o" +} +expect { + timeout { exit 1 } + "381 nick" +} + +send "who 0 o\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick \* ~user localhost ngircd.test.server nick G* :0 Real Name" +} + +send "away\r" +expect { + timeout { exit 1 } + "305 nick" +} + +send "who *cal*ho??\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick \* ~user localhost ngircd.test.server nick H* :0 Real Name" +} + +send "join #opers\r" +expect { + timeout { exit 1 } + "@* JOIN :#opers" +} + +send "who #opers\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick #opers ~user localhost ngircd.test.server nick H*@ :0 Real Name" +} + +send "mode #opers -o nick\r" +expect { + timeout { exit 1 } + "@* MODE #opers -o nick\r" +} + +send "who *.server\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick #opers ~user localhost ngircd.test.server nick H* :0 Real Name" +} + +send "mode #opers +v nick\r" +expect { + timeout { exit 1 } + "@* MODE #opers +v nick\r" +} + +send "who Real*me\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick #opers ~user localhost ngircd.test.server nick H*+ :0 Real Name" +} + +send "mode #opers +s\r" +expect { + timeout { exit 1 } + "@* MODE #opers +s\r" +} + +send "who n?c?\r" +expect { + timeout { exit 1 } + ":ngircd.test.server 352 nick \* ~user localhost ngircd.test.server nick H* :0 Real Name" +} + +send "quit\r" +expect { + timeout { exit 1 } + "Connection closed" +} + +# -eof- |