mirror of
https://github.com/netbirdio/netbird.git
synced 2026-07-18 20:49:56 +00:00
Stand up the full agent-network data path in containers and drive a real chat-completion through the gateway: - harness: a shared docker network (combined server reachable by alias), a proxy container built from the published reverse-proxy image (NB_PROXY_PRIVATE, NB_PROXY_ALLOW_INSECURE, NB_RELAY_TRANSPORT=ws to match the combined server's WS-multiplexed relay) with a generated self-signed wildcard cert, and a netbird client container that joins via a setup key. - the combined image, proxy image, and client image default to the published rc.2 releases (overridable via NB_E2E_*_IMAGE; a bare local tag is built from source instead). Geolocation download is disabled so the server starts without external fetches. - one shared domain is used for the management exposed address, the proxy domain, and the agent-network cluster; the proxy token is minted via the server CLI (global) to match the manual install. TestChatCompletionThroughProxy provisions provider+policy+group+setup key, runs proxy+client, drives an OpenAI chat-completion through the tunnel, and asserts a 200 plus the ingested access-log row. Requires OPENAI_TOKEN (skips otherwise). The provider must be created with enabled=true explicitly — the create default is false despite the API doc.
27 lines
859 B
Go
27 lines
859 B
Go
//go:build e2e
|
|
|
|
package harness
|
|
|
|
// combinedConfigYAML is a minimal combined-server config for tests: plain HTTP
|
|
// on :8080 (no TLS cert configured → the server serves HTTP and expects to sit
|
|
// behind a reverse proxy, which is exactly what we want for in-cluster tests),
|
|
// embedded IdP, local signal/relay/STUN, and a sqlite store under the mounted
|
|
// data dir. exposedAddress is the address peers use to reach this container; it
|
|
// is overridden per-run so the value matches the container's network alias.
|
|
const combinedConfigYAML = `server:
|
|
listenAddress: ":8080"
|
|
exposedAddress: "%s"
|
|
healthcheckAddress: ":9000"
|
|
metricsPort: 9090
|
|
logLevel: "info"
|
|
logFile: "console"
|
|
authSecret: "e2e-relay-secret"
|
|
dataDir: "/nb/data"
|
|
disableAnonymousMetrics: true
|
|
disableGeoliteUpdate: true
|
|
auth:
|
|
issuer: "%s"
|
|
store:
|
|
engine: "sqlite"
|
|
`
|