summaryrefslogtreecommitdiff
path: root/lib/tdb2/test
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-09-14 08:11:13 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-09-14 08:11:13 +0930
commit85fe9cffe529fd6a8c76ca5f0e3c68c090ce25bf (patch)
treeb115b236b8c142833137041a5804ee2e549f0f3c /lib/tdb2/test
parent26f3587d4bf60fe3c82084a7661c4f856534725f (diff)
downloadsamba-85fe9cffe529fd6a8c76ca5f0e3c68c090ce25bf.tar.gz
samba-85fe9cffe529fd6a8c76ca5f0e3c68c090ce25bf.tar.bz2
samba-85fe9cffe529fd6a8c76ca5f0e3c68c090ce25bf.zip
tdb2: return TDB_ERR_RDONLY from transactions on R/O databases, log nesting
Rather than rturning TDB_ERR_EINVAL, return TDB_ERR_RDONLY, and log when we fail due to nesting. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 27647f94668040d91de377849dce87dabd72be69)
Diffstat (limited to 'lib/tdb2/test')
-rw-r--r--lib/tdb2/test/run-tdb1-nested-transactions.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/tdb2/test/run-tdb1-nested-transactions.c b/lib/tdb2/test/run-tdb1-nested-transactions.c
index a6a815363c..149e5318a0 100644
--- a/lib/tdb2/test/run-tdb1-nested-transactions.c
+++ b/lib/tdb2/test/run-tdb1-nested-transactions.c
@@ -15,7 +15,7 @@ int main(int argc, char *argv[])
hsize.base.next = &tap_log_attr;
hsize.tdb1_hashsize.hsize = 1024;
- plan_tests(29);
+ plan_tests(30);
key.dsize = strlen("hi");
key.dptr = (void *)"hi";
@@ -33,6 +33,7 @@ int main(int argc, char *argv[])
ok1(memcmp(data.dptr, "world", strlen("world")) == 0);
free(data.dptr);
ok1(tdb_transaction_start(tdb) == TDB_ERR_EINVAL);
+ ok1(tap_log_messages == 1);
ok1(tdb_fetch(tdb, key, &data) == TDB_SUCCESS);
ok1(data.dsize == strlen("world"));
@@ -55,7 +56,7 @@ int main(int argc, char *argv[])
ok1(tdb_transaction_commit(tdb) == TDB_SUCCESS);
ok1(!tdb_exists(tdb, key));
tdb_transaction_cancel(tdb);
- ok1(tap_log_messages == 0);
+ ok1(tap_log_messages == 1);
/* Surprise! Kills inner "committed" transaction. */
ok1(tdb_exists(tdb, key));