mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 12:59:02 +02:00

This migrates current runtime test suite to be used with the new framework. [YOCTO #10234] (From OE-Core rev: b39c61f2d442c79d03b73e8ffd104996fcb2177e) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
31 lines
1.2 KiB
Python
31 lines
1.2 KiB
Python
from oeqa.runtime.case import OERuntimeTestCase
|
|
from oeqa.core.decorator.depends import OETestDepends
|
|
from oeqa.core.decorator.oeid import OETestID
|
|
from oeqa.runtime.decorator.package import OEHasPackage
|
|
|
|
class ConnmanTest(OERuntimeTestCase):
|
|
|
|
def service_status(self, service):
|
|
if oeRuntimeTest.hasFeature("systemd"):
|
|
(_, output) = self.target.run('systemctl status -l %s' % service)
|
|
return output
|
|
else:
|
|
return "Unable to get status or logs for %s" % service
|
|
|
|
@OETestID(961)
|
|
@OETestDepends(['ssh.SSHTest.test_ssh'])
|
|
@OEHasPackage(["connman"])
|
|
def test_connmand_help(self):
|
|
(status, output) = self.target.run('/usr/sbin/connmand --help')
|
|
msg = 'Failed to get connman help. Output: %s' % output
|
|
self.assertEqual(status, 0, msg=msg)
|
|
|
|
@OETestID(221)
|
|
@OETestDepends(['connman.ConnmanTest.test_connmand_help'])
|
|
def test_connmand_running(self):
|
|
cmd = '%s | grep [c]onnmand' % self.tc.target_cmds['ps']
|
|
(status, output) = self.target.run(cmd)
|
|
if status != 0:
|
|
self.logger.info(self.service_status("connman"))
|
|
self.fail("No connmand process running")
|