All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftest/imagefeatures: Enable sanity test for IMAGE_GEN_DEBUGFS
@ 2020-04-01  5:37 Yeoh Ee Peng
  2020-04-21  3:10 ` Yeoh Ee Peng
  2020-04-23  8:52 ` [OE-core] " Richard Purdie
  0 siblings, 2 replies; 7+ messages in thread
From: Yeoh Ee Peng @ 2020-04-01  5:37 UTC (permalink / raw)
  To: openembedded-core; +Cc: Yeoh Ee Peng, Humberto Ibarra

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]

Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
---
 meta/lib/oeqa/selftest/cases/imagefeatures.py | 33 +++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py b/meta/lib/oeqa/selftest/cases/imagefeatures.py
index 5c519ac..9ad5c17 100644
--- a/meta/lib/oeqa/selftest/cases/imagefeatures.py
+++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py
@@ -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 <humberto.ibarra.lopez@intel.com>
+                     Yeoh Ee Peng <ee.peng.yeoh@intel.com>
+        """
+        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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] selftest/imagefeatures: Enable sanity test for IMAGE_GEN_DEBUGFS
  2020-04-01  5:37 [PATCH] selftest/imagefeatures: Enable sanity test for IMAGE_GEN_DEBUGFS Yeoh Ee Peng
@ 2020-04-21  3:10 ` Yeoh Ee Peng
  2020-04-23  8:52 ` [OE-core] " Richard Purdie
  1 sibling, 0 replies; 7+ messages in thread
From: Yeoh Ee Peng @ 2020-04-21  3:10 UTC (permalink / raw)
  To: openembedded-core; +Cc: Humberto Ibarra

Hi all,

Anyone has any inputs or suggestions for this patch that enable selftest for IMAGE_GEN_DEBUGFS?
Thank you very much for your attention and help!

Best regards,
Yeoh Ee Peng

-----Original Message-----
From: Yeoh, Ee Peng <ee.peng.yeoh@intel.com> 
Sent: Wednesday, April 1, 2020 1:38 PM
To: openembedded-core@lists.openembedded.org
Cc: Yeoh, Ee Peng <ee.peng.yeoh@intel.com>; Humberto Ibarra <humberto.ibarra.lopez@intel.com>
Subject: [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]

Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
---
 meta/lib/oeqa/selftest/cases/imagefeatures.py | 33 +++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py b/meta/lib/oeqa/selftest/cases/imagefeatures.py
index 5c519ac..9ad5c17 100644
--- a/meta/lib/oeqa/selftest/cases/imagefeatures.py
+++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py
@@ -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 <humberto.ibarra.lopez@intel.com>
+                     Yeoh Ee Peng <ee.peng.yeoh@intel.com>
+        """
+        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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [OE-core] [PATCH] selftest/imagefeatures: Enable sanity test for IMAGE_GEN_DEBUGFS
  2020-04-01  5:37 [PATCH] selftest/imagefeatures: Enable sanity test for IMAGE_GEN_DEBUGFS Yeoh Ee Peng
  2020-04-21  3:10 ` Yeoh Ee Peng
@ 2020-04-23  8:52 ` Richard Purdie
  2020-04-23  9:33   ` Yeoh Ee Peng
  2020-05-01  8:36   ` Yeoh Ee Peng
  1 sibling, 2 replies; 7+ messages in thread
From: Richard Purdie @ 2020-04-23  8:52 UTC (permalink / raw)
  To: Yeoh Ee Peng, openembedded-core; +Cc: Humberto Ibarra

