tests/bin/ctdb_randrec tests/bin/ctdb_persistent \
tests/bin/ctdb_traverse tests/bin/rb_test tests/bin/ctdb_transaction \
tests/bin/ctdb_takeover_tests tests/bin/ctdb_update_record \
- tests/bin/ctdb_tool_libctdb \
+ tests/bin/ctdb_tool_libctdb tests/bin/ctdb_tool_stubby \
@INFINIBAND_BINS@
BINS = bin/ctdb @CTDB_SCSI_IO@ bin/smnotify bin/ping_pong bin/ltdbtool @CTDB_PMDA@
@echo Linking $@
@$(CC) $(CFLAGS) -o $@ tests/src/ctdb_tool_libctdb.o $(CTDB_TEST_OBJ) @POPT_OBJ@ $(LIB_FLAGS)
+tests/src/ctdb_tool_stubby.o: tests/src/ctdb_tool_stubby.c tests/src/libctdb_test.c $(CTDB_TEST_C)
+
+tests/bin/ctdb_tool_stubby: $(CTDB_TEST_OBJ) tests/src/ctdb_tool_stubby.o
+ @echo Linking $@
+ @$(CC) $(CFLAGS) -o $@ tests/src/ctdb_tool_stubby.o $(CTDB_TEST_OBJ) @POPT_OBJ@ $(LIB_FLAGS)
+
tests/bin/ibwrapper_test: $(CTDB_CLIENT_OBJ) ib/ibwrapper_test.o
@echo Linking $@
@$(CC) $(CFLAGS) -o $@ ib/ibwrapper_test.o $(CTDB_CLIENT_OBJ) $(LIB_FLAGS)
--- /dev/null
+/*
+ Tests wrapper for tools/ctdb.c that uses stubs
+
+ Copyright (C) Martin Schwenke 2011
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#define CTDB_TEST_USE_MAIN
+#include "ctdb_test.c"
+
+#include "libctdb_test.c"
+
+void tevent_loop_allow_nesting_foobar(struct tevent_context *ev)
+{
+ return;
+}
+
+struct ctdb_context *ctdb_cmdline_client_foobar(struct tevent_context *ev,
+ struct timeval req_timeout)
+{
+ struct ctdb_context *ret;
+
+ ret = talloc(NULL, struct ctdb_context);
+
+ return ret;
+}
+
+struct tevent_context *tevent_context_init_foobar(TALLOC_CTX *mem_ctx)
+{
+ /* This should obviously never be used... */
+ return (struct tevent_context *) 1;
+}
+
+const char *ctdb_get_socketname_foobar(struct ctdb_context *ctdb)
+{
+ return LIBCTDB_TEST_FAKESTATE;
+}