Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Issue 1823193002: add GetBattorPathFromPhoneSerial to find_usb_devices (Closed)

Created:
4 years, 9 months ago by alexandermont
Modified:
4 years, 8 months ago
CC:
catapult-reviews_chromium.org
Base URL:
git@github.com:catapult-project/catapult@master
Target Ref:
refs/heads/master
Project:
catapult
Visibility:
Public.

Description

Add function GetBattorPathFromPhoneSerial() to find_usb_devices. Adds a function GetBattorPathFromPhoneSerial() which takes a serial number of a phone and returns that TTY path (e.g. /dev/ttyUSB0) that is used to communicate with the BattOr corresponding to that port. This is necessary for tracing agents to get battery traces from the BattOr. See, e.g. go/battor-systrace, go/clock-sync-design. Committed: https://chromium.googlesource.com/external/github.com/catapult-project/catapult/+/58dc3f59eca9a1f2a3e38d51aee8f3d3bb3bec5a

Patch Set 1 #

Total comments: 9

Patch Set 2 : changes from code review #

Patch Set 3 : add ability to specify explicit serial map #

Total comments: 2

Patch Set 4 : update docs #

Total comments: 20

Patch Set 5 : add new feature to add a fixed mapping #

Total comments: 17

Patch Set 6 : simplify api #

Patch Set 7 : add standalone script for update #

Total comments: 16

Patch Set 8 : changes from code review #

Total comments: 2

Patch Set 9 : add named class #

Total comments: 14

Patch Set 10 : updates from code review #

Total comments: 2

Patch Set 11 : fix nits #

Total comments: 1

Patch Set 12 : fix test #

Total comments: 4

Patch Set 13 : fix test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+490 lines, -129 lines) Patch
A devil/devil/utils/battor_device_mapping.py View 1 2 3 4 5 6 7 8 9 1 chunk +217 lines, -0 lines 0 comments Download
M devil/devil/utils/find_usb_devices.py View 1 2 3 4 5 6 7 10 chunks +14 lines, -112 lines 0 comments Download
M devil/devil/utils/find_usb_devices_test.py View 1 2 3 4 5 6 7 8 9 10 11 12 8 chunks +116 lines, -17 lines 0 comments Download
A devil/devil/utils/test/data/test_serial_map.json View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
A devil/devil/utils/update_mapping.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +44 lines, -0 lines 0 comments Download
A devil/devil/utils/usb_hubs.py View 1 2 3 4 5 6 7 1 chunk +98 lines, -0 lines 0 comments Download

Messages

