Commit graph

29 commits

Author SHA1 Message Date
Hikaru Nishida
5fe672aaf4 e2e_test: Add a test for virtio-pvclock behavior
BUG=b:295256641
TEST=tools/dev_container tools/presubmit all

Change-Id: Ie8009bedd5265c35ee5724767d324c6a821fb511
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5151637
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Hikaru Nishida <hikalium@chromium.org>
2024-03-13 09:05:25 +00:00
Hikaru Nishida
917e1f4641 guest_under_testing: uprev PREBUILT_VERSION
It looks like r13 of the prebuilt uploaded does not include the change
made in https://crrev.com/c/5190792 . This CL updates the prebuilt
with the CL as well as the updates made so far.

BUG=b:295256641
TEST=tools/dev_container tools/presubmit all

Change-Id: I795762089ae8aaa42ab34ad9e9cf393429c237cc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5351685
Commit-Queue: Hikaru Nishida <hikalium@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2024-03-08 05:56:38 +00:00
Wang Ningyuan
6b00bc162b e2e_tests: Add PCIe hotplug support
Currently the guest kernel does not properly support PCIe hotplug: when
a PCI device is hotplugged, PCI_EXP_SLTCTL_CCIE is not sent to notify
the hardware that hotplug is completed. This is solved by enabling the
kernel flags.

BUG=b:325997618
TEST=./tools/dev_container ./tools/presubmit

Change-Id: I6d22fbd94fb420dab3b21c87cedccccbe015d7df
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5332332
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Ningyuan Wang <ningyuan@google.com>
2024-03-05 04:16:26 +00:00
Hikaru Nishida
c3a24eeb28 uprev prebuilt version
Update prebuilts to reflect the recent updates on guest_under_test images:
- crrev/c/5308635
- crrev/c/5190792

BUG=b:295256641
TEST=tools/dev_container tools/presubmit all

Change-Id: I06910645d4a6507989bc7289e59e754be773ccca
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5300045
Reviewed-by: David Stevens <stevensd@chromium.org>
Auto-Submit: Hikaru Nishida <hikalium@chromium.org>
Commit-Queue: Hikaru Nishida <hikalium@chromium.org>
2024-02-21 08:58:03 +00:00
Hikaru Nishida
9510142a7c Specify patch version of e2e_test kernels explicitly
Specify patch version explicitly to improve the reproducibility of
e2e_test image generation. This patch version is determined based on r11
of the prebuilt images, which is the currently used version at this
point.

BUG=b:295256641
TEST=./tools/dev_container ./tools/presubmit

Change-Id: I6e91ce88bec4827168a61c682c3de9f0e94e4c70
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5308635
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Hikaru Nishida <hikalium@chromium.org>
2024-02-20 04:13:58 +00:00
Kaiyi Li
c28067d1d9 Reformat comments
Test: presubmit
Change-Id: I39c261d9985989873b698213c5d8b653fc13757b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5299850
Auto-Submit: Kaiyi Li <kaiyili@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2024-02-15 23:30:13 +00:00
Hikaru Nishida
481d24e461 guest_under_test: Apply virtio-pvclock guest kernel patch for testing
BUG=b:295256641
TEST=make clean-all && make kernel

Change-Id: I7197b7a29f160fe19fcbc1c5fa53043e58088927
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5190792
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Hikaru Nishida <hikalium@chromium.org>
Auto-Submit: Hikaru Nishida <hikalium@chromium.org>
2024-01-29 08:37:47 +00:00
Takaya Saeki
29ee984466 e2e_tests: Revert unnecessary version bump of anyhow/libc crates
https://crrev.com/c/5188024 bumped the version of anyhow and libc. That
broke ChromiumOS build, since we forgot to bump the versions on
ChromiumOS side. This CL fixes the build failure by reverting the
version bump. Although we also can upgrade the versions on the
ChromiumOS, they are not mandate version dump so we just revert them.

BUG=None
Test=./tools/dev_container ./tools/presubmit

Change-Id: Ie47b7219402d73493679cac3330fb958601086df
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5223988
Commit-Queue: Takaya Saeki <takayas@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Takaya Saeki <takayas@chromium.org>
2024-01-23 18:43:01 +00:00
Hikaru Nishida
a3cad48f93 e2e_tests: Add a helper to read guest clocks
BUG=b:295256641
TEST=make rootfs
TEST=./tools/dev_container ./tools/presubmit crosvm_tests_mingw64
TEST=./tools/dev_container ./tools/presubmit crosvm_tests_x86_64

Change-Id: I07c4ec76b4a3d3ca31b26551393befbd7907678b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5188024
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Hikaru Nishida <hikalium@chromium.org>
2024-01-22 11:24:14 +00:00
Hikaru Nishida
cbdf02884c e2e_tests: Update use_local_build.sh to include the initrd env var
Fixup/improvement of crrev/c/5151636

