xref: /freebsd/contrib/pjdfstest/tests/rename/13.t (revision 580744621f33383027108364dcadad718df46ffe)
1#!/bin/sh
2# vim: filetype=sh noexpandtab ts=8 sw=8
3# $FreeBSD: head/tools/regression/pjdfstest/tests/rename/13.t 211352 2010-08-15 21:24:17Z pjd $
4
5desc="rename returns ENOTDIR when the 'from' argument is a directory, but 'to' is not a directory"
6
7dir=`dirname $0`
8. ${dir}/../misc.sh
9
10echo "1..32"
11
12n0=`namegen`
13n1=`namegen`
14
15expect 0 mkdir ${n0} 0755
16
17for type in regular fifo block char socket symlink; do
18	create_file ${type} ${n1}
19	expect ENOTDIR rename ${n0} ${n1}
20	expect dir lstat ${n0} type
21	expect ${type} lstat ${n1} type
22	expect 0 unlink ${n1}
23done
24
25expect 0 rmdir ${n0}
26