Commit graph

56 commits

Author SHA1 Message Date
Anton Romanov
bf27367aab Revert "Do not run cros_async tests on armhf"
This reverts commit 15a4ee3200.

Reason for revert: Should pass now

Original change's description:
> Do not run cros_async tests on armhf
>
> The test has been flaking with segfaults occasionally.
>
> BUG=None
> TEST=presubmit
>
> Change-Id: Ifbfee7e7ed5de91b7bdf9b25db7983139951f81f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3606751
> Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
> Tested-by: kokoro <noreply+kokoro@google.com>
> Commit-Queue: Dennis Kempin <denniskempin@google.com>

Bug: None
Change-Id: I85d0885ce9f9fa3d46dd86536a5a20a71ffbbabb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3626010
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Anton Romanov <romanton@google.com>
2022-05-03 22:48:46 +00:00
Daniel Verkamp
55a5b54bf2 base: clean up vestigal sys_util references
The sys_util crate has been merged into base, but a few places still
refer to the old name. Fix or remove them as appropriate.

BUG=b:227226222
TEST=tools/presubmit --all

Change-Id: Icf9b57aff672b7c1afec768c9694e059f0f9a43d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3621205
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2022-05-02 20:16:18 +00:00
Anton Romanov
50d2f5599d crosvm: test_runner: Allow arch to be specified separately for TestTarget
Fixes cases when we use target vm:aarch64 but arch armhf and test_runner
picks up tests for aarch64

BUG=none
TEST=run and made sure armhf-disabled tests are not picked up

Change-Id: I4d0734bb6320fc698bf16adc59de5e03b00a4a68
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3617081
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Anton Romanov <romanton@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Anton Romanov <romanton@google.com>
2022-04-30 01:10:15 +00:00
Dennis Kempin
793004384d infra: Add recipes and example builder
Following the onboarding instructions. If everything works we should
have a builder at:
https://ci.chromium.org/p/crosvm/builders/ci/Example%20Builder

BUG=chromium:1300370
TEST=None

Change-Id: I98eeaad6ccffd228fdee116e664c9d2760708e24
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3500817
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-04-26 19:26:47 +00:00
Dennis Kempin
15a4ee3200 Do not run cros_async tests on armhf
The test has been flaking with segfaults occasionally.

BUG=None
TEST=presubmit

Change-Id: Ifbfee7e7ed5de91b7bdf9b25db7983139951f81f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3606751
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-04-26 17:10:09 +00:00
Anton Romanov
13c21bdd12 crosvm: tools: Skip non-scripts in tools/
Otherwise tools/[fmt, health-check] crash and burn trying to decode
vim's swap/undo files as utf8 text

BUG=none
TEST=kokoro

Change-Id: I4ebd3fe33484353bddb0ae12054c47ca3ecd6b89
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3598242
Auto-Submit: Anton Romanov <romanton@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-04-20 23:50:38 +00:00
Dennis Kempin
a62858f89d Ensure python doc tests failures will fail health-check.
And fix a nit in the existing tests to make it pass.

BUG=b:219965702
TEST=presubmit

Change-Id: I65fb98b04d7042755930dd34913f679fa129c88c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3594248
Reviewed-by: Maciek Swiech <drmasquatch@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-04-20 19:47:49 +00:00
Noah Gold
35290a48c0 cros_async: enable tests on Windows.
BUG=b:213147081
TEST=bots

Change-Id: I88ac2eb0c4c9b4f3f77e2b3c0cc994979a14d14c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3585009
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
2022-04-20 18:56:54 +00:00
Dennis Kempin
ba4adc0efb Add python presubmit checks
This change adds python type and formatting checks and
consolidates code health checks in ./tools/health-check.

Dealing with relative imports in python is tricky, so
we are making ./tools/impl a proper package with no
directly executable files.

Some of the bash shorthands in ./tools had to be converted
to python for this.

To make the new checks pass, we run the formatter and fix
some mypy type checks.

