mirror of
https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin.git
synced 2026-09-02 20:28:50 +02:00
📝 test(e2e/redis): fix swapped IP→verdict comments
The mock returns "f" (not banned) for 1.2.3.4 and "t" (banned) for 1.2.3.5, and the run.sh assertions match that. Both doc comments described the opposite mapping; correct them to match the code. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -52,7 +52,7 @@ func list(m map[string]Decision) []Decision {
|
||||
// --- Redis mock (inline-command wire format, as spoken by simpleredis) ---
|
||||
|
||||
// serveRedis is a hardcoded stand-in. Every line is scanned for known IPs:
|
||||
// 1.2.3.4 → "t", 1.2.3.5 → "f", GET for anything else → miss ($-1).
|
||||
// 1.2.3.4 → "f", 1.2.3.5 → "t", GET for anything else → miss ($-1).
|
||||
// SET, DEL, AUTH, SELECT get +OK (they don't read the response anyway).
|
||||
func serveRedis(addr string) {
|
||||
ln, err := net.Listen("tcp", addr)
|
||||
|
||||
@@ -7,8 +7,8 @@ source "$HERE/../../lib/common.sh"
|
||||
|
||||
SCENARIO=redis
|
||||
|
||||
# Redis cache check: the mock returns "t" (banned) for 1.2.3.4 and "f" (not
|
||||
# banned) for 1.2.3.5. All other IPs return a miss, which falls through to the
|
||||
# Redis cache check: the mock returns "f" (not banned) for 1.2.3.4 and "t"
|
||||
# (banned) for 1.2.3.5. All other IPs return a miss, which falls through to the
|
||||
# LAPI (no decision → allowed). This proves the plugin reads cached decisions
|
||||
# from Redis correctly.
|
||||
body() {
|
||||
|
||||
Reference in New Issue
Block a user