All Berkeley DB tests are run from the Tcl front-end application, dbtest. To start the tester, enter:
To run tests for a particular subsystem:
% r btree % r hash % r lock % r log % r mpool % r mutex % r recd % r recno % r txn
In the case of run_all, normal output is directed to a file named ALL.OUT, as running all the tests often takes several hours. After the test suite has completed, you will get a single message that indicates whether the entire suite succeeded or failed. If it failed, the file ALL.OUT will contain more details describing what failed. Any errors will appear in that file as output lines beginning with the word: FAIL.
For any of the other tests, a successful test will return you to the tcl prompt (%). On failure, you will get a message indicating what failed and why.
Tests are run, by default, in the directory ./TESTDIR. However, the test files are often very large. To use a different directory for the test directory, edit the file .dbtestrc in your build directory, and change the line:
to a more appropriate value for your system, e.g.:
Alternatively, you can create a symbolic link named TESTDIR in your build directory to an appropriate location for running the tests.
WARNING: On many platforms, the mmap(2) and/or fcntl(2) locking system calls won't work correctly over remote filesystems (e.g., NFS and AFS), so we strongly recommend that the test directory be a local filesystem.
There are two different modes of RECNO access method tests, with and without record renumbering. The access method type RRECNO implies RECNO with renumbering.
The DB tester currently includes the following tests:
Access Method Tests | Action |
---|---|
test001 | Small keys/data Put/get per key Dump file, verify Close, reopen Dump file, verify |
test002 | Small keys/medium data Put/get per key Dump file, verify Close, reopen Dump file, verify |
test003 | Small keys/large data Put/get per key Dump file, verify Close, reopen Dump file, verify |
test004 | Small keys/medium data Put/get per key Sequential (cursor) get/delete and verify |
test005 | Small keys/medium data Put/get per key Close, reopen Sequential (cursor) get/delete and verify |
test006 | Small keys/medium data Put/get per key Keyed delete and verify |
test007 | Small keys/medium data Put/get per key Close, reopen Keyed delete and verify |
test008 | Small keys/large data Put/get per key Loop through keys by steps (which change) ... delete each key at step ... add each key back ... change step Tests that overflow pages are getting reused appropriately |
test009 | Small keys/large data Same as test008; close and reopen database |
test010 | Duplicate test Small key/data pairs. |
test011 | Duplicate test Small key/data pairs. Test Keyfirst, Keylast, add_before and add_after. To verify duplicates onto overflow pages, run with small pagesize. |
test012 | Small keys/large data Same as test003 except use big keys (source files and executables) and small data (the file/executable names). |
test013 | Partial put test Overwrite entire records using partial puts. Make sure that we do not allow overwrites when the NOOVERWRITE flag is set. |
test014 | Exercise partial puts on short data Run 5 combinations of numbers of characters to replace, and number of times to increase the size by. |
test015 | Partial put test. Partial put teset where the key does not initially exist. |
test016 | Partial put test. Partial put where the datum gets shorter as a result of the put. |
test017 | Basic offpage duplicate test. |
test018 | Offpage duplicate test. Key_{first,last,before,after} offpage duplicates. |
test019 | Partial get test. |
test020 | In-Memory database tests. |
test021 | Btree range tests. |
test022 | Multiple data directories test. |
test023 | Duplicate test. Exercise deletes and cursor operations within a duplicate set. |
test024 | Record number retrieval test. |
test025 | DB_APPEND flag test. |
test026 | Small keys/medium data w/duplicates Put/get per key. Loop through keys -- delete each key ... test that we are deleting dups correctly with the cursor |
test027 | Off-page duplicate test. Call test026 with parameters to force off-page duplicates. |
test028 | Cursor delete test. Test put operations after deleting through a cursor. |
test029 | Record renumbering. |
test030 | DB_NEXT_DUP functionality |
test031 | Duplicate sorting functionality |
test032 | DB_GET_BOTH |
test033 | DB_GET_BOTH without comparison function |
test034 | Test032 with off-page duplicates |
test035 | test033 with off-page duplicates |
test036 | Test KEYFIRST and KEYLAST when the key doesn't exist. |
test037 | Test DB_RMW |
test038 | DB_GET_BOTH on deleted items |
test039 | DB_GET_BOTH on deleted items without comparison function |
test040 | Test038 with off-page duplicates |
test041 | test039 with off-page duplicates |
test042 | Multi-process random test Tests multiple processes running random operations concurrently. Has the potential for deadlocks. Not run by default. |
test043 | Get/Put/Delete operation flags (not yet completed). Not run by default. |
test044 | System integration tests. Requires proper functioning of the checkpoint daemon, recovery, transactions, etc. Not run by default. |
test045 | Random tester Runs a number of random add/delete/retrieve operations. Tests both successful conditions and error conditions. Not run by default. |
jointest | Tests duplicate assisted joins. Executes 1, 2, 3, and 4 way joins with differing index orders and selectivity. |
Locking Subsystem Tests | Action |
lock001 | Specifically checks: open, close, unlink. |
lock002 | Gets/Puts. Contention without waiting. |
lock003 | Growing a shared region. |
lock004 | Multi-process lock tests. |
lock005 | Multiprocess random lock test. |
Logging Subsystem Tests | Action |
log001 | Specifically checks: open, close, unlink. |
log002 | Read/write log records. |
log003 | Tests multiple logs, truncation, lsn comparison and file functionality. |
log004 | Verify that log_flush is flushing records correctly. |
Memory Pool Subsystem Tests | Action |
memp001 | Randomly updates pages. |
memp002 | Tests multiple processes accessing and modifying the same files. |
Transaction Subsystem Tests | Action |
txn001 | Specifically checks: open, close, unlink. |
txn002 | Begin, commit, abort testing. |
txn003 | Region growing code. |
Access Method Recovery Tests | Action |
recd001 | Per-operation recovery tests for non-duplicate, non-split messages. Makes sure that we exercise redo, undo, and do-nothing condition. Any test that appears with the message (change state) indicates that we've already run the particular test, but we are running it again so that we can change the state of the data base to prepare for the next test (this applies to all other recovery tests as well). |
recd002 | Split recovery tests. For every known split log message, makes sure that we exercise redo, undo, and do-nothing condition. |
recd003 | Duplicate recovery tests. For every known duplicate log message, makes sure that we exercise redo, undo, and do-nothing condition. |
recd004 | Big key test where big key gets elevated to internal page. |
Deadlock detection Tests | Action |
dead001 | Use two different configurations to test deadlock detection among a variable number of processes. One configuration has the processes deadlocked in a ring. The other has the processes all deadlocked on a single resource. |
dead002 | Same test as dead001, but use "detect on every collision" instead of separate deadlock detector. |
Bug Tests | Action |
bug001 | Cursor maintenance in duplicates. |
bug002 | Cursor ops not in duplicates. |
bug003 | Delete with cursor on a key. |
bug004 | Delete cursor key and re-add. |
bug005 | Verify that deleting and readding duplicates results in correct ordering. |
bug006 | Log prev works across log files. |
bug007 | Cursor ops work with a partial length of 0. |