All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] oeqa/kerneldevelopment: Able to apply a single patch to the Linux kernel source
@ 2019-08-23  2:29 mazliana.mohamad
  2019-08-23  8:02 ` ✗ patchtest: failure for oeqa/kerneldevelopment: Able to apply a single patch to the Linux kernel source (rev3) Patchwork
  2019-08-23 12:10 ` [PATCH v3] oeqa/kerneldevelopment: Able to apply a single patch to the Linux kernel source akuster808
  0 siblings, 2 replies; 4+ messages in thread
From: mazliana.mohamad @ 2019-08-23  2:29 UTC (permalink / raw)
  To: openembedded-core

From: Mazliana <mazliana.mohamad@intel.com>

Purpose of kernel development is basically to customize our
own recipes kernel by reused existing recipes.
 
This is an initiative of automating manual kernel development
test cases. Applying a single patch to the Linux kernel source
is one of the manual test cases of kernel development.

Objective of this test is as a developer we can make changes of
a file in kernel source and able to apply a single patch to
the kernel source.
 
ref:https://wiki.yoctoproject.org/wiki/Kernel_Development_Test_Cases

Signed-off-by: Mazliana <mazliana.mohamad@intel.com>
---
 meta/lib/oeqa/selftest/cases/kerneldevelopment.py | 67 +++++++++++++++++++++++
 1 file changed, 67 insertions(+)
 create mode 100644 meta/lib/oeqa/selftest/cases/kerneldevelopment.py

