Skip to content

test(forward): add missing ForwardSpec::parse coverage for bracketed IPv6 and max port - #4905

Closed
0x5t4l1n wants to merge 1 commit into
NVIDIA:mainfrom
0x5t4l1n:test/forward-spec-parse
Closed

0x5t4l1n wants to merge 1 commit into
NVIDIA:mainfrom
0x5t4l1n:test/forward-spec-parse

Conversation

@0x5t4l1n

Copy link
Copy Markdown

Summary

ForwardSpec::parse accepts a pre-bracketed IPv6 bind address
([::1]:8080) — it splits on the last :, retains the brackets in
bind_addr, and ssh_forward_arg / Display both round-trip correctly.
However this code path was untested, so a refactor could silently break it.

Also adds a boundary test for port 65535 (the highest valid u16 value),
which was not covered by the existing forward_spec_parse_rejects_zero_port
and forward_spec_parse_rejects_invalid tests.

New tests

Test What it covers
forward_spec_parse_bracketed_ipv6_and_port "[::1]:8080" parses correctly; ssh_forward_arg does not double-bracket; Display round-trips
forward_spec_parse_max_port_boundary port 65535 accepted for both plain-port and addr:port forms

Test plan

  • cargo test -p openshell-core forward_spec_parse — new tests pass
  • cargo test -p openshell-core — no regressions

🤖 Generated with Claude Code

…IPv6 and max port

ForwardSpec::parse already handles a pre-bracketed IPv6 bind address
("[::1]:8080") by splitting on the last ':' and retaining the brackets in
bind_addr, but this code path had no test.  A user can reasonably supply
the bracketed form (it mirrors what OpenSSH itself uses in '-L' arguments),
so the behaviour deserves explicit documentation via tests.

Also adds a boundary test for port 65535 (the highest valid u16 value),
which was not covered by the existing parse tests.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@copy-pr-bot

copy-pr-bot Bot commented Oct 24, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

Copy link
Copy Markdown

Thank you for your submission! We ask that you sign our Developer Certificate of Origin before we can accept your contribution. You can sign the DCO by adding a comment below using this text:


I have read the DCO document and I hereby sign the DCO.


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the DCO Assistant Lite bot.

@github-actions

Copy link
Copy Markdown

Thank you for your interest in contributing to OpenShell, @0x5t4l1n.

This project uses a vouch system for first-time contributors. Before submitting a pull request, you need to be vouched by a maintainer.

To get vouched:

  1. Open a Vouch Request discussion.
  2. Describe what you want to change and why.
  3. Write in your own words — do not have an AI generate the request.
  4. A maintainer will comment /vouch if approved.
  5. Once vouched, open a new PR (preferred) or reopen this one after a few minutes.

See CONTRIBUTING.md for details.

@github-actions github-actions Bot closed this Oct 24, 2026
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