summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/autotest-remote-host.pl14
-rw-r--r--tests/autotest-remote-server.pl6
2 files changed, 19 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;
diff --git a/tests/autotest-remote-server.pl b/tests/autotest-remote-server.pl
index e113808..9b7e8c1 100644
--- a/tests/autotest-remote-server.pl
+++ b/tests/autotest-remote-server.pl
@@ -2,9 +2,15 @@
use IO::Socket;
+$vm = shift;
+
my $server = new IO::Socket::INET(LocalPort => 7183, Listen => 1);
die "Could not create socket: $!\n" unless $server;
+system("vboxmanage startvm $vm --type gui");
+
+print "Listening for connection...\n";
+
my $client = $server->accept();
print while (<$client>);