summaryrefslogtreecommitdiff
path: root/ctdb/tests
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2015-10-29 16:49:44 +1100
committerAmitay Isaacs <amitay@samba.org>2015-11-20 01:36:31 +0100
commitcfa0ffe78073f9e3a014bb127fb9a4b7ad95fceb (patch)
tree55fbe405966cc3555a39028c614a1cf375a40953 /ctdb/tests
parentd7739d8a7f2d72c5cf6d77272d11f5dd859b6010 (diff)
downloadsamba-cfa0ffe78073f9e3a014bb127fb9a4b7ad95fceb.tar.gz
ctdb-ipalloc: Move IP allocation state into its own struct
Most of the IP allocation code does not need a CTDB context. However, temporarily hang this off the CTDB context and make only the changes relating to known/available IP address. This makes those logic changes obvious without burying them in function type changes. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/tests')
-rw-r--r--ctdb/tests/src/ctdb_takeover_tests.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ctdb/tests/src/ctdb_takeover_tests.c b/ctdb/tests/src/ctdb_takeover_tests.c
index f26515834a5..8a9938280db 100644
--- a/ctdb/tests/src/ctdb_takeover_tests.c
+++ b/ctdb/tests/src/ctdb_takeover_tests.c
@@ -496,6 +496,8 @@ static void ctdb_test_init(const char nodestates[],
(*ctdb)->nodes = talloc_array(*ctdb, struct ctdb_node *, numnodes); // FIXME: bogus size, overkill
+ (*ctdb)->ipalloc_state = ipalloc_state_init(*ctdb, *ctdb);
+
for (i=0; i < numnodes; i++) {
nodemap->nodes[i].pnn = i;
nodemap->nodes[i].flags = nodeflags[i];
@@ -509,8 +511,9 @@ static void ctdb_test_init(const char nodestates[],
(*ctdb)->nodes[i] = talloc(*ctdb, struct ctdb_node);
(*ctdb)->nodes[i]->pnn = i;
(*ctdb)->nodes[i]->flags = nodeflags[i];
- (*ctdb)->nodes[i]->available_public_ips = avail[i];
- (*ctdb)->nodes[i]->known_public_ips = known[i];
+
+ (*ctdb)->ipalloc_state->available_public_ips[i] = avail[i];
+ (*ctdb)->ipalloc_state->known_public_ips[i] = known[i];
}
*ipflags = set_ipflags_internal(*ctdb, *ctdb, nodemap,