2 use test::helper qw($_point $_loop $_opts $_real $_pidfile);
5 use Test::More tests => 3;
8 my $diag = -e '/proc/mounts' ? `cat /proc/mounts` : ($^O eq 'linux' ? `/bin/mount` : `/sbin/mount`);
9 return $diag =~ m{ (?:/private)?$_point };
12 ok(!is_mounted(),"already mounted");
13 ok(-f $_loop,"loopback exists");
17 diag "mounting $_loop to $_point";
18 open REALSTDOUT, '>&STDOUT';
19 open REALSTDERR, '>&STDERR';
20 open STDOUT, '>', '/tmp/fusemnt.log';
21 open STDERR, '>&', \*STDOUT;
22 system("perl -Iblib/lib -Iblib/arch $_loop $_opts $_point");
23 open STDOUT, '>&', \*REALSTDOUT;
24 open STDERR, '>&', \*REALSTDERR;
26 my ($success, $count) = (0,0);
27 while ($count++ < 50 && !$success) {
28 select(undef, undef, undef, 0.1);
29 ($success) = is_mounted();
31 diag "Mounted in ", $count/10, " secs";
33 ok($success,"mount succeeded");
34 system("rm -rf $_real");
36 kill('INT',`cat $_pidfile`);