mirror of https://github.com/progval/irctest.git
add test for RPL_NAMREPLY for secret channels (#265)
Ergo and ngIRCd were getting this wrong
This commit is contained in:
parent
1bc8741479
commit
723991c7ec
|
@ -228,7 +228,7 @@ jobs:
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
path: ngircd
|
path: ngircd
|
||||||
ref: 0714466af88d71d6c395629cd7fb624b099507d4
|
ref: 3e3f6cbeceefd9357b53b27c2386bb39306ab353
|
||||||
repository: ngircd/ngircd
|
repository: ngircd/ngircd
|
||||||
- name: Build ngircd
|
- name: Build ngircd
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -68,6 +68,39 @@ class NamesTestCase(cases.BaseServerTestCase):
|
||||||
"""
|
"""
|
||||||
self._testNames(symbol=True, allow_trailing_space=False)
|
self._testNames(symbol=True, allow_trailing_space=False)
|
||||||
|
|
||||||
|
@cases.mark_specifications("RFC2812", "Modern")
|
||||||
|
def testNames2812Secret(self):
|
||||||
|
"""The symbol sent for a secret channel is `@` instead of `=`:
|
||||||
|
https://datatracker.ietf.org/doc/html/rfc2812#section-3.2.5
|
||||||
|
https://modern.ircdocs.horse/#rplnamreply-353
|
||||||
|
"""
|
||||||
|
self.connectClient("nick1")
|
||||||
|
self.sendLine(1, "JOIN #chan")
|
||||||
|
# enable secret channel mode
|
||||||
|
self.sendLine(1, "MODE #chan +s")
|
||||||
|
self.getMessages(1)
|
||||||
|
self.sendLine(1, "NAMES #chan")
|
||||||
|
messages = self.getMessages(1)
|
||||||
|
self.assertMessageMatch(
|
||||||
|
messages[0],
|
||||||
|
command=RPL_NAMREPLY,
|
||||||
|
params=["nick1", "@", "#chan", StrRe("@nick1 ?")],
|
||||||
|
)
|
||||||
|
self.assertMessageMatch(
|
||||||
|
messages[1],
|
||||||
|
command=RPL_ENDOFNAMES,
|
||||||
|
params=["nick1", "#chan", ANYSTR],
|
||||||
|
)
|
||||||
|
|
||||||
|
self.connectClient("nick2")
|
||||||
|
self.sendLine(2, "JOIN #chan")
|
||||||
|
namreplies = [msg for msg in self.getMessages(2) if msg.command == RPL_NAMREPLY]
|
||||||
|
self.assertNotEqual(len(namreplies), 0)
|
||||||
|
for msg in namreplies:
|
||||||
|
self.assertMessageMatch(
|
||||||
|
msg, command=RPL_NAMREPLY, params=["nick2", "@", "#chan", ANYSTR]
|
||||||
|
)
|
||||||
|
|
||||||
def _testNamesMultipleChannels(self, symbol):
|
def _testNamesMultipleChannels(self, symbol):
|
||||||
self.connectClient("nick1")
|
self.connectClient("nick1")
|
||||||
|
|
||||||
|
|
|
@ -230,7 +230,7 @@ software:
|
||||||
name: ngircd
|
name: ngircd
|
||||||
repository: ngircd/ngircd
|
repository: ngircd/ngircd
|
||||||
refs:
|
refs:
|
||||||
stable: 0714466af88d71d6c395629cd7fb624b099507d4 # two years ahead of rel-26.1
|
stable: 3e3f6cbeceefd9357b53b27c2386bb39306ab353 # three years ahead of rel-26.1
|
||||||
release: null
|
release: null
|
||||||
devel: master
|
devel: master
|
||||||
devel_release: null
|
devel_release: null
|
||||||
|
|
Loading…
Reference in New Issue