mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v3 9/9] test: Add pytest suite for NVMEM framework
Date: Tue, 17 Jun 2025 10:03:08 +0200	[thread overview]
Message-ID: <aFEhPCJWVpRUVbqk@pengutronix.de> (raw)
In-Reply-To: <20250612065812.2025665-10-o.rempel@pengutronix.de>

On Thu, Jun 12, 2025 at 08:58:12AM +0200, Oleksij Rempel wrote:
> Introduce test_nvmem.py, a pytest-based suite for
> validating Barebox's NVMEM framework and shell commands.
> It uses pytest-labgrid for target interaction.
> 
> Tests cover:
> 
> - nvmem command: Listing, dynamic rmem creation (-c, -v), parameter
>   validation, help.
> 
> - CDEV operations (/dev/rmemX): md/mw for read/write with various access
>   sizes (byte, word, long), byte swapping (-x), string/numerical data,
>   and wrapped md output.
> 
> - Protection: protect/unprotect commands, including writes to
>   protected/unprotected areas, out-of-bounds protection attempts, and
> merging of overlapping protected ranges.
> 
> Includes helpers for parsing md output and checks command return
> codes and data integrity. A session-wide fixture skips tests if
> essential related CONFIGs are disabled.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  test/py/test_nvmem.py | 1012 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 1012 insertions(+)
>  create mode 100644 test/py/test_nvmem.py
> 
> diff --git a/test/py/test_nvmem.py b/test/py/test_nvmem.py
> new file mode 100644
> index 000000000000..fdb3c8eb6022
> --- /dev/null
> +++ b/test/py/test_nvmem.py
> @@ -0,0 +1,1012 @@
> +import pytest
> +import re
> +
> +# --- Essential Configuration Check ---
> +
> +# This list should contain the CONFIG strings for all commands and features
> +# that are absolutely essential for the NVMEM test suite to run.
> +ESSENTIAL_CONFIGS = [
> +    "CONFIG_CMD_NVMEM",       # For the 'nvmem' command itself
> +    "CONFIG_CMD_MD",          # For the 'md' (memory display) command
> +    "CONFIG_CMD_MW",          # For the 'mw' (memory write) command
> +    "CONFIG_CMD_FLASH",       # For 'protect' and 'unprotect' commands
> +    "CONFIG_NVMEM_RMEM",      # For creating dynamic rmem NVMEM devices
> +    "CONFIG_FS_DEVFS"         # For /dev/ device character file paths
> +]

There doesn't seem to be any config with this combination of options, so
I assume this test will never be executed.

Specifically CONFIG_CMD_NVMEM is disabled in all defconfigs. It's a good
thing for coverage to have at least one config with this option enabled,
could you add it to multi_v8_defconfig?

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



  reply	other threads:[~2025-06-17  8:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-12  6:58 [PATCH v3 0/9] NVMEM: Introduce write protection support Oleksij Rempel
2025-06-12  6:58 ` [PATCH v3 1/9] nvmem: Add 'protect' operation to core framework Oleksij Rempel
2025-06-12  6:58 ` [PATCH v3 2/9] nvmem: rmem: add write and protect support Oleksij Rempel
2025-06-12  6:58 ` [PATCH v3 3/9] commands: nvmem: Add support for creating dynamic rmem devices Oleksij Rempel
2025-06-12  6:58 ` [PATCH v3 4/9] regmap: Add reg_seal operation for hardware protection Oleksij Rempel
2025-06-12  6:58 ` [PATCH v3 5/9] nvmem: regmap: Implement protect operation using regmap_seal Oleksij Rempel
2025-06-12  6:58 ` [PATCH v3 6/9] nvmem: bsec: Implement NVMEM protect via regmap_seal for OTP locking Oleksij Rempel
2025-06-12  6:58 ` [PATCH v3 7/9] nvmem: rmem: ensure unique device name per instance Oleksij Rempel
2025-06-12  6:58 ` [PATCH v3 8/9] fs: Report errors for out-of-bounds protect operations Oleksij Rempel
2025-06-17  7:56   ` Sascha Hauer
2025-06-12  6:58 ` [PATCH v3 9/9] test: Add pytest suite for NVMEM framework Oleksij Rempel
2025-06-17  8:03   ` Sascha Hauer [this message]
2025-06-17  8:17     ` Oleksij Rempel
2025-06-17  8:04 ` (subset) [PATCH v3 0/9] NVMEM: Introduce write protection support Sascha Hauer

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=aFEhPCJWVpRUVbqk@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=o.rempel@pengutronix.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