Skip to content

Reach a pod by name: --connection benchpod-a1b2c3 / a1b2c3 - #39

Merged
wardviaene merged 1 commit into
mainfrom
connection-by-name
Oct 15, 2026
Merged

wardviaene merged 1 commit into
mainfrom
connection-by-name

Conversation

@wardviaene

Copy link
Copy Markdown
Member

benchpod setup --connection a1c5c7 failed with "no BenchPod answers at a1c5c7:8080": a bare pod name was dialed as a hostname, and the CLI's resolver does not resolve .local either (benchpod-a1c5c7.local fails with an i/o timeout).

What changes

  • parseTarget takes a value shaped like a pod name (benchpod-a1b2c3, a1b2c3, optional .local; regex ^(benchpod-)?[0-9a-f]{6}(\.local)?$) and looks it up with the CLI's own mDNS browse (the one discover uses). The browse ends as soon as the pod answers. Every other hostname goes to the system resolver as before.
  • A pod not heard on the LAN falls back to usb:<name>, with a one-line note on stderr.
  • The lookup runs at most once per name per run, because a command parses its connection several times.
  • Two browses (1.2 s + 1.8 s) instead of one 3 s browse: the pod's lwIP responder does not repeat a multicast answer within 1 s, and zeroconf only queries again after 4 s. Without the second browse, back-to-back commands missed the pod every other run.
  • set-connection <name> saves the resolved LAN address (like discover --save), or usb:benchpod-<id> when the pod was only heard on USB or its USB link, so later commands skip the lookup.
  • README (Connection table, new "Pod names" paragraph, set-connection reference, examples) and the --connection / set-connection help are updated.

Tests

  • Unit tests cover the name pattern (including hostnames that must not match), resolution on the LAN, the USB fallback, the once-per-run cache, mDNS entry matching, address choice, and set-connection in three cases.
  • TestIdentityWipeOnlyOverUSB now stubs the lookup, so benchpod-a1b2c3.local still resolves to a LAN address there.
  • Read-only check on the bench (benchpod-a1c5c7, lock free, ping/status only): --connection a1c5c7, benchpod-a1c5c7 and benchpod-a1c5c7.local reach the pod in 0.1 to 1.3 s across 8 back-to-back runs. benchpod-baea06 (unplugged from the LAN) falls back to USB.

Notes

  • The embeddedci.com CLI docs snapshot (embeddedci-server webapp/src/docs/coverage/cli.json) needs a refresh for the new help text.
  • internal/fwrefusals fails locally against the sibling firmware checkout. That is unrelated to this change.

🤖 Generated with Claude Code

A bare pod name was dialed as a hostname (a1c5c7:8080) and timed out, and
the CLI's Go resolver does not resolve .local either. A value shaped like a
pod name (^(benchpod-)?[0-9a-f]{6}(.local)?$) is now looked up with the
CLI's own mDNS browse (the one discover uses), ending as soon as the pod
answers and asking twice within 3 s because the pod's responder skips an
answer repeated within a second. A pod not heard on the LAN falls back to
usb:<name>. set-connection saves the resolved LAN address (or
usb:benchpod-<id>) so later commands do not browse. Other hostnames still
go to the system resolver.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wardviaene
wardviaene merged commit 35551f7 into main Oct 15, 2026
2 checks passed
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.

1 participant