Closed Bug 1499511 Opened 1 year ago Closed 1 year ago

[mozdevice] Support single-quotes in adb command line

Categories

(Testing :: Mozbase, enhancement)

Version 3
enhancement
Not set

Tracking

(firefox64 fixed)

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: gbrown, Assigned: bc)

References

Details

Attachments

(2 files)

In bug 1475648, we've found that the jittest command line may have single-quotes in it; currently it looks like they are lost. They should probably be escaped by _escape_command_line().
I got it running locally and see the syntax errors but my first attempt to fix it didn't work either. Dealing with passing these commands around and getting them work in the shell may be tricky. If you get to home plate first, you win the pennant.
- don't quote already quoted elements of cmd
- expand the list of quotable characters and use the regular expression
  [ ()\"&'\]]
- use " to quote

before and after android jit look good on try. doing a full android test now

<https://treeherder.mozilla.org/#/jobs?repo=try&tier=1%2C2%2C3&author=bclary%40mozilla.com&group_state=expanded&fromchange=933c28ccafc2d094fc856739cd81ebdf72837d0c&tochange=65be8c13e7535eeacecf6b6183ad74b6d0d3bf7a>
Attachment #9017823 - Flags: review?(gbrown)
Comment on attachment 9017823 [details] [diff] [review]
bug-1499511-escape-command-line.patch

Review of attachment 9017823 [details] [diff] [review]:
-----------------------------------------------------------------

Nice. I was heading toward this type of solution last night, but couldn't quite get it to work. Your try run looks great!

I have a simple unit test for _escape_command_line() on the go; I'll attach a patch later today.
Attachment #9017823 - Flags: review?(gbrown) → review+
Assignee: gbrown → bob
Pushed by bclary@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/02d89c011037
[mozdevice] Support single-quotes in adb command line, r=gbrown.
Attached patch simple unit testSplinter Review
I'm happy to add more cases if you like.
Attachment #9017930 - Flags: review?(bob)
https://hg.mozilla.org/mozilla-central/rev/02d89c011037
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Comment on attachment 9017930 [details] [diff] [review]
simple unit test

Review of attachment 9017930 [details] [diff] [review]:
-----------------------------------------------------------------

r+, lgtm.
Attachment #9017930 - Flags: review?(bob) → review+
Pushed by gbrown@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/73466d27dd00
Add unit test for adb.py _escape_command_line; r=bc
You need to log in before you can comment on or make changes to this bug.