diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/cp/acl | 22 | ||||
-rwxr-xr-x | tests/cp/reflink-perm | 4 |
2 files changed, 17 insertions, 9 deletions
diff --git a/tests/cp/acl b/tests/cp/acl index 010348a9d..c19eb4e93 100755 --- a/tests/cp/acl +++ b/tests/cp/acl @@ -36,28 +36,32 @@ grep '^#define USE_ACL 1' $CONFIG_HEADER > /dev/null || mkdir -p a b || framework_failure touch a/file || framework_failure -skip=no # Ensure that setfacl and getfacl work on this file system. +skip=no +acl1=`cd a && getfacl file` || skip=yes setfacl -m user:bin:rw a/file 2> /dev/null || skip=yes -acl1=`cd a && getfacl file | grep -v ':bin:' | grep -v 'mask::'` \ - || skip=yes - test $skip = yes && skip_test_ "'.' is not on a suitable file system for this test" # copy a file without preserving permissions cp a/file b/ || fail=1 - acl2=`cd b && getfacl file` || framework_failure test "$acl1" = "$acl2" || fail=1 -rm a/file || framework_failure -# copy a file, preserving permissions -touch a/file || framework_failure -setfacl -m user:bin:rw a/file || framework_failure +# Update with acl set above acl1=`cd a && getfacl file` || framework_failure + +# copy a file, preserving permissions cp -p a/file b/ || fail=1 acl2=`cd b && getfacl file` || framework_failure test "$acl1" = "$acl2" || fail=1 +# copy a file, preserving permissions, with --attributes-only +echo > a/file || framework_failure # add some data +test -s a/file || framework_failure +cp -p --attributes-only a/file b/ || fail=1 +test -s b/file && fail=1 +acl2=`cd b && getfacl file` || framework_failure +test "$acl1" = "$acl2" || fail=1 + Exit $fail diff --git a/tests/cp/reflink-perm b/tests/cp/reflink-perm index 92cb7ae8f..77f119f4a 100755 --- a/tests/cp/reflink-perm +++ b/tests/cp/reflink-perm @@ -39,4 +39,8 @@ test "$mode" = "-rwxrwxrwx" || fail=1 test copy -nt file && fail=1 +echo > file2 # file with data +cp --reflink=auto --preserve --attributes-only file2 empty_copy || fail=1 +test -s empty_copy && fail=1 + Exit $fail |