Commit Graph

323 Commits

Author SHA1 Message Date
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
Sebastien Boeuf
48d1a31e08 tests: Introduce test_macvtap_hotplug
The existing test_macvtap is factorized to be able to support both
coldplug and hotplug of a macvtap interface through virtio-net. Adding
the new test_macvtap_hotplug test allows for validating that sending a
TAP file descriptor through control message along with the add-net
command works.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-07-21 15:34:22 +02:00
Sebastien Boeuf
2ecced376e tests: Update test_macvtap to rely on exec_host_command_status()
To help with readability, we rely on exec_host_command_status() from the
macvtap test, which replaces the former "bash -c ..." syntax.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-07-21 15:34:22 +02:00
Bo Chen
1365388f0b tests: Extend 'test_vfio' with block device passthrough
Fixes: #2822

Signed-off-by: Bo Chen <chen.bo@intel.com>
2021-07-13 14:08:57 +02:00
Sebastien Boeuf
9aedabe11e sgx: Add mandatory id field to SgxEpcConfig
In order to uniquely identify each SGX EPC section, we introduce a
mandatory option `id` to the `--sgx-epc` parameter.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-07-09 14:45:30 +02:00
Henry Wang
894a46f30c tests: Re-enable AArch64 snapshot/restore test
Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-07-05 22:51:56 +02:00
Rob Bradford
28b80ba42a tests: Change string checking for console success
The output from getty ("login:") does not always appear. This can be
observed interactively when booting the VM. (Mashing return will bring
it up.) Instead of checking for that string to ensure the VM has booted
instead check for a message from systemd to say it has started the SSH
daemon.

Fixes: #2799

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-06-28 17:09:16 +01:00
Rob Bradford
f40e8ce6b7 tests: For test_console_file print out the console file
This should aid debugging of this test flakiness.

See: #2799

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-06-25 08:55:11 -07:00
Henry Wang
48326ce731 tests: Enable test_numa_nodes() on AArch64
Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-06-25 10:22:40 +01:00
Anatol Belski
5e42e0f1f7 tests: Add case for multiple net devices for Windows guest
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2021-06-25 10:22:28 +01:00
Michael Zhao
d330d91e1a tests: Optimize integration test on AArch64
AArch64 tests were divided into 2 steps:
- Build and test with 'acpi' feature
- Build and test without 'acpi'

This can be optimized. We need only to build and test once with default
features ('acpi' is enabled).

On AArch64, ACPI only works with UEFI. If UEFI is not available, guest
kernel fall back to use FDT. Most AArch64 test cases boot from direct
kernel, the guest will keep using FDT even if ACPI is enabled. So
nothing is broken.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-06-24 13:13:27 +01:00
Bo Chen
5825ab2dd4 clippy: Address the issue 'needless-borrow'
Issue from beta verion of clippy:

Error:    --> vm-virtio/src/queue.rs:700:59
    |
700 |             if let Some(used_event) = self.get_used_event(&mem) {
    |                                                           ^^^^ help: change this to: `mem`
    |
    = note: `-D clippy::needless-borrow` implied by `-D warnings`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Signed-off-by: Bo Chen <chen.bo@intel.com>
2021-06-24 08:55:43 +02:00
Sebastien Boeuf
4d36ecef9e tests: Fix virtio_balloon integration test
The virtio_balloon test is a bit flaky since we can't really know how
much the balloon is gonna be deflated when the guest is under memory
pressure. That's why it's safer to simply check that the balloon is not
the initial size anymore.

One small detail, but we don't need to check for the balloon size to be
higher than 0 since the returned value is a u64.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-22 11:49:53 +02:00
Anatol Belski
dc15e44e2a tests: Add test for Windows guest multiple disk hotplug
Additionally, he disk creation routine is extended to support NTFS and
variable image size.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2021-06-17 16:17:44 +02:00
Sebastien Boeuf
a36ac96444 vmm: cpu_manager: Add _PXM ACPI method to each vCPU
In order to allow a hotplugged vCPU to be assigned to the correct NUMA
node in the guest, the DSDT table must expose the _PXM method for each
vCPU. This method defines the proximity domain to which each vCPU should
be attached to.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-17 16:08:46 +02:00
Michael Zhao
9708019312 tests: Enhance test_large_vm case
Enhanced the test case test_large_vm to check the number of total VCPUs
and on-line VCPUs.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-06-16 15:38:23 +02:00
Fei Li
2c576ab312 test: Introduce test_virtio_balloon() function
The new test_virtio_balloon() is to verify if the 'deflate_on_oom'
parameter works. Its testing result is as follows:

1. Start a 4G guest with 2G balloon, check memory once starts up.
total_mem    is 4294967296 bytes
actual_mem   is 2147483648 bytes
orig_balloon is 2147483648 bytes
       total      used      free    shared    buff/cache    available
Mem:   3.8Gi     2.1Gi     1.6Gi     0.0Ki         140Mi        1.6Gi
Swap:     0B        0B        0B

2. Run a command in guest to eat up 25G memory, and check again.
total_mem        is 4294967296 bytes
actual_mem       is 3121610752 bytes
deflated_balloon is 1173356544 bytes
       total      used      free    shared    buff/cache    available
Mem:   3.8Gi     1.2Gi     2.6Gi     0.0Ki          49Mi        2.5Gi
Swap:     0B        0B        0B

From above, we can notice the balloon memory indeed deflates from
2147483648 bytes to 1173356544 bytes once an oom is going to be
triggered.

Signed-off-by: Fei Li <lifei.shirley@bytedance.com>
2021-06-16 09:55:22 +02:00
Fei Li
de7cfd61a0 tests: Clean up unused workload_path
Signed-off-by: Fei Li <lifei.shirley@bytedance.com>
2021-06-15 15:21:26 +02:00
Anatol Belski
57f70c0761 tests: Simplify Windows guest boot and DHCP setup
A new method has been introduced for WindowsGuest, that would poll on
the SSH connection and try to execute a test command. When successfull,
the polling stops and the guest is considered finished boot. The
downside of this method is that the network setup is needed always even
if the test doesn't use network, however it complies with the behavior
of other tests. I also observe a bit more stability on the local test
run, however it still appears to be a resource issue so some sporadic
fails are possible on a slower machine.

The hardcoded timeouts for guest boot and DHCP setup have been removed.

The dnsmasq invocation uses `--bind-dynamic` so then the daemon can be
started while the target interface could be down yet.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
Co-authored-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-14 09:38:34 +02:00
Michael Zhao
f060ecd705 tests: Unblock some vhost-user tests
Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-06-11 11:03:08 +02:00
Henry Wang
31e4d80caf tests: Enable AArch64 API pause/resume test case
Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-06-11 09:05:54 +02:00
Michael Zhao
7cfb2139d0 tests: Enable pty test case on AArch64
Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-06-10 15:05:25 +02:00