xref: /aosp_15_r20/external/curl/tests/data/test1052 (revision 6236dae45794135f37c4eb022389c904c8b0090d)
1*6236dae4SAndroid Build Coastguard Worker<testcase>
2*6236dae4SAndroid Build Coastguard Worker<info>
3*6236dae4SAndroid Build Coastguard Worker<keywords>
4*6236dae4SAndroid Build Coastguard WorkerHTTP
5*6236dae4SAndroid Build Coastguard WorkerHTTP PUT
6*6236dae4SAndroid Build Coastguard Workerfollowlocation
7*6236dae4SAndroid Build Coastguard Worker</keywords>
8*6236dae4SAndroid Build Coastguard Worker
9*6236dae4SAndroid Build Coastguard Worker</info>
10*6236dae4SAndroid Build Coastguard Worker# Server-side
11*6236dae4SAndroid Build Coastguard Worker<reply>
12*6236dae4SAndroid Build Coastguard Worker<data>
13*6236dae4SAndroid Build Coastguard WorkerHTTP/1.0 301 Redirect swsclose
14*6236dae4SAndroid Build Coastguard WorkerDate: Thu, 29 Jul 2008 14:49:00 GMT
15*6236dae4SAndroid Build Coastguard WorkerServer: test-server/fake
16*6236dae4SAndroid Build Coastguard WorkerLocation: data/%TESTNUMBER0002.txt?coolsite=yes
17*6236dae4SAndroid Build Coastguard WorkerContent-Length: 0
18*6236dae4SAndroid Build Coastguard WorkerConnection: close
19*6236dae4SAndroid Build Coastguard Worker
20*6236dae4SAndroid Build Coastguard Worker</data>
21*6236dae4SAndroid Build Coastguard Worker<data2>
22*6236dae4SAndroid Build Coastguard WorkerHTTP/1.0 200 Followed here fine swsclose
23*6236dae4SAndroid Build Coastguard WorkerDate: Thu, 29 Jul 2008 14:49:00 GMT
24*6236dae4SAndroid Build Coastguard WorkerServer: test-server/fake
25*6236dae4SAndroid Build Coastguard WorkerContent-Length: 51
26*6236dae4SAndroid Build Coastguard Worker
27*6236dae4SAndroid Build Coastguard WorkerIf this is received, the location following worked
28*6236dae4SAndroid Build Coastguard Worker</data2>
29*6236dae4SAndroid Build Coastguard Worker<datacheck>
30*6236dae4SAndroid Build Coastguard WorkerHTTP/1.0 301 Redirect swsclose
31*6236dae4SAndroid Build Coastguard WorkerDate: Thu, 29 Jul 2008 14:49:00 GMT
32*6236dae4SAndroid Build Coastguard WorkerServer: test-server/fake
33*6236dae4SAndroid Build Coastguard WorkerLocation: data/%TESTNUMBER0002.txt?coolsite=yes
34*6236dae4SAndroid Build Coastguard WorkerContent-Length: 0
35*6236dae4SAndroid Build Coastguard WorkerConnection: close
36*6236dae4SAndroid Build Coastguard Worker
37*6236dae4SAndroid Build Coastguard WorkerHTTP/1.0 200 Followed here fine swsclose
38*6236dae4SAndroid Build Coastguard WorkerDate: Thu, 29 Jul 2008 14:49:00 GMT
39*6236dae4SAndroid Build Coastguard WorkerServer: test-server/fake
40*6236dae4SAndroid Build Coastguard WorkerContent-Length: 51
41*6236dae4SAndroid Build Coastguard Worker
42*6236dae4SAndroid Build Coastguard WorkerIf this is received, the location following worked
43*6236dae4SAndroid Build Coastguard Worker</datacheck>
44*6236dae4SAndroid Build Coastguard Worker</reply>
45*6236dae4SAndroid Build Coastguard Worker
46*6236dae4SAndroid Build Coastguard Worker# Client-side
47*6236dae4SAndroid Build Coastguard Worker<client>
48*6236dae4SAndroid Build Coastguard Worker<server>
49*6236dae4SAndroid Build Coastguard Workerhttp
50*6236dae4SAndroid Build Coastguard Worker</server>
51*6236dae4SAndroid Build Coastguard Worker<name>
52*6236dae4SAndroid Build Coastguard WorkerHTTP 1.0 PUT with Location: following
53*6236dae4SAndroid Build Coastguard Worker</name>
54*6236dae4SAndroid Build Coastguard Worker<command>
55*6236dae4SAndroid Build Coastguard Workerhttp://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -0 -L -T %LOGDIR/test%TESTNUMBER.txt
56*6236dae4SAndroid Build Coastguard Worker</command>
57*6236dae4SAndroid Build Coastguard Worker<file name="%LOGDIR/test%TESTNUMBER.txt">
58*6236dae4SAndroid Build Coastguard WorkerWeird
59*6236dae4SAndroid Build Coastguard Worker     file
60*6236dae4SAndroid Build Coastguard Worker         to
61*6236dae4SAndroid Build Coastguard Worker   upload
62*6236dae4SAndroid Build Coastguard Workerfor
63*6236dae4SAndroid Build Coastguard Worker   testing
64*6236dae4SAndroid Build Coastguard Workerthe
65*6236dae4SAndroid Build Coastguard Worker   PUT
66*6236dae4SAndroid Build Coastguard Worker      feature
67*6236dae4SAndroid Build Coastguard Worker</file>
68*6236dae4SAndroid Build Coastguard Worker</client>
69*6236dae4SAndroid Build Coastguard Worker
70*6236dae4SAndroid Build Coastguard Worker# Verify data after the test has been "shot"
71*6236dae4SAndroid Build Coastguard Worker<verify>
72*6236dae4SAndroid Build Coastguard Worker
73*6236dae4SAndroid Build Coastguard Worker# The primary reason libcurl sends the data part twice in this test is that
74*6236dae4SAndroid Build Coastguard Worker# the test HTTP server is blocking until it has read the entire request,
75*6236dae4SAndroid Build Coastguard Worker# including the full request-body before it responds. So in this test the
76*6236dae4SAndroid Build Coastguard Worker# server says 301 and 200 _after_ the entire PUT body has been sent.
77*6236dae4SAndroid Build Coastguard Worker<protocol>
78*6236dae4SAndroid Build Coastguard WorkerPUT /want/%TESTNUMBER HTTP/1.0
79*6236dae4SAndroid Build Coastguard WorkerHost: %HOSTIP:%HTTPPORT
80*6236dae4SAndroid Build Coastguard WorkerUser-Agent: curl/%VERSION
81*6236dae4SAndroid Build Coastguard WorkerAccept: */*
82*6236dae4SAndroid Build Coastguard WorkerContent-Length: 78
83*6236dae4SAndroid Build Coastguard Worker
84*6236dae4SAndroid Build Coastguard WorkerWeird
85*6236dae4SAndroid Build Coastguard Worker     file
86*6236dae4SAndroid Build Coastguard Worker         to
87*6236dae4SAndroid Build Coastguard Worker   upload
88*6236dae4SAndroid Build Coastguard Workerfor
89*6236dae4SAndroid Build Coastguard Worker   testing
90*6236dae4SAndroid Build Coastguard Workerthe
91*6236dae4SAndroid Build Coastguard Worker   PUT
92*6236dae4SAndroid Build Coastguard Worker      feature
93*6236dae4SAndroid Build Coastguard WorkerPUT /want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.0
94*6236dae4SAndroid Build Coastguard WorkerHost: %HOSTIP:%HTTPPORT
95*6236dae4SAndroid Build Coastguard WorkerUser-Agent: curl/%VERSION
96*6236dae4SAndroid Build Coastguard WorkerAccept: */*
97*6236dae4SAndroid Build Coastguard WorkerContent-Length: 78
98*6236dae4SAndroid Build Coastguard Worker
99*6236dae4SAndroid Build Coastguard WorkerWeird
100*6236dae4SAndroid Build Coastguard Worker     file
101*6236dae4SAndroid Build Coastguard Worker         to
102*6236dae4SAndroid Build Coastguard Worker   upload
103*6236dae4SAndroid Build Coastguard Workerfor
104*6236dae4SAndroid Build Coastguard Worker   testing
105*6236dae4SAndroid Build Coastguard Workerthe
106*6236dae4SAndroid Build Coastguard Worker   PUT
107*6236dae4SAndroid Build Coastguard Worker      feature
108*6236dae4SAndroid Build Coastguard Worker</protocol>
109*6236dae4SAndroid Build Coastguard Worker</verify>
110*6236dae4SAndroid Build Coastguard Worker</testcase>
111