Skip to content

Update test for getprotobyname and getprotobynumber for inconsistant protocol 0 - #670

Merged
nahime0 merged 2 commits into
illegalstudio:mainfrom
matt-h:fix-test-for-getprotobynumber
Aug 6, 2026
Merged

Update test for getprotobyname and getprotobynumber for inconsistant protocol 0#670
nahime0 merged 2 commits into
illegalstudio:mainfrom
matt-h:fix-test-for-getprotobynumber

Conversation

@matt-h

@matt-h matt-h commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Depending on the system protocol 0 can be ip or hopopt. On Arch Linux it is hopopt while the former test here assumed it to always be ip

So, this test would fail if run from an Arch Linux system.

Arch gets its protocol list for /etc/protocols from
https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml
https://sources.archlinux.org/other/packages/iana-etc/protocol-numbers-20260310.xml

I've updated the tests here so it can still pass with ip or hopopt being protocol 0.

…databases

Depending on the system protocol 0 can be `ip` or `hopopt`. On Arch Linux it is `hopopt` while the former test here assumed it to always be `ip`
@github-actions github-actions Bot added area:triage No primary component could be inferred from changed paths. size:xs Very small pull request. type:triage Needs a conventional title or branch prefix before review. labels Aug 5, 2026
@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown

Greptile Summary

This PR makes protocol-zero tests independent of whether the host names protocol 0 ip, hopopt, or another valid canonical name.

  • Removes protocol-zero assertions from tests with fixed platform-specific output.
  • Adds a dynamic name-to-number round-trip test for protocol zero.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the new test obtains the host-defined protocol-zero name dynamically and verifies that it resolves back to zero.

Important Files Changed

Filename Overview
tests/codegen/io/streams.rs Replaces hard-coded protocol-zero naming expectations with a host-defined round-trip assertion, fully addressing the previous portability finding.

Reviews (2): Last reviewed commit: "test: make protocol zero round-trip port..." | Re-trigger Greptile

Comment thread tests/codegen/io/streams.rs Outdated
@nahime0

nahime0 commented Aug 6, 2026

Copy link
Copy Markdown
Member

Given that this is a mere test fix, I'm gonna merge as is without further reviews.

@nahime0
nahime0 merged commit c448d94 into illegalstudio:main Aug 6, 2026
117 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:triage No primary component could be inferred from changed paths. size:xs Very small pull request. type:triage Needs a conventional title or branch prefix before review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants