diff mbox series

[v3,01/10] tst_test.sh: Fix tst_mkfs() for tmpfs

Message ID 20220804121946.19564-2-pvorel@suse.cz
State Accepted
Headers show
Series [v3,01/10] tst_test.sh: Fix tst_mkfs() for tmpfs | expand

Commit Message

Petr Vorel Aug. 4, 2022, 12:19 p.m. UTC
+ add test for it.

This has been broken since ever, but get more problematic when
$TST_FORMAT_DEVICE got introduced.

Fixes: 7783ac3a0 ("lib/tst_test.sh: Add new shell library")
Fixes: 95734791c ("tst_test.sh: Add $TST_FORMAT_DEVICE and related vars")

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
New in v3

 lib/newlib_tests/shell/tst_mount_device_tmpfs.sh | 15 +++++++++++++++
 testcases/lib/tst_test.sh                        |  5 +++++
 2 files changed, 20 insertions(+)
 create mode 100755 lib/newlib_tests/shell/tst_mount_device_tmpfs.sh

Comments

Richard Palethorpe Sept. 2, 2022, 9:18 a.m. UTC | #1
Hello,

No response and seems reasonable, please merge!

Acked-by: Richard Palethorpe <rpalethorpe@suse.com>

Petr Vorel <pvorel@suse.cz> writes:

> + add test for it.
>
> This has been broken since ever, but get more problematic when
> $TST_FORMAT_DEVICE got introduced.
>
> Fixes: 7783ac3a0 ("lib/tst_test.sh: Add new shell library")
> Fixes: 95734791c ("tst_test.sh: Add $TST_FORMAT_DEVICE and related vars")
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> New in v3
>
>  lib/newlib_tests/shell/tst_mount_device_tmpfs.sh | 15 +++++++++++++++
>  testcases/lib/tst_test.sh                        |  5 +++++
>  2 files changed, 20 insertions(+)
>  create mode 100755 lib/newlib_tests/shell/tst_mount_device_tmpfs.sh
>
> diff --git a/lib/newlib_tests/shell/tst_mount_device_tmpfs.sh b/lib/newlib_tests/shell/tst_mount_device_tmpfs.sh
> new file mode 100755
> index 000000000..36a78bc85
> --- /dev/null
> +++ b/lib/newlib_tests/shell/tst_mount_device_tmpfs.sh
> @@ -0,0 +1,15 @@
> +#!/bin/sh
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +# Copyright (c) 2022 Petr Vorel <pvorel@suse.cz>
> +
> +TST_MOUNT_DEVICE=1
> +TST_FS_TYPE=tmpfs
> +TST_TESTFUNC=test
> +
> +test()
> +{
> +	EXPECT_PASS "cd $TST_MNTPOINT"
> +}
> +
> +. tst_test.sh
> +tst_run
> diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
> index a35fa2e7b..b7cf5f3d4 100644
> --- a/testcases/lib/tst_test.sh
> +++ b/testcases/lib/tst_test.sh
> @@ -351,6 +351,11 @@ tst_mkfs()
>  
>  	opts="$@"
>  
> +	if [ "$fs_type" = tmpfs ]; then
> +		tst_res TINFO "Skipping mkfs for TMPFS filesystem"
> +		return
> +	fi
> +
>  	if [ -z "$opts" ]; then
>  		if [ "$TST_NEEDS_DEVICE" != 1 ]; then
>  			tst_brk "Using default parameters in tst_mkfs requires TST_NEEDS_DEVICE=1"
> -- 
> 2.37.1
Petr Vorel Sept. 2, 2022, 9:34 a.m. UTC | #2
Hi Richie,

> Hello,

> No response and seems reasonable, please merge!

> Acked-by: Richard Palethorpe <rpalethorpe@suse.com>
Thanks a lot for your review! I suppose you mean your ack for whole patchset.

If yes, I'll merge all but the last RFC commit which needs more work (i.e.
TST_ALL_FILESYSTEMS infrastructure although nothing uses it yet).

Merging would help me not having to rebase this work after finishing and get
merged "Track minimal size per filesystem" [1] (originally I thought that one
would go first, but TST_ALL_FILESYSTEMS infrastructure is ready now).

I also plan to convert df01.sh and mkfs01.sh to TST_ALL_FILESYSTEMS.

