Closed Bug 1425334 Opened 2 years ago Closed 2 years ago

Give root permissions to adbd when running emulator unit tests

Categories

(Firefox for Android :: Testing, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
Firefox 59
Tracking Status
firefox59 --- fixed

People

(Reporter: gbrown, Assigned: gbrown)

References

Details

Attachments

(1 file)

A lack of adbd root permissions results in a variety of errors when running a modern Android emulator environment (sdk 26, android 7.0).

$ adb shell ls /data/local
ls: /data/local: Permission denied
$ adb root
$ adb shell ls /data/local
tmp


We already try to use 'adb root' in android_emulator_unittest.py, but it does not always work because we try to use it too early:

[task 2017-12-14T04:42:01.803Z] 04:42:01     INFO - Running timeout 30 /builds/worker/workspace/build/android-sdk-linux/platform-tools/adb kill-server
[task 2017-12-14T04:42:01.807Z] 04:42:01     INFO - stderr: * server not running *
[task 2017-12-14T04:42:01.807Z] 04:42:01     INFO - Running timeout 30 /builds/worker/workspace/build/android-sdk-linux/platform-tools/adb root
[task 2017-12-14T04:42:05.063Z] 04:42:05     INFO - * daemon not running. starting it now at tcp:5037 *
[task 2017-12-14T04:42:05.063Z] 04:42:05     INFO - * daemon started successfully *
[task 2017-12-14T04:42:05.063Z] 04:42:05     INFO - stderr: adb: unable to connect for root: no devices/emulators found
This fixes this issue on trial runs with Android 7 on an arm emulator.

It doesn't break any existing jobs:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=963a48a15613549db8708914a40f67dd8438dcc2
Attachment #8936972 - Flags: review?(jmaher)
Attachment #8936972 - Flags: review?(jmaher) → review+
Pushed by gbrown@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/1a337abb11ee
In android emulator tests, restart adbd after emulator has started; r=jmaher
https://hg.mozilla.org/mozilla-central/rev/1a337abb11ee
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 59
You need to log in before you can comment on or make changes to this bug.