Commit Graph

444 Commits

Author SHA1 Message Date
Sebastien Boeuf
e674577ea9 tests: Fix clippy error on latest cargo beta version
The current patch fixes the following error that was raised by clippy:

error: this let-binding has unit value
    --> tests/integration.rs:6538:13
     |
6538 | /             let _ = stdin
6539 | |                 .write_all("type=7".as_bytes())
6540 | |                 .expect("failed to write stdin");
     | |_________________________________________________^
     |
     = note: `-D clippy::let-unit-value` implied by `-D warnings`
     = help: for further information visit
https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
help: omit the `let` binding
     |
6538 ~             stdin
6539 +                 .write_all("type=7".as_bytes())
6540 +                 .expect("failed to write stdin");
     |

error: could not compile `cloud-hypervisor` due to previous error

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-05-20 09:59:43 +01:00
Bo Chen
32353fa389 event_monitor: Append double newlines after each event
This allows to consume and parse the output event output file.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-05-17 09:55:03 +02:00
Bo Chen
33e2a7121e tests: Extend 'resize_command()' with event-monitor checks
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-05-17 09:55:03 +02:00
Bo Chen
2eb984b45d tests: Extend existing tests with checks on event monitor
In this way, we can cover a broad range of events from the event monitor
while avoiding code duplication.

Fixes: #4054

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-05-17 09:55:03 +02:00
Rob Bradford
4fed2d4ed7 tests: Use different API sockets when restoring
This prevents a conflict since the old API socket will not have been
cleaned up (due to the use of SIGKILL.)

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-04-29 18:40:49 +01:00
Bo Chen
eebf4f10e3 tests: Cover 'virtio-balloon' for live migration and live upgrade
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-04-27 12:27:49 -07:00
Bo Chen
3d1b2eb4e5 tests: Cover 'virtio-watchdog' for live migration and live upgrade
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-04-27 12:27:49 -07:00
Bo Chen
16740b4fcd tests: Refactor 'test_watchdog' for reusing
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-04-27 12:27:49 -07:00
Bo Chen
e97fe7a43e tests: Cover 'virtio-pmem' for live migration and live upgrade
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-04-27 12:27:49 -07:00
Sebastien Boeuf
2f47bea809 tests: Re-enable aarch64_acpi::test_virtio_iommu
Now that virtio-iommu has been fixed, the test can be enabled again.

Fixes #3941

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-04-26 13:07:32 +02:00
Rob Bradford
80de77a6e6 tests: Add integration test for --platform serial_number
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-04-21 17:17:08 +02:00
Bo Chen
82aa0e1222 tests: Disable live upgrade tests
Live upgrade is currently not guaranteed during this development cycle
and we will try to enable these tests after the next release.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-04-20 11:51:50 -07:00
Bo Chen
edca82c4bd scripts, tests: Add live upgrade tests
By augmenting existing set of tests, this patch added a set of
tests for live-upgrade that covers use cases with NUMA,
vhost-user (OVS-DPDK), and local-migration.

