mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
nine new test cases
This commit is contained in:
parent
c528dc53c9
commit
56da5a05be
@ -5,8 +5,9 @@ test:
|
|||||||
[ -f test1 ] || ln -s $(srcdir)/test* .
|
[ -f test1 ] || ln -s $(srcdir)/test* .
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
test1 test102 test106 test13 test17 test300 test43 test8 \
|
test1 test104 test13 test19 test21 test3 test5 \
|
||||||
test10 test103 test107 test14 test2 test33 test5 test9 \
|
test10 test105 test14 test2 test22 test300 test6 \
|
||||||
test100 test104 test11 test15 test200 test4 test6 \
|
test100 test106 test15 test20 test23 test33 test7 \
|
||||||
test101 test105 test12 test16 test3 test400 test7 test201 \
|
test101 test107 test16 test200 test24 test4 test8 \
|
||||||
test202
|
test102 test11 test17 test201 test25 test400 test9 \
|
||||||
|
test103 test12 test18 test202 test26 test43
|
||||||
|
75
tests/data/test18
Normal file
75
tests/data/test18
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
<data nocheck=1>
|
||||||
|
HTTP/1.1 200 OK
|
||||||
|
Funny-head: yesyes
|
||||||
|
|
||||||
|
moo
|
||||||
|
</data>
|
||||||
|
<data2>
|
||||||
|
HTTP/1.1 200 OK
|
||||||
|
Funny-head: yesyes
|
||||||
|
|
||||||
|
foo
|
||||||
|
</data2>
|
||||||
|
<data3>
|
||||||
|
HTTP/1.1 200 OK
|
||||||
|
Funny-head: yesyes
|
||||||
|
|
||||||
|
hoo
|
||||||
|
</data3>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<name>
|
||||||
|
multiple requests using {} in URL
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
'%HOSTIP:%HOSTPORT/{18,180002,180003}'
|
||||||
|
</command>
|
||||||
|
</test>
|
||||||
|
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<strip>
|
||||||
|
^User-Agent:.*
|
||||||
|
</strip>
|
||||||
|
<protocol>
|
||||||
|
GET /18 HTTP/1.1
|
||||||
|
User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
|
||||||
|
Host: 127.0.0.1:8999
|
||||||
|
Pragma: no-cache
|
||||||
|
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
|
||||||
|
|
||||||
|
GET /180002 HTTP/1.1
|
||||||
|
User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
|
||||||
|
Host: 127.0.0.1:8999
|
||||||
|
Pragma: no-cache
|
||||||
|
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
|
||||||
|
|
||||||
|
GET /180003 HTTP/1.1
|
||||||
|
User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
|
||||||
|
Host: 127.0.0.1:8999
|
||||||
|
Pragma: no-cache
|
||||||
|
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
|
||||||
|
|
||||||
|
</protocol>
|
||||||
|
<stdout>
|
||||||
|
--_curl_--127.0.0.1:8999/18
|
||||||
|
HTTP/1.1 200 OK
|
||||||
|
Funny-head: yesyes
|
||||||
|
|
||||||
|
moo
|
||||||
|
--_curl_--127.0.0.1:8999/180002
|
||||||
|
HTTP/1.1 200 OK
|
||||||
|
Funny-head: yesyes
|
||||||
|
|
||||||
|
foo
|
||||||
|
--_curl_--127.0.0.1:8999/180003
|
||||||
|
HTTP/1.1 200 OK
|
||||||
|
Funny-head: yesyes
|
||||||
|
|
||||||
|
hoo
|
||||||
|
</stdout>
|
||||||
|
</verify>
|
22
tests/data/test19
Normal file
22
tests/data/test19
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
<data>
|
||||||
|
</data>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<name>
|
||||||
|
attempt connect to non-listening socket
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
%HOSTIP:60000
|
||||||
|
</command>
|
||||||
|
</test>
|
||||||
|
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<errorcode>
|
||||||
|
7
|
||||||
|
</errorcode>
|
||||||
|
</verify>
|
22
tests/data/test20
Normal file
22
tests/data/test20
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
<data>
|
||||||
|
</data>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<name>
|
||||||
|
attempt connect to non-existing host name
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
non-existing-and-weeeeeeirdname
|
||||||
|
</command>
|
||||||
|
</test>
|
||||||
|
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<errorcode>
|
||||||
|
6
|
||||||
|
</errorcode>
|
||||||
|
</verify>
|
22
tests/data/test21
Normal file
22
tests/data/test21
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
<data>
|
||||||
|
</data>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<name>
|
||||||
|
use curl with multiple request methods
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
-I -X FOOO localhost
|
||||||
|
</command>
|
||||||
|
</test>
|
||||||
|
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<errorcode>
|
||||||
|
2
|
||||||
|
</errorcode>
|
||||||
|
</verify>
|
34
tests/data/test22
Normal file
34
tests/data/test22
Normal file
File diff suppressed because one or more lines are too long
22
tests/data/test23
Normal file
22
tests/data/test23
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
<data>
|
||||||
|
</data>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<name>
|
||||||
|
unsupported protocol:// URL
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
htfp://%HOSTIP:%HOSTPORT/none.htfml
|
||||||
|
</command>
|
||||||
|
</test>
|
||||||
|
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<errorcode>
|
||||||
|
1
|
||||||
|
</errorcode>
|
||||||
|
</verify>
|
37
tests/data/test24
Normal file
37
tests/data/test24
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
<data nocheck=1>
|
||||||
|
HTTP/1.0 404 BAD BOY
|
||||||
|
Content-Type: text/html
|
||||||
|
|
||||||
|
This silly page doesn't reaaaaaly exist so you should not get it.
|
||||||
|
</data>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<name>
|
||||||
|
HTTP GET fail silently on HTTP error return
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
http://%HOSTIP:%HOSTPORT/24 --fail
|
||||||
|
</command>
|
||||||
|
</test>
|
||||||
|
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<strip>
|
||||||
|
^User-Agent: curl/.*
|
||||||
|
</strip>
|
||||||
|
<protocol>
|
||||||
|
GET /24 HTTP/1.1
|
||||||
|
User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
|
||||||
|
Host: 127.0.0.1:8999
|
||||||
|
Pragma: no-cache
|
||||||
|
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
|
||||||
|
|
||||||
|
</protocol>
|
||||||
|
<errorcode>
|
||||||
|
22
|
||||||
|
</errorcode>
|
||||||
|
</verify>
|
109
tests/data/test25
Normal file
109
tests/data/test25
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
<data>
|
||||||
|
HTTP/1.1 301 This is a weirdo text message
|
||||||
|
Server: test-server/fake
|
||||||
|
Location: data/reply/25
|
||||||
|
Content-Length: 32
|
||||||
|
Connection: close
|
||||||
|
|
||||||
|
Redirect to the same URL again!
|
||||||
|
</data>
|
||||||
|
<datacheck>
|
||||||
|
HTTP/1.1 301 This is a weirdo text message
|
||||||
|
Server: test-server/fake
|
||||||
|
Location: data/reply/25
|
||||||
|
Content-Length: 32
|
||||||
|
Connection: close
|
||||||
|
|
||||||
|
HTTP/1.1 301 This is a weirdo text message
|
||||||
|
Server: test-server/fake
|
||||||
|
Location: data/reply/25
|
||||||
|
Content-Length: 32
|
||||||
|
Connection: close
|
||||||
|
|
||||||
|
HTTP/1.1 301 This is a weirdo text message
|
||||||
|
Server: test-server/fake
|
||||||
|
Location: data/reply/25
|
||||||
|
Content-Length: 32
|
||||||
|
Connection: close
|
||||||
|
|
||||||
|
HTTP/1.1 301 This is a weirdo text message
|
||||||
|
Server: test-server/fake
|
||||||
|
Location: data/reply/25
|
||||||
|
Content-Length: 32
|
||||||
|
Connection: close
|
||||||
|
|
||||||
|
HTTP/1.1 301 This is a weirdo text message
|
||||||
|
Server: test-server/fake
|
||||||
|
Location: data/reply/25
|
||||||
|
Content-Length: 32
|
||||||
|
Connection: close
|
||||||
|
|
||||||
|
HTTP/1.1 301 This is a weirdo text message
|
||||||
|
Server: test-server/fake
|
||||||
|
Location: data/reply/25
|
||||||
|
Content-Length: 32
|
||||||
|
Connection: close
|
||||||
|
|
||||||
|
</datacheck>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<name>
|
||||||
|
looping HTTP Location: following with --max-redirs, no persistance
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
http://%HOSTIP:%HOSTPORT/want/25 -L --max-redirs 5
|
||||||
|
</command>
|
||||||
|
</test>
|
||||||
|
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<strip>
|
||||||
|
^User-Agent: curl/.*
|
||||||
|
</strip>
|
||||||
|
<protocol>
|
||||||
|
GET /want/25 HTTP/1.1
|
||||||
|
User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
|
||||||
|
Host: 127.0.0.1:8999
|
||||||
|
Pragma: no-cache
|
||||||
|
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
|
||||||
|
|
||||||
|
GET /want/data/reply/25 HTTP/1.1
|
||||||
|
User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
|
||||||
|
Host: 127.0.0.1:8999
|
||||||
|
Pragma: no-cache
|
||||||
|
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
|
||||||
|
|
||||||
|
GET /want/data/reply/data/reply/25 HTTP/1.1
|
||||||
|
User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
|
||||||
|
Host: 127.0.0.1:8999
|
||||||
|
Pragma: no-cache
|
||||||
|
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
|
||||||
|
|
||||||
|
GET /want/data/reply/data/reply/data/reply/25 HTTP/1.1
|
||||||
|
User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
|
||||||
|
Host: 127.0.0.1:8999
|
||||||
|
Pragma: no-cache
|
||||||
|
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
|
||||||
|
|
||||||
|
GET /want/data/reply/data/reply/data/reply/data/reply/25 HTTP/1.1
|
||||||
|
User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
|
||||||
|
Host: 127.0.0.1:8999
|
||||||
|
Pragma: no-cache
|
||||||
|
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
|
||||||
|
|
||||||
|
GET /want/data/reply/data/reply/data/reply/data/reply/data/reply/25 HTTP/1.1
|
||||||
|
User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
|
||||||
|
Host: 127.0.0.1:8999
|
||||||
|
Pragma: no-cache
|
||||||
|
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
|
||||||
|
|
||||||
|
</protocol>
|
||||||
|
|
||||||
|
<errorcode>
|
||||||
|
47
|
||||||
|
</errorcode>
|
||||||
|
</verify>
|
32
tests/data/test26
Normal file
32
tests/data/test26
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
<data>
|
||||||
|
HTTP/1.1 200 Mooo
|
||||||
|
Server: test-server/fake
|
||||||
|
Connection: close
|
||||||
|
|
||||||
|
*flopp*
|
||||||
|
</data>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<name>
|
||||||
|
specify more -o than URLs
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
http://%HOSTIP:%HOSTPORT/want/26 -o - -o -
|
||||||
|
</command>
|
||||||
|
</test>
|
||||||
|
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<protocol>
|
||||||
|
GET /want/26 HTTP/1.1
|
||||||
|
User-Agent: curl/7.8.1-pre3 (sparc-sun-solaris2.7) libcurl 7.8.1-pre3 (OpenSSL 0.9.6a) (krb4 enabled)
|
||||||
|
Host: 127.0.0.1:8999
|
||||||
|
Pragma: no-cache
|
||||||
|
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
|
||||||
|
|
||||||
|
</protocol>
|
||||||
|
</verify>
|
Loading…
Reference in New Issue
Block a user