Commit Graph

491 Commits

Author SHA1 Message Date
Sebastien Boeuf
3bf3cca70a vhost_user_net: Allow user to set MTU
Adding the support for the user to set the MTU for the vhost-user-net
backend, which allows the integration test to be extended with the test
of the MTU parameter.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-09-27 10:37:35 +01:00
Sebastien Boeuf
76dbf85b79 net: Give the user the ability to set MTU
Add a new "mtu" parameter to the NetConfig structure and therefore to
the --net option. This allows Cloud Hypervisor's users to define the
Maximum Transmission Unit (MTU) they want to use for the network
interface that they create.

In details, there are two main aspects. On the one hand, the TAP
interface is created with the proper MTU if it is provided. And on the
other hand the guest is made aware of the MTU through the VIRTIO
configuration. That means the MTU is properly set on both the TAP on the
host and the network interface in the guest.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-09-21 16:20:57 +02:00
Rob Bradford
d4d0780b89 tests: Fix aarch64 beta clippy issues
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-09-20 10:59:48 +01:00
Rob Bradford
f32487f8e8 misc: Automatic beta clippy fixes
e.g. cargo clippy --all --tests --all-targets --fix --features=..

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-09-20 10:59:48 +01:00
Bo Chen
d5219525d8 tests: Add rate limiter test for virtio block
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-09-14 15:01:43 +01:00
Bo Chen
a15b641c61 tests: Add rate limiter test for virtio net
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-09-14 15:01:43 +01:00
Bo Chen
60f3bd43f5 tests: live-migration: Split numa tests into its own function
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-09-08 10:31:50 +02:00
Bo Chen
e145b823a5 tests: live-migration: Split balloon tests into its own function
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-09-08 10:31:50 +02:00
Bo Chen
ff3e9eb668 tests: live-migration: Split watchdog tests into its own function
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-09-08 10:31:50 +02:00
Bo Chen
e3d7824f09 tests: Provide a function to log guests outputs w/ migration errors
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-09-08 10:31:50 +02:00
Bo Chen
d5481cddcf tests: Provide a function to start live migration
This function starts the 'receive-migration' for the destination VM,
'send-migration' for the source VM, waits for the live-migration
completion, and prints debug information upon errors.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-09-08 10:31:50 +02:00
Bo Chen
1817224fe9 tests: Refactor 'test_watchdog' for better readability
This patch moves the actual test logic and assertions from various
functions to the actual tests, which makes these tests more readable and
easier to debug.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-09-07 09:51:34 +01:00
Sebastien Boeuf
3b5c2b3718 tests: Disable test_windows_guest_disk_hotplug for aarch64
Until the issue #4583 is resolved, we must disable this test given it's
failing quite often on the aarch64 worker.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-09-05 17:08:34 +02:00
Bo Chen
3c6014554b tests: ovs_dpdk: Cleanup ovs-dpdk after terminating VMs
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-09-01 08:39:39 +02:00
Bo Chen
6cf4ea74fc tests: live-migration: Cleanup ovs-dpdk setup correctly on failures
As 'handle_child_output()' may terminate the test on panic, we need to
cleanup ovs-dpdk setup in advance.

see: #4555

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-09-01 08:39:39 +02:00
Anatol Belski
2306291720 tests: Enable more Windows guest tests for aarch64
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2022-08-30 09:02:54 +01:00
Michael Zhao
88bbf7989a tests: Enable live upgrade tests on AArch64
Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2022-08-22 10:51:18 +08:00
Rob Bradford
31dfe3d02a tests: Enable live upgrade tests
Following our recent v26.0 release we can re-enable our live upgrade
tests to try and make it possible for us to move to making LTS releases.

Currently limited to x86-64 as the live upgrade tests fail on aarch64.

Fixes: #3949

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-08-18 14:41:22 +01:00
Bo Chen
8f3462b3e3 tests: live_migration: Run most tests in parallel
Only the ovs-dpdk live-migration tests need to run sequentially as they
use the same ovs-dpdk setup.

