summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/selftest')
-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)