commit:     c5143ef5f3b0ae1a4ea4988215fa913d63ba4afb
Author:     Louis Chauvet <louis.chauvet <AT> bootlin <DOT> com>
AuthorDate: Wed Dec 17 07:10:15 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Dec 18 01:34:11 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c5143ef5

tests/test_config: Add test for package.license in profiles

Now package.license can be read from profiles, add two tests to ensure that
user and profile configuration are properly read.

Bug: https://bugs.gentoo.org/686888
Signed-off-by: Louis Chauvet <louis.chauvet <AT> bootlin.com>
Reviewed-by: Sam James <sam <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/portage/tests/ebuild/test_config.py | 37 +++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/lib/portage/tests/ebuild/test_config.py 
b/lib/portage/tests/ebuild/test_config.py
index b36073504b..4394098725 100644
--- a/lib/portage/tests/ebuild/test_config.py
+++ b/lib/portage/tests/ebuild/test_config.py
@@ -185,6 +185,43 @@ class ConfigTestCase(TestCase):
             portage.util.noiselimit = 0
             playground.cleanup()
 
+    def testLicenseManagerProfile(self):
+        profile_config = {
+            "package.license": self._testLicenseManagerPackageLicense,
+        }
+
+        playground = ResolverPlayground(profile=profile_config)
+        settings = config(clone=playground.settings)
+        try:
+            portage.util.noiselimit = -2
+
+            lic_man = LicenseManager(settings._locations_manager)
+            self._testLicenseManager(lic_man)
+
+        finally:
+            portage.util.noiselimit = 0
+            playground.cleanup()
+
+    def testLicenseManagerMixed(self):
+        profile_config = {
+            "package.license": self._testLicenseManagerPackageLicense[:4],
+        }
+        user_config = {
+            "package.license": self._testLicenseManagerPackageLicense[4:],
+        }
+
+        playground = ResolverPlayground(user_config=user_config, 
profile=profile_config)
+        settings = config(clone=playground.settings)
+        try:
+            portage.util.noiselimit = -2
+
+            lic_man = LicenseManager(settings._locations_manager)
+            self._testLicenseManager(lic_man)
+
+        finally:
+            portage.util.noiselimit = 0
+            playground.cleanup()
+
     def testPackageMaskOrder(self):
         ebuilds = {
             "dev-libs/A-1": {},

Reply via email to