ctdb-tests: Test stub fixes
authorMartin Schwenke <martin@meltin.net>
Sat, 7 Feb 2015 21:14:41 +0000 (08:14 +1100)
committerAmitay Isaacs <amitay@samba.org>
Mon, 16 Mar 2015 05:41:06 +0000 (06:41 +0100)
Initialise ctdb->ev in ctdb_cmdline_client_stub().

Add a comment to tevent_context_init_stub() explaining why the ctdb
context is initialised there instead of ctdb_cmdline_client_stub().
This information is in the git log but that doesn't help someone who
is reading the code.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/src/ctdb_test_stubs.c

index 3e12177332e16655474bda4d3fadeadd95e281fb..6dff4a8ced3a8d3b8e27de68f552500501259c22 100644 (file)
@@ -367,6 +367,8 @@ struct ctdb_context *ctdb_cmdline_client_stub(struct tevent_context *ev,
                DEBUGLEVEL = 0;
        }
 
+       ctdb_global->ev = ev;
+
        return ctdb_global;
 }
 
@@ -374,6 +376,8 @@ struct tevent_context *tevent_context_init_stub(TALLOC_CTX *mem_ctx)
 {
        struct ctdb_context *ctdb;
 
+       /* This needs to be initialised prior to the client setup, for
+          the xpnn stub */
        ctdb = talloc_zero(NULL, struct ctdb_context);
 
        ctdb_set_socketname(ctdb, "fake");