Skip to content

test(unikernels): add unit tests for Unikraft version parsing and command string generation - #921

Open
ParthMozarkar wants to merge 1 commit into
urunc-dev:mainfrom
ParthMozarkar:test/unikraft-version-parsing-tests
Open

test(unikernels): add unit tests for Unikraft version parsing and command string generation#921
ParthMozarkar wants to merge 1 commit into
urunc-dev:mainfrom
ParthMozarkar:test/unikraft-version-parsing-tests

Conversation

@ParthMozarkar

@ParthMozarkar ParthMozarkar commented Aug 7, 2026

Copy link
Copy Markdown

Summary

This PR introduces unit test coverage for the Unikraft unikernel provider in pkg/unikontainers/unikernels/unikraft.go.

Description of Changes

Added pkg/unikontainers/unikernels/unikraft_test.go with table-driven tests covering:

  1. Version Parsing & Fallback:
    • Empty version returning ErrUndefinedVersion and defaulting to current args.
    • Invalid version strings returning ErrVersionParsing and defaulting to current args.
    • Modern versions (>= 0.16.1) generating vfs.fstab and netdev.ip args while preserving environment variables (env.vars=[ ... ]).
    • Legacy versions (< 0.16.1) generating compatibility arguments (netdev.ipv4_addr) and clearing environment variables.
  2. Command Line Generation: Verifies CommandString() formatting with app name, environment variables, network arguments, and user command parameters.
  3. Capabilities: Verifies SupportsFS("9pfs") returns true and SupportsBlock() returns false.

Related Issue

Closes #918

Verification & Testing

  • Added pkg/unikontainers/unikernels/unikraft_test.go and verified compilation targeting Linux (GOOS=linux).

@netlify

netlify Bot commented Aug 7, 2026

Copy link
Copy Markdown

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit cce6790
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/6a76382a68d7270007036b37

…mand string generation

Signed-off-by: ParthMozarkar <greatparth21@gmail.com>
@ParthMozarkar
ParthMozarkar force-pushed the test/unikraft-version-parsing-tests branch from 3d617b6 to cce6790 Compare August 7, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Testing]: Add unit test coverage for Unikraft version parsing and boot commandline generation

1 participant