All Berkeley DB tests are run from the Tcl front-end application, dbtest. The dbtest application prompts for input with a percent sign (%).
To run the entire test suite, enter:
% run_all
The output from dbtest will be re-directed to a file in the current directory named ALL.OUT, as running all the tests can take from a few hours to multiple days. After the test suite has finished, you will get a single message on the screen that indicates whether the entire suite succeeded or failed. If it failed, the ALL.OUT file will contain details describing what failed. Any errors will appear in that file as output lines beginning with the string: FAIL.
It is also possible 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
Or to run a single, individual test:
%test001 btree
In all cases, when not running the entire test suite as described above, a successful test run will return you to the dbtest 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:
set testdir ./TESTDIR
to a more appropriate value for your system, e.g.:
set testdir /var/tmp/db.test
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 test type RECNO is without renumbering, and RRECNO is with renumbering.
The DB tester currently includes the following tests:
Access Method Tests | Action |
---|---|
test001 | Small keys/data
|
test002 | Small keys/medium data
|
test003 | Small keys/large data
|
test004 | Small keys/medium data
|
test005 | Small keys/medium data
|
test006 | Small keys/medium data
|
test007 | Small keys/medium data
|
test008 | Small keys/large data
|
test009 | Small keys/large data
|
test010 | Duplicate test
|
test011 | Duplicate test
|
test012 | Large keys/small data
|
test013 | Partial put test
|
test014 | Exercise partial puts on short data
|
test015 | Partial put test.
|
test016 | Partial put test.
|
test017 | Basic offpage duplicate test. |
test018 | Offpage duplicate test.
|
test019 | Partial get test. |
test020 | In-Memory database tests. |
test021 | Btree range tests. |
test022 | Multiple data directories test. |
test023 | Duplicate test.
|
test024 | Record number retrieval test. |
test025 | DB_APPEND flag test. |
test026 | Small keys/medium data w/duplicates
|
test027 | Off-page duplicate test.
|
test028 | Cursor delete test.
|
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 the concurrent DB product)
|
test043 | Recno renumbering and implicit creation test. |
test044 | System integration tests.
|
test045 | Random tester
|
test046 | Get/Put/Delete operation flags (not yet completed).
|
jointest | Tests duplicate assisted joins.
|
Locking Subsystem Tests | Action |
lock001 | 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 | 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 | Open, close, unlink |
txn002 | Begin, commit, abort testing. |
txn003 | Growing a shared region. |
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. |