summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorYeoh Ee Peng <ee.peng.yeoh@intel.com>2020-05-01 16:30:39 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-05-12 15:20:43 +0100
commita368fd429016c1614277b923ae69c854d0e0ca88 (patch)
tree22d684b42de7bf79f36a76f2f279762f8080d76a /meta
parent9e44438a9deb7b6bfac3f82f31a1a7ad138a5d16 (diff)
downloadpoky-a368fd429016c1614277b923ae69c854d0e0ca88.tar.gz
selftest/imagefeatures: Enable sanity test for IMAGE_GEN_DEBUGFS
Add new testcase to check IMAGE_GEN_DEBUGFS. Test makes sure that debug filesystem is created accordingly. Test also check for debug symbols for some packages as suggested by Ross Burton. [YOCTO #10906] (From OE-Core rev: 727e8819df17f0f959b602e6f7b6af15993fc466) Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez@intel.com> Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/selftest/cases/imagefeatures.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py b/meta/lib/oeqa/selftest/cases/imagefeatures.py
index 5c519ac3d6..2b9c4998f7 100644
--- a/meta/lib/oeqa/selftest/cases/imagefeatures.py
+++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py
@@ -262,3 +262,35 @@ PNBLACKLIST[busybox] = "Don't build this"
262 self.write_config(config) 262 self.write_config(config)
263 263
264 bitbake("--graphviz core-image-sato") 264 bitbake("--graphviz core-image-sato")
265
266 def test_image_gen_debugfs(self):
267 """
268 Summary: Check debugfs generation
269 Expected: 1. core-image-minimal can be build with IMAGE_GEN_DEBUGFS variable set
270 2. debug filesystem is created when variable set
271 3. debug symbols available
272 Product: oe-core
273 Author: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
274 Yeoh Ee Peng <ee.peng.yeoh@intel.com>
275 """
276 import glob
277 image_name = 'core-image-minimal'
278 features = 'IMAGE_GEN_DEBUGFS = "1"\n'
279 features += 'IMAGE_FSTYPES_DEBUGFS = "tar.bz2"\n'
280 features += 'MACHINE = "genericx86-64"\n'
281 self.write_config(features)
282
283 bitbake(image_name)
284 deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE')
285 dbg_tar_file = os.path.join(deploy_dir_image, "*-dbg.rootfs.tar.bz2")
286 debug_files = glob.glob(dbg_tar_file)
287 self.assertNotEqual(len(debug_files), 0, 'debug filesystem not generated at %s' % dbg_tar_file)
288 result = runCmd('cd %s; tar xvf %s' % (deploy_dir_image, dbg_tar_file))
289 self.assertEqual(result.status, 0, msg='Failed to extract %s: %s' % (dbg_tar_file, result.output))
290 result = runCmd('find %s -name %s' % (deploy_dir_image, "udevadm"))
291 self.assertTrue("udevadm" in result.output, msg='Failed to find udevadm: %s' % result.output)
292 dbg_symbols_targets = result.output.splitlines()
293 self.assertTrue(dbg_symbols_targets, msg='Failed to split udevadm: %s' % dbg_symbols_targets)
294 for t in dbg_symbols_targets:
295 result = runCmd('objdump --syms %s | grep debug' % t)
296 self.assertTrue("debug" in result.output, msg='Failed to find debug symbol: %s' % result.output)