More tests.

This commit is contained in:
Pawel Jakub Dawidek 2010-08-18 22:06:43 +00:00
parent 44510b41ff
commit af8ec89da4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=211474
15 changed files with 120 additions and 135 deletions

View File

@ -8,13 +8,15 @@ dir=`dirname $0`
require chflags
echo "1..5"
echo "1..17"
n0=`namegen`
n1=`namegen`
expect 0 mkdir ${n0} 0755
expect 0 create ${n0}/${n1} 0644
expect ENOTDIR chflags ${n0}/${n1}/test SF_IMMUTABLE
expect 0 unlink ${n0}/${n1}
for type in regular fifo block char socket; do
create_file ${type} ${n0}/${n1}
expect ENOTDIR chflags ${n0}/${n1}/test SF_IMMUTABLE
expect 0 unlink ${n0}/${n1}
done
expect 0 rmdir ${n0}

View File

@ -6,13 +6,15 @@ desc="chmod returns ENOTDIR if a component of the path prefix is not a directory
dir=`dirname $0`
. ${dir}/../misc.sh
echo "1..5"
echo "1..17"
n0=`namegen`
n1=`namegen`
expect 0 mkdir ${n0} 0755
expect 0 create ${n0}/${n1} 0644
expect ENOTDIR chmod ${n0}/${n1}/test 0644
expect 0 unlink ${n0}/${n1}
for type in regular fifo block char socket; do
create_file ${type} ${n0}/${n1}
expect ENOTDIR chmod ${n0}/${n1}/test 0644
expect 0 unlink ${n0}/${n1}
done
expect 0 rmdir ${n0}

View File

@ -7,9 +7,9 @@ dir=`dirname $0`
. ${dir}/../misc.sh
if supported lchmod; then
echo "1..8"
echo "1..10"
else
echo "1..6"
echo "1..8"
fi
n0=`namegen`
@ -17,6 +17,8 @@ n1=`namegen`
expect 0 symlink ${n0} ${n1}
expect 0 symlink ${n1} ${n0}
expect ELOOP chmod ${n0} 0644
expect ELOOP chmod ${n1} 0644
expect ELOOP chmod ${n0}/test 0644
expect ELOOP chmod ${n1}/test 0644
if supported lchmod; then

View File

@ -6,14 +6,16 @@ desc="chown returns ENOTDIR if a component of the path prefix is not a directory
dir=`dirname $0`
. ${dir}/../misc.sh
echo "1..6"
echo "1..22"
n0=`namegen`
n1=`namegen`
expect 0 mkdir ${n0} 0755
expect 0 create ${n0}/${n1} 0644
expect ENOTDIR chown ${n0}/${n1}/test 65534 65534
expect ENOTDIR lchown ${n0}/${n1}/test 65534 65534
expect 0 unlink ${n0}/${n1}
for type in regular fifo block char socket; do
create_file ${type} ${n0}/${n1}
expect ENOTDIR chown ${n0}/${n1}/test 65534 65534
expect ENOTDIR lchown ${n0}/${n1}/test 65534 65534
expect 0 unlink ${n0}/${n1}
done
expect 0 rmdir ${n0}

View File

@ -6,17 +6,19 @@ desc="link returns ENOTDIR if a component of either path prefix is not a directo
dir=`dirname $0`
. ${dir}/../misc.sh
echo "1..8"
echo "1..32"
n0=`namegen`
n1=`namegen`
n2=`namegen`
expect 0 mkdir ${n0} 0755
expect 0 create ${n0}/${n1} 0644
expect ENOTDIR link ${n0}/${n1}/test ${n0}/${n2}
expect 0 create ${n0}/${n2} 0644
expect ENOTDIR link ${n0}/${n2} ${n0}/${n1}/test
expect 0 unlink ${n0}/${n1}
expect 0 unlink ${n0}/${n2}
for type in regular fifo block char socket; do
create_file ${type} ${n0}/${n1}
expect ENOTDIR link ${n0}/${n1}/test ${n0}/${n2}
create_file ${type} ${n0}/${n2}
expect ENOTDIR link ${n0}/${n2} ${n0}/${n1}/test
expect 0 unlink ${n0}/${n1}
expect 0 unlink ${n0}/${n2}
done
expect 0 rmdir ${n0}

View File

@ -6,27 +6,21 @@ desc="link returns EEXIST if the destination file does exist"
dir=`dirname $0`
. ${dir}/../misc.sh
echo "1..14"
echo "1..23"
n0=`namegen`
n1=`namegen`
expect 0 create ${n0} 0644
expect 0 create ${n1} 0644
expect EEXIST link ${n0} ${n1}
expect 0 unlink ${n1}
expect 0 mkdir ${n1} 0755
expect EEXIST link ${n0} ${n1}
expect 0 rmdir ${n1}
expect 0 symlink test ${n1}
expect EEXIST link ${n0} ${n1}
expect 0 unlink ${n1}
expect 0 mkfifo ${n1} 0644
expect EEXIST link ${n0} ${n1}
expect 0 unlink ${n1}
for type in regular dir fifo block char socket symlink; do
create_file ${type} ${n1}
expect EEXIST link ${n0} ${n1}
if [ "${type}" = "dir" ]; then
expect 0 rmdir ${n1}
else
expect 0 unlink ${n1}
fi
done
expect 0 unlink ${n0}