TEST=./tools/health-check
BUG=b:218559722,b:219965702

Change-Id: Ie18d3d6dd2f5a033141e167a6e1aa762791941d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3558592
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-04-15 19:22:53 +00:00
Dennis Kempin
335aaf6ad2 common.py allow absolute paths to programs
This would previously trigger a program not found error.

BUG=None
TEST=Added doctest

Change-Id: I357c44d2b9ce7b2a3240958c5c88008a29164baa
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3587885
Reviewed-by: Anton Romanov <romanton@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
2022-04-15 18:42:27 +00:00
Dennis Kempin
f334e19ffc merge bot: Do not check result of git config
If the value is not set, treat it as empty.

BUG=None
TEST=Tested by removing the config setting locally.

Change-Id: Ia160285c03bffcf7a332f3891587e7ada2228623
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3585860
Reviewed-by: Anton Romanov <romanton@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
2022-04-14 22:43:59 +00:00
Dennis Kempin
b193738186 New merge bot
The new merge bot is written in python to allow us to improve the
merge process.

The new process is as follows:
- The merge bot will only create a new merge when the previous
  ones have been submitted.
- When the bot creates a new merge, it'll split the merge commits
  into smaller changes to make bisection easier.

This allows us to only ever deal with one set of merge commits
instead of piling on new merges day after day.

For dry runs, the new process is:
- The bot will check existing dry runs and abandon them if the CQ
  is done.
- The bot will vote Verified+-1 to indicate if the dry run passed.
- If no more dry runs are active, it'll create a new one.

This ensures we always have a dry run in the CQ and can easily see
in gerrit which ones have passed.

The python script will also allow us to add convenience features
for oncall for retrying bratches, etc.

BUG=b:227347397
TEST=The script can be run locally:
./tools/chromeos/merge_bot update-merges
./tools/chromeos/merge_bot update-dry-runs

Change-Id: I51fc0741f5032868ad07f5e926e570e29cc461fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3583254
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-04-14 21:38:07 +00:00
Anton Romanov
24a226169d Run some win64 tests with wine as part of presubmit
docker container size increases to ~4.7-8 Gb

TEST=./dev_container --hermetic ./tools/presubmit
BUG=none

Change-Id: I49dc03182f6ac5c29e0174618cc3864e073a2eb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3499264
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Anton Romanov <romanton@google.com>
Auto-Submit: Anton Romanov <romanton@google.com>
2022-04-06 19:45:49 +00:00
Vikram Auradkar
de1f006a08 Enable clippy on windows
Also fixes few warning introduced during upstream which linux clippy
run does not catch.

test: py tools\clippy
bug: 226966790
Change-Id: I6979f87be5d6d34727afabafcaccb57631975567
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3553401
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-03-31 16:09:00 +00:00
Vikram Auradkar
2b43443edc Enable vmm_vhost windows tests
Does couple of things
- move tube under right directory
- cleanup cros_async dependency
- export tube module from base
- enable base windows tests
- add verbose flag to test runner

test: built on window and presubmit
bug: b:213151429
bug: b:213153157
Change-Id: I0d1906d7edcc3352db53325ea7527550eaf00895
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3550296
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-03-29 20:29:54 +00:00
Dmitry Torokhov
1dd97fadeb tools: fix reference to no longer existing install-deps.sh
install-deps is now a Python script, update the message to make user's
life easier.

BUG=None
TEST=./tools/presubmit

Change-Id: Id1eca4f5b1fb0066574b6b7c381c908e65d919e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3536892
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dmitry Torokhov <dtor@chromium.org>
2022-03-29 17:17:17 +00:00
Dennis Kempin
9fbf4987f0 Refactoring: Move win_(sys_)util
This executes the script in https://crrev.com/c/3537257

BUG=b:223206469
TEST=presubmit

