Closed Bug 1497642 Opened 6 years ago Closed 4 years ago

ADBRootError: Can not run command test -d /storage/sdcard0 as root!

Categories

(Testing :: Mozbase, defect, P3)

Version 3
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: miketaylr, Unassigned)

References

Details

(Whiteboard: [fixed-by-bug-1486004])

I'm trying to run mochitests on a local fennec build, installed on my Pixel 1. ./mach mochitest dom/animation/test 0:01.49 adb INFO Using adb 1.0.40 0:02.06 adb INFO adbd not restarted as root 0:02.73 adb INFO /system/bin/ls -1A supported 0:02.84 adb INFO Native cp support: True 0:03.05 adb INFO Native chmod -R support: True 0:03.27 adb INFO Setting SELinux Permissive 0:03.27 adb WARNING Unable to set SELinux Permissive due to Can not run command setenforce Permissive as root!. Granting important runtime permissions to org.mozilla.fennec_mitaylor 0:05.30 adb INFO Using adb 1.0.40 0:05.88 adb INFO adbd not restarted as root 0:06.55 adb INFO /system/bin/ls -1A supported 0:06.67 adb INFO Native cp support: True 0:06.89 adb INFO Native chmod -R support: True 0:07.10 adb INFO Setting SELinux Permissive 0:07.10 adb WARNING Unable to set SELinux Permissive due to Can not run command setenforce Permissive as root!. Error running mach: ['mochitest', 'dom/animation/test'] The error occurred in code that was called by the mach command. This is either a bug in the called code itself or in the way that mach is calling it. You should consider filing a bug for this issue. If filing a bug, please include the full output of mach, including this error message. The details of the failure are as follows: ADBRootError: Can not run command test -d /storage/sdcard0 as root! File "/Users/mitaylor/dev/gecko/testing/mochitest/mach_commands.py", line 469, in run_mochitest_general **harness_args) File "/Users/mitaylor/dev/gecko/testing/mochitest/mach_commands.py", line 180, in run_android_test return runtestsremote.run_test_harness(parser, options) File "/Users/mitaylor/dev/gecko/objdir-fennec/_tests/testing/mochitest/runtestsremote.py", line 354, in run_test_harness mochitest = MochiRemote(options) File "/Users/mitaylor/dev/gecko/objdir-fennec/_tests/testing/mochitest/runtestsremote.py", line 49, in __init__ options.remoteTestRoot = self.device.test_root File "/Users/mitaylor/dev/gecko/testing/mozbase/mozdevice/mozdevice/adb.py", line 876, in test_root if self._try_test_root(test_root): File "/Users/mitaylor/dev/gecko/testing/mozbase/mozdevice/mozdevice/adb.py", line 892, in _try_test_root if not self.is_dir(base_path, root=self._require_root): File "/Users/mitaylor/dev/gecko/testing/mozbase/mozdevice/mozdevice/adb.py", line 1752, in is_dir return self._test_path('d', path, timeout, root) File "/Users/mitaylor/dev/gecko/testing/mozbase/mozdevice/mozdevice/adb.py", line 1711, in _test_path timeout=timeout, root=root) File "/Users/mitaylor/dev/gecko/testing/mozbase/mozdevice/mozdevice/adb.py", line 1308, in shell_bool timeout=timeout, root=root) File "/Users/mitaylor/dev/gecko/testing/mozbase/mozdevice/mozdevice/adb.py", line 1218, in shell raise ADBRootError('Can not run command %s as root!' % cmd)
Component: Mochitest → Mozbase
We'll have a look at this, but we cannot guarantee that tests run on all devices. Usually tests run okay on rooted devices. Consider using an emulator to run your tests (an x86 build/emulator is quite fast): Remove your device and re-run your mach mochitest command -- it will offer to start an emulator.
You can also try https://github.com/topjohnwu/Magisk which allows you to turn root on and off.
Priority: -- → P3

Fixed by bug 1486004 though these days that command will run geckoview test.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-by-bug-1486004]
You need to log in before you can comment on or make changes to this bug.