Module: ngircd.git Branch: master Commit: d1f604ab89f34412cbe44aaf323b450b800a49d9 URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=d1f60...
Author: Alexander Barton alex@barton.de Date: Sat Mar 19 14:52:07 2011 +0100
Add "whois-test" to testsuite and distribution archive
Test script proposed by Dana Dahlstrom, 2008-02-17. See https://arthur.barton.de/bugzilla/show_bug.cgi?id=72 ...
---
src/testsuite/.gitignore | 1 + src/testsuite/Makefile.am | 2 +- src/testsuite/whois-test.e | 53 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletions(-)
diff --git a/src/testsuite/.gitignore b/src/testsuite/.gitignore index fd628e3..5884a48 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 52cc31a..9dc76a7 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 0000000..7024d5f --- /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-