blob: 591bae6f10878db0d7596d2f479f99ef3298b92b [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
Greg Kerr8e77a2c2019-02-07 00:28:0616* `amd64` - The [amd64] processor architecture.
Hidehiko Abe267c5d22019-02-28 11:42:2017* `android` - The ability to [run Android apps]. Any production version of
18 Android (i.e. ones except `master-arc-dev`) can be used.
19* `android_all` - in addition to `android`, runs on `master-arc-dev`, too.
Becca Hughes8247fde2018-11-09 18:50:0320* `android_p` - The ability to [run Android apps] that require Android P or
Eric Caruso6ca58ce2018-12-04 00:38:3821 later.
Shik Chen8142e7c2019-02-22 07:32:1922* `arc_camera3` - The [Camera HAL3] interface in Android.
Eric Caruso6ca58ce2018-12-04 00:38:3823* `aslr` - Address space layout randomization, which mitigates buffer-overflow
24 attacks, is functional (this is not true for builds with [AddressSanitizer]
25 instrumentation built in).
Daniel Erat943de1b2018-07-03 17:32:1626* `audio_play` - The ability to play audio.
27* `audio_record` - The ability to record audio.
Daniel Eratdf04ea02018-09-19 21:31:2428* `autotest-capability:foo` - An [Autotest capability] named `foo`. See below.
Keiichi Watanabec7acad02018-10-16 10:19:4929* `camera_720p` - The ability to capture video with frame size 1280x720.
Daniel Erat5b270ed2018-05-02 05:37:5430* `chrome` - A Chrome process.
Daniel Erat7fcae522019-02-26 04:26:0831* `chrome_internal` - Functionality that is only available in internal builds
32 of Chrome (e.g. official branding and proprietary codecs like H.264).
Daniel Erat5b270ed2018-05-02 05:37:5433* `chrome_login` - Implies `chrome` with the further requirement that user
34 login (i.e. using `session_manager` and `cryptohome`) is supported.
Daniel Erat6ada41d2018-12-18 22:37:1035* `containers` - The ability to run code within containers. This implies the
36 presence of the `run_oci` program.
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.
Shuhei Takahashidd131722018-08-01 06:53:2140* `display_backlight` - An internal display backlight.
Xiaochu Liub034be02019-02-01 21:34:4141* `dlc` - Support of [Downloadable Content] (DLC).
Ricardo Quesadac2b2b6d2019-02-20 18:50:0942* `drm_atomic` - The ability to synchronize video buffer overlays atomically.
43 This is guarantees that [video hardware overlays] are supported.
Daniel Erat92d132d2018-12-13 05:31:5444* `gpu_sandboxing` - Chrome's GPU process is [sandboxed].
Luigi Semenzatoedde0712018-11-14 18:26:4645* `memd` - [Memory stats collection daemon].
Andrew Moylane739f2e2018-09-20 22:34:5346* `ml_service` - ML Service daemon.
Daniel Erat63de30d2018-11-20 00:48:3447* `no_android` - The inability to run Android apps. This is the opposite of
48 the `android` feature; DUTs will have exactly one of these two features.
Daniel Erat97478882018-11-14 05:54:3949* `no_symlink_mount` - Symlink mounting is disabled via the
50 `CONFIG_SECURITY_CHROMIUMOS_NO_SYMLINK_MOUNT` kernel option.
Daniel Erate758f642018-11-29 19:59:3151* `reboot` - The ability to reboot reliably during a remote test.
Daniel Erat86c64372018-09-25 19:28:2652* `screenshot` - The [screenshot command] can save screenshots.
Qijiang Fan7ced1b92018-09-07 04:08:1653* `selinux` - An SELinux-enabled board. All Android boards are
54 SELinux-enabled.
Qijiang Fan066d2662019-01-10 09:25:1255* `selinux_current` - All SELinux-enabled boards except experimental boards.
56 This implies `selinux`.
57* `selinux_experimental` - An experimental SELinux board. An experimental
58 board has `SELINUX=permissive` in `/etc/selinux/config`, thus no policy
59 will be enforced. This implies `selinux`.
James Cook74596d32019-01-25 02:20:5860* `stable_egl` - Board has stable EGL graphics driver (e.g. not a nyan board).
61 https://crbug.com/717275
Tetsui Ohkubo1960f3a2018-12-20 04:39:0262* `tablet_mode` - The ability to enter tablet mode. The device is either
63 a convertible device or a tablet device.
Daniel Erat943de1b2018-07-03 17:32:1664* `tpm` - A [Trusted Platform Module] chip.
George Burgess IV28e8fc52019-01-16 19:46:5065* `transparent_hugepage` - [Transparent Hugepage] support in the Linux kernel.
Allen Webb67dcae12019-02-11 17:01:1966* `usbguard` - The ability to allow or block USB devices based on policy.
David Valleau3d19c4c2019-02-07 23:57:1067* `virtual_usb_printer` - Emulates a USB printer. This implies the presence of
68 the `usbip` program.
Stephen Barbere1482562018-05-21 23:54:5269* `vm_host` - The ability to [run virtual machines].
Hidehiko Abeb6557502019-03-26 13:32:1470* `vulkan` - Whether [Vulkan] is enabled.
Daniel Erat5b270ed2018-05-02 05:37:5471
Daniel Erat673ebab2019-02-13 05:32:4672## New features
Daniel Erat5b270ed2018-05-02 05:37:5473
Daniel Erat673ebab2019-02-13 05:32:4674Features should be descriptive and precise. Consider a hypothetical test that
75exercises authentication using a biometrics daemon that isn't present in system
76images built to run on virtual machines. Instead of adding a `real_hardware` or
77`non_vm` feature that is overly broad and will likely be interpreted as carrying
78additional meaning beyond the original intent, add a `biometrics_daemon` feature
79that precisely communicates the test's actual requirement.
80
81Features are composed from USE flags, which are statically defined when the
82system image is built. [local_test_runner] lists boolean expressions that are
83used to generate features; for example, an imaginary feature named `hd_audio`
84with the expression
85
86```go
87cras && (audio_chipset_a || audio_chipset_b) && !broken_headphone_jack
88```
89
90will be reported as available on systems where the `cras` USE flag is set,
91either `audio_chipset_a` or `audio_chipset_b` is set, and
92`broken_headphone_jack` is explicitly *not* set. Before a new USE flag can be
93used in an expression, it must be added to `IUSE` in the [tast-use-flags]
94package, and before a feature can be listed by a test, it must be registered in
95`local_test_runner`. Please use [CQ-DEPEND] in your commit messages to ensure
96that changes land in the correct order.
97
98If you're having trouble finding a way to specify your test's dependencies,
99please ask for help on the [tast-users mailing list].
100
101[CQ-DEPEND]: https://chromium.googlesource.com/chromiumos/docs/+/master/contributing.md#cq-depend
102[tast-users mailing list]: https://groups.google.com/a/chromium.org/forum/#!forum/tast-users
103
104### Example changes
Daniel Erata3413832019-01-31 23:43:32105
Daniel Erat920fc652018-12-19 16:11:22106See the following changes for an example of adding a new `containers` software
107feature based on the `containers` USE flag and making a test depend on it:
108
109* `chromiumos-overlay` repository: <https://crrev.com/c/1382877>
110* `tast` repository: <https://crrev.com/c/1382621>
111* `tast-tests` repository: <https://crrev.com/c/1382878>
112
Daniel Erata3413832019-01-31 23:43:32113## autotest-capability
114
Daniel Erat673ebab2019-02-13 05:32:46115There are also `autotest-capability:`-prefixed features, which are added by the
116[autocaps package] as specified by YAML files in
Daniel Eratdf04ea02018-09-19 21:31:24117`/usr/local/etc/autotest-capability`. This exists in order to support porting
118existing Autotest-based video tests to Tast. Do not depend on capabilities from
119outside of video tests.
120
Daniel Eratd8c4c4c2018-05-08 00:35:12121[run Android apps]: https://developer.android.com/topic/arc/
Eric Caruso6ca58ce2018-12-04 00:38:38122[AddressSanitizer]: https://github.com/google/sanitizers/wiki/AddressSanitizer
Daniel Eratdf04ea02018-09-19 21:31:24123[Autotest capability]: https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/master/chromeos-base/autotest-capability-default/
Xiaochu Liub034be02019-02-01 21:34:41124[Downloadable Content]: https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/dlcservice
Ricardo Quesadac2b2b6d2019-02-20 18:50:09125[video hardware overlays]: https://en.wikipedia.org/wiki/Hardware_overlay
Daniel Erat92d132d2018-12-13 05:31:54126[sandboxed]: https://chromium.googlesource.com/chromium/src/+/HEAD/docs/linux_sandboxing.md
Luigi Semenzatoedde0712018-11-14 18:26:46127[Memory stats collection daemon]: https://chromium.googlesource.com/chromiumos/platform2/+/master/metrics/memd/
Daniel Erat86c64372018-09-25 19:28:26128[screenshot command]: https://chromium.googlesource.com/chromiumos/platform2/+/master/screenshot/
Daniel Erat943de1b2018-07-03 17:32:16129[Trusted Platform Module]: https://en.wikipedia.org/wiki/Trusted_Platform_Module
Xiaochu Liub034be02019-02-01 21:34:41130[Transparent Hugepage]: https://www.kernel.org/doc/Documentation/vm/transhuge.txt
Luigi Semenzatoedde0712018-11-14 18:26:46131[run virtual machines]: https://chromium.googlesource.com/chromiumos/docs/+/master/containers_and_vms.md
Daniel Erat5b270ed2018-05-02 05:37:54132[local_test_runner]: https://chromium.googlesource.com/chromiumos/platform/tast/+/master/src/chromiumos/cmd/local_test_runner/main.go
133[tast-use-flags]: https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/master/chromeos-base/tast-use-flags/
Daniel Eratdf04ea02018-09-19 21:31:24134[autocaps package]: https://godoc.org/chromium.googlesource.com/chromiumos/platform/tast.git/src/chromiumos/tast/autocaps/
Greg Kerr8e77a2c2019-02-07 00:28:06135[Transparent Hugepage]: https://www.kernel.org/doc/Documentation/vm/transhuge.txt
136[amd64]: https://en.wikipedia.org/wiki/X86-64
Shik Chen8142e7c2019-02-22 07:32:19137[Camera HAL3]: https://source.android.com/devices/camera/camera3
Hidehiko Abeb6557502019-03-26 13:32:14138[Vulkan]: https://www.khronos.org/vulkan/