]> code.ossystems Code Review - openembedded-core.git/commitdiff
oe-pkgdata-util: Added a test to verify oe-pkgdata-util without parameters
authorMilan Shah <mshah@mvista.com>
Mon, 4 Jan 2021 05:54:02 +0000 (11:24 +0530)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 5 Jan 2021 13:48:06 +0000 (13:48 +0000)
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/pkgdata.py

index 833a1803ba632c5a5b27100172965e1b8381131a..254abc40c6df6d98662c8ebce487d96802aa111c 100644 (file)
@@ -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')
+        self.assertTrue(currpos != -1, msg = "Test is Failed. Help is not Displayed in %s" % result.output)