Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests that would fail if run on microvm 6.1 #4733

Merged
merged 4 commits into from
Aug 20, 2024

Conversation

Manciukic
Copy link
Contributor

@Manciukic Manciukic commented Aug 16, 2024

Changes

This patchset fixes some tests that would fail if run on a guest kernel 6.1 (#4737). None of these seems to be an issue with the firecracker/guest kernel integration, but only a testing framework issue.

This patch-set was tested on 6.1 kernel here: https://buildkite.com/firecracker/mancio-test/builds/9

1. wait for VM to be up before taking snapshots

test_get_full_config_after_restoring_snapshot
test_remove_regs

These two tests are failing on uvm 6.1. This is caused by vmgenid driver not being initialized at the time we take the snapshot. This is something we explicitly warn against in the documentation here but we were only observing it in x86.

This patch adds the wait_for_up like other snapshot tests to ensure the guest is fully booted before taking the snapshot.

2. remove assumption on no hwrng device except virtio_rng

test_rng.py tests assume that virtio_rng device is the only hw rng available in the microvm. Since 5.15, ARM uvms have a SMCCC TRNG device which is paravirtualized by KVM (https://patchwork.kernel.org/project/linux-arm-kernel/list/?series=400659&state=%2A&archive=both).
This patch removes that assumption by checking which rng are available and which is currently in use in the tests to ensure the right device is tested (virtio-rng).

Reason

We are adding support for uvm 6.1, these tests, despite being only run on 5.10 in the CI, would fail if run on 6.1

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this
    PR.
  • API changes follow the Runbook for Firecracker API changes.
  • User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
  • New TODOs link to an issue.
  • Commits meet
    contribution quality standards.

  • This functionality cannot be added in rust-vmm.

When using guest kernel 6.1 these tests started failing. Waiting for
the VM to come up before the snapshot fixes the problems.

Signed-off-by: Riccardo Mancini <mancio@amazon.com>
On guest 6.1 on ARM instances we have a new paravirtualized SMCC
TRNG device, which breaks the assumptions of test_rng_not_present.
This patch changes the test to read the list of available hwrng devices
and assert virtio_rng is not preset.

Signed-off-by: Riccardo Mancini <mancio@amazon.com>
ARM Uvm with 6.1 kernel have an additional SMCCC TRNG device which is
paravirtualized by KVM. We need to ensure we are testing the virtio-rng
device, which is the one picked up by default by the kernel, if
available.

Signed-off-by: Riccardo Mancini <mancio@amazon.com>
@Manciukic Manciukic requested review from bchalios and roypat August 16, 2024 15:44
@Manciukic Manciukic changed the title Uvm 6.1/tests Fix tests that would fail if run on microvm 6.1 Aug 16, 2024
Copy link

codecov bot commented Aug 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.37%. Comparing base (312030d) to head (1430a13).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4733   +/-   ##
=======================================
  Coverage   84.37%   84.37%           
=======================================
  Files         249      249           
  Lines       27433    27433           
=======================================
  Hits        23147    23147           
  Misses       4286     4286           
Flag Coverage Δ
5.10-c5n.metal 84.60% <ø> (ø)
5.10-m5n.metal 84.59% <ø> (+<0.01%) ⬆️
5.10-m6a.metal 83.88% <ø> (+<0.01%) ⬆️
5.10-m6g.metal 80.90% <ø> (-0.01%) ⬇️
5.10-m6i.metal 84.58% <ø> (-0.01%) ⬇️
5.10-m7g.metal 80.91% <ø> (+<0.01%) ⬆️
6.1-c5n.metal 84.60% <ø> (ø)
6.1-m5n.metal 84.58% <ø> (-0.01%) ⬇️
6.1-m6a.metal 83.87% <ø> (ø)
6.1-m6g.metal 80.91% <ø> (ø)
6.1-m6i.metal 84.58% <ø> (ø)
6.1-m7g.metal 80.91% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Manciukic Manciukic merged commit 40a57fc into firecracker-microvm:main Aug 20, 2024
7 checks passed
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.

3 participants