-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add e2e testing of ipvlan, macvlan, and bridge plugins #167
Conversation
@steveej @jonboulle I intend to rebase #145 on top of this and use this framework for the testcases that were requested. |
As a bonus it increases test coverage from 21% to 36% overall, and we get this for plugins: ok github.com/appc/cni/plugins/main/ipvlan 0.014s coverage: 68.9% of statements |
@danwinship a review from you would be nice since you've done similar-yet-different stuff for openshift-sdn... |
Seems like maybe it would be good to have a way to run the new test programs against the actual netlink implementation, so you can make sure that they actually actually work. (Maybe a second set of tests using the real ops instead of the test ops, but skipped by default?) |
ecd9620
to
b4f221d
Compare
d3ead5f
to
c0d9344
Compare
@steveej @jonboulle @danwinship PTAL; latest push enables both mock and live testing. I'm not 100% happy with how the live testing gets done (by running all testcases over with a new env variable) but I can fix that next week if people want. |
BTW, the first commit in this PR is actually #176 |
travis failure seems to be a flake?
|
return nil, syscall.Errno(syscall.ERANGE) | ||
} | ||
nsid = int(nsfd) | ||
} |
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.
missing default case
@dcbw The |
I'm also unclear on why you're calling |
5e1051e
to
c39e019
Compare
@rosenhouse rebased and fixed NewNS. PTAL, thanks! |
ed4b93e
to
c12f35d
Compare
@rosenhouse as a side-effect of only calling LockOSThread() in the goroutine for netns.Do(), we now need to make sure that any checks we do in testcases are done wrapped in a Do(), otherwise I see periodic failures where the namespace gets switched back, possibly because the testcase gets switched to the main thread every so often. Just something to be aware of. |
@dcbw @rosenhouse I suggest that we split this PR in two. The first one without change in implementation related to tests at all, just adding of tests and fixes in the network locking. The second one can then be rebased on top of the reworked first one. I would really like to get this in by the end of the week as it is the biggest blocker for v0.3 which is highly awaited at this point. |
This also removes the thread-locking arguments from the ns package per containernetworking#183 by doing all the namespace changes in a separate goroutine that locks/unlocks itself, instead of the caller having to track OS thread locking.
c12f35d
to
ab8ecee
Compare
@steveej could you clarify which parts you'd like split out into separate PRs? I'm not sure which parts you mean by "just adding of tests and fixes in the network locking". Is there anything else I can do about the later patches in the series that add e2e testing that would make you more comfortable with them? I'm happy to continue reworking patches, but to get things done by the end of the week the review/rework cycle needs to be a lot shorter... |
In the interest of getting the fixes merged faster I've removed the netops stuff and pushed a reduced set of commits in #211. We'll leave this one open to discuss mocking further. |
@dcbw I've lost track of this PR's changes. Have they been merged via another PR? |
@steveej the only thing this PR was kept around for was the mock netlink stuff. But I guess we long ago decided not to use that, so I'll close and we can always resurrect later if we want to. |
Fixes #179