View File

@ -6,13 +6,15 @@ desc="mkdir returns ENOTDIR if a component of the path prefix is not a directory
dir=`dirname $0`
. ${dir}/../misc.sh
echo "1..5"
echo "1..17"
n0=`namegen`
n1=`namegen`
expect 0 mkdir ${n0} 0755
expect 0 create ${n0}/${n1} 0644
expect ENOTDIR mkdir ${n0}/${n1}/test 0755
expect 0 unlink ${n0}/${n1}
for type in regular fifo block char socket; do
create_file ${type} ${n0}/${n1}
expect ENOTDIR mkdir ${n0}/${n1}/test 0755
expect 0 unlink ${n0}/${n1}
done
expect 0 rmdir ${n0}

View File

@ -6,13 +6,15 @@ desc="mkfifo returns ENOTDIR if a component of the path prefix is not a director
dir=`dirname $0`
. ${dir}/../misc.sh
echo "1..5"
echo "1..17"
n0=`namegen`
n1=`namegen`
expect 0 mkdir ${n0} 0755
expect 0 create ${n0}/${n1} 0644
expect ENOTDIR mkfifo ${n0}/${n1}/test 0644
expect 0 unlink ${n0}/${n1}
for type in regular fifo block char socket; do
create_file ${type} ${n0}/${n1}
expect ENOTDIR mkfifo ${n0}/${n1}/test 0644
expect 0 unlink ${n0}/${n1}
done
expect 0 rmdir ${n0}

View File

@ -6,22 +6,16 @@ desc="mkfifo returns EEXIST if the named file exists"
dir=`dirname $0`
. ${dir}/../misc.sh
echo "1..12"
echo "1..21"
n0=`namegen`
expect 0 mkdir ${n0} 0755
expect EEXIST mkfifo ${n0} 0644
expect 0 rmdir ${n0}
expect 0 create ${n0} 0644
expect EEXIST mkfifo ${n0} 0644
expect 0 unlink ${n0}
expect 0 symlink test ${n0}
expect EEXIST mkfifo ${n0} 0644
expect 0 unlink ${n0}
expect 0 mkfifo ${n0} 0644
expect EEXIST mkfifo ${n0} 0644
expect 0 unlink ${n0}
for type in regular dir fifo block char socket symlink; do
create_file ${type} ${n0}
expect EEXIST mkfifo ${n0} 0644
if [ "${type}" = "dir" ]; then
expect 0 rmdir ${n0}
else
expect 0 unlink ${n0}
fi
done

View File

@ -6,13 +6,17 @@ desc="mknod returns ENOTDIR if a component of the path prefix is not a directory
dir=`dirname $0`
. ${dir}/../misc.sh
echo "1..5"
echo "1..27"
n0=`namegen`
n1=`namegen`
expect 0 mkdir ${n0} 0755
expect 0 create ${n0}/${n1} 0644
expect ENOTDIR mknod ${n0}/${n1}/test f 0644 0 0
expect 0 unlink ${n0}/${n1}
for type in regular fifo block char socket; do
create_file ${type} ${n0}/${n1}
expect ENOTDIR mknod ${n0}/${n1}/test b 0644 1 2
expect ENOTDIR mknod ${n0}/${n1}/test c 0644 1 2
expect ENOTDIR mknod ${n0}/${n1}/test f 0644 0 0
expect 0 unlink ${n0}/${n1}
done
expect 0 rmdir ${n0}

View File

@ -6,30 +6,18 @@ desc="mknod returns EEXIST if the named file exists"
dir=`dirname $0`
. ${dir}/../misc.sh
echo "1..18"
echo "1..35"
n0=`namegen`
expect 0 mkdir ${n0} 0755
expect EEXIST mknod ${n0} f 0644 0 0
expect 0 rmdir ${n0}
expect 0 create ${n0} 0644
expect EEXIST mknod ${n0} f 0644 0 0
expect 0 unlink ${n0}
expect 0 symlink test ${n0}
expect EEXIST mknod ${n0} f 0644 0 0
expect 0 unlink ${n0}
expect 0 mkfifo ${n0} 0644
expect EEXIST mknod ${n0} f 0644 0 0
expect 0 unlink ${n0}
expect 0 bind ${n0}
expect EEXIST mknod ${n0} f 0644 0 0
expect 0 unlink ${n0}
expect 0 mknod ${n0} f 0644 0 0
expect EEXIST mknod ${n0} f 0644 0 0
expect 0 unlink ${n0}
for type in regular dir fifo block char socket symlink; do
create_file ${type} ${n0}
expect EEXIST mknod ${n0} b 0644 0 0
expect EEXIST mknod ${n0} c 0644 0 0
expect EEXIST mknod ${n0} f 0644 0 0
if [ "${type}" = "dir" ]; then
expect 0 rmdir ${n0}
else
expect 0 unlink ${n0}
fi
done

