/[fuse.before_github]/perl-llin/test/helper.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /perl-llin/test/helper.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4 by mszeredi, Thu Nov 11 14:44:15 2004 UTC revision 10 by dpavlin, Sun Mar 20 00:36:05 2005 UTC
# Line 2  Line 2 
2  package test::helper;  package test::helper;
3  use strict;  use strict;
4  use Exporter;  use Exporter;
5    use POSIX qw(WEXITSTATUS);
6  our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);  our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
7  @ISA = "Exporter";  @ISA = "Exporter";
8  @EXPORT_OK = qw($_loop $_point $_pidfile $_real);  @EXPORT_OK = qw($_loop $_point $_pidfile $_real);
9  our($_loop, $_point, $_pidfile, $_real) = ("examples/loopback.pl","/mnt","test/s/mounted.pid","/tmp/fusetest");  our($_loop, $_point, $_pidfile, $_real) = ("examples/loopback.pl","/tmp/fusemnt-".$ENV{LOGNAME},"test/s/mounted.pid","/tmp/fusetest-".$ENV{LOGNAME});
10  if($0 !~ qr|s/u?mount\.t$|) {  if($0 !~ qr|s/u?mount\.t$|) {
11          my ($reject) = 1;          my ($reject) = 1;
12          if(-f $_pidfile) {          if(-f $_pidfile) {
13                  unless(system("ps `cat $_pidfile` | grep \"$_loop $_point\" >/dev/null")>>8) {                  unless(POSIX::WEXITSTATUS(system("ps `cat $_pidfile` | grep \"$_loop $_point\" >/dev/null"))) {
14                          if(`mount | grep "on $_point"`) {                          if(`mount | grep "on $_point"`) {
15                                  $reject = 0;                                  $reject = 0;
16                          } else {                          } else {
# Line 17  if($0 !~ qr|s/u?mount\.t$|) { Line 18  if($0 !~ qr|s/u?mount\.t$|) {
18                          }                          }
19                  }                  }
20          }          }
21          $reject = 1 if (system("ls $_point >&/dev/null") >> 8);          system("ls $_point >&/dev/null");
22            $reject = 1 if (POSIX::WEXITSTATUS($?));
23          die "not properly mounted\n" if $reject;          die "not properly mounted\n" if $reject;
24  }  }
25  1;  1;

Legend:
Removed from v.4  
changed lines
  Added in v.10

  ViewVC Help
Powered by ViewVC 1.1.26