Skip to content

Fix SecRemoteRules regression test not to depend on a specific error message #3211

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

Conversation

eduar-hte
Copy link
Contributor

@eduar-hte eduar-hte commented Aug 6, 2024

what

Simplify the Include remote rules - failed download (Abort) test expected parser error because it's not always the same in different curl/OS versions.

why

This was detected after an update of the GitHub runner images to macOS 14.6 released yesterday:

Current runner version: '2.317.0'
Operating System
  macOS
  14.6
  23G80
Runner Image
  Image: macos-14-arm64
  Version: 20240805.3

Builds that were assigned a macOS runner image with this version would fail when running the test/test-cases/regression/config-secremoterules.json regression tests.

The test configuration depends on a specific error message from curl/OS (HTTP response code said error), which seems to have changed (Failure when receiving data from the peer).

This PR simplifies the test configuration and look just for Failed to download, which is the prefix added by the libModSecurity parser when logging the parser error.

- After the GitHub macOS runner images were upgraded to macOS 14.6
  (Sonoma), the test 'Include remote rules - failed download (Abort)'
  started failing because the error message reported by curl/OS is no
  longer 'HTTP response code said error'.
Copy link

sonarqubecloud bot commented Aug 6, 2024

@eduar-hte
Copy link
Contributor Author

airween@, notice that the macOS builds triggered by the creation of the PR were assigned a macOS 14.5 runner, so them passing do not prove that the change fixes the issue.

Current runner version: '2.317.0'
Operating System
  macOS
  14.5
  23F79
Runner Image
  Image: macos-14-arm64
  Version: 20240728.1

You should retrigger them until you see that they're run on a macOS 14.6 runner.

@marcstern marcstern added the 3.x Related to ModSecurity version 3.x label Aug 7, 2024
Copy link
Member

@airween airween left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@airween airween merged commit 0feaeac into owasp-modsecurity:v3/master Aug 7, 2024
49 checks passed
@eduar-hte eduar-hte deleted the secremoterules-regression branch August 7, 2024 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Related to ModSecurity version 3.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants