• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..29-Oct-2021-

min_cfg/H03-May-2022-4945

.editorconfigH A D29-Oct-2021952 2723

cli_tools.test.extH A D29-Oct-20211.8 KiB5750

conditions.test.extH A D29-Oct-20213.4 KiB11287

curl_header.test.extH A D29-Oct-20218.9 KiB214183

httpbin.test.extH A D29-Oct-20211.8 KiB5343

init.cli.extH A D29-Oct-20212.2 KiB5445

ip.test.extH A D29-Oct-20211.5 KiB4132

microDNS.test.extH A D29-Oct-20213.9 KiB12393

microserver.test.extH A D29-Oct-20218.3 KiB266211

ports.pyH A D29-Oct-20218.5 KiB251191

readme.mdH A D29-Oct-20212.2 KiB3224

setup.cli.extH A D29-Oct-20216.6 KiB156140

traffic_replay.test.extH A D29-Oct-20213.5 KiB9671

trafficserver.test.extH A D29-Oct-202116.4 KiB480386

trafficserver_plugins.test.extH A D29-Oct-20214.1 KiB12094

verifier_client.test.extH A D29-Oct-20218 KiB198156

verifier_common.pyH A D29-Oct-20212.1 KiB6036

verifier_server.test.extH A D29-Oct-20219.4 KiB232182

when.test.extH A D29-Oct-20213.1 KiB8672

readme.md

1
2# CurlHeader Tester
3
4This tester tests for the output of curl. User should provide a reference python dictionary whose key-value pair should be (header, op_value) for each line of the expected curl output. For header field, user should provide a string that matches case-insensitively the expected header. For op_value field, which performs comparison operations against the actual value corresponding to that header, use can provide one of the following inputs:
5 * **A string**: If provided a string, it will be compared with the actual value for an exact match.
6 * **A dictionary**: If provided a dictionary, the key-value pair should be (op, value) or (op, [values]), where 'op' indicates the operation to perform with the actual value and the expected value. Following are the available operations:
7    * **equal**: This operation tries to find an exact match. In case of given a single string, it checks for exact match between it and the actual value. In case of given a list of strings, it checks for exact match with any string of the list.
8    * **equal_re**: This operation tries to find a regular expression match . In case of give a single python regular expression string, it checks if the actual value matches the expression. In case of given a list of regular expressions, it checks if the actual value can match any one of the expressions.
9 * **NoneType**: If provided a None, the tester will ignore the value for this header
10
11To use the CurlHeader tester when writing tests, which is not one of the default testers, user should invoke the tester in the following way:
12 1. tr = Test.AddTestRun()
13 2. tr.Processes.Default.Streams.stdout = Testers.CurlHeader(reference_dict)
14
15 Examples:
16 * To check for header 'X-Cache' that have value 'miss' and header 'cache-control' that have value starting with 'max', provide the following dictionary to tester:
17
18        {
19            'X-Cache' : 'miss',
20            'cache-control' : {'equal_re' : 'max.*'}
21        }
22
23 * To check for header 'Age' that can have any value and header 'etag' that have value either matching 'myetag' or end with 'p', provide the following dictionary to tester:
24
25        {
26            'Age' : None,
27            'etag' : {
28                'equal' : 'myetag',
29                'equal_re' : '.*p'
30            }
31        }
32