fix: update integration test to use hashed ruleset filenames

- Use glob pattern for ruleset file inspection (integration-xss-*.conf)
- Increase wait time for monitor mode config application from 2s to 5s
- Aligns with manager.go hash-based filename generation
This commit is contained in:
GitHub Actions
2025-12-03 23:23:19 +00:00
parent c366fe0ef2
commit 0795fcf10c

View File

@@ -107,7 +107,7 @@ curl -s http://localhost:2019/config | grep -n "waf" || true
curl -s http://localhost:2019/config | grep -n "integration-xss" || true
echo "Inspecting ruleset file inside container..."
docker exec charon-debug cat /app/data/caddy/coraza/rulesets/integration-xss.conf || true
docker exec charon-debug sh -c 'cat /app/data/caddy/coraza/rulesets/integration-xss-*.conf' || true
echo "Recent caddy logs (may contain plugin errors):"
docker logs charon-debug | tail -n 200 || true
@@ -127,10 +127,10 @@ SEC_CFG_MONITOR='{"name":"default","enabled":true,"waf_mode":"monitor","waf_rule
curl -s -X POST -H "Content-Type: application/json" -d "${SEC_CFG_MONITOR}" -b ${TMP_COOKIE} http://localhost:8080/api/v1/security/config
echo "Wait for Caddy to apply monitor mode config..."
sleep 2
sleep 5
echo "Inspecting ruleset file (should now have DetectionOnly)..."
docker exec charon-debug cat /app/data/caddy/coraza/rulesets/integration-xss.conf | head -5 || true
docker exec charon-debug sh -c 'cat /app/data/caddy/coraza/rulesets/integration-xss-*.conf | head -5' || true
RESPONSE_MONITOR=$(curl -s -o /dev/null -w "%{http_code}" -d "<script>alert(1)</script>" -H "Host: integration.local" http://localhost/post)
if [ "$RESPONSE_MONITOR" = "200" ]; then