]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/testsuite/misc-test.e
ngIRCd Release 27
[ngircd-alex.git] / src / testsuite / misc-test.e
index 4b8837985fd6dc886c141139556d5b28090ca8b7..8896624bd9e116078e23f4959376512f854cf285 100644 (file)
@@ -1,6 +1,7 @@
-# $Id: misc-test.e,v 1.2 2008/02/17 13:51:00 alex Exp $
+# ngIRCd test suite
+# Misc test
 
-spawn telnet localhost 6789
+spawn telnet 127.0.0.1 6789
 expect {
        timeout { exit 1 }
        "Connected"
@@ -13,32 +14,151 @@ expect {
        "376"
 }
 
+# RFC 2812 Section 3.4.1
+
+send "motd\r"
+expect {
+       timeout { exit 1 }
+       "375"
+}
+expect {
+       timeout { exit 1 }
+       "372"
+}
+expect {
+       timeout { exit 1 }
+       "376"
+}
+
+send "motd ngircd.test.server\r"
+expect {
+       timeout { exit 1 }
+       "375"
+}
+expect {
+       timeout { exit 1 }
+       "372"
+}
+expect {
+       timeout { exit 1 }
+       "376"
+}
+
+send "motd doesnotexist\r"
+expect {
+       timeout { exit 1 }
+       "402"
+# note this is not specified in RFC 2812, but probably should be
+}
+
+# RFC 2812 Section 3.4.3
+
+send "version\r"
+expect {
+       timeout { exit 1 }
+       "351"
+}
+
+send "version ngircd.test.server\r"
+expect {
+       timeout { exit 1 }
+       "351"
+}
+
+send "version doesnotexist\r"
+expect {
+       timeout { exit 1 }
+       "402"
+}
+
+# RFC 2812 Section 3.4.6
+
+send "time\r"
+expect {
+       timeout { exit 1 }
+       "391"
+}
+
+send "time ngircd.test.server\r"
+expect {
+       timeout { exit 1 }
+       "391"
+}
+
+send "time doesnotexist\r"
+expect {
+       timeout { exit 1 }
+       "402"
+}
+
+# RFC 2812 Section 3.4.10
+
+send "info\r"
+expect {
+       timeout { exit 1 }
+       "371"
+}
+expect {
+       timeout { exit 1 }
+       "374"
+}
+
+# RFC 2812 Section 4.5
+
 send "summon\r"
 expect {
        timeout { exit 1 }
        "445"
 }
 
+# RFC 2812 Section 4.6
+
 send "users\r"
 expect {
        timeout { exit 1 }
        "446"
 }
 
-send "info\r"
+# RFC 2812 Section 4.8
+
+send "userhost\r"
 expect {
        timeout { exit 1 }
-       "371"
+       "461"
 }
+
+send "userhost nick\r"
 expect {
        timeout { exit 1 }
-       "374"
+       -re ":ngircd.test.server 302 nick :?nick=+.*@127.0.0.1"
 }
 
-send "quit\r"
+send "userhost doesnotexist\r"
+expect {
+       timeout { exit 1 }
+       ":ngircd.test.server 302 nick :\r"
+}
+
+send "userhost nick doesnotexist nick doesnotexist\r"
+expect {
+       timeout { exit 1 }
+       -re ":ngircd.test.server 302 nick :nick=+.*@127.0.0.1 nick=+.*@127.0.0.1"
+}
+
+send "away :testing\r"
 expect {
        timeout { exit 1 }
-       "ERROR"
+       "306 nick"
 }
 
-# -eof-
+send "userhost nick nick nick nick nick nick\r"
+expect {
+       timeout { exit 1 }
+       -re ":ngircd.test.server 302 nick :nick=-.*@127.0.0.1 nick=-.*@127.0.0.1 nick=-.*@127.0.0.1 nick=-.*@127.0.0.1 nick=-.*@127.0.0.1\r"
+}
+
+send "quit\r"
+expect {
+       timeout { exit 1 }
+       "ERROR :Closing connection"
+}