Debian Codegraph @

internal/test/testsuite/doc.go

raw
1 // Package testsuite provides integration-test helpers for OpenVPN management,
2 // OAuth2, OIDC, and HTTP test flows.
3 //
4 // The central type is Suite, which owns test configuration, mock HTTP
5 // transport, in-memory logs, the OpenVPN client, the OAuth2 client, and the
6 // accepted management-interface connection. Suite can set up either a full mock
7 // OIDC environment with an HTTP callback server or a lighter management-only
8 // environment for OpenVPN tests.
9 //
10 // SetupOIDCServer starts a minimal OIDC provider and applies the generated
11 // issuer, client credentials, callback base URL, nonce settings, and refresh
12 // defaults to the suite configuration. SetupOpenVPNOAuth2Clients then builds the
13 // OpenVPN and OAuth2 clients from that configuration.
14 //
15 // Conn wraps a raw net.Conn with the same management-interface assertions used
16 // by Suite, so tests that do not need a full Suite can still send commands,
17 // compare responses, read single lines, and perform the OpenVPN version and
18 // hold-release handshake consistently.
19 //
20 // The package also includes HTTP helpers for issuing requests through either a
21 // Suite-owned client or an arbitrary http.Client, plus mock round-trippers and
22 // listener utilities used by integration tests. Logger and buffer primitives
23 // live in internal/test/testlogger; Suite exposes only GetLogger and Logs for
24 // consumers that need log output.
25 package testsuite