diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2012-01-30 15:59:16 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2012-01-30 15:59:16 +1030 |
commit | e1665c94ac290e030321f7d243e3e70661874778 (patch) | |
tree | 63e097ab974764f505a1530c5d727dd3e5ac466c /lib | |
parent | 10230829df5c5624edaa5fabaf84c9ac5bc31285 (diff) | |
download | samba-e1665c94ac290e030321f7d243e3e70661874778.tar.gz samba-e1665c94ac290e030321f7d243e3e70661874778.tar.bz2 samba-e1665c94ac290e030321f7d243e3e70661874778.zip |
tdb2: add -1 and -2 options to tdbtorture
(For now, -1 is the default).
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tdb2/tools/tdb2torture.c | 19 |
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); |