blob: 88cbe339651951ad6e7e337c4658f4f71a1ec235 [file] [log] [blame]
Keun Soo Yimb293fdb2016-09-21 16:03:44 -07001#!/usr/bin/env python
2#
3# Copyright 2016 - The Android Open Source Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
Keun Soo Yimb293fdb2016-09-21 16:03:44 -070016"""This module holds constants used by the driver."""
17BRANCH_PREFIX = "git_"
18BUILD_TARGET_MAPPING = {
Kevin Chengb5963882018-05-09 00:06:27 -070019 # TODO: Add aosp goldfish targets and internal cf targets to vendor code
20 # base.
21 "aosp_phone": "aosp_cf_x86_phone-userdebug",
22 "aosp_tablet": "aosp_cf_x86_tablet-userdebug",
Keun Soo Yimb293fdb2016-09-21 16:03:44 -070023}
Sam Chiu81bdc652018-06-29 18:45:08 +080024SPEC_NAMES = {
25 "nexus5", "nexus6", "nexus7_2012", "nexus7_2013", "nexus9", "nexus10"
26}
Keun Soo Yimb293fdb2016-09-21 16:03:44 -070027
28DEFAULT_SERIAL_PORT = 1
29LOGCAT_SERIAL_PORT = 2
Kevin Cheng3087af52018-08-13 13:26:50 -070030
herbertxuedf01c422018-09-06 19:52:52 +080031# Remote image parameters
32BUILD_TARGET = "build_target"
33BUILD_BRANCH = "build_branch"
34BUILD_ID = "build_id"
35
Kevin Cheng3087af52018-08-13 13:26:50 -070036# AVD types
37TYPE_GCE = "gce"
38TYPE_CF = "cuttlefish"
39TYPE_GF = "goldfish"
Sam Chiu81bdc652018-06-29 18:45:08 +080040
herbertxue2625b042018-08-16 23:28:20 +080041# Image types
42IMAGE_SRC_REMOTE = "remote_image"
43IMAGE_SRC_LOCAL = "local_image"
44
herbertxueb617e8a2018-08-22 10:02:19 +080045# AVD types in build target
46AVD_TYPES_MAPPING = {
47 TYPE_GCE: "gce",
48 TYPE_CF: "cf",
49 TYPE_GF: "sdk",
50}
51
cylanabe0a3a2018-08-16 18:50:09 +080052# Instance types
53INSTANCE_TYPE_REMOTE = "remote"
54INSTANCE_TYPE_LOCAL = "local"
55
56# Flavor types
57FLAVOR_PHONE = "phone"
58FLAVOR_AUTO = "auto"
59FLAVOR_WEAR = "wear"
60FLAVOR_TV = "tv"
61FLAVOR_IOT = "iot"
62FLAVOR_TABLET = "tablet"
63FLAVOR_TABLET_3G = "tablet_3g"
64ALL_FLAVORS = [
65 FLAVOR_PHONE, FLAVOR_AUTO, FLAVOR_WEAR, FLAVOR_TV, FLAVOR_IOT,
66 FLAVOR_TABLET, FLAVOR_TABLET_3G
67]
68
Sam Chiuc64f3432018-08-17 11:19:06 +080069# HW Property
70HW_ALIAS_CPUS = "cpu"
71HW_ALIAS_RESOLUTION = "resolution"
72HW_ALIAS_DPI = "dpi"
73HW_ALIAS_MEMORY = "memory"
74HW_ALIAS_DISK = "disk"
75HW_PROPERTIES_CMD_EXAMPLE = (
76 " %s:2,%s:1280x700,%s:160,%s:2g,%s:2g" %
77 (HW_ALIAS_CPUS,
78 HW_ALIAS_RESOLUTION,
79 HW_ALIAS_DPI,
80 HW_ALIAS_MEMORY,
81 HW_ALIAS_DISK)
82)
83HW_PROPERTIES = [HW_ALIAS_CPUS, HW_ALIAS_RESOLUTION, HW_ALIAS_DPI,
84 HW_ALIAS_MEMORY, HW_ALIAS_DISK]
herbertxuedf01c422018-09-06 19:52:52 +080085HW_X_RES = "x_res"
86HW_Y_RES = "y_res"
Sam Chiuc64f3432018-08-17 11:19:06 +080087
Sam Chiu81bdc652018-06-29 18:45:08 +080088USER_ANSWER_YES = {"y", "yes", "Y"}
Sam Chiuafbc6582018-09-04 20:47:13 +080089
90# Cuttlefish groups
91LIST_CF_USER_GROUPS = ["kvm", "libvirt", "cvdnetwork"]
92
cylan66713722018-10-06 01:38:26 +080093DEFAULT_VNC_PORT = 6444
Kevin Cheng065fdd62018-10-09 14:27:22 -070094DEFAULT_ADB_PORT = 6520
95VNC_PORT = "vnc_port"
96ADB_PORT = "adb_port"
Sam Chiuafbc6582018-09-04 20:47:13 +080097
herbertxue61007092018-10-10 11:56:57 +080098CMD_LAUNCH_CVD = "launch_cvd"
Sam Chiuafbc6582018-09-04 20:47:13 +080099ENV_ANDROID_BUILD_TOP = "ANDROID_BUILD_TOP"
cylan66713722018-10-06 01:38:26 +0800100
Kevin Cheng065fdd62018-10-09 14:27:22 -0700101LOCALHOST_ADB_SERIAL = "127.0.0.1:%d"
Kevin Cheng835a4152018-10-11 10:46:57 -0700102
103SSH_BIN = "ssh"
104ADB_BIN = "adb"