@@ -1,5 +1,6 @@
import os
import infra
+import subprocess
from infra.basetest import BRTest
@@ -57,3 +58,31 @@ class TestPy3BmapTools(TestBmapTools):
"""
BR2_PACKAGE_PYTHON3=y
"""
+
+
+class TestHostBmapTools(BRTest):
+ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+ """
+ BR2_PACKAGE_HOST_BMAP_TOOLS=y
+ # BR2_TARGET_ROOTFS_TAR is not set
+ BR2_TARGET_ROOTFS_EXT2=y
+ """
+
+ def test_run(self):
+ cmd = [os.path.join(self.b.builddir, "host", "bin", "bmaptool"),
+ "create",
+ "-o", os.path.join(self.b.builddir, "images", "rootfs.ext2.bmap"),
+ os.path.join(self.b.builddir, "images", "rootfs.ext2")]
+ ret = subprocess.call(cmd,
+ stdout=self.b.logfile,
+ stderr=self.b.logfile)
+ self.assertEqual(ret, 0)
+
+ cmd = [os.path.join(self.b.builddir, "host", "bin", "bmaptool"),
+ "copy",
+ os.path.join(self.b.builddir, "images", "rootfs.ext2"),
+ os.path.join(self.b.builddir, "images", "rootfs.ext2.copy")]
+ ret = subprocess.call(cmd,
+ stdout=self.b.logfile,
+ stderr=self.b.logfile)
+ self.assertEqual(ret, 0)
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> --- .../testing/tests/package/test_bmap_tools.py | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+)