diff mbox series

[2/2] selftest pokybleeding.py: add test for poky-bleeding.bbclass

Message ID 20250404154702.441150-2-mikko.rapeli@linaro.org
State New
Headers show
Series [1/2] poky-bleeding.bbclass: support recipes with multiple scm SRCREVs | expand

Commit Message

Mikko Rapeli April 4, 2025, 3:47 p.m. UTC
The class sets SRCREV to AUTOINC for recipes with single
or multiple repositories. Test those cases.

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
 meta/lib/oeqa/selftest/cases/pokybleeding.py | 32 ++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 meta/lib/oeqa/selftest/cases/pokybleeding.py

Comments

Alexander Kanavin June 24, 2025, 1:48 p.m. UTC | #1
This was added to meta-yocto repository, rather than oe-core, by
mistake I believe.

I'll send a correction.

Alex

On Fri, 4 Apr 2025 at 17:47, Mikko Rapeli via lists.openembedded.org
<mikko.rapeli=linaro.org@lists.openembedded.org> wrote:
>
> The class sets SRCREV to AUTOINC for recipes with single
> or multiple repositories. Test those cases.
>
> Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
> ---
>  meta/lib/oeqa/selftest/cases/pokybleeding.py | 32 ++++++++++++++++++++
>  1 file changed, 32 insertions(+)
>  create mode 100644 meta/lib/oeqa/selftest/cases/pokybleeding.py
>
> diff --git a/meta/lib/oeqa/selftest/cases/pokybleeding.py b/meta/lib/oeqa/selftest/cases/pokybleeding.py
> new file mode 100644
> index 0000000000..dc12f761b9
> --- /dev/null
> +++ b/meta/lib/oeqa/selftest/cases/pokybleeding.py
> @@ -0,0 +1,32 @@
> +#
> +# Copyright OpenEmbedded Contributors
> +#
> +# SPDX-License-Identifier: MIT
> +#
> +
> +from oeqa.utils.commands import bitbake, get_bb_var
> +from oeqa.selftest.case import OESelftestTestCase
> +
> +class PokyBleeding(OESelftestTestCase):
> +
> +    def test_poky_bleeding_autorev(self):
> +        """
> +        Test that poky-bleeding.bbclass sets SRCREV to "AUTOINC" for recipe
> +        with a single scm in SRC_URI and for recipe with two scm's in SRC_URI.
> +        """
> +
> +        self.assertNotEqual( get_bb_var('SRCREV', 'mtd-utils-selftest'), "AUTOINC")
> +
> +        self.assertNotEqual( get_bb_var('SRCREV', 'hello-rs'), "AUTOINC")
> +        self.assertNotEqual( get_bb_var('SRCREV_hello-lib', 'hello-rs'), "AUTOINC")
> +
> +        features = '''
> +INHERIT += "poky-bleeding"
> +POKY_AUTOREV_RECIPES = "hello-rs mtd-utils-selftest"
> +'''
> +        self.write_config(features)
> +
> +        self.assertEqual( get_bb_var('SRCREV', 'mtd-utils-selftest'), "AUTOINC")
> +
> +        self.assertEqual( get_bb_var('SRCREV', 'hello-rs'), "AUTOINC")
> +        self.assertEqual( get_bb_var('SRCREV_hello-lib', 'hello-rs'), "AUTOINC")
> --
> 2.43.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#214350): https://lists.openembedded.org/g/openembedded-core/message/214350
> Mute This Topic: https://lists.openembedded.org/mt/112086625/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/lib/oeqa/selftest/cases/pokybleeding.py b/meta/lib/oeqa/selftest/cases/pokybleeding.py
new file mode 100644
index 0000000000..dc12f761b9
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/pokybleeding.py
@@ -0,0 +1,32 @@ 
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+from oeqa.utils.commands import bitbake, get_bb_var
+from oeqa.selftest.case import OESelftestTestCase
+
+class PokyBleeding(OESelftestTestCase):
+
+    def test_poky_bleeding_autorev(self):
+        """
+        Test that poky-bleeding.bbclass sets SRCREV to "AUTOINC" for recipe
+        with a single scm in SRC_URI and for recipe with two scm's in SRC_URI.
+        """
+
+        self.assertNotEqual( get_bb_var('SRCREV', 'mtd-utils-selftest'), "AUTOINC")
+
+        self.assertNotEqual( get_bb_var('SRCREV', 'hello-rs'), "AUTOINC")
+        self.assertNotEqual( get_bb_var('SRCREV_hello-lib', 'hello-rs'), "AUTOINC")
+        
+        features = '''
+INHERIT += "poky-bleeding"
+POKY_AUTOREV_RECIPES = "hello-rs mtd-utils-selftest"
+'''
+        self.write_config(features)
+
+        self.assertEqual( get_bb_var('SRCREV', 'mtd-utils-selftest'), "AUTOINC")
+
+        self.assertEqual( get_bb_var('SRCREV', 'hello-rs'), "AUTOINC")
+        self.assertEqual( get_bb_var('SRCREV_hello-lib', 'hello-rs'), "AUTOINC")