summaryrefslogtreecommitdiff
path: root/lib/tdb/test
AgeCommit message (Collapse)AuthorFilesLines
2012-03-23lib/tdb: fix test/run-die-during-transaction when HAVE_INCOHERENT_MMAP.Rusty Russell1-0/+5
Since we force mmap on, we don't intercept writes to the db, so we never see it in an inconsistent state. #ifdef over the check that we should have recovered it at least once. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-03-22lib/tdb: fix OpenBSD incoherent mmap.Rusty Russell1-4/+23
This comment appears in two places in the code (commit 4c6a8273c6dd3e2aeda5a63c4a62aa55bc133099 from 2001): /* * We must ensure the file is unmapped before doing this * to ensure consistency with systems like OpenBSD where * writes and mmaps are not consistent. */ But this doesn't help, because if one process is using mmap and another using pwrite, we get incoherent results. As demonstrated by OpenBSD's failure on the tdb unit tests. Rather than disable mmap on OpenBSD, we test for this issue and force mmap to be enabled. This means that we will fail on very large TDBs on 32-bit systems, but it's better than the horrendous performance penalty on every OpenBSD system. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-03-22lib/tdb: fix up run-die-during-transaction test cases on Solaris.Rusty Russell4-5/+4
By using a different include order, we end up with a different version of FILE_OFFSET_BITS (and probably other things) in parts of the test. The different variants get linked together, and the result is weird: the stat returns 0 size. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-03-14lib/tdb: remove unnecessary XOPEN and FILE_OFFSET_BITS defines in test/Rusty Russell17-20/+0
These were relics: they don't need to be defined here as long as we are careful to include the replace headers before any standard headers (we are). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User: Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date: Wed Mar 14 10:12:26 CET 2012 on sn-devel-104
2012-02-14tdb/test: fix up tests for use in SAMBA tdb code.Rusty Russell5-13/+16
1) Make sure we include "tdb_private.h" first, to get the right headers (esp. the correct setting of _FILE_OFFSET_BITS before unistd.h). 2) Fix 3G file test since expand logic has changed. 3) Fix nested transaction test, since default is to allow nesting. 4) Capture fdatasync, which was slowing down transaction expand. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-02-14tdb: wean CCAN-style unit tests off of tap.Rusty Russell25-23/+64
We could use subunit, but that's overkill. Just print messages when we fail, and use exit status. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-02-14tdb: import unit tests from CCAN into tdb/test/Rusty Russell34-0/+2566
I pulled tdb into CCAN as an experiment a while ago; it doesn't belong there, but it has accumulated some important unit tests. These are copied from CCAN version init-1486-gc438ec1 with #include "../" changed to #include "../common/". Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>