-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix: mod_security2's regression tests fix #3425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
fzipi
approved these changes
Jul 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go!
theseion
requested changes
Jul 28, 2025
theseion
requested changes
Jul 29, 2025
Co-authored-by: Max Leske <[email protected]>
|
theseion
approved these changes
Jul 29, 2025
e1ea8e5
into
owasp-modsecurity:v2/master
122 of 162 checks passed
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.
what
This PR is a set of commits, where I fixed Apache2 mod_security2's regression tests.
We definitely should integrate this regression test framework to mod_security2's CI pipeline.
why
Unfortunately the tests were abandoned, last commits were 12 years ago. Most tests checks log line messages and status codes, and I assume many messages have changed. Also, it seems like the test script (
tests/run-regression-tests.pl
) itself was not finished, I had to add a few modifications for a working state.Commits' details:
rel2abs()
wasn't referenced as it's expected;-S
arguments wasn't handledDIST_ROOT
was set to parent directory of the whole projectmodsecurity.conf-minimal
- that's almost the same as-recommended
, but I removed audit.log settings; that's the script's taskunicode.mapping
fileRUNASUSER
; this can be different on different systems (Linux, Windows)ip.pag
file stores theIP
collections data, but that has changed too: the new format is$USERNAME-ip.pag
, eg.www-data.ip.pag
, but if we run local, then the user it's meStatusEngine
does not work anymore, I didn't want to remove that completely, just suspended (commented out)SecRemoteRules
needs to maintain a remote infrastructure, and as we agreed this feature will be phased out; same as the previous case, I just suspendedMakefile.am
; Now after the build it's enough to run the command:make test-regression
, and all the tests will run. If all tests are success, thenmake
returns0
, otherwise it shows the problems.How does it work?
If you build the module, you can run the test on two ways:
make test-regression
in source root directorycd tests; ./run-regression-tests.pl -v -S .
, where-v
is theverbose
flag-S
is the server's root path directory; without this the script does not work out of box, but you can set different path - if you know what are you doingYou can run a single test file or just a single test case from a file, eg:
or
where the last
4
means you want to run the 4th test only.For help, run:
Indeed, I'm going to add these information to README.