Skip to contentSkip to conversation

selftest/imagefeatures: Enable sanity test for IMAGE_GEN_DEBUGFS

PATCH Yeoh Ee Peng 1 participant 1 message Apr 1, 2020 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi Ross,

This is a following up patch for enable sanity test for IMAGE_GEN_DEBUGFS. You provided the review for this patch in the past. Could you take a look and give us your inputs? Thank you very much for your attention and help!
https://lists.openembedded.org/g/openembedded-core/message/106075?p=,,,20,0,0,0::Created,,IMAGE_GEN_DEBUGFS,20,2,20,72347194

Thanks,
Ee Peng

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Yeoh Ee Peng
Sent: Wednesday, April 1, 2020 1:38 PM
To: [email protected]
Cc: Yeoh, Ee Peng <[email protected]>; Humberto Ibarra <[email protected]>
Subject: [OE-core] [PATCH] 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]

---
 meta/lib/oeqa/selftest/cases/imagefeatures.py | 33 +++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
meta/lib/oeqa/selftest/cases/imagefeatures.py +33 -0
index 5c519ac..9ad5c17 100644
@@ -262,3 +262,36 @@ PNBLACKLIST[busybox] = "Don't build this"
         self.write_config(config)
 
         bitbake("--graphviz core-image-sato")
+
+    def test_image_gen_debugfs(self):
+        """
+        Summary:     Check debugfs generation
+        Expected:    1. core-image-minimal can be build with IMAGE_GEN_DEBUGFS variable set
+                     2. debug filesystem is created when variable set
+                     3. debug symbols available
+        Product:     oe-core
+        Author:      Humberto Ibarra <[email protected]>
+                     Yeoh Ee Peng <[email protected]>
+        """
+        import glob
+        image_name = 'core-image-minimal'
+        deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE')
+
+        features = 'IMAGE_GEN_DEBUGFS = "1"\n'
+        features += 'IMAGE_FSTYPES_DEBUGFS = "tar.bz2"\n'
+        features += 'MACHINE = "genericx86-64"\n'
+        self.write_config(features)
+
+        bitbake(image_name)
+        dbg_tar_file = os.path.join(deploy_dir_image, "*-dbg.rootfs.tar.bz2")
+        debug_files = glob.glob(dbg_tar_file)
+        self.assertNotEqual(len(debug_files), 0, 'debug filesystem not generated')
+        result = runCmd('cd %s; tar xvf %s' % (deploy_dir_image, dbg_tar_file))
+        self.assertEqual(result.status, 0, msg='Failed to extract %s: %s' % (dbg_tar_file, result.output))
+        result = runCmd('find %s -name %s' % (deploy_dir_image, "udevadm"))
+        self.assertTrue("udevadm" in result.output, msg='Failed to find udevadm: %s' % result.output)
+        dbg_symbols_targets = result.output.splitlines()
+        self.assertTrue(dbg_symbols_targets, msg='Failed to split udevadm: %s' % dbg_symbols_targets)
+        for t in dbg_symbols_targets:
+            result = runCmd('objdump --syms %s | grep debug' % t)
+            self.assertTrue("debug" in result.output, msg='Failed to 

+ find debug symbol: %s' % result.output)
--
2.7.4