run tests on all hosts automatically
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 19 Feb 2010 22:36:27 +0000 (22:36 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 19 Feb 2010 22:36:27 +0000 (22:36 +0000)
git-svn-id: svn://svn.rot13.org/sysadmin-cookbook@163 191e9f34-6774-4a6d-acfc-7664dacd4a2a

recepies/netpipe-tcp/test-all.pl [new file with mode: 0755]

diff --git a/recepies/netpipe-tcp/test-all.pl b/recepies/netpipe-tcp/test-all.pl
new file mode 100755 (executable)
index 0000000..fb48270
--- /dev/null
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+
+# usage: test-all.pl hosts
+
+use warnings;
+use strict;
+use autodie;
+use File::Slurp;
+
+chdir '/srv/sysadmin-cookbook/recepies/netpipe-tcp/';
+
+my @hosts = read_file 'hosts';
+
+foreach my $host ( @hosts ) {
+       chomp($host);
+
+       foreach my $to ( @hosts ) {
+               chomp($to);
+               warn "start NPtcp on $to\n";
+               system "ssh $to NPtcp &";
+       }
+
+       warn "TEST from $host\n";
+       system "ssh $host /srv/sysadmin-cookbook/recepies/netpipe-tcp/test.sh";
+       system "rsync $host:/tmp/*.np $host/";
+}