tests: replace %PWD with %FILE_PWD for file://
Before this patch not all tests used `%FILE_PWD` with the `file://` protocol. Keep `%PWD` for test1145, to keep it fail on Windows like the test expects. Cherry-picked from #14949 Closes #15090
This commit is contained in:
parent
18143579ba
commit
f6cb707b6a
@ -18,6 +18,8 @@ file:// bad host
|
|||||||
</name>
|
</name>
|
||||||
# This command should not succeed since we only accept
|
# This command should not succeed since we only accept
|
||||||
# file:/// file://localhost/ file://127.0.0.1/
|
# file:/// file://localhost/ file://127.0.0.1/
|
||||||
|
# Pass %PWD instead of %FILE_PWD to trigger the expected
|
||||||
|
# error code with native Windows curl.
|
||||||
<command>
|
<command>
|
||||||
file://bad-host%PWD/%LOGDIR/test%TESTNUMBER.txt
|
file://bad-host%PWD/%LOGDIR/test%TESTNUMBER.txt
|
||||||
</command>
|
</command>
|
||||||
|
|||||||
@ -40,7 +40,7 @@ HTTP GET with -O -J and Content-Disposition (empty file)
|
|||||||
CURL_TESTDIR=%LOGDIR
|
CURL_TESTDIR=%LOGDIR
|
||||||
</setenv>
|
</setenv>
|
||||||
<command option="no-output,no-include">
|
<command option="no-output,no-include">
|
||||||
http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O file://%PWD/%LOGDIR/name%TESTNUMBER
|
http://%HOSTIP:%HTTPPORT/%TESTNUMBER -J -O file://%FILE_PWD/%LOGDIR/name%TESTNUMBER
|
||||||
</command>
|
</command>
|
||||||
</client>
|
</client>
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ file
|
|||||||
HTTP GET -o fname without Content-Disposition (empty file)
|
HTTP GET -o fname without Content-Disposition (empty file)
|
||||||
</name>
|
</name>
|
||||||
<command option="no-output,no-include">
|
<command option="no-output,no-include">
|
||||||
http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/outfile%TESTNUMBER file://%PWD/%LOGDIR/outfile%TESTNUMBER
|
http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o %LOGDIR/outfile%TESTNUMBER file://%FILE_PWD/%LOGDIR/outfile%TESTNUMBER
|
||||||
</command>
|
</command>
|
||||||
</client>
|
</client>
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ file
|
|||||||
Check --write-out with trailing %{
|
Check --write-out with trailing %{
|
||||||
</name>
|
</name>
|
||||||
<command>
|
<command>
|
||||||
file://localhost/%PWD/%LOGDIR/non-existent-file.txt --write-out '%{'
|
file://localhost/%FILE_PWD/%LOGDIR/non-existent-file.txt --write-out '%{'
|
||||||
</command>
|
</command>
|
||||||
</client>
|
</client>
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ file
|
|||||||
Check --write-out with trailing %
|
Check --write-out with trailing %
|
||||||
</name>
|
</name>
|
||||||
<command>
|
<command>
|
||||||
file://localhost/%PWD/%LOGDIR/non-existent-file.txt --write-out '%'
|
file://localhost/%FILE_PWD/%LOGDIR/non-existent-file.txt --write-out '%'
|
||||||
</command>
|
</command>
|
||||||
</client>
|
</client>
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ file
|
|||||||
Check --write-out with trailing \
|
Check --write-out with trailing \
|
||||||
</name>
|
</name>
|
||||||
<command>
|
<command>
|
||||||
file://localhost/%PWD/%LOGDIR/non-existent-file.txt --write-out '\'
|
file://localhost/%FILE_PWD/%LOGDIR/non-existent-file.txt --write-out '\'
|
||||||
</command>
|
</command>
|
||||||
</client>
|
</client>
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@ file
|
|||||||
missing file:// file
|
missing file:// file
|
||||||
</name>
|
</name>
|
||||||
<command>
|
<command>
|
||||||
file://localhost/%PWD/%LOGDIR/non-existent-file.txt
|
file://localhost/%FILE_PWD/%LOGDIR/non-existent-file.txt
|
||||||
</command>
|
</command>
|
||||||
</client>
|
</client>
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@ file
|
|||||||
"upload" nonexisting with file://
|
"upload" nonexisting with file://
|
||||||
</name>
|
</name>
|
||||||
<command option="no-include">
|
<command option="no-include">
|
||||||
file://localhost/%PWD/%LOGDIR/nonexisting/result%TESTNUMBER.txt -T %LOGDIR/upload%TESTNUMBER.txt
|
file://localhost/%FILE_PWD/%LOGDIR/nonexisting/result%TESTNUMBER.txt -T %LOGDIR/upload%TESTNUMBER.txt
|
||||||
</command>
|
</command>
|
||||||
<file name="%LOGDIR/upload%TESTNUMBER.txt">
|
<file name="%LOGDIR/upload%TESTNUMBER.txt">
|
||||||
data
|
data
|
||||||
|
|||||||
@ -24,7 +24,7 @@ file
|
|||||||
file:// with Unix path resolution behavior for the case of extra slashes
|
file:// with Unix path resolution behavior for the case of extra slashes
|
||||||
</name>
|
</name>
|
||||||
<command option="no-include">
|
<command option="no-include">
|
||||||
file:////%PWD/%LOGDIR/test%TESTNUMBER.txt
|
file:////%FILE_PWD/%LOGDIR/test%TESTNUMBER.txt
|
||||||
</command>
|
</command>
|
||||||
<precheck>
|
<precheck>
|
||||||
perl -e "print 'Test requires a Unix system' if ( $^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'dos' || $^O eq 'msys');"
|
perl -e "print 'Test requires a Unix system' if ( $^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'dos' || $^O eq 'msys');"
|
||||||
|
|||||||
@ -21,7 +21,7 @@ GET a directory using file://
|
|||||||
!win32
|
!win32
|
||||||
</features>
|
</features>
|
||||||
<command>
|
<command>
|
||||||
file://%PWD/
|
file://%FILE_PWD/
|
||||||
</command>
|
</command>
|
||||||
</client>
|
</client>
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ lib%TESTNUMBER
|
|||||||
simple multi file:// get
|
simple multi file:// get
|
||||||
</name>
|
</name>
|
||||||
<command>
|
<command>
|
||||||
file://%PWD/%LOGDIR/test%TESTNUMBER.txt
|
file://%FILE_PWD/%LOGDIR/test%TESTNUMBER.txt
|
||||||
</command>
|
</command>
|
||||||
<file name="%LOGDIR/test%TESTNUMBER.txt">
|
<file name="%LOGDIR/test%TESTNUMBER.txt">
|
||||||
foo
|
foo
|
||||||
|
|||||||
@ -3104,6 +3104,8 @@ sub subvariables {
|
|||||||
$$thing =~ s/${prefix}DATE/$DATE/g;
|
$$thing =~ s/${prefix}DATE/$DATE/g;
|
||||||
$$thing =~ s/${prefix}TESTNUMBER/$testnum/g;
|
$$thing =~ s/${prefix}TESTNUMBER/$testnum/g;
|
||||||
|
|
||||||
|
# POSIX/MSYS/Cygwin curl needs: file://localhost/d/path/to
|
||||||
|
# Windows native curl needs: file://localhost/D:/path/to
|
||||||
my $file_pwd = $pwd;
|
my $file_pwd = $pwd;
|
||||||
if($file_pwd !~ /^\//) {
|
if($file_pwd !~ /^\//) {
|
||||||
$file_pwd = "/$file_pwd";
|
$file_pwd = "/$file_pwd";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user