test(hypervisors): cover Qemu.BuildExecCmd#597
Open
parthdagia05 wants to merge 1 commit intourunc-dev:mainfrom
Open
test(hypervisors): cover Qemu.BuildExecCmd#597parthdagia05 wants to merge 1 commit intourunc-dev:mainfrom
parthdagia05 wants to merge 1 commit intourunc-dev:mainfrom
Conversation
Walks through the main code paths the function exercises — static flags, memory, vCPUs, network (incl. vhost), initrd, sharedfs, block devices, vsock, and the kernel command append rule. Signed-off-by: Parth Dagia <parth.24bcs10414@sst.scaler.com>
✅ Deploy Preview for urunc canceled.
|
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.
Description
Qemu.BuildExecCmdinpkg/unikontainers/hypervisors/qemu.godidn't have any direct unit-test coverage, so this PR addsqemu_test.gothat walks through the main branches the function actually exercises:-smpwhen zero, sets it correctly otherwise)-M virton arm64)MonitorNetCli, and vhost on/offExactArgsverbatim pathMonitorCliextras (ExtraInitrd,OtherArgs)VAccelTypeset-appendrule for the kernel command lineA small
fakeUnikernelstub keeps the tests focused onBuildExecCmditself rather than pulling in any real unikernel implementation.Related issues
How was this tested?
go test ./pkg/unikontainers/hypervisors/...passes locallygo build ./...passest.Parallel()and assert against the joined command stringLLM usage
Used Anthropic's Claude Opus 4.6 to help research the function's branches and shape the test cases around the actual code paths.
Checklist
make lint).make test_ctr,make test_nerdctl,make test_docker,make test_crictl).