[PATCH 2/3] test: py: test mount/unmount of pstore file system

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Jun 23 01:37:39 PDT 2025


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 at 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 |




More information about the barebox mailing list