Test NAMES on invalid/nonexisting channel returns RPL_ENDOFNAMES.

This commit is contained in:
Valentin Lorentz 2021-08-07 14:30:33 +02:00 committed by Val Lorentz
parent f2c80a2e96
commit 93a989b746
2 changed files with 49 additions and 0 deletions

View File

@ -33,12 +33,14 @@ HYBRID_SELECTORS := \
# testNoticeNonexistentChannel fails because of https://github.com/inspircd/inspircd/issues/1849
# testBotPrivateMessage and testBotChannelMessage fail because https://github.com/inspircd/inspircd/pull/1910 is not released yet
# testNamesInvalidChannel and testNamesNonexistingChannel fail because https://github.com/inspircd/inspircd/pull/1922 is not released yet.
INSPIRCD_SELECTORS := \
not Ergo \
and not deprecated \
and not strict \
and not testNoticeNonexistentChannel \
and not testBotPrivateMessage and not testBotChannelMessage \
and not testNamesInvalidChannel and not testNamesNonexistingChannel \
$(EXTRA_SELECTORS)
MAMMON_SELECTORS := \

View File

@ -22,6 +22,7 @@ from irctest.numerics import (
ERR_NOSUCHNICK,
ERR_NOTONCHANNEL,
ERR_UNKNOWNERROR,
RPL_ENDOFNAMES,
RPL_INVITING,
RPL_NAMREPLY,
RPL_NOTOPIC,
@ -1070,6 +1071,52 @@ class AuditoriumTestCase(cases.BaseServerTestCase):
)
class NamesTestCase(cases.BaseServerTestCase):
@cases.mark_specifications("RFC1459", "RFC2812", "Modern")
def testNamesInvalidChannel(self):
"""
"There is no error reply for bad channel names."
-- https://datatracker.ietf.org/doc/html/rfc1459#section-4.2.5
-- https://datatracker.ietf.org/doc/html/rfc2812#section-3.2.5
"If the channel name is invalid or the channel does not exist,
one `RPL_ENDOFNAMES` numeric containing the given channel name
should be returned."
-- https://modern.ircdocs.horse/#names-message
"""
self.connectClient("foo")
self.getMessages(1)
self.sendLine(1, "NAMES invalid")
self.assertMessageMatch(
self.getMessage(1),
command=RPL_ENDOFNAMES,
params=["foo", "invalid", ANYSTR],
)
@cases.mark_specifications("RFC1459", "RFC2812", "Modern")
def testNamesNonexistingChannel(self):
"""
"There is no error reply for bad channel names."
-- https://datatracker.ietf.org/doc/html/rfc1459#section-4.2.5
-- https://datatracker.ietf.org/doc/html/rfc2812#section-3.2.5
"If the channel name is invalid or the channel does not exist,
one `RPL_ENDOFNAMES` numeric containing the given channel name
should be returned."
-- https://modern.ircdocs.horse/#names-message
"""
self.connectClient("foo")
self.getMessages(1)
self.sendLine(1, "NAMES #nonexisting")
self.assertMessageMatch(
self.getMessage(1),
command=RPL_ENDOFNAMES,
params=["foo", "#nonexisting", ANYSTR],
)
class TopicPrivileges(cases.BaseServerTestCase):
@cases.mark_specifications("RFC2812")
def testTopicPrivileges(self):