On Wed, 2020-04-01 at 13:37 +0800, Yeoh Ee Peng wrote:
> 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]
> 
> Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
> Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
> ---
>  meta/lib/oeqa/selftest/cases/imagefeatures.py | 33 +++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py b/meta/lib/oeqa/selftest/cases/imagefeatures.py
> index 5c519ac..9ad5c17 100644
> --- a/meta/lib/oeqa/selftest/cases/imagefeatures.py
> +++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py
> @@ -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 <humberto.ibarra.lopez@intel.com>
> +                     Yeoh Ee Peng <ee.peng.yeoh@intel.com>
> +        """
> +        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)

The test failed on the autobuilder:

https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/858
https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/855
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/861
https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/849

Cheers,

Richard



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [OE-core] [PATCH] selftest/imagefeatures: Enable sanity test for IMAGE_GEN_DEBUGFS
  2020-04-23  8:52 ` [OE-core] " Richard Purdie
@ 2020-04-23  9:33   ` Yeoh Ee Peng
  2020-04-24  9:39     ` Yeoh Ee Peng
  2020-05-01  8:36   ` Yeoh Ee Peng
  1 sibling, 1 reply; 7+ messages in thread
From: Yeoh Ee Peng @ 2020-04-23  9:33 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core

Hi Richard,

This was surprising, it look like debug filesystem was not being generated given the configuration (IMAGE_GEN_DEBUGFS = "1"). This was exactly the type of error that this automated test was designed to catch. 

I shall debug this on master and potentially master-next. 

Thanks,
Yeoh Ee Peng 

2020-04-23 03:57:33,491 - oe-selftest - INFO - ======================================================================
2020-04-23 03:57:33,491 - oe-selftest - INFO - FAIL: imagefeatures.ImageFeatures.test_image_gen_debugfs (subunit.RemotedTestCase)
2020-04-23 03:57:33,491 - oe-selftest - INFO - ----------------------------------------------------------------------
2020-04-23 03:57:33,491 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/home/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/lib/oeqa/selftest/cases/imagefeatures.py", line 288, in test_image_gen_debugfs
    self.assertNotEqual(len(debug_files), 0, 'debug filesystem not generated')
  File "/usr/lib64/python3.7/unittest/case.py", line 861, in assertNotEqual
    raise self.failureException(msg)
AssertionError: 0 == 0 : debug filesystem not generated

-----Original Message-----
From: Richard Purdie <richard.purdie@linuxfoundation.org> 
Sent: Thursday, April 23, 2020 4:53 PM
To: Yeoh, Ee Peng <ee.peng.yeoh@intel.com>; openembedded-core@lists.openembedded.org
Cc: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
Subject: Re: [OE-core] [PATCH] selftest/imagefeatures: Enable sanity test for IMAGE_GEN_DEBUGFS

On Wed, 2020-04-01 at 13:37 +0800, Yeoh Ee Peng wrote:
> 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]
> 
> Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
> Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
> ---
>  meta/lib/oeqa/selftest/cases/imagefeatures.py | 33 
> +++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py 
> b/meta/lib/oeqa/selftest/cases/imagefeatures.py
> index 5c519ac..9ad5c17 100644
> --- a/meta/lib/oeqa/selftest/cases/imagefeatures.py
> +++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py
> @@ -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 <humberto.ibarra.lopez@intel.com>
> +                     Yeoh Ee Peng <ee.peng.yeoh@intel.com>
> +        """
> +        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)

The test failed on the autobuilder:

https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/858
https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/855
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/861
https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/849

Cheers,

Richard



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [OE-core] [PATCH] selftest/imagefeatures: Enable sanity test for IMAGE_GEN_DEBUGFS
  2020-04-23  9:33   ` Yeoh Ee Peng
@ 2020-04-24  9:39     ` Yeoh Ee Peng
  0 siblings, 0 replies; 7+ messages in thread
From: Yeoh Ee Peng @ 2020-04-24  9:39 UTC (permalink / raw)
  To: 'Richard Purdie',
	'openembedded-core@lists.openembedded.org'

Hi Richard,

I did rerun the imagefeatures tests on master and master-next, here are my findings.

On master (commit: a44b8d2856a937ca3991cbf566788b0cd541d777), test_image_gen_debugfs test was passing. 
2020-04-24 16:05:56,417 - oe-selftest - INFO - test_image_gen_debugfs (imagefeatures.ImageFeatures)
2020-04-24 16:34:54,821 - oe-selftest - INFO -  ... ok
2020-04-24 16:34:54,834 - oe-selftest - INFO - ----------------------------------------------------------------------
2020-04-24 16:34:54,834 - oe-selftest - INFO - Ran 1 test in 1738.418s
2020-04-24 16:34:54,834 - oe-selftest - INFO - OK
2020-04-24 16:35:01,077 - oe-selftest - INFO - RESULTS:
2020-04-24 16:35:01,078 - oe-selftest - INFO - RESULTS - imagefeatures.ImageFeatures.test_image_gen_debugfs: PASSED (1738.40s)
2020-04-24 16:35:01,135 - oe-selftest - INFO - SUMMARY:
2020-04-24 16:35:01,135 - oe-selftest - INFO - oe-selftest () - Ran 1 test in 1740.237s
2020-04-24 16:35:01,136 - oe-selftest - INFO - oe-selftest - OK - All required tests passed (successes=1, skipped=0, failures=0, errors=0)

