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

test: add a fixture for Qemu vhost-user-blk backend #4156

Closed
wants to merge 3 commits into from

Conversation

kalyazin
Copy link
Contributor

@kalyazin kalyazin commented Oct 9, 2023

Changes

This adds a fixture for Qemu's vhost-user-blk backend. The fixture fetches a Qemu release (currently v8.1.1) and builds the backend binary.
The build requires additional dependencies in the devctr image (increases by ~30K).

The backend can be used as:

./vhost-user-blk -s socket.sock -b image.ext4

Reason

Needed for integration tests for vhsot-user-blk device.

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.

@codecov
Copy link

codecov bot commented Oct 9, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (c723745) 82.99% compared to head (5f77b15) 82.99%.
Report is 10 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4156   +/-   ##
=======================================
  Coverage   82.99%   82.99%           
=======================================
  Files         223      223           
  Lines       28448    28448           
=======================================
  Hits        23609    23609           
  Misses       4839     4839           
Flag Coverage Δ
4.14-c7g.metal 78.53% <ø> (+<0.01%) ⬆️
4.14-m5d.metal 80.34% <ø> (+0.02%) ⬆️
4.14-m6a.metal 79.46% <ø> (ø)
4.14-m6g.metal 78.53% <ø> (ø)
4.14-m6i.metal 80.31% <ø> (ø)
5.10-c7g.metal 81.44% <ø> (ø)
5.10-m5d.metal 83.00% <ø> (ø)
5.10-m6a.metal 82.23% <ø> (ø)
5.10-m6g.metal 81.44% <ø> (ø)
5.10-m6i.metal 82.99% <ø> (ø)
6.1-c7g.metal 81.44% <ø> (ø)
6.1-m5d.metal 83.00% <ø> (ø)
6.1-m6a.metal 82.23% <ø> (ø)
6.1-m6g.metal 81.44% <ø> (ø)
6.1-m6i.metal 82.99% <ø> (ø)

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.

The following is added:
 - gpg, gpg-agent
 - bison, flex
 - libglib2.0-dev
 - libpixman-1-dev
 - ninja-build
 - meson

This increases the images size by ~30K.

Signed-off-by: Nikita Kalyazin <[email protected]>
The new warnings are likely caused by the devctr update.

Signed-off-by: Nikita Kalyazin <[email protected]>
The fixture fetches a Qemu release,
verifies its signature, configures and builds
the vhost-user-blk backend.

The fixture is supposed to be used for testing
vhost-user-blk device.

Command line options:
  -s, --socket-path=PATH       Use UNIX socket path
  -b, --blk-file=PATH          block device or file path
  -r, --read-only              Enable read-only

Signed-off-by: Nikita Kalyazin <[email protected]>
@kalyazin kalyazin marked this pull request as ready for review October 9, 2023 12:21
@kalyazin kalyazin added the Status: Awaiting review Indicates that a pull request is ready to be reviewed label Oct 9, 2023
@@ -58,6 +59,11 @@


METRICS = get_metrics_logger()
QEMU_PUB_KEY_URL = "https://keys.openpgp.org/vks/v1/by-fingerprint/CEACC9E15534EBABB82D3FA03353C9CEF108B584"
Copy link
Contributor

Choose a reason for hiding this comment

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

The Ubuntu packages don't have the vhost-user-blk binary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that was my first guess too, but I wasn't able to find it.

@roypat
Copy link
Contributor

roypat commented Oct 9, 2023

Why can't we just add a pre-compiled qemu vhost backend to the devctr instead of downloading/compiling it on the fly?

@kalyazin
Copy link
Contributor Author

kalyazin commented Oct 9, 2023

Why can't we just add a pre-compiled qemu vhost backend to the devctr instead of downloading/compiling it on the fly?

I was also thinking about it. I think it depends on the upgrade pace. If we need to update it often, having it as a constant in the test is easier (doesn't involve building an image). We don't know this in advance, unfortunately, so I'm open to change if we have enough data.

@kalyazin
Copy link
Contributor Author

Decided to move the backend build to devctr build time. Implemented in #4167 .

@kalyazin kalyazin closed this Oct 11, 2023
@kalyazin kalyazin deleted the backend branch October 11, 2023 12:05
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