~ubuntu-branches/ubuntu/wily/nginx/wily-proposed

« back to all changes in this revision

Viewing changes to debian/modules/chunkin-nginx-module/t/error.t

  • Committer: Package Import Robot
  • Author(s): Dmitry Shachnev
  • Date: 2013-05-11 14:47:53 UTC
  • mfrom: (4.3.1 sid)
  • Revision ID: package-import@ubuntu.com-20130511144753-a65vqwrxy58omej4
Tags: 1.4.1-1ubuntu1
* Merge with Debian unstable (LP: #1177919). Remaining changes:
  - debian/conf/sites-available/default:
    + Modify default site configuration file to correct a typo
      that prevented out-of-the-box usability (LP: #1162177).
  - debian/patches/ubuntu-branding.patch:
    + Add ubuntu branding to server_tokens.
* Refresh all patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# vi:filetype=
2
 
 
3
 
use lib 't/lib';
4
 
use Test::Nginx::Socket::Chunkin;
5
 
 
6
 
plan tests => repeat_each() * 2 * blocks();
7
 
 
8
 
no_diff;
9
 
 
10
 
run_tests();
11
 
 
12
 
__DATA__
13
 
 
14
 
=== TEST 1: sanity
15
 
--- config
16
 
    location /main {
17
 
        echo hi;
18
 
    }
19
 
--- request
20
 
GET /main
21
 
--- response_body
22
 
hi
23
 
 
24
 
 
25
 
 
26
 
=== TEST 2: good chunked body
27
 
--- config
28
 
    chunkin on;
29
 
    location /main {
30
 
        echo_request_body;
31
 
    }
32
 
--- more_headers
33
 
Transfer-Encoding: chunked
34
 
--- request eval
35
 
"POST /main
36
 
5\r
37
 
hello\r
38
 
0\r
39
 
\r
40
 
"
41
 
--- response_body chomp
42
 
hello
43
 
 
44
 
 
45
 
 
46
 
=== TEST 3: chunk size too small
47
 
--- config
48
 
    chunkin on;
49
 
    location /main {
50
 
        echo_request_body;
51
 
    }
52
 
--- more_headers
53
 
Transfer-Encoding: chunked
54
 
--- request eval
55
 
"POST /main
56
 
4\r
57
 
hello\r
58
 
0\r
59
 
\r
60
 
"
61
 
--- error_code: 400
62
 
--- response_body_like: 400 Bad Request
63
 
 
64
 
 
65
 
 
66
 
=== TEST 4: chunk size too big
67
 
--- config
68
 
    chunkin on;
69
 
    location /main {
70
 
        echo_request_body;
71
 
    }
72
 
--- more_headers
73
 
Transfer-Encoding: chunked
74
 
--- request eval
75
 
"POST /main
76
 
6\r
77
 
hello\r
78
 
0\r
79
 
\r
80
 
"
81
 
--- response_body_like: 400 Bad Request
82
 
--- error_code: 400
83
 
 
84
 
 
85
 
 
86
 
=== TEST 5: chunk size even bigger
87
 
--- config
88
 
    chunkin on;
89
 
    location /main {
90
 
        echo_request_body;
91
 
    }
92
 
--- more_headers
93
 
Transfer-Encoding: chunked
94
 
--- request eval
95
 
"POST /main
96
 
7\r
97
 
hello\r
98
 
0\r
99
 
\r
100
 
"
101
 
--- response_body_like: 400 Bad Request
102
 
--- error_code: 400
103
 
 
104
 
 
105
 
 
106
 
=== TEST 6: chunk size WAY too big and rejected by ragel DFA
107
 
--- config
108
 
    chunkin on;
109
 
    location /main {
110
 
        echo_request_body;
111
 
    }
112
 
--- more_headers
113
 
Transfer-Encoding: chunked
114
 
--- request eval
115
 
"POST /main
116
 
8\r
117
 
hello\r
118
 
0\r
119
 
\r
120
 
"
121
 
--- error_code: 400
122
 
--- response_body_like: 400 Bad Request
123
 
 
124
 
 
125
 
 
126
 
=== TEST 7: missing LF after data chunk
127
 
--- config
128
 
    chunkin on;
129
 
    location /main {
130
 
        echo_request_body;
131
 
    }
132
 
--- more_headers
133
 
Transfer-Encoding: chunked
134
 
--- request eval
135
 
"POST /main
136
 
5\r
137
 
hello\r0\r
138
 
\r
139
 
"
140
 
--- error_code: 400
141
 
--- response_body_like: 400 Bad Request
142
 
 
143
 
 
144
 
 
145
 
=== TEST 8: missing CR after data chunk
146
 
--- config
147
 
    chunkin on;
148
 
    location /main {
149
 
        echo_request_body;
150
 
    }
151
 
--- more_headers
152
 
Transfer-Encoding: chunked
153
 
--- request eval
154
 
"POST /main
155
 
5\r
156
 
hello
157
 
0\r
158
 
\r
159
 
"
160
 
--- error_code: 400
161
 
--- response_body_like: 400 Bad Request
162
 
 
163
 
 
164
 
 
165
 
=== TEST 9: missing CRLF after data chunk
166
 
--- config
167
 
    chunkin on;
168
 
    location /main {
169
 
        echo_request_body;
170
 
    }
171
 
--- more_headers
172
 
Transfer-Encoding: chunked
173
 
--- request eval
174
 
"POST /main
175
 
5\r
176
 
hello0\r
177
 
\r
178
 
"
179
 
--- error_code: 400
180
 
--- response_body_like: 400 Bad Request
181
 
 
182
 
 
183
 
 
184
 
=== TEST 10: 2 zero chunks
185
 
--- config
186
 
    chunkin on;
187
 
    location /main {
188
 
        echo_request_body;
189
 
    }
190
 
--- more_headers
191
 
Transfer-Encoding: chunked
192
 
--- request eval
193
 
"POST /main
194
 
0\r
195
 
\r
196
 
0\r
197
 
\r
198
 
"
199
 
--- response_body
200
 
 
201
 
 
202
 
 
203
 
=== TEST 11: 1 00 chunk and 1 zero chunk
204
 
--- config
205
 
    chunkin on;
206
 
    location /main {
207
 
        #echo "length: $http_content_length";
208
 
        echo_request_body;
209
 
    }
210
 
--- more_headers
211
 
Transfer-Encoding: chunked
212
 
--- request eval
213
 
"POST /main
214
 
00\r
215
 
\r
216
 
0\r
217
 
\r
218
 
"
219
 
--- response_body
220
 
 
221
 
 
222
 
 
223
 
=== TEST 12: 1 00 chunk and 1 zero chunk
224
 
--- config
225
 
    chunkin on;
226
 
    location /main {
227
 
        echo_request_body;
228
 
    }
229
 
--- more_headers
230
 
Transfer-Encoding: chunked
231
 
--- request eval
232
 
"POST /main
233
 
10\r
234
 
helloworld,hello\r
235
 
00\r
236
 
\r
237
 
0\r
238
 
\r
239
 
"
240
 
--- response_body: helloworld,hello
241
 
 
242
 
 
243
 
 
244
 
=== TEST 13: bad chunk size
245
 
--- config
246
 
    chunkin on;
247
 
    location /main {
248
 
        echo_request_body;
249
 
    }
250
 
--- more_headers
251
 
Transfer-Encoding: chunked
252
 
--- request eval
253
 
"POST /main
254
 
zc\r
255
 
hello\r
256
 
0\r
257
 
\r
258
 
"
259
 
--- response_body_like: 400 Bad Request
260
 
--- error_code: 400
261
 
 
262
 
 
263
 
 
264
 
=== TEST 14: bad chunk size in the 2nd chunk
265
 
--- config
266
 
    chunkin on;
267
 
    location /main {
268
 
        echo_request_body;
269
 
    }
270
 
--- more_headers
271
 
Transfer-Encoding: chunked
272
 
User-Agent: Java Browser
273
 
--- request eval
274
 
"POST /main
275
 
1\r
276
 
a\r
277
 
zc\r
278
 
hello\r
279
 
0\r
280
 
\r
281
 
"
282
 
--- response_body_like: 400 Bad Request
283
 
--- error_code: 400
284
 
 
285
 
 
286
 
 
287
 
=== TEST 15: error near the end of big chunks
288
 
--- config
289
 
    chunkin on;
290
 
    location /main {
291
 
        echo_request_body;
292
 
    }
293
 
--- more_headers
294
 
Transfer-Encoding: chunked
295
 
--- request eval
296
 
"POST /main
297
 
800\r
298
 
".('a'x2047)."\r
299
 
0\r
300
 
\r
301
 
"
302
 
--- response_body_like: 400 Bad Request
303
 
--- error_code: 400
304
 
--- timeout: 10
305