*** empty log message ***
[coreutils.git] / tests / mv / partition-perm
blobef5882ba21fae623581194af44d861b77eca1f01
1 #!/bin/sh
2 # Make sure permissions are preserved when moving from one partition to another.
4 if test "$VERBOSE" = yes; then
5 set -x
6 mv --version
7 fi
9 . $srcdir/setup
11 if test -z "$other_partition_tmpdir"; then
12 exit 77
15 LANGUAGE=C; export LANGUAGE
16 LANG=C; export LANG
18 pwd=`pwd`
19 dir=p-perm-$$
20 trap "cd $pwd; rm -rf $dir $other_partition_tmpdir" 0 1 2 3 15
22 mkdir $dir
23 unset VERSION_CONTROL SIMPLE_BACKUP_SUFFIX
25 if test "${VERSION_CONTROL+set}" = set; then
26 echo '$0: the VERSION_CONTROL envvar is set --' \
27 ' unset it and rerun this test' >&2
28 exit 1
31 if test "${SIMPLE_BACKUP_SUFFIX+set}" = set; then
32 echo '$0: the SIMPLE_BACKUP_SUFFIX envvar is set --' \
33 ' unset it and rerun this test' >&2
34 >&2
35 exit 1
38 cd $dir
39 : > file
40 chmod a=rwx file
42 umask 777
43 mv file $other_partition_tmpdir
45 fail=0
46 test -f file && fail=1
47 test -f $other_partition_tmpdir/file || fail=1
49 # This would have failed with the mv from fileutils-4.0i.
50 test -r $other_partition_tmpdir/file || fail=1
52 exit $fail