Closed Bug 1148421 Opened 9 years ago Closed 9 years ago

devicemanagerSUT.py does not support devices running adbd as root

Categories

(Testing :: Mozbase, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: bc, Unassigned)

References

Details

The shell method in https://dxr.mozilla.org/mozilla-central/source/testing/mozbase/mozdevice/mozdevice/devicemanagerSUT.py#306 forces the use of execsu/execcwdsu when executing a command under root if the SUTAgent version is >= 1.13 regardless of how the device is rooted.

_logcatNeedsRoot = True in https://dxr.mozilla.org/mozilla-central/source/testing/mozbase/mozdevice/mozdevice/devicemanager.py#47 forces the SUTAgent to use root even for a basic command like logcat.

This is causing the Autophone mochitests to fail with execsu /system/bin/logcat -c causing DMError: Automation Error: Error finding end of line/return value when running '/system/bin/logcat -c'

If the device is already running adbd as root, devicemanagerSUT.py should use the normal exec command instead of execsu/execcwdsu.

In the SUTAgent, the invocation of su via execsu/execcwdsu always uses the shell-like invocation su -c "command args" form which is a different problem. I'll file a different bug for the SUTAgent.
Blocks: 1148423
It appears that unless we use su of some form, the commands issued by the sutagent will be executed with the user id of the sutagent regardless of whether adbd runs as root. I hate sut.

-> invalid.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.