BUG=b:295256641
TEST=make -C e2e_tests/guest_under_test x86_64_initramfs
TEST=source e2e_tests/guest_under_test/use_local_build.sh
TEST=cargo test --package e2e_tests -- boot

Change-Id: I94c092c87434bbd59aea25be456b9160f2882065
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5190791
Commit-Queue: Hikaru Nishida <hikalium@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2024-01-15 01:52:27 +00:00
Hikaru Nishida
ae075a5591 e2e_test: Update instructions to use locally built kernel/rootfs images
Fix the outdated documentation and scripts.

TEST=make -C e2e_tests/guest_under_test rootfs kernel
TEST=source e2e_tests/guest_under_test/use_local_build.sh
TEST=cargo test --package e2e_tests -- boot

Change-Id: Ie787296759234adf7b9e770e0da984aa3639f280
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5151636
Auto-Submit: Hikaru Nishida <hikalium@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2024-01-05 04:50:21 +00:00
Zihan Chen
60a419217c e2e_tests/benches: Add gimp benchmark for disk performance
Gimp plugin initializing, loading and file batch processing are
plausible real-world operations to run under crosvm, and can be
easily measured in an automated gui-less fasion. These operations
mainly stress small file disk performance.

BUG=b:181105093

TEST=./tools/bench gimp

