s4-provision: don't ask only 3 times for passwd in interactive mode
[Samba/gebeck_regimport.git] / selftest / README
blobc23d730d640b9d5d1677e3810152f3f9a69d25ec
1 # vim: ft=rst
3 This directory contains test scripts that are useful for running a
4 bunch of tests all at once. 
6 There are two parts to this: 
8  * The test runner (selftest/selftest.pl)
9  * The test formatter
11 selftest.pl simply outputs subunit, which can then be formatted or analyzed 
12 by tools that understand the subunit protocol. One of these tools is 
13 format-subunit, which is used by default as part of "make test".
15 Available testsuites
16 ====================
17 The available testsuites are obtained from a script, usually 
18 source{3,4}/selftest/tests.py. This script should for each testsuite output
19 the name of the test, the command to run and the environment that should be 
20 provided. Use the included "plantest" function to generate the required output.
22 Testsuite behaviour
23 ===================
25 Exit code
26 ------------
27 The testsuites should exit with a non-zero exit code if at least one 
28 test failed. Skipped tests should not influence the exit code.
30 Output format
31 -------------
32 Testsuites can simply use the exit code to indicate whether all of their 
33 tests have succeeded or one or more have failed. It is also possible to 
34 provide more granular information using the Subunit protocol. 
36 This protocol works by writing simple messages to standard output. Any 
37 messages that can not be interpreted by this protocol are considered comments 
38 for the last announced test.
40 For a full description of the subunit protocol, see ../lib/subunit/README.
42 The following commands are Samba extensions to Subunit:
44 testsuite-count
45 ~~~~~~~~~~~~~~~
46 testsuite-count: number
48 Announce the number of tests that is going to be run.
50 start-testsuite
51 ~~~~~~~~~~~~~~~
52 start-testsuite: name
54 The testsuite name is used as prefix for all containing tests.
56 skip-testsuite
57 ~~~~~~~~~~~~~~
58 skip-testsuite: name
60 Mark the testsuite with the specified name as skipped.
62 testsuite-success
63 ~~~~~~~~~~~~~~~~~
64 testsuite-success: name
66 Indicate that the testsuite has succeeded successfully.
68 testsuite-fail
69 ~~~~~~~~~~~~~~
70 testsuite-fail: name
72 Indicate that a testsuite has failed.
74 Environments
75 ============
76 Tests often need to run against a server with particular things set up, 
77 a "environment". This environment is provided by the test "target": Samba 3, 
78 Samba 4 or Windows.
80 The environments are currently available include
82  - none: No server set up, no variables set.
83  - dc,s3dc: Domain controller set up. The following environment variables will
84    be set:
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
95  - member,s4member,s3member: Domain controller and member server that is joined to it set up. The
96    following environment variables will be set:
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
104 See Samba.pm, Samba3.pm and Samba4.pm for the full list.
106 Running tests
107 =============
109 To run all the tests use::
111    make test
113 To run a quicker subset run::
115    make quicktest
117 To run a specific test, use this syntax::
119    make test TESTS=testname
121 for example::
123    make test TESTS=samba4.BASE-DELETE