Commit Graph

447 Commits

Author SHA1 Message Date
Saravanan D
2ddbc5abbb scripts: use arch OVMF downloads and bump fw tag
Rename download_ovmf to download_amd64_ovmf and add a separate
download_aarch64_ovmf for CLOUDHV_EFI.fd

Replace build_edk2 with download_aarch64_ovmf in aarch64 scripts

Update OVMF firmware tag to ch-1e1b96f126

Update CLOUDHV.fd sha1sum in sha1sums-x86_64

Add CLOUDHV_EFI.fd sha1sum in sha1sums-aarch64-common

Fixes: #7622

Signed-off-by: Saravanan D <saravanand@crusoe.ai>
2026-04-12 10:10:09 +00:00
Bo Chen
9d47769bc2 tests: Add iommufd integration tests
Add an `iommufd` flag to existing VFIO integration tests. When false,
tests use the legacy vfio container/group backend (existing behavior).
When true, tests use vfio cdev with iommufd and vfio_p2p_dma=off.

vfio_p2p_dma=off is required because the VFIO test runner uses a stock
Ubuntu 24.04 kernel (v6.8) which does not support mapping device MMIO
pages (VM_PFNMAP) through iommufd, causing IOMMU_IOAS_MAP to fail with
-EFAULT on MMIO BAR regions.

Signed-off-by: Bo Chen <bchen@crusoe.ai>
2026-04-10 22:55:38 +00:00
Thomas Prescher
84c5e48bdb scripts: use latest ovmf version for x86_64
This commit bumps ovmf to ch-13b4963ec4 [1].

[1] https://github.com/cloud-hypervisor/edk2/releases/tag/ch-13b4963ec4

On-behalf-of: SAP thomas.prescher@sap.com
Signed-off-by: Thomas Prescher <thomas.prescher@cyberus-technology.de>
2026-04-09 17:23:02 +00:00
Anirudh Rayabharam
fa949678d1 scripts: build mshv feature too for dbus, fw_cfg & ivshmem tests
The aarch64 dbus, fw_cfg & ivshmem tests don't build the mshv feature
causing them to fail when run on MSHV. Fix by building the mshv feature
too just like the x86 version of the script does.

Signed-off-by: Anirudh Rayabharam <anrayabh@microsoft.com>
2026-04-07 19:12:48 +00:00
Muminul Islam
5bb4ea20a5 scripts: Fix volume argument splitting in dev_cli.sh
Use IFS-based splitting instead of parameter expansion to
correctly separate '#'-delimited volume paths in
process_volumes_args(). The previous approach placed all
volumes into a single array element, causing Docker to
receive malformed --volume arguments.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2026-03-27 03:39:10 +00:00
Rob Bradford
a8d962640f build: Use newer virtiofsd
Switch to a git hash of virtiofsd as unfortunately the last release is
some time ago and does not incorporate a dependency bump that enables it
to work with snapshot-restore.

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-03-25 15:19:56 +00:00
Julian Schindel
27a40ed32b ci: remove net_gen from allowed titles
On-behalf-of: SAP julian.schindel@sap.com
Signed-off-by: Julian Schindel <julian.schindel@cyberus-technology.de>
2026-03-23 12:50:38 +00:00
Anatol Belski
07479536ab scripts: Wire --test-exclude through test harness
Add --test-exclude to process_common_args in test-util.sh and forward
it to the performance-metrics binary from run_metrics.sh.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-03-18 09:43:06 +00:00
Souradeep
f1875668e0 scripts: Rename sha1sums-aarch64 to sha1sums-aarch64-common
Rename the aarch64 sha1sums file to sha1sums-aarch64-common to follow
the same naming convention as sha1sums-x86_64-common. This allows
run_metrics.sh to use the generic sha1sums-${TEST_ARCH}-common
pattern for all architectures, removing the need for aarch64-specific
conditionals.

Update run_integration_tests_aarch64.sh to reference the renamed file.

Signed-off-by: Souradeep <schakrabarti@microsoft.com>
2026-03-16 12:35:37 +00:00
Muminul Islam
c53bc3d170 scripts: refactor prepare_vdpa for distro-specific setup
Split the vDPA preparation flow into helper functions for
building modules, validating availability, loading modules,
and creating devices.

Build the vdpa_sim modules only on Ubuntu, where the script
installs dependencies and compiles them from the matching
kernel source. On other distributions, reuse the installed
kernel modules and verify that they are available before
continuing.

