xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame^] | 1 | <testcase> |
| 2 | <info> |
| 3 | <keywords> |
| 4 | HTTP |
| 5 | HTTP FORMPOST |
| 6 | config file |
| 7 | </keywords> |
| 8 | </info> |
| 9 | # Server-side |
| 10 | <reply> |
| 11 | <data> |
| 12 | HTTP/1.1 200 OK swsclose |
| 13 | Date: Tue, 09 Nov 2010 14:49:00 GMT |
| 14 | Server: test-server/fake |
| 15 | Content-Length: 11 |
| 16 | |
| 17 | blablabla |
| 18 | |
| 19 | </data> |
| 20 | </reply> |
| 21 | |
| 22 | # Client-side |
| 23 | <client> |
| 24 | <features> |
| 25 | Mime |
| 26 | </features> |
| 27 | <server> |
| 28 | http |
| 29 | </server> |
| 30 | <name> |
| 31 | HTTP and -F upload in config file |
| 32 | </name> |
| 33 | <stdin> |
| 34 | -F name=daniel |
| 35 | -F tool=curl |
| 36 | -F file=@log/test%TESTNUMBER.txt |
| 37 | user-agent = "" |
| 38 | </stdin> |
| 39 | <command> |
| 40 | http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -K - |
| 41 | </command> |
| 42 | # We create this file before the command is invoked! |
| 43 | <file name="log/test%TESTNUMBER.txt"> |
| 44 | foo- |
| 45 | This is a moo- |
| 46 | bar |
| 47 | </file> |
| 48 | </client> |
| 49 | |
| 50 | # Verify data after the test has been "shot" |
| 51 | <verify> |
| 52 | <strip> |
| 53 | ^(Content-Type: multipart/form-data;|------------).* |
| 54 | </strip> |
| 55 | <protocol> |
| 56 | POST /we/want/%TESTNUMBER HTTP/1.1
|
| 57 | Host: %HOSTIP:%HTTPPORT
|
| 58 | Accept: */*
|
| 59 | Content-Length: 408
|
| 60 | Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763
|
| 61 |
|
| 62 | ------------------------------9ef8d6205763
|
| 63 | Content-Disposition: form-data; name="name"
|
| 64 |
|
| 65 | daniel
|
| 66 | ------------------------------9ef8d6205763
|
| 67 | Content-Disposition: form-data; name="tool"
|
| 68 |
|
| 69 | curl
|
| 70 | ------------------------------9ef8d6205763
|
| 71 | Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt"
|
| 72 | Content-Type: text/plain
|
| 73 |
|
| 74 | foo- |
| 75 | This is a moo- |
| 76 | bar |
| 77 |
|
| 78 | ------------------------------9ef8d6205763--
|
| 79 | </protocol> |
| 80 | </verify> |
| 81 | </testcase> |