• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2022 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
9import "chromiumos/test/api/cros_provision_cli.proto";
10import "chromiumos/test/api/android_provision.proto";
11import "chromiumos/test/lab/api/ip_endpoint.proto";
12
13option go_package = "go.chromium.org/chromiumos/config/go/test/api";
14
15// Wrapper message of one of container-specific templates
16// NEXT TAG: 12
17message Template {
18  oneof container {
19    CrosDutTemplate cros_dut = 1;
20    CrosProvisionTemplate cros_provision = 2;
21    CrosTestTemplate cros_test = 3;
22    CrosPublishTemplate cros_publish = 4;
23    CrosFirmwareProvisionTemplate cros_fw_provision = 5;
24    CacheServerTemplate cache_server = 6;
25    CrosTestFinderTemplate cros_test_finder = 7;
26    AndroidProvisionTemplate android_provision = 8;
27    GenericTemplate generic = 9;
28    CrosVMProvisionTemplate cros_vm_provision = 10;
29    PostProcessTemplate post_process = 11;
30  }
31}
32
33// Plain template to demonstrate the usage of cros-dut container. All fields are
34// required.
35message CrosDutTemplate {
36  // Reserved for network and artifact_dir that have been moved to upper level.
37  reserved 1, 2;
38  // Cache server address
39  chromiumos.test.lab.api.IpEndpoint cache_server = 3;
40  // Dut ssh address
41  chromiumos.test.lab.api.IpEndpoint dut_address = 4;
42}
43
44// Plain template to demonstrate the usage of cros-provision container. All
45// fields are required.
46message CrosProvisionTemplate {
47  // Reserved for network and artifact_dir that have been moved to upper level.
48  reserved 1, 2;
49  // CrosProvisionRequest payload can have template placeholders, to be populated
50  // and write to a json file inside the artifact directory and pass along to
51  // cros-provision server. Note that inventory_server is no longer needed
52  chromiumos.test.api.CrosProvisionRequest input_request = 3;
53}
54
55// Plain template to demonstrate the usage of android-provision container. All
56// fields are required.
57//
58// TODO (b/272519698) To be made generic with CrosProvisionTemplate.
59message AndroidProvisionTemplate {
60  // AndroidProvisionRequest payload can have template placeholders, to be populated
61  // and write to a json file inside the artifact directory and pass along to
62  // android-provision server.
63  chromiumos.test.api.AndroidProvisionRequest input_request = 1;
64}
65
66// Plain template to demonstrate the usage of cros-test container. network and
67// artifact_dir in the StartTemplatedContainer message are required.
68// artifact_dir: Host directory, two sub-directories will be created and mounted
69// into the container. `<artifact_dir>/cros-test/cros-test` for logs and
70// `<artifact_dir>/cros-test/results` for result artifacts to be published
71message CrosTestTemplate {
72  // Reserved for network and artifact_dir that have been moved to upper level.
73  reserved 1, 2;
74}
75
76// Plain template to demonstrate the usage of cros-test-finder container. All fields are
77// required.
78message CrosTestFinderTemplate {
79}
80
81// Plain template to demonstrate the usage of vm-provision container. All fields are
82// required.
83message CrosVMProvisionTemplate {
84}
85
86// Generic template to demonstrate the usage of any container.
87message GenericTemplate {
88  // Name of the binary called within the container.
89  string binary_name = 1;
90  // Args passed to the call to the binary.
91  repeated string binary_args = 2;
92  // Directory mount from the perspective of the docker container.
93  string docker_artifact_dir = 3;
94  repeated string additional_volumes = 4;
95  repeated string expose = 5;
96  repeated string env = 6;
97}
98
99// Plain template to demonstrate the usage of cache-server container.
100message CacheServerTemplate {
101  // Required if the container image needs authentication.
102  oneof application_default_credentials {
103    // This is the full path of service account keyfile in JSON. When provided,
104    // the template will find mount the directory, and export the environment
105    // variable `GOOGLE_APPLICATION_CREDENTIALS` to point it to the keyfile.
106    string service_account_keyfile = 1;
107  }
108}
109
110// Plain template to demonstrate the usage of cros-publish container. publish_type
111// is required. publish_src_dir is required for GCS, TKO, and CPCON publish types.
112message CrosPublishTemplate {
113  enum PublishType {
114    PUBLISH_UNSPECIFIED = 0;
115    PUBLISH_GCS = 1;
116    PUBLISH_TKO = 2;
117    PUBLISH_RDB = 3;
118    PUBLISH_CPCON = 4;
119  }
120
121  PublishType publish_type = 1;
122  // Source directory of artifacts that needs to be published.
123  // If provided, will be mounted to "/tmp/<publish_type>-publish-test-artifacts/"
124  // (Ex: gcs-publish-test-artifacts). Required for GCS, TKO, and CPCON publish types.
125  string publish_src_dir = 2;
126}
127
128// Plain template to demonstrate the usage of cros-fw-provision container.
129message CrosFirmwareProvisionTemplate {
130}
131
132// Plain template to demonstrate the usage of post-process container.
133// NEXT TAG: 2
134message PostProcessTemplate {
135  // Source directory of artifacts that needs to be processed.
136  // This is also required to specify the location where the artifacts should
137  // be mounted.
138  string post_process_src_dir = 1;
139}
140