Keun Soo Yim | b293fdb | 2016-09-21 16:03:44 -0700 | [diff] [blame] | 1 | #!/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 Yim | b293fdb | 2016-09-21 16:03:44 -0700 | [diff] [blame] | 16 | """This module holds constants used by the driver.""" |
| 17 | BRANCH_PREFIX = "git_" |
| 18 | BUILD_TARGET_MAPPING = { |
Kevin Cheng | b596388 | 2018-05-09 00:06:27 -0700 | [diff] [blame] | 19 | # 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 Yim | b293fdb | 2016-09-21 16:03:44 -0700 | [diff] [blame] | 23 | } |
Sam Chiu | 81bdc65 | 2018-06-29 18:45:08 +0800 | [diff] [blame] | 24 | SPEC_NAMES = { |
| 25 | "nexus5", "nexus6", "nexus7_2012", "nexus7_2013", "nexus9", "nexus10" |
| 26 | } |
Keun Soo Yim | b293fdb | 2016-09-21 16:03:44 -0700 | [diff] [blame] | 27 | |
| 28 | DEFAULT_SERIAL_PORT = 1 |
| 29 | LOGCAT_SERIAL_PORT = 2 |
Kevin Cheng | 3087af5 | 2018-08-13 13:26:50 -0700 | [diff] [blame] | 30 | |
herbertxue | df01c42 | 2018-09-06 19:52:52 +0800 | [diff] [blame] | 31 | # Remote image parameters |
| 32 | BUILD_TARGET = "build_target" |
| 33 | BUILD_BRANCH = "build_branch" |
| 34 | BUILD_ID = "build_id" |
| 35 | |
Kevin Cheng | 3087af5 | 2018-08-13 13:26:50 -0700 | [diff] [blame] | 36 | # AVD types |
| 37 | TYPE_GCE = "gce" |
| 38 | TYPE_CF = "cuttlefish" |
| 39 | TYPE_GF = "goldfish" |
Sam Chiu | 81bdc65 | 2018-06-29 18:45:08 +0800 | [diff] [blame] | 40 | |
herbertxue | 2625b04 | 2018-08-16 23:28:20 +0800 | [diff] [blame] | 41 | # Image types |
| 42 | IMAGE_SRC_REMOTE = "remote_image" |
| 43 | IMAGE_SRC_LOCAL = "local_image" |
| 44 | |
herbertxue | b617e8a | 2018-08-22 10:02:19 +0800 | [diff] [blame] | 45 | # AVD types in build target |
| 46 | AVD_TYPES_MAPPING = { |
| 47 | TYPE_GCE: "gce", |
| 48 | TYPE_CF: "cf", |
| 49 | TYPE_GF: "sdk", |
| 50 | } |
| 51 | |
cylan | abe0a3a | 2018-08-16 18:50:09 +0800 | [diff] [blame] | 52 | # Instance types |
| 53 | INSTANCE_TYPE_REMOTE = "remote" |
| 54 | INSTANCE_TYPE_LOCAL = "local" |
| 55 | |
| 56 | # Flavor types |
| 57 | FLAVOR_PHONE = "phone" |
| 58 | FLAVOR_AUTO = "auto" |
| 59 | FLAVOR_WEAR = "wear" |
| 60 | FLAVOR_TV = "tv" |
| 61 | FLAVOR_IOT = "iot" |
| 62 | FLAVOR_TABLET = "tablet" |
| 63 | FLAVOR_TABLET_3G = "tablet_3g" |
| 64 | ALL_FLAVORS = [ |
| 65 | FLAVOR_PHONE, FLAVOR_AUTO, FLAVOR_WEAR, FLAVOR_TV, FLAVOR_IOT, |
| 66 | FLAVOR_TABLET, FLAVOR_TABLET_3G |
| 67 | ] |
| 68 | |
Sam Chiu | c64f343 | 2018-08-17 11:19:06 +0800 | [diff] [blame] | 69 | # HW Property |
| 70 | HW_ALIAS_CPUS = "cpu" |
| 71 | HW_ALIAS_RESOLUTION = "resolution" |
| 72 | HW_ALIAS_DPI = "dpi" |
| 73 | HW_ALIAS_MEMORY = "memory" |
| 74 | HW_ALIAS_DISK = "disk" |
| 75 | HW_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 | ) |
| 83 | HW_PROPERTIES = [HW_ALIAS_CPUS, HW_ALIAS_RESOLUTION, HW_ALIAS_DPI, |
| 84 | HW_ALIAS_MEMORY, HW_ALIAS_DISK] |
herbertxue | df01c42 | 2018-09-06 19:52:52 +0800 | [diff] [blame] | 85 | HW_X_RES = "x_res" |
| 86 | HW_Y_RES = "y_res" |
Sam Chiu | c64f343 | 2018-08-17 11:19:06 +0800 | [diff] [blame] | 87 | |
Sam Chiu | 81bdc65 | 2018-06-29 18:45:08 +0800 | [diff] [blame] | 88 | USER_ANSWER_YES = {"y", "yes", "Y"} |
Sam Chiu | afbc658 | 2018-09-04 20:47:13 +0800 | [diff] [blame] | 89 | |
| 90 | # Cuttlefish groups |
| 91 | LIST_CF_USER_GROUPS = ["kvm", "libvirt", "cvdnetwork"] |
| 92 | |
cylan | 6671372 | 2018-10-06 01:38:26 +0800 | [diff] [blame] | 93 | DEFAULT_VNC_PORT = 6444 |
Kevin Cheng | 065fdd6 | 2018-10-09 14:27:22 -0700 | [diff] [blame] | 94 | DEFAULT_ADB_PORT = 6520 |
| 95 | VNC_PORT = "vnc_port" |
| 96 | ADB_PORT = "adb_port" |
Sam Chiu | afbc658 | 2018-09-04 20:47:13 +0800 | [diff] [blame] | 97 | |
herbertxue | 6100709 | 2018-10-10 11:56:57 +0800 | [diff] [blame] | 98 | CMD_LAUNCH_CVD = "launch_cvd" |
herbertxue | 07293a3 | 2018-11-05 20:40:11 +0800 | [diff] [blame] | 99 | CMD_STOP_CVD = "stop_cvd" |
Sam Chiu | afbc658 | 2018-09-04 20:47:13 +0800 | [diff] [blame] | 100 | ENV_ANDROID_BUILD_TOP = "ANDROID_BUILD_TOP" |
cylan | 6671372 | 2018-10-06 01:38:26 +0800 | [diff] [blame] | 101 | |
Kevin Cheng | 065fdd6 | 2018-10-09 14:27:22 -0700 | [diff] [blame] | 102 | LOCALHOST_ADB_SERIAL = "127.0.0.1:%d" |
Kevin Cheng | 835a415 | 2018-10-11 10:46:57 -0700 | [diff] [blame] | 103 | |
| 104 | SSH_BIN = "ssh" |
| 105 | ADB_BIN = "adb" |
Sam Chiu | 5029a25 | 2018-11-06 20:54:13 +0800 | [diff] [blame] | 106 | |
| 107 | LABEL_CREATE_BY = "created_by" |
Sam Chiu | 5029a25 | 2018-11-06 20:54:13 +0800 | [diff] [blame] | 108 | |
| 109 | # for list and delete cmd |
| 110 | INS_KEY_NAME = "name" |
| 111 | INS_KEY_FULLNAME = "full_name" |
| 112 | INS_KEY_STATUS = "status" |
| 113 | INS_KEY_DISPLAY = "display" |
| 114 | INS_KEY_IP = "ip" |
| 115 | INS_KEY_ADB = "adb" |
| 116 | INS_KEY_VNC = "vnc" |
| 117 | INS_KEY_CREATETIME = "creationTimestamp" |
Sam Chiu | 56c5889 | 2018-10-25 09:53:19 +0800 | [diff] [blame] | 118 | INS_KEY_AVD_TYPE = "avd_type" |
| 119 | INS_KEY_AVD_FLAVOR = "flavor" |
Sam Chiu | 5029a25 | 2018-11-06 20:54:13 +0800 | [diff] [blame] | 120 | INS_KEY_IS_LOCAL = "remote" |
| 121 | INS_STATUS_RUNNING = "RUNNING" |
| 122 | LOCAL_INS_NAME = "local-instance" |