diff mbox series

[v3,2/2] oeqa/selftest/pkgdata: add a test for variable consistency in multilib

Message ID 20260511031151.946905-3-jaeyoon.jung@lge.com
State Under Review
Headers show
Series Fix multilib package variable propagation | expand

Commit Message

From: Jaeyoon Jung <jaeyoon.jung@lge.com>

There was a case where a package's LICENSE in a multilib build is not
expanded properly and it ends up with fallback to the main LICENSE value
which is unexpected. This adds a selftest for that; verify the pkgdata
variable LICENSE is identical between the base and multilib packages.

Signed-off-by: Jaeyoon Jung <jaeyoon.jung@lge.com>
---
Changes in v3:
- Set INIT_MANAGER to systemd
- Use a list of recipe and package to test
---
 meta/lib/oeqa/selftest/cases/pkgdata.py | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
diff mbox series

Patch

diff --git a/meta/lib/oeqa/selftest/cases/pkgdata.py b/meta/lib/oeqa/selftest/cases/pkgdata.py
index d786c33018..69196ccf12 100644
--- a/meta/lib/oeqa/selftest/cases/pkgdata.py
+++ b/meta/lib/oeqa/selftest/cases/pkgdata.py
@@ -225,3 +225,26 @@  class OePkgdataUtilTests(OESelftestTestCase):
         self.assertEqual(result.status, 2, "Status different than 2. output: %s" % result.output)
         currpos = result.output.find('usage: oe-pkgdata-util')
         self.assertTrue(currpos != -1, msg = "Test is Failed. Help is not Displayed in %s" % result.output)
+
+    def test_multilib_variables(self):
+        # Set up a lib32 multilib configuration
+        self.write_config("""
+MACHINE:forcevariable = "qemux86-64"
+require conf/multilib.conf
+MULTILIBS = "multilib:lib32"
+DEFAULTTUNE:virtclass-multilib-lib32 = "x86"
+INIT_MANAGER = "systemd"
+DISTRO_FEATURES:append = " systemd usrmerge"
+""")
+        # Verify pkgdata variable LICENSE is identical between the base
+        # and multilib packages for selected recipes/packages below.
+        test_list = [
+            ('systemd', 'libsystemd')
+        ]
+        for recipe, package in test_list:
+            bitbake(f'{recipe} lib32-{recipe}')
+            pkg = runCmd(f'oe-pkgdata-util lookup-pkg {package}').output
+            pkg_lib32 = runCmd(f'oe-pkgdata-util lookup-pkg lib32-{package}').output
+            lic = runCmd(f'oe-pkgdata-util read-value LICENSE {pkg}').output
+            lic_lib32 = runCmd(f'oe-pkgdata-util read-value LICENSE {pkg_lib32}').output
+            self.assertEqual(lic, lic_lib32)