diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-03-31 13:59:03 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-03-31 13:59:03 +1100 |
commit | 84547b8dba3c0cf4e20b3c50d9386081d475df6b (patch) | |
tree | ebf5c9d57a4e4830c72d3f77d8e919e7a70a68f2 | |
parent | b90863c0b7b860b006ac49c9396711ff351f777f (diff) | |
download | samba-84547b8dba3c0cf4e20b3c50d9386081d475df6b.tar.gz samba-84547b8dba3c0cf4e20b3c50d9386081d475df6b.tar.bz2 samba-84547b8dba3c0cf4e20b3c50d9386081d475df6b.zip |
added basic testing of tdb_transaction_prepare_commit() in tdbtorture
-rw-r--r-- | lib/tdb/tools/tdbtorture.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/tdb/tools/tdbtorture.c b/lib/tdb/tools/tdbtorture.c index 9265cf07aa..0c9bbd613d 100644 --- a/lib/tdb/tools/tdbtorture.c +++ b/lib/tdb/tools/tdbtorture.c @@ -18,6 +18,7 @@ #define STORE_PROB 4 #define APPEND_PROB 6 #define TRANSACTION_PROB 10 +#define TRANSACTION_PREPARE_PROB 2 #define LOCKSTORE_PROB 5 #define TRAVERSE_PROB 20 #define TRAVERSE_READ_PROB 20 @@ -109,6 +110,11 @@ static void addrec_db(void) goto next; } if (in_transaction && random() % TRANSACTION_PROB == 0) { + if (random() % TRANSACTION_PREPARE_PROB == 0) { + if (tdb_transaction_prepare_commit(db) != 0) { + fatal("tdb_transaction_prepare_commit failed"); + } + } if (tdb_transaction_commit(db) != 0) { fatal("tdb_transaction_commit failed"); } |