]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
oeqa/runtime/cases/ptest.py: use to_boolean for PTEST_EXPECT_FAILURE
authorChen Qi <Qi.Chen@windriver.com>
Fri, 9 Jan 2026 01:36:09 +0000 (01:36 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 15 Jan 2026 22:46:04 +0000 (22:46 +0000)
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.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/runtime/cases/ptest.py

index fbaeb84d006d9285c83493a2e4c7fc14ffbc305b..75165101af44f10a3c085c327d51b4d56f532c15 100644 (file)
@@ -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()