OSDN Git Service

Merge tag 'android-8.1.0_r1' into oreo-x86
[android-x86/external-toybox.git] / tests / getfattr.test
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