test1053 (2734B)
1 <testcase> 2 # Based on test 9 3 <info> 4 <keywords> 5 HTTP 6 HTTP FORMPOST 7 HTTP file upload 8 followlocation 9 </keywords> 10 </info> 11 12 # Server-side 13 <reply> 14 <data> 15 HTTP/1.1 307 Redirect swsclose 16 Date: Thu, 29 Jul 2008 14:49:00 GMT 17 Server: test-server/fake 18 Location: data/%TESTNUMBER0002.txt?coolsite=yes 19 Content-Length: 0 20 Connection: close 21 22 </data> 23 <data2> 24 HTTP/1.1 200 OK swsclose 25 Date: Tue, 09 Nov 2010 14:49:00 GMT 26 Server: test-server/fake 27 Content-Length: 11 28 Connection: close 29 30 blablabla 31 32 </data2> 33 <datacheck> 34 HTTP/1.1 307 Redirect swsclose 35 Date: Thu, 29 Jul 2008 14:49:00 GMT 36 Server: test-server/fake 37 Location: data/%TESTNUMBER0002.txt?coolsite=yes 38 Content-Length: 0 39 Connection: close 40 41 HTTP/1.1 200 OK swsclose 42 Date: Tue, 09 Nov 2010 14:49:00 GMT 43 Server: test-server/fake 44 Content-Length: 11 45 Connection: close 46 47 blablabla 48 49 </datacheck> 50 </reply> 51 52 # Client-side 53 <client> 54 <features> 55 Mime 56 </features> 57 <server> 58 http 59 </server> 60 <name> 61 HTTP RFC1867-type formposting from file with Location: following 62 </name> 63 <command> 64 http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -L -F name=daniel -F tool=curl -F file=@%LOGDIR/test%TESTNUMBER.txt 65 </command> 66 # We create this file before the command is invoked! 67 <file name="%LOGDIR/test%TESTNUMBER.txt"> 68 foo- 69 This is a moo- 70 bar 71 </file> 72 </client> 73 74 # Verify data after the test has been "shot" 75 <verify> 76 <strip> 77 ^(Content-Type: multipart/form-data;|------------).* 78 </strip> 79 <protocol> 80 POST /we/want/%TESTNUMBER HTTP/1.1 81 Host: %HOSTIP:%HTTPPORT 82 User-Agent: curl/%VERSION 83 Accept: */* 84 Content-Length: 434 85 Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763 86 87 ------------------------------9ef8d6205763 88 Content-Disposition: form-data; name="name" 89 90 daniel 91 ------------------------------9ef8d6205763 92 Content-Disposition: form-data; name="tool" 93 94 curl 95 ------------------------------9ef8d6205763 96 Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt" 97 Content-Type: text/plain 98 99 foo- 100 This is a moo- 101 bar 102 103 ------------------------------9ef8d6205763-- 104 POST /we/want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1 105 Host: %HOSTIP:%HTTPPORT 106 User-Agent: curl/%VERSION 107 Accept: */* 108 Content-Length: 434 109 Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763 110 111 ------------------------------9ef8d6205763 112 Content-Disposition: form-data; name="name" 113 114 daniel 115 ------------------------------9ef8d6205763 116 Content-Disposition: form-data; name="tool" 117 118 curl 119 ------------------------------9ef8d6205763 120 Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER.txt" 121 Content-Type: text/plain 122 123 foo- 124 This is a moo- 125 bar 126 127 ------------------------------9ef8d6205763-- 128 </protocol> 129 </verify> 130 </testcase>