Commit Graph

258 Commits

Author SHA1 Message Date
Rob Bradford
fa7487629f scripts: Fix feature build for aarch64 and mshv builds
These were erroneously skipping features for the unit tests and the
"build" target for dev_cli.sh

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-28 09:18:29 -07:00
Rob Bradford
6eb47bdb03 scripts: Remove unused "cargo" testing script
These are never run by the CI and is inconsistent with the way we build
test which is specified inside the .github workflows.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-28 09:18:29 -07:00
Henry Wang
26351a81b2 scripts: Use the same linux kernel build function everywhere
This commit unifies the custom linux kernel build in x86, Arm, and
performance metrics to the same function. Therefore, when bumping
the kernel version, we can make sure we only need to make the change
in one place.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2022-03-28 10:20:14 +01:00
Henry Wang
90805dd131 scripts: run_metrics: Always build the custom linux kernel
This commit makes sure that the custom linux kernel is always
rebuilt when running the performance metrics tests, and therefore
changes to the kernel config file is always caught.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2022-03-25 17:01:55 +01:00
Henry Wang
4335e5f84c scripts: aarch64: Build fio from source for performance metrics
On Arm64, the fio binary that comes from ubuntu distribution cannot
support io_uring, which is a required engine for the block
performance tests in performance metrics. Therefore this commit
build the fio from a relatively new version, and replace the native
ubuntu fio with the newly build one.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2022-03-23 18:25:48 +08:00
Jianyong Wu
30025d7676 performance-metrics: prepare image and toolchain for AArch64
Prepare disk image, kernel image and toolchain for AArch64 before run
performance-metrics tests.

Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2022-03-23 18:25:48 +08:00
Henry Wang
d4192abce1 scripts: aarch64: Revert the "Reduce source code build" for linux
Changes in commit "scripts: aarch64: Reduce source code build in CI"
for the Linux kernel will lead to the kernel cannot be rebuilt if
the config file is changed. Therefore should be reverted.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2022-03-21 14:41:36 +00:00
Henry Wang
0fa71ddf7e scripts: aarch64: Reduce source code build in CI
As Linux kernel, edk2, virtiofd, SPDK are all build from source, we
need to find a way to reduce the number of source code build.

To address this issue, this commit adds a stage that touching a
".built" file to each repo of the source code after a successfully
build. By checking if the ".built" file exists, we can determine
if there is already an old build. Since the source code repo will
be removed and cloned again when we bump the repo hash, the CI will
rebuild the repo.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2022-03-21 14:05:59 +08: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
Sebastien Boeuf
d1d55f1686 scripts: Add a script for preparing environment for vDPA
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-03-18 12:28:40 +01:00
Rob Bradford
1f077e7871 scripts: Propagate "--test-filter" metrics test
Populate iff the the parameter is passed.

Following combinations tested:

scripts/dev_cli.sh tests --metrics -- --test-filter boot_time
scripts/dev_cli.sh tests --metrics -- --test-filter boot_time -- --report-file /root/workloads/metrics.json
scripts/dev_cli.sh tests --metrics
scripts/dev_cli.sh tests --metrics --  -- --report-file /root/workloads/metrics.json

Fixes: #3787

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-07 14:34:57 +00:00
Rob Bradford
7e146a2057 Revert "scripts: Pass-through '--test-filter' option to performance-metrics"
This reverts commit 0be2d09778.

See: #3813

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-07 11:31:52 +00:00
Bo Chen
0be2d09778 scripts: Pass-through '--test-filter' option to performance-metrics
To be consistently with the integration scripts, we now pass through the
`--test-filter` option of the test scripts to the `performance-metrics`
binary. Now the following two commands achieve the same results:

`$./scripts/dev_cli.sh tests --metrics -- --test-filter boot_time_ -- --test-filter latency`
`$./scripts/dev_cli.sh tests --metrics -- -- --test-filter boot_time_ --test-filter latency`

Note that, the test scripts support only single occurrence of the
`--test-filter` option while the `performance-metrics` binary allows
multiple occurrences for filtering based on different keywords.

Fixes: #3787

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-03-04 13:22:56 -08:00
Rob Bradford
7936bfe680 Dockerfile, scripts: Update container Rust to latest stable
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-03 12:35:41 +00:00
Michael Zhao
2c3908eed9 scripts: Remove some obselete settings for musl
Additional settings on `TARGET_CC` and `CFLAGS` for `musl` target are no
longer needed on X86_64.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2022-03-02 14:12:29 +00:00
Michael Zhao
8ba1bc7621 scripts: Fix musl build error in AArch64 unit test
Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2022-03-02 14:12:29 +00:00
Michael Zhao
273098ee99 scripts: Fix musl build error in integration tests
Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2022-03-02 14:12:29 +00:00
Sebastien Boeuf
b0324f8557 scripts: Fix musl build on aarch64
Adding the missing TARGET_CC environment variable to get the build to
complete correctly.

