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>
3 files changed
tree: b3d146b66c475ec60da50c74395acc75293c36f7
  1. .cargo/
  2. .devcontainer/
  3. .github/
  4. .vscode/
  5. aarch64/
  6. acpi_tables/
  7. anti_tamper/
  8. arch/
  9. argh_helpers/
  10. base/
  11. bin/
  12. bit_field/
  13. broker_ipc/
  14. ci/
  15. common/
  16. cros_async/
  17. crosvm-fuzz/
  18. crosvm_control/
  19. crosvm_plugin/
  20. devices/
  21. disk/
  22. docs/
  23. fuse/
  24. gpu_display/
  25. hypervisor/
  26. infra/
  27. integration_tests/
  28. io_uring/
  29. kernel_cmdline/
  30. kernel_loader/
  31. kvm/
  32. kvm_sys/
  33. libcras_stub/
  34. linux_input_sys/
  35. logo/
  36. media/
  37. metrics/
  38. net_sys/
  39. net_util/
  40. power_monitor/
  41. protos/
  42. qcow_utils/
  43. resources/
  44. rutabaga_gfx/
  45. seccomp/
  46. serde_keyvalue/
  47. src/
  48. system_api_stub/
  49. tests/
  50. third_party/
  51. tools/
  52. tpm2/
  53. tpm2-sys/
  54. tracing/
  55. tube_transporter/
  56. usb_sys/
  57. usb_util/
  58. vfio_sys/
  59. vhost/
  60. virtio_sys/
  61. vm_control/
  62. vm_memory/
  63. win_audio/
  64. win_util/
  65. x86_64/
  66. .dockerignore
  67. .gitignore
  68. .gitmodules
  69. .rustfmt.toml
  70. ARCHITECTURE.md
  71. build.rs
  72. Cargo.lock
  73. Cargo.toml
  74. CONTRIBUTING.md
  75. DIR_METADATA
  76. LICENSE
  77. mypy.ini
  78. navbar.md
  79. OWNERS
  80. PRESUBMIT.cfg
  81. pyproject.toml
  82. README.chromeos.md
  83. README.md
  84. run_tests
  85. rust-toolchain
  86. setup_cros_cargo.sh
  87. test_all
  88. unblocked_terms.txt
README.md

crosvm - The Chrome OS Virtual Machine Monitor

crosvm is a virtual machine monitor (VMM) based on Linux’s KVM hypervisor, with a focus on simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security boundary for running native applications on the Chrome OS platform. Compared to QEMU, crosvm doesn’t emulate architectures or real hardware, instead concentrating on paravirtualized devices, such as the virtio standard.

crosvm is currently used to run Linux/Android guests on Chrome OS devices.

Logo