You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
736 B
22 lines
736 B
#!/bin/bash
|
|
|
|
[ -f testing.sh ] && . testing.sh
|
|
|
|
#testing "name" "command" "result" "infile" "stdin"
|
|
|
|
mkdir attrs
|
|
touch attrs/file
|
|
setfattr -n user.empty attrs/file
|
|
setfattr -n user.data -v hello attrs/file
|
|
setfattr -n user.delete-me -v hello attrs/file
|
|
|
|
testing "-x" \
|
|
"setfattr -x user.delete-me attrs/file && getfattr attrs/file" \
|
|
"# file: attrs/file\nuser.data\nuser.empty\n\n" "" ""
|
|
testing "-n" "setfattr -n user.new attrs/file && getfattr -d attrs/file" \
|
|
"# file: attrs/file\nuser.data=\"hello\"\nuser.empty\nuser.new\n\n" "" ""
|
|
testing "-n -v" "setfattr -n user.new -v data attrs/file && getfattr -d attrs/file" \
|
|
"# file: attrs/file\nuser.data=\"hello\"\nuser.empty\nuser.new=\"data\"\n\n" "" ""
|
|
|
|
rm -rf attrs
|