Closed Bug 1499511 Opened 1 year ago Closed 1 year ago

[mozdevice] Support single-quotes in adb command line


(Testing :: Mozbase, enhancement)

Version 3
Not set


(firefox64 fixed)

Tracking Status
firefox64 --- fixed


(Reporter: gbrown, Assigned: bc)




(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

Attachment #9017823 - Flags: review?(gbrown)
Comment on attachment 9017823 [details] [diff] [review]

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
[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)
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
Add unit test for _escape_command_line; r=bc
You need to log in before you can comment on or make changes to this bug.