From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Brandon Maier <brandon.maier@collins.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/4] support/testing: add mtd test
Date: Sat, 1 Jun 2024 21:36:53 +0200 [thread overview]
Message-ID: <Zlt4Vce7XMIE55Z6@landeda> (raw)
In-Reply-To: <20240529202425.469185-1-brandon.maier@collins.com>
Brandon, All,
On 2024-05-29 20:24 +0000, Brandon Maier via buildroot spake thusly:
> Signed-off-by: Brandon Maier <brandon.maier@collins.com>
I've dropped the BR2_ENABLE_LOCALE_WHITELIST seting, because it is not
needed.
Applied to master, thanks.
Regards,
Yann E. MORIN.
> ---
> support/testing/tests/package/test_mtd.py | 48 +++++++++++++++++++++++
> 1 file changed, 48 insertions(+)
> create mode 100644 support/testing/tests/package/test_mtd.py
>
> diff --git a/support/testing/tests/package/test_mtd.py b/support/testing/tests/package/test_mtd.py
> new file mode 100644
> index 0000000000..0871ab6457
> --- /dev/null
> +++ b/support/testing/tests/package/test_mtd.py
> @@ -0,0 +1,48 @@
> +import os
> +
> +import infra.basetest
> +
> +
> +class TestMtd(infra.basetest.BRTest):
> + config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
> + """
> + BR2_ENABLE_LOCALE_WHITELIST=""
> + BR2_PACKAGE_MTD=y
> + # BR2_TARGET_ROOTFS_TAR is not set
> + BR2_TARGET_ROOTFS_CPIO=y
> + """
> +
> + def test_run(self):
> + cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
> + self.emulator.boot(arch="armv7",
> + kernel="builtin",
> + options=["-initrd", cpio_file])
> +
> + self.emulator.login()
> +
> + mtd = "/dev/mtd0"
> + erasesize = 256 * 1024
> + test_sectors = 4
> + test_size = erasesize * test_sectors
> +
> + output, exit_code = self.emulator.run(f"mtd_debug info {mtd}")
> + output = [x.strip() for x in output if x.strip()]
> + self.assertEqual(output, [
> + "mtd.type = MTD_NORFLASH",
> + "mtd.flags = MTD_CAP_NORFLASH",
> + "mtd.size = 134217728 (128M)",
> + "mtd.erasesize = 262144 (256K)",
> + "mtd.writesize = 1",
> + "mtd.oobsize = 0",
> + "regions = 0",
> + ])
> +
> + # Test flashcp
> + self.assertRunOk(f"dd if=/dev/urandom of=random.bin bs={test_size} count=1")
> + self.assertRunOk(f"flashcp random.bin {mtd}")
> + self.assertRunOk(f"cmp -s -n {test_size} random.bin {mtd}")
> +
> + # Test flash_erase
> + self.assertRunOk(f"dd if=/dev/zero bs={test_size} count=1 | tr '\\000' '\\377' >nor-erase.bin")
> + self.assertRunOk(f"flash_erase {mtd} 0 {test_sectors}")
> + self.assertRunOk(f"cmp -s -n {test_size} nor-erase.bin {mtd}")
> --
> 2.45.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
next prev parent reply other threads:[~2024-06-01 19:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-29 20:24 [Buildroot] [PATCH 1/4] support/testing: add mtd test Brandon Maier via buildroot
2024-05-29 20:24 ` [Buildroot] [PATCH 2/4] package/mtd: switch to https mirror Brandon Maier via buildroot
2024-06-01 19:37 ` Yann E. MORIN
2024-06-08 16:56 ` Peter Korsgaard
2024-05-29 20:24 ` [Buildroot] [PATCH 3/4] package/mtd: bump to version 2.2.0 Brandon Maier via buildroot
2024-06-01 19:37 ` Yann E. MORIN
2024-05-29 20:24 ` [Buildroot] [PATCH 4/4] DEVELOPERS: add myself for package/mtd Brandon Maier via buildroot
2024-06-01 19:37 ` Yann E. MORIN
2024-06-08 16:56 ` Peter Korsgaard
2024-06-01 19:36 ` Yann E. MORIN [this message]
2024-06-08 16:56 ` [Buildroot] [PATCH 1/4] support/testing: add mtd test Peter Korsgaard
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=Zlt4Vce7XMIE55Z6@landeda \
--to=yann.morin.1998@free.fr \
--cc=brandon.maier@collins.com \
--cc=buildroot@buildroot.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.