Skip to content

ci: enable integration tests for hypervisor#56

Merged
lisongqian merged 20 commits intoTencentCloud:masterfrom
lisongqian:vmm-ci
Apr 24, 2026
Merged

ci: enable integration tests for hypervisor#56
lisongqian merged 20 commits intoTencentCloud:masterfrom
lisongqian:vmm-ci

Conversation

@lisongqian
Copy link
Copy Markdown
Collaborator

No description provided.

Signed-off-by: Songqian Li <sionli@tencent.com>
@lisongqian lisongqian force-pushed the vmm-ci branch 3 times, most recently from 3316f8f to 1a37568 Compare April 24, 2026 08:33
…dency management

- Upgrade vhost-user-backend from 0.13.1 to 0.16.1 and remove legacy vhost 0.10.0
- Migrate vhost_user_block and vhost_user_net dependencies to workspace references
- Add vmm-sys-util to workspace Cargo.toml
- Adapt vhost_user_net to new API: add rx_rate_limited, tx_rate_limited, id fields
- Move get_vm_snapshot import to top-level in vm.rs and fix import ordering
- Update unit test config for dirty_log and CompatibleMode::Vendor

Signed-off-by: Songqian Li <sionli@tencent.com>
upstream commit: 8d8791c95d079363ebeeceb57ea5c7fa85d1511f

This is to resolve the following unit test failures:

---- tap::tests::test_read stdout ----
thread 'tap::tests::test_read' panicked at 'datalink channel error or unhandled channel type', net_util/src/tap.rs:742:13
stack backtrace:
   0: rust_begin_unwind
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:578:5
   1: core::panicking::panic_fmt
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/panicking.rs:67:14
   2: net_util::tap::tests::pnet_get_mac_tx_rx
             at ./src/tap.rs:742:13
   3: net_util::tap::tests::pnet_send_packet
             at ./src/tap.rs:718:32
   4: net_util::tap::tests::test_read
             at ./src/tap.rs:818:9
   5: net_util::tap::tests::test_read::{{closure}}
             at ./src/tap.rs:809:20
   6: core::ops::function::FnOnce::call_once
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ops/function.rs:250:5
   7: core::ops::function::FnOnce::call_once
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ops/function.rs:250:5

Test with: `cargo test -p net_util --lib tap::tests::test_read`.

Signed-off-by: Bo Chen <chen.bo@intel.com>
Signed-off-by: Songqian Li <sionli@tencent.com>
Unify the config validate order of vhost-user to resolve
the following unit test failures:

---- config::tests::test_config_validation stdout ----
thread 'config::tests::test_config_validation' panicked at 'assertion failed: `(left == right)`
  left: `Err(VhostUserMissingSocket)`,
right: `Err(VhostUserRequiresSharedMemory)`', vmm/src/config.rs:3477:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:578:5
   1: core::panicking::panic_fmt
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/panicking.rs:67:14
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/panicking.rs:228:5
   4: vmm::config::tests::test_config_validation
             at ./src/config.rs:3477:9
   5: vmm::config::tests::test_config_validation::{{closure}}
             at ./src/config.rs:3295:33
   6: core::ops::function::FnOnce::call_once
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ops/function.rs:250:5
   7: core::ops::function::FnOnce::call_once
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ops/function.rs:250:5

Test with: `cargo test -p vmm --features kvm --lib config::tests::test_config_validation`.

Signed-off-by: Songqian Li <sionli@tencent.com>
upstream commit: f346687e3d0426b45645a63f215fe9d0c4e79202

This fixes the valid VM config unit tests, which would otherwise fail
to deserialize their expected JSON config due to the missing "gdb" field.

The following unit test failures:

running 16 tests
test unit_tests::test_valid_vm_config_cpus ... FAILED
test unit_tests::test_valid_vm_config_devices ... FAILED
test unit_tests::test_valid_vm_config_memory ... FAILED
test unit_tests::test_valid_vm_config_fs ... FAILED
test unit_tests::test_valid_vm_config_kernel ... FAILED
test unit_tests::test_valid_vm_config_default ... FAILED
test unit_tests::test_valid_vm_config_cmdline ... FAILED
test unit_tests::test_valid_vm_config_pmem ... FAILED
test unit_tests::test_valid_vm_config_rng ... FAILED
test unit_tests::test_valid_vm_config_serial_pty_console_pty ... FAILED
test unit_tests::test_valid_vm_config_net ... FAILED
test unit_tests::test_valid_vm_config_serial_console ... FAILED
test unit_tests::test_valid_vm_config_disks ... FAILED
test unit_tests::test_valid_vm_config_tpm_socket ... FAILED
test unit_tests::test_valid_vm_config_vdpa ... FAILED
test unit_tests::test_valid_vm_config_vsock ... FAILED

