/[sysadmin-cookbook]/recepies/netpipe-tcp/test-all.pl
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 /recepies/netpipe-tcp/test-all.pl

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

revision 168 by dpavlin, Sat Feb 20 16:32:19 2010 UTC revision 169 by dpavlin, Sat Feb 20 17:35:42 2010 UTC
# Line 6  use warnings; Line 6  use warnings;
6  use strict;  use strict;
7  use autodie;  use autodie;
8  use File::Slurp;  use File::Slurp;
9    use Data::Dump qw(dump);
10    
11  chdir '/srv/sysadmin-cookbook/recepies/netpipe-tcp/';  chdir '/srv/sysadmin-cookbook/recepies/netpipe-tcp/';
12    
13  my @hosts = read_file 'hosts';  my @hosts = read_file 'hosts';
14    @hosts = map { chomp; $_ } @hosts;
15    warn "hosts = ",dump(@hosts);
16    
17  foreach my $host ( @hosts ) {  foreach my $host ( @hosts ) {
18          chomp($host);          chomp($host);
19    
20            my @test;
21    
22          foreach my $to ( @hosts ) {          foreach my $to ( @hosts ) {
23                  chomp($to);                  next if -s "$host/$to.np";
24                  warn "start NPtcp on $to\n";                  warn "start NPtcp on $to\n";
25                  system "ssh $to NPtcp &";                  system "ssh $to NPtcp &";
26                    push @test, $to;
27            }
28    
29            warn "# missing ", dump(@test);
30    
31            open(my $ssh, '|-', "ssh $host xargs -i NPtcp -h {} -u 1048576 -o /tmp/{}.np");
32            foreach my $to ( @test ) {
33                    warn "TEST from $host to $to\n";
34                    print $ssh "$to\n";
35          }          }
36            close($ssh);
37    
38          warn "TEST from $host\n";          system "rsync -v $host:/tmp/*.np $host/";
         system "cat hosts | ssh $host xargs -i NPtcp -h {} -u 1048576 -o /tmp/{}.np";  
         system "rsync $host:/tmp/*.np $host/";  
39  }  }

Legend:
Removed from v.168  
changed lines
  Added in v.169

  ViewVC Help
Powered by ViewVC 1.1.26