]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oeqa/selftest: tag tests that use runqemu
authorRoss Burton <ross@burtonini.com>
Thu, 31 Mar 2022 18:29:08 +0000 (19:29 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 1 Apr 2022 22:05:31 +0000 (23:05 +0100)
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.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
meta/lib/oeqa/selftest/cases/devtool.py
meta/lib/oeqa/selftest/cases/gcc.py
meta/lib/oeqa/selftest/cases/glibc.py
meta/lib/oeqa/selftest/cases/imagefeatures.py
meta/lib/oeqa/selftest/cases/overlayfs.py
meta/lib/oeqa/selftest/cases/runqemu.py
meta/lib/oeqa/selftest/cases/runtime_test.py
meta/lib/oeqa/selftest/cases/wic.py

index 9c69585a88c5e1d8da203523888b2464e6ba7497..ba5dca0359e806b0c165bde6cd2290f282dfdb6c 100644 (file)
@@ -9,10 +9,10 @@ import tempfile
 import glob
 import fnmatch
 
-import oeqa.utils.ftools as ftools
 from oeqa.selftest.case import OESelftestTestCase
 from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer
 from oeqa.utils.commands import get_bb_vars, runqemu, get_test_layer
+from oeqa.core.decorator import OETestTag
 
 oldmetapath = None
 
@@ -1351,6 +1351,7 @@ class DevtoolExtractTests(DevtoolBase):
         matches2 = glob.glob(stampprefix2 + '*')
         self.assertFalse(matches2, 'Stamp files exist for recipe %s that should have been cleaned' % testrecipe2)
 
+    @OETestTag("runqemu")
     def test_devtool_deploy_target(self):
         # NOTE: Whilst this test would seemingly be better placed as a runtime test,
         # unfortunately the runtime tests run under bitbake and you can't run
index 9308724ce5ed11275af61e8d6603d04f56f9a977..b9ea03ae62d5419f599134b3e0506a0d6841cfcf 100644 (file)
@@ -114,37 +114,44 @@ class GccLibItmSelfTest(GccSelfTestBase):
         self.run_check("libitm")
 
 @OETestTag("toolchain-system")
+@OETestTag("runqemu")
 class GccCrossSelfTestSystemEmulated(GccSelfTestBase):
     def test_cross_gcc(self):
         self.run_check_emulated("gcc")
 
 @OETestTag("toolchain-system")
+@OETestTag("runqemu")
 class GxxCrossSelfTestSystemEmulated(GccSelfTestBase):
     def test_cross_gxx(self):
         self.run_check_emulated("g++")
 
 @OETestTag("toolchain-system")
+@OETestTag("runqemu")
 class GccLibAtomicSelfTestSystemEmulated(GccSelfTestBase):
     def test_libatomic(self):
         self.run_check_emulated("libatomic")
 
 @OETestTag("toolchain-system")
+@OETestTag("runqemu")
 class GccLibGompSelfTestSystemEmulated(GccSelfTestBase):
     def test_libgomp(self):
         self.run_check_emulated("libgomp")
 
 @OETestTag("toolchain-system")
+@OETestTag("runqemu")
 class GccLibStdCxxSelfTestSystemEmulated(GccSelfTestBase):
     def test_libstdcxx(self):
         self.run_check_emulated("libstdc++-v3")
 
 @OETestTag("toolchain-system")
+@OETestTag("runqemu")
 class GccLibSspSelfTestSystemEmulated(GccSelfTestBase):
     def test_libssp(self):
         self.check_skip("libssp")
         self.run_check_emulated("libssp")
 
 @OETestTag("toolchain-system")
+@OETestTag("runqemu")
 class GccLibItmSelfTestSystemEmulated(GccSelfTestBase):
     def test_libitm(self):
         self.check_skip("libitm")
index 4c149ab70231bde61d02a6b3b1f528ff84cf7e71..6fc98e9cb4798e2c2063b95ed0484e53aa2b39df 100644 (file)
@@ -83,6 +83,7 @@ class GlibcSelfTest(GlibcSelfTestBase):
         self.run_check()
 
 @OETestTag("toolchain-system")
+@OETestTag("runqemu")
 class GlibcSelfTestSystemEmulated(GlibcSelfTestBase):
     def test_glibc(self):
         self.run_check_emulated()
index d36d45c55166089a9ddcf7c685e6483bda76c71e..6b94ace4eba0f264b26e1c1f1a2eb0239cd3ec9b 100644 (file)
@@ -3,6 +3,7 @@
 #
 
 from oeqa.selftest.case import OESelftestTestCase
+from oeqa.core.decorator import OETestTag
 from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
 from oeqa.utils.sshcontrol import SSHControl
 import glob
@@ -14,6 +15,7 @@ class ImageFeatures(OESelftestTestCase):
     test_user = 'tester'
     root_user = 'root'
 
+    @OETestTag("runqemu")
     def test_non_root_user_can_connect_via_ssh_without_password(self):
         """
         Summary: Check if non root user can connect via ssh without password
@@ -39,6 +41,7 @@ class ImageFeatures(OESelftestTestCase):
                 status, output = ssh.run("true")
                 self.assertEqual(status, 0, 'ssh to user %s failed with %s' % (user, output))
 
+    @OETestTag("runqemu")
     def test_all_users_can_connect_via_ssh_without_password(self):
         """
         Summary:     Check if all users can connect via ssh without password
index 56ae48ce64b4f3c49e982e7a580c3e0a18aa9047..472746a64f4b049edf31412aab563ac8bd534b20 100644 (file)
@@ -3,7 +3,8 @@
 #
 
 from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
+from oeqa.utils.commands import bitbake, runqemu
+from oeqa.core.decorator import OETestTag
 
 def getline_qemu(out, line):
     for l in out.split('\n'):
@@ -185,6 +186,7 @@ EOT
             line = getline_qemu(output, "upperdir=/mnt/overlay/upper/usr/share/another-overlay-mount")
             self.assertTrue(line and line.startswith("overlay"), msg=output)
 
+    @OETestTag("runqemu")
     def test_correct_image_fstab(self):
         """
         Summary:   Check that we can create an image when all parameters are
@@ -203,6 +205,7 @@ EOT
 
         self._test_correct_image('base-files', base_files_append)
 
+    @OETestTag("runqemu")
     def test_correct_image_unit(self):
         """
         Summary:   Check that we can create an image when all parameters are
@@ -238,6 +241,7 @@ EOT
 
         self._test_correct_image('systemd-machine-units', systemd_machine_unit_append)
 
+@OETestTag("runqemu")
 class OverlayFSEtcRunTimeTests(OESelftestTestCase):
     """overlayfs-etc class tests"""
 
index da22f77b2767e4c2e7f07cc5dfc11feb69e51a6d..c1d277a095a4056d92a3c142fcfdc8c6ffab33c0 100644 (file)
@@ -12,6 +12,7 @@ from oeqa.core.decorator import OETestTag
 from oeqa.selftest.case import OESelftestTestCase
 from oeqa.utils.commands import bitbake, runqemu, get_bb_var, runCmd
 
+@OETestTag("runqemu")
 class RunqemuTests(OESelftestTestCase):
     """Runqemu test class"""
 
@@ -149,6 +150,7 @@ SYSLINUX_TIMEOUT = "10"
 # bootup various filesystem types, including live image(iso and hddimg)
 # where live image was not supported on all qemu architecture.
 @OETestTag("machine")
+@OETestTag("runqemu")
 class QemuTest(OESelftestTestCase):
 
     @classmethod
index 642f0eb6375869226ea9c26c70a45ed764d6b6c9..7b7371b6e073ba9817bde7134b25cf2ed3d6c5b4 100644 (file)
@@ -4,16 +4,15 @@
 
 from oeqa.selftest.case import OESelftestTestCase
 from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu
-from oeqa.utils.sshcontrol import SSHControl
+from oeqa.core.decorator import OETestTag
 import os
-import re
 import tempfile
-import shutil
 import oe.lsb
 from oeqa.core.decorator.data import skipIfNotQemu
 
 class TestExport(OESelftestTestCase):
 
+    @OETestTag("runqemu")
     def test_testexport_basic(self):
         """
         Summary: Check basic testexport functionality with only ping test enabled.
@@ -106,6 +105,7 @@ class TestExport(OESelftestTestCase):
             self.assertEqual(0, result.status, "Couldn't run tar from SDK")
 
 
+@OETestTag("runqemu")
 class TestImage(OESelftestTestCase):
 
     def test_testimage_install(self):
@@ -240,6 +240,7 @@ class TestImage(OESelftestTestCase):
         bitbake('core-image-minimal')
         bitbake('-c testimage core-image-minimal')
 
+@OETestTag("runqemu")
 class Postinst(OESelftestTestCase):
 
     def init_manager_loop(self, init_manager):
@@ -357,6 +358,7 @@ class Postinst(OESelftestTestCase):
                 self.assertFalse(os.path.isfile(os.path.join(hosttestdir, "rootfs-after-failure")),
                                     "rootfs-after-failure file was created")
 
+@OETestTag("runqemu")
 class SystemTap(OESelftestTestCase):
         """
         Summary:        The purpose of this test case is to verify native crosstap
@@ -433,4 +435,3 @@ IMAGE_INSTALL:append = " systemtap-runtime"
                 cmd = "crosstap -r root@192.168.7.2 -s %s/process/ syscalls_by_pid.stp" % systemtap_examples
                 result = runCmd(cmd)
                 self.assertEqual(0, result.status, 'crosstap  syscalls_by_pid returned a non 0 status:%s' % result.output)
-
index 325fb7776a8c451d81250b3ca70ca785626b99ea..2eb80ac1941a9ae34ff76fbd3e1987d465008ee7 100644 (file)
@@ -19,6 +19,7 @@ from functools import wraps, lru_cache
 from tempfile import NamedTemporaryFile
 
 from oeqa.selftest.case import OESelftestTestCase
+from oeqa.core.decorator import OETestTag
 from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu
 
 
@@ -843,6 +844,7 @@ class Wic2(WicTestCase):
 
     # TODO this should work on aarch64
     @only_for_arch(['i586', 'i686', 'x86_64'])
+    @OETestTag("runqemu")
     def test_qemu(self):
         """Test wic-image-minimal under qemu"""
         config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "wic-image-minimal"\n'\
@@ -863,6 +865,7 @@ class Wic2(WicTestCase):
             self.assertEqual(output, 'UUID=2c71ef06-a81d-4735-9d3a-379b69c6bdba\t/media\text4\tdefaults\t0\t0')
 
     @only_for_arch(['i586', 'i686', 'x86_64'])
+    @OETestTag("runqemu")
     def test_qemu_efi(self):
         """Test core-image-minimal efi image under qemu"""
         config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "mkefidisk.wks"\n'
@@ -1046,6 +1049,7 @@ class Wic2(WicTestCase):
             self.assertGreaterEqual(size, 204800)
 
     @only_for_arch(['i586', 'i686', 'x86_64', 'aarch64'])
+    @OETestTag("runqemu")
     def test_rawcopy_plugin_qemu(self):
         """Test rawcopy plugin in qemu"""
         # build ext4 and then use it for a wic image
@@ -1113,6 +1117,7 @@ class Wic2(WicTestCase):
         self.assertEqual('1', result.output)
 
     @only_for_arch(['i586', 'i686', 'x86_64'])
+    @OETestTag("runqemu")
     def test_biosplusefi_plugin_qemu(self):
         """Test biosplusefi plugin in qemu"""
         config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_biosplusefi_plugin.wks"\nMACHINE_FEATURES:append = " efi"\n'
@@ -1172,6 +1177,7 @@ class Wic2(WicTestCase):
 
     # TODO this test could also work on aarch64
     @only_for_arch(['i586', 'i686', 'x86_64'])
+    @OETestTag("runqemu")
     def test_efi_plugin_unified_kernel_image_qemu(self):
         """Test efi plugin's Unified Kernel Image feature in qemu"""
         config = 'IMAGE_FSTYPES = "wic"\n'\
@@ -1381,6 +1387,7 @@ class Wic2(WicTestCase):
             self.assertEqual(1, len(out))
 
     @only_for_arch(['i586', 'i686', 'x86_64'])
+    @OETestTag("runqemu")
     def test_expand_mbr_image(self):
         """Test wic write --expand command for mbr image"""
         # build an image