From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD858C169C4 for ; Mon, 11 Feb 2019 05:19:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A757420855 for ; Mon, 11 Feb 2019 05:19:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726036AbfBKFTl (ORCPT ); Mon, 11 Feb 2019 00:19:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45950 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725962AbfBKFTl (ORCPT ); Mon, 11 Feb 2019 00:19:41 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3A9FD811AC for ; Mon, 11 Feb 2019 05:19:41 +0000 (UTC) Received: from test1135.test.redhat.com (vpn2-54-20.bne.redhat.com [10.64.54.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 824DC5C236 for ; Mon, 11 Feb 2019 05:19:40 +0000 (UTC) From: Ronnie Sahlberg To: linux-fsdevel Subject: [PATCH] cifs: add test that setfattr -x fails non-existing EAs Date: Mon, 11 Feb 2019 15:19:32 +1000 Message-Id: <20190211051932.20542-2-lsahlber@redhat.com> In-Reply-To: <20190211051932.20542-1-lsahlber@redhat.com> References: <20190211051932.20542-1-lsahlber@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 11 Feb 2019 05:19:41 +0000 (UTC) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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. Signed-off-by: Ronnie Sahlberg --- 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 + $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 :" +setfattr -x user.does-not-exist $file + +# success, all done +status=0 +exit diff --git a/tests/cifs/002.out b/tests/cifs/002.out new file mode 100644 index 00000000..163eb48a --- /dev/null +++ b/tests/cifs/002.out @@ -0,0 +1,6 @@ +QA output created by 002 + +create file foo + +unset EA : +setfattr: TEST_DIR/foo: No such attribute diff --git a/tests/cifs/group b/tests/cifs/group index 6d07b1c4..191e6a67 100644 --- a/tests/cifs/group +++ b/tests/cifs/group @@ -4,3 +4,4 @@ # - comment line before each group is "new" description # 001 auto quick +002 auto quick -- 2.13.6