2 use test::helper qw($_real $_point);
6 use Unix::Mknod qw(:all);
7 use Fcntl qw(S_IFCHR S_IFBLK);
13 ok(open($file, '>', 'reg'),"create normal file");
15 ok(defined mkfifo($_point.'/fifo', 0600),"create fifo");
18 ok(-e "reg" ,"normal file exists");
19 ok(-e "fifo","fifo exists");
20 ok(-f "reg" ,"normal file is normal file");
21 ok(-p "fifo","fifo is fifo");
24 skip('Need root to mknod devices', 8) unless ($UID == 0);
27 ok(!mknod($_point.'/chr', 0600|S_IFCHR, makedev(2,3)),"create chrdev");
28 ok(!mknod($_point.'/blk', 0600|S_IFBLK, makedev(2,3)),"create blkdev");
31 ok(-e "chr" ,"chrdev exists");
32 ok(-e "blk" ,"blkdev exists");
34 skip('mknod() is just pretend under fakeroot(1)', 4)
35 if exists $ENV{FAKEROOTKEY};
37 ok(-c "chr" ,"chrdev is chrdev");
38 ok(-b "blk" ,"blkdev is blkdev");
41 is($stat[6],makedev(2,3),"chrdev has right major,minor");
43 is($stat[6],makedev(2,3),"blkdev has right major,minor");
47 ok(-e "reg" ,"normal file exists");
48 ok(-e "fifo","fifo exists");
49 ok(-f "reg" ,"normal file is normal file");
50 ok(-p "fifo","fifo is fifo");
53 skip('Need root to mknod devices', 6) unless ($UID == 0);
55 ok(-e "chr" ,"chrdev exists");
56 ok(-e "blk" ,"blkdev exists");
57 ok(-c "chr" ,"chrdev is chrdev");
58 ok(-b "blk" ,"blkdev is blkdev");
61 is($stat[6],makedev(2,3),"chrdev has right major,minor");
63 is($stat[6],makedev(2,3),"blkdev has right major,minor");
66 map { unlink } qw(reg chr blk fifo);