aboutsummaryrefslogtreecommitdiff
path: root/tests/sshhelp.pm
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2019-05-18 23:32:04 +0200
committerJay Satiro <raysatiro@yahoo.com>2019-12-09 19:32:41 -0500
commit9819984fbb04968dcec53a65ae0dfae23111dd18 (patch)
treeb66fdf74f8b3b7396e19f993df9125934209dee2 /tests/sshhelp.pm
parent213c5aca7bfc74a6ae02b065c5f38a1e9ff54d62 (diff)
tests: make it possible to set executable extensions
This enables the use of Windows Subsystem for Linux (WSL) to run the testsuite against Windows binaries while using Linux servers. This commit introduces the following environment variables: - CURL_TEST_EXE_EXT: set the executable extension for all components - CURL_TEST_EXE_EXT_TOOL: set it for the curl tool only - CURL_TEST_EXE_EXT_SSH: set it for the SSH tools only Later testcurl.pl could be adjusted to make use of those variables. - CURL_TEST_EXE_EXT_SRV: set it for the test servers only (This is one of several commits to support use of WSL for the tests.) Closes https://github.com/curl/curl/pull/3899
Diffstat (limited to 'tests/sshhelp.pm')
-rw-r--r--tests/sshhelp.pm21
1 files changed, 14 insertions, 7 deletions
diff --git a/tests/sshhelp.pm b/tests/sshhelp.pm
index 47ea2324c..248be67a2 100644
--- a/tests/sshhelp.pm
+++ b/tests/sshhelp.pm
@@ -106,12 +106,12 @@ use vars qw(
#***************************************************************************
# Global variables initialization
#
-$sshdexe = 'sshd' .exe_ext(); # base name and ext of ssh daemon
-$sshexe = 'ssh' .exe_ext(); # base name and ext of ssh client
-$sftpsrvexe = 'sftp-server' .exe_ext(); # base name and ext of sftp-server
-$sftpexe = 'sftp' .exe_ext(); # base name and ext of sftp client
-$sshkeygenexe = 'ssh-keygen' .exe_ext(); # base name and ext of ssh-keygen
-$httptlssrvexe = 'gnutls-serv' .exe_ext(); # base name and ext of gnutls-serv
+$sshdexe = 'sshd' .exe_ext('SSH'); # base name and ext of ssh daemon
+$sshexe = 'ssh' .exe_ext('SSH'); # base name and ext of ssh client
+$sftpsrvexe = 'sftp-server' .exe_ext('SSH'); # base name and ext of sftp-server
+$sftpexe = 'sftp' .exe_ext('SSH'); # base name and ext of sftp client
+$sshkeygenexe = 'ssh-keygen' .exe_ext('SSH'); # base name and ext of ssh-keygen
+$httptlssrvexe = 'gnutls-serv' .exe_ext('SSH'); # base name and ext of gnutls-serv
$sshdconfig = 'curl_sshd_config'; # ssh daemon config file
$sshconfig = 'curl_ssh_config'; # ssh client config file
$sftpconfig = 'curl_sftp_config'; # sftp client config file
@@ -180,6 +180,13 @@ $clipubkeyf = 'curl_client_key.pub'; # client public key file
# Return file extension for executable files on this operating system
#
sub exe_ext {
+ my ($component, @arr) = @_;
+ if ($ENV{'CURL_TEST_EXE_EXT'}) {
+ return $ENV{'CURL_TEST_EXE_EXT'};
+ }
+ if ($ENV{'CURL_TEST_EXE_EXT_'.$component}) {
+ return $ENV{'CURL_TEST_EXE_EXT_'.$component};
+ }
if ($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'msys' ||
$^O eq 'dos' || $^O eq 'os2') {
return '.exe';
@@ -314,7 +321,7 @@ sub find_exe_file {
my $fn = $_[0];
shift;
my @path = @_;
- my $xext = exe_ext();
+ my $xext = exe_ext('SSH');
foreach (@path) {
my $file = File::Spec->catfile($_, $fn);
if(-e $file && ! -d $file) {