Skip to contentSkip to conversation

oeqa/selftest/sanity: add test case for the recipe-naming sanity check

PATCH In review Ross Burton 2 participants 3 messages Jun 10, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 oeqa/selftest/sanity: add test case for the recipe-naming sanity check

Add a pair of test recipes to meta-selftest, and a new test module to collect test cases for the recipe_qa/package_qa checks.

---
 .../recipename/nativesdk-recipename-test.bb   |  6 +++++
 .../recipename/recipename-test-native.bb      |  6 +++++
 meta/lib/oeqa/selftest/cases/sanity.py        | 27 +++++++++++++++++++
 3 files changed, 39 insertions(+)
 create mode 100644 meta-selftest/recipes-test/recipename/nativesdk-recipename-test.bb
 create mode 100644 meta-selftest/recipes-test/recipename/recipename-test-native.bb
 create mode 100644 meta/lib/oeqa/selftest/cases/sanity.py
meta-selftest/recipes-test/recipename/nativesdk-recipename-test.bb new file +6 -0
new file mode 100644
index 00000000000..c5342150b23
@@ -0,0 +1,6 @@
+SUMMARY = "Recipe that is called nativesdk- but does not inherit nativesdk"
+LICENSE = "CLOSED"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+EXCLUDE_FROM_WORLD = "1"
meta-selftest/recipes-test/recipename/recipename-test-native.bb new file +6 -0
new file mode 100644
index 00000000000..2a05f6c617b
@@ -0,0 +1,6 @@
+SUMMARY = "Recipe that is called -native but does not inherit native"
+LICENSE = "CLOSED"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+EXCLUDE_FROM_WORLD = "1"
meta/lib/oeqa/selftest/cases/sanity.py new file +27 -0
new file mode 100644
index 00000000000..50ad0a141da
@@ -0,0 +1,27 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import bitbake
+
+class RecipeQaTests(OESelftestTestCase):
+    """
+    Tests to exercise the recipe_qa checks.
+    """
+
+    def test_recipe_naming(self):
+        """
+        Exercise the recipe-naming check.
+        """
+        self.write_config('ERROR_QA = "recipe-naming"')
+
+        for recipe in ("recipename-test-native", "nativesdk-recipename-test"):
+            with self.subTest(recipe=recipe):
+                res = bitbake(f"{recipe} -c recipe_qa -f", ignore_status=True)
+                # bitbake should have failed
+                self.assertNotEqual(res.status, 0)
+                # The recipe-naming test should be in the output
+                self.assertRegex(res.output, fr"do_recipe_qa.*{recipe}.*\[recipe-naming\]")
Signature · 1 line
2.43.0
#1 lore raw
Quoted 5 lines · Ross Burton via lists.openembedded.org

Add a pair of test recipes to meta-selftest, and a new test module to collect test cases for the recipe_qa/package_qa checks.

---

Hi Ross,

We get this error:

ERROR: recipename-test-native-1.0-r0 do_recipe_qa: QA Issue: Recipe recipename-test-native appears native but is not, should inherit native [recipe-naming]

https://autobuilder.yoctoproject.org/valkyrie/#/builders/29/builds/1775

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw
Quoted 8 lines · Mathieu Dubois-Briand
Quoted 5 lines · Ross Burton via lists.openembedded.org

Add a pair of test recipes to meta-selftest, and a new test module to collect test cases for the recipe_qa/package_qa checks.

---

Quoted 7 lines

Hi Ross,

We get this error:

ERROR: recipename-test-native-1.0-r0 do_recipe_qa: QA Issue: Recipe recipename-test-native appears native but is not, should inherit native [recipe-naming]

https://autobuilder.yoctoproject.org/valkyrie/#/builders/29/builds/1775

Well that’s just annoying.

Sorry for the noise, I’ll go back to the drawing board and figure out how to make a test.

Ross