mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@barebox.org>, barebox@lists.infradead.org
Subject: Re: [PATCH 2/3] test: py: test mount/unmount of pstore file system
Date: Mon, 23 Jun 2025 10:37:39 +0200	[thread overview]
Message-ID: <0354f477-bcf0-4feb-b838-8a49b53428d0@pengutronix.de> (raw)
In-Reply-To: <20250623062641.3529615-3-a.fatoum@barebox.org>

Hi,

On 6/23/25 08:26, Ahmad Fatoum wrote:
> The file system internals were recently touched to enable easier porting
> of the 9P file system. This led to regressions[1][2] that broke
> unmounting a volumes.

I pivoted from testing with pstore to ramfs as I needed to create a
file. Sascha, could you s/pstore/ramfs/ in the commit message title?

Thanks,
Ahmad

> 
> Add a simple regression test that would have caught the two described
> issues.
> 
> [1]: a3ef153fdf26 ("fs: unreference path on file close")
> [2]: aef3b0134519 ("fs: unreference path in canonicalize_path()")
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
> ---
>  arch/arm/configs/multi_v5_v6_defconfig |  1 +
>  arch/arm/configs/multi_v7_defconfig    |  1 +
>  arch/arm/configs/multi_v8_defconfig    |  1 +
>  test/py/test_mount.py                  | 21 +++++++++++++++++++++
>  4 files changed, 24 insertions(+)
>  create mode 100644 test/py/test_mount.py
> 
> diff --git a/arch/arm/configs/multi_v5_v6_defconfig b/arch/arm/configs/multi_v5_v6_defconfig
> index 2afc072e129c..91d3a63e85ab 100644
> --- a/arch/arm/configs/multi_v5_v6_defconfig
> +++ b/arch/arm/configs/multi_v5_v6_defconfig
> @@ -38,6 +38,7 @@ CONFIG_CMD_GO=y
>  CONFIG_CMD_RESET=y
>  CONFIG_CMD_UIMAGE=y
>  CONFIG_CMD_PARTITION=y
> +CONFIG_CMD_FINDMNT=y
>  CONFIG_CMD_UBIFORMAT=y
>  CONFIG_CMD_EXPORT=y
>  CONFIG_CMD_LOADENV=y
> diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
> index 4fb696a10626..726afe8ce6c5 100644
> --- a/arch/arm/configs/multi_v7_defconfig
> +++ b/arch/arm/configs/multi_v7_defconfig
> @@ -143,6 +143,7 @@ CONFIG_CMD_RESET=y
>  CONFIG_CMD_UIMAGE=y
>  CONFIG_CMD_BOOTCHOOSER=y
>  CONFIG_CMD_PARTITION=y
> +CONFIG_CMD_FINDMNT=y
>  CONFIG_CMD_UBIFORMAT=y
>  CONFIG_CMD_EXPORT=y
>  CONFIG_CMD_DEFAULTENV=y
> diff --git a/arch/arm/configs/multi_v8_defconfig b/arch/arm/configs/multi_v8_defconfig
> index 3d3f3254df20..a487d331d04e 100644
> --- a/arch/arm/configs/multi_v8_defconfig
> +++ b/arch/arm/configs/multi_v8_defconfig
> @@ -89,6 +89,7 @@ CONFIG_CMD_RESET=y
>  CONFIG_CMD_UIMAGE=y
>  CONFIG_CMD_BOOTCHOOSER=y
>  CONFIG_CMD_PARTITION=y
> +CONFIG_CMD_FINDMNT=y
>  CONFIG_CMD_EXPORT=y
>  CONFIG_CMD_DEFAULTENV=y
>  CONFIG_CMD_LOADENV=y
> diff --git a/test/py/test_mount.py b/test/py/test_mount.py
> new file mode 100644
> index 000000000000..33608a3b6ddb
> --- /dev/null
> +++ b/test/py/test_mount.py
> @@ -0,0 +1,21 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +
> +from .helper import skip_disabled
> +
> +
> +def test_findmnt_umount(barebox, barebox_config):
> +    skip_disabled(barebox_config, "CONFIG_CMD_FINDMNT")
> +
> +    barebox.run_check("mount -t ramfs none /tmp")
> +    findmnt_out1 = barebox.run_check("findmnt /tmp")
> +    barebox.run_check("umount /tmp")
> +
> +    assert len(findmnt_out1) == 2
> +
> +
> +def test_echo_umount(barebox):
> +    barebox.run_check("mount -t ramfs none /tmp")
> +    barebox.run_check("echo -o /tmp/file test")
> +    barebox.run_check("umount /tmp")
> +
> +    # Nothing to assert, we are happy if this is reached without exception

-- 
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-23  8:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-23  6:26 [PATCH 0/3] test: test recent regressions/features Ahmad Fatoum
2025-06-23  6:26 ` [PATCH 1/3] test: self: idr: add test for idr_remove in idr_for_each_entry Ahmad Fatoum
2025-06-23  6:26 ` [PATCH 2/3] test: py: test mount/unmount of pstore file system Ahmad Fatoum
2025-06-23  8:37   ` Ahmad Fatoum [this message]
2025-06-23  9:26     ` Sascha Hauer
2025-06-23  6:26 ` [PATCH 3/3] test: py: add bootchooser attempt decrement and locking test Ahmad Fatoum
2025-06-23  8:35 ` [PATCH 0/3] test: test recent regressions/features 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=0354f477-bcf0-4feb-b838-8a49b53428d0@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=a.fatoum@barebox.org \
    --cc=barebox@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox