[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 106/151: tests: make it possible to set executable extensions
From: |
gnunet |
Subject: |
[gnurl] 106/151: tests: make it possible to set executable extensions |
Date: |
Fri, 20 Dec 2019 14:26:55 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 9819984fbb04968dcec53a65ae0dfae23111dd18
Author: Marc Hoersken <address@hidden>
AuthorDate: Sat May 18 23:32:04 2019 +0200
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
---
tests/ftpserver.pl | 10 +++++++---
tests/httpserver.pl | 8 ++++++--
tests/runtests.pl | 14 +++++++++-----
tests/sshhelp.pm | 21 ++++++++++++++-------
4 files changed, 36 insertions(+), 17 deletions(-)
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
index d401be24c..ac02722e9 100755
--- a/tests/ftpserver.pl
+++ b/tests/ftpserver.pl
@@ -68,6 +68,10 @@ use serverhelp qw(
datasockf_logfilename
);
+use sshhelp qw(
+ exe_ext
+ );
+
#**********************************************************************
# global vars...
#
@@ -411,7 +415,7 @@ sub sysread_or_die {
}
sub startsf {
- my $mainsockfcmd = "./server/sockfilt " .
+ my $mainsockfcmd = "./server/sockfilt".exe_ext('SRV')." " .
"--ipv$ipvnum --port $port " .
"--pidfile \"$mainsockf_pidfile\" " .
"--logfile \"$mainsockf_logfile\"";
@@ -2401,7 +2405,7 @@ sub PASV_ftp {
logmsg "DATA sockfilt for passive data channel starting...\n";
# We fire up a new sockfilt to do the data transfer for us.
- my $datasockfcmd = "./server/sockfilt " .
+ my $datasockfcmd = "./server/sockfilt".exe_ext('SRV')." " .
"--ipv$ipvnum $bindonly --port 0 " .
"--pidfile \"$datasockf_pidfile\" " .
"--logfile \"$datasockf_logfile\"";
@@ -2620,7 +2624,7 @@ sub PORT_ftp {
logmsg "DATA sockfilt for active data channel starting...\n";
# We fire up a new sockfilt to do the data transfer for us.
- my $datasockfcmd = "./server/sockfilt " .
+ my $datasockfcmd = "./server/sockfilt".exe_ext('SRV')." " .
"--ipv$ipvnum --connect $port --addr \"$addr\" " .
"--pidfile \"$datasockf_pidfile\" " .
"--logfile \"$datasockf_logfile\"";
diff --git a/tests/httpserver.pl b/tests/httpserver.pl
index 7f6c86a8a..8b789a9b9 100755
--- a/tests/httpserver.pl
+++ b/tests/httpserver.pl
@@ -34,6 +34,10 @@ use serverhelp qw(
server_logfilename
);
+use sshhelp qw(
+ exe_ext
+ );
+
my $verbose = 0; # set to 1 for debugging
my $port = 8990; # just a default
my $unix_socket; # location to place a listening Unix socket
@@ -133,7 +137,7 @@ if($ipvnum eq 'unix') {
$flags .= "--srcdir \"$srcdir\"";
if($verbose) {
- print STDERR "RUN: server/sws $flags\n";
+ print STDERR "RUN: server/sws".exe_ext('SRV')." $flags\n";
}
-exec("server/sws $flags");
+exec("server/sws".exe_ext('SRV')." $flags");
diff --git a/tests/runtests.pl b/tests/runtests.pl
index 737fbe27e..961cdb753 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -150,7 +150,7 @@ my $SMBSPORT; # SMBS server port
my $NEGTELNETPORT; # TELNET server port with negotiation
my $srcdir = $ENV{'srcdir'} || '.';
-my $CURL="../src/curl".exe_ext(); # what curl executable to run on the tests
+my $CURL="../src/curl".exe_ext('TOOL'); # what curl executable to run on the
tests
my $VCURL=$CURL; # what curl binary to use to verify the servers with
# VCURL is handy to set to the system one when the one you
# just built hangs or crashes and thus prevent verification
@@ -2915,7 +2915,8 @@ sub checksystem {
# client has IPv6 support
# check if the HTTP server has it!
- my @sws = `server/sws --version`;
+ my $cmd = "server/sws".exe_ext('SRV')." --version";
+ my @sws = `$cmd`;
if($sws[0] =~ /IPv6/) {
# HTTP server has IPv6 support!
$http_ipv6 = 1;
@@ -2923,7 +2924,8 @@ sub checksystem {
}
# check if the FTP server has it!
- @sws = `server/sockfilt --version`;
+ $cmd = "server/sockfilt".exe_ext('SRV')." --version";
+ @sws = `$cmd`;
if($sws[0] =~ /IPv6/) {
# FTP server has IPv6 support!
$ftp_ipv6 = 1;
@@ -2932,7 +2934,8 @@ sub checksystem {
if($has_unix) {
# client has Unix sockets support, check whether the HTTP server has it
- my @sws = `server/sws --version`;
+ my $cmd = "server/sws".exe_ext('SRV')." --version";
+ my @sws = `$cmd`;
$http_unix = 1 if($sws[0] =~ /unix/);
}
@@ -3342,7 +3345,7 @@ sub singletest {
}
else {
if($var =~ /^LD_PRELOAD/) {
- if(exe_ext() && (exe_ext() eq '.exe')) {
+ if(exe_ext('TOOL') && (exe_ext('TOOL') eq '.exe')) {
# print "Skipping LD_PRELOAD due to lack of OS
support\n";
next;
}
@@ -3489,6 +3492,7 @@ sub singletest {
if(@codepieces) {
$tool = $codepieces[0];
chomp $tool;
+ $tool .= exe_ext('TOOL');
}
# remove server output logfile
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) {
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 75/151: docs: add "added: 7.68.0" to the --etag-* docs, (continued)
- [gnurl] 75/151: docs: add "added: 7.68.0" to the --etag-* docs, gnunet, 2019/12/20
- [gnurl] 81/151: openssl: set X509_V_FLAG_PARTIAL_CHAIN, gnunet, 2019/12/20
- [gnurl] 78/151: travis: do not use OVERRIDE_CC or OVERRIDE_CXX if empty, gnunet, 2019/12/20
- [gnurl] 91/151: curl_setup: fix `CURLRES_IPV6` condition, gnunet, 2019/12/20
- [gnurl] 71/151: strerror: Add Curl_winapi_strerror for Win API specific errors, gnunet, 2019/12/20
- [gnurl] 72/151: openssl: retrieve reported LibreSSL version at runtime, gnunet, 2019/12/20
- [gnurl] 74/151: copyright: fix the year ranges for two files, gnunet, 2019/12/20
- [gnurl] 68/151: docs: add more references to curl_multi_poll, gnunet, 2019/12/20
- [gnurl] 76/151: Azure Pipelines: initial CI setup, gnunet, 2019/12/20
- [gnurl] 97/151: mailmap: Mohammad Hasbini, gnunet, 2019/12/20
- [gnurl] 106/151: tests: make it possible to set executable extensions,
gnunet <=
- [gnurl] 92/151: etag: allow both --etag-compare and --etag-save in same cmdline, gnunet, 2019/12/20
- [gnurl] 95/151: RELEASE-NOTES: synced, gnunet, 2019/12/20
- [gnurl] 104/151: tests: use \r\n for log messages in WSL, gnunet, 2019/12/20
- [gnurl] 88/151: azure: add more builds, gnunet, 2019/12/20
- [gnurl] 93/151: setopt: Fix ALPN / NPN user option when built without HTTP2, gnunet, 2019/12/20
- [gnurl] 100/151: conncache: fix multi-thread use of shared connection cache, gnunet, 2019/12/20
- [gnurl] 111/151: vtls: make BearSSL possible to set with CURL_SSL_BACKEND, gnunet, 2019/12/20
- [gnurl] 109/151: travis: remove "coverage", make it "torture", gnunet, 2019/12/20
- [gnurl] 77/151: azure-pipelines: fix the test script, gnunet, 2019/12/20
- [gnurl] 73/151: build: Disable Visual Studio warning "conditional expression is constant", gnunet, 2019/12/20