diff options
author | Jeremy Allison <jra@samba.org> | 2003-01-11 00:07:40 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-01-11 00:07:40 +0000 |
commit | 8e7dfa50b03139227bf1c14cddc6de3ebabcabc3 (patch) | |
tree | 85c2c3200da555c64adcf4651297ae58326fc814 /source3/tdb/tdbtorture.c | |
parent | fe6bb1e9edb51890f190f0a305493fba1286c5cb (diff) | |
download | samba-8e7dfa50b03139227bf1c14cddc6de3ebabcabc3.tar.gz samba-8e7dfa50b03139227bf1c14cddc6de3ebabcabc3.tar.bz2 samba-8e7dfa50b03139227bf1c14cddc6de3ebabcabc3.zip |
Added tdb_append() call. Efficiently adds to an entry. Used by new messaging
code. Also added torture tests for it.
Jeremy.
(This used to be commit b515525a060a388c6ae0a03006a882c9be2e42b6)
Diffstat (limited to 'source3/tdb/tdbtorture.c')
-rw-r--r-- | source3/tdb/tdbtorture.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source3/tdb/tdbtorture.c b/source3/tdb/tdbtorture.c index c4d912a147..e27bbff990 100644 --- a/source3/tdb/tdbtorture.c +++ b/source3/tdb/tdbtorture.c @@ -21,6 +21,7 @@ #define REOPEN_PROB 30 #define DELETE_PROB 8 #define STORE_PROB 4 +#define APPEND_PROB 6 #define LOCKSTORE_PROB 0 #define TRAVERSE_PROB 20 #define CULL_PROB 100 @@ -122,6 +123,15 @@ static void addrec_db(void) } #endif +#if APPEND_PROB + if (random() % APPEND_PROB == 0) { + if (tdb_append(db, key, data) != 0) { + fatal("tdb_append failed"); + } + goto next; + } +#endif + #if LOCKSTORE_PROB if (random() % LOCKSTORE_PROB == 0) { tdb_chainlock(db, lockkey); |