1#
2# Copyright (C) 2018 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17# The default Partner Android Build (PAB) public account.
18# To obtain access permission, please reach out to Android partner engineering
19# department of Google LLC.
20
21from vti.test_serving.proto import TestScheduleConfigMessage_pb2 as pb
22
23_DEFAULT_ACCOUNT_ID = '543365459'
24
25# The default Partner Android Build (PAB) internal account.
26_DEFAULT_ACCOUNT_ID_INTERNAL = '541462473'
27
28# The key value used for getting a fetched .zip android img file.
29FULL_ZIPFILE = "full-zipfile"
30# The key of an item that stores the unziped files of a full image zip file.
31FULL_ZIPFILE_DIR = "full-zipfile-dir"
32
33# The key of an item that stores the fetch GSI image (.zip) file.
34GSI_ZIPFILE = "gsi-zipfile"
35# The key of an item that stores the unziped files of a GSI image zip file.
36GSI_ZIPFILE_DIR = "gsi-zipfile-dir"
37
38# The default value for "flash --current".
39_DEFAULT_FLASH_IMAGES = [
40    FULL_ZIPFILE,
41    FULL_ZIPFILE_DIR,
42    "bootloader.img",
43    "boot.img",
44    "cache.img",
45    "radio.img",
46    "system.img",
47    "userdata.img",
48    "vbmeta.img",
49    "vendor.img",
50]
51
52# The environment variable for default serial numbers.
53_ANDROID_SERIAL = "ANDROID_SERIAL"
54
55_DEVICE_STATUS_DICT = {
56    "unknown": 0,
57    "fastboot": 1,
58    "online": 2,
59    "ready": 3,
60    "use": 4,
61    "error": 5,
62    "no-response": 6
63}
64
65_STORAGE_TYPE_DICT = {
66    pb.UNKNOWN_BUILD_STORAGE_TYPE: "unknown",
67    pb.BUILD_STORAGE_TYPE_PAB: "pab",
68    pb.BUILD_STORAGE_TYPE_GCS: "gcs",
69}
70
71_STORAGE_TYPE_DICT_REVERSE = {
72    "unknown": pb.UNKNOWN_BUILD_STORAGE_TYPE,
73    "pab": pb.BUILD_STORAGE_TYPE_PAB,
74    "gcs": pb.BUILD_STORAGE_TYPE_GCS,
75}
76
77# Default SPL date, used for gsispl command
78_SPL_DEFAULT_DAY = 5
79
80# Maximum number of leased jobs per host.
81_MAX_LEASED_JOBS = 14
82
83# Defualt access point for dut wifi_on command.
84_DEFAULT_WIFI_AP = "GoogleGuest"
85
86# SoC name list.
87K39TV1_BSP = "k39tv1_bsp"
88K39TV1_BSP_1G = "k39tv1_bsp_1g"
89
90SDM845 = "sdm845"
91
92UNIVERSAL9810 = "universal9810"
93
94# Lib files from SDM845 vendor system image need to be re-pushed
95# into GSI system image to boot the devices up properly.
96SDM845_LIB_LIST = [
97    "libdrm.so",
98    "vendor.display.color@1.0.so",
99    "vendor.display.config@1.0.so",
100    "vendor.display.config@1.1.so",
101    "vendor.display.postproc@1.0.so",
102    "vendor.qti.hardware.perf@1.0.so",
103]
104
105# Dir name in which the addtional files need to be repacked.
106_ADDITIONAL_FILES_DIR = "additional_file"
107
108# Relative path to the "results" directory from the tools directory.
109_RESULTS_BASE_PATH = "../results"
110
111# Test result file contains invoked test plan results.
112_TEST_RESULT_XML = "test_result.xml"
113
114_LOG_RESULT_XML = "log-result.xml"
115
116# XML tag name whose attributes represent a module.
117_MODULE_TAG = "Module"
118
119# XML tag name whose attribute is test plan.
120_RESULT_TAG = "Result"
121
122# XML tag name whose attributes represent a test case in a module.
123_TESTCASE_TAG = "TestCase"
124
125# XML tag name whose attributes represent a test result in a test case.
126_TEST_TAG = "Test"
127
128# XML tag name whose attributes are about the build info of the device.
129_BUILD_TAG = "Build"
130
131# XML tag name whose attributes are pass/fail count, modules run/total count.
132_SUMMARY_TAG = "Summary"
133
134# The key value for retrieving test plan and etc. from the result xml
135_SUITE_PLAN_ATTR_KEY = "suite_plan"
136
137_SUITE_BUILD_NUM_ATTR_KEY = "suite_build_number"
138
139_SUITE_VERSION_ATTR_KEY = "suite_version"
140
141_HOST_NAME_ATTR_KEY = "host_name"
142
143_START_TIME_ATTR_KEY = "start"
144
145_START_DISPLAY_TIME_ATTR_KEY = "start_display"
146
147_END_TIME_ATTR_KEY = "end"
148
149_END_DISPLAY_TIME_ATTR_KEY = "end_display"
150
151_SUITE_NAME_ATTR_KEY = "suite_name"
152
153# The key value for retrieving build fingerprint values from the result xml.
154_ABIS_ATTR_KEY = "build_abis"
155
156_FINGERPRINT_ATTR_KEY = "build_fingerprint"
157
158_SYSTEM_FINGERPRINT_ATTR_KEY = "build_system_fingerprint"
159
160_VENDOR_FINGERPRINT_ATTR_KEY = "build_vendor_fingerprint"
161
162# The key value for retrieving passed testcase count
163_PASSED_ATTR_KEY = "pass"
164
165# The key value for retrieving failed testcase count
166_FAILED_ATTR_KEY = "failed"
167
168# The key value for retrieving total module count
169_MODULES_TOTAL_ATTR_KEY = "modules_total"
170
171# The key value for retrieving run module count
172_MODULES_DONE_ATTR_KEY = "modules_done"
173
174# The key value for retrieving name of a test, testcase, or module.
175_NAME_ATTR_KEY = "name"
176
177# The key value for retrieving ABI of a module.
178_ABI_ATTR_KEY = "abi"
179
180# The key value for retrieving result of a test.
181_RESULT_ATTR_KEY = "result"
182
183# VTSLAB package version file
184_VTSLAB_VERSION_TXT = "version.txt"
185
186_VTSLAB_VERSION_DEFAULT_VALUE = "000000_000000:00000000"
187
188# String representations of the artifact types can be fetched.
189_ARTIFACT_TYPE_DEVICE = "device"
190_ARTIFACT_TYPE_GSI = "gsi"
191_ARTIFACT_TYPE_TEST_SUITE = "test_suite"
192# Artifact type that are usually for custom tools fetched from GCS.
193_ARTIFACT_TYPE_INFRA = "infra"
194
195# List of artifact types.
196_ARTIFACT_TYPE_LIST = [
197    _ARTIFACT_TYPE_DEVICE,
198    _ARTIFACT_TYPE_GSI,
199    _ARTIFACT_TYPE_TEST_SUITE,
200    _ARTIFACT_TYPE_INFRA,
201]
202# Directory relative to the home directory, in which the devices' lock files will be.
203_DEVLOCK_DIR = ".devlock"
204
205# Default timeout for "adb reboot/fastboot getvar" command in secs.
206DEFAULT_DEVICE_TIMEOUT_SECS = 300
207
208# Maximum number of concurrent adb/fastboot processes.
209MAX_ADB_FASTBOOT_PROCESS = 2
210
211# Default number of the actual retry runs for the "retry" command.
212DEFAULT_RETRY_COUNT = 30