2 # vim: filetype=sh noexpandtab ts=8 sw=8
3 # $FreeBSD: head/tools/regression/pjdfstest/tests/mknod/00.t 211352 2010-08-15 21:24:17Z pjd $
5 desc="mknod creates fifo files"
15 expect 0 mkdir ${n1} 0755
19 # POSIX: The file permission bits of the new FIFO shall be initialized from
20 # mode. The file permission bits of the mode argument shall be modified by the
21 # process' file creation mask.
22 expect 0 mknod ${n0} f 0755 0 0
23 expect fifo,0755 lstat ${n0} type,mode
25 expect 0 mknod ${n0} f 0151 0 0
26 expect fifo,0151 lstat ${n0} type,mode
28 expect 0 -U 077 mknod ${n0} f 0151 0 0
29 expect fifo,0100 lstat ${n0} type,mode
31 expect 0 -U 070 mknod ${n0} f 0345 0 0
32 expect fifo,0305 lstat ${n0} type,mode
34 expect 0 -U 0501 mknod ${n0} f 0345 0 0
35 expect fifo,0244 lstat ${n0} type,mode
38 # POSIX: The FIFO's user ID shall be set to the process' effective user ID.
39 # The FIFO's group ID shall be set to the group ID of the parent directory or to
40 # the effective group ID of the process.
41 expect 0 chown . 65535 65535
42 expect 0 -u 65535 -g 65535 mknod ${n0} f 0755 0 0
43 expect 65535,65535 lstat ${n0} uid,gid
45 expect 0 -u 65535 -g 65534 mknod ${n0} f 0755 0 0
46 expect "65535,6553[45]" lstat ${n0} uid,gid
49 expect 0 -u 65534 -g 65533 mknod ${n0} f 0755 0 0
50 expect "65534,6553[35]" lstat ${n0} uid,gid
53 # POSIX: Upon successful completion, mknod() shall mark for update the
54 # st_atime, st_ctime, and st_mtime fields of the file. Also, the st_ctime and
55 # st_mtime fields of the directory that contains the new entry shall be marked
58 time=`${fstest} stat . ctime`
60 expect 0 mknod ${n0} f 0755 0 0
61 atime=`${fstest} stat ${n0} atime`
62 test_check $time -lt $atime
63 mtime=`${fstest} stat ${n0} mtime`
64 test_check $time -lt $mtime
65 ctime=`${fstest} stat ${n0} ctime`
66 test_check $time -lt $ctime
67 mtime=`${fstest} stat . mtime`
68 test_check $time -lt $mtime
69 ctime=`${fstest} stat . ctime`
70 test_check $time -lt $ctime