summaryrefslogtreecommitdiffstats
path: root/testing/mozbase/mozdevice/tests/sut_info.py
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/mozbase/mozdevice/tests/sut_info.py
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/mozbase/mozdevice/tests/sut_info.py')
-rw-r--r--testing/mozbase/mozdevice/tests/sut_info.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/testing/mozbase/mozdevice/tests/sut_info.py b/testing/mozbase/mozdevice/tests/sut_info.py
new file mode 100644
index 000000000..93f3d4258
--- /dev/null
+++ b/testing/mozbase/mozdevice/tests/sut_info.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+import mozdevice
+import logging
+import re
+import unittest
+from sut import MockAgent
+
+
+class TestGetInfo(unittest.TestCase):
+
+ commands = {'os': ('info os', 'JDQ39'),
+ 'id': ('info id', '11:22:33:44:55:66'),
+ 'uptime': ('info uptime', '0 days 0 hours 7 minutes 0 seconds 0 ms'),
+ 'uptimemillis': ('info uptimemillis', '666'),
+ 'systime': ('info systime', '2013/04/2 12:42:00:007'),
+ 'screen': ('info screen', 'X:768 Y:1184'),
+ 'rotation': ('info rotation', 'ROTATION:0'),
+ 'memory': ('info memory', 'PA:1351032832, FREE: 878645248'),
+ 'process': ('info process', '1000 527 system\n'
+ '10091 3443 org.mozilla.firefox\n'
+ '10112 3137 com.mozilla.SUTAgentAndroid\n'
+ '10035 807 com.android.launcher'),
+ 'disk': ('info disk', '/data: 6084923392 total, 980922368 available\n'
+ '/system: 867999744 total, 332333056 available\n'
+ '/mnt/sdcard: 6084923392 total, 980922368 available'),
+ 'power': ('info power', 'Power status:\n'
+ ' AC power OFFLINE\n'
+ ' Battery charge LOW DISCHARGING\n'
+ ' Remaining charge: 20%\n'
+ ' Battery Temperature: 25.2 (c)'),
+ 'sutuserinfo': ('info sutuserinfo', 'User Serial:0'),
+ 'temperature': ('info temperature', 'Temperature: unknown')
+ }
+
+ def test_getInfo(self):
+
+ for directive in self.commands.keys():
+ m = MockAgent(self, commands=[self.commands[directive]])
+ d = mozdevice.DroidSUT('127.0.0.1', port=m.port, logLevel=logging.DEBUG)
+
+ expected = re.sub(r'\ +', ' ', self.commands[directive][1]).split('\n')
+ # Account for slightly different return format for 'process'
+ if directive is 'process':
+ expected = [[x] for x in expected]
+
+ self.assertEqual(d.getInfo(directive=directive)[directive], expected)
+
+if __name__ == '__main__':
+ unittest.main()