From: Dave Chinner <david@fromorbit.com>
To: Ronnie Sahlberg <lsahlber@redhat.com>
Cc: fstests@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] cifs: add test that setfattr -x fails non-existing EAs
Date: Tue, 12 Feb 2019 08:51:17 +1100 [thread overview]
Message-ID: <20190211215117.GG20493@dastard> (raw)
In-Reply-To: <20190211051932.20542-2-lsahlber@redhat.com>
[cc fstests@vger.kernel.org]
Hi Ronnie,
Probably better to send this (and any followups) to the fstests
list... :)
On Mon, Feb 11, 2019 at 03:19:32PM +1000, Ronnie Sahlberg wrote:
> We just fixed a bug in cifs.ko where it would incorrectly return success
> for setfattr -x user.does-not-exist.
>
> This patch adds a test case for this.
>
> Xfstests already have tests for setfattr -x in generic/097
> but we can not yet use that test for cifs since we can only support
> the user namespace.
'the "user." xattr namespace.'
"user namespace" is an overloaded term.
> Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
> ---
> tests/cifs/002 | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
> tests/cifs/002.out | 6 ++++++
> tests/cifs/group | 1 +
> 3 files changed, 60 insertions(+)
> create mode 100755 tests/cifs/002
> create mode 100644 tests/cifs/002.out
>
> diff --git a/tests/cifs/002 b/tests/cifs/002
> new file mode 100755
> index 00000000..80baa66a
> --- /dev/null
> +++ b/tests/cifs/002
> @@ -0,0 +1,53 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved.
> +# Copyright (c) 2017 Google, Inc. All Rights Reserved.
> +#
> +# FS QA Test No. 002. Modified from generic/097
> +#
> +# simple attr test for deleting a non-existing EA:
> +#
> +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
> +
> +file=$TEST_DIR/foo
> +
> +_cleanup()
> +{
> + rm -f $tmp.* $file
> +}
> +
> +setfattr()
> +{
> + echo $SETFATTR_PROG "$@" >>/tmp/foo
Why? And it doesn't get cleaned up on test exit, either.
> + $SETFATTR_PROG "$@" |& _filter_test_dir
> +}
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +. ./common/attr
> +. ./common/filter
> +
> +# real QA test starts here
> +_supported_fs generic
> +_supported_os Linux
> +
> +_require_test
> +_require_attrs
> +
> +echo -e "\ncreate file foo"
> +rm -f $file
> +touch $file
> +
> +echo -e "\nunset EA <does-not-exist>:"
> +setfattr -x user.does-not-exist $file
> +
> +# success, all done
> +status=0
> +exit
I don't see anything cifs specific in this test.
And why just test this one specific thing you found a bug in? Why
not just copy all of generic/097 and chop out all the non-"user."
xattr namespace bits so you exercise all the different xattr
operations?
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
prev parent reply other threads:[~2019-02-11 21:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-11 5:19 [PATCH 0/1] cifs: setfattr -x test for cifs Ronnie Sahlberg
2019-02-11 5:19 ` [PATCH] cifs: add test that setfattr -x fails non-existing EAs Ronnie Sahlberg
2019-02-11 21:51 ` Dave Chinner [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=20190211215117.GG20493@dastard \
--to=david@fromorbit.com \
--cc=fstests@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=lsahlber@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).