Add new xattr test 532
PATCH 1/1 Add new xattr test 532
This test is cloned from 097 but has had all the tests for trusted.* removed.
This makes it possible to use this test on filesystems that can only provide user.* xattrs such as CIFS.
--- tests/generic/532 | 144 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/532.out | 108 +++++++++++++++++++++++++++++++++++++ tests/generic/group | 1 + 3 files changed, 253 insertions(+) create mode 100755 tests/generic/532 create mode 100644 tests/generic/532.out
tests/generic/532 new file +144 -0
@@ -0,0 +1,144 @@ +#! /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. +# Copyright (c) 2019 Red Hat Inc. All Rights Reserved. +# +# FS QA Test No. 526. Modified from 097. +# +# simple attr tests for user. EAs: +# - set +# - get +# - list +# - remove +# Basic testing. +# +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 +} + +getfattr() +{ + _getfattr --absolute-names "$@" |& _filter_test_dir +} + +setfattr() +{ + $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 "\nshould be no EAs for foo:" +getfattr -d $file + +echo -e "\nset EA <NOISE,woof>:" +setfattr -n user.NOISE -v woof $file + +echo -e "\nset EA <COLOUR,blue>:" +setfattr -n user.COLOUR -v blue $file + +echo -e "\nset EA <SIZE,small>:" +setfattr -n user.SIZE -v small $file + +echo -e "\nlist the EAs for foo: NOISE, COLOUR, SIZE" +getfattr -d $file + +echo -e "\ncheck the list again for foo" +getfattr -d $file + +echo -e "\nunmount the FS and see if EAs are persistent" +_test_cycle_mount + +echo -e "\ncheck the list again for foo after umount/mount" +getfattr -d $file + +echo -e "\nremove the COLOUR EA on foo" +setfattr -x user.COLOUR $file + +echo -e "\nlist EAs for foo: NOISE, SIZE" +getfattr -d $file + +echo -e "\nget the value of the NOISE EA" +getfattr -n user.NOISE $file + +echo -e "\nget the value of the COLOUR EA which was removed earlier" +getfattr -n user.COLOUR $file + +echo -e "\nget the value of the SIZE EA" +getfattr -n user.SIZE $file + +echo -e "\nlist all the EAs again: NOISE, SIZE" +getfattr -d $file + +echo -e "\nchange the value of the SIZE EA from small to huge" +setfattr -n user.SIZE -v huge $file + +echo -e "\nget the SIZE EA which should now have value huge" +getfattr -n user.SIZE $file + +echo -e "\nlist EAs: NOISE, SIZE" +getfattr -d $file + +echo -e "\nremove the SIZE EA from foo" +setfattr -x user.SIZE $file + +echo -e "\nlist EAs: NOISE (SIZE EA has been removed)" +getfattr -d $file + +echo -e "\ntry removing non-existent EA named woof" +setfattr -x user.WOOF $file + +echo -e "\ntry removing already removed EA SIZE" +setfattr -x user.SIZE $file + +echo -e "\nlist EAs: NOISE" +getfattr -d $file + +echo -e "\ntry removing already removed EA COLOUR" +setfattr -x user.COLOUR $file + +echo -e "\nlist EAs: NOISE" +getfattr -d $file + +echo -e "\nremove remaining EA NOISE" +setfattr -x user.NOISE $file + +echo -e "\nlist EAs: should be no EAs left now" +getfattr -d $file + +echo -e "\nunmount the FS and see if EAs are persistent" +_test_cycle_mount + +echo -e "\nlist EAs: should still be no EAs left" +getfattr -d $file + +# success, all done +status=0 +exit
tests/generic/532.out new file +108 -0
108 lines not on this page · raw message
tests/generic/group +1 -0
@@ -534,3 +534,4 @@ 529 auto quick attr 530 auto quick unlink 531 auto quick unlink +532 attr auto quick
Signature · 1 line
2.13.6
Quoted 6 lines · Ronnie Sahlberg
This test is cloned from 097 but has had all the tests for trusted.* removed.
This makes it possible to use this test on filesystems that can only provide user.* xattrs such as CIFS.Signed-off-by Ronnie Sahlberg <[email protected]>
Sorry I missed your last patch of this clone..
Do I need to do special setup for CIFS to support xattr? Currently I got test _notrun because attrs are not supported by CIFS. I was mounting a local samba server with
-o vers=3.0 -o username=user,password=passwd,sfu -o context=system_u:object_r:root_t:s0 //localhost/scratch /mnt/scratch
Kernel is 5.0.0-rc7.
But instead of cloning all the user.* xattr tests, I think it's better to split generic/097, leave all trusted.* xattr tests there and move all user.* xattr tests to this new test. So we don't have to maintain two copys of the same user.* xattr tests.
Thanks,
Eryu
----- Original Message -----
Quoted 7 lines
From: "Eryu Guan" <[email protected]>
To: "Ronnie Sahlberg" <[email protected]>
Cc: "fstests" <[email protected]>
Sent: Wednesday, 6 March, 2019 10:52:34 PM
Subject: Re: [PATCH] Add new xattr test 532On Tue, Mar 05, 2019 at 02:36:13PM +1000, Ronnie Sahlberg wrote:
Quoted 8 lines
Quoted 6 lines
This test is cloned from 097 but has had all the tests for trusted.* removed.
This makes it possible to use this test on filesystems that can only provide user.* xattrs such as CIFS.Signed-off-by Ronnie Sahlberg <[email protected]>Sorry I missed your last patch of this clone..
No worries. I will resend it later once I address Daves concerns.
Quoted 7 lines
Do I need to do special setup for CIFS to support xattr? Currently I got test
_notrunbecause attrs are not supported by CIFS. I was mounting a local samba server with-o vers=3.0 -o username=user,password=passwd,sfu -o context=system_u:object_r:root_t:s0 //localhost/scratch
/mnt/scratch
You don't need the 'sfu' mount option but you likely need to make sure you have the proper vfs modules loaded for samba:
I use this on my share :
[Share]
path = /Share
read only = no
guest ok = no
vfs objects = acl_xattr, streams_xattr aio_pthread ea support = yes
aio read size = 16384
aio write size = 16384
I think the only important one is ea support = yes (the xattrs are stored as EAs)
Quoted 11 lines
Kernel is 5.0.0-rc7.
But instead of cloning all the user.* xattr tests, I think it's better to split generic/097, leave all trusted.* xattr tests there and move all user.* xattr tests to this new test. So we don't have to maintain two copys of the same user.* xattr tests.
Thanks,
Eryu
Quoted 43 lines · Ronnie Sahlberg
----- Original Message -----
Quoted 7 lines
From: "Eryu Guan" <[email protected]>
To: "Ronnie Sahlberg" <[email protected]>
Cc: "fstests" <[email protected]>
Sent: Wednesday, 6 March, 2019 10:52:34 PM
Subject: Re: [PATCH] Add new xattr test 532On Tue, Mar 05, 2019 at 02:36:13PM +1000, Ronnie Sahlberg wrote:
Quoted 8 lines
Quoted 6 lines
This test is cloned from 097 but has had all the tests for trusted.* removed.
This makes it possible to use this test on filesystems that can only provide user.* xattrs such as CIFS.Signed-off-by Ronnie Sahlberg <[email protected]>Sorry I missed your last patch of this clone..
No worries. I will resend it later once I address Daves concerns.
Quoted 7 lines
Do I need to do special setup for CIFS to support xattr? Currently I got test
_notrunbecause attrs are not supported by CIFS. I was mounting a local samba server with-o vers=3.0 -o username=user,password=passwd,sfu -o context=system_u:object_r:root_t:s0 //localhost/scratch
/mnt/scratchYou don't need the 'sfu' mount option but you likely need to make sure you have the proper vfs modules loaded for samba:
I use this on my share :[Share]
path = /Share
read only = no
guest ok = no
vfs objects =acl_xattr,streams_xattraio_pthreadea support = yes
aio read size = 16384
aio write size = 16384
Quoted 1 line
I think the only important one is ea support = yes (the xattrs are stored as EAs)
I got xattr working on CIFS now, thanks!
Quoted 10 lines
Quoted 10 lines
Kernel is 5.0.0-rc7.
But instead of cloning all the user.* xattr tests, I think it's better to split generic/097, leave all trusted.* xattr tests there and move all user.* xattr tests to this new test. So we don't have to maintain two copys of the same user.* xattr tests.
But it seems you missed above comments when sending new version of the patch :)
Thanks,
Eryu
Quoted 55 lines · Eryu Guan
Quoted 43 lines · Ronnie Sahlberg
----- Original Message -----
Quoted 7 lines
From: "Eryu Guan" <[email protected]>
To: "Ronnie Sahlberg" <[email protected]>
Cc: "fstests" <[email protected]>
Sent: Wednesday, 6 March, 2019 10:52:34 PM
Subject: Re: [PATCH] Add new xattr test 532On Tue, Mar 05, 2019 at 02:36:13PM +1000, Ronnie Sahlberg wrote:
Quoted 8 lines
Quoted 6 lines
This test is cloned from 097 but has had all the tests for trusted.* removed.
This makes it possible to use this test on filesystems that can only provide user.* xattrs such as CIFS.Signed-off-by Ronnie Sahlberg <[email protected]>Sorry I missed your last patch of this clone..
No worries. I will resend it later once I address Daves concerns.
Quoted 7 lines
Do I need to do special setup for CIFS to support xattr? Currently I got test
_notrunbecause attrs are not supported by CIFS. I was mounting a local samba server with-o vers=3.0 -o username=user,password=passwd,sfu -o context=system_u:object_r:root_t:s0 //localhost/scratch
/mnt/scratchYou don't need the 'sfu' mount option but you likely need to make sure you have the proper vfs modules loaded for samba:
I use this on my share :[Share]
path = /Share
read only = no
guest ok = no
vfs objects =acl_xattr,streams_xattraio_pthreadea support = yes
aio read size = 16384
aio write size = 16384Quoted 1 line
I think the only important one is ea support = yes (the xattrs are stored as EAs)
I got xattr working on CIFS now, thanks!
Quoted 6 lines
Quoted 6 lines
Kernel is 5.0.0-rc7.
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
But instead of cloning all the user.* xattr tests, I think it's better to split generic/097, leave all trusted.* xattr tests there and move all user.* xattr tests to this new test. So we don't have to maintain two copys of the same user.* xattr tests.
But it seems you missed above comments when sending new version of the patch :)
Oh I missed that. Should just be a matter of deleting these tests from 097? Do you want me to re-send the patch?
Quoted 3 lines
Thanks,
Eryu
Quoted 61 lines · ronnie sahlberg
Quoted 60 lines · Eryu Guan
Quoted 43 lines · Ronnie Sahlberg
----- Original Message -----
Quoted 7 lines
From: "Eryu Guan" <[email protected]>
To: "Ronnie Sahlberg" <[email protected]>
Cc: "fstests" <[email protected]>
Sent: Wednesday, 6 March, 2019 10:52:34 PM
Subject: Re: [PATCH] Add new xattr test 532On Tue, Mar 05, 2019 at 02:36:13PM +1000, Ronnie Sahlberg wrote:
Quoted 8 lines
Quoted 6 lines
This test is cloned from 097 but has had all the tests for trusted.* removed.
This makes it possible to use this test on filesystems that can only provide user.* xattrs such as CIFS.Signed-off-by Ronnie Sahlberg <[email protected]>Sorry I missed your last patch of this clone..
No worries. I will resend it later once I address Daves concerns.
Quoted 7 lines
Do I need to do special setup for CIFS to support xattr? Currently I got test
_notrunbecause attrs are not supported by CIFS. I was mounting a local samba server with-o vers=3.0 -o username=user,password=passwd,sfu -o context=system_u:object_r:root_t:s0 //localhost/scratch
/mnt/scratchYou don't need the 'sfu' mount option but you likely need to make sure you have the proper vfs modules loaded for samba:
I use this on my share :[Share]
path = /Share
read only = no
guest ok = no
vfs objects =acl_xattr,streams_xattraio_pthreadea support = yes
aio read size = 16384
aio write size = 16384Quoted 1 line
I think the only important one is ea support = yes (the xattrs are stored as EAs)
I got xattr working on CIFS now, thanks!
Quoted 10 lines
Quoted 10 lines
Kernel is 5.0.0-rc7.
But instead of cloning all the user.* xattr tests, I think it's better to split generic/097, leave all trusted.* xattr tests there and move all user.* xattr tests to this new test. So we don't have to maintain two copys of the same user.* xattr tests.
Quoted 4 lines
Quoted 2 lines
But it seems you missed above comments when sending new version of the patch :)
Oh I missed that. Should just be a matter of deleting these tests from 097?
Yes, I think that should be enough.
Quoted 1 line
Do you want me to re-send the patch?
Yes please. Thanks a lot!
Eryu