generic/554: hide permision warning on exfat
[xfstests-dev.git] / tests / generic / 533
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
4 # Copyright (c) 2017 Google, Inc.  All Rights Reserved.
5 # Copyright (c) 2019 Red Hat Inc.  All Rights Reserved.
6 #
7 # FS QA Test No. 526.
8 #
9 # Simple attr smoke tests for user EAs, dereived from generic/097.
10 #
11 seq=`basename $0`
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
14
15 here=`pwd`
16 tmp=/tmp/$$
17 status=1        # failure is the default!
18 trap "_cleanup; exit \$status" 0 1 2 3 15
19
20 file=$TEST_DIR/foo.$seq
21
22 _cleanup()
23 {
24         cd /
25         rm -f $tmp.*
26 }
27
28 getfattr()
29 {
30         _getfattr --absolute-names "$@" |& _filter_test_dir
31 }
32
33 setfattr()
34 {
35         $SETFATTR_PROG "$@" |& _filter_test_dir
36 }
37
38 # get standard environment, filters and checks
39 . ./common/rc
40 . ./common/attr
41 . ./common/filter
42
43 # real QA test starts here
44 _supported_fs generic
45
46 _require_test
47 _require_attrs
48
49 # remove previous $seqres.full before test
50 rm -f $seqres.full
51
52 echo -e "\ncreate file foo.$seq"
53 rm -f $file
54 touch $file
55
56 echo -e "\nshould be no EAs for foo.$seq:"
57 getfattr -d $file
58
59 echo -e "\nset EA <NOISE,woof>:"
60 setfattr -n user.NOISE -v woof $file
61
62 echo -e "\nset EA <COLOUR,blue>:"
63 setfattr -n user.COLOUR -v blue $file
64
65 echo -e "\nset EA <SIZE,small>:"
66 setfattr -n user.SIZE -v small $file
67
68 echo -e "\nlist the EAs for foo.$seq: NOISE, COLOUR, SIZE"
69 getfattr -d $file
70
71 echo -e "\ncheck the list again for foo.$seq"
72 getfattr -d $file
73
74 echo -e "\nunmount the FS and see if EAs are persistent"
75 _test_cycle_mount
76
77 echo -e "\ncheck the list again for foo.$seq after umount/mount"
78 getfattr -d $file
79
80 echo -e "\nremove the COLOUR EA on foo.$seq"
81 setfattr -x user.COLOUR $file
82
83 echo -e "\nlist EAs for foo.$seq: NOISE, SIZE"
84 getfattr -d $file
85
86 echo -e "\nget the value of the NOISE EA"
87 getfattr -n user.NOISE $file
88
89 echo -e "\nget the value of the COLOUR EA which was removed earlier"
90 getfattr -n user.COLOUR $file
91
92 echo -e "\nget the value of the SIZE EA"
93 getfattr -n user.SIZE $file
94
95 echo -e "\nlist all the EAs again: NOISE, SIZE"
96 getfattr -d $file
97
98 echo -e "\nchange the value of the SIZE EA from small to huge"
99 setfattr -n user.SIZE -v huge $file
100
101 echo -e "\nget the SIZE EA which should now have value huge"
102 getfattr -n user.SIZE $file
103
104 echo -e "\nlist EAs: NOISE, SIZE"
105 getfattr -d $file
106
107 echo -e "\nremove the SIZE EA from foo.$seq"
108 setfattr -x user.SIZE $file
109
110 echo -e "\nlist EAs: NOISE (SIZE EA has been removed)"
111 getfattr -d $file
112
113 echo -e "\ntry removing non-existent EA named woof"
114 setfattr -x user.WOOF $file
115
116 echo -e "\ntry removing already removed EA SIZE"
117 setfattr -x user.SIZE $file
118
119 echo -e "\nlist EAs: NOISE"
120 getfattr -d $file
121
122 echo -e "\ntry removing already removed EA COLOUR"
123 setfattr -x user.COLOUR $file
124
125 echo -e "\nlist EAs: NOISE"
126 getfattr -d $file
127
128 echo -e "\nremove remaining EA NOISE"
129 setfattr -x user.NOISE $file
130
131 echo -e "\nlist EAs: should be no EAs left now"
132 getfattr -d $file
133
134 echo -e "\nunmount the FS and see if EAs are persistent"
135 _test_cycle_mount
136
137 echo -e "\nlist EAs: should still be no EAs left"
138 getfattr -d $file
139
140 # success, all done
141 status=0
142 exit