Commit graph

308 commits

Author SHA1 Message Date
Vikram Auradkar
1b32084a56 crosvm: Enable default features on windows.
The patch makes usb feature no-op on windows as USB pass-through is
not supported on windows.

BUG=b:241251677
BUG=b:213149155
TEST=tools/presubmit

Change-Id: Id82d4c732a86e782695d2af698cc08e8e3fd2d35
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4006819
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-11-07 23:03:25 +00:00
Ryuichiro Chiba
df7a2e51bf e2e_tests: Add a tool to dev_container and guest rootfs
Add a tool used in vsock tests to dev_container and guest rootfs

BUG=b:254375643
TEST=`./tools/presubmit` with the new guest rootfs on the new
dev_container

Change-Id: I135e6d2d413bedffef0fd69edd4ab14080429e3a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3974349
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Commit-Queue: Ryuichiro Chiba <chibar@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-11-07 04:00:40 +00:00
Dennis Kempin
7eadfac122 vhost: Move tests into an integration test
The tests require access to vhost syscalls which are not available
in all environments and are not suitable for unit tests.

BUG=b:244623767
TEST=presubmit

Change-Id: I2b6320d005da8966adab3f016237fedf1361055a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4004981
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
2022-11-04 06:49:36 +00:00
Dennis Kempin
3375878f14 Move hypervisor::kvm tests to integration tests
These tests require kvm to pass and are not suitable for a unit
test.

In order to move the test, KvmVm::create_vcpu had to be renamed
to prevent conflicts with the trait function VcpuX86_64::create_vcpu,
implemented for the same type.

The aarch64 variant does not actually run in CI since the tests
do not pass in the emulated aarch64 environment. So the
DO_NOT_RUN_AARCH64 flag remains.

BUG=b:244623454
TEST=presubmit

Change-Id: I79bba3926a38d19350e2fd3c7bfa4662499223e5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3999799
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-11-03 23:19:11 +00:00
Dennis Kempin
b50f6580a2 test_config: Cleanup and enable some video crates
Some of these flags were no longer necessary since we now split
between unit and integration tests.
Others could be enabled by adding some missing dependencies.

BUG=None
TEST=presubmit

Change-Id: Ife5b09a4ee8b27885ee2042d5d93447e8d4deedd
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4004345
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-11-03 23:03:54 +00:00
Dennis Kempin
009cb53c76 Rename integration_tests to e2e_tests
Cargo already uses the term 'integration test' for tests living
in the tests/ directory of a crate.

To prevent confusion, rename our 'integration_tests' crate to
'e2e_tests'.

BUG=None
TEST=presubmit

Change-Id: Icfa819eaed08be54ab0f36092f1ba367f3f1ce88
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4004977
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
2022-11-03 22:49:39 +00:00
Vikram Auradkar
d8f3e272df tools: Call clippy for mingw64 from presubmit
BUG=b:257249038
TEST=CQ

Change-Id: I6331bf60666b8583aeb11eae3e245d4f0e0e528b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4000812
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-11-03 18:36:41 +00:00
Vikram Auradkar
90a92c697d tools: Add --platform arg to tools/clippy
BUG=b:257249038
TEST=CQ

Change-Id: Ife9a917b82508a97beda6c50e8d3d71dccfa520d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4000811
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-11-03 18:36:29 +00:00
Dennis Kempin
a7b5a94480 tools/cl upload: Add a few convenience flags
--try: set CQ+1
--autosubmit: Set Auto-Submit and CQ+1
--submit: set CQ+2
--reviewer: Set a username as reviewer

BUG=None
TEST=This CL was uploaded with:
tools/cl upload --autosubmit -r dverkamp

Change-Id: I1ec9834d2f5d365eaa500e8e5915c77a4f066c6b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3997873
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-11-02 20:20:47 +00:00
Dennis Kempin
389a02462d dev_container: Install tmux and mold
tmux can be used to run presubmit checks in parallel:

  $ tools/presubmit --tmux

And mold is a faster linker that will be used for experiments.

BUG=None
TEST=None

