oeqa/selftest/cases/package.py: adding unittest for package rename conflicts

This Unittest tries to rename a package, using an already used name and
fails on do_package.

Reviewed-by: Yoann CONGAL <yoann.congal@smile.fr>
(From OE-Core rev: c3fe173d5196506d89aa464ba56aabcf581a60db)

Signed-off-by: Fawzi KHABER <fawzi.khaber@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Fawzi KHABER 2023-03-29 10:57:57 +02:00 committed by Richard Purdie
parent b8486ffe80
commit 3ae3669468
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,10 @@
SUMMARY = "Test case that tries to rename a package to an existing one and fails"
DESCRIPTION = "This generates a packaging error when a package is renamed to a pre-existing name"
LICENSE = "MIT"
# Add a new package ${PN}-renametest
PACKAGES += "${PN}-renametest"
# ... and try to rename the ${PN}-dev to the new ${PN}-renametest (conflict)
PKG:${PN}-dev = "${PN}-renametest"
EXCLUDE_FROM_WORLD = "1"

View File

@ -89,6 +89,13 @@ class VersionOrdering(OESelftestTestCase):
self.assertEqual(status - 100, sort, "%s %s (%d) failed" % (ver1, ver2, sort))
class PackageTests(OESelftestTestCase):
# Verify that a recipe cannot rename a package into an existing one
def test_package_name_conflict(self):
res = bitbake("packagenameconflict", ignore_status=True)
self.assertNotEqual(res.status, 0)
err = "package name already exists"
self.assertTrue(err in res.output)
# Verify that a recipe which sets up hardlink files has those preserved into split packages
# Also test file sparseness is preserved
def test_preserve_sparse_hardlinks(self):