MCPcopy Create free account
hub / github.com/dan-v/lambda-nat-proxy / TestShutdownMessage

Function TestShutdownMessage

pkg/shared/control_test.go:65–82  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

63}
64
65func TestShutdownMessage(t *testing.T) {
66 var buf bytes.Buffer
67
68 // Write shutdown
69 if err := WriteShutdown(&buf); err != nil {
70 t.Fatalf("WriteShutdown failed: %v", err)
71 }
72
73 // Read it back
74 opcode, _, err := ReadControlMessage(&buf)
75 if err != nil {
76 t.Fatalf("ReadControlMessage failed: %v", err)
77 }
78
79 if opcode != OpShutdown {
80 t.Errorf("Expected OpShutdown (0x%02x), got 0x%02x", OpShutdown, opcode)
81 }
82}
83
84func TestUnknownOpcode(t *testing.T) {
85 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 2

WriteShutdownFunction · 0.85
ReadControlMessageFunction · 0.85

Tested by

no test coverage detected