diff options
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/minidebuginfo.py | 15 |
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 | |||
| 9 | import shutil | 9 | import shutil |
| 10 | 10 | ||
| 11 | from oeqa.selftest.case import OESelftestTestCase | 11 | from oeqa.selftest.case import OESelftestTestCase |
| 12 | from oeqa.utils.commands import bitbake, get_bb_var, runCmd | 12 | from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runCmd |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | class Minidebuginfo(OESelftestTestCase): | 15 | class 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(""" |
| 21 | PACKAGE_MINIDEBUGINFO = "1" | 24 | PACKAGE_MINIDEBUGINFO = "1" |
| 22 | IMAGE_FSTYPES = "tar.bz2" | 25 | IMAGE_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 | ||
