* [OE-Core][PATCH v2] oe-pkgdata-util: Added a test to verify oe-pkgdata-util without parameters
@ 2020-12-24 10:01 Milan Shah
2021-01-03 11:48 ` Paul Barker
0 siblings, 1 reply; 3+ messages in thread
From: Milan Shah @ 2020-12-24 10:01 UTC (permalink / raw)
To: openembedded-core
A test is implemented on poky/meta/lib/oeqa/selftest/pkgdata.py to test
the scenario when oe-pkgdata-util is executed without parameters and
help is displayed.
See [YOCTO #10726] for detailed bug information.
Signed-off-by: Milan Shah <mshah@mvista.com>
---
meta/lib/oeqa/selftest/cases/pkgdata.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/meta/lib/oeqa/selftest/cases/pkgdata.py b/meta/lib/oeqa/selftest/cases/pkgdata.py
index 833a180..94ee1f5 100644
--- a/meta/lib/oeqa/selftest/cases/pkgdata.py
+++ b/meta/lib/oeqa/selftest/cases/pkgdata.py
@@ -218,3 +218,9 @@ class OePkgdataUtilTests(OESelftestTestCase):
def test_specify_pkgdatadir(self):
result = runCmd('oe-pkgdata-util -p %s lookup-pkg zlib' % get_bb_var('PKGDATA_DIR'))
self.assertEqual(result.output, 'libz1')
+
+ def test_no_param(self):
+ result = runCmd('oe-pkgdata-util', ignore_status=True)
+ self.assertEqual(result.status, 2, "Status different than 2. output: %s" % result.output)
+ currpos = result.output.find('usage: oe-pkgdata-util [-h] [-d] [-p PKGDATA_DIR] <subcommand>')
+ self.assertTrue(currpos != -1, msg = "Test is Failed. Help is not Displayed in %s" % result.output)
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [OE-Core][PATCH v2] oe-pkgdata-util: Added a test to verify oe-pkgdata-util without parameters
2020-12-24 10:01 [OE-Core][PATCH v2] oe-pkgdata-util: Added a test to verify oe-pkgdata-util without parameters Milan Shah
@ 2021-01-03 11:48 ` Paul Barker
2021-01-04 6:04 ` Milan Shah
0 siblings, 1 reply; 3+ messages in thread
From: Paul Barker @ 2021-01-03 11:48 UTC (permalink / raw)
To: Milan Shah; +Cc: openembedded-core
On Thu, 24 Dec 2020 at 10:01, Milan Shah <mshah@mvista.com> wrote:
>
> A test is implemented on poky/meta/lib/oeqa/selftest/pkgdata.py to test
> the scenario when oe-pkgdata-util is executed without parameters and
> help is displayed.
>
> See [YOCTO #10726] for detailed bug information.
>
> Signed-off-by: Milan Shah <mshah@mvista.com>
> ---
> meta/lib/oeqa/selftest/cases/pkgdata.py | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/meta/lib/oeqa/selftest/cases/pkgdata.py b/meta/lib/oeqa/selftest/cases/pkgdata.py
> index 833a180..94ee1f5 100644
> --- a/meta/lib/oeqa/selftest/cases/pkgdata.py
> +++ b/meta/lib/oeqa/selftest/cases/pkgdata.py
> @@ -218,3 +218,9 @@ class OePkgdataUtilTests(OESelftestTestCase):
> def test_specify_pkgdatadir(self):
> result = runCmd('oe-pkgdata-util -p %s lookup-pkg zlib' % get_bb_var('PKGDATA_DIR'))
> self.assertEqual(result.output, 'libz1')
> +
> + def test_no_param(self):
> + result = runCmd('oe-pkgdata-util', ignore_status=True)
> + self.assertEqual(result.status, 2, "Status different than 2. output: %s" % result.output)
> + currpos = result.output.find('usage: oe-pkgdata-util [-h] [-d] [-p PKGDATA_DIR] <subcommand>')
In my opinion this is still too restrictive a test, it would need
updating when any further arguments are added to the oe-pkgdata-util
tool. I'd recommend just checking for "usage: oe-pkgdata-util" and
ignoring the rest of the line.
Thanks,
--
Paul Barker
Konsulko Group
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [OE-Core][PATCH v2] oe-pkgdata-util: Added a test to verify oe-pkgdata-util without parameters
2021-01-03 11:48 ` Paul Barker
@ 2021-01-04 6:04 ` Milan Shah
0 siblings, 0 replies; 3+ messages in thread
From: Milan Shah @ 2021-01-04 6:04 UTC (permalink / raw)
To: Paul Barker; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 2064 bytes --]
Hi Paul,
Thanks for the review. Review comments are addressed and the new Patch
<https://lists.openembedded.org/g/openembedded-core/topic/patch_v3_oe_pkgdata_util/79418977?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,79418977>
is sent again for review.
-----------------------
Thanks & Regards,
*Milan Shah*
MontaVista Software, Bangalore, India
On Sun, Jan 3, 2021 at 5:18 PM Paul Barker <pbarker@konsulko.com> wrote:
> On Thu, 24 Dec 2020 at 10:01, Milan Shah <mshah@mvista.com> wrote:
> >
> > A test is implemented on poky/meta/lib/oeqa/selftest/pkgdata.py to test
> > the scenario when oe-pkgdata-util is executed without parameters and
> > help is displayed.
> >
> > See [YOCTO #10726] for detailed bug information.
> >
> > Signed-off-by: Milan Shah <mshah@mvista.com>
> > ---
> > meta/lib/oeqa/selftest/cases/pkgdata.py | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/meta/lib/oeqa/selftest/cases/pkgdata.py
> b/meta/lib/oeqa/selftest/cases/pkgdata.py
> > index 833a180..94ee1f5 100644
> > --- a/meta/lib/oeqa/selftest/cases/pkgdata.py
> > +++ b/meta/lib/oeqa/selftest/cases/pkgdata.py
> > @@ -218,3 +218,9 @@ class OePkgdataUtilTests(OESelftestTestCase):
> > def test_specify_pkgdatadir(self):
> > result = runCmd('oe-pkgdata-util -p %s lookup-pkg zlib' %
> get_bb_var('PKGDATA_DIR'))
> > self.assertEqual(result.output, 'libz1')
> > +
> > + def test_no_param(self):
> > + result = runCmd('oe-pkgdata-util', ignore_status=True)
> > + self.assertEqual(result.status, 2, "Status different than 2.
> output: %s" % result.output)
> > + currpos = result.output.find('usage: oe-pkgdata-util [-h] [-d]
> [-p PKGDATA_DIR] <subcommand>')
>
> In my opinion this is still too restrictive a test, it would need
> updating when any further arguments are added to the oe-pkgdata-util
> tool. I'd recommend just checking for "usage: oe-pkgdata-util" and
> ignoring the rest of the line.
>
> Thanks,
>
> --
> Paul Barker
> Konsulko Group
>
[-- Attachment #2: Type: text/html, Size: 3534 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-04 6:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-24 10:01 [OE-Core][PATCH v2] oe-pkgdata-util: Added a test to verify oe-pkgdata-util without parameters Milan Shah
2021-01-03 11:48 ` Paul Barker
2021-01-04 6:04 ` Milan Shah
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.