Fixes: #3949

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-04-20 11:51:50 -07:00
Bo Chen
7e9c61ab18 tests: Add `test_live_migration_numa_local'
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-04-20 11:51:50 -07:00
Rob Bradford
719c9b8233 tests: Fix aarch64 clippy issues in integration tests
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-04-13 13:54:06 +01:00
Michael Zhao
9dd107bb03 tests: Revert the impact for the hidden 4MiB RAM
We modified a test case to workaround the RAM calculation error caused
by hidding 4MiB memory for UEFI. Now change it back to normal.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2022-04-11 09:51:34 +01:00
Sebastien Boeuf
bf7daa8ade tests: Disable aarch64_acpi::test_virtio_iommu
Now that address translations performed by virtio-iommu can error out if
the address can't be translated, we uncovered an issue in integration
test aarch64_acpi::test_virtio_iommu.

We disable the test until we can investigate and fix the root cause.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-04-06 11:21:46 +02:00
Michael Zhao
261e39d8ab tests: Improve test_live_migration_numa
Set various initial memory node sizes in test case
`test_live_migration_numa`.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2022-04-05 11:04:52 +08:00
Sebastien Boeuf
a2acc02f50 tests: Update test_vdpa_block to include vIOMMU testing
The extra vDPA device in the test is hotplugged behind the vIOMMU, which
covers the use case of placing a vDPA device behind a virtual IOMMU.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-04-05 00:09:52 +02:00
Bo Chen
4af04d8f49 tests: Enable 'test_vfio_user' using Jammy on 'aarch64'
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-03-31 09:22:07 +01:00
Bo Chen
d49363a5af tests: Enable guest console log for test_vfio_user
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-03-31 09:22:07 +01:00
Bo Chen
0e2cb9fd06 tests: Move to use Jammy guest image for test_vfio_user
Fixes: #3495

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-03-31 09:22:07 +01:00
Bo Chen
cec035c6e0 tests: Increase timeout after vfio-user device hotplug
As reported by the periodic CI runs, it may take more time for the NVMe
device to present in the guest after being hotplugged as a VFIO user
device on `aarch64` (especially under high load). Let's increase the
timeout after device hotplug from `1s` to `10s` to increase the test
stability.

Fixes: #3495

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-03-31 09:22:07 +01:00
Bo Chen
3679be3721 tests: Enable hugepages for test_vfio_user
This is will fix a warning reported from the SPDK/NVMe backend when the
memory address is not 2M aligned.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-03-31 09:22:07 +01:00
Rob Bradford
c66be2e974 tests: Split test_simple_launch() into separate tests
This will make it much easier identify which tests are failing.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-29 15:20:58 +01:00
Rob Bradford
7c0cf8cc23 arch, devices, vmm: Remove "acpi" feature gate
Compile this feature in by default as it's well supported on both
aarch64 and x86_64 and we only officially support using it (no non-acpi
binaries are available.)

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-28 09:18:29 -07:00
Sebastien Boeuf
2ef201e43f tests: Simplify test_vdpa_block() to increase stability
It seems the vdpa_sim_block isn't behaving properly after the vhost
device is closed, as it sometimes returns EBUSY when we try to open it
again. The easiest way to deal with this issue is by simplifying the
integration test, avoid to plug the same device after it's been
unplugged.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-03-28 13:09:01 +01:00
Sebastien Boeuf
afd9f17b73 virtio-fs: Deprecate the DAX feature
Disable the DAX feature from the virtio-fs implementation as the feature
is still not stable. The feature is deprecated, meaning the 'dax'
parameter will be removed in about 2 releases cycles.

In the meantime, the parameter value is ignored and forced to be
disabled.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-03-24 10:39:11 -07:00
Sebastien Boeuf
fd40aceabb tests: Fix flakiness in test_vdpa_block()
The test is sporadically failing whenever we try to hotplug the vDPA
device we've just unplugged. This is causing the kernel to complain with
EBUSY because the device hasn't been released yet. This is happening
because the CI system is under very high load, therefore taking quite
some time to the host to update the state of this device.

The easy way to fix such issue is by increasing the sleep time between
the unplug and the replug.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-03-24 15:15:51 +01:00
Rob Bradford
0834eca8d4 vmm: config: Validate IOMMU configuration
Ensure devices that are specified to be on a PCI segment that is behind
the IOMMU are IOMMU enabled if possible or error out for those devices
that do not support it.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-22 11:13:20 +00:00
Sebastien Boeuf
03014e2e7f tests: Add integration tests for vDPA
Adding two new integration tests for vDPA, relying on both block and net
simulators from the host kernel.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-03-18 12:28:40 +01:00
Rob Bradford
71d911b3aa tests: Add test for virtio-net control queue
Use ethtool to trigger an event on the control queue.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-10 11:27:35 +00:00
Rob Bradford
b2bf88bcb1 tests, scripts: Rename virtiofsd binary
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-02-21 10:42:36 +00:00
Rob Bradford
75fbea3c46 tests: Rename prepare_virtiofsd_rs_daemon
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-02-21 10:42:36 +00:00
Rob Bradford
4c4eb8db40 tests: Drop classic (i.e. C based) virtiofsd testing
This has been deprecated upstream in favour of the Rust version.

Fixes: #3729

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-02-21 10:42:36 +00:00
Bo Chen
6daddf0831 tests: Add "test_live_migration_ovs_dpdk_local()" test
In this way, we can cover local-migration with dpdk in our regular CI,
to prevent similar regressions reported and fixed by #3657.

Fixes: #3659

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-02-21 08:56:14 +01:00
Rob Bradford
d0789871a5 tests: Add test_iommu_segments integration test
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-02-11 11:20:04 +00:00
Sebastien Boeuf
da20fa74c6 tests: Add new integration test for free page reporting
Introducing a new integration test relying on the virtio-balloon ability
to free host pages that have been reported as freed by the guest.

This test checks that after consuming a lot of RAM in the guest, the VMM
process is able to releases the pages reported by the guest. Simply done
by checking the RSS associated with the VMM's process follows the memory
trend in the guest.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-02-11 12:10:07 +01:00
Bo Chen
7f987552ef test_infra: Move struct Guest and struct GuestCommand from tests
In this way, these structs can be reused for performance tests.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-02-07 10:34:00 +01:00
Bo Chen
a3a175216a tests: Remove reference to hardcoded constants from struct Guest
In this way, we allows to reuse the struct `Guest` with kernel paths and
kernel commands (e.g. hardcoded constants) that are tests-specific.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-02-07 10:34:00 +01:00
Bo Chen
7a3d8c6299 tests: Construct firmware path from tests explicitly
Instead of using hardcoded firmware paths inside the `Guest` struct
constructor, this commit removes `fw_path` related code paths from the
`Guest` struct and asks each test constructs its firmware path
explicitly. This allows better flexibility for the `Guest` struct so
that it can be reused for the performance tests we are adding soon.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-02-07 10:34:00 +01:00
Sebastien Boeuf
e9eb2c5dbc tests: Update macvtap integration tests with multiqueue
Now that multiple file descriptors can be provided along with add-net,
that means we can hotplug a multiqueue macvtap interface to the VM.

The common macvtap test is updated, meaning that both coldplug and
hotplug codepath now use multiqueue.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-01-31 10:37:53 +00:00
Jianyong Wu
e9b069bf38 tests: add test case for testing PMU on direct kernel boot
Add integration tests for "pmu=on". It depends on checking if there
is "arm-pmu" item in "/proc/interrupts". As PMU info has not been added
to ACPI, the tests are only for dt.

Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2022-01-21 17:59:36 +08:00
Sebastien Boeuf
ae68c2f31a tests: Increase timeout when booting with firmware
As it might take more time for the VM to boot (especially under high
load) when using the firmware, let's increase the timeout waiting for
the VM to be reachable.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-01-21 09:46:19 +00:00
Sebastien Boeuf
eb5c5f2c7f tests: Add integration test for O_DIRECT
Both OVMF and RHF firmwares triggered an error when O_DIRECT was used
because they didn't align the buffers to the block sector size.

In order to prevent regressions, we're adding a new test validating the
VM can properly boot when the OS disk is opened with O_DIRECT and booted
from the rust-hypervisor-fw.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-01-20 11:49:02 +00:00
Henry Wang
b4566b9eab tests: ignore the result from test_vfio_user
As it is currently unstable.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2022-01-20 11:40:30 +00:00
Henry Wang
b7b3b45364 tests: Enable test_vfio_user for AArch64
Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2022-01-18 18:00:00 -08:00
Sebastien Boeuf
779bc1a53a edk2: Rely on latest OVMF based on CloudHvX64 target
Update documentation and CI to rely on the new CLOUDHV.fd firmware built
from the newly introduced target CloudHvX64.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-01-18 11:58:26 +01:00
Rob Bradford
cb243571de tests: Add test_live_migration_local() test
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-01-18 09:07:47 +00:00
Rob Bradford
b204f43aae tests: Fix beta clippy issues
error: this boolean expression can be simplified
    --> tests/integration.rs:3755:33
     |
3755 |                         assert!(!(empty > 5), "No login on pty");
     |                                 ^^^^^^^^^^^^ help: try: `empty <= 5`
     |
     = note: `-D clippy::nonminimal-bool` implied by `-D warnings`
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool

error: unneeded late initalization
    --> tests/integration.rs:7619:13
     |
7619 |             let mut success;
     |             ^^^^^^^^^^^^^^^^
     |
     = note: `-D clippy::needless-late-init` implied by `-D warnings`
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
help: declare `success` here
     |
7621 |             let mut success = if let Some(status) = send_migration
     |             +++++++++++++++++
help: remove the assignments from the branches
     |
7625 ~                 status.success()
7626 |             } else {
7627 ~                 false
     |
help: add a semicolon after the `if` expression
     |
7628 |             };
     |              +

error: unneeded late initalization
    --> tests/integration.rs:7838:13
     |
7838 |             let mut success;
     |             ^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
help: declare `success` here
     |
7840 |             let mut success = if let Some(status) = send_migration
     |             +++++++++++++++++
help: remove the assignments from the branches
     |
7844 ~                 status.success()
7845 |             } else {
7846 ~                 false
     |
help: add a semicolon after the `if` expression
     |
7847 |             };
     |              +

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-01-14 14:33:18 +00:00
Bo Chen
6738e45b37 tests: Add crate-level attribute to silence "dead-code" warnings
When enabling the `mshv` feature, we skip quite some tests and
hence have known dead-code. This annotation silences dead-code
related warnings for our quality workflow to pass.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-01-10 10:29:07 +01:00
Bo Chen
e7a2a715e0 tests: Remove unnecessary annotations integration_tests and test
Given integration tests are placed in a dedicate directory, they don't
need annotations (e.g. `#[cfg(integration_test)]` and `#[cfg(test)]`) or
defining `test mod` to exclude themselves from the common compilation
process.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-01-10 10:29:07 +01:00
Sebastien Boeuf
210a29f05c tests: Disable test_vfio_user
The test test_vfio_user is flaky, let's disable it until we find the
right way to fix it.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-01-03 12:59:23 +01:00
Sebastien Boeuf
21a21ce51a tests: Disable test_virtio_block_topology for aarch64
The test test_virtio_block_topology is flaky on aarch64, let's disable
it until we find the right way to fix it.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-01-03 12:59:23 +01:00
Rob Bradford
6a76a6772d tests: Add integration test for virtio-block topology
This test relies on using losetup with a block size to create a block
device from a file that has a specific block size for the topology
detection code to pick up and passthrough to the guest.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-12-17 12:42:10 +01:00
Sebastien Boeuf
7bce72dff3 tests: Re-enable vfio_user integration test
This time we use the Rust Hypervisor Firmware for test_vfio_user() in
order to fix the systemd issues we've seen so far.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-12-08 14:38:30 +00:00
Rob Bradford
eea2907daf build: Use OVMF binary released from edk2 repo
Fixes: #3415

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-12-07 10:34:05 +01:00
Henry Wang
00bb1ea1d5 tests: Enhance test for multiple PCI segments
This commit enhances the integration test for multiple PCI segments
by:

