selftest-ed: Upgrade to version 1.21/1.20.2

Older versions do not compile with GCC 15. We had different versions to test
GPLv3 exclusion.

1.21 compiles with gcc 15 and 1.20.2 has a CFLAGS tweak to allow it to work
with gcc 15 too.

1.21 is licensed under GPL-2.0 so we need to rework some of the tests.

Tweak the gplv3 test by adding a special override of LICENSE to then test
the license exclusion code.

Modify the archiver selftests to use the new version.

Based on a patch from Khem Raj <raj.khem@gmail.com>

(From OE-Core rev: 3b17355ad1ecad17d12c5eb0e6403a59ef11f7d7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2025-04-26 20:44:23 -07:00
parent 6f6a9ec39b
commit cf9c5ac2c1
6 changed files with 97 additions and 71 deletions

View File

@@ -190,28 +190,28 @@ class Archiver(OESelftestTestCase):
Test that the archiver works with `ARCHIVER_MODE[src] = "original"`.
"""
self._test_archiver_mode('original', 'ed-1.14.1.tar.lz')
self._test_archiver_mode('original', 'ed-1.21.1.tar.lz')
def test_archiver_mode_patched(self):
"""
Test that the archiver works with `ARCHIVER_MODE[src] = "patched"`.
"""
self._test_archiver_mode('patched', 'selftest-ed-native-1.14.1-r0-patched.tar.xz')
self._test_archiver_mode('patched', 'selftest-ed-native-1.21.1-r0-patched.tar.xz')
def test_archiver_mode_configured(self):
"""
Test that the archiver works with `ARCHIVER_MODE[src] = "configured"`.
"""
self._test_archiver_mode('configured', 'selftest-ed-native-1.14.1-r0-configured.tar.xz')
self._test_archiver_mode('configured', 'selftest-ed-native-1.21.1-r0-configured.tar.xz')
def test_archiver_mode_recipe(self):
"""
Test that the archiver works with `ARCHIVER_MODE[recipe] = "1"`.
"""
self._test_archiver_mode('patched', 'selftest-ed-native-1.14.1-r0-recipe.tar.xz',
self._test_archiver_mode('patched', 'selftest-ed-native-1.21.1-r0-recipe.tar.xz',
'ARCHIVER_MODE[recipe] = "1"\n')
def test_archiver_mode_diff(self):
@@ -220,7 +220,7 @@ class Archiver(OESelftestTestCase):
Exclusions controlled by `ARCHIVER_MODE[diff-exclude]` are not yet tested.
"""
self._test_archiver_mode('patched', 'selftest-ed-native-1.14.1-r0-diff.gz',
self._test_archiver_mode('patched', 'selftest-ed-native-1.21.1-r0-diff.gz',
'ARCHIVER_MODE[diff] = "1"\n')
def test_archiver_mode_dumpdata(self):
@@ -228,7 +228,7 @@ class Archiver(OESelftestTestCase):
Test that the archiver works with `ARCHIVER_MODE[dumpdata] = "1"`.
"""
self._test_archiver_mode('patched', 'selftest-ed-native-1.14.1-r0-showdata.dump',
self._test_archiver_mode('patched', 'selftest-ed-native-1.21.1-r0-showdata.dump',
'ARCHIVER_MODE[dumpdata] = "1"\n')
def test_archiver_mode_mirror(self):
@@ -236,7 +236,7 @@ class Archiver(OESelftestTestCase):
Test that the archiver works with `ARCHIVER_MODE[src] = "mirror"`.
"""
self._test_archiver_mode('mirror', 'ed-1.14.1.tar.lz',
self._test_archiver_mode('mirror', 'ed-1.21.1.tar.lz',
'BB_GENERATE_MIRROR_TARBALLS = "1"\n')
def test_archiver_mode_mirror_excludes(self):
@@ -247,7 +247,7 @@ class Archiver(OESelftestTestCase):
"""
target='selftest-ed'
target_file_name = 'ed-1.14.1.tar.lz'
target_file_name = 'ed-1.21.1.tar.lz'
features = 'INHERIT += "archiver"\n'
features += 'ARCHIVER_MODE[src] = "mirror"\n'
@@ -285,7 +285,7 @@ class Archiver(OESelftestTestCase):
bitbake('-c deploy_archives %s' % (target))
bb_vars = get_bb_vars(['DEPLOY_DIR_SRC'])
for target_file_name in ['ed-1.14.1.tar.lz', 'hello.c']:
for target_file_name in ['ed-1.21.1.tar.lz', 'hello.c']:
glob_str = os.path.join(bb_vars['DEPLOY_DIR_SRC'], 'mirror', target_file_name)
glob_result = glob.glob(glob_str)
self.assertTrue(glob_result, 'Missing archive file %s' % (target_file_name))

View File

@@ -233,6 +233,7 @@ INHERIT:remove = \"report-error\"
def test_non_gplv3(self):
self.write_config('''INCOMPATIBLE_LICENSE = "GPL-3.0-or-later"
OVERRIDES .= ":gplv3test"
require conf/distro/include/no-gplv3.inc
''')
result = bitbake('selftest-ed', ignore_status=True)
@@ -241,7 +242,7 @@ require conf/distro/include/no-gplv3.inc
arch = get_bb_var('SSTATE_PKGARCH')
filename = os.path.join(lic_dir, arch, 'selftest-ed', 'generic_GPL-3.0-or-later')
self.assertFalse(os.path.isfile(filename), msg="License file %s exists and shouldn't" % filename)
filename = os.path.join(lic_dir, arch, 'selftest-ed', 'generic_GPL-2.0-or-later')
filename = os.path.join(lic_dir, arch, 'selftest-ed', 'generic_GPL-2.0-only')
self.assertTrue(os.path.isfile(filename), msg="License file %s doesn't exist" % filename)
def test_setscene_only(self):