Skip to content

MDEV-39169: Replace deprecated network functions in resolveip (testfix 2) - #5528

Merged
grooverdan merged 1 commit into
mainfrom
bb-main-mdev-39169
Aug 11, 2026
Merged

MDEV-39169: Replace deprecated network functions in resolveip (testfix 2)#5528
grooverdan merged 1 commit into
mainfrom
bb-main-mdev-39169

Conversation

@raghunandanbhat

Copy link
Copy Markdown
Contributor

fixes resolveip test failures after MDEV-39169

Problem:

The test piped resolveip through sed patterns that rewrote its failure message into the expected success line, and the pipe also discarded the exit status - the test could not fail. Removing the masking exposes the real issue: reverse lookup results are OS dependent. The name of ::1 differs per system, and ::ffff:127.0.0.1 has a name on glibc and musl (which map it to 127.0.0.1) but none on macOS.
The suite.pm check bound a socket to the address, which asks the kernel, not the resolver: it fails under net.ipv6.bindv6only=1 where the lookup works and succeeds on macOS where it doesn't.

Fix:

Split the test in two:

  • main/resolveip.test: deterministic cases, never skips. Lookup failures are pinned with addresses that resolve nowhere (192.0.2.1, nonexistent.invalid), checking the exit status and that IPv4-mapped literals take the reverse-lookup path on every OS.

  • main/resolveip_lookup.test: the reverse lookups. A perl probe resolves the three loopback addresses with the same call resolveip makes, getnameinfo(NI_NAMEREQD), skips unless all have names, and returns the names so the test requires them exactly.

Output is normalized with replace_result/replace_regex instead of pipes, keeping the exit status checked.

…x 2)

Problem:
  The test piped resolveip through sed patterns that rewrote its failure
  message into the expected success line, and the pipe also discarded
  the exit status - the test could not fail.  Removing the masking
  exposes the real issue: reverse lookup results are OS dependent. The
  name of ::1 differs per system, and ::ffff:127.0.0.1 has a name on
  glibc and musl (which map it to 127.0.0.1) but none on macOS.

  The suite.pm check bound a socket to the address, which asks the
  kernel, not the resolver: it fails under net.ipv6.bindv6only=1 where
  the lookup works and succeeds on macOS where it doesn't.

Fix:
  Split the test in two:
  - main/resolveip.test: deterministic cases, never skips.  Lookup
  failures are pinned with addresses that resolve nowhere (192.0.2.1,
  nonexistent.invalid), checking the exit status and that IPv4-mapped
  literals take the reverse-lookup path on every OS.

  - main/resolveip_lookup.test: the reverse lookups.  A perl probe
  resolves the three loopback addresses with the same call resolveip
  makes, getnameinfo(NI_NAMEREQD), skips unless all have names, and
  returns the names so the test requires them exactly.

  Output is normalized with replace_result/replace_regex instead of
  pipes, keeping the exit status checked.

Co-Authored-By: Claude Fable 5 (1M context) <noreply@anthropic.com>
@grooverdan
grooverdan merged commit f4a8522 into main Aug 11, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants