Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | import unittest |
| 2 | from oeqa.oetest import oeRuntimeTest, skipModule |
| 3 | from oeqa.utils.decorators import * |
| 4 | |
| 5 | def setUpModule(): |
| 6 | if not oeRuntimeTest.hasPackage("connman"): |
| 7 | skipModule("No connman package in image") |
| 8 | |
| 9 | |
| 10 | class ConnmanTest(oeRuntimeTest): |
| 11 | |
| 12 | def service_status(self, service): |
| 13 | if oeRuntimeTest.hasFeature("systemd"): |
| 14 | (status, output) = self.target.run('systemctl status -l %s' % service) |
| 15 | return output |
| 16 | else: |
| 17 | return "Unable to get status or logs for %s" % service |
| 18 | |
| 19 | @testcase(961) |
| 20 | @skipUnlessPassed('test_ssh') |
| 21 | def test_connmand_help(self): |
| 22 | (status, output) = self.target.run('/usr/sbin/connmand --help') |
| 23 | self.assertEqual(status, 0, msg="status and output: %s and %s" % (status,output)) |
| 24 | |
| 25 | @testcase(221) |
| 26 | @skipUnlessPassed('test_connmand_help') |
| 27 | def test_connmand_running(self): |
| 28 | (status, output) = self.target.run(oeRuntimeTest.pscmd + ' | grep [c]onnmand') |
| 29 | if status != 0: |
| 30 | print self.service_status("connman") |
| 31 | self.fail("No connmand process running") |