blob: 315d1a61c2c98394512ae4355c62bb119c013c8e [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001#
2# SPDX-License-Identifier: MIT
3#
4
5import uuid
6
7from oeqa.selftest.case import OESelftestTestCase
Patrick Williams45852732022-04-02 08:58:32 -05008from oeqa.utils.commands import bitbake
Andrew Geissler82c905d2020-04-13 13:39:40 -05009
10class SysrootTests(OESelftestTestCase):
11 def test_sysroot_cleanup(self):
12 """
13 Build sysroot test which depends on virtual/sysroot-test for one machine,
14 switch machine, switch provider of virtual/sysroot-test and check that the
15 sysroot is correctly cleaned up. The files in the two providers overlap
16 so can cause errors if the sysroot code doesn't function correctly.
17 Yes, sysroot-test should be machine specific really to avoid this, however
18 the sysroot cleanup should also work [YOCTO #13702].
19 """
20
21 uuid1 = uuid.uuid4()
22 uuid2 = uuid.uuid4()
23
24 self.write_config("""
25PREFERRED_PROVIDER_virtual/sysroot-test = "sysroot-test-arch1"
26MACHINE = "qemux86"
Patrick Williams213cb262021-08-07 19:21:33 -050027TESTSTRING:pn-sysroot-test-arch1 = "%s"
28TESTSTRING:pn-sysroot-test-arch2 = "%s"
Andrew Geissler82c905d2020-04-13 13:39:40 -050029""" % (uuid1, uuid2))
30 bitbake("sysroot-test")
31 self.write_config("""
32PREFERRED_PROVIDER_virtual/sysroot-test = "sysroot-test-arch2"
33MACHINE = "qemux86copy"
Patrick Williams213cb262021-08-07 19:21:33 -050034TESTSTRING:pn-sysroot-test-arch1 = "%s"
35TESTSTRING:pn-sysroot-test-arch2 = "%s"
Andrew Geissler82c905d2020-04-13 13:39:40 -050036""" % (uuid1, uuid2))
37 bitbake("sysroot-test")