xref: /freebsd/contrib/pjdfstest/tests/mknod/03.t (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
1#!/bin/sh
2# vim: filetype=sh noexpandtab ts=8 sw=8
3# $FreeBSD: head/tools/regression/pjdfstest/tests/mknod/03.t 211352 2010-08-15 21:24:17Z pjd $
4
5desc="mknod returns ENAMETOOLONG if an entire path name exceeded {PATH_MAX} characters"
6
7dir=`dirname $0`
8. ${dir}/../misc.sh
9
10echo "1..12"
11
12nx=`dirgen_max`
13nxx="${nx}x"
14
15mkdir -p "${nx%/*}"
16
17expect 0 mknod ${nx} f 0644 0 0
18expect fifo stat ${nx} type
19expect 0 unlink ${nx}
20expect ENAMETOOLONG mknod ${nxx} f 0644 0 0
21
22expect 0 mknod ${nx} b 0644 1 2
23expect block stat ${nx} type
24expect 0 unlink ${nx}
25expect ENAMETOOLONG mknod ${nxx} b 0644 1 2
26
27expect 0 mknod ${nx} c 0644 1 2
28expect char stat ${nx} type
29expect 0 unlink ${nx}
30expect ENAMETOOLONG mknod ${nxx} c 0644 1 2
31
32rm -rf "${nx%%/*}"
33