Change-Id: I51176d02081a7130270cf1b2ebe7c58ef9056db3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3537258
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-22 22:23:41 +00:00
Dennis Kempin
4fa9b5147c Refactoring script: Copy sys_util(_core) to base
This will allow us to merge sys_util and win_sys_util.
The original source locations will remain until they
are moved into the ChromeOS source base.

See go/future-of-sys-util for details

BUG=b:22320646
TEST=run it

Change-Id: Ie1adcadba9d35f18cc7472dc78f05262114a726f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3536890
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-21 19:52:56 +00:00
Dennis Kempin
fd0b4cb74a Refactoring script to move common/base/ to base/
This is a prerequisite for sys_util* to move into the base
crate. The crate should never have been in common in the
first place since it is not shared.

BUG=b:223206469
TEST=python tools/contrib/cargo_refactor.py

Change-Id: I60115e0418c6980d7bf7ff624a3cc0a24e71a57d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3530502
Reviewed-by: Anton Romanov <romanton@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
2022-03-17 00:01:27 +00:00
Vikram Auradkar
4d88ee98d5 Upstream data_model
Test: cargo test
Bug: b:213147091

Change-Id: I9c73963e18591b8a9548e508f63bbb423f5aafa3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3515113
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-03-10 18:48:52 +00:00
Anton Romanov
90922be6d6 crosvm: Enable plugin feature in CI builds
BUG=none
TEST=cq

Change-Id: I201f5090c096912f61f2b461fc2f0be9621389a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3515213
Reviewed-by: Anton Romanov <romanton@google.com>
Auto-Submit: Anton Romanov <romanton@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-03-10 01:00:39 +00:00
Dennis Kempin
7f03a70790 Parallelize tools/fmt
cargo fmt will only format those files that are referenced by
crosvm. To really catch all files in our source tree, we need to
run rustfmt directly.

This will check files multiple times, since rustfmt will follow
included modules. But is still faster that cargo fmt.

To run these in parallel, this change adds some tools to common.py
for parallel execution of commands.

This reduces the fmt check time from ~9s to 1.5s.

I verified that we are actually catching all files now by adding a
newline to all .rs files in our sources tree. The formatter reverted
them all.

BUG=b:218559722
TEST=./tools/fmt

Change-Id: If721d837ebc9eee3ce28fa7f439ab0bcc0b993cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3474926
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-03-07 22:50:12 +00:00
Daniel Verkamp
a6f8814c7b tools/bindgen-all-the-things: add script to regenerate bindings
Add a framework for bindgen scripts.

This will be filled in when each binding is added in upcoming separate
commits.

BUG=b:218388029
TEST=None

Change-Id: I62363b49d92ceb5b54700589c2329daace7181b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3339804
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-03-03 23:47:03 +00:00
Vikram Auradkar
6b8e9c14cc Check for crlf line endings
With crosvm adding support for windows, we want to make sure that
the line endings are not crlf.

git hooks and configs will be added as a part of another change.

Bug: b:213146393
Test: Modified Cargo.toml to have crlf endings and ran the script.

Change-Id: Ie6f53a7c0687578546e63770bb98706e4315a520
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3495708
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-03-01 00:51:16 +00:00
Dennis Kempin
5fe0c34f8e TestRunner: Enable some no-op tests crates
Adding some conditional compilation flags so we do not need to
exclude them on each test run. None of there actually increase
the number of tests run, but gets us closer to being able
to run `cargo test --workspace`

BUG=b:218374759
TEST=./tools/presubmit --all

Change-Id: I181a84847fc09a4e1a6fb2b5f21538ebc400d607
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3453046
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-02-28 21:38:13 +00:00
Daniel Verkamp
acaa8859a9 Convert CRLF line endings to LF
dos2unix tools/impl/check_code_hygiene.py to fix line endings

BUG=None
TEST=git grep -I $'\r' # returns no results

Change-Id: I821cd8758da5f998310db00394cc1471aec2fa5d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3490740
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-02-25 23:02:59 +00:00
Vikram Auradkar
45f1a419d4 Make crates depend on base instead of sys_util
As we make progress on upstreaming sys_util, we do not want more
dependencies on sys_util added. This check helps in that cause.

