2 use test::helper qw($_real $_point);
6 use Unix::Mknod qw(:all);
13 ok(!(system("touch reg" )>>8),"create normal file");
14 ok(defined mkfifo($_point.'/fifo', 0600),"create fifo");
17 ok(-e "reg" ,"normal file exists");
18 ok(-e "fifo","fifo exists");
19 ok(-f "reg" ,"normal file is normal file");
20 ok(-p "fifo","fifo is fifo");
23 skip('Need root to mknod devices', 8) unless ($UID == 0);
26 ok(!mknod($_point.'/chr', 0600|S_IFCHR, makedev(2,3)),"create chrdev");
27 ok(!mknod($_point.'/blk', 0600|S_IFBLK, makedev(2,3)),"create blkdev");
30 ok(-e "chr" ,"chrdev exists");
31 ok(-e "blk" ,"blkdev exists");
33 skip('mknod() is just pretend under fakeroot(1)', 4)
34 if exists $ENV{FAKEROOTKEY};
36 ok(-c "chr" ,"chrdev is chrdev");
37 ok(-b "blk" ,"blkdev is blkdev");
40 is($stat[6],makedev(2,3),"chrdev has right major,minor");
42 is($stat[6],makedev(2,3),"blkdev has right major,minor");
46 ok(-e "reg" ,"normal file exists");
47 ok(-e "fifo","fifo exists");
48 ok(-f "reg" ,"normal file is normal file");
49 ok(-p "fifo","fifo is fifo");
52 skip('Need root to mknod devices', 6) unless ($UID == 0);
54 ok(-e "chr" ,"chrdev exists");
55 ok(-e "blk" ,"blkdev exists");
56 ok(-c "chr" ,"chrdev is chrdev");
57 ok(-b "blk" ,"blkdev is blkdev");
60 is($stat[6],makedev(2,3),"chrdev has right major,minor");
62 is($stat[6],makedev(2,3),"blkdev has right major,minor");
65 map { unlink } qw(reg chr blk fifo);