On master-next (commit: a0852af226802e50955e6e5ddd14f773cb42a10f), the test consistently failed at bison do_compile. 
| gcc  -DEXEEXT=\"\"   -I. -I./lib -I../bison-3.5.4 -I../bison-3.5.4/lib -DINSTALLDIR=\"/data/eyeoh7/tmp/poky/build-image-minimal-gen-debugs-master-next-st/tmp/work/x86_64-linux/bison-native/3.5.4-r0/recipe-sysroot-native/usr/bin\" -isystem/data/eyeoh7/tmp/poky/build-image-minimal-gen-debugs-master-next-st/tmp/work/x86_64-linux/bison-native/3.5.4-r0/recipe-sysroot-native/usr/include   -isystem/data/eyeoh7/tmp/poky/build-image-minimal-gen-debugs-master-next-st/tmp/work/x86_64-linux/bison-native/3.5.4-r0/recipe-sysroot-native/usr/include -O2 -pipe -c -o src/bison-symtab.o `test -f 'src/symtab.c' || echo '../bison-3.5.4/'`src/symtab.c
| ../bison-3.5.4/lib/fcntl.c: In function 'rpl_fcntl_DUPFD_CLOEXEC':
| ../bison-3.5.4/lib/fcntl.c:507:35: error: 'GNULIB_defined_F_DUPFD_CLOEXEC' undeclared (first use in this function); did you mean 'rpl_fcntl_DUPFD_CLOEXEC'?
|    static int have_dupfd_cloexec = GNULIB_defined_F_DUPFD_CLOEXEC ? -1 : 0;
|                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|                                    rpl_fcntl_DUPFD_CLOEXEC
| ../bison-3.5.4/lib/fcntl.c:507:35: note: each undeclared identifier is reported only once for each function it appears in
| Makefile:5414: recipe for target 'lib/libbison_a-fcntl.o' failed
| make: *** [lib/libbison_a-fcntl.o] Error 1
| make: *** Waiting for unfinished jobs....
| mv examples/c/reccalc/scan.stamp.tmp examples/c/reccalc/scan.stamp
| WARNING: exit code 1 from a shell command.
| 
NOTE: recipe bison-native-3.5.4-r0: task do_compile: Failed
ERROR: Task (virtual:native:/data/eyeoh7/tmp/poky/meta/recipes-devtools/bison/bison_3.5.4.bb:do_compile) failed with exit code '1'

I will continue debugging this.

Best regards,
Yeoh Ee Peng 

-----Original Message-----
From: Yeoh, Ee Peng 
Sent: Thursday, April 23, 2020 5:33 PM
To: Richard Purdie <richard.purdie@linuxfoundation.org>; openembedded-core@lists.openembedded.org
Subject: RE: [OE-core] [PATCH] selftest/imagefeatures: Enable sanity test for IMAGE_GEN_DEBUGFS

Hi Richard,

This was surprising, it look like debug filesystem was not being generated given the configuration (IMAGE_GEN_DEBUGFS = "1"). This was exactly the type of error that this automated test was designed to catch. 

I shall debug this on master and potentially master-next. 

Thanks,
Yeoh Ee Peng 

2020-04-23 03:57:33,491 - oe-selftest - INFO - ======================================================================
2020-04-23 03:57:33,491 - oe-selftest - INFO - FAIL: imagefeatures.ImageFeatures.test_image_gen_debugfs (subunit.RemotedTestCase)
2020-04-23 03:57:33,491 - oe-selftest - INFO - ----------------------------------------------------------------------
2020-04-23 03:57:33,491 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/home/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/lib/oeqa/selftest/cases/imagefeatures.py", line 288, in test_image_gen_debugfs
    self.assertNotEqual(len(debug_files), 0, 'debug filesystem not generated')
  File "/usr/lib64/python3.7/unittest/case.py", line 861, in assertNotEqual
    raise self.failureException(msg)
AssertionError: 0 == 0 : debug filesystem not generated

-----Original Message-----
From: Richard Purdie <richard.purdie@linuxfoundation.org>
Sent: Thursday, April 23, 2020 4:53 PM
To: Yeoh, Ee Peng <ee.peng.yeoh@intel.com>; openembedded-core@lists.openembedded.org
Cc: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
Subject: Re: [OE-core] [PATCH] selftest/imagefeatures: Enable sanity test for IMAGE_GEN_DEBUGFS

