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
This commit is contained in:
parent
754567ece2
commit
d520ce55d9
@ -12,10 +12,22 @@ sub execprint
|
|||||||
}
|
}
|
||||||
|
|
||||||
use IO::Socket;
|
use IO::Socket;
|
||||||
|
use Net::Ping;
|
||||||
|
|
||||||
$exitcmd = shift;
|
$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;
|
exit unless $client;
|
||||||
|
|
||||||
select $client;
|
select $client;
|
||||||
|
|||||||
@ -2,9 +2,15 @@
|
|||||||
|
|
||||||
use IO::Socket;
|
use IO::Socket;
|
||||||
|
|
||||||
|
$vm = shift;
|
||||||
|
|
||||||
my $server = new IO::Socket::INET(LocalPort => 7183, Listen => 1);
|
my $server = new IO::Socket::INET(LocalPort => 7183, Listen => 1);
|
||||||
die "Could not create socket: $!\n" unless $server;
|
die "Could not create socket: $!\n" unless $server;
|
||||||
|
|
||||||
|
system("vboxmanage startvm $vm --type gui");
|
||||||
|
|
||||||
|
print "Listening for connection...\n";
|
||||||
|
|
||||||
my $client = $server->accept();
|
my $client = $server->accept();
|
||||||
|
|
||||||
print while (<$client>);
|
print while (<$client>);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user