With this change only files that are inside common can depend directly
on sys_util.

Test: python3 ./tools/impl/check_code_hygiene.py common/sys_util_core
Bug: b:213149154

Change-Id: I57a8cb9189d3263a4031338b302cb27da799f4de
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3473344
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-02-25 20:17:46 +00:00
Vikram Auradkar
ae5118f5c7 Enable windows tests for a few crates
Run tests for sys_util_core, poll_token_derive and balloon_control on
windows.

Using dotfiles to disable/serialize test runs of a subset of crates does
not work well with third party crates as it forces us to commit the dot
file to the crate.

The patch modifies and uses the script that runs linux tests.
This patch also allows us to
- build/test child crate even if parent crate has disabled build/test.
- avoid building crosvm if it is not explicitly specified.

RIP short lived .windows_build_test_skip. You allowed us to run noop
kokoro tests.

Test: py .\tools\impl\test_runner.py --arch x86_64
Bug: b:215610772
Change-Id: Icc6d04ffd7c0c33d4f60aeac16fc7d23881c387d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3459809
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-02-18 03:18:58 +00:00
Dennis Kempin
9b7471e51a tools/dev_container: Pythonify
Use the new common.py utilities to make turn this bash script into
python. The behavior should be the same.

BUG=b:218559770
TEST=./tools/presubmit

Change-Id: Id1412c2076089fd21f280959d6cde1f4cb64e163
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3469049
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-02-18 00:18:56 +00:00
Dennis Kempin
278849cbe1 test_runner: More flexible timeouts
Tests can now be marked as large to increase the timeout from it's
original 60s to 120s.
The test runner is also updated to detect if the test is running in
an emulated environment, and doubles the timeout for those.

BUG=b:218681921
TEST=./tools/presubmit --all

Change-Id: I95fc238dcd23a5035826f422752eaf0ca215706c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3469496
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Anton Romanov <romanton@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-02-16 22:54:17 +00:00
Dennis Kempin
27ecaad405 Pythonify clippy/fmt scripts and add common.py
We are replacing most of our bash tools with python versions so we
can support cross-platform development.

To facilitate writing shell-like scripts in Python, this CL adds
a common.py file to share common utilities. It curretly contains
tools to simplify shell-like command execution and argument parsing.

BUG=b:218559770
TEST=./tools/clippy && ./tools/fmt && ./tools/impl/common.py

Change-Id: I7f8b3523394973ed5c741b926fdc41e52133189f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3461240
Reviewed-by: Maciek Swiech <drmasquatch@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-02-15 22:01:58 +00:00
Dennis Kempin
5f46e21c02 Remove rutabaga_gfx_ffi from workspace
The crate requires special compilation flags that conflict with the
workspace flags.

We may want to consider moving it to common/ so the test runner can
compile it in a separate workspace.

This brings us one step closer to be able to run
`cargo build --workspace` with no excludes.

BUG=b:206689789
TEST=./tools/presubmit

Change-Id: Ice747ced00f81db0a8e05ff2bc43d4d0e323e456
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3453050
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-02-11 15:58:56 +00:00
Dennis Kempin
4d0436e74e Add DO_NOT_RUN_ON_FOREIGN_KERNEL option
While we can run armhf binaries on aarch64 or use user-space emulation
to run aarch64 tests on the x86 host, some tests will fail in that
scenario as they will interact with kernel APIs directly (e.g. kvm).

This will make it easier to distinguish 'do not run on armhf because
we haven't fixed the tests' from 'this test is not supported on
a foreign arch kernel and that is expected'.

It also enables a quicker method of running aarch64 tests with
user-space emulation.

BUG=b:218374759
TEST=./tools/dev_container ./tools/run_tests --target=host
--arch=aarch64

