Closed
Bug 841887
Opened 12 years ago
Closed 12 years ago
Negatus support for sutini
Categories
(Testing :: Mozbase, defect)
Testing
Mozbase
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: mcote, Assigned: mihneadb)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
mcote
:
review+
|
Details | Diff | Splinter Review |
The path for SUTAgent.ini is different in Negatus, and Negatus does not support network configuration at the moment. sutini should be able to find the file for a Negatus installation and should not bother prompting for network settings.
Assignee | ||
Comment 1•12 years ago
|
||
How about berofe checking for the ini file [1], performing a check to see if the device is running Negatus or the Java agent and set the path according to that?
[1] https://github.com/mozilla/mozbase/blob/master/mozdevice/mozdevice/sutini.py#L107
Reporter | ||
Comment 2•12 years ago
|
||
That's a good idea! We can use the "ver" command for that. Feel free to take a crack at it if you're looking for something to do. No C++ involved. ;)
Assignee | ||
Comment 3•12 years ago
|
||
I don't like the fact I'm using _sendCmds and not shell(), but I couldn't get it to work using the latter.
I did some debugging and the issue was the fact that dm would run ver, get the right output and then run exec ver which has no output and this raised the "couldn't find end of line [...]" exception in dmSUT (at the end of the shell() method).
So.. what am I missing? Also, do you want the check-for-negatus logic to reside in a function?
Assignee: nobody → mihneadb
Attachment #715971 -
Flags: feedback?(mcote)
Assignee | ||
Comment 4•12 years ago
|
||
Thanks to :wlach's suggestion, I switched to using dm.agentProductName.
Also, may I suggest changing the retryLimit to 2 in sutini.py. I rarely got it to work using retryLimit=1.
Attachment #715971 -
Attachment is obsolete: true
Attachment #715971 -
Flags: feedback?(mcote)
Attachment #716192 -
Flags: review?(mcote)
Reporter | ||
Comment 5•12 years ago
|
||
Comment on attachment 716192 [details] [diff] [review]
fix
Review of attachment 716192 [details] [diff] [review]:
-----------------------------------------------------------------
Yes sorry, forgot that DM executes ver when it's instantiated.
This is along the right track, but I don't like overriding INI_PATH. Generally stuff defined in capitals at the beginning of a file are sort of constants; it would be unexpected to modify them further down. Better would be having two of them specifying both ini paths (like INI_PATH_JAVA and INI_PATH_NEGATUS or something like that) and picking one based on the product version.
Attachment #716192 -
Flags: review?(mcote) → review-
Assignee | ||
Comment 6•12 years ago
|
||
How about this?
Attachment #716192 -
Attachment is obsolete: true
Attachment #716233 -
Flags: review?(mcote)
Reporter | ||
Comment 7•12 years ago
|
||
Comment on attachment 716233 [details] [diff] [review]
fix
Review of attachment 716233 [details] [diff] [review]:
-----------------------------------------------------------------
This looks good, with just a few nits and a question. :) r+ with those addressed (and either changing retryLimit back to 1 or indicating why it should be 2. Admittedly I should have indicated why it was 1 with a comment (which is because I wanted it to fail quickly rather than retry for a long time, since a human user will be using this script instead of automation) :)
::: mozdevice/mozdevice/sutini.py
@@ +12,5 @@
> from mozdevice.devicemanager import DMError
>
> USAGE = '%s <host>'
> +INI_PATH_JAVA = '/data/data/com.mozilla.SUTAgentAndroid/files/SUTAgent.ini'
> +INI_PATH_NEGATUS = "/data/local/SUTAgent.ini"
Use single quotes for consistency.
@@ +23,4 @@
> ('ENCR', ''),
> ('EAP', ''))}
>
> +def get_cfg(d, ini_path=INI_PATH_JAVA):
Since you are always passing in ini_path below, there's no need to make this an optional parameter.
@@ +32,5 @@
> pass
> return cfg
>
>
> +def put_cfg(d, cfg, ini_path=INI_PATH_JAVA):
Ditto.
@@ +101,4 @@
> print USAGE % sys.argv[0]
> sys.exit(1)
> try:
> + d = DroidSUT(host, retryLimit=2)
Why did you change retryLimit?
Attachment #716233 -
Flags: review?(mcote) → review+
Assignee | ||
Comment 8•12 years ago
|
||
Modified as requested and pushed: https://github.com/mozilla/mozbase/commit/985b4c6342cc00b852c8a93bfbb57df4e209af59
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 9•12 years ago
|
||
Ah sorry I missed the bit about retryLimit. That is strange that you have problems connecting. If you can figure out what it is (is it timing out, or the port isn't open, or what) maybe file a new bug?
Assignee | ||
Comment 10•12 years ago
|
||
Sure, I'll try to figure it out.
You need to log in
before you can comment on or make changes to this bug.
Description
•