From: Ronnie sahlberg Date: Thu, 12 Apr 2007 23:44:56 +0000 (+1000) Subject: add more elaborate test to fetch1 test X-Git-Tag: tevent-0.9.20~348^2~2929^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=673b879a3fa4728b37d4d6556e40f17eb1fbefcf;p=thirdparty%2Fsamba.git add more elaborate test to fetch1 test for now: fetch a record store a known entry for this record fetch the record again (and later verify we got the same record) store it back again this will not work right now since we dont yet store the record inside the daemon (This used to be ctdb commit f502094499a3c25ab58aa3d192588b5e6dd2b8e4) --- diff --git a/ctdb/tests/ctdb_fetch1.c b/ctdb/tests/ctdb_fetch1.c index 29a4fc9a62b..4e5bf63b605 100644 --- a/ctdb/tests/ctdb_fetch1.c +++ b/ctdb/tests/ctdb_fetch1.c @@ -42,7 +42,7 @@ int main(int argc, const char *argv[]) const char *myaddress = NULL; int self_connect=0; int daemon_mode=0; - TDB_DATA key, *data, store_data; + TDB_DATA key, *data, *data2, store_data; struct ctdb_record_handle *rh; struct poptOption popt_options[] = { @@ -146,6 +146,14 @@ int main(int argc, const char *argv[]) ret = ctdb_store_unlock(rh, store_data); printf("ctdb_store_unlock ret:%d\n",ret); + data2 = NULL; + rh = ctdb_fetch_lock(ctdb_db, ctdb_db, key, data2); +/* hopefully data2 will now contain the record written above */ + + /* just write it back to unlock it */ + ret = ctdb_store_unlock(rh, data2); + printf("ctdb_store_unlock ret:%d\n",ret); + while (1) { event_loop_once(ev); }