From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 3/5] zram01.sh: Check properly mkfs.* dependencies
Date: Fri, 29 Jan 2021 17:11:00 +0100 [thread overview]
Message-ID: <YBQzlEoPLUAT3NFi@yuki.lan> (raw)
In-Reply-To: <20210129121817.12563-4-pvorel@suse.cz>
Hi!
> +check_fs_support()
> +{
> + local fs unsupported
> + local msg="missing kernel support or mkfs for filesystems:"
> + dev_num=0
> +
> + for fs in $zram_filesystems; do
> + if tst_supported_fs $fs 2> /dev/null; then
Why are we silencing the output here?
> + dev_num=$((dev_num+1))
> + else
> + unsupported="$unsupported $fs"
> + fi
> + done
Maybe we should put the Btrfs space check here as well, so that all
checks are in a single place.
> + if [ $dev_num -eq 0 -a "$fallback_filesystem" != "$FS_TYPE" ]; then
> + if tst_supported_fs $fallback_filesystem 2> /dev/null; then
> + dev_num=1
> + fi
> + fi
> +
> + if [ $dev_num -eq 0 ]; then
> + tst_res TINFO "filesystems on the system"
> + tst_supported_fs > /dev/null
And producing different output here.
> + msg="$msg $zram_filesystems"
> + if [ "$fallback_filesystem" != "$FS_TYPE" ]; then
> + msg="$msg $fallback_filesystem"
> + fi
> + tst_brk TCONF "$msg"
> + fi
> +
> + [ "$unsupported" ] && tst_res TINFO "$msg$unsupported"
And here.
I guess that we end up with a bit nicer output but the code is much more
complex.
Also I'm confused how this is supposed to work, we do limit the dev_num
but the zram_filesystems is untouched? That isn't going to work right.
I guess the best shoot would be generating the zram_filesystems here on
the fly based on output of the tst_supported_fs.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2021-01-29 16:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-29 12:18 [LTP] [PATCH 0/5] zram cleanup Petr Vorel
2021-01-29 12:18 ` [LTP] [PATCH 1/5] zram: Require root Petr Vorel
2021-01-29 14:09 ` Cyril Hrubis
2021-01-29 15:40 ` Petr Vorel
2021-01-29 12:18 ` [LTP] [PATCH 2/5] zram: Calculate dev_num variable Petr Vorel
2021-01-29 14:17 ` Cyril Hrubis
2021-01-29 12:18 ` [LTP] [PATCH 3/5] zram01.sh: Check properly mkfs.* dependencies Petr Vorel
2021-01-29 16:11 ` Cyril Hrubis [this message]
2021-01-29 17:59 ` Petr Vorel
2021-01-29 18:34 ` Cyril Hrubis
2021-01-29 19:21 ` Petr Vorel
2021-01-29 12:18 ` [LTP] [PATCH 4/5] zram: Move zram_compress_alg() to zram02.sh Petr Vorel
2021-01-29 12:18 ` [LTP] [PATCH 5/5] zram: Move test specific functions out of zram_lib.sh Petr Vorel
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=YBQzlEoPLUAT3NFi@yuki.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/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 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.