diff --git a/meta/lib/oeqa/selftest/cases/kerneldevelopment.py b/meta/lib/oeqa/selftest/cases/kerneldevelopment.py
new file mode 100644
index 0000000..a61876e
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/kerneldevelopment.py
@@ -0,0 +1,67 @@
+import os
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, get_bb_var
+from oeqa.utils.git import GitRepo
+
+class KernelDev(OESelftestTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        super(KernelDev, cls).setUpClass()
+        # Create the recipe directory structure inside the created layer
+        cls.layername = 'meta-kerneltest'
+        runCmd('bitbake-layers create-layer %s' % cls.layername)
+        runCmd('mkdir -p %s/recipes-kernel/linux/linux-yocto' % cls.layername)
+        cls.recipes_linuxyocto_dir = os.path.join \
+            (cls.builddir, cls.layername, 'recipes-kernel', 'linux', 'linux-yocto')
+        cls.recipeskernel_dir = os.path.dirname(cls.recipes_linuxyocto_dir)
+        runCmd('bitbake-layers add-layer %s' % cls.layername)
+
+    @classmethod
+    def tearDownClass(cls):
+        runCmd('bitbake-layers remove-layer %s' % cls.layername, ignore_status=True)
+        runCmd('rm -rf %s' % cls.layername)
+        super(KernelDev, cls).tearDownClass()
+
+    def setUp(self):
+        super(KernelDev, self).setUp()
+        self.set_machine_config('MACHINE = "qemux86-64"\n')
+
+    def test_apply_patches(self):
+        """
+        Summary:     Able to apply a single patch to the Linux kernel source
+        Expected:    The README file should exist and the patch changes should be
+                     displayed at the end of the file.
+        Product:     Kernel Development
+        Author:      Yeoh Ee Peng <ee.peng.yeoh@intel.com>
+        AutomatedBy: Mazliana Mohamad <mazliana.mohamad@intel.com>
+        """
+        runCmd('bitbake virtual/kernel -c patch')
+        kernel_source = get_bb_var('STAGING_KERNEL_DIR')
+        readme = os.path.join(kernel_source, 'README')
+
+        # This test step adds modified file 'README' to git and creates a
+        # patch file '0001-KERNEL_DEV_TEST_CASE.patch' at the same location as file
+        patch_content = 'This is a test to apply a patch to the kernel'
+        with open(readme, 'a+') as f:
+            f.write(patch_content)
+        repo = GitRepo('%s' % kernel_source, is_topdir=True)
+        repo.run_cmd('add %s' % readme)
+        repo.run_cmd(['commit', '-m', 'KERNEL_DEV_TEST_CASE'])
+        repo.run_cmd(['format-patch', '-1'])
+        patch_name = '0001-KERNEL_DEV_TEST_CASE.patch'
+        patchpath = os.path.join(kernel_source, patch_name)
+        runCmd('mv %s %s' % (patchpath, self.recipes_linuxyocto_dir))
+        runCmd('rm %s ' % readme)
+        self.assertFalse(os.path.exists(readme))
+
+        recipe_append = os.path.join(self.recipeskernel_dir, 'linux-yocto_%.bbappend')
+        with open(recipe_append, 'w+') as fh:
+            fh.write('SRC_URI += "file://%s"\n' % patch_name)
+            fh.write('FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"')
+
+        runCmd('bitbake virtual/kernel -c clean')
+        runCmd('bitbake virtual/kernel -c patch')
+        self.assertTrue(os.path.exists(readme))
+        result = runCmd('tail -n 1 %s' % readme)
+        self.assertEqual(result.output, patch_content)
-- 
2.7.4



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

* ✗ patchtest: failure for oeqa/kerneldevelopment: Able to apply a single patch to the Linux kernel source (rev3)
  2019-08-23  2:29 [PATCH v3] oeqa/kerneldevelopment: Able to apply a single patch to the Linux kernel source mazliana.mohamad
@ 2019-08-23  8:02 ` Patchwork
  2019-08-23 12:10 ` [PATCH v3] oeqa/kerneldevelopment: Able to apply a single patch to the Linux kernel source akuster808
  1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2019-08-23  8:02 UTC (permalink / raw)
  To: mazliana.mohamad; +Cc: openembedded-core

== Series Details ==

Series: oeqa/kerneldevelopment: Able to apply a single patch to the Linux kernel source (rev3)
Revision: 3
URL   : https://patchwork.openembedded.org/series/19411/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Errors in your Python code were encountered [test_pylint] 
  Suggested fix    Correct the lines introduced by your patch
  Output           Please, fix the listed issues:
                   meta/lib/oeqa/selftest/cases/kerneldevelopment.py does not exist



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



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

* Re: [PATCH v3] oeqa/kerneldevelopment: Able to apply a single patch to the Linux kernel source
  2019-08-23  2:29 [PATCH v3] oeqa/kerneldevelopment: Able to apply a single patch to the Linux kernel source mazliana.mohamad
  2019-08-23  8:02 ` ✗ patchtest: failure for oeqa/kerneldevelopment: Able to apply a single patch to the Linux kernel source (rev3) Patchwork
@ 2019-08-23 12:10 ` akuster808
  2019-08-26  6:39   ` Mohamad, Mazliana
  1 sibling, 1 reply; 4+ messages in thread
From: akuster808 @ 2019-08-23 12:10 UTC (permalink / raw)
  To: mazliana.mohamad, openembedded-core



On 8/22/19 7:29 PM, mazliana.mohamad@intel.com wrote:
> From: Mazliana <mazliana.mohamad@intel.com>
>
> Purpose of kernel development is basically to customize our
> own recipes kernel by reused existing recipes.
>  
> This is an initiative of automating manual kernel development
> test cases. Applying a single patch to the Linux kernel source
> is one of the manual test cases of kernel development.
Doesn't this allow us to remove
"kernel-dev.kernel-dev.Kernel_dev_Applying_patches" from the
manual/kernel-dev.json?

- armin
>
> Objective of this test is as a developer we can make changes of
> a file in kernel source and able to apply a single patch to
> the kernel source.
>  
> ref:https://wiki.yoctoproject.org/wiki/Kernel_Development_Test_Cases
>
> Signed-off-by: Mazliana <mazliana.mohamad@intel.com>
> ---
>  meta/lib/oeqa/selftest/cases/kerneldevelopment.py | 67 +++++++++++++++++++++++
>  1 file changed, 67 insertions(+)
>  create mode 100644 meta/lib/oeqa/selftest/cases/kerneldevelopment.py
>
> diff --git a/meta/lib/oeqa/selftest/cases/kerneldevelopment.py b/meta/lib/oeqa/selftest/cases/kerneldevelopment.py
> new file mode 100644
> index 0000000..a61876e
> --- /dev/null
> +++ b/meta/lib/oeqa/selftest/cases/kerneldevelopment.py
> @@ -0,0 +1,67 @@
> +import os
> +from oeqa.selftest.case import OESelftestTestCase
> +from oeqa.utils.commands import runCmd, get_bb_var
> +from oeqa.utils.git import GitRepo
> +
> +class KernelDev(OESelftestTestCase):
> +
> +    @classmethod
> +    def setUpClass(cls):
> +        super(KernelDev, cls).setUpClass()
> +        # Create the recipe directory structure inside the created layer
> +        cls.layername = 'meta-kerneltest'
> +        runCmd('bitbake-layers create-layer %s' % cls.layername)
> +        runCmd('mkdir -p %s/recipes-kernel/linux/linux-yocto' % cls.layername)
> +        cls.recipes_linuxyocto_dir = os.path.join \
> +            (cls.builddir, cls.layername, 'recipes-kernel', 'linux', 'linux-yocto')
> +        cls.recipeskernel_dir = os.path.dirname(cls.recipes_linuxyocto_dir)
> +        runCmd('bitbake-layers add-layer %s' % cls.layername)
> +
> +    @classmethod
> +    def tearDownClass(cls):
> +        runCmd('bitbake-layers remove-layer %s' % cls.layername, ignore_status=True)
> +        runCmd('rm -rf %s' % cls.layername)
> +        super(KernelDev, cls).tearDownClass()
> +
> +    def setUp(self):
> +        super(KernelDev, self).setUp()
> +        self.set_machine_config('MACHINE = "qemux86-64"\n')
> +
> +    def test_apply_patches(self):
> +        """
> +        Summary:     Able to apply a single patch to the Linux kernel source
> +        Expected:    The README file should exist and the patch changes should be
> +                     displayed at the end of the file.
> +        Product:     Kernel Development
> +        Author:      Yeoh Ee Peng <ee.peng.yeoh@intel.com>
> +        AutomatedBy: Mazliana Mohamad <mazliana.mohamad@intel.com>
> +        """
> +        runCmd('bitbake virtual/kernel -c patch')
> +        kernel_source = get_bb_var('STAGING_KERNEL_DIR')
> +        readme = os.path.join(kernel_source, 'README')
> +
> +        # This test step adds modified file 'README' to git and creates a
> +        # patch file '0001-KERNEL_DEV_TEST_CASE.patch' at the same location as file
> +        patch_content = 'This is a test to apply a patch to the kernel'
> +        with open(readme, 'a+') as f:
> +            f.write(patch_content)
> +        repo = GitRepo('%s' % kernel_source, is_topdir=True)
> +        repo.run_cmd('add %s' % readme)
> +        repo.run_cmd(['commit', '-m', 'KERNEL_DEV_TEST_CASE'])
> +        repo.run_cmd(['format-patch', '-1'])
> +        patch_name = '0001-KERNEL_DEV_TEST_CASE.patch'
> +        patchpath = os.path.join(kernel_source, patch_name)
> +        runCmd('mv %s %s' % (patchpath, self.recipes_linuxyocto_dir))
> +        runCmd('rm %s ' % readme)
> +        self.assertFalse(os.path.exists(readme))
> +
> +        recipe_append = os.path.join(self.recipeskernel_dir, 'linux-yocto_%.bbappend')
> +        with open(recipe_append, 'w+') as fh:
> +            fh.write('SRC_URI += "file://%s"\n' % patch_name)
> +            fh.write('FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"')
> +
> +        runCmd('bitbake virtual/kernel -c clean')
> +        runCmd('bitbake virtual/kernel -c patch')
> +        self.assertTrue(os.path.exists(readme))
> +        result = runCmd('tail -n 1 %s' % readme)
> +        self.assertEqual(result.output, patch_content)



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

* Re: [PATCH v3] oeqa/kerneldevelopment: Able to apply a single patch to the Linux kernel source
  2019-08-23 12:10 ` [PATCH v3] oeqa/kerneldevelopment: Able to apply a single patch to the Linux kernel source akuster808
@ 2019-08-26  6:39   ` Mohamad, Mazliana
  0 siblings, 0 replies; 4+ messages in thread
From: Mohamad, Mazliana @ 2019-08-26  6:39 UTC (permalink / raw)
  To: akuster808, openembedded-core

Hi Armin,

Yes, but wait until the patch has been accepted.

Thanks & Regards,
Mazliana Mohamad

-----Original Message-----
From: akuster808 [mailto:akuster808@gmail.com] 
Sent: Friday, August 23, 2019 8:10 PM
To: Mohamad, Mazliana <mazliana.mohamad@intel.com>; openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH v3] oeqa/kerneldevelopment: Able to apply a single patch to the Linux kernel source



On 8/22/19 7:29 PM, mazliana.mohamad@intel.com wrote:
> From: Mazliana <mazliana.mohamad@intel.com>
>
> Purpose of kernel development is basically to customize our own 
> recipes kernel by reused existing recipes.
>  
> This is an initiative of automating manual kernel development test 
> cases. Applying a single patch to the Linux kernel source is one of 
> the manual test cases of kernel development.
Doesn't this allow us to remove
"kernel-dev.kernel-dev.Kernel_dev_Applying_patches" from the manual/kernel-dev.json?

- armin
>
> Objective of this test is as a developer we can make changes of a file 
> in kernel source and able to apply a single patch to the kernel 
> source.
>  
> ref:https://wiki.yoctoproject.org/wiki/Kernel_Development_Test_Cases
>
> Signed-off-by: Mazliana <mazliana.mohamad@intel.com>
> ---
>  meta/lib/oeqa/selftest/cases/kerneldevelopment.py | 67 
> +++++++++++++++++++++++
>  1 file changed, 67 insertions(+)
>  create mode 100644 meta/lib/oeqa/selftest/cases/kerneldevelopment.py
>
> diff --git a/meta/lib/oeqa/selftest/cases/kerneldevelopment.py 
> b/meta/lib/oeqa/selftest/cases/kerneldevelopment.py
> new file mode 100644
> index 0000000..a61876e
> --- /dev/null
> +++ b/meta/lib/oeqa/selftest/cases/kerneldevelopment.py
> @@ -0,0 +1,67 @@
> +import os
> +from oeqa.selftest.case import OESelftestTestCase from 
> +oeqa.utils.commands import runCmd, get_bb_var from oeqa.utils.git 
> +import GitRepo
> +
> +class KernelDev(OESelftestTestCase):
> +
> +    @classmethod
> +    def setUpClass(cls):
> +        super(KernelDev, cls).setUpClass()
> +        # Create the recipe directory structure inside the created layer
> +        cls.layername = 'meta-kerneltest'
> +        runCmd('bitbake-layers create-layer %s' % cls.layername)
> +        runCmd('mkdir -p %s/recipes-kernel/linux/linux-yocto' % cls.layername)
> +        cls.recipes_linuxyocto_dir = os.path.join \
> +            (cls.builddir, cls.layername, 'recipes-kernel', 'linux', 'linux-yocto')
> +        cls.recipeskernel_dir = os.path.dirname(cls.recipes_linuxyocto_dir)
> +        runCmd('bitbake-layers add-layer %s' % cls.layername)
> +
> +    @classmethod
> +    def tearDownClass(cls):
> +        runCmd('bitbake-layers remove-layer %s' % cls.layername, ignore_status=True)
> +        runCmd('rm -rf %s' % cls.layername)
> +        super(KernelDev, cls).tearDownClass()
> +
> +    def setUp(self):
> +        super(KernelDev, self).setUp()
> +        self.set_machine_config('MACHINE = "qemux86-64"\n')
> +
> +    def test_apply_patches(self):
> +        """
> +        Summary:     Able to apply a single patch to the Linux kernel source
> +        Expected:    The README file should exist and the patch changes should be
> +                     displayed at the end of the file.
> +        Product:     Kernel Development
> +        Author:      Yeoh Ee Peng <ee.peng.yeoh@intel.com>
> +        AutomatedBy: Mazliana Mohamad <mazliana.mohamad@intel.com>
> +        """
> +        runCmd('bitbake virtual/kernel -c patch')
> +        kernel_source = get_bb_var('STAGING_KERNEL_DIR')
> +        readme = os.path.join(kernel_source, 'README')
> +
> +        # This test step adds modified file 'README' to git and creates a
> +        # patch file '0001-KERNEL_DEV_TEST_CASE.patch' at the same location as file
> +        patch_content = 'This is a test to apply a patch to the kernel'
> +        with open(readme, 'a+') as f:
> +            f.write(patch_content)
> +        repo = GitRepo('%s' % kernel_source, is_topdir=True)
> +        repo.run_cmd('add %s' % readme)
> +        repo.run_cmd(['commit', '-m', 'KERNEL_DEV_TEST_CASE'])
> +        repo.run_cmd(['format-patch', '-1'])
> +        patch_name = '0001-KERNEL_DEV_TEST_CASE.patch'
> +        patchpath = os.path.join(kernel_source, patch_name)
> +        runCmd('mv %s %s' % (patchpath, self.recipes_linuxyocto_dir))
> +        runCmd('rm %s ' % readme)
> +        self.assertFalse(os.path.exists(readme))
> +
> +        recipe_append = os.path.join(self.recipeskernel_dir, 'linux-yocto_%.bbappend')
> +        with open(recipe_append, 'w+') as fh:
> +            fh.write('SRC_URI += "file://%s"\n' % patch_name)
> +            fh.write('FILESEXTRAPATHS_prepend := 
> + "${THISDIR}/${PN}:"')
> +
> +        runCmd('bitbake virtual/kernel -c clean')
> +        runCmd('bitbake virtual/kernel -c patch')
> +        self.assertTrue(os.path.exists(readme))
> +        result = runCmd('tail -n 1 %s' % readme)
> +        self.assertEqual(result.output, patch_content)


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

end of thread, other threads:[~2019-08-26  6:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-23  2:29 [PATCH v3] oeqa/kerneldevelopment: Able to apply a single patch to the Linux kernel source mazliana.mohamad
2019-08-23  8:02 ` ✗ patchtest: failure for oeqa/kerneldevelopment: Able to apply a single patch to the Linux kernel source (rev3) Patchwork
2019-08-23 12:10 ` [PATCH v3] oeqa/kerneldevelopment: Able to apply a single patch to the Linux kernel source akuster808
2019-08-26  6:39   ` Mohamad, Mazliana

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.