Change-Id: I81871e11d3b02ee1ed3bac88bada28fbba8a3f31
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3447292
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-02-10 22:04:18 +00:00
Keiichi Watanabe
70e41c106b devices: Drop vvu feature
Enable VVU feature unconditionally.
Since kokoro will start checking VVU code from this CL, clippy errors
are fixed.

In addition, the time limit of kokoro unit testing needed to be
increased because some time-consuming unit tests will start running on
aarch64 QEMU, which is really slow.

BUG=none
TEST=kokoro

Change-Id: I67437c060ff5ba9f690dcfc6e5c3dd155b95a785
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3450014
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
2022-02-09 17:08:32 +00:00
Dennis Kempin
bb27416ccb TestRunner: Clean up test options
This will still run the same tests as before, the options are just
more consistent now.

BUG=b:218374759
TEST=./tools/presubmit

Change-Id: I41a8730f6cfaf65a62aaa26c45e2c284f0356d33
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3447541
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-02-09 00:20:38 +00:00
Vikram Auradkar
7aa543ca35 Introduce code hygiene checks
The patch disallows any platform specific code in sys_util_core and
doesn't let sys_util compile on windows platform.

This ensure to some extent that we keep sys_util and it's dependency
sys_util_core independent of windows code.

check_code_hygiene is not foolproof.

Test: Ran the script against a modified file in sys_util_core containing
      string "target_os = "
      Tried to compile sys_util on windows.
Bug: b:215610772
Upstream-Crate: common/win_sys_util

Cq-Depend: chromium:3433709
Change-Id: Ideb45092a959dd347d966633c3bd4e82f842b1a8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3438709
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-08 20:59:24 +00:00
Vikram Auradkar
323006cf82 Move os independent files under a new crate sys_util_core
sys_util_core won't have OS specific features so that sys_util and
win_sys_util can depend on it.

Test: Presubmit
Bug: b:213149154
Upstream-Crate: common/win_sys_util

Cq-Depend: chromium:3433709
Change-Id: I863f7a6bc7549944b4d114cca6d7be04c3093fc3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3426380
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-08 20:59:24 +00:00
Dennis Kempin
9503e86ff4 Enable bit_field_derive tests
proc-macro tests run on the host, adding logic into the test runner
to accomodate for that.

BUG=b:218374759
TEST=./tools/presubmit

Change-Id: I83c853b9e28dae725d299509f7e3a07f56bd6ad8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3445531
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-02-08 17:08:52 +00:00
Dennis Kempin
e225a10959 Enable cros_async tests
Adds use_uring checks to a few more test cases that are using the
URingExecutor.

BUG=b:218374759
TEST=./tools/run_tests

Change-Id: Ie5822dea4f22c2e8cffab13549c07873e89129d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3443634
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-02-08 17:08:51 +00:00
Anton Romanov
cb3cabe3ba Upgrade rust toolchain version to 1.58.1
Pre 1.58.1 have CVE-2022-21658
Cros toolchain got upgraded to 1.58.1

BUG=None
TEST=cq

Change-Id: I2ce5a08b40bcc4895c4f2ecef83efd4162d67494
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3435385
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Anton Romanov <romanton@google.com>
2022-02-04 02:20:36 +00:00
Keiichi Watanabe
f46226d65a tools: dev_container: Install mdbook-linkcheck
Install https://github.com/Michael-F-Bryan/mdbook-linkcheck and bump up
the container version.

BUG=none
TEST=make -C tools/impl/dev_container crosvm_dev

Change-Id: I6ce95ddb66f93e23b5abac5ee1350ff8e3106073
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3428603
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-02-02 02:52:53 +00:00
Dennis Kempin
6b06f405ff docs: Use mdformat to format markdown files
The tool is added to ./tools/fmt which will be called during
./tools/presubmit as well as by Kokoro during testing.

This requires a new dev container version to bundle the mdformat
tool in the container.

