From: Tom Rini <trini@konsulko.com>
To: Love Kumar <love.kumar@amd.com>
Cc: u-boot@lists.denx.de, michal.simek@amd.com, git@amd.com,
sjg@chromium.org
Subject: Re: [PATCH] test/py: mtd: Add tests for mtd command
Date: Tue, 26 May 2026 10:30:36 -0600 [thread overview]
Message-ID: <20260526163036.GZ1858239@bill-the-cat> (raw)
In-Reply-To: <20260526073749.89059-1-love.kumar@amd.com>
[-- Attachment #1: Type: text/plain, Size: 3020 bytes --]
On Tue, May 26, 2026 at 01:07:49PM +0530, Love Kumar wrote:
> Add test cases for mtd commands to verify list, erase, write, read
> and dump operations on NOR flash and binary-file data integrity.
> This test relies on boardenv_* configurations to run it for single or
> multiple MTD partitions.
>
> Signed-off-by: Love Kumar <love.kumar@amd.com>
> ---
> doc/develop/pytest/test_mtd.rst | 10 +
> test/py/tests/test_mtd.py | 648 ++++++++++++++++++++++++++++++++
> 2 files changed, 658 insertions(+)
> create mode 100644 doc/develop/pytest/test_mtd.rst
> create mode 100644 test/py/tests/test_mtd.py
Have you built the documentation and looked at it to make sure it
renders correctly? I ask because:
[snip]
> +"""
> +Note: This test relies on boardenv_* containing configuration values to
> +define one or more MTD partitions on which to exercise the 'mtd' U-Boot
> +command. The test reads env__mtd_partitions itself and loops over every
> +entry. Without this configuration the test is automatically skipped.
> +
> +It exercises the 'mtd' subcommands (list, erase, write, read, dump) and
> +a binary-file data integrity round-trip (tftp + write + read + cmp.b).
> +The suite works for single and stacked flash configurations. Partitions
> +whose detected MTD type is not 'NOR flash' are logged and skipped
> +per-partition.
> +
> +For Example:
> +
> +# List of MTD partitions to test. partition_name is the MTD partition
> +# name passed to every 'mtd' subcommand; flash_part_name is optional
> +# and, when set, is verified against 'SF: Detected <name>' lines in
> +# 'mtd list' output.
> +#
> +# partition_name - MTD partition name (required)
> +# flash_part_name - expected flash chip name (optional)
> +# expected_size - partition size in bytes (optional cross-check)
> +# expected_erasesize - erase-block size in bytes (optional cross-check)
> +# writeable - bool; if False only non-destructive tests run
> +# timeout - per-partition command timeout for long ops
> +env__mtd_partitions = [
> + {
> + 'partition_name': 'qspi-fsbl-uboot',
> + 'flash_part_name': 'mt25qu512a',
> + 'expected_size': 0x1000000,
> + 'expected_erasesize': 0x10000,
> + 'writeable': True,
> + },
> + {
> + 'partition_name': 'rootfs_b',
> + 'flash_part_name': 'mt25qu512a',
> + 'expected_size': 0x1000000,
> + 'writeable': True,
> + },
> + {
> + 'partition_name': 'rootfs_a-rootfs_c-concat',
> + 'flash_part_name': 'mt25qu512a',
> + 'expected_size': 0x6000000,
> + 'writeable': True,
> + },
> +]
I recall it being tricky to get this kind of markup to render correctly
and not produce a warning (which is fatal in CI) when doing some of the
other tests. It's possible, it's just a matter of indentation and some
other hinting to the tools that this is an example bit of code, in
essence. Thanks.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-05-26 16:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-26 7:37 [PATCH] test/py: mtd: Add tests for mtd command Love Kumar
2026-05-26 16:30 ` Tom Rini [this message]
2026-05-27 13:36 ` Heinrich Schuchardt
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=20260526163036.GZ1858239@bill-the-cat \
--to=trini@konsulko.com \
--cc=git@amd.com \
--cc=love.kumar@amd.com \
--cc=michal.simek@amd.com \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/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