On Thu, 24 Dec 2020 at 10:01, Milan Shah <ms...@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 <ms...@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
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#146337): 
https://lists.openembedded.org/g/openembedded-core/message/146337
Mute This Topic: https://lists.openembedded.org/mt/79199395/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to