• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2021 The ChromiumOS Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5syntax = "proto3";
6
7package chromiumos.test.api;
8
9option go_package = "go.chromium.org/chromiumos/config/go/test/api";
10
11import "chromiumos/build/api/dlc.proto";
12import "chromiumos/build/api/firmware_config.proto";
13import "chromiumos/build/api/portage.proto";
14import "chromiumos/storage_path.proto";
15import "google/protobuf/any.proto";
16
17// ProvisionState defines all of the installable (provisionable) elements on a
18// ChromeOS test device as part of device setup for test operations.
19//
20// This record is used to define the following:
21//   How devices should be provisioned based on the client's respective needs.
22//     E.g.
23//       CrOS CI - System image only
24//       Lacros CI - System image + Lacros component
25//   How device provisioning state is reported for corresponding test results.
26//     Every test result will link to a provisioning record for
27//     analysis/debugging.
28message ProvisionState {
29  // String encoded id that uniquely reflects a given ProvisionState.
30  // This is used for both scheduling and reporting purposes.
31  // For scheduling, is used to determine if a device is in the requested
32  // provisioning state for testing or it needs to be reprovisioned.
33  // For reporting, this can be used to compare the entire provision state
34  // (in a summarized string) across different test results.
35  message Id {
36    string value = 1;
37  }
38  Id id = 1;
39
40  chromiumos.build.api.FirmwareConfig firmware = 2;
41
42  message SystemImage {
43    // Unique version used in constructing the overall Id
44    string version = 1;
45    StoragePath system_image_path = 2;
46    // List of DLCs that were built/archived for a given system image and are
47    // installed as part of provisioning.
48    repeated chromiumos.build.api.Dlc.Id dlcs = 3;
49
50    // An optional tarball to be extracted at the root of the filesystem to
51    // overwrite existing binary payloads.
52    StoragePath overwrite_payload = 4;
53  }
54  SystemImage system_image = 3;
55
56  message Package {
57    // Package names must match actual portage package names that
58    // exist in a given ChromeOS test image.
59    // Package versions may be in any scheme that is relevant to the clients
60    // versioning scheme (e.g. Lacros build versions).
61    chromiumos.build.api.Portage.Package portage_package = 1;
62    StoragePath package_path = 2;
63  }
64  repeated Package packages = 4;
65
66  // Prevents device reboot during system image provisioning.
67  bool prevent_reboot = 5;
68
69  // update_firmware will update OS bundled firmware(RW only) during the provision.
70  // Please note this firmware update only update RW firmware that built in the
71  // target_build OS image and it is different from firmware provision which
72  // download and update a separate firmware image based on request.
73  bool update_firmware = 6;
74
75  // Use force to pass "--force" to futility, which skips the TPM checks.
76  bool firmware_force = 7;
77
78  // If True, provision firmware over servo; information about
79  // servo to use will be pulled from a `Dut` proto, that will be
80  // requested from InventoryService.
81  // If False, SSH to the DUT and provision it directly.
82  bool use_servo = 8;
83
84  // Specific metadata for provisioning android etc for companion dut
85  google.protobuf.Any provision_metadata = 9;
86}
87
88// User configurable provisioning settings.  These inform the final
89// ProvisionState that's requested from the provisioning service.
90message ProvisionConfig {
91    chromiumos.build.api.FirmwareConfig  firmware = 1;
92    repeated chromiumos.build.api.Dlc.Id dlcs     = 2;
93    repeated ProvisionState.Package      packages = 3;
94
95    // Variant on the primary build target to test with.
96    //
97    // E.g.: If we were targeting a 'coral' board for testing, setting this to
98    // 'kernelnext' would use the coral-kernelnext image from the build for
99    // testing.
100    //
101    // Note that this looks for an overlay called <build target>-<variant>,
102    // (in the above example, there is an overlay called 'coral-kernelnext').
103    // If you are targeting a non-base profile of a build target, use the
104    // 'profile' field.
105    string board_variant = 4;
106
107    // Profile to test with. If not set, the 'base' profile is used.
108    //
109    // E.g. If you are targeting a 'amd64-generic' board for testing, setting
110    // this to 'asan' would use the amd64-generic ASAN image for testing.
111    //
112    // Note that if you are looking to use the 'base' profile of a variant
113    // overlay ('coral-kernelnext') use the 'board_variant' field above.
114    string profile = 6;
115
116    // Optional tarball to pass through to provisioning.
117    StoragePath overwrite_payload = 5;
118
119    // Optional config for one companion DUT. Note that this field is NOT used
120    // to determine whether the DUT is a companion, meaning setting the field on
121    // the first (primary) DutTarget is invalid and will be ignored. The field
122    // only provides additional provision config that may affect how the
123    // underlying DUT companion should be provisioned.
124    CompanionConfig companion = 7;
125}
126
127// Provision config for a companion DUT to override the default behavior, which
128// assumes the companion is a ChromeOS build and tries to find a build with
129// the same buildset (e.g. the same CQ orchestrator run).
130message CompanionConfig {
131  // CrosBuild is used when the companion DUT is a ChromeOS device and needs to
132  // be provisioned with a build that is different from the default build found
133  // within the context (e.g. a CQ run).
134  // The initial implementation of multi-dut doesn't support Cros provision
135  // overriding. Fields will be added when requirements become clear.
136  message CrosBuild {}
137
138  // Android is used when the companion DUT is an Android device. As ChromeOS
139  // doesn't build Android images, the config must provide information for each
140  // Android companion.
141  message Android {
142    // Optional. The android image version for android provisioning.
143    string android_image_version = 1;
144
145    // gms core cipd package for android provisioning. Recommend to use
146    // "latest_stable".
147    // See https://chrome-infra-packages.appspot.com/p/chromiumos/infra/skylab/third_party/gmscore/gmscore_prodsc_arm64_xxhdpi_release_apk/+/
148    string gms_core_package = 2;
149  }
150
151  oneof config {
152    // Optional. Only used when need to override the default provision behavior
153    // for ChromeOS device.
154    CrosBuild cros_build = 1;
155    // Mandatory for Android device.
156    Android android = 2;
157  }
158}
159