mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
Merge of xfs-cmds-2.4.18:slinx:111985a by nathans.
getfattr/setfattr fixes
This commit is contained in:
@@ -81,7 +81,7 @@ _attr_list()
|
||||
file=$1
|
||||
|
||||
echo " *** print attributes"
|
||||
if ! _getfattr -ad $file >$tmp.raw
|
||||
if ! _getfattr -ad $file
|
||||
then
|
||||
echo " !!! error return"
|
||||
return 1
|
||||
@@ -93,6 +93,8 @@ _attr_list()
|
||||
|
||||
# real QA test starts here
|
||||
|
||||
rm -f $seq.full
|
||||
|
||||
testfile=$TEST_DIR/attribute_$$
|
||||
|
||||
echo "*** list non-existant file"
|
||||
@@ -128,7 +130,7 @@ echo "*** add lots of attributes"
|
||||
v=0
|
||||
while [ $v -lt 1000 ]
|
||||
do
|
||||
echo "value_$v" | attr -s "attribute_$v" $testfile >/dev/null
|
||||
echo "value_$v" | attr -s "attribute_$v" $testfile >>$seq.full
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "!!! failed to add \"attribute_$v\""
|
||||
@@ -140,14 +142,19 @@ done
|
||||
|
||||
echo "*** check"
|
||||
# don't print it all out...
|
||||
getfattr $testfile \
|
||||
| $AWK_PROG '{ l++ } END {print " *** " (l - 1) " attribute(s)" }'
|
||||
getfattr -a $testfile \
|
||||
| tee -a $seq.full \
|
||||
| $AWK_PROG '
|
||||
/^#/ { next }
|
||||
/^[ ]*$/ { next }
|
||||
{ l++ }
|
||||
END {print " *** " (l - 1) " attribute(s)" }'
|
||||
|
||||
echo "*** remove lots of attributes"
|
||||
v=0
|
||||
while [ $v -lt 1000 ]
|
||||
do
|
||||
if ! attr -r "attribute_$v" $testfile >/dev/null
|
||||
if ! attr -r "attribute_$v" $testfile >>$seq.full
|
||||
then
|
||||
echo "!!! failed to remove \"attribute_$v\""
|
||||
exit 1
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
QA output created by 020
|
||||
*** list non-existant file
|
||||
*** print attributes
|
||||
attr_list: No such file or directory
|
||||
Could not list attributes for <TESTFILE>
|
||||
getfattr: <TESTFILE>: No such file or directory
|
||||
!!! error return
|
||||
*** list non-xfs file (in /proc)
|
||||
*** print attributes
|
||||
attr_list: Operation not supported
|
||||
Could not list attributes for <PROCFILE>
|
||||
!!! error return
|
||||
*** list empty file
|
||||
*** print attributes
|
||||
*** 0 attribute(s)
|
||||
*** query non-existant attribute
|
||||
attr_get: No data available
|
||||
Could not get "nonexistant" for <TESTFILE>
|
||||
@@ -20,62 +15,54 @@ Attribute "fish" set to a 5 byte value for <TESTFILE>:
|
||||
fish
|
||||
|
||||
*** print attributes
|
||||
*** 1 attribute(s)
|
||||
*** field: fish length: 5
|
||||
::: fish
|
||||
:::
|
||||
# file: <TESTFILE>
|
||||
user.fish="fish\012"
|
||||
|
||||
*** replace attribute
|
||||
Attribute "fish" set to a 6 byte value for <TESTFILE>:
|
||||
fish3
|
||||
|
||||
*** print attributes
|
||||
*** 1 attribute(s)
|
||||
*** field: fish length: 6
|
||||
::: fish3
|
||||
:::
|
||||
# file: <TESTFILE>
|
||||
user.fish="fish3\012"
|
||||
|
||||
*** add attribute
|
||||
Attribute "snrub" set to a 6 byte value for <TESTFILE>:
|
||||
fish2
|
||||
|
||||
*** print attributes
|
||||
*** 2 attribute(s)
|
||||
*** field: fish length: 6
|
||||
::: fish3
|
||||
:::
|
||||
*** field: snrub length: 6
|
||||
::: fish2
|
||||
:::
|
||||
# file: <TESTFILE>
|
||||
user.fish="fish3\012"
|
||||
user.snrub="fish2\012"
|
||||
|
||||
*** remove attribute
|
||||
*** print attributes
|
||||
*** 1 attribute(s)
|
||||
*** field: snrub length: 6
|
||||
::: fish2
|
||||
:::
|
||||
# file: <TESTFILE>
|
||||
user.snrub="fish2\012"
|
||||
|
||||
*** add lots of attributes
|
||||
*** check
|
||||
*** 1001 attribute(s)
|
||||
*** 1000 attribute(s)
|
||||
*** remove lots of attributes
|
||||
*** print attributes
|
||||
*** 1 attribute(s)
|
||||
*** field: snrub length: 6
|
||||
::: fish2
|
||||
:::
|
||||
# file: <TESTFILE>
|
||||
user.snrub="fish2\012"
|
||||
|
||||
*** really long value
|
||||
0000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
*
|
||||
0200000 0a
|
||||
0200001
|
||||
*** set/get/remove really long names (expect failure)
|
||||
attr_set: Bad address
|
||||
attr_set: Invalid argument
|
||||
Could not set "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" for <TESTFILE>
|
||||
attr_get: Bad address
|
||||
attr_get: Invalid argument
|
||||
Could not get "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" for <TESTFILE>
|
||||
attr_remove: Bad address
|
||||
attr_remove: Invalid argument
|
||||
Could not remove "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" for <TESTFILE>
|
||||
*** check final
|
||||
*** print attributes
|
||||
*** 1 attribute(s)
|
||||
*** field: snrub length: 6
|
||||
::: fish2
|
||||
:::
|
||||
# file: <TESTFILE>
|
||||
user.snrub="fish2\012"
|
||||
|
||||
*** delete
|
||||
|
||||
@@ -111,11 +111,19 @@ echo "*** make test file 2"
|
||||
touch $testfile.2
|
||||
echo "value_1" | _attr -s "a1" $testfile.2 >/dev/null
|
||||
echo "value_2" | _attr -s "a2-----" $testfile.2 >/dev/null
|
||||
|
||||
(echo start ; dd if=/dev/zero bs=65525 count=1 ; echo end ) \
|
||||
| _attr -s "a3" $testfile.2 >/dev/null
|
||||
|
||||
_getfattr -a $testfile.2
|
||||
|
||||
# print name and size from 1st line of output
|
||||
_attr -g "a3" $testfile.2 | head -1
|
||||
|
||||
# print out the rest of the data apart from the header
|
||||
# the size is +1 for an extra \n at the end
|
||||
echo -n "size of attr value = "
|
||||
_attr -g "a3" $testfile.2 | tail -3 | wc -c
|
||||
echo ""
|
||||
|
||||
inum_2=`ls -li $testfile.2 | $AWK_PROG '{ print $1 }'`
|
||||
|
||||
echo "*** unmount FS"
|
||||
@@ -131,5 +139,4 @@ echo "*** dump attributes (2)"
|
||||
xfs_db -r -c "inode $inum_2" -c "a a.bmx[0].startblock" -c "print" $SCRATCH_DEV
|
||||
|
||||
echo "*** done"
|
||||
rm $seq.full
|
||||
exit
|
||||
|
||||
@@ -2,14 +2,21 @@ QA output created by 021
|
||||
*** mkfs
|
||||
*** mount FS
|
||||
*** make test file 1
|
||||
Attribute "a1" has a 3 byte value for <TESTFILE>.1
|
||||
Attribute "a2--" has a 5 byte value for <TESTFILE>.1
|
||||
# file: <TESTFILE>.1
|
||||
user.a1
|
||||
user.a2--
|
||||
|
||||
*** make test file 2
|
||||
1+0 records in
|
||||
1+0 records out
|
||||
Attribute "a1" has a 8 byte value for <TESTFILE>.2
|
||||
Attribute "a3" has a 65535 byte value for <TESTFILE>.2
|
||||
Attribute "a2-----" has a 8 byte value for <TESTFILE>.2
|
||||
# file: <TESTFILE>.2
|
||||
user.a1
|
||||
user.a2-----
|
||||
user.a3
|
||||
|
||||
Attribute "a3" had a 65535 byte value for <TESTFILE>.2:
|
||||
size of attr value = 65536
|
||||
|
||||
*** unmount FS
|
||||
*** dump attributes (1)
|
||||
a.sfattr.hdr.totsize = 24
|
||||
|
||||
@@ -7,9 +7,9 @@ $SCRATCH_MNT/test.1 [u::r-x,g::---,o::---]
|
||||
$SCRATCH_MNT/test.2 [u::---,g::r-x,o::---]
|
||||
$SCRATCH_MNT/test.3 [u::---,g::---,o::r-x]
|
||||
$SCRATCH_MNT/test.4 [u::---,g::r-x,o::rwx]
|
||||
$SCRATCH_MNT/test.5 [u::---,g::---,o::---,u:id2:r-x,m::rwx]
|
||||
$SCRATCH_MNT/test.5 [u::---,u:id2:r-x,g::---,m::rwx,o::---]
|
||||
$SCRATCH_MNT/test.6 [u::rwx,g::r-x,o::r--]
|
||||
$SCRATCH_MNT/test.7 [u::---,g::---,o::---,g:id2:r-x,m::-w-]
|
||||
$SCRATCH_MNT/test.7 [u::---,g::---,g:id2:r-x,m::-w-,o::---]
|
||||
unmount $SCRATCH_DEV... done
|
||||
repair filesystem... done
|
||||
mount filesytem... done
|
||||
@@ -19,6 +19,6 @@ $SCRATCH_MNT/test.1 [u::r-x,g::---,o::---]
|
||||
$SCRATCH_MNT/test.2 [u::---,g::r-x,o::---]
|
||||
$SCRATCH_MNT/test.3 [u::---,g::---,o::r-x]
|
||||
$SCRATCH_MNT/test.4 [u::---,g::r-x,o::rwx]
|
||||
$SCRATCH_MNT/test.5 [u::---,g::---,o::---,u:id2:r-x,m::rwx]
|
||||
$SCRATCH_MNT/test.5 [u::---,u:id2:r-x,g::---,m::rwx,o::---]
|
||||
$SCRATCH_MNT/test.6 [u::rwx,g::r-x,o::r--]
|
||||
$SCRATCH_MNT/test.7 [u::---,g::---,o::---,g:id2:r-x,m::-w-]
|
||||
$SCRATCH_MNT/test.7 [u::---,g::---,g:id2:r-x,m::-w-,o::---]
|
||||
|
||||
@@ -98,6 +98,8 @@ _acl_on()
|
||||
}
|
||||
|
||||
# real QA test starts here
|
||||
_notrun "irix get semantics no longer required"
|
||||
|
||||
rm -f $seq.full
|
||||
|
||||
_need_to_be_root
|
||||
|
||||
@@ -155,8 +155,8 @@ _extend_test_bed()
|
||||
mkdir -p $SCRATCH_MNT/descend/down/here
|
||||
find $SCRATCH_MNT/descend | xargs setfattr -n user.x -v yz
|
||||
find $SCRATCH_MNT/descend | xargs setfattr -n user.1 -v 23
|
||||
find $SCRATCH_MNT/here | xargs setfattr -n root.a -v bc
|
||||
find $SCRATCH_MNT/here | xargs setfattr -n root.9 -v 87
|
||||
find $SCRATCH_MNT/here | xargs setfattr -n xfsroot.a -v bc
|
||||
find $SCRATCH_MNT/here | xargs setfattr -n xfsroot.9 -v 87
|
||||
# whack a symlink in the middle, just to be difficult
|
||||
ln -s $SCRATCH_MNT/here/up $SCRATCH_MNT/descend/and
|
||||
# dump out our new starting point
|
||||
|
||||
@@ -587,8 +587,6 @@ SCRATCH_MNT/dev/p: xfsroot.name2: No such attribute
|
||||
# file: SCRATCH_MNT/dev/p
|
||||
user.name="\272\276"
|
||||
user.name3="\336\372\316"
|
||||
|
||||
# file: SCRATCH_MNT/dev/p
|
||||
xfsroot.name="\272\276"
|
||||
xfsroot.name3="\336\372\316"
|
||||
|
||||
@@ -735,8 +733,8 @@ user.1=0x3233
|
||||
user.x=0x797a
|
||||
|
||||
# file: SCRATCH_MNT/descend/and/ascend
|
||||
root.9=0x3837
|
||||
root.a=0x6263
|
||||
xfsroot.9=0x3837
|
||||
xfsroot.a=0x6263
|
||||
|
||||
# file: SCRATCH_MNT/descend
|
||||
user.1=0x3233
|
||||
@@ -771,8 +769,6 @@ xfsroot.name3=0xdeface
|
||||
# file: SCRATCH_MNT/dev/p
|
||||
user.name=0xbabe
|
||||
user.name3=0xdeface
|
||||
|
||||
# file: SCRATCH_MNT/dev/p
|
||||
xfsroot.name=0xbabe
|
||||
xfsroot.name3=0xdeface
|
||||
|
||||
|
||||
Reference in New Issue
Block a user