aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/FILEFORMAT.md24
-rw-r--r--tests/azure.pm12
-rw-r--r--tests/data/Makefile.inc10
-rw-r--r--tests/data/test11196
-rw-r--r--tests/data/test113910
-rw-r--r--tests/data/test11406
-rw-r--r--tests/data/test119788
-rw-r--r--tests/data/test13302
-rw-r--r--tests/data/test14522
-rw-r--r--tests/data/test15546
-rw-r--r--tests/data/test156773
-rw-r--r--tests/data/test19082
-rw-r--r--tests/data/test20432
-rw-r--r--tests/data/test20702
-rw-r--r--tests/data/test301057
-rw-r--r--tests/data/test396202
-rw-r--r--tests/data/test397198
-rw-r--r--tests/data/test5582
-rw-r--r--tests/data/test67457
-rw-r--r--tests/data/test8427
-rw-r--r--tests/data/test8437
-rw-r--r--tests/data/test84412
-rw-r--r--tests/data/test8459
-rw-r--r--tests/data/test8879
-rw-r--r--tests/data/test8887
-rw-r--r--tests/data/test8899
-rw-r--r--tests/data/test8907
-rw-r--r--tests/data/test9143
-rw-r--r--tests/data/test9469
-rw-r--r--tests/data/test9477
-rw-r--r--tests/data/test9489
-rw-r--r--tests/data/test9497
-rw-r--r--tests/data/test9553
-rw-r--r--tests/data/test9593
-rw-r--r--tests/data/test9702
-rwxr-xr-xtests/ftpserver.pl39
-rw-r--r--tests/libtest/Makefile.am7
-rw-r--r--tests/libtest/Makefile.inc17
-rw-r--r--tests/libtest/lib1567.c52
-rw-r--r--tests/libtest/lib3010.c66
-rw-r--r--tests/libtest/lib557.c13
-rw-r--r--tests/libtest/lib674.c81
-rw-r--r--tests/libtest/testutil.c2
-rwxr-xr-xtests/manpage-scan.pl2
-rwxr-xr-xtests/nroff-scan.pl12
-rw-r--r--tests/runtests.14
-rwxr-xr-xtests/runtests.pl331
-rw-r--r--tests/server/util.c3
-rw-r--r--tests/sshserver.pl5
-rwxr-xr-xtests/symbol-scan.pl3
-rw-r--r--tests/testcurl.12
51 files changed, 1202 insertions, 308 deletions
diff --git a/tests/FILEFORMAT.md b/tests/FILEFORMAT.md
index 62cddd1a..c280c852 100644
--- a/tests/FILEFORMAT.md
+++ b/tests/FILEFORMAT.md
@@ -21,6 +21,25 @@ variables are substituted by the their respective contents and the output
version of the test file is stored as `log/testNUM`. That version is what will
be read and used by the test servers.
+## Base64 Encoding
+
+In the preprocess stage, a special instruction can be used to have runtests.pl
+base64 encode a certain section and insert in the generated output file. This
+is in particular good for test cases where the test tool is expected to pass
+in base64 encoded content that might use dynamic information that is unique
+for this particular test invocation, like the server port number.
+
+To insert a base64 encoded string into the output, use this syntax:
+
+ %b64[ data to encode ]b64%
+
+The data to encode can then use any of the existing variables mentioned below,
+or even percent-encoded individual bytes. As an example, insert the HTTP
+server's port number (in ASCII) followed by a space and the hexadecimal byte
+9a:
+
+ %b64[%HTTPPORT %9a]b64%
+
# Variables
When the test is preprocessed, a range of "variables" in the test file will be
@@ -44,6 +63,7 @@ Available substitute variables include:
- `%HOSTIP` - IPv4 address of the host running this test
- `%HTTP6PORT` - IPv6 port number of the HTTP server
- `%HTTPPORT` - Port number of the HTTP server
+- `%HTTP2PORT` - Port number of the HTTP/2 server
- `%HTTPSPORT` - Port number of the HTTPS server
- `%HTTPSPROXYPORT` - Port number of the HTTPS-proxy
- `%HTTPTLS6PORT` - IPv6 port number of the HTTP TLS server
@@ -52,7 +72,7 @@ Available substitute variables include:
- `%IMAP6PORT` - IPv6 port number of the IMAP server
- `%IMAPPORT` - Port number of the IMAP server
- `%MQTTPORT` - Port number of the MQTT server
-- `%NEGTELNETPORT` - Port number of the telnet server
+- `%TELNETPORT` - Port number of the telnet server
- `%NOLISTENPORT` - Port number where no service is listening
- `%POP36PORT` - IPv6 port number of the POP3 server
- `%POP3PORT` - Port number of the POP3 server
@@ -308,6 +328,7 @@ Features testable here are:
- `parsedate`
- `proxy`
- `PSL`
+- `Schannel`
- `shuffle-dns`
- `socks`
- `SPNEGO`
@@ -322,7 +343,6 @@ Features testable here are:
- `unix-sockets`
- `verbose-strings`
- `win32`
-- `WinSSL`
as well as each protocol that curl supports. A protocol only needs to be
specified if it is different from the server (useful when the server
diff --git a/tests/azure.pm b/tests/azure.pm
index 9dcb56c7..004c3d30 100644
--- a/tests/azure.pm
+++ b/tests/azure.pm
@@ -48,7 +48,7 @@ sub azure_create_test_run {
'build': {'id': '$ENV{'BUILD_BUILDID'}'}
}
" \\
- "$azure_baseurl/_apis/test/runs?api-version=5.0"`;
+ "$azure_baseurl/_apis/test/runs?api-version=5.1"`;
if($azure_run =~ /"id":(\d+)/) {
return $1;
}
@@ -75,7 +75,7 @@ sub azure_create_test_result {
}
]
" \\
- "$azure_baseurl/_apis/test/runs/$azure_run_id/results?api-version=5.0"`;
+ "$azure_baseurl/_apis/test/runs/$azure_run_id/results?api-version=5.1"`;
if($azure_result =~ /\[\{"id":(\d+)/) {
return $1;
}
@@ -92,10 +92,10 @@ sub azure_update_test_result {
my $azure_duration = sprintf("%.0f", ($stop-$start)*1000);
my $azure_outcome;
if($error == 2) {
- $azure_outcome = 'Not applicable';
+ $azure_outcome = 'NotApplicable';
}
elsif($error < 0) {
- $azure_outcome = 'Not executed';
+ $azure_outcome = 'NotExecuted';
}
elsif(!$error) {
$azure_outcome = 'Passed';
@@ -118,7 +118,7 @@ sub azure_update_test_result {
}
]
" \\
- "$azure_baseurl/_apis/test/runs/$azure_run_id/results?api-version=5.0"`;
+ "$azure_baseurl/_apis/test/runs/$azure_run_id/results?api-version=5.1"`;
if($azure_result =~ /\[\{"id":(\d+)/) {
return $1;
}
@@ -136,7 +136,7 @@ sub azure_update_test_run {
'state': 'Completed'
}
" \\
- "$azure_baseurl/_apis/test/runs/$azure_run_id?api-version=5.0"`;
+ "$azure_baseurl/_apis/test/runs/$azure_run_id?api-version=5.1"`;
if($azure_run =~ /"id":(\d+)/) {
return $1;
}
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
index ef9252b7..3752502e 100644
--- a/tests/data/Makefile.inc
+++ b/tests/data/Makefile.inc
@@ -61,7 +61,7 @@ test334 test335 test336 test337 test338 test339 test340 test341 test342 \
test343 test344 test345 test346 \
test350 test351 test352 test353 test354 test355 test356 test357 test358 \
test359 \
-test393 test394 test395 \
+test393 test394 test395 test396 test397 \
\
test400 test401 test402 test403 test404 test405 test406 test407 test408 \
test409 \
@@ -89,7 +89,7 @@ test635 test636 test637 test638 test639 test640 test641 test642 \
test643 test644 test645 test646 test647 test648 test649 test650 test651 \
test652 test653 test654 test655 test656 test658 test659 test660 test661 \
test662 test663 test664 test665 test666 test667 test668 test669 \
-test670 test671 test672 test673 \
+test670 test671 test672 test673 test674 \
\
test700 test701 test702 test703 test704 test705 test706 test707 test708 \
test709 test710 test711 test712 test713 test714 test715 test716 test717 \
@@ -141,7 +141,7 @@ test1168 \
test1170 test1171 test1172 test1173 test1174 test1175 test1176 test1177 \
test1178 test1179 \
\
-test1190 test1191 test1192 test1193 test1194 test1195 test1196 \
+test1190 test1191 test1192 test1193 test1194 test1195 test1196 test1197 \
\
test1200 test1201 test1202 test1203 test1204 test1205 test1206 test1207 \
test1208 test1209 test1210 test1211 test1212 test1213 test1214 test1215 \
@@ -189,7 +189,7 @@ test1540 test1541 \
\
test1550 test1551 test1552 test1553 test1554 test1555 test1556 test1557 \
test1558 test1559 test1560 test1561 test1562 test1563 test1564 test1565 \
-test1566 \
+test1566 test1567 \
\
test1590 test1591 test1592 test1593 test1594 test1595 test1596 \
\
@@ -225,4 +225,4 @@ test2080 \
test2100 \
\
test3000 test3001 \
-test3002 test3003 test3004 test3005 test3006 test3007
+test3002 test3003 test3004 test3005 test3006 test3007 test3010
diff --git a/tests/data/test1119 b/tests/data/test1119
index 017f598f..5fb3c944 100644
--- a/tests/data/test1119
+++ b/tests/data/test1119
@@ -22,4 +22,10 @@ Verify that symbols-in-versions and headers are in sync
</command>
</client>
+<verify>
+<stdout>
+OK
+</stdout>
+</verify>
+
</testcase>
diff --git a/tests/data/test1139 b/tests/data/test1139
index 72761c67..b5267b01 100644
--- a/tests/data/test1139
+++ b/tests/data/test1139
@@ -15,13 +15,19 @@ documentation
none
</server>
- <name>
+<name>
Verify that all libcurl options have man pages
- </name>
+</name>
<command type="perl">
%SRCDIR/manpage-scan.pl %SRCDIR/.. %PWD/..
</command>
</client>
+<verify>
+<stderr>
+0
+</stderr>
+</verify>
+
</testcase>
diff --git a/tests/data/test1140 b/tests/data/test1140
index b9458be9..f083eec3 100644
--- a/tests/data/test1140
+++ b/tests/data/test1140
@@ -23,4 +23,10 @@ Verify the nroff of man pages
</command>
</client>
+<verify>
+<stdout>
+OK
+</stdout>
+</verify>
+
</testcase>
diff --git a/tests/data/test1197 b/tests/data/test1197
new file mode 100644
index 00000000..96d368f8
--- /dev/null
+++ b/tests/data/test1197
@@ -0,0 +1,88 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+followlocation
+--write-out
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 302 OK swsbounce swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 8
+Connection: close
+Content-Type: text/plain
+Location: ./11970001
+
+monster
+</data>
+<data1 nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 15
+Connection: close
+Content-Type: text/plain; charset=us-ascii
+
+bigger monster
+</data1>
+
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP POST redirected to GET and --write-out method
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1197 -w "%{method}\n" -L -d "twinkle twinkle little star"
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+POST /1197 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Content-Length: 27
+Content-Type: application/x-www-form-urlencoded
+
+twinkle twinkle little starGET /11970001 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+
+<stdout>
+HTTP/1.1 302 OK swsbounce swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 8
+Connection: close
+Content-Type: text/plain
+Location: ./11970001
+
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Content-Length: 15
+Connection: close
+Content-Type: text/plain; charset=us-ascii
+
+bigger monster
+GET
+</stdout>
+
+</verify>
+</testcase>
diff --git a/tests/data/test1330 b/tests/data/test1330
index ce04e333..f7ac9b0d 100644
--- a/tests/data/test1330
+++ b/tests/data/test1330
@@ -41,6 +41,8 @@ s/\(.*\)/()/
s/:\d+/:/
s:^(MEM )(.*/)(.*):$1$3:
s/\r\n/\n/
+s/^MEM getenv.c: realloc\(\)[\n]$//
+s/^MEM getenv.c: free\(\)[\n]$//
</stripfile>
</verify>
</testcase>
diff --git a/tests/data/test1452 b/tests/data/test1452
index 0a84cf8c..6c76ef84 100644
--- a/tests/data/test1452
+++ b/tests/data/test1452
@@ -29,7 +29,7 @@ Basic TELNET negotiation
test1452
</stdin>
<command>
-telnet://%HOSTIP:%NEGTELNETPORT --upload-file -
+telnet://%HOSTIP:%TELNETPORT --upload-file -
</command>
</client>
diff --git a/tests/data/test1554 b/tests/data/test1554
index d3926d91..fffa6adb 100644
--- a/tests/data/test1554
+++ b/tests/data/test1554
@@ -50,6 +50,8 @@ run 1: foobar and so on fun!
<- Mutex unlock
-> Mutex lock
<- Mutex unlock
+-> Mutex lock
+<- Mutex unlock
run 1: foobar and so on fun!
-> Mutex lock
<- Mutex unlock
@@ -65,6 +67,8 @@ run 1: foobar and so on fun!
<- Mutex unlock
-> Mutex lock
<- Mutex unlock
+-> Mutex lock
+<- Mutex unlock
run 1: foobar and so on fun!
-> Mutex lock
<- Mutex unlock
@@ -74,6 +78,8 @@ run 1: foobar and so on fun!
<- Mutex unlock
-> Mutex lock
<- Mutex unlock
+-> Mutex lock
+<- Mutex unlock
</datacheck>
</reply>
diff --git a/tests/data/test1567 b/tests/data/test1567
new file mode 100644
index 00000000..088ebf49
--- /dev/null
+++ b/tests/data/test1567
@@ -0,0 +1,73 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+URL API
+CURLOPT_CURLU
+CURLOPT_FOLLOWLOCATION
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+HTTP/1.1 302 OK
+Content-Length: 6
+Location: /15670002
+
+-foo-
+</data>
+<data2>
+HTTP/1.1 200 OK
+Content-Length: 11
+
+redirected
+</data2>
+<datacheck>
+redirected
+redirected
+</datacheck>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# tool is what to use instead of 'curl'
+<tool>
+lib1567
+</tool>
+
+ <name>
+re-run redirected transfer without setting CURLU URL again
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/1567
+</command>
+</client>
+
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /1567 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /15670002 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /1567 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /15670002 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test1908 b/tests/data/test1908
index 236bd4af..bf23ef9f 100644
--- a/tests/data/test1908
+++ b/tests/data/test1908
@@ -62,7 +62,7 @@ Accept: */*
# matches
s/\"([^\"]*)\"/TIMESTAMP/
</stripfile>
-<file name="log/altsvc-1908">
+<file name="log/altsvc-1908" mode="text">
# Your alt-svc cache. https://curl.haxx.se/docs/alt-svc.html
# This file was generated by libcurl! Edit at your own risk.
h1 127.0.0.1 %HTTPPORT h2 3dbbdetxoyw4nsp6c3cc456oj2ays6s43ezxzsfxxri3h5xqd.example 443 TIMESTAMP 1 0
diff --git a/tests/data/test2043 b/tests/data/test2043
index 34f53b72..754a9b92 100644
--- a/tests/data/test2043
+++ b/tests/data/test2043
@@ -10,7 +10,7 @@ HTTP GET
# Client-side
<client>
<features>
-WinSSL
+Schannel
</features>
<server>
none
diff --git a/tests/data/test2070 b/tests/data/test2070
index 4a21512b..f03c87b4 100644
--- a/tests/data/test2070
+++ b/tests/data/test2070
@@ -24,7 +24,7 @@ MooMoo
# Client-side
<client>
<features>
-WinSSL
+Schannel
!MinGW
</features>
<server>
diff --git a/tests/data/test3010 b/tests/data/test3010
new file mode 100644
index 00000000..1372a79d
--- /dev/null
+++ b/tests/data/test3010
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP Basic
+RETRY-AFTER
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 301 Moved Permanently
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Type: text/html
+Content-Length: 0
+Retry-After: 2
+Location: /30100002
+
+</data>
+<data2>
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Type: text/html
+Content-Length: 0
+
+</data2>
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+
+<name>
+HTTP retry-after reset
+</name>
+<tool>
+lib3010
+</tool>
+
+<command>
+%HOSTIP:%HTTPPORT/3010
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<stdout>
+Retry-After: 2
+Retry-After: 0
+</stdout>
+</verify>
+</testcase>
diff --git a/tests/data/test396 b/tests/data/test396
new file mode 100644
index 00000000..1dd03421
--- /dev/null
+++ b/tests/data/test396
@@ -0,0 +1,202 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+compressed
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+<data base64="yes">
+SFRUUC8xLjEgMjAwIE9LDQpEYXRlOiBNb24sIDI5IE5vdiAyMDA0IDIxOjU2OjUzIEdNVA0KU2Vy
+dmVyOiBBcGFjaGUvMS4zLjMxIChEZWJpYW4gR05VL0xpbnV4KSBtb2RfZ3ppcC8xLjMuMjYuMWEg
+UEhQLzQuMy45LTEgbW9kX3NzbC8yLjguMjAgT3BlblNTTC8wLjkuN2QgbW9kX3BlcmwvMS4yOQ0K
+VmFyeTogQWNjZXB0LUVuY29kaW5nDQpDb250ZW50LVR5cGU6IHRleHQvaHRtbDsgY2hhcnNldD1J
+U08tODg1OS0xDQpDb250ZW50LUVuY29kaW5nOiB6c3RkDQpDb250ZW50LUxlbmd0aDogMTMwOQ0K
+DQootS/9ZLESfSgAhj+9KODQugGwA7ZypiefqCCMWuEChf2B/kAy8O+aCN/J85sQo2WYoY3AzAu3
+ALMArADzIbf2pNpzu3kaHt3a+7pumz3QvrNJn6zxUdptGFLvNOy67bymt1gZRqqBqhqopndRkImC
+WNNUYZLrGFaqAWoasKZHVZBrglyVCoXJljJq+kbJsKImFCan5j0IgxD2kFdKljRBHrJtWNa+0GLG
+t6t0Y2+db98wD3D3dh7PwZLBVGAep877k0Ku1hbWuWeJqMgcQCAAQAgreFCQiuS6IBAYhgcBp05p
+tdrvMUnUg6Da+d6eR7eMAhjTU/ubEztOjRRyTNXz9lh739eZvfb42ruTgRxSd+6LNDLIIdsbw3Lv
+5/fMsM699c68G27U5mZebw1yXDCYbOvqdSvdYvxH7kWyt+7bIUcko6Vc977nhbXai24X3bccJD5K
+GwNyfHyRhGUhAkIhslwYEl4UYYBweVHG8nCxZF6UOWBASIAcUUQm4UWYKCKTWXh/3XJc9+8yPCkj
+3qrx30GObzo3Ht/Px1B6783X6PddJCZey7W1Se0G2a373CC/5z3vYYj1x47mHWT5WcbbjLdZy6zl
+xvnGOWSOpc2psaNx88PNT/XJqk/24dwP50Jmn7K9N9thyPxYcyKnod4xvLSLm0bANB2tRs8i2Fc7
+Lzdd+6x7hpGLIVVht3ZW0zCcJNIVnaFkYkhdUoRiaEkkqyKZeKQdZzmGlQmFXdToDCeUFMFubc2b
+Y0iRSNZFkWDtVnuNxp003ulhCDmkv7W3aj0MIYzht0eIVkUklkWj3GYvUKypimSTfihJpKIi1kSj
+ZSgQ8C4YTG3uzsvQmlgUTE6G00Num9XaHwTNadyn0VOrLWtzLSHDiISaKlfFmlDTNFXUdVGRSVUx
+rDzW7411btMZMkPvigGBNbXOkL0lJ2Yb1DuGHO+s9sU82rPGd9u5XWSIZVvXuZprO1+7XXvIckqu
+aUJhWEkVJVEwTdN2zWV4eVs3r9uv9uBRcIbBAesPgOiggZVzaGZABgAggEEBQELCICNKAyHz5wz5
+Gr+3SMoKzoiT4JcFlMRJ8E0BVdBikl8WJGONBZ5ErsE5h2Oju5HWDnZ50LZofbucqKR8qlj/gvM2
+pP8JtMX1f4XHv4sy+T9yUDCHs9YmJmw5hnGWowLZWgC0/j7rTMyJRnY3KrwRdj/wXTFmjnFucfZu
+/94DmfjeEDOFz0C0f3YgYWUsI+2YO9YVXGtiM3AJTNsy5j6K9jkAKLew5bRCRJqMYqloGVw2M0JH
+f4ZlSeeJaBsx6A24uIythC24JsTWGU7cNBP0NL3qbNPMIllkjj1n95If2W0cQobpYDaGF2ja1bjg
+5MAexBa5GWSJY2kGTsRGwkEd3Ad5qiG3zWSmXQGb7VwHzPvskUlDyLuenXPmlGEajIyyvcZ1Dns9
+S2Ru2G3YO5OHEHZNu4aZS8MuG5GPrZkBNbsTDMDQBg0rr/EM2GW5AKf9gZiRlINAzPQ5ltqgBSFC
+GNOIHYGDMjg5MNphi1sImR3WcGKBiIA8sM64mdAQ0sxEb84XSBFzplx8N2jz0O5guS/GeNfaqg7r
+yLrOzSoJKq2aJUadLQgFtLV6UcfzOw296pBr0/ms+rHmnTs5jnmC0eqLUKV72l4Ym3HYkknmcEsY
+QP51NUQZGktcjt2485yobNJeXv/S9pzH3nguOoYl36mAbjiMjYXDkIwI+7N0JMiHzrs7y3WvSOFZ
+</data>
+
+<datacheck>
+HTTP/1.1 200 OK
+Date: Mon, 29 Nov 2004 21:56:53 GMT
+Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29
+Vary: Accept-Encoding
+Content-Type: text/html; charset=ISO-8859-1
+Content-Encoding: zstd
+Content-Length: 1309
+
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE project-listing SYSTEM "http://freshmeat.net/backend/fm-projects-0.4.dtd">
+<project-listing>
+ <project>
+ <project_id>1612</project_id>
+ <date_added>1998-08-21 04:01:29</date_added>
+ <date_updated>2004-10-18 02:22:23</date_updated>
+ <projectname_short>curl</projectname_short>
+ <projectname_full>curl and libcurl</projectname_full>
+ <desc_short>Command line tool and library for client-side URL transfers.</desc_short>
+ <desc_full>curl and libcurl is a tool for transferring files
+using URL syntax. It supports HTTP, HTTPS, FTP,
+FTPS, DICT, TELNET, LDAP, FILE, and GOPHER, as
+well as HTTP-post, HTTP-put, cookies, FTP upload,
+resumed transfers, passwords, portnumbers, SSL
+certificates, Kerberos, and proxies. It is powered
+by libcurl, the client-side URL transfer library.
+There are bindings to libcurl for over 20
+languages and environments.
+</desc_full>
+ <vitality_score>5784.57</vitality_score>
+ <vitality_percent>3.16</vitality_percent>
+ <vitality_rank>169</vitality_rank>
+ <popularity_score>6594.54</popularity_score>
+ <popularity_percent>13.81</popularity_percent>
+ <popularity_rank>105</popularity_rank>
+ <rating>8.50</rating>
+ <rating_count>21</rating_count>
+ <rating_rank>183</rating_rank>
+ <subscriptions>323</subscriptions>
+ <branch_name>Default</branch_name>
+ <url_project_page>http://freshmeat.net/projects/curl/</url_project_page>
+ <url_homepage>http://freshmeat.net/redir/curl/1612/url_homepage/</url_homepage>
+ <url_tgz>http://freshmeat.net/redir/curl/1612/url_tgz/</url_tgz>
+ <url_bz2>http://freshmeat.net/redir/curl/1612/url_bz2/</url_bz2>
+ <url_zip>http://freshmeat.net/redir/curl/1612/url_zip/</url_zip>
+ <url_changelog>http://freshmeat.net/redir/curl/1612/url_changelog/</url_changelog>
+ <url_rpm>http://freshmeat.net/redir/curl/1612/url_rpm/</url_rpm>
+ <url_deb>http://freshmeat.net/redir/curl/1612/url_deb/</url_deb>
+ <url_osx>http://freshmeat.net/redir/curl/1612/url_osx/</url_osx>
+ <url_bsdport>http://freshmeat.net/redir/curl/1612/url_bsdport/</url_bsdport>
+ <url_purchase></url_purchase>
+ <url_cvs>http://freshmeat.net/redir/curl/1612/url_cvs/</url_cvs>
+ <url_list>http://freshmeat.net/redir/curl/1612/url_list/</url_list>
+ <url_mirror>http://freshmeat.net/redir/curl/1612/url_mirror/</url_mirror>
+ <url_demo></url_demo>
+ <license>MIT/X Consortium License</license>
+ <latest_release>
+ <latest_release_version>7.12.2</latest_release_version>
+ <latest_release_id>176085</latest_release_id>
+ <latest_release_date>2004-10-18 02:22:23</latest_release_date>
+ </latest_release>
+ <screenshot_thumb></screenshot_thumb>
+ <authors>
+ <author>
+ <author_name>Daniel Stenberg</author_name>
+ <author_url>http://freshmeat.net/~bagder/</author_url>
+ <author_role>Owner</author_role>
+ </author>
+ </authors>
+ <descriminators>
+ <trove_id>12</trove_id>
+ <trove_id>226</trove_id>
+ <trove_id>3</trove_id>
+ <trove_id>2</trove_id>
+ <trove_id>188</trove_id>
+ <trove_id>216</trove_id>
+ <trove_id>200</trove_id>
+ <trove_id>220</trove_id>
+ <trove_id>164</trove_id>
+ <trove_id>90</trove_id>
+ <trove_id>89</trove_id>
+ <trove_id>809</trove_id>
+ <trove_id>150</trove_id>
+ <trove_id>224</trove_id>
+ <trove_id>900</trove_id>
+ <trove_id>839</trove_id>
+ </descriminators>
+ <dependencies>
+ <dependency type="recommended">
+ <dependency_release_id>0</dependency_release_id>
+ <dependency_branch_id>7464</dependency_branch_id>
+ <dependency_project_id>7464</dependency_project_id>
+ <dependency_project_title>OpenSSL (Default)</dependency_project_title>
+ </dependency>
+ <dependency type="optional">
+ <dependency_release_id>0</dependency_release_id>
+ <dependency_branch_id>0</dependency_branch_id>
+ <dependency_project_id>7443</dependency_project_id>
+ <dependency_project_title>OpenLDAP</dependency_project_title>
+ </dependency>
+ <dependency type="optional">
+ <dependency_release_id>0</dependency_release_id>
+ <dependency_branch_id>0</dependency_branch_id>
+ <dependency_project_id>12351</dependency_project_id>
+ <dependency_project_title>zlib</dependency_project_title>
+ </dependency>
+ <dependency type="optional">
+ <dependency_release_id>0</dependency_release_id>
+ <dependency_branch_id>0</dependency_branch_id>
+ <dependency_project_id>32047</dependency_project_id>
+ <dependency_project_title>Heimdal</dependency_project_title>
+ </dependency>
+ <dependency type="optional">
+ <dependency_release_id>0</dependency_release_id>
+ <dependency_branch_id>0</dependency_branch_id>
+ <dependency_project_id>44532</dependency_project_id>
+ <dependency_project_title>c-ares</dependency_project_title>
+ </dependency>
+ </dependencies>
+ </project>
+</project-listing>
+</datacheck>
+
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+zstd
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP GET zstd compressed content
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/396 --compressed
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<strippart>
+s/^Accept-Encoding: .*/Accept-Encoding: xxx/
+</strippart>
+<protocol>
+GET /396 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Accept-Encoding: xxx
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test397 b/tests/data/test397
new file mode 100644
index 00000000..6f872e2a
--- /dev/null
+++ b/tests/data/test397
@@ -0,0 +1,198 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+compressed
+</keywords>
+</info>
+#
+# Server-side
+<reply>
+# Length of not-encoded content is 16512 what is greater than default value of
+# CURL_MAX_WRITE_SIZE (16384)
+<data base64="yes">
+SFRUUC8xLjEgMjAwIE9LDQpEYXRlOiBNb24sIDI5IE5vdiAyMDA0IDIxOjU2OjUzIEdNVA0KU2Vy
+dmVyOiBBcGFjaGUvMS4zLjMxIChEZWJpYW4gR05VL0xpbnV4KSBtb2RfZ3ppcC8xLjMuMjYuMWEg
+UEhQLzQuMy45LTEgbW9kX3NzbC8yLjguMjAgT3BlblNTTC8wLjkuN2QgbW9kX3BlcmwvMS4yOQ0K
+VmFyeTogQWNjZXB0LUVuY29kaW5nDQpDb250ZW50LVR5cGU6IHRleHQvaHRtbDsgY2hhcnNldD1J
+U08tODg1OS0xDQpDb250ZW50LUVuY29kaW5nOiB6c3RkDQpDb250ZW50LUxlbmd0aDogNDcNCg0K
+KLUv/WSAPw0BAIgwMTIzNDU2Nzg5QUJDREVGCgQAfJ9geAAEGh3Sq006l4KvuZw=
+</data>
+
+<datacheck>
+HTTP/1.1 200 OK
+Date: Mon, 29 Nov 2004 21:56:53 GMT
+Server: Apache/1.3.31 (Debian GNU/Linux) mod_gzip/1.3.26.1a PHP/4.3.9-1 mod_ssl/2.8.20 OpenSSL/0.9.7d mod_perl/1.29
+Vary: Accept-Encoding
+Content-Type: text/html; charset=ISO-8859-1
+Content-Encoding: zstd
+Content-Length: 47
+
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
+</datacheck>
+
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+zstd
+</features>
+<server>
+http
+</server>
+ <name>
+HTTP GET zstd compressed content of size more than CURL_MAX_WRITE_SIZE
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/397 --compressed
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<strippart>
+s/^Accept-Encoding: .*/Accept-Encoding: xxx/
+</strippart>
+<protocol>
+GET /397 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Accept-Encoding: xxx
+
+</protocol>
+</verify>
+</testcase>
diff --git a/tests/data/test558 b/tests/data/test558
index 94697967..d5aa0e08 100644
--- a/tests/data/test558
+++ b/tests/data/test558
@@ -49,6 +49,8 @@ s/\(.*\)/()/
s/:\d+/:/
s:^(MEM |FD )(.*/)(.*):$1$3:
s/\r\n/\n/
+s/^MEM getenv.c: realloc\(\)[\n]$//
+s/^MEM getenv.c: free\(\)[\n]$//
</stripfile>
</verify>
diff --git a/tests/data/test674 b/tests/data/test674
new file mode 100644
index 00000000..d1f1a865
--- /dev/null
+++ b/tests/data/test674
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+CURLOPT_CURLU
+curl_easy_duphandle
+</keywords>
+</info>
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+<client>
+<server>
+http
+</server>
+<tool>
+lib674
+</tool>
+<name>
+Set CURLOPT_CURLU and dupe the handle
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/674
+</command>
+</client>
+
+<verify>
+<strip>
+^User-Agent:.*
+</strip>
+<protocol>
+GET /674 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /674 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol>
+</verify>
+
+</testcase>
diff --git a/tests/data/test842 b/tests/data/test842
index 1d9181e1..2b5ae1c1 100644
--- a/tests/data/test842
+++ b/tests/data/test842
@@ -15,7 +15,7 @@ RFC7628
<servercmd>
AUTH OAUTHBEARER
REPLY AUTHENTICATE +
-REPLY bixhPXVzZXIsAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMwFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ== A002 OK AUTHENTICATE completed
+REPLY %b64[n,a=user,%01host=127.0.0.1%01port=%IMAPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% A002 OK AUTHENTICATE completed
</servercmd>
<data>
From: me@somewhere
@@ -42,9 +42,6 @@ IMAP OAuth 2.0 (OAUTHBEARER) authentication
</command>
# The protocol section doesn't support ways of specifying the raw data in the
# base64 encoded message so we must assert this
-<precheck>
-perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%IMAPPORT' ne '9003' );"
-</precheck>
</client>
#
@@ -53,7 +50,7 @@ perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP'
<protocol>
A001 CAPABILITY
A002 AUTHENTICATE OAUTHBEARER
-bixhPXVzZXIsAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMwFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
+%b64[n,a=user,%01host=127.0.0.1%01port=%IMAPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64%
A003 SELECT 842
A004 FETCH 1 BODY[]
A005 LOGOUT
diff --git a/tests/data/test843 b/tests/data/test843
index bd39dd90..13118893 100644
--- a/tests/data/test843
+++ b/tests/data/test843
@@ -41,11 +41,6 @@ IMAP OAuth 2.0 (OAUTHBEARER) authentication with initial response
<command>
'imap://%HOSTIP:%IMAPPORT/843/;MAILINDEX=1' -u user --oauth2-bearer mF_9.B5f-4.1JqM
</command>
-# The protocol section doesn't support ways of specifying the raw data in the
-# base64 encoded message so we must assert this
-<precheck>
-perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%IMAPPORT' ne '9003' );"
-</precheck>
</client>
#
@@ -53,7 +48,7 @@ perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP'
<verify>
<protocol>
A001 CAPABILITY
-A002 AUTHENTICATE OAUTHBEARER bixhPXVzZXIsAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMwFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
+A002 AUTHENTICATE OAUTHBEARER %b64[n,a=user,%01host=127.0.0.1%01port=%IMAPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64%
A003 SELECT 843
A004 FETCH 1 BODY[]
A005 LOGOUT
diff --git a/tests/data/test844 b/tests/data/test844
index c5093d2b..8573bc2f 100644
--- a/tests/data/test844
+++ b/tests/data/test844
@@ -15,9 +15,7 @@ RFC7628
<servercmd>
AUTH OAUTHBEARER
REPLY AUTHENTICATE +
-REPLY bixhPXVzZXIsAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMwFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ== +
-eyJzdGF0dXMiOiJpbnZhbGlkX3Rva2VuIiwic2NvcGUiOiJleGFtcGxlX3Njb3BlIiwib3BlbmlkLWNvbmZpZ3VyYXRpb24iOiJodHRwczovL2V4YW1wbGUuY29tLy53ZWxsLWtub3duL29wZW5pZC1jb25maWd1cmF0aW9uIn0=
-REPLY AQ== A002 NO Authentication failed
+REPLY %b64[n,a=user,%01host=127.0.0.1%01port=%IMAPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% A002 NO Authentication failed
</servercmd>
</reply>
@@ -33,11 +31,6 @@ IMAP OAuth 2.0 (OAUTHBEARER) failure as continuation
<command>
'imap://%HOSTIP:%IMAPPORT/844/;MAILINDEX=1' -u user --oauth2-bearer mF_9.B5f-4.1JqM
</command>
-# The protocol section doesn't support ways of specifying the raw data in the
-# base64 encoded message so we must assert this
-<precheck>
-perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%IMAPPORT' ne '9003' );"
-</precheck>
</client>
#
@@ -53,8 +46,7 @@ perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP'
<protocol>
A001 CAPABILITY
A002 AUTHENTICATE OAUTHBEARER
-bixhPXVzZXIsAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMwFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
-AQ==
+%b64[n,a=user,%01host=127.0.0.1%01port=%IMAPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64%
</protocol>
</verify>
</testcase>
diff --git a/tests/data/test845 b/tests/data/test845
index 70562c7a..449eef35 100644
--- a/tests/data/test845
+++ b/tests/data/test845
@@ -33,11 +33,6 @@ IMAP OAuth 2.0 (OAUTHBEARER) failure as continuation with initial response
<command>
'imap://%HOSTIP:%IMAPPORT/845/;MAILINDEX=1' -u user --oauth2-bearer mF_9.B5f-4.1JqM
</command>
-# The protocol section doesn't support ways of specifying the raw data in the
-# base64 encoded message so we must assert this
-<precheck>
-perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%IMAPPORT' ne '9003' );"
-</precheck>
</client>
#
@@ -52,8 +47,8 @@ perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP'
# transfer and such a connection will not get a "LOGOUT"
<protocol>
A001 CAPABILITY
-A002 AUTHENTICATE OAUTHBEARER bixhPXVzZXIsAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMwFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
-AQ==
+A002 AUTHENTICATE OAUTHBEARER %b64[n,a=user,%01host=127.0.0.1%01port=%IMAPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64%
+%b64[%01]b64%
</protocol>
</verify>
</testcase>
diff --git a/tests/data/test887 b/tests/data/test887
index 35419b50..ccf36495 100644
--- a/tests/data/test887
+++ b/tests/data/test887
@@ -17,7 +17,7 @@ RFC7628
<servercmd>
AUTH OAUTHBEARER
REPLY AUTH +
-REPLY bixhPXVzZXIsAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ== +OK Login successful
+REPLY %b64[n,a=user,%01host=127.0.0.1%01port=%POP3PORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% +OK Login successful
</servercmd>
<data>
From: me@somewhere
@@ -42,11 +42,6 @@ POP3 OAuth 2.0 (OAUTHBEARER) authentication
<command>
pop3://%HOSTIP:%POP3PORT/887 -u user --oauth2-bearer mF_9.B5f-4.1JqM
</command>
-# The protocol section doesn't support ways of specifying the raw data in the
-# base64 encoded message so we must assert this
-<precheck>
-perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%POP3PORT' ne '9001' );"
-</precheck>
</client>
#
@@ -55,7 +50,7 @@ perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP'
<protocol>
CAPA
AUTH OAUTHBEARER
-bixhPXVzZXIsAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
+%b64[n,a=user,%01host=127.0.0.1%01port=%POP3PORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64%
RETR 887
QUIT
</protocol>
diff --git a/tests/data/test888 b/tests/data/test888
index 78463fea..465a2d0c 100644
--- a/tests/data/test888
+++ b/tests/data/test888
@@ -42,11 +42,6 @@ POP3 OAuth 2.0 (OAUTHBEARER) authentication with initial response
<command>
pop3://%HOSTIP:%POP3PORT/888 -u user --oauth2-bearer mF_9.B5f-4.1JqM --sasl-ir
</command>
-# The protocol section doesn't support ways of specifying the raw data in the
-# base64 encoded message so we must assert this
-<precheck>
-perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%POP3PORT' ne '9001' );"
-</precheck>
</client>
#
@@ -54,7 +49,7 @@ perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP'
<verify>
<protocol>
CAPA
-AUTH OAUTHBEARER bixhPXVzZXIsAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
+AUTH OAUTHBEARER %b64[n,a=user,%01host=127.0.0.1%01port=%POP3PORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64%
RETR 888
QUIT
</protocol>
diff --git a/tests/data/test889 b/tests/data/test889
index 2edb371e..9658d386 100644
--- a/tests/data/test889
+++ b/tests/data/test889
@@ -17,7 +17,7 @@ RFC7628
<servercmd>
AUTH OAUTHBEARER
REPLY AUTH +
-REPLY bixhPXVzZXIsAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ== + eyJzdGF0dXMiOiJpbnZhbGlkX3Rva2VuIiwic2NvcGUiOiJleGFtcGxlX3Njb3BlIiwib3BlbmlkLWNvbmZpZ3VyYXRpb24iOiJodHRwczovL2V4YW1wbGUuY29tLy53ZWxsLWtub3duL29wZW5pZC1jb25maWd1cmF0aW9uIn0
+REPLY %b64[n,a=user,%01host=127.0.0.1%01port=%POP3PORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% + eyJzdGF0dXMiOiJpbnZhbGlkX3Rva2VuIiwic2NvcGUiOiJleGFtcGxlX3Njb3BlIiwib3BlbmlkLWNvbmZpZ3VyYXRpb24iOiJodHRwczovL2V4YW1wbGUuY29tLy53ZWxsLWtub3duL29wZW5pZC1jb25maWd1cmF0aW9uIn0
REPLY AQ== -ERR Authentication failed
</servercmd>
</reply>
@@ -34,11 +34,6 @@ POP3 OAuth 2.0 (OAUTHBEARER) failure as continuation
<command>
pop3://%HOSTIP:%POP3PORT/889 -u user --oauth2-bearer mF_9.B5f-4.1JqM
</command>
-# The protocol section doesn't support ways of specifying the raw data in the
-# base64 encoded message so we must assert this
-<precheck>
-perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%POP3PORT' ne '9001' );"
-</precheck>
</client>
#
@@ -54,7 +49,7 @@ perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP'
<protocol>
CAPA
AUTH OAUTHBEARER
-bixhPXVzZXIsAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
+%b64[n,a=user,%01host=127.0.0.1%01port=%POP3PORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64%
AQ==
</protocol>
</verify>
diff --git a/tests/data/test890 b/tests/data/test890
index ca0ccc7b..4d6701ab 100644
--- a/tests/data/test890
+++ b/tests/data/test890
@@ -34,11 +34,6 @@ POP3 OAuth 2.0 (OAUTHBEARER) failure as continuation with initial response
<command>
pop3://%HOSTIP:%POP3PORT/890 -u user --oauth2-bearer mF_9.B5f-4.1JqM --sasl-ir
</command>
-# The protocol section doesn't support ways of specifying the raw data in the
-# base64 encoded message so we must assert this
-<precheck>
-perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%POP3PORT' ne '9001' );"
-</precheck>
</client>
#
@@ -53,7 +48,7 @@ perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP'
# transfer and such a connection will not get a "QUIT"
<protocol>
CAPA
-AUTH OAUTHBEARER bixhPXVzZXIsAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwMQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
+AUTH OAUTHBEARER %b64[n,a=user,%01host=127.0.0.1%01port=%POP3PORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64%
AQ==
</protocol>
</verify>
diff --git a/tests/data/test914 b/tests/data/test914
index d1532c80..0124b767 100644
--- a/tests/data/test914
+++ b/tests/data/test914
@@ -8,6 +8,9 @@ SMTP
#
# Server-side
<reply>
+<servercmd>
+REPLY MAIL 501 not fine enough
+</servercmd>
</reply>
#
diff --git a/tests/data/test946 b/tests/data/test946
index c6753dc1..aa88364f 100644
--- a/tests/data/test946
+++ b/tests/data/test946
@@ -16,7 +16,7 @@ RFC7628
<servercmd>
AUTH OAUTHBEARER
REPLY AUTH 334 OAUTHBEARER supported
-REPLY bixhPXVzZXIsAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwNQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ== 235 Authenticated
+REPLY %b64[n,a=user,%01host=127.0.0.1%01port=%SMTPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% 235 Authenticated
</servercmd>
</reply>
@@ -35,11 +35,6 @@ mail body
<command>
smtp://%HOSTIP:%SMTPPORT/946 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user --oauth2-bearer mF_9.B5f-4.1JqM -T -
</command>
-# The protocol section doesn't support ways of specifying the raw data in the
-# base64 encoded message so we must assert this
-<precheck>
-perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%SMTPPORT' ne '9005' );"
-</precheck>
</client>
#
@@ -48,7 +43,7 @@ perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP'
<protocol>
EHLO 946
AUTH OAUTHBEARER
-bixhPXVzZXIsAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwNQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
+%b64[n,a=user,%01host=127.0.0.1%01port=%SMTPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64%
MAIL FROM:<sender@example.com>
RCPT TO:<recipient@example.com>
DATA
diff --git a/tests/data/test947 b/tests/data/test947
index 03c3fbe3..d2622be8 100644
--- a/tests/data/test947
+++ b/tests/data/test947
@@ -35,11 +35,6 @@ mail body
<command>
smtp://%HOSTIP:%SMTPPORT/947 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user --oauth2-bearer mF_9.B5f-4.1JqM --sasl-ir -T -
</command>
-# The protocol section doesn't support ways of specifying the raw data in the
-# base64 encoded message so we must assert this
-<precheck>
-perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%SMTPPORT' ne '9005' );"
-</precheck>
</client>
#
@@ -47,7 +42,7 @@ perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP'
<verify>
<protocol>
EHLO 947
-AUTH OAUTHBEARER bixhPXVzZXIsAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwNQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
+AUTH OAUTHBEARER %b64[n,a=user,%01host=127.0.0.1%01port=%SMTPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64%
MAIL FROM:<sender@example.com>
RCPT TO:<recipient@example.com>
DATA
diff --git a/tests/data/test948 b/tests/data/test948
index 8385f0cd..a6eadf5f 100644
--- a/tests/data/test948
+++ b/tests/data/test948
@@ -16,7 +16,7 @@ RFC7628
<servercmd>
AUTH OAUTHBEARER
REPLY AUTH 334 OAUTHBEARER supported
-REPLY bixhPXVzZXIsAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwNQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ== 334 eyJzdGF0dXMiOiJpbnZhbGlkX3Rva2VuIiwic2NvcGUiOiJleGFtcGxlX3Njb3BlIiwib3BlbmlkLWNvbmZpZ3VyYXRpb24iOiJodHRwczovL2V4YW1wbGUuY29tLy53ZWxsLWtub3duL29wZW5pZC1jb25maWd1cmF0aW9uIn0
+REPLY %b64[n,a=user,%01host=127.0.0.1%01port=%SMTPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64% 334 eyJzdGF0dXMiOiJpbnZhbGlkX3Rva2VuIiwic2NvcGUiOiJleGFtcGxlX3Njb3BlIiwib3BlbmlkLWNvbmZpZ3VyYXRpb24iOiJodHRwczovL2V4YW1wbGUuY29tLy53ZWxsLWtub3duL29wZW5pZC1jb25maWd1cmF0aW9uIn0
REPLY AQ== 535 Username and Password not accepted. Learn more at\r\n535 http://support.example.com/mail/oauth
</servercmd>
</reply>
@@ -36,11 +36,6 @@ mail body
<command>
smtp://%HOSTIP:%SMTPPORT/948 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user --oauth2-bearer mF_9.B5f-4.1JqM -T -
</command>
-# The protocol section doesn't support ways of specifying the raw data in the
-# base64 encoded message so we must assert this
-<precheck>
-perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%SMTPPORT' ne '9005' );"
-</precheck>
</client>
#
@@ -56,7 +51,7 @@ perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP'
<protocol>
EHLO 948
AUTH OAUTHBEARER
-bixhPXVzZXIsAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwNQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
+%b64[n,a=user,%01host=127.0.0.1%01port=%SMTPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64%
AQ==
</protocol>
</verify>
diff --git a/tests/data/test949 b/tests/data/test949
index 34594007..82064f19 100644
--- a/tests/data/test949
+++ b/tests/data/test949
@@ -36,11 +36,6 @@ mail body
<command>
smtp://%HOSTIP:%SMTPPORT/949 --mail-rcpt recipient@example.com --mail-from sender@example.com -u user --oauth2-bearer mF_9.B5f-4.1JqM --sasl-ir -T -
</command>
-# The protocol section doesn't support ways of specifying the raw data in the
-# base64 encoded message so we must assert this
-<precheck>
-perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%SMTPPORT' ne '9005' );"
-</precheck>
</client>
#
@@ -55,7 +50,7 @@ perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP'
# transfer and such a connection will not get a "QUIT"
<protocol>
EHLO 949
-AUTH OAUTHBEARER bixhPXVzZXIsAWhvc3Q9MTI3LjAuMC4xAXBvcnQ9OTAwNQFhdXRoPUJlYXJlciBtRl85LkI1Zi00LjFKcU0BAQ==
+AUTH OAUTHBEARER %b64[n,a=user,%01host=127.0.0.1%01port=%SMTPPORT%01auth=Bearer mF_9.B5f-4.1JqM%01%01]b64%
AQ==
</protocol>
</verify>
diff --git a/tests/data/test955 b/tests/data/test955
index 57d618c7..97ef2956 100644
--- a/tests/data/test955
+++ b/tests/data/test955
@@ -8,6 +8,9 @@ SMTP
#
# Server-side
<reply>
+<servercmd>
+REPLY MAIL 501 not fine enough
+</servercmd>
</reply>
#
diff --git a/tests/data/test959 b/tests/data/test959
index a61c3d14..1b2d6584 100644
--- a/tests/data/test959
+++ b/tests/data/test959
@@ -8,6 +8,9 @@ SMTP
#
# Server-side
<reply>
+<servercmd>
+REPLY MAIL 501 not fine enough
+</servercmd>
</reply>
#
diff --git a/tests/data/test970 b/tests/data/test970
index e6d138f4..c0a88a79 100644
--- a/tests/data/test970
+++ b/tests/data/test970
@@ -61,7 +61,7 @@ Accept: */*
</protocol>
<stdout nonewline="yes">
-{"url_effective":"http://%HOSTIP:%HTTPPORT/970","http_code":200,"response_code":200,"http_connect":0,"time_total":0.000013,"time_namelookup":0.000013,"time_connect":0.000013,"time_appconnect":0.000013,"time_pretransfer":0.000013,"time_starttransfer":0.000013,"size_header":4019,"size_request":4019,"size_download":445,"size_upload":0,"speed_download":13,"speed_upload":13,"content_type":"text/html","num_connects":1,"time_redirect":0.000013,"num_redirects":0,"ssl_verify_result":0,"proxy_ssl_verify_result":0,"filename_effective":"log/out970","remote_ip":"%HOSTIP","remote_port":%HTTPPORT,"local_ip":"127.0.0.1","local_port":13,"http_version":"1.1","scheme":"HTTP","curl_version":"curl-unit-test-fake-version"}
+{"url_effective":"http://%HOSTIP:%HTTPPORT/970","method":"GET","http_code":200,"response_code":200,"http_connect":0,"time_total":0.000013,"time_namelookup":0.000013,"time_connect":0.000013,"time_appconnect":0.000013,"time_pretransfer":0.000013,"time_starttransfer":0.000013,"size_header":4019,"size_request":4019,"size_download":445,"size_upload":0,"speed_download":13,"speed_upload":13,"content_type":"text/html","num_connects":1,"time_redirect":0.000013,"num_redirects":0,"ssl_verify_result":0,"proxy_ssl_verify_result":0,"filename_effective":"log/out970","remote_ip":"%HOSTIP","remote_port":%HTTPPORT,"local_ip":"127.0.0.1","local_port":13,"http_version":"1.1","scheme":"HTTP","curl_version":"curl-unit-test-fake-version"}
</stdout>
</verify>
</testcase>
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
index 92420ea4..d587f453 100755
--- a/tests/ftpserver.pl
+++ b/tests/ftpserver.pl
@@ -83,6 +83,7 @@ my $proto = 'ftp'; # default server protocol
my $srcdir; # directory where ftpserver.pl is located
my $srvrname; # server name for presentation purposes
my $cwd_testno; # test case numbers extracted from CWD command
+my $testno = 0; # test case number (read from ftpserver.cmd)
my $path = '.';
my $logdir = $path .'/log';
@@ -449,17 +450,14 @@ sub startsf {
# Returns the given test's reply data
#
sub getreplydata {
- my ($testno) = @_;
+ my ($num) = @_;
my $testpart = "";
- $testno =~ s/^([^0-9]*)//;
- if($testno > 10000) {
- $testpart = $testno % 10000;
- $testno = int($testno / 10000);
+ $num =~ s/^([^0-9]*)//;
+ if($num > 10000) {
+ $testpart = $num % 10000;
}
- loadtest("$srcdir/data/test$testno");
-
my @data = getpart("reply", "data$testpart");
if((!@data) && ($testpart ne "")) {
@data = getpart("reply", "data");
@@ -835,13 +833,8 @@ sub MAIL_smtp {
}
}
- # Validate the from address (only <> and a valid email address inside
- # <> are allowed, such as <user@example.com>)
- if (($from eq "<>") ||
- (!$smtputf8 && $from =~
- /^<([a-zA-Z0-9._%+-]+)\@(([a-zA-Z0-9-]+)\.)+([a-zA-Z]{2,4})>$/) ||
- ($smtputf8 && $from =~
- /^<([a-zA-Z0-9\x{80}-\x{ff}._%+-]+)\@(([a-zA-Z0-9\x{80}-\x{ff}-]+)\.)+([a-zA-Z]{2,4})>$/)) {
+ # this server doesn't "validate" MAIL FROM addresses
+ if (length($from)) {
my @found;
my $valid = 1;
@@ -2098,7 +2091,8 @@ my @ftpdir=("total 20\r\n",
logmsg "pass LIST data on data connection\n";
if($cwd_testno) {
- loadtest("$srcdir/data/test$cwd_testno");
+ loadtest("$logdir/test$cwd_testno") ||
+ loadtest("$srcdir/data/test$cwd_testno");
my @data = getpart("reply", "data");
for(@data) {
@@ -2161,7 +2155,8 @@ sub MDTM_ftp {
$testno = int($testno / 10000);
}
- loadtest("$srcdir/data/test$testno");
+ loadtest("$logdir/test$testno") ||
+ loadtest("$srcdir/data/test$testno");
my @data = getpart("reply", "mdtm");
@@ -2214,7 +2209,8 @@ sub SIZE_ftp {
$testno = int($testno / 10000);
}
- loadtest("$srcdir/data/test$testno");
+ loadtest("$logdir/test$testno") ||
+ loadtest("$srcdir/data/test$testno");
my @data = getpart("reply", "size");
@@ -2303,7 +2299,8 @@ sub RETR_ftp {
$testno = int($testno / 10000);
}
- loadtest("$srcdir/data/test$testno");
+ loadtest("$logdir/test$testno") ||
+ loadtest("$srcdir/data/test$testno");
my @data = getpart("reply", "data$testpart");
@@ -2886,6 +2883,10 @@ sub customize {
$nosave = 1;
logmsg "FTPD: NOSAVE prevents saving of uploaded data\n";
}
+ elsif($_ =~ /^Testnum (\d+)/){
+ $testno = $1;
+ logmsg "FTPD: run test case number: $testno\n";
+ }
}
close(CUSTOM);
}
@@ -3074,6 +3075,8 @@ while(1) {
$| = 1;
&customize(); # read test control instructions
+ loadtest("$logdir/test$testno") ||
+ loadtest("$srcdir/data/test$testno");
my $welcome = $commandreply{"welcome"};
if(!$welcome) {
diff --git a/tests/libtest/Makefile.am b/tests/libtest/Makefile.am
index e87a3630..7f68abae 100644
--- a/tests/libtest/Makefile.am
+++ b/tests/libtest/Makefile.am
@@ -91,8 +91,11 @@ libhostname_la_CPPFLAGS_EXTRA =
libhostname_la_LDFLAGS_EXTRA = -module -avoid-version -rpath /nowhere
libhostname_la_CFLAGS_EXTRA =
+libstubgss_la_LDFLAGS_EXTRA =
+
if CURL_LT_SHLIB_USE_NO_UNDEFINED
libhostname_la_LDFLAGS_EXTRA += -no-undefined
+libstubgss_la_LDFLAGS_EXTRA += -no-undefined
endif
if CURL_LT_SHLIB_USE_MIMPURE_TEXT
@@ -118,7 +121,7 @@ if BUILD_STUB_GSS
noinst_LTLIBRARIES += libstubgss.la
libstubgss_la_CPPFLAGS = $(AM_CPPFLAGS)
-libstubgss_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version -rpath /nowhere
+libstubgss_la_LDFLAGS = $(AM_LDFLAGS) $(libstubgss_la_LDFLAGS_EXTRA) -avoid-version -rpath /nowhere
libstubgss_la_CFLAGS = $(AM_CFLAGS) -g
libstubgss_la_SOURCES = stub_gssapi.c stub_gssapi.h
@@ -137,7 +140,7 @@ CS_1 =
CS_ = $(CS_0)
checksrc:
- $(CHECKSRC)@PERL@ $(top_srcdir)/lib/checksrc.pl $(srcdir)/*.[ch]
+ $(CHECKSRC)@PERL@ $(top_srcdir)/lib/checksrc.pl -D$(srcdir) $(srcdir)/*.[ch]
if CURLDEBUG
# for debug builds, we scan the sources on all regular make invokes
diff --git a/tests/libtest/Makefile.inc b/tests/libtest/Makefile.inc
index f29bf6ae..2c9c6653 100644
--- a/tests/libtest/Makefile.inc
+++ b/tests/libtest/Makefile.inc
@@ -47,7 +47,7 @@ noinst_PROGRAMS = chkhostname libauthretry libntlmconnect \
lib583 lib585 lib586 lib587 lib589 lib590 lib591 lib597 lib598 lib599 \
lib643 lib644 lib645 lib650 lib651 lib652 lib653 lib654 lib655 lib658 \
lib659 lib661 lib666 lib667 lib668 \
- lib670 lib671 lib672 lib673 \
+ lib670 lib671 lib672 lib673 lib674 \
lib1156 \
lib1500 lib1501 lib1502 lib1503 lib1504 lib1505 lib1506 lib1507 lib1508 \
lib1509 lib1510 lib1511 lib1512 lib1513 lib1514 lib1515 lib1517 \
@@ -56,10 +56,10 @@ noinst_PROGRAMS = chkhostname libauthretry libntlmconnect \
lib1534 lib1535 lib1536 lib1537 lib1538 lib1539 \
lib1540 lib1541 \
lib1550 lib1551 lib1552 lib1553 lib1554 lib1555 lib1556 lib1557 \
- lib1558 lib1559 lib1560 lib1564 lib1565 \
+ lib1558 lib1559 lib1560 lib1564 lib1565 lib1567 \
lib1591 lib1592 lib1593 lib1594 lib1596 \
lib1900 lib1905 lib1906 lib1907 lib1908 lib1910 \
- lib2033
+ lib2033 lib3010
chkdecimalpoint_SOURCES = chkdecimalpoint.c ../../lib/mprintf.c \
../../lib/curl_ctype.c ../../lib/dynbuf.c ../../lib/strdup.c
@@ -400,6 +400,10 @@ lib673_SOURCES = lib670.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib673_LDADD = $(TESTUTIL_LIBS)
lib673_CPPFLAGS = $(AM_CPPFLAGS) -DLIB673
+lib674_SOURCES = lib674.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
+lib674_LDADD = $(TESTUTIL_LIBS)
+lib674_CPPFLAGS = $(AM_CPPFLAGS)
+
lib1500_SOURCES = lib1500.c $(SUPPORTFILES) $(TESTUTIL)
lib1500_LDADD = $(TESTUTIL_LIBS)
lib1500_CPPFLAGS = $(AM_CPPFLAGS)
@@ -600,6 +604,9 @@ lib1565_SOURCES = lib1565.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1565_LDADD = $(TESTUTIL_LIBS)
lib1565_CPPFLAGS = $(AM_CPPFLAGS)
+lib1567_SOURCES = lib1567.c $(SUPPORTFILES)
+lib1567_CPPFLAGS = $(AM_CPPFLAGS)
+
lib1591_SOURCES = lib1591.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1591_LDADD = $(TESTUTIL_LIBS)
lib1591_CPPFLAGS = $(AM_CPPFLAGS) -DLIB1591
@@ -645,3 +652,7 @@ lib1910_CPPFLAGS = $(AM_CPPFLAGS)
lib2033_SOURCES = libntlmconnect.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib2033_LDADD = $(TESTUTIL_LIBS)
lib2033_CPPFLAGS = $(AM_CPPFLAGS) -DUSE_PIPELINING
+
+lib3010_SOURCES = lib3010.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
+lib3010_LDADD = $(TESTUTIL_LIBS)
+lib3010_CPPFLAGS = $(AM_CPPFLAGS)
diff --git a/tests/libtest/lib1567.c b/tests/libtest/lib1567.c
new file mode 100644
index 00000000..48e6ea96
--- /dev/null
+++ b/tests/libtest/lib1567.c
@@ -0,0 +1,52 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at https://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include "test.h"
+
+#include "memdebug.h"
+
+#include <curl/multi.h>
+
+int test(char *URL)
+{
+ CURL *curl;
+ CURLcode res = CURLE_OK;
+
+ global_init(CURL_GLOBAL_ALL);
+ curl = curl_easy_init();
+ if(curl) {
+ CURLU *u = curl_url();
+ if(u) {
+ curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+ curl_url_set(u, CURLUPART_URL, URL, 0);
+ curl_easy_setopt(curl, CURLOPT_CURLU, u);
+ res = curl_easy_perform(curl);
+
+ fprintf(stderr, "****************************** Do it again\n");
+ res = curl_easy_perform(curl);
+ curl_url_cleanup(u);
+ }
+ curl_easy_cleanup(curl);
+ }
+ curl_global_cleanup();
+ return (int)res;
+}
diff --git a/tests/libtest/lib3010.c b/tests/libtest/lib3010.c
new file mode 100644
index 00000000..9c24b2f5
--- /dev/null
+++ b/tests/libtest/lib3010.c
@@ -0,0 +1,66 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 2020 - 2020, Nicolas Sterchele, <nicolas@sterchelen.net>
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at https://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include "test.h"
+
+#include "memdebug.h"
+
+int test(char *URL)
+{
+ CURLcode ret = CURLE_OK;
+ CURL *curl = NULL;
+ curl_off_t retry_after;
+ char *follow_url = NULL;
+
+ curl_global_init(CURL_GLOBAL_ALL);
+ curl = curl_easy_init();
+
+ if(curl) {
+ curl_easy_setopt(curl, CURLOPT_URL, URL);
+ ret = curl_easy_perform(curl);
+ if(ret) {
+ fprintf(stderr, "%s:%d curl_easy_perform() failed with code %d (%s)\n",
+ __FILE__, __LINE__, ret, curl_easy_strerror(ret));
+ goto test_cleanup;
+ }
+ curl_easy_getinfo(curl, CURLINFO_REDIRECT_URL, &follow_url);
+ curl_easy_getinfo(curl, CURLINFO_RETRY_AFTER, &retry_after);
+ printf("Retry-After: %" CURL_FORMAT_CURL_OFF_T "\n", retry_after);
+ curl_easy_setopt(curl, CURLOPT_URL, follow_url);
+ ret = curl_easy_perform(curl);
+ if(ret) {
+ fprintf(stderr, "%s:%d curl_easy_perform() failed with code %d (%s)\n",
+ __FILE__, __LINE__, ret, curl_easy_strerror(ret));
+ goto test_cleanup;
+ }
+
+ curl_easy_reset(curl);
+ curl_easy_getinfo(curl, CURLINFO_RETRY_AFTER, &retry_after);
+ printf("Retry-After: %" CURL_FORMAT_CURL_OFF_T "\n", retry_after);
+ }
+
+test_cleanup:
+ curl_easy_cleanup(curl);
+ curl_global_cleanup();
+
+ return ret;
+}
+
diff --git a/tests/libtest/lib557.c b/tests/libtest/lib557.c
index 2e51b99c..b34a0c2f 100644
--- a/tests/libtest/lib557.c
+++ b/tests/libtest/lib557.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -1537,6 +1537,17 @@ static int test_weird_arguments(void)
errors += string_check(buf, "");
+ /* Do not skip sanity checks with parameters! */
+ buf[0] = 0;
+ rc = curl_msnprintf(buf, sizeof(buf), "%d, %.*1$d", 500, 1);
+
+ if(rc != 256) {
+ printf("curl_mprintf() returned %d and not 256!\n", rc);
+ errors++;
+ }
+
+ errors += strlen_check(buf, 255);
+
if(errors)
printf("Some curl_mprintf() weird arguments tests failed!\n");
diff --git a/tests/libtest/lib674.c b/tests/libtest/lib674.c
new file mode 100644
index 00000000..828e52cd
--- /dev/null
+++ b/tests/libtest/lib674.c
@@ -0,0 +1,81 @@
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at https://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+#include "test.h"
+
+#include "testutil.h"
+#include "warnless.h"
+#include "memdebug.h"
+
+/*
+ * Get a single URL without select().
+ */
+
+int test(char *URL)
+{
+ CURL *handle = NULL;
+ CURL *handle2;
+ CURLcode res = 0;
+ CURLU *urlp = NULL;
+ CURLUcode uc = 0;
+
+ global_init(CURL_GLOBAL_ALL);
+ easy_init(handle);
+
+ urlp = curl_url();
+
+ if(!urlp) {
+ fprintf(stderr, "problem init URL api.");
+ goto test_cleanup;
+ }
+
+ uc = curl_url_set(urlp, CURLUPART_URL, URL, 0);
+ if(uc) {
+ fprintf(stderr, "problem setting CURLUPART_URL.");
+ goto test_cleanup;
+ }
+
+ /* demonstrate override behavior */
+
+
+ easy_setopt(handle, CURLOPT_CURLU, urlp);
+ easy_setopt(handle, CURLOPT_VERBOSE, 1L);
+
+ res = curl_easy_perform(handle);
+
+ if(res) {
+ fprintf(stderr, "%s:%d curl_easy_perform() failed with code %d (%s)\n",
+ __FILE__, __LINE__, res, curl_easy_strerror(res));
+ goto test_cleanup;
+ }
+
+ handle2 = curl_easy_duphandle(handle);
+ res = curl_easy_perform(handle2);
+ curl_easy_cleanup(handle2);
+
+test_cleanup:
+
+ curl_url_cleanup(urlp);
+ curl_easy_cleanup(handle);
+ curl_global_cleanup();
+
+ return res;
+}
diff --git a/tests/libtest/testutil.c b/tests/libtest/testutil.c
index 94a0b46b..d40603d9 100644
--- a/tests/libtest/testutil.c
+++ b/tests/libtest/testutil.c
@@ -55,7 +55,7 @@ struct timeval tutil_tvnow(void)
struct timespec tsnow;
if(0 == clock_gettime(CLOCK_MONOTONIC, &tsnow)) {
now.tv_sec = tsnow.tv_sec;
- now.tv_usec = tsnow.tv_nsec / 1000;
+ now.tv_usec = (int)(tsnow.tv_nsec / 1000);
}
/*
** Even when the configure process has truly detected monotonic clock
diff --git a/tests/manpage-scan.pl b/tests/manpage-scan.pl
index 10d2d15a..41dfdec9 100755
--- a/tests/manpage-scan.pl
+++ b/tests/manpage-scan.pl
@@ -288,4 +288,4 @@ foreach my $o (keys %opts) {
}
}
-exit $errors;
+print STDERR "$errors\n";
diff --git a/tests/nroff-scan.pl b/tests/nroff-scan.pl
index 3df778a7..15a59c9b 100755
--- a/tests/nroff-scan.pl
+++ b/tests/nroff-scan.pl
@@ -63,23 +63,23 @@ sub file {
while($l =~ s/\\f(.)([^ ]*)\\f(.)//) {
my ($pre, $str, $post)=($1, $2, $3);
if($post ne "P") {
- print STDERR "error: $f:$line: missing \\fP after $str\n";
+ print "error: $f:$line: missing \\fP after $str\n";
$errors++;
}
if($str =~ /((libcurl|curl)([^ ]*))\(3\)/i) {
my $man = "$1.3";
if(!manpresent($man)) {
- print STDERR "error: $f:$line: referring to non-existing man page $man\n";
+ print "error: $f:$line: referring to non-existing man page $man\n";
$errors++;
}
if($pre ne "I") {
- print STDERR "error: $f:$line: use \\fI before $str\n";
+ print "error: $f:$line: use \\fI before $str\n";
$errors++;
}
}
}
if($l =~ /(curl([^ ]*)\(3\))/i) {
- print STDERR "error: $f:$line: non-referencing $1\n";
+ print "error: $f:$line: non-referencing $1\n";
$errors++;
}
if($l =~ /^\.BR (.*)/) {
@@ -87,7 +87,7 @@ sub file {
while($i =~ s/((lib|)curl([^ ]*)) *\"\(3\)(,|) *\" *//i ) {
my $man = "$1.3";
if(!manpresent($man)) {
- print STDERR "error: $f:$line: referring to non-existing man page $man\n";
+ print "error: $f:$line: referring to non-existing man page $man\n";
$errors++;
}
}
@@ -101,4 +101,6 @@ foreach my $f (@f) {
file($f);
}
+print "OK\n" if(!$errors);
+
exit $errors?1:0;
diff --git a/tests/runtests.1 b/tests/runtests.1
index 5dc9eb3b..27ce2734 100644
--- a/tests/runtests.1
+++ b/tests/runtests.1
@@ -20,7 +20,7 @@
.\" *
.\" **************************************************************************
.\"
-.TH runtests.pl 1 "May 25, 2020" "Curl 7.71.1" "runtests"
+.TH runtests.pl 1 "August 05, 2020" "Curl 7.72.0" "runtests"
.SH NAME
runtests.pl \- run one or more test cases
@@ -56,8 +56,6 @@ Prefix a keyword with a tilde (~) to still run it, but ignore the results.
.IP "-a"
Continue running the rest of the test cases even if one test fails. By
default, the test script stops as soon as an error is detected.
-.IP "-bN"
-Use N as the base TCP/UDP port number on which to start the test servers.
.IP "-c <curl>"
Provide a path to a custom curl binary to run the tests with. Default is the
curl executable in the build tree.
diff --git a/tests/runtests.pl b/tests/runtests.pl
index 0743d491..a409bcc7 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -76,6 +76,7 @@ use strict;
use warnings;
use Cwd;
use Digest::MD5 qw(md5);
+use MIME::Base64;
# Subs imported from serverhelp module
use serverhelp qw(
@@ -126,10 +127,6 @@ my $HOST6IP="[::1]"; # address on which the test server listens
my $CLIENTIP="127.0.0.1"; # address which curl uses for incoming connections
my $CLIENT6IP="[::1]"; # address which curl uses for incoming connections
-my $base = 8990; # base port number
-my $minport; # minimum used port number
-my $maxport; # maximum used port number
-
my $noport="[not running]";
my $NOLISTENPORT=47; # port number we use for a local non-listening service
@@ -162,7 +159,7 @@ my $HTTP2PORT=$noport; # HTTP/2 server port
my $DICTPORT=$noport; # DICT server port
my $SMBPORT=$noport; # SMB server port
my $SMBSPORT=$noport; # SMBS server port
-my $NEGTELNETPORT=$noport; # TELNET server port with negotiation
+my $TELNETPORT=$noport; # TELNET server port with negotiation
my $HTTPUNIXPATH; # HTTP server Unix domain socket path
my $SSHSRVMD5 = "[uninitialized]"; # MD5 of ssh server public key
@@ -240,6 +237,7 @@ my $has_ipv6; # set if libcurl is built with IPv6 support
my $has_unix; # set if libcurl is built with Unix sockets support
my $has_libz; # set if libcurl is built with libz support
my $has_brotli; # set if libcurl is built with brotli support
+my $has_zstd; # set if libcurl is built with zstd support
my $has_getrlimit; # set if system has getrlimit()
my $has_ntlm; # set if libcurl is built with NTLM support
my $has_ntlm_wb; # set if libcurl is built with NTLM delegation to winbind
@@ -270,8 +268,8 @@ my $has_openssl; # built with a lib using an OpenSSL-like API
my $has_gnutls; # built with GnuTLS
my $has_nss; # built with NSS
my $has_wolfssl; # built with wolfSSL
-my $has_winssl; # built with WinSSL (Secure Channel aka Schannel)
-my $has_darwinssl; # built with DarwinSSL (Secure Transport)
+my $has_schannel; # built with Schannel
+my $has_sectransp; # built with Secure Transport
my $has_boringssl; # built with BoringSSL
my $has_libressl; # built with libressl
my $has_mbedtls; # built with mbedTLS
@@ -1432,7 +1430,7 @@ sub responsiveserver {
# start the http2 server
#
sub runhttp2server {
- my ($verbose, $port) = @_;
+ my ($verbose) = @_;
my $server;
my $srvrname;
my $pidfile;
@@ -1464,26 +1462,34 @@ sub runhttp2server {
$logfile = server_logfilename($LOGDIR, $proto, $ipvnum, $idnum);
$flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
- $flags .= "--port $HTTP2PORT ";
$flags .= "--connect $HOSTIP:$HTTPPORT ";
$flags .= $verbose_flag if($debugprotocol);
- my $cmd = "$exe $flags";
- my ($http2pid, $pid2) = startnew($cmd, $pidfile, 15, 0);
+ my ($http2pid, $pid2);
+ my $port = 23113;
+ for(1 .. 10) {
+ $port += int(rand(900));
+ my $aflags = "--port $port $flags";
- if($http2pid <= 0 || !pidexists($http2pid)) {
- # it is NOT alive
- logmsg "RUN: failed to start the $srvrname server\n";
- stopserver($server, "$pid2");
- $doesntrun{$pidfile} = 1;
- return (0,0);
- }
+ my $cmd = "$exe $aflags";
+ ($http2pid, $pid2) = startnew($cmd, $pidfile, 15, 0);
- if($verbose) {
- logmsg "RUN: $srvrname server is now running PID $http2pid\n";
+ if($http2pid <= 0 || !pidexists($http2pid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ stopserver($server, "$pid2");
+ $doesntrun{$pidfile} = 1;
+ next;
+ }
+ $doesntrun{$pidfile} = 0;
+
+ if($verbose) {
+ logmsg "RUN: $srvrname server PID $http2pid port $port\n";
+ }
+ last;
}
- return ($http2pid, $pid2);
+ return ($http2pid, $pid2, $port);
}
#######################################################################
@@ -1695,7 +1701,6 @@ sub runhttpsserver {
sub runhttptlsserver {
my ($verbose, $ipv6) = @_;
my $proto = "httptls";
- my $port = ($ipv6 && ($ipv6 =~ /6$/)) ? $HTTPTLS6PORT : $HTTPTLSPORT;
my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP";
my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4;
my $idnum = 1;
@@ -1730,40 +1735,36 @@ sub runhttptlsserver {
$flags .= "--http ";
$flags .= "--debug 1 " if($debugprotocol);
- $flags .= "--port $port ";
$flags .= "--priority NORMAL:+SRP ";
$flags .= "--srppasswd $srcdir/certs/srp-verifier-db ";
$flags .= "--srppasswdconf $srcdir/certs/srp-verifier-conf";
- my $cmd = "$httptlssrv $flags > $logfile 2>&1";
- my ($httptlspid, $pid2) = startnew($cmd, $pidfile, 10, 1); # fake pidfile
+ my $port = 24367;
+ my ($httptlspid, $pid2);
+ for (1 .. 10) {
+ $port += int(rand(800));
+ my $allflags = "--port $port $flags";
- if($httptlspid <= 0 || !pidexists($httptlspid)) {
- # it is NOT alive
- logmsg "RUN: failed to start the $srvrname server\n";
- stopserver($server, "$pid2");
- displaylogs($testnumcheck);
- $doesntrun{$pidfile} = 1;
- return (0,0);
- }
+ my $cmd = "$httptlssrv $allflags > $logfile 2>&1";
+ ($httptlspid, $pid2) = startnew($cmd, $pidfile, 10, 1);
- # Server is up. Verify that we can speak to it. PID is from fake pidfile
- my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port);
- if(!$pid3) {
- logmsg "RUN: $srvrname server failed verification\n";
- # failed to talk to it properly. Kill the server and return failure
- stopserver($server, "$httptlspid $pid2");
- displaylogs($testnumcheck);
- $doesntrun{$pidfile} = 1;
- return (0,0);
- }
- $pid2 = $pid3;
+ if($httptlspid <= 0 || !pidexists($httptlspid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ stopserver($server, "$pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ $httptlspid = $pid2 = 0;
+ next;
+ }
+ $doesntrun{$pidfile} = 0;
- if($verbose) {
- logmsg "RUN: $srvrname server is now running PID $httptlspid\n";
+ if($verbose) {
+ logmsg "RUN: $srvrname server PID $httptlspid port $port\n";
+ }
+ last;
}
-
- return ($httptlspid, $pid2);
+ return ($httptlspid, $pid2, $port);
}
#######################################################################
@@ -2400,7 +2401,7 @@ sub runsocksserver {
# start the dict server
#
sub rundictserver {
- my ($verbose, $alt, $port) = @_;
+ my ($verbose, $alt) = @_;
my $proto = "dict";
my $ip = $HOSTIP;
my $ipvnum = 4;
@@ -2437,45 +2438,42 @@ sub rundictserver {
$flags .= "--verbose 1 " if($debugprotocol);
$flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
$flags .= "--id $idnum " if($idnum > 1);
- $flags .= "--port $port --srcdir \"$srcdir\" ";
+ $flags .= "--srcdir \"$srcdir\" ";
$flags .= "--host $HOSTIP";
- my $cmd = "$srcdir/dictserver.py $flags";
- my ($dictpid, $pid2) = startnew($cmd, $pidfile, 15, 0);
-
- if($dictpid <= 0 || !pidexists($dictpid)) {
- # it is NOT alive
- logmsg "RUN: failed to start the $srvrname server\n";
- stopserver($server, "$pid2");
- displaylogs($testnumcheck);
- $doesntrun{$pidfile} = 1;
- return (0,0);
- }
+ my $port = 29000;
+ my ($dictpid, $pid2);
+ for(1 .. 10) {
+ $port += int(rand(900));
+ my $aflags = "--port $port $flags";
+ my $cmd = "$srcdir/dictserver.py $aflags";
+ ($dictpid, $pid2) = startnew($cmd, $pidfile, 15, 0);
- # Server is up. Verify that we can speak to it.
- my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port);
- if(!$pid3) {
- logmsg "RUN: $srvrname server failed verification\n";
- # failed to talk to it properly. Kill the server and return failure
- stopserver($server, "$dictpid $pid2");
- displaylogs($testnumcheck);
- $doesntrun{$pidfile} = 1;
- return (0,0);
- }
- $pid2 = $pid3;
+ if($dictpid <= 0 || !pidexists($dictpid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ stopserver($server, "$pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ $dictpid = $pid2 = 0;
+ next;
+ }
+ $doesntrun{$pidfile} = 0;
- if($verbose) {
- logmsg "RUN: $srvrname server is now running PID $dictpid\n";
+ if($verbose) {
+ logmsg "RUN: $srvrname server PID $dictpid port $port\n";
+ }
+ last;
}
- return ($dictpid, $pid2);
+ return ($dictpid, $pid2, $port);
}
#######################################################################
# start the SMB server
#
sub runsmbserver {
- my ($verbose, $alt, $port) = @_;
+ my ($verbose, $alt) = @_;
my $proto = "smb";
my $ip = $HOSTIP;
my $ipvnum = 4;
@@ -2512,45 +2510,42 @@ sub runsmbserver {
$flags .= "--verbose 1 " if($debugprotocol);
$flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
$flags .= "--id $idnum " if($idnum > 1);
- $flags .= "--port $port --srcdir \"$srcdir\" ";
+ $flags .= "--srcdir \"$srcdir\" ";
$flags .= "--host $HOSTIP";
- my $cmd = "$srcdir/smbserver.py $flags";
- my ($smbpid, $pid2) = startnew($cmd, $pidfile, 15, 0);
-
- if($smbpid <= 0 || !pidexists($smbpid)) {
- # it is NOT alive
- logmsg "RUN: failed to start the $srvrname server\n";
- stopserver($server, "$pid2");
- displaylogs($testnumcheck);
- $doesntrun{$pidfile} = 1;
- return (0,0);
- }
+ my ($smbpid, $pid2);
+ my $port = 31923;
+ for(1 .. 10) {
+ $port += int(rand(760));
+ my $aflags = "--port $port $flags";
+ my $cmd = "$srcdir/smbserver.py $aflags";
+ ($smbpid, $pid2) = startnew($cmd, $pidfile, 15, 0);
- # Server is up. Verify that we can speak to it.
- my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port);
- if(!$pid3) {
- logmsg "RUN: $srvrname server failed verification\n";
- # failed to talk to it properly. Kill the server and return failure
- stopserver($server, "$smbpid $pid2");
- displaylogs($testnumcheck);
- $doesntrun{$pidfile} = 1;
- return (0,0);
- }
- $pid2 = $pid3;
+ if($smbpid <= 0 || !pidexists($smbpid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ stopserver($server, "$pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ $smbpid = $pid2 = 0;
+ next;
+ }
+ $doesntrun{$pidfile} = 0;
- if($verbose) {
- logmsg "RUN: $srvrname server is now running PID $smbpid\n";
+ if($verbose) {
+ logmsg "RUN: $srvrname server PID $smbpid port $port\n";
+ }
+ last;
}
- return ($smbpid, $pid2);
+ return ($smbpid, $pid2, $port);
}
#######################################################################
# start the telnet server
#
sub runnegtelnetserver {
- my ($verbose, $alt, $port) = @_;
+ my ($verbose, $alt) = @_;
my $proto = "telnet";
my $ip = $HOSTIP;
my $ipvnum = 4;
@@ -2587,37 +2582,34 @@ sub runnegtelnetserver {
$flags .= "--verbose 1 " if($debugprotocol);
$flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
$flags .= "--id $idnum " if($idnum > 1);
- $flags .= "--port $port --srcdir \"$srcdir\"";
-
- my $cmd = "$srcdir/negtelnetserver.py $flags";
- my ($ntelpid, $pid2) = startnew($cmd, $pidfile, 15, 0);
+ $flags .= "--srcdir \"$srcdir\"";
- if($ntelpid <= 0 || !pidexists($ntelpid)) {
- # it is NOT alive
- logmsg "RUN: failed to start the $srvrname server\n";
- stopserver($server, "$pid2");
- displaylogs($testnumcheck);
- $doesntrun{$pidfile} = 1;
- return (0,0);
- }
+ my ($ntelpid, $pid2);
+ my $port = 32000;
+ for(1 .. 10) {
+ $port += int(rand(800));
+ my $aflags = "--port $port $flags";
+ my $cmd = "$srcdir/negtelnetserver.py $aflags";
+ ($ntelpid, $pid2) = startnew($cmd, $pidfile, 15, 0);
- # Server is up. Verify that we can speak to it.
- my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port);
- if(!$pid3) {
- logmsg "RUN: $srvrname server failed verification\n";
- # failed to talk to it properly. Kill the server and return failure
- stopserver($server, "$ntelpid $pid2");
- displaylogs($testnumcheck);
- $doesntrun{$pidfile} = 1;
- return (0,0);
- }
- $pid2 = $pid3;
+ if($ntelpid <= 0 || !pidexists($ntelpid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the $srvrname server\n";
+ stopserver($server, "$pid2");
+ displaylogs($testnumcheck);
+ $doesntrun{$pidfile} = 1;
+ $ntelpid = $pid2 = 0;
+ next;
+ }
+ $doesntrun{$pidfile} = 0;
- if($verbose) {
- logmsg "RUN: $srvrname server is now running PID $ntelpid\n";
+ if($verbose) {
+ logmsg "RUN: $srvrname server PID $ntelpid port $port\n";
+ }
+ last;
}
- return ($ntelpid, $pid2);
+ return ($ntelpid, $pid2, $port);
}
@@ -2796,7 +2788,6 @@ sub setupfeatures {
$feature{"alt-svc"} = $has_altsvc;
$feature{"brotli"} = $has_brotli;
$feature{"crypto"} = $has_crypto;
- $feature{"DarwinSSL"} = $has_darwinssl; # alias
$feature{"debug"} = $debug_build;
$feature{"getrlimit"} = $has_getrlimit;
$feature{"GnuTLS"} = $has_gnutls;
@@ -2816,10 +2807,10 @@ sub setupfeatures {
$feature{"NSS"} = $has_nss;
$feature{"NTLM"} = $has_ntlm;
$feature{"NTLM_WB"} = $has_ntlm_wb;
- $feature{"OpenSSL"} = $has_openssl;
+ $feature{"OpenSSL"} = $has_openssl || $has_libressl || $has_boringssl;
$feature{"PSL"} = $has_psl;
- $feature{"Schannel"} = $has_winssl; # alias
- $feature{"sectransp"} = $has_darwinssl;
+ $feature{"Schannel"} = $has_schannel;
+ $feature{"sectransp"} = $has_sectransp;
$feature{"SPNEGO"} = $has_spnego;
$feature{"SSL"} = $has_ssl;
$feature{"SSLpinning"} = $has_sslpinning;
@@ -2830,7 +2821,7 @@ sub setupfeatures {
$feature{"unittest"} = $debug_build;
$feature{"unix-sockets"} = $has_unix;
$feature{"win32"} = $has_win32;
- $feature{"WinSSL"} = $has_winssl;
+ $feature{"zstd"} = $has_zstd;
# make each protocol an enabled "feature"
for my $p (@protocols) {
@@ -2914,7 +2905,7 @@ sub checksystem {
$has_mingw = 1 if ($curl =~ /-pc-mingw32/);
}
if ($libcurl =~ /(winssl|schannel)/i) {
- $has_winssl=1;
+ $has_schannel=1;
$has_sslpinning=1;
}
elsif ($libcurl =~ /openssl/i) {
@@ -2934,7 +2925,7 @@ sub checksystem {
$has_sslpinning=1;
}
elsif ($libcurl =~ /securetransport/i) {
- $has_darwinssl=1;
+ $has_sectransp=1;
$has_sslpinning=1;
}
elsif ($libcurl =~ /BoringSSL/i) {
@@ -3011,6 +3002,9 @@ sub checksystem {
if($feat =~ /brotli/i) {
$has_brotli = 1;
}
+ if($feat =~ /zstd/i) {
+ $has_zstd = 1;
+ }
if($feat =~ /NTLM/i) {
# NTLM enabled
$has_ntlm=1;
@@ -3214,18 +3208,8 @@ sub checksystem {
$run_event_based?"event-based ":"");
logmsg sprintf("%s\n", $libtool?"Libtool ":"");
logmsg ("* Seed: $randseed\n");
- logmsg ("* Port range: $minport-$maxport\n");
if($verbose) {
- logmsg "* Ports: ";
- if($httptlssrv) {
- logmsg sprintf("HTTPTLS/%d ", $HTTPTLSPORT);
- if($has_ipv6) {
- logmsg sprintf("HTTPTLS-IPv6/%d ", $HTTPTLS6PORT);
- }
- logmsg "\n";
- }
-
if($has_unix) {
logmsg "* Unix socket paths:\n";
if($http_unix) {
@@ -3284,7 +3268,7 @@ sub subVariables {
$$thing =~ s/${prefix}DICTPORT/$DICTPORT/g;
$$thing =~ s/${prefix}SMBPORT/$SMBPORT/g;
$$thing =~ s/${prefix}SMBSPORT/$SMBSPORT/g;
- $$thing =~ s/${prefix}NEGTELNETPORT/$NEGTELNETPORT/g;
+ $$thing =~ s/${prefix}TELNETPORT/$TELNETPORT/g;
$$thing =~ s/${prefix}NOLISTENPORT/$NOLISTENPORT/g;
# server Unix domain socket paths
@@ -3333,6 +3317,20 @@ sub subVariables {
$$thing =~ s/${prefix}H2CVER/$h2cver/g;
}
+sub subBase64 {
+ my ($thing) = @_;
+
+ # cut out the base64 piece
+ if($$thing =~ s/%b64\[(.*)\]b64%/%%B64%%/i) {
+ my $d = $1;
+ # encode %NN characters
+ $d =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
+ my $enc = encode_base64($d, "");
+ # put the result into there
+ $$thing =~ s/%%B64%%/$enc/;
+ }
+}
+
sub fixarray {
my @in = @_;
@@ -3555,16 +3553,21 @@ sub singletest {
for my $s (@entiretest) {
my $f = $s;
subVariables(\$s, "%");
+ subBase64(\$s);
if($f ne $s) {
$diff++;
}
print D $s;
}
close(D);
+
# remove the separate test file again if nothing was updated to keep
# things simpler
unlink($otest) if(!$diff);
+ # in case the process changed the file, reload it
+ loadtest("log/test${testnum}") if($diff);
+
# timestamp required servers verification end
$timesrvrend{$testnum} = Time::HiRes::time();
@@ -4644,7 +4647,7 @@ sub startservers {
}
elsif($what eq "http/2") {
if(!$run{'http/2'}) {
- ($pid, $pid2) = runhttp2server($verbose, $HTTP2PORT);
+ ($pid, $pid2, $HTTP2PORT) = runhttp2server($verbose);
if($pid <= 0) {
return "failed starting HTTP/2 server";
}
@@ -4838,7 +4841,8 @@ sub startservers {
stopserver('httptls');
}
if(!$run{'httptls'}) {
- ($pid, $pid2) = runhttptlsserver($verbose, "IPv4");
+ ($pid, $pid2, $HTTPTLSPORT) =
+ runhttptlsserver($verbose, "IPv4");
if($pid <= 0) {
return "failed starting HTTPTLS server (gnutls-serv)";
}
@@ -4857,7 +4861,8 @@ sub startservers {
stopserver('httptls-ipv6');
}
if(!$run{'httptls-ipv6'}) {
- ($pid, $pid2) = runhttptlsserver($verbose, "ipv6");
+ ($pid, $pid2, $HTTPTLS6PORT) =
+ runhttptlsserver($verbose, "ipv6");
if($pid <= 0) {
return "failed starting HTTPTLS-IPv6 server (gnutls-serv)";
}
@@ -4945,7 +4950,7 @@ sub startservers {
}
elsif($what eq "dict") {
if(!$run{'dict'}) {
- ($pid, $pid2) = rundictserver($verbose, "", $DICTPORT);
+ ($pid, $pid2, $DICTPORT) = rundictserver($verbose, "");
if($pid <= 0) {
return "failed starting DICT server";
}
@@ -4956,7 +4961,7 @@ sub startservers {
}
elsif($what eq "smb") {
if(!$run{'smb'}) {
- ($pid, $pid2) = runsmbserver($verbose, "", $SMBPORT);
+ ($pid, $pid2, $SMBPORT) = runsmbserver($verbose, "");
if($pid <= 0) {
return "failed starting SMB server";
}
@@ -4967,9 +4972,8 @@ sub startservers {
}
elsif($what eq "telnet") {
if(!$run{'telnet'}) {
- ($pid, $pid2) = runnegtelnetserver($verbose,
- "",
- $NEGTELNETPORT);
+ ($pid, $pid2, $TELNETPORT) =
+ runnegtelnetserver($verbose, "");
if($pid <= 0) {
return "failed starting neg TELNET server";
}
@@ -5195,12 +5199,6 @@ while(@ARGV) {
# verbose output
$verbose=1;
}
- elsif($ARGV[0] =~ /^-b(.*)/) {
- my $portno=$1;
- if($portno =~ s/(\d+)$//) {
- $base = int $1;
- }
- }
elsif ($ARGV[0] eq "-c") {
# use this path to curl instead of default
$DBGCURL=$CURL="\"$ARGV[1]\"";
@@ -5322,7 +5320,6 @@ while(@ARGV) {
Usage: runtests.pl [options] [test selection(s)]
-a continue even if a test fails
-am automake style output PASS/FAIL: [number] [name]
- -bN use base port number N for test servers (default $base)
-c path use this curl executable
-d display server debug info
-e event-based execution
@@ -5470,18 +5467,8 @@ if ($gdbthis) {
}
}
-$minport = $base; # original base port number
-$HTTPTLSPORT = $base++; # HTTP TLS (non-stunnel) server port
-$HTTPTLS6PORT = $base++; # HTTP TLS (non-stunnel) IPv6 server port
-$HTTP2PORT = $base++; # HTTP/2 port
-$DICTPORT = $base++; # DICT port
-$SMBPORT = $base++; # SMB port
-$SMBSPORT = $base++; # SMBS port
-$NEGTELNETPORT = $base++; # TELNET port with negotiation
$HTTPUNIXPATH = "http$$.sock"; # HTTP server Unix domain socket path
-$maxport = $base-1; # updated base port number
-
#######################################################################
# clear and create logging directory:
#
diff --git a/tests/server/util.c b/tests/server/util.c
index 577a56cb..dccce596 100644
--- a/tests/server/util.c
+++ b/tests/server/util.c
@@ -119,6 +119,7 @@ void logmsg(const char *msg, ...)
known_offset = 1;
}
sec = epoch_offset + tv.tv_sec;
+ /* !checksrc! disable BANNEDFUNC 1 */
now = localtime(&sec); /* not thread safe but we don't care */
msnprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%06ld",
@@ -475,7 +476,7 @@ static struct timeval tvnow(void)
struct timespec tsnow;
if(0 == clock_gettime(CLOCK_MONOTONIC, &tsnow)) {
now.tv_sec = tsnow.tv_sec;
- now.tv_usec = tsnow.tv_nsec / 1000;
+ now.tv_usec = (int)(tsnow.tv_nsec / 1000);
}
/*
** Even when the configure process has truly detected monotonic clock
diff --git a/tests/sshserver.pl b/tests/sshserver.pl
index 24c98d63..5cff897a 100644
--- a/tests/sshserver.pl
+++ b/tests/sshserver.pl
@@ -522,6 +522,11 @@ push @cfgarr, '#';
# and do not support quotes around values for some unknown reason.
if ($sshdid =~ /OpenSSH-Windows/) {
my $username_lc = lc $username;
+ if (exists $ENV{USERDOMAIN}) {
+ my $userdomain_lc = lc $ENV{USERDOMAIN};
+ $username_lc = "$userdomain_lc\\$username_lc";
+ }
+ $username_lc =~ s/ /\?/g; # replace space with ?
push @cfgarr, "DenyUsers !$username_lc";
push @cfgarr, "AllowUsers $username_lc";
} else {
diff --git a/tests/symbol-scan.pl b/tests/symbol-scan.pl
index e8f594ee..7905ee77 100755
--- a/tests/symbol-scan.pl
+++ b/tests/symbol-scan.pl
@@ -178,3 +178,6 @@ if($summary) {
if($misses) {
exit 2; # there are stuff to attend to!
}
+else {
+ print "OK\n";
+}
diff --git a/tests/testcurl.1 b/tests/testcurl.1
index 6780ba3d..fb8d4396 100644
--- a/tests/testcurl.1
+++ b/tests/testcurl.1
@@ -20,7 +20,7 @@
.\" *
.\" **************************************************************************
.\"
-.TH testcurl.pl 1 "October 22, 2016" "Curl 7.71.1" "testcurl"
+.TH testcurl.pl 1 "October 22, 2016" "Curl 7.72.0" "testcurl"
.SH NAME
testcurl.pl \- (automatically) test curl