Module: tools
Branch: master
Commit: f49d5bd90360276afbea2603f398a5850d29bf01
URL: http://source.winehq.org/git/tools.git/?a=commit;h=f49d5bd90360276afbea2603…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Tue Dec 11 17:46:17 2012 +0100
testbot/TestAgent: Small fixes in the authentication data setup.
We don't allow interactive login methods so there's no point merging the 'interact' setting from the configuration defaults.
Also Net::SSH2 does not like getting undefined settings so don't override potentially defined values with undefined ones.
---
testbot/lib/WineTestBot/TestAgent.pm | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/testbot/lib/WineTestBot/TestAgent.pm b/testbot/lib/WineTestBot/TestAgent.pm
index 92d20bb..e04827a 100644
--- a/testbot/lib/WineTestBot/TestAgent.pm
+++ b/testbot/lib/WineTestBot/TestAgent.pm
@@ -798,9 +798,9 @@ sub _Connect($)
my $Tunnel = $self->{tunnel};
my %AuthOptions=(username => $Tunnel->{username} || $ENV{USER});
foreach my $Key ("username", "password", "publickey", "privatekey",
- "hostname", "local_username", "interact")
+ "hostname", "local_username")
{
- $AuthOptions{$Key} = $Tunnel->{$Key} if (exists $Tunnel->{$Key});
+ $AuthOptions{$Key} = $Tunnel->{$Key} if (defined $Tunnel->{$Key});
}
# Interactive authentication makes no sense with automatic reconnects
$AuthOptions{interact} = 0;
Module: tools
Branch: master
Commit: f486603d9079ce1905e8241d4794d06180489745
URL: http://source.winehq.org/git/tools.git/?a=commit;h=f486603d9079ce1905e8241d…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Tue Dec 11 17:46:00 2012 +0100
testbot/TestAgent: Add global configuration options for the SSH tunneling.
This makes it possible to use other SSH keys than just id_dsa.
This also makes it possible to disable SSH tunneling entirely or to
hardcode the SSH tunnel to use instead of using whatever VirtURI
specifies.
---
testbot/lib/WineTestBot/Config.pm | 8 ++++----
testbot/lib/WineTestBot/ConfigLocalTemplate.pl | 21 +++++++++++++++++++++
testbot/lib/WineTestBot/VMs.pm | 22 ++++++++++++----------
testbot/scripts/TestAgent | 20 +++++++++++---------
4 files changed, 48 insertions(+), 23 deletions(-)
diff --git a/testbot/lib/WineTestBot/Config.pm b/testbot/lib/WineTestBot/Config.pm
index 9a16fe6..8d96c36 100644
--- a/testbot/lib/WineTestBot/Config.pm
+++ b/testbot/lib/WineTestBot/Config.pm
@@ -32,8 +32,8 @@ use vars qw (@ISA @EXPORT @EXPORT_OK $UseSSL $LogDir $DataDir $BinDir
$BuildTimeout $ReconfigTimeout $OverheadTimeout $TagPrefix
$ProjectName $PatchesMailingList $PatchResultsEMail $LDAPServer
$LDAPBindDN $LDAPSearchBase $LDAPSearchFilter
- $LDAPRealNameAttribute $LDAPEMailAttribute $AgentPort
- $JobPurgeDays $JobArchiveDays $WebHostName);
+ $LDAPRealNameAttribute $LDAPEMailAttribute $AgentPort $Tunnel
+ $TunnelDefaults $JobPurgeDays $JobArchiveDays $WebHostName);
require Exporter;
@ISA = qw(Exporter);
@@ -44,8 +44,8 @@ require Exporter;
$SingleTimeout $BuildTimeout $ReconfigTimeout $OverheadTimeout
$TagPrefix $ProjectName $PatchesMailingList $PatchResultsEMail
$LDAPServer $LDAPBindDN $LDAPSearchBase $LDAPSearchFilter
- $LDAPRealNameAttribute $LDAPEMailAttribute $AgentPort
- $JobPurgeDays $JobArchiveDays $WebHostName);
+ $LDAPRealNameAttribute $LDAPEMailAttribute $AgentPort $Tunnel
+ $TunnelDefaults $JobPurgeDays $JobArchiveDays $WebHostName);
@EXPORT_OK = qw($DbDataSource $DbUsername $DbPassword);
if ($::RootDir !~ m=^/=)
diff --git a/testbot/lib/WineTestBot/ConfigLocalTemplate.pl b/testbot/lib/WineTestBot/ConfigLocalTemplate.pl
index 06afb77..38e6a3a 100644
--- a/testbot/lib/WineTestBot/ConfigLocalTemplate.pl
+++ b/testbot/lib/WineTestBot/ConfigLocalTemplate.pl
@@ -83,4 +83,25 @@ $WineTestBot::Config::LDAPEMailAttribute = undef;
# The port the VM agents are listening on
$WineTestBot::Config::AgentPort = undef;
+# This specifies if and how to do SSH tunneling.
+# - If unset then tunneling is automatic based on the VM's VirtURI setting.
+# - If set to an SSH URI, then tunneling is performed using these parameters.
+# - Any other setting disables SSH tunneling. In particular to disable
+# tunneling for SSH VirtURIs it is recommended to set this to 'never'.
+$Tunnel = undef;
+
+# If set this specifies the SSH tunnel parameters to be used for the
+# TestAgent connection. This is mostly useful for parameters that cannot be
+# specified through the SSH URI, like the key filenames. Listed below are
+# the supported settings. For a full reference, see the Net::SSH2::auth()
+# documentation. Note though that interactive methods are disabled.
+# - username
+# - password
+# - publickey
+# - privatekey
+# - hostname
+# - local_username
+$WineTestBot::Config::TunnelDefaults = undef;
+
+
1;
diff --git a/testbot/lib/WineTestBot/VMs.pm b/testbot/lib/WineTestBot/VMs.pm
index a42fb12..2d1c1fd 100644
--- a/testbot/lib/WineTestBot/VMs.pm
+++ b/testbot/lib/WineTestBot/VMs.pm
@@ -361,17 +361,19 @@ sub _GetTunnel($)
{
my ($self) = @_;
- # Auto-detect the SSH settings based on the libvirt URI
- my $VirtURI = $self->VirtURI;
- if ($VirtURI =~ s/^[a-z]+\+(?:ssh|libssh2):/ssh:/)
+ # Use either the tunnel specified in the configuration file
+ # or autodetect the settings based on the VM's VirtURI setting.
+ my $URI = $Tunnel || $self->VirtURI;
+
+ if ($URI =~ s/^(?:[a-z]+\+)?(?:ssh|libssh2):/ssh:/)
{
- my $URI = URI->new($VirtURI);
- my $TunnelInfo = {
- sshhost => $URI->host,
- sshport => $URI->port,
- username => $URI->userinfo,
- };
- return $TunnelInfo;
+ my $ParsedURI = URI->new($URI);
+
+ my %TunnelInfo = %$TunnelDefaults;
+ $TunnelInfo{sshhost} = $ParsedURI->host;
+ $TunnelInfo{sshport} = $ParsedURI->port;
+ $TunnelInfo{username} = $ParsedURI->userinfo;
+ return \%TunnelInfo;
}
return undef;
diff --git a/testbot/scripts/TestAgent b/testbot/scripts/TestAgent
index 6d241b5..f72531c 100755
--- a/testbot/scripts/TestAgent
+++ b/testbot/scripts/TestAgent
@@ -53,7 +53,7 @@ my ($Cmd, $Hostname, $LocalFilename, $ServerFilename, @Rm);
my (@Run, $RunIn, $RunOut, $RunErr);
my $SendFlags = 0;
my $RunFlags = 0;
-my ($Port, $ConnectTimeout, $Timeout, $Tunnel);
+my ($Port, $ConnectTimeout, $Timeout, $TunnelOpt);
my $Usage;
sub check_opt_val($$)
@@ -95,7 +95,7 @@ while (@ARGV)
}
elsif ($arg eq "--tunnel")
{
- $Tunnel = check_opt_val($arg, $Tunnel);
+ $TunnelOpt = check_opt_val($arg, $TunnelOpt);
}
elsif ($arg eq "--sendfile-exe")
{
@@ -189,9 +189,9 @@ if (!defined $Usage)
$Usage = 2;
}
$AgentPort = $Port if (defined $Port);
- if (defined $Tunnel and $Tunnel !~ /^ssh:/)
+ if ($TunnelOpt and $TunnelOpt !~ /^ssh:/)
{
- error("only SSH proxies are supported\n");
+ error("only SSH tunnels are supported\n");
$Usage = 2;
}
}
@@ -239,13 +239,15 @@ if (defined $Usage)
exit 0;
}
+$TunnelOpt = $Tunnel if (!defined $TunnelOpt);
my $TunnelInfo;
-if (defined $Tunnel)
+if ($TunnelOpt)
{
- my $URI = URI->new($Tunnel);
- $TunnelInfo = {sshhost => $URI->host,
- sshport => $URI->port,
- username => $URI->userinfo};
+ my $ParsedURI = URI->new($TunnelOpt);
+ %$TunnelInfo = %$TunnelDefaults;
+ $TunnelInfo->{sshhost} = $ParsedURI->host;
+ $TunnelInfo->{sshport} = $ParsedURI->port;
+ $TunnelInfo->{username} = $ParsedURI->userinfo;
}
my $TA = TestAgent->new($Hostname, $AgentPort, $TunnelInfo);
Module: tools
Branch: master
Commit: 23453c79aa6a08d2891d7b32ad84f2006b7b07e7
URL: http://source.winehq.org/git/tools.git/?a=commit;h=23453c79aa6a08d2891d7b32…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Tue Dec 11 12:17:13 2012 +0100
testbot/testagentd: Reset the status when handling a new client.
Otherwise, once the status has been set to FATAL, it cannot be set to
anything else anymore, even for other clients.
---
testbot/src/testagentd/testagentd.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/testbot/src/testagentd/testagentd.c b/testbot/src/testagentd/testagentd.c
index fc3a840..13d16e4 100644
--- a/testbot/src/testagentd/testagentd.c
+++ b/testbot/src/testagentd/testagentd.c
@@ -155,6 +155,8 @@ void set_status(int newstatus, const char* format, ...)
status = newstatus;
if (newstatus == ST_FATAL)
broken = 1;
+ else if (newstatus == ST_OK)
+ broken = 0;
va_start(valist, format);
vset_status_msg(format, valist);
va_end(valist);
@@ -1145,7 +1147,9 @@ int main(int argc, char** argv)
{
if (is_host_allowed(client, opt_srchost, addrlen))
{
- broken = 0;
+ /* Reset the status so new non-fatal errors can be set */
+ set_status(ST_OK, "ok");
+
/* Send the version right away */
send_string(client, PROTOCOL_VERSION);