summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/sysroot.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/sysroot.py')
-rw-r--r--meta/lib/oeqa/selftest/cases/sysroot.py59
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
5import uuid 7import uuid
6 8
7from oeqa.selftest.case import OESelftestTestCase 9from oeqa.selftest.case import OESelftestTestCase
8from oeqa.utils.commands import bitbake 10from oeqa.utils.commands import bitbake
9 11
10class SysrootTests(OESelftestTestCase): 12class 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("""
25PREFERRED_PROVIDER_virtual/sysroot-test = "sysroot-test-arch1" 27PREFERRED_PROVIDER_virtual/sysroot-test = "sysroot-test-arch1"
26MACHINE = "qemux86" 28MACHINE = "qemux86"
27TESTSTRING_pn-sysroot-test-arch1 = "%s" 29TESTSTRING:pn-sysroot-test-arch1 = "%s"
28TESTSTRING_pn-sysroot-test-arch2 = "%s" 30TESTSTRING: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("""
32PREFERRED_PROVIDER_virtual/sysroot-test = "sysroot-test-arch2" 34PREFERRED_PROVIDER_virtual/sysroot-test = "sysroot-test-arch2"
33MACHINE = "qemux86copy" 35MACHINE = "qemux86copy"
34TESTSTRING_pn-sysroot-test-arch1 = "%s" 36TESTSTRING:pn-sysroot-test-arch1 = "%s"
35TESTSTRING_pn-sysroot-test-arch2 = "%s" 37TESTSTRING: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)