FILEFORMAT.md (27407B)
1 <!-- 2 Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3 4 SPDX-License-Identifier: curl 5 --> 6 7 # curl test suite file format 8 9 The curl test suite's file format is simple and extendable, closely resembling 10 XML. All data for a single test case resides in a single ASCII file. Labels 11 mark the beginning and the end of all sections, and each label must be written 12 in its own line. Comments are either XML-style (enclosed with `<!--` and 13 `-->`) or shell script style (beginning with `#`) and must appear on their own 14 lines and not alongside actual test data. Most test data files are 15 syntactically valid XML, although a few files are not (lack of support for 16 character entities and the preservation of CR/LF characters at the end of 17 lines are the biggest differences). 18 19 Each test case source exists as a file matching the format 20 `tests/data/testNUM`, where `NUM` is the unique test number, and must begin 21 with a `testcase` tag, which encompasses the remainder of the file. 22 23 # Preprocessing 24 25 When a test is to be executed, the source file is first preprocessed and 26 variables are substituted by their respective contents and the output version 27 of the test file is stored as `%LOGDIR/testNUM`. That version is what is read 28 and used by the test servers. 29 30 ## Base64 Encoding 31 32 In the preprocess stage, a special instruction can be used to have runtests.pl 33 base64 encode a certain section and insert in the generated output file. This 34 is in particular good for test cases where the test tool is expected to pass 35 in base64 encoded content that might use dynamic information that is unique 36 for this particular test invocation, like the server port number. 37 38 To insert a base64 encoded string into the output, use this syntax: 39 40 %b64[ data to encode ]b64% 41 42 The data to encode can then use any of the existing variables mentioned below, 43 or even percent-encoded individual bytes. As an example, insert the HTTP 44 server's port number (in ASCII) followed by a space and the hexadecimal byte 45 9a: 46 47 %b64[%HTTPPORT %9a]b64% 48 49 ## Hexadecimal decoding 50 51 In the preprocess stage, a special instruction can be used to have runtests.pl 52 generate a sequence of binary bytes. 53 54 To insert a sequence of bytes from a hex encoded string, use this syntax: 55 56 %hex[ %XX-encoded data to decode ]hex% 57 58 Other bytes within the brackets that not percent encoded are inserted as-is. 59 60 For example, to insert the binary octets 0, 1 and 255 into the test file: 61 62 %hex[%00%01%FF]hex% 63 64 ## Repeat content 65 66 In the preprocess stage, a special instruction can be used to have runtests.pl 67 generate a repetitive sequence of bytes. 68 69 To insert a sequence of repeat bytes, use this syntax to make the `<string>` 70 get repeated `<number>` of times. The number has to be 1 or larger and the 71 string may contain `%HH` hexadecimal codes: 72 73 %repeat[<number> x <string>]% 74 75 For example, to insert the word hello 100 times: 76 77 %repeat[100 x hello]% 78 79 ## Insert capped epoch days 80 81 Mostly to test capped cookie expire dates: `%days[NUM]` inserts the number of 82 seconds for the given number of days into the future, aligned to the nearest 83 minute. That is the same calculation the cookie engine uses to cap expiration 84 dates. 85 86 ## Include file 87 88 This instruction allows a test case to include another file. It is helpful to 89 remember that the ordinary variables are expanded before the include happens 90 so `%LOGDIR` and the others can be used in the include line. 91 92 The filename cannot contain `%` as that letter is used to end the name for 93 the include instruction: 94 95 %include filename% 96 97 ## Conditional lines 98 99 Lines in the test file can be made to appear conditionally on a specific 100 feature (see the "features" section below) being set or not set. If the 101 specific feature is present, the following lines are output, otherwise it 102 outputs nothing, until a following else or `endif` clause. Like this: 103 104 %if brotli 105 Accept-Encoding 106 %endif 107 108 It can also check for the inverse condition, so if the feature is *not* set by 109 the use of an exclamation mark: 110 111 %if !brotli 112 Accept-Encoding: not-brotli 113 %endif 114 115 You can also make an "else" clause to get output for the opposite condition, 116 like: 117 118 %if brotli 119 Accept-Encoding: brotli 120 %else 121 Accept-Encoding: nothing 122 %endif 123 124 Nested conditions are supported. 125 126 # Variables 127 128 When the test is preprocessed, a range of "variables" in the test file is 129 replaced by their content at that time. 130 131 Available substitute variables include: 132 133 - `%CLIENT6IP` - IPv6 address of the client running curl (including brackets) 134 - `%CLIENT6IP-NB` - IPv6 address of the client running curl (no brackets) 135 - `%CLIENTIP` - IPv4 address of the client running curl 136 - `%CURL` - Path to the curl executable 137 - `%DATE` - current YYYY-MM-DD date 138 - `%DEV_NULL` - Null device (e.g. /dev/null) 139 - `%FILE_PWD` - Current directory, on Windows prefixed with a slash 140 - `%FTP6PORT` - IPv6 port number of the FTP server 141 - `%FTPPORT` - Port number of the FTP server 142 - `%FTPSPORT` - Port number of the FTPS server 143 - `%FTPTIME2` - Timeout in seconds that should be just sufficient to receive a 144 response from the test FTP server 145 - `%GOPHER6PORT` - IPv6 port number of the Gopher server 146 - `%GOPHERPORT` - Port number of the Gopher server 147 - `%GOPHERSPORT` - Port number of the Gophers server 148 - `%HOST6IP` - IPv6 address of the host running this test 149 - `%HOSTIP` - IPv4 address of the host running this test 150 - `%HTTP2PORT` - Port number of the HTTP/2 server 151 - `%HTTP6PORT` - IPv6 port number of the HTTP server 152 - `%HTTPPORT` - Port number of the HTTP server 153 - `%HTTPSPORT` - Port number of the HTTPS server 154 - `%HTTPSPROXYPORT` - Port number of the HTTPS-proxy 155 - `%HTTPTLS6PORT` - IPv6 port number of the HTTP TLS server 156 - `%HTTPTLSPORT` - Port number of the HTTP TLS server 157 - `%HTTPUNIXPATH` - Path to the Unix socket of the HTTP server 158 - `%IMAP6PORT` - IPv6 port number of the IMAP server 159 - `%IMAPPORT` - Port number of the IMAP server 160 - `%LOGDIR` - Log directory relative to %PWD 161 - `%MQTTPORT` - Port number of the MQTT server 162 - `%NOLISTENPORT` - Port number where no service is listening 163 - `%POP36PORT` - IPv6 port number of the POP3 server 164 - `%POP3PORT` - Port number of the POP3 server 165 - `%PROXYPORT` - Port number of the HTTP proxy 166 - `%PWD` - Current directory 167 - `%RESOLVE` - server/resolve command 168 - `%RTSP6PORT` - IPv6 port number of the RTSP server 169 - `%RTSPPORT` - Port number of the RTSP server 170 - `%SMBPORT` - Port number of the SMB server 171 - `%SMBSPORT` - Port number of the SMBS server 172 - `%SMTP6PORT` - IPv6 port number of the SMTP server 173 - `%SMTPPORT` - Port number of the SMTP server 174 - `%SOCKSPORT` - Port number of the SOCKS4/5 server 175 - `%SOCKSUNIXPATH` - Path to the Unix socket of the SOCKS server 176 - `%SRCDIR` - Full path to the source dir 177 - `%SCP_PWD` - Current directory friendly for the SSH server for the scp:// protocol 178 - `%SFTP_PWD` - Current directory friendly for the SSH server for the sftp:// protocol 179 - `%SSHPORT` - Port number of the SCP/SFTP server 180 - `%SSHSRVMD5` - MD5 of SSH server's public key 181 - `%SSHSRVSHA256` - SHA256 of SSH server's public key 182 - `%TELNETPORT` - Port number of the telnet server 183 - `%TESTNUMBER` - Number of the test case 184 - `%TFTP6PORT` - IPv6 port number of the TFTP server 185 - `%TFTPPORT` - Port number of the TFTP server 186 - `%USER` - Login ID of the user running the test 187 - `%VERNUM` - the version number of the tested curl (without -DEV) 188 - `%VERSION` - the full version number of the tested curl 189 190 # `<testcase>` 191 192 Each test is always specified entirely within the `testcase` tag. Each test 193 case is split up in four main sections: `info`, `reply`, `client` and 194 `verify`. 195 196 - **info** provides information about the test case 197 198 - **reply** is used for the server to know what to send as a reply for the 199 requests curl sends 200 201 - **client** defines how the client should behave 202 203 - **verify** defines how to verify that the data stored after a command has 204 been run ended up correct 205 206 Each main section has a number of available subsections that can be specified, 207 that are checked/used if specified. 208 209 ## `<info>` 210 211 ### `<keywords>` 212 A newline-separated list of keywords describing what this test case uses and 213 tests. Try to use already used keywords. These keywords are used for 214 statistical/informational purposes and for choosing or skipping classes of 215 tests. Keywords must begin with an alphabetic character, `-`, `[` or `{` and 216 may actually consist of multiple words separated by spaces which are treated 217 together as a single identifier. Most keywords are only there to provide a way 218 for users to skip certain classes of tests, if desired, but a few are treated 219 specially by the test harness or build system. 220 221 When running a unit test and the keywords include `unittest`, the `<tool>` 222 section can be left empty to use the standard unit test tool name `unitN` where 223 `N` is the test number. 224 225 The `text-ci` make target automatically skips test with the `flaky` keyword. 226 227 Tests that have strict timing dependencies have the `timing-dependent` keyword. 228 These are intended to eventually be treated specially on CI builds which are 229 often run on overloaded machines with unpredictable timing. 230 231 Tests using non-7-bit-ASCII characters must provide them with `%hex[]` or 232 similar. 233 234 ## `<reply>` 235 236 ### `<data [nocheck="yes"] [sendzero="yes"] [hex="yes"] [nonewline="yes"] [crlf="yes"]>` 237 238 data to be sent to the client on its request and later verified that it 239 arrived safely. Set `nocheck="yes"` to prevent the test script from verifying 240 the arrival of this data. 241 242 If the data contains `swsclose` anywhere within the start and end tag, and 243 this is an HTTP test, then the connection is closed by the server after this 244 response is sent. If not, the connection is kept persistent. 245 246 If the data contains `swsbounce` anywhere within the start and end tag, then 247 the HTTP server overrides the part number response returned for a subsequent 248 request made by the same test to `previous part number + 1`. For example, if a 249 test makes a request which causes the server to return `<data>` that contains 250 keyword `swsbounce` then for the next response it ignores the requested part 251 number and instead returns `<data1>`. And if `<data1>` contains keyword 252 `swsbounce` then the next response is `<data2>` and so on. This is useful for 253 auth tests and similar. 254 255 `sendzero=yes` means that the (FTP) server "sends" the data even if the size 256 is zero bytes. Used to verify curl's behavior on zero bytes transfers. 257 258 `hex=yes` means that the data is a sequence of hex pairs. It gets decoded and 259 used as "raw" data. 260 261 `nonewline=yes` means that the last byte (the trailing newline character) 262 should be cut off from the data before sending or comparing it. 263 264 `crlf=yes` forces *header* newlines to become CRLF even if not written so in 265 the source file. Note that this makes runtests.pl parse and "guess" what is a 266 header and what is not in order to apply the CRLF line endings appropriately. 267 268 For FTP file listings, the `<data>` section is be used *only* if you make sure 269 that there has been a CWD done first to a directory named `test-[NUM]` where 270 `NUM` is the test case number. Otherwise the ftp server cannot know from which 271 test file to load the list content. 272 273 ### `<dataNUM [crlf="yes"]>` 274 275 Send back this contents instead of the `<data>` one. The `NUM` is set by: 276 277 - The test number in the request line is >10000 and this is the remainder 278 of [test case number]%10000. 279 - The request was HTTP and included digest details, which adds 1000 to `NUM` 280 - If an HTTP request is NTLM type-1, it adds 1001 to `NUM` 281 - If an HTTP request is NTLM type-3, it adds 1002 to `NUM` 282 - If an HTTP request is Basic and `NUM` is already >=1000, it adds 1 to `NUM` 283 - If an HTTP request is Negotiate, `NUM` gets incremented by one for each 284 request with Negotiate authorization header on the same test case. 285 286 Dynamically changing `NUM` in this way allows the test harness to be used to 287 test authentication negotiation where several different requests must be sent 288 to complete a transfer. The response to each request is found in its own data 289 section. Validating the entire negotiation sequence can be done by specifying 290 a `datacheck` section. 291 292 ### `<connect>` 293 The connect section is used instead of the 'data' for all CONNECT 294 requests. The remainder of the rules for the data section then apply but with 295 a connect prefix. 296 297 ### `<socks>` 298 Address type and address details as logged by the SOCKS proxy. 299 300 ### `<datacheck [mode="text"] [nonewline="yes"] [crlf="yes"]>` 301 if the data is sent but this is what should be checked afterwards. If 302 `nonewline=yes` is set, runtests cuts off the trailing newline from the data 303 before comparing with the one actually received by the client. 304 305 Use the `mode="text"` attribute if the output is in text mode on platforms 306 that have a text/binary difference. 307 308 ### `<datacheckNUM [nonewline="yes"] [mode="text"] [crlf="yes"]>` 309 The contents of numbered `datacheck` sections are appended to the non-numbered 310 one. 311 312 ### `<size>` 313 number to return on an ftp SIZE command (set to -1 to make this command fail) 314 315 ### `<mdtm>` 316 what to send back if the client sends a (FTP) `MDTM` command, set to -1 to 317 have it return that the file does not exist 318 319 ### `<postcmd>` 320 special purpose server-command to control its behavior *after* the 321 reply is sent 322 For HTTP/HTTPS, these are supported: 323 324 `wait [secs]` - Pause for the given time 325 326 ### `<servercmd>` 327 Special-commands for the server. 328 329 The first line of this file is always set to `Testnum [number]` by the test 330 script, to allow servers to read that to know what test the client is about to 331 issue. 332 333 #### For FTP/SMTP/POP/IMAP 334 335 - `REPLY [command] [return value] [response string]` - Changes how the server 336 responds to the [command]. [response string] is evaluated as a perl string, 337 so it can contain embedded \r\n, for example. There is a special [command] 338 named "welcome" (without quotes) which is the string sent immediately on 339 connect as a welcome. 340 - `REPLYLF` (like above but sends the response terminated with LF-only and not 341 CRLF) 342 - `COUNT [command] [num]` - Do the `REPLY` change for `[command]` only `[num]` 343 times and then go back to the built-in approach 344 - `DELAY [command] [secs]` - Delay responding to this command for the given 345 time 346 - `RETRWEIRDO` - Enable the "weirdo" RETR case when multiple response lines 347 appear at once when a file is transferred 348 - `RETRNOSIZE` - Make sure the RETR response does not contain the size of the 349 file 350 - `RETRSIZE [size]` - Force RETR response to contain the specified size 351 - `NOSAVE` - Do not actually save what is received 352 - `SLOWDOWN` - Send FTP responses with 0.01 sec delay between each byte 353 - `SLOWDOWNDATA` - Send FTP responses with 0.01 sec delay between each data 354 byte 355 - `PASVBADIP` - makes PASV send back an illegal IP in its 227 response 356 - `CAPA [capabilities]` - Enables support for and specifies a list of space 357 separated capabilities to return to the client for the IMAP `CAPABILITY`, 358 POP3 `CAPA` and SMTP `EHLO` commands 359 - `AUTH [mechanisms]` - Enables support for SASL authentication and specifies 360 a list of space separated mechanisms for IMAP, POP3 and SMTP 361 - `STOR [msg]` respond with this instead of default after `STOR` 362 363 #### For HTTP/HTTPS 364 365 - `auth_required` if this is set and a POST/PUT is made without auth, the 366 server does NOT wait for the full request body to get sent 367 - `delay: [msecs]` - delay this amount after connection 368 - `idle` - do nothing after receiving the request, just "sit idle" 369 - `stream` - continuously send data to the client, never-ending 370 - `writedelay: [msecs]` delay this amount between reply packets 371 - `skip: [num]` - instructs the server to ignore reading this many bytes from 372 a PUT or POST request 373 - `rtp: part [num] channel [num] size [num]` - stream a fake RTP packet for 374 the given part on a chosen channel with the given payload size 375 - `connection-monitor` - When used, this logs `[DISCONNECT]` to the 376 `server.input` log when the connection is disconnected. 377 - `upgrade` - when an HTTP upgrade header is found, the server upgrades to 378 http2 379 - `swsclose` - instruct server to close connection after response 380 - `no-expect` - do not read the request body if Expect: is present 381 382 #### For TFTP 383 `writedelay: [secs]` delay this amount between reply packets (each packet 384 being 512 bytes payload) 385 386 ### `<dns>` 387 388 Commands for the test DNS server. 389 390 - `A: [dotted ipv4 address]` - set IPv4 address to return 391 - `AAAA: [numerical IPv6 address]` - set IPv6 address to return, with or 392 without `[]` 393 394 ## `<client>` 395 396 ### `<server>` 397 What server(s) this test case requires/uses. Available servers: 398 399 - `dict` 400 - `file` 401 - `ftp` 402 - `ftp-ipv6` 403 - `ftps` 404 - `gopher` 405 - `gopher-ipv6` 406 - `gophers` 407 - `http` 408 - `http/2` 409 - `http-ipv6` 410 - `http-proxy` 411 - `https` 412 - `https-proxy` 413 - `https-mtls` 414 - `httptls+srp` 415 - `httptls+srp-ipv6` 416 - `http-unix` 417 - `imap` 418 - `mqtt` 419 - `none` 420 - `pop3` 421 - `rtsp` 422 - `rtsp-ipv6` 423 - `scp` 424 - `sftp` 425 - `smb` 426 - `smtp` 427 - `socks4` 428 - `socks5` 429 - `socks5unix` 430 - `telnet` 431 - `tftp` 432 433 Give only one per line. This subsection is mandatory (use `none` if no servers 434 are required). Servers that require a special server certificate can have the 435 PEM certificate filename (found in the `certs` directory) appended to the 436 server name separated by a space. 437 438 ### `<features>` 439 A list of features that MUST be present in the client/library for this test to 440 be able to run. If a required feature is not present then the test is SKIPPED. 441 442 Alternatively a feature can be prefixed with an exclamation mark to indicate a 443 feature is NOT required. If the feature is present then the test is SKIPPED. 444 445 Features testable here are: 446 447 - `--libcurl` 448 - `alt-svc` 449 - `aws` - built with **aws-sigv4** support 450 - `AppleIDN` 451 - `asyn-rr` - c-ares is used for additional records only 452 - `brotli` 453 - `c-ares` - c-ares is used for (all) name resolves 454 - `CharConv` 455 - `codeset-utf8`. If the running codeset is UTF-8 capable. 456 - `cookies` 457 - `crypto` 458 - `Debug` 459 - `digest` 460 - `DoH` 461 - `getrlimit` 462 - `GnuTLS` 463 - `GSS-API` 464 - `h2c` 465 - `headers-api` 466 - `HSTS` 467 - `HTTP-auth` 468 - `http/2` 469 - `http/3` 470 - `HTTPS-proxy` 471 - `HTTPSRR` 472 - `IDN` 473 - `IPv6` 474 - `Kerberos` 475 - `Largefile` 476 - `large-time` (time_t is larger than 32-bit) 477 - `large-size` (size_t is larger than 32-bit) 478 - `libssh2` 479 - `libssh` 480 - `oldlibssh` (versions before 0.9.4) 481 - `libz` 482 - `local-http`. The HTTP server runs on 127.0.0.1 483 - `manual` 484 - `mbedtls` 485 - `Mime` 486 - `netrc` 487 - `nghttpx` 488 - `nghttpx-h3` 489 - `NTLM` 490 - `NTLM_WB` 491 - `OpenSSL` 492 - `override-dns` - this build can use a "fake" DNS server 493 - `parsedate` 494 - `proxy` 495 - `PSL` 496 - `rustls` 497 - `Schannel` 498 - `shuffle-dns` 499 - `socks` 500 - `SPNEGO` 501 - `SSL` 502 - `SSLpinning` 503 - `SSPI` 504 - `threaded-resolver` 505 - `TLS-SRP` 506 - `TrackMemory` 507 - `typecheck` 508 - `threadsafe` 509 - `Unicode` 510 - `unittest` 511 - `UnixSockets` 512 - `verbose-strings` 513 - `wakeup` 514 - `win32` 515 - `WinIDN` 516 - `wolfssh` 517 - `wolfssl` 518 - `xattr` 519 - `zstd` 520 521 as well as each protocol that curl supports. A protocol only needs to be 522 specified if it is different from the server (useful when the server is 523 `none`). 524 525 ### `<killserver>` 526 Using the same syntax as in `<server>` but when mentioned here these servers 527 are explicitly KILLED when this test case is completed. Only use this if there 528 is no other alternatives. Using this of course requires subsequent tests to 529 restart servers. 530 531 ### `<precheck>` 532 A command line that if set gets run by the test script before the test. If an 533 output is displayed by the command or if the return code is non-zero, the test 534 is skipped and the (single-line) output is displayed as reason for not running 535 the test. 536 537 ### `<tool>` 538 Name of tool to invoke instead of "curl". This tool must be built and exist 539 either in the `libtest/` directory (if the tool name starts with `lib`) or in 540 the `unit/` directory (if the tool name starts with `unit`). 541 542 ### `<name>` 543 Brief test case description, shown when the test runs. 544 545 ### `<setenv>` 546 547 variable1=contents1 548 variable2=contents2 549 variable3 550 551 Set the given environment variables to the specified value before the actual 552 command is run. They are restored back to their former values again after the 553 command has been run. 554 555 If the variable name has no assignment, no `=`, then that variable is just 556 deleted. 557 558 ### `<command [option="no-q/no-output/no-include/force-output/binary-trace"] [timeout="secs"][delay="secs"][type="perl/shell"]>` 559 Command line to run. 560 561 Note that the URL that gets passed to the server actually controls what data 562 that is returned. The last slash in the URL must be followed by a number. That 563 number (N) is used by the test-server to load test case N and return the data 564 that is defined within the `<reply><data></data></reply>` section. 565 566 If there is no test number found above, the HTTP test server uses the number 567 following the last dot in the given hostname (made so that a CONNECT can still 568 pass on test number) so that "foo.bar.123" gets treated as test case 569 123. Alternatively, if an IPv6 address is provided to CONNECT, the last 570 hexadecimal group in the address is used as the test number. For example the 571 address "[1234::ff]" would be treated as test case 255. 572 573 Set `type="perl"` to write the test case as a perl script. It implies that 574 there is no memory debugging and valgrind gets shut off for this test. 575 576 Set `type="shell"` to write the test case as a shell script. It implies that 577 there is no memory debugging and valgrind gets shut off for this test. 578 579 Set `option="no-output"` to prevent the test script to slap on the `--output` 580 argument that directs the output to a file. The `--output` is also not added 581 if the verify/stdout section is used. 582 583 Set `option="force-output"` to make use of `--output` even when the test is 584 otherwise written to verify stdout. 585 586 Set `option="no-include"` to prevent the test script to slap on the 587 `--include` argument. 588 589 Set `option="no-q"` avoid using `-q` as the first argument in the curl command 590 line. 591 592 Set `option="binary-trace"` to use `--trace` instead of `--trace-ascii` for 593 tracing. Suitable for binary-oriented protocols such as MQTT. 594 595 Set `timeout="secs"` to override default server logs advisor read lock 596 timeout. This timeout is used by the test harness, once that the command has 597 completed execution, to wait for the test server to write out server side log 598 files and remove the lock that advised not to read them. The "secs" parameter 599 is the not negative integer number of seconds for the timeout. This `timeout` 600 attribute is documented for completeness sake, but is deep test harness stuff 601 and only needed for singular and specific test cases. Avoid using it. 602 603 Set `delay="secs"` to introduce a time delay once that the command has 604 completed execution and before the `<postcheck>` section runs. The "secs" 605 parameter is the not negative integer number of seconds for the delay. This 606 'delay' attribute is intended for specific test cases, and normally not 607 needed. 608 609 ### `<file name="%LOGDIR/filename" [nonewline="yes"]>` 610 This creates the named file with this content before the test case is run, 611 which is useful if the test case needs a file to act on. 612 613 If `nonewline="yes"` is used, the created file gets the final newline stripped 614 off. 615 616 ### `<file1>` 617 1 to 4 can be appended to 'file' to create more files. 618 619 ### `<file2>` 620 621 ### `<file3>` 622 623 ### `<file4>` 624 625 ### `<stdin [nonewline="yes"]>` 626 Pass this given data on stdin to the tool. 627 628 If `nonewline` is set, we cut off the trailing newline of this given data 629 before comparing with the one actually received by the client 630 631 ## `<disable>` 632 633 If `test-duphandle` is a listed item here, this is not run when 634 `--test-duphandle` is used. 635 636 ## `<verify>` 637 ### `<errorcode>` 638 numerical error code curl is supposed to return. Specify a list of accepted 639 error codes by separating multiple numbers with comma. See test 237 for an 640 example. 641 642 ### `<strip>` 643 One regex per line that is removed from the protocol dumps before the 644 comparison is made. This is useful to remove dependencies on dynamically 645 changing protocol data such as port numbers or user-agent strings. 646 647 ### `<strippart>` 648 One perl op per line that operates on the protocol dump. This is pretty 649 advanced. Example: `s/^EPRT .*/EPRT stripped/`. 650 651 ### `<postcheck>` 652 A command line that if set gets run by the test script after the test. If the 653 command exists with a non-zero status code, the test is considered failed. 654 655 ### `<notexists>` 656 A list of directory entries that are checked for after the test has completed 657 and that must not exist. A listed entry existing causes the test to fail. 658 659 ### `<protocol [nonewline="yes"][crlf="yes"]>` 660 661 the protocol dump curl should transmit, if `nonewline` is set, we cut off the 662 trailing newline of this given data before comparing with the one actually 663 sent by the client The `<strip>` and `<strippart>` rules are applied before 664 comparisons are made. 665 666 `crlf=yes` forces the newlines to become CRLF even if not written so in the 667 test. 668 669 ### `<proxy [nonewline="yes"][crlf="yes"]>` 670 671 The protocol dump curl should transmit to an HTTP proxy (when the http-proxy 672 server is used), if `nonewline` is set, we cut off the trailing newline of 673 this given data before comparing with the one actually sent by the client The 674 `<strip>` and `<strippart>` rules are applied before comparisons are made. 675 676 ### `<stderr [mode="text"] [nonewline="yes"] [crlf="yes"]>` 677 This verifies that this data was passed to stderr. 678 679 Use the mode="text" attribute if the output is in text mode on platforms that 680 have a text/binary difference. 681 682 `crlf=yes` forces the newlines to become CRLF even if not written so in the 683 test. 684 685 If `nonewline` is set, we cut off the trailing newline of this given data 686 before comparing with the one actually received by the client 687 688 ### `<stdout [mode="text"] [nonewline="yes"] [crlf="yes"] [loadfile="filename"]>` 689 This verifies that this data was passed to stdout. 690 691 Use the mode="text" attribute if the output is in text mode on platforms that 692 have a text/binary difference. 693 694 If `nonewline` is set, we cut off the trailing newline of this given data 695 before comparing with the one actually received by the client 696 697 `crlf=yes` forces the newlines to become CRLF even if not written so in the 698 test. 699 700 `loadfile="filename"` makes loading the data from an external file. 701 702 ### `<limit>` 703 704 When this test runs and curl was built with debug enabled, runtests make sure 705 that the set limits are not exceeded. Supported limits: 706 707 Allocations: [number of allocation calls] 708 Maximum allocated: [maximum concurrent memory allocated] 709 710 ### `<file name="%LOGDIR/filename" [mode="text"]>` 711 The file's contents must be identical to this after the test is complete. Use 712 the mode="text" attribute if the output is in text mode on platforms that have 713 a text/binary difference. 714 715 ### `<file1>` 716 1 to 4 can be appended to 'file' to compare more files. 717 718 ### `<file2>` 719 720 ### `<file3>` 721 722 ### `<file4>` 723 724 ### `<stripfile>` 725 One perl op per line that operates on the output file or stdout before being 726 compared with what is stored in the test file. This is pretty 727 advanced. Example: "s/^EPRT .*/EPRT stripped/" 728 729 ### `<stripfile1>` 730 1 to 4 can be appended to `stripfile` to strip the corresponding `<fileN>` 731 content 732 733 ### `<stripfile2>` 734 735 ### `<stripfile3>` 736 737 ### `<stripfile4>` 738 739 ### `<upload [crlf="yes"] [nonewline="yes"]>` 740 the contents of the upload data curl should have sent 741 742 `crlf=yes` forces *upload* newlines to become CRLF even if not written so in 743 the source file. 744 745 `nonewline=yes` means that the last byte (the trailing newline character) 746 should be cut off from the upload data before comparing it. 747 748 ### `<valgrind>` 749 disable - disables the valgrind log check for this test