View File

@ -6,13 +6,16 @@ desc="open returns ENOTDIR if a component of the path prefix is not a directory"
dir=`dirname $0`
. ${dir}/../misc.sh
echo "1..5"
echo "1..22"
n0=`namegen`
n1=`namegen`
expect 0 mkdir ${n0} 0755
expect 0 create ${n0}/${n1} 0644
expect ENOTDIR open ${n0}/${n1}/test O_CREAT 0644
expect 0 unlink ${n0}/${n1}
for type in regular fifo block char socket; do
create_file ${type} ${n0}/${n1}
expect ENOTDIR open ${n0}/${n1}/test O_RDONLY
expect ENOTDIR open ${n0}/${n1}/test O_CREAT 0644
expect 0 unlink ${n0}/${n1}
done
expect 0 rmdir ${n0}

View File

@ -6,17 +6,19 @@ desc="rename returns ENOTDIR if a component of either path prefix is not a direc
dir=`dirname $0`
. ${dir}/../misc.sh
echo "1..8"
echo "1..32"
n0=`namegen`
n1=`namegen`
n2=`namegen`
expect 0 mkdir ${n0} 0755
expect 0 create ${n0}/${n1} 0644
expect ENOTDIR rename ${n0}/${n1}/test ${n0}/${n2}
expect 0 create ${n0}/${n2} 0644
expect ENOTDIR link ${n0}/${n2} ${n0}/${n1}/test
expect 0 unlink ${n0}/${n1}
expect 0 unlink ${n0}/${n2}
for type in regular fifo block char socket; do
create_file ${type} ${n0}/${n1}
expect ENOTDIR rename ${n0}/${n1}/test ${n0}/${n2}
create_file ${type} ${n0}/${n2}
expect ENOTDIR link ${n0}/${n2} ${n0}/${n1}/test
expect 0 unlink ${n0}/${n1}
expect 0 unlink ${n0}/${n2}
done
expect 0 rmdir ${n0}

View File

@ -6,31 +6,19 @@ desc="rmdir returns EEXIST or ENOTEMPTY the named directory contains files other
dir=`dirname $0`
. ${dir}/../misc.sh
echo "1..20"
echo "1..23"
n0=`namegen`
n1=`namegen`
expect 0 mkdir ${n0} 0755
expect 0 mkdir ${n0}/${n1} 0755
expect "EEXIST|ENOTEMPTY" rmdir ${n0}
expect 0 rmdir ${n0}/${n1}
expect 0 rmdir ${n0}
expect 0 mkdir ${n0} 0755
expect 0 create ${n0}/${n1} 0644
expect "EEXIST|ENOTEMPTY" rmdir ${n0}
expect 0 unlink ${n0}/${n1}
expect 0 rmdir ${n0}
expect 0 mkdir ${n0} 0755
expect 0 symlink test ${n0}/${n1}
expect "EEXIST|ENOTEMPTY" rmdir ${n0}
expect 0 unlink ${n0}/${n1}
expect 0 rmdir ${n0}
expect 0 mkdir ${n0} 0755
expect 0 mkfifo ${n0}/${n1} 0644
expect "EEXIST|ENOTEMPTY" rmdir ${n0}
expect 0 unlink ${n0}/${n1}
for type in regular dir fifo block char socket symlink; do
create_file ${type} ${n0}/${n1}
expect "EEXIST|ENOTEMPTY" rmdir ${n0}
if [ "${type}" = "dir" ]; then
expect 0 rmdir ${n0}/${n1}
else
expect 0 unlink ${n0}/${n1}
fi
done
expect 0 rmdir ${n0}

View File

@ -6,18 +6,16 @@ desc="symlink returns EEXIST if the name2 argument already exists"
dir=`dirname $0`
. ${dir}/../misc.sh
echo "1..9"
echo "1..21"
n0=`namegen`
expect 0 create ${n0} 0644
expect EEXIST symlink test ${n0}
expect 0 unlink ${n0}
expect 0 mkdir ${n0} 0755
expect EEXIST symlink test ${n0}
expect 0 rmdir ${n0}
expect 0 symlink test ${n0}
expect EEXIST symlink test ${n0}
expect 0 unlink ${n0}
for type in regular dir fifo block char socket symlink; do
create_file ${type} ${n0}
expect EEXIST symlink test ${n0}
if [ "${type}" = "dir" ]; then
expect 0 rmdir ${n0}
else
expect 0 unlink ${n0}
fi
done