blob: 5cf0f242825070a7fc82d248d2c3a3e6e4d12941 [file] [log] [blame] [view]
Daniel Erat599e0242018-09-15 00:52:551# Tast Test Dependencies (go/tast-deps)
Daniel Erat5b270ed2018-05-02 05:37:542
3A test may specify software features that must be supported by the DUT's system
4image in order for the test to run successfully. If one or more features aren't
Daniel Erat673ebab2019-02-13 05:32:465supported by the DUT, the test will usually be skipped. See the `tast` command's
6`-checktestdeps` flag to control this behavior.
Daniel Erat5b270ed2018-05-02 05:37:547
8Tests specify dependencies through the `SoftwareDeps` field in [testing.Test].
Daniel Erat673ebab2019-02-13 05:32:469
10[testing.Test]: https://godoc.org/chromium.googlesource.com/chromiumos/platform/tast.git/src/chromiumos/tast/testing#Test
11
12## Existing features
13
Daniel Erat5b270ed2018-05-02 05:37:5414The following software features are defined:
15
Eric Caruso20c6b052019-04-03 21:29:5416* `alt_syscall` - Whether the platform supports the alt syscall framework.
Greg Kerr8e77a2c2019-02-07 00:28:0617* `amd64` - The [amd64] processor architecture.
Hidehiko Abe267c5d22019-02-28 11:42:2018* `android` - The ability to [run Android apps]. Any production version of
19 Android (i.e. ones except `master-arc-dev`) can be used.
20* `android_all` - in addition to `android`, runs on `master-arc-dev`, too.
Becca Hughes8247fde2018-11-09 18:50:0321* `android_p` - The ability to [run Android apps] that require Android P or
Eric Caruso6ca58ce2018-12-04 00:38:3822 later.
Shik Chen8142e7c2019-02-22 07:32:1923* `arc_camera3` - The [Camera HAL3] interface in Android.
Eric Caruso6ca58ce2018-12-04 00:38:3824* `aslr` - Address space layout randomization, which mitigates buffer-overflow
25 attacks, is functional (this is not true for builds with [AddressSanitizer]
26 instrumentation built in).
Daniel Erat943de1b2018-07-03 17:32:1627* `audio_play` - The ability to play audio.
28* `audio_record` - The ability to record audio.
Daniel Eratdf04ea02018-09-19 21:31:2429* `autotest-capability:foo` - An [Autotest capability] named `foo`. See below.
Keiichi Watanabec7acad02018-10-16 10:19:4930* `camera_720p` - The ability to capture video with frame size 1280x720.
Daniel Erat5b270ed2018-05-02 05:37:5431* `chrome` - A Chrome process.
Daniel Erat7fcae522019-02-26 04:26:0832* `chrome_internal` - Functionality that is only available in internal builds
33 of Chrome (e.g. official branding and proprietary codecs like H.264).
Daniel Erat5b270ed2018-05-02 05:37:5434* `chrome_login` - Implies `chrome` with the further requirement that user
35 login (i.e. using `session_manager` and `cryptohome`) is supported.
Mathew Kingcf6e5a42019-05-08 21:23:4936* `cros_config` - `cros_config` utility is available.
Daniel Erat7fcae522019-02-26 04:26:0837* `cros_internal` - Functionality that is only available in internal builds of
38 Chrome OS (i.e. ones built using `chromeos-overlay`).
Hidehiko Abec9c34132018-09-26 15:10:5339* `cups` - CUPS daemon.
Mathew King4f1fcc02019-03-28 00:41:4440* `diagnostics` - [Diagnostic utilities].
Shuhei Takahashidd131722018-08-01 06:53:2141* `display_backlight` - An internal display backlight.
Xiaochu Liub034be02019-02-01 21:34:4142* `dlc` - Support of [Downloadable Content] (DLC).
Ricardo Quesadac2b2b6d2019-02-20 18:50:0943* `drm_atomic` - The ability to synchronize video buffer overlays atomically.
44 This is guarantees that [video hardware overlays] are supported.
Daniel Erat33a351b2019-04-02 05:23:2145* `firewall` - Standard Chrome OS network firewall rules.
Daniel Erat0c2e3b82019-04-15 04:43:5246* `google_virtual_keyboard` - The proprietary Google onscreen virtual keyboard
47 (as opposed to the builtin open-source virtual keyboard).
Daniel Erat92d132d2018-12-13 05:31:5448* `gpu_sandboxing` - Chrome's GPU process is [sandboxed].
Luigi Semenzatoedde0712018-11-14 18:26:4649* `memd` - [Memory stats collection daemon].
Andrew Moylane739f2e2018-09-20 22:34:5350* `ml_service` - ML Service daemon.
Daniel Erat63de30d2018-11-20 00:48:3451* `no_android` - The inability to run Android apps. This is the opposite of
52 the `android` feature; DUTs will have exactly one of these two features.
Daniel Erat97478882018-11-14 05:54:3953* `no_symlink_mount` - Symlink mounting is disabled via the
54 `CONFIG_SECURITY_CHROMIUMOS_NO_SYMLINK_MOUNT` kernel option.
Daniel Erate4ea2992019-04-13 01:28:4555* `oci` - The ability to use the `run_oci` program to execute code within
56 [OCI] containers.
Daniel Erate758f642018-11-29 19:59:3157* `reboot` - The ability to reboot reliably during a remote test.
Daniel Erat86c64372018-09-25 19:28:2658* `screenshot` - The [screenshot command] can save screenshots.
Qijiang Fan7ced1b92018-09-07 04:08:1659* `selinux` - An SELinux-enabled board. All Android boards are
60 SELinux-enabled.
Qijiang Fan066d2662019-01-10 09:25:1261* `selinux_current` - All SELinux-enabled boards except experimental boards.
62 This implies `selinux`.
63* `selinux_experimental` - An experimental SELinux board. An experimental
64 board has `SELINUX=permissive` in `/etc/selinux/config`, thus no policy
65 will be enforced. This implies `selinux`.
Tetsui Ohkubo1960f3a2018-12-20 04:39:0266* `tablet_mode` - The ability to enter tablet mode. The device is either
67 a convertible device or a tablet device.
Daniel Erat943de1b2018-07-03 17:32:1668* `tpm` - A [Trusted Platform Module] chip.
George Burgess IV28e8fc52019-01-16 19:46:5069* `transparent_hugepage` - [Transparent Hugepage] support in the Linux kernel.
Allen Webb67dcae12019-02-11 17:01:1970* `usbguard` - The ability to allow or block USB devices based on policy.
David Valleau3d19c4c2019-02-07 23:57:1071* `virtual_usb_printer` - Emulates a USB printer. This implies the presence of
72 the `usbip` program.
Stephen Barbere1482562018-05-21 23:54:5273* `vm_host` - The ability to [run virtual machines].
Hidehiko Abeb6557502019-03-26 13:32:1474* `vulkan` - Whether [Vulkan] is enabled.
Daniel Erat5b270ed2018-05-02 05:37:5475
Daniel Erate4ea2992019-04-13 01:28:4576[amd64]: https://en.wikipedia.org/wiki/X86-64
77[run Android apps]: https://developer.android.com/topic/arc/
78[Camera HAL3]: https://source.android.com/devices/camera/camera3
79[AddressSanitizer]: https://github.com/google/sanitizers/wiki/AddressSanitizer
80[Autotest capability]: https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/master/chromeos-base/autotest-capability-default/
81[Diagnostic utilities]: https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/diagnostics/README.md
82[Downloadable Content]: https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/dlcservice
83[video hardware overlays]: https://en.wikipedia.org/wiki/Hardware_overlay
84[sandboxed]: https://chromium.googlesource.com/chromium/src/+/HEAD/docs/linux_sandboxing.md
85[Memory stats collection daemon]: https://chromium.googlesource.com/chromiumos/platform2/+/master/metrics/memd/
86[OCI]: https://www.opencontainers.org/
87[screenshot command]: https://chromium.googlesource.com/chromiumos/platform2/+/master/screenshot/
88[Trusted Platform Module]: https://en.wikipedia.org/wiki/Trusted_Platform_Module
89[Transparent Hugepage]: https://www.kernel.org/doc/Documentation/vm/transhuge.txt
90[run virtual machines]: https://chromium.googlesource.com/chromiumos/docs/+/master/containers_and_vms.md
91[Vulkan]: https://www.khronos.org/vulkan/
92
Daniel Erat673ebab2019-02-13 05:32:4693## New features
Daniel Erat5b270ed2018-05-02 05:37:5494
Daniel Erat673ebab2019-02-13 05:32:4695Features should be descriptive and precise. Consider a hypothetical test that
96exercises authentication using a biometrics daemon that isn't present in system
97images built to run on virtual machines. Instead of adding a `real_hardware` or
98`non_vm` feature that is overly broad and will likely be interpreted as carrying
99additional meaning beyond the original intent, add a `biometrics_daemon` feature
100that precisely communicates the test's actual requirement.
101
102Features are composed from USE flags, which are statically defined when the
103system image is built. [local_test_runner] lists boolean expressions that are
104used to generate features; for example, an imaginary feature named `hd_audio`
105with the expression
106
107```go
108cras && (audio_chipset_a || audio_chipset_b) && !broken_headphone_jack
109```
110
111will be reported as available on systems where the `cras` USE flag is set,
112either `audio_chipset_a` or `audio_chipset_b` is set, and
113`broken_headphone_jack` is explicitly *not* set. Before a new USE flag can be
114used in an expression, it must be added to `IUSE` in the [tast-use-flags]
115package, and before a feature can be listed by a test, it must be registered in
116`local_test_runner`. Please use [CQ-DEPEND] in your commit messages to ensure
117that changes land in the correct order.
118
119If you're having trouble finding a way to specify your test's dependencies,
120please ask for help on the [tast-users mailing list].
121
Daniel Erate4ea2992019-04-13 01:28:45122[local_test_runner]: https://chromium.googlesource.com/chromiumos/platform/tast/+/master/src/chromiumos/cmd/local_test_runner/main.go
123[tast-use-flags]: https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/master/chromeos-base/tast-use-flags/
Daniel Erat673ebab2019-02-13 05:32:46124[CQ-DEPEND]: https://chromium.googlesource.com/chromiumos/docs/+/master/contributing.md#cq-depend
125[tast-users mailing list]: https://groups.google.com/a/chromium.org/forum/#!forum/tast-users
126
127### Example changes
Daniel Erata3413832019-01-31 23:43:32128
Daniel Erat920fc652018-12-19 16:11:22129See the following changes for an example of adding a new `containers` software
130feature based on the `containers` USE flag and making a test depend on it:
131
132* `chromiumos-overlay` repository: <https://crrev.com/c/1382877>
133* `tast` repository: <https://crrev.com/c/1382621>
134* `tast-tests` repository: <https://crrev.com/c/1382878>
135
Daniel Erate4ea2992019-04-13 01:28:45136(Note that the `containers` feature has since been renamed to `oci`.)
137
Daniel Erata3413832019-01-31 23:43:32138## autotest-capability
139
Daniel Erat673ebab2019-02-13 05:32:46140There are also `autotest-capability:`-prefixed features, which are added by the
141[autocaps package] as specified by YAML files in
Daniel Eratdf04ea02018-09-19 21:31:24142`/usr/local/etc/autotest-capability`. This exists in order to support porting
143existing Autotest-based video tests to Tast. Do not depend on capabilities from
144outside of video tests.
145
Daniel Erate4ea2992019-04-13 01:28:45146[autocap package]: https://godoc.org/chromium.googlesource.com/chromiumos/platform/tast.git/src/chromiumos/tast/autocaps/