diff options
4 files changed, 71 insertions, 0 deletions
diff --git a/meta-selftest/recipes-test/sysroot-test/sysroot-test-arch1_1.0.bb b/meta-selftest/recipes-test/sysroot-test/sysroot-test-arch1_1.0.bb new file mode 100644 index 0000000000..36a682c53d --- /dev/null +++ b/meta-selftest/recipes-test/sysroot-test/sysroot-test-arch1_1.0.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | LICENSE = "CLOSED" | ||
2 | |||
3 | PROVIDES = "virtual/sysroot-test" | ||
4 | INHIBIT_DEFAULT_DEPS = "1" | ||
5 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
6 | |||
7 | TESTSTRING ?= "1" | ||
8 | |||
9 | do_install() { | ||
10 | install -d ${D}${includedir} | ||
11 | echo "# test ${TESTSTRING}" > ${D}${includedir}/sysroot-test.h | ||
12 | } | ||
13 | |||
14 | EXCLUDE_FROM_WORLD = "1" | ||
diff --git a/meta-selftest/recipes-test/sysroot-test/sysroot-test-arch2_1.0.bb b/meta-selftest/recipes-test/sysroot-test/sysroot-test-arch2_1.0.bb new file mode 100644 index 0000000000..67172f3cab --- /dev/null +++ b/meta-selftest/recipes-test/sysroot-test/sysroot-test-arch2_1.0.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | LICENSE = "CLOSED" | ||
2 | |||
3 | PROVIDES = "virtual/sysroot-test" | ||
4 | INHIBIT_DEFAULT_DEPS = "1" | ||
5 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
6 | |||
7 | TESTSTRING ?= "2" | ||
8 | |||
9 | do_install() { | ||
10 | install -d ${D}${includedir} | ||
11 | echo "# test ${TESTSTRING}" > ${D}${includedir}/sysroot-test.h | ||
12 | } | ||
13 | |||
14 | EXCLUDE_FROM_WORLD = "1" | ||
diff --git a/meta-selftest/recipes-test/sysroot-test/sysroot-test_1.0.bb b/meta-selftest/recipes-test/sysroot-test/sysroot-test_1.0.bb new file mode 100644 index 0000000000..560487c159 --- /dev/null +++ b/meta-selftest/recipes-test/sysroot-test/sysroot-test_1.0.bb | |||
@@ -0,0 +1,6 @@ | |||
1 | SUMMARY = "Virtual provider sysroot test" | ||
2 | LICENSE = "CLOSED" | ||
3 | INHIBIT_DEFAULT_DEPS = "1" | ||
4 | DEPENDS = "virtual/sysroot-test" | ||
5 | |||
6 | EXCLUDE_FROM_WORLD = "1" | ||
diff --git a/meta/lib/oeqa/selftest/cases/sysroot.py b/meta/lib/oeqa/selftest/cases/sysroot.py new file mode 100644 index 0000000000..6e34927c90 --- /dev/null +++ b/meta/lib/oeqa/selftest/cases/sysroot.py | |||
@@ -0,0 +1,37 @@ | |||
1 | # | ||
2 | # SPDX-License-Identifier: MIT | ||
3 | # | ||
4 | |||
5 | import uuid | ||
6 | |||
7 | from oeqa.selftest.case import OESelftestTestCase | ||
8 | from oeqa.utils.commands import bitbake | ||
9 | |||
10 | class 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(""" | ||
25 | PREFERRED_PROVIDER_virtual/sysroot-test = "sysroot-test-arch1" | ||
26 | MACHINE = "qemux86" | ||
27 | TESTSTRING_pn-sysroot-test-arch1 = "%s" | ||
28 | TESTSTRING_pn-sysroot-test-arch2 = "%s" | ||
29 | """ % (uuid1, uuid2)) | ||
30 | bitbake("sysroot-test") | ||
31 | self.write_config(""" | ||
32 | PREFERRED_PROVIDER_virtual/sysroot-test = "sysroot-test-arch2" | ||
33 | MACHINE = "qemux86copy" | ||
34 | TESTSTRING_pn-sysroot-test-arch1 = "%s" | ||
35 | TESTSTRING_pn-sysroot-test-arch2 = "%s" | ||
36 | """ % (uuid1, uuid2)) | ||
37 | bitbake("sysroot-test") | ||