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