mirror of
https://git.yoctoproject.org/poky
synced 2026-04-21 03:32:12 +02:00
oeqa/selftest: Add test for conflicting sysroot provider
sysroot-test depends on virtual/sysroot-test which we build for one machine, switch machine, switch provider of virtual/sysroot-test and check that the sysroot is correctly cleaned up. The files in the two providers overlap so can cause errors if the sysroot code doesn't function correctly. Yes, sysroot-test should be machine specific really to avoid this, however the sysroot cleanup should also work. This adds a test for bug: [YOCTO #13702] (From OE-Core rev: 31a8b4935e673aba8a1147c4a2fb510b1a8bc3ce) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
LICENSE = "CLOSED"
|
||||
|
||||
PROVIDES = "virtual/sysroot-test"
|
||||
INHIBIT_DEFAULT_DEPS = "1"
|
||||
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||
|
||||
TESTSTRING ?= "1"
|
||||
|
||||
do_install() {
|
||||
install -d ${D}${includedir}
|
||||
echo "# test ${TESTSTRING}" > ${D}${includedir}/sysroot-test.h
|
||||
}
|
||||
|
||||
EXCLUDE_FROM_WORLD = "1"
|
||||
@@ -0,0 +1,14 @@
|
||||
LICENSE = "CLOSED"
|
||||
|
||||
PROVIDES = "virtual/sysroot-test"
|
||||
INHIBIT_DEFAULT_DEPS = "1"
|
||||
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||
|
||||
TESTSTRING ?= "2"
|
||||
|
||||
do_install() {
|
||||
install -d ${D}${includedir}
|
||||
echo "# test ${TESTSTRING}" > ${D}${includedir}/sysroot-test.h
|
||||
}
|
||||
|
||||
EXCLUDE_FROM_WORLD = "1"
|
||||
@@ -0,0 +1,6 @@
|
||||
SUMMARY = "Virtual provider sysroot test"
|
||||
LICENSE = "CLOSED"
|
||||
INHIBIT_DEFAULT_DEPS = "1"
|
||||
DEPENDS = "virtual/sysroot-test"
|
||||
|
||||
EXCLUDE_FROM_WORLD = "1"
|
||||
37
meta/lib/oeqa/selftest/cases/sysroot.py
Normal file
37
meta/lib/oeqa/selftest/cases/sysroot.py
Normal file
@@ -0,0 +1,37 @@
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
import uuid
|
||||
|
||||
from oeqa.selftest.case import OESelftestTestCase
|
||||
from oeqa.utils.commands import bitbake
|
||||
|
||||
class SysrootTests(OESelftestTestCase):
|
||||
def test_sysroot_cleanup(self):
|
||||
"""
|
||||
Build sysroot test which depends on virtual/sysroot-test for one machine,
|
||||
switch machine, switch provider of virtual/sysroot-test and check that the
|
||||
sysroot is correctly cleaned up. The files in the two providers overlap
|
||||
so can cause errors if the sysroot code doesn't function correctly.
|
||||
Yes, sysroot-test should be machine specific really to avoid this, however
|
||||
the sysroot cleanup should also work [YOCTO #13702].
|
||||
"""
|
||||
|
||||
uuid1 = uuid.uuid4()
|
||||
uuid2 = uuid.uuid4()
|
||||
|
||||
self.write_config("""
|
||||
PREFERRED_PROVIDER_virtual/sysroot-test = "sysroot-test-arch1"
|
||||
MACHINE = "qemux86"
|
||||
TESTSTRING_pn-sysroot-test-arch1 = "%s"
|
||||
TESTSTRING_pn-sysroot-test-arch2 = "%s"
|
||||
""" % (uuid1, uuid2))
|
||||
bitbake("sysroot-test")
|
||||
self.write_config("""
|
||||
PREFERRED_PROVIDER_virtual/sysroot-test = "sysroot-test-arch2"
|
||||
MACHINE = "qemux86copy"
|
||||
TESTSTRING_pn-sysroot-test-arch1 = "%s"
|
||||
TESTSTRING_pn-sysroot-test-arch2 = "%s"
|
||||
""" % (uuid1, uuid2))
|
||||
bitbake("sysroot-test")
|
||||
Reference in New Issue
Block a user