Skip to content

Part messages#59

Merged
Ratler merged 1 commit intoUndernetIRC:u2_10_12_branchfrom
MrIron-no:partmsg
Mar 21, 2026
Merged

Part messages#59
Ratler merged 1 commit intoUndernetIRC:u2_10_12_branchfrom
MrIron-no:partmsg

Conversation

@MrIron-no
Copy link
Copy Markdown
Contributor

Fix to ensure that part messages are not propagated when supposed to be hidden.

Copy link
Copy Markdown
Member

@Ratler Ratler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I tested the changes using a test harness that included a hub, a leaf, and three clients, which monitored the propagation across the servers.

@Ratler Ratler merged commit 36d5c01 into UndernetIRC:u2_10_12_branch Mar 21, 2026
@MrIron-no MrIron-no deleted the partmsg branch March 21, 2026 21:11
Ratler added a commit that referenced this pull request Mar 24, 2026
- Dockerfile with multi-stage build for ircu from working tree
- docker-compose with hub + 2 leaves topology
- Custom async IRC client with CAP negotiation support
- pytest fixtures for container lifecycle management
- PR #59 tests (part message suppression for banned users)
- PR #61 tests (userhost-in-names capability)
- IRC message parser unit tests
Ratler added a commit that referenced this pull request Mar 24, 2026
The original test_fix.py tested local part message suppression, which
already worked on the base branch. The actual bug PR #59 fixes is that
part messages leak across server-to-server links for banned users.

Rewrote tests to use ircd_network fixture (multi-server topology):
- Observer on leaf1 sees banned user's part message from hub (bug)
- Fixed docker-compose to use static IPs (10.55.0.x) so ircu's
  built-in DNS resolver can find the other servers
- Control test verifies unbanned part messages work cross-server
Ratler added a commit that referenced this pull request Mar 24, 2026
- Dockerfile with multi-stage build for ircu from working tree
- docker-compose with hub + 2 leaves topology
- Custom async IRC client with CAP negotiation support
- pytest fixtures for container lifecycle management
- PR #59 tests (part message suppression for banned users)
- PR #61 tests (userhost-in-names capability)
- IRC message parser unit tests
Ratler added a commit that referenced this pull request Mar 24, 2026
The original test_fix.py tested local part message suppression, which
already worked on the base branch. The actual bug PR #59 fixes is that
part messages leak across server-to-server links for banned users.

Rewrote tests to use ircd_network fixture (multi-server topology):
- Observer on leaf1 sees banned user's part message from hub (bug)
- Fixed docker-compose to use static IPs (10.55.0.x) so ircu's
  built-in DNS resolver can find the other servers
- Control test verifies unbanned part messages work cross-server
Ratler added a commit that referenced this pull request Mar 25, 2026
* feat(tests): add Python test harness with Docker infrastructure

- Dockerfile with multi-stage build for ircu from working tree
- docker-compose with hub + 2 leaves topology
- Custom async IRC client with CAP negotiation support
- pytest fixtures for container lifecycle management
- PR #59 tests (part message suppression for banned users)
- PR #61 tests (userhost-in-names capability)
- IRC message parser unit tests

* docs: add test harness README

- tests/README.md: setup, usage, topology, API reference

* fix(tests): fix wait_for buffer bug and use get_running_loop

- Fixed infinite loop in wait_for where stashed messages were
  re-read from buffer endlessly
- Replaced deprecated asyncio.get_event_loop() with get_running_loop()
- Simplified buffer search using enumerate

* chore: switch from pip/requirements.txt to uv

- Move dependencies from requirements.txt to pyproject.toml [project.dependencies]
- Remove requirements.txt
- Add uv.lock
- Add .venv and uv.lock to .dockerignore

* fix(tests): ensure Docker rebuild on every test run

Add --force-recreate and explicit docker compose down before up to
guarantee tests always run against the currently checked-out code.
This is critical for TDD workflow where you switch branches between runs.

* fix(tests): rewrite PR #59 tests for cross-server propagation bug

The original test_fix.py tested local part message suppression, which
already worked on the base branch. The actual bug PR #59 fixes is that
part messages leak across server-to-server links for banned users.

Rewrote tests to use ircd_network fixture (multi-server topology):
- Observer on leaf1 sees banned user's part message from hub (bug)
- Fixed docker-compose to use static IPs (10.55.0.x) so ircu's
  built-in DNS resolver can find the other servers
- Control test verifies unbanned part messages work cross-server

* feat(tests): add P10 test server and PR #62 remote +x tests

Add a lightweight P10 fake server (tests/p10_server.py) that connects
to ircd as a U:lined service, completes the full P10 handshake, and
can send S2S messages like OPMODE and ACCOUNT. This enables testing
server-to-server protocol behavior from the Python test harness.

Add integration tests for PR #62 (Remote +x):
- test_fix.py: 3 TDD tests that verify OPMODE +x from a U:lined
  server sets hidden host (fail on base branch, pass with PR #62)
- test_edge_cases.py: 6 adversarial tests covering remote users,
  unsupported modes, ACCOUNT, -o regression, and rapid sequences

Infrastructure changes:
- Docker configs: add Connect + UWorld blocks for services.test.net
- Dockerfile: clean host-compiled binaries before Linux build to
  fix exec format error on cross-platform Docker builds

* fix(tests): align test_remote_opmode_x_without_account with PR #62

PR #62's OPMODE +x handler requires IsAccount(dptr) — it silently
ignores +x on users without an account. Updated the test to verify
this correct behavior instead of expecting a MODE notification.

* fix(tests): test both no-account and with-account paths for OPMODE +x

Extend test_remote_opmode_x_without_account to a two-phase test:
first verifies +x is ignored without an account (IsAccount guard),
then sets the account and verifies +x succeeds and hides the host.

* feat(tests): add ACCOUNT U:line restriction test for PR #62

Add test_account_rejected_from_non_ulined_server which connects a
second fake P10 server (notulined.test.net) that has a Connect block
but no UWorld entry. Verifies that ACCOUNT from this server gets
ERR_NOPRIVILEGES (481) and the user's account is not set.

This covers the second half of PR #62: ms_account now requires
CONF_UWORLD before accepting ACCOUNT messages.

* docs: update test README with P10 server API and PR #62 tests

* fix(tests): align PR #62 tests with updated code review

- Remove incorrect 481 (ERR_NOPRIVILEGES) expectation from
  test_account_rejected_from_non_ulined_server; protocol_violation()
  only sends a DESYNCH wallops, not a numeric reply
- Rename test_nooper_uworld_cannot_send_plus_x to _can_ and flip
  assertion; PR #62 intentionally only gates +o/-o behind
  CONF_UWORLD_OPER while +x needs only basic CONF_UWORLD
- Rename test_nooper_uworld_unknown_mode_should_be_rejected to
  _silently_ignored; unknown modes fall through without error
- Strengthen test_opmode_minus_o_still_works to verify MODE -o
  notification now that PR #62 adds send_umode_out() to de_oper()
- Add Connect/UWorld blocks for uworldonly.test.net in hub config
- Switch Dockerfile to debian:trixie-slim and use autogen.sh for
  reliable autotools bootstrapping in container builds

* docs: update test README with new PR #62 test files and uworldonly server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants