Elliott Hughes | bd471f6 | 2016-07-17 10:42:31 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | [ -f testing.sh ] && . testing.sh |
| 4 | |
| 5 | #testing "name" "command" "result" "infile" "stdin" |
| 6 | |
| 7 | mkdir attrs |
| 8 | touch attrs/file |
| 9 | setfattr -n user.empty attrs/file |
| 10 | setfattr -n user.data -v hello attrs/file |
| 11 | |
| 12 | testing "" "getfattr attrs/file" \ |
| 13 | "# file: attrs/file\nuser.data\nuser.empty\n\n" "" "" |
| 14 | testing "-d" "getfattr -d attrs/file" \ |
| 15 | "# file: attrs/file\nuser.data=\"hello\"\nuser.empty\n\n" "" "" |
| 16 | testing "-n" "getfattr -n user.empty attrs/file" \ |
| 17 | "# file: attrs/file\nuser.empty\n\n" "" "" |
| 18 | testing "-d -n" "getfattr -d -n user.data attrs/file" \ |
| 19 | "# file: attrs/file\nuser.data=\"hello\"\n\n" "" "" |
| 20 | |
| 21 | rm -rf attrs |