This is to reduce our CI time, particularly for the live-migration
and aarch64 jobs.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-08-16 22:42:33 +01:00
Bo Chen
1f70d16c12 tests: Avoid name clashing for 'parallel/sequential' tests
Add prefix 'common_' to make them more specific.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-08-16 22:42:33 +01:00
Bo Chen
76bde33fc4 tests: live-migration: Cleanup ovs-dpdk after terminating VMs
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-08-16 11:45:44 +01:00
Anatol Belski
944d09208e ci: Initial Windows image integration
This enables the Windows test module. One basic test is enabled,
while all others are disabled yet for aarch64. Jenkins file is
extended with the corresponding step for aarch64.

installAzureCli() is parametrized.

It seems that transferring a 30GB image would take >= 15 minutes. An
optimization here is having a gzip'ed image to 10GB which would unpack
in 3 minutes. Expect to be quicker than transferring an uncompressed
image while on another network.

Signed-off-by: Anatol Belski <ab@php.net>
2022-08-12 15:04:06 +01:00
Sebastien Boeuf
6d452fad52 tests: Improve test_virtio_block_topology reliability
The test test_virtio_block_topology has been recently failing due to an
error happening in losetup while trying to set the block size. Since
there's no option in losetup for retrying, we took the approach of
programming the expected behavior of creating a loop device relying
directly on the system ioctl LOOP_CONFIGURE. We apply a retry loop based
on the result returned by this ioctl, so that we don't fail on the first
try. We also added a sleep before retrying, hoping this would help the
next iteration to succeed.

Fixes #3494

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-08-10 14:43:26 +02:00
Wei Liu
a85d27bd52 tests: add OEM strings integration test
Signed-off-by: Wei Liu <liuwe@microsoft.com>
2022-08-08 08:59:19 +01:00
Sebastien Boeuf
dc75519372 tests: Improve reliability of test_bionic_ovmf
It's been observed on the Bionic image that udev and snapd services can
cause some delay in the VM's shutdown. Disabling them before shutting
down the VM improves the reliability of the test.

Also increasing slightly the sleep time to ensure we give the VM enough
time to shutdown before checking the list of events provided by the
event monitor.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-08-05 13:30:22 +01:00
Sebastien Boeuf
3b0f6247b7 ci: Add test_vfio to the baremetal CI
Since it's not possible to run the integration test test_vfio on Azure
at the moment (because of some nested virtualization issues), we can
temporarily run it on the baremetal CI where we already run some VFIO
tests.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-08-04 11:37:18 +01:00
lizhaoxin1
b3b252a5d1 tests: Add integration test for --platform uuid
Signed-off-by: lizhaoxin1 <Lxiaoyouling@163.com>
2022-08-04 09:20:06 +02:00
Sebastien Boeuf
103494f441 tests: Improve live migration tests reliability
Move the live migration tests to a 'jammy' worker rather than
'jammy-small'. This type of worker has more CPUs (64 vs 16) and more RAM
(256G vs 64G), which should improve the time it takes to run each test.
With this improvement, the test shouldn't fail anymore due to timeout
being reached.

A second improvement is to reduce the amount of vCPUs created for each
VM. The point is simply to check we can migrate a VM with multiple
vCPUs, therefore using 2 instead of 6 should be enough when possible.
When testing NUMA, we can't lower the amount of vCPUs since there's a
quite complex topology that is expected there.
Also, the total amount of vCPUs is reduced from 12 to 4 (again when not
testing with NUMA).

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-08-03 10:42:45 -07:00
Sebastien Boeuf
9524a8ffe8 tests: Re-enable virtio_block_topology on aarch64
Improve error catching on the steps creating the block device so that we
can understand if qemu-img or losetup is the faulty command leading to
an empty device path.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-08-02 14:46:54 +02:00
Sebastien Boeuf
fa0565234c tests: Make test_api_shutdown and test_api_delete more reliable
Both of these tests have been sporadically failing through multiple CI
runs. The reason is related to cloud-init which fails to run the
"init-local" script during the second boot of the VM. This causes the
network interface to not be available, and therefore the test can't SSH
into the VM as expected. The root cause is the filesystem and cache
corruption that happens on the cloud-init disk.