Note: mdformat does not have any IDE integrations, but the prettier
plugin with prose-wrap enabled and a line length of 100 provides
almost identical results.

BUG=None
TEST=./tools/fmt --check

Change-Id: I0ae5659eff8555df7c85c70e62095a1e116b98da
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3416098
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-01-27 21:29:11 +00:00
Anton Romanov
234f81100d kvm_sys|virtio_sys|net_sys: disable tests failing on 32bits
BUG=b/210015827
TEST=./tools/run_tests --target vm:aarch64 --arch armhf

Change-Id: I4b1968d85969e6094ed393bb4f83c67328591cce
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3340226
Reviewed-by: Anton Romanov <romanton@google.com>
Auto-Submit: Anton Romanov <romanton@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2021-12-15 00:55:48 +00:00
Anton Romanov
c20f783733 Enable some tests for armhf builds
TEST=./tools/dev_container --hermetic bash -c "./tools/run_tests --target=vm:aarch64 --arch armhf"
BUG=b/203152778

Change-Id: I76da1d029e9b11016b1ed9245c5b09095703fb63
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3328099
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Anton Romanov <romanton@google.com>
2021-12-14 18:11:32 +00:00
Dennis Kempin
0fcc7ace5a Uprev rust toolchain to 1.56.1
Two new clippy fixes are affecting us, but will be easy to fix in
a follow-up.
Fixed the dev-container so we can create a new version with the new
toolchain.

BUG=b:210037151
TEST=Kokoro

Change-Id: I9ac4d84aff72b1ee5219d6dab0a88667ca6c5951
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3328954
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2021-12-10 02:34:50 +00:00
Anton Romanov
14e024ae4e Make aarch64 vm usable for running armhf binaries.
BUG: b/203152778
TEST: ./tools/run_tests --target vm:aarch64; ./tools/run_tests vm:aarch64 --arch armhf
Change-Id: I5b774ebf66f1a0a71e025dc364a6e85d43d3b6cb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3324410
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Anton Romanov <romanton@google.com>
2021-12-09 01:08:45 +00:00
Dennis Kempin
d012f3ddcf test_runner Use workspace for building and testing
Instead of enumerating crosvm crates separately, we can now use
the workspace to build all tests for crosvm.

This enables the vmm_vhost tests.

BUG=b:206026060
TEST=./tools/presubmit

Change-Id: I2af84ad8111e874ddea5e438bda41599caf1fd30
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3287463
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2021-11-19 20:09:38 +00:00
Daniel Verkamp
c13c0c210b enumn: switch to upstream crates.io version
Developers may need to manually clean up the common/enumn directory - it
will be left behind if there are build artifacts (Cargo.lock, target
directory, etc.):

  rm -rf common/enumn

BUG=b:205344148
TEST=cargo build
TEST=tools/presubmit
TEST=emerge-hatch crosvm # with https://crrev.com/c/3265967

Change-Id: I1af3bdd22f40e87895a78a5cbc8033476058c927
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3278774
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2021-11-15 21:03:25 +00:00
Dennis Kempin
8f5978fda2 crosvm: Do not use .cargo/config.toml
Building crates in common/ will try to access the file, but won't
be allowed to read it with CROS_WORKON_SUBTREE set.

BUG=b:195126527
TEST=./tools/run_tests --target=vm:aarch64

Change-Id: Ic455ca6c3102dd363daf70468e5d89003d10bb4c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3254042
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Abhishek Bhardwaj <abhishekbh@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
2021-10-30 00:16:33 +00:00
Dennis Kempin
8a1c50d5cd Refactoring: Move various general purpose crates to common/
This change contains the results of running

./tools/contib/cargo_refactor.py

This will break the next uprev, and needs to be synchronizized
with the corresponding ebuild changes in https://crrev.com/c/3248925

BUG=b:195126527
TEST=./tools/run_tests

Change-Id: Ied15a1841887bb8f59fba65b912b81acf69beb73
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3248129
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2021-10-29 22:31:43 +00:00