tools/httptester/README

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tools/httptester/README	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,53 @@
     1.4 +This is a regression tester for http.
     1.5 +
     1.6 +The summary
     1.7 +===========
     1.8 +
     1.9 +1) start the server, with python server.py
    1.10 +2) Get a file of all tests available by getting http://localhost:8000/
    1.11 +3) Use that file as an argument to mozilla -f (this requires either a 
    1.12 +debug build or a build with --enable-perf-metrics)
    1.13 +4) Look at the results of http://localhost:8000/id/report
    1.14 +
    1.15 +Detail
    1.16 +======
    1.17 +
    1.18 +Each run gets a unique ID number, which is used to map a test run to a 
    1.19 +database of results. Every test (which lives in the tests/ directory) is 
    1.20 +enumerated in step 2. Adding a new test is as simple as just creating the 
    1.21 +directory and addiing the appropriate files.
    1.22 +
    1.23 +Test format
    1.24 +===========
    1.25 +
    1.26 +Each test must have a config file, which is simply a list of all the files
    1.27 +which will be requested, in order. Each file (x) can either be present in
    1.28 +the directory as that name, in which case the contents will be sent to the
    1.29 +browser, or as x.headers and (optionally) x.body.
    1.30 +
    1.31 +The headers file has a first line which is the response code, and then any 
    1.32 +subsequent lines are header: value pairs. If the body file is not present, 
    1.33 +the test server will construct a one line response. This is useful for 
    1.34 +testing mozilla's response to headers (see the responses/ subdirectory of 
    1.35 +tests for examples)
    1.36 +
    1.37 +Advanced tests
    1.38 +==============
    1.39 +
    1.40 +The default definition of a tests's 'success' is that all the files are 
    1.41 +retreived in the correct order. This can be overridden on a per test 
    1.42 +basis. For example, the referer test additionally checks that a 
    1.43 +referer header was sent.
    1.44 +
    1.45 +To do this, a file called tester.py must exist in the test's directory. 
    1.46 +This class must provide an object called tester, which is used by the 
    1.47 +driver code instead of the default tester. This default tester is 
    1.48 +automatically present in the file's namespace under the name 'BaseTester'. 
    1.49 +This means that it can be inherited from in order to only override certain 
    1.50 +functionality.
    1.51 +
    1.52 +The routines in the default tester are documented in BaseTest.py. The most 
    1.53 +common routine which needs to be extended in verify_request. For an 
    1.54 +example, see the referer test.
    1.55 +
    1.56 +Bradley Baetz <bbaetz@netscape.com>, <bbaetz@cs.mcgill.ca>

mercurial