This makes the script easier to follow and supports systems
such as Azure Linux, where the modules are provided by the
kernel package.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2026-03-14 09:46:38 +00:00
Muminul Islam
4ba2d770d1 scripts: update CVM test script to add thread
- Modified the integration test script to support CVM test threads
- Add more parameters to cargo nextest to match other files

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2026-03-13 08:58:15 +00:00
Anatol Belski
600e74f0af scripts: dev_cli.sh: Allow passing commands to shell subcommand
Accept arguments after -- in 'dev_cli.sh shell' and forward them
to 'bash -c' inside the container. When no arguments are given,
an interactive shell is started as before. This enables running
one-off commands in the CI container without an interactive session,
for example:

  ./scripts/dev_cli.sh shell -- rustup toolchain install nightly \&\& cargo +nightly fmt --all -- --check

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-23 16:07:23 +00:00
Anatol Belski
20f5cadb6f scripts: Fix run_metrics.sh to use sha1sums common file
The focal image checksums have been moved in the -common
sha1sums file. Use the correct file for metrics.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-15 12:31:32 +00:00
Muminul Islam
97c5d837ab scripts: allow cloud-init script to accept a custom output file
When running manual tests locally, it is sometimes necessary to
generate a cloud-init file at a custom path instead of defaulting
to /tmp. This is useful for developers and higher-level management
layers where files in /tmp may be cleaned up automatically.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2026-02-10 21:50:29 +00:00
Muminul Islam
258f826027 tests: Add initial support of CVM test on MSHV
This patch adds the skeleton of the CVM test
support and modify existing scripts and test framework
to enable such scenario. Split the sha1sum to support both
regular and CVM guest. Add one test case for CVM. Will further
add more test cases.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2026-02-06 06:37:26 +00:00
Muminul Islam
f391a37a35 scripts: add common image download code to utility script
X64_64 image download steps is being used for both
regular and CVM guest. Keeping the steps withing a function
in the test-util.sh

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2026-02-06 06:37:26 +00:00
Demi Marie Obenour
093a8497d0 scripts: Upgrade virtiofsd to 1.13.3
Testing generic vhost-user devices will require virtiofsd to support the
--tag option, which v1.8.0 does not support.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2026-02-04 17:29:48 +00:00
Saravanan D
d58e421eea scripts: fix build_edk2 built marker creation
build_edk2 was leaving behind .built markers
even when compilation failed.

Gate creation of.built marker to occur only on
successful build

Modify build_edk2() to exit with error code
when arm64 firmware artifact : CLOUDHV_EFI.fd
is not produced

Fixes #7608

Signed-off-by: Saravanan D <saravanand@crusoe.ai>
2026-01-22 01:45:43 +00:00
Saravanan D
298da55902 scripts: fix build_edk2 compilation
build_edk2() module in scripts/common-aarch64.sh
does not produce the UEFI firmware for aarch64 as
the commits used to assemble sources for acpica,
edk2-platforms and edk2 do not compile after GCC
version upgraded from 11.4.0 to 13.3.0 in the
developer container (ubuntu 22.04 to 24.04)

Apply minimum upgrade to EDK2_REPO and ACPICA_REPO
required to compile with GCC 13.3.0
while still assuring guest VM boot for all
integration tests

BaseTools: Brotli compression submodule that was
previously failing has been fixed following commit
bump

Developers can now produce UEFI firmware for
aarch64 using the following commands
```
./scripts/dev_cli.sh shell
source scripts/test-util.sh
source scripts/common-aarch64.sh
build_edk2
```

Update docs/uefi.md

Fixes #7608

Signed-off-by: Saravanan D <saravanand@crusoe.ai>
2026-01-22 01:45:43 +00:00
Anatol Belski
cb495959a8 tests: qcow: Add testing for backing file in raw format
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-01-15 16:19:15 +00:00
Yi Wang
34ee973ee0 scripts: fix warning in test util
CI reports:
In scripts/test-util.sh line 216:
    cleanup() {
    ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly).

The shellcheck can't trace calling in trap, so we need add hint
to make it happy.

Signed-off-by: Yi Wang <foxywang@tencent.com>
2026-01-14 09:04:07 +00:00
Anatol Belski
e6dd429a64 tests: qcow: Add testing for uncompressed backing file
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2025-12-05 15:38:55 +00:00
Anatol Belski
248e786363 tests: qcow: Adjust namings for zstd compresed backing file
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2025-12-05 15:38:55 +00:00
Sebastien Boeuf
801059c2d5 scripts: Update custom image to Ubuntu Noble Numbat
Updating the helper script to create a VFIO custom image from Ubuntu
22.04 to Ubuntu 24.04.

Signed-off-by: Sebastien Boeuf <seb@rivosinc.com>
2025-12-04 15:25:13 +00:00
Wei Liu
a1a018bd83 tests: Do not return a failure when no tests are run
It is a common use case to run a subset of tests locally to verify
certain functionalities.

