test(e2e): run the firecracker suite by default and reap its leaked VMs - #204
Merged
Conversation
This file contains hidden or 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
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.
The
firecrackere2e suite (9 scenarios) existed but was not in the default set oftests/e2e/run.sh, so it only ran when named explicitly. Unlike the containerd exclusion — which is documented and justified by its root/CNI requirements — this one was neither. Cloud Hypervisor is in the default set with the same shape of prerequisites (/dev/kvmplus a VMM binary, eachsetup.shexiting non-zero with an install hint when they are missing), so Firecracker joins it. A host lacking the prerequisites now reports a clear failure instead of silently skipping the least mature runtime's coverage.cleanup_between_testsalso did not reap Firecracker VMs. A test killed before its own EXIT trap runs leaves a live VM holding its tap and its /30, and the next test that hashes to the same network slot then fails on a name already taken. Verified on a host with firecracker and/dev/kvm: interrupting a test does leavefirecrackerprocesses behind, and the addedpkillreaps them.The kill is scoped to the suite's own socket directory (
ring-e2e-fc-sockets-*) rather than everyfirecrackerprocess. The existing kills in this function are unscoped, but a container runtime's daemon is not comparable to a microVM: one running on this host may well belong to something other than the test suite.One gap is left open and documented in place. Killing a VM does not remove its tap, which is persistent. The suite already reaps those itself —
setup.shsnapshotsring-*interfaces before the run and deletes what appeared, via an EXIT trap — but if a test is killed hard enough to skip that trap, the leaked tap is already present when the next test snapshots, so it is treated as pre-existing and never reaped. Deleting everyring-*fromrun.shwould close it, at the risk of taking down a tap belonging to a concurrent Ring: the tap name is a hash of the instance id, with nothing in it to tell a test VM from a real one. Not worth trading a leaked interface for a broken workload.Tests
bash -nclean. Ran the Firecracker suite on a host with the prerequisites: the tests fail there for lack ofCAP_NET_ADMINon the test binary (setcap cap_net_admin+epneeds interactive sudo), which is an environment limit rather than a code one. What the run did confirm is that the error path is correct end to end —TapDevice::createreports the exact remedy, the failure classifies as retryable,restart_countclimbs toward its bound, and no tap is leaked across repeated failures.