|
1 This is a regression tester for http. |
|
2 |
|
3 The summary |
|
4 =========== |
|
5 |
|
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 |
|
11 |
|
12 Detail |
|
13 ====== |
|
14 |
|
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. |
|
19 |
|
20 Test format |
|
21 =========== |
|
22 |
|
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. |
|
27 |
|
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) |
|
33 |
|
34 Advanced tests |
|
35 ============== |
|
36 |
|
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. |
|
41 |
|
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. |
|
48 |
|
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. |
|
52 |
|
53 Bradley Baetz <bbaetz@netscape.com>, <bbaetz@cs.mcgill.ca> |