summaryrefslogtreecommitdiff
path: root/deprecated-ngircd/src/testsuite/misc-test.e
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2025-11-02 15:29:28 +0800
committerMistivia <i@mistivia.com>2025-11-02 15:29:28 +0800
commit9f42c2d5f911cb4e215d7873221e642ce7df4d61 (patch)
tree6dac90a889a7402a9556d3d1bcc5cb53cdb9f123 /deprecated-ngircd/src/testsuite/misc-test.e
parentfb2d9de539b660a261af19b1cbcceb7ee7980cb1 (diff)
deprecate webircdateway and ngircd
Diffstat (limited to 'deprecated-ngircd/src/testsuite/misc-test.e')
-rw-r--r--deprecated-ngircd/src/testsuite/misc-test.e164
1 files changed, 164 insertions, 0 deletions
diff --git a/deprecated-ngircd/src/testsuite/misc-test.e b/deprecated-ngircd/src/testsuite/misc-test.e
new file mode 100644
index 0000000..8896624
--- /dev/null
+++ b/deprecated-ngircd/src/testsuite/misc-test.e
@@ -0,0 +1,164 @@
+# ngIRCd test suite
+# Misc test
+
+spawn telnet 127.0.0.1 6789
+expect {
+ timeout { exit 1 }
+ "Connected"
+}
+
+send "nick nick\r"
+send "user user . . :User\r"
+expect {
+ timeout { exit 1 }
+ "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"
+}
+
+# RFC 2812 Section 4.8
+
+send "userhost\r"
+expect {
+ timeout { exit 1 }
+ "461"
+}
+
+send "userhost nick\r"
+expect {
+ timeout { exit 1 }
+ -re ":ngircd.test.server 302 nick :?nick=+.*@127.0.0.1"
+}
+
+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 }
+ "306 nick"
+}
+
+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"
+}