From: Peter Marko Date: Thu, 13 Nov 2025 07:45:25 +0000 (+0100) Subject: oeqa: fix package detection in go sdk tests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0966b8086847cacb99506ee972dae593af9026c1;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git oeqa: fix package detection in go sdk tests The test are skipped if architecture contains dash because TARGET_ARCH contains underscore while package name contains dash. Here the translation needs to be done. Note that poky distro default arch has dash: MACHINE="qemux86-64" TARGET_ARCH="x86_64" ERROR: Nothing PROVIDES 'go-cross-canadian-x86_64'. Close matches: gcc-cross-canadian-x86-64 gdb-cross-canadian-x86-64 go-cross-canadian-x86-64 TRANSLATED_TARGET_ARCH="x86-64" Quoting meta/classes-recipe/cross-canadian.bbclass: TRANSLATED_TARGET_ARCH is added into PN Signed-off-by: Peter Marko Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oeqa/sdk/cases/go.py b/meta/lib/oeqa/sdk/cases/go.py index a050df7a9fa..693be89e1df 100644 --- a/meta/lib/oeqa/sdk/cases/go.py +++ b/meta/lib/oeqa/sdk/cases/go.py @@ -25,9 +25,9 @@ class GoCompileTest(OESDKTestCase): os.path.join(self.tc.sdk_dir, 'test.go')) def setUp(self): - target_arch = self.td.get("TARGET_ARCH") + translated_target_arch = self.td.get("TRANSLATED_TARGET_ARCH") # Check for go-cross-canadian package (uses target architecture) - if not self.tc.hasHostPackage("go-cross-canadian-%s" % target_arch): + if not self.tc.hasHostPackage("go-cross-canadian-%s" % translated_target_arch): raise unittest.SkipTest("GoCompileTest class: SDK doesn't contain a Go cross-canadian toolchain") # Additional runtime check for go command availability @@ -63,9 +63,9 @@ class GoHostCompileTest(OESDKTestCase): os.path.join(self.tc.sdk_dir, 'test.go')) def setUp(self): - target_arch = self.td.get("TARGET_ARCH") + translated_target_arch = self.td.get("TRANSLATED_TARGET_ARCH") # Check for go-cross-canadian package (uses target architecture) - if not self.tc.hasHostPackage("go-cross-canadian-%s" % target_arch): + if not self.tc.hasHostPackage("go-cross-canadian-%s" % translated_target_arch): raise unittest.SkipTest("GoHostCompileTest class: SDK doesn't contain a Go cross-canadian toolchain") # Additional runtime check for go command availability