Documentation
¶
Overview ¶
Package silkdtest fakes a silkd daemon for host-side tests: deterministic frame semantics over any listener, plus the hybrid-vsock muxer handshake for tests that dial a UDS the way sandboxd does.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListenHybrid ¶
ListenHybrid serves the muxer handshake on a UDS: each connection must open with "CONNECT <port>", is answered "OK <port>", then speaks the Serve protocol. The returned closer stops the listener.
func Serve ¶
Serve accepts connections until l closes, speaking one RPC per connection and closing it after the terminal frame, like silkd. Semantics: info → InfoResp; exec echo → stdout of the args; exec cat → echoes stdin frames until stdin_close; exec false → exit 1; exec sleep → started, then blocks until the client disconnects; anything else → an error frame.
Types ¶
type Fake ¶
type Fake struct {
Root string
// contains filtered or unexported fields
}
Fake is a stateful silkd fake backing the fs verbs with a real directory and tracking sessions, so an SDK write-then-read round-trips through it. exec/info reuse the stateless handlers. It exists for host-side unit tests; the authoritative fs/session behavior is silkd's own Rust test suite.