From 84ef58ae3905d0e3d15d0c88f495a9aba5b12751 Mon Sep 17 00:00:00 2001 From: Fabien Mahot Date: Wed, 14 Jun 2023 17:47:49 +0200 Subject: oeqa/selftest/bbtests: add non-existent prefile/postfile tests Fixes [YOCTO #10725] (From OE-Core rev: 74fed908b807056cbb10c20d62d494f3089f52ee) Signed-off-by: Fabien Mahot Reviewed-by: Yoann Congal Signed-off-by: Richard Purdie (cherry picked from commit b0c33655fad5b2e7d96a45b6210527dfb766797b) Signed-off-by: Steve Sakoman --- meta/lib/oeqa/selftest/cases/bbtests.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'meta/lib/oeqa/selftest/cases') diff --git a/meta/lib/oeqa/selftest/cases/bbtests.py b/meta/lib/oeqa/selftest/cases/bbtests.py index e659be5341..0b88316950 100644 --- a/meta/lib/oeqa/selftest/cases/bbtests.py +++ b/meta/lib/oeqa/selftest/cases/bbtests.py @@ -185,6 +185,10 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\" self.assertTrue(find, "No version returned for searched recipe. bitbake output: %s" % result.output) def test_prefile(self): + # Test when the prefile does not exist + result = runCmd('bitbake -r conf/prefile.conf', ignore_status=True) + self.assertEqual(1, result.status, "bitbake didn't error and should have when a specified prefile didn't exist: %s" % result.output) + # Test when the prefile exists preconf = os.path.join(self.builddir, 'conf/prefile.conf') self.track_for_cleanup(preconf) ftools.write_file(preconf ,"TEST_PREFILE=\"prefile\"") @@ -195,6 +199,10 @@ SSTATE_DIR = \"${TOPDIR}/download-selftest\" self.assertIn('localconf', result.output) def test_postfile(self): + # Test when the postfile does not exist + result = runCmd('bitbake -R conf/postfile.conf', ignore_status=True) + self.assertEqual(1, result.status, "bitbake didn't error and should have when a specified postfile didn't exist: %s" % result.output) + # Test when the postfile exists postconf = os.path.join(self.builddir, 'conf/postfile.conf') self.track_for_cleanup(postconf) ftools.write_file(postconf , "TEST_POSTFILE=\"postfile\"") -- cgit v1.2.3-54-g00ecf