test(inttest): raw TCP destination e2e flavor (tcp-sink) - #111
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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. Thetcp/udp/unixdests were Go-component-only before this — this is the first daemon-level e2e for the raw socket path.Change
RAW_SOCKETcheck (self-test 5f): validates the received records are well-formed jsonl (non-emptyhostname) and thedestTCPWritescounter is non-zero — send + receipt both proven.tcp:localhost:…(resolves to127.0.0.1and::1) and the ncat sink listens on[::](bindv6only=0→ also accepts IPv4-mapped), so either family works.jqidiom); the existingtcp_serveris echo-only.Verification
nix-fmtgreen.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