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