Skip to content

netlink: add unit tests for IPVS service, destination, and statistics decoding - #48

Merged
thaJeztah merged 2 commits into
moby:mainfrom
thaJeztah:add_decoding_tests
Oct 14, 2026
Merged

thaJeztah merged 2 commits into
moby:mainfrom
thaJeztah:add_decoding_tests

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

Add table-driven tests for assembleService and assembleDestination, covering IPv4 and IPv6 addresses and their corresponding netlink attributes.

Verify decoding of service persistence engine names, destination weights larger than 16 bits, and persistent connection counts.

Also verify that attribute ordering does not affect decoding and that unknown attributes are ignored for forward compatibility.

These tests exercise the decoding functions directly, without requiring network namespaces or elevated privileges.

@thaJeztah
thaJeztah requested a balanced review from Copilot October 13, 2026 15:08

This comment was marked as resolved.

Add table-driven tests for assembleService and assembleDestination,
covering IPv4 and IPv6 addresses and their corresponding netlink
attributes.

Verify decoding of service persistence engine names, destination
weights larger than 16 bits, and persistent connection counts.

Also verify that attribute ordering does not affect decoding and
that unknown attributes are ignored for forward compatibility.

These tests exercise the decoding functions directly, without
requiring network namespaces or elevated privileges.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
thaJeztah requested a balanced review from Copilot October 13, 2026 15:16

This comment was marked as outdated.

Add table-driven tests for assembleStats, covering all supported
statistics attributes, including 32-bit counters and 64-bit byte
counts.

Verify that unknown attributes are ignored without interrupting
decoding, and that malformed netlink attributes return an error.

These tests exercise the decoder without requiring network namespaces
or elevated privileges, and provide baseline coverage for future
STATS64 support.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah changed the title netlink: add unit tests for IPVS service and destination decoding netlink: add unit tests for IPVS service, destination, and statistics decoding Oct 13, 2026
@thaJeztah
thaJeztah requested a balanced review from Copilot October 13, 2026 15:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The tests correctly exercise the stated decoding behaviors and error handling.

0 open findings

🧠 Review effort: Balanced

@thaJeztah
thaJeztah requested review from robmry and vvoland October 13, 2026 15:35
@thaJeztah
thaJeztah merged commit 21a72d0 into moby:main Oct 14, 2026
5 checks passed
@thaJeztah
thaJeztah deleted the add_decoding_tests branch October 14, 2026 15:41
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.

3 participants