2 use test::helper qw($_point $_loop $_real $_pidfile);
4 use Test::More tests => 3;
7 my $diag = -e '/proc/mounts' ? `cat /proc/mounts` : `mount`;
8 return $diag =~ m{ (?:/private)?$_point };
11 ok(!is_mounted(),"already mounted");
12 ok(-f $_loop,"loopback exists");
20 `echo $$ >test/s/mounted.pid`;
21 diag "mounting $_loop to $_point";
22 open STDOUT, '>', '/tmp/fusemnt.log';
23 open STDERR, '>&', \*STDOUT;
24 exec("perl -Iblib/lib -Iblib/arch $_loop $_point");
28 my ($success, $count) = (0,0);
29 while ($count++ < 50 && !$success) {
30 select(undef, undef, undef, 0.1);
31 ($success) = is_mounted();
33 diag "Mounted in ", $count/10, " secs";
35 ok($success,"mount succeeded");
36 system("rm -rf $_real");
38 kill('INT',`cat $_pidfile`);