diff options
Diffstat (limited to 'tests/data')
-rw-r--r-- | tests/data/Makefile.inc | 16 | ||||
-rw-r--r-- | tests/data/test1159 | 58 | ||||
-rw-r--r-- | tests/data/test1160 | 6 | ||||
-rw-r--r-- | tests/data/test1322 | 2 | ||||
-rw-r--r-- | tests/data/test1457 | 62 | ||||
-rw-r--r-- | tests/data/test1518 | 62 | ||||
-rw-r--r-- | tests/data/test1519 | 62 | ||||
-rw-r--r-- | tests/data/test1652 | 23 | ||||
-rw-r--r-- | tests/data/test1653 | 23 | ||||
-rw-r--r-- | tests/data/test20 | 2 | ||||
-rw-r--r-- | tests/data/test203 | 6 | ||||
-rw-r--r-- | tests/data/test2070 | 41 | ||||
-rw-r--r-- | tests/data/test2076 | 75 | ||||
-rw-r--r-- | tests/data/test327 | 73 | ||||
-rw-r--r-- | tests/data/test328 | 55 | ||||
-rw-r--r-- | tests/data/test329 | 70 | ||||
-rw-r--r-- | tests/data/test658 | 50 |
17 files changed, 632 insertions, 54 deletions
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc index 35c7aa4f..dd38f896 100644 --- a/tests/data/Makefile.inc +++ b/tests/data/Makefile.inc @@ -56,7 +56,7 @@ test289 test290 test291 test292 test293 test294 test295 test296 test297 \ test298 test299 test300 test301 test302 test303 test304 test305 test306 \ test307 test308 test309 test310 test311 test312 test313 test314 test315 \ test316 test317 test318 test319 test320 test321 test322 test323 test324 \ -test325 test326 \ +test325 test326 test327 test328 test329 \ \ test340 \ \ @@ -83,7 +83,7 @@ test617 test618 test619 test620 test621 test622 test623 test624 test625 \ test626 test627 test628 test629 test630 test631 test632 test633 test634 \ test635 test636 test637 test638 test639 test640 test641 test642 \ test643 test644 test645 test646 test647 test648 test649 test650 test651 \ -test652 test653 test654 test655 test656 \ +test652 test653 test654 test655 test656 test658 \ \ test700 test701 test702 test703 test704 test705 test706 test707 test708 \ test709 test710 test711 test712 test713 test714 test715 \ @@ -127,7 +127,7 @@ test1120 test1121 test1122 test1123 test1124 test1125 test1126 test1127 \ test1128 test1129 test1130 test1131 test1132 test1133 test1134 test1135 \ test1136 test1137 test1138 test1139 test1140 test1141 test1142 test1143 \ test1144 test1145 test1146 test1147 test1148 test1149 test1150 test1151 \ -test1152 test1153 test1154 test1155 test1156 test1157 test1158 \ +test1152 test1153 test1154 test1155 test1156 test1157 test1158 test1159 \ \ test1160 test1161 test1162 test1163 test1164 \ test1170 test1171 \ @@ -166,12 +166,10 @@ test1424 test1425 test1426 test1427 \ test1428 test1429 test1430 test1431 test1432 test1433 test1434 test1435 \ test1436 test1437 test1438 test1439 test1440 test1441 test1442 test1443 \ test1444 test1445 test1446 test1447 test1448 test1449 test1450 test1451 \ -test1452 test1453 test1454 test1455 test1456 \ +test1452 test1453 test1454 test1455 test1456 test1457 \ test1500 test1501 test1502 test1503 test1504 test1505 test1506 test1507 \ test1508 test1509 test1510 test1511 test1512 test1513 test1514 test1515 \ -test1516 test1517 \ -\ -test1520 test1521 test1522 \ +test1516 test1517 test1518 test1519 test1520 test1521 test1522 \ \ test1525 test1526 test1527 test1528 test1529 test1530 test1531 test1532 \ test1533 test1534 test1535 test1536 test1537 test1538 \ @@ -184,7 +182,7 @@ test1590 \ test1600 test1601 test1602 test1603 test1604 test1605 test1606 test1607 \ test1608 test1609 test1620 \ \ -test1650 test1651 \ +test1650 test1651 test1652 test1653 \ \ test1700 test1701 test1702 \ \ @@ -201,7 +199,7 @@ test2040 test2041 test2042 test2043 test2044 test2045 test2046 test2047 \ test2048 test2049 test2050 test2051 test2052 test2053 test2054 test2055 \ test2056 test2057 test2058 test2059 test2060 test2061 test2062 test2063 \ test2064 test2065 test2066 test2067 test2068 test2069 \ -test2070 test2071 test2072 test2073 test2074 test2075 \ + test2071 test2072 test2073 test2074 test2075 test2076 \ test2080 \ test2100 \ \ diff --git a/tests/data/test1159 b/tests/data/test1159 new file mode 100644 index 00000000..a5160165 --- /dev/null +++ b/tests/data/test1159 @@ -0,0 +1,58 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +redirect_url +followlocation +--write-out +</keywords> +</info> + +# Server-side +<reply> +<data nocheck="yes"> +HTTP/1.1 301 This is a weirdo text message swsclose
+Location: ht3p://localhost/
+Content-Length: 62
+Connection: close
+
+This server reply is for testing a simple Location: following +</data> +</reply> + +# Client-side +<client> +<server> +http +</server> + <name> +HTTP Location: and 'redirect_url' with non-supported scheme + </name> +<command> +http://%HOSTIP:%HTTPPORT/we/want/our/1159 -w '%{redirect_url}\n' +</command> +</client> + +# Verify data after the test has been "shot" +<verify> +<strip> +^User-Agent:.* +</strip> +<protocol> +GET /we/want/our/1159 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol> +<stdout> +HTTP/1.1 301 This is a weirdo text message swsclose
+Location: ht3p://localhost/
+Content-Length: 62
+Connection: close
+
+This server reply is for testing a simple Location: following +ht3p://localhost/ +</stdout> +</verify> +</testcase> diff --git a/tests/data/test1160 b/tests/data/test1160 index 26a758c4..3fe689e9 100644 --- a/tests/data/test1160 +++ b/tests/data/test1160 @@ -43,7 +43,11 @@ Host: %HOSTIP:%HTTPPORT Accept: */*
</protocol> -<file name="log/cookies1160.txt"> +<file name="log/cookies1160.txt" mode="text"> +# Netscape HTTP Cookie File +# https://curl.haxx.se/docs/http-cookies.html +# This file was generated by libcurl! Edit at your own risk. + </file> </verify> </testcase> diff --git a/tests/data/test1322 b/tests/data/test1322 index bf10a8d0..97498951 100644 --- a/tests/data/test1322 +++ b/tests/data/test1322 @@ -37,7 +37,7 @@ http HTTP with --resolve and hostname with trailing dot </name> <command> ---resolve example.com:%HTTPPORT:%HOSTIP http://example.com.:%HTTPPORT/1322 +--ipv4 --resolve example.com.:%HTTPPORT:%HOSTIP http://example.com.:%HTTPPORT/1322 </command> </client> diff --git a/tests/data/test1457 b/tests/data/test1457 new file mode 100644 index 00000000..aad6d43d --- /dev/null +++ b/tests/data/test1457 @@ -0,0 +1,62 @@ +<testcase> +<info> +<keywords> +protocol +--write-out +</keywords> +</info> +# Server-side +<reply> +<data nocheck="yes"> +HTTP/1.1 200 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Content-Length: 9 +Connection: close +Content-Type: text/plain + +testdata +</data> + +</reply> + +# Client-side +<client> +<server> +http +</server> + +<name> +Check if %{stderr} and %{stdout} switch between stdout and stderr. +</name> +<command> +http://%HOSTIP:%HTTPPORT/1457 --write-out 'line1%{stderr}line2%{stdout}line3' +</command> +</client> + +# Verify data +<verify> +<stdout nonewline="yes"> +HTTP/1.1 200 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Content-Length: 9 +Connection: close +Content-Type: text/plain + +testdata +line1line3 +</stdout> +#note: as of now <stderr> doesn't actually exist in runtests.pl +<stderr nonewline="yes"> +line2 +</stderr> +<protocol> +GET /1457 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol> +<strip> +^User-Agent:.* +</strip> +</verify> +</testcase> diff --git a/tests/data/test1518 b/tests/data/test1518 new file mode 100644 index 00000000..134ea4af --- /dev/null +++ b/tests/data/test1518 @@ -0,0 +1,62 @@ +<testcase> +<info> +<keywords> +HTTP +</keywords> +</info> +# +# This reproduces issue #3340 +# +# Server-side +<reply> +<data nocheck="yes"> +HTTP/1.1 302 redirect to broken URL +Date: Thu, 17 Mar 2016 14:41:00 GMT +Server: test-server/fake +Content-Type: text/plain; charset=US-ASCII +X-Special: swsclose +Location: http://1.2 .4.5/test +Content-Length: 0 +Connection: close + +</data> +</reply> + +# Client-side +<client> +<server> +http +</server> +# tool is what to use instead of 'curl' +<tool> +lib1518 +</tool> + + <name> +Extract Location: with broken URL + </name> + <command> +http://%HOSTIP:%HTTPPORT/1518 +</command> +</client> + +# +# Verify data after the test has been "shot" +<verify> +<strippart> + +</strippart> +<protocol> +</protocol> +<stdout> +res: 0 +status: 302 +redirects: 0 +effectiveurl: http://%HOSTIP:%HTTPPORT/1518 +redirecturl: http://1.2 .4.5/test +</stdout> +<errorcode> +0 +</errorcode> +</verify> +</testcase> diff --git a/tests/data/test1519 b/tests/data/test1519 new file mode 100644 index 00000000..ab23dadc --- /dev/null +++ b/tests/data/test1519 @@ -0,0 +1,62 @@ +<testcase> +<info> +<keywords> +HTTP +</keywords> +</info> +# +# This reproduces issue #3340 +# +# Server-side +<reply> +<data nocheck="yes"> +HTTP/1.1 302 redirect to broken URL +Date: Thu, 17 Mar 2016 14:41:00 GMT +Server: test-server/fake +Content-Type: text/plain; charset=US-ASCII +X-Special: swsclose +Location: h ttp://1.2.4.5/test +Content-Length: 0 +Connection: close + +</data> +</reply> + +# Client-side +<client> +<server> +http +</server> +# tool is what to use instead of 'curl' +<tool> +lib1518 +</tool> + + <name> +Extract Location: with broken absolute URL + </name> + <command> +http://%HOSTIP:%HTTPPORT/1519 +</command> +</client> + +# +# Verify data after the test has been "shot" +<verify> +<strippart> + +</strippart> +<protocol> +</protocol> +<stdout> +res: 0 +status: 302 +redirects: 0 +effectiveurl: http://%HOSTIP:%HTTPPORT/1519 +redirecturl: http://127.0.0.1:8990/h%20ttp://1.2.4.5/test +</stdout> +<errorcode> +0 +</errorcode> +</verify> +</testcase> diff --git a/tests/data/test1652 b/tests/data/test1652 new file mode 100644 index 00000000..c4116901 --- /dev/null +++ b/tests/data/test1652 @@ -0,0 +1,23 @@ +<testcase> +<info> +<keywords> +unittest +infof +</keywords> +</info> + +<client> +<server> +none +</server> +<features> +unittest +</features> +<name> +infof +</name> +<tool> +unit1652 +</tool> +</client> +</testcase> diff --git a/tests/data/test1653 b/tests/data/test1653 new file mode 100644 index 00000000..0de2c14b --- /dev/null +++ b/tests/data/test1653 @@ -0,0 +1,23 @@ +<testcase> +<info> +<keywords> +unittest +urlapi +</keywords> +</info> + +<client> +<server> +none +</server> +<features> +unittest +</features> +<name> +urlapi +</name> +<tool> +unit1653 +</tool> +</client> +</testcase> diff --git a/tests/data/test20 b/tests/data/test20 index 57fa48de..910cb54c 100644 --- a/tests/data/test20 +++ b/tests/data/test20 @@ -25,7 +25,7 @@ http attempt connect to non-existing host name </name> <command> -non-existing-host.haxx.se. +--ipv4 non-existing-host.haxx.se. </command> </client> diff --git a/tests/data/test203 b/tests/data/test203 index 39384265..ee850cb1 100644 --- a/tests/data/test203 +++ b/tests/data/test203 @@ -24,8 +24,12 @@ file <name> file:/path URL with a single slash </name> +<setenv> +# Needed for MSYS2 to not convert +MSYS2_ARG_CONV_EXCL=file: +</setenv> <command option="no-include"> -file:%PWD/log/test203.txt +file:%FILE_PWD/log/test203.txt </command> <file name="log/test203.txt"> foo diff --git a/tests/data/test2070 b/tests/data/test2070 deleted file mode 100644 index 655cd8a3..00000000 --- a/tests/data/test2070 +++ /dev/null @@ -1,41 +0,0 @@ -<testcase> -<info> -<keywords> -FILE -</keywords> -</info> - -<reply> -<data> -foo - bar -bar - foo -moo -</data> -</reply> - -# Client-side -<client> -<server> -file -</server> - <name> -basic file:// file with no authority - </name> -<command option="no-include"> -file:%PWD/log/test2070.txt -</command> -<file name="log/test2070.txt"> -foo - bar -bar - foo -moo -</file> -</client> - -# Verify data after the test has been "shot" -<verify> -</verify> -</testcase> diff --git a/tests/data/test2076 b/tests/data/test2076 new file mode 100644 index 00000000..2c477b1a --- /dev/null +++ b/tests/data/test2076 @@ -0,0 +1,75 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +HTTP Digest auth +</keywords> +</info> +# Server-side +<reply> +<data> +HTTP/1.1 401 Authorization Required swsclose
+WWW-Authenticate: Digest realm="testrealm", nonce="1"
+Content-Length: 26
+
+This is not the real page +</data> + +# This is supposed to be returned when the server gets a +# Authorization: Digest line passed-in from the client +<data1000> +HTTP/1.1 200 OK swsclose
+Content-Length: 23
+
+This IS the real page! +</data1000> + +<datacheck> +HTTP/1.1 401 Authorization Required swsclose
+WWW-Authenticate: Digest realm="testrealm", nonce="1"
+Content-Length: 26
+
+HTTP/1.1 200 OK swsclose
+Content-Length: 23
+
+This IS the real page! +</datacheck> + +</reply> + +# Client-side +<client> +<server> +http +</server> +<features> +!SSPI +crypto +</features> +<name> +HTTP with digest auth and URI contains query +</name> +<command> +"http://%HOSTIP:%HTTPPORT/2076?query" -u testuser:testpass --digest +</command> +</client> + +# Verify data after the test has been "shot" +<verify> +<strip> +^User-Agent:.* +</strip> +<protocol> +GET /2076?query HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /2076?query HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Authorization: Digest username="testuser", realm="testrealm", nonce="1", uri="/2076?query", response="5758bd3bbde7f33236e6ccd278eb59af"
+Accept: */*
+
+</protocol> +</verify> +</testcase> diff --git a/tests/data/test327 b/tests/data/test327 new file mode 100644 index 00000000..fcb98990 --- /dev/null +++ b/tests/data/test327 @@ -0,0 +1,73 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +cookies +header dump +</keywords> +</info> + +# This test verifies that the cookie file gets created even if the last cookie +# has been removed - particularly important when the file is going to be read +# again and thus must not contain old contents. + +# Server-side +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +Funny-head: yesyes swsclose +Set-Cookie: foobar=name; expires=Thu, 22 Nov 2028 10:54:11 GMT; + +</data> +<data2> +HTTP/1.1 200 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Type: text/html +Funny-head: yesyes swsclose +Set-Cookie: foobar=name; expires=Thu, 01 Jan 1970 00:00:00 GMT; + +</data> +</reply> + +# Client-side +<client> +<server> +http +</server> + <name> +HTTP with cookiejar without cookies left + </name> + <command> +http://%HOSTIP:%HTTPPORT/we/want/327 -b none -c log/cookies327 http://%HOSTIP:%HTTPPORT/we/want/3270002 +</command> +</client> + +# Verify data after the test has been "shot" +<verify> +<strip> +^User-Agent:.* +</strip> +<protocol> +GET /we/want/327 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+GET /we/want/3270002 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+Cookie: foobar=name
+
+</protocol> +<file name="log/cookies327" mode="text"> +# Netscape HTTP Cookie File +# https://curl.haxx.se/docs/http-cookies.html +# This file was generated by libcurl! Edit at your own risk. + +</file> +</verify> +</testcase> diff --git a/tests/data/test328 b/tests/data/test328 new file mode 100644 index 00000000..93c00e18 --- /dev/null +++ b/tests/data/test328 @@ -0,0 +1,55 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +Content-Encoding +</keywords> +</info> + +# Server-side +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Content-Type: text/html +Content-Encoding: none +Content-Length: 38 + +Q: What did 0 say to 8? A: Nice Belt! +</data> +</reply> + +# Client-side +<client> +<server> +http +</server> + +# we're actually more interested in any compression support but this is the +# best we can do right now +<features> +libz +</features> + <name> +HTTP with "Content-Encoding: none + </name> + <command> +http://%HOSTIP:%HTTPPORT/hello/328 --compressed +</command> +</client> + +# Verify data after the test has been "shot" +<verify> +<strip> +^User-Agent:.* +^Accept-Encoding:.* +</strip> +<protocol> +GET /hello/328 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</protocol> +</verify> +</testcase> diff --git a/tests/data/test329 b/tests/data/test329 new file mode 100644 index 00000000..c9e3d9d4 --- /dev/null +++ b/tests/data/test329 @@ -0,0 +1,70 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +cookies +</keywords> +</info> +# Server-side +<reply> +<data> +HTTP/1.1 200 OK
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Type: text/html
+Funny-head: yesyes
+Set-Cookie: test=yes; path=/we/want/; domain=.host.foo.com; Max-Age=0;
+Content-Length: 4
+
+boo +</data> +<data2> +HTTP/1.1 200 OK
+Funny-head: yesyes
+Content-Length: 4
+
+moo +</data2> +</reply> + +# Client-side +<client> +<file name="log/jar329.txt" mode="text"> +.host.foo.com TRUE /we/want/ FALSE 2054030187 test no +</file> +<server> +http +</server> + <name> +HTTP cookie with Max-Age=0 + </name> +# Explicitly set the time zone to a known good one, in case the user is +# using one of the 'right' zones that take into account leap seconds +# which causes the cookie expiry times to be different. +<setenv> +TZ=GMT +</setenv> + <command> +http://%HOSTIP:%HTTPPORT/we/want/329 -b log/jar329.txt -H "Host: host.foo.com" http://%HOSTIP:%HTTPPORT/we/want/3290002 +</command> +</client> + +# Verify data after the test has been "shot" +<verify> +<strip> +^User-Agent:.* +</strip> +<protocol> +GET /we/want/329 HTTP/1.1
+Host: host.foo.com
+Accept: */*
+Cookie: test=no
+
+GET /we/want/3290002 HTTP/1.1
+Host: host.foo.com
+Accept: */*
+
+</protocol> +</verify> +</testcase> diff --git a/tests/data/test658 b/tests/data/test658 new file mode 100644 index 00000000..c75293c6 --- /dev/null +++ b/tests/data/test658 @@ -0,0 +1,50 @@ +<testcase> +<info> +<keywords> +HTTP +HTTP GET +</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> +lib658 +</tool> +<name> +HTTP GET + </name> + <command> +http://%HOSTIP:%HTTPPORT/658 +</command> +</client> + +<verify> +<strip> +^User-Agent:.* +</strip> +<protocol> +GET /658 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+Accept: */*
+
+</verify> + +</testcase> |