Skip to contentSkip to conversation

oeqa/runtime/cases/ptest.py: use to_boolean for PTEST_EXPECT_FAILURE

PATCH New [email protected] 1 participant 1 message Jan 9

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 oeqa/runtime/cases/ptest.py: use to_boolean for PTEST_EXPECT_FAILURE

From: Chen Qi <[email protected]>

When PTEST_EXPECT_FAILURE is set to "0", "False" or unset, the expected behavior is that ptest should succeed. So we need to use to_boolean.

---
 meta/lib/oeqa/runtime/cases/ptest.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/lib/oeqa/runtime/cases/ptest.py +2 -2
index fbaeb84d00..75165101af 100644
@@ -22,7 +22,7 @@ class PtestRunnerTest(OERuntimeTestCase):
     @OEHasPackage(['ptest-runner'])
     @unittest.expectedFailure
     def test_ptestrunner_expectfail(self):
-        if not self.td.get('PTEST_EXPECT_FAILURE'):
+        if not bb.utils.to_boolean(self.td.get('PTEST_EXPECT_FAILURE'), default=False):
             self.skipTest('Cannot run ptests with @expectedFailure as ptests are required to pass')
         self.do_ptestrunner()
 
@@ -30,7 +30,7 @@ class PtestRunnerTest(OERuntimeTestCase):
     @OETestDepends(['ssh.SSHTest.test_ssh'])
     @OEHasPackage(['ptest-runner'])
     def test_ptestrunner_expectsuccess(self):
-        if self.td.get('PTEST_EXPECT_FAILURE'):
+        if bb.utils.to_boolean(self.td.get('PTEST_EXPECT_FAILURE'), default=False):
             self.skipTest('Cannot run ptests without @expectedFailure as ptests are expected to fail')
         self.do_ptestrunner()
 
Signature · 1 line
2.43.0