test: add Docker-based build and smoke test environment - #92
Open
fzipi wants to merge 3 commits into
Open
Conversation
Adds a multi-stage Dockerfile that builds libmodsecurity v3, Apache 2.4.62, and the connector, plus docker-compose.yml, an automated test-connector.sh smoke test, and docs summarizing the fixes and how to verify them. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
test-rules.conf's REQUEST_BODY rule used status:488, a non-standard code Apache can't emit on the wire (it falls back to 500), while test-connector.sh inconsistently expected 403 for the same rule in one test and 488 in another. Use 403 everywhere so the smoke suite actually passes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Builds the Docker image and runs test-connector.sh on push to master and on pull requests that touch the Dockerfile, docker-compose.yml, test-connector.sh, or src/. There was previously no CI covering the Docker build. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Dockerfilethat builds libmodsecurity v3, Apache 2.4.62, and the connector, and produces a runnable test imagedocker-compose.ymlfor container managementtest-connector.sh, an automated smoke test suite (normal requests, query-string blocking, request-body blocking, large/multi-bucket POST handling)DOCKER_TEST.mdandFIXES_SUMMARY.mddocumenting how to run the tests and what they verifytest-connector.sh's expectations so the suite passes consistently.github/workflows/docker-build.yml) that builds the image and runstest-connector.shon pushes tomasterand on PRs touching the Dockerfile, compose file, test script, orsrc/— there was no CI covering the Docker build beforeTest plan
docker build -t modsec3-apache-test .completes successfullymod_security3./test-connector.shpasses all 6 checks (200/403/200/200/403 as expected)actionlintandzizmorreport no findings on the new workflow