The way to prevent from this issue is to sync the guest filesystem
before we shut it down, and as a security harness, we also wait for a
few seconds for the shutdown command to complete inside the guest before
we trigger the API shutdown or delete.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-08-02 13:13:06 +02:00
Sebastien Boeuf
561791ed22 tests: Reliably trigger a guest OOM
Rely on /proc/sysrq-trigger to forcibly trigger an OOM in the guest.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-07-26 09:22:38 +02:00
Sebastien Boeuf
ec27e0ee82 tests: Fix test_virtio_balloon_deflate_on_oom()
It might sometimes take a few seconds for the guest to trigger the OOM
and report it back to the host. That's why this patch adds some sleep
time between the command in the guest supposedly triggering the OOM and
the check of the balloon size from the host.

Fixes #4336

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-07-21 12:00:14 +01:00
Rob Bradford
9fdfdf25fb tests: Disable test_windows_guest_snapshot_restore for now
See: #4327

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-07-18 17:42:14 +01:00
Rob Bradford
f8f2f09a19 tests: Skip test_vfio for now
See: #4324

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-07-18 14:35:41 +01:00
Rob Bradford
30da293d8f tests: Report stderr on ch-remote command failure
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-07-04 09:18:18 +02:00
Rob Bradford
67bfd4e234 tests: tests_api_create_boot: Use ch-remote for creating and booting vm
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-07-04 09:18:18 +02:00
Rob Bradford
0c82e7593d tests: Remove test on available entropy bits
As far as I can tell this always reports 256 for us now:
https://lore.kernel.org/lkml/YmlMGx6+uigkGiZ0@zx2c4.com/

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-07-01 18:45:05 +01:00
Rob Bradford
2716bc3311 build: Fix beta clippy issue (derive_partial_eq_without_eq)
warning: you are deriving `PartialEq` and can implement `Eq`
  --> vmm/src/serial_manager.rs:59:30
   |
59 | #[derive(Debug, Clone, Copy, PartialEq)]
   |                              ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-06-30 20:50:45 +01:00
Wei Liu
32b855df3a tests: switch from lazy_static to once_cell
Once_cell does not require using macro and is slated to become part of
Rust std at some point.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
2022-06-20 16:03:07 +01:00
Rob Bradford
7c8719b4ea tests: Unify API based boot across architectures
Use direct kernel boot for all the tests that create the VM via API.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-06-17 16:52:56 +01:00
Rob Bradford
094625242d tests: Add tests for vm.delete and vm.shutdown
Fixes: #1295

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-06-16 11:29:33 +01:00
Yi Wang
fd41892065 tests: Add integration test for coredump
As coredump function is to make a vmcore for crash tool to analyze,
in order not to introduce a big thing in integration, we just check
if ch-remote command runs no error report here.

Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
2022-05-30 13:41:40 +02:00
Rob Bradford
5da8a1c08e tests: Use smaller hotplug size for live migration tests
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-05-27 11:30:27 +02:00
Rob Bradford
62120f9afe tests: Remove testing of virtio-fs DAX cache
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-05-27 09:47:13 +02:00
Rob Bradford
56c11600db tests: Rename test_virtio_fs helper
This is so we can have a test called test_virtio_fs

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-05-27 09:47:13 +02:00
Rob Bradford
f2336413be tests: Simplify virtiofsd spawning
The cache methodology is never changed so it can be hardcoded.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-05-27 09:47:13 +02:00
Rob Bradford
75e3a3d982 tests: Use default timeout for booting in live migration tests
From the logs it appears that booting the VM to the point at which it
can signal to the host can sometimes take longer than then 30 seconds
specified.

Fixes: #4136

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-05-25 17:05:45 +01:00
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