Skip to contentSkip to conversation

oeqa/selftest/imagefeatures: add test for man-db

PATCH New Ross Burton 1 participant 1 message Mar 7, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 oeqa/selftest/imagefeatures: add test for man-db

Add a test to verify that manpages are built with api-documentation enabled, and apropos works on the target (so mandb has been ran).

---
 meta/lib/oeqa/selftest/cases/imagefeatures.py | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)
meta/lib/oeqa/selftest/cases/imagefeatures.py +22 -0
index af38150613b..bdd4d3200e2 100644
@@ -299,3 +299,25 @@ SKIP_RECIPE[busybox] = "Don't build this"
         result = glob.glob(images)
         with open(result[1],"r") as f:
                 self.assertEqual(len(f.read().strip()),0)
+
+    def test_mandb(self):
+        """
+        Test that an image containing manpages has working man and apropos commands.
+        """
+        config = """
+DISTRO_FEATURES:append = " api-documentation"
+CORE_IMAGE_EXTRA_INSTALL = "man-pages kmod-doc"
+"""
+        self.write_config(config)
+        bitbake("core-image-minimal")
+
+        with runqemu('core-image-minimal', ssh=False, runqemuparams='nographic') as qemu:
+            # This manpage is provided by man-pages
+            status, output = qemu.run_serial("apropos 8859")
+            self.assertEqual(status, 1, 'Failed to run apropos: %s' % (output))
+            self.assertIn("iso_8859_15", output)
+
+            # This manpage is provided by kmod
+            status, output = qemu.run_serial("man --pager=cat modprobe")
+            self.assertEqual(status, 1, 'Failed to run man: %s' % (output))
+            self.assertIn("force-modversion", output)
Signature · 1 line
2.34.1