summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2022-03-31 19:29:08 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-01 23:11:37 +0100
commit416cce968d3abb85177287cc1e497867d0472755 (patch)
tree6e3a5dab815105c9402c22887e6b07c94ca585bc /meta/lib
parent4e5f84902e52d477e46eb83978f23416f09bbc6a (diff)
downloadpoky-416cce968d3abb85177287cc1e497867d0472755.tar.gz
oeqa/selftest: tag tests that use runqemu
There may be environments or machines which don't have working runqemu, so tag all of the tests which use runqemu() so that they can be skipped. (From OE-Core rev: 3f45ce6d2b1dfde8bc3d554397d55f81846c52d5) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/selftest/cases/devtool.py3
-rw-r--r--meta/lib/oeqa/selftest/cases/gcc.py7
-rw-r--r--meta/lib/oeqa/selftest/cases/glibc.py1
-rw-r--r--meta/lib/oeqa/selftest/cases/imagefeatures.py3
-rw-r--r--meta/lib/oeqa/selftest/cases/overlayfs.py6
-rw-r--r--meta/lib/oeqa/selftest/cases/runqemu.py2
-rw-r--r--meta/lib/oeqa/selftest/cases/runtime_test.py9
-rw-r--r--meta/lib/oeqa/selftest/cases/wic.py7
8 files changed, 32 insertions, 6 deletions
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index 9c69585a88..ba5dca0359 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -9,10 +9,10 @@ import tempfile
9import glob 9import glob
10import fnmatch 10import fnmatch
11 11
12import oeqa.utils.ftools as ftools
13from oeqa.selftest.case import OESelftestTestCase 12from oeqa.selftest.case import OESelftestTestCase
14from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer 13from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer
15from oeqa.utils.commands import get_bb_vars, runqemu, get_test_layer 14from oeqa.utils.commands import get_bb_vars, runqemu, get_test_layer
15from oeqa.core.decorator import OETestTag
16 16
17oldmetapath = None 17oldmetapath = None
18 18
@@ -1351,6 +1351,7 @@ class DevtoolExtractTests(DevtoolBase):
1351 matches2 = glob.glob(stampprefix2 + '*') 1351 matches2 = glob.glob(stampprefix2 + '*')
1352 self.assertFalse(matches2, 'Stamp files exist for recipe %s that should have been cleaned' % testrecipe2) 1352 self.assertFalse(matches2, 'Stamp files exist for recipe %s that should have been cleaned' % testrecipe2)
1353 1353
1354 @OETestTag("runqemu")
1354 def test_devtool_deploy_target(self): 1355 def test_devtool_deploy_target(self):
1355 # NOTE: Whilst this test would seemingly be better placed as a runtime test, 1356 # NOTE: Whilst this test would seemingly be better placed as a runtime test,
1356 # unfortunately the runtime tests run under bitbake and you can't run 1357 # unfortunately the runtime tests run under bitbake and you can't run
diff --git a/meta/lib/oeqa/selftest/cases/gcc.py b/meta/lib/oeqa/selftest/cases/gcc.py
index 9308724ce5..b9ea03ae62 100644
--- a/meta/lib/oeqa/selftest/cases/gcc.py
+++ b/meta/lib/oeqa/selftest/cases/gcc.py
@@ -114,37 +114,44 @@ class GccLibItmSelfTest(GccSelfTestBase):
114 self.run_check("libitm") 114 self.run_check("libitm")
115 115
116@OETestTag("toolchain-system") 116@OETestTag("toolchain-system")
117@OETestTag("runqemu")
117class GccCrossSelfTestSystemEmulated(GccSelfTestBase): 118class GccCrossSelfTestSystemEmulated(GccSelfTestBase):
118 def test_cross_gcc(self): 119 def test_cross_gcc(self):
119 self.run_check_emulated("gcc") 120 self.run_check_emulated("gcc")
120 121
121@OETestTag("toolchain-system") 122@OETestTag("toolchain-system")
123@OETestTag("runqemu")
122class GxxCrossSelfTestSystemEmulated(GccSelfTestBase): 124class GxxCrossSelfTestSystemEmulated(GccSelfTestBase):
123 def test_cross_gxx(self): 125 def test_cross_gxx(self):
124 self.run_check_emulated("g++") 126 self.run_check_emulated("g++")
125 127
126@OETestTag("toolchain-system") 128@OETestTag("toolchain-system")
129@OETestTag("runqemu")
127class GccLibAtomicSelfTestSystemEmulated(GccSelfTestBase): 130class GccLibAtomicSelfTestSystemEmulated(GccSelfTestBase):
128 def test_libatomic(self): 131 def test_libatomic(self):
129 self.run_check_emulated("libatomic") 132 self.run_check_emulated("libatomic")
130 133
131@OETestTag("toolchain-system") 134@OETestTag("toolchain-system")
135@OETestTag("runqemu")
132class GccLibGompSelfTestSystemEmulated(GccSelfTestBase): 136class GccLibGompSelfTestSystemEmulated(GccSelfTestBase):
133 def test_libgomp(self): 137 def test_libgomp(self):
134 self.run_check_emulated("libgomp") 138 self.run_check_emulated("libgomp")
135 139
136@OETestTag("toolchain-system") 140@OETestTag("toolchain-system")
141@OETestTag("runqemu")
137class GccLibStdCxxSelfTestSystemEmulated(GccSelfTestBase): 142class GccLibStdCxxSelfTestSystemEmulated(GccSelfTestBase):
138 def test_libstdcxx(self): 143 def test_libstdcxx(self):
139 self.run_check_emulated("libstdc++-v3") 144 self.run_check_emulated("libstdc++-v3")
140 145
141@OETestTag("toolchain-system") 146@OETestTag("toolchain-system")
147@OETestTag("runqemu")
142class GccLibSspSelfTestSystemEmulated(GccSelfTestBase): 148class GccLibSspSelfTestSystemEmulated(GccSelfTestBase):
143 def test_libssp(self): 149 def test_libssp(self):
144 self.check_skip("libssp") 150 self.check_skip("libssp")
145 self.run_check_emulated("libssp") 151 self.run_check_emulated("libssp")
146 152
147@OETestTag("toolchain-system") 153@OETestTag("toolchain-system")
154@OETestTag("runqemu")
148class GccLibItmSelfTestSystemEmulated(GccSelfTestBase): 155class GccLibItmSelfTestSystemEmulated(GccSelfTestBase):
149 def test_libitm(self): 156 def test_libitm(self):
150 self.check_skip("libitm") 157 self.check_skip("libitm")
diff --git a/meta/lib/oeqa/selftest/cases/glibc.py b/meta/lib/oeqa/selftest/cases/glibc.py
index 4c149ab702..6fc98e9cb4 100644
--- a/meta/lib/oeqa/selftest/cases/glibc.py
+++ b/meta/lib/oeqa/selftest/cases/glibc.py
@@ -83,6 +83,7 @@ class GlibcSelfTest(GlibcSelfTestBase):
83 self.run_check() 83 self.run_check()
84 84
85@OETestTag("toolchain-system") 85@OETestTag("toolchain-system")
86@OETestTag("runqemu")
86class GlibcSelfTestSystemEmulated(GlibcSelfTestBase): 87class GlibcSelfTestSystemEmulated(GlibcSelfTestBase):
87 def test_glibc(self): 88 def test_glibc(self):
88 self.run_check_emulated() 89 self.run_check_emulated()
diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py b/meta/lib/oeqa/selftest/cases/imagefeatures.py
index d36d45c551..6b94ace4eb 100644
--- a/meta/lib/oeqa/selftest/cases/imagefeatures.py
+++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py
@@ -3,6 +3,7 @@
3# 3#
4 4
5from oeqa.selftest.case import OESelftestTestCase 5from oeqa.selftest.case import OESelftestTestCase
6from oeqa.core.decorator import OETestTag
6from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu 7from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
7from oeqa.utils.sshcontrol import SSHControl 8from oeqa.utils.sshcontrol import SSHControl
8import glob 9import glob
@@ -14,6 +15,7 @@ class ImageFeatures(OESelftestTestCase):
14 test_user = 'tester' 15 test_user = 'tester'
15 root_user = 'root' 16 root_user = 'root'
16 17
18 @OETestTag("runqemu")
17 def test_non_root_user_can_connect_via_ssh_without_password(self): 19 def test_non_root_user_can_connect_via_ssh_without_password(self):
18 """ 20 """
19 Summary: Check if non root user can connect via ssh without password 21 Summary: Check if non root user can connect via ssh without password
@@ -39,6 +41,7 @@ class ImageFeatures(OESelftestTestCase):
39 status, output = ssh.run("true") 41 status, output = ssh.run("true")
40 self.assertEqual(status, 0, 'ssh to user %s failed with %s' % (user, output)) 42 self.assertEqual(status, 0, 'ssh to user %s failed with %s' % (user, output))
41 43
44 @OETestTag("runqemu")
42 def test_all_users_can_connect_via_ssh_without_password(self): 45 def test_all_users_can_connect_via_ssh_without_password(self):
43 """ 46 """
44 Summary: Check if all users can connect via ssh without password 47 Summary: Check if all users can connect via ssh without password
diff --git a/meta/lib/oeqa/selftest/cases/overlayfs.py b/meta/lib/oeqa/selftest/cases/overlayfs.py
index 56ae48ce64..472746a64f 100644
--- a/meta/lib/oeqa/selftest/cases/overlayfs.py
+++ b/meta/lib/oeqa/selftest/cases/overlayfs.py
@@ -3,7 +3,8 @@
3# 3#
4 4
5from oeqa.selftest.case import OESelftestTestCase 5from oeqa.selftest.case import OESelftestTestCase
6from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu 6from oeqa.utils.commands import bitbake, runqemu
7from oeqa.core.decorator import OETestTag
7 8
8def getline_qemu(out, line): 9def getline_qemu(out, line):
9 for l in out.split('\n'): 10 for l in out.split('\n'):
@@ -185,6 +186,7 @@ EOT
185 line = getline_qemu(output, "upperdir=/mnt/overlay/upper/usr/share/another-overlay-mount") 186 line = getline_qemu(output, "upperdir=/mnt/overlay/upper/usr/share/another-overlay-mount")
186 self.assertTrue(line and line.startswith("overlay"), msg=output) 187 self.assertTrue(line and line.startswith("overlay"), msg=output)
187 188
189 @OETestTag("runqemu")
188 def test_correct_image_fstab(self): 190 def test_correct_image_fstab(self):
189 """ 191 """
190 Summary: Check that we can create an image when all parameters are 192 Summary: Check that we can create an image when all parameters are
@@ -203,6 +205,7 @@ EOT
203 205
204 self._test_correct_image('base-files', base_files_append) 206 self._test_correct_image('base-files', base_files_append)
205 207
208 @OETestTag("runqemu")
206 def test_correct_image_unit(self): 209 def test_correct_image_unit(self):
207 """ 210 """
208 Summary: Check that we can create an image when all parameters are 211 Summary: Check that we can create an image when all parameters are
@@ -238,6 +241,7 @@ EOT
238 241
239 self._test_correct_image('systemd-machine-units', systemd_machine_unit_append) 242 self._test_correct_image('systemd-machine-units', systemd_machine_unit_append)
240 243
244@OETestTag("runqemu")
241class OverlayFSEtcRunTimeTests(OESelftestTestCase): 245class OverlayFSEtcRunTimeTests(OESelftestTestCase):
242 """overlayfs-etc class tests""" 246 """overlayfs-etc class tests"""
243 247
diff --git a/meta/lib/oeqa/selftest/cases/runqemu.py b/meta/lib/oeqa/selftest/cases/runqemu.py
index da22f77b27..c1d277a095 100644
--- a/meta/lib/oeqa/selftest/cases/runqemu.py
+++ b/meta/lib/oeqa/selftest/cases/runqemu.py
@@ -12,6 +12,7 @@ from oeqa.core.decorator import OETestTag
12from oeqa.selftest.case import OESelftestTestCase 12from oeqa.selftest.case import OESelftestTestCase
13from oeqa.utils.commands import bitbake, runqemu, get_bb_var, runCmd 13from oeqa.utils.commands import bitbake, runqemu, get_bb_var, runCmd
14 14
15@OETestTag("runqemu")
15class RunqemuTests(OESelftestTestCase): 16class RunqemuTests(OESelftestTestCase):
16 """Runqemu test class""" 17 """Runqemu test class"""
17 18
@@ -149,6 +150,7 @@ SYSLINUX_TIMEOUT = "10"
149# bootup various filesystem types, including live image(iso and hddimg) 150# bootup various filesystem types, including live image(iso and hddimg)
150# where live image was not supported on all qemu architecture. 151# where live image was not supported on all qemu architecture.
151@OETestTag("machine") 152@OETestTag("machine")
153@OETestTag("runqemu")
152class QemuTest(OESelftestTestCase): 154class QemuTest(OESelftestTestCase):
153 155
154 @classmethod 156 @classmethod
diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
index 642f0eb637..7b7371b6e0 100644
--- a/meta/lib/oeqa/selftest/cases/runtime_test.py
+++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
@@ -4,16 +4,15 @@
4 4
5from oeqa.selftest.case import OESelftestTestCase 5from oeqa.selftest.case import OESelftestTestCase
6from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu 6from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu
7from oeqa.utils.sshcontrol import SSHControl 7from oeqa.core.decorator import OETestTag
8import os 8import os
9import re
10import tempfile 9import tempfile
11import shutil
12import oe.lsb 10import oe.lsb
13from oeqa.core.decorator.data import skipIfNotQemu 11from oeqa.core.decorator.data import skipIfNotQemu
14 12
15class TestExport(OESelftestTestCase): 13class TestExport(OESelftestTestCase):
16 14
15 @OETestTag("runqemu")
17 def test_testexport_basic(self): 16 def test_testexport_basic(self):
18 """ 17 """
19 Summary: Check basic testexport functionality with only ping test enabled. 18 Summary: Check basic testexport functionality with only ping test enabled.
@@ -106,6 +105,7 @@ class TestExport(OESelftestTestCase):
106 self.assertEqual(0, result.status, "Couldn't run tar from SDK") 105 self.assertEqual(0, result.status, "Couldn't run tar from SDK")
107 106
108 107
108@OETestTag("runqemu")
109class TestImage(OESelftestTestCase): 109class TestImage(OESelftestTestCase):
110 110
111 def test_testimage_install(self): 111 def test_testimage_install(self):
@@ -240,6 +240,7 @@ class TestImage(OESelftestTestCase):
240 bitbake('core-image-minimal') 240 bitbake('core-image-minimal')
241 bitbake('-c testimage core-image-minimal') 241 bitbake('-c testimage core-image-minimal')
242 242
243@OETestTag("runqemu")
243class Postinst(OESelftestTestCase): 244class Postinst(OESelftestTestCase):
244 245
245 def init_manager_loop(self, init_manager): 246 def init_manager_loop(self, init_manager):
@@ -357,6 +358,7 @@ class Postinst(OESelftestTestCase):
357 self.assertFalse(os.path.isfile(os.path.join(hosttestdir, "rootfs-after-failure")), 358 self.assertFalse(os.path.isfile(os.path.join(hosttestdir, "rootfs-after-failure")),
358 "rootfs-after-failure file was created") 359 "rootfs-after-failure file was created")
359 360
361@OETestTag("runqemu")
360class SystemTap(OESelftestTestCase): 362class SystemTap(OESelftestTestCase):
361 """ 363 """
362 Summary: The purpose of this test case is to verify native crosstap 364 Summary: The purpose of this test case is to verify native crosstap
@@ -433,4 +435,3 @@ IMAGE_INSTALL:append = " systemtap-runtime"
433 cmd = "crosstap -r root@192.168.7.2 -s %s/process/ syscalls_by_pid.stp" % systemtap_examples 435 cmd = "crosstap -r root@192.168.7.2 -s %s/process/ syscalls_by_pid.stp" % systemtap_examples
434 result = runCmd(cmd) 436 result = runCmd(cmd)
435 self.assertEqual(0, result.status, 'crosstap syscalls_by_pid returned a non 0 status:%s' % result.output) 437 self.assertEqual(0, result.status, 'crosstap syscalls_by_pid returned a non 0 status:%s' % result.output)
436
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index 325fb7776a..2eb80ac194 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -19,6 +19,7 @@ from functools import wraps, lru_cache
19from tempfile import NamedTemporaryFile 19from tempfile import NamedTemporaryFile
20 20
21from oeqa.selftest.case import OESelftestTestCase 21from oeqa.selftest.case import OESelftestTestCase
22from oeqa.core.decorator import OETestTag
22from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu 23from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu
23 24
24 25
@@ -843,6 +844,7 @@ class Wic2(WicTestCase):
843 844
844 # TODO this should work on aarch64 845 # TODO this should work on aarch64
845 @only_for_arch(['i586', 'i686', 'x86_64']) 846 @only_for_arch(['i586', 'i686', 'x86_64'])
847 @OETestTag("runqemu")
846 def test_qemu(self): 848 def test_qemu(self):
847 """Test wic-image-minimal under qemu""" 849 """Test wic-image-minimal under qemu"""
848 config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "wic-image-minimal"\n'\ 850 config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "wic-image-minimal"\n'\
@@ -863,6 +865,7 @@ class Wic2(WicTestCase):
863 self.assertEqual(output, 'UUID=2c71ef06-a81d-4735-9d3a-379b69c6bdba\t/media\text4\tdefaults\t0\t0') 865 self.assertEqual(output, 'UUID=2c71ef06-a81d-4735-9d3a-379b69c6bdba\t/media\text4\tdefaults\t0\t0')
864 866
865 @only_for_arch(['i586', 'i686', 'x86_64']) 867 @only_for_arch(['i586', 'i686', 'x86_64'])
868 @OETestTag("runqemu")
866 def test_qemu_efi(self): 869 def test_qemu_efi(self):
867 """Test core-image-minimal efi image under qemu""" 870 """Test core-image-minimal efi image under qemu"""
868 config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "mkefidisk.wks"\n' 871 config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "mkefidisk.wks"\n'
@@ -1046,6 +1049,7 @@ class Wic2(WicTestCase):
1046 self.assertGreaterEqual(size, 204800) 1049 self.assertGreaterEqual(size, 204800)
1047 1050
1048 @only_for_arch(['i586', 'i686', 'x86_64', 'aarch64']) 1051 @only_for_arch(['i586', 'i686', 'x86_64', 'aarch64'])
1052 @OETestTag("runqemu")
1049 def test_rawcopy_plugin_qemu(self): 1053 def test_rawcopy_plugin_qemu(self):
1050 """Test rawcopy plugin in qemu""" 1054 """Test rawcopy plugin in qemu"""
1051 # build ext4 and then use it for a wic image 1055 # build ext4 and then use it for a wic image
@@ -1113,6 +1117,7 @@ class Wic2(WicTestCase):
1113 self.assertEqual('1', result.output) 1117 self.assertEqual('1', result.output)
1114 1118
1115 @only_for_arch(['i586', 'i686', 'x86_64']) 1119 @only_for_arch(['i586', 'i686', 'x86_64'])
1120 @OETestTag("runqemu")
1116 def test_biosplusefi_plugin_qemu(self): 1121 def test_biosplusefi_plugin_qemu(self):
1117 """Test biosplusefi plugin in qemu""" 1122 """Test biosplusefi plugin in qemu"""
1118 config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_biosplusefi_plugin.wks"\nMACHINE_FEATURES:append = " efi"\n' 1123 config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_biosplusefi_plugin.wks"\nMACHINE_FEATURES:append = " efi"\n'
@@ -1172,6 +1177,7 @@ class Wic2(WicTestCase):
1172 1177
1173 # TODO this test could also work on aarch64 1178 # TODO this test could also work on aarch64
1174 @only_for_arch(['i586', 'i686', 'x86_64']) 1179 @only_for_arch(['i586', 'i686', 'x86_64'])
1180 @OETestTag("runqemu")
1175 def test_efi_plugin_unified_kernel_image_qemu(self): 1181 def test_efi_plugin_unified_kernel_image_qemu(self):
1176 """Test efi plugin's Unified Kernel Image feature in qemu""" 1182 """Test efi plugin's Unified Kernel Image feature in qemu"""
1177 config = 'IMAGE_FSTYPES = "wic"\n'\ 1183 config = 'IMAGE_FSTYPES = "wic"\n'\
@@ -1381,6 +1387,7 @@ class Wic2(WicTestCase):
1381 self.assertEqual(1, len(out)) 1387 self.assertEqual(1, len(out))
1382 1388
1383 @only_for_arch(['i586', 'i686', 'x86_64']) 1389 @only_for_arch(['i586', 'i686', 'x86_64'])
1390 @OETestTag("runqemu")
1384 def test_expand_mbr_image(self): 1391 def test_expand_mbr_image(self):
1385 """Test wic write --expand command for mbr image""" 1392 """Test wic write --expand command for mbr image"""
1386 # build an image 1393 # build an image