Skip to main content

Crate smb_server_test_dashboard

Crate smb_server_test_dashboard 

Source
Expand description

A tiny, dependency-free HTTP server that serves MS-SMB2 test results.

It reads a CSV (the source of truth for pass/fail state), exposes a REST API over it, and serves a static single-page dashboard that renders progress. It listens on the SMB port plus one so it sits next to the server under test.

Modulesยง

csv ๐Ÿ”’
CSV storage for test results. The schema is a header line followed by rows: suite,name,category,status,duration_ms,timestamp,commit,note. suite is one of protocol/unit/system; status is pass/fail/skip/unknown; commit is the changeset the test last passed at (empty when not passing); note explains a skip/fail reason (empty otherwise).
http ๐Ÿ”’
A minimal blocking HTTP/1.1 request handler covering the routes the dashboard needs: the static page and two read-only JSON endpoints.
json ๐Ÿ”’
Hand-rolled JSON serialization for the REST responses (no dependencies).

Structsยง

Config ๐Ÿ”’
Runtime configuration resolved from the command line.

Constantsยง

DEFAULT_SMB_PORT ๐Ÿ”’
Default SMB port the dashboard sits next to (it listens on this plus one).
EXIT_USAGE ๐Ÿ”’
Exit code for a command-line usage error.

Functionsยง

fail ๐Ÿ”’
main ๐Ÿ”’
next_u16 ๐Ÿ”’
next_value ๐Ÿ”’
parse_args ๐Ÿ”’
Parse --smb-port, --port and --csv. The dashboard defaults to the SMB port (4450) plus one; an explicit --port overrides that.
print_help_and_exit ๐Ÿ”’
serve ๐Ÿ”’
Bind the listener and hand each connection to a worker thread. The CSV path is shared read-only; every request re-reads the file so external test runs are reflected immediately.