Closed
Bug 715060
Opened 13 years ago
Closed 13 years ago
devicemanagerADB pushDir fails on non-rooted device when unzipping to sdcard
Categories
(Testing :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla12
People
(Reporter: gbrown, Assigned: gbrown)
Details
Attachments
(1 file, 1 obsolete file)
2.78 KB,
patch
|
gbrown
:
review+
|
Details | Diff | Splinter Review |
Bug 701038 introduced the use of zip/unzip to devicemanagerADB.pushDir, to speed up pushes of large directories. If pushDir is used with zip/unzip on a device without privileged/root access, and the destination directory is on /sdcard, then unzip is likely to fail and abort because it cannot change the permissions on the destination files. For example, when pushing to /mnt/sdcard/tests/profile (for a mochitest-robotium test run), I see: Archive: /mnt/sdcard/tests/profile/adbdmtmp.zip creating: chrome/ unzip: can't set permissions of directory 'chrome/': Operation not permitted unzip: exiting The remaining files in the directory are not created. I can find no way to override this behavior in the BusyBox unzip. Since permissions are of no consequence to most tests, this failure is undesirable. pushDir without zip/unzip will also fail to set file permissions in this scenario, but all the files will still be pushed.
Assignee | ||
Comment 1•13 years ago
|
||
This patch detects the unzip failure and then falls back to the normal pushDir behavior automatically: If unzip fails, devicemanager retries the pushDir without the zip/unzip.
Attachment #585647 -
Flags: review?(jmaher)
Assignee | ||
Updated•13 years ago
|
Assignee: nobody → gbrown
Assignee | ||
Comment 2•13 years ago
|
||
:kats reported trouble running mochitest-robotium on an unrooted phone -- I suspect this patch will help him.
Comment 3•13 years ago
|
||
Comment on attachment 585647 [details] [diff] [review] patch to ADB pushDir Review of attachment 585647 [details] [diff] [review]: ----------------------------------------------------------------- r=me, just a couple nits below. ::: build/mobile/devicemanagerADB.py @@ +120,5 @@ > subprocess.check_output(["zip", "-r", localZip, '.'], cwd=localDir) > self.pushFile(localZip, remoteZip) > os.remove(localZip) > + data = self.runCmdAs(["shell", "unzip", "-o", remoteZip, "-d", remoteDir]).stdout.read() > + print data do we need the 'print data' here? @@ +125,4 @@ > self.checkCmdAs(["shell", "rm", remoteZip]) > + if (re.search("unzip: exiting", data) or re.search("Operation not permitted", data)): > + print "zip/unzip failure: falling back to normal push" > + self.useZip = False do we need to set self.useZip here? It is referenced above this.
Attachment #585647 -
Flags: review?(jmaher) → review+
Assignee | ||
Comment 4•13 years ago
|
||
(In reply to Joel Maher (:jmaher) from comment #3) > do we need the 'print data' here? No - just being verbose. I will remove it. > do we need to set self.useZip here? It is referenced above this. Yes - so that the recursive pushDir call does not use zip/unzip. Also, I want to not use zip/unzip on any additional pushDir's in the same instance -- if unzip fails once, I figure it's not worth checking again.
Comment 5•13 years ago
|
||
sounds good. Upload a new patch and I can land it if you need me to.
Assignee | ||
Comment 6•13 years ago
|
||
Just removed extra print call. Carrying forward r+=jmaher.
Attachment #585647 -
Attachment is obsolete: true
Attachment #585832 -
Flags: review+
Assignee | ||
Updated•13 years ago
|
Keywords: checkin-needed
Comment 7•13 years ago
|
||
inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/1f35778a02a8
Comment 8•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/1f35778a02a8
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla12
Updated•13 years ago
|
Keywords: checkin-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•