failures:

---- unit_tests::test_valid_vm_config_cpus stdout ----
thread 'unit_tests::test_valid_vm_config_cpus' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `gdb`", line: 4, column: 17)', src/main.rs:960:73

---- unit_tests::test_valid_vm_config_devices stdout ----
thread 'unit_tests::test_valid_vm_config_devices' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `gdb`", line: 7, column: 17)', src/main.rs:960:73

---- unit_tests::test_valid_vm_config_memory stdout ----
thread 'unit_tests::test_valid_vm_config_memory' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `gdb`", line: 4, column: 17)', src/main.rs:960:73

---- unit_tests::test_valid_vm_config_fs stdout ----
thread 'unit_tests::test_valid_vm_config_fs' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `gdb`", line: 8, column: 17)', src/main.rs:960:73

---- unit_tests::test_valid_vm_config_kernel stdout ----
thread 'unit_tests::test_valid_vm_config_kernel' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `gdb`", line: 3, column: 13)', src/main.rs:960:73

---- unit_tests::test_valid_vm_config_default stdout ----
thread 'unit_tests::test_valid_vm_config_default' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `gdb`", line: 1, column: 44)', src/main.rs:960:73
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- unit_tests::test_valid_vm_config_cmdline stdout ----
thread 'unit_tests::test_valid_vm_config_cmdline' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `gdb`", line: 3, column: 13)', src/main.rs:960:73

---- unit_tests::test_valid_vm_config_pmem stdout ----
thread 'unit_tests::test_valid_vm_config_pmem' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `gdb`", line: 7, column: 17)', src/main.rs:960:73

---- unit_tests::test_valid_vm_config_rng stdout ----
thread 'unit_tests::test_valid_vm_config_rng' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `gdb`", line: 4, column: 13)', src/main.rs:960:73

---- unit_tests::test_valid_vm_config_serial_pty_console_pty stdout ----
thread 'unit_tests::test_valid_vm_config_serial_pty_console_pty' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `gdb`", line: 5, column: 17)', src/main.rs:960:73

---- unit_tests::test_valid_vm_config_net stdout ----
thread 'unit_tests::test_valid_vm_config_net' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `gdb`", line: 4, column: 17)', src/main.rs:960:73

---- unit_tests::test_valid_vm_config_serial_console stdout ----
thread 'unit_tests::test_valid_vm_config_serial_console' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `gdb`", line: 5, column: 17)', src/main.rs:960:73

---- unit_tests::test_valid_vm_config_disks stdout ----
thread 'unit_tests::test_valid_vm_config_disks' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `gdb`", line: 7, column: 17)', src/main.rs:960:73

---- unit_tests::test_valid_vm_config_tpm_socket stdout ----
thread 'unit_tests::test_valid_vm_config_tpm_socket' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `gdb`", line: 4, column: 17)', src/main.rs:960:73

---- unit_tests::test_valid_vm_config_vdpa stdout ----
thread 'unit_tests::test_valid_vm_config_vdpa' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `gdb`", line: 7, column: 17)', src/main.rs:960:73

---- unit_tests::test_valid_vm_config_vsock stdout ----
thread 'unit_tests::test_valid_vm_config_vsock' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `gdb`", line: 4, column: 17)', src/main.rs:960:73

failures:
    unit_tests::test_valid_vm_config_cmdline
    unit_tests::test_valid_vm_config_cpus
    unit_tests::test_valid_vm_config_default
    unit_tests::test_valid_vm_config_devices
    unit_tests::test_valid_vm_config_disks
    unit_tests::test_valid_vm_config_fs
    unit_tests::test_valid_vm_config_kernel
    unit_tests::test_valid_vm_config_memory
    unit_tests::test_valid_vm_config_net
    unit_tests::test_valid_vm_config_pmem
    unit_tests::test_valid_vm_config_rng
    unit_tests::test_valid_vm_config_serial_console
    unit_tests::test_valid_vm_config_serial_pty_console_pty
    unit_tests::test_valid_vm_config_tpm_socket
    unit_tests::test_valid_vm_config_vdpa
    unit_tests::test_valid_vm_config_vsock

test result: FAILED. 0 passed; 16 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s

Signed-off-by: Alyssa Ross <hi@alyssa.is>
Signed-off-by: Songqian Li <sionli@tencent.com>
Upstream commit 544de7d0000f5c4952706c3955d2912e267fcf0b

Killing CLH by SIGKILL will cause inaccurate code coverage
information. This patch changes the signal to SIGTERM.

Fixes: #6507

Signed-off-by: Songqian Li <sionli@tencent.com>
…tHub Releases