Fixes #3776

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-03-01 13:29:40 +08:00
Fabiano Fidêncio
5343e09e7b scripts: dev_cli: Add --features option
Let's officially have a way to pass the features used to build
cloud-hypervisor to the dev_cli.sh script.

This doesn't invalidate the previous commit, as we still don't what the
features_build variable to be quoted, otherwise we face the following
issue:
```
error: Found argument '--features tdx' which wasn't expected, or isn't valid in this context
	Did you mean --features?

USAGE:
    cargo build --all --features <FEATURES>...
```

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-25 15:28:49 +00:00
Fabiano Fidêncio
7dc9259c6c scripts: dev_cli: Don't quote $features_build
2805e7b1dc quoted enclose variables to
prevent globbing or incorrect splitting.  However, by doing with with
$features_build it broke the capability to call the script as:
```
$ ./scripts/dev_cli.sh build --release --libc musl -- --features tdx

```

Before 2805e7b1dc it simply worked, after,
the result is:
```
docker run --user 1000:1000 --workdir /cloud-hypervisor --rm --volume /dev/kvm --volume /home/ffidenci/go/src/github.com/cloud-hypervisor/cloud-hypervisor:/cloud-hypervisor --env RUSTFLAGS= cloudhypervisor/dev:20220223-0 cargo build --all '' --target-dir /cloud-hypervisor/build/cargo_target --features tdx --release --target x86_64-unknown-linux-musl
error: Found argument '' which wasn't expected, or isn't valid in this context

USAGE:
    cargo build --all

For more information try --help
```

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-02-25 15:28:49 +00:00
Bo Chen
4552d07a80 scripts: Support custom arguments to the test binary with dev_cli.sh
The dev container interface script (e.g. 'dev_cli.sh') now supports the
following arguments syntax for running tests:

`tests [--unit|--cargo|--all] [--libc musl|gnu] [-- [<test scripts args>] [-- [<test binary args>]]] `

In this way, we can pass custom arguments to the test binary (either
"cargo test" or "performance-metrics") with our dev container script.
For example:

`$ ./dev_cli.sh tests --metrics -- -- --report-file /tmp/metrics.json --test-filter latency`
`$ ./dev_cli.sh tests --integration -- --test-filter "test_serial"  -- --nocapture --test-threads=1`

Fixes: #3739

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-02-24 16:34:32 +01:00
Rob Bradford
c35220b1ca scripts: dev_cli: Bump container version to use
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-02-23 16:30:22 +01:00
Rob Bradford
2861330d09 Dockerfile: Remove classic virtiofsd from container
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-02-21 16:05:53 +00:00
Rob Bradford
55b8a2182b scripts: dev_cli.sh Support building container before use
If `--local` is provided or if the version is not available then build
the container before use. This allows combining updates to the
Dockerfile with a full CI run.

Drop the "--dev" parameter as we only support one container type for
simplicity.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-02-21 16:05:53 +00:00
Rob Bradford
b1f61d7286 scipts: dev_cli.sh: Remove "ensure_latest_ctr" from build-container
It makes no sense to check for a container when building it.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-02-21 16:05:53 +00:00
Rob Bradford
7e22786b2c scripts: dev_cli.sh: Remove unused --unattended
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-02-21 16:05:53 +00:00
Rob Bradford
eade9d8b87 scripts: dev_cli.sh: Don't surround $exported_volumes
This leads to '' which docker doesn't handle.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-02-21 16:05:53 +00:00
Rob Bradford
1a5b94ee0e scipts: dev_cli.sh: Reformat script for consistency
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-02-21 16:05:53 +00:00
Rob Bradford
2805e7b1dc scripts: dev_cli.sh: Ensure correct quoting in bash script
Use quotes to correctly enclose variables for prevent globbing or
incorrect splitting.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-02-21 16:05:53 +00:00
Rob Bradford
5447451921 scripts: Rename virtiofsd build directory
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-02-21 10:42:36 +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
e3bb822c4e scripts: Use new virtiofsd url for Rust version
The old URL redirects to this one.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-02-21 10:42:36 +00:00
Rob Bradford
5d55070ceb scripts: Use date tagged docker container in dev_cli.sh
This allows more predictable use of the container.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-02-18 14:09:41 +00:00
Rob Bradford
36852795e4 tests: Bump version of virtiofsd-rs in use to latest tagged
Binary is renamed but for clarity continue using the old name for our
tests.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-02-17 17:53:14 +00:00
Bo Chen
1025783973 scripts: Remove obsoleted env variable "cflags" and "target_cc"
To run unit tests correctly on musl target, We don't need to provide
specific "CFLAGS" or "TARGET_CC", as long as we use the correct build
target `*-linux-musl` with the "cargo test" command.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-02-17 14:14:38 +00:00
Bo Chen
1cf73c83e2 scripts: Generate performance metrics with the dev container
Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-02-17 14:14:38 +00:00
Henry Wang
1c18d124dc scripts: Add more huge pages for AArch64 integration test
Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2022-01-18 18:00:00 -08:00
Henry Wang
7a42ce9310 scripts: AArch64: Build SPDK NVMe before running integration tests
The SPDK-NVMe is needed for the integration test for vfio_user.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
Signed-off-by: Bo Chen <chen.bo@intel.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
Sebastien Boeuf
482e1ca435 scripts: Pin OVMF EDK2 version
By pinning the OVMF version, we will be able to update the EDK2 fork
with a new version without potentially breaking our Cloud Hypervisor CI.

