Skip to content

Various small test fixes#5887

Open
JamesC1305 wants to merge 3 commits into
firecracker-microvm:mainfrom
JamesC1305:fix-test-stuff
Open

Various small test fixes#5887
JamesC1305 wants to merge 3 commits into
firecracker-microvm:mainfrom
JamesC1305:fix-test-stuff

Conversation

@JamesC1305
Copy link
Copy Markdown
Contributor

@JamesC1305 JamesC1305 commented May 14, 2026

Changes

  • Commit 1: Allow the AL2023 rootfs to be selected by devtool sandbox
  • Commit 2: Disable boot-time crypto self-tests
  • Commit 3: Clear /srv/test_artifacts on each test run

Reason

  1. QoL
  2. Fix boot time regressions
  3. Artifact A/B would re-use A's artifacts for the B run

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

  • I have read and understand CONTRIBUTING.md.
  • I have run tools/devtool checkbuild --all to verify that the PR passes
    build checks on all supported architectures.
  • I have run tools/devtool checkstyle to verify that the PR passes the
    automated style checks.
  • I have described what is done in these changes, why they are needed, and
    how they are solving the problem in a clear and encompassing way.
  • I have updated any relevant documentation (both in code and in the docs)
    in the PR.
  • I have mentioned all user-facing changes in CHANGELOG.md.
  • If a specific issue led to this PR, this PR closes the issue.
  • When making API changes, I have followed the
    Runbook for Firecracker API changes.
  • I have tested all new and changed functionalities in unit tests and/or
    integration tests.
  • I have linked an issue to every new TODO.

  • This functionality cannot be added in rust-vmm.

We were previously only searching for ubuntu rootfs'. Add AL2023 to the
list too.

Signed-off-by: James Curtis <jxcurtis@amazon.co.uk>
With the Kconfig update in commit 8a7e8a0,
CONFIG_CRYPTO_MANAGER_DISABLE_TESTS was changed from `y` to `not set`.
Crypto self-tests are required as part of the FIPS-enabled boot tests
and we will use the same Kconfig for testing FIPS-enabled VMs, so
instead of disabling tests at config level again, we set
`cryptomgr.notests` kernel boot arg to skip them.

To validate the fix, A/B tests were run:
- Firstly with the Kconfig option set to `y` vs `not set` to validate
  the regression
- Then with the boot arg set, to validate that the regression
  disappears

Signed-off-by: James Curtis <jxcurtis@amazon.co.uk>
Before each test run, we copy artifacts from the build/artifacts/ path
to /srv/test_artifacts. This directory was not cleared up though, which
led to issues with artifact A/B testing, where A's artifacts persisted
and were selected by pytest over B's artifacts.

To prevent this, clear the test artifacts dir at the beginning of each
run.

Signed-off-by: James Curtis <jxcurtis@amazon.co.uk>
@JamesC1305 JamesC1305 added the Status: Awaiting review Indicates that a pull request is ready to be reviewed label May 14, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.89%. Comparing base (d4b02ce) to head (bc4f05b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5887   +/-   ##
=======================================
  Coverage   82.89%   82.89%           
=======================================
  Files         277      277           
  Lines       30051    30051           
=======================================
  Hits        24912    24912           
  Misses       5139     5139           
Flag Coverage Δ
5.10-m5n.metal 83.20% <ø> (+<0.01%) ⬆️
5.10-m6a.metal 82.54% <ø> (+<0.01%) ⬆️
5.10-m6g.metal 79.83% <ø> (ø)
5.10-m6i.metal 83.19% <ø> (-0.01%) ⬇️
5.10-m7a.metal-48xl 82.53% <ø> (ø)
5.10-m7g.metal 79.83% <ø> (ø)
5.10-m7i.metal-24xl 83.17% <ø> (-0.01%) ⬇️
5.10-m7i.metal-48xl 83.17% <ø> (ø)
5.10-m8g.metal-24xl 79.83% <ø> (ø)
5.10-m8g.metal-48xl 79.83% <ø> (-0.01%) ⬇️
5.10-m8i.metal-48xl 83.17% <ø> (ø)
5.10-m8i.metal-96xl 83.17% <ø> (-0.01%) ⬇️
6.1-m5n.metal 83.22% <ø> (ø)
6.1-m6a.metal 82.57% <ø> (+<0.01%) ⬆️
6.1-m6g.metal 79.83% <ø> (-0.01%) ⬇️
6.1-m6i.metal 83.22% <ø> (ø)
6.1-m7a.metal-48xl 82.55% <ø> (ø)
6.1-m7g.metal 79.83% <ø> (+<0.01%) ⬆️
6.1-m7i.metal-24xl 83.24% <ø> (ø)
6.1-m7i.metal-48xl 83.23% <ø> (-0.01%) ⬇️
6.1-m8g.metal-24xl 79.83% <ø> (-0.01%) ⬇️
6.1-m8g.metal-48xl 79.83% <ø> (ø)
6.1-m8i.metal-48xl 83.24% <ø> (+<0.01%) ⬆️
6.1-m8i.metal-96xl 83.24% <ø> (+<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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread tools/sandbox.py
from framework.microvm import MicroVMFactory

kernels = list(kernels("vmlinux-*"))
rootfs = list(disks("ubuntu*ext4"))
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.

maybe we can just keep *.ext4 so we can put whatever we want in there?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Can do, I thought it would be better to be explicit, to prevent other rootfs' from being used, but I don't feel strongly about that

Copy link
Copy Markdown
Contributor

@Manciukic Manciukic May 14, 2026

Choose a reason for hiding this comment

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

sandbox is for development, I think it's nice if it picks up whatever is in the artifacts folder. But maybe as you say, it may lead to unexpected behaviours. Maybe we should tweak the default logic to be predictable, or just leave it as you made it here, that's fine as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Wdym by tweaking default logic to be predictable? Are you suggesting being more permissive but ensuring we default to AL2023/Ubuntu? That sounds reasonable to me.

The other thing that bugs me with the sandbox is that it takes devctr paths rather than host paths, so you have to prepend /firecracker to all the paths. Personally I think host paths make more sense, since we're launching from host rather than devctr. I don't know how you feel abt that, if you think it's something worth changing

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.

yes, that's what I meant. I agree also on paths! Any improvement to the tool is welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Awaiting review Indicates that a pull request is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants