Skip to content

test(unikernels): add unit tests for Mewz#640

Open
r0hansaxena wants to merge 1 commit into
urunc-dev:mainfrom
r0hansaxena:test/mewz
Open

test(unikernels): add unit tests for Mewz#640
r0hansaxena wants to merge 1 commit into
urunc-dev:mainfrom
r0hansaxena:test/mewz

Conversation

@r0hansaxena
Copy link
Copy Markdown

Description

Adds unit tests for the Mewz unikernel backend, covering CommandString, MonitorNetCli, MonitorBlockCli, MonitorCli, SupportsBlock, SupportsFS and Init. Tests verify the ip/gateway cmdline format, the qemu-only virtio-net device line, the no-block/no-fs guarantees, the qemu-specific monitor args (-no-reboot and isa-debug-exit) and Init's mask handling including the default /24 fallback when no mask is provided.

Related issues

How was this tested?

All 7 unit tests pass locally. Full package tests pass. Linter passes (make lint, 0 issues).

LLM usage

LLM assisted with locating coverage gaps only. All code was written manually and tested locally.

Checklist

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally (make test_ctr, make test_nerdctl, make test_docker, make test_crictl).
  • If LLMs were used: I have read the llm policy.

Signed-off-by: r0hansaxena <rohansxn8772@gmail.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented May 7, 2026

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit 6465d6f
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/69fc62e09339db0008012f76

Copy link
Copy Markdown
Contributor

@cmainas cmainas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @r0hansaxena ,

thank you for the PR.

I have added some comments.

assert.Empty(t, got.ExtraInitrd)

assert.Equal(t, types.MonitorCliArgs{}, (&Mewz{Monitor: "spt"}).MonitorCli())
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do not we add more checks for the monitors as the previous unit test?

assert.NoError(t, err)
assert.Equal(t, 24, m.Net.Mask)

out, _ := m.CommandString()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason to callCommandString, we can accessing the struct.

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.

2 participants