Skip to content

test(inttest): raw TCP destination e2e flavor (tcp-sink) - #111

Merged
randomizedcoder merged 1 commit into
mainfrom
feat/inttest-raw-socket
Aug 2, 2026
Merged

test(inttest): raw TCP destination e2e flavor (tcp-sink)#111
randomizedcoder merged 1 commit into
mainfrom
feat/inttest-raw-socket

Conversation

@randomizedcoder

Copy link
Copy Markdown
Owner

What & why

New lightweight lifecycle flavor tcp-sink: xtcp2 streams jsonl records over the raw -dest tcp:... destination to an in-VM ncat receiver, closing the last gap in the destination coverage plan. The tcp/udp/unix dests were Go-component-only before this — this is the first daemon-level e2e for the raw socket path.

Change

  • RAW_SOCKET check (self-test 5f): validates the received records are well-formed jsonl (non-empty hostname) and the destTCP Writes counter is non-zero — send + receipt both proven.
  • Dual-stack (per the standing directive): xtcp2 dials tcp:localhost:… (resolves to 127.0.0.1 and ::1) and the ncat sink listens on [::] (bindv6only=0 → also accepts IPv4-mapped), so either family works.
  • No new Go tool — ncat (from nmap, already in the VM) writes to a file the self-test validates (reusing the OUTPUT_CONTENT jq idiom); the existing tcp_server is echo-only.

Verification

  • nix-fmt green.
  • lifecycle microVM: RAW_SOCKET_PASS (records=139, destTCP_Writes=15), OVERALL_PASS.

Run: nix run .#microvm-x86_64-lifecycle-tcp-sink.

Fourth and final PR of the coverage-expansion series (PR1 #108, PR2 #109, PR3 #110 merged). Straight off main.

🤖 Generated with Claude Code

New lightweight lifecycle flavor `tcp-sink`: xtcp2 streams jsonl records
over the raw `-dest tcp:...` destination to an in-VM ncat receiver, and
the self-test's RAW_SOCKET check (5f) validates the received records ARE
well-formed jsonl (non-empty hostname) AND the destTCP Writes counter is
non-zero — send + receipt both proven. The tcp/udp/unix dests were
Go-component-only before this; this is the first daemon-level e2e for the
raw socket path.

Dual-stack: xtcp2 dials `tcp:localhost:...` (resolves to 127.0.0.1 AND
::1) and the ncat sink listens on [::] (bindv6only=0 → also accepts
IPv4-mapped), so either family works. No new Go tool needed — ncat (from
nmap, already in the VM) + a file the self-test validates, reusing the
OUTPUT_CONTENT jq idiom.

Wiring: mkVm.nix (isTcpSink predicate, xtcp2TcpSinkArgs, the ncat sink
service ordered before xtcp2, runRawSocketCheck), self-test.nix (Check 5f),
default.nix (mkOneTcpSink/vmsTcpSink/lifecycleTcpSink), nix/default.nix
(boot + lifecycle app/package). Run: nix run .#microvm-x86_64-lifecycle-tcp-sink.

Verified: lifecycle microVM RAW_SOCKET_PASS (records=139, destTCP_Writes=15),
OVERALL_PASS; nix-fmt green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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