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)

x86
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla9

People

(Reporter: gbrown, Assigned: gbrown)

Details

(Whiteboard: [mobile-testing][xpcshell])

Attachments

(1 file)

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: nobody → gbrown
Whiteboard: [mobile-testing][xpcshell]
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.
Attached patch patch for review — — Splinter Review
Attachment #555894 - Flags: review?(jmaher)
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+
Keywords: checkin-needed
Status: NEW → ASSIGNED
Keywords: checkin-needed
Target Milestone: --- → mozilla9
Version: unspecified → Trunk
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.

Attachment

General

Created:
Updated:
Size: