Berkeley DB: Running the Test Suite
Полезная информация

Running the Test Suite

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:

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:

Or to run a single, individual test:

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:

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 test type RECNO is without renumbering, and RRECNO is with renumbering.

The DB tester currently includes the following tests:
Access Method TestsAction
test001Small keys/data
  • Put/get per key
  • Dump file, verify
  • Close, reopen
  • Dump file, verify
test002Small keys/medium data
  • Put/get per key
  • Dump file, verify
  • Close, reopen
  • Dump file, verify
test003Small keys/large data
  • Put/get per key
  • Dump file, verify
  • Close, reopen
  • Dump file, verify
test004Small keys/medium data
  • Put/get per key
  • Sequential (cursor) get/delete and verify
test005Small keys/medium data
  • Put/get per key
  • Close, reopen
  • Sequential (cursor) get/delete and verify
test006Small keys/medium data
  • Put/get per key
  • Keyed delete and verify
test007Small keys/medium data
  • Put/get per key
  • Close, reopen
  • Keyed delete and verify
test008Small 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
test009Small keys/large data
  • Same as test008; close and reopen database
test010Duplicate test
  • Small key/data pairs.
test011Duplicate test
  • Small key/data pairs.
  • Test Keyfirst, Keylast, add_before and add_after. To verify duplicates onto overflow pages, run with small pagesize.
test012Large keys/small data
  • Same as test003 except use big keys (source files and executables) and small data (the file/executable names).
test013Partial put test
  • Overwrite entire records using partial puts. Make sure that we do not allow overwrites when the NOOVERWRITE flag is set.
test014Exercise partial puts on short data
  • Run 5 combinations of numbers of characters to replace, and number of times to increase the size by.
test015Partial put test.
  • Partial put teset where the key does not initially exist.
test016Partial put test.
  • Partial put where the datum gets shorter as a result of the put.
test017Basic offpage duplicate test.
test018Offpage duplicate test.
  • Key_{first,last,before,after} offpage duplicates.
test019Partial get test.
test020In-Memory database tests.
test021Btree range tests.
test022Multiple data directories test.
test023Duplicate test.
  • Exercise deletes and cursor operations within a duplicate set.
test024Record number retrieval test.
test025DB_APPEND flag test.
test026Small 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
test027Off-page duplicate test.
  • Call test026 with parameters to force off-page duplicates.
test028Cursor delete test.
  • Test put operations after deleting through a cursor.
test029Record renumbering.
test030DB_NEXT_DUP functionality
test031Duplicate sorting functionality
test032DB_GET_BOTH
test033DB_GET_BOTH without comparison function
test034Test032 with off-page duplicates
test035Test033 with off-page duplicates
test036Test KEYFIRST and KEYLAST when the key doesn't exist.
test037Test DB_RMW
test038DB_GET_BOTH on deleted items
test039DB_GET_BOTH on deleted items without comparison function
test040Test038 with off-page duplicates
test041Test039 with off-page duplicates
test042Multi-process random test (tests the concurrent DB product)
  • Tests multiple processes running random operations concurrently.
test043Recno renumbering and implicit creation test.
test044System integration tests.
  • Requires proper functioning of the checkpoint daemon, recovery, transactions, etc.
  • Not run by default.
test045Random tester
  • Runs a number of random add/delete/retrieve operations. Tests both successful conditions and error conditions.
  • Not run by default.
test046Get/Put/Delete operation flags (not yet completed).
  • Not run by default.
jointestTests duplicate assisted joins.
  • Executes 1, 2, 3, and 4 way joins with differing index orders and selectivity.
Locking Subsystem TestsAction
lock001Open, close, unlink
lock002Gets/Puts. Contention without waiting.
lock003Growing a shared region.
lock004Multi-process lock tests.
lock005Multiprocess random lock test.
Logging Subsystem TestsAction
log001Open, close, unlink
log002Read/write log records.
log003Tests multiple logs, truncation, lsn comparison and file functionality.
log004Verify that log_flush is flushing records correctly.
Memory Pool Subsystem TestsAction
memp001Randomly updates pages.
memp002Tests multiple processes accessing and modifying the same files.
Transaction Subsystem TestsAction
txn001Open, close, unlink
txn002Begin, commit, abort testing.
txn003Growing a shared region.
Access Method Recovery TestsAction
recd001Per-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).
recd002Split recovery tests. For every known split log message, makes sure that we exercise redo, undo, and do-nothing condition.
recd003Duplicate recovery tests. For every known duplicate log message, makes sure that we exercise redo, undo, and do-nothing condition.
recd004Big key test where big key gets elevated to internal page.
Deadlock detection TestsAction
dead001Use 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.
dead002Same test as dead001, but use "detect on every collision" instead of separate deadlock detector.
Bug TestsAction
bug001Cursor maintenance in duplicates.
bug002Cursor ops not in duplicates.
bug003Delete with cursor on a key.
bug004Delete cursor key and re-add.
bug005Verify that deleting and readding duplicates results in correct ordering.
bug006Log prev works across log files.
bug007Cursor ops work with a partial length of 0.