source: trunk/server/selftest/README@ 858

Last change on this file since 858 was 745, checked in by Silvan Scherrer, 13 years ago

Samba Server: updated trunk to 3.6.0

File size: 3.3 KB
Line 
1# vim: ft=rst
2
3This directory contains test scripts that are useful for running a
4bunch of tests all at once.
5
6There are two parts to this:
7
8 * The test runner (selftest/selftest.pl)
9 * The test formatter
10
11selftest.pl simply outputs subunit, which can then be formatted or analyzed
12by tools that understand the subunit protocol. One of these tools is
13format-subunit, which is used by default as part of "make test".
14
15Available testsuites
16====================
17The available testsuites are obtained from a script, usually
18source{3,4}/selftest/tests.sh. This script should for each testsuite output
19the name of the test, the command to run and the environment that should be
20provided. Use the included "plantest" function to generate the required output.
21
22Testsuite behaviour
23===================
24
25Exit code
26------------
27The testsuites should exit with a non-zero exit code if at least one
28test failed. Skipped tests should not influence the exit code.
29
30Output format
31-------------
32Testsuites can simply use the exit code to indicate whether all of their
33tests have succeeded or one or more have failed. It is also possible to
34provide more granular information using the Subunit protocol.
35
36This protocol works by writing simple messages to standard output. Any
37messages that can not be interpreted by this protocol are considered comments
38for the last announced test.
39
40For a full description of the subunit protocol, see ../lib/subunit/README.
41
42The following commands are Samba extensions to Subunit:
43
44testsuite-count
45~~~~~~~~~~~~~~~
46testsuite-count: number
47
48Announce the number of tests that is going to be run.
49
50start-testsuite
51~~~~~~~~~~~~~~~
52start-testsuite: name
53
54The testsuite name is used as prefix for all containing tests.
55
56skip-testsuite
57~~~~~~~~~~~~~~
58skip-testsuite: name
59
60Mark the testsuite with the specified name as skipped.
61
62testsuite-success
63~~~~~~~~~~~~~~~~~
64testsuite-success: name
65
66Indicate that the testsuite has succeeded successfully.
67
68testsuite-fail
69~~~~~~~~~~~~~~
70testsuite-fail: name
71
72Indicate that a testsuite has failed.
73
74Environments
75============
76Tests often need to run against a server with particular things set up,
77a "environment". This environment is provided by the test "target": Samba 3,
78Samba 4 or Windows.
79
80The following environments are currently available:
81
82 - none: No server set up, no variables set.
83 - dc: Domain controller set up. The following environment variables will
84 be set:
85
86 * USERNAME: Administrator user name
87 * PASSWORD: Administrator password
88 * DOMAIN: Domain name
89 * REALM: Realm name
90 * SERVER: DC host name
91 * SERVER_IP: DC IPv4 address
92 * NETBIOSNAME: DC NetBIOS name
93 * NETIOSALIAS: DC NetBIOS alias
94
95 - member: Domain controller and member server that is joined to it set up. The
96 following environment variables will be set:
97
98 * USERNAME: Domain administrator user name
99 * PASSWORD: Domain administrator password
100 * DOMAIN: Domain name
101 * REALM: Realm name
102 * SERVER: Name of the member server
103
104
105Running tests
106=============
107
108To run all the tests use::
109
110 make test
111
112To run a quick subset (aiming for about 1 minute of testing) run::
113
114 make quicktest
115
116To run a specific test, use this syntax::
117
118 make test TESTS=testname
119
120for example::
121
122 make test TESTS=samba4.BASE-DELETE
123
Note: See TracBrowser for help on using the repository browser.