]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oeqa/selftest/wic: clean up only_for_arch decorator
authorRoss Burton <ross@burtonini.com>
Thu, 31 Mar 2022 18:28:58 +0000 (19:28 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 1 Apr 2022 22:05:31 +0000 (23:05 +0100)
There's no need to pass a recipe name when determining the target
architecture, there's no need to cap the size of the lru_cache as it
will only have one entry, and __name__ is set by @wraps.

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

index 5d7f7bf613542630c75a29a8296c61390a91065b..317b80ea27b7a002055adca9356374f49d2a9372 100644 (file)
@@ -22,26 +22,22 @@ from oeqa.selftest.case import OESelftestTestCase
 from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu
 
 
-@lru_cache(maxsize=32)
-def get_host_arch(recipe):
-    """A cached call to get_bb_var('HOST_ARCH', <recipe>)"""
-    return get_bb_var('HOST_ARCH', recipe)
+@lru_cache()
+def get_host_arch():
+    return get_bb_var('HOST_ARCH')
 
 
-def only_for_arch(archs, image='core-image-minimal'):
+def only_for_arch(archs):
     """Decorator for wrapping test cases that can be run only for specific target
     architectures. A list of compatible architectures is passed in `archs`.
-    Current architecture will be determined by parsing bitbake output for
-    `image` recipe.
     """
     def wrapper(func):
         @wraps(func)
         def wrapped_f(*args, **kwargs):
-            arch = get_host_arch(image)
+            arch = get_host_arch()
             if archs and arch not in archs:
                 raise unittest.SkipTest("Testcase arch dependency not met: %s" % arch)
             return func(*args, **kwargs)
-        wrapped_f.__name__ = func.__name__
         return wrapped_f
     return wrapper