4 # A directory in a device different from that where the tests are run
8 # Begin an individual test
11 COUNT=`expr $COUNT + 1`
17 NAME="$1 (cross device)"
19 rm -rf testdir $TMPDIR/testdir
20 mkdir -p testdir $TMPDIR/testdir
24 # End an individual test
35 rm -rf testdir $TMPDIR/testdir
38 # Make a file that can later be verified
45 # Verify that the file specified is correct
48 if [ -f $2 ] && echo "$1-$1" | diff - $2 >/dev/null
56 # Make a fifo that can later be verified
62 # Verify that the file specified is correct
73 # Make a directory that can later be verified
80 # Verify that the directory specified is correct
91 # Verify that the specified file does not exist
103 # A part of a test succeeds
109 # A part of a test fails
115 # Verify that the exit code passed is for unsuccessful termination
126 # Verify that the exit code passed is for successful termination
137 # Run all tests locally and across devices
139 for FS in '' $TMPDIR/testdir/
149 begin 'Move files into directory'
161 begin 'Move file from directory to file'
170 begin 'Move file from directory to existing file'
180 begin 'Move file from directory to existing directory'
184 # Should fail per POSIX step 3a:
185 # Destination path is a file of type directory and
186 # source_file is not a file of type directory
187 mv 1/2/3/fa ${FS}db 2>/dev/null
192 begin 'Move file from directory to directory'
194 mkdir -p ${FS}db1/db2/db3
196 mv da1/da2/da3/fa ${FS}db1/db2/db3/fb
198 ckf fa ${FS}db1/db2/db3/fb
202 begin 'Rename directory'
210 begin 'Move directory to directory name'
212 mkdir -p ${FS}db1/db2/db3
213 mv da1/da2/da3/da ${FS}db1/db2/db3/db
215 ckd da ${FS}db1/db2/db3/db
219 begin 'Move directory to directory'
221 mkdir -p ${FS}db1/db2/db3
222 mv da1/da2/da3/da ${FS}db1/db2/db3
224 ckd da ${FS}db1/db2/db3/da
228 begin 'Move directory to existing empty directory'
230 mkdir -p ${FS}db1/db2/db3/da
231 mv da1/da2/da3/da ${FS}db1/db2/db3
233 ckd da ${FS}db1/db2/db3/da
237 begin 'Move directory to existing non-empty directory'
239 mkdir -p ${FS}db1/db2/db3/da/full
240 # Should fail (per the semantics of rename(2))
241 mv da1/da2/da3/da ${FS}db1/db2/db3 2>/dev/null
243 ckd da da1/da2/da3/da
246 begin 'Move directory to existing file'
248 mkdir -p ${FS}db1/db2/db3
249 :> ${FS}db1/db2/db3/da
250 # Should fail per POSIX step 3b:
251 # Destination path is a file not of type directory
252 # and source_file is a file of type directory
253 mv da1/da2/da3/da ${FS}db1/db2/db3/da 2>/dev/null
255 ckd da da1/da2/da3/da
266 begin 'Move fifos into directory'
278 begin 'Move fifo from directory to fifo'
287 begin 'Move fifo from directory to directory'
289 mkdir -p ${FS}db1/db2/db3
291 mv da1/da2/da3/fa ${FS}db1/db2/db3/fb
293 ckp fa ${FS}db1/db2/db3/fb