Daniel Erat | 599e024 | 2018-09-15 00:52:55 | [diff] [blame] | 1 | # Tast Test Dependencies (go/tast-deps) |
Daniel Erat | 5b270ed | 2018-05-02 05:37:54 | [diff] [blame] | 2 | |
| 3 | A test may specify software features that must be supported by the DUT's system |
| 4 | image in order for the test to run successfully. If one or more features aren't |
Daniel Erat | 673ebab | 2019-02-13 05:32:46 | [diff] [blame] | 5 | supported by the DUT, the test will usually be skipped. See the `tast` command's |
| 6 | `-checktestdeps` flag to control this behavior. |
Daniel Erat | 5b270ed | 2018-05-02 05:37:54 | [diff] [blame] | 7 | |
| 8 | Tests specify dependencies through the `SoftwareDeps` field in [testing.Test]. |
Daniel Erat | 673ebab | 2019-02-13 05:32:46 | [diff] [blame] | 9 | |
| 10 | [testing.Test]: https://godoc.org/chromium.googlesource.com/chromiumos/platform/tast.git/src/chromiumos/tast/testing#Test |
| 11 | |
| 12 | ## Existing features |
| 13 | |
Daniel Erat | 5b270ed | 2018-05-02 05:37:54 | [diff] [blame] | 14 | The following software features are defined: |
| 15 | |
Eric Caruso | 20c6b05 | 2019-04-03 21:29:54 | [diff] [blame] | 16 | * `alt_syscall` - Whether the platform supports the alt syscall framework. |
Greg Kerr | 8e77a2c | 2019-02-07 00:28:06 | [diff] [blame] | 17 | * `amd64` - The [amd64] processor architecture. |
Hidehiko Abe | 267c5d2 | 2019-02-28 11:42:20 | [diff] [blame] | 18 | * `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 Hughes | 8247fde | 2018-11-09 18:50:03 | [diff] [blame] | 21 | * `android_p` - The ability to [run Android apps] that require Android P or |
Eric Caruso | 6ca58ce | 2018-12-04 00:38:38 | [diff] [blame] | 22 | later. |
Shik Chen | 8142e7c | 2019-02-22 07:32:19 | [diff] [blame] | 23 | * `arc_camera3` - The [Camera HAL3] interface in Android. |
Eric Caruso | 6ca58ce | 2018-12-04 00:38:38 | [diff] [blame] | 24 | * `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 Erat | 943de1b | 2018-07-03 17:32:16 | [diff] [blame] | 27 | * `audio_play` - The ability to play audio. |
| 28 | * `audio_record` - The ability to record audio. |
Daniel Erat | df04ea0 | 2018-09-19 21:31:24 | [diff] [blame] | 29 | * `autotest-capability:foo` - An [Autotest capability] named `foo`. See below. |
Keiichi Watanabe | c7acad0 | 2018-10-16 10:19:49 | [diff] [blame] | 30 | * `camera_720p` - The ability to capture video with frame size 1280x720. |
Daniel Erat | 5b270ed | 2018-05-02 05:37:54 | [diff] [blame] | 31 | * `chrome` - A Chrome process. |
Daniel Erat | 7fcae52 | 2019-02-26 04:26:08 | [diff] [blame] | 32 | * `chrome_internal` - Functionality that is only available in internal builds |
| 33 | of Chrome (e.g. official branding and proprietary codecs like H.264). |
Daniel Erat | 5b270ed | 2018-05-02 05:37:54 | [diff] [blame] | 34 | * `chrome_login` - Implies `chrome` with the further requirement that user |
| 35 | login (i.e. using `session_manager` and `cryptohome`) is supported. |
Mathew King | cf6e5a4 | 2019-05-08 21:23:49 | [diff] [blame] | 36 | * `cros_config` - `cros_config` utility is available. |
Daniel Erat | 7fcae52 | 2019-02-26 04:26:08 | [diff] [blame] | 37 | * `cros_internal` - Functionality that is only available in internal builds of |
| 38 | Chrome OS (i.e. ones built using `chromeos-overlay`). |
Hidehiko Abe | c9c3413 | 2018-09-26 15:10:53 | [diff] [blame] | 39 | * `cups` - CUPS daemon. |
Mathew King | 4f1fcc0 | 2019-03-28 00:41:44 | [diff] [blame] | 40 | * `diagnostics` - [Diagnostic utilities]. |
Shuhei Takahashi | dd13172 | 2018-08-01 06:53:21 | [diff] [blame] | 41 | * `display_backlight` - An internal display backlight. |
Xiaochu Liu | b034be0 | 2019-02-01 21:34:41 | [diff] [blame] | 42 | * `dlc` - Support of [Downloadable Content] (DLC). |
Ricardo Quesada | c2b2b6d | 2019-02-20 18:50:09 | [diff] [blame] | 43 | * `drm_atomic` - The ability to synchronize video buffer overlays atomically. |
| 44 | This is guarantees that [video hardware overlays] are supported. |
Daniel Erat | 33a351b | 2019-04-02 05:23:21 | [diff] [blame] | 45 | * `firewall` - Standard Chrome OS network firewall rules. |
Daniel Erat | 0c2e3b8 | 2019-04-15 04:43:52 | [diff] [blame] | 46 | * `google_virtual_keyboard` - The proprietary Google onscreen virtual keyboard |
| 47 | (as opposed to the builtin open-source virtual keyboard). |
Daniel Erat | 92d132d | 2018-12-13 05:31:54 | [diff] [blame] | 48 | * `gpu_sandboxing` - Chrome's GPU process is [sandboxed]. |
Luigi Semenzato | edde071 | 2018-11-14 18:26:46 | [diff] [blame] | 49 | * `memd` - [Memory stats collection daemon]. |
Andrew Moylan | e739f2e | 2018-09-20 22:34:53 | [diff] [blame] | 50 | * `ml_service` - ML Service daemon. |
Daniel Erat | 63de30d | 2018-11-20 00:48:34 | [diff] [blame] | 51 | * `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 Erat | 9747888 | 2018-11-14 05:54:39 | [diff] [blame] | 53 | * `no_symlink_mount` - Symlink mounting is disabled via the |
| 54 | `CONFIG_SECURITY_CHROMIUMOS_NO_SYMLINK_MOUNT` kernel option. |
Daniel Erat | e4ea299 | 2019-04-13 01:28:45 | [diff] [blame] | 55 | * `oci` - The ability to use the `run_oci` program to execute code within |
| 56 | [OCI] containers. |
Daniel Erat | e758f64 | 2018-11-29 19:59:31 | [diff] [blame] | 57 | * `reboot` - The ability to reboot reliably during a remote test. |
Daniel Erat | 86c6437 | 2018-09-25 19:28:26 | [diff] [blame] | 58 | * `screenshot` - The [screenshot command] can save screenshots. |
Qijiang Fan | 7ced1b9 | 2018-09-07 04:08:16 | [diff] [blame] | 59 | * `selinux` - An SELinux-enabled board. All Android boards are |
| 60 | SELinux-enabled. |
Qijiang Fan | 066d266 | 2019-01-10 09:25:12 | [diff] [blame] | 61 | * `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 Ohkubo | 1960f3a | 2018-12-20 04:39:02 | [diff] [blame] | 66 | * `tablet_mode` - The ability to enter tablet mode. The device is either |
| 67 | a convertible device or a tablet device. |
Daniel Erat | 943de1b | 2018-07-03 17:32:16 | [diff] [blame] | 68 | * `tpm` - A [Trusted Platform Module] chip. |
George Burgess IV | 28e8fc5 | 2019-01-16 19:46:50 | [diff] [blame] | 69 | * `transparent_hugepage` - [Transparent Hugepage] support in the Linux kernel. |
Allen Webb | 67dcae1 | 2019-02-11 17:01:19 | [diff] [blame] | 70 | * `usbguard` - The ability to allow or block USB devices based on policy. |
David Valleau | 3d19c4c | 2019-02-07 23:57:10 | [diff] [blame] | 71 | * `virtual_usb_printer` - Emulates a USB printer. This implies the presence of |
| 72 | the `usbip` program. |
Stephen Barber | e148256 | 2018-05-21 23:54:52 | [diff] [blame] | 73 | * `vm_host` - The ability to [run virtual machines]. |
Hidehiko Abe | b655750 | 2019-03-26 13:32:14 | [diff] [blame] | 74 | * `vulkan` - Whether [Vulkan] is enabled. |
Daniel Erat | 5b270ed | 2018-05-02 05:37:54 | [diff] [blame] | 75 | |
Daniel Erat | e4ea299 | 2019-04-13 01:28:45 | [diff] [blame] | 76 | [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 Erat | 673ebab | 2019-02-13 05:32:46 | [diff] [blame] | 93 | ## New features |
Daniel Erat | 5b270ed | 2018-05-02 05:37:54 | [diff] [blame] | 94 | |
Daniel Erat | 673ebab | 2019-02-13 05:32:46 | [diff] [blame] | 95 | Features should be descriptive and precise. Consider a hypothetical test that |
| 96 | exercises authentication using a biometrics daemon that isn't present in system |
| 97 | images 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 |
| 99 | additional meaning beyond the original intent, add a `biometrics_daemon` feature |
| 100 | that precisely communicates the test's actual requirement. |
| 101 | |
| 102 | Features are composed from USE flags, which are statically defined when the |
| 103 | system image is built. [local_test_runner] lists boolean expressions that are |
| 104 | used to generate features; for example, an imaginary feature named `hd_audio` |
| 105 | with the expression |
| 106 | |
| 107 | ```go |
| 108 | cras && (audio_chipset_a || audio_chipset_b) && !broken_headphone_jack |
| 109 | ``` |
| 110 | |
| 111 | will be reported as available on systems where the `cras` USE flag is set, |
| 112 | either `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 |
| 114 | used in an expression, it must be added to `IUSE` in the [tast-use-flags] |
| 115 | package, 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 |
| 117 | that changes land in the correct order. |
| 118 | |
| 119 | If you're having trouble finding a way to specify your test's dependencies, |
| 120 | please ask for help on the [tast-users mailing list]. |
| 121 | |
Daniel Erat | e4ea299 | 2019-04-13 01:28:45 | [diff] [blame] | 122 | [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 Erat | 673ebab | 2019-02-13 05:32:46 | [diff] [blame] | 124 | [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 Erat | a341383 | 2019-01-31 23:43:32 | [diff] [blame] | 128 | |
Daniel Erat | 920fc65 | 2018-12-19 16:11:22 | [diff] [blame] | 129 | See the following changes for an example of adding a new `containers` software |
| 130 | feature 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 Erat | e4ea299 | 2019-04-13 01:28:45 | [diff] [blame] | 136 | (Note that the `containers` feature has since been renamed to `oci`.) |
| 137 | |
Daniel Erat | a341383 | 2019-01-31 23:43:32 | [diff] [blame] | 138 | ## autotest-capability |
| 139 | |
Daniel Erat | 673ebab | 2019-02-13 05:32:46 | [diff] [blame] | 140 | There are also `autotest-capability:`-prefixed features, which are added by the |
| 141 | [autocaps package] as specified by YAML files in |
Daniel Erat | df04ea0 | 2018-09-19 21:31:24 | [diff] [blame] | 142 | `/usr/local/etc/autotest-capability`. This exists in order to support porting |
| 143 | existing Autotest-based video tests to Tast. Do not depend on capabilities from |
| 144 | outside of video tests. |
| 145 | |
Daniel Erat | e4ea299 | 2019-04-13 01:28:45 | [diff] [blame] | 146 | [autocap package]: https://godoc.org/chromium.googlesource.com/chromiumos/platform/tast.git/src/chromiumos/tast/autocaps/ |