Patchwork [5/8] lib/oeqa/oetest.py: provide a ps command for all tests

login
register
mail settings
Submitter Stanacar, StefanX
Date July 12, 2013, 4:46 p.m.
Message ID <9ecb14de37a2164c3e4c2ba4f3f7a389741325b4.1373647359.git.stefanx.stanacar@intel.com>
Download mbox | patch
Permalink /patch/53623/
State Accepted
Commit 1515d33d2c5b7275a3ac20e07c1db1d8273de796
Headers show

Comments

Stanacar, StefanX - July 12, 2013, 4:46 p.m.
Many tests will use 'ps' but we need to know if it's busybox
or standard ps.
Drop the existing check from the connman test.

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
---
 meta/lib/oeqa/oetest.py          | 5 ++---
 meta/lib/oeqa/runtime/connman.py | 5 -----
 2 files changed, 2 insertions(+), 8 deletions(-)

Patch

diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
index 24548e9..5777ff8 100644
--- a/meta/lib/oeqa/oetest.py
+++ b/meta/lib/oeqa/oetest.py
@@ -9,7 +9,8 @@  def runTests(tc):
 
     # set the context object passed from the test class
     setattr(oeRuntimeTest, "tc", tc)
-
+    # set ps command to use
+    setattr(oeRuntimeTest, "pscmd", "ps -ef" if oeRuntimeTest.hasPackage("procps") else "ps")
     # prepare test suite, loader and runner
     suite = unittest.TestSuite()
     testloader = unittest.TestLoader()
@@ -30,7 +31,6 @@  class oeRuntimeTest(unittest.TestCase):
     testFailures = []
     testSkipped = []
     testErrors = []
-    pscmd = "ps"
 
     def __init__(self, methodName='runTest'):
         self.target = oeRuntimeTest.tc.target
@@ -74,7 +74,6 @@  class oeRuntimeTest(unittest.TestCase):
 
 
 
-
 def getmodule(pos=2):
     # stack returns a list of tuples containg frame information
     # First element of the list the is current frame, caller is 1
diff --git a/meta/lib/oeqa/runtime/connman.py b/meta/lib/oeqa/runtime/connman.py
index 835e135..5ef96f6 100644
--- a/meta/lib/oeqa/runtime/connman.py
+++ b/meta/lib/oeqa/runtime/connman.py
@@ -17,11 +17,6 @@  class ConnmanTest(oeRuntimeTest):
 
     @skipUnlessPassed('test_connmand_help')
     def test_connmand_running(self):
-        status = self.target.run('ls -l `which ps` | grep busybox')[0]
-        if status == 0:
-            oeRuntimeTest.pscmd = 'ps'
-        else:
-            oeRuntimeTest.pscmd = 'ps -ef'
         (status, output) = self.target.run(oeRuntimeTest.pscmd + ' | grep [c]onnmand')
         self.assertEqual(status, 0, msg="no connmand process, ps output: %s" % self.target.run(oeRuntimeTest.pscmd)[1])