summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/gcc.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/gcc.py')
-rw-r--r--meta/lib/oeqa/selftest/cases/gcc.py30
1 files changed, 25 insertions, 5 deletions
diff --git a/meta/lib/oeqa/selftest/cases/gcc.py b/meta/lib/oeqa/selftest/cases/gcc.py
index 3efe15228f..d01a791cb5 100644
--- a/meta/lib/oeqa/selftest/cases/gcc.py
+++ b/meta/lib/oeqa/selftest/cases/gcc.py
@@ -1,9 +1,14 @@
1#
2# Copyright OpenEmbedded Contributors
3#
1# SPDX-License-Identifier: MIT 4# SPDX-License-Identifier: MIT
5#
2import os 6import os
7import time
3from oeqa.core.decorator import OETestTag 8from oeqa.core.decorator import OETestTag
4from oeqa.core.case import OEPTestResultTestCase 9from oeqa.core.case import OEPTestResultTestCase
5from oeqa.selftest.case import OESelftestTestCase 10from oeqa.selftest.case import OESelftestTestCase
6from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runqemu, Command 11from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runqemu
7 12
8def parse_values(content): 13def parse_values(content):
9 for i in content: 14 for i in content:
@@ -32,15 +37,20 @@ class GccSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
32 features = [] 37 features = []
33 features.append('MAKE_CHECK_TARGETS = "{0}"'.format(" ".join(targets))) 38 features.append('MAKE_CHECK_TARGETS = "{0}"'.format(" ".join(targets)))
34 if ssh is not None: 39 if ssh is not None:
35 features.append('TOOLCHAIN_TEST_TARGET = "ssh"') 40 features.append('TOOLCHAIN_TEST_TARGET = "linux-ssh"')
36 features.append('TOOLCHAIN_TEST_HOST = "{0}"'.format(ssh)) 41 features.append('TOOLCHAIN_TEST_HOST = "{0}"'.format(ssh))
37 features.append('TOOLCHAIN_TEST_HOST_USER = "root"') 42 features.append('TOOLCHAIN_TEST_HOST_USER = "root"')
38 features.append('TOOLCHAIN_TEST_HOST_PORT = "22"') 43 features.append('TOOLCHAIN_TEST_HOST_PORT = "22"')
39 self.write_config("\n".join(features)) 44 self.write_config("\n".join(features))
40 45
41 recipe = "gcc-runtime" 46 recipe = "gcc-runtime"
47
48 start_time = time.time()
49
42 bitbake("{} -c check".format(recipe)) 50 bitbake("{} -c check".format(recipe))
43 51
52 end_time = time.time()
53
44 bb_vars = get_bb_vars(["B", "TARGET_SYS"], recipe) 54 bb_vars = get_bb_vars(["B", "TARGET_SYS"], recipe)
45 builddir, target_sys = bb_vars["B"], bb_vars["TARGET_SYS"] 55 builddir, target_sys = bb_vars["B"], bb_vars["TARGET_SYS"]
46 56
@@ -54,14 +64,14 @@ class GccSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
54 64
55 ptestsuite = "gcc-{}".format(suite) if suite != "gcc" else suite 65 ptestsuite = "gcc-{}".format(suite) if suite != "gcc" else suite
56 ptestsuite = ptestsuite + "-user" if ssh is None else ptestsuite 66 ptestsuite = ptestsuite + "-user" if ssh is None else ptestsuite
57 self.ptest_section(ptestsuite, logfile = logpath) 67 self.ptest_section(ptestsuite, duration = int(end_time - start_time), logfile = logpath)
58 with open(sumspath, "r") as f: 68 with open(sumspath, "r") as f:
59 for test, result in parse_values(f): 69 for test, result in parse_values(f):
60 self.ptest_result(ptestsuite, test, result) 70 self.ptest_result(ptestsuite, test, result)
61 71
62 def run_check_emulated(self, *args, **kwargs): 72 def run_check_emulated(self, *args, **kwargs):
63 # build core-image-minimal with required packages 73 # build core-image-minimal with required packages
64 default_installed_packages = ["libgcc", "libstdc++", "libatomic", "libgomp"] 74 default_installed_packages = ["libgcc", "libstdc++", "libatomic", "libgomp", "libitm"]
65 features = [] 75 features = []
66 features.append('IMAGE_FEATURES += "ssh-server-openssh"') 76 features.append('IMAGE_FEATURES += "ssh-server-openssh"')
67 features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" ".join(default_installed_packages))) 77 features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" ".join(default_installed_packages)))
@@ -69,10 +79,13 @@ class GccSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
69 bitbake("core-image-minimal") 79 bitbake("core-image-minimal")
70 80
71 # wrap the execution with a qemu instance 81 # wrap the execution with a qemu instance
72 with runqemu("core-image-minimal", runqemuparams = "nographic") as qemu: 82 # Increase RAM to 4GB to accommodate some GCC tests that require more than 3GB
83 with runqemu("core-image-minimal", runqemuparams = "nographic", qemuparams=" -m 4096") as qemu:
73 # validate that SSH is working 84 # validate that SSH is working
74 status, _ = qemu.run("uname") 85 status, _ = qemu.run("uname")
75 self.assertEqual(status, 0) 86 self.assertEqual(status, 0)
87 qemu.run('echo "MaxStartups 75:30:100" >> /etc/ssh/sshd_config')
88 qemu.run('service sshd restart')
76 89
77 return self.run_check(*args, ssh=qemu.ip, **kwargs) 90 return self.run_check(*args, ssh=qemu.ip, **kwargs)
78 91
@@ -114,37 +127,44 @@ class GccLibItmSelfTest(GccSelfTestBase):
114 self.run_check("libitm") 127 self.run_check("libitm")
115 128
116@OETestTag("toolchain-system") 129@OETestTag("toolchain-system")
130@OETestTag("runqemu")
117class GccCrossSelfTestSystemEmulated(GccSelfTestBase): 131class GccCrossSelfTestSystemEmulated(GccSelfTestBase):
118 def test_cross_gcc(self): 132 def test_cross_gcc(self):
119 self.run_check_emulated("gcc") 133 self.run_check_emulated("gcc")
120 134
121@OETestTag("toolchain-system") 135@OETestTag("toolchain-system")
136@OETestTag("runqemu")
122class GxxCrossSelfTestSystemEmulated(GccSelfTestBase): 137class GxxCrossSelfTestSystemEmulated(GccSelfTestBase):
123 def test_cross_gxx(self): 138 def test_cross_gxx(self):
124 self.run_check_emulated("g++") 139 self.run_check_emulated("g++")
125 140
126@OETestTag("toolchain-system") 141@OETestTag("toolchain-system")
142@OETestTag("runqemu")
127class GccLibAtomicSelfTestSystemEmulated(GccSelfTestBase): 143class GccLibAtomicSelfTestSystemEmulated(GccSelfTestBase):
128 def test_libatomic(self): 144 def test_libatomic(self):
129 self.run_check_emulated("libatomic") 145 self.run_check_emulated("libatomic")
130 146
131@OETestTag("toolchain-system") 147@OETestTag("toolchain-system")
148@OETestTag("runqemu")
132class GccLibGompSelfTestSystemEmulated(GccSelfTestBase): 149class GccLibGompSelfTestSystemEmulated(GccSelfTestBase):
133 def test_libgomp(self): 150 def test_libgomp(self):
134 self.run_check_emulated("libgomp") 151 self.run_check_emulated("libgomp")
135 152
136@OETestTag("toolchain-system") 153@OETestTag("toolchain-system")
154@OETestTag("runqemu")
137class GccLibStdCxxSelfTestSystemEmulated(GccSelfTestBase): 155class GccLibStdCxxSelfTestSystemEmulated(GccSelfTestBase):
138 def test_libstdcxx(self): 156 def test_libstdcxx(self):
139 self.run_check_emulated("libstdc++-v3") 157 self.run_check_emulated("libstdc++-v3")
140 158
141@OETestTag("toolchain-system") 159@OETestTag("toolchain-system")
160@OETestTag("runqemu")
142class GccLibSspSelfTestSystemEmulated(GccSelfTestBase): 161class GccLibSspSelfTestSystemEmulated(GccSelfTestBase):
143 def test_libssp(self): 162 def test_libssp(self):
144 self.check_skip("libssp") 163 self.check_skip("libssp")
145 self.run_check_emulated("libssp") 164 self.run_check_emulated("libssp")
146 165
147@OETestTag("toolchain-system") 166@OETestTag("toolchain-system")
167@OETestTag("runqemu")
148class GccLibItmSelfTestSystemEmulated(GccSelfTestBase): 168class GccLibItmSelfTestSystemEmulated(GccSelfTestBase):
149 def test_libitm(self): 169 def test_libitm(self):
150 self.check_skip("libitm") 170 self.check_skip("libitm")