Skip to content

Start the dns service and test name resolution in Renode - #118

Closed
JohnAmadis wants to merge 3 commits into
masterfrom
claude/zealous-ramanujan-nnsy9w
Closed

JohnAmadis wants to merge 3 commits into
masterfrom
claude/zealous-ramanujan-nnsy9w

Conversation

@JohnAmadis

@JohnAmadis JohnAmadis commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The STM32F746G Discovery board now resolves host names: the dns service starts at boot, and the Renode network test checks resolution end to end. The PR also fixes two causes of the red Renode pipeline.

configs/board/stm32f746g-disco/flash.dmd

dmdns service=dns.ini
nslookup
  • dns.ini is a type=library unit from the dmdns package. It loads and enables the resolver once for the whole system, with no per-interface rule.
  • Name servers come from the DHCP lease (option 6). dmdhcp ≥ 0.4 reports them through dmdns's dmdns_provide_servers DIF on every lookup, so the board needs no DNS configuration.
  • nslookup lets you look names up from the shell.

scripts/test_renode_network.py

  • The host DHCP server now also offers option 6 (DNS = 192.168.100.1).
  • A new DnsServer thread listens on the TAP (UDP 53). It knows one name, dmod-boot.test → 192.168.100.77, and answers AAAA for it with NODATA. Every other name gets NXDOMAIN.
  • After the telnet check, the test runs:
    1. nslookup -4 dmod-boot.test without a server argument → must print Address: 192.168.100.77. This checks the whole path: dns service → server from the DHCP lease through the DIF → UDP query → answer parsing.
    2. A check that the query really reached the host's DNS server from 192.168.100.2.
    3. nslookup -4 no-such-host.test → must report NXDOMAIN.

Fixes for the red Renode pipeline

  1. dmlog ring too small for the emulation. monitor-gdb attaches only after the board has run for a while. With DNS added, the boot log up to the start of systemd is about 33 KB, so the 8 KiB ring had already overwritten DMOD-Boot started.
    • linker/common.ld now takes the ring size from __dmboot_logs_size__ when it is defined (default still 8192).
    • CMakeLists.txt sets it to 64 KiB for DMBOOT_EMULATION builds via DMBOOT_EMULATION_LOGS_SIZE.
    • Board builds are unchanged.
  2. Unexpected GDB response: $ (master's failure after Board skill: always build and flash from build/, dmf-get's cache #117). This was a race in dmlog_monitor: a late stop reply from Renode arrived before the ack. It is fixed in Monitor: skip a stop reply that arrives before an ack dmlog#58 (merged), and lib/dmlog points at its merge commit.

Verification

  • I ran the full scripts/run_renode_tests.sh locally with DMBOOT_TEST_NETWORK=1 (Renode 1.15.3, arm-none-eabi 10.3-2021.10, TAP). All 9 steps passed, including the DNS checks above.
  • CI passed on 3c31ca4: all three builds and Test Renode Simulation.

Merge order

choco-technologies/dmdns#2 (adds nslookup to the manifest) before this PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SVi4u4Lf8HPw1emy5uyGSB

claude added 3 commits October 5, 2026 14:26
The STM32F746G Discovery flash set now brings up the dmdns resolver with
its dns unit (type=library, one for the whole system) and adds nslookup.
Name servers come from the DHCP lease: dmdhcp reports option 6 through
dmdns's dmdns_provide_servers DIF.

The Renode network test serves option 6 in its DHCP answers and runs a
small DNS server on the TAP: the board must resolve dmod-boot.test with
no server given (proving dns service -> DHCP-provided server -> UDP query
-> answer), the query must reach the host, and an unknown name must come
back as NXDOMAIN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SVi4u4Lf8HPw1emy5uyGSB
The Renode tests attach dmlog_monitor only after the board has been
running for a while. With DNS added, the boot log before systemd starts
is about 33 KB, so the 8 KiB ring had already overwritten
"DMOD-Boot started" and step 4 failed.

The ring size is now overridable (__dmboot_logs_size__) and the
emulation build uses 64 KiB. Board builds keep 8 KiB.

Bump lib/dmlog to the monitor fix for a stop reply that arrives before
an ack ("Unexpected GDB response: $"), which made master red.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SVi4u4Lf8HPw1emy5uyGSB
choco-technologies/dmlog#58 is merged; same tree as the commit tested
before, now on dmlog master.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SVi4u4Lf8HPw1emy5uyGSB
@JohnAmadis JohnAmadis closed this Oct 18, 2026
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.

2 participants