1271294Sngie#!/bin/sh
2271294Sngie# $FreeBSD: head/tools/regression/pjdfstest/tests/rmdir/12.t 211352 2010-08-15 21:24:17Z pjd $
3271294Sngie
4271294Sngiedesc="rmdir returns EINVAL if the last component of the path is '.' and EEXIST or ENOTEMPTY if the last component of the path is '..'"
5271294Sngie
6271294Sngiedir=`dirname $0`
7271294Sngie. ${dir}/../misc.sh
8271294Sngie
9271294Sngieecho "1..6"
10271294Sngie
11271294Sngien0=`namegen`
12271294Sngien1=`namegen`
13271294Sngie
14271294Sngieexpect 0 mkdir ${n0} 0755
15271294Sngieexpect 0 mkdir ${n0}/${n1} 0755
16271294Sngieexpect EINVAL rmdir ${n0}/${n1}/.
17271294Sngietodo FreeBSD "According to POSIX: EEXIST or ENOTEMPTY - The path argument names a directory that is not an empty directory, or there are hard links to the directory other than dot or a single entry in dot-dot."
18271294Sngieexpect "ENOTEMPTY|EEXIST" rmdir ${n0}/${n1}/..
19271294Sngieexpect 0 rmdir ${n0}/${n1}
20271294Sngieexpect 0 rmdir ${n0}
21