Change-Id: Ie332d7285aa94d9072e201a3cac825337ae825cb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3997872
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-11-02 01:56:48 +00:00
Dennis Kempin
a0dcf8ab13 Generate constants.json offline
The constants.json file is generated for compiling seccomp polices,
but is only ever added to in newer versions of linux.
Generating them in build.rs will cause the seccomp compiler to only
understand constants and syscalls available on the build machine
and fail if policy files try to allow syscalls not available.

Putting the constants in version control will allow us to compile
the policies regardless of how old the kernel headers on the build
machine are.

BUG=b:235858187
TEST=presubmit

Change-Id: I1cfbb38f4687eb68b141f62c1c5fe6104b3f6456
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3988899
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
2022-11-02 00:13:08 +00:00
Dennis Kempin
b28d5a963d Fix winetricks install and build new container
Uprevs the container version to include the newly added
winetricks.

Fixes /dev/kvm permissions.

BUG=None
TEST=CQ

Change-Id: I019178f103068d3ae0dc048180a14c8786e738e0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3994884
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-11-01 19:04:35 +00:00
Dennis Kempin
10a9c3304b Simplify cargo-doc
We no longer need to selectively disable features or set the
CARGO_DOC env var to successfully build crosvm.

BUG=None
TEST=None

Change-Id: Ib997533c79340e3330a80633c4e8a81cbfb22ab6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3988653
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-10-31 21:33:33 +00:00
Dennis Kempin
45b5c13047 Make common crates part of the crosvm workspace
This greatly simplifies and speeds up compilation
and clippy times.

This ChromeOS-side building these crates has been
updated to copy the source out of the source tree
so that they will compile as a separate workspace.

BUG=b:256020427
TEST=presubmit

Change-Id: I2e0f1f6724924d6bdd70ea28d7777df7966cf724
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3988324
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-10-31 21:33:33 +00:00
Dennis Kempin
278e5ffeba test_runner: Add separate cargo target dir for each platform
Using the same CARGO_TARGET_DIR for all builds prevents us from
building for platforms in parallel, since cargo will lock the
directory to only run one build at a time.

Use the same directory for clippy as well, and ensure that
clippy won't invalidate caches created by run_tests.

This reduces the build time for tools/presubmit by about 50%.

Another advantage is that rust_analyzer and run_tests will no longer
block each other or invalidate the cache when run with different
feature flags.

