# 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()
testFailures = []
testSkipped = []
testErrors = []
- pscmd = "ps"
def __init__(self, methodName='runTest'):
self.target = oeRuntimeTest.tc.target
-
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
@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])