-
Notifications
You must be signed in to change notification settings - Fork 39
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
tests: Fix test-commands test case failures. #172
tests: Fix test-commands test case failures. #172
Conversation
PR #171 will be leveraged by this pull requested once it is merged to master. |
Pull Request Test Coverage Report for Build 1647641308Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
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.
Just one grammar nit, I don't have any other suggestions right now. Will watch for updates w.r.t. #171
f317b97
to
0f9111d
Compare
The current test-commands unit test assumes that it can use hard-coded MPTCP address ID test values, but that could fail if the same address ID is currently in use by the in-kernel path manager. Leverage the mptcpd global MPTCP address ID manager to generate an ID suitable for the test since it attempts to stay in sync with the kernel.
Co-authored-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Instead of relying on the appearance of the MPTCP generic netlink path manager family, use the mptcpd path manager "pm_ready" callback feature to determine when to run the test cases in the test-commands unit test. This ensures that mptcpd is fully initialized prior to running the test cases.
The mptcpd_pm_ready() call in the test-commands unit test is no longer necessary since the tests now are only run when the mptcpd path manager is guaranteed to be fully initialized and ready.
Call flush_addrs after all kernel path management command test cases are run to make sure resources, such as MPTCP address/IP mappings, used between between test cases are valid. Calling flush_addrs wipes out all such mappings.
The mptcpd_kpm_add_addr() and mptcpd_kpm_get_addr() command tests will fail if the test IP address is not bound to a network interface. Set up the test IP address on the loopback interface prior to the test run, and tear it down afterward. This requires that the test be run with CAP_NET_ADMIN capability, such as running it through the root user. The previous behavior of ignoring and logging failures due to lack of the CAP_NET_ADMIN capability is still preserved.
30fedd3
to
0a1adf1
Compare
Run the mptcpd test suite as root when generating code coverage results so that mptcpd code paths that require that capability are also exercised.
Run tests as both non-root and root user to help ensure code paths that are triggered when insufficient and sufficient privileges respectively exist are executed.
The GitHub "ubuntu-latest" environment does not support the "ip mptcp" command/object. Drop the call to it that reset the MPTCP limits to 0.
With these changes in place the full set of test cases in the The test suite was run with the following set of commands:
There is one caveat to keep in mind when running
Ideally, the test should retrieve and store existing MPTCP limits prior to running the |
I also tried to run tests in the mptcpd GitHub workflows as |
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.
Looks good to me. Tried building/running with ELL 0.30 and recent master branch (although I modified the recent ELL to deal with the warnings, unrelated to this PR).
Correct several issues with the
test-commands
unit test:test-commands
unit test assumes that it can use hard-coded MPTCP address ID test values, but that could fail if the same address ID is currently in use by the in-kernel path manager. Leverage the mptcpd global MPTCP address ID manager to generate an ID suitable for the test since it attempts to stay in sync with the kernel.mptcpd_kpm_add_addr()
test case always fails.mptcpd_kpm_add_addr()
test failures by explicitly binding the test IPv4 address to a network interface (loopback).mptcpd_kpm_flush_addrs()
was called too early.get_addrs
test case, causing the latter to fail due to all MPTCP addresses being purged from the in-kernel MPTCP path manager prior to retrieval of the test addresses.