Skip to content

test(unikernels): Add unit test suite for Unikraft driver - #945

Open
safiya2610 wants to merge 1 commit into
urunc-dev:mainfrom
safiya2610:test/unikraft-unit-tests
Open

test(unikernels): Add unit test suite for Unikraft driver#945
safiya2610 wants to merge 1 commit into
urunc-dev:mainfrom
safiya2610:test/unikraft-unit-tests

Conversation

@safiya2610

Copy link
Copy Markdown

Problem

The Unikraft unikernel driver in pkg/unikontainers/unikernels/unikraft.go currently lacks unit test coverage. Critical logic such as command-line parameter generation, version-based network configuration, and root filesystem handling is not protected against regressions.

Summary

This PR introduces a comprehensive table-driven unit test suite (unikraft_test.go) for the Unikraft driver.

Changes include:

  • TestUnikraftCommandString: Verifies CLI parameter generation for standard executions, environment variables, network arguments, and VFS configurations (initrd).
  • TestUnikraftSupportsFS & TestUnikraftSupportsBlock: Validates that Unikraft correctly reports support only for 9pfs and rejects ext2, virtiofs, and block devices.
  • TestUnikraftInitVersionHandling: Verifies the version comparison logic in configureUnikraftArgs(), ensuring legacy networking arguments (netdev.ipv4_addr) are applied for Unikraft < 0.16.1, and modern arguments (netdev.ip) for >= 0.16.1.

Testing

  • Tested locally via go test -v ./pkg/unikontainers/unikernels/... (All Unikraft tests pass).
  • Validated that go build does not break.

Linked Issues

Fixes: #943

Signed-off-by: safiya2610 <lci2023053@iiitl.ac.in>
@netlify

netlify Bot commented Aug 10, 2026

Copy link
Copy Markdown

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit 296f7cf
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/6a7a5e3941003d0008130ad3

@safiya2610

Copy link
Copy Markdown
Author
Screenshot (4111)

@safiya2610

Copy link
Copy Markdown
Author
Screenshot (4111)

@cmainas Can you please review the PR.

@cmainas cmainas added invalid This doesn't seem right do-not-merge labels Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(unikernels/unikraft): Add unit test suite for Unikraft driver CLI parameter generation

2 participants