From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: Marcos Paulo de Souza <mpdesouza@suse.de>,
Marcos Paulo de Souza <marcos.souza.org@gmail.com>,
dsterba@suse.com, linux-btrfs@vger.kernel.org,
Marcos Paulo de Souza <mpdesouza@suse.com>,
wqu@suse.com
Subject: Re: [btrfs-progs PATCH 4/4] tests: Do not fail is dmsetup is missing
Date: Wed, 18 Dec 2019 17:03:50 +0100 [thread overview]
Message-ID: <20191218160350.GL3929@suse.cz> (raw)
In-Reply-To: <a880c99c-982d-135c-4e6e-e82c19e681c1@gmx.com>
On Wed, Dec 18, 2019 at 08:48:21AM +0800, Qu Wenruo wrote:
> >>> +# check if dmsetup and targets passed as arguments are available,
> >> and skip the
> >>> +# test if they aren't.
> >>> check_dm_target_support()
> >>> {
> >>> + which dmsetup &> /dev/null
> >>> + if [ $? -ne 0 ]; then
> >>> + _not_run "This test requires dmsetup tool.";
> >>> + fi
> >>
> >> What about using existing check_global_prereq()?
> >
> > check_global_prereq call _fail when the executable is not found in
> > $PATH, that's why I open coded the implementation and just called
> > _not_run.
>
> Makes sense.
>
> Although it would be even better to change from "_fail" to "_not_run"
> for check_global_prereq().
I'd rather keep it as _fail, the utilities checked by this helper is
mostly some system tool or other filesystem tool, all should be present
for the testing. I don't want the testsuite to skip random tests without
a good reason. We can add a script or make target to make the checks in
advance and not when some test fails after a long time.
prev parent reply other threads:[~2019-12-18 16:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-17 20:31 [btrfs-progs PATCH 0/4] tests: do not fail if dm-thin is missing Marcos Paulo de Souza
2019-12-17 20:31 ` [btrfs-progs PATCH 1/4] tests: common: Add check_dm_target_support helper Marcos Paulo de Souza
2019-12-18 0:26 ` Qu Wenruo
2019-12-18 15:58 ` David Sterba
2019-12-18 16:05 ` Marcos Paulo de Souza
2019-12-17 20:31 ` [btrfs-progs PATCH 2/4] tests: mkfs: 017: Use " Marcos Paulo de Souza
2019-12-18 0:26 ` Qu Wenruo
2019-12-17 20:31 ` [btrfs-progs PATCH 3/4] tests: mkfs: 005: " Marcos Paulo de Souza
2019-12-18 0:27 ` Qu Wenruo
2019-12-17 20:31 ` [btrfs-progs PATCH 4/4] tests: Do not fail is dmsetup is missing Marcos Paulo de Souza
2019-12-18 0:30 ` Qu Wenruo
2019-12-18 0:44 ` Marcos Paulo de Souza
2019-12-18 0:48 ` Qu Wenruo
2019-12-18 16:03 ` David Sterba [this message]
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=20191218160350.GL3929@suse.cz \
--to=dsterba@suse.cz \
--cc=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=marcos.souza.org@gmail.com \
--cc=mpdesouza@suse.com \
--cc=mpdesouza@suse.de \
--cc=quwenruo.btrfs@gmx.com \
--cc=wqu@suse.com \
/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.