All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Tulak <jtulak@redhat.com>
To: Eryu Guan <eguan@redhat.com>
Cc: fstests@vger.kernel.org, Dave Chinner <dchinner@redhat.com>
Subject: Re: [PATCH] xfstests: Add mkfs input validation tests
Date: Thu, 23 Jun 2016 13:10:58 +0200	[thread overview]
Message-ID: <CACj3i71F6XPnLRHdftpNUh3-3+yVhAOE-AHwvwCB-FX7sowxsQ@mail.gmail.com> (raw)
In-Reply-To: <20160623110417.GK3226@eguan.usersys.redhat.com>

On Thu, Jun 23, 2016 at 1:04 PM, Eryu Guan <eguan@redhat.com> wrote:
> On Tue, Jun 14, 2016 at 10:31:08AM +0200, Jan Tulak wrote:
>> mkfs.xfs does not do a very good job of input validation. This test
>> is designed to exercise the input validation and test good/bad
>> combinations of options being set. It will not pass on an old
>> mkfs.xfs binary - it is designed to be the test case for an input
>> validation cleanup (merged in spring/summer 2016).
>
> Looks good to me overall, I tested with xfsprogs v4.7-rc1 and it passed
> the test, on both x86_64 and ppc64 host. Old xfsprogs failed the test as
> expected.
>
> But I'm not sure about all the sub-tests it does, is it enough or not,
> is it doing valid tests, etc. Need help from xfs developers.
>

Thanks. This is something I hope to hear too... I tried to put there
everything important, but with so many options and combinations,
omittions are possible. :-)

> Some minor issues below.

I will see to them and send a fix. Thank you.

Cheers, Jan

>
>>
>> Signed-off-by: Dave Chinner <dchinner@redhat.com>
>> Signed-off-by: Jan Tulak <jtulak@redhat.com>
>>
>> ---
>>
>> CHANGES:
>>   * Edited commit message to reflect that the cleanup was already merged.
>>   * I added other sections - now it should go through all options and check
>> conflicting/mandatory combinations when appropriate. I'm not feeding a garbage
>> into every option, because now the parsing should be done consistently and the
>> same for all options of the same type. However, it is possible I forgot
>> something what should be there - in such case, hit me. :-)
>>
>> Also, at the moment of submitting this, there are some patches for xfsprogs
>> fixing some issues in the mailing list - so expect this to fail with the
>> current for-next branch (c5d584c)
>>
>> Regarding of the number of this test: I used the number as this test was some
>> time half baked and I wanted to avoid conflicts with other new tests. So if it
>> is an issue, I can submit it with another number, somewhere in the main
>> sequence.
>>
>> Cheers,
>> Jan
>> ---
>>  tests/xfs/400-input-validation     | 335 +++++++++++++++++++++++++++++++++++++
>>  tests/xfs/400-input-validation.out |   2 +
>>  tests/xfs/group                    |   1 +
>>  3 files changed, 338 insertions(+)
>>  create mode 100755 tests/xfs/400-input-validation
>>  create mode 100644 tests/xfs/400-input-validation.out
>>
>> diff --git a/tests/xfs/400-input-validation b/tests/xfs/400-input-validation
>> new file mode 100755
>> index 0000000..c52a4b6
>> --- /dev/null
>> +++ b/tests/xfs/400-input-validation
>> @@ -0,0 +1,335 @@
>> +#! /bin/bash
>> +# FS QA Test No. xfs/400
>> +#
>> +# mkfs.xfs input validation test. Designed to break mkfs.xfs if it doesn't
>> +# filter garbage input or invalid option combinations correctly.
>> +#
>> +#-----------------------------------------------------------------------
>> +# Copyright (c) 2014 Red Hat, Inc.  All Rights Reserved.
>                    ^^^^ 2016
>> +#
>> +# This program is free software; you can redistribute it and/or
>> +# modify it under the terms of the GNU General Public License as
>> +# published by the Free Software Foundation.
>> +#
>> +# This program is distributed in the hope that it would be useful,
>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> +# GNU General Public License for more details.
>> +#
>> +# You should have received a copy of the GNU General Public License
>> +# along with this program; if not, write the Free Software Foundation,
>> +# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
>> +#-----------------------------------------------------------------------
>> +#
>> +
>> +
>> +seq=`basename $0`
>> +seqres=$RESULT_DIR/$seq
>> +echo "QA output created by $seq"
>> +
>> +here=`pwd`
>> +tmp=/tmp/$$
>> +status=1        # failure is the default!
>> +trap "_cleanup; exit \$status" 0 1 2 3 15
>> +
>> +_cleanup()
>> +{
>> +    cd /
>> +    rm -f $tmp.*
>
> You're using space for indention in the whole test, please use tab.
>
>> +}
>> +
>> +# get standard environment, filters and checks
>> +. ./common/rc
>> +. ./common/filter
>> +
>> +# real QA test starts here
>> +
>> +# Modify as appropriate.
>> +_supported_fs xfs
>> +_supported_os Linux
>> +_require_scratch
>> +
>> +rm $seqres.full || true
>
> rm -f $seqres.full
>
> Otherwise it fails when I ran it for the first time
> rm: cannot remove '/root/xfstests/results//xfs/006-input-validation.full': No such file or directory
>
> Thanks,
> Eryu



-- 
Jan Tulak
jtulak@redhat.com / jan@tulak.me

  reply	other threads:[~2016-06-23 11:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-14  8:31 [PATCH] xfstests: Add mkfs input validation tests Jan Tulak
2016-06-23 11:04 ` Eryu Guan
2016-06-23 11:10   ` Jan Tulak [this message]
2016-06-29 10:38 ` [PATCH v2] " Jan Tulak
2016-06-29 12:52   ` Eryu Guan
2016-06-29 13:03     ` Jan Tulak
2016-07-01 16:12 ` [PATCH v3] " Jan Tulak
2016-07-13 10:46   ` Eryu Guan
2016-07-14 10:20     ` Jan Tulak

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=CACj3i71F6XPnLRHdftpNUh3-3+yVhAOE-AHwvwCB-FX7sowxsQ@mail.gmail.com \
    --to=jtulak@redhat.com \
    --cc=dchinner@redhat.com \
    --cc=eguan@redhat.com \
    --cc=fstests@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 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.