tools/httptester/README

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 This is a regression tester for http.
     3 The summary
     4 ===========
     6 1) start the server, with python server.py
     7 2) Get a file of all tests available by getting http://localhost:8000/
     8 3) Use that file as an argument to mozilla -f (this requires either a 
     9 debug build or a build with --enable-perf-metrics)
    10 4) Look at the results of http://localhost:8000/id/report
    12 Detail
    13 ======
    15 Each run gets a unique ID number, which is used to map a test run to a 
    16 database of results. Every test (which lives in the tests/ directory) is 
    17 enumerated in step 2. Adding a new test is as simple as just creating the 
    18 directory and addiing the appropriate files.
    20 Test format
    21 ===========
    23 Each test must have a config file, which is simply a list of all the files
    24 which will be requested, in order. Each file (x) can either be present in
    25 the directory as that name, in which case the contents will be sent to the
    26 browser, or as x.headers and (optionally) x.body.
    28 The headers file has a first line which is the response code, and then any 
    29 subsequent lines are header: value pairs. If the body file is not present, 
    30 the test server will construct a one line response. This is useful for 
    31 testing mozilla's response to headers (see the responses/ subdirectory of 
    32 tests for examples)
    34 Advanced tests
    35 ==============
    37 The default definition of a tests's 'success' is that all the files are 
    38 retreived in the correct order. This can be overridden on a per test 
    39 basis. For example, the referer test additionally checks that a 
    40 referer header was sent.
    42 To do this, a file called tester.py must exist in the test's directory. 
    43 This class must provide an object called tester, which is used by the 
    44 driver code instead of the default tester. This default tester is 
    45 automatically present in the file's namespace under the name 'BaseTester'. 
    46 This means that it can be inherited from in order to only override certain 
    47 functionality.
    49 The routines in the default tester are documented in BaseTest.py. The most 
    50 common routine which needs to be extended in verify_request. For an 
    51 example, see the referer test.
    53 Bradley Baetz <bbaetz@netscape.com>, <bbaetz@cs.mcgill.ca>

mercurial