Writing Tests summary

From SambaWiki
Revision as of 02:47, 16 May 2024 by Abartlet (talk | contribs) (Correct description of how LDB tests are now run)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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