Skip to content

test: add unit tests for core modules and integration tests for graceful shutdown#27

Closed
Itsusinn wants to merge 1 commit into
mainfrom
test/tests
Closed

test: add unit tests for core modules and integration tests for graceful shutdown#27
Itsusinn wants to merge 1 commit into
mainfrom
test/tests

Conversation

@Itsusinn

@Itsusinn Itsusinn commented Jun 15, 2026

Copy link
Copy Markdown
Member

Add comprehensive test coverage across wind-core (utils, resolve,
dispatcher), wind-socks (lib, udp), wind-dns (resolver), wind-base
(resolve, direct), and a new wind-test shutdown module.

wind-core

  • utils: StackPrefer (from_str/serde round-trip/aliases) + is_private_ip boundary cases (19 tests)
  • resolve: pick/filter_addrs_by_preference all 4 preference modes, empty input, order preservation (16 tests)
  • dispatcher: AclRouter edge cases: SRC-PORT, IN-PORT, DOMAIN-KEYWORD, DOMAIN-REGEX, DOMAIN-WILDCARD (5 tests)

wind-socks

  • lib: convert_addr/convert_to_socks_addr round-trip for IPv4/IPv6/Domain (9 tests)
  • udp: parse_udp_request_sync SOCKS5 UDP header (all ATYP, RSV errors, truncation), target_addr_to_socket, unmap_v4_mapped (14 tests)

wind-dns

  • resolver: parse_server scheme/port/IPv6-bracket/SNI combos, split_host_port (14 tests)

wind-base

  • resolve: resolve_target with mock Resolver — verifies bypass on IP inputs (3 tests)
  • direct: DirectOutboundOpts construction (3 tests)

wind-test (new shutdown.rs module)

Graceful shutdown integration tests:

  • SOCKS5 listen loop exits promptly on cancel
  • Raw TCP relay in-flight connection still relays after cancel
  • TUIC QUIC listen loop stops on ctx.token.cancel()
  • TUIC in-flight relay disconnects on cancel (documents current behaviour)
  • TaskTracker drain completes within timeout

Signed-off-by: iHsin sun@ihsin.dev
Assisted-by: OpenClaw:deepseek-v4-flash

…ful shutdown

Add comprehensive test coverage across wind-core (utils, resolve,
dispatcher), wind-socks (lib, udp), wind-dns (resolver), wind-base
(resolve, direct), and a new wind-test shutdown module.

wind-core:
  - utils: StackPrefer from_str/serde + is_private_ip boundary cases
  - resolve: pick/filter_addrs_by_preference all 4 preference modes
  - dispatcher: AclRouter SRC-PORT, IN-PORT, DOMAIN-KEYWORD/REGEX/WILDCARD

wind-socks:
  - lib: convert_addr and convert_to_socks_addr round-trip
  - udp: parse_udp_request_sync with error cases, addr helpers

wind-dns:
  - resolver: parse_server scheme/port/IPv6-bracket edge cases
  - split_host_port helper

wind-base:
  - resolve: resolve_target bypasses-resolver on IP inputs
  - direct: DirectOutboundOpts construction

wind-test (new shutdown module):
  - SOCKS5/TUIC/raw-TCP graceful shutdown on cancellation token

Signed-off-by: iHsin <sun@ihsin.dev>
Assisted-by: OpenClaw:deepseek-v4-flash
@Itsusinn Itsusinn changed the title tests: comprehensive unit + integration test additions test: add unit tests for core modules and integration tests for graceful shutdown Jun 15, 2026
@Itsusinn Itsusinn closed this Jun 15, 2026
@Itsusinn Itsusinn deleted the test/tests branch June 15, 2026 03:28
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.

1 participant