Commit Graph

306 Commits

Author SHA1 Message Date
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
Michael Zhao
97307a7fc1 tests: Remove test_aarch64_pe_boot case
test_aarch64_pe_boot was added at the very beginning of AArch64 support.
Now it can be combined to test_vmlinux_boot.

Renamed test_vmlinux_boot to test_direct_kernel_boot for generality.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-06-10 10:10:53 +02:00
Michael Zhao
6ed1f83a87 tests: Enable the boot_noacpi case on AArch64
Enabled test case test_vmlinux_boot_noacpi on AArch64 and renamed it
test_direct_kernel_boot_noacpi for generality.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-06-10 10:10:53 +02:00
Michael Zhao
04aff2e2f9 tests: Enable test_console_file case on AArch64
This test case could have been ready on AArch64 since the serial issue
was fixed.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-06-10 10:10:53 +02:00
Sebastien Boeuf
9dba097224 ci: Update guest cloud image by installing "stress" utility
Some new integration tests will require the "stress" binary to be
present in the guest in order to run correctly.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-09 14:34:55 +01:00
Michael Zhao
ce5c5833cb tests: Add a simple test case for ACPI on AArch64
In the test case, the guest boots from EDK2.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-06-09 18:36:59 +08:00
Sebastien Boeuf
bb68e0bc3b tests: Re-enable virtiofsd tests
Re-enable virtiofsd testing now that issues with capstone repository
have been resolved.

This reverts commit a14c70019a.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-08 20:13:41 +02:00
Sebastien Boeuf
1e2aa769e5 test_infra, tests: Introduce exec_host_command_output() function
This new function allows for better readability of the code by
factorizing a few of lines of code into a single one.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-04 16:25:41 +02:00
Sebastien Boeuf
8091c28dd5 tests: Make sure exec_host_command_status() succeeds
It's important to verify the actual exit code returned from the new
function exec_host_command_status() to ensure the command ran
successfully.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-04 16:25:41 +02:00
Sebastien Boeuf
eca1df4e2d test_infra, tests: Introduce exec_host_command_status() function
This new function allows for better readability of the code by
factorizing a bunch of lines of code into a single one.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-04 16:25:41 +02:00
Sebastien Boeuf
3d8728488d tests: Remove ssh_command_ok()
There's no need for ssh_command_ok() anymore since ssh_command() now
returns an error in case the executed command returned with an exit code
different than 0.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-04 16:25:41 +02:00
Sebastien Boeuf
b443900cc2 tests: Extend OVS DPDK test with reconnection
Make sure the reconnection functionaliity is well tested from the OVS
DPDK integration test.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-04 11:13:44 +02:00
Sebastien Boeuf
8fad60bada tests: Improve OVS DPDK integration test
In order to simplify and speed up the OVS DPDK test, we switch from
using 'iperf3' to 'netcat' to validate the connectivity is functional.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-04 11:13:44 +02:00
Sebastien Boeuf
2e8a552c24 tests: Use OVS DPDK in client mode
Since OVS DPDK deprecated the use for the server mode, let's make sure
the integration test uses the client mode instead. This means the OVS
backend is the client and the VMM acts as the server, therefore the
reason why we use "vhost_mode=server".

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-04 11:13:44 +02:00
Sebastien Boeuf
7c917c0e74 tests: Re-enable test_ovs_dpdk
Re-enable the OVS DPDK integration test by assigning both VMs to the
NUMA node 0. This ensures the processes are being run on NUMA node 0,
preventing OVS DPDK from abnormal functioning.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-04 11:13:44 +02:00
Rob Bradford
0ccb597baf tests: Adapt commands for new SSH non-zero exit behaviour
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-06-03 13:28:25 -07:00
Rob Bradford
a3cbc1ff72 tests: Use sudo when testing disks with dd
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-06-03 13:28:25 -07:00
Rob Bradford
a14c70019a tests: Don't test virtiofsd
The CI is failing due the git server that the submodules required for
this fork of QEMU need to build from is unavailable.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
(cherry picked from commit 2aec0a92a5)
2021-06-02 16:12:30 +02:00