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.py25
1 files changed, 22 insertions, 3 deletions
diff --git a/meta/lib/oeqa/selftest/cases/gcc.py b/meta/lib/oeqa/selftest/cases/gcc.py
index 3efe15228f..1bda29a72b 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,7 +64,7 @@ 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)
@@ -73,6 +83,8 @@ class GccSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
73 # validate that SSH is working 83 # validate that SSH is working
74 status, _ = qemu.run("uname") 84 status, _ = qemu.run("uname")
75 self.assertEqual(status, 0) 85 self.assertEqual(status, 0)
86 qemu.run('echo "MaxStartups 75:30:100" >> /etc/ssh/sshd_config')
87 qemu.run('service sshd restart')
76 88
77 return self.run_check(*args, ssh=qemu.ip, **kwargs) 89 return self.run_check(*args, ssh=qemu.ip, **kwargs)
78 90
@@ -114,37 +126,44 @@ class GccLibItmSelfTest(GccSelfTestBase):
114 self.run_check("libitm") 126 self.run_check("libitm")
115 127
116@OETestTag("toolchain-system") 128@OETestTag("toolchain-system")
129@OETestTag("runqemu")
117class GccCrossSelfTestSystemEmulated(GccSelfTestBase): 130class GccCrossSelfTestSystemEmulated(GccSelfTestBase):
118 def test_cross_gcc(self): 131 def test_cross_gcc(self):
119 self.run_check_emulated("gcc") 132 self.run_check_emulated("gcc")
120 133
121@OETestTag("toolchain-system") 134@OETestTag("toolchain-system")
135@OETestTag("runqemu")
122class GxxCrossSelfTestSystemEmulated(GccSelfTestBase): 136class GxxCrossSelfTestSystemEmulated(GccSelfTestBase):
123 def test_cross_gxx(self): 137 def test_cross_gxx(self):
124 self.run_check_emulated("g++") 138 self.run_check_emulated("g++")
125 139
126@OETestTag("toolchain-system") 140@OETestTag("toolchain-system")
141@OETestTag("runqemu")
127class GccLibAtomicSelfTestSystemEmulated(GccSelfTestBase): 142class GccLibAtomicSelfTestSystemEmulated(GccSelfTestBase):
128 def test_libatomic(self): 143 def test_libatomic(self):
129 self.run_check_emulated("libatomic") 144 self.run_check_emulated("libatomic")
130 145
131@OETestTag("toolchain-system") 146@OETestTag("toolchain-system")
147@OETestTag("runqemu")
132class GccLibGompSelfTestSystemEmulated(GccSelfTestBase): 148class GccLibGompSelfTestSystemEmulated(GccSelfTestBase):
133 def test_libgomp(self): 149 def test_libgomp(self):
134 self.run_check_emulated("libgomp") 150 self.run_check_emulated("libgomp")
135 151
136@OETestTag("toolchain-system") 152@OETestTag("toolchain-system")
153@OETestTag("runqemu")
137class GccLibStdCxxSelfTestSystemEmulated(GccSelfTestBase): 154class GccLibStdCxxSelfTestSystemEmulated(GccSelfTestBase):
138 def test_libstdcxx(self): 155 def test_libstdcxx(self):
139 self.run_check_emulated("libstdc++-v3") 156 self.run_check_emulated("libstdc++-v3")
140 157
141@OETestTag("toolchain-system") 158@OETestTag("toolchain-system")
159@OETestTag("runqemu")
142class GccLibSspSelfTestSystemEmulated(GccSelfTestBase): 160class GccLibSspSelfTestSystemEmulated(GccSelfTestBase):
143 def test_libssp(self): 161 def test_libssp(self):
144 self.check_skip("libssp") 162 self.check_skip("libssp")
145 self.run_check_emulated("libssp") 163 self.run_check_emulated("libssp")
146 164
147@OETestTag("toolchain-system") 165@OETestTag("toolchain-system")
166@OETestTag("runqemu")
148class GccLibItmSelfTestSystemEmulated(GccSelfTestBase): 167class GccLibItmSelfTestSystemEmulated(GccSelfTestBase):
149 def test_libitm(self): 168 def test_libitm(self):
150 self.check_skip("libitm") 169 self.check_skip("libitm")