summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/tdb2/tools/tdb2torture.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/tdb2/tools/tdb2torture.c b/lib/tdb2/tools/tdb2torture.c
index db6515d0cf..83847da027 100644
--- a/lib/tdb2/tools/tdb2torture.c
+++ b/lib/tdb2/tools/tdb2torture.c
@@ -16,6 +16,9 @@
#include <time.h>
#include <sys/wait.h>
+/* Currently we default to creating a tdb1. This will change! */
+#define TDB2_IS_DEFAULT false
+
//#define REOPEN_PROB 30
#define DELETE_PROB 8
#define STORE_PROB 4
@@ -346,14 +349,16 @@ int main(int argc, char * const *argv)
int kill_random = 0;
int *done;
int tdb_flags = TDB_DEFAULT;
+ bool tdb2 = TDB2_IS_DEFAULT;
char *test_tdb;
log_attr.base.attr = TDB_ATTRIBUTE_LOG;
log_attr.base.next = &seed_attr;
log_attr.log.fn = tdb_log;
seed_attr.base.attr = TDB_ATTRIBUTE_SEED;
+ seed_attr.base.next = NULL;
- while ((c = getopt(argc, argv, "n:l:s:thkS")) != -1) {
+ while ((c = getopt(argc, argv, "n:l:s:thkS12")) != -1) {
switch (c) {
case 'n':
num_procs = strtol(optarg, NULL, 0);
@@ -378,11 +383,23 @@ int main(int argc, char * const *argv)
case 'k':
kill_random = 1;
break;
+ case '1':
+ tdb2 = false;
+ break;
+ case '2':
+ tdb2 = true;
+ break;
default:
usage();
}
}
+ if (!tdb2) {
+ tdb_flags |= TDB_VERSION1;
+ /* TDB1 tdbs don't use seed. */
+ log_attr.base.next = NULL;
+ }
+
test_tdb = test_path("torture.tdb");
unlink(test_tdb);