Closed
Bug 681810
Opened 15 years ago
Closed 15 years ago
devicemanagerADB: getAppRoot fails when not root and cp not executable
Categories
(Testing :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla9
People
(Reporter: gbrown, Assigned: gbrown)
Details
(Whiteboard: [mobile-testing][xpcshell])
Attachments
(1 file)
|
1.99 KB,
patch
|
jmaher
:
review+
|
Details | Diff | Splinter Review |
When running remotexpcshelltests.py on an unrooted phone, where cp is not executable, devicemanagerADB::getAppRoot() fails because packageName has not been set:
make
SOLO_FILE="test_307_redirect.js" -C netwerk/test check-one-remote
make: Entering directory
`/home/bjarne/Work/Mozilla/Fennec/objdir-android/netwerk/test'
/usr/bin/python2.6 -u
/home/bjarne/Work/Mozilla/Fennec/mozilla-central/config/pythonpath.py \
-I/home/bjarne/Work/Mozilla/Fennec/mozilla-central/build \
-I/home/bjarne/Work/Mozilla/Fennec/mozilla-central/build/mobile \
/home/bjarne/Work/Mozilla/Fennec/mozilla-central/testing/xpcshell/remotexpcshelltests.py
\
--symbols-path=../../dist/crashreporter-symbols \
--build-info-json=../../mozinfo.json \
--test-path=test_307_redirect.js \
--profile-name=fennec \
--verbose \
\
--dm_trans=adb \
--deviceIP= \
--objdir=../.. \
--noSetup \
../../_tests/xpcshell/netwerk/test/unit
../../_tests/xpcshell/netwerk/test/unit_ipc
unable to execute 'cp' on device; consider installing busybox from
Android Market
NOT running as root
adbd cannot run as root in production builds
using APK: ../../dist/fennec-9.0a1.en-US.android-arm.apk
chmod /data/local/tests/xpcshell/p
TEST-INFO | profile dir is /data/local/tests/xpcshell/p
TEST-INFO |
/home/bjarne/Work/Mozilla/Fennec/objdir-android/_tests/xpcshell/netwerk/test/unit/test_307_redirect.js
| running test ...
Traceback (most recent call last):
File
"/home/bjarne/Work/Mozilla/Fennec/mozilla-central/config/pythonpath.py",
line 52, in <module>
main(sys.argv[1:])
File
"/home/bjarne/Work/Mozilla/Fennec/mozilla-central/config/pythonpath.py",
line 44, in main
execfile(script, frozenglobals)
File
"/home/bjarne/Work/Mozilla/Fennec/mozilla-central/testing/xpcshell/remotexpcshelltests.py",
line 336, in <module>
main()
File
"/home/bjarne/Work/Mozilla/Fennec/mozilla-central/testing/xpcshell/remotexpcshelltests.py",
line 331, in main
**options.__dict__):
File
"/home/bjarne/Work/Mozilla/Fennec/mozilla-central/testing/xpcshell/runxpcshelltests.py",
line 510, in runTests
stdout=pStdout, stderr=pStderr, env=self.env, cwd=testdir)
File
"/home/bjarne/Work/Mozilla/Fennec/mozilla-central/testing/xpcshell/remotexpcshelltests.py",
line 198, in launchProcess
shellArgs += "; export GRE_HOME="+self.device.getAppRoot()
File
"/home/bjarne/Work/Mozilla/Fennec/mozilla-central/build/mobile/devicemanagerADB.py",
line 396, in getAppRoot
elif (self.packageName and self.dirExists('/data/data/' +
self.packageName)):
AttributeError: DeviceManagerADB instance has no attribute 'packageName'
make: *** [check-one-remote] Error 1
make: Leaving directory
`/home/bjarne/Work/Mozilla/Fennec/objdir-android/netwerk/test'
bjarne@bjarne-laptop:~/Work/Mozilla/Fennec/objdir-android$
| Assignee | ||
Updated•15 years ago
|
Assignee: nobody → gbrown
| Assignee | ||
Updated•15 years ago
|
Whiteboard: [mobile-testing][xpcshell]
| Assignee | ||
Comment 1•15 years ago
|
||
It is simple enough to ensure initialization of self.packageName to None, but there is a complication: Without a valid packageName, getAppRoot() is likely to return None, which will cause failure in remotexpcshelltests.py. Even if a packageName can be determined, getAppRoot() will still return None if there are insufficient privileges to verify the existence of /data/data/<packageName>.
Thankfully, it turns out that getAppRoot is only used by remotexpcshelltests.py to set the GRE_HOME environment variable, and not setting GRE_HOME seems to have no effect on xpcshell tests: Exactly the same tests pass/fail with or without GRE_HOME.
| Assignee | ||
Comment 2•15 years ago
|
||
Attachment #555894 -
Flags: review?(jmaher)
Comment 3•15 years ago
|
||
Comment on attachment 555894 [details] [diff] [review]
patch for review
Review of attachment 555894 [details] [diff] [review]:
-----------------------------------------------------------------
nice and simple patch, thanks!
Attachment #555894 -
Flags: review?(jmaher) → review+
| Assignee | ||
Updated•15 years ago
|
Keywords: checkin-needed
Comment 4•15 years ago
|
||
Status: NEW → ASSIGNED
Keywords: checkin-needed
Target Milestone: --- → mozilla9
Version: unspecified → Trunk
Comment 5•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•