gost/tests/e2e
ginuerzh ccf2989bc0 gost: bump x to v0.13.9, relay to v0.6.2; add PHT e2e tests
- go.mod: x v0.13.8 → v0.13.9, relay v0.6.1 → v0.6.2
- tests/e2e/pht_test.go: 3 test cases (basic tunnel, PHTs, heartbeat)
- tests/e2e/testdata/pht/: client/server and client_phts/server_phts YAML configs
2026-07-06 22:10:15 +08:00
..
scripts test(mtls): add e2e tests for mTLS client cert identity forwarding 2026-07-04 19:00:44 +08:00
testdata gost: bump x to v0.13.9, relay to v0.6.2; add PHT e2e tests 2026-07-06 22:10:15 +08:00
Dockerfile Add e2e test cases for shadowsocks 2026-05-22 14:28:17 +08:00
PLAN-HTTP.md feat: add comprehensive HTTP e2e tests covering connector, TLS, probeResist, idleTimeout, and UDP relay 2026-06-26 22:00:35 +08:00
PLAN.md feat: add comprehensive HTTP e2e tests covering connector, TLS, probeResist, idleTimeout, and UDP relay 2026-06-26 22:00:35 +08:00
README.md Add e2e test cases for shadowsocks 2026-05-22 14:28:17 +08:00
dns_test.go test: add http2 handler e2e suite and tighten host-mapper + idle-timeout tests 2026-06-27 20:15:31 +08:00
file_test.go feat: add file handler e2e tests covering GET, PUT, index, auth, and 404 2026-06-26 22:19:13 +08:00
forward_test.go feat: add comprehensive forward handler e2e tests 2026-06-27 13:59:22 +08:00
http2_test.go test: add http2 handler e2e suite and tighten host-mapper + idle-timeout tests 2026-06-27 20:15:31 +08:00
http_test.go feat: add comprehensive HTTP e2e tests covering connector, TLS, probeResist, idleTimeout, and UDP relay 2026-06-26 22:00:35 +08:00
main_test.go fix(e2e): use host network for Docker image builds in DinD environments 2026-06-06 20:34:24 +08:00
mtls_test.go test(mtls): add e2e tests for mTLS client cert identity forwarding 2026-07-04 19:00:44 +08:00
parallel_selector_test.go Add e2e test cases for shadowsocks 2026-05-22 14:28:17 +08:00
pht_test.go gost: bump x to v0.13.9, relay to v0.6.2; add PHT e2e tests 2026-07-06 22:10:15 +08:00
shadowsocks_test.go Add e2e test cases for shadowsocks 2026-05-22 14:28:17 +08:00
utils.go feat: add comprehensive DNS handler e2e tests 2026-06-27 00:21:37 +08:00

README.md

End-to-End Tests

Integration tests that spin up real gost instances inside Docker containers and verify protocol behavior over the network.

Prerequisites

  • Docker (running daemon)
  • Go toolchain (for compiling the gost binary under test)

Running

From the repository root:

# Run all e2e tests
go test ./tests/e2e/ -v -timeout 10m

# Run a specific test suite
go test ./tests/e2e/ -v -run TestShadowsocksSuite -timeout 5m
go test ./tests/e2e/ -v -run TestParallelSelectorSuite -timeout 5m

# Use a pre-built gost binary (skips compilation)
go test ./tests/e2e/ -v -gost-bin /path/to/gost

Architecture

tests/e2e/
├── Dockerfile                  # Shared base image (Alpine + curl, python3, etc.)
├── main_test.go                # TestMain: compiles gost, creates Docker network
├── utils.go                    # Helpers: container lifecycle, config rendering
├── scripts/
│   ├── tcp_echo.py             # HTTP echo server (responds with "hello-gost")
│   └── udp_echo.py             # UDP echo server (reflects payloads)
├── testdata/                   # config files or data files for running cases
├── shadowsocks_test.go         # Shadowsocks protocol tests
└── parallel_selector_test.go   # Parallel node selector tests

How it works

  1. TestMain (main_test.go) compiles the gost binary from ../../cmd/gost (unless -gost-bin is provided) and creates a shared Docker network for all containers.
  2. Each test suite starts echo server containers (TCP/UDP), then launches separate gost containers for server and client roles.
  3. Client configs use Go template syntax ({{.ServerAddr}}) so the server address is injected at runtime.
  4. Tests verify end-to-end connectivity by sending traffic through the gost proxy chain and checking that the echo server responds correctly.

Tips

  • Increase -timeout for CI or slow networks. Container image builds on first run take extra time.
  • Use -gost-bin to avoid recompiling when iterating on tests locally.
  • Add -v to see container log output on failure.
  • RunGostContainer will wait for exposedPorts automatically, but it's not reliable for udp ports. So, you should check the readiness of udp ports inside cases.