summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2023-03-13 13:15:37 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-22 13:53:29 +0000
commit2e7d36b542b2a01d305d5f1e7d8f2daa65fd9d8e (patch)
treec170c398f6ca3a62ad90595eb62c02f517cae834
parentc0df9c9e92b56c33952fa3e6c050f1e4c53b66d9 (diff)
downloadpoky-2e7d36b542b2a01d305d5f1e7d8f2daa65fd9d8e.tar.gz
selftest: gdbserver.py: respect IMAGE_LINK_NAME
* use IMAGE_LINK_NAME instead of hardcoding core-image-minimal-${MACHINE} assumption [YOCTO #12937] (From OE-Core rev: 3ee65ecdf841d74e2767d620e7f4a62e3a8863dc) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/selftest/cases/gdbserver.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/meta/lib/oeqa/selftest/cases/gdbserver.py b/meta/lib/oeqa/selftest/cases/gdbserver.py
index 3621d9c13e..9da97ae780 100644
--- a/meta/lib/oeqa/selftest/cases/gdbserver.py
+++ b/meta/lib/oeqa/selftest/cases/gdbserver.py
@@ -10,13 +10,12 @@ import shutil
10import concurrent.futures 10import concurrent.futures
11 11
12from oeqa.selftest.case import OESelftestTestCase 12from oeqa.selftest.case import OESelftestTestCase
13from oeqa.utils.commands import bitbake, get_bb_var, runqemu, runCmd 13from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars , runqemu, runCmd
14 14
15class GdbServerTest(OESelftestTestCase): 15class GdbServerTest(OESelftestTestCase):
16 def test_gdb_server(self): 16 def test_gdb_server(self):
17 target_arch = self.td["TARGET_ARCH"] 17 target_arch = self.td["TARGET_ARCH"]
18 target_sys = self.td["TARGET_SYS"] 18 target_sys = self.td["TARGET_SYS"]
19 deploy_dir = get_bb_var("DEPLOY_DIR_IMAGE")
20 19
21 features = """ 20 features = """
22IMAGE_GEN_DEBUGFS = "1" 21IMAGE_GEN_DEBUGFS = "1"
@@ -34,11 +33,13 @@ CORE_IMAGE_EXTRA_INSTALL = "gdbserver"
34 r = runCmd("%s --version" % gdb_binary, native_sysroot=native_sysroot, target_sys=target_sys) 33 r = runCmd("%s --version" % gdb_binary, native_sysroot=native_sysroot, target_sys=target_sys)
35 self.assertEqual(r.status, 0) 34 self.assertEqual(r.status, 0)
36 self.assertIn("GNU gdb", r.output) 35 self.assertIn("GNU gdb", r.output)
36 image = 'core-image-minimal'
37 bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'], image)
37 38
38 with tempfile.TemporaryDirectory(prefix="debugfs-") as debugfs: 39 with tempfile.TemporaryDirectory(prefix="debugfs-") as debugfs:
39 filename = os.path.join(deploy_dir, "core-image-minimal-%s-dbg.tar.bz2" % self.td["MACHINE"]) 40 filename = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], "%s-dbg.tar.bz2" % bb_vars['IMAGE_LINK_NAME'])
40 shutil.unpack_archive(filename, debugfs) 41 shutil.unpack_archive(filename, debugfs)
41 filename = os.path.join(deploy_dir, "core-image-minimal-%s.tar.bz2" % self.td["MACHINE"]) 42 filename = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], "%s.tar.bz2" % bb_vars['IMAGE_LINK_NAME'])
42 shutil.unpack_archive(filename, debugfs) 43 shutil.unpack_archive(filename, debugfs)
43 44
44 with runqemu("core-image-minimal", runqemuparams="nographic") as qemu: 45 with runqemu("core-image-minimal", runqemuparams="nographic") as qemu: