diff options
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/sysroot.py')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/sysroot.py | 59 |
1 files changed, 54 insertions, 5 deletions
diff --git a/meta/lib/oeqa/selftest/cases/sysroot.py b/meta/lib/oeqa/selftest/cases/sysroot.py index 6e34927c90..ef854f6fee 100644 --- a/meta/lib/oeqa/selftest/cases/sysroot.py +++ b/meta/lib/oeqa/selftest/cases/sysroot.py | |||
@@ -1,11 +1,13 @@ | |||
1 | # | 1 | # |
2 | # Copyright OpenEmbedded Contributors | ||
3 | # | ||
2 | # SPDX-License-Identifier: MIT | 4 | # SPDX-License-Identifier: MIT |
3 | # | 5 | # |
4 | 6 | ||
5 | import uuid | 7 | import uuid |
6 | 8 | ||
7 | from oeqa.selftest.case import OESelftestTestCase | 9 | from oeqa.selftest.case import OESelftestTestCase |
8 | from oeqa.utils.commands import bitbake | 10 | from oeqa.utils.commands import bitbake |
9 | 11 | ||
10 | class SysrootTests(OESelftestTestCase): | 12 | class SysrootTests(OESelftestTestCase): |
11 | def test_sysroot_cleanup(self): | 13 | def test_sysroot_cleanup(self): |
@@ -24,14 +26,61 @@ class SysrootTests(OESelftestTestCase): | |||
24 | self.write_config(""" | 26 | self.write_config(""" |
25 | PREFERRED_PROVIDER_virtual/sysroot-test = "sysroot-test-arch1" | 27 | PREFERRED_PROVIDER_virtual/sysroot-test = "sysroot-test-arch1" |
26 | MACHINE = "qemux86" | 28 | MACHINE = "qemux86" |
27 | TESTSTRING_pn-sysroot-test-arch1 = "%s" | 29 | TESTSTRING:pn-sysroot-test-arch1 = "%s" |
28 | TESTSTRING_pn-sysroot-test-arch2 = "%s" | 30 | TESTSTRING:pn-sysroot-test-arch2 = "%s" |
29 | """ % (uuid1, uuid2)) | 31 | """ % (uuid1, uuid2)) |
30 | bitbake("sysroot-test") | 32 | bitbake("sysroot-test") |
31 | self.write_config(""" | 33 | self.write_config(""" |
32 | PREFERRED_PROVIDER_virtual/sysroot-test = "sysroot-test-arch2" | 34 | PREFERRED_PROVIDER_virtual/sysroot-test = "sysroot-test-arch2" |
33 | MACHINE = "qemux86copy" | 35 | MACHINE = "qemux86copy" |
34 | TESTSTRING_pn-sysroot-test-arch1 = "%s" | 36 | TESTSTRING:pn-sysroot-test-arch1 = "%s" |
35 | TESTSTRING_pn-sysroot-test-arch2 = "%s" | 37 | TESTSTRING:pn-sysroot-test-arch2 = "%s" |
36 | """ % (uuid1, uuid2)) | 38 | """ % (uuid1, uuid2)) |
37 | bitbake("sysroot-test") | 39 | bitbake("sysroot-test") |
40 | |||
41 | def test_sysroot_max_shebang(self): | ||
42 | """ | ||
43 | Summary: Check max shebang triggers. To confirm [YOCTO #11053] is closed. | ||
44 | Expected: Fail when a shebang bigger than the max shebang-size is reached. | ||
45 | Author: Paulo Neves <ptsneves@gmail.com> | ||
46 | """ | ||
47 | expected = "maximum shebang size exceeded, the maximum size is 128. [shebang-size]" | ||
48 | res = bitbake("sysroot-shebang-test-native -c populate_sysroot", ignore_status=True) | ||
49 | self.assertTrue(expected in res.output, msg=res.output) | ||
50 | self.assertTrue(res.status != 0) | ||
51 | |||
52 | def test_sysroot_la(self): | ||
53 | """ | ||
54 | Summary: Check that workdir paths are not contained in .la files. | ||
55 | Expected: Fail when a workdir path is found in the file content. | ||
56 | Author: Paulo Neves <ptsneves@gmail.com> | ||
57 | """ | ||
58 | expected = "la-test.la failed sanity test (workdir) in path" | ||
59 | |||
60 | res = bitbake("sysroot-la-test -c populate_sysroot", ignore_status=True) | ||
61 | self.assertTrue(expected in res.output, msg=res.output) | ||
62 | self.assertTrue('[la]' in res.output, msg=res.output) | ||
63 | self.assertTrue(res.status != 0) | ||
64 | |||
65 | res = bitbake("sysroot-la-test-native -c populate_sysroot", ignore_status=True) | ||
66 | self.assertTrue(expected in res.output, msg=res.output) | ||
67 | self.assertTrue('[la]' in res.output, msg=res.output) | ||
68 | self.assertTrue(res.status != 0) | ||
69 | |||
70 | def test_sysroot_pkgconfig(self): | ||
71 | """ | ||
72 | Summary: Check that tmpdir paths are not contained in .pc files. | ||
73 | Expected: Fail when a tmpdir path is found in the file content. | ||
74 | Author: Paulo Neves <ptsneves@gmail.com> | ||
75 | """ | ||
76 | expected = "test.pc failed sanity test (tmpdir) in path" | ||
77 | |||
78 | res = bitbake("sysroot-pc-test -c populate_sysroot", ignore_status=True) | ||
79 | self.assertTrue('[pkgconfig]' in res.output, msg=res.output) | ||
80 | self.assertTrue(expected in res.output, msg=res.output) | ||
81 | self.assertTrue(res.status != 0) | ||
82 | |||
83 | res = bitbake("sysroot-pc-test-native -c populate_sysroot", ignore_status=True) | ||
84 | self.assertTrue(expected in res.output, msg=res.output) | ||
85 | self.assertTrue('[pkgconfig]' in res.output, msg=res.output) | ||
86 | self.assertTrue(res.status != 0) | ||