test163 (1345B)
1 <testcase> 2 <info> 3 <keywords> 4 HTTP 5 HTTP POST 6 </keywords> 7 </info> 8 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: 10 16 17 blablabla 18 </data> 19 </reply> 20 21 # Client-side 22 <client> 23 <features> 24 Mime 25 </features> 26 <server> 27 http 28 </server> 29 <name> 30 HTTP multipart formpost with contents from a file 31 </name> 32 <command> 33 http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F "name=<%LOGDIR/field%TESTNUMBER" -F tool=curl 34 </command> 35 # We create this file before the command is invoked! 36 <file name="%LOGDIR/field%TESTNUMBER"> 37 contents 38 from 39 a 40 file 41 42 newlinens? 43 yes please 44 45 [tab][CR] too 46 </file> 47 </client> 48 49 # Verify data after the test has been "shot" 50 <verify> 51 <strip> 52 ^(Content-Type: multipart/form-data;|------------).* 53 </strip> 54 <protocol> 55 POST /we/want/%TESTNUMBER HTTP/1.1 56 Host: %HOSTIP:%HTTPPORT 57 User-Agent: curl/%VERSION 58 Accept: */* 59 Content-Length: 322 60 Content-Type: multipart/form-data; boundary=----------------------------c2d1767eb6ac 61 62 ------------------------------c2d1767eb6ac 63 Content-Disposition: form-data; name="name" 64 65 contents 66 from 67 a 68 file 69 70 newlinens? 71 yes please 72 73 [tab][CR] too 74 75 ------------------------------c2d1767eb6ac 76 Content-Disposition: form-data; name="tool" 77 78 curl 79 ------------------------------c2d1767eb6ac-- 80 </protocol> 81 </verify> 82 </testcase>