Replace cloud-hypervisor.azureedge.net download sources with
GitHub Releases (lisongqian/CubeSandbox/releases/download/ci) for
bionic, focal, and jammy OS images. Since the GitHub release assets
are stored as .zip files, add a rename step after download to strip
the .zip suffix and maintain the expected filename.

Signed-off-by: Songqian Li <sionli@tencent.com>
…test

- Extract snapshot_and_check_events() helper to deduplicate snapshot
  pause/snapshot/event-check logic from inline test code
- Add _test_restore_from_config() to verify VM restore with custom
  RestoreConfig including vsock, net, disk, pmem, and fs devices
- Add _test_snapshot_restore_from_different_binary() to support
  snapshot/restore across different hypervisor binary versions
- Refactor existing snapshot test to use the new shared helper

Signed-off-by: Songqian Li <sionli@tencent.com>
Add permission control to integration tests.

Signed-off-by: Songqian Li <sionli@tencent.com>
Signed-off-by: Songqian Li <sionli@tencent.com>
upstream commit: 57fdaa3a39fc9536ffd2665c470c33476dbdd931

Program the APIC ID (CPUID leaf 0x1 EBX) with the CPU id. This resolves
an issue where the EDKII firmware expects the APIC ID to vary per-CPU.

Fixes: #5475

Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
Signed-off-by: Songqian Li <sionli@tencent.com>
This patch adds four test cases to test the native
virtio-fs: test_native_virtio_fs,
test_native_virtio_fs_hotplug,
test_native_virtio_fs_multi_segment,
test_native_virtio_fs_multi_segment_hotplug.

Signed-off-by: Songqian Li <sionli@tencent.com>
Signed-off-by: Yi Wang <foxywang@tencent.com>
Upstream commit 544de7d0000f5c4952706c3955d2912e267fcf0b

Killing CLH by SIGKILL will cause inaccurate code coverage
information. This patch changes the signal to SIGTERM.

Fixes: #6507

Signed-off-by: Songqian Li <sionli@tencent.com>
Delete the latest event check and remove the
resume command since the VM is automatically
restarted after restored.

Signed-off-by: Songqian Li <sionli@tencent.com>
upstream commit: 98dcb0309d362dd83f6ffcac4f66914a2fbd5a73

With new toolchains this will panic:

thread 'vmm' panicked at 'misaligned pointer dereference: address must
be a multiple of 0x8 but is 0x7f314401ca6c',
/home/rob/src/rust-vmm/acpi_tables/src/sdt.rs:113:13

As the pointer is not correctly aligned for the data.

NOTE: cargo build will fail after this patch, 'cause acpi_tables
has been derived in the new version of upstream, the according
patches of cloud-hyperviosr will come in the next patches.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
Signed-off-by: Yi Wang <foxywang@tencent.com>
Signed-off-by: Songqian Li <sionli@tencent.com>
upstream commit: 71d1296d09dfd46ee668c30aa0590961dc86a362

For structures that are used in SDT ACPI tables it is necessary for them
to implement this trait for the newly safe Std::write() API.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
Signed-off-by: Yi Wang <foxywang@tencent.com>
Signed-off-by: Songqian Li <sionli@tencent.com>
upstream commit: d17d70fae115d95e0912b531603a142941ef4891

In particular the Std::write() API requires that the value implements
AsBytes and copies the slice representation into the table data. This
avoids unaligned writes which can cause a panic with the updated
toolchain.

Note: To make build successfully, also add zerocopy dependency
in vmm, which is introduced in upstream commit 73c415677(vmm,
devices: Update to latest acpi_tables crate API) in this patch.
However, we don't need that whole patch for now, 'cause the acpi_tables
has been seperated from vmm at that time.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
Signed-off-by: Yi Wang <foxywang@tencent.com>
Signed-off-by: Songqian Li <sionli@tencent.com>
Fix test failures in vmm_instance integration tests caused by repeated
JSON log configuration initialization.

The error message is as follows:

failures:
 vmm_instance::test_api_delete
 vmm_instance::test_api_pause_resume
 vmm_instance::test_api_snapshot_restore
 vmm_instance::test_get_shutdown_notifier

Signed-off-by: Jinrong Liang <cloudliang@tencent.com>
Signed-off-by: Songqian Li <sionli@tencent.com>
Signed-off-by: Songqian Li <sionli@tencent.com>
@lisongqian lisongqian merged commit c2ede75 into TencentCloud:master Apr 24, 2026
1 of 2 checks passed
@lisongqian lisongqian deleted the vmm-ci branch April 24, 2026 13:50
@chenhengqi
Copy link
Copy Markdown
Collaborator

@lisongqian Please don't merge MR without a review.

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