Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v6 5/5] support/testing/tests/package/test_bmap_tools: add test for host bmap-tools
Date: Fri, 25 Jun 2021 14:38:11 +0200	[thread overview]
Message-ID: <20210625123811.GF104638@scaer> (raw)
In-Reply-To: <20210621210111.363433-6-thomas.petazzoni@bootlin.com>

Thomas, All,

On 2021-06-21 23:01 +0200, Thomas Petazzoni spake thusly:
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
>  .../testing/tests/package/test_bmap_tools.py  | 29 +++++++++++++++++++
>  1 file changed, 29 insertions(+)
> 
> diff --git a/support/testing/tests/package/test_bmap_tools.py b/support/testing/tests/package/test_bmap_tools.py
> index e8802fc057..a0f8d5c2ad 100644
> --- a/support/testing/tests/package/test_bmap_tools.py
> +++ b/support/testing/tests/package/test_bmap_tools.py
> @@ -1,5 +1,6 @@
>  import os
>  import infra
> +import subprocess
>  
>  from infra.basetest import BRTest
>  
> @@ -59,3 +60,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)

Again, it is sad that the copy is not cehcked to be identical to the
original, so I added a basic test that reads the two files, and compare
their content. Not opitimised, very crude, but we don;t care much for a
~64MiB image file

Applied to master, thanks.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

      reply	other threads:[~2021-06-25 12:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-21 21:01 [Buildroot] [PATCH v6 0/5] Introduce bmap-tools as target + host package Thomas Petazzoni
2021-06-21 21:01 ` [Buildroot] [PATCH v6 1/5] package/bmap-tools: new package Thomas Petazzoni
2021-06-25 12:35   ` Yann E. MORIN
2021-06-25 12:45     ` Thomas Petazzoni
2021-06-25 12:54       ` Yann E. MORIN
2021-06-25 13:57         ` Thomas Petazzoni
2021-06-21 21:01 ` [Buildroot] [PATCH v6 2/5] package/bmap-tools: enable host package Thomas Petazzoni
2021-06-25 12:35   ` Yann E. MORIN
2021-06-21 21:01 ` [Buildroot] [PATCH v6 3/5] support/testing/infra/emulator.py: update pre-built kernels Thomas Petazzoni
2021-06-25 12:35   ` Yann E. MORIN
2021-06-26 20:07   ` Yann E. MORIN
2021-06-21 21:01 ` [Buildroot] [PATCH v6 4/5] support/testing/tests/package/test_bmap_tools: new test Thomas Petazzoni
2021-06-25 12:36   ` Yann E. MORIN
2021-06-25 12:46     ` Thomas Petazzoni
2021-06-21 21:01 ` [Buildroot] [PATCH v6 5/5] support/testing/tests/package/test_bmap_tools: add test for host bmap-tools Thomas Petazzoni
2021-06-25 12:38   ` Yann E. MORIN [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210625123811.GF104638@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox