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