xref: /freebsd/contrib/pjdfstest/tests/mknod/02.t (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
1#!/bin/sh
2# vim: filetype=sh noexpandtab ts=8 sw=8
3# $FreeBSD: head/tools/regression/pjdfstest/tests/mknod/02.t 211352 2010-08-15 21:24:17Z pjd $
4
5desc="mknod returns ENAMETOOLONG if a component of a pathname exceeded {NAME_MAX} characters"
6
7dir=`dirname $0`
8. ${dir}/../misc.sh
9
10echo "1..12"
11
12nx=`namegen_max`
13nxx="${nx}x"
14
15expect 0 mknod ${nx} f 0644 0 0
16expect fifo,0644 stat ${nx} type,mode
17expect 0 unlink ${nx}
18expect ENAMETOOLONG mknod ${nxx} f 0644 0 0
19
20expect 0 mknod ${nx} b 0644 1 2
21expect block,0644 stat ${nx} type,mode
22expect 0 unlink ${nx}
23expect ENAMETOOLONG mknod ${nxx} b 0644 0 0
24
25expect 0 mknod ${nx} c 0644 1 2
26expect char,0644 stat ${nx} type,mode
27expect 0 unlink ${nx}
28expect ENAMETOOLONG mknod ${nxx} c 0644 0 0
29