blob: bd9dba3bd0c6eead14c14b8addbd92153a1c5fbf [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001import unittest
2from oeqa.oetest import oeRuntimeTest, skipModule
3from oeqa.utils.decorators import *
4
5def setUpModule():
6 if not oeRuntimeTest.hasPackage("connman"):
7 skipModule("No connman package in image")
8
9
10class 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")