2 use test::helper qw($_real $_point);
8 if ($^O eq 'darwin') { $maj_off = 24; }
13 ok(!(system("touch reg" )>>8),"create normal file");
14 ok(!(system("mkfifo fifo" )>>8),"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(!(system("mknod chr c 2 3")>>8),"create chrdev");
27 ok(!(system("mknod blk b 2 3")>>8),"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],3+(2<<$maj_off),"chrdev has right major,minor");
42 is($stat[6],3+(2<<$maj_off),"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],3+(2<<$maj_off),"chrdev has right major,minor");
62 is($stat[6],3+(2<<$maj_off),"blkdev has right major,minor");
65 map { unlink } qw(reg chr blk fifo);