diff options
-rw-r--r-- | meta/lib/oeqa/selftest/cases/glibc.py | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/meta/lib/oeqa/selftest/cases/glibc.py b/meta/lib/oeqa/selftest/cases/glibc.py index e13de87014..2e42485dd6 100644 --- a/meta/lib/oeqa/selftest/cases/glibc.py +++ b/meta/lib/oeqa/selftest/cases/glibc.py | |||
@@ -13,12 +13,8 @@ def parse_values(content): | |||
13 | yield i[len(v) + 2:].strip(), v | 13 | yield i[len(v) + 2:].strip(), v |
14 | break | 14 | break |
15 | 15 | ||
16 | @OETestTag("machine") | 16 | class GlibcSelfTestBase(OESelftestTestCase): |
17 | class GlibcSelfTest(OESelftestTestCase): | 17 | def run_check(self, ssh = None): |
18 | def test_glibc(self): | ||
19 | self.glibc_run_check() | ||
20 | |||
21 | def glibc_run_check(self, ssh = None): | ||
22 | # configure ssh target | 18 | # configure ssh target |
23 | features = [] | 19 | features = [] |
24 | if ssh is not None: | 20 | if ssh is not None: |
@@ -40,28 +36,26 @@ class GlibcSelfTest(OESelftestTestCase): | |||
40 | for test, result in parse_values(f): | 36 | for test, result in parse_values(f): |
41 | self.extraresults["ptestresult.{}.{}".format(ptestsuite, test)] = {"status" : result} | 37 | self.extraresults["ptestresult.{}.{}".format(ptestsuite, test)] = {"status" : result} |
42 | 38 | ||
43 | class GlibcSelfTestSystemEmulated(GlibcSelfTest): | 39 | def run_check_emulated(self): |
44 | default_installed_packages = [ | ||
45 | "glibc-charmaps", | ||
46 | "libgcc", | ||
47 | "libstdc++", | ||
48 | "libatomic", | ||
49 | "libgomp", | ||
50 | # "python3", | ||
51 | # "python3-pexpect", | ||
52 | "nfs-utils", | ||
53 | ] | ||
54 | |||
55 | def glibc_run_check(self): | ||
56 | with contextlib.ExitStack() as s: | 40 | with contextlib.ExitStack() as s: |
57 | # use the base work dir, as the nfs mount, since the recipe directory may not exist | 41 | # use the base work dir, as the nfs mount, since the recipe directory may not exist |
58 | tmpdir = get_bb_var("BASE_WORKDIR") | 42 | tmpdir = get_bb_var("BASE_WORKDIR") |
59 | nfsport, mountport = s.enter_context(unfs_server(tmpdir)) | 43 | nfsport, mountport = s.enter_context(unfs_server(tmpdir)) |
60 | 44 | ||
61 | # build core-image-minimal with required packages | 45 | # build core-image-minimal with required packages |
46 | default_installed_packages = [ | ||
47 | "glibc-charmaps", | ||
48 | "libgcc", | ||
49 | "libstdc++", | ||
50 | "libatomic", | ||
51 | "libgomp", | ||
52 | # "python3", | ||
53 | # "python3-pexpect", | ||
54 | "nfs-utils", | ||
55 | ] | ||
62 | features = [] | 56 | features = [] |
63 | features.append('IMAGE_FEATURES += "ssh-server-openssh"') | 57 | features.append('IMAGE_FEATURES += "ssh-server-openssh"') |
64 | features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" ".join(self.default_installed_packages))) | 58 | features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" ".join(default_installed_packages))) |
65 | self.write_config("\n".join(features)) | 59 | self.write_config("\n".join(features)) |
66 | bitbake("core-image-minimal") | 60 | bitbake("core-image-minimal") |
67 | 61 | ||
@@ -80,5 +74,15 @@ class GlibcSelfTestSystemEmulated(GlibcSelfTest): | |||
80 | if status != 0: | 74 | if status != 0: |
81 | raise Exception("Failed to setup NFS mount on target ({})".format(repr(output))) | 75 | raise Exception("Failed to setup NFS mount on target ({})".format(repr(output))) |
82 | 76 | ||
83 | super().glibc_run_check(ssh = qemu.ip) | 77 | self.run_check(ssh = qemu.ip) |
78 | |||
79 | @OETestTag("toolchain-user") | ||
80 | class GlibcSelfTest(GlibcSelfTestBase): | ||
81 | def test_glibc(self): | ||
82 | self.run_check() | ||
83 | |||
84 | @OETestTag("toolchain-system") | ||
85 | class GlibcSelfTestSystemEmulated(GlibcSelfTestBase): | ||
86 | def test_glibc(self): | ||
87 | self.run_check_emulated() | ||
84 | 88 | ||