Patchwork [v2,9/9] lib/oeqa: fix dependecy check

login
register
mail settings
Submitter Stanacar, StefanX
Date July 15, 2013, 2:42 p.m.
Message ID <4d06d05ef481537369dd646b114f617a2bc7f8a4.1373899189.git.stefanx.stanacar@intel.com>
Download mbox | patch
Permalink /patch/53691/
State Accepted
Commit 3dee534f1e25109e0bdb681de0746c336f4b8840
Headers show

Comments

Stanacar, StefanX - July 15, 2013, 2:42 p.m.
Adds missing skip for smart test and fix the check (which I somehow broke
a while ago).

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
---
 meta/lib/oeqa/runtime/smart.py    | 1 +
 meta/lib/oeqa/utils/decorators.py | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/lib/oeqa/runtime/smart.py b/meta/lib/oeqa/runtime/smart.py
index 8cfacd4..0b03a30 100644
--- a/meta/lib/oeqa/runtime/smart.py
+++ b/meta/lib/oeqa/runtime/smart.py
@@ -10,6 +10,7 @@  def setUpModule():
 
 class SmartHelpTest(oeRuntimeTest):
 
+    @skipUnlessPassed('test_ssh')
     def test_smart_help(self):
         status = self.target.run('smart --help')[0]
         self.assertEqual(status, 0)
diff --git a/meta/lib/oeqa/utils/decorators.py b/meta/lib/oeqa/utils/decorators.py
index adec65e..e0ca6fd 100644
--- a/meta/lib/oeqa/utils/decorators.py
+++ b/meta/lib/oeqa/utils/decorators.py
@@ -41,7 +41,9 @@  class skipUnlessPassed(object):
 
     def __call__(self,f):
         def wrapped_f(*args):
-            if self.testcase in (oeRuntimeTest.testSkipped, oeRuntimeTest.testFailures, oeRuntimeTest.testErrors):
+            if self.testcase in oeRuntimeTest.testSkipped or \
+                    self.testcase in  oeRuntimeTest.testFailures or \
+                    self.testcase in oeRuntimeTest.testErrors:
                 raise unittest.SkipTest("Testcase dependency not met: %s" % self.testcase)
             f(*args)
         wrapped_f.__name__ = f.__name__