Change-Id: I5891771a031f5843df4aebdfede8ae9b7ed53977
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4994843
Auto-Submit: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-11-14 18:37:11 +00:00
Joe Hattori
429c10ceda e2e_tests: Add the sg3-utils packages to the test rootfs.
`sg3-utils` is the package needed for `sg_reset`, `sg_opcodes`, and
other `sg_*` commands, which sends SCSI commands to devices. This commit
adds the package to the test rootfs so that `sg_*` commands can be used
in the e2e_tests in later commit (cf. https://crrev.com/c/4958314).

BUG=b:300042376
TEST=./run_guest.sh boots a guest with the `sg_*` commands installed.

Change-Id: I644d7bda3eab054ea8e88b1e78edcf6df659a259
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4974876
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Joe Hattori <hattorij@google.com>
2023-10-25 09:32:30 +00:00
A. Cody Schuffelen
97dff044f8 Replace #[cfg(unix)] with #[cfg(any(target_os = "android", target_os = "linux"))]
Updates are made to source and documentation.

This more accurately represents the currently supported platforms of
Android/Linux and Windows, without unexpectedly including other
unix-like operating systems.

Command to reproduce:
$ find . -type f -not -path '*/\.git/*' | xargs -I {} sed -i 's/cfg(unix)/cfg(any(target_os = "android", target_os = "linux"))/g' {}
$ cargo fmt

md files manually updated to fix line lengths.

Renaming `unix` modules to `linux` will be done in a later CL.

Test: ./tools/dev_container ./tools/presubmit
Bug: b/298269162
Change-Id: I42c1bf0abf80b9a0df25551613910293217c7295
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4909059
Commit-Queue: Cody Schuffelen <schuffelen@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
2023-10-11 00:43:29 +00:00
Joe Hattori
37ff62374d e2e_tests: Add configs for virtio-scsi support.
Currently the guest kernel for the e2e test does not support virtio-scsi
driver. This commit changes the `common.config` file to make the guest
kernel support virtio-scsi driver so we'll be able to add scsi e2e tests.

BUG=b:300042376
TEST=virtio-scsi e2e test CL (CL:4876531) worked with the kernel locally

Change-Id: Ic38dd7744df59049ed6d17b346df974d1b34aa1e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4882199
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
2023-09-27 02:20:04 +00:00
Zihan Chen
2505dd5bb7 e2e_tests/guest_under_test: Fix Makefile
I break the Makefile in crrev.com/c/4787727, this cl fixes it.

TEST=make clean && make

Change-Id: I931d2bfa8c6dfa2ce218a67a59e8cd52a682b259
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4883337
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Auto-Submit: Zihan Chen <zihanchen@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-09-22 02:36:11 +00:00
Zihan Chen
5db1e3c1fc e2e_tests: Add postgres benchmark
Add a preliminary version of pgbench running in e2e_tests
facilities. It currently does nothing with the benchmark result.

TEST=Can pass and produce results with `./tools/bench postgres`

BUG=b:257303497

Change-Id: If2f06cb0a9c91f5d7240094bacf86fc681062127
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4763144
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
2023-09-20 19:00:15 +00:00
Zihan Chen
7a62cb0465 e2e_tests: Support program parsing guest command output
Delegate has been restructured to support this change, and sadly
Win64 compile exclusion has to be reintroduced to avoid compiling
this binary on Windows.

Now e2e_tests can explicitly obtain result (including stdout/stderr/
exit code/signal) from command ran in test guests.

BUG=b:257303497

Change-Id: Ibcd773b69cca9708a8dacb34cc870ca527fa32c3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4787727
Auto-Submit: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
2023-09-19 22:27:35 +00:00
Zihan Chen
9151130e4d e2e_tests: Update guest kernel config and initramfs
As I'm tinkering with the first real benchmark (pgbench), a few
kernel configs are found to be missing to support psql to run in
e2e test guests. Among with previously added but not uprev-ed
KConfig changes, an uprev is prepared.

Initramfs script is also updated to match distribution behavior.

TEST=locally can pass postgres e2e benchmark

BUG=b:257303497

Change-Id: I69b44e3156d3296cbef7fa41804e8b54e4aaf0ab
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4761848
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
2023-08-11 20:29:24 +00:00
Zihan Chen
594c215bed e2e_tests: Add initramfs definition and documentation
A light weight, purely static initramfs has been added to allow
running tests that are slightly more complex. This also allow
us to inject e2e_test components (e.g. delegate) into pre-built
containers from 3rd-party sources.

TEST=VM can boot from initramfs produced by make

Change-Id: Id27faa61a54bd151187dc6231d996efaaa6ae890
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4718770
Commit-Queue: Zihan Chen <zihanchen@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-08-04 19:43:15 +00:00
Zihan Chen
8b39118abe e2e_tests: Add test to verify booting custom artifacts work
A hand-made initramfs and an updated kernel that supports initramfs
are uploaded alongside this CL. This test is added for the sole
purpose of letting the CQ to continously verify specifying custom
artifacts in e2e_tests is not broken. At its current speed, it's
not the slowest e2e tests we have.

TEST=CQ

BUG=b:257303497

Change-Id: I19baf495ce8af4805f76f16a5f831f86959d41a8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4697698
Commit-Queue: Zihan Chen <zihanchen@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-07-21 00:24:28 +00:00
Zihan Chen
8d49ca4d61 e2e_tests: Add cgroup, unix socket, virtiofs DAX support to guest
cgroup and unix socket support are mandatory for booting with
systemd. virtiofs DAX is supported by crosvm and should be tested.

TEST=CQ
TEST=new prebuilt kernel can boot debian userspace to normal shell

Change-Id: I0b4a969f31056e777526f42b613abb66eaaf18c0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4582848
Auto-Submit: Zihan Chen <zihanchen@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-06-01 21:56:52 +00:00
Takaya Saeki
4131e80c89 e2e_tests: fix small bugs in run_guest.sh
run_guest.sh lacks the shebang, and has a small bug of missing quotes.
This commit fixes them.

BUG=None
TEST=Confirmed that "$@" works as expected by checking the passed
arguments.

Change-Id: Ic0d5e8676b206be15b1b2f09b3b9c6de2b9d2fb3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4537378
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Takaya Saeki <takayas@chromium.org>
2023-05-17 02:56:31 +00:00
Dennis Kempin
b96ba4c8be e2e_tests: Switch to custom kernel config and debian rootfs
We switch from the chromeos-5.10 kernel with crostini configs
to a stripped down config building the mainline 6.1 branch.

This allows us more control over the guest kernel for testing
and significantly speeds up e2e tests (~4s -> 1.2s for all
tests run with nextest).

The rootfs is switched to Debian as that's what we use elsewhere
which makes this easier to maintain.

BUG=b:256652981
TEST=presubmit

Change-Id: Ib3897b8dbf3391eefdb1eedb69ec7555f4c77344
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4326888
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-03-15 21:09:39 +00:00
Dennis Kempin
a5312895e7 e2e_tests: Extend exec_in_guest functionality
This is a refactoring that adds the following functionality to
exec_in_guest:

- Receive exit codes from executed commands and by default check
  if they are zero.
- Add timeouts to all communication with the guest
- Allow commands to be executed asynchronously, to allow the test
  code to perform actions while the guest command is running.
- Add anyhow error handling with contexts for more helpful error
  messages

BUG=b:269137600
BUG=b:268539201

Change-Id: Ic069c3ccae363790a124db10a0db76e4ad4384c3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4251717
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Zihan Chen <zihanchen@google.com>
2023-02-21 22:54:30 +00:00
Vikram Auradkar
6e46da68ba e2e_tests: stay in the current directory
BUG=NONE
TEST=`source e2e_tests/guest_under_test/use_local_build.sh`

Change-Id: Ife81553ba2bdc2b37e079191c3d13d86d08c5136
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4072946
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-12-02 00:16:50 +00:00
Zihan Chen
23e3de8afb e2e_tests: Uprev kernel to 5.10
Block resize failed in my cloudtop after uprev, it works fine
when tested manually (with same kernel and rootfs). Adding a delay
fixed it.

TEST=./e2e_tests/run
FIXED=b:259160336

Change-Id: I2cfb4fbc491b39b721b0358181cad2ee75398adc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4026591
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Zihan Chen <zihanchen@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
2022-11-15 21:06:40 +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
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