Skip to contentSkip to conversation

oeqa/runtime: Added one runtime testcase in connman.

PATCH In review Daniel Istrate 3 participants 3 messages Jul 15, 2015 – Jul 16, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 oeqa/runtime: Added one runtime testcase in connman.

(testcase 223) Check that only one connmand runs in background.

---
 meta/lib/oeqa/runtime/connman.py | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
meta/lib/oeqa/runtime/connman.py +23 -0
index cc537f7..b040400 100644
@@ -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 <[email protected]>
+        AutomatedBy: Daniel Istrate <[email protected]>
+        """
+
+        # 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))
Signature · 1 line
2.1.4
#1 lore raw

Hi Daniel and Alex,

Quoted 23 lines · Daniel Istrate

(testcase 223) Check that only one connmand runs in background.

---
  meta/lib/oeqa/runtime/connman.py | 23 +++++++++++++++++++++++
  1 file changed, 23 insertions(+)
meta/lib/oeqa/runtime/connman.py +8 -0
index cc537f7..b040400 100644
@@ -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 <[email protected]>

meta/lib/oeqa/runtime/connman.py class ConnmanTest(oeRuntimeTest): · line 48

Quoted 10 lines
meta/lib/oeqa/runtime/connman.py +10 -0
+        AutomatedBy: Daniel Istrate <[email protected]>
+        """
+
+        # 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.')

If multiple instances of connmand can run, is that not a bug it connmand rather than in our configuration? I'm asking because it seems like this would be more suited as a connman test that would be part of ptest.

Otherwise, why not test all daemons for multiple instances?

#2 lore raw
Quoted 4 lines · Randy Witt

If multiple instances of connmand can run, is that not a bug it connmand rather than in our configuration? I'm asking because it seems like this would be more suited as a connman test that would be part of ptest.

The test doubles as "did connman start" (for images in which connman is expected to be present). With sufficiently broken kernels, connman will exit on startup (this test exists for a reason...)

Ross