summaryrefslogtreecommitdiff
path: root/test/attr.test
blob: b1399e8f3ce426b8dcc461dadd6db64c17dd7604 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
!
! Tests for getting/setting extended file attributes with ext2/ext3
! The initial size checks are ext2/ext3 specific, but the remainder
! should work for any extended attributes filesystem (eg. XFS).
!
$ mkdir attr-test
$ touch attr-test/f
! Maximum attribute size for 1024 byte blocks = 1024 - (20+20+4) = 980
$ aset -n user.name -v 968+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ attr-test/f
! Attribute too big for 1024 byte blocks
$ aset -n user.name -v 969++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ attr-test/f
attr-test/f: No space left on device
$ aset -n user.name attr-test/f
$ aget -d attr-test/f
# file: attr-test/f
user.name

$ aset -n user.name -v 0xbabe attr-test/f
$ aset -n user.name2 -v 0xdeadbeef attr-test/f
$ aset -n user.name3 -v 0xdeface attr-test/f
!
!
$ aget -d -e hex attr-test/f
# file: attr-test/f
user.name=0xbabe
user.name2=0xdeadbeef
user.name3=0xdeface

$ aget -d -e base64 attr-test/f
# file: attr-test/f
user.name=0sur4=
user.name2=0s3q2+7w==
user.name3=0s3vrO

!
! shrink value of existing attribute
!
$ aset -n user.name2 -v 0xdeaf attr-test/f
$ aget -d -e hex attr-test/f
# file: attr-test/f
user.name=0xbabe
user.name2=0xdeaf
user.name3=0xdeface

!
! grow value of existing attribute
!
$ aset -n user.name2 -v 0xdecade attr-test/f
$ aget -d -e hex attr-test/f
# file: attr-test/f
user.name=0xbabe
user.name2=0xdecade
user.name3=0xdeface

!
! empty value
!
$ aset -n user.name2 attr-test/f
$ aget -d -n user.name2 attr-test/f
# file: attr-test/f
user.name2

!
! overwrite empty value
!
$ aset -n user.name2 -v 0xcafe attr-test/f
$ aget -d -e hex -n user.name2 attr-test/f
# file: attr-test/f
user.name2=0xcafe

!
! remove attribute
!
$ aset -x user.name2 attr-test/f
$ aget -d -n user.name2 attr-test/f
attr-test/f: user.name2: No such attribute
$ rm attr-test/f
$ rmdir attr-test