summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2019-09-07 12:55:06 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-09-07 21:56:43 +0100
commit2ae6a072ca6e065dae8639b37d92cecc79ce4812 (patch)
tree0d4136284447aa25e4c8c6523d8a607d731c769a /meta/lib/oeqa
parentfdb2bfa0b7ee3ebd4a9124ddda6f61db0e4519bc (diff)
downloadpoky-2ae6a072ca6e065dae8639b37d92cecc79ce4812.tar.gz
oeqa/selftest/cases/glibc.py: Rework and tag with toolchain-user/system
Rework the glibc execution into a common base class. Additionally tag the tests with "toolchain-user" and "toolchain-system". (From OE-Core rev: 94bf24268108774e022ad247c647e48a781debbb) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/selftest/cases/glibc.py46
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") 16class GlibcSelfTestBase(OESelftestTestCase):
17class 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
43class 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")
80class GlibcSelfTest(GlibcSelfTestBase):
81 def test_glibc(self):
82 self.run_check()
83
84@OETestTag("toolchain-system")
85class GlibcSelfTestSystemEmulated(GlibcSelfTestBase):
86 def test_glibc(self):
87 self.run_check_emulated()
84 88