xfs
[Top] [All Lists]

Re: [PATCH v2 12/12] xfstests: check if filesystem supports chattr

To: xfs@xxxxxxxxxxx, Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH v2 12/12] xfstests: check if filesystem supports chattr
From: Junho Ryu <jayr@xxxxxxxxxx>
Date: Tue, 17 Dec 2013 14:23:29 -0800
Cc: Boris Ranto <branto@xxxxxxxxxx>, Hugh Dickins <hughd@xxxxxxxxxx>, "Theodore Ts'o" <tytso@xxxxxxx>, Junho Ryu <jayr@xxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=CCsQC5TsRMINcgBU8olLkWvzmTULxdDUJxoEvSJbIlk=; b=H36W8A4vYio4zQO0BSUibg0Ft6BT2cNYMRo0PBoc7myPm79wYZj09L1uCQs0vgHD8X oov6yeL9r6JAohVW+RyVpqnS3MhKMdZVl+1OWJ6S3dgmCac18D9uGb5mbS2h8ENWqAkW f7PLJ0uDsQgLGFO73yb0gCJ6fk6cBXAh7F+DAQIpB/YMJM0jYEBFk+A29pSXsvAe/tR0 9fVmj4PVj8B98u5gUM242l+jJoHAaY2nmAK3Fq3sQbcneoLV50bOuXB4SXAn59WxkuA6 zCvo0T7wYk/WAtaf0X2voIKiPcEmLMnRmrz8dY2+rUWSh8LDDjP9uz+QKUs3KtfrhSyA hHKQ==
In-reply-to: <1387318722-3050-12-git-send-email-jayr@xxxxxxxxxx>
References: <1387318722-3050-1-git-send-email-jayr@xxxxxxxxxx> <1387318722-3050-12-git-send-email-jayr@xxxxxxxxxx>
Hi Christoph,

I'm not sure what you meant by "it might be worth to have a common
_require_chattr helper chared with generic/079". I cannot find
"chattr" in "generic/079".

Regards,
Junho

On Tue, Dec 17, 2013 at 2:18 PM, Junho Ryu <jayr@xxxxxxxxxx> wrote:
> Add _require_chattr which verifies exit code of chattr command and call
> it before running generic/277.
>
> Signed-off-by: Junho Ryu <jayr@xxxxxxxxxx>
> ---
>
> v2: extracted from patch 9
>
>  common/attr       | 13 +++++++++++++
>  tests/generic/277 |  2 ++
>  2 files changed, 15 insertions(+)
>
> diff --git a/common/attr b/common/attr
> index 4a3ac9e..278633f 100644
> --- a/common/attr
> +++ b/common/attr
> @@ -218,5 +218,18 @@ else # Assume max ~1 block of attrs
>  fi
>
>  export MAX_ATTRVAL_SIZE
> +
> +_require_chattr()
> +{
> +    touch $TEST_DIR/syscalltest
> +    chattr +A $TEST_DIR/syscalltest > $TEST_DIR/syscalltest.out 2>&1
> +    if [ $? -ne 0 ]; then
> +      _notrun "chattr has failed to change attribute of a file in TEST_DIR"
> +    fi
> +    cat $TEST_DIR/syscalltest.out >> $seqres.full
> +
> +    rm -f $TEST_DIR/syscalltest.out
> +}
> +
>  # make sure this script returns success
>  /bin/true
> diff --git a/tests/generic/277 b/tests/generic/277
> index 8461ad9..c31f7c4 100755
> --- a/tests/generic/277
> +++ b/tests/generic/277
> @@ -38,11 +38,13 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
>  # get standard environment, filters and checks
>  . ./common/rc
>  . ./common/filter
> +. ./common/attr
>
>  # real QA test starts here
>  _supported_fs generic
>  _supported_os Linux
>  _require_scratch
> +_require_chattr
>
>  _scratch_mkfs > /dev/null 2>&1
>  _scratch_mount
> --
> 1.8.5.1
>

<Prev in Thread] Current Thread [Next in Thread>