Skip to content

Combine IPv4 UDP broadcast socket tests#13271

Open
Haihan-Jiang wants to merge 1 commit into
google:masterfrom
Haihan-Jiang:codex/gvisor-combine-udp-tests
Open

Combine IPv4 UDP broadcast socket tests#13271
Haihan-Jiang wants to merge 1 commit into
google:masterfrom
Haihan-Jiang:codex/gvisor-combine-udp-tests

Conversation

@Haihan-Jiang
Copy link
Copy Markdown

Fixes #1640.

What

  • Combine the duplicated IPv4 UDP broadcast send/recv tests into one parameterized test over source bind address.
  • Share the IPv4 UDP unbound socket parameter list between the existing fixture and the new bind-address fixture.
  • Extract the external-networking interface setup so both fixtures preserve the same skip behavior.

Why

UDPBroadcastSendRecvOnSocketBoundToBroadcast and UDPBroadcastSendRecvOnSocketBoundToAny had identical bodies except for the source address. Parameterizing the address keeps the same behavioral coverage while removing the duplicate test body and the TODO/FIXME.

Testing

  • git diff --check
  • bazel build --nobuild //test/syscalls/linux:socket_ipv4_udp_unbound_external_networking_test

bazel test //test/syscalls/linux:socket_ipv4_udp_unbound_external_networking_test --test_output=errors was attempted locally, but this macOS checkout cannot build Linux syscall tests: the host C++ toolchain first missed libc++ headers (<cerrno>, <functional>), and after adding the SDK libc++ include path it failed on Linux-only <sys/statfs.h> before compiling this target.

@Haihan-Jiang Haihan-Jiang marked this pull request as ready for review May 24, 2026 10:01
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.

Combine similar syscall tests

1 participant