Francois Gouget : testbot/TestAgent: Add --connect-attempts and --connect-interval options.

Alexandre Julliard julliard at winehq.org
Wed Oct 25 02:52:20 CDT 2017


Module: tools
Branch: master
Commit: e7e490e5e2e7d883a1d8d6a8a1ba3d8e5868c614
URL:    http://source.winehq.org/git/tools.git/?a=commit;h=e7e490e5e2e7d883a1d8d6a8a1ba3d8e5868c614

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Tue Oct 24 15:48:19 2017 +0200

testbot/TestAgent: Add --connect-attempts and --connect-interval options.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/scripts/TestAgent | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/testbot/scripts/TestAgent b/testbot/scripts/TestAgent
index 33fc298..bfc4fbc 100755
--- a/testbot/scripts/TestAgent
+++ b/testbot/scripts/TestAgent
@@ -56,7 +56,8 @@ my ($Cmd, $Hostname, $LocalFilename, $ServerFilename, $PropName, @Rm);
 my (@Run, $RunIn, $RunOut, $RunErr, $WaitPid);
 my $SendFlags = 0;
 my $RunFlags = 0;
-my ($Port, $ConnectTimeout, $Timeout, $Keepalive, $TunnelOpt);
+my ($Port, $ConnectTimeout, $ConnectAttempts, $ConnectInterval, $Timeout);
+my ($Keepalive, $TunnelOpt);
 my $Usage;
 
 sub set_cmd($)
@@ -103,6 +104,14 @@ while (@ARGV)
     {
         $ConnectTimeout = check_opt_val($arg, $ConnectTimeout);
     }
+    elsif ($arg eq "--connect-attempts")
+    {
+        $ConnectAttempts = check_opt_val($arg, $ConnectAttempts);
+    }
+    elsif ($arg eq "--connect-interval")
+    {
+        $ConnectInterval = check_opt_val($arg, $ConnectInterval);
+    }
     elsif ($arg eq "--timeout")
     {
         $Timeout = check_opt_val($arg, $Timeout);
@@ -340,6 +349,9 @@ if (defined $Usage)
     print "  --port <port> Use the specified port number instead of the default one.\n";
     print "  --connect-timeout <timeout> Use the specified timeout (in seconds) when\n";
     print "                connecting instead of the default one.\n";
+    print "  --connect-attempts <count> How many connection attempts to perform.\n";
+    print "  --connect-interval <time> The minimum interval (in seconds) between failed\n";
+    print "                connection attempts.\n";
     print "  --timeout <timeout> Use the specified timeout (in seconds) instead of the\n";
     print "                default one for the operation.\n";
     print "  --keepalive <keepalive> How often (in seconds) the run and wait operations\n";
@@ -363,7 +375,10 @@ if ($TunnelOpt and $TunnelOpt =~ /^ssh:/)
 }
 
 my $TA = TestAgent->new($Hostname, $AgentPort, $TunnelInfo);
-$TA->SetConnectTimeout($ConnectTimeout) if (defined $ConnectTimeout);
+if (defined $ConnectTimeout or defined $ConnectAttempts or defined $ConnectInterval)
+{
+    $TA->SetConnectTimeout($ConnectTimeout, $ConnectAttempts, $ConnectInterval);
+}
 $TA->SetTimeout($Timeout) if (defined $Timeout);
 
 my $RC = 0;




More information about the wine-cvs mailing list