Rework netfilter tests in preparation for running them on Buildkite. #12245
+529
−545
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.
Rework netfilter tests in preparation for running them on Buildkite.
The main goal of this rework is to make the netfilter tests better to work with
on native Linux. The main change to this end is adding NetfilterBoundSocket,
which helped debug what was going on with NetlinkNetfilterBatchRequestAckOrError
on certain kernels. Prior to this, running the test natively on older kernels
would simply block forever.
Destroying test-created tables as cleanup actions has been removed in favour of
simply creating uniquely-named tables. This is preferable in case the destroy
command itself fails (as it does on older kernels), and we can guarantee that
tables won't get reused between tests, which causes problems.
ErrNewBaseChainWithUnsupportedFamilyChainTypePair has been removed because it is
incorrect regarding native Linux behaviour; support for it needs to be added in
gVisor but that's outside the scope of this CL.
socket_netlink_netfilter_test was tested on Linux 6.8 (cgroupsv2 agents on
buildkite).