+++ /dev/null
-#!/usr/bin/env bash
-
-# Verify the operation of 'ctdb isnotrecmaster'
-
-. "${TEST_SCRIPTS_DIR}/integration.bash"
-
-set -e
-
-ctdb_test_init
-
-cmd="$CTDB isnotrecmaster || true"
-try_command_on_node -v all "$cmd"
-
-num_all_lines=$(wc -l <"$outfile")
-num_rm_lines=$(grep -Fc 'this node is the recmaster' "$outfile") || true
-num_not_rm_lines=$(grep -Fc 'this node is not the recmaster' "$outfile") || true
-
-if [ $num_rm_lines -eq 1 ] ; then
- echo "OK, there is only 1 recmaster"
-else
- die "BAD, there are ${num_rm_lines} nodes claiming to be the recmaster"
-fi
-
-if [ $(($num_all_lines - $num_not_rm_lines)) -eq 1 ] ; then
- echo "OK, all the other nodes claim not to be the recmaster"
-else
- die "BAD, there are only ${num_not_rm_lines} notrecmaster nodes"
-fi
return ipreallocate(mem_ctx, ctdb);
}
-static int control_isnotrecmaster(TALLOC_CTX *mem_ctx,
- struct ctdb_context *ctdb,
- int argc, const char **argv)
-{
- uint32_t recmaster;
- int ret;
-
- if (argc != 0) {
- usage("isnotrecmaster");
- }
-
- ret = ctdb_ctrl_get_recmaster(mem_ctx, ctdb->ev, ctdb->client,
- ctdb->pnn, TIMEOUT(), &recmaster);
- if (ret != 0) {
- fprintf(stderr, "Failed to get recmaster\n");
- return ret;
- }
-
- if (recmaster != ctdb->pnn) {
- printf("this node is not the recmaster\n");
- return 1;
- }
-
- printf("this node is the recmaster\n");
- return 0;
-}
-
static int control_gratarp(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
int argc, const char **argv)
{
"run ip reallocation (deprecated)", NULL },
{ "ipreallocate", control_ipreallocate, false, true,
"run ip reallocation", NULL },
- { "isnotrecmaster", control_isnotrecmaster, false, false,
- "check if local node is the recmaster", NULL },
{ "gratarp", control_gratarp, false, true,
"send a gratuitous arp", "<ip> <interface>" },
{ "tickle", control_tickle, true, false,