diff options
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/wic.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index 5d7f7bf613..317b80ea27 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py | |||
| @@ -22,26 +22,22 @@ from oeqa.selftest.case import OESelftestTestCase | |||
| 22 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu | 22 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu |
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | @lru_cache(maxsize=32) | 25 | @lru_cache() |
| 26 | def get_host_arch(recipe): | 26 | def get_host_arch(): |
| 27 | """A cached call to get_bb_var('HOST_ARCH', <recipe>)""" | 27 | return get_bb_var('HOST_ARCH') |
| 28 | return get_bb_var('HOST_ARCH', recipe) | ||
| 29 | 28 | ||
| 30 | 29 | ||
| 31 | def only_for_arch(archs, image='core-image-minimal'): | 30 | def only_for_arch(archs): |
| 32 | """Decorator for wrapping test cases that can be run only for specific target | 31 | """Decorator for wrapping test cases that can be run only for specific target |
| 33 | architectures. A list of compatible architectures is passed in `archs`. | 32 | architectures. A list of compatible architectures is passed in `archs`. |
| 34 | Current architecture will be determined by parsing bitbake output for | ||
| 35 | `image` recipe. | ||
| 36 | """ | 33 | """ |
| 37 | def wrapper(func): | 34 | def wrapper(func): |
| 38 | @wraps(func) | 35 | @wraps(func) |
| 39 | def wrapped_f(*args, **kwargs): | 36 | def wrapped_f(*args, **kwargs): |
| 40 | arch = get_host_arch(image) | 37 | arch = get_host_arch() |
| 41 | if archs and arch not in archs: | 38 | if archs and arch not in archs: |
| 42 | raise unittest.SkipTest("Testcase arch dependency not met: %s" % arch) | 39 | raise unittest.SkipTest("Testcase arch dependency not met: %s" % arch) |
| 43 | return func(*args, **kwargs) | 40 | return func(*args, **kwargs) |
| 44 | wrapped_f.__name__ = func.__name__ | ||
| 45 | return wrapped_f | 41 | return wrapped_f |
| 46 | return wrapper | 42 | return wrapper |
| 47 | 43 | ||
