summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2010-08-18 22:06:43 +0000
committerpjd <pjd@FreeBSD.org>2010-08-18 22:06:43 +0000
commitd2e0fb8db2bd08dedff42d79d6179b153aa934f1 (patch)
treece424c7968596fe1e38920ca5b01648443bc6dc9
parent28527a66ab56e4258d8489f2e9e25f943f36b9b9 (diff)
downloadFreeBSD-src-d2e0fb8db2bd08dedff42d79d6179b153aa934f1.zip
FreeBSD-src-d2e0fb8db2bd08dedff42d79d6179b153aa934f1.tar.gz
More tests.
-rw-r--r--tools/regression/pjdfstest/tests/chflags/01.t10
-rw-r--r--tools/regression/pjdfstest/tests/chmod/01.t10
-rw-r--r--tools/regression/pjdfstest/tests/chmod/06.t6
-rw-r--r--tools/regression/pjdfstest/tests/chown/01.t12
-rw-r--r--tools/regression/pjdfstest/tests/link/01.t16
-rw-r--r--tools/regression/pjdfstest/tests/link/10.t26
-rw-r--r--tools/regression/pjdfstest/tests/mkdir/01.t10
-rw-r--r--tools/regression/pjdfstest/tests/mkfifo/01.t10
-rw-r--r--tools/regression/pjdfstest/tests/mkfifo/09.t26
-rw-r--r--tools/regression/pjdfstest/tests/mknod/01.t12
-rw-r--r--tools/regression/pjdfstest/tests/mknod/08.t36
-rw-r--r--tools/regression/pjdfstest/tests/open/01.t11
-rw-r--r--tools/regression/pjdfstest/tests/rename/12.t16
-rw-r--r--tools/regression/pjdfstest/tests/rmdir/06.t32
-rw-r--r--tools/regression/pjdfstest/tests/symlink/08.t22
15 files changed, 120 insertions, 135 deletions
diff --git a/tools/regression/pjdfstest/tests/chflags/01.t b/tools/regression/pjdfstest/tests/chflags/01.t
index 029ee46..b71951b 100644
--- a/tools/regression/pjdfstest/tests/chflags/01.t
+++ b/tools/regression/pjdfstest/tests/chflags/01.t
@@ -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}
diff --git a/tools/regression/pjdfstest/tests/chmod/01.t b/tools/regression/pjdfstest/tests/chmod/01.t
index 469daa4..49164e7 100644
--- a/tools/regression/pjdfstest/tests/chmod/01.t
+++ b/tools/regression/pjdfstest/tests/chmod/01.t
@@ -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}
diff --git a/tools/regression/pjdfstest/tests/chmod/06.t b/tools/regression/pjdfstest/tests/chmod/06.t
index 8abdb0a..c06fe2b 100644
--- a/tools/regression/pjdfstest/tests/chmod/06.t
+++ b/tools/regression/pjdfstest/tests/chmod/06.t
@@ -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
diff --git a/tools/regression/pjdfstest/tests/chown/01.t b/tools/regression/pjdfstest/tests/chown/01.t
index d410f5d..249ce4d 100644
--- a/tools/regression/pjdfstest/tests/chown/01.t
+++ b/tools/regression/pjdfstest/tests/chown/01.t
@@ -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}
diff --git a/tools/regression/pjdfstest/tests/link/01.t b/tools/regression/pjdfstest/tests/link/01.t
index 9a740ed..9400901 100644
--- a/tools/regression/pjdfstest/tests/link/01.t
+++ b/tools/regression/pjdfstest/tests/link/01.t
@@ -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}
diff --git a/tools/regression/pjdfstest/tests/link/10.t b/tools/regression/pjdfstest/tests/link/10.t
index beb141c..725a020 100644
--- a/tools/regression/pjdfstest/tests/link/10.t
+++ b/tools/regression/pjdfstest/tests/link/10.t
@@ -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}
diff --git a/tools/regression/pjdfstest/tests/mkdir/01.t b/tools/regression/pjdfstest/tests/mkdir/01.t
index 43717e6..c1de087 100644
--- a/tools/regression/pjdfstest/tests/mkdir/01.t
+++ b/tools/regression/pjdfstest/tests/mkdir/01.t
@@ -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}
diff --git a/tools/regression/pjdfstest/tests/mkfifo/01.t b/tools/regression/pjdfstest/tests/mkfifo/01.t
index 69bfff5..1c6193b 100644
--- a/tools/regression/pjdfstest/tests/mkfifo/01.t
+++ b/tools/regression/pjdfstest/tests/mkfifo/01.t
@@ -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}
diff --git a/tools/regression/pjdfstest/tests/mkfifo/09.t b/tools/regression/pjdfstest/tests/mkfifo/09.t
index 102e12b..6b2015e 100644
--- a/tools/regression/pjdfstest/tests/mkfifo/09.t
+++ b/tools/regression/pjdfstest/tests/mkfifo/09.t
@@ -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
diff --git a/tools/regression/pjdfstest/tests/mknod/01.t b/tools/regression/pjdfstest/tests/mknod/01.t
index dc36093..bc2b658 100644
--- a/tools/regression/pjdfstest/tests/mknod/01.t
+++ b/tools/regression/pjdfstest/tests/mknod/01.t
@@ -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}
diff --git a/tools/regression/pjdfstest/tests/mknod/08.t b/tools/regression/pjdfstest/tests/mknod/08.t
index 6eb0fda..47d0010 100644
--- a/tools/regression/pjdfstest/tests/mknod/08.t
+++ b/tools/regression/pjdfstest/tests/mknod/08.t
@@ -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
diff --git a/tools/regression/pjdfstest/tests/open/01.t b/tools/regression/pjdfstest/tests/open/01.t
index 39446ba..6dfc6f5 100644
--- a/tools/regression/pjdfstest/tests/open/01.t
+++ b/tools/regression/pjdfstest/tests/open/01.t
@@ -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}
diff --git a/tools/regression/pjdfstest/tests/rename/12.t b/tools/regression/pjdfstest/tests/rename/12.t
index 504980c..4383d84 100644
--- a/tools/regression/pjdfstest/tests/rename/12.t
+++ b/tools/regression/pjdfstest/tests/rename/12.t
@@ -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}
diff --git a/tools/regression/pjdfstest/tests/rmdir/06.t b/tools/regression/pjdfstest/tests/rmdir/06.t
index dbb378b..9de34b0 100644
--- a/tools/regression/pjdfstest/tests/rmdir/06.t
+++ b/tools/regression/pjdfstest/tests/rmdir/06.t
@@ -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}
diff --git a/tools/regression/pjdfstest/tests/symlink/08.t b/tools/regression/pjdfstest/tests/symlink/08.t
index c4843e5..9d539f1 100644
--- a/tools/regression/pjdfstest/tests/symlink/08.t
+++ b/tools/regression/pjdfstest/tests/symlink/08.t
@@ -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
OpenPOWER on IntegriCloud