The default behaviour for nextest is to error out if no tests are run.
That causes the test scripts to return a non-zero value (failure). Pass
`--no-tests=pass` to nextest to match what `cargo test` does if no tests
are run.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
2025-11-25 15:59:39 +00:00
Eugene Korenevsky
e6d31a3d81 block: qcow: switch qcow2 tests from focal to jammy qcow2 images
Signed-off-by: Eugene Korenevsky <ekorenevsky@aliyun.com>
2025-11-24 08:52:13 +00:00
Eugene Korenevsky
94ed7c1745 block: qcow: add integration tests for qcow2 compression
Add tests:
- zlib: test_virtio_block_qcow2_zlib()
- zstd: test_virtio_block_qcow2_zstd()
Both these tests use zlib- and zstd-compressed images as OS image.

Modify test_virtio_block_qcow2_backing_file() test: it is practical
to test qcow2 file-backing with compression, so use zlib-compressed
image as a backing file.

Signed-off-by: Eugene Korenevsky <ekorenevsky@aliyun.com>
2025-11-24 08:52:13 +00:00
Philipp Schuster
c990f1bdaa tests: enable cargo test --workspace + #[cfg(devcli_testenv)]
TL;DR: Massive quality of life improvement for devs

Cloud Hypervisor uses the Cargo test framework for multiple tests:

- normal unit tests
- unit tests requiring special environment (the Tap device tests)
- integration tests requiring a special environment

This prevented the execution of `cargo test --workspace`, which results
in a very poor developer experience. Although
`./scripts/run_unit_tests.sh` exists, there are valid reasons why devs
cannot or even don't want to use it.

By adding a new `chv_testenv` rustc config, we can conditionally only
activate tests when the `./scripts/` magic runs them. This improves
the general developer experience by a lot.

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com
2025-11-20 21:15:03 +00:00
Bo Chen
e3e9e1c84c tests: Add retries for artifact downloads
This change makes integration tests more resilient to transient download
failures. This will reduce churn in our CI workflow, specifically for
the Merge Queue.

Examples:
https://github.com/cloud-hypervisor/cloud-hypervisor/actions/runs/19545345066/job/55962570896
https://github.com/cloud-hypervisor/cloud-hypervisor/actions/runs/19545345122/job/55962570736
https://github.com/cloud-hypervisor/cloud-hypervisor/actions/runs/19545345034/job/55962570724

Signed-off-by: Bo Chen <bchen@crusoe.ai>
2025-11-20 19:34:57 +00:00
Rob Bradford
6147c4c8b7 tests: Disable nextest failure on fw_cfg tests on MSHV
Due to the fw_cfg test being disabled on MSHV this results in no tests
being runnable which results in an error in nextest. Reduce that error
to a warning use --no-tests=warn

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2025-11-17 10:22:34 +00:00
Rob Bradford
3734a13cbf tests: Use cargo nextest for integration tests
This alternative test runner supports retries and also reports how long
each test takes to run.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2025-11-17 10:22:34 +00:00
Rob Bradford
5051feb0bd build: Bump MSRV to 1.89.0
This is required to support exclusive locking on files which is needed
for safe test ID generation when using nextest (since it runs each test
as a separate process.)

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2025-11-17 10:22:34 +00:00
Philipp Schuster
02da2f2d36 misc: gitlint: python code improvements
Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com
2025-11-13 19:16:45 +00:00
Philipp Schuster
62345cd6fd misc: gitlint: allow more prefixes disabling 72 width limit
Suggested-by Alyssa Ross [0].

[0]: https://github.com/cloud-hypervisor/cloud-hypervisor/pull/7471#discussion_r2519894440

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com
2025-11-13 19:16:45 +00:00
Philipp Schuster
f826d92601 misc: gitlint: allow well-known commit tags to exceed line limit
To get that list, I've used

```
git log | grep --fixed-strings -- "-by:" | head -n 100000 | sort | less
```

