blob: f0d15fac9b223b8aa52fa2f30f667113393519eb [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001#
2# SPDX-License-Identifier: MIT
3#
4
Brad Bishop6e60e8b2018-02-01 10:27:11 -05005from oeqa.runtime.case import OERuntimeTestCase
6from oeqa.core.decorator.depends import OETestDepends
Brad Bishop6e60e8b2018-02-01 10:27:11 -05007from oeqa.runtime.decorator.package import OEHasPackage
8
9class ConnmanTest(OERuntimeTestCase):
10
11 def service_status(self, service):
12 if 'systemd' in self.tc.td['DISTRO_FEATURES']:
13 (_, output) = self.target.run('systemctl status -l %s' % service)
14 return output
15 else:
16 return "Unable to get status or logs for %s" % service
17
Brad Bishop6e60e8b2018-02-01 10:27:11 -050018 @OETestDepends(['ssh.SSHTest.test_ssh'])
19 @OEHasPackage(["connman"])
20 def test_connmand_help(self):
21 (status, output) = self.target.run('/usr/sbin/connmand --help')
22 msg = 'Failed to get connman help. Output: %s' % output
23 self.assertEqual(status, 0, msg=msg)
24
Brad Bishop6e60e8b2018-02-01 10:27:11 -050025 @OETestDepends(['connman.ConnmanTest.test_connmand_help'])
26 def test_connmand_running(self):
27 cmd = '%s | grep [c]onnmand' % self.tc.target_cmds['ps']
28 (status, output) = self.target.run(cmd)
29 if status != 0:
30 self.logger.info(self.service_status("connman"))
31 self.fail("No connmand process running")