Summary
pkg/unikontainers/unikernels/unikraft.go is the core handler for Unikraft, the primary unikernel OS supported by urunc. It manages boot argument construction based on Unikraft versioning (< 0.16.1 legacy compatibility vs. modern vfs.fstab, netdev.ip, env.vars).
While sibling files mirage_test.go and mewz_test.go exist, unikraft.go currently has zero unit tests. Any regression in version parsing or command-line generation could break Unikraft container deployments in Kubernetes/containerd.
Expected Behavior
pkg/unikontainers/unikernels should include a unikraft_test.go test suite that verifies:
- Version fallback logic (
ErrUndefinedVersion, ErrVersionParsing, version >= 0.16.1 vs < 0.16.1).
- Boot command line generation via
CommandString() (environment variables env.vars=[ ... ], console string, network IP string, rootfs vfs.fstab).
- File system support (
SupportsFS("9pfs")) and block support (SupportsBlock()).
Proposed Changes
- Create
pkg/unikontainers/unikernels/unikraft_test.go with table-driven tests covering modern/legacy Unikraft versions, architecture-specific console settings (arm64 vs amd64), and error cases.
Summary
pkg/unikontainers/unikernels/unikraft.gois the core handler for Unikraft, the primary unikernel OS supported byurunc. It manages boot argument construction based on Unikraft versioning (< 0.16.1legacy compatibility vs. modernvfs.fstab,netdev.ip,env.vars).While sibling files
mirage_test.goandmewz_test.goexist,unikraft.gocurrently has zero unit tests. Any regression in version parsing or command-line generation could break Unikraft container deployments in Kubernetes/containerd.Expected Behavior
pkg/unikontainers/unikernelsshould include aunikraft_test.gotest suite that verifies:ErrUndefinedVersion,ErrVersionParsing, version>= 0.16.1vs< 0.16.1).CommandString()(environment variablesenv.vars=[ ... ], console string, network IP string, rootfsvfs.fstab).SupportsFS("9pfs")) and block support (SupportsBlock()).Proposed Changes
pkg/unikontainers/unikernels/unikraft_test.gowith table-driven tests covering modern/legacy Unikraft versions, architecture-specific console settings (arm64vsamd64), and error cases.