summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/src
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2011-12-15 11:26:57 +1100
committerMartin Schwenke <martin@meltin.net>2012-02-06 16:00:24 +1100
commit31487f31df154e29bdc8060cc8dfce4b436c6bf0 (patch)
treed2a200cc23db0ef766013a9ef71258548fb2a0e2 /ctdb/tests/src
parente2ceae48e382e47ca175231cda8581020dd8a000 (diff)
Tests - add a version of the ctdb tool that compiles against libctdb stubs
Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 6c79b951c3ae68238f8dbd836ceca6c1187eaabe)
Diffstat (limited to 'ctdb/tests/src')
-rw-r--r--ctdb/tests/src/ctdb_tool_stubby.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/ctdb/tests/src/ctdb_tool_stubby.c b/ctdb/tests/src/ctdb_tool_stubby.c
new file mode 100644
index 0000000000..c388c63070
--- /dev/null
+++ b/ctdb/tests/src/ctdb_tool_stubby.c
@@ -0,0 +1,49 @@
+/*
+ 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;
+}