Once the new version is ready on the EDK2 fork, we'll be able to update
Cloud Hypervisor codebase, replacing the fixed version with the latest,
as well as replacing OVMF.fd with CLOUDHV.fd. This is because we'll
start building from the new target CloudHvX64.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-01-18 10:21:51 +01:00
Bo Chen
5b05e0cdcd scripts: Remove use of "integration_tests" feature
Given integration tests don't have special annotations, all our
integration test scripts do not need to carry special flags when running
`cargo test`. This commit also removed the "test::" prefix for
pattern-matching different set of integration tests.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-01-10 10:29:07 +01:00
Bo Chen
430f72f96c scripts: Use cargo build-in options to run unit tests only
In this way, we don't need to rely on feature gates to exclude
integration tests from running.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-01-10 10:29:07 +01:00
Muhammad Falak R Wani
7cc1643782 scripts: create-cloud-init: use rm -f instead of rm
Ignore non-existing file instead of bailing out.

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
2022-01-05 11:02:20 +01:00
Rob Bradford
07756aa8fb tests, README: Bump kernel fork to 5.15.12
This updated tree now includes a fix for virtio-net regression that was
present in 5.14:

commit 732b74d647048668f0f8dc0c848f0746c69e2e2f
Author: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Date:   Sat Oct 9 05:17:53 2021 -0400

    virtio-net: fix for skb_over_panic inside big mode

    commit 126285651b7f ("Merge ra.kernel.org:/pub/scm/linux/kernel/git/netdev/net")
    accidentally reverted the effect of
    commit 1a8024239da ("virtio-net: fix for skb_over_panic inside big mode")
    on drivers/net/virtio_net.c

    As a result, users of crosvm (which is using large packet mode)
    are experiencing crashes with 5.14-rc1 and above that do not
    occur with 5.13.

    Crash trace:

    [   61.346677] skbuff: skb_over_panic: text:ffffffff881ae2c7 len:3762 put:3762 head:ffff8a5ec8c22000 data:ffff8a5ec8c22010 tail:0xec2 end:0xec0 dev:<NULL>
    [   61.369192] kernel BUG at net/core/skbuff.c:111!
    [   61.372840] invalid opcode: 0000 [#1] SMP PTI
    [   61.374892] CPU: 5 PID: 0 Comm: swapper/5 Not tainted 5.14.0-rc1 linux-v5.14-rc1-for-mesa-ci.tar.bz2 #1
    [   61.376450] Hardware name: ChromiumOS crosvm, BIOS 0

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-01-04 18:07:35 +01:00
Rob Bradford
eea2907daf build: Use OVMF binary released from edk2 repo
Fixes: #3415

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

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2021-12-04 23:04:32 +01:00
Michael Zhao
ac25172176 scripts: Fix an error in virtiofsd build commands
Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2021-11-30 10:04:38 +01:00
Muminul Islam
bbefbe9273 tools: Add a script to check image compatibility
This script checks if an image is compatible with Cloud Hypervisor.
At first, it detects the image type(raw or qcow2),
partition type whether it is DOS or GPT.
Then it mounts the image and checks if VIRTIO Configs
are enabled in the kernel config. In the end, it provides
a message about the compatibility of the image.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2021-10-05 14:40:10 +01:00
Muminul Islam
6454c677d0 scripts: populate build and test features based on hypervisor
Signed-off-by: Muminul Islam <muislam@microsoft.com>
2021-09-29 15:02:50 +01:00
Muminul Islam
ca4857b5e6 scripts: check hypervisor before running the test
Add two more checks if the hypervisor value is correct.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2021-09-29 15:02:50 +01:00