From: Alexander Barton Date: Sat, 19 Mar 2011 13:52:07 +0000 (+0100) Subject: Add "whois-test" to testsuite and distribution archive X-Git-Tag: rel-18-rc1~37^3 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=commitdiff_plain;h=d1f604ab89f34412cbe44aaf323b450b800a49d9 Add "whois-test" to testsuite and distribution archive Test script proposed by Dana Dahlstrom, 2008-02-17. See ... --- diff --git a/src/testsuite/.gitignore b/src/testsuite/.gitignore index fd628e3d..5884a486 100644 --- a/src/testsuite/.gitignore +++ b/src/testsuite/.gitignore @@ -11,6 +11,7 @@ mode-test opless-channel-test server-link-test who-test +whois-test ngircd-test1.log ngircd-test2.log ngircd-test1.motd diff --git a/src/testsuite/Makefile.am b/src/testsuite/Makefile.am index 52cc31a6..9dc76a7d 100644 --- a/src/testsuite/Makefile.am +++ b/src/testsuite/Makefile.am @@ -20,7 +20,7 @@ EXTRA_DIST = \ test-loop.sh wait-tests.sh \ channel-test.e connect-test.e check-idle.e invite-test.e \ join-test.e kick-test.e message-test.e misc-test.e mode-test.e \ - opless-channel-test.e server-link-test.e who-test.e \ + opless-channel-test.e server-link-test.e who-test.e whois-test.e \ stress-A.e stress-B.e \ start-server1 stop-server1 ngircd-test1.conf \ start-server2 stop-server2 ngircd-test2.conf diff --git a/src/testsuite/whois-test.e b/src/testsuite/whois-test.e new file mode 100644 index 00000000..7024d5ff --- /dev/null +++ b/src/testsuite/whois-test.e @@ -0,0 +1,53 @@ +# ngIRCd test suite +# WHOIS test + +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 "whois nick\r" +expect { + timeout { exit 1 } + "311 nick nick ~user localhost \* :Real Name\r" +} + +send "whois *\r" +expect { + timeout { exit 1 } + "311 nick nick ~user localhost \* :Real Name\r" +} + +send "whois n*\r" +expect { + timeout { exit 1 } + "311 nick nick ~user localhost \* :Real Name\r" +} + +send "whois ?ick\r" +expect { + timeout { exit 1 } + "311 nick nick ~user localhost \* :Real Name\r" +} + +send "whois ????,n?*k\r" +expect { + timeout { exit 1 } + "311 nick nick ~user localhost \* :Real Name\r" +} + +send "quit\r" +expect { + timeout { exit 1 } + "ERROR" +} + +# -eof-