svn commit: r211178 - in head/tools/regression/fstest/tests:
chflags chmod chown link mkdir mkfifo mknod open rename rmdir
symlink truncate unlink
Pawel Jakub Dawidek
pjd at FreeBSD.org
Wed Aug 11 16:33:18 UTC 2010
Author: pjd
Date: Wed Aug 11 16:33:17 2010
New Revision: 211178
URL: http://svn.freebsd.org/changeset/base/211178
Log:
Make use of recently added dirgen_max() and namegen_max() to implement
ENAMETOOLONG checks.
Modified:
head/tools/regression/fstest/tests/chflags/02.t
head/tools/regression/fstest/tests/chflags/03.t
head/tools/regression/fstest/tests/chmod/02.t
head/tools/regression/fstest/tests/chmod/03.t
head/tools/regression/fstest/tests/chown/02.t
head/tools/regression/fstest/tests/chown/03.t
head/tools/regression/fstest/tests/link/02.t
head/tools/regression/fstest/tests/link/03.t
head/tools/regression/fstest/tests/mkdir/02.t
head/tools/regression/fstest/tests/mkdir/03.t
head/tools/regression/fstest/tests/mkfifo/02.t
head/tools/regression/fstest/tests/mkfifo/03.t
head/tools/regression/fstest/tests/mknod/02.t
head/tools/regression/fstest/tests/mknod/03.t
head/tools/regression/fstest/tests/open/02.t
head/tools/regression/fstest/tests/open/03.t
head/tools/regression/fstest/tests/rename/01.t
head/tools/regression/fstest/tests/rename/02.t
head/tools/regression/fstest/tests/rmdir/02.t
head/tools/regression/fstest/tests/rmdir/03.t
head/tools/regression/fstest/tests/symlink/02.t
head/tools/regression/fstest/tests/symlink/03.t
head/tools/regression/fstest/tests/truncate/02.t
head/tools/regression/fstest/tests/truncate/03.t
head/tools/regression/fstest/tests/unlink/02.t
head/tools/regression/fstest/tests/unlink/03.t
Modified: head/tools/regression/fstest/tests/chflags/02.t
==============================================================================
--- head/tools/regression/fstest/tests/chflags/02.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/chflags/02.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,18 +1,28 @@
#!/bin/sh
# $FreeBSD$
-desc="chflags returns ENAMETOOLONG if a component of a pathname exceeded 255 characters"
+desc="chflags returns ENAMETOOLONG if a component of a pathname exceeded {NAME_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
require chflags
-echo "1..6"
+echo "1..12"
-expect 0 create ${name255} 0644
-expect 0 chflags ${name255} SF_IMMUTABLE
-expect SF_IMMUTABLE stat ${name255} flags
-expect 0 chflags ${name255} none
-expect 0 unlink ${name255}
-expect ENAMETOOLONG chflags ${name256} SF_IMMUTABLE
+nx=`namegen_max`
+nxx="${nx}x"
+
+expect 0 create ${nx} 0644
+expect 0 chflags ${nx} SF_IMMUTABLE
+expect SF_IMMUTABLE stat ${nx} flags
+expect 0 chflags ${nx} none
+expect 0 unlink ${nx}
+expect ENAMETOOLONG chflags ${nxx} SF_IMMUTABLE
+
+expect 0 create ${nx} 0644
+expect 0 lchflags ${nx} SF_IMMUTABLE
+expect SF_IMMUTABLE stat ${nx} flags
+expect 0 lchflags ${nx} none
+expect 0 unlink ${nx}
+expect ENAMETOOLONG lchflags ${nxx} SF_IMMUTABLE
Modified: head/tools/regression/fstest/tests/chflags/03.t
==============================================================================
--- head/tools/regression/fstest/tests/chflags/03.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/chflags/03.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,25 +1,32 @@
#!/bin/sh
# $FreeBSD$
-desc="chflags returns ENAMETOOLONG if an entire path name exceeded 1023 characters"
+desc="chflags returns ENAMETOOLONG if an entire path name exceeded {PATH_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
require chflags
-echo "1..13"
+echo "1..12"
-expect 0 mkdir ${name255} 0755
-expect 0 mkdir ${name255}/${name255} 0755
-expect 0 mkdir ${name255}/${name255}/${name255} 0755
-expect 0 mkdir ${path1021} 0755
-expect 0 create ${path1023} 0644
-expect 0 chflags ${path1023} SF_IMMUTABLE
-expect 0 chflags ${path1023} none
-expect 0 unlink ${path1023}
-expect ENAMETOOLONG chflags ${path1024} SF_IMMUTABLE
-expect 0 rmdir ${path1021}
-expect 0 rmdir ${name255}/${name255}/${name255}
-expect 0 rmdir ${name255}/${name255}
-expect 0 rmdir ${name255}
+nx=`dirgen_max`
+nxx="${nx}x"
+
+mkdir -p "${nx%/*}"
+
+expect 0 create ${nx} 0644
+expect 0 chflags ${nx} SF_IMMUTABLE
+expect SF_IMMUTABLE stat ${nx} flags
+expect 0 chflags ${nx} none
+expect 0 unlink ${nx}
+expect ENAMETOOLONG chflags ${nxx} SF_IMMUTABLE
+
+expect 0 create ${nx} 0644
+expect 0 lchflags ${nx} SF_IMMUTABLE
+expect SF_IMMUTABLE stat ${nx} flags
+expect 0 lchflags ${nx} none
+expect 0 unlink ${nx}
+expect ENAMETOOLONG lchflags ${nxx} SF_IMMUTABLE
+
+rm -rf "${nx%%/*}"
Modified: head/tools/regression/fstest/tests/chmod/02.t
==============================================================================
--- head/tools/regression/fstest/tests/chmod/02.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/chmod/02.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,15 +1,24 @@
#!/bin/sh
# $FreeBSD$
-desc="chmod returns ENAMETOOLONG if a component of a pathname exceeded 255 characters"
+desc="chmod returns ENAMETOOLONG if a component of a pathname exceeded {NAME_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
-echo "1..5"
+echo "1..10"
-expect 0 create ${name255} 0644
-expect 0 chmod ${name255} 0620
-expect 0620 stat ${name255} mode
-expect 0 unlink ${name255}
-expect ENAMETOOLONG chmod ${name256} 0620
+nx=`namegen_max`
+nxx="${nx}x"
+
+expect 0 create ${nx} 0644
+expect 0 chmod ${nx} 0620
+expect 0620 stat ${nx} mode
+expect 0 unlink ${nx}
+expect ENAMETOOLONG chmod ${nxx} 0620
+
+expect 0 create ${nx} 0644
+expect 0 lchmod ${nx} 0620
+expect 0620 stat ${nx} mode
+expect 0 unlink ${nx}
+expect ENAMETOOLONG lchmod ${nxx} 0620
Modified: head/tools/regression/fstest/tests/chmod/03.t
==============================================================================
--- head/tools/regression/fstest/tests/chmod/03.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/chmod/03.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,22 +1,28 @@
#!/bin/sh
# $FreeBSD$
-desc="chmod returns ENAMETOOLONG if an entire path name exceeded 1023 characters"
+desc="chmod returns ENAMETOOLONG if an entire path name exceeded {PATH_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
-echo "1..12"
+echo "1..10"
-expect 0 mkdir ${name255} 0755
-expect 0 mkdir ${name255}/${name255} 0755
-expect 0 mkdir ${name255}/${name255}/${name255} 0755
-expect 0 mkdir ${path1021} 0755
-expect 0 create ${path1023} 0644
-expect 0 chmod ${path1023} 0642
-expect 0 unlink ${path1023}
-expect ENAMETOOLONG chmod ${path1024} 0642
-expect 0 rmdir ${path1021}
-expect 0 rmdir ${name255}/${name255}/${name255}
-expect 0 rmdir ${name255}/${name255}
-expect 0 rmdir ${name255}
+nx=`dirgen_max`
+nxx="${nx}x"
+
+mkdir -p "${nx%/*}"
+
+expect 0 create ${nx} 0644
+expect 0 chmod ${nx} 0642
+expect 0642 stat ${nx} mode
+expect 0 unlink ${nx}
+expect ENAMETOOLONG chmod ${nxx} 0642
+
+expect 0 create ${nx} 0644
+expect 0 lchmod ${nx} 0642
+expect 0642 stat ${nx} mode
+expect 0 unlink ${nx}
+expect ENAMETOOLONG lchmod ${nxx} 0642
+
+rm -rf "${nx%%/*}"
Modified: head/tools/regression/fstest/tests/chown/02.t
==============================================================================
--- head/tools/regression/fstest/tests/chown/02.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/chown/02.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,15 +1,24 @@
#!/bin/sh
# $FreeBSD$
-desc="chown returns ENAMETOOLONG if a component of a pathname exceeded 255 characters"
+desc="chown returns ENAMETOOLONG if a component of a pathname exceeded ${NAME_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
-echo "1..5"
+echo "1..10"
-expect 0 create ${name255} 0644
-expect 0 chown ${name255} 65534 65534
-expect 65534,65534 stat ${name255} uid,gid
-expect 0 unlink ${name255}
-expect ENAMETOOLONG chown ${name256} 65533 65533
+nx=`namegen_max`
+nxx="${nx}x"
+
+expect 0 create ${nx} 0644
+expect 0 chown ${nx} 65534 65534
+expect 65534,65534 stat ${nx} uid,gid
+expect 0 unlink ${nx}
+expect ENAMETOOLONG chown ${nxx} 65534 65534
+
+expect 0 create ${nx} 0644
+expect 0 lchown ${nx} 65534 65534
+expect 65534,65534 stat ${nx} uid,gid
+expect 0 unlink ${nx}
+expect ENAMETOOLONG lchown ${nxx} 65534 65534
Modified: head/tools/regression/fstest/tests/chown/03.t
==============================================================================
--- head/tools/regression/fstest/tests/chown/03.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/chown/03.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,22 +1,28 @@
#!/bin/sh
# $FreeBSD$
-desc="chown returns ENAMETOOLONG if an entire path name exceeded 1023 characters"
+desc="chown returns ENAMETOOLONG if an entire path name exceeded {PATH_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
-echo "1..12"
+echo "1..10"
-expect 0 mkdir ${name255} 0755
-expect 0 mkdir ${name255}/${name255} 0755
-expect 0 mkdir ${name255}/${name255}/${name255} 0755
-expect 0 mkdir ${path1021} 0755
-expect 0 create ${path1023} 0644
-expect 0 chown ${path1023} 65534 65534
-expect 0 unlink ${path1023}
-expect ENAMETOOLONG chown ${path1024} 65533 65533
-expect 0 rmdir ${path1021}
-expect 0 rmdir ${name255}/${name255}/${name255}
-expect 0 rmdir ${name255}/${name255}
-expect 0 rmdir ${name255}
+nx=`dirgen_max`
+nxx="${nx}x"
+
+mkdir -p "${nx%/*}"
+
+expect 0 create ${nx} 0644
+expect 0 chown ${nx} 65534 65534
+expect 65534,65534 stat ${nx} uid,gid
+expect 0 unlink ${nx}
+expect ENAMETOOLONG chown ${nxx} 65534 65534
+
+expect 0 create ${nx} 0644
+expect 0 lchown ${nx} 65534 65534
+expect 65534,65534 stat ${nx} uid,gid
+expect 0 unlink ${nx}
+expect ENAMETOOLONG lchown ${nxx} 65534 65534
+
+rm -rf "${nx%%/*}"
Modified: head/tools/regression/fstest/tests/link/02.t
==============================================================================
--- head/tools/regression/fstest/tests/link/02.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/link/02.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,7 +1,7 @@
#!/bin/sh
# $FreeBSD$
-desc="link returns ENAMETOOLONG if a component of either pathname exceeded 255 characters"
+desc="link returns ENAMETOOLONG if a component of either pathname exceeded {NAME_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
@@ -9,15 +9,17 @@ dir=`dirname $0`
echo "1..10"
n0=`namegen`
+nx=`namegen_max`
+nxx="${nx}x"
-expect 0 create ${name255} 0644
-expect 0 link ${name255} ${n0}
-expect 0 unlink ${name255}
-expect 0 link ${n0} ${name255}
+expect 0 create ${nx} 0644
+expect 0 link ${nx} ${n0}
+expect 0 unlink ${nx}
+expect 0 link ${n0} ${nx}
expect 0 unlink ${n0}
-expect 0 unlink ${name255}
+expect 0 unlink ${nx}
expect 0 create ${n0} 0644
-expect ENAMETOOLONG link ${n0} ${name256}
+expect ENAMETOOLONG link ${n0} ${nxx}
expect 0 unlink ${n0}
-expect ENAMETOOLONG link ${name256} ${n0}
+expect ENAMETOOLONG link ${nxx} ${n0}
Modified: head/tools/regression/fstest/tests/link/03.t
==============================================================================
--- head/tools/regression/fstest/tests/link/03.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/link/03.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,28 +1,31 @@
#!/bin/sh
# $FreeBSD$
-desc="link returns ENAMETOOLONG if an entire length of either path name exceeded 1023 characters"
+desc="link returns ENAMETOOLONG if an entire length of either path name exceeded {PATH_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
-echo "1..16"
+echo "1..13"
n0=`namegen`
+nx=`dirgen_max`
+nxx="${nx}x"
-expect 0 mkdir ${name255} 0755
-expect 0 mkdir ${name255}/${name255} 0755
-expect 0 mkdir ${name255}/${name255}/${name255} 0755
-expect 0 mkdir ${path1021} 0755
-expect 0 create ${path1023} 0644
-expect 0 link ${path1023} ${n0}
-expect 0 unlink ${path1023}
-expect 0 link ${n0} ${path1023}
-expect 0 unlink ${path1023}
-expect ENAMETOOLONG link ${n0} ${path1024}
+mkdir -p "${nx%/*}"
+
+expect 0 create ${nx} 0644
+expect 0 link ${nx} ${n0}
+expect 2 stat ${n0} nlink
+expect 2 stat ${nx} nlink
+expect 0 unlink ${nx}
+expect 0 link ${n0} ${nx}
+expect 2 stat ${n0} nlink
+expect 2 stat ${nx} nlink
+expect 0 unlink ${nx}
+expect ENAMETOOLONG link ${n0} ${nxx}
+expect 1 stat ${n0} nlink
expect 0 unlink ${n0}
-expect ENAMETOOLONG link ${path1024} ${n0}
-expect 0 rmdir ${path1021}
-expect 0 rmdir ${name255}/${name255}/${name255}
-expect 0 rmdir ${name255}/${name255}
-expect 0 rmdir ${name255}
+expect ENAMETOOLONG link ${nxx} ${n0}
+
+rm -rf "${nx%%/*}"
Modified: head/tools/regression/fstest/tests/mkdir/02.t
==============================================================================
--- head/tools/regression/fstest/tests/mkdir/02.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/mkdir/02.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,13 +1,16 @@
#!/bin/sh
# $FreeBSD$
-desc="mkdir returns ENAMETOOLONG if a component of a pathname exceeded 255 characters"
+desc="mkdir returns ENAMETOOLONG if a component of a pathname exceeded {NAME_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
echo "1..3"
-expect 0 mkdir ${name255} 0755
-expect 0 rmdir ${name255}
-expect ENAMETOOLONG mkdir ${name256} 0755
+nx=`namegen_max`
+nxx="${nx}x"
+
+expect 0 mkdir ${nx} 0755
+expect 0 rmdir ${nx}
+expect ENAMETOOLONG mkdir ${nxx} 0755
Modified: head/tools/regression/fstest/tests/mkdir/03.t
==============================================================================
--- head/tools/regression/fstest/tests/mkdir/03.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/mkdir/03.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,21 +1,20 @@
#!/bin/sh
# $FreeBSD$
-desc="mkdir returns ENAMETOOLONG if an entire path name exceeded 1023 characters"
+desc="mkdir returns ENAMETOOLONG if an entire path name exceeded {PATH_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
-echo "1..11"
+echo "1..3"
-expect 0 mkdir ${name255} 0755
-expect 0 mkdir ${name255}/${name255} 0755
-expect 0 mkdir ${name255}/${name255}/${name255} 0755
-expect 0 mkdir ${path1021} 0755
-expect 0 mkdir ${path1023} 0755
-expect 0 rmdir ${path1023}
-expect ENAMETOOLONG mkdir ${path1024} 0755
-expect 0 rmdir ${path1021}
-expect 0 rmdir ${name255}/${name255}/${name255}
-expect 0 rmdir ${name255}/${name255}
-expect 0 rmdir ${name255}
+nx=`dirgen_max`
+nxx="${nx}x"
+
+mkdir -p "${nx%/*}"
+
+expect 0 mkdir ${nx} 0755
+expect 0 rmdir ${nx}
+expect ENAMETOOLONG mkdir ${nxx} 0755
+
+rm -rf "${nx%%/*}"
Modified: head/tools/regression/fstest/tests/mkfifo/02.t
==============================================================================
--- head/tools/regression/fstest/tests/mkfifo/02.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/mkfifo/02.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,13 +1,17 @@
#!/bin/sh
# $FreeBSD$
-desc="mkfifo returns ENAMETOOLONG if a component of a pathname exceeded 255 characters"
+desc="mkfifo returns ENAMETOOLONG if a component of a pathname exceeded {NAME_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
-echo "1..3"
+echo "1..4"
-expect 0 mkfifo ${name255} 0644
-expect 0 unlink ${name255}
-expect ENAMETOOLONG mkfifo ${name256} 0644
+nx=`namegen_max`
+nxx="${nx}x"
+
+expect 0 mkfifo ${nx} 0644
+expect fifo,0644 stat ${nx} type,mode
+expect 0 unlink ${nx}
+expect ENAMETOOLONG mkfifo ${nxx} 0644
Modified: head/tools/regression/fstest/tests/mkfifo/03.t
==============================================================================
--- head/tools/regression/fstest/tests/mkfifo/03.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/mkfifo/03.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,21 +1,21 @@
#!/bin/sh
# $FreeBSD$
-desc="mkfifo returns ENAMETOOLONG if an entire path name exceeded 1023 characters"
+desc="mkfifo returns ENAMETOOLONG if an entire path name exceeded {PATH_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
-echo "1..11"
+echo "1..4"
-expect 0 mkdir ${name255} 0755
-expect 0 mkdir ${name255}/${name255} 0755
-expect 0 mkdir ${name255}/${name255}/${name255} 0755
-expect 0 mkdir ${path1021} 0755
-expect 0 mkfifo ${path1023} 0644
-expect 0 unlink ${path1023}
-expect ENAMETOOLONG mkfifo ${path1024} 0644
-expect 0 rmdir ${path1021}
-expect 0 rmdir ${name255}/${name255}/${name255}
-expect 0 rmdir ${name255}/${name255}
-expect 0 rmdir ${name255}
+nx=`dirgen_max`
+nxx="${nx}x"
+
+mkdir -p "${nx%/*}"
+
+expect 0 mkfifo ${nx} 0644
+expect fifo stat ${nx} type
+expect 0 unlink ${nx}
+expect ENAMETOOLONG mkfifo ${nxx} 0644
+
+rm -rf "${nx%%/*}"
Modified: head/tools/regression/fstest/tests/mknod/02.t
==============================================================================
--- head/tools/regression/fstest/tests/mknod/02.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/mknod/02.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,13 +1,27 @@
#!/bin/sh
# $FreeBSD$
-desc="mknod returns ENAMETOOLONG if a component of a pathname exceeded 255 characters"
+desc="mknod returns ENAMETOOLONG if a component of a pathname exceeded {NAME_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
-echo "1..3"
+echo "1..12"
-expect 0 mknod ${name255} f 0644 0 0
-expect 0 unlink ${name255}
-expect ENAMETOOLONG mknod ${name256} f 0644 0 0
+nx=`namegen_max`
+nxx="${nx}x"
+
+expect 0 mknod ${nx} f 0644 0 0
+expect fifo,0644 stat ${nx} type,mode
+expect 0 unlink ${nx}
+expect ENAMETOOLONG mknod ${nxx} f 0644 0 0
+
+expect 0 mknod ${nx} b 0644 1 2
+expect block,0644 stat ${nx} type,mode
+expect 0 unlink ${nx}
+expect ENAMETOOLONG mknod ${nxx} b 0644 0 0
+
+expect 0 mknod ${nx} c 0644 1 2
+expect char,0644 stat ${nx} type,mode
+expect 0 unlink ${nx}
+expect ENAMETOOLONG mknod ${nxx} c 0644 0 0
Modified: head/tools/regression/fstest/tests/mknod/03.t
==============================================================================
--- head/tools/regression/fstest/tests/mknod/03.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/mknod/03.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,21 +1,31 @@
#!/bin/sh
# $FreeBSD$
-desc="mknod returns ENAMETOOLONG if an entire path name exceeded 1023 characters"
+desc="mknod returns ENAMETOOLONG if an entire path name exceeded {PATH_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
-echo "1..11"
+echo "1..12"
-expect 0 mkdir ${name255} 0755 # 1
-expect 0 mkdir ${name255}/${name255} 0755 # 2
-expect 0 mkdir ${name255}/${name255}/${name255} 0755 # 3
-expect 0 mkdir ${path1021} 0755 # 4
-expect 0 mknod ${path1023} f 0644 0 0 # 5
-expect 0 unlink ${path1023} # 6
-expect ENAMETOOLONG mknod ${path1024} f 0644 0 0 # 7
-expect 0 rmdir ${path1021} # 8
-expect 0 rmdir ${name255}/${name255}/${name255} # 9
-expect 0 rmdir ${name255}/${name255} # 10
-expect 0 rmdir ${name255} # 11
+nx=`dirgen_max`
+nxx="${nx}x"
+
+mkdir -p "${nx%/*}"
+
+expect 0 mknod ${nx} f 0644 0 0
+expect fifo stat ${nx} type
+expect 0 unlink ${nx}
+expect ENAMETOOLONG mknod ${nxx} f 0644 0 0
+
+expect 0 mknod ${nx} b 0644 1 2
+expect block stat ${nx} type
+expect 0 unlink ${nx}
+expect ENAMETOOLONG mknod ${nxx} b 0644 1 2
+
+expect 0 mknod ${nx} c 0644 1 2
+expect char stat ${nx} type
+expect 0 unlink ${nx}
+expect ENAMETOOLONG mknod ${nxx} c 0644 1 2
+
+rm -rf "${nx%%/*}"
Modified: head/tools/regression/fstest/tests/open/02.t
==============================================================================
--- head/tools/regression/fstest/tests/open/02.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/open/02.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,14 +1,17 @@
#!/bin/sh
# $FreeBSD$
-desc="open returns ENAMETOOLONG if a component of a pathname exceeded 255 characters"
+desc="open returns ENAMETOOLONG if a component of a pathname exceeded {NAME_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
echo "1..4"
-expect 0 open ${name255} O_CREAT 0620
-expect 0620 stat ${name255} mode
-expect 0 unlink ${name255}
-expect ENAMETOOLONG open ${name256} O_CREAT 0620
+nx=`namegen_max`
+nxx="${nx}x"
+
+expect 0 open ${nx} O_CREAT 0620
+expect regular,0620 stat ${nx} type,mode
+expect 0 unlink ${nx}
+expect ENAMETOOLONG open ${nxx} O_CREAT 0620
Modified: head/tools/regression/fstest/tests/open/03.t
==============================================================================
--- head/tools/regression/fstest/tests/open/03.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/open/03.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,22 +1,21 @@
#!/bin/sh
# $FreeBSD$
-desc="open returns ENAMETOOLONG if an entire path name exceeded 1023 characters"
+desc="open returns ENAMETOOLONG if an entire path name exceeded ${PATH_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
-echo "1..12"
+echo "1..4"
-expect 0 mkdir ${name255} 0755
-expect 0 mkdir ${name255}/${name255} 0755
-expect 0 mkdir ${name255}/${name255}/${name255} 0755
-expect 0 mkdir ${path1021} 0755
-expect 0 open ${path1023} O_CREAT 0642
-expect 0642 stat ${path1023} mode
-expect 0 unlink ${path1023}
-expect ENAMETOOLONG open ${path1024} O_CREAT 0642
-expect 0 rmdir ${path1021}
-expect 0 rmdir ${name255}/${name255}/${name255}
-expect 0 rmdir ${name255}/${name255}
-expect 0 rmdir ${name255}
+nx=`dirgen_max`
+nxx="${nx}x"
+
+mkdir -p "${nx%/*}"
+
+expect 0 open ${nx} O_CREAT 0642
+expect regular,0642 stat ${nx} type,mode
+expect 0 unlink ${nx}
+expect ENAMETOOLONG open ${nxx} O_CREAT 0642
+
+rm -rf "${nx%%/*}"
Modified: head/tools/regression/fstest/tests/rename/01.t
==============================================================================
--- head/tools/regression/fstest/tests/rename/01.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/rename/01.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,7 +1,7 @@
#!/bin/sh
# $FreeBSD$
-desc="rename returns ENAMETOOLONG if a component of either pathname exceeded 255 characters"
+desc="rename returns ENAMETOOLONG if a component of either pathname exceeded {NAME_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
@@ -9,13 +9,15 @@ dir=`dirname $0`
echo "1..8"
n0=`namegen`
+nx=`namegen_max`
+nxx="${nx}x"
-expect 0 create ${name255} 0644
-expect 0 rename ${name255} ${n0}
-expect 0 rename ${n0} ${name255}
-expect 0 unlink ${name255}
+expect 0 create ${nx} 0644
+expect 0 rename ${nx} ${n0}
+expect 0 rename ${n0} ${nx}
+expect 0 unlink ${nx}
expect 0 create ${n0} 0644
-expect ENAMETOOLONG rename ${n0} ${name256}
+expect ENAMETOOLONG rename ${n0} ${nxx}
expect 0 unlink ${n0}
-expect ENAMETOOLONG rename ${name256} ${n0}
+expect ENAMETOOLONG rename ${nxx} ${n0}
Modified: head/tools/regression/fstest/tests/rename/02.t
==============================================================================
--- head/tools/regression/fstest/tests/rename/02.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/rename/02.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,26 +1,24 @@
#!/bin/sh
# $FreeBSD$
-desc="rename returns ENAMETOOLONG if an entire length of either path name exceeded 1023 characters"
+desc="rename returns ENAMETOOLONG if an entire length of either path name exceeded {PATH_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
-echo "1..14"
+echo "1..6"
n0=`namegen`
+nx=`dirgen_max`
+nxx="${nx}x"
+
+mkdir -p "${nx%/*}"
-expect 0 mkdir ${name255} 0755
-expect 0 mkdir ${name255}/${name255} 0755
-expect 0 mkdir ${name255}/${name255}/${name255} 0755
-expect 0 mkdir ${path1021} 0755
expect 0 create ${n0} 0644
-expect 0 rename ${n0} ${path1023}
-expect 0 rename ${path1023} ${n0}
-expect ENAMETOOLONG rename ${n0} ${path1024}
+expect 0 rename ${n0} ${nx}
+expect 0 rename ${nx} ${n0}
+expect ENAMETOOLONG rename ${n0} ${nxx}
expect 0 unlink ${n0}
-expect ENAMETOOLONG rename ${path1024} ${n0}
-expect 0 rmdir ${path1021}
-expect 0 rmdir ${name255}/${name255}/${name255}
-expect 0 rmdir ${name255}/${name255}
-expect 0 rmdir ${name255}
+expect ENAMETOOLONG rename ${nxx} ${n0}
+
+rm -rf "${nx%%/*}"
Modified: head/tools/regression/fstest/tests/rmdir/02.t
==============================================================================
--- head/tools/regression/fstest/tests/rmdir/02.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/rmdir/02.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,14 +1,17 @@
#!/bin/sh
# $FreeBSD$
-desc="rmdir returns ENAMETOOLONG if a component of a pathname exceeded 255 characters"
+desc="rmdir returns ENAMETOOLONG if a component of a pathname exceeded {NAME_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
echo "1..4"
-expect 0 mkdir ${name255} 0755
-expect 0 rmdir ${name255}
-expect ENOENT rmdir ${name255}
-expect ENAMETOOLONG rmdir ${name256}
+nx=`namegen_max`
+nxx="${nx}x"
+
+expect 0 mkdir ${nx} 0755
+expect 0 rmdir ${nx}
+expect ENOENT rmdir ${nx}
+expect ENAMETOOLONG rmdir ${nxx}
Modified: head/tools/regression/fstest/tests/rmdir/03.t
==============================================================================
--- head/tools/regression/fstest/tests/rmdir/03.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/rmdir/03.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,22 +1,22 @@
#!/bin/sh
# $FreeBSD$
-desc="rmdir returns ENAMETOOLONG if an entire path name exceeded 1023 characters"
+desc="rmdir returns ENAMETOOLONG if an entire path name exceeded ${PATH_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
-echo "1..12"
+echo "1..5"
-expect 0 mkdir ${name255} 0755
-expect 0 mkdir ${name255}/${name255} 0755
-expect 0 mkdir ${name255}/${name255}/${name255} 0755
-expect 0 mkdir ${path1021} 0755
-expect 0 mkdir ${path1023} 0755
-expect 0 rmdir ${path1023}
-expect ENOENT rmdir ${path1023}
-expect ENAMETOOLONG rmdir ${path1024}
-expect 0 rmdir ${path1021}
-expect 0 rmdir ${name255}/${name255}/${name255}
-expect 0 rmdir ${name255}/${name255}
-expect 0 rmdir ${name255}
+nx=`dirgen_max`
+nxx="${nx}x"
+
+mkdir -p "${nx%/*}"
+
+expect 0 mkdir ${nx} 0755
+expect dir,0755 stat ${nx} type,mode
+expect 0 rmdir ${nx}
+expect ENOENT rmdir ${nx}
+expect ENAMETOOLONG rmdir ${nxx}
+
+rm -rf "${nx%%/*}"
Modified: head/tools/regression/fstest/tests/symlink/02.t
==============================================================================
--- head/tools/regression/fstest/tests/symlink/02.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/symlink/02.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,7 +1,7 @@
#!/bin/sh
# $FreeBSD$
-desc="symlink returns ENAMETOOLONG if a component of the name2 pathname exceeded 255 characters"
+desc="symlink returns ENAMETOOLONG if a component of the name2 pathname exceeded {NAME_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
@@ -9,12 +9,14 @@ dir=`dirname $0`
echo "1..7"
n0=`namegen`
+nx=`namegen_max`
+nxx="${nx}x"
-expect 0 symlink ${name255} ${n0}
+expect 0 symlink ${nx} ${n0}
expect 0 unlink ${n0}
-expect 0 symlink ${n0} ${name255}
-expect 0 unlink ${name255}
+expect 0 symlink ${n0} ${nx}
+expect 0 unlink ${nx}
-expect ENAMETOOLONG symlink ${n0} ${name256}
-expect 0 symlink ${name256} ${n0}
+expect ENAMETOOLONG symlink ${n0} ${nxx}
+expect 0 symlink ${nxx} ${n0}
expect 0 unlink ${n0}
Modified: head/tools/regression/fstest/tests/symlink/03.t
==============================================================================
--- head/tools/regression/fstest/tests/symlink/03.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/symlink/03.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,26 +1,22 @@
#!/bin/sh
# $FreeBSD$
-desc="symlink returns ENAMETOOLONG if an entire length of either path name exceeded 1023 characters"
+desc="symlink returns ENAMETOOLONG if an entire length of either path name exceeded {PATH_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
-echo "1..14"
+echo "1..6"
n0=`namegen`
+nx=`dirgen_max`
+nxx="${nx}x"
-expect 0 symlink ${path1023} ${n0}
+mkdir -p "${nx%/*}"
+expect 0 symlink ${nx} ${n0}
expect 0 unlink ${n0}
-expect 0 mkdir ${name255} 0755
-expect 0 mkdir ${name255}/${name255} 0755
-expect 0 mkdir ${name255}/${name255}/${name255} 0755
-expect 0 mkdir ${path1021} 0755
-expect 0 symlink ${n0} ${path1023}
-expect 0 unlink ${path1023}
-expect ENAMETOOLONG symlink ${n0} ${path1024}
-expect ENAMETOOLONG symlink ${path1024} ${n0}
-expect 0 rmdir ${path1021}
-expect 0 rmdir ${name255}/${name255}/${name255}
-expect 0 rmdir ${name255}/${name255}
-expect 0 rmdir ${name255}
+expect 0 symlink ${n0} ${nx}
+expect 0 unlink ${nx}
+expect ENAMETOOLONG symlink ${n0} ${nxx}
+expect ENAMETOOLONG symlink ${nxx} ${n0}
+rm -rf "${nx%%/*}"
Modified: head/tools/regression/fstest/tests/truncate/02.t
==============================================================================
--- head/tools/regression/fstest/tests/truncate/02.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/truncate/02.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,15 +1,18 @@
#!/bin/sh
# $FreeBSD$
-desc="truncate returns ENAMETOOLONG if a component of a pathname exceeded 255 characters"
+desc="truncate returns ENAMETOOLONG if a component of a pathname exceeded {NAME_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
echo "1..5"
-expect 0 create ${name255} 0644
-expect 0 truncate ${name255} 123
-expect 123 stat ${name255} size
-expect 0 unlink ${name255}
-expect ENAMETOOLONG truncate ${name256} 123
+nx=`namegen_max`
+nxx="${nx}x"
+
+expect 0 create ${nx} 0644
+expect 0 truncate ${nx} 123
+expect 123 stat ${nx} size
+expect 0 unlink ${nx}
+expect ENAMETOOLONG truncate ${nxx} 123
Modified: head/tools/regression/fstest/tests/truncate/03.t
==============================================================================
--- head/tools/regression/fstest/tests/truncate/03.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/truncate/03.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,22 +1,22 @@
#!/bin/sh
# $FreeBSD$
-desc="truncate returns ENAMETOOLONG if an entire path name exceeded 1023 characters"
+desc="truncate returns ENAMETOOLONG if an entire path name exceeded {PATH_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
-echo "1..12"
+echo "1..5"
-expect 0 mkdir ${name255} 0755
-expect 0 mkdir ${name255}/${name255} 0755
-expect 0 mkdir ${name255}/${name255}/${name255} 0755
-expect 0 mkdir ${path1021} 0755
-expect 0 create ${path1023} 0644
-expect 0 truncate ${path1023} 123
-expect 0 unlink ${path1023}
-expect ENAMETOOLONG truncate ${path1024} 123
-expect 0 rmdir ${path1021}
-expect 0 rmdir ${name255}/${name255}/${name255}
-expect 0 rmdir ${name255}/${name255}
-expect 0 rmdir ${name255}
+nx=`dirgen_max`
+nxx="${nx}x"
+
+mkdir -p "${nx%/*}"
+
+expect 0 create ${nx} 0644
+expect 0 truncate ${nx} 123
+expect regular,123 stat ${nx} type,size
+expect 0 unlink ${nx}
+expect ENAMETOOLONG truncate ${nxx} 123
+
+rm -rf "${nx%%/*}"
Modified: head/tools/regression/fstest/tests/unlink/02.t
==============================================================================
--- head/tools/regression/fstest/tests/unlink/02.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/unlink/02.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,14 +1,17 @@
#!/bin/sh
# $FreeBSD$
-desc="unlink returns ENAMETOOLONG if a component of a pathname exceeded 255 characters"
+desc="unlink returns ENAMETOOLONG if a component of a pathname exceeded {NAME_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
echo "1..4"
-expect 0 create ${name255} 0644
-expect 0 unlink ${name255}
-expect ENOENT unlink ${name255}
-expect ENAMETOOLONG unlink ${name256}
+nx=`namegen_max`
+nxx="${nx}x"
+
+expect 0 create ${nx} 0644
+expect 0 unlink ${nx}
+expect ENOENT unlink ${nx}
+expect ENAMETOOLONG unlink ${nxx}
Modified: head/tools/regression/fstest/tests/unlink/03.t
==============================================================================
--- head/tools/regression/fstest/tests/unlink/03.t Wed Aug 11 16:29:12 2010 (r211177)
+++ head/tools/regression/fstest/tests/unlink/03.t Wed Aug 11 16:33:17 2010 (r211178)
@@ -1,22 +1,21 @@
#!/bin/sh
# $FreeBSD$
-desc="unlink returns ENAMETOOLONG if an entire path name exceeded 1023 characters"
+desc="unlink returns ENAMETOOLONG if an entire path name exceeded {PATH_MAX} characters"
dir=`dirname $0`
. ${dir}/../misc.sh
-echo "1..12"
+echo "1..4"
-expect 0 mkdir ${name255} 0755
-expect 0 mkdir ${name255}/${name255} 0755
-expect 0 mkdir ${name255}/${name255}/${name255} 0755
-expect 0 mkdir ${path1021} 0755
-expect 0 create ${path1023} 0644
-expect 0 unlink ${path1023}
-expect ENOENT unlink ${path1023}
-expect ENAMETOOLONG unlink ${path1024}
-expect 0 rmdir ${path1021}
-expect 0 rmdir ${name255}/${name255}/${name255}
-expect 0 rmdir ${name255}/${name255}
-expect 0 rmdir ${name255}
+nx=`dirgen_max`
+nxx="${nx}x"
+
+mkdir -p "${nx%/*}"
+
+expect 0 create ${nx} 0644
+expect 0 unlink ${nx}
+expect ENOENT unlink ${nx}
+expect ENAMETOOLONG unlink ${nxx}
+
+rm -rf "${nx%%/*}"
More information about the svn-src-head
mailing list