From: Ruediger Meier <sweet_f_a@gmx.de>
To: Bernhard Voelker <mail@bernhard-voelker.de>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH 3/3] tests: always quote $LODEV
Date: Mon, 7 Nov 2016 09:58:25 +0100 [thread overview]
Message-ID: <201611070958.25232.sweet_f_a@gmx.de> (raw)
In-Reply-To: <6d62a61c-6dcf-e7a5-bfa3-5df4f93723a4@bernhard-voelker.de>
On Sunday 06 November 2016, Bernhard Voelker wrote:
> On 11/05/2016 04:08 PM, Ruediger Meier wrote:
> > From: Ruediger Meier <ruediger.meier@ga-group.nl>
> >
> > Since there is no error handling in this test $LODEV
> > may be empty.
> >
> > Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
> > ---
> > tests/ts/losetup/losetup-loop | 46
> > +++++++++++++++++++++---------------------- 1 file changed, 23
> > insertions(+), 23 deletions(-)
> >
> > diff --git a/tests/ts/losetup/losetup-loop
> > b/tests/ts/losetup/losetup-loop index cff12c9..13ccc65 100755
> > --- a/tests/ts/losetup/losetup-loop
> > +++ b/tests/ts/losetup/losetup-loop
> > @@ -42,15 +42,15 @@ BACKFILE="$TS_DEVICE"
> >
> > ts_init_subtest "find-race-condition"
> > LODEV=$( $TS_CMD_LOSETUP --find --nooverlap --show $BACKFILE )
> > -$TS_CMD_LOSETUP -d $LODEV
> > +$TS_CMD_LOSETUP -d "$LODEV"
>
> So what happens now when losetup is fed with ""?
> Wouldn't it be better to handle the error instead?
Actually the failure is generally handled in terms that the test will
fail and exit 1. I did not want to change more of the test logic
shortly before release. Also note that we are testing a possibly broken
losetup here which makes any "good" error handling questionable
anyways. For example if something goes wrong it would be of course nice
to do at least some cleanup and remove all loop devices again to not
let other tests fail too. But how should we do that if losetup is
broken?
Regarding quoting. IMO we are missing a lot quotation marks in our
test-suite. This is specially annoying since our programs are printing
the whole --help output on usage errors. I really hate that auto-help
feature. Don't understand why we are doing that instead of just
printing "unkown option" or "missing argument".
cu,
Rudi
next prev parent reply other threads:[~2016-11-07 8:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-05 15:08 [PATCH 1/3] tests: udevadm settle before losetup -d Ruediger Meier
2016-11-05 15:08 ` [PATCH 2/3] tests: replace sleep by udevadm Ruediger Meier
2016-11-07 13:13 ` Stanislav Brabec
2016-11-05 15:08 ` [PATCH 3/3] tests: always quote $LODEV Ruediger Meier
2016-11-06 20:57 ` Bernhard Voelker
2016-11-07 8:58 ` Ruediger Meier [this message]
2016-11-07 9:41 ` Karel Zak
2016-11-07 10:21 ` Ruediger Meier
2016-11-07 11:37 ` Karel Zak
2016-11-07 12:48 ` Ruediger Meier
2016-11-07 13:38 ` Karel Zak
2016-11-07 13:52 ` Karel Zak
2016-11-07 9:53 ` [PATCH 1/3] tests: udevadm settle before losetup -d Karel Zak
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=201611070958.25232.sweet_f_a@gmx.de \
--to=sweet_f_a@gmx.de \
--cc=mail@bernhard-voelker.de \
--cc=util-linux@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox