* [LTP] [PATCH 1/1] zram01.sh: Rewrite to run by single filesystem
@ 2026-11-06 16:41 Petr Vorel
2026-11-06 18:35 ` [LTP] " linuxtestproject.agent
2026-11-09 12:09 ` [LTP] [PATCH 1/1] " Cyril Hrubis
0 siblings, 2 replies; 5+ messages in thread
From: Petr Vorel @ 2026-11-06 16:41 UTC (permalink / raw)
To: ltp
That allows:
1) test only particular filesystem
2) easily identify which filesystem is slow or fails
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
runtest/kernel_misc | 9 +++
.../kernel/device-drivers/zram/zram01.sh | 75 +++++++++++--------
2 files changed, 54 insertions(+), 30 deletions(-)
diff --git a/runtest/kernel_misc b/runtest/kernel_misc
index ac14f633e2..05ec709422 100644
--- a/runtest/kernel_misc
+++ b/runtest/kernel_misc
@@ -13,6 +13,15 @@ uaccess uaccess
rcu_torture rcu_torture.sh
lock_torture lock_torture.sh
zram01 zram01.sh
+zram01_ext2 zram01.sh -f ext2
+zram01_ext3 zram01.sh -f ext3
+zram01_ext4 zram01.sh -f ext4
+zram01_xfs zram01.sh -f xfs
+zram01_btrfs zram01.sh -f btrfs
+zram01_bcachefs zram01.sh -f bcachefs
+zram01_vfat zram01.sh -f vfat
+zram01_exfat zram01.sh -f exfat
+zram01_ntfs zram01.sh -f ntfs
zram02 zram02.sh
zram03 zram03
umip_basic_test umip_basic_test
diff --git a/testcases/kernel/device-drivers/zram/zram01.sh b/testcases/kernel/device-drivers/zram/zram01.sh
index 4b7f2a753f..3c3e0eec0b 100755
--- a/testcases/kernel/device-drivers/zram/zram01.sh
+++ b/testcases/kernel/device-drivers/zram/zram01.sh
@@ -1,15 +1,34 @@
#!/bin/sh
# Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
-# Copyright (c) 2019-2022 Petr Vorel <pvorel@suse.cz>
+# Copyright (c) 2019-2026 Petr Vorel <pvorel@suse.cz>
# Author: Alexey Kodanev <alexey.kodanev@oracle.com>
#
-# Test creates several zram devices with different filesystems on them.
-# It fills each device with zeros and checks that compression works.
+# Test creates zram device with a filesystem on it.
+# It fills the device with zeros and checks that compression works.
TST_CNT=7
TST_TESTFUNC="do_test"
TST_NEEDS_CMDS="awk bc dd"
TST_SETUP="setup"
+TST_OPTS="f:"
+TST_USAGE="usage"
+TST_PARSE_ARGS="parse_args"
+
+usage()
+{
+ cat << EOF
+usage: $0 [-f <ext2|ext3|ext4|xfs|btrfs|...>]
+
+OPTIONS
+-f Specify the filesystem to be tested. If not specified,
+ \$LTP_DEV_FS_TYPE or ext2 is used.
+EOF
+}
+
+parse_args()
+{
+ TST_FS_TYPE="$2"
+}
check_space_for_fs()
{
@@ -18,14 +37,11 @@ check_space_for_fs()
ram_size=$(awk '/MemTotal:/ {print $2}' /proc/meminfo)
if [ "$ram_size" -lt 1048576 ]; then
- tst_res TINFO "not enough space for $fs"
- return 1
+ tst_brk TCONF "not enough space for $fs"
fi
- return 0
}
-# List of parameters for zram devices.
-# For each number the test creates own zram device.
+# Parameters for zram device.
# NOTE about size:
# The zram sysfs node 'disksize' value can be either in bytes,
# or you can use mem suffixes. But in some old kernels, mem
@@ -36,34 +52,33 @@ check_space_for_fs()
# bytes to make sure everything works correctly.
initialize_vars()
{
- local fs limit size stream=-1
- dev_num=0
+ local fs="${TST_FS_TYPE:-${LTP_DEV_FS_TYPE:-ext2}}"
+ local size="26214400"
+ local limit="25M"
- for fs in $(tst_supported_fs -s tmpfs); do
- size="26214400"
- limit="25M"
+ [ "$fs" = "tmpfs" ] && tst_brk TCONF "tmpfs is not supported"
- if [ "$fs" = "btrfs" -o "$fs" = "xfs" ]; then
- check_space_for_fs "$fs" || continue
+ tst_supported_fs "$fs" || \
+ tst_brk TCONF "filesystem $fs is not supported"
- if [ "$fs" = "btrfs" ]; then
- size="402653184"
- elif [ "$fs" = "xfs" ]; then
- size=314572800
- fi
- limit="$((size/1024/1024))M"
+ if [ "$fs" = "btrfs" -o "$fs" = "xfs" ]; then
+ check_space_for_fs "$fs"
+
+ if [ "$fs" = "btrfs" ]; then
+ size="402653184"
+ elif [ "$fs" = "xfs" ]; then
+ size=314572800
fi
+ limit="$((size/1024/1024))M"
+ fi
- stream=$((stream+3))
- dev_num=$((dev_num+1))
- zram_filesystems="$zram_filesystems $fs"
- zram_mem_limits="$zram_mem_limits $limit"
- zram_sizes="$zram_sizes $size"
- zram_max_streams="$zram_max_streams $stream"
- done
+ tst_res TINFO "testing $fs filesystem"
- [ $dev_num -eq 0 ] && \
- tst_brk TCONF "no suitable filesystem"
+ dev_num=1
+ zram_filesystems="$fs"
+ zram_mem_limits="$limit"
+ zram_sizes="$size"
+ zram_max_streams="2"
}
setup()
--
2.56.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [LTP] zram01.sh: Rewrite to run by single filesystem
2026-11-06 16:41 [LTP] [PATCH 1/1] zram01.sh: Rewrite to run by single filesystem Petr Vorel
@ 2026-11-06 18:35 ` linuxtestproject.agent
2026-11-09 12:09 ` [LTP] [PATCH 1/1] " Cyril Hrubis
1 sibling, 0 replies; 5+ messages in thread
From: linuxtestproject.agent @ 2026-11-06 18:35 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hi Petr,
On 2026-11-06, Petr Vorel <pvorel@suse.cz> wrote:
> zram01.sh: Rewrite to run by single filesystem
Verdict - Reviewed
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH 1/1] zram01.sh: Rewrite to run by single filesystem
2026-11-06 16:41 [LTP] [PATCH 1/1] zram01.sh: Rewrite to run by single filesystem Petr Vorel
2026-11-06 18:35 ` [LTP] " linuxtestproject.agent
@ 2026-11-09 12:09 ` Cyril Hrubis
2026-11-09 13:12 ` Petr Vorel
1 sibling, 1 reply; 5+ messages in thread
From: Cyril Hrubis @ 2026-11-09 12:09 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hi!
> 1) test only particular filesystem
> 2) easily identify which filesystem is slow or fails
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> runtest/kernel_misc | 9 +++
> .../kernel/device-drivers/zram/zram01.sh | 75 +++++++++++--------
> 2 files changed, 54 insertions(+), 30 deletions(-)
>
> diff --git a/runtest/kernel_misc b/runtest/kernel_misc
> index ac14f633e2..05ec709422 100644
> --- a/runtest/kernel_misc
> +++ b/runtest/kernel_misc
> @@ -13,6 +13,15 @@ uaccess uaccess
> rcu_torture rcu_torture.sh
> lock_torture lock_torture.sh
> zram01 zram01.sh
> +zram01_ext2 zram01.sh -f ext2
> +zram01_ext3 zram01.sh -f ext3
> +zram01_ext4 zram01.sh -f ext4
> +zram01_xfs zram01.sh -f xfs
> +zram01_btrfs zram01.sh -f btrfs
> +zram01_bcachefs zram01.sh -f bcachefs
> +zram01_vfat zram01.sh -f vfat
> +zram01_exfat zram01.sh -f exfat
> +zram01_ntfs zram01.sh -f ntfs
I do not like this. With this we have to maintain the list of the
filesystems manually in the runtest file. What is the exact problem you
are trying to fix?
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH 1/1] zram01.sh: Rewrite to run by single filesystem
2026-11-09 12:09 ` [LTP] [PATCH 1/1] " Cyril Hrubis
@ 2026-11-09 13:12 ` Petr Vorel
2026-11-09 19:39 ` Petr Vorel
0 siblings, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2026-11-09 13:12 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
> Hi!
> > 1) test only particular filesystem
> > 2) easily identify which filesystem is slow or fails
> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> > runtest/kernel_misc | 9 +++
> > .../kernel/device-drivers/zram/zram01.sh | 75 +++++++++++--------
> > 2 files changed, 54 insertions(+), 30 deletions(-)
> > diff --git a/runtest/kernel_misc b/runtest/kernel_misc
> > index ac14f633e2..05ec709422 100644
> > --- a/runtest/kernel_misc
> > +++ b/runtest/kernel_misc
> > @@ -13,6 +13,15 @@ uaccess uaccess
> > rcu_torture rcu_torture.sh
> > lock_torture lock_torture.sh
> > zram01 zram01.sh
> > +zram01_ext2 zram01.sh -f ext2
> > +zram01_ext3 zram01.sh -f ext3
> > +zram01_ext4 zram01.sh -f ext4
> > +zram01_xfs zram01.sh -f xfs
> > +zram01_btrfs zram01.sh -f btrfs
> > +zram01_bcachefs zram01.sh -f bcachefs
> > +zram01_vfat zram01.sh -f vfat
> > +zram01_exfat zram01.sh -f exfat
> > +zram01_ntfs zram01.sh -f ntfs
> I do not like this. With this we have to maintain the list of the
> filesystems manually in the runtest file. What is the exact problem you
> are trying to fix?
FYI we use this approach also on mkfs01.sh (it was not transformed to use
TST_ALL_FILESYSTEMS).
I'm sorry to not explain it properly. zram01.sh sometimes timeouts on slower
worker (I need to dig further as increasing timeout did not help) and it's not from
the first view obvious what is wrong. One can debug with
LTP_FORCE_SINGLE_FS_TYPE or LTP_SINGLE_FS_TYPE, but it's not that easy to filter
out filesystem one is not interested in (which would be with this one). But ok,
that's general problem of .all_filesystems = 1 approach anyway.
I'll first debug with a custom code using LTP_FORCE_SINGLE_FS_TYPE.
Also rewrite the test to use TST_ALL_FILESYSTEMS would probably help to more
easily see which filesystem is tested (and maybe even with better timeout
handling).
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-11-09 19:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-06 16:41 [LTP] [PATCH 1/1] zram01.sh: Rewrite to run by single filesystem Petr Vorel
2026-11-06 18:35 ` [LTP] " linuxtestproject.agent
2026-11-09 12:09 ` [LTP] [PATCH 1/1] " Cyril Hrubis
2026-11-09 13:12 ` Petr Vorel
2026-11-09 19:39 ` Petr Vorel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.