Writing Tests summary: Difference between revisions

From SambaWiki
(summary page about writing tests)
 
(Correct description of how LDB tests are now run)
 
Line 5: Line 5:
* [[Writing Torture Tests]]: smbtorture in the ''source4/torture'' directory and provides direct C protocol tests.
* [[Writing Torture Tests]]: smbtorture in the ''source4/torture'' directory and provides direct C protocol tests.
* [[Writing Python Tests]]: If the protocol under test is [[DCERPC]], then [[PIDL]] will have already auto-generated [[Python]] bindings. Likewise LDAP is easily accessed via [[LDB]].
* [[Writing Python Tests]]: If the protocol under test is [[DCERPC]], then [[PIDL]] will have already auto-generated [[Python]] bindings. Likewise LDAP is easily accessed via [[LDB]].
* [[Writing cmocka Tests]]: Idea for unit tests of C functions.
* [[Writing cmocka Tests]]: Ideal for unit tests of C functions.
* [[LDB]]: Tests for LDB are in <code>lib/ldb/tests</code> and are run from <code>make test</code> within <code>lib/ldb</code>
* [[LDB]]: Tests for LDB are in <code>lib/ldb/tests</code> but are since Samba 4.21 run from the top level <code>make test</code>
* [[Running_CTDB_tests|CTDB]]: Tests for CTDB are written as shell scripts under <code>ctdb/tests</code> and are run from <code>make test</code> within <code>ctdb</code>
* [[Running_CTDB_tests|CTDB]]: Tests for CTDB are written as shell scripts under <code>ctdb/tests</code> and are run from <code>make test</code> within <code>ctdb</code>

Latest revision as of 02:47, 16 May 2024

Most changes to Samba should have a test to demonstrate the bug being fixed, or test the feature being added. Most tests are run using 'make test' from a Samba source tree.

See writing and running Samba tests but in particular:

  • Writing Torture Tests: smbtorture in the source4/torture directory and provides direct C protocol tests.
  • Writing Python Tests: If the protocol under test is DCERPC, then PIDL will have already auto-generated Python bindings. Likewise LDAP is easily accessed via LDB.
  • Writing cmocka Tests: Ideal for unit tests of C functions.
  • LDB: Tests for LDB are in lib/ldb/tests but are since Samba 4.21 run from the top level make test
  • CTDB: Tests for CTDB are written as shell scripts under ctdb/tests and are run from make test within ctdb