Commit Graph

381 Commits

Author SHA1 Message Date
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
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
Rob Bradford
9341cce8b3 tests: Temporarily disable test_ovs_dpdk
This test is flaking out regularly, particularly on the musl build.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-06-01 17:46:58 +02:00
Sebastien Boeuf
4db7530f28 ci: Add OVS-DPDK integration test
In order to avoid regression regarding OVS-DPDK support, a new
integration test is added. This test consists of running two VMs, both
attached to a distinct OVS port, where both ports are connected to an
OVS bridge. Once the VM are running, the test validates the connection
between the two VMs works correctly.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-01 12:17:23 +02:00
Sebastien Boeuf
239e2adc68 tests: Introduce ssh_command_ok()
Adding a new function ssh_command_ok() as a wrapper around the existing
ssh_command() function. The goal being to identify if the command
returned without any error.

This new function allow for a bit of factorization through the codebase.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-06-01 12:17:23 +02:00
Anatol Belski
56b9149325 tests: Pull common code into a separate method
Yet another small refactoring step for WindowsGuest
after f56471566b.

For this particular case - there's currently neither overloading nor
default argument support in Rust (except a macro or other tricky stuff),
so keep the timeout and other options default for now.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2021-05-19 16:41:08 +01:00
Anatol Belski
01e2826f26 tests: Implement disk hotplug test
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2021-05-19 10:39:46 +02:00
Sebastien Boeuf
ae4e01adc9 tests: vfio: Increase time for memory hotplug
Bump the sleep time before checking the guest RAM size from 10 to 30
seconds. This will help the VFIO baremetal CI passing more consistently.

Fixes #2606

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-07 18:44:31 +02:00
Rob Bradford
6d6cafafb2 tests: Fix clippy issues in integration tests
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-05-07 14:31:57 +02:00
Sebastien Boeuf
5268bf5a8c tests: Re-enable virtiofsd tests
Re-enable virtiofsd testing now that issues with capstone repository
have been resolved.

This reverts commit 2aec0a92a5.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-07 11:16:36 +02:00
Wei Liu
c439324451 tests: add a Windows multiple queues test
Create as many queues as there are boot CPUs for block and twice as many
for net.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
2021-05-07 08:57:13 +02:00
Sebastien Boeuf
66b46a277e tests: Remove unused code from Windows integration tests
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-07 08:57:13 +02:00
Sebastien Boeuf
9adfc04f75 tests: Wait for dnsmasq process to terminate
Make sure the dnsmasq process terminates after we sent the kill signal.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-07 08:57:13 +02:00
Sebastien Boeuf
0a00df2e7e tests: Dynamically assign IPs for Windows integration tests
Relying on dnsmasq running on the host, the Windows guest are now
getting allocated with the expected IP addresses. This allows for
multiple VMs, therefore multiple tests to run in parallel.

The end goal is to reduce the time spent running Windows integration
tests.

Fixes #1891

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-06 17:27:33 +02:00
Sebastien Boeuf
aa76c9db2e tests: Rename Windows specific functions
Let's keep the function names as simple as possible.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-06 15:17:27 +02:00
Sebastien Boeuf
f56471566b tests: Introduce WindowsGuest structure for further factorization
This new wrapping structure allows for a better factorization of the
Windows specific code. This makes each test simpler and easier to read.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-06 15:17:27 +02:00
Sebastien Boeuf
14544d64e4 tests: Factorize shutdown and reboot functions for Windows
Add some factorization for both functions rebooting and shutting down a
Windows guest.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-06 15:17:27 +02:00
Sebastien Boeuf
2646b24047 tests: Remove references from Guest and DiskConfig
By using a Box around the DiskConfig trait, it becomes Sized. For that
reason, we can pass the DiskConfig to the Guest so that it can own it.
This allows for further simplification as the Guest does not need to be
bound to a specific lifetime, which makes things easier.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-06 15:17:27 +02:00
Sebastien Boeuf
b2b577257f tests: Add integration test for vhost-user-net client mode
Refactor the existing vhost-user-net integration tests in order to
extend it with an extra test for vhost-user client mode.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-05 16:05:51 +02:00
Sebastien Boeuf
b5be62a167 tests: Extend VFIO baremetal integration tests
Relying on guest Ubuntu image 21.04, including a 5.11 kernel, this patch
adds some additional tests to the VFIO baremetal integration tests. It
adds a test for ACPI memory hotplug, another one for virtio-mem memory
hotplug, and finally a test for hotplugging the NVIDIA card.

The existing test already taking care of the reboot has been renamed.

The script running "cargo test" has been modified to run only one thread
at a time, so that each test run sequentially. This is mandatory since
the card can't be shared across multiple VMs.

Fixes #2404

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-04 15:01:29 +02:00
Sebastien Boeuf
6eaf44ec61 tests: Update journalctl command to get reboot count
In order to support most recent Ubuntu distributions, we must update
the way of detecting a reboot through the journal since there is no
more "-- Reboot --" logs.

Using the `--list-boots` option is the preferred way for getting the
boot count information from journalctl command. We simply need to add 1
to the count in order to get the reboot count.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-04 15:01:29 +02:00
Sebastien Boeuf
8ee0377456 tests: Update VFIO baremetal test to rely on Ubuntu 21.04
Moving to latest Ubuntu version as the guest image is needed to move to
more recent guest kernel (5.11). With more recent kernels, we'll be able
to add hotplug and virtio-mem tests to the VFIO baremetal CI.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-05-04 15:01:29 +02:00
Rob Bradford
2aec0a92a5 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>
2021-05-04 12:14:37 +01:00
Rob Bradford
1f4a34ffc8 tests: Remove last tests using bzImage
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-04-30 16:16:48 +02:00
Sebastien Boeuf
ed54036bfb tests: Fix reboot by allowing specifying the custom timeout
test_reboot became flaky after the refactoring of the VM reboot code.
This is because we removed the ability to specify a custom timeout.
This patch fixes the issue by allowing a custom timeout of 120s to be
set.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-04-29 11:10:40 +01:00
Sebastien Boeuf
b31589f6bc tests: Factorize memory hotplug enabling
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-04-28 17:48:10 +02:00
Sebastien Boeuf
d30de8ecee tests: Add reboot validation to VFIO baremetal testing
Make sure the VFIO baremetal tests are still passing correctly after the
guest is rebooted.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-04-28 17:48:10 +02:00