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.
6 # FS QA Test No. 097. Modifed from UDFQA test 033.
8 # simple attr tests for EAs:
16 _begin_fstest attr auto quick
20 # Override the default cleanup function.
28 _getfattr --absolute-names "$@" |& _filter_test_dir
33 $SETFATTR_PROG "$@" |& _filter_test_dir
36 # Import common functions.
40 # real QA test starts here
44 _require_attrs user trusted
46 echo -e "\ncreate file foo"
50 echo -e "\n*** Test out the trusted namespace ***"
52 echo -e "\nset EA <trusted:colour,marone>:"
53 setfattr -n trusted.colour -v marone $file
55 echo -e "\nset EA <user:colour,beige>:"
56 setfattr -n user.colour -v beige $file
58 echo -e "\nset EA <user:vomit,pizza>:"
59 setfattr -n user.vomit -v pizza $file
61 echo -e "\nset EA <trusted:noise,whack>:"
62 setfattr -n trusted.noise -v whack $file
64 echo -e "\nlist trusted EAs: <trusted:colour,noise>:"
65 getfattr -d -m '^trusted\.' $file
67 echo -e "\nlist user EAs: <user:colour,vomit>:"
70 echo -e "\nget trusted EA colour: marone"
71 getfattr -n trusted.colour $file
73 echo -e "\nget trusted EA noise: whack"
74 getfattr -n trusted.noise $file
76 echo -e "\nget trusted EA vomit which is a user EA => find nothing"
77 getfattr -n trusted.vomit $file
79 echo -e "\nunmount the FS and see if EAs are persistent"
82 echo -e "\nget trusted EA colour: marone"
83 getfattr -n trusted.colour $file
85 echo -e "\nget trusted EA noise: whack"
86 getfattr -n trusted.noise $file
88 echo -e "\nget user EA vomit: pizza"
89 getfattr -n user.vomit $file
91 echo -e "\nremove the trusted colour EA"
92 setfattr -x trusted.colour $file
94 echo -e "\nlist trusted EAs: <trusted:noise>:"
95 getfattr -d -m '^trusted\.' $file
97 echo -e "\nlist user EAs: <user:colour,vomit>:"
100 echo -e "\nremove the final trusted EA noise"
101 setfattr -x trusted.noise $file
103 echo -e "\nlist trusted EAs: none"
104 getfattr -d -m '^trusted\.' $file