(1) Enables the `test_virtio_fs_multi_segment` on AArch64.

(2) Adds a new integration test case for both x86_64 and AArch64 using
the direct kernel boot to test virtio-disk multiple PCI segments.
The test case does:
- Start a VM using direct kernel boot with 16 PCI segments and assign
the last PCI segment with a virtio-disk device.
- Check if the number of PCI host bridges equals to 16 after VM boots.
- Mount the virtio-disk device on the last PCI segment to the rootfs
and write/read data to the virtio-disk device.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-12-06 09:29:49 +00:00
Sebastien Boeuf
cab0b3446f tests: Test OVMF with Linux guest
Extending the test_simple_launch() integration test to validate Cloud
Hypervisor boots correctly with both rust-hypervisor-fw and OVMF on
x86_64 platforms.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-12-04 23:04:32 +01:00
Sebastien Boeuf
9b0fe505ca ci: Update the OVMF version the tests rely on
Bumping the OVMF binary version along with UEFI documentation to
reflect the latest set of patches on top of tianocore/edk2 'master'
branch, which can be found on the Cloud Hypervisor fork on 'ch' branch.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-12-04 23:04:32 +01:00
Henry Wang
788d77aee5 tests: Update the virtiofsd-rs cmdline
Commit ac25172176 bumps the rust
version of virtiofsd named `virtiofsd-rs`, which causes a warning
```
warning: use of deprecated parameter '--socket':
Please use the '--socket-path' option instead.
```