Kind regards,
Petr

[1] https://patchwork.ozlabs.org/project/ltp/list/?series=315621
Richard Palethorpe Sept. 2, 2022, 9:44 a.m. UTC | #3
Hi,

Petr Vorel <pvorel@suse.cz> writes:

> Hi Richie,
>
>> Hello,
>
>> No response and seems reasonable, please merge!
>
>> Acked-by: Richard Palethorpe <rpalethorpe@suse.com>
> Thanks a lot for your review! I suppose you mean your ack for whole patchset.
>
> If yes, I'll merge all but the last RFC commit which needs more work (i.e.
> TST_ALL_FILESYSTEMS infrastructure although nothing uses it yet).
>
> Merging would help me not having to rebase this work after finishing and get
> merged "Track minimal size per filesystem" [1] (originally I thought that one
> would go first, but TST_ALL_FILESYSTEMS infrastructure is ready now).
>
> I also plan to convert df01.sh and mkfs01.sh to TST_ALL_FILESYSTEMS.
>
> Kind regards,
> Petr
>
> [1] https://patchwork.ozlabs.org/project/ltp/list/?series=315621

OK, I have acked everything that didn't already have a review tag. It
would help to include some test conversions in the patch set, but I
trust you will follow up with df01.sh and mkfs01.sh ;-)
Petr Vorel Sept. 2, 2022, 10:22 a.m. UTC | #4
> Petr Vorel <pvorel@suse.cz> writes:

> > Hi Richie,

> >> Hello,

> >> No response and seems reasonable, please merge!

> >> Acked-by: Richard Palethorpe <rpalethorpe@suse.com>
> > Thanks a lot for your review! I suppose you mean your ack for whole patchset.

> > If yes, I'll merge all but the last RFC commit which needs more work (i.e.
> > TST_ALL_FILESYSTEMS infrastructure although nothing uses it yet).

> > Merging would help me not having to rebase this work after finishing and get
> > merged "Track minimal size per filesystem" [1] (originally I thought that one
> > would go first, but TST_ALL_FILESYSTEMS infrastructure is ready now).

> > I also plan to convert df01.sh and mkfs01.sh to TST_ALL_FILESYSTEMS.

> > Kind regards,
> > Petr

> > [1] https://patchwork.ozlabs.org/project/ltp/list/?series=315621

> OK, I have acked everything that didn't already have a review tag. It
> would help to include some test conversions in the patch set, but I
> trust you will follow up with df01.sh and mkfs01.sh ;-)

Thanks! As I found that there is tiny issue in TST_ALL_FILESYSTEMS
implementation (there should be equivalent of tst_device->fs_type)
I've merged patches up to "[v3,04/10] tst_mount_device.sh: Cover early
tst_umount call" and send v4 with fixed this version and converted at least one
of df01.sh and mkfs01.sh. Then I base "Track minimal size per filesystem"
patchset on this work (suppose this patchet will be quickly re-reviewed).

Kind regards,
Petr
diff mbox series

Patch

diff --git a/lib/newlib_tests/shell/tst_mount_device_tmpfs.sh b/lib/newlib_tests/shell/tst_mount_device_tmpfs.sh
new file mode 100755
index 000000000..36a78bc85
--- /dev/null
+++ b/lib/newlib_tests/shell/tst_mount_device_tmpfs.sh
@@ -0,0 +1,15 @@ 
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2022 Petr Vorel <pvorel@suse.cz>
+
+TST_MOUNT_DEVICE=1
+TST_FS_TYPE=tmpfs
+TST_TESTFUNC=test
+
+test()
+{
+	EXPECT_PASS "cd $TST_MNTPOINT"
+}
+
+. tst_test.sh
+tst_run
diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index a35fa2e7b..b7cf5f3d4 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -351,6 +351,11 @@  tst_mkfs()
 
 	opts="$@"
 
+	if [ "$fs_type" = tmpfs ]; then
+		tst_res TINFO "Skipping mkfs for TMPFS filesystem"
+		return
+	fi
+
 	if [ -z "$opts" ]; then
 		if [ "$TST_NEEDS_DEVICE" != 1 ]; then
 			tst_brk "Using default parameters in tst_mkfs requires TST_NEEDS_DEVICE=1"