Skip to content

feat(dut-network): allow DNS hostnames in public_ip field#672

Merged
mangelajo merged 2 commits into
mainfrom
fix/666-dns-name-entries
May 12, 2026
Merged

feat(dut-network): allow DNS hostnames in public_ip field#672
mangelajo merged 2 commits into
mainfrom
fix/666-dns-name-entries

Conversation

@ambient-code

@ambient-code ambient-code Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add _resolve_ip() helper to DutNetwork driver that resolves DNS hostnames to IPv4 addresses using socket.getaddrinfo(), passing through valid IP addresses unchanged
  • Integrate resolution in _get_1to1_mappings() and add_static_lease() so hostname-based public_ip values are resolved before being used in nftables rules and IP aliases
  • Add 7 unit tests covering IP passthrough, DNS resolution, error handling, and end-to-end 1:1 NAT setup with hostnames

Closes #666

Test plan

  • All 36 tests in test_driver.py pass (including 7 new tests)
  • All 144 tests in the dut-network package pass
  • Linting passes (make lint-fix)
  • Verify with a real DNS hostname in a lab config (manual)

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a6796e27-22a9-4da3-9bc2-d495cca9ab6b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/666-dns-name-entries

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mangelajo

Copy link
Copy Markdown
Member

@ambient-code please rebase and fix conflict.

Resolve DNS hostnames to IPv4 addresses when used in the public_ip field
of static_leases configuration, enabling users to specify entries like
"nxp-xxx-08.my.internal.lab.com" instead of raw IP addresses.

Closes #666

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ambient-code ambient-code Bot force-pushed the fix/666-dns-name-entries branch from cedb7d6 to cdf0c7d Compare May 12, 2026 10:02
@mangelajo

mangelajo commented May 12, 2026

Copy link
Copy Markdown
Member

@ambient-code please rebase again

… DNS tests

The TestDnsNameIn1to1 tests were passing 'static_leases' to _make_driver()
but DutNetwork uses 'addresses' as the field name (renamed in 38a6f72).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ambient-code

ambient-code Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

@mangelajo Done — the branch was already up to date with main (no new commits to rebase onto), but I found and fixed the actual CI failure: the three TestDnsNameIn1to1 tests were passing static_leases= to _make_driver() instead of addresses=. This was the leftover from the static_leasesaddresses rename. Pushed a fixup commit (211a6ffa).

@mangelajo mangelajo enabled auto-merge (rebase) May 12, 2026 10:36
@mangelajo mangelajo disabled auto-merge May 12, 2026 10:53
@mangelajo mangelajo enabled auto-merge (squash) May 12, 2026 10:53
@mangelajo mangelajo merged commit 2609472 into main May 12, 2026
32 checks passed
@raballew raballew deleted the fix/666-dns-name-entries branch June 5, 2026 11:38
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.

dut-network: enhancement : allow dns name entries for IP references.

1 participant