summaryrefslogtreecommitdiff
path: root/tests/15_xattr_add.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/15_xattr_add.sh')
-rwxr-xr-xtests/15_xattr_add.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/15_xattr_add.sh b/tests/15_xattr_add.sh
new file mode 100755
index 0000000..18156aa
--- /dev/null
+++ b/tests/15_xattr_add.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+TEST_ID="15"
+TEST_NAME="Extended Attributes manipulation"
+
+CREATE=`pwd`/$1
+DEPLOY=`pwd`/$2
+TEST_TOOLS=$3
+
+. ./test_lib.sh
+
+############# Test specific code ############
+if is_command getfattr && is_command setfattr; then :; else
+ echo Test requires commands: getfattr, setfattr, attr >&2
+ exit 127
+fi
+
+setup () {
+ touch $ORIGIN/file &&
+ setfattr -n "user.preserve" -v "true" $ORIGIN/file &&
+ setfattr -n "user.change" -v "false" $ORIGIN/file &&
+ setfattr -n "user.remove" -v "false" $ORIGIN/file &&
+ touch $TARGET/file &&
+ setfattr -n "user.preserve" -v "true" $TARGET/file &&
+ setfattr -n "user.change" -v "true" $TARGET/file &&
+ setfattr -n "user.add" -v "true" $TARGET/file
+}
+
+check_results () {
+ check_xattrs $ORIGIN/file $TARGET/file
+}
+
+#############################################
+main $@