Total messages: 60 (15 generated)
alexandermont
4 years, 9 months ago (2016-03-22 18:11:48 UTC) #2
rnephew (Reviews Here)
https://codereview.chromium.org/1823193002/diff/1/devil/devil/utils/battor_mapping_test.py File devil/devil/utils/battor_mapping_test.py (right): https://codereview.chromium.org/1823193002/diff/1/devil/devil/utils/battor_mapping_test.py#newcode1 devil/devil/utils/battor_mapping_test.py:1: #!/usr/bin/env python Is it possible for these tests to ...
4 years, 9 months ago (2016-03-22 18:43:14 UTC) #4
alexandermont
https://codereview.chromium.org/1823193002/diff/1/devil/devil/utils/find_usb_devices.py File devil/devil/utils/find_usb_devices.py (right): https://codereview.chromium.org/1823193002/diff/1/devil/devil/utils/find_usb_devices.py#newcode10 devil/devil/utils/find_usb_devices.py:10: from devil.utils import cmd_helper, usb_hubs, lsusb On 2016/03/22 at ...
4 years, 9 months ago (2016-03-22 19:10:56 UTC) #6
alexandermont
4 years, 9 months ago (2016-03-22 22:16:14 UTC) #8
alexandermont
4 years, 9 months ago (2016-03-22 22:26:01 UTC) #10
Zhen Wang
https://codereview.chromium.org/1823193002/diff/40001/devil/devil/utils/find_usb_devices.py File devil/devil/utils/find_usb_devices.py (right): https://codereview.chromium.org/1823193002/diff/40001/devil/devil/utils/find_usb_devices.py#newcode535 devil/devil/utils/find_usb_devices.py:535: def GetBattorPathFromPhoneSerial(serial, hub_types=None, serial_map=None): So this is the interface ...
4 years, 9 months ago (2016-03-22 23:51:37 UTC) #11
alexandermont
https://codereview.chromium.org/1823193002/diff/40001/devil/devil/utils/find_usb_devices.py File devil/devil/utils/find_usb_devices.py (right): https://codereview.chromium.org/1823193002/diff/40001/devil/devil/utils/find_usb_devices.py#newcode535 devil/devil/utils/find_usb_devices.py:535: def GetBattorPathFromPhoneSerial(serial, hub_types=None, serial_map=None): On 2016/03/22 at 23:51:37, Zhen ...
4 years, 9 months ago (2016-03-23 17:42:59 UTC) #12
nednguyen
I defer to John & Randy for reviewing this https://codereview.chromium.org/1823193002/diff/60001/devil/devil/utils/find_usb_devices.py File devil/devil/utils/find_usb_devices.py (right): https://codereview.chromium.org/1823193002/diff/60001/devil/devil/utils/find_usb_devices.py#newcode638 devil/devil/utils/find_usb_devices.py:638: ...
4 years, 9 months ago (2016-03-24 02:04:21 UTC) #13
alexandermont
On 2016/03/24 at 02:04:21, nednguyen wrote: > I defer to John & Randy for reviewing ...
4 years, 9 months ago (2016-03-24 16:51:12 UTC) #15
alexandermont
4 years, 9 months ago (2016-03-24 16:51:28 UTC) #16
jbudorick
https://codereview.chromium.org/1823193002/diff/60001/devil/devil/utils/find_usb_devices.py File devil/devil/utils/find_usb_devices.py (right): https://codereview.chromium.org/1823193002/diff/60001/devil/devil/utils/find_usb_devices.py#newcode57 devil/devil/utils/find_usb_devices.py:57: class BattorError(Exception): This should at least inherit from BaseError: ...
4 years, 9 months ago (2016-03-24 17:34:10 UTC) #17
rnephew (Reviews Here)
https://codereview.chromium.org/1823193002/diff/60001/devil/devil/utils/find_usb_devices.py File devil/devil/utils/find_usb_devices.py (right): https://codereview.chromium.org/1823193002/diff/60001/devil/devil/utils/find_usb_devices.py#newcode517 devil/devil/utils/find_usb_devices.py:517: """Parses a file consisting of a list of lines: ...
4 years, 9 months ago (2016-03-24 19:10:21 UTC) #18
rnephew (Reviews Here)
4 years, 9 months ago (2016-03-24 19:10:23 UTC) #19
alexandermont
https://codereview.chromium.org/1823193002/diff/60001/devil/devil/utils/find_usb_devices.py File devil/devil/utils/find_usb_devices.py (right): https://codereview.chromium.org/1823193002/diff/60001/devil/devil/utils/find_usb_devices.py#newcode57 devil/devil/utils/find_usb_devices.py:57: class BattorError(Exception): On 2016/03/24 at 17:34:09, jbudorick wrote: > ...
4 years, 9 months ago (2016-03-24 23:00:06 UTC) #20
alexandermont
https://codereview.chromium.org/1823193002/diff/80001/devil/devil/utils/usb_hubs.py File devil/devil/utils/usb_hubs.py (right): https://codereview.chromium.org/1823193002/diff/80001/devil/devil/utils/usb_hubs.py#newcode80 devil/devil/utils/usb_hubs.py:80: def _is_plugable_7port_hub(node): Note that I had to change this ...
4 years, 9 months ago (2016-03-24 23:04:22 UTC) #21
alexandermont
4 years, 9 months ago (2016-03-24 23:57:50 UTC) #22
rnephew (Reviews Here)
https://codereview.chromium.org/1823193002/diff/80001/devil/devil/utils/find_usb_devices.py File devil/devil/utils/find_usb_devices.py (right): https://codereview.chromium.org/1823193002/diff/80001/devil/devil/utils/find_usb_devices.py#newcode267 devil/devil/utils/find_usb_devices.py:267: def GetBusNumberToDeviceTreeMap(fast=False): Since everywhere seems to use fast=True, should ...
4 years, 9 months ago (2016-03-25 00:17:53 UTC) #23
nednguyen
https://codereview.chromium.org/1823193002/diff/80001/devil/devil/utils/find_usb_devices.py File devil/devil/utils/find_usb_devices.py (right): https://codereview.chromium.org/1823193002/diff/80001/devil/devil/utils/find_usb_devices.py#newcode651 devil/devil/utils/find_usb_devices.py:651: def GetBattorPathFromPhoneSerial(serial, serial_map=None, hub_types=None): In which use case a ...
4 years, 9 months ago (2016-03-25 03:05:29 UTC) #24
rnephew (Reviews Here)
On 2016/03/25 03:05:29, nednguyen wrote: > https://codereview.chromium.org/1823193002/diff/80001/devil/devil/utils/find_usb_devices.py > File devil/devil/utils/find_usb_devices.py (right): > > https://codereview.chromium.org/1823193002/diff/80001/devil/devil/utils/find_usb_devices.py#newcode651 > ...
4 years, 9 months ago (2016-03-25 04:58:58 UTC) #25
rnephew (Reviews Here)
https://codereview.chromium.org/1823193002/diff/80001/devil/devil/utils/find_usb_devices.py File devil/devil/utils/find_usb_devices.py (right): https://codereview.chromium.org/1823193002/diff/80001/devil/devil/utils/find_usb_devices.py#newcode694 devil/devil/utils/find_usb_devices.py:694: nit: no space here. https://codereview.chromium.org/1823193002/diff/80001/devil/devil/utils/find_usb_devices.py#newcode698 devil/devil/utils/find_usb_devices.py:698: if not tty_string: ...
4 years, 9 months ago (2016-03-25 05:02:42 UTC) #26
rnephew (Reviews Here)
https://codereview.chromium.org/1823193002/diff/80001/devil/devil/utils/find_usb_devices.py File devil/devil/utils/find_usb_devices.py (right): https://codereview.chromium.org/1823193002/diff/80001/devil/devil/utils/find_usb_devices.py#newcode651 devil/devil/utils/find_usb_devices.py:651: def GetBattorPathFromPhoneSerial(serial, serial_map=None, hub_types=None): > I think the plan ...
4 years, 9 months ago (2016-03-25 05:03:19 UTC) #27
nednguyen
https://codereview.chromium.org/1823193002/diff/80001/devil/devil/utils/find_usb_devices.py File devil/devil/utils/find_usb_devices.py (right): https://codereview.chromium.org/1823193002/diff/80001/devil/devil/utils/find_usb_devices.py#newcode651 devil/devil/utils/find_usb_devices.py:651: def GetBattorPathFromPhoneSerial(serial, serial_map=None, hub_types=None): On 2016/03/25 05:03:19, rnephew1 wrote: ...
4 years, 9 months ago (2016-03-27 16:44:32 UTC) #28
alexandermont
On 2016/03/24 at 23:04:22, alexandermont wrote: > https://codereview.chromium.org/1823193002/diff/80001/devil/devil/utils/usb_hubs.py > File devil/devil/utils/usb_hubs.py (right): > > https://codereview.chromium.org/1823193002/diff/80001/devil/devil/utils/usb_hubs.py#newcode80 ...
4 years, 8 months ago (2016-03-28 17:53:46 UTC) #29
alexandermont
https://codereview.chromium.org/1823193002/diff/80001/devil/devil/utils/find_usb_devices.py File devil/devil/utils/find_usb_devices.py (right): https://codereview.chromium.org/1823193002/diff/80001/devil/devil/utils/find_usb_devices.py#newcode535 devil/devil/utils/find_usb_devices.py:535: [{'phone':<phone serial 1>, 'battor':<battor serial 1>}, On 2016/03/25 at ...
4 years, 8 months ago (2016-03-28 18:47:29 UTC) #30
nednguyen
lgtm from my side. devil folks, can you review this?
4 years, 8 months ago (2016-03-29 18:51:18 UTC) #31
alexandermont
4 years, 8 months ago (2016-03-29 21:10:54 UTC) #32
rnephew (Reviews Here)
lgtm with one question. See if John wants to go over it one last time ...
4 years, 8 months ago (2016-03-30 14:39:54 UTC) #33
jbudorick
https://codereview.chromium.org/1823193002/diff/120001/devil/devil/utils/find_usb_devices.py File devil/devil/utils/find_usb_devices.py (right): https://codereview.chromium.org/1823193002/diff/120001/devil/devil/utils/find_usb_devices.py#newcode531 devil/devil/utils/find_usb_devices.py:531: def ReadSerialMapFile(filename): I should've brought this up on whatever ...
4 years, 8 months ago (2016-03-30 19:28:58 UTC) #34
alexandermont
https://codereview.chromium.org/1823193002/diff/120001/devil/devil/utils/find_usb_devices.py File devil/devil/utils/find_usb_devices.py (right): https://codereview.chromium.org/1823193002/diff/120001/devil/devil/utils/find_usb_devices.py#newcode585 devil/devil/utils/find_usb_devices.py:585: hub_types: List of hub types to check for On ...
4 years, 8 months ago (2016-03-30 23:35:53 UTC) #35
jbudorick
https://codereview.chromium.org/1823193002/diff/140001/devil/devil/utils/battor_device_mapping.py File devil/devil/utils/battor_device_mapping.py (right): https://codereview.chromium.org/1823193002/diff/140001/devil/devil/utils/battor_device_mapping.py#newcode109 devil/devil/utils/battor_device_mapping.py:109: port_to_devices = collections.defaultdict(lambda: [None, None]) A list really isn't ...
4 years, 8 months ago (2016-03-30 23:40:15 UTC) #36
alexandermont
4 years, 8 months ago (2016-03-30 23:47:21 UTC) #37
alexandermont
https://codereview.chromium.org/1823193002/diff/140001/devil/devil/utils/battor_device_mapping.py File devil/devil/utils/battor_device_mapping.py (right): https://codereview.chromium.org/1823193002/diff/140001/devil/devil/utils/battor_device_mapping.py#newcode109 devil/devil/utils/battor_device_mapping.py:109: port_to_devices = collections.defaultdict(lambda: [None, None]) On 2016/03/30 at 23:40:15, ...
4 years, 8 months ago (2016-03-31 00:23:44 UTC) #38
jbudorick
https://codereview.chromium.org/1823193002/diff/160001/devil/devil/utils/battor_device_mapping.py File devil/devil/utils/battor_device_mapping.py (right): https://codereview.chromium.org/1823193002/diff/160001/devil/devil/utils/battor_device_mapping.py#newcode21 devil/devil/utils/battor_device_mapping.py:21: return '0403:6001' in node.desc This holds for all BattOrs? ...
4 years, 8 months ago (2016-03-31 20:57:32 UTC) #39
alexandermont
https://codereview.chromium.org/1823193002/diff/160001/devil/devil/utils/battor_device_mapping.py File devil/devil/utils/battor_device_mapping.py (right): https://codereview.chromium.org/1823193002/diff/160001/devil/devil/utils/battor_device_mapping.py#newcode21 devil/devil/utils/battor_device_mapping.py:21: return '0403:6001' in node.desc On 2016/03/31 at 20:57:31, jbudorick ...
4 years, 8 months ago (2016-03-31 22:11:18 UTC) #40
jbudorick
lgtm w/ nit https://codereview.chromium.org/1823193002/diff/180001/devil/devil/utils/update_mapping.py File devil/devil/utils/update_mapping.py (right): https://codereview.chromium.org/1823193002/diff/180001/devil/devil/utils/update_mapping.py#newcode32 devil/devil/utils/update_mapping.py:32: action='store', choices=['plugable_7port'], nit: this should be ...
4 years, 8 months ago (2016-04-01 17:43:36 UTC) #41
alexandermont
https://codereview.chromium.org/1823193002/diff/180001/devil/devil/utils/update_mapping.py File devil/devil/utils/update_mapping.py (right): https://codereview.chromium.org/1823193002/diff/180001/devil/devil/utils/update_mapping.py#newcode32 devil/devil/utils/update_mapping.py:32: action='store', choices=['plugable_7port'], On 2016/04/01 at 17:43:36, jbudorick wrote: > ...
4 years, 8 months ago (2016-04-01 18:49:29 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1823193002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1823193002/200001
4 years, 8 months ago (2016-04-01 18:49:37 UTC) #45
commit-bot: I haz the power
Try jobs failed on following builders: Catapult Linux Tryserver on master.tryserver.client.catapult (JOB_FAILED, https://build.chromium.org/p/tryserver.client.catapult/builders/Catapult%20Linux%20Tryserver/builds/2659)
4 years, 8 months ago (2016-04-01 18:54:47 UTC) #47
rnephew (Reviews Here)
https://codereview.chromium.org/1823193002/diff/200001/devil/devil/utils/find_usb_devices_test.py File devil/devil/utils/find_usb_devices_test.py (right): https://codereview.chromium.org/1823193002/diff/200001/devil/devil/utils/find_usb_devices_test.py#newcode307 devil/devil/utils/find_usb_devices_test.py:307: 'test/data/test_serial_map.json') Might need to do something like: os.path.abspath(os.path.join(os.path.dirname(__file__), 'test', ...
4 years, 8 months ago (2016-04-01 19:12:09 UTC) #48
alexandermont
4 years, 8 months ago (2016-04-01 20:34:31 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1823193002/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1823193002/220001
4 years, 8 months ago (2016-04-01 20:34:40 UTC) #52
rnephew (Reviews Here)
https://codereview.chromium.org/1823193002/diff/220001/devil/devil/utils/find_usb_devices_test.py File devil/devil/utils/find_usb_devices_test.py (right): https://codereview.chromium.org/1823193002/diff/220001/devil/devil/utils/find_usb_devices_test.py#newcode307 devil/devil/utils/find_usb_devices_test.py:307: curr_dir = os.path.dirname(os.path.realpath(__file__)) One of two things should happen, ...
4 years, 8 months ago (2016-04-01 20:51:19 UTC) #54
alexandermont
https://codereview.chromium.org/1823193002/diff/220001/devil/devil/utils/find_usb_devices_test.py File devil/devil/utils/find_usb_devices_test.py (right): https://codereview.chromium.org/1823193002/diff/220001/devil/devil/utils/find_usb_devices_test.py#newcode307 devil/devil/utils/find_usb_devices_test.py:307: curr_dir = os.path.dirname(os.path.realpath(__file__)) On 2016/04/01 at 20:51:18, rnephew1 wrote: ...
4 years, 8 months ago (2016-04-01 21:06:50 UTC) #56
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1823193002/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1823193002/240001
4 years, 8 months ago (2016-04-01 21:07:00 UTC) #58
commit-bot: I haz the power
4 years, 8 months ago (2016-04-01 21:25:58 UTC) #60
Message was sent while issue was closed.
Committed patchset #13 (id:240001) as
https://chromium.googlesource.com/external/github.com/catapult-project/catapu...

Powered by Google App Engine
This is Rietveld 408576698