summaryrefslogtreecommitdiffstats
path: root/meta/lib
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-22 16:23:24 +0100
commit02f8d9bac206d667231b7a0c8023909df56a69ef (patch)
treed5b95d637c8a82873e0f4f732d97249a5e14e426 /meta/lib
parent224bb0f8378e75d729aeaca758582bbfff439397 (diff)
downloadpoky-02f8d9bac206d667231b7a0c8023909df56a69ef.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: 1038195fe9823c93cf20e2d256865171e0c915c4) 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> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-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)