Skip to content
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 12 commits into from
Jan 3, 2020
Merged

Extend the test suite #24

merged 12 commits into from
Jan 3, 2020

Conversation

lfos
Copy link
Contributor

@lfos lfos commented Jan 2, 2020

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.

lfos added 12 commits January 2, 2020 23:29
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.
@poolpOrg poolpOrg self-assigned this Jan 3, 2020
@poolpOrg poolpOrg merged commit fa5b74d into poolpOrg:master Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants