}
/* The calculation part of the IP allocation algorithm. */
-static bool ctdb_takeover_run_core(struct ipalloc_state *ipalloc_state)
+static bool ipalloc(struct ipalloc_state *ipalloc_state)
{
bool ret;
ipalloc_state->force_rebalance_nodes = force_rebalance_nodes;
/* Do the IP reassignment calculations */
- ctdb_takeover_run_core(ipalloc_state);
+ ipalloc(ipalloc_state);
/* Now tell all nodes to release any public IPs should not
* host. This will be a NOOP on nodes that don't currently
* by a blank line. This mode is for testing weird behaviours where
* the IP layouts differs across nodes and we want to improve
* create_merged_ip_list(), so should only be used in tests of
- * ctdb_takeover_run_core(). Yes, it is a hack... :-)
+ * ipalloc(). Yes, it is a hack... :-)
*/
static void ctdb_test_init(const char nodestates[],
struct ctdb_context **ctdb,
/* IP layout is read from stdin. See comment for ctdb_test_init() for
* explanation of read_ips_for_multiple_nodes.
*/
-static void ctdb_test_ctdb_takeover_run_core(const char nodestates[],
- bool read_ips_for_multiple_nodes)
+static void ctdb_test_ipalloc(const char nodestates[],
+ bool read_ips_for_multiple_nodes)
{
struct ctdb_context *ctdb;
struct ipalloc_state *ipalloc_state;
ctdb_test_init(nodestates, &ctdb, &ipalloc_state,
read_ips_for_multiple_nodes);
- ctdb_takeover_run_core(ipalloc_state);
+ ipalloc(ipalloc_state);
print_ctdb_public_ip_list(ipalloc_state->all_ips);
} else if (argc == 3 && strcmp(argv[1], "lcp2_failback_loop") == 0) {
ctdb_test_lcp2_failback_loop(argv[2]);
} else if (argc == 3 &&
- strcmp(argv[1], "ctdb_takeover_run_core") == 0) {
- ctdb_test_ctdb_takeover_run_core(argv[2], false);
+ strcmp(argv[1], "ipalloc") == 0) {
+ ctdb_test_ipalloc(argv[2], false);
} else if (argc == 4 &&
- strcmp(argv[1], "ctdb_takeover_run_core") == 0 &&
+ strcmp(argv[1], "ipalloc") == 0 &&
strcmp(argv[3], "multi") == 0) {
- ctdb_test_ctdb_takeover_run_core(argv[2], true);
+ ctdb_test_ipalloc(argv[2], true);
} else {
usage();
}
# Written while asleep...
# Convert the cluster state to something that be fed to
- # ctdb_takeover_tests ctdb_takeover_run_core ...
+ # ctdb_takeover_tests ipalloc ...
in_lines = []
for ip in sorted(list(self.all_public_ips)):
else:
os.environ["CTDB_TEST_LOGLEVEL"] = "0"
- p = subprocess.Popen("../../bin/ctdb_takeover_tests ctdb_takeover_run_core %s 2>&1" % nodestates,
+ p = subprocess.Popen("../../bin/ctdb_takeover_tests ipalloc %s 2>&1" % nodestates,
shell=True,
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
p.stdin.write("\n".join(in_lines))