Note: This introduces two subtle changes to the build that required nit
fixes:
- build.rs files are now run through clippy as well
- common/* crates are now also built for the target architecture instead
  the host.

BUG=None
TEST=tools/presubmit

Change-Id: I8da9ef53418c0b15827d512a04e77828621aef88
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3984416
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-10-31 21:33:33 +00:00
Dennis Kempin
06c98828c0 run_tests: Allow integration tests to run natively on windows
This should re-enable windows integration tests in CI.

BUG=b:255366812
TEST=CQ

Change-Id: I869e6b17ef00bdcbbd32758787345ea893996a7f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3988894
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-10-29 14:53:14 +00:00
Alexandre Courbot
0fbe82466f tools/health-check: ignore more video file types for newline check
We are going a add a couple of .vp9 and .ivf files, these are binary and
do not need to end with a newline.

BUG=b:214478588
TEST=./tools/health-check passes with crrev.com/c/3875043

Change-Id: Ic4e434616ed880dbff5dae76108e8d6692d80584
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3990145
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
2022-10-28 03:21:59 +00:00
Vikram Auradkar
2653304c8e tools: Install winetricks
This will help us running audio tests under wine.

BUG=b:237011316
TEST=presubmit

Change-Id: Iba297159291abd135fb1972a19fa5b5c216fa956
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3971028
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2022-10-27 18:11:46 +00:00
Zihan Chen
988858b66b infra: Add build_chromeos_container builder
Add a new builder to build crosvm in crOS tree, and all the
depencies of this new builder.

BUG=b:240692674
TESTED=led get-builder luci.crosvm.ci:chromeos_amd64-generic | led edit-cr-cl https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3966928 | led edit-recipe-bundle | led edit -r build_chromeos_hatch | led launch

Change-Id: Id2f284139922916edd2dd584f576da9fb3445518
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3966928
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
2022-10-26 23:05:08 +00:00
Dennis Kempin
bf4cad131d reland: dev_container: Fix podman and enable unprivileged containers
reland note: Added wineboot for Dockerfile.user, since it prepares
directories for wine on a per-user basis.

To enable podman, the Dockerfile has been split into a root
run Dockerfile and one that adds a non-root user.

The following combinations have been tested:

./tools/dev_container -v --clean --podman --unprivileged
./tools/dev_container -v --clean --podman
./tools/dev_container -v --clean --unprivileged

And warnings have been added to ensure users are aware that
the only fully supported variant is running a privileged
docker container:

./tools/dev_container -v --clean

The unprivileged containers will allow us to validate if
unit tests require privileged system access.

BUG=None
TEST=See above

Change-Id: Ifd70c1e30ef266e39bf517e315dc88fccecc8a62
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3983255
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
2022-10-26 20:10:25 +00:00
Dennis Kempin
2f5eb3ac64 Extract devices integration tests
This change moves most ircchip tests into an integration test.
These tests rely on kvm, and if they do not - reuse much of the
test code from each other, so they need to move together.

Note: This removes the apic_timer test. The test has been disabled
for a while due to it's use of sleep in unit tests.

We cannot support it as an integration test either, since it combines
the sleep with a FakeClock. userspace.rs swaps the real clock for
FakeClock when compiled with cfg(test), but integration tests do not
compile with cfg(test), so we cannot use the FakeClock.

The biggest side-effect is faster execution as we can run all other 300+
tests in parallel and via user-space emulation, significantly cutting
down on the test times. It also allows those tests to run in a
podman container.

BUG=b:244620308
TEST=CQ

Change-Id: I1728a736d27e924daf228752711435885dacfa6a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3977111
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-10-26 17:53:08 +00:00
Dennis Kempin
a0e6a664fc Revert "dev_container: Fix podman and enable unprivileged containers"
This reverts commit 6a2b1fda85.

Reason for revert: Broke mingw64 builds

Original change's description:
> dev_container: Fix podman and enable unprivileged containers
>
> To enable podman, the Dockerfile has been split into a root
> run Dockerfile and one that adds a non-root user.
>
> The following combinations have been tested:
>
> ./tools/dev_container -v --clean --podman --unprivileged
> ./tools/dev_container -v --clean --podman
> ./tools/dev_container -v --clean --unprivileged
>
> And warnings have been added to ensure users are aware that
> the only fully supported variant is running a privileged
> docker container:
>
> ./tools/dev_container -v --clean
>
> The unprivileged containers will allow us to validate if
> unit tests require privileged system access.
>
> BUG=None
> TEST=See above
>
> Change-Id: I185b1d9c3829674986305b0e72a39b1a4ba11b98
> Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3971029
> Reviewed-by: Zihan Chen <zihanchen@google.com>
> Commit-Queue: Dennis Kempin <denniskempin@google.com>
> Reviewed-by: Dennis Kempin <denniskempin@google.com>

Bug: None
Change-Id: Id57686ed869abcfb54431aa328c54234b9465eb7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3979385
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
2022-10-26 03:06:26 +00:00
Dennis Kempin
6a2b1fda85 dev_container: Fix podman and enable unprivileged containers
To enable podman, the Dockerfile has been split into a root
run Dockerfile and one that adds a non-root user.

The following combinations have been tested:

./tools/dev_container -v --clean --podman --unprivileged
./tools/dev_container -v --clean --podman
./tools/dev_container -v --clean --unprivileged

And warnings have been added to ensure users are aware that
the only fully supported variant is running a privileged
docker container:

./tools/dev_container -v --clean

The unprivileged containers will allow us to validate if
unit tests require privileged system access.

BUG=None
TEST=See above

Change-Id: I185b1d9c3829674986305b0e72a39b1a4ba11b98
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3971029
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2022-10-26 02:06:06 +00:00
Dennis Kempin
b896b869e4 base: Extract integration tests
The extracted tests rely on access to system devices
or global state that prevent them from being run in parallel
or in restricted environments.

As an integration test they will be executed separately and
single threaded.

Updates the test runner to ensure integration tests are actually
run single threaded as intended.

BUG=b:244623061
TEST=./tools/run_tests base:\* --repeat 100 -p x86_64/mingw64/aarch64

Change-Id: I4267b9f79055208aca86796d902da251816bcada
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3971025
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-10-24 22:49:29 +00:00
Bastian Kersting
606bebceaf Bump scudo and enable corresponding feature
This CL bumps to the latest Rust-scudo version and re-enables
the corresponding feature, after it was disabled in crrev/c/3964927.
The fix introduced in https://github.com/google/rust-scudo/pull/6 was
submitted and is part of the 0.1.3 release of scudo.

BUG=None
TEST=health-check

Change-Id: I9c658cde9ea2d4cdf0d03110e2d015c8339e5267
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3973490
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2022-10-24 17:40:47 +00:00
Dennis Kempin
89f0a34eff Disable scudo feature
The feature will trigger rebuilds on every cargo build invocation.
A fix is submitted: https://github.com/google/rust-scudo/pull/6
Until then, let's disable it.

BUG=None
TEST=health-check

Change-Id: Id328bd976b65674b50f9845490eb5083008781e8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3964927
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-10-20 23:11:58 +00:00
Dennis Kempin
ca2049f982 Use previous bindgen version
The latest version is breaking minijail bindings and needs changes
to accomodate, which we cannot do until ChromeOS is updating it's
bindgen version as well.

BUG=None
TEST=make -C tools/impl/dev_container crosvm_dev &&
./tools/dev_container cargo build

Change-Id: I86476e4260154caf2aaf1b210490d466961b827f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3964923
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
2022-10-20 22:08:37 +00:00
Dennis Kempin
6d0d597b5f gfxstream: Enable the feature upstream via stub backend
This won't be functional at runtime, but does allow us to at
least compile with gfxstream enabled.

BUG=b:244618506
TEST=presubmit

Change-Id: I72a63976310e635964645a1265a22518fc6cb694
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3967431
Reviewed-by: Kaiyi Li <kaiyili@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-10-20 20:22:23 +00:00
David Stevens
aad6a554dc tools/cl: add confirmation for multi-cl uploads
Add a confirmation if multiple changes are being uploaded. This can help
catch errors such as being based on the wrong branch.

BUG=None
TEST=manual testing

Change-Id: Ia7ea75564628e25b09eda894bf45bd2a3f9e4f26
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3960214
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: David Stevens <stevensd@chromium.org>
2022-10-20 00:54:27 +00:00
Eval EXEC
b951ca684f fix bindgen installation instruction
The bindgen cli tool has changed to a workspace member of rust-bindegen
repo: https://github.com/rust-lang/rust-bindgen/commits/master/bindgen-cli

Change-Id: Ie3248d61919fdb742e49f57a10f5db827cd8230d
Signed-off-by: Eval EXEC <execvy@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3964808
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-10-18 19:50:46 +00:00
Zihan Chen
a95adc3124 tools/cros_container: Add experimental CrOS builder container
This allow GCP cloud build to fresh and incrementally build updated
docker containers to test upstream crosvm in CrOS tree efficiently.
Currently this resides in an experimental GCP project while being WIP.

TEST=Both fresh and incremental can build, emerge-hatch in pulled container
BUG=b:240692674

Change-Id: Id54014f347c00e4dae16674b430159dd8cfa67aa
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3934983
Commit-Queue: Zihan Chen <zihanchen@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2022-10-17 21:29:57 +00:00
Dennis Kempin
849f1558cf Enable the video-encoder feature upstream
This feature can be enabled now that we have ffmpeg enabled.

BUG=b:244618273
TEST=presubmit

Change-Id: Ic1c36ffa46729fcbdc408135f4167c49042ea56a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3953083
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2022-10-14 20:31:19 +00:00
Dennis Kempin
5a32a2d198 Enable vaapi feature upstream
The feature can be built but not tested without access to an intel
GPU.
To enable the build, the testvm and dev container are updated to
include libva.

BUG=b:244619376
TEST=presubmit

Change-Id: Ia8c4dc46ccbcd244bf57441f2c550a6b73c67b1c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3946027
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2022-10-14 20:31:19 +00:00
Dennis Kempin
f91a9f673a Remove plugin-render-server feature
This feature was used for experiments and is no longer needed.

BUG=b:253086623
TEST=presubmit

Change-Id: Id8ece0e1e8588a5716794961c359482bc60dc729
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3946029
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-10-14 20:31:19 +00:00
Dennis Kempin
bb9a3a5572 Document feature flags and introduce new feature sets
The feature flags are documented using the document_features
crate.
Each platform gets one feature set that enables the features that
are built and tested for that platform.

The only functional difference is that the plugin feature is now
enabled in clippy. Otherwise this should be a no-op.

BUG=b:243894033
TEST=presubmit && cargo doc

Change-Id: Ia910bc2670696172daedcc503f7ad5844a844964
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3946024
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-10-14 20:31:19 +00:00
Dennis Kempin
e8842561c6 Enable a couple of trivial features in upstream
Also fixes health-check to recognize that the proto optional
crate is referred to by other features.

Change-Id: Ie0e8f9ee8960ccb31539eeb2604e8c9654798de4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3943594
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-10-13 17:24:22 +00:00
Daniel Verkamp
915dfb2f84 tools/presubmit: update mingw64 build steps
This now requires --platform instead of --target, per the error message
from tools/run_tests:

  Warning: Setting --target for running crosvm tests is deprecated.
  Use --platform instead to specify which platform to test for.

BUG=None
TEST=tools/presubmit

Change-Id: I0e52f97273774b968617007c098aa80d33103263
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3950716
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-10-13 16:25:38 +00:00
Vikram Auradkar
44a07970cb sandbox: upstream sandbox
The crate depends on a prebuilt library.

BUG=b:213170185
TEST=presubmit

Change-Id: I810baa14afa53e88f6b2a739481a6d3656efc2e5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3784338
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-10-12 21:05:39 +00:00
Vikram Auradkar
c4a4dc9b23 net_util: Add windows slirp support
BUG=b:237011316
TEST=presubmit and tested in wine

Change-Id: I1b6160142b8161d4b09d3fd98dfacde354e238b4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3934818
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-10-11 15:25:38 +00:00
Dennis Kempin
2abc17423b Add health-check to verify that features are build upstream
We want to move towards enabling all features upstream. To
verify we are not disabling any, nor adding any disabled
features, this check will verify that all features are
included in one of our composite features for each platform
we are building upstream.

BUG=None
TEST=health-check

Change-Id: I076c7b79143b40e59d8806ad2286ac7e357b1fc1
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3938628
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
2022-10-10 19:55:10 +00:00
Daniel Verkamp
84761cbff3 tools/health-check: fix extra --color arg with --nightly
The nightly rustfmt command had an extra .with_color_flag() call,
duplicating the one below. Drop it to fix the error message when using
tools/fmt --nightly:

  Option 'color' given more than once

BUG=None
TEST=tools/fmt --nightly

Change-Id: I7158e4394167fa89d78f9eb38beb0b827471e3a9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3942707
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
2022-10-10 19:34:40 +00:00
Vikram Auradkar
1acc0a28d9 prebuilts: move prebuilts tests under tests
BUG=b:246987526
TEST=presubmit

Change-Id: I86eed7c84f7e21eb7155695489ee9446f999dc1d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3936733
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-10-07 15:54:37 +00:00
Daniel Verkamp
b60140b37e tree-wide: use "crosvm" capitalization everywhere
Fix a few stray references to "CrosVM" and "CrosVm" so that we refer to
the crosvm project with consistent capitalization.

BUG=None
TEST=None

Change-Id: If5c3c131774d6e5da1d27466810642aec3cb42ac
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3938640
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2022-10-07 01:10:12 +00:00
Dennis Kempin
8a38e8f36e Re-enable video-decoder feature
This was disabled in https://crrev.com/c/3835500 due to the lack
of ffmgeg 5.0 in our dev containers.
The container has since been upgraded in https://crrev.com/c/3892621

BUG=b:244619658
TEST=presubmit

Change-Id: Ia2bd41fbd780bad7d7706e0ffe7554e202ec0eb1
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3907377
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-10-06 18:28:56 +00:00
Vikram Auradkar
eb52905d36 prebuilts: Add helper crate to download prebuilts
BUG=b:246987526
TEST=presubmit

Change-Id: I1e54cf4a176d48c30340d6e7925733d6a1f4ce93
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3784337
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-10-04 20:22:47 +00:00
Zihan Chen
646b6ea8fa crosvm-fuzz: Migrate crosvm-fuzz to cargo fuzz
Fuzzer targets can be ran with
cargo +nightly fuzz run --fuzz-dir crosvm-fuzz --features
upstream-fuzz <target>

This should enable us to move fuzzing to anywhere including
ClusterFuzz while maintain compatibility with cros infra.

TEST=`cargo fuzz` won't crash in first 30s,
`USE="asan fuzzer" emerge-hatch crosvm` builds,
`/build/hatch/usr/libexec/fuzzers/crosvm_qcow_fuzzer` won't
crash in first 30s
FIXED=b:245007212
BUG=b:244631591

Change-Id: I4b262ee1a6a90247dea96347c55a3849af793bec
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3905095
Auto-Submit: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2022-10-03 16:12:15 +00:00
Dennis Kempin
891455563b system_api: Add copy of ChromeOS's system_api
Adds a script that copies the bindings we need upstream. We cannot
use the original repository, as it's part of the large platform2 git
repository, and the original build.rs depends on ChromeOS tooling to
generate these bindings.

So instead, this change adds a script that can be called from a
chromiumos checkout of crosvm to update the upstream bindings.

This allows us to enable certain features that talk to ChromeOS
dbus services. They won't be functional upstream, but at least we
can compile and test the code.

To make things more consistent, we no longer replace the crate
with the ChromeOS version when building for ChromeOS.

BUG=b:244618505
TEST=presubmit

Change-Id: I504cbf6d12b0cb50d9935f5e49b7fa72b692d45c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3919814
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-09-28 18:13:00 +00:00
Yiwei Zhang
2d1d44b6df handle new CV run ended message
As announced in http://g/luci-announce/d5-USDV4YXQ, the run pass
and failure message will be changed as part of CQ -> CV migration.
This CL allows the tool to handle both old style and new style
messages.

Change-Id: Ia06c05eeff321b26af92dc67bd41747e60d9b071
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3914865
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
2022-09-23 16:58:44 +00:00
Dennis Kempin
3164f92428 power_monitor: Enable feature in all-linux
To enable this feature, we copy the required proto file from
ChromeOS. Not a great solution, but better than leaving the
code uncompiled in upstream.

We could consider downloading the file from gitilies with
a fixed sha that is manually upreved. But unfortunately
downloading things in build.rs is not trivial without adding
a ton of dependencies for the reqwest crate.

BUG=b:244619797
TEST=presubmit

Change-Id: I401917134471909be80a281454bc64dd27799afe
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3907373
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-09-20 21:06:47 +00:00
Dennis Kempin
97da569f79 tools/run_tests: Split unit tests from integration tests
Changes how unit tests are executed. Instead of running all tests on
a selected target (i.e. host or a VM), we will select a platform to test
and run_tests will use a separate target for unit tests than for
integration tests.

e.g. instead of running all tests in the aarch64 vm:

./tools/run_tests --target=vm:aarch64

We can now run

./tools/run_tests --platform=aarch64

to run unit tests via user-space emulation on the host, and only
integration tests on the VM.

This will eventually apply to x86 testing as well, so tests can be
run in an unprivileged environment (e.g. podman).

A new TestOption has been added to mark unit tests that have system
interactions that require them to be run like integration tests in a VM.
These should be fixed.

You can also use --unit-tests and --integration-tests to run just one
type of tests. Running unit tests only takes a few seconds on most
platforms since we can use user-space emulation.

BUG=b:247139912
TEST=./tools/run_tests
./tools/run_tests -p aarch64
./tools/run_tests -p mingw64
./tools/run_tests -p armhf

Change-Id: Icd0c502623f1889906d199e752b3eccb7de76dc0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3902688
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-09-20 18:27:23 +00:00