summaryrefslogtreecommitdiff
path: root/source4/lib/tdb/tools/tdbtorture.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/tdb/tools/tdbtorture.c')
-rw-r--r--source4/lib/tdb/tools/tdbtorture.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source4/lib/tdb/tools/tdbtorture.c b/source4/lib/tdb/tools/tdbtorture.c
index b0a2e7484f..c0076a92d4 100644
--- a/source4/lib/tdb/tools/tdbtorture.c
+++ b/source4/lib/tdb/tools/tdbtorture.c
@@ -39,6 +39,7 @@
#define TRANSACTION_PROB 10
#define LOCKSTORE_PROB 5
#define TRAVERSE_PROB 20
+#define TRAVERSE_READ_PROB 20
#define CULL_PROB 100
#define KEYLEN 3
#define DATALEN 100
@@ -192,6 +193,13 @@ static void addrec_db(void)
}
#endif
+#if TRAVERSE_READ_PROB
+ if (random() % TRAVERSE_READ_PROB == 0) {
+ tdb_traverse_read(db, NULL, NULL);
+ goto next;
+ }
+#endif
+
data = tdb_fetch(db, key);
if (data.dptr) free(data.dptr);
@@ -273,7 +281,7 @@ static void usage(void)
addrec_db();
}
- tdb_traverse(db, NULL, NULL);
+ tdb_traverse_read(db, NULL, NULL);
tdb_traverse(db, traverse_fn, NULL);
tdb_traverse(db, traverse_fn, NULL);