-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Extend the test suite #24
Merged
Merged
Conversation
This file contains 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
Split the test cases into several logical modules that can be run separately. To run all tests at once, use `make check`.
The current test suite implementation does not only rely on network connectivity, it also hardcodes real-life IP addresses and assumes they have a Sender Score within a specific range. This makes the test suite unusable offline and prone to break with future changes in the score of those specific IP addresses. Address this by adding a -testMode command line flag. When used, instead of executing DNS queries, the Sender Score is derived directly from the last byte of the connecting IP address. If the IP address ends with 255, the filter behaves as if the Sender Score DNS query was not found in production mode. Moreover, if this flag is used, all requests are processed sequentially. This patch also removes the -disableConcurrency flag, since sequential processing is enabled implicitly with -testMode and not useful outside the test suite.
Refactor tests and add tests for the -blockPhase argument.
Add a test case to test the -junkBelow parameter with a reputable IP address.
The current protocol check yields incorrect results if the protocol version is larger than 0.5 but has 0.1, 0.2, 0.3 or 0.4 as a prefix. For example, using protocol version 0.42 turns on legacy mode even though it should not. Fix this by parsing the version number properly instead of using string comparisons.
Add a test case to verify that high protocol versions such as 0.42 do not trigger legacy mode.
Test both the IP address whitelist and the subnet whitelist features.
Add a regression test to make sure the program does not crash if an invalid session ID is received, such as was the case before commit be532be (Avoid segmentation fault on invalid session ID, 2019-12-17).
Redirect stderr to /dev/null by default. The scripts can still be executed directly for verbose output.
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.
Multiple improvements and additions to the test suite. I will look into creating a test suite for the other filters as well as soon as this is merged.