Skip to contentSkip to conversation

oe-pkgdata-util: Added a test to verify oe-pkgdata-util without parameters

PATCH In review Milan Shah 2 participants 3 messages Jan 4, 2021 – Jan 11, 2021

lore
Share & tools
lore

Milan Shah

author
#0 lore raw

PATCH v3 1/1 oe-pkgdata-util: Added a test to verify oe-pkgdata-util without parameters

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.

---
 meta/lib/oeqa/selftest/cases/pkgdata.py | 6 ++++++
 1 file changed, 6 insertions(+)
meta/lib/oeqa/selftest/cases/pkgdata.py +6 -0
index 833a180..254abc4 100644
@@ -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)
Signature · 1 line
2.7.4
author
#1 lore raw

Hi All,

This is a gentle reminder to review this patch.

-----------------------
Thanks & Regards,
*Milan Shah*
MontaVista Software, Bangalore, India

Quoted 33 lines · Milan Shah

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.

---
 meta/lib/oeqa/selftest/cases/pkgdata.py | 6 ++++++
 1 file changed, 6 insertions(+)
meta/lib/oeqa/selftest/cases/pkgdata.py +4 -0
index 833a180..254abc4 100644
@@ -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)

meta/lib/oeqa/selftest/cases/pkgdata.py +2 -0
+        currpos = result.output.find('usage: oe-pkgdata-util')
+        self.assertTrue(currpos != -1, msg = "Test is Failed. Help is not

Displayed in %s" % result.output)
--
2.7.4