aboutsummaryrefslogtreecommitdiff
path: root/tests/getfattr.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/getfattr.test')
-rwxr-xr-xtests/getfattr.test21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/getfattr.test b/tests/getfattr.test
new file mode 100755
index 00000000..cb0f9475
--- /dev/null
+++ b/tests/getfattr.test
@@ -0,0 +1,21 @@
+#!/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
+
+testing "" "getfattr attrs/file" \
+ "# file: attrs/file\nuser.data\nuser.empty\n\n" "" ""
+testing "-d" "getfattr -d attrs/file" \
+ "# file: attrs/file\nuser.data=\"hello\"\nuser.empty\n\n" "" ""
+testing "-n" "getfattr -n user.empty attrs/file" \
+ "# file: attrs/file\nuser.empty\n\n" "" ""
+testing "-d -n" "getfattr -d -n user.data attrs/file" \
+ "# file: attrs/file\nuser.data=\"hello\"\n\n" "" ""
+
+rm -rf attrs