Repository navigation
Add tools/testnet: local linked-network test kit with link and CAP tests - #270
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
tools/testnet/, a stdlib-only Python kit that starts a three-server network on 127.0.0.1 from a builtsrc/ircd, runsunittesttests against it, and shuts it down. It needs onlypython3and theopensslCLI, so it runs the same on a laptop (Linux/macOS) or in CI. New IRCv3 caps can each add atests/test_<cap>.py.Things that aren't obvious from the code:
SET THROTTLE ENABLE off. The hub is turned off before the leaves start, and connects that fail with "connection refused" are retried and don't count toward the throttle. The hub's control connection is then used to pollLINKSuntil all three servers are linked.wait_for_nick()(repeats WHOIS until it gets 311) before messaging a user on another server, and accept the topic either as 332 or as a laterTOPICline.ircd -tkeeps the server in the foreground, so the launcher tracks each server's pid anddownstops it with SIGTERM.tests/test_cap.pyskips itself whenCAPreturns 421, so it skips on current master and runs once Add IRCv3 CAP negotiation skeleton with a static capability registry #269 is merged.Tests:
test_link.py: LINKS, PRIVMSG leaf↔leaf across the hub, remote WHOIS, channel JOIN/TOPIC/PRIVMSG across links, NICK and QUIT propagation, and the TLS client port.test_cap.py: the CAP LS/LIST/REQ/END behavior from Add IRCv3 CAP negotiation skeleton with a static capability registry #269, including:name=valueinCAP LIST461for a REQ with an empty or all-space listResults, run locally:
Link to Devin session: https://app.devin.ai/sessions/9c171b7fd3d341178646e3cce156ddd7
Open in Devin Desktop: https://app.devin.ai/desktop/session/9c171b7fd3d341178646e3cce156ddd7?variant=devin
Requested by: @eaescob