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_update_record_persistent \
- tests/bin/ctdb_tool_libctdb tests/bin/ctdb_tool_stubby \
+ tests/bin/ctdb_functest tests/bin/ctdb_stubtest \
tests/bin/ctdb_porting_tests tests/bin/ctdb_lock_tdb \
@INFINIBAND_BINS@
CTDB_SERVER_MOST_OBJ = $(CTDB_SERVER_OBJ:server/ctdbd.o=)
CTDBD_TEST_C = $(CTDB_SERVER_MOST_OBJ:.o=.c) tests/src/ctdbd_test.c
-CTDB_TEST_C = $(CTDB_CLIENT_OBJ:.o=.c) tools/ctdb.c tools/ctdb_vacuum.c tests/src/ctdb_test.c
+CTDB_TEST_C = $(CTDB_CLIENT_OBJ:.o=.c) tools/ctdb.c tools/ctdb_vacuum.c tests/src/ctdb_test_stubs.c
CTDB_TEST_OBJ = $(TALLOC_OBJ) $(TDB_OBJ) \
@CTDB_SYSTEM_OBJ@ $(REPLACE_OBJ) $(EXTRA_OBJ) $(TEVENT_OBJ) $(SOCKET_WRAPPER_OBJ)
@echo Linking $@
$(WRAPPER) $(CC) $(CFLAGS) -o $@ tests/src/ctdb_takeover_tests.o $(CTDB_TEST_OBJ) $(LIB_FLAGS)
-tests/src/ctdb_tool_libctdb.o: tests/src/ctdb_tool_libctdb.c tests/src/libctdb_test.c $(CTDB_TEST_C)
+tests/src/ctdb_functest.o: tests/src/ctdb_functest.c tests/src/ctdb_test.c $(CTDB_TEST_C)
-tests/bin/ctdb_tool_libctdb: $(CTDB_TEST_OBJ) tests/src/ctdb_tool_libctdb.o
+tests/bin/ctdb_functest: tests/src/ctdb_functest.o $(CTDB_TEST_OBJ)
@echo Linking $@
- $(WRAPPER) $(CC) $(CFLAGS) -o $@ tests/src/ctdb_tool_libctdb.o $(CTDB_TEST_OBJ) $(POPT_OBJ) $(LIB_FLAGS)
+ $(WRAPPER) $(CC) $(CFLAGS) -o $@ $^ $(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/src/ctdb_test.o: tests/src/ctdb_test.c $(CTDB_TEST_C)
-tests/bin/ctdb_tool_stubby: $(CTDB_TEST_OBJ) tests/src/ctdb_tool_stubby.o
+tests/bin/ctdb_stubtest: tests/src/ctdb_test.o $(CTDB_TEST_OBJ)
@echo Linking $@
- $(WRAPPER) $(CC) $(CFLAGS) -o $@ tests/src/ctdb_tool_stubby.o $(CTDB_TEST_OBJ) $(POPT_OBJ) $(LIB_FLAGS)
+ $(WRAPPER) $(CC) $(CFLAGS) -o $@ $^ $(POPT_OBJ) $(LIB_FLAGS)
tests/bin/ctdb_lock_tdb: tests/src/ctdb_lock_tdb.o $(CTDB_CLIENT_OBJ)
@echo Linking $@
/*
- Tests for tools/ctdb.c and libctdb stubs
+ Tests for tools/ctdb.c and CTDB client stubs
Copyright (C) Martin Schwenke 2011
{
struct ctdb_context *ctdb = talloc_zero(NULL, struct ctdb_context);
- libctdb_test_read_nodemap(ctdb);
- libctdb_test_print_nodemap(ctdb);
+ ctdb_test_stubs_read_nodemap(ctdb);
+ ctdb_test_stubs_print_nodemap(ctdb);
talloc_free(ctdb);
}
{
struct ctdb_context *ctdb = talloc_zero(NULL, struct ctdb_context);
- libctdb_test_read_ifaces(ctdb);
- libctdb_test_print_ifaces(ctdb);
+ ctdb_test_stubs_read_ifaces(ctdb);
+ ctdb_test_stubs_print_ifaces(ctdb);
talloc_free(ctdb);
}
{
struct ctdb_context *ctdb = talloc_zero(NULL, struct ctdb_context);
- libctdb_test_read_vnnmap(ctdb);
- libctdb_test_print_vnnmap(ctdb);
+ ctdb_test_stubs_read_vnnmap(ctdb);
+ ctdb_test_stubs_print_vnnmap(ctdb);
talloc_free(ctdb);
}
bool first = true;
struct ctdb_context *ctdb = talloc_zero(NULL, struct ctdb_context);
- libctdb_test_fake_setup(ctdb);
+ ctdb_test_stubs_fake_setup(ctdb);
if (ctdb->nodes != NULL) {
if (!first) {
printf("\n");
}
printf("NODEMAP\n");
- libctdb_test_print_nodemap(ctdb);
+ ctdb_test_stubs_print_nodemap(ctdb);
first = false;
}
printf("\n");
}
printf("IFACES\n");
- libctdb_test_print_ifaces(ctdb);
+ ctdb_test_stubs_print_ifaces(ctdb);
first = false;
}
printf("\n");
}
printf("VNNMAP\n");
- libctdb_test_print_vnnmap(ctdb);
+ ctdb_test_stubs_print_vnnmap(ctdb);
first = false;
}
ctdb = talloc_zero(NULL, struct ctdb_context);
- libctdb_test_read_nodemap(ctdb);
+ ctdb_test_stubs_read_nodemap(ctdb);
if (parse_nodestring(ctdb, NULL, nodestring, CTDB_CURRENT_NODE, dd_ok,
&nodes, &pnn_mode)) {
static void usage(void)
{
- fprintf(stderr, "usage: ctdb_tool_libctdb <op>\n");
+ fprintf(stderr, "usage: ctdb_tool_functest <op>\n");
exit(1);
}
#include "client/ctdb_client.c"
/* TEST STUBS */
-#include "libctdb_test.c"
+#include "ctdb_test_stubs.c"
#endif /* _CTDBD_TEST_C */
/*
- Test stubs and support functions for some libctdb functions
+ Test stubs and support functions for some CTDB client functions
Copyright (C) Martin Schwenke 2011
* <PNN> <FLAGS> [RECMASTER] [CURRENT]
* EOF or a blank line terminates input.
*/
-void libctdb_test_read_nodemap(struct ctdb_context *ctdb)
+void ctdb_test_stubs_read_nodemap(struct ctdb_context *ctdb)
{
char line[1024];
}
}
-void libctdb_test_print_nodemap(struct ctdb_context *ctdb)
+void ctdb_test_stubs_print_nodemap(struct ctdb_context *ctdb)
{
int i;
uint32_t references;
};
-void libctdb_test_read_ifaces(struct ctdb_context *ctdb)
+void ctdb_test_stubs_read_ifaces(struct ctdb_context *ctdb)
{
char line[1024];
struct ctdb_iface *iface;
}
}
-void libctdb_test_print_ifaces(struct ctdb_context *ctdb)
+void ctdb_test_stubs_print_ifaces(struct ctdb_context *ctdb)
{
struct ctdb_iface *iface;
uint32_t *map;
};
*/
-void libctdb_test_read_vnnmap(struct ctdb_context *ctdb)
+void ctdb_test_stubs_read_vnnmap(struct ctdb_context *ctdb)
{
char line[1024];
}
}
-void libctdb_test_print_vnnmap(struct ctdb_context *ctdb)
+void ctdb_test_stubs_print_vnnmap(struct ctdb_context *ctdb)
{
int i;
}
}
-void libctdb_test_fake_setup(struct ctdb_context *ctdb)
+void ctdb_test_stubs_fake_setup(struct ctdb_context *ctdb)
{
char line[1024];
}
if (strcmp(line, "NODEMAP") == 0) {
- libctdb_test_read_nodemap(ctdb);
+ ctdb_test_stubs_read_nodemap(ctdb);
} else if (strcmp(line, "IFACES") == 0) {
- libctdb_test_read_ifaces(ctdb);
+ ctdb_test_stubs_read_ifaces(ctdb);
} else if (strcmp(line, "VNNMAP") == 0) {
- libctdb_test_read_vnnmap(ctdb);
+ ctdb_test_stubs_read_vnnmap(ctdb);
} else {
printf("Unknown line %s\n", line);
exit(1);
ctdb_set_socketname(ctdb, "fake");
- libctdb_test_fake_setup(ctdb);
+ ctdb_test_stubs_fake_setup(ctdb);
return ctdb;
}
+++ /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/>.
-*/
-
-#include "ctdb_test.c"
* func.<some_function>.NNN.sh
Run <some_function> in the ctdb tool code using the
- ctdb_tool_libctdb test program. This test program uses test stubs
- for libctdb functions.
+ ctdb_tool_functest test program. This test program uses test stubs
+ for CTDB client functions.
* stubby.<command>.NNN.sh
Run the ctdb_tool_stubby test program with <command> as the 1st
argument - subsequent are passed to simple_test(). ctdb_tool_stubby
- is linked against the test stubs for libctdb functions.
+ is linked against the test stubs for CTDB client functions.
-To add tests here you may need to change commands/functions in the
-ctdb tool so that they use libctdb. You will also need to add the
-appropriate test stubs.
+To add tests here you may need to add appropriate test stubs.
func.*)
_func="${_f#func.}"
_func="${_func%.*}" # Strip test number
- test_prog="ctdb_tool_libctdb ${_func}"
+ test_prog="ctdb_functest ${_func}"
;;
stubby.*)
_cmd="${_f#stubby.}"
_cmd="${_cmd%.*}" # Strip test number
- test_prog="ctdb_tool_stubby ${_cmd}"
+ test_prog="ctdb_stubtest ${_cmd}"
;;
*)
die "Unknown pattern for testcase \"$_f\""