Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Linus Kaschulla <linus@cosmos-ink.net>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] fs/squashfs: needs more test cases
Date: Tue, 17 May 2022 22:40:27 +0200	[thread overview]
Message-ID: <20220517204027.GS1597494@scaer> (raw)
In-Reply-To: <20220517141938.3395-1-linus@cosmos-ink.net>

Linus, All,

On 2022-05-17 14:19 +0000, Linus Kaschulla via buildroot spake thusly:
> For the new patch, adding block size options (commit 555f8dfd),
> Yann E. MORIN requested updated testcases that specifically ensure
> the extreme blocksizes (4K and 1024K) don't cause issues.
> 
> This patch splits the current test case in 2, testing with both
> block sizes and ensuring the block size was applied in the same
> fashion as for the specified compression.
> 
> Signed-off-by: Linus Kaschulla <linus@cosmos-ink.net>
> ---
>  support/testing/tests/fs/test_squashfs.py | 17 ++++++++++++++++-
>  1 file changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/support/testing/tests/fs/test_squashfs.py b/support/testing/tests/fs/test_squashfs.py
> index a914f5aac7..07239fcce2 100644
> --- a/support/testing/tests/fs/test_squashfs.py
> +++ b/support/testing/tests/fs/test_squashfs.py
> @@ -3,13 +3,15 @@ import os
>  import infra.basetest
>  
>  
> -class TestSquashfs(infra.basetest.BRTest):
> +class TestSquashfsMinBlocksize(infra.basetest.BRTest):

In fact I think we need to keep the existing test that uses the default
value too.

>      config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
>          """
>          BR2_TARGET_ROOTFS_SQUASHFS=y
> +        BR2_TARGET_ROOTFS_SQUASHFS_BS_4K=y
>          BR2_TARGET_ROOTFS_SQUASHFS4_LZO=y
>          # BR2_TARGET_ROOTFS_TAR is not set
>          """
> +    expected_blocksize_in_bytes = 1024 * 4
>  
>      def test_run(self):
>          unsquashfs_cmd = ["host/bin/unsquashfs", "-s", "images/rootfs.squashfs"]
> @@ -18,6 +20,7 @@ class TestSquashfs(infra.basetest.BRTest):
>          self.assertEqual(out[0],
>                           "Found a valid SQUASHFS 4:0 superblock on images/rootfs.squashfs.")
>          self.assertEqual(out[3], "Compression lzo")
> +        self.assertEqual(out[4], "Block size {}".format(self.expected_blocksize_in_bytes))
>  
>          img = os.path.join(self.builddir, "images", "rootfs.squashfs")
>          infra.img_round_power2(img)
> @@ -31,3 +34,15 @@ class TestSquashfs(infra.basetest.BRTest):
>  
>          cmd = "mount | grep '/dev/root on / type squashfs'"
>          self.assertRunOk(cmd)
> +

    $ make check-flake8
    WARNING: support/testing/tests/fs/test_squashfs.py:40:1: E302 expected 2 blank lines, found 1

Yes, like check-package, this is 100% totally undocumented. :-]

So, I've restored the original test that checks the default, and two new
tersts that check the min and max, and I fixed the flake8 issue.

Applied to master, thanks.

Regards,
Yann E. MORIN.

> +# Reusing TestSquashfsMinBlocksize's test_run(), but change
> +# blocksize in config the maxium to ensure all extemes work.
> +class TestSquashfsMaxBlocksize(TestSquashfsMinBlocksize):
> +    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
> +        """
> +        BR2_TARGET_ROOTFS_SQUASHFS=y
> +        BR2_TARGET_ROOTFS_SQUASHFS_BS_1024K=y
> +        BR2_TARGET_ROOTFS_SQUASHFS4_LZO=y
> +        # BR2_TARGET_ROOTFS_TAR is not set
> +        """
> +    expected_blocksize_in_bytes = 1024 * 1024
> -- 
> 2.35.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-05-17 20:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17 14:19 [Buildroot] [PATCH 1/1] fs/squashfs: needs more test cases Linus Kaschulla via buildroot
2022-05-17 20:40 ` Yann E. MORIN [this message]
2022-05-17 20:56   ` Linus via buildroot
2022-05-17 21:04     ` Yann E. MORIN
2022-05-17 21:08       ` Linus via buildroot

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=20220517204027.GS1597494@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=linus@cosmos-ink.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