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

Issue 251743003: telemetry: android: use both methods to access protected files (Closed)

Created:
6 years, 8 months ago by pasko
Modified:
6 years, 7 months ago
Reviewers:
bulach, Philippe, jbudorick, Sami
CC:
chromium-reviews, klundberg+watch_chromium.org, bulach+watch_chromium.org, yfriedman+watch_chromium.org, ilevy-cc_chromium.org, Fabrice (no longer in Chrome), Philippe
Visibility:
Public.

Description

telemetry: android: use both methods to access protected files Currently when telemetry asks to read/write a protected file, it attempts doing so with the 'su' command, but not all devices have the 'su' command installed. In this case telemetry ignores all errors and continues silently. This change: 1. chooses the best method to access protected files: 'adb root' or 'su' 2. caches the choice 3. throws warnings each time a protected file cannot be accessed BUG=366640 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=267137

Patch Set 1 #

Total comments: 24

Patch Set 2 : comments #

Total comments: 3

Patch Set 3 : self._privileged_command_runner #

Total comments: 2

Patch Set 4 : lambda was not necessary #

Total comments: 2

Patch Set 5 : even more compact #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -11 lines) Patch
M build/android/pylib/android_commands.py View 1 2 3 4 3 chunks +49 lines, -11 lines 3 comments Download

Messages

