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