Replace system() calls for 'touch' and friends with Perl ops for same.
[perl-fuse.git] / test / chown.t
1 #!/usr/bin/perl
2 use test::helper qw($_real $_point);
3 use Test::More;
4 use English;
5 plan tests => 4;
6
7 my (@stat);
8 chdir($_point);
9 open($file, '>', 'file');
10 print $file "frog\n";
11 close($file);
12
13 SKIP: {
14         skip('Need root to give away ownership', 4) unless ($UID == 0);
15
16         ok(chown(0,0,"file"),"set 0,0");
17         @stat = stat("file");
18         ok($stat[4] == 0 && $stat[5] == 0,"0,0");
19         ok(chown(1,1,"file"),"set 1,1");
20         @stat = stat("file");
21         ok($stat[4] == 1 && $stat[5] == 1,"1,1");
22 }
23
24 unlink("file");