* Re: [OE-Core][PATCH] manifest.py: Add tests to empty image
[not found] <20210112133626.2229251-1-milan.opensource@gmail.com>
@ 2021-01-18 6:54 ` Milan Shah
0 siblings, 0 replies; 6+ messages in thread
From: Milan Shah @ 2021-01-18 6:54 UTC (permalink / raw)
To: openembedded-core
Cc: alejandro.franco, paul.eggleton, benjamin.esquivel,
leonardo.sandoval.gonzalez, richard.purdie, akuster,
randy.macleod
[-- Attachment #1: Type: text/plain, Size: 3004 bytes --]
Hi All,
This is a gentle reminder to review this patch.
On Tue, Jan 12, 2021 at 7:06 PM Milan Shah <milan.opensource@gmail.com>
wrote:
> An oe-selftest test is added to ensure
> meta-selftest/recipes-test/images/test-empty-image.bb builds and is empty.
>
> It is just a test that ensures that an empty image has no packages in it
> (i.e. nothing in the manifest)
>
> See [YOCTO #8455] for details.
>
> Signed-off-by: Milan Shah <milan.opensource@gmail.com>
> ---
> meta/lib/oeqa/selftest/cases/manifest.py | 45 ++++++++++++++++++++++++
> 1 file changed, 45 insertions(+)
>
> diff --git a/meta/lib/oeqa/selftest/cases/manifest.py
> b/meta/lib/oeqa/selftest/cases/manifest.py
> index 5d13f35468..d9b8612628 100644
> --- a/meta/lib/oeqa/selftest/cases/manifest.py
> +++ b/meta/lib/oeqa/selftest/cases/manifest.py
> @@ -162,3 +162,48 @@ class VerifyManifest(OESelftestTestCase):
> self.logger.debug(logmsg)
> self.logger.info(msg)
> self.fail(logmsg)
> +
> +class VerifyEmptyManifest(OESelftestTestCase):
> + '''Tests for the manifest files of an empty image'''
> +
> + @classmethod
> + def setUpClass(self):
> +
> + # the setup should bitbake test-empty-image
> + super(VerifyEmptyManifest, self).setUpClass()
> + self.buildtarget = 'test-empty-image'
> + self.classname = 'VerifyEmptyManifest'
> +
> + self.logger.info("{}: doing bitbake {} as a prerequisite of the
> test"\
> + .format(self.classname, self.buildtarget))
> + if bitbake(self.buildtarget).status:
> + self.logger.debug("{} Failed to setup {}"\
> + .format(self.classname, self.buildtarget))
> + self.skipTest("{}: Cannot setup testing scenario"\
> + .format(self.classname))
> +
> +
> + @classmethod
> + def test_image_manifest_empty(self):
> + '''Verifying the image manifest file is empty, this may take a
> build'''
> +
> + # get manifest location based on target to query about
> + try:
> + mdir = VerifyManifest.get_dir_from_bb_var('DEPLOY_DIR_IMAGE',
> + self.buildtarget)
> + mfilename = get_bb_var("IMAGE_LINK_NAME", self.buildtarget)\
> + + ".manifest"
> + mpath = os.path.join(mdir, mfilename)
> + self.logger.info("Manifest file path is: {}" .format(mpath))
> +
> + if not os.path.isfile(mpath): raise IOError
> + if not os.path.getsize(mpath) == 0: raise OSError
> +
> + except OSError:
> + raise self.skipTest("{}: manifest file is not empty"\
> + .format(self.classname))
> +
> + except IOError:
> + msg = "{}: Error cannot find manifests in dir:\n{}"\
> + .format(self.classname, mdir)
> + self.fail(msg)
> --
> 2.25.1
>
>
[-- Attachment #2: Type: text/html, Size: 4177 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [OE-Core][PATCH] manifest.py: Add tests to empty image
@ 2021-01-22 5:58 Milan Shah
2021-02-06 6:13 ` Milan Shah
2021-02-06 9:07 ` Richard Purdie
0 siblings, 2 replies; 6+ messages in thread
From: Milan Shah @ 2021-01-22 5:58 UTC (permalink / raw)
To: openembedded-core; +Cc: richard.purdie, akuster, randy.macleod
An oe-selftest test is added to ensure
meta-selftest/recipes-test/images/test-empty-image.bb builds and is empty.
It is just a test that ensures that an empty image has no packages in it
(i.e. nothing in the manifest)
See [YOCTO #8455] for details.
Signed-off-by: Milan Shah <milan.opensource@gmail.com>
---
meta/lib/oeqa/selftest/cases/manifest.py | 45 ++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/meta/lib/oeqa/selftest/cases/manifest.py b/meta/lib/oeqa/selftest/cases/manifest.py
index 5d13f35468..d9b8612628 100644
--- a/meta/lib/oeqa/selftest/cases/manifest.py
+++ b/meta/lib/oeqa/selftest/cases/manifest.py
@@ -162,3 +162,48 @@ class VerifyManifest(OESelftestTestCase):
self.logger.debug(logmsg)
self.logger.info(msg)
self.fail(logmsg)
+
+class VerifyEmptyManifest(OESelftestTestCase):
+ '''Tests for the manifest files of an empty image'''
+
+ @classmethod
+ def setUpClass(self):
+
+ # the setup should bitbake test-empty-image
+ super(VerifyEmptyManifest, self).setUpClass()
+ self.buildtarget = 'test-empty-image'
+ self.classname = 'VerifyEmptyManifest'
+
+ self.logger.info("{}: doing bitbake {} as a prerequisite of the test"\
+ .format(self.classname, self.buildtarget))
+ if bitbake(self.buildtarget).status:
+ self.logger.debug("{} Failed to setup {}"\
+ .format(self.classname, self.buildtarget))
+ self.skipTest("{}: Cannot setup testing scenario"\
+ .format(self.classname))
+
+
+ @classmethod
+ def test_image_manifest_empty(self):
+ '''Verifying the image manifest file is empty, this may take a build'''
+
+ # get manifest location based on target to query about
+ try:
+ mdir = VerifyManifest.get_dir_from_bb_var('DEPLOY_DIR_IMAGE',
+ self.buildtarget)
+ mfilename = get_bb_var("IMAGE_LINK_NAME", self.buildtarget)\
+ + ".manifest"
+ mpath = os.path.join(mdir, mfilename)
+ self.logger.info("Manifest file path is: {}" .format(mpath))
+
+ if not os.path.isfile(mpath): raise IOError
+ if not os.path.getsize(mpath) == 0: raise OSError
+
+ except OSError:
+ raise self.skipTest("{}: manifest file is not empty"\
+ .format(self.classname))
+
+ except IOError:
+ msg = "{}: Error cannot find manifests in dir:\n{}"\
+ .format(self.classname, mdir)
+ self.fail(msg)
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [OE-Core][PATCH] manifest.py: Add tests to empty image
2021-01-22 5:58 [OE-Core][PATCH] manifest.py: Add tests to empty image Milan Shah
@ 2021-02-06 6:13 ` Milan Shah
2021-02-06 9:07 ` Richard Purdie
1 sibling, 0 replies; 6+ messages in thread
From: Milan Shah @ 2021-02-06 6:13 UTC (permalink / raw)
To: openembedded-core; +Cc: Richard Purdie, akuster, randy.macleod
[-- Attachment #1: Type: text/plain, Size: 3038 bytes --]
Hi All,
This is a Gentle reminder to review this patch.
Thanks & Regards,
Milan Shah
On Fri, Jan 22, 2021 at 11:28 AM Milan Shah <milan.opensource@gmail.com>
wrote:
> An oe-selftest test is added to ensure
> meta-selftest/recipes-test/images/test-empty-image.bb builds and is empty.
>
> It is just a test that ensures that an empty image has no packages in it
> (i.e. nothing in the manifest)
>
> See [YOCTO #8455] for details.
>
> Signed-off-by: Milan Shah <milan.opensource@gmail.com>
> ---
> meta/lib/oeqa/selftest/cases/manifest.py | 45 ++++++++++++++++++++++++
> 1 file changed, 45 insertions(+)
>
> diff --git a/meta/lib/oeqa/selftest/cases/manifest.py
> b/meta/lib/oeqa/selftest/cases/manifest.py
> index 5d13f35468..d9b8612628 100644
> --- a/meta/lib/oeqa/selftest/cases/manifest.py
> +++ b/meta/lib/oeqa/selftest/cases/manifest.py
> @@ -162,3 +162,48 @@ class VerifyManifest(OESelftestTestCase):
> self.logger.debug(logmsg)
> self.logger.info(msg)
> self.fail(logmsg)
> +
> +class VerifyEmptyManifest(OESelftestTestCase):
> + '''Tests for the manifest files of an empty image'''
> +
> + @classmethod
> + def setUpClass(self):
> +
> + # the setup should bitbake test-empty-image
> + super(VerifyEmptyManifest, self).setUpClass()
> + self.buildtarget = 'test-empty-image'
> + self.classname = 'VerifyEmptyManifest'
> +
> + self.logger.info("{}: doing bitbake {} as a prerequisite of the
> test"\
> + .format(self.classname, self.buildtarget))
> + if bitbake(self.buildtarget).status:
> + self.logger.debug("{} Failed to setup {}"\
> + .format(self.classname, self.buildtarget))
> + self.skipTest("{}: Cannot setup testing scenario"\
> + .format(self.classname))
> +
> +
> + @classmethod
> + def test_image_manifest_empty(self):
> + '''Verifying the image manifest file is empty, this may take a
> build'''
> +
> + # get manifest location based on target to query about
> + try:
> + mdir = VerifyManifest.get_dir_from_bb_var('DEPLOY_DIR_IMAGE',
> + self.buildtarget)
> + mfilename = get_bb_var("IMAGE_LINK_NAME", self.buildtarget)\
> + + ".manifest"
> + mpath = os.path.join(mdir, mfilename)
> + self.logger.info("Manifest file path is: {}" .format(mpath))
> +
> + if not os.path.isfile(mpath): raise IOError
> + if not os.path.getsize(mpath) == 0: raise OSError
> +
> + except OSError:
> + raise self.skipTest("{}: manifest file is not empty"\
> + .format(self.classname))
> +
> + except IOError:
> + msg = "{}: Error cannot find manifests in dir:\n{}"\
> + .format(self.classname, mdir)
> + self.fail(msg)
> --
> 2.25.1
>
>
[-- Attachment #2: Type: text/html, Size: 4267 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [OE-Core][PATCH] manifest.py: Add tests to empty image
2021-01-22 5:58 [OE-Core][PATCH] manifest.py: Add tests to empty image Milan Shah
2021-02-06 6:13 ` Milan Shah
@ 2021-02-06 9:07 ` Richard Purdie
2021-02-14 6:19 ` Milan Shah
1 sibling, 1 reply; 6+ messages in thread
From: Richard Purdie @ 2021-02-06 9:07 UTC (permalink / raw)
To: Milan Shah, openembedded-core; +Cc: akuster, randy.macleod
On Fri, 2021-01-22 at 11:28 +0530, Milan Shah wrote:
> An oe-selftest test is added to ensure
> meta-selftest/recipes-test/images/test-empty-image.bb builds and is empty.
>
> It is just a test that ensures that an empty image has no packages in it
> (i.e. nothing in the manifest)
>
> See [YOCTO #8455] for details.
>
> Signed-off-by: Milan Shah <milan.opensource@gmail.com>
> ---
> meta/lib/oeqa/selftest/cases/manifest.py | 45 ++++++++++++++++++++++++
> 1 file changed, 45 insertions(+)
I was curious what else was using test-empty-image.bb and I see a test
in:
meta/lib/oeqa/selftest/cases/imagefeatures.py:
"""Test creation of image with no packages"""
bitbake('test-empty-image')
res_dir = get_bb_var('DEPLOY_DIR_IMAGE')
images = os.path.join(res_dir, "test-empty-image-*.manifest")
result = glob.glob(images)
with open(result[1],"r") as f:
self.assertEqual(len(f.read().strip()),0)
Is this test doing the same thing?
Cheers,
Richard
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [OE-Core][PATCH] manifest.py: Add tests to empty image
2021-02-06 9:07 ` Richard Purdie
@ 2021-02-14 6:19 ` Milan Shah
2021-02-14 11:07 ` Richard Purdie
0 siblings, 1 reply; 6+ messages in thread
From: Milan Shah @ 2021-02-14 6:19 UTC (permalink / raw)
To: Richard Purdie; +Cc: openembedded-core, akuster, randy.macleod
[-- Attachment #1: Type: text/plain, Size: 1498 bytes --]
Yes, Richard
Looks like now there are two patches for the same bug. As the bugz was not
updated, I also worked on the same bug.
As It is already merged, you can neglect my one. Please update the Bugzilla
bug and mark it as resolve whoever has worked on it.
Thanks,
Milan Shah
On Sat, Feb 6, 2021 at 2:37 PM Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:
> On Fri, 2021-01-22 at 11:28 +0530, Milan Shah wrote:
> > An oe-selftest test is added to ensure
> > meta-selftest/recipes-test/images/test-empty-image.bb builds and is
> empty.
> >
> > It is just a test that ensures that an empty image has no packages in it
> > (i.e. nothing in the manifest)
> >
> > See [YOCTO #8455] for details.
> >
> > Signed-off-by: Milan Shah <milan.opensource@gmail.com>
> > ---
> > meta/lib/oeqa/selftest/cases/manifest.py | 45 ++++++++++++++++++++++++
> > 1 file changed, 45 insertions(+)
>
> I was curious what else was using test-empty-image.bb and I see a test
> in:
>
> meta/lib/oeqa/selftest/cases/imagefeatures.py:
>
> """Test creation of image with no packages"""
> bitbake('test-empty-image')
> res_dir = get_bb_var('DEPLOY_DIR_IMAGE')
> images = os.path.join(res_dir, "test-empty-image-*.manifest")
> result = glob.glob(images)
> with open(result[1],"r") as f:
> self.assertEqual(len(f.read().strip()),0)
>
> Is this test doing the same thing?
>
> Cheers,
>
> Richard
>
>
[-- Attachment #2: Type: text/html, Size: 2317 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [OE-Core][PATCH] manifest.py: Add tests to empty image
2021-02-14 6:19 ` Milan Shah
@ 2021-02-14 11:07 ` Richard Purdie
0 siblings, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2021-02-14 11:07 UTC (permalink / raw)
To: Milan Shah; +Cc: openembedded-core, akuster, randy.macleod
On Sun, 2021-02-14 at 11:49 +0530, Milan Shah wrote:
> Yes, Richard
> Looks like now there are two patches for the same bug. As the bugz
> was not updated, I also worked on the same bug.
>
> As It is already merged, you can neglect my one. Please update the
> Bugzilla bug and mark it as resolve whoever has worked on it.
Sorry about that, we try and keep things in sync but its hard to catch
every change. I'll make sure this one is resolved.
Cheers,
Richard
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-02-14 11:07 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-22 5:58 [OE-Core][PATCH] manifest.py: Add tests to empty image Milan Shah
2021-02-06 6:13 ` Milan Shah
2021-02-06 9:07 ` Richard Purdie
2021-02-14 6:19 ` Milan Shah
2021-02-14 11:07 ` Richard Purdie
[not found] <20210112133626.2229251-1-milan.opensource@gmail.com>
2021-01-18 6:54 ` Milan Shah
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox