Deleted Added
full compact
13.t (211156) 13.t (211186)
1#!/bin/sh
1#!/bin/sh
2# $FreeBSD: head/tools/regression/fstest/tests/rename/13.t 211156 2010-08-10 22:57:43Z pjd $
2# $FreeBSD: head/tools/regression/fstest/tests/rename/13.t 211186 2010-08-11 17:34:58Z pjd $
3
4desc="rename returns ENOTDIR when the 'from' argument is a directory, but 'to' is not a directory"
5
6dir=`dirname $0`
7. ${dir}/../misc.sh
8
9echo "1..32"
10
11n0=`namegen`
12n1=`namegen`
13
14expect 0 mkdir ${n0} 0755
15
3
4desc="rename returns ENOTDIR when the 'from' argument is a directory, but 'to' is not a directory"
5
6dir=`dirname $0`
7. ${dir}/../misc.sh
8
9echo "1..32"
10
11n0=`namegen`
12n1=`namegen`
13
14expect 0 mkdir ${n0} 0755
15
16expect 0 create ${n1} 0644
17expect ENOTDIR rename ${n0} ${n1}
18expect dir lstat ${n0} type
19expect regular lstat ${n1} type
20expect 0 unlink ${n1}
16for type in regular fifo block char socket symlink; do
17 create_file ${type} ${n1}
18 expect ENOTDIR rename ${n0} ${n1}
19 expect dir lstat ${n0} type
20 expect ${type} lstat ${n1} type
21 expect 0 unlink ${n1}
22done
21
23
22expect 0 mkfifo ${n1} 0644
23expect ENOTDIR rename ${n0} ${n1}
24expect dir lstat ${n0} type
25expect fifo lstat ${n1} type
26expect 0 unlink ${n1}
27
28expect 0 mknod ${n1} b 0644 1 2
29expect ENOTDIR rename ${n0} ${n1}
30expect dir lstat ${n0} type
31expect block lstat ${n1} type
32expect 0 unlink ${n1}
33
34expect 0 mknod ${n1} c 0644 1 2
35expect ENOTDIR rename ${n0} ${n1}
36expect dir lstat ${n0} type
37expect char lstat ${n1} type
38expect 0 unlink ${n1}
39
40expect 0 bind ${n1}
41expect ENOTDIR rename ${n0} ${n1}
42expect dir lstat ${n0} type
43expect socket lstat ${n1} type
44expect 0 unlink ${n1}
45
46expect 0 symlink test ${n1}
47expect ENOTDIR rename ${n0} ${n1}
48expect dir lstat ${n0} type
49expect symlink lstat ${n1} type
50expect 0 unlink ${n1}
51
52expect 0 rmdir ${n0}
24expect 0 rmdir ${n0}