]> rtime.felk.cvut.cz Git - hornmich/skoda-qr-demo.git/blob - QRScanner/mobile/jni/thirdparty/curl/tests/FILEFORMAT
Add MuPDF native source codes
[hornmich/skoda-qr-demo.git] / QRScanner / mobile / jni / thirdparty / curl / tests / FILEFORMAT
1  The test suite's file format is very simple and extensible, closely
2 resembling XML. All data for a single test case resides in a single
3 ASCII file. Labels mark the beginning and the end of all sections, and each
4 label must be written in its own line.  Comments are either XML-style
5 (enclosed with <!-- and -->) or C-style (beginning with #) and must appear
6 on their own lines and not alongside actual test data.  Most test data files
7 are syntactically valid XML, although a few files are not (lack of
8 support for character entities and the preservation of CR/LF characters at
9 the end of lines are the biggest differences).
10
11  The file begins with a 'testcase' tag, which encompasses the remainder of
12 the file.
13
14 <testcase>
15
16  Each file is split up in three main sections: reply, client and verify. The
17 reply section is used for the server to know what to send as a reply for the
18 requests curl sends, the client section defines how the client should behave
19 while the verify section defines how to verify that the data stored after a
20 command has been run ended up correctly.
21
22  Each main section has a number of available subsections that can be
23 specified, that will be checked/used if specified. This document includes all
24 the subsections currently supported.
25
26 Main sections are 'info', 'reply', 'client' and 'verify'.
27
28 <info>
29 <keywords>
30 A newline-separated list of keywords describing what this test case uses and
31 tests. Try to use an already used keyword.  These keywords will be used for
32 statistical/informational purposes and for choosing or skipping classes
33 of tests.  "Keywords" must begin with an alphabetic character, "-", "["
34 or "{" and may actually consist of multiple words separated by spaces
35 which are treated together as a single identifier.
36 </keywords>
37 </info>
38
39 <reply>
40 <data [nocheck="yes"] [sendzero="yes"] [base64="yes"]>
41 data to be sent to the client on its request and later verified that it arrived
42 safely. Set nocheck="yes" to prevent the test script from verifying the arrival
43 of this data.
44
45 If the data contains 'swsclose' anywhere within the start and end tag, and
46 this is a HTTP test, then the connection will be closed by the server after
47 this response is sent. If not, the connection will be kept persistent.
48
49 If the data contains 'swsbounce' anywhere within the start and end tag, the
50 HTTP server will detect if this is a second request using the same test and
51 part number and will then increase the part number with one. This is useful
52 for auth tests and similar.
53
54 'sendzero' set to yes means that the (FTP) server will "send" the data even if
55 the size is zero bytes. Used to verify curl's behaviour on zero bytes
56 transfers.
57
58 'base64' set to yes means that the data provided in the test-file is a chunk
59 of data encoded with base64. It is the only way a test case can contain binary
60 data. (This attribute can in fact be used on any section, but it doesn't make
61 much sense for other sections than "data").
62 </data>
63 <dataNUM>
64 Send back this contents instead of the <data> one. The num is set by:
65 A) The test number in the request line is >10000 and this is the remainder
66 of [test case number]%10000.
67 B) The request was HTTP and included digest details, which adds 1000 to NUM
68 C) If a HTTP request is NTLM type-1, it adds 1001 to num
69 D) If a HTTP request is NTLM type-3, it adds 1002 to num
70 E) If a HTTP request is Basic and num is already >=1000, it adds 1 to num
71
72 Dynamically changing num in this way allows the test harness to be used to
73 test authentication negotiation where several different requests must be sent
74 to complete a transfer. The response to each request is found in its own data
75 section.  Validating the entire negotiation sequence can be done by
76 specifying a datacheck section.
77 </dataNUM>
78 <connect>
79 The connect section is used instead of the 'data' for all CONNECT
80 requests. The remainder of the rules for the data section then apply but with
81 a connect prefix.
82 </connect>
83 <datacheck [nonewline="yes"]>
84 if the data is sent but this is what should be checked afterwards. If
85 'nonewline' is set, we will cut off the trailing newline of this given data
86 before comparing with the one actually received by the client
87 </datacheck>
88 <size>
89 number to return on a ftp SIZE command (set to -1 to make this command fail)
90 </size>
91 <mdtm>
92 what to send back if the client sends a (FTP) MDTM command, set to -1 to
93 have it return that the file doesn't exist
94 </mdtm>
95 <postcmd>
96 special purpose server-command to control its behavior *after* the
97 reply is sent
98 For HTTP/HTTPS, these are supported:
99
100 wait [secs]
101  - Pause for the given time
102 </postcmd>
103 <servercmd>
104 Special-commands for the server.
105 For FTP/SMTP/POP/IMAP, these are supported:
106
107 REPLY [command] [return value] [response string]
108  - Changes how the server responds to the [command]. [response string] is
109    evaluated as a perl string, so it can contain embedded \r\n, for example.
110    There's a special [command] named "welcome" (without quotes) which is the
111    string sent immediately on connect as a welcome.
112 COUNT [command] [num]
113  - Do the REPLY change for [command] only [num] times and then go back to the
114    built-in approach
115 DELAY [command] [secs]
116  - Delay responding to this command for the given time
117 RETRWEIRDO
118  - Enable the "weirdo" RETR case when multiple response lines appear at once
119    when a file is transfered
120 RETRNOSIZE
121  - Make sure the RETR response doesn't contain the size of the file
122 NOSAVE
123  - Don't actually save what is received
124 SLOWDOWN
125  - Send FTP responses with 0.01 sec delay between each byte
126 PASVBADIP
127  - makes PASV send back an illegal IP in its 227 response
128
129 For HTTP/HTTPS:
130 auth_required   if this is set and a POST/PUT is made without auth, the
131                 server will NOT wait for the full request body to get sent
132 idle            do nothing after receiving the request, just "sit idle"
133 stream          continuously send data to the client, never-ending
134 writedelay: [secs] delay this amount between reply packets
135 pipe: [num]     tell the server to expect this many HTTP requests before
136                 sending back anything, to allow pipelining tests
137 skip: [num]     instructs the server to ignore reading this many bytes from a PUT
138                 or POST request
139
140 rtp: part [num] channel [num] size [num]
141                stream a fake RTP packet for the given part on a chosen channel
142                with the given payload size
143
144 connection-monitor When used, this will log [DISCONNECT] to the server.input
145                log when the connection is disconnected.
146
147 </servercmd>
148 </reply>
149
150 <client>
151
152 <server>
153 What server(s) this test case requires/uses:
154
155 file
156 ftp
157 ftp-ipv6
158 ftps
159 http
160 http-ipv6
161 https
162 none
163 scp
164 sftp
165 socks4
166 socks5
167 rtsp
168 rtsp-ipv6
169 imap
170 pop3
171 smtp
172 httptls+srp
173 httptls+srp-ipv6
174 http-proxy
175
176 Give only one per line.  This subsection is mandatory.
177 </server>
178
179 <features>
180 A list of features that MUST be present in the client/library for this test to
181 be able to run (if these features are not present, the test will be
182 SKIPPED). Features testable here are:
183
184 axTLS
185 crypto
186 getrlimit
187 GnuTLS
188 idn
189 ipv6
190 large_file
191 libz
192 NSS
193 NTLM
194 OpenSSL
195 SSL
196 socks
197 unittest
198 debug
199 TLS-SRP
200 Metalink
201 TrackMemory
202
203 as well as each protocol that curl supports.  A protocol only needs to be
204 specified if it is different from the server (useful when the server
205 is 'none').
206 </features>
207
208 <killserver>
209 Using the same syntax as in <server> but when mentioned here these servers
210 are explicitly KILLED when this test case is completed. Only use this if there
211 is no other alternatives. Using this of course requires subsequent tests to
212 restart servers.
213 </killserver>
214
215 <precheck>
216 A command line that if set gets run by the test script before the test. If an
217 output is displayed by the command or if the return code is non-zero, the test
218 will be skipped and the (single-line) output will be displayed as reason for
219 not running the test.  Variables are substituted as in the <command> section.
220 </precheck>
221
222 <postcheck>
223 A command line that if set gets run by the test script after the test. If
224 the command exists with a non-zero status code, the test will be considered
225 to have failed. Variables are substituted as in the <command> section.
226 </postcheck>
227
228 <tool>
229 Name of tool to use instead of "curl". This tool must be built and exist
230 either in the libtest/ directory (if the tool starts with 'lib') or in the
231 unit/ directory (if the tool starts with 'unit').
232 </tool>
233
234 <name>
235 test case description
236 </name>
237
238 <setenv>
239 variable1=contents1
240 variable2=contents2
241
242 Set the given environment variables to the specified value before the actual
243 command is run. They are cleared again after the command has been run.
244 Variables are first substituted as in the <command> section.
245 </setenv>
246
247 <command [option="no-output/no-include"] [timeout="secs"] [delay="secs"]
248          [type="perl"]>
249 command line to run, there's a bunch of %variables that get replaced
250 accordingly.
251
252 Note that the URL that gets passed to the server actually controls what data
253 that is returned. The last slash in the URL must be followed by a number. That
254 number (N) will be used by the test-server to load test case N and return the
255 data that is defined within the <reply><data></data></reply> section.
256
257 If there's no test number found above, the HTTP test server will use the
258 number following the last dot in the given hostname (made so that a CONNECT
259 can still pass on test number) so that "foo.bar.123" gets treated as test case
260 123. Alternatively, if an ipv6-address is provided to CONNECT, the last
261 hexadecimal group in the address will be used as the test numer! For example
262 the address "[1234::ff]" would be treated as test case 255.
263
264 Set type="perl" to write the test case as a perl script. It implies that
265 there's no memory debugging and valgrind gets shut off for this test.
266
267 Set option="no-output" to prevent the test script to slap on the --output
268 argument that directs the output to a file. The --output is also not added if
269 the verify/stdout section is used.
270
271 Set option="no-include" to prevent the test script to slap on the --include
272 argument.
273
274 Set timeout="secs" to override default server logs advisor read lock timeout.
275 This timeout is used by the test harness, once that the command has completed
276 execution, to wait for the test server to write out server side log files and
277 remove the lock that advised not to read them. The "secs" parameter is the not
278 negative integer number of seconds for the timeout. This 'timeout' attribute
279 is documented for completeness sake, but is deep test harness stuff and only
280 needed for very singular and specific test cases. Avoid using it.
281
282 Set delay="secs" to introduce a time delay once that the command has completed
283 execution and before the <postcheck> section runs. The "secs" parameter is the
284 not negative integer number of seconds for the delay. This 'delay' attribute
285 is intended for very specific test cases, and normally not needed.
286
287 Available substitute variables include:
288 %CLIENTIP   - IPv4 address of the client running curl
289 %CLIENT6IP  - IPv6 address of the client running curl
290 %HOSTIP    - IPv4 address of the host running this test
291 %HTTPPORT  - Port number of the HTTP server
292 %HOST6IP   - IPv6 address of the host running this test
293 %HTTP6PORT - IPv6 port number of the HTTP server
294 %HTTPSPORT - Port number of the HTTPS server
295 %PROXYPORT - Port number of the HTTP proxy
296 %FTPPORT   - Port number of the FTP server
297 %FTP6PORT  - IPv6 port number of the FTP server
298 %FTPSPORT  - Port number of the FTPS server
299 %FTP2PORT  - Port number of the FTP server 2
300 %FTPTIME2  - Timeout in seconds that should be just sufficient to receive
301              a response from the test FTP server
302 %TFTPPORT  - Port number of the TFTP server
303 %TFTP6PORT - IPv6 port number of the TFTP server
304 %SSHPORT   - Port number of the SCP/SFTP server
305 %SOCKSPORT - Port number of the SOCKS4/5 server
306 %RTSPPORT  - Port number of the RTSP server
307 %RTSP6PORT - IPv6 port number of the RTSP server
308 %SRCDIR    - Full path to the source dir
309 %PWD       - Current directory
310 %CURL      - Path to the curl executable
311 %USER      - Login ID of the user running the test
312 </command>
313
314 <file name="log/filename">
315 This creates the named file with this content before the test case is run,
316 which is useful if the test case needs a file to act on.
317 Variables are substituted on the contents of the file as in the <command>
318 section.
319 </file>
320
321 <stdin [nonewline="yes"]>
322 Pass this given data on stdin to the tool.
323
324 If 'nonewline' is set, we will cut off the trailing newline of this given data
325 before comparing with the one actually received by the client
326 </stdin>
327
328 </client>
329
330 <verify>
331 <errorcode>
332 numerical error code curl is supposed to return. Specify a list of accepted
333 error codes by separating multiple numbers with comma. See test 237 for an
334 example.
335 </errorcode>
336 <strip>
337 One regex per line that is removed from the protocol dumps before the
338 comparison is made. This is very useful to remove dependencies on dynamically
339 changing protocol data such as port numbers or user-agent strings.
340 </strip>
341 <strippart>
342 One perl op per line that operates on the protocol dump. This is pretty
343 advanced. Example: "s/^EPRT .*/EPRT stripped/"
344 </strippart>
345
346 <protocol [nonewline="yes"]>
347
348 the protocol dump curl should transmit, if 'nonewline' is set, we will cut off
349 the trailing newline of this given data before comparing with the one actually
350 sent by the client Variables are substituted as in the <command> section.  The
351 <strip> and <strippart> rules are applied before comparisons are made.
352
353 </protocol>
354
355 <proxy [nonewline="yes"]>
356
357 The protocol dump curl should transmit to a HTTP proxy (when the http-proxy
358 server is used), if 'nonewline' is set, we will cut off the trailing newline
359 of this given data before comparing with the one actually sent by the client
360 Variables are substituted as in the <command> section. The <strip> and
361 <strippart> rules are applied before comparisons are made.
362
363 </proxy>
364
365 <stdout [mode="text"] [nonewline="yes"]>
366 This verifies that this data was passed to stdout.  Variables are
367 substituted as in the <command> section.
368
369 Use the mode="text" attribute if the output is in text mode on platforms that
370 have a text/binary difference.
371
372 If 'nonewline' is set, we will cut off the trailing newline of this given data
373 before comparing with the one actually received by the client
374 </stdout>
375 <file name="log/filename" [mode="text"]>
376 The file's contents must be identical to this after the test is complete.
377 Use the mode="text" attribute if the output is in text mode on platforms that
378 have a text/binary difference.
379 Variables are substituted as in the <command> section.
380 </file>
381 <stripfile>
382 One perl op per line that operates on the file before being compared. This is
383 pretty advanced. Example: "s/^EPRT .*/EPRT stripped/"
384 </stripfile>
385 <upload>
386 the contents of the upload data curl should have sent
387 </upload>
388 <valgrind>
389 disable - disables the valgrind log check for this test
390 </valgrind>
391 </verify>
392
393 </testcase>