2014-04-17 23:55:49 +02:00
|
|
|
# ngIRCd test suite
|
|
|
|
# Misc test
|
2008-02-17 14:26:41 +01:00
|
|
|
|
2014-04-17 23:57:38 +02:00
|
|
|
spawn telnet 127.0.0.1 6789
|
2008-02-17 14:26:41 +01:00
|
|
|
expect {
|
|
|
|
timeout { exit 1 }
|
|
|
|
"Connected"
|
|
|
|
}
|
|
|
|
|
|
|
|
send "nick nick\r"
|
|
|
|
send "user user . . :User\r"
|
|
|
|
expect {
|
|
|
|
timeout { exit 1 }
|
|
|
|
"376"
|
|
|
|
}
|
|
|
|
|
2008-05-15 08:39:05 +02:00
|
|
|
# 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
|
|
|
|
|
2008-02-17 14:26:41 +01:00
|
|
|
send "summon\r"
|
|
|
|
expect {
|
|
|
|
timeout { exit 1 }
|
|
|
|
"445"
|
|
|
|
}
|
|
|
|
|
2008-05-15 08:39:05 +02:00
|
|
|
# RFC 2812 Section 4.6
|
|
|
|
|
2008-02-17 14:26:41 +01:00
|
|
|
send "users\r"
|
|
|
|
expect {
|
|
|
|
timeout { exit 1 }
|
|
|
|
"446"
|
|
|
|
}
|
|
|
|
|
2008-05-15 08:39:05 +02:00
|
|
|
# RFC 2812 Section 4.8
|
|
|
|
|
|
|
|
send "userhost\r"
|
2008-02-17 14:26:41 +01:00
|
|
|
expect {
|
|
|
|
timeout { exit 1 }
|
2008-05-15 08:39:05 +02:00
|
|
|
"461"
|
2008-02-17 14:26:41 +01:00
|
|
|
}
|
2008-05-15 08:39:05 +02:00
|
|
|
|
|
|
|
send "userhost nick\r"
|
2008-02-17 14:26:41 +01:00
|
|
|
expect {
|
|
|
|
timeout { exit 1 }
|
2014-04-17 23:57:38 +02:00
|
|
|
-re ":ngircd.test.server 302 nick :?nick=+.*@127.0.0.1"
|
2008-05-15 08:39:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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 }
|
2014-04-17 23:57:38 +02:00
|
|
|
-re ":ngircd.test.server 302 nick :nick=+.*@127.0.0.1 nick=+.*@127.0.0.1"
|
2008-05-15 08:39:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
send "away :testing\r"
|
|
|
|
expect {
|
|
|
|
timeout { exit 1 }
|
|
|
|
"306 nick"
|
|
|
|
}
|
|
|
|
|
|
|
|
send "userhost nick nick nick nick nick nick\r"
|
|
|
|
expect {
|
|
|
|
timeout { exit 1 }
|
2014-04-17 23:57:38 +02:00
|
|
|
-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"
|
2008-02-17 14:26:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
send "quit\r"
|
|
|
|
expect {
|
|
|
|
timeout { exit 1 }
|
|
|
|
"ERROR"
|
|
|
|
}
|