Browse Source

tdb: unify logging code in test dir.

Rusty Russell 15 years ago
parent
commit
655ef777da

+ 4 - 17
ccan/tdb/test/external-agent.c

@@ -1,5 +1,6 @@
 #include "external-agent.h"
 #include "external-agent.h"
 #include "lock-tracking.h"
 #include "lock-tracking.h"
+#include "logging.h"
 #include <sys/types.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <sys/wait.h>
 #include <unistd.h>
 #include <unistd.h>
@@ -17,23 +18,8 @@
 
 
 static struct tdb_context *tdb;
 static struct tdb_context *tdb;
 
 
-static void taplog(struct tdb_context *tdb,
-		   enum tdb_debug_level level,
-		   const char *fmt, ...)
-{
-	va_list ap;
-	char line[200];
-
-	va_start(ap, fmt);
-	vsprintf(line, fmt, ap);
-	va_end(ap);
-
-	diag("external: %s", line);
-}
-
 static enum agent_return do_operation(enum operation op, const char *name)
 static enum agent_return do_operation(enum operation op, const char *name)
 {
 {
-	struct tdb_logging_context logctx = { taplog, NULL };
 	TDB_DATA k;
 	TDB_DATA k;
 	enum agent_return ret;
 	enum agent_return ret;
 	TDB_DATA data;
 	TDB_DATA data;
@@ -54,7 +40,7 @@ static enum agent_return do_operation(enum operation op, const char *name)
 			return OTHER_FAILURE;
 			return OTHER_FAILURE;
 		}
 		}
 		tdb = tdb_open_ex(name, 0, TDB_DEFAULT, O_RDWR, 0,
 		tdb = tdb_open_ex(name, 0, TDB_DEFAULT, O_RDWR, 0,
-				  &logctx, NULL);
+				  &taplogctx, NULL);
 		if (!tdb) {
 		if (!tdb) {
 			if (!locking_would_block)
 			if (!locking_would_block)
 				diag("Opening tdb gave %s", strerror(errno));
 				diag("Opening tdb gave %s", strerror(errno));
@@ -66,7 +52,7 @@ static enum agent_return do_operation(enum operation op, const char *name)
 		if (tdb)
 		if (tdb)
 			return OTHER_FAILURE;
 			return OTHER_FAILURE;
 		tdb = tdb_open_ex(name, 0, TDB_CLEAR_IF_FIRST, O_RDWR, 0,
 		tdb = tdb_open_ex(name, 0, TDB_CLEAR_IF_FIRST, O_RDWR, 0,
-				  &logctx, NULL);
+				  &taplogctx, NULL);
 		ret = tdb ? SUCCESS : OTHER_FAILURE;
 		ret = tdb ? SUCCESS : OTHER_FAILURE;
 		break;
 		break;
 	case TRANSACTION_START:
 	case TRANSACTION_START:
@@ -146,6 +132,7 @@ struct agent *prepare_external_agent(void)
 
 
 	/* We want to fail, not block. */
 	/* We want to fail, not block. */
 	nonblocking_locks = true;
 	nonblocking_locks = true;
+	log_prefix = "external: ";
 	while ((ret = read(command[0], name, sizeof(name))) > 0) {
 	while ((ret = read(command[0], name, sizeof(name))) > 0) {
 		enum agent_return result;
 		enum agent_return result;
 
 

+ 3 - 2
ccan/tdb/test/run-3G-file.c

@@ -14,6 +14,7 @@
 #include <ccan/tap/tap.h>
 #include <ccan/tap/tap.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <err.h>
 #include <err.h>
+#include "logging.h"
 
 
 static int tdb_expand_file_sparse(struct tdb_context *tdb,
 static int tdb_expand_file_sparse(struct tdb_context *tdb,
 				  tdb_off_t size,
 				  tdb_off_t size,
@@ -73,8 +74,8 @@ int main(int argc, char *argv[])
 	struct tdb_record rec;
 	struct tdb_record rec;
 
 
 	plan_tests(24);
 	plan_tests(24);
-	tdb = tdb_open("run-36-file.tdb", 1024, TDB_CLEAR_IF_FIRST,
-		       O_CREAT|O_TRUNC|O_RDWR, 0600);
+	tdb = tdb_open_ex("run-36-file.tdb", 1024, TDB_CLEAR_IF_FIRST,
+			  O_CREAT|O_TRUNC|O_RDWR, 0600, &taplogctx, NULL);
 
 
 	ok1(tdb);
 	ok1(tdb);
 	tdb->methods = &large_io_methods;
 	tdb->methods = &large_io_methods;

+ 9 - 4
ccan/tdb/test/run-bad-tdb-header.c

@@ -12,6 +12,7 @@
 #include <ccan/tap/tap.h>
 #include <ccan/tap/tap.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <err.h>
 #include <err.h>
+#include "logging.h"
 
 
 int main(int argc, char *argv[])
 int main(int argc, char *argv[])
 {
 {
@@ -25,9 +26,11 @@ int main(int argc, char *argv[])
 	ok1(fd >= 0);
 	ok1(fd >= 0);
 	ok1(write(fd, "hello world", 11) == 11);
 	ok1(write(fd, "hello world", 11) == 11);
 	close(fd);
 	close(fd);
-	tdb = tdb_open("run-bad-tdb-header.tdb", 1024, 0, O_RDWR, 0);
+	tdb = tdb_open_ex("run-bad-tdb-header.tdb", 1024, 0, O_RDWR, 0,
+			  &taplogctx, NULL);
 	ok1(!tdb);
 	ok1(!tdb);
-	tdb = tdb_open("run-bad-tdb-header.tdb", 1024, 0, O_CREAT|O_RDWR, 0600);
+	tdb = tdb_open_ex("run-bad-tdb-header.tdb", 1024, 0, O_CREAT|O_RDWR,
+			  0600, &taplogctx, NULL);
 	ok1(tdb);
 	ok1(tdb);
 	tdb_close(tdb);
 	tdb_close(tdb);
 
 
@@ -41,12 +44,14 @@ int main(int argc, char *argv[])
 	ok1(write(fd, &hdr, sizeof(hdr)) == sizeof(hdr));
 	ok1(write(fd, &hdr, sizeof(hdr)) == sizeof(hdr));
 	close(fd);
 	close(fd);
 
 
-	tdb = tdb_open("run-bad-tdb-header.tdb", 1024, 0, O_RDWR|O_CREAT, 0600);
+	tdb = tdb_open_ex("run-bad-tdb-header.tdb", 1024, 0, O_RDWR|O_CREAT,
+			  0600, &taplogctx, NULL);
 	ok1(errno == EIO);
 	ok1(errno == EIO);
 	ok1(!tdb);
 	ok1(!tdb);
 
 
 	/* With truncate, will be fine. */
 	/* With truncate, will be fine. */
-	tdb = tdb_open("run-bad-tdb-header.tdb", 1024, 0, O_RDWR|O_CREAT|O_TRUNC, 0600);
+	tdb = tdb_open_ex("run-bad-tdb-header.tdb", 1024, 0,
+			  O_RDWR|O_CREAT|O_TRUNC, 0600, &taplogctx, NULL);
 	ok1(tdb);
 	ok1(tdb);
 	tdb_close(tdb);
 	tdb_close(tdb);
 
 

+ 3 - 2
ccan/tdb/test/run-check.c

@@ -12,6 +12,7 @@
 #include <ccan/tap/tap.h>
 #include <ccan/tap/tap.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <err.h>
 #include <err.h>
+#include "logging.h"
 
 
 int main(int argc, char *argv[])
 int main(int argc, char *argv[])
 {
 {
@@ -19,8 +20,8 @@ int main(int argc, char *argv[])
 	TDB_DATA key, data;
 	TDB_DATA key, data;
 
 
 	plan_tests(9);
 	plan_tests(9);
-	tdb = tdb_open("run-check.tdb", 1, TDB_CLEAR_IF_FIRST,
-		       O_CREAT|O_TRUNC|O_RDWR, 0600);
+	tdb = tdb_open_ex("run-check.tdb", 1, TDB_CLEAR_IF_FIRST,
+			  O_CREAT|O_TRUNC|O_RDWR, 0600, &taplogctx, NULL);
 
 
 	ok1(tdb);
 	ok1(tdb);
 	ok1(tdb_check(tdb, NULL, NULL) == 0);
 	ok1(tdb_check(tdb, NULL, NULL) == 0);

+ 5 - 4
ccan/tdb/test/run-corrupt.c

@@ -12,6 +12,7 @@
 #include <ccan/tap/tap.h>
 #include <ccan/tap/tap.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <err.h>
 #include <err.h>
+#include "logging.h"
 
 
 static int check(TDB_DATA key, TDB_DATA data, void *private)
 static int check(TDB_DATA key, TDB_DATA data, void *private)
 {
 {
@@ -103,8 +104,8 @@ int main(int argc, char *argv[])
 
 
 	plan_tests(4);
 	plan_tests(4);
 	/* This should use mmap. */
 	/* This should use mmap. */
-	tdb = tdb_open("run-corrupt.tdb", 2, TDB_CLEAR_IF_FIRST,
-		       O_CREAT|O_TRUNC|O_RDWR, 0600);
+	tdb = tdb_open_ex("run-corrupt.tdb", 2, TDB_CLEAR_IF_FIRST,
+			  O_CREAT|O_TRUNC|O_RDWR, 0600, &taplogctx, NULL);
 
 
 	if (!tdb)
 	if (!tdb)
 		abort();
 		abort();
@@ -112,8 +113,8 @@ int main(int argc, char *argv[])
 	tdb_close(tdb);
 	tdb_close(tdb);
 
 
 	/* This should not. */
 	/* This should not. */
-	tdb = tdb_open("run-corrupt.tdb", 2, TDB_CLEAR_IF_FIRST|TDB_NOMMAP,
-		       O_CREAT|O_TRUNC|O_RDWR, 0600);
+	tdb = tdb_open_ex("run-corrupt.tdb", 2, TDB_CLEAR_IF_FIRST|TDB_NOMMAP,
+			  O_CREAT|O_TRUNC|O_RDWR, 0600, &taplogctx, NULL);
 
 
 	if (!tdb)
 	if (!tdb)
 		abort();
 		abort();

+ 2 - 20
ccan/tdb/test/run-die-during-transaction.c

@@ -27,6 +27,7 @@ static int ftruncate_check(int fd, off_t length);
 #include <err.h>
 #include <err.h>
 #include <setjmp.h>
 #include <setjmp.h>
 #include "external-agent.h"
 #include "external-agent.h"
+#include "logging.h"
 
 
 #undef write
 #undef write
 #undef pwrite
 #undef pwrite
@@ -34,29 +35,11 @@ static int ftruncate_check(int fd, off_t length);
 #undef ftruncate
 #undef ftruncate
 
 
 static bool in_transaction;
 static bool in_transaction;
-static bool suppress_logging;
 static int target, current;
 static int target, current;
 static jmp_buf jmpbuf;
 static jmp_buf jmpbuf;
 #define TEST_DBNAME "run-die-during-transaction.tdb"
 #define TEST_DBNAME "run-die-during-transaction.tdb"
 #define KEY_STRING "helloworld"
 #define KEY_STRING "helloworld"
 
 
-static void taplog(struct tdb_context *tdb,
-		   enum tdb_debug_level level,
-		   const char *fmt, ...)
-{
-	va_list ap;
-	char line[200];
-
-	if (suppress_logging)
-		return;
-
-	va_start(ap, fmt);
-	vsprintf(line, fmt, ap);
-	va_end(ap);
-
-	diag("%s", line);
-}
-
 static void maybe_die(int fd)
 static void maybe_die(int fd)
 {
 {
 	if (in_transaction && current++ == target) {
 	if (in_transaction && current++ == target) {
@@ -109,7 +92,6 @@ static bool test_death(enum operation op, struct agent *agent)
 {
 {
 	struct tdb_context *tdb = NULL;
 	struct tdb_context *tdb = NULL;
 	TDB_DATA key;
 	TDB_DATA key;
-	struct tdb_logging_context logctx = { taplog, NULL };
 	enum agent_return ret;
 	enum agent_return ret;
 	int needed_recovery = 0;
 	int needed_recovery = 0;
 
 
@@ -172,7 +154,7 @@ reset:
 
 
 	unlink(TEST_DBNAME);
 	unlink(TEST_DBNAME);
 	tdb = tdb_open_ex(TEST_DBNAME, 1024, TDB_NOMMAP,
 	tdb = tdb_open_ex(TEST_DBNAME, 1024, TDB_NOMMAP,
-			  O_CREAT|O_TRUNC|O_RDWR, 0600, &logctx, NULL);
+			  O_CREAT|O_TRUNC|O_RDWR, 0600, &taplogctx, NULL);
 
 
 	/* Put key for agent to fetch. */
 	/* Put key for agent to fetch. */
 	key.dsize = strlen(KEY_STRING);
 	key.dsize = strlen(KEY_STRING);

+ 6 - 3
ccan/tdb/test/run-endian.c

@@ -12,6 +12,7 @@
 #include <ccan/tap/tap.h>
 #include <ccan/tap/tap.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <err.h>
 #include <err.h>
+#include "logging.h"
 
 
 int main(int argc, char *argv[])
 int main(int argc, char *argv[])
 {
 {
@@ -19,8 +20,9 @@ int main(int argc, char *argv[])
 	TDB_DATA key, data;
 	TDB_DATA key, data;
 
 
 	plan_tests(13);
 	plan_tests(13);
-	tdb = tdb_open("run-endian.tdb", 1024, TDB_CLEAR_IF_FIRST|TDB_CONVERT,
-		       O_CREAT|O_TRUNC|O_RDWR, 0600);
+	tdb = tdb_open_ex("run-endian.tdb", 1024,
+			  TDB_CLEAR_IF_FIRST|TDB_CONVERT,
+			  O_CREAT|O_TRUNC|O_RDWR, 0600, &taplogctx, NULL);
 
 
 	ok1(tdb);
 	ok1(tdb);
 	key.dsize = strlen("hi");
 	key.dsize = strlen("hi");
@@ -46,7 +48,8 @@ int main(int argc, char *argv[])
 	tdb_close(tdb);
 	tdb_close(tdb);
 
 
 	/* Reopen: should read it */
 	/* Reopen: should read it */
-	tdb = tdb_open("run-endian.tdb", 1024, 0, O_RDWR, 0);
+	tdb = tdb_open_ex("run-endian.tdb", 1024, 0, O_RDWR, 0,
+			  &taplogctx, NULL);
 	ok1(tdb);
 	ok1(tdb);
 	
 	
 	key.dsize = strlen("hi");
 	key.dsize = strlen("hi");

+ 7 - 3
ccan/tdb/test/run-nested-transactions.c

@@ -13,6 +13,8 @@
 #include <stdlib.h>
 #include <stdlib.h>
 #include <stdbool.h>
 #include <stdbool.h>
 #include <err.h>
 #include <err.h>
+#include "logging.h"
+
 int main(int argc, char *argv[])
 int main(int argc, char *argv[])
 {
 {
 	struct tdb_context *tdb;
 	struct tdb_context *tdb;
@@ -22,8 +24,9 @@ int main(int argc, char *argv[])
 	key.dsize = strlen("hi");
 	key.dsize = strlen("hi");
 	key.dptr = (void *)"hi";
 	key.dptr = (void *)"hi";
 
 
-	tdb = tdb_open("run-nested-transactions.tdb", 1024, TDB_CLEAR_IF_FIRST,
-		       O_CREAT|O_TRUNC|O_RDWR, 0600);
+	tdb = tdb_open_ex("run-nested-transactions.tdb",
+			  1024, TDB_CLEAR_IF_FIRST,
+			  O_CREAT|O_TRUNC|O_RDWR, 0600, &taplogctx, NULL);
 	ok1(tdb);
 	ok1(tdb);
 
 
 	/* No nesting by default. */
 	/* No nesting by default. */
@@ -49,7 +52,8 @@ int main(int argc, char *argv[])
 	free(data.dptr);
 	free(data.dptr);
 	tdb_close(tdb);
 	tdb_close(tdb);
 
 
-	tdb = tdb_open("run-nested-transactions.tdb", 1024, TDB_ALLOW_NESTING, O_RDWR, 0);
+	tdb = tdb_open_ex("run-nested-transactions.tdb",
+			  1024, TDB_ALLOW_NESTING, O_RDWR, 0, &taplogctx, NULL);
 	ok1(tdb);
 	ok1(tdb);
 
 
 	ok1(tdb_transaction_start(tdb) == 0);
 	ok1(tdb_transaction_start(tdb) == 0);

+ 3 - 2
ccan/tdb/test/run-nested-traverse.c

@@ -17,6 +17,7 @@
 #include <stdbool.h>
 #include <stdbool.h>
 #include <err.h>
 #include <err.h>
 #include "external-agent.h"
 #include "external-agent.h"
+#include "logging.h"
 
 
 static struct agent *agent;
 static struct agent *agent;
 
 
@@ -65,8 +66,8 @@ int main(int argc, char *argv[])
 	if (!agent)
 	if (!agent)
 		err(1, "preparing agent");
 		err(1, "preparing agent");
 
 
-	tdb = tdb_open("run-nested-traverse.tdb", 1024, TDB_CLEAR_IF_FIRST,
-		       O_CREAT|O_TRUNC|O_RDWR, 0600);
+	tdb = tdb_open_ex("run-nested-traverse.tdb", 1024, TDB_CLEAR_IF_FIRST,
+			  O_CREAT|O_TRUNC|O_RDWR, 0600, &taplogctx, NULL);
 	ok1(tdb);
 	ok1(tdb);
 
 
 	ok1(external_agent_operation(agent, OPEN, tdb_name(tdb)) == SUCCESS);
 	ok1(external_agent_operation(agent, OPEN, tdb_name(tdb)) == SUCCESS);

+ 4 - 2
ccan/tdb/test/run-no-lock-during-traverse.c

@@ -17,6 +17,7 @@
 #include <ccan/tap/tap.h>
 #include <ccan/tap/tap.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <err.h>
 #include <err.h>
+#include "logging.h"
 
 
 #undef fcntl
 #undef fcntl
 
 
@@ -78,8 +79,9 @@ int main(int argc, char *argv[])
 	int errors = 0;
 	int errors = 0;
 
 
 	plan_tests(41);
 	plan_tests(41);
-	tdb = tdb_open("run-no-lock-during-traverse.tdb",
-		       1024, TDB_CLEAR_IF_FIRST, O_CREAT|O_TRUNC|O_RDWR, 0600);
+	tdb = tdb_open_ex("run-no-lock-during-traverse.tdb",
+			  1024, TDB_CLEAR_IF_FIRST, O_CREAT|O_TRUNC|O_RDWR,
+			  0600, &taplogctx, NULL);
 
 
 	ok1(tdb);
 	ok1(tdb);
 	ok1(prepare_entries(tdb));
 	ok1(prepare_entries(tdb));

+ 2 - 16
ccan/tdb/test/run-open-during-transaction.c

@@ -27,6 +27,7 @@ static int ftruncate_check(int fd, off_t length);
 #include <stdarg.h>
 #include <stdarg.h>
 #include <err.h>
 #include <err.h>
 #include "external-agent.h"
 #include "external-agent.h"
+#include "logging.h"
 
 
 static struct agent *agent;
 static struct agent *agent;
 static bool opened;
 static bool opened;
@@ -39,20 +40,6 @@ static bool clear_if_first;
 #undef fcntl
 #undef fcntl
 #undef ftruncate
 #undef ftruncate
 
 
-static void taplog(struct tdb_context *tdb,
-		   enum tdb_debug_level level,
-		   const char *fmt, ...)
-{
-	va_list ap;
-	char line[200];
-
-	va_start(ap, fmt);
-	vsprintf(line, fmt, ap);
-	va_end(ap);
-
-	diag("%s", line);
-}
-
 static bool is_same(const char *snapshot, const char *latest, off_t len)
 static bool is_same(const char *snapshot, const char *latest, off_t len)
 {
 {
 	unsigned i;
 	unsigned i;
@@ -154,7 +141,6 @@ static int ftruncate_check(int fd, off_t length)
 
 
 int main(int argc, char *argv[])
 int main(int argc, char *argv[])
 {
 {
-	struct tdb_logging_context logctx = { taplog, NULL };
 	const int flags[] = { TDB_DEFAULT,
 	const int flags[] = { TDB_DEFAULT,
 			      TDB_CLEAR_IF_FIRST,
 			      TDB_CLEAR_IF_FIRST,
 			      TDB_NOMMAP, 
 			      TDB_NOMMAP, 
@@ -177,7 +163,7 @@ int main(int argc, char *argv[])
 		unlink(TEST_DBNAME);
 		unlink(TEST_DBNAME);
 		tdb = tdb_open_ex(TEST_DBNAME, 1024, flags[i],
 		tdb = tdb_open_ex(TEST_DBNAME, 1024, flags[i],
 				  O_CREAT|O_TRUNC|O_RDWR, 0600,
 				  O_CREAT|O_TRUNC|O_RDWR, 0600,
-				  &logctx, NULL);
+				  &taplogctx, NULL);
 		ok1(tdb);
 		ok1(tdb);
 
 
 		opened = true;
 		opened = true;

+ 4 - 2
ccan/tdb/test/run-traverse-in-transaction.c

@@ -17,6 +17,7 @@
 #include <stdbool.h>
 #include <stdbool.h>
 #include <err.h>
 #include <err.h>
 #include "external-agent.h"
 #include "external-agent.h"
+#include "logging.h"
 
 
 static struct agent *agent;
 static struct agent *agent;
 
 
@@ -50,8 +51,9 @@ int main(int argc, char *argv[])
 	if (!agent)
 	if (!agent)
 		err(1, "preparing agent");
 		err(1, "preparing agent");
 
 
-	tdb = tdb_open("run-traverse-in-transaction.tdb",
-		       1024, TDB_CLEAR_IF_FIRST, O_CREAT|O_TRUNC|O_RDWR, 0600);
+	tdb = tdb_open_ex("run-traverse-in-transaction.tdb",
+			  1024, TDB_CLEAR_IF_FIRST, O_CREAT|O_TRUNC|O_RDWR,
+			  0600, &taplogctx, NULL);
 	ok1(tdb);
 	ok1(tdb);
 
 
 	key.dsize = strlen("hi");
 	key.dsize = strlen("hi");

+ 3 - 1
ccan/tdb/test/run-zero-append.c

@@ -12,6 +12,7 @@
 #include <ccan/tap/tap.h>
 #include <ccan/tap/tap.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <err.h>
 #include <err.h>
+#include "logging.h"
 
 
 int main(int argc, char *argv[])
 int main(int argc, char *argv[])
 {
 {
@@ -19,7 +20,8 @@ int main(int argc, char *argv[])
 	TDB_DATA key, data;
 	TDB_DATA key, data;
 
 
 	plan_tests(4);
 	plan_tests(4);
-	tdb = tdb_open(NULL, 1024, TDB_INTERNAL, O_CREAT|O_TRUNC|O_RDWR, 0600);
+	tdb = tdb_open_ex(NULL, 1024, TDB_INTERNAL, O_CREAT|O_TRUNC|O_RDWR,
+			  0600, &taplogctx, NULL);
 	ok1(tdb);
 	ok1(tdb);
 
 
 	/* Tickle bug on appending zero length buffer to zero length buffer. */
 	/* Tickle bug on appending zero length buffer to zero length buffer. */

+ 3 - 2
ccan/tdb/test/run.c

@@ -12,6 +12,7 @@
 #include <ccan/tap/tap.h>
 #include <ccan/tap/tap.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <err.h>
 #include <err.h>
+#include "logging.h"
 
 
 int main(int argc, char *argv[])
 int main(int argc, char *argv[])
 {
 {
@@ -19,8 +20,8 @@ int main(int argc, char *argv[])
 	TDB_DATA key, data;
 	TDB_DATA key, data;
 
 
 	plan_tests(10);
 	plan_tests(10);
-	tdb = tdb_open("run.tdb", 1024, TDB_CLEAR_IF_FIRST,
-		       O_CREAT|O_TRUNC|O_RDWR, 0600);
+	tdb = tdb_open_ex("run.tdb", 1024, TDB_CLEAR_IF_FIRST,
+			  O_CREAT|O_TRUNC|O_RDWR, 0600, &taplogctx, NULL);
 
 
 	ok1(tdb);
 	ok1(tdb);
 	key.dsize = strlen("hi");
 	key.dsize = strlen("hi");