On Wed, 2020-04-01 at 13:37 +0800, Yeoh Ee Peng wrote:
> 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]
> 
> Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
> Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
> ---
>  meta/lib/oeqa/selftest/cases/imagefeatures.py | 33
> +++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py
> b/meta/lib/oeqa/selftest/cases/imagefeatures.py
> index 5c519ac..9ad5c17 100644
> --- a/meta/lib/oeqa/selftest/cases/imagefeatures.py
> +++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py
> @@ -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 <humberto.ibarra.lopez@intel.com>
> +                     Yeoh Ee Peng <ee.peng.yeoh@intel.com>
> +        """
> +        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)

The test failed on the autobuilder:

https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/858
https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/855
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/861
https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/849

Cheers,

Richard



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [OE-core] [PATCH] selftest/imagefeatures: Enable sanity test for IMAGE_GEN_DEBUGFS
  2020-04-23  8:52 ` [OE-core] " Richard Purdie
  2020-04-23  9:33   ` Yeoh Ee Peng
@ 2020-05-01  8:36   ` Yeoh Ee Peng
  1 sibling, 0 replies; 7+ messages in thread
From: Yeoh Ee Peng @ 2020-05-01  8:36 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core

Hi Richard,

I had identified the root cause of the failure and fixed it. The earlier patch was calling the get_bb_var('DEPLOY_DIR_IMAGE') before the setting configuration and thus using the wrong DEPLOY_DIR to check the debug filesystem being generated. 

I had submitted v02 patch. 
https://lists.openembedded.org/g/openembedded-core/message/137697

Best regards,
Yeoh Ee Peng 

-----Original Message-----
From: Richard Purdie <richard.purdie@linuxfoundation.org> 
Sent: Thursday, April 23, 2020 4:53 PM
To: Yeoh, Ee Peng <ee.peng.yeoh@intel.com>; openembedded-core@lists.openembedded.org
Cc: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
Subject: Re: [OE-core] [PATCH] selftest/imagefeatures: Enable sanity test for IMAGE_GEN_DEBUGFS

On Wed, 2020-04-01 at 13:37 +0800, Yeoh Ee Peng wrote:
> 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]
> 
> Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
> Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
> ---
>  meta/lib/oeqa/selftest/cases/imagefeatures.py | 33 
> +++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py 
> b/meta/lib/oeqa/selftest/cases/imagefeatures.py
> index 5c519ac..9ad5c17 100644
> --- a/meta/lib/oeqa/selftest/cases/imagefeatures.py
> +++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py
> @@ -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 <humberto.ibarra.lopez@intel.com>
> +                     Yeoh Ee Peng <ee.peng.yeoh@intel.com>
> +        """
> +        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)

The test failed on the autobuilder:

https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/858
https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/855
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/861
https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/849

Cheers,

Richard



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [OE-core] [PATCH] selftest/imagefeatures: Enable sanity test for IMAGE_GEN_DEBUGFS
       [not found] <16019B7602D587BE.16702@lists.openembedded.org>
@ 2020-04-01  5:43 ` Yeoh Ee Peng
  0 siblings, 0 replies; 7+ messages in thread
From: Yeoh Ee Peng @ 2020-04-01  5:43 UTC (permalink / raw)
  To: Yeoh, Ee Peng, openembedded-core, Ross Burton

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: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Yeoh Ee Peng
Sent: Wednesday, April 1, 2020 1:38 PM
To: openembedded-core@lists.openembedded.org
Cc: Yeoh, Ee Peng <ee.peng.yeoh@intel.com>; Humberto Ibarra <humberto.ibarra.lopez@intel.com>
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]

Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
---
 meta/lib/oeqa/selftest/cases/imagefeatures.py | 33 +++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py b/meta/lib/oeqa/selftest/cases/imagefeatures.py
index 5c519ac..9ad5c17 100644
--- a/meta/lib/oeqa/selftest/cases/imagefeatures.py
+++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py
@@ -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 <humberto.ibarra.lopez@intel.com>
+                     Yeoh Ee Peng <ee.peng.yeoh@intel.com>
+        """
+        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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-05-01  8:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-01  5:37 [PATCH] selftest/imagefeatures: Enable sanity test for IMAGE_GEN_DEBUGFS Yeoh Ee Peng
2020-04-21  3:10 ` Yeoh Ee Peng
2020-04-23  8:52 ` [OE-core] " Richard Purdie
2020-04-23  9:33   ` Yeoh Ee Peng
2020-04-24  9:39     ` Yeoh Ee Peng
2020-05-01  8:36   ` Yeoh Ee Peng
     [not found] <16019B7602D587BE.16702@lists.openembedded.org>
2020-04-01  5:43 ` Yeoh Ee Peng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.