Files
crowdsec-bouncer-traefik-pl…/tests/e2e
mhx 4c3bbf81fd tests: revert to docker provider + bump versions + add 6 scenarios
Reverts the stream-mode scenario to the Traefik docker provider (the
file provider was a workaround for a local docker daemon API version
mismatch, irrelevant in CI). Bumps Traefik to v3.7.1 and Crowdsec to
v1.7.8 across all scenarios.

Adds six new E2E scenarios:
- live-mode: short defaultDecisionSeconds, verifies cache-then-recheck
- none-mode: verifies LAPI is queried per request, no caching
- trusted-ips: clientTrustedIPs bypass even when the trusted IP is banned
- custom-ban-page: BanHTMLFilePath body + Content-Type validation
- captcha: captcha decision serves the captcha page (HTTP 200)
- appsec: SQLi probe blocked by appsec-virtual-patching

Each scenario uses an isolated compose project, mounts the repo as a
local plugin, and asserts behavior via curl. Workflow matrix and
Makefile E2E_SCENARIOS updated accordingly.

Refs #328
2026-06-06 12:03:19 +02:00
..

End-to-end test suite

These tests spin up real Traefik + Crowdsec containers and exercise the plugin in the same conditions Traefik uses in production: loaded from a local path, no module download, no mocking.

Each scenario lives in its own directory under scenarios/ and owns:

  • docker-compose.yml — the stack to spin up
  • run.sh — orchestration + assertions
  • optional fixtures (acquis.yaml, ban.html, ...)

Running locally

Prerequisites: docker, docker compose, curl, bash.

Run a single scenario:

./tests/e2e/scenarios/stream-mode/run.sh
# or
make e2e_stream-mode

Run everything:

make e2e

Each scenario uses an isolated Docker Compose project (-p e2e-<scenario>), so multiple scenarios can run in parallel without colliding on container names — except for the crowdsec container, which keeps its canonical name so cscli commands work uniformly across scenarios. Run scenarios serially if you need to invoke them on the same host at the same time.

Writing a new scenario

  1. Copy scenarios/stream-mode/ as a template.
  2. Rename container_names (keep crowdsec for the LAPI container).
  3. Edit run.sh to express the behavior under test.
  4. Add the scenario name to the matrix in .github/workflows/e2e.yml and to E2E_SCENARIOS in the Makefile.

CI

.github/workflows/e2e.yml runs one parallel job per scenario on every PR and push to main. On failure, container logs are uploaded as an artifact named logs-<scenario>.