Total messages: 30 (0 generated)
pasko
I am no good python stylist, so please be picky :)
6 years, 8 months ago (2014-04-25 17:13:42 UTC) #1
pasko
Philippe, can you take a look as well? As we discussed offline, I could probably ...
6 years, 7 months ago (2014-04-28 11:00:43 UTC) #2
bulach
lgtm, I like this, thanks egor! some suggestions below that you may want to do ...
6 years, 7 months ago (2014-04-28 12:21:47 UTC) #3
Sami
https://codereview.chromium.org/251743003/diff/1/build/android/pylib/android_commands.py File build/android/pylib/android_commands.py (right): https://codereview.chromium.org/251743003/diff/1/build/android/pylib/android_commands.py#newcode1107 build/android/pylib/android_commands.py:1107: ACCESS_METHOD_NO_ACCESS = "no access" nit: Start with underscore since ...
6 years, 7 months ago (2014-04-28 12:55:48 UTC) #4
jbudorick
lgtm I'll add this functionality to the refactor. https://codereview.chromium.org/251743003/diff/1/build/android/pylib/android_commands.py File build/android/pylib/android_commands.py (right): https://codereview.chromium.org/251743003/diff/1/build/android/pylib/android_commands.py#newcode1107 build/android/pylib/android_commands.py:1107: ACCESS_METHOD_NO_ACCESS ...
6 years, 7 months ago (2014-04-28 14:22:52 UTC) #5
pasko
PTAL https://codereview.chromium.org/251743003/diff/1/build/android/pylib/android_commands.py File build/android/pylib/android_commands.py (right): https://codereview.chromium.org/251743003/diff/1/build/android/pylib/android_commands.py#newcode1107 build/android/pylib/android_commands.py:1107: ACCESS_METHOD_NO_ACCESS = "no access" On 2014/04/28 12:55:49, Sami ...
6 years, 7 months ago (2014-04-29 09:42:32 UTC) #6
Sami
On 2014/04/29 09:42:32, pasko wrote: > Do you suggest to check for None and call ...
6 years, 7 months ago (2014-04-29 10:16:34 UTC) #7
bulach
still lgtm with some more suggestions, thanks! https://codereview.chromium.org/251743003/diff/20001/build/android/pylib/android_commands.py File build/android/pylib/android_commands.py (right): https://codereview.chromium.org/251743003/diff/20001/build/android/pylib/android_commands.py#newcode1107 build/android/pylib/android_commands.py:1107: _ACCESS_METHOD_NO_ACCESS = ...
6 years, 7 months ago (2014-04-29 10:21:39 UTC) #8
pasko
On 2014/04/29 10:16:34, Sami wrote: > On 2014/04/29 09:42:32, pasko wrote: > > Do you ...
6 years, 7 months ago (2014-04-29 12:57:30 UTC) #9
pasko
https://codereview.chromium.org/251743003/diff/20001/build/android/pylib/android_commands.py File build/android/pylib/android_commands.py (right): https://codereview.chromium.org/251743003/diff/20001/build/android/pylib/android_commands.py#newcode1132 build/android/pylib/android_commands.py:1132: def IsValidAuxContents(contents): On 2014/04/29 10:21:39, bulach wrote: > I'm ...
6 years, 7 months ago (2014-04-29 12:57:38 UTC) #10
Sami
Thanks, this looks much clearer. One question below. Also, there's a @_Memoized decorator in constants.py ...
6 years, 7 months ago (2014-04-29 13:16:19 UTC) #11
pasko
On 2014/04/29 13:16:19, Sami wrote: > Thanks, this looks much clearer. One question below. > ...
6 years, 7 months ago (2014-04-29 13:29:58 UTC) #12
pasko
https://codereview.chromium.org/251743003/diff/40001/build/android/pylib/android_commands.py File build/android/pylib/android_commands.py (right): https://codereview.chromium.org/251743003/diff/40001/build/android/pylib/android_commands.py#newcode1143 build/android/pylib/android_commands.py:1143: self._privileged_command_runner = lambda cmd: self.RunShellCommand(cmd) On 2014/04/29 13:16:19, Sami ...
6 years, 7 months ago (2014-04-29 13:30:04 UTC) #13
pasko
The CQ bit was checked by pasko@chromium.org
6 years, 7 months ago (2014-04-29 13:31:39 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pasko@chromium.org/251743003/50002
6 years, 7 months ago (2014-04-29 13:32:01 UTC) #15
bulach
still lgtm, just clarifying my suggestion and taking into account the lambda goodness... as before, ...
6 years, 7 months ago (2014-04-29 13:42:01 UTC) #16
pasko
https://codereview.chromium.org/251743003/diff/50002/build/android/pylib/android_commands.py File build/android/pylib/android_commands.py (right): https://codereview.chromium.org/251743003/diff/50002/build/android/pylib/android_commands.py#newcode1149 build/android/pylib/android_commands.py:1149: return self._privileged_command_runner On 2014/04/29 13:42:02, bulach wrote: > well, ...
6 years, 7 months ago (2014-04-29 14:02:56 UTC) #17
pasko
The CQ bit was unchecked by pasko@chromium.org
6 years, 7 months ago (2014-04-29 14:11:24 UTC) #18
pasko
bulach: repetitions eliminated, function removed, yey, ptal
6 years, 7 months ago (2014-04-29 14:14:47 UTC) #19
bulach
still lgtm :) https://codereview.chromium.org/251743003/diff/70001/build/android/pylib/android_commands.py File build/android/pylib/android_commands.py (right): https://codereview.chromium.org/251743003/diff/70001/build/android/pylib/android_commands.py#newcode1130 build/android/pylib/android_commands.py:1130: self._protected_file_access_method_initialized = True nit: I think ...
6 years, 7 months ago (2014-04-29 14:26:53 UTC) #20
pasko
https://codereview.chromium.org/251743003/diff/70001/build/android/pylib/android_commands.py File build/android/pylib/android_commands.py (right): https://codereview.chromium.org/251743003/diff/70001/build/android/pylib/android_commands.py#newcode1130 build/android/pylib/android_commands.py:1130: self._protected_file_access_method_initialized = True On 2014/04/29 14:26:54, bulach wrote: > ...
6 years, 7 months ago (2014-04-29 15:39:16 UTC) #21
pasko
The CQ bit was checked by pasko@chromium.org
6 years, 7 months ago (2014-04-29 15:42:51 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pasko@chromium.org/251743003/70001
6 years, 7 months ago (2014-04-29 15:43:29 UTC) #23
bulach
On 2014/04/29 15:39:16, pasko wrote: > https://codereview.chromium.org/251743003/diff/70001/build/android/pylib/android_commands.py > File build/android/pylib/android_commands.py (right): > > https://codereview.chromium.org/251743003/diff/70001/build/android/pylib/android_commands.py#newcode1130 > ...
6 years, 7 months ago (2014-04-29 16:04:41 UTC) #24
pasko
On 2014/04/29 16:04:41, bulach wrote: > On 2014/04/29 15:39:16, pasko wrote: > > > https://codereview.chromium.org/251743003/diff/70001/build/android/pylib/android_commands.py ...
6 years, 7 months ago (2014-04-29 16:21:58 UTC) #25
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-04-29 21:43:45 UTC) #26
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel on tryserver.chromium
6 years, 7 months ago (2014-04-29 21:43:46 UTC) #27
pasko
The CQ bit was checked by pasko@chromium.org
6 years, 7 months ago (2014-04-30 07:34:14 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pasko@chromium.org/251743003/70001
6 years, 7 months ago (2014-04-30 07:34:40 UTC) #29
commit-bot: I haz the power
6 years, 7 months ago (2014-04-30 08:41:07 UTC) #30
Message was sent while issue was closed.
Change committed as 267137

Powered by Google App Engine
This is Rietveld 408576698