]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/runtime: Added one runtime testcase in connman.
authorDaniel Istrate <daniel.alexandrux.istrate@intel.com>
Wed, 15 Jul 2015 14:35:34 +0000 (17:35 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 22 Jul 2015 22:24:58 +0000 (23:24 +0100)
(testcase 223) Check that only one connmand runs in background.

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/runtime/connman.py

index cc537f7766bea8e0fc58d8f593cd1d452fe7e54e..b04040016f31bcb1ede8522564fd271887e93442 100644 (file)
@@ -28,3 +28,26 @@ class ConnmanTest(oeRuntimeTest):
         if status != 0:
             print self.service_status("connman")
             self.fail("No connmand process running")
+
+    @testcase(223)
+    def test_only_one_connmand_in_background(self):
+        """
+        Summary:     Only one connmand in background
+        Expected:    There will be only one connmand instance in background.
+        Product:     BSPs
+        Author:      Alexandru Georgescu <alexandru.c.georgescu@intel.com>
+        AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+        """
+
+        # Make sure that 'connmand' is running in background
+        (status, output) = self.target.run(oeRuntimeTest.pscmd + ' | grep [c]onnmand')
+        self.assertEqual(0, status, 'Failed to find "connmand" process running in background.')
+
+        # Start a new instance of 'connmand'
+        (status, output) = self.target.run('connmand')
+        self.assertEqual(0, status, 'Failed to start a new "connmand" process.')
+
+        # Make sure that only one 'connmand' is running in background
+        (status, output) = self.target.run(oeRuntimeTest.pscmd + ' | grep [c]onnmand | wc -l')
+        self.assertEqual(0, status, 'Failed to find "connmand" process running in background.')
+        self.assertEqual(1, int(output), 'Found {} connmand processes running, expected 1.'.format(output))