summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2025-02-01 08:05:14 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-02-01 13:20:45 +0000
commit36f2627b1382bbf407073d92f194b72c368a47a5 (patch)
tree8f90507aeeca33ef792fee732bbfde0369d7c7de
parent4a7b6f254de302cc2e52cec14eea074fd1f0c6b5 (diff)
downloadpoky-36f2627b1382bbf407073d92f194b72c368a47a5.tar.gz
oeqa/sdk/context: Improve multilib handling
Rather than hiding the multilib logic in the package tests, move the multilib setting to the init function of the class so the logic is clearer. (From OE-Core rev: 7699867c3ce979ab615eb677a417bb5b82faecb7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/sdk/context.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/meta/lib/oeqa/sdk/context.py b/meta/lib/oeqa/sdk/context.py
index 77e6a98f39..d968cfa2be 100644
--- a/meta/lib/oeqa/sdk/context.py
+++ b/meta/lib/oeqa/sdk/context.py
@@ -23,6 +23,13 @@ class OESDKTestContext(OETestContext):
23 self.target_pkg_manifest = target_pkg_manifest 23 self.target_pkg_manifest = target_pkg_manifest
24 self.host_pkg_manifest = host_pkg_manifest 24 self.host_pkg_manifest = host_pkg_manifest
25 25
26 # match multilib according to sdk_env
27 self.multilib = ""
28 multilibs = self.td.get('MULTILIB_VARIANTS', '').split()
29 for ml in multilibs:
30 if ml in os.path.basename(self.sdk_env):
31 self.multilib = ml
32
26 def _hasPackage(self, manifest, pkg, regex=False): 33 def _hasPackage(self, manifest, pkg, regex=False):
27 if regex: 34 if regex:
28 # do regex match 35 # do regex match
@@ -41,13 +48,7 @@ class OESDKTestContext(OETestContext):
41 48
42 def hasTargetPackage(self, pkg, multilib=False, regex=False): 49 def hasTargetPackage(self, pkg, multilib=False, regex=False):
43 if multilib: 50 if multilib:
44 stripped_sdk_env = os.path.basename(self.sdk_env) 51 pkg = self.multilib + '-' + pkg
45 if stripped_sdk_env.startswith('environment-setup-'):
46 # match multilib according to sdk_env
47 mls = self.td.get('MULTILIB_VARIANTS', '').split()
48 for ml in mls:
49 if ('ml'+ml) in stripped_sdk_env:
50 pkg = ml + '-' + pkg
51 return self._hasPackage(self.target_pkg_manifest, pkg, regex=regex) 52 return self._hasPackage(self.target_pkg_manifest, pkg, regex=regex)
52 53
53class OESDKTestContextExecutor(OETestContextExecutor): 54class OESDKTestContextExecutor(OETestContextExecutor):