on the Linux kernel's git repository.

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com
2025-11-13 19:16:45 +00:00
Rob Bradford
8bf284e713 scripts: Bump Linux version to 6.16.9
Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2025-11-13 14:29:26 +00:00
Aastha Rawat
c4cce38631 scripts: aarch64: replace guestmount for image modification
Replace the use of `guestmount and `guestunmount` with standard tools
(losetup, mount) to modify cloud disk image. This eliminates
dependency on guestmount which requires /dev/kvm and is not available
in MSHV root partition.

Signed-off-by: Aastha Rawat <aastharawat@microsoft.com>
2025-11-06 19:33:53 +00:00
Aastha Rawat
e302d50b09 scripts: aarch64: enable MSHV support
Refactor MSHV hypervisor selection logic to enable aarch64 support
instead of exiting. Use `--features mshv` to conditionally build &
test when hypervisor is mshv replacing hard exit for aarch64 on mshv.

Signed-off-by: Aastha Rawat <aastharawat@microsoft.com>
2025-11-06 19:33:53 +00:00
Muminul Islam
e3fa27e251 scripts: Fix issue when extra docker volumes provided
With the current syntax docker gives 'docker: invalid reference format'
error. Also during parsing /xxx:/yyy in process_volumes_args
with \" inside variable i.e arr_vols=("${arg_vols//#/ }")
gives wrong output.

Example:
scripts/dev_cli.sh tests --integration --volumes /mshv:/mshv
Error: The volume /mshv /mshv does not exist.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2025-11-05 10:45:24 +00:00
Anirudh Rayabharam
f74cde7882 scripts: build mshv feature for ivshmem testing
The ivshmem tests are all failing in the CI for MSHV because Cloud
Hypervisor is built without the mshv feature.

Error: Cloud Hypervisor exited with the following chain of errors:
  0: Failed to open hypervisor interface (is hypervisor interface
       available?)
  1: Failed to create the hypervisor
  2: no supported hypervisor

Modify the build command to include the mshv feature.

Signed-off-by: Anirudh Rayabharam <anrayabh@microsoft.com>
2025-10-28 15:31:58 +00:00
Anirudh Rayabharam
861b7ab64d tests: exclude test_fw_cfg for mshv
test_fw_cfg is frequently failing in the CI for MSHV. Exclude it for
now. It needs further investigation. See issue #7434 for details.

Signed-off-by: Anirudh Rayabharam <anrayabh@microsoft.com>
2025-10-25 10:16:24 +00:00
Bo Chen
205e62aaa8 scripts: Download jammy images for rate-limiter tests
We recently moved many of our tests to use focal to jammy as the guest
images, including rate-limiter tests (#7367). We forgot to update the
rate-limiter scripts to reflect such change.

Our CI pipeline failed to report such error because our self-host runner
happened to be not working at the time we land the changes (see #7405).

Signed-off-by: Bo Chen <bchen@crusoe.ai>
2025-10-09 22:49:12 +00:00
Rob Bradford
d760301c8d tests: Reduce parallelism on x86-64 testing
Only use 75% of the available threads - this will reduce dislk and
memory pressure. Reducing the chance of flaky tests.

See: #7405

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2025-10-09 11:02:49 +00:00
Wei Liu
78a16227d2 scripts: Exit create-cloud-init.sh on error
Signed-off-by: Wei Liu <liuwe@microsoft.com>
2025-09-22 14:24:50 +00:00
Shubham Chakrawar
2d9e243163 misc: Remove SGX support from Cloud Hypervisor
This commit removes the SGX support from cloud hypervisor. SGX support
was deprecated in May as part of #7090.

Signed-off-by: Shubham Chakrawar <schakrawar@crusoe.ai>
2025-09-05 18:08:36 +00:00
Muminul Islam
1ca6c159ef tests: option to override default migratable version
This patch gives user an option to override the
default migratable version to any later release.
This option makes MSHV specific tests suitable for
tests since MSHV is stable after some breaking changes.
This patch is also necessary for MSHV CI.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2025-09-03 18:51:24 +00:00
Philipp Schuster
92f415ea3f build: Bump MSRV to 1.88
This is necessary to use the let-chains feature in a
follow-up. After upgrading to Rust edition 2024, clippy
wants to collapse various if's with let-chains.

Update image to 20250815-0 since MSRV in Dockerfile is updated.

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com
2025-08-15 10:55:48 +00:00
Songqian Li
4c1ee0329e tests: add ivshmem integration test case
Signed-off-by: Songqian Li <sionli@tencent.com>
2025-08-14 22:14:34 +00:00
Alex Orozco
5d478c534e tests: Add fw_cfg device integration test
This test verifies that we can see custom items added to the fw_cfg
device from inside the guest

Signed-off-by: Alex Orozco <alexorozco@google.com>
2025-08-11 17:29:51 +00:00
Songqian Li
530719a57a build: Bump MSRV to 1.87.0
rustc 1.90.0-beta.1 (788da80fc 2025-08-04) suggests using library
feature `unsigned_is_multiple_of`. It is stabled in Rust 1.87.0.

Update image to 20250807-0 since MSRV in Dockerfile is updated.

Signed-off-by: Songqian Li <sionli@tencent.com>
Signed-off-by: Bo Chen <bchen@crusoe.ai>
2025-08-07 16:53:59 +00:00