oeqa/sdk: use ensure_*_package helpers

Clean up lots of dependency checking code by using the new helpers.

This means that a lot of tests that were previously skipped inside the
eSDK testing on the autobuilder are now executed, and fail.

(From OE-Core rev: 11277efd057685558a744e98082b5709e849dd2a)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ross Burton
2025-05-10 09:43:42 +01:00
committed by Richard Purdie
parent eeacb5d906
commit 393691faf1
7 changed files with 11 additions and 38 deletions

View File

@@ -23,9 +23,7 @@ class CMakeTest(OESDKTestCase):
if libc in [ 'newlib' ]:
raise unittest.SkipTest("CMakeTest class: SDK doesn't contain a supported C library")
if not (self.tc.hasHostPackage("nativesdk-cmake") or
self.tc.hasHostPackage("cmake-native")):
raise unittest.SkipTest("CMakeTest: needs cmake")
self.ensure_host_package("cmake")
def test_assimp(self):
with tempfile.TemporaryDirectory(prefix="assimp", dir=self.tc.sdk_dir) as testdir:

View File

@@ -22,12 +22,8 @@ class GTK3Test(OESDKTestCase):
if libc in [ 'newlib' ]:
raise unittest.SkipTest("GTK3Test class: SDK doesn't contain a supported C library")
if not (self.tc.hasTargetPackage("gtk+3", multilib=True) or \
self.tc.hasTargetPackage("libgtk-3.0", multilib=True)):
raise unittest.SkipTest("GalculatorTest class: SDK don't support gtk+3")
if not (self.tc.hasHostPackage("nativesdk-gettext-dev") or
self.tc.hasHostPackage("gettext-native")):
raise unittest.SkipTest("GalculatorTest class: SDK doesn't contain gettext")
self.ensure_host_package(recipe="intltool")
self.ensure_target_package("gtk+3", "libgtk-3.0", recipe="gtk+3")
def test_galculator(self):
with tempfile.TemporaryDirectory(prefix="galculator", dir=self.tc.sdk_dir) as testdir:

View File

@@ -7,7 +7,6 @@
import os
import subprocess
import tempfile
import unittest
from oeqa.sdk.case import OESDKTestCase
from oeqa.utils.subprocesstweak import errors_have_output
@@ -17,16 +16,11 @@ class KernelModuleTest(OESDKTestCase):
"""
Test that out-of-tree kernel modules build.
"""
def setUp(self):
if not self.tc.hasTargetPackage("kernel-devsrc"):
raise unittest.SkipTest("KernelModuleTest needs kernel-devsrc")
def test_cryptodev(self):
self.ensure_target_package("kernel-devsrc")
# These targets need to be built before kernel modules can be built.
self._run("make -j -C $OECORE_TARGET_SYSROOT/usr/src/kernel prepare scripts")
def test_cryptodev(self):
with tempfile.TemporaryDirectory(prefix="cryptodev", dir=self.tc.sdk_dir) as testdir:
git_url = "https://github.com/cryptodev-linux/cryptodev-linux"
# This is a knnown-good commit post-1.13 that builds with kernel 6.7+

View File

@@ -16,11 +16,7 @@ errors_have_output()
class MaturinTest(OESDKTestCase):
def setUp(self):
if not (
self.tc.hasHostPackage("nativesdk-python3-maturin")
or self.tc.hasHostPackage("python3-maturin-native")
):
raise unittest.SkipTest("No python3-maturin package in the SDK")
self.ensure_host_package("python3-maturin")
def test_maturin_list_python(self):
py_major = self._run("python3 -c 'import sys; print(sys.version_info.major)'")
@@ -49,11 +45,8 @@ class MaturinDevelopTest(OESDKTestCase):
def setUp(self):
machine = self.td.get("MACHINE")
if not (
self.tc.hasHostPackage("nativesdk-python3-maturin")
or self.tc.hasHostPackage("python3-maturin-native")
):
raise unittest.SkipTest("No python3-maturin package in the SDK")
self.ensure_host_package("python3-maturin")
if not (
self.tc.hasHostPackage("packagegroup-rust-cross-canadian-%s" % machine)
):

View File

@@ -22,9 +22,7 @@ class MesonTest(OESDKTestCase):
if libc in [ 'newlib' ]:
raise unittest.SkipTest("MesonTest class: SDK doesn't contain a supported C library")
if not (self.tc.hasHostPackage("nativesdk-meson") or
self.tc.hasHostPackage("meson-native")):
raise unittest.SkipTest("MesonTest: needs meson")
self.ensure_host_package("meson")
def test_epoxy(self):
with tempfile.TemporaryDirectory(prefix="epoxy", dir=self.tc.sdk_dir) as testdir:

View File

@@ -4,7 +4,6 @@
# SPDX-License-Identifier: MIT
#
import unittest
from oeqa.sdk.case import OESDKTestCase
from oeqa.utils.subprocesstweak import errors_have_output
@@ -12,9 +11,7 @@ errors_have_output()
class PerlTest(OESDKTestCase):
def setUp(self):
if not (self.tc.hasHostPackage("nativesdk-perl") or
self.tc.hasHostPackage("perl-native")):
raise unittest.SkipTest("No perl package in the SDK")
self.ensure_host_package("perl")
def test_perl(self):
cmd = "perl -e '$_=\"Uryyb, jbeyq\"; tr/a-zA-Z/n-za-mN-ZA-M/;print'"

View File

@@ -4,7 +4,6 @@
# SPDX-License-Identifier: MIT
#
import unittest
from oeqa.sdk.case import OESDKTestCase
from oeqa.utils.subprocesstweak import errors_have_output
@@ -12,9 +11,7 @@ errors_have_output()
class Python3Test(OESDKTestCase):
def setUp(self):
if not (self.tc.hasHostPackage("nativesdk-python3-core") or
self.tc.hasHostPackage("python3-core-native")):
raise unittest.SkipTest("No python3 package in the SDK")
self.ensure_host_package("python3-core", recipe="python3")
def test_python3(self):
cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\""