Closed Bug 1081167 Opened 10 years ago Closed 10 years ago

[mozdevice] Command line tool fails to show info for ADB connected devices

Categories

(Testing :: Mozbase, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla36

People

(Reporter: davehunt, Assigned: davehunt)

References

Details

Attachments

(1 file)

While working on bug 1078274 I found that the 'info' command for the device manager command line tool is broken.

When no directives are specified, everything should be returned. Instead, nothing is returned. When a valid directive is given, it's split on each character with a newline between.

Expected:
$ dm -m adb info
ID: e47cd86c
-- etc --

Actual:
$ dm -m adb info
-- no output --

Expected:
$ dm -m adb info id
e47cd86c

Actual:
$ dm -m adb info id
e
4
7
c
d
8
6
c

The exception is the 'uptime' directive, which for some reason returns a list with one item. This means it does not suffer from being split on each character, but the value returned is incorrect.

Expected:
$ dm -m adb info uptime
2 days 3 hours 57 minutes 9 seconds

Actual:
$ dm -m adb info uptime
0 days 2 days, 03 hours 57 minutes 09 seconds
This fixes the issues described for me. I've run this locally in addition to the tests, but I'm not sure if I need to consider non-B2G devices or if these changes will cause problems with SUT. If there's a suitable try syntax for this patch let me know and I'll trigger it.
Attachment #8503251 - Flags: review?(wlachance)
Comment on attachment 8503251 [details] [diff] [review]
Fix uptime and command line tool for ADB devices. v1.0

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

This looks reasonable to me. I don't believe this particular method of dmADB is used by anything in the tree, but if you want to generally test that, you can try running the unit tests against a b2g emulator build, which will invoke dmADB for a few things.
Attachment #8503251 - Flags: review?(wlachance) → review+
Blocks: 1078274
https://hg.mozilla.org/mozilla-central/rev/44eef0bd1b1d
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Depends on: 1084519
You need to log in before you can comment on or make changes to this bug.