This commit updates the cmdline parameter accordingly.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-12-04 13:45:50 +01:00
Bo Chen
32dd4d10d0 tests: Temporarily disable test_vfio_user
This test is flaky (#3400) while we are experiencing a bug of using the latest
SPDK/NVMe backend as VFIO user device (#3401). Let's disable this test
before we fix the above two issues.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2021-12-02 12:43:11 +01:00
Bo Chen
27b5f8756f tests: Add integration test for vfio-user with SPDK NVMe
For now we only enable the vfio-user test on x86_64 platform, as we have
a known hanging issue to resovle on the aarch64 platform.

Fixes: #3098

Signed-off-by: Bo Chen <chen.bo@intel.com>
2021-12-01 10:31:54 +00:00
Michael Zhao
17b0f40154 tests: Enable PCI-segment tests
Enabled following hot-plug tests:
 - virtio-net
 - virtio-pmem
 - virtio-fs

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-12-01 09:24:01 +08:00
Sebastien Boeuf
6a7a588268 tests: Add integration test for CPU affinity
This new integration test validates the vCPUs are running on the
expected set of CPUs on the host.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-11-12 09:40:37 +00:00
Sebastien Boeuf
b81d758c41 option_parser: Expect commas instead of colons for lists
The elements of a list should be using commas as the correct delimiter
now that it is supported. Deprecate use of colons as delimiter.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-11-09 08:59:59 +01:00
Rob Bradford
bad26133cb tests: Add test_virtio_fs_multi_segment{_hotplug}
Refactor the existing virtio fs test to support controlling the PCI
segment the device should be added to and use this for a multiple
segment test.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-11-02 16:55:42 +00:00
Rob Bradford
b881339866 tests: Add test_net_multi_segment_hotplug
Refactor the existing net hotplug test to support controlling the PCI
segment the device should be added to and use this for a multiple
segment test.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-11-02 16:55:42 +00:00
Rob Bradford
0afa619d2c tests: Add test_pmem_multi_segment_hotplug
Refactor the existing pmem hotplug test to support controlling the PCI
segment the device should be added to and use this for a multiple
segment test.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-11-02 16:55:42 +00:00
Rob Bradford
4ae8ee2376 tests: Use assert!() rather than if+panic
As identified by the new beta clippy.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-10-19 19:42:36 +01:00
Wei Liu
3e0bf235bb tests: consolidate arch constants into modules
This avoids having cfg(...) for each individual line. No functional
change.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
2021-10-08 10:51:14 -07:00
Henry Wang
db5d66747e tests: Enable device hotplug test cases on AArch64
On AArch64, device hotplug can be enabled with ACPI. Therefore,
this commit enables the hotplug test case for following devices:

- PCI bar reprogramming
- virtio-disk
- virtio-net
- macvtap
- virtio-vsock
- virtio-pmem: Works with the latest reference kernel
- virtio-fs: Works with the latest reference kernel

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-09-29 17:37:43 +01:00
Henry Wang
8c135030d0 tests: Mute warning when building tests on AArch64
Currently vfio and nested virtualization is not used on AArch64,
and SGX is a x86_64 only feature. Therefore this commit adds the
architecture gates for helper functions related to vfio, SGX, and
nested virtualization to mute warnings when building tests on the
AArch64 platform.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-09-29 17:37:43 +01:00
Jianyong Wu
277ff84e55 tests: Enable memory hotplug and virtio_balloon on arm64
Memory hotplug and virtio_balloon works on arm64 with:

- memory hotplug: An updated kernel using ACPI
- virtio balloon: `stress` installed in the cloud image

Therefore, we can enable test cases for them in integration test.

Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-09-29 16:32:51 +01:00
Muminul Islam
73244aa6f2 tests: Disable unsupported tests for MSHV
On MSHV some of the integration test cases are not supported yet
or still in progress. This patch disables all those test cases.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2021-09-29 15:02:50 +01:00
Rob Bradford
1511cbda87 tests, scripts: Update custom aarch64 image to include "stress"
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-09-29 15:01:46 +01:00
Sebastien Boeuf
562a57012f tests: Update virtiofsd-rs to use the cache option
Now that virtiofsd-rs binary supports the cache option, let's use it.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-09-28 19:48:17 +01:00
Sebastien Boeuf
93d19329f9 tests: Extend snapshot/restore test with virtio-mem
Add virtio-mem plug/unplug testing to the existing snapshot/restore
integration test.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-09-28 10:15:22 -07:00
Sebastien Boeuf
612dc544a8 tests: Extend live migration testing with virtio-mem
Adding some bits to the existing live migration test with NUMA in order
to properly validate virtio-mem works with live migration.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-09-28 10:15:22 -07:00
Michael Zhao
7383087230 tests: Enable virtio-iommu test on AArch64
Refactored the test case `test_virtio_iommu` to adapt architectures and
different choices among ACPI and FDT. In the case of ACPI, a Focal image
with modified kernel is tested.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-09-24 07:57:57 +01:00
Sebastien Boeuf
6fb88c3c5a virtio-devices: balloon: Add snapshot/restore support
Adding the snapshot/restore support along with migration as well,
allowing a VM with a virtio-balloon device attached to be properly
migrated.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-09-21 14:47:17 +02:00
Bo Chen
d6c08d902b ci: Use the pre-installed virtiofsd
Signed-off-by: Bo Chen <chen.bo@intel.com>
2021-09-20 16:47:28 +01:00
Michael Zhao
9dc9e224b9 tests: Enable IOMMU test case on AArch64
For AArch64, now virtual IOMMU is only tested on FDT, not ACPI.
In the case of FDT, the behavior of IOMMU is a bit different with ACPI.
All the devices on the PCI bus will be attached to the virtual IOMMU,
except the virtio-iommu device itself. So these devices will all be
added to IOMMU groups, and appear in folder '/sys/kernel/iommu_groups/'.

The result is, on AArch64 IOMMU group '0' contains "0000:00:01.0" which
is the console device. But on X86, console device is not attached to
IOMMU. So the IOMMU group '0' contains "0000:00:02.0" which is the first
disk.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-09-17 12:19:46 +02:00
Bo Chen
2e56f0df77 ci: Rustify ovs-dpdk setup and cleanup
Signed-off-by: Bo Chen <chen.bo@intel.com>
2021-09-10 07:41:15 +01:00
Bo Chen
a181b77bc8 ci: Add integration test for live migration with OVS-DPDK
Signed-off-by: Bo Chen <chen.bo@intel.com>
2021-09-10 07:41:15 +01:00
Bo Chen
9023412e31 tests: Refactor test_ovs_dpdk
This patch adds a separate function to launch two guest VMs and ensure
they are connected through ovs-dpdk, so that we can reuse this function
in other tests, e.g. the test for live-migration with ovs-dpdk.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2021-09-10 07:41:15 +01:00
Jianyong Wu
579710d3e0 tests: Enable some virtio-pmem test for Arm64
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2021-09-08 09:40:48 +01:00
Henry Wang
4d8a73735b tests: Enable Arm64 user defined mem regions test
Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-09-08 09:40:48 +01:00
Henry Wang
25798a97b3 tests: Restructure AArch64 tests
Currently we need to test both device tree and ACPI on AArch64. As
the number of ACPI test cases is gradually increasing and expected
to increase in the future, it is better to extract all ACPI test
cases on AArch64 to a single module.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-09-07 09:35:06 +01:00
Jianyong Wu
2752b07762 enable virtio-mem test for arm64
virtio-mem has enabled on arm64. let's test it.

Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2021-09-07 09:34:22 +01:00
Henry Wang
1bf083bf00 tests: Add a test case for Arm64 ACPI power button
Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-09-03 10:27:52 -07:00
Bo Chen
6c142e35f7 tests: Add test_live_migration_numa
This patch refactors and reuses the existing 'test_live_migration' for
adding 'test_live_migraiton_numa'.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2021-09-03 06:50:01 +01:00
Bo Chen
32da33eacd tests: Refactor common checks on numa
This patch adds a separate function to perform common numa checks, so
that we can reuse this function in other tests, e.g. the test for
live-migration with numa.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2021-09-03 06:50:01 +01:00
Bo Chen
92a506fb06 tests: Add the integration test for live migration
This test exercises the local live-migration between two Cloud
Hypervisor VMs on the same host. It ensures the following behaviors:
1. The source VM is up and functional (including various virtio-devices
are working properly);
2. The 'send-migration' and 'receive-migration' command finished
successfully;
3. The source VM terminated gracefully after live migration;
4. The destination VM is functional (including various virtio-devices
are working properly) after live migration.

Note: This test does not use vsock as we can't create two identical
vsock on the same host.

Fixes: #2965

Signed-off-by: Bo Chen <chen.bo@intel.com>
2021-09-02 14:57:31 +01:00
Bo Chen
72eb533f56 tests: Refactor test_snapshot_restore
This patch adds a dedicate function to include the common checks on the
virtio-devices from the 'test_snapshot_restore' test, which will also be
reused for the upcoming 'test_live_migration' test.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2021-09-02 14:57:31 +01:00
Fazla Mehrab
1fa3a60b35 tests: integration tests for the fixed and dynamic VHDx implementation
Two tests for booting Linux cloud image from the different VHDx files:
fixed and dynamic. Another test for testing the dynamic expansion of a
generated VHDx file.

Signed-off-by: Fazla Mehrab <akm.fazla.mehrab@intel.com>
2021-08-19 11:43:19 +02:00
Henry Wang
1d403ea5d6 tests: Add test_guest_numa_nodes_dt test case
This commit adds an AArch64-only integration test case called
`test_guest_numa_nodes_dt` so that it is possible to test the
NUMA for the FDT on AArch64 platform.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-08-12 10:49:02 +02:00
Henry Wang
c6dd9918d5 tests: Add AArch64 ACPI CPU topology tests
AArch64 CPU topology can be described using either device tree or
ACPI. Therefore, the integration test should also cover the AArch64
ACPI CPU topology tests.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-08-05 21:19:16 +08:00
Henry Wang
db102a2547 tests: Enable CPU topology for AArch64
Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-08-05 21:19:16 +08:00
Sebastien Boeuf
4abcb0a33c tests: Add snapshot/restore to OVS DPDK integration test
Now that vhost-user supports being snapshot and restored, we extend the
existing test_ovs_dpdk to validate snapshot/restore feature works as
expected.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-07-29 06:35:03 -07:00