code wiki / (root) / nx_moonraker_io_test.nx

nx_moonraker_io_test.nx

buildroot/runtime/nx_moonraker_io_test.nx

3731 B109 linesdepth 7pulls 10 transitivereach 0 importersview sourcekind gate/prooftopic moonraker
docsdependenciesstructsconstsfunctions

about

nx_moonraker_io_test.nx -- REAL network roundtrip test. Parent: acts as a fake Moonraker server -- listens on a loopback port, accepts the connection, reads the POST request, validates it contains expected markers, sends back a canned HTTP/1.1 200 OK response. Child: builds + sends the Moonraker POST /printer/print/start request via nx_mr_post_loopback (composes nx_mr_build_post_request + tcp_connect_loopback + sys_write + sys_read). Verifies the response status is 200. Exits with assertion code. Bytes flow over a real loopback socket through the real Linux kernel TCP stack inside qemu -- this is REAL network I/O, not a mock. expect_exit: 0 license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_tls13_io.nx nx_moonraker_client.nx nx_moonraker_io.nx nx_moonraker_io_test.nx

imports: nx_syscalls.nxnx_tls13_io.nxnx_moonraker_client.nxnx_moonraker_io.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main tcp_listen_loopback sys_socket sys_setsockopt sys_bind sys_listen sys_fork sys_mmap nx_mr_post_loopback nx_mr_build_post_request nx_mr_write_cstr nx_mr_write_bytes nx_mr_write_int tcp_connect_loopback sys_socket ↻ nx_connect_bounded nx_fcntl sys_connect sys_mmap ↻ sys_poll sys_write sys_close sys_read sys_exit nx_mr_parse_status smoke_contains sys_accept sys_read ↻ sys_write ↻ sys_close ↻

structs

none

consts

25const TEST_PORT: i64 = 18447

functions

28func smoke_contains(buf: *u8, len: i64, needle: *u8) -> i64
called by 1: main
46func main() -> i64