diff options
author | Daniel Stenberg <daniel@haxx.se> | 2001-05-28 12:30:21 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2001-05-28 12:30:21 +0000 |
commit | b6ca1be1cd792e02f3d6d0ba24b1654fcabce569 (patch) | |
tree | e2be97f5512aa232d1409d2d1b09cc4d94c2c3db | |
parent | 20d67917c4443623275c14df53edf7bbcf5b1f90 (diff) | |
download | curl-b6ca1be1cd792e02f3d6d0ba24b1654fcabce569.tar.gz |
test case converted to the new file format
-rw-r--r-- | tests/data/test10 | 56 | ||||
-rw-r--r-- | tests/data/test11 | 64 | ||||
-rw-r--r-- | tests/data/test12 | 44 | ||||
-rw-r--r-- | tests/data/test13 | 34 | ||||
-rw-r--r-- | tests/data/test14 | 34 | ||||
-rw-r--r-- | tests/data/test200 | 31 | ||||
-rw-r--r-- | tests/data/test6 | 36 | ||||
-rw-r--r-- | tests/data/test7 | 49 | ||||
-rw-r--r-- | tests/data/test8 | 47 | ||||
-rw-r--r-- | tests/data/test9 | 60 |
10 files changed, 455 insertions, 0 deletions
diff --git a/tests/data/test10 b/tests/data/test10 new file mode 100644 index 000000000..ef34e8712 --- /dev/null +++ b/tests/data/test10 @@ -0,0 +1,56 @@ +# Server-side +<reply> +<data> +HTTP/1.0 200 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake + +blablabla + +</data> +</reply> + +# Client-side +<client> + <name> +simple HTTP PUT from file + </name> + <command> +http://%HOSTIP:%HOSTPORT/we/want/10 -T log/test10.txt +</command> +<file name="log/test10.txt"> +Weird + file + to + upload +for + testing +the + PUT + feature +</file> +</test> + +# Verify data after the test has been "shot" +<verify> +<strip> +^User-Agent:.* +</strip> +<protocol> +PUT /we/want/10 HTTP/1.1
+Host: 127.0.0.1:8999
+Pragma: no-cache
+Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
+Content-Length: 78
+
+Weird + file + to + upload +for + testing +the + PUT + feature +</protocol> +</verify> diff --git a/tests/data/test11 b/tests/data/test11 new file mode 100644 index 000000000..9a9ccdd8a --- /dev/null +++ b/tests/data/test11 @@ -0,0 +1,64 @@ +# Server-side +<reply> +<data> +HTTP/1.1 301 This is a weirdo text message +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Location: data/110002.txt?coolsite=yes +Connection: close + +This server reply is for testing a simple Location: following + +</data> +<data2> +HTTP/1.1 200 Followed here fine +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake + +If this is received, the location following worked + +</data2> +<datacheck> +HTTP/1.1 301 This is a weirdo text message +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Location: data/110002.txt?coolsite=yes +Connection: close + +HTTP/1.1 200 Followed here fine +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake + +If this is received, the location following worked + +</datacheck> +</reply> + +# Client-side +<client> + <name> +simple HTTP Location: following + </name> + <command> +http://%HOSTIP:%HOSTPORT/want/11 -L +</command> +</test> + +# Verify data after the test has been "shot" +<verify> +<strip> +^User-Agent:.* +</strip> +<protocol> +GET /want/11 HTTP/1.1
+Host: 127.0.0.1:8999
+Pragma: no-cache
+Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
+
+GET /want/data/110002.txt?coolsite=yes HTTP/1.1
+Host: 127.0.0.1:8999
+Pragma: no-cache
+Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
+
+</protocol> +</verify> diff --git a/tests/data/test12 b/tests/data/test12 new file mode 100644 index 000000000..9f105f0cf --- /dev/null +++ b/tests/data/test12 @@ -0,0 +1,44 @@ +# Server-side +<reply> +<data> +HTTP/1.1 206 Partial Content +Date: Mon, 13 Nov 2000 13:41:09 GMT +Server: Apache/1.3.11 (Unix) PHP/3.0.14 +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 101 +Content-Range: bytes 100-200/3527 +Connection: close +Content-Type: text/html + +ink="#ffffff" vlink="#cccccc"> +<table width=100% cellspacing=0 cellpadding=0 border=0> + <tr> 0123456 +</data> +</reply> + +# Client-side +<client> + <name> +HTTP range support + </name> + <command> +http://%HOSTIP:%HOSTPORT/want/12 -r 100-200 +</command> +</test> + +# Verify data after the test has been "shot" +<verify> +<strip> +^User-Agent:.* +</strip> +<protocol> +GET /want/12 HTTP/1.1
+Range: bytes=100-200
+Host: 127.0.0.1:8999
+Pragma: no-cache
+Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
+
+</protocol> +</verify> diff --git a/tests/data/test13 b/tests/data/test13 new file mode 100644 index 000000000..5049946aa --- /dev/null +++ b/tests/data/test13 @@ -0,0 +1,34 @@ +# Server-side +<reply> +<data> +HTTP/1.1 200 Read you +Deleted: suppose we got a header like this! ;-) + +blabla custom request result + +</data> +</reply> + +# Client-side +<client> + <name> +HTTP custom request 'DELETE' + </name> + <command> +http://%HOSTIP:%HOSTPORT/want/13 -X DELETE +</command> +</test> + +# Verify data after the test has been "shot" +<verify> +<strip> +^User-Agent:.* +</strip> +<protocol> +DELETE /want/13 HTTP/1.1
+Host: 127.0.0.1:8999
+Pragma: no-cache
+Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
+
+</protocol> +</verify> diff --git a/tests/data/test14 b/tests/data/test14 new file mode 100644 index 000000000..795a9b4db --- /dev/null +++ b/tests/data/test14 @@ -0,0 +1,34 @@ +# Server-side +<reply> +<data> +HTTP/1.1 200 OK +Server: thebest/1.0 +Connection: close + +</data> +</reply> + +# Client-side +<client> + <name> +HTTP HEAD with Connection: close + </name> + <command> +http://%HOSTIP:%HOSTPORT/want/14 -i --head +</command> +</test> + +# Verify data after the test has been "shot" +<verify> +<strip> +^User-Agent:.* +</strip> +<protocol> +HEAD /want/14 HTTP/1.1
+User-Agent: curl/7.4.2-pre4 (sparc-sun-solaris2.7) libcurl 7.4.2-pre4
+Host: 127.0.0.1:8999
+Pragma: no-cache
+Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
+
+</protocol> +</verify> diff --git a/tests/data/test200 b/tests/data/test200 new file mode 100644 index 000000000..19d44eb16 --- /dev/null +++ b/tests/data/test200 @@ -0,0 +1,31 @@ +# Server-side +<reply> +<data> +foo + bar +bar + foo +moo +</data> +</reply> + +# Client-side +<client> + <name> +file:// with relative path + </name> + <command> +file://log/test200.txt +</command> +<file name="log/test200.txt"> +foo + bar +bar + foo +moo +</file> +</test> + +# Verify data after the test has been "shot" +<verify> +</verify> diff --git a/tests/data/test6 b/tests/data/test6 new file mode 100644 index 000000000..c1bf5b34d --- /dev/null +++ b/tests/data/test6 @@ -0,0 +1,36 @@ +# 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 + +</data> +</reply> + +# Client-side +<client> + <name> +HTTP with simple cookie send + </name> + <command> +http://%HOSTIP:%HOSTPORT/we/want/that/page/6 -b "name=contents;name2=content2" +</command> +</test> + +# Verify data after the test has been "shot" +<verify> +<strip> +^User-Agent:.* +</strip> +<protocol> +GET /we/want/that/page/6 HTTP/1.1
+Cookie: name=contents;name2=content2
+Host: 127.0.0.1:8999
+Pragma: no-cache
+Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
+
+</protocol> +</verify> diff --git a/tests/data/test7 b/tests/data/test7 new file mode 100644 index 000000000..80f7b560c --- /dev/null +++ b/tests/data/test7 @@ -0,0 +1,49 @@ +# 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: foobar=name; domain=127.0.0.1; path=/; +Set-Cookie: mismatch=this; domain=127.0.0.1; path="/silly/"; +Set-Cookie: partmatch=present; domain=.0.0.1; path=/; + +</data> +</reply> + +# Client-side +<client> + <name> +HTTP with cookie parser and header recording + </name> + <command> +http://%HOSTIP:%HOSTPORT/we/want/7 -b none -D log/heads7.txt +</command> +</test> + +# Verify data after the test has been "shot" +<verify> +<strip> +^User-Agent:.* +</strip> +<protocol> +GET /we/want/7 HTTP/1.1
+Host: 127.0.0.1:8999
+Pragma: no-cache
+Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
+
+</protocol> +<file name="log/heads7.txt"> +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: foobar=name; domain=127.0.0.1; path=/; +Set-Cookie: mismatch=this; domain=127.0.0.1; path="/silly/"; +Set-Cookie: partmatch=present; domain=.0.0.1; path=/; + +</file> +</verify> diff --git a/tests/data/test8 b/tests/data/test8 new file mode 100644 index 000000000..d47d4e8f8 --- /dev/null +++ b/tests/data/test8 @@ -0,0 +1,47 @@ +# Server-side +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake + +</data> +</reply> + +# Client-side +<client> + <name> +HTTP with cookie parsing from header file + </name> + <command> +http://%HOSTIP:%HOSTPORT/we/want/8 -b log/heads8.txt +</command> + +# We create this file before the command is invoked! +<file name="log/heads8.txt"> +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: foobar=name; domain=127.0.0.1; path=/; +Set-Cookie: mismatch=this; domain=127.0.0.1; path="/silly/"; +Set-Cookie: partmatch=present; domain=.0.0.1; path=/; + +</file> +</test> + +# Verify data after the test has been "shot" +<verify> +<strip> +^User-Agent:.* +</strip> +<protocol> +GET /we/want/8 HTTP/1.1
+Host: 127.0.0.1:8999
+Pragma: no-cache
+Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
+Cookie: foobar=name; partmatch=present
+
+</protocol> +</verify> diff --git a/tests/data/test9 b/tests/data/test9 new file mode 100644 index 000000000..92978e4d1 --- /dev/null +++ b/tests/data/test9 @@ -0,0 +1,60 @@ +# Server-side +<reply> +<data> +HTTP/1.1 200 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake + +blablabla + +</data> +</reply> + +# Client-side +<client> + <name> +HTTP RFC1867-type formposting + </name> + <command> +http://%HOSTIP:%HOSTPORT/we/want/9 -F name=daniel -F tool=curl -F file=@log/test9.txt +</command> +# We create this file before the command is invoked! +<file name="log/test9.txt"> +foo- +This is a moo- +bar +</file> +</test> + +# Verify data after the test has been "shot" +<verify> +<strip> +^(User-Agent:|Content-Type: multipart/form-data;|--curl).* +</strip> +<protocol> +POST /we/want/9 HTTP/1.1
+Host: 127.0.0.1:8999
+Pragma: no-cache
+Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
+Content-Length: 375
+Content-Type: multipart/form-data; boundary=curluczemxkcWWsxptLlAImrFQHwQ3W
+
+--curluczemxkcWWsxptLlAImrFQHwQ3W
+Content-Disposition: form-data; name="name"
+
+daniel
+--curluczemxkcWWsxptLlAImrFQHwQ3W
+Content-Disposition: form-data; name="tool"
+
+curl
+--curluczemxkcWWsxptLlAImrFQHwQ3W
+Content-Disposition: form-data; name="file"; filename="log/test9.txt"
+Content-Type: text/plain
+
+foo- +This is a moo- +bar +--curluczemxkcWWsxptLlAImrFQHwQ3W--
+
+</protocol> +</verify> |