summaryrefslogtreecommitdiff
path: root/tests/misc/xattr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/misc/xattr')
-rwxr-xr-xtests/misc/xattr15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/misc/xattr b/tests/misc/xattr
index 4137c53cb..f067ff535 100755
--- a/tests/misc/xattr
+++ b/tests/misc/xattr
@@ -1,6 +1,7 @@
#!/bin/sh
-# Ensure that cp --preserve=xattr and mv preserve extended attributes and
-# install does not preserve extended attributes.
+# Ensure that cp --preserve=xattr, cp --preserve=all and mv preserve extended
+# attributes and install does not preserve extended attributes.
+# cp -a should preserve xattr, error diagnostics should not be displayed
# Copyright (C) 2009 Free Software Foundation, Inc.
@@ -66,6 +67,16 @@ cp --preserve=xattr a b || fail=1
getfattr -d b >out_b || skip_test_ "failed to get xattr of file"
grep -F "$xattr_pair" out_b >/dev/null || fail=1
+#test if --preserve=all option works
+cp --preserve=all a c || fail=1
+getfattr -d c >out_c || skip_test_ "failed to get xattr of file"
+grep -F "$xattr_pair" out_c >/dev/null || fail=1
+
+#test if -a option works without any diagnostics
+cp -a a d 2>err && test -s err && fail=1
+getfattr -d d >out_d || skip_test_ "failed to get xattr of file"
+grep -F "$xattr_pair" out_d >/dev/null || fail=1
+
rm b || framework_failure
# install should never preserve xattr