summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2023-03-13 13:15:38 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-22 13:53:29 +0000
commit752d8ab3edff6363c5e437dc0062c917e21fb30e (patch)
tree6016b3637c2c37b96dad05cfc3cebf304a9bf945 /meta
parent2e7d36b542b2a01d305d5f1e7d8f2daa65fd9d8e (diff)
downloadpoky-752d8ab3edff6363c5e437dc0062c917e21fb30e.tar.gz
selftest: minidebuginfo.py respect IMAGE_LINK_NAME
* use IMAGE_LINK_NAME instead of hardcoding core-image-minimal-${MACHINE} assumption [YOCTO #12937] (From OE-Core rev: 9f8ffe22d9bb7cd93b9bc9ece917a48b27ab22d3) 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>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/selftest/cases/minidebuginfo.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/meta/lib/oeqa/selftest/cases/minidebuginfo.py b/meta/lib/oeqa/selftest/cases/minidebuginfo.py
index 7947c3803c..aa1f9fa1f7 100644
--- a/meta/lib/oeqa/selftest/cases/minidebuginfo.py
+++ b/meta/lib/oeqa/selftest/cases/minidebuginfo.py
@@ -9,7 +9,7 @@ import tempfile
9import shutil 9import shutil
10 10
11from oeqa.selftest.case import OESelftestTestCase 11from oeqa.selftest.case import OESelftestTestCase
12from oeqa.utils.commands import bitbake, get_bb_var, runCmd 12from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runCmd
13 13
14 14
15class Minidebuginfo(OESelftestTestCase): 15class Minidebuginfo(OESelftestTestCase):
@@ -17,27 +17,28 @@ class Minidebuginfo(OESelftestTestCase):
17 target_sys = get_bb_var("TARGET_SYS") 17 target_sys = get_bb_var("TARGET_SYS")
18 binutils = "binutils-cross-{}".format(get_bb_var("TARGET_ARCH")) 18 binutils = "binutils-cross-{}".format(get_bb_var("TARGET_ARCH"))
19 19
20 image = 'core-image-minimal'
21 bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME', 'READELF'], image)
22
20 self.write_config(""" 23 self.write_config("""
21PACKAGE_MINIDEBUGINFO = "1" 24PACKAGE_MINIDEBUGINFO = "1"
22IMAGE_FSTYPES = "tar.bz2" 25IMAGE_FSTYPES = "tar.bz2"
23""") 26""")
24 bitbake("core-image-minimal {}:do_addto_recipe_sysroot".format(binutils)) 27 bitbake("{} {}:do_addto_recipe_sysroot".format(image, binutils))
25 28
26 deploy_dir = get_bb_var("DEPLOY_DIR_IMAGE")
27 native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", binutils) 29 native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", binutils)
28 readelf = get_bb_var("READELF", "core-image-minimal")
29 30
30 # confirm that executables and shared libraries contain an ELF section 31 # confirm that executables and shared libraries contain an ELF section
31 # ".gnu_debugdata" which stores minidebuginfo. 32 # ".gnu_debugdata" which stores minidebuginfo.
32 with tempfile.TemporaryDirectory(prefix = "unpackfs-") as unpackedfs: 33 with tempfile.TemporaryDirectory(prefix = "unpackfs-") as unpackedfs:
33 filename = os.path.join(deploy_dir, "core-image-minimal-{}.tar.bz2".format(self.td["MACHINE"])) 34 filename = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], "{}.tar.bz2".format(bb_vars['IMAGE_LINK_NAME']))
34 shutil.unpack_archive(filename, unpackedfs) 35 shutil.unpack_archive(filename, unpackedfs)
35 36
36 r = runCmd([readelf, "-W", "-S", os.path.join(unpackedfs, "bin", "busybox")], 37 r = runCmd([bb_vars['READELF'], "-W", "-S", os.path.join(unpackedfs, "bin", "busybox")],
37 native_sysroot = native_sysroot, target_sys = target_sys) 38 native_sysroot = native_sysroot, target_sys = target_sys)
38 self.assertIn(".gnu_debugdata", r.output) 39 self.assertIn(".gnu_debugdata", r.output)
39 40
40 r = runCmd([readelf, "-W", "-S", os.path.join(unpackedfs, "lib", "libc.so.6")], 41 r = runCmd([bb_vars['READELF'], "-W", "-S", os.path.join(unpackedfs, "lib", "libc.so.6")],
41 native_sysroot = native_sysroot, target_sys = target_sys) 42 native_sysroot = native_sysroot, target_sys = target_sys)
42 self.assertIn(".gnu_debugdata", r.output) 43 self.assertIn(".gnu_debugdata", r.output)
43 44