summaryrefslogtreecommitdiff
path: root/tests/autotest-remote-host.pl
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-05-13 16:48:46 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-05-13 16:48:46 +0000
commitd520ce55d9376855c82cecc596a00a86eafea062 (patch)
tree4823a7bf7bfe778cdab539fdcc1ce7f00e42f5d0 /tests/autotest-remote-host.pl
parent754567ece20faa10d6d4de6d8f5c421b51dd259c (diff)
tests: Added wait for server to remote host, added automatic VM launch
git-svn-id: http://pugixml.googlecode.com/svn/trunk@423 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests/autotest-remote-host.pl')
-rw-r--r--tests/autotest-remote-host.pl14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/autotest-remote-host.pl b/tests/autotest-remote-host.pl
index 91d929a..5abef1e 100644
--- a/tests/autotest-remote-host.pl
+++ b/tests/autotest-remote-host.pl
@@ -12,10 +12,22 @@ sub execprint
}
use IO::Socket;
+use Net::Ping;
$exitcmd = shift;
+$host = "10.0.2.2";
-my $client = new IO::Socket::INET(PeerAddr => "10.0.2.2:7183", Timeout => 5);
+# wait while network is up
+$ping = Net::Ping->new("icmp");
+
+while (!$ping->ping($host))
+{
+ print "### autotest $host is down, retrying...\n";
+}
+
+print "### autotest $host is up, connecting...\n";
+
+my $client = new IO::Socket::INET(PeerAddr => "$host:7183");
exit unless $client;
select $client;