s4:NBT-WINSREPLICATION: fix compiler warnings
[Samba/fernandojvsilva.git] / source4 / torture / nbt / winsreplication.c
bloba693f2490af1de654d1712fc055ee9332813c628
1 /*
2 Unix SMB/CIFS implementation.
4 WINS replication testing
6 Copyright (C) Andrew Tridgell 2005
7 Copyright (C) Stefan Metzmacher 2005
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "includes.h"
24 #include "libcli/wrepl/winsrepl.h"
25 #include "lib/events/events.h"
26 #include "lib/socket/socket.h"
27 #include "system/network.h"
28 #include "lib/socket/netif.h"
29 #include "librpc/gen_ndr/ndr_nbt.h"
30 #include "torture/torture.h"
31 #include "torture/nbt/proto.h"
32 #include "param/param.h"
34 #define CHECK_STATUS(tctx, status, correct) \
35 torture_assert_ntstatus_equal(tctx, status, correct, \
36 "Incorrect status")
38 #define CHECK_VALUE(tctx, v, correct) \
39 torture_assert(tctx, (v) == (correct), \
40 talloc_asprintf(tctx, "Incorrect value %s=%d - should be %d\n", \
41 #v, v, correct))
43 #define CHECK_VALUE_UINT64(tctx, v, correct) \
44 torture_assert(tctx, (v) == (correct), \
45 talloc_asprintf(tctx, "Incorrect value %s=%llu - should be %llu\n", \
46 #v, (long long)v, (long long)correct))
48 #define CHECK_VALUE_STRING(tctx, v, correct) \
49 torture_assert_str_equal(tctx, v, correct, "Invalid value")
51 #define _NBT_NAME(n,t,s) {\
52 .name = n,\
53 .type = t,\
54 .scope = s\
57 static const char *wrepl_name_type_string(enum wrepl_name_type type)
59 switch (type) {
60 case WREPL_TYPE_UNIQUE: return "UNIQUE";
61 case WREPL_TYPE_GROUP: return "GROUP";
62 case WREPL_TYPE_SGROUP: return "SGROUP";
63 case WREPL_TYPE_MHOMED: return "MHOMED";
65 return "UNKNOWN_TYPE";
68 static const char *wrepl_name_state_string(enum wrepl_name_state state)
70 switch (state) {
71 case WREPL_STATE_ACTIVE: return "ACTIVE";
72 case WREPL_STATE_RELEASED: return "RELEASED";
73 case WREPL_STATE_TOMBSTONE: return "TOMBSTONE";
74 case WREPL_STATE_RESERVED: return "RESERVED";
76 return "UNKNOWN_STATE";
80 test how assoc_ctx's are only usable on the connection
81 they are created on.
83 static bool test_assoc_ctx1(struct torture_context *tctx)
85 bool ret = true;
86 struct wrepl_request *req;
87 struct wrepl_socket *wrepl_socket1;
88 struct wrepl_associate associate1;
89 struct wrepl_socket *wrepl_socket2;
90 struct wrepl_associate associate2;
91 struct wrepl_pull_table pull_table;
92 struct wrepl_packet packet;
93 struct wrepl_send_ctrl ctrl;
94 struct wrepl_packet *rep_packet;
95 struct wrepl_associate_stop assoc_stop;
96 NTSTATUS status;
97 struct nbt_name name;
98 const char *address;
100 if (!torture_nbt_get_name(tctx, &name, &address))
101 return false;
103 torture_comment(tctx, "Test if assoc_ctx is only valid on the conection it was created on\n");
105 wrepl_socket1 = wrepl_socket_init(tctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx));
106 wrepl_socket2 = wrepl_socket_init(tctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx));
108 torture_comment(tctx, "Setup 2 wrepl connections\n");
109 status = wrepl_connect(wrepl_socket1, wrepl_best_ip(tctx->lp_ctx, address), address);
110 CHECK_STATUS(tctx, status, NT_STATUS_OK);
112 status = wrepl_connect(wrepl_socket2, wrepl_best_ip(tctx->lp_ctx, address), address);
113 CHECK_STATUS(tctx, status, NT_STATUS_OK);
115 torture_comment(tctx, "Send a start association request (conn1)\n");
116 status = wrepl_associate(wrepl_socket1, &associate1);
117 CHECK_STATUS(tctx, status, NT_STATUS_OK);
119 torture_comment(tctx, "association context (conn1): 0x%x\n", associate1.out.assoc_ctx);
121 torture_comment(tctx, "Send a start association request (conn2)\n");
122 status = wrepl_associate(wrepl_socket2, &associate2);
123 CHECK_STATUS(tctx, status, NT_STATUS_OK);
125 torture_comment(tctx, "association context (conn2): 0x%x\n", associate2.out.assoc_ctx);
127 torture_comment(tctx, "Send a replication table query, with assoc 1 (conn2), the anwser should be on conn1\n");
128 ZERO_STRUCT(packet);
129 packet.opcode = WREPL_OPCODE_BITS;
130 packet.assoc_ctx = associate1.out.assoc_ctx;
131 packet.mess_type = WREPL_REPLICATION;
132 packet.message.replication.command = WREPL_REPL_TABLE_QUERY;
133 ZERO_STRUCT(ctrl);
134 ctrl.send_only = true;
135 req = wrepl_request_send(wrepl_socket2, &packet, &ctrl);
136 status = wrepl_request_recv(req, tctx, &rep_packet);
137 CHECK_STATUS(tctx, status, NT_STATUS_OK);
139 torture_comment(tctx, "Send a association request (conn2), to make sure the last request was ignored\n");
140 status = wrepl_associate(wrepl_socket2, &associate2);
141 CHECK_STATUS(tctx, status, NT_STATUS_OK);
143 torture_comment(tctx, "Send a replication table query, with invalid assoc (conn1), receive answer from conn2\n");
144 pull_table.in.assoc_ctx = 0;
145 req = wrepl_pull_table_send(wrepl_socket1, &pull_table);
146 status = wrepl_request_recv(req, tctx, &rep_packet);
147 CHECK_STATUS(tctx, status, NT_STATUS_OK);
149 torture_comment(tctx, "Send a association request (conn1), to make sure the last request was handled correct\n");
150 status = wrepl_associate(wrepl_socket1, &associate2);
151 CHECK_STATUS(tctx, status, NT_STATUS_OK);
153 assoc_stop.in.assoc_ctx = associate1.out.assoc_ctx;
154 assoc_stop.in.reason = 4;
155 torture_comment(tctx, "Send a association stop request (conn1), reson: %u\n", assoc_stop.in.reason);
156 status = wrepl_associate_stop(wrepl_socket1, &assoc_stop);
157 CHECK_STATUS(tctx, status, NT_STATUS_END_OF_FILE);
159 assoc_stop.in.assoc_ctx = associate2.out.assoc_ctx;
160 assoc_stop.in.reason = 0;
161 torture_comment(tctx, "Send a association stop request (conn2), reson: %u\n", assoc_stop.in.reason);
162 status = wrepl_associate_stop(wrepl_socket2, &assoc_stop);
163 CHECK_STATUS(tctx, status, NT_STATUS_OK);
165 torture_comment(tctx, "Close 2 wrepl connections\n");
166 talloc_free(wrepl_socket1);
167 talloc_free(wrepl_socket2);
168 return ret;
172 test if we always get back the same assoc_ctx
174 static bool test_assoc_ctx2(struct torture_context *tctx)
176 struct wrepl_socket *wrepl_socket;
177 struct wrepl_associate associate;
178 uint32_t assoc_ctx1;
179 struct nbt_name name;
180 NTSTATUS status;
181 const char *address;
183 if (!torture_nbt_get_name(tctx, &name, &address))
184 return false;
186 torture_comment(tctx, "Test if we always get back the same assoc_ctx\n");
188 wrepl_socket = wrepl_socket_init(tctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx));
190 torture_comment(tctx, "Setup wrepl connections\n");
191 status = wrepl_connect(wrepl_socket, wrepl_best_ip(tctx->lp_ctx, address), address);
192 CHECK_STATUS(tctx, status, NT_STATUS_OK);
194 torture_comment(tctx, "Send 1st start association request\n");
195 status = wrepl_associate(wrepl_socket, &associate);
196 CHECK_STATUS(tctx, status, NT_STATUS_OK);
197 assoc_ctx1 = associate.out.assoc_ctx;
198 torture_comment(tctx, "1st association context: 0x%x\n", associate.out.assoc_ctx);
200 torture_comment(tctx, "Send 2nd start association request\n");
201 status = wrepl_associate(wrepl_socket, &associate);
202 torture_assert_ntstatus_ok(tctx, status, "2nd start association failed");
203 torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1,
204 "Different context returned");
205 torture_comment(tctx, "2nd association context: 0x%x\n", associate.out.assoc_ctx);
207 torture_comment(tctx, "Send 3rd start association request\n");
208 status = wrepl_associate(wrepl_socket, &associate);
209 torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1,
210 "Different context returned");
211 CHECK_STATUS(tctx, status, NT_STATUS_OK);
212 torture_comment(tctx, "3rd association context: 0x%x\n", associate.out.assoc_ctx);
214 torture_comment(tctx, "Close wrepl connections\n");
215 talloc_free(wrepl_socket);
216 return true;
221 display a replication entry
223 static void display_entry(struct torture_context *tctx, struct wrepl_name *name)
225 int i;
227 torture_comment(tctx, "%s\n", nbt_name_string(tctx, &name->name));
228 torture_comment(tctx, "\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n",
229 name->type, name->state, name->node, name->is_static, (long long)name->version_id);
230 torture_comment(tctx, "\tRAW_FLAGS: 0x%08X OWNER: %-15s\n",
231 name->raw_flags, name->owner);
232 for (i=0;i<name->num_addresses;i++) {
233 torture_comment(tctx, "\tADDR: %-15s OWNER: %-15s\n",
234 name->addresses[i].address, name->addresses[i].owner);
239 test a full replication dump from a WINS server
241 static bool test_wins_replication(struct torture_context *tctx)
243 struct wrepl_socket *wrepl_socket;
244 NTSTATUS status;
245 int i, j;
246 struct wrepl_associate associate;
247 struct wrepl_pull_table pull_table;
248 struct wrepl_pull_names pull_names;
249 struct nbt_name name;
250 const char *address;
252 if (!torture_nbt_get_name(tctx, &name, &address))
253 return false;
255 torture_comment(tctx, "Test one pull replication cycle\n");
257 wrepl_socket = wrepl_socket_init(tctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx));
259 torture_comment(tctx, "Setup wrepl connections\n");
260 status = wrepl_connect(wrepl_socket, wrepl_best_ip(tctx->lp_ctx, address), address);
261 CHECK_STATUS(tctx, status, NT_STATUS_OK);
263 torture_comment(tctx, "Send a start association request\n");
265 status = wrepl_associate(wrepl_socket, &associate);
266 CHECK_STATUS(tctx, status, NT_STATUS_OK);
268 torture_comment(tctx, "association context: 0x%x\n", associate.out.assoc_ctx);
270 torture_comment(tctx, "Send a replication table query\n");
271 pull_table.in.assoc_ctx = associate.out.assoc_ctx;
273 status = wrepl_pull_table(wrepl_socket, tctx, &pull_table);
274 if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) {
275 struct wrepl_packet packet;
276 struct wrepl_request *req;
278 ZERO_STRUCT(packet);
279 packet.opcode = WREPL_OPCODE_BITS;
280 packet.assoc_ctx = associate.out.assoc_ctx;
281 packet.mess_type = WREPL_STOP_ASSOCIATION;
282 packet.message.stop.reason = 0;
284 req = wrepl_request_send(wrepl_socket, &packet, NULL);
285 talloc_free(req);
287 torture_fail(tctx, "We are not a valid pull partner for the server");
289 CHECK_STATUS(tctx, status, NT_STATUS_OK);
291 torture_comment(tctx, "Found %d replication partners\n", pull_table.out.num_partners);
293 for (i=0;i<pull_table.out.num_partners;i++) {
294 struct wrepl_wins_owner *partner = &pull_table.out.partners[i];
295 torture_comment(tctx, "%s max_version=%6llu min_version=%6llu type=%d\n",
296 partner->address,
297 (long long)partner->max_version,
298 (long long)partner->min_version,
299 partner->type);
301 pull_names.in.assoc_ctx = associate.out.assoc_ctx;
302 pull_names.in.partner = *partner;
304 status = wrepl_pull_names(wrepl_socket, tctx, &pull_names);
305 CHECK_STATUS(tctx, status, NT_STATUS_OK);
307 torture_comment(tctx, "Received %d names\n", pull_names.out.num_names);
309 for (j=0;j<pull_names.out.num_names;j++) {
310 display_entry(tctx, &pull_names.out.names[j]);
314 torture_comment(tctx, "Close wrepl connections\n");
315 talloc_free(wrepl_socket);
316 return true;
319 struct test_wrepl_conflict_conn {
320 const char *address;
321 struct wrepl_socket *pull;
322 uint32_t pull_assoc;
324 #define TEST_OWNER_A_ADDRESS "127.65.65.1"
325 #define TEST_ADDRESS_A_PREFIX "127.0.65"
326 #define TEST_OWNER_B_ADDRESS "127.66.66.1"
327 #define TEST_ADDRESS_B_PREFIX "127.0.66"
328 #define TEST_OWNER_X_ADDRESS "127.88.88.1"
329 #define TEST_ADDRESS_X_PREFIX "127.0.88"
331 struct wrepl_wins_owner a, b, c, x;
333 struct socket_address *myaddr;
334 struct socket_address *myaddr2;
335 struct nbt_name_socket *nbtsock;
336 struct nbt_name_socket *nbtsock2;
338 struct nbt_name_socket *nbtsock_srv;
339 struct nbt_name_socket *nbtsock_srv2;
341 uint32_t addresses_best_num;
342 struct wrepl_ip *addresses_best;
344 uint32_t addresses_best2_num;
345 struct wrepl_ip *addresses_best2;
347 uint32_t addresses_all_num;
348 struct wrepl_ip *addresses_all;
350 uint32_t addresses_mhomed_num;
351 struct wrepl_ip *addresses_mhomed;
354 static const struct wrepl_ip addresses_A_1[] = {
356 .owner = TEST_OWNER_A_ADDRESS,
357 .ip = TEST_ADDRESS_A_PREFIX".1"
360 static const struct wrepl_ip addresses_A_2[] = {
362 .owner = TEST_OWNER_A_ADDRESS,
363 .ip = TEST_ADDRESS_A_PREFIX".2"
366 static const struct wrepl_ip addresses_A_3_4[] = {
368 .owner = TEST_OWNER_A_ADDRESS,
369 .ip = TEST_ADDRESS_A_PREFIX".3"
372 .owner = TEST_OWNER_A_ADDRESS,
373 .ip = TEST_ADDRESS_A_PREFIX".4"
376 static const struct wrepl_ip addresses_A_3_4_X_3_4[] = {
378 .owner = TEST_OWNER_A_ADDRESS,
379 .ip = TEST_ADDRESS_A_PREFIX".3"
382 .owner = TEST_OWNER_A_ADDRESS,
383 .ip = TEST_ADDRESS_A_PREFIX".4"
386 .owner = TEST_OWNER_X_ADDRESS,
387 .ip = TEST_ADDRESS_X_PREFIX".3"
390 .owner = TEST_OWNER_X_ADDRESS,
391 .ip = TEST_ADDRESS_X_PREFIX".4"
394 static const struct wrepl_ip addresses_A_3_4_B_3_4[] = {
396 .owner = TEST_OWNER_A_ADDRESS,
397 .ip = TEST_ADDRESS_A_PREFIX".3"
400 .owner = TEST_OWNER_A_ADDRESS,
401 .ip = TEST_ADDRESS_A_PREFIX".4"
404 .owner = TEST_OWNER_B_ADDRESS,
405 .ip = TEST_ADDRESS_B_PREFIX".3"
408 .owner = TEST_OWNER_B_ADDRESS,
409 .ip = TEST_ADDRESS_B_PREFIX".4"
412 static const struct wrepl_ip addresses_A_3_4_OWNER_B[] = {
414 .owner = TEST_OWNER_B_ADDRESS,
415 .ip = TEST_ADDRESS_A_PREFIX".3"
418 .owner = TEST_OWNER_B_ADDRESS,
419 .ip = TEST_ADDRESS_A_PREFIX".4"
422 static const struct wrepl_ip addresses_A_3_4_X_3_4_OWNER_B[] = {
424 .owner = TEST_OWNER_B_ADDRESS,
425 .ip = TEST_ADDRESS_A_PREFIX".3"
428 .owner = TEST_OWNER_B_ADDRESS,
429 .ip = TEST_ADDRESS_A_PREFIX".4"
432 .owner = TEST_OWNER_B_ADDRESS,
433 .ip = TEST_ADDRESS_X_PREFIX".3"
436 .owner = TEST_OWNER_B_ADDRESS,
437 .ip = TEST_ADDRESS_X_PREFIX".4"
441 static const struct wrepl_ip addresses_A_3_4_X_1_2[] = {
443 .owner = TEST_OWNER_A_ADDRESS,
444 .ip = TEST_ADDRESS_A_PREFIX".3"
447 .owner = TEST_OWNER_A_ADDRESS,
448 .ip = TEST_ADDRESS_A_PREFIX".4"
451 .owner = TEST_OWNER_X_ADDRESS,
452 .ip = TEST_ADDRESS_X_PREFIX".1"
455 .owner = TEST_OWNER_X_ADDRESS,
456 .ip = TEST_ADDRESS_X_PREFIX".2"
460 static const struct wrepl_ip addresses_B_1[] = {
462 .owner = TEST_OWNER_B_ADDRESS,
463 .ip = TEST_ADDRESS_B_PREFIX".1"
466 static const struct wrepl_ip addresses_B_2[] = {
468 .owner = TEST_OWNER_B_ADDRESS,
469 .ip = TEST_ADDRESS_B_PREFIX".2"
472 static const struct wrepl_ip addresses_B_3_4[] = {
474 .owner = TEST_OWNER_B_ADDRESS,
475 .ip = TEST_ADDRESS_B_PREFIX".3"
478 .owner = TEST_OWNER_B_ADDRESS,
479 .ip = TEST_ADDRESS_B_PREFIX".4"
482 static const struct wrepl_ip addresses_B_3_4_X_3_4[] = {
484 .owner = TEST_OWNER_B_ADDRESS,
485 .ip = TEST_ADDRESS_B_PREFIX".3"
488 .owner = TEST_OWNER_B_ADDRESS,
489 .ip = TEST_ADDRESS_B_PREFIX".4"
492 .owner = TEST_OWNER_X_ADDRESS,
493 .ip = TEST_ADDRESS_X_PREFIX".3"
496 .owner = TEST_OWNER_X_ADDRESS,
497 .ip = TEST_ADDRESS_X_PREFIX".4"
500 static const struct wrepl_ip addresses_B_3_4_X_1_2[] = {
502 .owner = TEST_OWNER_B_ADDRESS,
503 .ip = TEST_ADDRESS_B_PREFIX".3"
506 .owner = TEST_OWNER_B_ADDRESS,
507 .ip = TEST_ADDRESS_B_PREFIX".4"
510 .owner = TEST_OWNER_X_ADDRESS,
511 .ip = TEST_ADDRESS_X_PREFIX".1"
514 .owner = TEST_OWNER_X_ADDRESS,
515 .ip = TEST_ADDRESS_X_PREFIX".2"
519 static const struct wrepl_ip addresses_X_1_2[] = {
521 .owner = TEST_OWNER_X_ADDRESS,
522 .ip = TEST_ADDRESS_X_PREFIX".1"
525 .owner = TEST_OWNER_X_ADDRESS,
526 .ip = TEST_ADDRESS_X_PREFIX".2"
529 static const struct wrepl_ip addresses_X_3_4[] = {
531 .owner = TEST_OWNER_X_ADDRESS,
532 .ip = TEST_ADDRESS_X_PREFIX".3"
535 .owner = TEST_OWNER_X_ADDRESS,
536 .ip = TEST_ADDRESS_X_PREFIX".4"
540 static struct test_wrepl_conflict_conn *test_create_conflict_ctx(
541 struct torture_context *tctx, const char *address)
543 struct test_wrepl_conflict_conn *ctx;
544 struct wrepl_associate associate;
545 struct wrepl_pull_table pull_table;
546 struct socket_address *nbt_srv_addr;
547 NTSTATUS status;
548 uint32_t i;
549 struct interface *ifaces;
551 ctx = talloc_zero(tctx, struct test_wrepl_conflict_conn);
552 if (!ctx) return NULL;
554 ctx->address = address;
555 ctx->pull = wrepl_socket_init(ctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx));
556 if (!ctx->pull) return NULL;
558 torture_comment(tctx, "Setup wrepl conflict pull connection\n");
559 status = wrepl_connect(ctx->pull, wrepl_best_ip(tctx->lp_ctx, ctx->address), ctx->address);
560 if (!NT_STATUS_IS_OK(status)) return NULL;
562 status = wrepl_associate(ctx->pull, &associate);
563 if (!NT_STATUS_IS_OK(status)) return NULL;
565 ctx->pull_assoc = associate.out.assoc_ctx;
567 ctx->a.address = TEST_OWNER_A_ADDRESS;
568 ctx->a.max_version = 0;
569 ctx->a.min_version = 0;
570 ctx->a.type = 1;
572 ctx->b.address = TEST_OWNER_B_ADDRESS;
573 ctx->b.max_version = 0;
574 ctx->b.min_version = 0;
575 ctx->b.type = 1;
577 ctx->x.address = TEST_OWNER_X_ADDRESS;
578 ctx->x.max_version = 0;
579 ctx->x.min_version = 0;
580 ctx->x.type = 1;
582 ctx->c.address = address;
583 ctx->c.max_version = 0;
584 ctx->c.min_version = 0;
585 ctx->c.type = 1;
587 pull_table.in.assoc_ctx = ctx->pull_assoc;
588 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
589 if (!NT_STATUS_IS_OK(status)) return NULL;
591 for (i=0; i < pull_table.out.num_partners; i++) {
592 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
593 ctx->a.max_version = pull_table.out.partners[i].max_version;
594 ctx->a.min_version = pull_table.out.partners[i].min_version;
596 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
597 ctx->b.max_version = pull_table.out.partners[i].max_version;
598 ctx->b.min_version = pull_table.out.partners[i].min_version;
600 if (strcmp(TEST_OWNER_X_ADDRESS,pull_table.out.partners[i].address)==0) {
601 ctx->x.max_version = pull_table.out.partners[i].max_version;
602 ctx->x.min_version = pull_table.out.partners[i].min_version;
604 if (strcmp(address,pull_table.out.partners[i].address)==0) {
605 ctx->c.max_version = pull_table.out.partners[i].max_version;
606 ctx->c.min_version = pull_table.out.partners[i].min_version;
610 talloc_free(pull_table.out.partners);
612 ctx->nbtsock = nbt_name_socket_init(ctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx));
613 if (!ctx->nbtsock) return NULL;
615 load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
617 ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_best_ip(ifaces, address), 0);
618 if (!ctx->myaddr) return NULL;
620 for (i = 0; i < iface_count(ifaces); i++) {
621 if (strcmp(ctx->myaddr->addr, iface_n_ip(ifaces, i)) == 0) continue;
622 ctx->myaddr2 = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_n_ip(ifaces, i), 0);
623 if (!ctx->myaddr2) return NULL;
624 break;
627 status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0);
628 if (!NT_STATUS_IS_OK(status)) return NULL;
630 ctx->nbtsock_srv = nbt_name_socket_init(ctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx));
631 if (!ctx->nbtsock_srv) return NULL;
633 /* Make a port 137 version of ctx->myaddr */
634 nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lp_nbt_port(tctx->lp_ctx));
635 if (!nbt_srv_addr) return NULL;
637 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
638 status = socket_listen(ctx->nbtsock_srv->sock, nbt_srv_addr, 0, 0);
639 talloc_free(nbt_srv_addr);
640 if (!NT_STATUS_IS_OK(status)) {
641 /* this isn't fatal */
642 talloc_free(ctx->nbtsock_srv);
643 ctx->nbtsock_srv = NULL;
646 if (ctx->myaddr2 && ctx->nbtsock_srv) {
647 ctx->nbtsock2 = nbt_name_socket_init(ctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx));
648 if (!ctx->nbtsock2) return NULL;
650 status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0);
651 if (!NT_STATUS_IS_OK(status)) return NULL;
653 ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx, lp_iconv_convenience(tctx->lp_ctx));
654 if (!ctx->nbtsock_srv2) return NULL;
656 /* Make a port 137 version of ctx->myaddr2 */
657 nbt_srv_addr = socket_address_from_strings(tctx,
658 ctx->nbtsock_srv->sock->backend_name,
659 ctx->myaddr2->addr,
660 lp_nbt_port(tctx->lp_ctx));
661 if (!nbt_srv_addr) return NULL;
663 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
664 status = socket_listen(ctx->nbtsock_srv2->sock, ctx->myaddr2, 0, 0);
665 talloc_free(nbt_srv_addr);
666 if (!NT_STATUS_IS_OK(status)) {
667 /* this isn't fatal */
668 talloc_free(ctx->nbtsock_srv2);
669 ctx->nbtsock_srv2 = NULL;
673 ctx->addresses_best_num = 1;
674 ctx->addresses_best = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best_num);
675 if (!ctx->addresses_best) return NULL;
676 ctx->addresses_best[0].owner = ctx->b.address;
677 ctx->addresses_best[0].ip = ctx->myaddr->addr;
679 ctx->addresses_all_num = iface_count(ifaces);
680 ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num);
681 if (!ctx->addresses_all) return NULL;
682 for (i=0; i < ctx->addresses_all_num; i++) {
683 ctx->addresses_all[i].owner = ctx->b.address;
684 ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(ifaces, i));
685 if (!ctx->addresses_all[i].ip) return NULL;
688 if (ctx->nbtsock_srv2) {
689 ctx->addresses_best2_num = 1;
690 ctx->addresses_best2 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best2_num);
691 if (!ctx->addresses_best2) return NULL;
692 ctx->addresses_best2[0].owner = ctx->b.address;
693 ctx->addresses_best2[0].ip = ctx->myaddr2->addr;
695 ctx->addresses_mhomed_num = 2;
696 ctx->addresses_mhomed = talloc_array(ctx, struct wrepl_ip, ctx->addresses_mhomed_num);
697 if (!ctx->addresses_mhomed) return NULL;
698 ctx->addresses_mhomed[0].owner = ctx->b.address;
699 ctx->addresses_mhomed[0].ip = ctx->myaddr->addr;
700 ctx->addresses_mhomed[1].owner = ctx->b.address;
701 ctx->addresses_mhomed[1].ip = ctx->myaddr2->addr;
704 return ctx;
707 static bool test_wrepl_update_one(struct torture_context *tctx,
708 struct test_wrepl_conflict_conn *ctx,
709 const struct wrepl_wins_owner *owner,
710 const struct wrepl_wins_name *name)
712 struct wrepl_socket *wrepl_socket;
713 struct wrepl_associate associate;
714 struct wrepl_packet update_packet, repl_send;
715 struct wrepl_table *update;
716 struct wrepl_wins_owner wrepl_wins_owners[1];
717 struct wrepl_packet *repl_recv;
718 struct wrepl_wins_owner *send_request;
719 struct wrepl_send_reply *send_reply;
720 struct wrepl_wins_name wrepl_wins_names[1];
721 uint32_t assoc_ctx;
722 NTSTATUS status;
724 wrepl_socket = wrepl_socket_init(ctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx));
726 status = wrepl_connect(wrepl_socket, wrepl_best_ip(tctx->lp_ctx, ctx->address), ctx->address);
727 CHECK_STATUS(tctx, status, NT_STATUS_OK);
729 status = wrepl_associate(wrepl_socket, &associate);
730 CHECK_STATUS(tctx, status, NT_STATUS_OK);
731 assoc_ctx = associate.out.assoc_ctx;
733 /* now send a WREPL_REPL_UPDATE message */
734 ZERO_STRUCT(update_packet);
735 update_packet.opcode = WREPL_OPCODE_BITS;
736 update_packet.assoc_ctx = assoc_ctx;
737 update_packet.mess_type = WREPL_REPLICATION;
738 update_packet.message.replication.command = WREPL_REPL_UPDATE;
739 update = &update_packet.message.replication.info.table;
741 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
742 update->partners = wrepl_wins_owners;
743 update->initiator = "0.0.0.0";
745 wrepl_wins_owners[0] = *owner;
747 status = wrepl_request(wrepl_socket, wrepl_socket,
748 &update_packet, &repl_recv);
749 CHECK_STATUS(tctx, status, NT_STATUS_OK);
750 CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_REPLICATION);
751 CHECK_VALUE(tctx, repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
752 send_request = &repl_recv->message.replication.info.owner;
754 ZERO_STRUCT(repl_send);
755 repl_send.opcode = WREPL_OPCODE_BITS;
756 repl_send.assoc_ctx = assoc_ctx;
757 repl_send.mess_type = WREPL_REPLICATION;
758 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
759 send_reply = &repl_send.message.replication.info.reply;
761 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
762 send_reply->names = wrepl_wins_names;
764 wrepl_wins_names[0] = *name;
766 status = wrepl_request(wrepl_socket, wrepl_socket,
767 &repl_send, &repl_recv);
768 CHECK_STATUS(tctx, status, NT_STATUS_OK);
769 CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
770 CHECK_VALUE(tctx, repl_recv->message.stop.reason, 0);
772 talloc_free(wrepl_socket);
773 return true;
776 static bool test_wrepl_is_applied(struct torture_context *tctx,
777 struct test_wrepl_conflict_conn *ctx,
778 const struct wrepl_wins_owner *owner,
779 const struct wrepl_wins_name *name,
780 bool expected)
782 NTSTATUS status;
783 struct wrepl_pull_names pull_names;
784 struct wrepl_name *names;
786 pull_names.in.assoc_ctx = ctx->pull_assoc;
787 pull_names.in.partner = *owner;
788 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
790 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
791 CHECK_STATUS(tctx, status, NT_STATUS_OK);
792 torture_assert(tctx, pull_names.out.num_names == (expected?1:0),
793 talloc_asprintf(tctx, "Invalid number of records returned - expected %d got %d", expected, pull_names.out.num_names));
795 names = pull_names.out.names;
797 if (expected) {
798 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
799 names[0].state,
800 names[0].node,
801 names[0].is_static);
802 CHECK_VALUE(tctx, names[0].name.type, name->name->type);
803 CHECK_VALUE_STRING(tctx, names[0].name.name, name->name->name);
804 CHECK_VALUE_STRING(tctx, names[0].name.scope, name->name->scope);
805 CHECK_VALUE(tctx, flags, name->flags);
806 CHECK_VALUE_UINT64(tctx, names[0].version_id, name->id);
808 if (flags & 2) {
809 CHECK_VALUE(tctx, names[0].num_addresses,
810 name->addresses.addresses.num_ips);
811 } else {
812 CHECK_VALUE(tctx, names[0].num_addresses, 1);
813 CHECK_VALUE_STRING(tctx, names[0].addresses[0].address,
814 name->addresses.ip);
817 talloc_free(pull_names.out.names);
818 return true;
821 static bool test_wrepl_mhomed_merged(struct torture_context *tctx,
822 struct test_wrepl_conflict_conn *ctx,
823 const struct wrepl_wins_owner *owner1,
824 uint32_t num_ips1, const struct wrepl_ip *ips1,
825 const struct wrepl_wins_owner *owner2,
826 uint32_t num_ips2, const struct wrepl_ip *ips2,
827 const struct wrepl_wins_name *name2)
829 NTSTATUS status;
830 struct wrepl_pull_names pull_names;
831 struct wrepl_name *names;
832 uint32_t flags;
833 uint32_t i, j;
834 uint32_t num_ips = num_ips1 + num_ips2;
836 for (i = 0; i < num_ips2; i++) {
837 for (j = 0; j < num_ips1; j++) {
838 if (strcmp(ips2[i].ip,ips1[j].ip) == 0) {
839 num_ips--;
840 break;
845 pull_names.in.assoc_ctx = ctx->pull_assoc;
846 pull_names.in.partner = *owner2;
847 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
849 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
850 CHECK_STATUS(tctx, status, NT_STATUS_OK);
851 CHECK_VALUE(tctx, pull_names.out.num_names, 1);
853 names = pull_names.out.names;
855 flags = WREPL_NAME_FLAGS(names[0].type,
856 names[0].state,
857 names[0].node,
858 names[0].is_static);
859 CHECK_VALUE(tctx, names[0].name.type, name2->name->type);
860 CHECK_VALUE_STRING(tctx, names[0].name.name, name2->name->name);
861 CHECK_VALUE_STRING(tctx, names[0].name.scope, name2->name->scope);
862 CHECK_VALUE(tctx, flags, name2->flags | WREPL_TYPE_MHOMED);
863 CHECK_VALUE_UINT64(tctx, names[0].version_id, name2->id);
865 CHECK_VALUE(tctx, names[0].num_addresses, num_ips);
867 for (i = 0; i < names[0].num_addresses; i++) {
868 const char *addr = names[0].addresses[i].address;
869 const char *owner = names[0].addresses[i].owner;
870 bool found = false;
872 for (j = 0; j < num_ips2; j++) {
873 if (strcmp(addr, ips2[j].ip) == 0) {
874 found = true;
875 CHECK_VALUE_STRING(tctx, owner, owner2->address);
876 break;
880 if (found) continue;
882 for (j = 0; j < num_ips1; j++) {
883 if (strcmp(addr, ips1[j].ip) == 0) {
884 found = true;
885 CHECK_VALUE_STRING(tctx, owner, owner1->address);
886 break;
890 if (found) continue;
892 CHECK_VALUE_STRING(tctx, addr, "not found in address list");
894 talloc_free(pull_names.out.names);
895 return true;
898 static bool test_wrepl_sgroup_merged(struct torture_context *tctx,
899 struct test_wrepl_conflict_conn *ctx,
900 struct wrepl_wins_owner *merge_owner,
901 struct wrepl_wins_owner *owner1,
902 uint32_t num_ips1, const struct wrepl_ip *ips1,
903 struct wrepl_wins_owner *owner2,
904 uint32_t num_ips2, const struct wrepl_ip *ips2,
905 const struct wrepl_wins_name *name2)
907 NTSTATUS status;
908 struct wrepl_pull_names pull_names;
909 struct wrepl_name *names;
910 struct wrepl_name *name = NULL;
911 uint32_t flags;
912 uint32_t i, j;
913 uint32_t num_ips = num_ips1 + num_ips2;
915 if (!merge_owner) {
916 merge_owner = &ctx->c;
919 for (i = 0; i < num_ips1; i++) {
920 if (owner1 != &ctx->c && strcmp(ips1[i].owner,owner2->address) == 0) {
921 num_ips--;
922 continue;
924 for (j = 0; j < num_ips2; j++) {
925 if (strcmp(ips1[i].ip,ips2[j].ip) == 0) {
926 num_ips--;
927 break;
933 pull_names.in.assoc_ctx = ctx->pull_assoc;
934 pull_names.in.partner = *merge_owner;
935 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
936 pull_names.in.partner.max_version = 0;
938 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
939 CHECK_STATUS(tctx, status, NT_STATUS_OK);
941 names = pull_names.out.names;
943 for (i = 0; i < pull_names.out.num_names; i++) {
944 if (names[i].name.type != name2->name->type) continue;
945 if (!names[i].name.name) continue;
946 if (strcmp(names[i].name.name, name2->name->name) != 0) continue;
947 if (names[i].name.scope) continue;
949 name = &names[i];
952 if (pull_names.out.num_names > 0) {
953 merge_owner->max_version = names[pull_names.out.num_names-1].version_id;
956 if (!name) {
957 torture_comment(tctx, "%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name));
958 return false;
961 flags = WREPL_NAME_FLAGS(name->type,
962 name->state,
963 name->node,
964 name->is_static);
965 CHECK_VALUE(tctx, name->name.type, name2->name->type);
966 CHECK_VALUE_STRING(tctx, name->name.name, name2->name->name);
967 CHECK_VALUE_STRING(tctx, name->name.scope, name2->name->scope);
968 CHECK_VALUE(tctx, flags, name2->flags);
970 CHECK_VALUE(tctx, name->num_addresses, num_ips);
972 for (i = 0; i < name->num_addresses; i++) {
973 const char *addr = name->addresses[i].address;
974 const char *owner = name->addresses[i].owner;
975 bool found = false;
977 for (j = 0; j < num_ips2; j++) {
978 if (strcmp(addr, ips2[j].ip) == 0) {
979 found = true;
980 CHECK_VALUE_STRING(tctx, owner, ips2[j].owner);
981 break;
985 if (found) continue;
987 for (j = 0; j < num_ips1; j++) {
988 if (strcmp(addr, ips1[j].ip) == 0) {
989 found = true;
990 if (owner1 == &ctx->c) {
991 CHECK_VALUE_STRING(tctx, owner, owner1->address);
992 } else {
993 CHECK_VALUE_STRING(tctx, owner, ips1[j].owner);
995 break;
999 if (found) continue;
1001 CHECK_VALUE_STRING(tctx, addr, "not found in address list");
1003 talloc_free(pull_names.out.names);
1004 return true;
1007 static bool test_conflict_same_owner(struct torture_context *tctx,
1008 struct test_wrepl_conflict_conn *ctx)
1010 static bool ret = true;
1011 struct wrepl_wins_name wins_name1;
1012 struct wrepl_wins_name wins_name2;
1013 struct wrepl_wins_name *wins_name_tmp;
1014 struct wrepl_wins_name *wins_name_last;
1015 struct wrepl_wins_name *wins_name_cur;
1016 uint32_t i,j;
1017 struct nbt_name names[] = {
1018 _NBT_NAME("_SAME_OWNER_A", 0x00, NULL),
1019 _NBT_NAME("_SAME_OWNER_A", 0x1C, NULL),
1021 struct {
1022 enum wrepl_name_type type;
1023 enum wrepl_name_state state;
1024 enum wrepl_name_node node;
1025 bool is_static;
1026 uint32_t num_ips;
1027 const struct wrepl_ip *ips;
1028 } records[] = {
1030 .type = WREPL_TYPE_GROUP,
1031 .state = WREPL_STATE_ACTIVE,
1032 .node = WREPL_NODE_B,
1033 .is_static = false,
1034 .num_ips = ARRAY_SIZE(addresses_A_1),
1035 .ips = addresses_A_1,
1037 .type = WREPL_TYPE_UNIQUE,
1038 .state = WREPL_STATE_ACTIVE,
1039 .node = WREPL_NODE_B,
1040 .is_static = false,
1041 .num_ips = ARRAY_SIZE(addresses_A_1),
1042 .ips = addresses_A_1,
1044 .type = WREPL_TYPE_UNIQUE,
1045 .state = WREPL_STATE_ACTIVE,
1046 .node = WREPL_NODE_B,
1047 .is_static = false,
1048 .num_ips = ARRAY_SIZE(addresses_A_2),
1049 .ips = addresses_A_2,
1051 .type = WREPL_TYPE_UNIQUE,
1052 .state = WREPL_STATE_ACTIVE,
1053 .node = WREPL_NODE_B,
1054 .is_static = true,
1055 .num_ips = ARRAY_SIZE(addresses_A_1),
1056 .ips = addresses_A_1,
1058 .type = WREPL_TYPE_UNIQUE,
1059 .state = WREPL_STATE_ACTIVE,
1060 .node = WREPL_NODE_B,
1061 .is_static = false,
1062 .num_ips = ARRAY_SIZE(addresses_A_2),
1063 .ips = addresses_A_2,
1065 .type = WREPL_TYPE_SGROUP,
1066 .state = WREPL_STATE_TOMBSTONE,
1067 .node = WREPL_NODE_B,
1068 .is_static = false,
1069 .num_ips = ARRAY_SIZE(addresses_A_2),
1070 .ips = addresses_A_2,
1072 .type = WREPL_TYPE_MHOMED,
1073 .state = WREPL_STATE_TOMBSTONE,
1074 .node = WREPL_NODE_B,
1075 .is_static = false,
1076 .num_ips = ARRAY_SIZE(addresses_A_1),
1077 .ips = addresses_A_1,
1079 .type = WREPL_TYPE_MHOMED,
1080 .state = WREPL_STATE_RELEASED,
1081 .node = WREPL_NODE_B,
1082 .is_static = false,
1083 .num_ips = ARRAY_SIZE(addresses_A_2),
1084 .ips = addresses_A_2,
1086 .type = WREPL_TYPE_SGROUP,
1087 .state = WREPL_STATE_ACTIVE,
1088 .node = WREPL_NODE_B,
1089 .is_static = false,
1090 .num_ips = ARRAY_SIZE(addresses_A_1),
1091 .ips = addresses_A_1,
1093 .type = WREPL_TYPE_SGROUP,
1094 .state = WREPL_STATE_ACTIVE,
1095 .node = WREPL_NODE_B,
1096 .is_static = false,
1097 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1098 .ips = addresses_A_3_4,
1100 .type = WREPL_TYPE_SGROUP,
1101 .state = WREPL_STATE_TOMBSTONE,
1102 .node = WREPL_NODE_B,
1103 .is_static = false,
1104 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1105 .ips = addresses_B_3_4,
1107 /* the last one should always be a unique,tomstone record! */
1108 .type = WREPL_TYPE_UNIQUE,
1109 .state = WREPL_STATE_TOMBSTONE,
1110 .node = WREPL_NODE_B,
1111 .is_static = false,
1112 .num_ips = ARRAY_SIZE(addresses_A_1),
1113 .ips = addresses_A_1,
1117 wins_name_tmp = NULL;
1118 wins_name_last = &wins_name2;
1119 wins_name_cur = &wins_name1;
1121 for (j=0; ret && j < ARRAY_SIZE(names); j++) {
1122 torture_comment(tctx, "Test Replica Conflicts with same owner[%s] for %s\n",
1123 nbt_name_string(ctx, &names[j]), ctx->a.address);
1125 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
1126 wins_name_tmp = wins_name_last;
1127 wins_name_last = wins_name_cur;
1128 wins_name_cur = wins_name_tmp;
1130 if (i > 0) {
1131 torture_comment(tctx, "%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
1132 wrepl_name_type_string(records[i-1].type),
1133 wrepl_name_state_string(records[i-1].state),
1134 (records[i-1].is_static?",static":""),
1135 wrepl_name_type_string(records[i].type),
1136 wrepl_name_state_string(records[i].state),
1137 (records[i].is_static?",static":""),
1138 (records[i-1].ips==records[i].ips?"same":"different"),
1139 "REPLACE");
1142 wins_name_cur->name = &names[j];
1143 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
1144 records[i].state,
1145 records[i].node,
1146 records[i].is_static);
1147 wins_name_cur->id = ++ctx->a.max_version;
1148 if (wins_name_cur->flags & 2) {
1149 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
1150 wins_name_cur->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
1151 records[i].ips);
1152 } else {
1153 wins_name_cur->addresses.ip = records[i].ips[0].ip;
1155 wins_name_cur->unknown = "255.255.255.255";
1157 ret &= test_wrepl_update_one(tctx, ctx, &ctx->a,wins_name_cur);
1158 if (records[i].state == WREPL_STATE_RELEASED) {
1159 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_last, false);
1160 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, false);
1161 } else {
1162 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, true);
1165 /* the first one is a cleanup run */
1166 if (!ret && i == 0) ret = true;
1168 if (!ret) {
1169 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, __location__);
1170 return ret;
1174 return ret;
1177 static bool test_conflict_different_owner(struct torture_context *tctx,
1178 struct test_wrepl_conflict_conn *ctx)
1180 bool ret = true;
1181 struct wrepl_wins_name wins_name1;
1182 struct wrepl_wins_name wins_name2;
1183 struct wrepl_wins_name *wins_name_r1;
1184 struct wrepl_wins_name *wins_name_r2;
1185 uint32_t i;
1186 struct {
1187 const char *line; /* just better debugging */
1188 struct nbt_name name;
1189 const char *comment;
1190 bool extra; /* not the worst case, this is an extra test */
1191 bool cleanup;
1192 struct {
1193 struct wrepl_wins_owner *owner;
1194 enum wrepl_name_type type;
1195 enum wrepl_name_state state;
1196 enum wrepl_name_node node;
1197 bool is_static;
1198 uint32_t num_ips;
1199 const struct wrepl_ip *ips;
1200 bool apply_expected;
1201 bool sgroup_merge;
1202 struct wrepl_wins_owner *merge_owner;
1203 bool sgroup_cleanup;
1204 } r1, r2;
1205 } records[] = {
1207 * NOTE: the first record and the last applied one
1208 * needs to be from the same owner,
1209 * to not conflict in the next smbtorture run!!!
1212 .line = __location__,
1213 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1214 .cleanup= true,
1215 .r1 = {
1216 .owner = &ctx->b,
1217 .type = WREPL_TYPE_UNIQUE,
1218 .state = WREPL_STATE_TOMBSTONE,
1219 .node = WREPL_NODE_B,
1220 .is_static = false,
1221 .num_ips = ARRAY_SIZE(addresses_B_1),
1222 .ips = addresses_B_1,
1223 .apply_expected = true /* ignored */
1225 .r2 = {
1226 .owner = &ctx->a,
1227 .type = WREPL_TYPE_UNIQUE,
1228 .state = WREPL_STATE_TOMBSTONE,
1229 .node = WREPL_NODE_B,
1230 .is_static = false,
1231 .num_ips = ARRAY_SIZE(addresses_A_1),
1232 .ips = addresses_A_1,
1233 .apply_expected = true /* ignored */
1238 * unique vs unique section
1241 * unique,active vs. unique,active
1242 * => should be replaced
1245 .line = __location__,
1246 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1247 .r1 = {
1248 .owner = &ctx->a,
1249 .type = WREPL_TYPE_UNIQUE,
1250 .state = WREPL_STATE_ACTIVE,
1251 .node = WREPL_NODE_B,
1252 .is_static = false,
1253 .num_ips = ARRAY_SIZE(addresses_A_1),
1254 .ips = addresses_A_1,
1255 .apply_expected = true
1257 .r2 = {
1258 .owner = &ctx->b,
1259 .type = WREPL_TYPE_UNIQUE,
1260 .state = WREPL_STATE_ACTIVE,
1261 .node = WREPL_NODE_B,
1262 .is_static = false,
1263 .num_ips = ARRAY_SIZE(addresses_B_1),
1264 .ips = addresses_B_1,
1265 .apply_expected = true
1270 * unique,active vs. unique,tombstone
1271 * => should NOT be replaced
1274 .line = __location__,
1275 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1276 .r1 = {
1277 .owner = &ctx->b,
1278 .type = WREPL_TYPE_UNIQUE,
1279 .state = WREPL_STATE_ACTIVE,
1280 .node = WREPL_NODE_B,
1281 .is_static = false,
1282 .num_ips = ARRAY_SIZE(addresses_B_1),
1283 .ips = addresses_B_1,
1284 .apply_expected = true
1286 .r2 = {
1287 .owner = &ctx->a,
1288 .type = WREPL_TYPE_UNIQUE,
1289 .state = WREPL_STATE_TOMBSTONE,
1290 .node = WREPL_NODE_B,
1291 .is_static = false,
1292 .num_ips = ARRAY_SIZE(addresses_B_1),
1293 .ips = addresses_B_1,
1294 .apply_expected = false
1299 * unique,released vs. unique,active
1300 * => should be replaced
1303 .line = __location__,
1304 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1305 .r1 = {
1306 .owner = &ctx->b,
1307 .type = WREPL_TYPE_UNIQUE,
1308 .state = WREPL_STATE_RELEASED,
1309 .node = WREPL_NODE_B,
1310 .is_static = false,
1311 .num_ips = ARRAY_SIZE(addresses_B_1),
1312 .ips = addresses_B_1,
1313 .apply_expected = false
1315 .r2 = {
1316 .owner = &ctx->a,
1317 .type = WREPL_TYPE_UNIQUE,
1318 .state = WREPL_STATE_ACTIVE,
1319 .node = WREPL_NODE_B,
1320 .is_static = false,
1321 .num_ips = ARRAY_SIZE(addresses_A_1),
1322 .ips = addresses_A_1,
1323 .apply_expected = true
1328 * unique,released vs. unique,tombstone
1329 * => should be replaced
1332 .line = __location__,
1333 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1334 .r1 = {
1335 .owner = &ctx->a,
1336 .type = WREPL_TYPE_UNIQUE,
1337 .state = WREPL_STATE_RELEASED,
1338 .node = WREPL_NODE_B,
1339 .is_static = false,
1340 .num_ips = ARRAY_SIZE(addresses_A_1),
1341 .ips = addresses_A_1,
1342 .apply_expected = false
1344 .r2 = {
1345 .owner = &ctx->b,
1346 .type = WREPL_TYPE_UNIQUE,
1347 .state = WREPL_STATE_TOMBSTONE,
1348 .node = WREPL_NODE_B,
1349 .is_static = false,
1350 .num_ips = ARRAY_SIZE(addresses_B_1),
1351 .ips = addresses_B_1,
1352 .apply_expected = true
1357 * unique,tombstone vs. unique,active
1358 * => should be replaced
1361 .line = __location__,
1362 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1363 .r1 = {
1364 .owner = &ctx->b,
1365 .type = WREPL_TYPE_UNIQUE,
1366 .state = WREPL_STATE_TOMBSTONE,
1367 .node = WREPL_NODE_B,
1368 .is_static = false,
1369 .num_ips = ARRAY_SIZE(addresses_B_1),
1370 .ips = addresses_B_1,
1371 .apply_expected = true
1373 .r2 = {
1374 .owner = &ctx->a,
1375 .type = WREPL_TYPE_UNIQUE,
1376 .state = WREPL_STATE_ACTIVE,
1377 .node = WREPL_NODE_B,
1378 .is_static = false,
1379 .num_ips = ARRAY_SIZE(addresses_A_1),
1380 .ips = addresses_A_1,
1381 .apply_expected = true
1386 * unique,tombstone vs. unique,tombstone
1387 * => should be replaced
1390 .line = __location__,
1391 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1392 .r1 = {
1393 .owner = &ctx->a,
1394 .type = WREPL_TYPE_UNIQUE,
1395 .state = WREPL_STATE_TOMBSTONE,
1396 .node = WREPL_NODE_B,
1397 .is_static = false,
1398 .num_ips = ARRAY_SIZE(addresses_A_1),
1399 .ips = addresses_A_1,
1400 .apply_expected = true
1402 .r2 = {
1403 .owner = &ctx->b,
1404 .type = WREPL_TYPE_UNIQUE,
1405 .state = WREPL_STATE_TOMBSTONE,
1406 .node = WREPL_NODE_B,
1407 .is_static = false,
1408 .num_ips = ARRAY_SIZE(addresses_B_1),
1409 .ips = addresses_B_1,
1410 .apply_expected = true
1416 * unique vs normal groups section,
1419 * unique,active vs. group,active
1420 * => should be replaced
1423 .line = __location__,
1424 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1425 .r1 = {
1426 .owner = &ctx->b,
1427 .type = WREPL_TYPE_UNIQUE,
1428 .state = WREPL_STATE_ACTIVE,
1429 .node = WREPL_NODE_B,
1430 .is_static = false,
1431 .num_ips = ARRAY_SIZE(addresses_B_1),
1432 .ips = addresses_B_1,
1433 .apply_expected = true
1435 .r2 = {
1436 .owner = &ctx->a,
1437 .type = WREPL_TYPE_GROUP,
1438 .state = WREPL_STATE_ACTIVE,
1439 .node = WREPL_NODE_B,
1440 .is_static = false,
1441 .num_ips = ARRAY_SIZE(addresses_A_1),
1442 .ips = addresses_A_1,
1443 .apply_expected = true
1448 * unique,active vs. group,tombstone
1449 * => should NOT be replaced
1452 .line = __location__,
1453 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1454 .r1 = {
1455 .owner = &ctx->a,
1456 .type = WREPL_TYPE_UNIQUE,
1457 .state = WREPL_STATE_ACTIVE,
1458 .node = WREPL_NODE_B,
1459 .is_static = false,
1460 .num_ips = ARRAY_SIZE(addresses_A_1),
1461 .ips = addresses_A_1,
1462 .apply_expected = true
1464 .r2 = {
1465 .owner = &ctx->b,
1466 .type = WREPL_TYPE_GROUP,
1467 .state = WREPL_STATE_TOMBSTONE,
1468 .node = WREPL_NODE_B,
1469 .is_static = false,
1470 .num_ips = ARRAY_SIZE(addresses_A_1),
1471 .ips = addresses_A_1,
1472 .apply_expected = false
1477 * unique,released vs. group,active
1478 * => should be replaced
1481 .line = __location__,
1482 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1483 .r1 = {
1484 .owner = &ctx->a,
1485 .type = WREPL_TYPE_UNIQUE,
1486 .state = WREPL_STATE_RELEASED,
1487 .node = WREPL_NODE_B,
1488 .is_static = false,
1489 .num_ips = ARRAY_SIZE(addresses_A_1),
1490 .ips = addresses_A_1,
1491 .apply_expected = false
1493 .r2 = {
1494 .owner = &ctx->b,
1495 .type = WREPL_TYPE_GROUP,
1496 .state = WREPL_STATE_ACTIVE,
1497 .node = WREPL_NODE_B,
1498 .is_static = false,
1499 .num_ips = ARRAY_SIZE(addresses_B_1),
1500 .ips = addresses_B_1,
1501 .apply_expected = true
1506 * unique,released vs. group,tombstone
1507 * => should be replaced
1510 .line = __location__,
1511 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1512 .r1 = {
1513 .owner = &ctx->b,
1514 .type = WREPL_TYPE_UNIQUE,
1515 .state = WREPL_STATE_RELEASED,
1516 .node = WREPL_NODE_B,
1517 .is_static = false,
1518 .num_ips = ARRAY_SIZE(addresses_B_1),
1519 .ips = addresses_B_1,
1520 .apply_expected = false
1522 .r2 = {
1523 .owner = &ctx->a,
1524 .type = WREPL_TYPE_GROUP,
1525 .state = WREPL_STATE_TOMBSTONE,
1526 .node = WREPL_NODE_B,
1527 .is_static = false,
1528 .num_ips = ARRAY_SIZE(addresses_A_1),
1529 .ips = addresses_A_1,
1530 .apply_expected = true
1535 * unique,tombstone vs. group,active
1536 * => should be replaced
1539 .line = __location__,
1540 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1541 .r1 = {
1542 .owner = &ctx->a,
1543 .type = WREPL_TYPE_UNIQUE,
1544 .state = WREPL_STATE_TOMBSTONE,
1545 .node = WREPL_NODE_B,
1546 .is_static = false,
1547 .num_ips = ARRAY_SIZE(addresses_A_1),
1548 .ips = addresses_A_1,
1549 .apply_expected = true
1551 .r2 = {
1552 .owner = &ctx->b,
1553 .type = WREPL_TYPE_GROUP,
1554 .state = WREPL_STATE_ACTIVE,
1555 .node = WREPL_NODE_B,
1556 .is_static = false,
1557 .num_ips = ARRAY_SIZE(addresses_B_1),
1558 .ips = addresses_B_1,
1559 .apply_expected = true
1564 * unique,tombstone vs. group,tombstone
1565 * => should be replaced
1568 .line = __location__,
1569 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1570 .r1 = {
1571 .owner = &ctx->b,
1572 .type = WREPL_TYPE_UNIQUE,
1573 .state = WREPL_STATE_TOMBSTONE,
1574 .node = WREPL_NODE_B,
1575 .is_static = false,
1576 .num_ips = ARRAY_SIZE(addresses_B_1),
1577 .ips = addresses_B_1,
1578 .apply_expected = true
1580 .r2 = {
1581 .owner = &ctx->a,
1582 .type = WREPL_TYPE_GROUP,
1583 .state = WREPL_STATE_TOMBSTONE,
1584 .node = WREPL_NODE_B,
1585 .is_static = false,
1586 .num_ips = ARRAY_SIZE(addresses_A_1),
1587 .ips = addresses_A_1,
1588 .apply_expected = true
1593 * unique vs special groups section,
1596 * unique,active vs. sgroup,active
1597 * => should NOT be replaced
1600 .line = __location__,
1601 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1602 .r1 = {
1603 .owner = &ctx->a,
1604 .type = WREPL_TYPE_UNIQUE,
1605 .state = WREPL_STATE_ACTIVE,
1606 .node = WREPL_NODE_B,
1607 .is_static = false,
1608 .num_ips = ARRAY_SIZE(addresses_A_1),
1609 .ips = addresses_A_1,
1610 .apply_expected = true
1612 .r2 = {
1613 .owner = &ctx->b,
1614 .type = WREPL_TYPE_SGROUP,
1615 .state = WREPL_STATE_ACTIVE,
1616 .node = WREPL_NODE_B,
1617 .is_static = false,
1618 .num_ips = ARRAY_SIZE(addresses_A_1),
1619 .ips = addresses_A_1,
1620 .apply_expected = false
1625 * unique,active vs. sgroup,tombstone
1626 * => should NOT be replaced
1629 .line = __location__,
1630 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1631 .r1 = {
1632 .owner = &ctx->a,
1633 .type = WREPL_TYPE_UNIQUE,
1634 .state = WREPL_STATE_ACTIVE,
1635 .node = WREPL_NODE_B,
1636 .is_static = false,
1637 .num_ips = ARRAY_SIZE(addresses_A_1),
1638 .ips = addresses_A_1,
1639 .apply_expected = true
1641 .r2 = {
1642 .owner = &ctx->b,
1643 .type = WREPL_TYPE_SGROUP,
1644 .state = WREPL_STATE_TOMBSTONE,
1645 .node = WREPL_NODE_B,
1646 .is_static = false,
1647 .num_ips = ARRAY_SIZE(addresses_A_1),
1648 .ips = addresses_A_1,
1649 .apply_expected = false
1654 * unique,released vs. sgroup,active
1655 * => should be replaced
1658 .line = __location__,
1659 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1660 .r1 = {
1661 .owner = &ctx->a,
1662 .type = WREPL_TYPE_UNIQUE,
1663 .state = WREPL_STATE_RELEASED,
1664 .node = WREPL_NODE_B,
1665 .is_static = false,
1666 .num_ips = ARRAY_SIZE(addresses_A_1),
1667 .ips = addresses_A_1,
1668 .apply_expected = false
1670 .r2 = {
1671 .owner = &ctx->b,
1672 .type = WREPL_TYPE_SGROUP,
1673 .state = WREPL_STATE_ACTIVE,
1674 .node = WREPL_NODE_B,
1675 .is_static = false,
1676 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1677 .ips = addresses_B_3_4,
1678 .apply_expected = true
1683 * unique,released vs. sgroup,tombstone
1684 * => should be replaced
1687 .line = __location__,
1688 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1689 .r1 = {
1690 .owner = &ctx->b,
1691 .type = WREPL_TYPE_UNIQUE,
1692 .state = WREPL_STATE_RELEASED,
1693 .node = WREPL_NODE_B,
1694 .is_static = false,
1695 .num_ips = ARRAY_SIZE(addresses_B_1),
1696 .ips = addresses_B_1,
1697 .apply_expected = false
1699 .r2 = {
1700 .owner = &ctx->a,
1701 .type = WREPL_TYPE_SGROUP,
1702 .state = WREPL_STATE_TOMBSTONE,
1703 .node = WREPL_NODE_B,
1704 .is_static = false,
1705 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1706 .ips = addresses_A_3_4,
1707 .apply_expected = true
1712 * unique,tombstone vs. sgroup,active
1713 * => should be replaced
1716 .line = __location__,
1717 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1718 .r1 = {
1719 .owner = &ctx->a,
1720 .type = WREPL_TYPE_UNIQUE,
1721 .state = WREPL_STATE_TOMBSTONE,
1722 .node = WREPL_NODE_B,
1723 .is_static = false,
1724 .num_ips = ARRAY_SIZE(addresses_A_1),
1725 .ips = addresses_A_1,
1726 .apply_expected = true
1728 .r2 = {
1729 .owner = &ctx->b,
1730 .type = WREPL_TYPE_SGROUP,
1731 .state = WREPL_STATE_ACTIVE,
1732 .node = WREPL_NODE_B,
1733 .is_static = false,
1734 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1735 .ips = addresses_B_3_4,
1736 .apply_expected = true
1741 * unique,tombstone vs. sgroup,tombstone
1742 * => should be replaced
1745 .line = __location__,
1746 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1747 .r1 = {
1748 .owner = &ctx->b,
1749 .type = WREPL_TYPE_UNIQUE,
1750 .state = WREPL_STATE_TOMBSTONE,
1751 .node = WREPL_NODE_B,
1752 .is_static = false,
1753 .num_ips = ARRAY_SIZE(addresses_B_1),
1754 .ips = addresses_B_1,
1755 .apply_expected = true
1757 .r2 = {
1758 .owner = &ctx->a,
1759 .type = WREPL_TYPE_SGROUP,
1760 .state = WREPL_STATE_TOMBSTONE,
1761 .node = WREPL_NODE_B,
1762 .is_static = false,
1763 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1764 .ips = addresses_A_3_4,
1765 .apply_expected = true
1770 * unique vs multi homed section,
1773 * unique,active vs. mhomed,active
1774 * => should be replaced
1777 .line = __location__,
1778 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1779 .r1 = {
1780 .owner = &ctx->a,
1781 .type = WREPL_TYPE_UNIQUE,
1782 .state = WREPL_STATE_ACTIVE,
1783 .node = WREPL_NODE_B,
1784 .is_static = false,
1785 .num_ips = ARRAY_SIZE(addresses_A_1),
1786 .ips = addresses_A_1,
1787 .apply_expected = true
1789 .r2 = {
1790 .owner = &ctx->b,
1791 .type = WREPL_TYPE_MHOMED,
1792 .state = WREPL_STATE_ACTIVE,
1793 .node = WREPL_NODE_B,
1794 .is_static = false,
1795 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1796 .ips = addresses_B_3_4,
1797 .apply_expected = true
1802 * unique,active vs. mhomed,tombstone
1803 * => should NOT be replaced
1806 .line = __location__,
1807 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1808 .r1 = {
1809 .owner = &ctx->b,
1810 .type = WREPL_TYPE_UNIQUE,
1811 .state = WREPL_STATE_ACTIVE,
1812 .node = WREPL_NODE_B,
1813 .is_static = false,
1814 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1815 .ips = addresses_B_3_4,
1816 .apply_expected = true
1818 .r2 = {
1819 .owner = &ctx->a,
1820 .type = WREPL_TYPE_MHOMED,
1821 .state = WREPL_STATE_TOMBSTONE,
1822 .node = WREPL_NODE_B,
1823 .is_static = false,
1824 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1825 .ips = addresses_B_3_4,
1826 .apply_expected = false
1831 * unique,released vs. mhomed,active
1832 * => should be replaced
1835 .line = __location__,
1836 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1837 .r1 = {
1838 .owner = &ctx->b,
1839 .type = WREPL_TYPE_UNIQUE,
1840 .state = WREPL_STATE_RELEASED,
1841 .node = WREPL_NODE_B,
1842 .is_static = false,
1843 .num_ips = ARRAY_SIZE(addresses_B_1),
1844 .ips = addresses_B_1,
1845 .apply_expected = false
1847 .r2 = {
1848 .owner = &ctx->a,
1849 .type = WREPL_TYPE_MHOMED,
1850 .state = WREPL_STATE_ACTIVE,
1851 .node = WREPL_NODE_B,
1852 .is_static = false,
1853 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1854 .ips = addresses_A_3_4,
1855 .apply_expected = true
1860 * unique,released vs. mhomed,tombstone
1861 * => should be replaced
1864 .line = __location__,
1865 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1866 .r1 = {
1867 .owner = &ctx->a,
1868 .type = WREPL_TYPE_UNIQUE,
1869 .state = WREPL_STATE_RELEASED,
1870 .node = WREPL_NODE_B,
1871 .is_static = false,
1872 .num_ips = ARRAY_SIZE(addresses_A_1),
1873 .ips = addresses_A_1,
1874 .apply_expected = false
1876 .r2 = {
1877 .owner = &ctx->b,
1878 .type = WREPL_TYPE_MHOMED,
1879 .state = WREPL_STATE_TOMBSTONE,
1880 .node = WREPL_NODE_B,
1881 .is_static = false,
1882 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1883 .ips = addresses_B_3_4,
1884 .apply_expected = true
1889 * unique,tombstone vs. mhomed,active
1890 * => should be replaced
1893 .line = __location__,
1894 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1895 .r1 = {
1896 .owner = &ctx->b,
1897 .type = WREPL_TYPE_UNIQUE,
1898 .state = WREPL_STATE_TOMBSTONE,
1899 .node = WREPL_NODE_B,
1900 .is_static = false,
1901 .num_ips = ARRAY_SIZE(addresses_B_1),
1902 .ips = addresses_B_1,
1903 .apply_expected = true
1905 .r2 = {
1906 .owner = &ctx->a,
1907 .type = WREPL_TYPE_MHOMED,
1908 .state = WREPL_STATE_ACTIVE,
1909 .node = WREPL_NODE_B,
1910 .is_static = false,
1911 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1912 .ips = addresses_A_3_4,
1913 .apply_expected = true
1918 * unique,tombstone vs. mhomed,tombstone
1919 * => should be replaced
1922 .line = __location__,
1923 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1924 .r1 = {
1925 .owner = &ctx->a,
1926 .type = WREPL_TYPE_UNIQUE,
1927 .state = WREPL_STATE_TOMBSTONE,
1928 .node = WREPL_NODE_B,
1929 .is_static = false,
1930 .num_ips = ARRAY_SIZE(addresses_A_1),
1931 .ips = addresses_A_1,
1932 .apply_expected = true
1934 .r2 = {
1935 .owner = &ctx->b,
1936 .type = WREPL_TYPE_MHOMED,
1937 .state = WREPL_STATE_TOMBSTONE,
1938 .node = WREPL_NODE_B,
1939 .is_static = false,
1940 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1941 .ips = addresses_B_3_4,
1942 .apply_expected = true
1947 * normal groups vs unique section,
1950 * group,active vs. unique,active
1951 * => should NOT be replaced
1954 .line = __location__,
1955 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1956 .r1 = {
1957 .owner = &ctx->a,
1958 .type = WREPL_TYPE_GROUP,
1959 .state = WREPL_STATE_ACTIVE,
1960 .node = WREPL_NODE_B,
1961 .is_static = false,
1962 .num_ips = ARRAY_SIZE(addresses_A_1),
1963 .ips = addresses_A_1,
1964 .apply_expected = true
1966 .r2 = {
1967 .owner = &ctx->b,
1968 .type = WREPL_TYPE_UNIQUE,
1969 .state = WREPL_STATE_ACTIVE,
1970 .node = WREPL_NODE_B,
1971 .is_static = false,
1972 .num_ips = ARRAY_SIZE(addresses_A_1),
1973 .ips = addresses_A_1,
1974 .apply_expected = false
1979 * group,active vs. unique,tombstone
1980 * => should NOT be replaced
1983 .line = __location__,
1984 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1985 .r1 = {
1986 .owner = &ctx->a,
1987 .type = WREPL_TYPE_GROUP,
1988 .state = WREPL_STATE_ACTIVE,
1989 .node = WREPL_NODE_B,
1990 .is_static = false,
1991 .num_ips = ARRAY_SIZE(addresses_A_1),
1992 .ips = addresses_A_1,
1993 .apply_expected = true
1995 .r2 = {
1996 .owner = &ctx->b,
1997 .type = WREPL_TYPE_UNIQUE,
1998 .state = WREPL_STATE_TOMBSTONE,
1999 .node = WREPL_NODE_B,
2000 .is_static = false,
2001 .num_ips = ARRAY_SIZE(addresses_A_1),
2002 .ips = addresses_A_1,
2003 .apply_expected = false
2008 * group,released vs. unique,active
2009 * => should NOT be replaced
2012 .line = __location__,
2013 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2014 .r1 = {
2015 .owner = &ctx->a,
2016 .type = WREPL_TYPE_GROUP,
2017 .state = WREPL_STATE_RELEASED,
2018 .node = WREPL_NODE_B,
2019 .is_static = false,
2020 .num_ips = ARRAY_SIZE(addresses_A_1),
2021 .ips = addresses_A_1,
2022 .apply_expected = false
2024 .r2 = {
2025 .owner = &ctx->b,
2026 .type = WREPL_TYPE_UNIQUE,
2027 .state = WREPL_STATE_ACTIVE,
2028 .node = WREPL_NODE_B,
2029 .is_static = false,
2030 .num_ips = ARRAY_SIZE(addresses_A_1),
2031 .ips = addresses_A_1,
2032 .apply_expected = false
2037 * group,released vs. unique,tombstone
2038 * => should NOT be replaced
2041 .line = __location__,
2042 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2043 .r1 = {
2044 .owner = &ctx->a,
2045 .type = WREPL_TYPE_GROUP,
2046 .state = WREPL_STATE_RELEASED,
2047 .node = WREPL_NODE_B,
2048 .is_static = false,
2049 .num_ips = ARRAY_SIZE(addresses_A_1),
2050 .ips = addresses_A_1,
2051 .apply_expected = false
2053 .r2 = {
2054 .owner = &ctx->b,
2055 .type = WREPL_TYPE_UNIQUE,
2056 .state = WREPL_STATE_TOMBSTONE,
2057 .node = WREPL_NODE_B,
2058 .is_static = false,
2059 .num_ips = ARRAY_SIZE(addresses_A_1),
2060 .ips = addresses_A_1,
2061 .apply_expected = false
2066 * group,tombstone vs. unique,active
2067 * => should NOT be replaced
2070 .line = __location__,
2071 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2072 .r1 = {
2073 .owner = &ctx->a,
2074 .type = WREPL_TYPE_GROUP,
2075 .state = WREPL_STATE_TOMBSTONE,
2076 .node = WREPL_NODE_B,
2077 .is_static = false,
2078 .num_ips = ARRAY_SIZE(addresses_A_1),
2079 .ips = addresses_A_1,
2080 .apply_expected = true
2082 .r2 = {
2083 .owner = &ctx->b,
2084 .type = WREPL_TYPE_UNIQUE,
2085 .state = WREPL_STATE_ACTIVE,
2086 .node = WREPL_NODE_B,
2087 .is_static = false,
2088 .num_ips = ARRAY_SIZE(addresses_A_1),
2089 .ips = addresses_A_1,
2090 .apply_expected = false
2095 * group,tombstone vs. unique,tombstone
2096 * => should NOT be replaced
2099 .line = __location__,
2100 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2101 .r1 = {
2102 .owner = &ctx->a,
2103 .type = WREPL_TYPE_GROUP,
2104 .state = WREPL_STATE_TOMBSTONE,
2105 .node = WREPL_NODE_B,
2106 .is_static = false,
2107 .num_ips = ARRAY_SIZE(addresses_A_1),
2108 .ips = addresses_A_1,
2109 .apply_expected = true
2111 .r2 = {
2112 .owner = &ctx->b,
2113 .type = WREPL_TYPE_UNIQUE,
2114 .state = WREPL_STATE_TOMBSTONE,
2115 .node = WREPL_NODE_B,
2116 .is_static = false,
2117 .num_ips = ARRAY_SIZE(addresses_A_1),
2118 .ips = addresses_A_1,
2119 .apply_expected = false
2124 * normal groups vs normal groups section,
2127 * group,active vs. group,active
2128 * => should NOT be replaced
2131 .line = __location__,
2132 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2133 .r1 = {
2134 .owner = &ctx->a,
2135 .type = WREPL_TYPE_GROUP,
2136 .state = WREPL_STATE_ACTIVE,
2137 .node = WREPL_NODE_B,
2138 .is_static = false,
2139 .num_ips = ARRAY_SIZE(addresses_A_1),
2140 .ips = addresses_A_1,
2141 .apply_expected = true
2143 .r2 = {
2144 .owner = &ctx->b,
2145 .type = WREPL_TYPE_GROUP,
2146 .state = WREPL_STATE_ACTIVE,
2147 .node = WREPL_NODE_B,
2148 .is_static = false,
2149 .num_ips = ARRAY_SIZE(addresses_A_1),
2150 .ips = addresses_A_1,
2151 .apply_expected = false
2156 * group,active vs. group,tombstone
2157 * => should NOT be replaced
2160 .line = __location__,
2161 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2162 .r1 = {
2163 .owner = &ctx->a,
2164 .type = WREPL_TYPE_GROUP,
2165 .state = WREPL_STATE_ACTIVE,
2166 .node = WREPL_NODE_B,
2167 .is_static = false,
2168 .num_ips = ARRAY_SIZE(addresses_A_1),
2169 .ips = addresses_A_1,
2170 .apply_expected = true
2172 .r2 = {
2173 .owner = &ctx->b,
2174 .type = WREPL_TYPE_GROUP,
2175 .state = WREPL_STATE_TOMBSTONE,
2176 .node = WREPL_NODE_B,
2177 .is_static = false,
2178 .num_ips = ARRAY_SIZE(addresses_A_1),
2179 .ips = addresses_A_1,
2180 .apply_expected = false
2185 * group,released vs. group,active
2186 * => should be replaced
2189 .line = __location__,
2190 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2191 .r1 = {
2192 .owner = &ctx->a,
2193 .type = WREPL_TYPE_GROUP,
2194 .state = WREPL_STATE_RELEASED,
2195 .node = WREPL_NODE_B,
2196 .is_static = false,
2197 .num_ips = ARRAY_SIZE(addresses_A_1),
2198 .ips = addresses_A_1,
2199 .apply_expected = false
2201 .r2 = {
2202 .owner = &ctx->b,
2203 .type = WREPL_TYPE_GROUP,
2204 .state = WREPL_STATE_ACTIVE,
2205 .node = WREPL_NODE_B,
2206 .is_static = false,
2207 .num_ips = ARRAY_SIZE(addresses_B_1),
2208 .ips = addresses_B_1,
2209 .apply_expected = true
2214 * group,released vs. group,tombstone
2215 * => should be replaced
2218 .line = __location__,
2219 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2220 .r1 = {
2221 .owner = &ctx->a,
2222 .type = WREPL_TYPE_GROUP,
2223 .state = WREPL_STATE_RELEASED,
2224 .node = WREPL_NODE_B,
2225 .is_static = false,
2226 .num_ips = ARRAY_SIZE(addresses_A_1),
2227 .ips = addresses_A_1,
2228 .apply_expected = false
2230 .r2 = {
2231 .owner = &ctx->b,
2232 .type = WREPL_TYPE_GROUP,
2233 .state = WREPL_STATE_TOMBSTONE,
2234 .node = WREPL_NODE_B,
2235 .is_static = false,
2236 .num_ips = ARRAY_SIZE(addresses_B_1),
2237 .ips = addresses_B_1,
2238 .apply_expected = true
2243 * group,tombstone vs. group,active
2244 * => should be replaced
2247 .line = __location__,
2248 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2249 .r1 = {
2250 .owner = &ctx->b,
2251 .type = WREPL_TYPE_GROUP,
2252 .state = WREPL_STATE_TOMBSTONE,
2253 .node = WREPL_NODE_B,
2254 .is_static = false,
2255 .num_ips = ARRAY_SIZE(addresses_B_1),
2256 .ips = addresses_B_1,
2257 .apply_expected = true
2259 .r2 = {
2260 .owner = &ctx->a,
2261 .type = WREPL_TYPE_GROUP,
2262 .state = WREPL_STATE_ACTIVE,
2263 .node = WREPL_NODE_B,
2264 .is_static = false,
2265 .num_ips = ARRAY_SIZE(addresses_A_1),
2266 .ips = addresses_A_1,
2267 .apply_expected = true
2272 * group,tombstone vs. group,tombstone
2273 * => should be replaced
2276 .line = __location__,
2277 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2278 .r1 = {
2279 .owner = &ctx->a,
2280 .type = WREPL_TYPE_GROUP,
2281 .state = WREPL_STATE_TOMBSTONE,
2282 .node = WREPL_NODE_B,
2283 .is_static = false,
2284 .num_ips = ARRAY_SIZE(addresses_A_1),
2285 .ips = addresses_A_1,
2286 .apply_expected = true
2288 .r2 = {
2289 .owner = &ctx->b,
2290 .type = WREPL_TYPE_GROUP,
2291 .state = WREPL_STATE_TOMBSTONE,
2292 .node = WREPL_NODE_B,
2293 .is_static = false,
2294 .num_ips = ARRAY_SIZE(addresses_B_1),
2295 .ips = addresses_B_1,
2296 .apply_expected = true
2301 * normal groups vs special groups section,
2304 * group,active vs. sgroup,active
2305 * => should NOT be replaced
2308 .line = __location__,
2309 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2310 .r1 = {
2311 .owner = &ctx->b,
2312 .type = WREPL_TYPE_GROUP,
2313 .state = WREPL_STATE_ACTIVE,
2314 .node = WREPL_NODE_B,
2315 .is_static = false,
2316 .num_ips = ARRAY_SIZE(addresses_B_1),
2317 .ips = addresses_B_1,
2318 .apply_expected = true
2320 .r2 = {
2321 .owner = &ctx->a,
2322 .type = WREPL_TYPE_SGROUP,
2323 .state = WREPL_STATE_ACTIVE,
2324 .node = WREPL_NODE_B,
2325 .is_static = false,
2326 .num_ips = ARRAY_SIZE(addresses_B_1),
2327 .ips = addresses_B_1,
2328 .apply_expected = false
2333 * group,active vs. sgroup,tombstone
2334 * => should NOT be replaced
2337 .line = __location__,
2338 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2339 .r1 = {
2340 .owner = &ctx->b,
2341 .type = WREPL_TYPE_GROUP,
2342 .state = WREPL_STATE_ACTIVE,
2343 .node = WREPL_NODE_B,
2344 .is_static = false,
2345 .num_ips = ARRAY_SIZE(addresses_B_1),
2346 .ips = addresses_B_1,
2347 .apply_expected = true
2349 .r2 = {
2350 .owner = &ctx->a,
2351 .type = WREPL_TYPE_SGROUP,
2352 .state = WREPL_STATE_TOMBSTONE,
2353 .node = WREPL_NODE_B,
2354 .is_static = false,
2355 .num_ips = ARRAY_SIZE(addresses_B_1),
2356 .ips = addresses_B_1,
2357 .apply_expected = false
2362 * group,released vs. sgroup,active
2363 * => should be replaced
2366 .line = __location__,
2367 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2368 .r1 = {
2369 .owner = &ctx->a,
2370 .type = WREPL_TYPE_GROUP,
2371 .state = WREPL_STATE_RELEASED,
2372 .node = WREPL_NODE_B,
2373 .is_static = false,
2374 .num_ips = ARRAY_SIZE(addresses_A_1),
2375 .ips = addresses_A_1,
2376 .apply_expected = false
2378 .r2 = {
2379 .owner = &ctx->b,
2380 .type = WREPL_TYPE_SGROUP,
2381 .state = WREPL_STATE_ACTIVE,
2382 .node = WREPL_NODE_B,
2383 .is_static = false,
2384 .num_ips = ARRAY_SIZE(addresses_B_1),
2385 .ips = addresses_B_1,
2386 .apply_expected = true
2391 * group,released vs. sgroup,tombstone
2392 * => should NOT be replaced
2395 .line = __location__,
2396 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2397 .r1 = {
2398 .owner = &ctx->b,
2399 .type = WREPL_TYPE_GROUP,
2400 .state = WREPL_STATE_RELEASED,
2401 .node = WREPL_NODE_B,
2402 .is_static = false,
2403 .num_ips = ARRAY_SIZE(addresses_B_1),
2404 .ips = addresses_B_1,
2405 .apply_expected = false
2407 .r2 = {
2408 .owner = &ctx->a,
2409 .type = WREPL_TYPE_SGROUP,
2410 .state = WREPL_STATE_TOMBSTONE,
2411 .node = WREPL_NODE_B,
2412 .is_static = false,
2413 .num_ips = ARRAY_SIZE(addresses_B_1),
2414 .ips = addresses_B_1,
2415 .apply_expected = false
2420 * group,tombstone vs. sgroup,active
2421 * => should be replaced
2424 .line = __location__,
2425 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2426 .r1 = {
2427 .owner = &ctx->b,
2428 .type = WREPL_TYPE_GROUP,
2429 .state = WREPL_STATE_TOMBSTONE,
2430 .node = WREPL_NODE_B,
2431 .is_static = false,
2432 .num_ips = ARRAY_SIZE(addresses_B_1),
2433 .ips = addresses_B_1,
2434 .apply_expected = true
2436 .r2 = {
2437 .owner = &ctx->a,
2438 .type = WREPL_TYPE_SGROUP,
2439 .state = WREPL_STATE_ACTIVE,
2440 .node = WREPL_NODE_B,
2441 .is_static = false,
2442 .num_ips = ARRAY_SIZE(addresses_A_1),
2443 .ips = addresses_A_1,
2444 .apply_expected = true
2449 * group,tombstone vs. sgroup,tombstone
2450 * => should be replaced
2453 .line = __location__,
2454 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2455 .r1 = {
2456 .owner = &ctx->a,
2457 .type = WREPL_TYPE_GROUP,
2458 .state = WREPL_STATE_TOMBSTONE,
2459 .node = WREPL_NODE_B,
2460 .is_static = false,
2461 .num_ips = ARRAY_SIZE(addresses_A_1),
2462 .ips = addresses_A_1,
2463 .apply_expected = true
2465 .r2 = {
2466 .owner = &ctx->b,
2467 .type = WREPL_TYPE_SGROUP,
2468 .state = WREPL_STATE_TOMBSTONE,
2469 .node = WREPL_NODE_B,
2470 .is_static = false,
2471 .num_ips = ARRAY_SIZE(addresses_B_1),
2472 .ips = addresses_B_1,
2473 .apply_expected = true
2478 * normal groups vs multi homed section,
2481 * group,active vs. mhomed,active
2482 * => should NOT be replaced
2485 .line = __location__,
2486 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2487 .r1 = {
2488 .owner = &ctx->b,
2489 .type = WREPL_TYPE_GROUP,
2490 .state = WREPL_STATE_ACTIVE,
2491 .node = WREPL_NODE_B,
2492 .is_static = false,
2493 .num_ips = ARRAY_SIZE(addresses_B_1),
2494 .ips = addresses_B_1,
2495 .apply_expected = true
2497 .r2 = {
2498 .owner = &ctx->a,
2499 .type = WREPL_TYPE_MHOMED,
2500 .state = WREPL_STATE_ACTIVE,
2501 .node = WREPL_NODE_B,
2502 .is_static = false,
2503 .num_ips = ARRAY_SIZE(addresses_B_1),
2504 .ips = addresses_B_1,
2505 .apply_expected = false
2510 * group,active vs. mhomed,tombstone
2511 * => should NOT be replaced
2514 .line = __location__,
2515 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2516 .r1 = {
2517 .owner = &ctx->b,
2518 .type = WREPL_TYPE_GROUP,
2519 .state = WREPL_STATE_ACTIVE,
2520 .node = WREPL_NODE_B,
2521 .is_static = false,
2522 .num_ips = ARRAY_SIZE(addresses_B_1),
2523 .ips = addresses_B_1,
2524 .apply_expected = true
2526 .r2 = {
2527 .owner = &ctx->a,
2528 .type = WREPL_TYPE_MHOMED,
2529 .state = WREPL_STATE_TOMBSTONE,
2530 .node = WREPL_NODE_B,
2531 .is_static = false,
2532 .num_ips = ARRAY_SIZE(addresses_B_1),
2533 .ips = addresses_B_1,
2534 .apply_expected = false
2539 * group,released vs. mhomed,active
2540 * => should NOT be replaced
2543 .line = __location__,
2544 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2545 .r1 = {
2546 .owner = &ctx->b,
2547 .type = WREPL_TYPE_GROUP,
2548 .state = WREPL_STATE_RELEASED,
2549 .node = WREPL_NODE_B,
2550 .is_static = false,
2551 .num_ips = ARRAY_SIZE(addresses_B_1),
2552 .ips = addresses_B_1,
2553 .apply_expected = false
2555 .r2 = {
2556 .owner = &ctx->a,
2557 .type = WREPL_TYPE_MHOMED,
2558 .state = WREPL_STATE_ACTIVE,
2559 .node = WREPL_NODE_B,
2560 .is_static = false,
2561 .num_ips = ARRAY_SIZE(addresses_B_1),
2562 .ips = addresses_B_1,
2563 .apply_expected = false
2568 * group,released vs. mhomed,tombstone
2569 * => should NOT be replaced
2572 .line = __location__,
2573 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2574 .r1 = {
2575 .owner = &ctx->b,
2576 .type = WREPL_TYPE_GROUP,
2577 .state = WREPL_STATE_RELEASED,
2578 .node = WREPL_NODE_B,
2579 .is_static = false,
2580 .num_ips = ARRAY_SIZE(addresses_B_1),
2581 .ips = addresses_B_1,
2582 .apply_expected = false
2584 .r2 = {
2585 .owner = &ctx->a,
2586 .type = WREPL_TYPE_MHOMED,
2587 .state = WREPL_STATE_TOMBSTONE,
2588 .node = WREPL_NODE_B,
2589 .is_static = false,
2590 .num_ips = ARRAY_SIZE(addresses_B_1),
2591 .ips = addresses_B_1,
2592 .apply_expected = false
2597 * group,tombstone vs. mhomed,active
2598 * => should be replaced
2601 .line = __location__,
2602 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2603 .r1 = {
2604 .owner = &ctx->b,
2605 .type = WREPL_TYPE_GROUP,
2606 .state = WREPL_STATE_TOMBSTONE,
2607 .node = WREPL_NODE_B,
2608 .is_static = false,
2609 .num_ips = ARRAY_SIZE(addresses_B_1),
2610 .ips = addresses_B_1,
2611 .apply_expected = true
2613 .r2 = {
2614 .owner = &ctx->a,
2615 .type = WREPL_TYPE_MHOMED,
2616 .state = WREPL_STATE_ACTIVE,
2617 .node = WREPL_NODE_B,
2618 .is_static = false,
2619 .num_ips = ARRAY_SIZE(addresses_A_1),
2620 .ips = addresses_A_1,
2621 .apply_expected = true
2626 * group,tombstone vs. mhomed,tombstone
2627 * => should be replaced
2630 .line = __location__,
2631 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2632 .r1 = {
2633 .owner = &ctx->a,
2634 .type = WREPL_TYPE_GROUP,
2635 .state = WREPL_STATE_TOMBSTONE,
2636 .node = WREPL_NODE_B,
2637 .is_static = false,
2638 .num_ips = ARRAY_SIZE(addresses_A_1),
2639 .ips = addresses_A_1,
2640 .apply_expected = true
2642 .r2 = {
2643 .owner = &ctx->b,
2644 .type = WREPL_TYPE_MHOMED,
2645 .state = WREPL_STATE_TOMBSTONE,
2646 .node = WREPL_NODE_B,
2647 .is_static = false,
2648 .num_ips = ARRAY_SIZE(addresses_B_1),
2649 .ips = addresses_B_1,
2650 .apply_expected = true
2655 * special groups vs unique section,
2658 * sgroup,active vs. unique,active
2659 * => should NOT be replaced
2662 .line = __location__,
2663 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2664 .r1 = {
2665 .owner = &ctx->b,
2666 .type = WREPL_TYPE_SGROUP,
2667 .state = WREPL_STATE_ACTIVE,
2668 .node = WREPL_NODE_B,
2669 .is_static = false,
2670 .num_ips = ARRAY_SIZE(addresses_B_1),
2671 .ips = addresses_B_1,
2672 .apply_expected = true
2674 .r2 = {
2675 .owner = &ctx->a,
2676 .type = WREPL_TYPE_UNIQUE,
2677 .state = WREPL_STATE_ACTIVE,
2678 .node = WREPL_NODE_B,
2679 .is_static = false,
2680 .num_ips = ARRAY_SIZE(addresses_B_1),
2681 .ips = addresses_B_1,
2682 .apply_expected = false
2687 * sgroup,active vs. unique,tombstone
2688 * => should NOT be replaced
2691 .line = __location__,
2692 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2693 .r1 = {
2694 .owner = &ctx->b,
2695 .type = WREPL_TYPE_SGROUP,
2696 .state = WREPL_STATE_ACTIVE,
2697 .node = WREPL_NODE_B,
2698 .is_static = false,
2699 .num_ips = ARRAY_SIZE(addresses_B_1),
2700 .ips = addresses_B_1,
2701 .apply_expected = true
2703 .r2 = {
2704 .owner = &ctx->a,
2705 .type = WREPL_TYPE_UNIQUE,
2706 .state = WREPL_STATE_TOMBSTONE,
2707 .node = WREPL_NODE_B,
2708 .is_static = false,
2709 .num_ips = ARRAY_SIZE(addresses_B_1),
2710 .ips = addresses_B_1,
2711 .apply_expected = false
2716 * sgroup,released vs. unique,active
2717 * => should be replaced
2720 .line = __location__,
2721 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2722 .r1 = {
2723 .owner = &ctx->b,
2724 .type = WREPL_TYPE_SGROUP,
2725 .state = WREPL_STATE_RELEASED,
2726 .node = WREPL_NODE_B,
2727 .is_static = false,
2728 .num_ips = ARRAY_SIZE(addresses_B_1),
2729 .ips = addresses_B_1,
2730 .apply_expected = false
2732 .r2 = {
2733 .owner = &ctx->a,
2734 .type = WREPL_TYPE_UNIQUE,
2735 .state = WREPL_STATE_ACTIVE,
2736 .node = WREPL_NODE_B,
2737 .is_static = false,
2738 .num_ips = ARRAY_SIZE(addresses_A_1),
2739 .ips = addresses_A_1,
2740 .apply_expected = true
2745 * sgroup,released vs. unique,tombstone
2746 * => should be replaced
2749 .line = __location__,
2750 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2751 .r1 = {
2752 .owner = &ctx->a,
2753 .type = WREPL_TYPE_SGROUP,
2754 .state = WREPL_STATE_RELEASED,
2755 .node = WREPL_NODE_B,
2756 .is_static = false,
2757 .num_ips = ARRAY_SIZE(addresses_A_1),
2758 .ips = addresses_A_1,
2759 .apply_expected = false
2761 .r2 = {
2762 .owner = &ctx->b,
2763 .type = WREPL_TYPE_UNIQUE,
2764 .state = WREPL_STATE_TOMBSTONE,
2765 .node = WREPL_NODE_B,
2766 .is_static = false,
2767 .num_ips = ARRAY_SIZE(addresses_B_1),
2768 .ips = addresses_B_1,
2769 .apply_expected = true
2774 * sgroup,tombstone vs. unique,active
2775 * => should be replaced
2778 .line = __location__,
2779 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2780 .r1 = {
2781 .owner = &ctx->a,
2782 .type = WREPL_TYPE_SGROUP,
2783 .state = WREPL_STATE_TOMBSTONE,
2784 .node = WREPL_NODE_B,
2785 .is_static = false,
2786 .num_ips = ARRAY_SIZE(addresses_A_1),
2787 .ips = addresses_A_1,
2788 .apply_expected = true
2790 .r2 = {
2791 .owner = &ctx->b,
2792 .type = WREPL_TYPE_UNIQUE,
2793 .state = WREPL_STATE_ACTIVE,
2794 .node = WREPL_NODE_B,
2795 .is_static = false,
2796 .num_ips = ARRAY_SIZE(addresses_B_1),
2797 .ips = addresses_B_1,
2798 .apply_expected = true
2803 * sgroup,tombstone vs. unique,tombstone
2804 * => should be replaced
2807 .line = __location__,
2808 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2809 .r1 = {
2810 .owner = &ctx->b,
2811 .type = WREPL_TYPE_SGROUP,
2812 .state = WREPL_STATE_TOMBSTONE,
2813 .node = WREPL_NODE_B,
2814 .is_static = false,
2815 .num_ips = ARRAY_SIZE(addresses_B_1),
2816 .ips = addresses_B_1,
2817 .apply_expected = true
2819 .r2 = {
2820 .owner = &ctx->a,
2821 .type = WREPL_TYPE_UNIQUE,
2822 .state = WREPL_STATE_TOMBSTONE,
2823 .node = WREPL_NODE_B,
2824 .is_static = false,
2825 .num_ips = ARRAY_SIZE(addresses_A_1),
2826 .ips = addresses_A_1,
2827 .apply_expected = true
2832 * special groups vs normal group section,
2835 * sgroup,active vs. group,active
2836 * => should NOT be replaced
2839 .line = __location__,
2840 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2841 .r1 = {
2842 .owner = &ctx->a,
2843 .type = WREPL_TYPE_SGROUP,
2844 .state = WREPL_STATE_ACTIVE,
2845 .node = WREPL_NODE_B,
2846 .is_static = false,
2847 .num_ips = ARRAY_SIZE(addresses_A_1),
2848 .ips = addresses_A_1,
2849 .apply_expected = true
2851 .r2 = {
2852 .owner = &ctx->b,
2853 .type = WREPL_TYPE_GROUP,
2854 .state = WREPL_STATE_ACTIVE,
2855 .node = WREPL_NODE_B,
2856 .is_static = false,
2857 .num_ips = ARRAY_SIZE(addresses_A_1),
2858 .ips = addresses_A_1,
2859 .apply_expected = false
2864 * sgroup,active vs. group,tombstone
2865 * => should NOT be replaced
2868 .line = __location__,
2869 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2870 .r1 = {
2871 .owner = &ctx->a,
2872 .type = WREPL_TYPE_SGROUP,
2873 .state = WREPL_STATE_ACTIVE,
2874 .node = WREPL_NODE_B,
2875 .is_static = false,
2876 .num_ips = ARRAY_SIZE(addresses_A_1),
2877 .ips = addresses_A_1,
2878 .apply_expected = true
2880 .r2 = {
2881 .owner = &ctx->b,
2882 .type = WREPL_TYPE_GROUP,
2883 .state = WREPL_STATE_TOMBSTONE,
2884 .node = WREPL_NODE_B,
2885 .is_static = false,
2886 .num_ips = ARRAY_SIZE(addresses_A_1),
2887 .ips = addresses_A_1,
2888 .apply_expected = false
2893 * sgroup,released vs. group,active
2894 * => should be replaced
2897 .line = __location__,
2898 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2899 .r1 = {
2900 .owner = &ctx->a,
2901 .type = WREPL_TYPE_SGROUP,
2902 .state = WREPL_STATE_RELEASED,
2903 .node = WREPL_NODE_B,
2904 .is_static = false,
2905 .num_ips = ARRAY_SIZE(addresses_A_1),
2906 .ips = addresses_A_1,
2907 .apply_expected = false
2909 .r2 = {
2910 .owner = &ctx->b,
2911 .type = WREPL_TYPE_GROUP,
2912 .state = WREPL_STATE_ACTIVE,
2913 .node = WREPL_NODE_B,
2914 .is_static = false,
2915 .num_ips = ARRAY_SIZE(addresses_B_1),
2916 .ips = addresses_B_1,
2917 .apply_expected = true
2922 * sgroup,released vs. group,tombstone
2923 * => should be replaced
2926 .line = __location__,
2927 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2928 .r1 = {
2929 .owner = &ctx->b,
2930 .type = WREPL_TYPE_SGROUP,
2931 .state = WREPL_STATE_RELEASED,
2932 .node = WREPL_NODE_B,
2933 .is_static = false,
2934 .num_ips = ARRAY_SIZE(addresses_B_1),
2935 .ips = addresses_B_1,
2936 .apply_expected = false
2938 .r2 = {
2939 .owner = &ctx->a,
2940 .type = WREPL_TYPE_GROUP,
2941 .state = WREPL_STATE_TOMBSTONE,
2942 .node = WREPL_NODE_B,
2943 .is_static = false,
2944 .num_ips = ARRAY_SIZE(addresses_A_1),
2945 .ips = addresses_A_1,
2946 .apply_expected = true
2951 * sgroup,tombstone vs. group,active
2952 * => should NOT be replaced
2955 .line = __location__,
2956 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2957 .r1 = {
2958 .owner = &ctx->a,
2959 .type = WREPL_TYPE_SGROUP,
2960 .state = WREPL_STATE_TOMBSTONE,
2961 .node = WREPL_NODE_B,
2962 .is_static = false,
2963 .num_ips = ARRAY_SIZE(addresses_A_1),
2964 .ips = addresses_A_1,
2965 .apply_expected = true
2967 .r2 = {
2968 .owner = &ctx->b,
2969 .type = WREPL_TYPE_GROUP,
2970 .state = WREPL_STATE_ACTIVE,
2971 .node = WREPL_NODE_B,
2972 .is_static = false,
2973 .num_ips = ARRAY_SIZE(addresses_B_1),
2974 .ips = addresses_B_1,
2975 .apply_expected = true
2980 * sgroup,tombstone vs. group,tombstone
2981 * => should NOT be replaced
2984 .line = __location__,
2985 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2986 .r1 = {
2987 .owner = &ctx->b,
2988 .type = WREPL_TYPE_SGROUP,
2989 .state = WREPL_STATE_TOMBSTONE,
2990 .node = WREPL_NODE_B,
2991 .is_static = false,
2992 .num_ips = ARRAY_SIZE(addresses_B_1),
2993 .ips = addresses_B_1,
2994 .apply_expected = true
2996 .r2 = {
2997 .owner = &ctx->a,
2998 .type = WREPL_TYPE_GROUP,
2999 .state = WREPL_STATE_TOMBSTONE,
3000 .node = WREPL_NODE_B,
3001 .is_static = false,
3002 .num_ips = ARRAY_SIZE(addresses_A_1),
3003 .ips = addresses_A_1,
3004 .apply_expected = true
3009 * special groups (not active) vs special group section,
3012 * sgroup,released vs. sgroup,active
3013 * => should be replaced
3016 .line = __location__,
3017 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3018 .r1 = {
3019 .owner = &ctx->a,
3020 .type = WREPL_TYPE_SGROUP,
3021 .state = WREPL_STATE_RELEASED,
3022 .node = WREPL_NODE_B,
3023 .is_static = false,
3024 .num_ips = ARRAY_SIZE(addresses_A_1),
3025 .ips = addresses_A_1,
3026 .apply_expected = false
3028 .r2 = {
3029 .owner = &ctx->b,
3030 .type = WREPL_TYPE_SGROUP,
3031 .state = WREPL_STATE_ACTIVE,
3032 .node = WREPL_NODE_B,
3033 .is_static = false,
3034 .num_ips = ARRAY_SIZE(addresses_B_1),
3035 .ips = addresses_B_1,
3036 .apply_expected = true
3041 * sgroup,released vs. sgroup,tombstone
3042 * => should be replaced
3045 .line = __location__,
3046 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3047 .r1 = {
3048 .owner = &ctx->b,
3049 .type = WREPL_TYPE_SGROUP,
3050 .state = WREPL_STATE_RELEASED,
3051 .node = WREPL_NODE_B,
3052 .is_static = false,
3053 .num_ips = ARRAY_SIZE(addresses_B_1),
3054 .ips = addresses_B_1,
3055 .apply_expected = false
3057 .r2 = {
3058 .owner = &ctx->a,
3059 .type = WREPL_TYPE_SGROUP,
3060 .state = WREPL_STATE_TOMBSTONE,
3061 .node = WREPL_NODE_B,
3062 .is_static = false,
3063 .num_ips = ARRAY_SIZE(addresses_A_1),
3064 .ips = addresses_A_1,
3065 .apply_expected = true
3070 * sgroup,tombstone vs. sgroup,active
3071 * => should NOT be replaced
3074 .line = __location__,
3075 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3076 .r1 = {
3077 .owner = &ctx->a,
3078 .type = WREPL_TYPE_SGROUP,
3079 .state = WREPL_STATE_TOMBSTONE,
3080 .node = WREPL_NODE_B,
3081 .is_static = false,
3082 .num_ips = ARRAY_SIZE(addresses_A_1),
3083 .ips = addresses_A_1,
3084 .apply_expected = true
3086 .r2 = {
3087 .owner = &ctx->b,
3088 .type = WREPL_TYPE_SGROUP,
3089 .state = WREPL_STATE_ACTIVE,
3090 .node = WREPL_NODE_B,
3091 .is_static = false,
3092 .num_ips = ARRAY_SIZE(addresses_B_1),
3093 .ips = addresses_B_1,
3094 .apply_expected = true
3099 * sgroup,tombstone vs. sgroup,tombstone
3100 * => should NOT be replaced
3103 .line = __location__,
3104 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3105 .r1 = {
3106 .owner = &ctx->b,
3107 .type = WREPL_TYPE_SGROUP,
3108 .state = WREPL_STATE_TOMBSTONE,
3109 .node = WREPL_NODE_B,
3110 .is_static = false,
3111 .num_ips = ARRAY_SIZE(addresses_B_1),
3112 .ips = addresses_B_1,
3113 .apply_expected = true
3115 .r2 = {
3116 .owner = &ctx->a,
3117 .type = WREPL_TYPE_SGROUP,
3118 .state = WREPL_STATE_TOMBSTONE,
3119 .node = WREPL_NODE_B,
3120 .is_static = false,
3121 .num_ips = ARRAY_SIZE(addresses_A_1),
3122 .ips = addresses_A_1,
3123 .apply_expected = true
3128 * special groups vs multi homed section,
3131 * sgroup,active vs. mhomed,active
3132 * => should NOT be replaced
3135 .line = __location__,
3136 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3137 .r1 = {
3138 .owner = &ctx->a,
3139 .type = WREPL_TYPE_SGROUP,
3140 .state = WREPL_STATE_ACTIVE,
3141 .node = WREPL_NODE_B,
3142 .is_static = false,
3143 .num_ips = ARRAY_SIZE(addresses_A_1),
3144 .ips = addresses_A_1,
3145 .apply_expected = true
3147 .r2 = {
3148 .owner = &ctx->b,
3149 .type = WREPL_TYPE_MHOMED,
3150 .state = WREPL_STATE_ACTIVE,
3151 .node = WREPL_NODE_B,
3152 .is_static = false,
3153 .num_ips = ARRAY_SIZE(addresses_A_1),
3154 .ips = addresses_A_1,
3155 .apply_expected = false
3160 * sgroup,active vs. mhomed,tombstone
3161 * => should NOT be replaced
3164 .line = __location__,
3165 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3166 .r1 = {
3167 .owner = &ctx->a,
3168 .type = WREPL_TYPE_SGROUP,
3169 .state = WREPL_STATE_ACTIVE,
3170 .node = WREPL_NODE_B,
3171 .is_static = false,
3172 .num_ips = ARRAY_SIZE(addresses_A_1),
3173 .ips = addresses_A_1,
3174 .apply_expected = true
3176 .r2 = {
3177 .owner = &ctx->b,
3178 .type = WREPL_TYPE_MHOMED,
3179 .state = WREPL_STATE_TOMBSTONE,
3180 .node = WREPL_NODE_B,
3181 .is_static = false,
3182 .num_ips = ARRAY_SIZE(addresses_A_1),
3183 .ips = addresses_A_1,
3184 .apply_expected = false
3189 * sgroup,released vs. mhomed,active
3190 * => should be replaced
3193 .line = __location__,
3194 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3195 .r1 = {
3196 .owner = &ctx->a,
3197 .type = WREPL_TYPE_SGROUP,
3198 .state = WREPL_STATE_RELEASED,
3199 .node = WREPL_NODE_B,
3200 .is_static = false,
3201 .num_ips = ARRAY_SIZE(addresses_A_1),
3202 .ips = addresses_A_1,
3203 .apply_expected = false
3205 .r2 = {
3206 .owner = &ctx->b,
3207 .type = WREPL_TYPE_MHOMED,
3208 .state = WREPL_STATE_ACTIVE,
3209 .node = WREPL_NODE_B,
3210 .is_static = false,
3211 .num_ips = ARRAY_SIZE(addresses_B_1),
3212 .ips = addresses_B_1,
3213 .apply_expected = true
3218 * sgroup,released vs. mhomed,tombstone
3219 * => should be replaced
3222 .line = __location__,
3223 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3224 .r1 = {
3225 .owner = &ctx->b,
3226 .type = WREPL_TYPE_SGROUP,
3227 .state = WREPL_STATE_RELEASED,
3228 .node = WREPL_NODE_B,
3229 .is_static = false,
3230 .num_ips = ARRAY_SIZE(addresses_B_1),
3231 .ips = addresses_B_1,
3232 .apply_expected = false
3234 .r2 = {
3235 .owner = &ctx->a,
3236 .type = WREPL_TYPE_MHOMED,
3237 .state = WREPL_STATE_TOMBSTONE,
3238 .node = WREPL_NODE_B,
3239 .is_static = false,
3240 .num_ips = ARRAY_SIZE(addresses_A_1),
3241 .ips = addresses_A_1,
3242 .apply_expected = true
3247 * sgroup,tombstone vs. mhomed,active
3248 * => should be replaced
3251 .line = __location__,
3252 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3253 .r1 = {
3254 .owner = &ctx->a,
3255 .type = WREPL_TYPE_SGROUP,
3256 .state = WREPL_STATE_TOMBSTONE,
3257 .node = WREPL_NODE_B,
3258 .is_static = false,
3259 .num_ips = ARRAY_SIZE(addresses_A_1),
3260 .ips = addresses_A_1,
3261 .apply_expected = true
3263 .r2 = {
3264 .owner = &ctx->b,
3265 .type = WREPL_TYPE_MHOMED,
3266 .state = WREPL_STATE_ACTIVE,
3267 .node = WREPL_NODE_B,
3268 .is_static = false,
3269 .num_ips = ARRAY_SIZE(addresses_B_1),
3270 .ips = addresses_B_1,
3271 .apply_expected = true
3276 * sgroup,tombstone vs. mhomed,tombstone
3277 * => should be replaced
3280 .line = __location__,
3281 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3282 .r1 = {
3283 .owner = &ctx->b,
3284 .type = WREPL_TYPE_SGROUP,
3285 .state = WREPL_STATE_TOMBSTONE,
3286 .node = WREPL_NODE_B,
3287 .is_static = false,
3288 .num_ips = ARRAY_SIZE(addresses_B_1),
3289 .ips = addresses_B_1,
3290 .apply_expected = true
3292 .r2 = {
3293 .owner = &ctx->a,
3294 .type = WREPL_TYPE_MHOMED,
3295 .state = WREPL_STATE_TOMBSTONE,
3296 .node = WREPL_NODE_B,
3297 .is_static = false,
3298 .num_ips = ARRAY_SIZE(addresses_A_1),
3299 .ips = addresses_A_1,
3300 .apply_expected = true
3305 * multi homed vs. unique section,
3308 * mhomed,active vs. unique,active
3309 * => should be replaced
3312 .line = __location__,
3313 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3314 .r1 = {
3315 .owner = &ctx->a,
3316 .type = WREPL_TYPE_MHOMED,
3317 .state = WREPL_STATE_ACTIVE,
3318 .node = WREPL_NODE_B,
3319 .is_static = false,
3320 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3321 .ips = addresses_A_3_4,
3322 .apply_expected = true
3324 .r2 = {
3325 .owner = &ctx->b,
3326 .type = WREPL_TYPE_UNIQUE,
3327 .state = WREPL_STATE_ACTIVE,
3328 .node = WREPL_NODE_B,
3329 .is_static = false,
3330 .num_ips = ARRAY_SIZE(addresses_B_1),
3331 .ips = addresses_B_1,
3332 .apply_expected = true
3337 * mhomed,active vs. unique,tombstone
3338 * => should NOT be replaced
3341 .line = __location__,
3342 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3343 .r1 = {
3344 .owner = &ctx->b,
3345 .type = WREPL_TYPE_MHOMED,
3346 .state = WREPL_STATE_ACTIVE,
3347 .node = WREPL_NODE_B,
3348 .is_static = false,
3349 .num_ips = ARRAY_SIZE(addresses_B_1),
3350 .ips = addresses_B_1,
3351 .apply_expected = true
3353 .r2 = {
3354 .owner = &ctx->a,
3355 .type = WREPL_TYPE_UNIQUE,
3356 .state = WREPL_STATE_TOMBSTONE,
3357 .node = WREPL_NODE_B,
3358 .is_static = false,
3359 .num_ips = ARRAY_SIZE(addresses_B_1),
3360 .ips = addresses_B_1,
3361 .apply_expected = false
3366 * mhomed,released vs. unique,active
3367 * => should be replaced
3370 .line = __location__,
3371 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3372 .r1 = {
3373 .owner = &ctx->a,
3374 .type = WREPL_TYPE_MHOMED,
3375 .state = WREPL_STATE_RELEASED,
3376 .node = WREPL_NODE_B,
3377 .is_static = false,
3378 .num_ips = ARRAY_SIZE(addresses_A_1),
3379 .ips = addresses_A_1,
3380 .apply_expected = false
3382 .r2 = {
3383 .owner = &ctx->b,
3384 .type = WREPL_TYPE_UNIQUE,
3385 .state = WREPL_STATE_ACTIVE,
3386 .node = WREPL_NODE_B,
3387 .is_static = false,
3388 .num_ips = ARRAY_SIZE(addresses_B_1),
3389 .ips = addresses_B_1,
3390 .apply_expected = true
3395 * mhomed,released vs. uinique,tombstone
3396 * => should be replaced
3399 .line = __location__,
3400 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3401 .r1 = {
3402 .owner = &ctx->b,
3403 .type = WREPL_TYPE_MHOMED,
3404 .state = WREPL_STATE_RELEASED,
3405 .node = WREPL_NODE_B,
3406 .is_static = false,
3407 .num_ips = ARRAY_SIZE(addresses_B_1),
3408 .ips = addresses_B_1,
3409 .apply_expected = false
3411 .r2 = {
3412 .owner = &ctx->a,
3413 .type = WREPL_TYPE_UNIQUE,
3414 .state = WREPL_STATE_TOMBSTONE,
3415 .node = WREPL_NODE_B,
3416 .is_static = false,
3417 .num_ips = ARRAY_SIZE(addresses_A_1),
3418 .ips = addresses_A_1,
3419 .apply_expected = true
3424 * mhomed,tombstone vs. unique,active
3425 * => should be replaced
3428 .line = __location__,
3429 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3430 .r1 = {
3431 .owner = &ctx->a,
3432 .type = WREPL_TYPE_MHOMED,
3433 .state = WREPL_STATE_TOMBSTONE,
3434 .node = WREPL_NODE_B,
3435 .is_static = false,
3436 .num_ips = ARRAY_SIZE(addresses_A_1),
3437 .ips = addresses_A_1,
3438 .apply_expected = true
3440 .r2 = {
3441 .owner = &ctx->b,
3442 .type = WREPL_TYPE_UNIQUE,
3443 .state = WREPL_STATE_ACTIVE,
3444 .node = WREPL_NODE_B,
3445 .is_static = false,
3446 .num_ips = ARRAY_SIZE(addresses_B_1),
3447 .ips = addresses_B_1,
3448 .apply_expected = true
3453 * mhomed,tombstone vs. uinique,tombstone
3454 * => should be replaced
3457 .line = __location__,
3458 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3459 .r1 = {
3460 .owner = &ctx->b,
3461 .type = WREPL_TYPE_MHOMED,
3462 .state = WREPL_STATE_TOMBSTONE,
3463 .node = WREPL_NODE_B,
3464 .is_static = false,
3465 .num_ips = ARRAY_SIZE(addresses_B_1),
3466 .ips = addresses_B_1,
3467 .apply_expected = true
3469 .r2 = {
3470 .owner = &ctx->a,
3471 .type = WREPL_TYPE_UNIQUE,
3472 .state = WREPL_STATE_TOMBSTONE,
3473 .node = WREPL_NODE_B,
3474 .is_static = false,
3475 .num_ips = ARRAY_SIZE(addresses_A_1),
3476 .ips = addresses_A_1,
3477 .apply_expected = true
3482 * multi homed vs. normal group section,
3485 * mhomed,active vs. group,active
3486 * => should be replaced
3489 .line = __location__,
3490 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3491 .r1 = {
3492 .owner = &ctx->a,
3493 .type = WREPL_TYPE_MHOMED,
3494 .state = WREPL_STATE_ACTIVE,
3495 .node = WREPL_NODE_B,
3496 .is_static = false,
3497 .num_ips = ARRAY_SIZE(addresses_A_1),
3498 .ips = addresses_A_1,
3499 .apply_expected = true
3501 .r2 = {
3502 .owner = &ctx->b,
3503 .type = WREPL_TYPE_GROUP,
3504 .state = WREPL_STATE_ACTIVE,
3505 .node = WREPL_NODE_B,
3506 .is_static = false,
3507 .num_ips = ARRAY_SIZE(addresses_B_1),
3508 .ips = addresses_B_1,
3509 .apply_expected = true
3514 * mhomed,active vs. group,tombstone
3515 * => should NOT be replaced
3518 .line = __location__,
3519 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3520 .r1 = {
3521 .owner = &ctx->b,
3522 .type = WREPL_TYPE_MHOMED,
3523 .state = WREPL_STATE_ACTIVE,
3524 .node = WREPL_NODE_B,
3525 .is_static = false,
3526 .num_ips = ARRAY_SIZE(addresses_B_1),
3527 .ips = addresses_B_1,
3528 .apply_expected = true
3530 .r2 = {
3531 .owner = &ctx->a,
3532 .type = WREPL_TYPE_GROUP,
3533 .state = WREPL_STATE_TOMBSTONE,
3534 .node = WREPL_NODE_B,
3535 .is_static = false,
3536 .num_ips = ARRAY_SIZE(addresses_B_1),
3537 .ips = addresses_B_1,
3538 .apply_expected = false
3543 * mhomed,released vs. group,active
3544 * => should be replaced
3547 .line = __location__,
3548 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3549 .r1 = {
3550 .owner = &ctx->b,
3551 .type = WREPL_TYPE_MHOMED,
3552 .state = WREPL_STATE_RELEASED,
3553 .node = WREPL_NODE_B,
3554 .is_static = false,
3555 .num_ips = ARRAY_SIZE(addresses_B_1),
3556 .ips = addresses_B_1,
3557 .apply_expected = false
3559 .r2 = {
3560 .owner = &ctx->a,
3561 .type = WREPL_TYPE_GROUP,
3562 .state = WREPL_STATE_ACTIVE,
3563 .node = WREPL_NODE_B,
3564 .is_static = false,
3565 .num_ips = ARRAY_SIZE(addresses_A_1),
3566 .ips = addresses_A_1,
3567 .apply_expected = true
3572 * mhomed,released vs. group,tombstone
3573 * => should be replaced
3576 .line = __location__,
3577 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3578 .r1 = {
3579 .owner = &ctx->a,
3580 .type = WREPL_TYPE_MHOMED,
3581 .state = WREPL_STATE_RELEASED,
3582 .node = WREPL_NODE_B,
3583 .is_static = false,
3584 .num_ips = ARRAY_SIZE(addresses_A_1),
3585 .ips = addresses_A_1,
3586 .apply_expected = false
3588 .r2 = {
3589 .owner = &ctx->b,
3590 .type = WREPL_TYPE_GROUP,
3591 .state = WREPL_STATE_TOMBSTONE,
3592 .node = WREPL_NODE_B,
3593 .is_static = false,
3594 .num_ips = ARRAY_SIZE(addresses_B_1),
3595 .ips = addresses_B_1,
3596 .apply_expected = true
3601 * mhomed,tombstone vs. group,active
3602 * => should be replaced
3605 .line = __location__,
3606 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3607 .r1 = {
3608 .owner = &ctx->b,
3609 .type = WREPL_TYPE_MHOMED,
3610 .state = WREPL_STATE_TOMBSTONE,
3611 .node = WREPL_NODE_B,
3612 .is_static = false,
3613 .num_ips = ARRAY_SIZE(addresses_B_1),
3614 .ips = addresses_B_1,
3615 .apply_expected = true
3617 .r2 = {
3618 .owner = &ctx->a,
3619 .type = WREPL_TYPE_GROUP,
3620 .state = WREPL_STATE_ACTIVE,
3621 .node = WREPL_NODE_B,
3622 .is_static = false,
3623 .num_ips = ARRAY_SIZE(addresses_A_1),
3624 .ips = addresses_A_1,
3625 .apply_expected = true
3630 * mhomed,tombstone vs. group,tombstone
3631 * => should be replaced
3634 .line = __location__,
3635 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3636 .r1 = {
3637 .owner = &ctx->a,
3638 .type = WREPL_TYPE_MHOMED,
3639 .state = WREPL_STATE_TOMBSTONE,
3640 .node = WREPL_NODE_B,
3641 .is_static = false,
3642 .num_ips = ARRAY_SIZE(addresses_A_1),
3643 .ips = addresses_A_1,
3644 .apply_expected = true
3646 .r2 = {
3647 .owner = &ctx->b,
3648 .type = WREPL_TYPE_GROUP,
3649 .state = WREPL_STATE_TOMBSTONE,
3650 .node = WREPL_NODE_B,
3651 .is_static = false,
3652 .num_ips = ARRAY_SIZE(addresses_B_1),
3653 .ips = addresses_B_1,
3654 .apply_expected = true
3659 * multi homed vs. special group section,
3662 * mhomed,active vs. sgroup,active
3663 * => should NOT be replaced
3666 .line = __location__,
3667 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3668 .r1 = {
3669 .owner = &ctx->a,
3670 .type = WREPL_TYPE_MHOMED,
3671 .state = WREPL_STATE_ACTIVE,
3672 .node = WREPL_NODE_B,
3673 .is_static = false,
3674 .num_ips = ARRAY_SIZE(addresses_A_1),
3675 .ips = addresses_A_1,
3676 .apply_expected = true
3678 .r2 = {
3679 .owner = &ctx->b,
3680 .type = WREPL_TYPE_SGROUP,
3681 .state = WREPL_STATE_ACTIVE,
3682 .node = WREPL_NODE_B,
3683 .is_static = false,
3684 .num_ips = ARRAY_SIZE(addresses_A_1),
3685 .ips = addresses_A_1,
3686 .apply_expected = false
3691 * mhomed,active vs. sgroup,tombstone
3692 * => should NOT be replaced
3695 .line = __location__,
3696 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3697 .r1 = {
3698 .owner = &ctx->a,
3699 .type = WREPL_TYPE_MHOMED,
3700 .state = WREPL_STATE_ACTIVE,
3701 .node = WREPL_NODE_B,
3702 .is_static = false,
3703 .num_ips = ARRAY_SIZE(addresses_A_1),
3704 .ips = addresses_A_1,
3705 .apply_expected = true
3707 .r2 = {
3708 .owner = &ctx->b,
3709 .type = WREPL_TYPE_SGROUP,
3710 .state = WREPL_STATE_TOMBSTONE,
3711 .node = WREPL_NODE_B,
3712 .is_static = false,
3713 .num_ips = ARRAY_SIZE(addresses_A_1),
3714 .ips = addresses_A_1,
3715 .apply_expected = false
3720 * mhomed,released vs. sgroup,active
3721 * => should be replaced
3724 .line = __location__,
3725 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3726 .r1 = {
3727 .owner = &ctx->a,
3728 .type = WREPL_TYPE_MHOMED,
3729 .state = WREPL_STATE_RELEASED,
3730 .node = WREPL_NODE_B,
3731 .is_static = false,
3732 .num_ips = ARRAY_SIZE(addresses_A_1),
3733 .ips = addresses_A_1,
3734 .apply_expected = false
3736 .r2 = {
3737 .owner = &ctx->b,
3738 .type = WREPL_TYPE_SGROUP,
3739 .state = WREPL_STATE_ACTIVE,
3740 .node = WREPL_NODE_B,
3741 .is_static = false,
3742 .num_ips = ARRAY_SIZE(addresses_B_1),
3743 .ips = addresses_B_1,
3744 .apply_expected = true
3749 * mhomed,released vs. sgroup,tombstone
3750 * => should be replaced
3753 .line = __location__,
3754 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3755 .r1 = {
3756 .owner = &ctx->b,
3757 .type = WREPL_TYPE_MHOMED,
3758 .state = WREPL_STATE_RELEASED,
3759 .node = WREPL_NODE_B,
3760 .is_static = false,
3761 .num_ips = ARRAY_SIZE(addresses_B_1),
3762 .ips = addresses_B_1,
3763 .apply_expected = false
3765 .r2 = {
3766 .owner = &ctx->a,
3767 .type = WREPL_TYPE_SGROUP,
3768 .state = WREPL_STATE_TOMBSTONE,
3769 .node = WREPL_NODE_B,
3770 .is_static = false,
3771 .num_ips = ARRAY_SIZE(addresses_A_1),
3772 .ips = addresses_A_1,
3773 .apply_expected = true
3778 * mhomed,tombstone vs. sgroup,active
3779 * => should be replaced
3782 .line = __location__,
3783 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3784 .r1 = {
3785 .owner = &ctx->a,
3786 .type = WREPL_TYPE_MHOMED,
3787 .state = WREPL_STATE_TOMBSTONE,
3788 .node = WREPL_NODE_B,
3789 .is_static = false,
3790 .num_ips = ARRAY_SIZE(addresses_A_1),
3791 .ips = addresses_A_1,
3792 .apply_expected = true
3794 .r2 = {
3795 .owner = &ctx->b,
3796 .type = WREPL_TYPE_SGROUP,
3797 .state = WREPL_STATE_ACTIVE,
3798 .node = WREPL_NODE_B,
3799 .is_static = false,
3800 .num_ips = ARRAY_SIZE(addresses_B_1),
3801 .ips = addresses_B_1,
3802 .apply_expected = true
3807 * mhomed,tombstone vs. sgroup,tombstone
3808 * => should be replaced
3811 .line = __location__,
3812 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3813 .r1 = {
3814 .owner = &ctx->b,
3815 .type = WREPL_TYPE_MHOMED,
3816 .state = WREPL_STATE_TOMBSTONE,
3817 .node = WREPL_NODE_B,
3818 .is_static = false,
3819 .num_ips = ARRAY_SIZE(addresses_B_1),
3820 .ips = addresses_B_1,
3821 .apply_expected = true
3823 .r2 = {
3824 .owner = &ctx->a,
3825 .type = WREPL_TYPE_SGROUP,
3826 .state = WREPL_STATE_TOMBSTONE,
3827 .node = WREPL_NODE_B,
3828 .is_static = false,
3829 .num_ips = ARRAY_SIZE(addresses_A_1),
3830 .ips = addresses_A_1,
3831 .apply_expected = true
3836 * multi homed vs. mlti homed section,
3839 * mhomed,active vs. mhomed,active
3840 * => should be replaced
3843 .line = __location__,
3844 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3845 .r1 = {
3846 .owner = &ctx->a,
3847 .type = WREPL_TYPE_MHOMED,
3848 .state = WREPL_STATE_ACTIVE,
3849 .node = WREPL_NODE_B,
3850 .is_static = false,
3851 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3852 .ips = addresses_A_3_4,
3853 .apply_expected = true
3855 .r2 = {
3856 .owner = &ctx->b,
3857 .type = WREPL_TYPE_MHOMED,
3858 .state = WREPL_STATE_ACTIVE,
3859 .node = WREPL_NODE_B,
3860 .is_static = false,
3861 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3862 .ips = addresses_B_3_4,
3863 .apply_expected = true
3868 * mhomed,active vs. mhomed,tombstone
3869 * => should NOT be replaced
3872 .line = __location__,
3873 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3874 .r1 = {
3875 .owner = &ctx->b,
3876 .type = WREPL_TYPE_MHOMED,
3877 .state = WREPL_STATE_ACTIVE,
3878 .node = WREPL_NODE_B,
3879 .is_static = false,
3880 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3881 .ips = addresses_B_3_4,
3882 .apply_expected = true
3884 .r2 = {
3885 .owner = &ctx->a,
3886 .type = WREPL_TYPE_MHOMED,
3887 .state = WREPL_STATE_TOMBSTONE,
3888 .node = WREPL_NODE_B,
3889 .is_static = false,
3890 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3891 .ips = addresses_B_3_4,
3892 .apply_expected = false
3897 * mhomed,released vs. mhomed,active
3898 * => should be replaced
3901 .line = __location__,
3902 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3903 .r1 = {
3904 .owner = &ctx->b,
3905 .type = WREPL_TYPE_MHOMED,
3906 .state = WREPL_STATE_RELEASED,
3907 .node = WREPL_NODE_B,
3908 .is_static = false,
3909 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3910 .ips = addresses_B_3_4,
3911 .apply_expected = false
3913 .r2 = {
3914 .owner = &ctx->a,
3915 .type = WREPL_TYPE_MHOMED,
3916 .state = WREPL_STATE_ACTIVE,
3917 .node = WREPL_NODE_B,
3918 .is_static = false,
3919 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3920 .ips = addresses_A_3_4,
3921 .apply_expected = true
3926 * mhomed,released vs. mhomed,tombstone
3927 * => should be replaced
3930 .line = __location__,
3931 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3932 .r1 = {
3933 .owner = &ctx->a,
3934 .type = WREPL_TYPE_MHOMED,
3935 .state = WREPL_STATE_RELEASED,
3936 .node = WREPL_NODE_B,
3937 .is_static = false,
3938 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3939 .ips = addresses_A_3_4,
3940 .apply_expected = false
3942 .r2 = {
3943 .owner = &ctx->b,
3944 .type = WREPL_TYPE_MHOMED,
3945 .state = WREPL_STATE_TOMBSTONE,
3946 .node = WREPL_NODE_B,
3947 .is_static = false,
3948 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3949 .ips = addresses_B_3_4,
3950 .apply_expected = true
3955 * mhomed,tombstone vs. mhomed,active
3956 * => should be replaced
3959 .line = __location__,
3960 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3961 .r1 = {
3962 .owner = &ctx->b,
3963 .type = WREPL_TYPE_MHOMED,
3964 .state = WREPL_STATE_TOMBSTONE,
3965 .node = WREPL_NODE_B,
3966 .is_static = false,
3967 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3968 .ips = addresses_B_3_4,
3969 .apply_expected = true
3971 .r2 = {
3972 .owner = &ctx->a,
3973 .type = WREPL_TYPE_MHOMED,
3974 .state = WREPL_STATE_ACTIVE,
3975 .node = WREPL_NODE_B,
3976 .is_static = false,
3977 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3978 .ips = addresses_A_3_4,
3979 .apply_expected = true
3984 * mhomed,tombstone vs. mhomed,tombstone
3985 * => should be replaced
3988 .line = __location__,
3989 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3990 .r1 = {
3991 .owner = &ctx->a,
3992 .type = WREPL_TYPE_MHOMED,
3993 .state = WREPL_STATE_TOMBSTONE,
3994 .node = WREPL_NODE_B,
3995 .is_static = false,
3996 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3997 .ips = addresses_A_3_4,
3998 .apply_expected = true
4000 .r2 = {
4001 .owner = &ctx->b,
4002 .type = WREPL_TYPE_MHOMED,
4003 .state = WREPL_STATE_TOMBSTONE,
4004 .node = WREPL_NODE_B,
4005 .is_static = false,
4006 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4007 .ips = addresses_B_3_4,
4008 .apply_expected = true
4012 .line = __location__,
4013 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4014 .cleanup= true,
4015 .r1 = {
4016 .owner = &ctx->b,
4017 .type = WREPL_TYPE_UNIQUE,
4018 .state = WREPL_STATE_TOMBSTONE,
4019 .node = WREPL_NODE_B,
4020 .is_static = false,
4021 .num_ips = ARRAY_SIZE(addresses_B_1),
4022 .ips = addresses_B_1,
4023 .apply_expected = true,
4025 .r2 = {
4026 .owner = &ctx->a,
4027 .type = WREPL_TYPE_UNIQUE,
4028 .state = WREPL_STATE_TOMBSTONE,
4029 .node = WREPL_NODE_B,
4030 .is_static = false,
4031 .num_ips = ARRAY_SIZE(addresses_A_1),
4032 .ips = addresses_A_1,
4033 .apply_expected = true,
4037 * special group vs special group section,
4040 * sgroup,active vs. sgroup,active same addresses
4041 * => should be NOT replaced
4044 .line = __location__,
4045 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4046 .comment= "A:A_3_4 vs. B:A_3_4",
4047 .extra = true,
4048 .r1 = {
4049 .owner = &ctx->a,
4050 .type = WREPL_TYPE_SGROUP,
4051 .state = WREPL_STATE_ACTIVE,
4052 .node = WREPL_NODE_B,
4053 .is_static = false,
4054 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4055 .ips = addresses_A_3_4,
4056 .apply_expected = true
4058 .r2 = {
4059 .owner = &ctx->b,
4060 .type = WREPL_TYPE_SGROUP,
4061 .state = WREPL_STATE_ACTIVE,
4062 .node = WREPL_NODE_B,
4063 .is_static = false,
4064 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4065 .ips = addresses_A_3_4,
4066 .apply_expected = false,
4067 .sgroup_cleanup = true
4071 * sgroup,active vs. sgroup,active same addresses
4072 * => should be NOT replaced
4075 .line = __location__,
4076 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4077 .comment= "A:A_3_4 vs. B:NULL",
4078 .extra = true,
4079 .r1 = {
4080 .owner = &ctx->a,
4081 .type = WREPL_TYPE_SGROUP,
4082 .state = WREPL_STATE_ACTIVE,
4083 .node = WREPL_NODE_B,
4084 .is_static = false,
4085 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4086 .ips = addresses_A_3_4,
4087 .apply_expected = true
4089 .r2 = {
4090 .owner = &ctx->b,
4091 .type = WREPL_TYPE_SGROUP,
4092 .state = WREPL_STATE_ACTIVE,
4093 .node = WREPL_NODE_B,
4094 .is_static = false,
4095 .num_ips = 0,
4096 .ips = NULL,
4097 .apply_expected = false,
4098 .sgroup_cleanup = true
4102 * sgroup,active vs. sgroup,active subset addresses, special case...
4103 * => should NOT be replaced
4106 .line = __location__,
4107 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4108 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4",
4109 .extra = true,
4110 .r1 = {
4111 .owner = &ctx->a,
4112 .type = WREPL_TYPE_SGROUP,
4113 .state = WREPL_STATE_ACTIVE,
4114 .node = WREPL_NODE_B,
4115 .is_static = false,
4116 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4117 .ips = addresses_A_3_4_X_3_4,
4118 .apply_expected = true,
4120 .r2 = {
4121 .owner = &ctx->b,
4122 .type = WREPL_TYPE_SGROUP,
4123 .state = WREPL_STATE_ACTIVE,
4124 .node = WREPL_NODE_B,
4125 .is_static = false,
4126 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4127 .ips = addresses_A_3_4,
4128 .apply_expected = false,
4132 .line = __location__,
4133 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4134 .cleanup= true,
4135 .r1 = {
4136 .owner = &ctx->a,
4137 .type = WREPL_TYPE_SGROUP,
4138 .state = WREPL_STATE_ACTIVE,
4139 .node = WREPL_NODE_B,
4140 .is_static = false,
4141 .num_ips = 0,
4142 .ips = NULL,
4143 .apply_expected = false,
4145 .r2 = {
4146 .owner = &ctx->x,
4147 .type = WREPL_TYPE_SGROUP,
4148 .state = WREPL_STATE_ACTIVE,
4149 .node = WREPL_NODE_B,
4150 .is_static = false,
4151 .num_ips = 0,
4152 .ips = NULL,
4153 .apply_expected = false,
4157 * sgroup,active vs. sgroup,active different addresses, but owner changed
4158 * => should be replaced
4161 .line = __location__,
4162 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4163 .comment= "A:B_3_4 vs. B:A_3_4",
4164 .extra = true,
4165 .r1 = {
4166 .owner = &ctx->a,
4167 .type = WREPL_TYPE_SGROUP,
4168 .state = WREPL_STATE_ACTIVE,
4169 .node = WREPL_NODE_B,
4170 .is_static = false,
4171 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4172 .ips = addresses_B_3_4,
4173 .apply_expected = true,
4175 .r2 = {
4176 .owner = &ctx->b,
4177 .type = WREPL_TYPE_SGROUP,
4178 .state = WREPL_STATE_ACTIVE,
4179 .node = WREPL_NODE_B,
4180 .is_static = false,
4181 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4182 .ips = addresses_A_3_4,
4183 .apply_expected = true,
4184 .sgroup_cleanup = true
4188 * sgroup,active vs. sgroup,active different addresses, but owner changed
4189 * => should be replaced
4192 .line = __location__,
4193 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4194 .comment= "A:A_3_4 vs. B:A_3_4_OWNER_B",
4195 .extra = true,
4196 .r1 = {
4197 .owner = &ctx->a,
4198 .type = WREPL_TYPE_SGROUP,
4199 .state = WREPL_STATE_ACTIVE,
4200 .node = WREPL_NODE_B,
4201 .is_static = false,
4202 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4203 .ips = addresses_A_3_4,
4204 .apply_expected = true,
4206 .r2 = {
4207 .owner = &ctx->b,
4208 .type = WREPL_TYPE_SGROUP,
4209 .state = WREPL_STATE_ACTIVE,
4210 .node = WREPL_NODE_B,
4211 .is_static = false,
4212 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4213 .ips = addresses_A_3_4_OWNER_B,
4214 .apply_expected = true,
4215 .sgroup_cleanup = true
4219 * sgroup,active vs. sgroup,active different addresses, but owner changed
4220 * => should be replaced
4223 .line = __location__,
4224 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4225 .comment= "A:A_3_4_OWNER_B vs. B:A_3_4",
4226 .extra = true,
4227 .r1 = {
4228 .owner = &ctx->a,
4229 .type = WREPL_TYPE_SGROUP,
4230 .state = WREPL_STATE_ACTIVE,
4231 .node = WREPL_NODE_B,
4232 .is_static = false,
4233 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4234 .ips = addresses_A_3_4_OWNER_B,
4235 .apply_expected = true,
4237 .r2 = {
4238 .owner = &ctx->b,
4239 .type = WREPL_TYPE_SGROUP,
4240 .state = WREPL_STATE_ACTIVE,
4241 .node = WREPL_NODE_B,
4242 .is_static = false,
4243 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4244 .ips = addresses_A_3_4,
4245 .apply_expected = true,
4246 .sgroup_cleanup = true
4250 * sgroup,active vs. sgroup,active different addresses
4251 * => should be merged
4254 .line = __location__,
4255 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4256 .comment= "A:A_3_4 vs. B:B_3_4 => C:A_3_4_B_3_4",
4257 .extra = true,
4258 .r1 = {
4259 .owner = &ctx->a,
4260 .type = WREPL_TYPE_SGROUP,
4261 .state = WREPL_STATE_ACTIVE,
4262 .node = WREPL_NODE_B,
4263 .is_static = false,
4264 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4265 .ips = addresses_A_3_4,
4266 .apply_expected = true,
4268 .r2 = {
4269 .owner = &ctx->b,
4270 .type = WREPL_TYPE_SGROUP,
4271 .state = WREPL_STATE_ACTIVE,
4272 .node = WREPL_NODE_B,
4273 .is_static = false,
4274 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4275 .ips = addresses_B_3_4,
4276 .sgroup_merge = true,
4277 .sgroup_cleanup = true,
4281 * sgroup,active vs. sgroup,active different addresses, special case...
4282 * => should be merged
4285 .line = __location__,
4286 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4287 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4_X_3_4",
4288 .extra = true,
4289 .r1 = {
4290 .owner = &ctx->a,
4291 .type = WREPL_TYPE_SGROUP,
4292 .state = WREPL_STATE_ACTIVE,
4293 .node = WREPL_NODE_B,
4294 .is_static = false,
4295 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4296 .ips = addresses_B_3_4_X_3_4,
4297 .apply_expected = true,
4299 .r2 = {
4300 .owner = &ctx->b,
4301 .type = WREPL_TYPE_SGROUP,
4302 .state = WREPL_STATE_ACTIVE,
4303 .node = WREPL_NODE_B,
4304 .is_static = false,
4305 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4306 .ips = addresses_A_3_4,
4307 .sgroup_merge = true,
4308 .merge_owner = &ctx->b,
4309 .sgroup_cleanup = false
4313 .line = __location__,
4314 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4315 .cleanup= true,
4316 .r1 = {
4317 .owner = &ctx->b,
4318 .type = WREPL_TYPE_SGROUP,
4319 .state = WREPL_STATE_ACTIVE,
4320 .node = WREPL_NODE_B,
4321 .is_static = false,
4322 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4_OWNER_B),
4323 .ips = addresses_A_3_4_X_3_4_OWNER_B,
4324 .apply_expected = true,
4326 .r2 = {
4327 .owner = &ctx->b,
4328 .type = WREPL_TYPE_SGROUP,
4329 .state = WREPL_STATE_ACTIVE,
4330 .node = WREPL_NODE_B,
4331 .is_static = false,
4332 .num_ips = 0,
4333 .ips = NULL,
4334 .apply_expected = false,
4338 * sgroup,active vs. sgroup,active different addresses, special case...
4339 * => should be merged
4342 .line = __location__,
4343 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4344 .comment= "A:X_3_4 vs. B:A_3_4 => C:A_3_4_X_3_4",
4345 .extra = true,
4346 .r1 = {
4347 .owner = &ctx->a,
4348 .type = WREPL_TYPE_SGROUP,
4349 .state = WREPL_STATE_ACTIVE,
4350 .node = WREPL_NODE_B,
4351 .is_static = false,
4352 .num_ips = ARRAY_SIZE(addresses_X_3_4),
4353 .ips = addresses_X_3_4,
4354 .apply_expected = true,
4356 .r2 = {
4357 .owner = &ctx->b,
4358 .type = WREPL_TYPE_SGROUP,
4359 .state = WREPL_STATE_ACTIVE,
4360 .node = WREPL_NODE_B,
4361 .is_static = false,
4362 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4363 .ips = addresses_A_3_4,
4364 .sgroup_merge = true,
4365 .sgroup_cleanup = false
4369 .line = __location__,
4370 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4371 .cleanup= true,
4372 .r1 = {
4373 .owner = &ctx->a,
4374 .type = WREPL_TYPE_SGROUP,
4375 .state = WREPL_STATE_ACTIVE,
4376 .node = WREPL_NODE_B,
4377 .is_static = false,
4378 .num_ips = 0,
4379 .ips = NULL,
4380 .apply_expected = false,
4382 .r2 = {
4383 .owner = &ctx->x,
4384 .type = WREPL_TYPE_SGROUP,
4385 .state = WREPL_STATE_ACTIVE,
4386 .node = WREPL_NODE_B,
4387 .is_static = false,
4388 .num_ips = 0,
4389 .ips = NULL,
4390 .apply_expected = false,
4394 * sgroup,active vs. sgroup,active different addresses, special case...
4395 * => should be merged
4398 .line = __location__,
4399 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4400 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4_OWNER_B => B:A_3_4_OWNER_B_X_3_4",
4401 .extra = true,
4402 .r1 = {
4403 .owner = &ctx->a,
4404 .type = WREPL_TYPE_SGROUP,
4405 .state = WREPL_STATE_ACTIVE,
4406 .node = WREPL_NODE_B,
4407 .is_static = false,
4408 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4409 .ips = addresses_A_3_4_X_3_4,
4410 .apply_expected = true,
4412 .r2 = {
4413 .owner = &ctx->b,
4414 .type = WREPL_TYPE_SGROUP,
4415 .state = WREPL_STATE_ACTIVE,
4416 .node = WREPL_NODE_B,
4417 .is_static = false,
4418 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4419 .ips = addresses_A_3_4_OWNER_B,
4420 .sgroup_merge = true,
4421 .merge_owner = &ctx->b,
4425 .line = __location__,
4426 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4427 .cleanup= true,
4428 .r1 = {
4429 .owner = &ctx->b,
4430 .type = WREPL_TYPE_SGROUP,
4431 .state = WREPL_STATE_ACTIVE,
4432 .node = WREPL_NODE_B,
4433 .is_static = false,
4434 .num_ips = 0,
4435 .ips = NULL,
4436 .apply_expected = false,
4438 .r2 = {
4439 .owner = &ctx->x,
4440 .type = WREPL_TYPE_SGROUP,
4441 .state = WREPL_STATE_ACTIVE,
4442 .node = WREPL_NODE_B,
4443 .is_static = false,
4444 .num_ips = 0,
4445 .ips = NULL,
4446 .apply_expected = false,
4450 * sgroup,active vs. sgroup,active partly different addresses, special case...
4451 * => should be merged
4454 .line = __location__,
4455 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4456 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4_X_1_2 => C:B_3_4_X_1_2_3_4",
4457 .extra = true,
4458 .r1 = {
4459 .owner = &ctx->a,
4460 .type = WREPL_TYPE_SGROUP,
4461 .state = WREPL_STATE_ACTIVE,
4462 .node = WREPL_NODE_B,
4463 .is_static = false,
4464 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4465 .ips = addresses_B_3_4_X_3_4,
4466 .apply_expected = true,
4468 .r2 = {
4469 .owner = &ctx->b,
4470 .type = WREPL_TYPE_SGROUP,
4471 .state = WREPL_STATE_ACTIVE,
4472 .node = WREPL_NODE_B,
4473 .is_static = false,
4474 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_1_2),
4475 .ips = addresses_B_3_4_X_1_2,
4476 .sgroup_merge = true,
4477 .sgroup_cleanup = false
4481 .line = __location__,
4482 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4483 .cleanup= true,
4484 .r1 = {
4485 .owner = &ctx->b,
4486 .type = WREPL_TYPE_SGROUP,
4487 .state = WREPL_STATE_ACTIVE,
4488 .node = WREPL_NODE_B,
4489 .is_static = false,
4490 .num_ips = 0,
4491 .ips = NULL,
4492 .apply_expected = false,
4494 .r2 = {
4495 .owner = &ctx->x,
4496 .type = WREPL_TYPE_SGROUP,
4497 .state = WREPL_STATE_ACTIVE,
4498 .node = WREPL_NODE_B,
4499 .is_static = false,
4500 .num_ips = 0,
4501 .ips = NULL,
4502 .apply_expected = false,
4506 * sgroup,active vs. sgroup,active different addresses, special case...
4507 * => should be merged
4510 .line = __location__,
4511 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4512 .comment= "A:A_3_4_B_3_4 vs. B:NULL => B:A_3_4",
4513 .extra = true,
4514 .r1 = {
4515 .owner = &ctx->a,
4516 .type = WREPL_TYPE_SGROUP,
4517 .state = WREPL_STATE_ACTIVE,
4518 .node = WREPL_NODE_B,
4519 .is_static = false,
4520 .num_ips = ARRAY_SIZE(addresses_A_3_4_B_3_4),
4521 .ips = addresses_A_3_4_B_3_4,
4522 .apply_expected = true,
4524 .r2 = {
4525 .owner = &ctx->b,
4526 .type = WREPL_TYPE_SGROUP,
4527 .state = WREPL_STATE_ACTIVE,
4528 .node = WREPL_NODE_B,
4529 .is_static = false,
4530 .num_ips = 0,
4531 .ips = NULL,
4532 .sgroup_merge = true,
4533 .merge_owner = &ctx->b,
4534 .sgroup_cleanup = true
4538 .line = __location__,
4539 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4540 .cleanup= true,
4541 .r1 = {
4542 .owner = &ctx->a,
4543 .type = WREPL_TYPE_SGROUP,
4544 .state = WREPL_STATE_ACTIVE,
4545 .node = WREPL_NODE_B,
4546 .is_static = false,
4547 .num_ips = 0,
4548 .ips = NULL,
4549 .apply_expected = false,
4551 .r2 = {
4552 .owner = &ctx->a,
4553 .type = WREPL_TYPE_UNIQUE,
4554 .state = WREPL_STATE_TOMBSTONE,
4555 .node = WREPL_NODE_B,
4556 .is_static = false,
4557 .num_ips = ARRAY_SIZE(addresses_A_1),
4558 .ips = addresses_A_1,
4559 .apply_expected = true,
4563 * sgroup,active vs. sgroup,active different addresses, special case...
4564 * => should be merged
4567 .line = __location__,
4568 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4569 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:X_3_4",
4570 .extra = true,
4571 .r1 = {
4572 .owner = &ctx->a,
4573 .type = WREPL_TYPE_SGROUP,
4574 .state = WREPL_STATE_ACTIVE,
4575 .node = WREPL_NODE_B,
4576 .is_static = false,
4577 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4578 .ips = addresses_B_3_4_X_3_4,
4579 .apply_expected = true,
4581 .r2 = {
4582 .owner = &ctx->b,
4583 .type = WREPL_TYPE_SGROUP,
4584 .state = WREPL_STATE_ACTIVE,
4585 .node = WREPL_NODE_B,
4586 .is_static = false,
4587 .num_ips = 0,
4588 .ips = NULL,
4589 .sgroup_merge = true,
4590 .merge_owner = &ctx->b,
4591 .sgroup_cleanup = true
4595 .line = __location__,
4596 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4597 .cleanup= true,
4598 .r1 = {
4599 .owner = &ctx->x,
4600 .type = WREPL_TYPE_SGROUP,
4601 .state = WREPL_STATE_ACTIVE,
4602 .node = WREPL_NODE_B,
4603 .is_static = false,
4604 .num_ips = 0,
4605 .ips = NULL,
4606 .apply_expected = false,
4608 .r2 = {
4609 .owner = &ctx->x,
4610 .type = WREPL_TYPE_UNIQUE,
4611 .state = WREPL_STATE_TOMBSTONE,
4612 .node = WREPL_NODE_B,
4613 .is_static = false,
4614 .num_ips = ARRAY_SIZE(addresses_A_1),
4615 .ips = addresses_A_1,
4616 .apply_expected = true,
4621 * sgroup,active vs. sgroup,tombstone different no addresses, special
4622 * => should be replaced
4625 .line = __location__,
4626 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4627 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:NULL",
4628 .extra = true,
4629 .r1 = {
4630 .owner = &ctx->a,
4631 .type = WREPL_TYPE_SGROUP,
4632 .state = WREPL_STATE_ACTIVE,
4633 .node = WREPL_NODE_B,
4634 .is_static = false,
4635 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4636 .ips = addresses_B_3_4_X_3_4,
4637 .apply_expected = true,
4639 .r2 = {
4640 .owner = &ctx->b,
4641 .type = WREPL_TYPE_SGROUP,
4642 .state = WREPL_STATE_TOMBSTONE,
4643 .node = WREPL_NODE_B,
4644 .is_static = false,
4645 .num_ips = 0,
4646 .ips = NULL,
4647 .apply_expected = true,
4651 * sgroup,active vs. sgroup,tombstone different addresses
4652 * => should be replaced
4655 .line = __location__,
4656 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4657 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4",
4658 .extra = true,
4659 .r1 = {
4660 .owner = &ctx->a,
4661 .type = WREPL_TYPE_SGROUP,
4662 .state = WREPL_STATE_ACTIVE,
4663 .node = WREPL_NODE_B,
4664 .is_static = false,
4665 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4666 .ips = addresses_B_3_4_X_3_4,
4667 .apply_expected = true,
4669 .r2 = {
4670 .owner = &ctx->b,
4671 .type = WREPL_TYPE_SGROUP,
4672 .state = WREPL_STATE_TOMBSTONE,
4673 .node = WREPL_NODE_B,
4674 .is_static = false,
4675 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4676 .ips = addresses_A_3_4,
4677 .apply_expected = true,
4681 * sgroup,active vs. sgroup,tombstone subset addresses
4682 * => should be replaced
4685 .line = __location__,
4686 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4687 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4 => B:B_3_4",
4688 .extra = true,
4689 .r1 = {
4690 .owner = &ctx->a,
4691 .type = WREPL_TYPE_SGROUP,
4692 .state = WREPL_STATE_ACTIVE,
4693 .node = WREPL_NODE_B,
4694 .is_static = false,
4695 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4696 .ips = addresses_B_3_4_X_3_4,
4697 .apply_expected = true,
4699 .r2 = {
4700 .owner = &ctx->b,
4701 .type = WREPL_TYPE_SGROUP,
4702 .state = WREPL_STATE_TOMBSTONE,
4703 .node = WREPL_NODE_B,
4704 .is_static = false,
4705 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4706 .ips = addresses_B_3_4,
4707 .apply_expected = true,
4711 * sgroup,active vs. sgroup,active same addresses
4712 * => should be replaced
4715 .line = __location__,
4716 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4717 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4_X_3_4 => B:B_3_4_X_3_4",
4718 .extra = true,
4719 .r1 = {
4720 .owner = &ctx->a,
4721 .type = WREPL_TYPE_SGROUP,
4722 .state = WREPL_STATE_ACTIVE,
4723 .node = WREPL_NODE_B,
4724 .is_static = false,
4725 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4726 .ips = addresses_B_3_4_X_3_4,
4727 .apply_expected = true,
4729 .r2 = {
4730 .owner = &ctx->b,
4731 .type = WREPL_TYPE_SGROUP,
4732 .state = WREPL_STATE_TOMBSTONE,
4733 .node = WREPL_NODE_B,
4734 .is_static = false,
4735 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4736 .ips = addresses_B_3_4_X_3_4,
4737 .apply_expected = true,
4742 * This should be the last record in this array,
4743 * we need to make sure the we leave a tombstoned unique entry
4744 * owned by OWNER_A
4747 .line = __location__,
4748 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4749 .cleanup= true,
4750 .r1 = {
4751 .owner = &ctx->a,
4752 .type = WREPL_TYPE_UNIQUE,
4753 .state = WREPL_STATE_TOMBSTONE,
4754 .node = WREPL_NODE_B,
4755 .is_static = false,
4756 .num_ips = ARRAY_SIZE(addresses_A_1),
4757 .ips = addresses_A_1,
4758 .apply_expected = true
4760 .r2 = {
4761 .owner = &ctx->a,
4762 .type = WREPL_TYPE_UNIQUE,
4763 .state = WREPL_STATE_TOMBSTONE,
4764 .node = WREPL_NODE_B,
4765 .is_static = false,
4766 .num_ips = ARRAY_SIZE(addresses_A_1),
4767 .ips = addresses_A_1,
4768 .apply_expected = true
4770 }}; /* do not add entries here, this should be the last record! */
4772 wins_name_r1 = &wins_name1;
4773 wins_name_r2 = &wins_name2;
4775 torture_comment(tctx, "Test Replica Conflicts with different owners\n");
4777 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
4779 if (!records[i].extra && !records[i].cleanup) {
4780 /* we should test the worst cases */
4781 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
4782 torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n",
4783 __location__, i, records[i].line);
4784 return false;
4785 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
4786 torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n",
4787 __location__, i, records[i].line);
4788 return false;
4792 if (!records[i].cleanup) {
4793 const char *expected;
4794 const char *ips;
4796 if (records[i].r2.sgroup_merge) {
4797 expected = "SGROUP_MERGE";
4798 } else if (records[i].r2.apply_expected) {
4799 expected = "REPLACE";
4800 } else {
4801 expected = "NOT REPLACE";
4804 if (!records[i].r1.ips && !records[i].r2.ips) {
4805 ips = "with no ip(s)";
4806 } else if (records[i].r1.ips==records[i].r2.ips) {
4807 ips = "with same ip(s)";
4808 } else {
4809 ips = "with different ip(s)";
4812 torture_comment(tctx, "%s,%s%s vs. %s,%s%s %s => %s\n",
4813 wrepl_name_type_string(records[i].r1.type),
4814 wrepl_name_state_string(records[i].r1.state),
4815 (records[i].r1.is_static?",static":""),
4816 wrepl_name_type_string(records[i].r2.type),
4817 wrepl_name_state_string(records[i].r2.state),
4818 (records[i].r2.is_static?",static":""),
4819 (records[i].comment?records[i].comment:ips),
4820 expected);
4824 * Setup R1
4826 wins_name_r1->name = &records[i].name;
4827 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
4828 records[i].r1.state,
4829 records[i].r1.node,
4830 records[i].r1.is_static);
4831 wins_name_r1->id = ++records[i].r1.owner->max_version;
4832 if (wins_name_r1->flags & 2) {
4833 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
4834 wins_name_r1->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
4835 records[i].r1.ips);
4836 } else {
4837 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
4839 wins_name_r1->unknown = "255.255.255.255";
4841 /* now apply R1 */
4842 ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1);
4843 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4844 wins_name_r1, records[i].r1.apply_expected);
4847 * Setup R2
4849 wins_name_r2->name = &records[i].name;
4850 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
4851 records[i].r2.state,
4852 records[i].r2.node,
4853 records[i].r2.is_static);
4854 wins_name_r2->id = ++records[i].r2.owner->max_version;
4855 if (wins_name_r2->flags & 2) {
4856 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
4857 wins_name_r2->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
4858 records[i].r2.ips);
4859 } else {
4860 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
4862 wins_name_r2->unknown = "255.255.255.255";
4864 /* now apply R2 */
4865 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4866 if (records[i].r1.state == WREPL_STATE_RELEASED) {
4867 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4868 wins_name_r1, false);
4869 } else if (records[i].r2.sgroup_merge) {
4870 ret &= test_wrepl_sgroup_merged(tctx, ctx, records[i].r2.merge_owner,
4871 records[i].r1.owner,
4872 records[i].r1.num_ips, records[i].r1.ips,
4873 records[i].r2.owner,
4874 records[i].r2.num_ips, records[i].r2.ips,
4875 wins_name_r2);
4876 } else if (records[i].r1.owner != records[i].r2.owner) {
4877 bool _expected;
4878 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
4879 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4880 wins_name_r1, _expected);
4882 if (records[i].r2.state == WREPL_STATE_RELEASED) {
4883 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner,
4884 wins_name_r2, false);
4885 } else if (!records[i].r2.sgroup_merge) {
4886 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner,
4887 wins_name_r2, records[i].r2.apply_expected);
4890 if (records[i].r2.sgroup_cleanup) {
4891 if (!ret) {
4892 torture_comment(tctx, "failed before sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4893 return ret;
4896 /* clean up the SGROUP record */
4897 wins_name_r1->name = &records[i].name;
4898 wins_name_r1->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4899 WREPL_STATE_ACTIVE,
4900 WREPL_NODE_B, false);
4901 wins_name_r1->id = ++records[i].r1.owner->max_version;
4902 wins_name_r1->addresses.addresses.num_ips = 0;
4903 wins_name_r1->addresses.addresses.ips = NULL;
4904 wins_name_r1->unknown = "255.255.255.255";
4905 ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1);
4907 /* here we test how names from an owner are deleted */
4908 if (records[i].r2.sgroup_merge && records[i].r2.num_ips) {
4909 ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL,
4910 records[i].r2.owner,
4911 records[i].r2.num_ips, records[i].r2.ips,
4912 records[i].r1.owner,
4913 0, NULL,
4914 wins_name_r2);
4917 /* clean up the SGROUP record */
4918 wins_name_r2->name = &records[i].name;
4919 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4920 WREPL_STATE_ACTIVE,
4921 WREPL_NODE_B, false);
4922 wins_name_r2->id = ++records[i].r2.owner->max_version;
4923 wins_name_r2->addresses.addresses.num_ips = 0;
4924 wins_name_r2->addresses.addresses.ips = NULL;
4925 wins_name_r2->unknown = "255.255.255.255";
4926 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4928 /* take ownership of the SGROUP record */
4929 wins_name_r2->name = &records[i].name;
4930 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4931 WREPL_STATE_ACTIVE,
4932 WREPL_NODE_B, false);
4933 wins_name_r2->id = ++records[i].r2.owner->max_version;
4934 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4935 wins_name_r2->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
4936 addresses_B_1);
4937 wins_name_r2->unknown = "255.255.255.255";
4938 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4939 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true);
4941 /* overwrite the SGROUP record with unique,tombstone */
4942 wins_name_r2->name = &records[i].name;
4943 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4944 WREPL_STATE_TOMBSTONE,
4945 WREPL_NODE_B, false);
4946 wins_name_r2->id = ++records[i].r2.owner->max_version;
4947 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4948 wins_name_r2->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
4949 addresses_B_1);
4950 wins_name_r2->unknown = "255.255.255.255";
4951 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4952 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true);
4954 if (!ret) {
4955 torture_comment(tctx, "failed in sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4956 return ret;
4960 /* the first one is a cleanup run */
4961 if (!ret && i == 0) ret = true;
4963 if (!ret) {
4964 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
4965 return ret;
4969 return ret;
4972 static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx,
4973 struct test_wrepl_conflict_conn *ctx)
4975 bool ret = true;
4976 NTSTATUS status;
4977 struct wrepl_wins_name wins_name_;
4978 struct wrepl_wins_name *wins_name = &wins_name_;
4979 struct nbt_name_register name_register_;
4980 struct nbt_name_register *name_register = &name_register_;
4981 struct nbt_name_release release_;
4982 struct nbt_name_release *release = &release_;
4983 uint32_t i;
4984 struct {
4985 const char *line; /* just better debugging */
4986 struct nbt_name name;
4987 struct {
4988 uint32_t nb_flags;
4989 bool mhomed;
4990 uint32_t num_ips;
4991 const struct wrepl_ip *ips;
4992 bool apply_expected;
4993 } wins;
4994 struct {
4995 enum wrepl_name_type type;
4996 enum wrepl_name_state state;
4997 enum wrepl_name_node node;
4998 bool is_static;
4999 uint32_t num_ips;
5000 const struct wrepl_ip *ips;
5001 bool apply_expected;
5002 } replica;
5003 } records[] = {
5005 * unique vs. unique section
5008 * unique,released vs. unique,active with same ip(s)
5011 .line = __location__,
5012 .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL),
5013 .wins = {
5014 .nb_flags = 0,
5015 .mhomed = false,
5016 .num_ips = ctx->addresses_best_num,
5017 .ips = ctx->addresses_best,
5018 .apply_expected = true
5020 .replica= {
5021 .type = WREPL_TYPE_UNIQUE,
5022 .state = WREPL_STATE_ACTIVE,
5023 .node = WREPL_NODE_B,
5024 .is_static = false,
5025 .num_ips = ctx->addresses_best_num,
5026 .ips = ctx->addresses_best,
5027 .apply_expected = true
5031 * unique,released vs. unique,active with different ip(s)
5034 .line = __location__,
5035 .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL),
5036 .wins = {
5037 .nb_flags = 0,
5038 .mhomed = false,
5039 .num_ips = ctx->addresses_best_num,
5040 .ips = ctx->addresses_best,
5041 .apply_expected = true
5043 .replica= {
5044 .type = WREPL_TYPE_UNIQUE,
5045 .state = WREPL_STATE_ACTIVE,
5046 .node = WREPL_NODE_B,
5047 .is_static = false,
5048 .num_ips = ARRAY_SIZE(addresses_B_1),
5049 .ips = addresses_B_1,
5050 .apply_expected = true
5054 * unique,released vs. unique,tombstone with same ip(s)
5057 .line = __location__,
5058 .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL),
5059 .wins = {
5060 .nb_flags = 0,
5061 .mhomed = false,
5062 .num_ips = ctx->addresses_best_num,
5063 .ips = ctx->addresses_best,
5064 .apply_expected = true
5066 .replica= {
5067 .type = WREPL_TYPE_UNIQUE,
5068 .state = WREPL_STATE_TOMBSTONE,
5069 .node = WREPL_NODE_B,
5070 .is_static = false,
5071 .num_ips = ctx->addresses_best_num,
5072 .ips = ctx->addresses_best,
5073 .apply_expected = true
5077 * unique,released vs. unique,tombstone with different ip(s)
5080 .line = __location__,
5081 .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL),
5082 .wins = {
5083 .nb_flags = 0,
5084 .mhomed = false,
5085 .num_ips = ctx->addresses_best_num,
5086 .ips = ctx->addresses_best,
5087 .apply_expected = true
5089 .replica= {
5090 .type = WREPL_TYPE_UNIQUE,
5091 .state = WREPL_STATE_TOMBSTONE,
5092 .node = WREPL_NODE_B,
5093 .is_static = false,
5094 .num_ips = ARRAY_SIZE(addresses_B_1),
5095 .ips = addresses_B_1,
5096 .apply_expected = true
5100 * unique vs. group section
5103 * unique,released vs. group,active with same ip(s)
5106 .line = __location__,
5107 .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL),
5108 .wins = {
5109 .nb_flags = 0,
5110 .mhomed = false,
5111 .num_ips = ctx->addresses_best_num,
5112 .ips = ctx->addresses_best,
5113 .apply_expected = true
5115 .replica= {
5116 .type = WREPL_TYPE_GROUP,
5117 .state = WREPL_STATE_ACTIVE,
5118 .node = WREPL_NODE_B,
5119 .is_static = false,
5120 .num_ips = ctx->addresses_best_num,
5121 .ips = ctx->addresses_best,
5122 .apply_expected = true
5126 * unique,released vs. group,active with different ip(s)
5129 .line = __location__,
5130 .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL),
5131 .wins = {
5132 .nb_flags = 0,
5133 .mhomed = false,
5134 .num_ips = ctx->addresses_best_num,
5135 .ips = ctx->addresses_best,
5136 .apply_expected = true
5138 .replica= {
5139 .type = WREPL_TYPE_GROUP,
5140 .state = WREPL_STATE_ACTIVE,
5141 .node = WREPL_NODE_B,
5142 .is_static = false,
5143 .num_ips = ARRAY_SIZE(addresses_B_1),
5144 .ips = addresses_B_1,
5145 .apply_expected = true
5149 * unique,released vs. group,tombstone with same ip(s)
5152 .line = __location__,
5153 .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL),
5154 .wins = {
5155 .nb_flags = 0,
5156 .mhomed = false,
5157 .num_ips = ctx->addresses_best_num,
5158 .ips = ctx->addresses_best,
5159 .apply_expected = true
5161 .replica= {
5162 .type = WREPL_TYPE_GROUP,
5163 .state = WREPL_STATE_TOMBSTONE,
5164 .node = WREPL_NODE_B,
5165 .is_static = false,
5166 .num_ips = ctx->addresses_best_num,
5167 .ips = ctx->addresses_best,
5168 .apply_expected = true
5172 * unique,released vs. group,tombstone with different ip(s)
5175 .line = __location__,
5176 .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL),
5177 .wins = {
5178 .nb_flags = 0,
5179 .mhomed = false,
5180 .num_ips = ctx->addresses_best_num,
5181 .ips = ctx->addresses_best,
5182 .apply_expected = true
5184 .replica= {
5185 .type = WREPL_TYPE_GROUP,
5186 .state = WREPL_STATE_TOMBSTONE,
5187 .node = WREPL_NODE_B,
5188 .is_static = false,
5189 .num_ips = ARRAY_SIZE(addresses_B_1),
5190 .ips = addresses_B_1,
5191 .apply_expected = true
5195 * unique vs. special group section
5198 * unique,released vs. sgroup,active with same ip(s)
5201 .line = __location__,
5202 .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL),
5203 .wins = {
5204 .nb_flags = 0,
5205 .mhomed = false,
5206 .num_ips = ctx->addresses_best_num,
5207 .ips = ctx->addresses_best,
5208 .apply_expected = true
5210 .replica= {
5211 .type = WREPL_TYPE_SGROUP,
5212 .state = WREPL_STATE_ACTIVE,
5213 .node = WREPL_NODE_B,
5214 .is_static = false,
5215 .num_ips = ctx->addresses_best_num,
5216 .ips = ctx->addresses_best,
5217 .apply_expected = true
5221 * unique,released vs. sgroup,active with different ip(s)
5224 .line = __location__,
5225 .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL),
5226 .wins = {
5227 .nb_flags = 0,
5228 .mhomed = false,
5229 .num_ips = ctx->addresses_best_num,
5230 .ips = ctx->addresses_best,
5231 .apply_expected = true
5233 .replica= {
5234 .type = WREPL_TYPE_SGROUP,
5235 .state = WREPL_STATE_ACTIVE,
5236 .node = WREPL_NODE_B,
5237 .is_static = false,
5238 .num_ips = ARRAY_SIZE(addresses_B_1),
5239 .ips = addresses_B_1,
5240 .apply_expected = true
5244 * unique,released vs. sgroup,tombstone with same ip(s)
5247 .line = __location__,
5248 .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL),
5249 .wins = {
5250 .nb_flags = 0,
5251 .mhomed = false,
5252 .num_ips = ctx->addresses_best_num,
5253 .ips = ctx->addresses_best,
5254 .apply_expected = true
5256 .replica= {
5257 .type = WREPL_TYPE_SGROUP,
5258 .state = WREPL_STATE_TOMBSTONE,
5259 .node = WREPL_NODE_B,
5260 .is_static = false,
5261 .num_ips = ctx->addresses_best_num,
5262 .ips = ctx->addresses_best,
5263 .apply_expected = true
5267 * unique,released vs. sgroup,tombstone with different ip(s)
5270 .line = __location__,
5271 .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL),
5272 .wins = {
5273 .nb_flags = 0,
5274 .mhomed = false,
5275 .num_ips = ctx->addresses_best_num,
5276 .ips = ctx->addresses_best,
5277 .apply_expected = true
5279 .replica= {
5280 .type = WREPL_TYPE_SGROUP,
5281 .state = WREPL_STATE_TOMBSTONE,
5282 .node = WREPL_NODE_B,
5283 .is_static = false,
5284 .num_ips = ARRAY_SIZE(addresses_B_1),
5285 .ips = addresses_B_1,
5286 .apply_expected = true
5290 * unique vs. multi homed section
5293 * unique,released vs. mhomed,active with same ip(s)
5296 .line = __location__,
5297 .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL),
5298 .wins = {
5299 .nb_flags = 0,
5300 .mhomed = false,
5301 .num_ips = ctx->addresses_best_num,
5302 .ips = ctx->addresses_best,
5303 .apply_expected = true
5305 .replica= {
5306 .type = WREPL_TYPE_MHOMED,
5307 .state = WREPL_STATE_ACTIVE,
5308 .node = WREPL_NODE_B,
5309 .is_static = false,
5310 .num_ips = ctx->addresses_best_num,
5311 .ips = ctx->addresses_best,
5312 .apply_expected = true
5316 * unique,released vs. mhomed,active with different ip(s)
5319 .line = __location__,
5320 .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL),
5321 .wins = {
5322 .nb_flags = 0,
5323 .mhomed = false,
5324 .num_ips = ctx->addresses_best_num,
5325 .ips = ctx->addresses_best,
5326 .apply_expected = true
5328 .replica= {
5329 .type = WREPL_TYPE_MHOMED,
5330 .state = WREPL_STATE_ACTIVE,
5331 .node = WREPL_NODE_B,
5332 .is_static = false,
5333 .num_ips = ARRAY_SIZE(addresses_B_1),
5334 .ips = addresses_B_1,
5335 .apply_expected = true
5339 * unique,released vs. mhomed,tombstone with same ip(s)
5342 .line = __location__,
5343 .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL),
5344 .wins = {
5345 .nb_flags = 0,
5346 .mhomed = false,
5347 .num_ips = ctx->addresses_best_num,
5348 .ips = ctx->addresses_best,
5349 .apply_expected = true
5351 .replica= {
5352 .type = WREPL_TYPE_MHOMED,
5353 .state = WREPL_STATE_TOMBSTONE,
5354 .node = WREPL_NODE_B,
5355 .is_static = false,
5356 .num_ips = ctx->addresses_best_num,
5357 .ips = ctx->addresses_best,
5358 .apply_expected = true
5362 * unique,released vs. mhomed,tombstone with different ip(s)
5365 .line = __location__,
5366 .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL),
5367 .wins = {
5368 .nb_flags = 0,
5369 .mhomed = false,
5370 .num_ips = ctx->addresses_best_num,
5371 .ips = ctx->addresses_best,
5372 .apply_expected = true
5374 .replica= {
5375 .type = WREPL_TYPE_MHOMED,
5376 .state = WREPL_STATE_TOMBSTONE,
5377 .node = WREPL_NODE_B,
5378 .is_static = false,
5379 .num_ips = ARRAY_SIZE(addresses_B_1),
5380 .ips = addresses_B_1,
5381 .apply_expected = true
5385 * group vs. unique section
5388 * group,released vs. unique,active with same ip(s)
5391 .line = __location__,
5392 .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL),
5393 .wins = {
5394 .nb_flags = NBT_NM_GROUP,
5395 .mhomed = false,
5396 .num_ips = ctx->addresses_best_num,
5397 .ips = ctx->addresses_best,
5398 .apply_expected = true
5400 .replica= {
5401 .type = WREPL_TYPE_UNIQUE,
5402 .state = WREPL_STATE_ACTIVE,
5403 .node = WREPL_NODE_B,
5404 .is_static = false,
5405 .num_ips = ctx->addresses_best_num,
5406 .ips = ctx->addresses_best,
5407 .apply_expected = false
5411 * group,released vs. unique,active with different ip(s)
5414 .line = __location__,
5415 .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL),
5416 .wins = {
5417 .nb_flags = NBT_NM_GROUP,
5418 .mhomed = false,
5419 .num_ips = ctx->addresses_best_num,
5420 .ips = ctx->addresses_best,
5421 .apply_expected = true
5423 .replica= {
5424 .type = WREPL_TYPE_UNIQUE,
5425 .state = WREPL_STATE_ACTIVE,
5426 .node = WREPL_NODE_B,
5427 .is_static = false,
5428 .num_ips = ARRAY_SIZE(addresses_B_1),
5429 .ips = addresses_B_1,
5430 .apply_expected = false
5434 * group,released vs. unique,tombstone with same ip(s)
5437 .line = __location__,
5438 .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL),
5439 .wins = {
5440 .nb_flags = NBT_NM_GROUP,
5441 .mhomed = false,
5442 .num_ips = ctx->addresses_best_num,
5443 .ips = ctx->addresses_best,
5444 .apply_expected = true
5446 .replica= {
5447 .type = WREPL_TYPE_UNIQUE,
5448 .state = WREPL_STATE_TOMBSTONE,
5449 .node = WREPL_NODE_B,
5450 .is_static = false,
5451 .num_ips = ctx->addresses_best_num,
5452 .ips = ctx->addresses_best,
5453 .apply_expected = false
5457 * group,released vs. unique,tombstone with different ip(s)
5460 .line = __location__,
5461 .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL),
5462 .wins = {
5463 .nb_flags = NBT_NM_GROUP,
5464 .mhomed = false,
5465 .num_ips = ctx->addresses_best_num,
5466 .ips = ctx->addresses_best,
5467 .apply_expected = true
5469 .replica= {
5470 .type = WREPL_TYPE_UNIQUE,
5471 .state = WREPL_STATE_TOMBSTONE,
5472 .node = WREPL_NODE_B,
5473 .is_static = false,
5474 .num_ips = ARRAY_SIZE(addresses_B_1),
5475 .ips = addresses_B_1,
5476 .apply_expected = false
5480 * group vs. group section
5483 * group,released vs. group,active with same ip(s)
5486 .line = __location__,
5487 .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL),
5488 .wins = {
5489 .nb_flags = NBT_NM_GROUP,
5490 .mhomed = false,
5491 .num_ips = ctx->addresses_best_num,
5492 .ips = ctx->addresses_best,
5493 .apply_expected = true
5495 .replica= {
5496 .type = WREPL_TYPE_GROUP,
5497 .state = WREPL_STATE_ACTIVE,
5498 .node = WREPL_NODE_B,
5499 .is_static = false,
5500 .num_ips = ctx->addresses_best_num,
5501 .ips = ctx->addresses_best,
5502 .apply_expected = true
5506 * group,released vs. group,active with different ip(s)
5509 .line = __location__,
5510 .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL),
5511 .wins = {
5512 .nb_flags = NBT_NM_GROUP,
5513 .mhomed = false,
5514 .num_ips = ctx->addresses_best_num,
5515 .ips = ctx->addresses_best,
5516 .apply_expected = true
5518 .replica= {
5519 .type = WREPL_TYPE_GROUP,
5520 .state = WREPL_STATE_ACTIVE,
5521 .node = WREPL_NODE_B,
5522 .is_static = false,
5523 .num_ips = ARRAY_SIZE(addresses_B_1),
5524 .ips = addresses_B_1,
5525 .apply_expected = true
5529 * group,released vs. group,tombstone with same ip(s)
5532 .line = __location__,
5533 .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL),
5534 .wins = {
5535 .nb_flags = NBT_NM_GROUP,
5536 .mhomed = false,
5537 .num_ips = ctx->addresses_best_num,
5538 .ips = ctx->addresses_best,
5539 .apply_expected = true
5541 .replica= {
5542 .type = WREPL_TYPE_GROUP,
5543 .state = WREPL_STATE_TOMBSTONE,
5544 .node = WREPL_NODE_B,
5545 .is_static = false,
5546 .num_ips = ctx->addresses_best_num,
5547 .ips = ctx->addresses_best,
5548 .apply_expected = true
5552 * group,released vs. group,tombstone with different ip(s)
5555 .line = __location__,
5556 .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL),
5557 .wins = {
5558 .nb_flags = NBT_NM_GROUP,
5559 .mhomed = false,
5560 .num_ips = ctx->addresses_best_num,
5561 .ips = ctx->addresses_best,
5562 .apply_expected = true
5564 .replica= {
5565 .type = WREPL_TYPE_GROUP,
5566 .state = WREPL_STATE_TOMBSTONE,
5567 .node = WREPL_NODE_B,
5568 .is_static = false,
5569 .num_ips = ARRAY_SIZE(addresses_B_1),
5570 .ips = addresses_B_1,
5571 .apply_expected = true
5575 * group vs. special group section
5578 * group,released vs. sgroup,active with same ip(s)
5581 .line = __location__,
5582 .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL),
5583 .wins = {
5584 .nb_flags = NBT_NM_GROUP,
5585 .mhomed = false,
5586 .num_ips = ctx->addresses_best_num,
5587 .ips = ctx->addresses_best,
5588 .apply_expected = true
5590 .replica= {
5591 .type = WREPL_TYPE_SGROUP,
5592 .state = WREPL_STATE_ACTIVE,
5593 .node = WREPL_NODE_B,
5594 .is_static = false,
5595 .num_ips = ctx->addresses_best_num,
5596 .ips = ctx->addresses_best,
5597 .apply_expected = false
5601 * group,released vs. sgroup,active with different ip(s)
5604 .line = __location__,
5605 .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL),
5606 .wins = {
5607 .nb_flags = NBT_NM_GROUP,
5608 .mhomed = false,
5609 .num_ips = ctx->addresses_best_num,
5610 .ips = ctx->addresses_best,
5611 .apply_expected = true
5613 .replica= {
5614 .type = WREPL_TYPE_SGROUP,
5615 .state = WREPL_STATE_ACTIVE,
5616 .node = WREPL_NODE_B,
5617 .is_static = false,
5618 .num_ips = ARRAY_SIZE(addresses_B_1),
5619 .ips = addresses_B_1,
5620 .apply_expected = false
5624 * group,released vs. sgroup,tombstone with same ip(s)
5627 .line = __location__,
5628 .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL),
5629 .wins = {
5630 .nb_flags = NBT_NM_GROUP,
5631 .mhomed = false,
5632 .num_ips = ctx->addresses_best_num,
5633 .ips = ctx->addresses_best,
5634 .apply_expected = true
5636 .replica= {
5637 .type = WREPL_TYPE_SGROUP,
5638 .state = WREPL_STATE_TOMBSTONE,
5639 .node = WREPL_NODE_B,
5640 .is_static = false,
5641 .num_ips = ctx->addresses_best_num,
5642 .ips = ctx->addresses_best,
5643 .apply_expected = false
5647 * group,released vs. sgroup,tombstone with different ip(s)
5650 .line = __location__,
5651 .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL),
5652 .wins = {
5653 .nb_flags = NBT_NM_GROUP,
5654 .mhomed = false,
5655 .num_ips = ctx->addresses_best_num,
5656 .ips = ctx->addresses_best,
5657 .apply_expected = true
5659 .replica= {
5660 .type = WREPL_TYPE_SGROUP,
5661 .state = WREPL_STATE_TOMBSTONE,
5662 .node = WREPL_NODE_B,
5663 .is_static = false,
5664 .num_ips = ARRAY_SIZE(addresses_B_1),
5665 .ips = addresses_B_1,
5666 .apply_expected = false
5670 * group vs. multi homed section
5673 * group,released vs. mhomed,active with same ip(s)
5676 .line = __location__,
5677 .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL),
5678 .wins = {
5679 .nb_flags = NBT_NM_GROUP,
5680 .mhomed = false,
5681 .num_ips = ctx->addresses_best_num,
5682 .ips = ctx->addresses_best,
5683 .apply_expected = true
5685 .replica= {
5686 .type = WREPL_TYPE_MHOMED,
5687 .state = WREPL_STATE_ACTIVE,
5688 .node = WREPL_NODE_B,
5689 .is_static = false,
5690 .num_ips = ctx->addresses_best_num,
5691 .ips = ctx->addresses_best,
5692 .apply_expected = false
5696 * group,released vs. mhomed,active with different ip(s)
5699 .line = __location__,
5700 .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL),
5701 .wins = {
5702 .nb_flags = NBT_NM_GROUP,
5703 .mhomed = false,
5704 .num_ips = ctx->addresses_best_num,
5705 .ips = ctx->addresses_best,
5706 .apply_expected = true
5708 .replica= {
5709 .type = WREPL_TYPE_MHOMED,
5710 .state = WREPL_STATE_ACTIVE,
5711 .node = WREPL_NODE_B,
5712 .is_static = false,
5713 .num_ips = ARRAY_SIZE(addresses_B_1),
5714 .ips = addresses_B_1,
5715 .apply_expected = false
5719 * group,released vs. mhomed,tombstone with same ip(s)
5722 .line = __location__,
5723 .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL),
5724 .wins = {
5725 .nb_flags = NBT_NM_GROUP,
5726 .mhomed = false,
5727 .num_ips = ctx->addresses_best_num,
5728 .ips = ctx->addresses_best,
5729 .apply_expected = true
5731 .replica= {
5732 .type = WREPL_TYPE_MHOMED,
5733 .state = WREPL_STATE_TOMBSTONE,
5734 .node = WREPL_NODE_B,
5735 .is_static = false,
5736 .num_ips = ctx->addresses_best_num,
5737 .ips = ctx->addresses_best,
5738 .apply_expected = false
5742 * group,released vs. mhomed,tombstone with different ip(s)
5745 .line = __location__,
5746 .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL),
5747 .wins = {
5748 .nb_flags = NBT_NM_GROUP,
5749 .mhomed = false,
5750 .num_ips = ctx->addresses_best_num,
5751 .ips = ctx->addresses_best,
5752 .apply_expected = true
5754 .replica= {
5755 .type = WREPL_TYPE_MHOMED,
5756 .state = WREPL_STATE_TOMBSTONE,
5757 .node = WREPL_NODE_B,
5758 .is_static = false,
5759 .num_ips = ARRAY_SIZE(addresses_B_1),
5760 .ips = addresses_B_1,
5761 .apply_expected = false
5765 * special group vs. unique section
5768 * sgroup,released vs. unique,active with same ip(s)
5771 .line = __location__,
5772 .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL),
5773 .wins = {
5774 .nb_flags = NBT_NM_GROUP,
5775 .mhomed = false,
5776 .num_ips = ctx->addresses_best_num,
5777 .ips = ctx->addresses_best,
5778 .apply_expected = true
5780 .replica= {
5781 .type = WREPL_TYPE_UNIQUE,
5782 .state = WREPL_STATE_ACTIVE,
5783 .node = WREPL_NODE_B,
5784 .is_static = false,
5785 .num_ips = ctx->addresses_best_num,
5786 .ips = ctx->addresses_best,
5787 .apply_expected = true
5791 * sgroup,released vs. unique,active with different ip(s)
5794 .line = __location__,
5795 .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL),
5796 .wins = {
5797 .nb_flags = NBT_NM_GROUP,
5798 .mhomed = false,
5799 .num_ips = ctx->addresses_best_num,
5800 .ips = ctx->addresses_best,
5801 .apply_expected = true
5803 .replica= {
5804 .type = WREPL_TYPE_UNIQUE,
5805 .state = WREPL_STATE_ACTIVE,
5806 .node = WREPL_NODE_B,
5807 .is_static = false,
5808 .num_ips = ARRAY_SIZE(addresses_B_1),
5809 .ips = addresses_B_1,
5810 .apply_expected = true
5814 * sgroup,released vs. unique,tombstone with same ip(s)
5817 .line = __location__,
5818 .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL),
5819 .wins = {
5820 .nb_flags = NBT_NM_GROUP,
5821 .mhomed = false,
5822 .num_ips = ctx->addresses_best_num,
5823 .ips = ctx->addresses_best,
5824 .apply_expected = true
5826 .replica= {
5827 .type = WREPL_TYPE_UNIQUE,
5828 .state = WREPL_STATE_TOMBSTONE,
5829 .node = WREPL_NODE_B,
5830 .is_static = false,
5831 .num_ips = ctx->addresses_best_num,
5832 .ips = ctx->addresses_best,
5833 .apply_expected = true
5837 * sgroup,released vs. unique,tombstone with different ip(s)
5840 .line = __location__,
5841 .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL),
5842 .wins = {
5843 .nb_flags = NBT_NM_GROUP,
5844 .mhomed = false,
5845 .num_ips = ctx->addresses_best_num,
5846 .ips = ctx->addresses_best,
5847 .apply_expected = true
5849 .replica= {
5850 .type = WREPL_TYPE_UNIQUE,
5851 .state = WREPL_STATE_TOMBSTONE,
5852 .node = WREPL_NODE_B,
5853 .is_static = false,
5854 .num_ips = ARRAY_SIZE(addresses_B_1),
5855 .ips = addresses_B_1,
5856 .apply_expected = true
5860 * special group vs. group section
5863 * sgroup,released vs. group,active with same ip(s)
5866 .line = __location__,
5867 .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL),
5868 .wins = {
5869 .nb_flags = NBT_NM_GROUP,
5870 .mhomed = false,
5871 .num_ips = ctx->addresses_best_num,
5872 .ips = ctx->addresses_best,
5873 .apply_expected = true
5875 .replica= {
5876 .type = WREPL_TYPE_GROUP,
5877 .state = WREPL_STATE_ACTIVE,
5878 .node = WREPL_NODE_B,
5879 .is_static = false,
5880 .num_ips = ctx->addresses_best_num,
5881 .ips = ctx->addresses_best,
5882 .apply_expected = true
5886 * sgroup,released vs. group,active with different ip(s)
5889 .line = __location__,
5890 .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL),
5891 .wins = {
5892 .nb_flags = NBT_NM_GROUP,
5893 .mhomed = false,
5894 .num_ips = ctx->addresses_best_num,
5895 .ips = ctx->addresses_best,
5896 .apply_expected = true
5898 .replica= {
5899 .type = WREPL_TYPE_GROUP,
5900 .state = WREPL_STATE_ACTIVE,
5901 .node = WREPL_NODE_B,
5902 .is_static = false,
5903 .num_ips = ARRAY_SIZE(addresses_B_1),
5904 .ips = addresses_B_1,
5905 .apply_expected = true
5909 * sgroup,released vs. group,tombstone with same ip(s)
5912 .line = __location__,
5913 .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL),
5914 .wins = {
5915 .nb_flags = NBT_NM_GROUP,
5916 .mhomed = false,
5917 .num_ips = ctx->addresses_best_num,
5918 .ips = ctx->addresses_best,
5919 .apply_expected = true
5921 .replica= {
5922 .type = WREPL_TYPE_GROUP,
5923 .state = WREPL_STATE_TOMBSTONE,
5924 .node = WREPL_NODE_B,
5925 .is_static = false,
5926 .num_ips = ctx->addresses_best_num,
5927 .ips = ctx->addresses_best,
5928 .apply_expected = true
5932 * sgroup,released vs. group,tombstone with different ip(s)
5935 .line = __location__,
5936 .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL),
5937 .wins = {
5938 .nb_flags = NBT_NM_GROUP,
5939 .mhomed = false,
5940 .num_ips = ctx->addresses_best_num,
5941 .ips = ctx->addresses_best,
5942 .apply_expected = true
5944 .replica= {
5945 .type = WREPL_TYPE_GROUP,
5946 .state = WREPL_STATE_TOMBSTONE,
5947 .node = WREPL_NODE_B,
5948 .is_static = false,
5949 .num_ips = ARRAY_SIZE(addresses_B_1),
5950 .ips = addresses_B_1,
5951 .apply_expected = true
5955 * special group vs. special group section
5958 * sgroup,released vs. sgroup,active with same ip(s)
5961 .line = __location__,
5962 .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL),
5963 .wins = {
5964 .nb_flags = NBT_NM_GROUP,
5965 .mhomed = false,
5966 .num_ips = ctx->addresses_best_num,
5967 .ips = ctx->addresses_best,
5968 .apply_expected = true
5970 .replica= {
5971 .type = WREPL_TYPE_SGROUP,
5972 .state = WREPL_STATE_ACTIVE,
5973 .node = WREPL_NODE_B,
5974 .is_static = false,
5975 .num_ips = ctx->addresses_best_num,
5976 .ips = ctx->addresses_best,
5977 .apply_expected = true
5981 * sgroup,released vs. sgroup,active with different ip(s)
5984 .line = __location__,
5985 .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL),
5986 .wins = {
5987 .nb_flags = NBT_NM_GROUP,
5988 .mhomed = false,
5989 .num_ips = ctx->addresses_best_num,
5990 .ips = ctx->addresses_best,
5991 .apply_expected = true
5993 .replica= {
5994 .type = WREPL_TYPE_SGROUP,
5995 .state = WREPL_STATE_ACTIVE,
5996 .node = WREPL_NODE_B,
5997 .is_static = false,
5998 .num_ips = ARRAY_SIZE(addresses_B_1),
5999 .ips = addresses_B_1,
6000 .apply_expected = true
6004 * sgroup,released vs. sgroup,tombstone with same ip(s)
6007 .line = __location__,
6008 .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL),
6009 .wins = {
6010 .nb_flags = NBT_NM_GROUP,
6011 .mhomed = false,
6012 .num_ips = ctx->addresses_best_num,
6013 .ips = ctx->addresses_best,
6014 .apply_expected = true
6016 .replica= {
6017 .type = WREPL_TYPE_SGROUP,
6018 .state = WREPL_STATE_TOMBSTONE,
6019 .node = WREPL_NODE_B,
6020 .is_static = false,
6021 .num_ips = ctx->addresses_best_num,
6022 .ips = ctx->addresses_best,
6023 .apply_expected = true
6027 * sgroup,released vs. sgroup,tombstone with different ip(s)
6030 .line = __location__,
6031 .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL),
6032 .wins = {
6033 .nb_flags = NBT_NM_GROUP,
6034 .mhomed = false,
6035 .num_ips = ctx->addresses_best_num,
6036 .ips = ctx->addresses_best,
6037 .apply_expected = true
6039 .replica= {
6040 .type = WREPL_TYPE_SGROUP,
6041 .state = WREPL_STATE_TOMBSTONE,
6042 .node = WREPL_NODE_B,
6043 .is_static = false,
6044 .num_ips = ARRAY_SIZE(addresses_B_1),
6045 .ips = addresses_B_1,
6046 .apply_expected = true
6050 * special group vs. multi homed section
6053 * sgroup,released vs. mhomed,active with same ip(s)
6056 .line = __location__,
6057 .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL),
6058 .wins = {
6059 .nb_flags = NBT_NM_GROUP,
6060 .mhomed = false,
6061 .num_ips = ctx->addresses_best_num,
6062 .ips = ctx->addresses_best,
6063 .apply_expected = true
6065 .replica= {
6066 .type = WREPL_TYPE_MHOMED,
6067 .state = WREPL_STATE_ACTIVE,
6068 .node = WREPL_NODE_B,
6069 .is_static = false,
6070 .num_ips = ctx->addresses_best_num,
6071 .ips = ctx->addresses_best,
6072 .apply_expected = true
6076 * sgroup,released vs. mhomed,active with different ip(s)
6079 .line = __location__,
6080 .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL),
6081 .wins = {
6082 .nb_flags = NBT_NM_GROUP,
6083 .mhomed = false,
6084 .num_ips = ctx->addresses_best_num,
6085 .ips = ctx->addresses_best,
6086 .apply_expected = true
6088 .replica= {
6089 .type = WREPL_TYPE_MHOMED,
6090 .state = WREPL_STATE_ACTIVE,
6091 .node = WREPL_NODE_B,
6092 .is_static = false,
6093 .num_ips = ARRAY_SIZE(addresses_B_1),
6094 .ips = addresses_B_1,
6095 .apply_expected = true
6099 * sgroup,released vs. mhomed,tombstone with same ip(s)
6102 .line = __location__,
6103 .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL),
6104 .wins = {
6105 .nb_flags = NBT_NM_GROUP,
6106 .mhomed = false,
6107 .num_ips = ctx->addresses_best_num,
6108 .ips = ctx->addresses_best,
6109 .apply_expected = true
6111 .replica= {
6112 .type = WREPL_TYPE_MHOMED,
6113 .state = WREPL_STATE_TOMBSTONE,
6114 .node = WREPL_NODE_B,
6115 .is_static = false,
6116 .num_ips = ctx->addresses_best_num,
6117 .ips = ctx->addresses_best,
6118 .apply_expected = true
6122 * sgroup,released vs. mhomed,tombstone with different ip(s)
6125 .line = __location__,
6126 .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL),
6127 .wins = {
6128 .nb_flags = NBT_NM_GROUP,
6129 .mhomed = false,
6130 .num_ips = ctx->addresses_best_num,
6131 .ips = ctx->addresses_best,
6132 .apply_expected = true
6134 .replica= {
6135 .type = WREPL_TYPE_MHOMED,
6136 .state = WREPL_STATE_TOMBSTONE,
6137 .node = WREPL_NODE_B,
6138 .is_static = false,
6139 .num_ips = ARRAY_SIZE(addresses_B_1),
6140 .ips = addresses_B_1,
6141 .apply_expected = true
6145 * multi homed vs. unique section
6148 * mhomed,released vs. unique,active with same ip(s)
6151 .line = __location__,
6152 .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL),
6153 .wins = {
6154 .nb_flags = 0,
6155 .mhomed = true,
6156 .num_ips = ctx->addresses_best_num,
6157 .ips = ctx->addresses_best,
6158 .apply_expected = true
6160 .replica= {
6161 .type = WREPL_TYPE_UNIQUE,
6162 .state = WREPL_STATE_ACTIVE,
6163 .node = WREPL_NODE_B,
6164 .is_static = false,
6165 .num_ips = ctx->addresses_best_num,
6166 .ips = ctx->addresses_best,
6167 .apply_expected = true
6171 * mhomed,released vs. unique,active with different ip(s)
6174 .line = __location__,
6175 .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL),
6176 .wins = {
6177 .nb_flags = 0,
6178 .mhomed = true,
6179 .num_ips = ctx->addresses_best_num,
6180 .ips = ctx->addresses_best,
6181 .apply_expected = true
6183 .replica= {
6184 .type = WREPL_TYPE_UNIQUE,
6185 .state = WREPL_STATE_ACTIVE,
6186 .node = WREPL_NODE_B,
6187 .is_static = false,
6188 .num_ips = ARRAY_SIZE(addresses_B_1),
6189 .ips = addresses_B_1,
6190 .apply_expected = true
6194 * mhomed,released vs. unique,tombstone with same ip(s)
6197 .line = __location__,
6198 .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL),
6199 .wins = {
6200 .nb_flags = 0,
6201 .mhomed = true,
6202 .num_ips = ctx->addresses_best_num,
6203 .ips = ctx->addresses_best,
6204 .apply_expected = true
6206 .replica= {
6207 .type = WREPL_TYPE_UNIQUE,
6208 .state = WREPL_STATE_TOMBSTONE,
6209 .node = WREPL_NODE_B,
6210 .is_static = false,
6211 .num_ips = ctx->addresses_best_num,
6212 .ips = ctx->addresses_best,
6213 .apply_expected = true
6217 * mhomed,released vs. unique,tombstone with different ip(s)
6220 .line = __location__,
6221 .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL),
6222 .wins = {
6223 .nb_flags = 0,
6224 .mhomed = true,
6225 .num_ips = ctx->addresses_best_num,
6226 .ips = ctx->addresses_best,
6227 .apply_expected = true
6229 .replica= {
6230 .type = WREPL_TYPE_UNIQUE,
6231 .state = WREPL_STATE_TOMBSTONE,
6232 .node = WREPL_NODE_B,
6233 .is_static = false,
6234 .num_ips = ARRAY_SIZE(addresses_B_1),
6235 .ips = addresses_B_1,
6236 .apply_expected = true
6240 * multi homed vs. group section
6243 * mhomed,released vs. group,active with same ip(s)
6246 .line = __location__,
6247 .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL),
6248 .wins = {
6249 .nb_flags = 0,
6250 .mhomed = true,
6251 .num_ips = ctx->addresses_best_num,
6252 .ips = ctx->addresses_best,
6253 .apply_expected = true
6255 .replica= {
6256 .type = WREPL_TYPE_GROUP,
6257 .state = WREPL_STATE_ACTIVE,
6258 .node = WREPL_NODE_B,
6259 .is_static = false,
6260 .num_ips = ctx->addresses_best_num,
6261 .ips = ctx->addresses_best,
6262 .apply_expected = true
6266 * mhomed,released vs. group,active with different ip(s)
6269 .line = __location__,
6270 .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL),
6271 .wins = {
6272 .nb_flags = 0,
6273 .mhomed = true,
6274 .num_ips = ctx->addresses_best_num,
6275 .ips = ctx->addresses_best,
6276 .apply_expected = true
6278 .replica= {
6279 .type = WREPL_TYPE_GROUP,
6280 .state = WREPL_STATE_ACTIVE,
6281 .node = WREPL_NODE_B,
6282 .is_static = false,
6283 .num_ips = ARRAY_SIZE(addresses_B_1),
6284 .ips = addresses_B_1,
6285 .apply_expected = true
6289 * mhomed,released vs. group,tombstone with same ip(s)
6292 .line = __location__,
6293 .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL),
6294 .wins = {
6295 .nb_flags = 0,
6296 .mhomed = true,
6297 .num_ips = ctx->addresses_best_num,
6298 .ips = ctx->addresses_best,
6299 .apply_expected = true
6301 .replica= {
6302 .type = WREPL_TYPE_GROUP,
6303 .state = WREPL_STATE_TOMBSTONE,
6304 .node = WREPL_NODE_B,
6305 .is_static = false,
6306 .num_ips = ctx->addresses_best_num,
6307 .ips = ctx->addresses_best,
6308 .apply_expected = true
6312 * mhomed,released vs. group,tombstone with different ip(s)
6315 .line = __location__,
6316 .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL),
6317 .wins = {
6318 .nb_flags = 0,
6319 .mhomed = true,
6320 .num_ips = ctx->addresses_best_num,
6321 .ips = ctx->addresses_best,
6322 .apply_expected = true
6324 .replica= {
6325 .type = WREPL_TYPE_GROUP,
6326 .state = WREPL_STATE_TOMBSTONE,
6327 .node = WREPL_NODE_B,
6328 .is_static = false,
6329 .num_ips = ARRAY_SIZE(addresses_B_1),
6330 .ips = addresses_B_1,
6331 .apply_expected = true
6335 * multi homed vs. special group section
6338 * mhomed,released vs. sgroup,active with same ip(s)
6341 .line = __location__,
6342 .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL),
6343 .wins = {
6344 .nb_flags = 0,
6345 .mhomed = true,
6346 .num_ips = ctx->addresses_best_num,
6347 .ips = ctx->addresses_best,
6348 .apply_expected = true
6350 .replica= {
6351 .type = WREPL_TYPE_SGROUP,
6352 .state = WREPL_STATE_ACTIVE,
6353 .node = WREPL_NODE_B,
6354 .is_static = false,
6355 .num_ips = ctx->addresses_best_num,
6356 .ips = ctx->addresses_best,
6357 .apply_expected = true
6361 * mhomed,released vs. sgroup,active with different ip(s)
6364 .line = __location__,
6365 .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL),
6366 .wins = {
6367 .nb_flags = 0,
6368 .mhomed = true,
6369 .num_ips = ctx->addresses_best_num,
6370 .ips = ctx->addresses_best,
6371 .apply_expected = true
6373 .replica= {
6374 .type = WREPL_TYPE_SGROUP,
6375 .state = WREPL_STATE_ACTIVE,
6376 .node = WREPL_NODE_B,
6377 .is_static = false,
6378 .num_ips = ARRAY_SIZE(addresses_B_1),
6379 .ips = addresses_B_1,
6380 .apply_expected = true
6384 * mhomed,released vs. sgroup,tombstone with same ip(s)
6387 .line = __location__,
6388 .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL),
6389 .wins = {
6390 .nb_flags = 0,
6391 .mhomed = true,
6392 .num_ips = ctx->addresses_best_num,
6393 .ips = ctx->addresses_best,
6394 .apply_expected = true
6396 .replica= {
6397 .type = WREPL_TYPE_SGROUP,
6398 .state = WREPL_STATE_TOMBSTONE,
6399 .node = WREPL_NODE_B,
6400 .is_static = false,
6401 .num_ips = ctx->addresses_best_num,
6402 .ips = ctx->addresses_best,
6403 .apply_expected = true
6407 * mhomed,released vs. sgroup,tombstone with different ip(s)
6410 .line = __location__,
6411 .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL),
6412 .wins = {
6413 .nb_flags = 0,
6414 .mhomed = true,
6415 .num_ips = ctx->addresses_best_num,
6416 .ips = ctx->addresses_best,
6417 .apply_expected = true
6419 .replica= {
6420 .type = WREPL_TYPE_SGROUP,
6421 .state = WREPL_STATE_TOMBSTONE,
6422 .node = WREPL_NODE_B,
6423 .is_static = false,
6424 .num_ips = ARRAY_SIZE(addresses_B_1),
6425 .ips = addresses_B_1,
6426 .apply_expected = true
6430 * multi homed vs. multi homed section
6433 * mhomed,released vs. mhomed,active with same ip(s)
6436 .line = __location__,
6437 .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL),
6438 .wins = {
6439 .nb_flags = 0,
6440 .mhomed = true,
6441 .num_ips = ctx->addresses_best_num,
6442 .ips = ctx->addresses_best,
6443 .apply_expected = true
6445 .replica= {
6446 .type = WREPL_TYPE_MHOMED,
6447 .state = WREPL_STATE_ACTIVE,
6448 .node = WREPL_NODE_B,
6449 .is_static = false,
6450 .num_ips = ctx->addresses_best_num,
6451 .ips = ctx->addresses_best,
6452 .apply_expected = true
6456 * mhomed,released vs. mhomed,active with different ip(s)
6459 .line = __location__,
6460 .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL),
6461 .wins = {
6462 .nb_flags = 0,
6463 .mhomed = true,
6464 .num_ips = ctx->addresses_best_num,
6465 .ips = ctx->addresses_best,
6466 .apply_expected = true
6468 .replica= {
6469 .type = WREPL_TYPE_MHOMED,
6470 .state = WREPL_STATE_ACTIVE,
6471 .node = WREPL_NODE_B,
6472 .is_static = false,
6473 .num_ips = ARRAY_SIZE(addresses_B_1),
6474 .ips = addresses_B_1,
6475 .apply_expected = true
6479 * mhomed,released vs. mhomed,tombstone with same ip(s)
6482 .line = __location__,
6483 .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL),
6484 .wins = {
6485 .nb_flags = 0,
6486 .mhomed = true,
6487 .num_ips = ctx->addresses_best_num,
6488 .ips = ctx->addresses_best,
6489 .apply_expected = true
6491 .replica= {
6492 .type = WREPL_TYPE_MHOMED,
6493 .state = WREPL_STATE_TOMBSTONE,
6494 .node = WREPL_NODE_B,
6495 .is_static = false,
6496 .num_ips = ctx->addresses_best_num,
6497 .ips = ctx->addresses_best,
6498 .apply_expected = true
6502 * mhomed,released vs. mhomed,tombstone with different ip(s)
6505 .line = __location__,
6506 .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL),
6507 .wins = {
6508 .nb_flags = 0,
6509 .mhomed = true,
6510 .num_ips = ctx->addresses_best_num,
6511 .ips = ctx->addresses_best,
6512 .apply_expected = true
6514 .replica= {
6515 .type = WREPL_TYPE_MHOMED,
6516 .state = WREPL_STATE_TOMBSTONE,
6517 .node = WREPL_NODE_B,
6518 .is_static = false,
6519 .num_ips = ARRAY_SIZE(addresses_B_1),
6520 .ips = addresses_B_1,
6521 .apply_expected = true
6526 torture_comment(tctx, "Test Replica records vs. owned released records\n");
6528 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
6529 torture_comment(tctx, "%s => %s\n", nbt_name_string(ctx, &records[i].name),
6530 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
6533 * Setup Register
6535 name_register->in.name = records[i].name;
6536 name_register->in.dest_addr = ctx->address;
6537 name_register->in.dest_port = lp_nbt_port(tctx->lp_ctx);
6538 name_register->in.address = records[i].wins.ips[0].ip;
6539 name_register->in.nb_flags = records[i].wins.nb_flags;
6540 name_register->in.register_demand= false;
6541 name_register->in.broadcast = false;
6542 name_register->in.multi_homed = records[i].wins.mhomed;
6543 name_register->in.ttl = 300000;
6544 name_register->in.timeout = 70;
6545 name_register->in.retries = 0;
6547 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
6548 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6549 torture_comment(tctx, "No response from %s for name register\n", ctx->address);
6550 ret = false;
6552 if (!NT_STATUS_IS_OK(status)) {
6553 torture_comment(tctx, "Bad response from %s for name register - %s\n",
6554 ctx->address, nt_errstr(status));
6555 ret = false;
6557 CHECK_VALUE(tctx, name_register->out.rcode, 0);
6558 CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address);
6559 CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type);
6560 CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name);
6561 CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope);
6562 CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[0].ip);
6564 /* release the record */
6565 release->in.name = records[i].name;
6566 release->in.dest_port = lp_nbt_port(tctx->lp_ctx);
6567 release->in.dest_addr = ctx->address;
6568 release->in.address = records[i].wins.ips[0].ip;
6569 release->in.nb_flags = records[i].wins.nb_flags;
6570 release->in.broadcast = false;
6571 release->in.timeout = 30;
6572 release->in.retries = 0;
6574 status = nbt_name_release(ctx->nbtsock, ctx, release);
6575 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6576 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
6577 return false;
6579 if (!NT_STATUS_IS_OK(status)) {
6580 torture_comment(tctx, "Bad response from %s for name query - %s\n",
6581 ctx->address, nt_errstr(status));
6582 return false;
6584 CHECK_VALUE(tctx, release->out.rcode, 0);
6587 * Setup Replica
6589 wins_name->name = &records[i].name;
6590 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
6591 records[i].replica.state,
6592 records[i].replica.node,
6593 records[i].replica.is_static);
6594 wins_name->id = ++ctx->b.max_version;
6595 if (wins_name->flags & 2) {
6596 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
6597 wins_name->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
6598 records[i].replica.ips);
6599 } else {
6600 wins_name->addresses.ip = records[i].replica.ips[0].ip;
6602 wins_name->unknown = "255.255.255.255";
6604 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
6605 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name,
6606 records[i].replica.apply_expected);
6608 if (records[i].replica.apply_expected) {
6609 wins_name->name = &records[i].name;
6610 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
6611 WREPL_STATE_TOMBSTONE,
6612 WREPL_NODE_B, false);
6613 wins_name->id = ++ctx->b.max_version;
6614 wins_name->addresses.ip = addresses_B_1[0].ip;
6615 wins_name->unknown = "255.255.255.255";
6617 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
6618 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
6619 } else {
6620 release->in.name = records[i].name;
6621 release->in.dest_addr = ctx->address;
6622 release->in.dest_port = lp_nbt_port(tctx->lp_ctx);
6623 release->in.address = records[i].wins.ips[0].ip;
6624 release->in.nb_flags = records[i].wins.nb_flags;
6625 release->in.broadcast = false;
6626 release->in.timeout = 30;
6627 release->in.retries = 0;
6629 status = nbt_name_release(ctx->nbtsock, ctx, release);
6630 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6631 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
6632 return false;
6634 if (!NT_STATUS_IS_OK(status)) {
6635 torture_comment(tctx, "Bad response from %s for name query - %s\n",
6636 ctx->address, nt_errstr(status));
6637 return false;
6639 CHECK_VALUE(tctx, release->out.rcode, 0);
6641 if (!ret) {
6642 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
6643 return ret;
6647 return ret;
6650 struct test_conflict_owned_active_vs_replica_struct {
6651 const char *line; /* just better debugging */
6652 const char *section; /* just better debugging */
6653 struct nbt_name name;
6654 const char *comment;
6655 bool skip;
6656 struct {
6657 uint32_t nb_flags;
6658 bool mhomed;
6659 uint32_t num_ips;
6660 const struct wrepl_ip *ips;
6661 bool apply_expected;
6662 } wins;
6663 struct {
6664 uint32_t timeout;
6665 bool positive;
6666 bool expect_release;
6667 bool late_release;
6668 bool ret;
6669 /* when num_ips == 0, then .wins.ips are used */
6670 uint32_t num_ips;
6671 const struct wrepl_ip *ips;
6672 } defend;
6673 struct {
6674 enum wrepl_name_type type;
6675 enum wrepl_name_state state;
6676 enum wrepl_name_node node;
6677 bool is_static;
6678 uint32_t num_ips;
6679 const struct wrepl_ip *ips;
6680 bool apply_expected;
6681 bool mhomed_merge;
6682 bool sgroup_merge;
6683 } replica;
6686 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
6687 struct nbt_name_packet *req_packet,
6688 struct socket_address *src);
6690 static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx,
6691 struct test_wrepl_conflict_conn *ctx)
6693 bool ret = true;
6694 NTSTATUS status;
6695 struct wrepl_wins_name wins_name_;
6696 struct wrepl_wins_name *wins_name = &wins_name_;
6697 struct nbt_name_register name_register_;
6698 struct nbt_name_register *name_register = &name_register_;
6699 struct nbt_name_release release_;
6700 struct nbt_name_release *release = &release_;
6701 uint32_t i;
6702 struct test_conflict_owned_active_vs_replica_struct records[] = {
6704 * unique vs. unique section
6707 * unique,active vs. unique,active with same ip(s), unchecked
6710 .line = __location__,
6711 .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL),
6712 .wins = {
6713 .nb_flags = 0,
6714 .mhomed = false,
6715 .num_ips = ctx->addresses_best_num,
6716 .ips = ctx->addresses_best,
6717 .apply_expected = true
6719 .defend = {
6720 .timeout = 0,
6722 .replica= {
6723 .type = WREPL_TYPE_UNIQUE,
6724 .state = WREPL_STATE_ACTIVE,
6725 .node = WREPL_NODE_B,
6726 .is_static = false,
6727 .num_ips = ctx->addresses_best_num,
6728 .ips = ctx->addresses_best,
6729 .apply_expected = true
6733 * unique,active vs. unique,active with different ip(s), positive response
6736 .line = __location__,
6737 .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL),
6738 .wins = {
6739 .nb_flags = 0,
6740 .mhomed = false,
6741 .num_ips = ctx->addresses_best_num,
6742 .ips = ctx->addresses_best,
6743 .apply_expected = true
6745 .defend = {
6746 .timeout = 10,
6747 .positive = true,
6749 .replica= {
6750 .type = WREPL_TYPE_UNIQUE,
6751 .state = WREPL_STATE_ACTIVE,
6752 .node = WREPL_NODE_B,
6753 .is_static = false,
6754 .num_ips = ARRAY_SIZE(addresses_B_1),
6755 .ips = addresses_B_1,
6756 .apply_expected = false
6760 * unique,active vs. unique,active with different ip(s), positive response other ips
6763 .line = __location__,
6764 .name = _NBT_NAME("_UA_UA_DI_O", 0x00, NULL),
6765 .wins = {
6766 .nb_flags = 0,
6767 .mhomed = false,
6768 .num_ips = ctx->addresses_best_num,
6769 .ips = ctx->addresses_best,
6770 .apply_expected = true
6772 .defend = {
6773 .timeout = 10,
6774 .positive = true,
6775 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6776 .ips = addresses_A_3_4,
6778 .replica= {
6779 .type = WREPL_TYPE_UNIQUE,
6780 .state = WREPL_STATE_ACTIVE,
6781 .node = WREPL_NODE_B,
6782 .is_static = false,
6783 .num_ips = ARRAY_SIZE(addresses_B_1),
6784 .ips = addresses_B_1,
6785 .apply_expected = false
6789 * unique,active vs. unique,active with different ip(s), negative response
6792 .line = __location__,
6793 .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL),
6794 .wins = {
6795 .nb_flags = 0,
6796 .mhomed = false,
6797 .num_ips = ctx->addresses_best_num,
6798 .ips = ctx->addresses_best,
6799 .apply_expected = true
6801 .defend = {
6802 .timeout = 10,
6803 .positive = false,
6805 .replica= {
6806 .type = WREPL_TYPE_UNIQUE,
6807 .state = WREPL_STATE_ACTIVE,
6808 .node = WREPL_NODE_B,
6809 .is_static = false,
6810 .num_ips = ARRAY_SIZE(addresses_B_1),
6811 .ips = addresses_B_1,
6812 .apply_expected = true
6816 * unique,active vs. unique,tombstone with same ip(s), unchecked
6819 .line = __location__,
6820 .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL),
6821 .wins = {
6822 .nb_flags = 0,
6823 .mhomed = false,
6824 .num_ips = ctx->addresses_best_num,
6825 .ips = ctx->addresses_best,
6826 .apply_expected = true
6828 .defend = {
6829 .timeout = 0,
6831 .replica= {
6832 .type = WREPL_TYPE_UNIQUE,
6833 .state = WREPL_STATE_TOMBSTONE,
6834 .node = WREPL_NODE_B,
6835 .is_static = false,
6836 .num_ips = ctx->addresses_best_num,
6837 .ips = ctx->addresses_best,
6838 .apply_expected = false
6842 * unique,active vs. unique,tombstone with different ip(s), unchecked
6845 .line = __location__,
6846 .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL),
6847 .wins = {
6848 .nb_flags = 0,
6849 .mhomed = false,
6850 .num_ips = ctx->addresses_best_num,
6851 .ips = ctx->addresses_best,
6852 .apply_expected = true
6854 .defend = {
6855 .timeout = 0,
6857 .replica= {
6858 .type = WREPL_TYPE_UNIQUE,
6859 .state = WREPL_STATE_TOMBSTONE,
6860 .node = WREPL_NODE_B,
6861 .is_static = false,
6862 .num_ips = ARRAY_SIZE(addresses_B_1),
6863 .ips = addresses_B_1,
6864 .apply_expected = false
6868 * unique vs. group section
6871 * unique,active vs. group,active with same ip(s), release expected
6874 .line = __location__,
6875 .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL),
6876 .wins = {
6877 .nb_flags = 0,
6878 .mhomed = false,
6879 .num_ips = ctx->addresses_best_num,
6880 .ips = ctx->addresses_best,
6881 .apply_expected = true
6883 .defend = {
6884 .timeout = 10,
6885 .expect_release = true,
6887 .replica= {
6888 .type = WREPL_TYPE_GROUP,
6889 .state = WREPL_STATE_ACTIVE,
6890 .node = WREPL_NODE_B,
6891 .is_static = false,
6892 .num_ips = ctx->addresses_best_num,
6893 .ips = ctx->addresses_best,
6894 .apply_expected = true
6898 * unique,active vs. group,active with different ip(s), release expected
6901 .line = __location__,
6902 .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL),
6903 .wins = {
6904 .nb_flags = 0,
6905 .mhomed = false,
6906 .num_ips = ctx->addresses_best_num,
6907 .ips = ctx->addresses_best,
6908 .apply_expected = true
6910 .defend = {
6911 .timeout = 10,
6912 .expect_release = true,
6914 .replica= {
6915 .type = WREPL_TYPE_GROUP,
6916 .state = WREPL_STATE_ACTIVE,
6917 .node = WREPL_NODE_B,
6918 .is_static = false,
6919 .num_ips = ARRAY_SIZE(addresses_B_1),
6920 .ips = addresses_B_1,
6921 .apply_expected = true
6925 * unique,active vs. group,tombstone with same ip(s), unchecked
6928 .line = __location__,
6929 .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL),
6930 .wins = {
6931 .nb_flags = 0,
6932 .mhomed = false,
6933 .num_ips = ctx->addresses_best_num,
6934 .ips = ctx->addresses_best,
6935 .apply_expected = true
6937 .defend = {
6938 .timeout = 0,
6940 .replica= {
6941 .type = WREPL_TYPE_GROUP,
6942 .state = WREPL_STATE_TOMBSTONE,
6943 .node = WREPL_NODE_B,
6944 .is_static = false,
6945 .num_ips = ctx->addresses_best_num,
6946 .ips = ctx->addresses_best,
6947 .apply_expected = false
6951 * unique,active vs. group,tombstone with different ip(s), unchecked
6954 .line = __location__,
6955 .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL),
6956 .wins = {
6957 .nb_flags = 0,
6958 .mhomed = false,
6959 .num_ips = ctx->addresses_best_num,
6960 .ips = ctx->addresses_best,
6961 .apply_expected = true
6963 .defend = {
6964 .timeout = 0,
6966 .replica= {
6967 .type = WREPL_TYPE_GROUP,
6968 .state = WREPL_STATE_TOMBSTONE,
6969 .node = WREPL_NODE_B,
6970 .is_static = false,
6971 .num_ips = ARRAY_SIZE(addresses_B_1),
6972 .ips = addresses_B_1,
6973 .apply_expected = false
6977 * unique vs. special group section
6980 * unique,active vs. sgroup,active with same ip(s), release expected
6983 .line = __location__,
6984 .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL),
6985 .wins = {
6986 .nb_flags = 0,
6987 .mhomed = false,
6988 .num_ips = ctx->addresses_best_num,
6989 .ips = ctx->addresses_best,
6990 .apply_expected = true
6992 .defend = {
6993 .timeout = 10,
6994 .expect_release = true,
6996 .replica= {
6997 .type = WREPL_TYPE_SGROUP,
6998 .state = WREPL_STATE_ACTIVE,
6999 .node = WREPL_NODE_B,
7000 .is_static = false,
7001 .num_ips = ctx->addresses_best_num,
7002 .ips = ctx->addresses_best,
7003 .apply_expected = true
7007 * unique,active vs. group,active with different ip(s), release expected
7010 .line = __location__,
7011 .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL),
7012 .wins = {
7013 .nb_flags = 0,
7014 .mhomed = false,
7015 .num_ips = ctx->addresses_best_num,
7016 .ips = ctx->addresses_best,
7017 .apply_expected = true
7019 .defend = {
7020 .timeout = 10,
7021 .expect_release = true,
7023 .replica= {
7024 .type = WREPL_TYPE_SGROUP,
7025 .state = WREPL_STATE_ACTIVE,
7026 .node = WREPL_NODE_B,
7027 .is_static = false,
7028 .num_ips = ARRAY_SIZE(addresses_B_1),
7029 .ips = addresses_B_1,
7030 .apply_expected = true
7034 * unique,active vs. sgroup,tombstone with same ip(s), unchecked
7037 .line = __location__,
7038 .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL),
7039 .wins = {
7040 .nb_flags = 0,
7041 .mhomed = false,
7042 .num_ips = ctx->addresses_best_num,
7043 .ips = ctx->addresses_best,
7044 .apply_expected = true
7046 .defend = {
7047 .timeout = 0,
7049 .replica= {
7050 .type = WREPL_TYPE_SGROUP,
7051 .state = WREPL_STATE_TOMBSTONE,
7052 .node = WREPL_NODE_B,
7053 .is_static = false,
7054 .num_ips = ctx->addresses_best_num,
7055 .ips = ctx->addresses_best,
7056 .apply_expected = false
7060 * unique,active vs. sgroup,tombstone with different ip(s), unchecked
7063 .line = __location__,
7064 .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL),
7065 .wins = {
7066 .nb_flags = 0,
7067 .mhomed = false,
7068 .num_ips = ctx->addresses_best_num,
7069 .ips = ctx->addresses_best,
7070 .apply_expected = true
7072 .defend = {
7073 .timeout = 0,
7075 .replica= {
7076 .type = WREPL_TYPE_SGROUP,
7077 .state = WREPL_STATE_TOMBSTONE,
7078 .node = WREPL_NODE_B,
7079 .is_static = false,
7080 .num_ips = ARRAY_SIZE(addresses_B_1),
7081 .ips = addresses_B_1,
7082 .apply_expected = false
7086 * unique vs. multi homed section
7089 * unique,active vs. mhomed,active with same ip(s), unchecked
7092 .line = __location__,
7093 .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL),
7094 .wins = {
7095 .nb_flags = 0,
7096 .mhomed = false,
7097 .num_ips = ctx->addresses_best_num,
7098 .ips = ctx->addresses_best,
7099 .apply_expected = true
7101 .defend = {
7102 .timeout = 0,
7104 .replica= {
7105 .type = WREPL_TYPE_MHOMED,
7106 .state = WREPL_STATE_ACTIVE,
7107 .node = WREPL_NODE_B,
7108 .is_static = false,
7109 .num_ips = ctx->addresses_best_num,
7110 .ips = ctx->addresses_best,
7111 .apply_expected = true
7115 * unique,active vs. mhomed,active with superset ip(s), unchecked
7118 .line = __location__,
7119 .name = _NBT_NAME("_UA_MA_SP_U", 0x00, NULL),
7120 .wins = {
7121 .nb_flags = 0,
7122 .mhomed = false,
7123 .num_ips = ctx->addresses_best_num,
7124 .ips = ctx->addresses_best,
7125 .apply_expected = true
7127 .defend = {
7128 .timeout = 0,
7130 .replica= {
7131 .type = WREPL_TYPE_MHOMED,
7132 .state = WREPL_STATE_ACTIVE,
7133 .node = WREPL_NODE_B,
7134 .is_static = false,
7135 .num_ips = ctx->addresses_all_num,
7136 .ips = ctx->addresses_all,
7137 .apply_expected = true
7141 * unique,active vs. mhomed,active with different ip(s), positive response
7144 .line = __location__,
7145 .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL),
7146 .wins = {
7147 .nb_flags = 0,
7148 .mhomed = false,
7149 .num_ips = ctx->addresses_best_num,
7150 .ips = ctx->addresses_best,
7151 .apply_expected = true
7153 .defend = {
7154 .timeout = 10,
7155 .positive = true,
7157 .replica= {
7158 .type = WREPL_TYPE_MHOMED,
7159 .state = WREPL_STATE_ACTIVE,
7160 .node = WREPL_NODE_B,
7161 .is_static = false,
7162 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7163 .ips = addresses_B_3_4,
7164 .apply_expected = false
7168 * unique,active vs. mhomed,active with different ip(s), positive response other ips
7171 .line = __location__,
7172 .name = _NBT_NAME("_UA_MA_DI_O", 0x00, NULL),
7173 .wins = {
7174 .nb_flags = 0,
7175 .mhomed = false,
7176 .num_ips = ctx->addresses_best_num,
7177 .ips = ctx->addresses_best,
7178 .apply_expected = true
7180 .defend = {
7181 .timeout = 10,
7182 .positive = true,
7183 .num_ips = ARRAY_SIZE(addresses_A_3_4),
7184 .ips = addresses_A_3_4,
7186 .replica= {
7187 .type = WREPL_TYPE_MHOMED,
7188 .state = WREPL_STATE_ACTIVE,
7189 .node = WREPL_NODE_B,
7190 .is_static = false,
7191 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7192 .ips = addresses_B_3_4,
7193 .apply_expected = false
7197 * unique,active vs. mhomed,active with different ip(s), negative response
7200 .line = __location__,
7201 .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL),
7202 .wins = {
7203 .nb_flags = 0,
7204 .mhomed = false,
7205 .num_ips = ctx->addresses_best_num,
7206 .ips = ctx->addresses_best,
7207 .apply_expected = true
7209 .defend = {
7210 .timeout = 10,
7211 .positive = false,
7213 .replica= {
7214 .type = WREPL_TYPE_MHOMED,
7215 .state = WREPL_STATE_ACTIVE,
7216 .node = WREPL_NODE_B,
7217 .is_static = false,
7218 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7219 .ips = addresses_B_3_4,
7220 .apply_expected = true
7224 * unique,active vs. mhomed,tombstone with same ip(s), unchecked
7227 .line = __location__,
7228 .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL),
7229 .wins = {
7230 .nb_flags = 0,
7231 .mhomed = false,
7232 .num_ips = ctx->addresses_best_num,
7233 .ips = ctx->addresses_best,
7234 .apply_expected = true
7236 .defend = {
7237 .timeout = 0,
7239 .replica= {
7240 .type = WREPL_TYPE_MHOMED,
7241 .state = WREPL_STATE_TOMBSTONE,
7242 .node = WREPL_NODE_B,
7243 .is_static = false,
7244 .num_ips = ctx->addresses_best_num,
7245 .ips = ctx->addresses_best,
7246 .apply_expected = false
7250 * unique,active vs. mhomed,tombstone with different ip(s), unchecked
7253 .line = __location__,
7254 .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL),
7255 .wins = {
7256 .nb_flags = 0,
7257 .mhomed = false,
7258 .num_ips = ctx->addresses_best_num,
7259 .ips = ctx->addresses_best,
7260 .apply_expected = true
7262 .defend = {
7263 .timeout = 0,
7265 .replica= {
7266 .type = WREPL_TYPE_MHOMED,
7267 .state = WREPL_STATE_TOMBSTONE,
7268 .node = WREPL_NODE_B,
7269 .is_static = false,
7270 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7271 .ips = addresses_B_3_4,
7272 .apply_expected = false
7276 * normal group vs. unique section
7279 * group,active vs. unique,active with same ip(s), unchecked
7282 .line = __location__,
7283 .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL),
7284 .wins = {
7285 .nb_flags = NBT_NM_GROUP,
7286 .mhomed = false,
7287 .num_ips = ctx->addresses_best_num,
7288 .ips = ctx->addresses_best,
7289 .apply_expected = true
7291 .defend = {
7292 .timeout = 0,
7294 .replica= {
7295 .type = WREPL_TYPE_UNIQUE,
7296 .state = WREPL_STATE_ACTIVE,
7297 .node = WREPL_NODE_B,
7298 .is_static = false,
7299 .num_ips = ctx->addresses_best_num,
7300 .ips = ctx->addresses_best,
7301 .apply_expected = false
7305 * group,active vs. unique,active with different ip(s), unchecked
7308 .line = __location__,
7309 .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL),
7310 .wins = {
7311 .nb_flags = NBT_NM_GROUP,
7312 .mhomed = false,
7313 .num_ips = ctx->addresses_best_num,
7314 .ips = ctx->addresses_best,
7315 .apply_expected = true
7317 .defend = {
7318 .timeout = 0,
7320 .replica= {
7321 .type = WREPL_TYPE_UNIQUE,
7322 .state = WREPL_STATE_ACTIVE,
7323 .node = WREPL_NODE_B,
7324 .is_static = false,
7325 .num_ips = ARRAY_SIZE(addresses_B_1),
7326 .ips = addresses_B_1,
7327 .apply_expected = false
7331 * group,active vs. unique,tombstone with same ip(s), unchecked
7334 .line = __location__,
7335 .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL),
7336 .wins = {
7337 .nb_flags = NBT_NM_GROUP,
7338 .mhomed = false,
7339 .num_ips = ctx->addresses_best_num,
7340 .ips = ctx->addresses_best,
7341 .apply_expected = true
7343 .defend = {
7344 .timeout = 0,
7346 .replica= {
7347 .type = WREPL_TYPE_UNIQUE,
7348 .state = WREPL_STATE_TOMBSTONE,
7349 .node = WREPL_NODE_B,
7350 .is_static = false,
7351 .num_ips = ctx->addresses_best_num,
7352 .ips = ctx->addresses_best,
7353 .apply_expected = false
7357 * group,active vs. unique,tombstone with different ip(s), unchecked
7360 .line = __location__,
7361 .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL),
7362 .wins = {
7363 .nb_flags = NBT_NM_GROUP,
7364 .mhomed = false,
7365 .num_ips = ctx->addresses_best_num,
7366 .ips = ctx->addresses_best,
7367 .apply_expected = true
7369 .defend = {
7370 .timeout = 0,
7372 .replica= {
7373 .type = WREPL_TYPE_UNIQUE,
7374 .state = WREPL_STATE_TOMBSTONE,
7375 .node = WREPL_NODE_B,
7376 .is_static = false,
7377 .num_ips = ARRAY_SIZE(addresses_B_1),
7378 .ips = addresses_B_1,
7379 .apply_expected = false
7383 * normal group vs. normal group section
7386 * group,active vs. group,active with same ip(s), unchecked
7389 .line = __location__,
7390 .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL),
7391 .wins = {
7392 .nb_flags = NBT_NM_GROUP,
7393 .mhomed = false,
7394 .num_ips = ctx->addresses_best_num,
7395 .ips = ctx->addresses_best,
7396 .apply_expected = true
7398 .defend = {
7399 .timeout = 0,
7401 .replica= {
7402 .type = WREPL_TYPE_GROUP,
7403 .state = WREPL_STATE_ACTIVE,
7404 .node = WREPL_NODE_B,
7405 .is_static = false,
7406 .num_ips = ctx->addresses_best_num,
7407 .ips = ctx->addresses_best,
7408 .apply_expected = true
7412 * group,active vs. group,active with different ip(s), unchecked
7415 .line = __location__,
7416 .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL),
7417 .wins = {
7418 .nb_flags = NBT_NM_GROUP,
7419 .mhomed = false,
7420 .num_ips = ctx->addresses_best_num,
7421 .ips = ctx->addresses_best,
7422 .apply_expected = true
7424 .defend = {
7425 .timeout = 0,
7427 .replica= {
7428 .type = WREPL_TYPE_GROUP,
7429 .state = WREPL_STATE_ACTIVE,
7430 .node = WREPL_NODE_B,
7431 .is_static = false,
7432 .num_ips = ARRAY_SIZE(addresses_B_1),
7433 .ips = addresses_B_1,
7434 .apply_expected = true
7438 * group,active vs. group,tombstone with same ip(s), unchecked
7441 .line = __location__,
7442 .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL),
7443 .wins = {
7444 .nb_flags = NBT_NM_GROUP,
7445 .mhomed = false,
7446 .num_ips = ctx->addresses_best_num,
7447 .ips = ctx->addresses_best,
7448 .apply_expected = true
7450 .defend = {
7451 .timeout = 0,
7453 .replica= {
7454 .type = WREPL_TYPE_GROUP,
7455 .state = WREPL_STATE_TOMBSTONE,
7456 .node = WREPL_NODE_B,
7457 .is_static = false,
7458 .num_ips = ctx->addresses_best_num,
7459 .ips = ctx->addresses_best,
7460 .apply_expected = false
7464 * group,active vs. group,tombstone with different ip(s), unchecked
7467 .line = __location__,
7468 .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL),
7469 .wins = {
7470 .nb_flags = NBT_NM_GROUP,
7471 .mhomed = false,
7472 .num_ips = ctx->addresses_best_num,
7473 .ips = ctx->addresses_best,
7474 .apply_expected = true
7476 .defend = {
7477 .timeout = 0,
7479 .replica= {
7480 .type = WREPL_TYPE_GROUP,
7481 .state = WREPL_STATE_TOMBSTONE,
7482 .node = WREPL_NODE_B,
7483 .is_static = false,
7484 .num_ips = ARRAY_SIZE(addresses_B_1),
7485 .ips = addresses_B_1,
7486 .apply_expected = false
7490 * normal group vs. special group section
7493 * group,active vs. sgroup,active with same ip(s), unchecked
7496 .line = __location__,
7497 .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL),
7498 .wins = {
7499 .nb_flags = NBT_NM_GROUP,
7500 .mhomed = false,
7501 .num_ips = ctx->addresses_best_num,
7502 .ips = ctx->addresses_best,
7503 .apply_expected = true
7505 .defend = {
7506 .timeout = 0,
7508 .replica= {
7509 .type = WREPL_TYPE_SGROUP,
7510 .state = WREPL_STATE_ACTIVE,
7511 .node = WREPL_NODE_B,
7512 .is_static = false,
7513 .num_ips = ctx->addresses_best_num,
7514 .ips = ctx->addresses_best,
7515 .apply_expected = false
7519 * group,active vs. sgroup,active with different ip(s), unchecked
7522 .line = __location__,
7523 .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL),
7524 .wins = {
7525 .nb_flags = NBT_NM_GROUP,
7526 .mhomed = false,
7527 .num_ips = ctx->addresses_best_num,
7528 .ips = ctx->addresses_best,
7529 .apply_expected = true
7531 .defend = {
7532 .timeout = 0,
7534 .replica= {
7535 .type = WREPL_TYPE_SGROUP,
7536 .state = WREPL_STATE_ACTIVE,
7537 .node = WREPL_NODE_B,
7538 .is_static = false,
7539 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7540 .ips = addresses_B_3_4,
7541 .apply_expected = false
7545 * group,active vs. sgroup,tombstone with same ip(s), unchecked
7548 .line = __location__,
7549 .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL),
7550 .wins = {
7551 .nb_flags = NBT_NM_GROUP,
7552 .mhomed = false,
7553 .num_ips = ctx->addresses_best_num,
7554 .ips = ctx->addresses_best,
7555 .apply_expected = true
7557 .defend = {
7558 .timeout = 0,
7560 .replica= {
7561 .type = WREPL_TYPE_SGROUP,
7562 .state = WREPL_STATE_TOMBSTONE,
7563 .node = WREPL_NODE_B,
7564 .is_static = false,
7565 .num_ips = ctx->addresses_best_num,
7566 .ips = ctx->addresses_best,
7567 .apply_expected = false
7571 * group,active vs. sgroup,tombstone with different ip(s), unchecked
7574 .line = __location__,
7575 .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL),
7576 .wins = {
7577 .nb_flags = NBT_NM_GROUP,
7578 .mhomed = false,
7579 .num_ips = ctx->addresses_best_num,
7580 .ips = ctx->addresses_best,
7581 .apply_expected = true
7583 .defend = {
7584 .timeout = 0,
7586 .replica= {
7587 .type = WREPL_TYPE_SGROUP,
7588 .state = WREPL_STATE_TOMBSTONE,
7589 .node = WREPL_NODE_B,
7590 .is_static = false,
7591 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7592 .ips = addresses_B_3_4,
7593 .apply_expected = false
7597 * normal group vs. multi homed section
7600 * group,active vs. mhomed,active with same ip(s), unchecked
7603 .line = __location__,
7604 .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL),
7605 .wins = {
7606 .nb_flags = NBT_NM_GROUP,
7607 .mhomed = false,
7608 .num_ips = ctx->addresses_best_num,
7609 .ips = ctx->addresses_best,
7610 .apply_expected = true
7612 .defend = {
7613 .timeout = 0,
7615 .replica= {
7616 .type = WREPL_TYPE_MHOMED,
7617 .state = WREPL_STATE_ACTIVE,
7618 .node = WREPL_NODE_B,
7619 .is_static = false,
7620 .num_ips = ctx->addresses_best_num,
7621 .ips = ctx->addresses_best,
7622 .apply_expected = false
7626 * group,active vs. mhomed,active with different ip(s), unchecked
7629 .line = __location__,
7630 .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL),
7631 .wins = {
7632 .nb_flags = NBT_NM_GROUP,
7633 .mhomed = false,
7634 .num_ips = ctx->addresses_best_num,
7635 .ips = ctx->addresses_best,
7636 .apply_expected = true
7638 .defend = {
7639 .timeout = 0,
7641 .replica= {
7642 .type = WREPL_TYPE_MHOMED,
7643 .state = WREPL_STATE_ACTIVE,
7644 .node = WREPL_NODE_B,
7645 .is_static = false,
7646 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7647 .ips = addresses_B_3_4,
7648 .apply_expected = false
7652 * group,active vs. mhomed,tombstone with same ip(s), unchecked
7655 .line = __location__,
7656 .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL),
7657 .wins = {
7658 .nb_flags = NBT_NM_GROUP,
7659 .mhomed = false,
7660 .num_ips = ctx->addresses_best_num,
7661 .ips = ctx->addresses_best,
7662 .apply_expected = true
7664 .defend = {
7665 .timeout = 0,
7667 .replica= {
7668 .type = WREPL_TYPE_MHOMED,
7669 .state = WREPL_STATE_TOMBSTONE,
7670 .node = WREPL_NODE_B,
7671 .is_static = false,
7672 .num_ips = ctx->addresses_best_num,
7673 .ips = ctx->addresses_best,
7674 .apply_expected = false
7678 * group,active vs. mhomed,tombstone with different ip(s), unchecked
7681 .line = __location__,
7682 .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL),
7683 .wins = {
7684 .nb_flags = NBT_NM_GROUP,
7685 .mhomed = false,
7686 .num_ips = ctx->addresses_best_num,
7687 .ips = ctx->addresses_best,
7688 .apply_expected = true
7690 .defend = {
7691 .timeout = 0,
7693 .replica= {
7694 .type = WREPL_TYPE_MHOMED,
7695 .state = WREPL_STATE_TOMBSTONE,
7696 .node = WREPL_NODE_B,
7697 .is_static = false,
7698 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7699 .ips = addresses_B_3_4,
7700 .apply_expected = false
7704 * special group vs. unique section
7707 * sgroup,active vs. unique,active with same ip(s), unchecked
7710 .line = __location__,
7711 .name = _NBT_NAME("_SA_UA_SI_U", 0x1C, NULL),
7712 .wins = {
7713 .nb_flags = NBT_NM_GROUP,
7714 .mhomed = false,
7715 .num_ips = ctx->addresses_best_num,
7716 .ips = ctx->addresses_best,
7717 .apply_expected = true
7719 .defend = {
7720 .timeout = 0,
7722 .replica= {
7723 .type = WREPL_TYPE_UNIQUE,
7724 .state = WREPL_STATE_ACTIVE,
7725 .node = WREPL_NODE_B,
7726 .is_static = false,
7727 .num_ips = ctx->addresses_best_num,
7728 .ips = ctx->addresses_best,
7729 .apply_expected = false
7733 * sgroup,active vs. unique,active with different ip(s), unchecked
7736 .line = __location__,
7737 .name = _NBT_NAME("_SA_UA_DI_U", 0x1C, NULL),
7738 .wins = {
7739 .nb_flags = NBT_NM_GROUP,
7740 .mhomed = false,
7741 .num_ips = ctx->addresses_best_num,
7742 .ips = ctx->addresses_best,
7743 .apply_expected = true
7745 .defend = {
7746 .timeout = 0,
7748 .replica= {
7749 .type = WREPL_TYPE_UNIQUE,
7750 .state = WREPL_STATE_ACTIVE,
7751 .node = WREPL_NODE_B,
7752 .is_static = false,
7753 .num_ips = ARRAY_SIZE(addresses_B_1),
7754 .ips = addresses_B_1,
7755 .apply_expected = false
7759 * sgroup,active vs. unique,tombstone with same ip(s), unchecked
7762 .line = __location__,
7763 .name = _NBT_NAME("_SA_UT_SI_U", 0x1C, NULL),
7764 .wins = {
7765 .nb_flags = NBT_NM_GROUP,
7766 .mhomed = false,
7767 .num_ips = ctx->addresses_best_num,
7768 .ips = ctx->addresses_best,
7769 .apply_expected = true
7771 .defend = {
7772 .timeout = 0,
7774 .replica= {
7775 .type = WREPL_TYPE_UNIQUE,
7776 .state = WREPL_STATE_TOMBSTONE,
7777 .node = WREPL_NODE_B,
7778 .is_static = false,
7779 .num_ips = ctx->addresses_best_num,
7780 .ips = ctx->addresses_best,
7781 .apply_expected = false
7785 * sgroup,active vs. unique,tombstone with different ip(s), unchecked
7788 .line = __location__,
7789 .name = _NBT_NAME("_SA_UT_DI_U", 0x1C, NULL),
7790 .wins = {
7791 .nb_flags = NBT_NM_GROUP,
7792 .mhomed = false,
7793 .num_ips = ctx->addresses_best_num,
7794 .ips = ctx->addresses_best,
7795 .apply_expected = true
7797 .defend = {
7798 .timeout = 0,
7800 .replica= {
7801 .type = WREPL_TYPE_UNIQUE,
7802 .state = WREPL_STATE_TOMBSTONE,
7803 .node = WREPL_NODE_B,
7804 .is_static = false,
7805 .num_ips = ARRAY_SIZE(addresses_B_1),
7806 .ips = addresses_B_1,
7807 .apply_expected = false
7811 * special group vs. normal group section
7814 * sgroup,active vs. group,active with same ip(s), unchecked
7817 .line = __location__,
7818 .name = _NBT_NAME("_SA_GA_SI_U", 0x1C, NULL),
7819 .wins = {
7820 .nb_flags = NBT_NM_GROUP,
7821 .mhomed = false,
7822 .num_ips = ctx->addresses_best_num,
7823 .ips = ctx->addresses_best,
7824 .apply_expected = true
7826 .defend = {
7827 .timeout = 0,
7829 .replica= {
7830 .type = WREPL_TYPE_GROUP,
7831 .state = WREPL_STATE_ACTIVE,
7832 .node = WREPL_NODE_B,
7833 .is_static = false,
7834 .num_ips = ctx->addresses_best_num,
7835 .ips = ctx->addresses_best,
7836 .apply_expected = false
7840 * sgroup,active vs. group,active with different ip(s), unchecked
7843 .line = __location__,
7844 .name = _NBT_NAME("_SA_GA_DI_U", 0x1C, NULL),
7845 .wins = {
7846 .nb_flags = NBT_NM_GROUP,
7847 .mhomed = false,
7848 .num_ips = ctx->addresses_best_num,
7849 .ips = ctx->addresses_best,
7850 .apply_expected = true
7852 .defend = {
7853 .timeout = 0,
7855 .replica= {
7856 .type = WREPL_TYPE_GROUP,
7857 .state = WREPL_STATE_ACTIVE,
7858 .node = WREPL_NODE_B,
7859 .is_static = false,
7860 .num_ips = ARRAY_SIZE(addresses_B_1),
7861 .ips = addresses_B_1,
7862 .apply_expected = false
7866 * sgroup,active vs. group,tombstone with same ip(s), unchecked
7869 .line = __location__,
7870 .name = _NBT_NAME("_SA_GT_SI_U", 0x1C, NULL),
7871 .wins = {
7872 .nb_flags = NBT_NM_GROUP,
7873 .mhomed = false,
7874 .num_ips = ctx->addresses_best_num,
7875 .ips = ctx->addresses_best,
7876 .apply_expected = true
7878 .defend = {
7879 .timeout = 0,
7881 .replica= {
7882 .type = WREPL_TYPE_GROUP,
7883 .state = WREPL_STATE_TOMBSTONE,
7884 .node = WREPL_NODE_B,
7885 .is_static = false,
7886 .num_ips = ctx->addresses_best_num,
7887 .ips = ctx->addresses_best,
7888 .apply_expected = false
7892 * sgroup,active vs. group,tombstone with different ip(s), unchecked
7895 .line = __location__,
7896 .name = _NBT_NAME("_SA_GT_DI_U", 0x1C, NULL),
7897 .wins = {
7898 .nb_flags = NBT_NM_GROUP,
7899 .mhomed = false,
7900 .num_ips = ctx->addresses_best_num,
7901 .ips = ctx->addresses_best,
7902 .apply_expected = true
7904 .defend = {
7905 .timeout = 0,
7907 .replica= {
7908 .type = WREPL_TYPE_GROUP,
7909 .state = WREPL_STATE_TOMBSTONE,
7910 .node = WREPL_NODE_B,
7911 .is_static = false,
7912 .num_ips = ARRAY_SIZE(addresses_B_1),
7913 .ips = addresses_B_1,
7914 .apply_expected = false
7918 * special group vs. multi homed section
7921 * sgroup,active vs. mhomed,active with same ip(s), unchecked
7924 .line = __location__,
7925 .name = _NBT_NAME("_SA_MA_SI_U", 0x1C, NULL),
7926 .wins = {
7927 .nb_flags = NBT_NM_GROUP,
7928 .mhomed = false,
7929 .num_ips = ctx->addresses_best_num,
7930 .ips = ctx->addresses_best,
7931 .apply_expected = true
7933 .defend = {
7934 .timeout = 0,
7936 .replica= {
7937 .type = WREPL_TYPE_MHOMED,
7938 .state = WREPL_STATE_ACTIVE,
7939 .node = WREPL_NODE_B,
7940 .is_static = false,
7941 .num_ips = ctx->addresses_best_num,
7942 .ips = ctx->addresses_best,
7943 .apply_expected = false
7947 * sgroup,active vs. mhomed,active with different ip(s), unchecked
7950 .line = __location__,
7951 .name = _NBT_NAME("_SA_MA_DI_U", 0x1C, NULL),
7952 .wins = {
7953 .nb_flags = NBT_NM_GROUP,
7954 .mhomed = false,
7955 .num_ips = ctx->addresses_best_num,
7956 .ips = ctx->addresses_best,
7957 .apply_expected = true
7959 .defend = {
7960 .timeout = 0,
7962 .replica= {
7963 .type = WREPL_TYPE_MHOMED,
7964 .state = WREPL_STATE_ACTIVE,
7965 .node = WREPL_NODE_B,
7966 .is_static = false,
7967 .num_ips = ARRAY_SIZE(addresses_B_1),
7968 .ips = addresses_B_1,
7969 .apply_expected = false
7973 * sgroup,active vs. mhomed,tombstone with same ip(s), unchecked
7976 .line = __location__,
7977 .name = _NBT_NAME("_SA_MT_SI_U", 0x1C, NULL),
7978 .wins = {
7979 .nb_flags = NBT_NM_GROUP,
7980 .mhomed = false,
7981 .num_ips = ctx->addresses_best_num,
7982 .ips = ctx->addresses_best,
7983 .apply_expected = true
7985 .defend = {
7986 .timeout = 0,
7988 .replica= {
7989 .type = WREPL_TYPE_MHOMED,
7990 .state = WREPL_STATE_TOMBSTONE,
7991 .node = WREPL_NODE_B,
7992 .is_static = false,
7993 .num_ips = ctx->addresses_best_num,
7994 .ips = ctx->addresses_best,
7995 .apply_expected = false
7999 * sgroup,active vs. mhomed,tombstone with different ip(s), unchecked
8002 .line = __location__,
8003 .name = _NBT_NAME("_SA_MT_DI_U", 0x1C, NULL),
8004 .wins = {
8005 .nb_flags = NBT_NM_GROUP,
8006 .mhomed = false,
8007 .num_ips = ctx->addresses_best_num,
8008 .ips = ctx->addresses_best,
8009 .apply_expected = true
8011 .defend = {
8012 .timeout = 0,
8014 .replica= {
8015 .type = WREPL_TYPE_MHOMED,
8016 .state = WREPL_STATE_TOMBSTONE,
8017 .node = WREPL_NODE_B,
8018 .is_static = false,
8019 .num_ips = ARRAY_SIZE(addresses_B_1),
8020 .ips = addresses_B_1,
8021 .apply_expected = false
8025 * multi homed vs. unique section
8028 * mhomed,active vs. unique,active with same ip(s), unchecked
8031 .line = __location__,
8032 .name = _NBT_NAME("_MA_UA_SI_U", 0x00, NULL),
8033 .wins = {
8034 .nb_flags = 0,
8035 .mhomed = true,
8036 .num_ips = ctx->addresses_best_num,
8037 .ips = ctx->addresses_best,
8038 .apply_expected = true
8040 .defend = {
8041 .timeout = 0,
8043 .replica= {
8044 .type = WREPL_TYPE_UNIQUE,
8045 .state = WREPL_STATE_ACTIVE,
8046 .node = WREPL_NODE_B,
8047 .is_static = false,
8048 .num_ips = ctx->addresses_best_num,
8049 .ips = ctx->addresses_best,
8050 .apply_expected = true
8054 * mhomed,active vs. unique,active with different ip(s), positive response
8057 .line = __location__,
8058 .name = _NBT_NAME("_MA_UA_DI_P", 0x00, NULL),
8059 .wins = {
8060 .nb_flags = 0,
8061 .mhomed = true,
8062 .num_ips = ctx->addresses_best_num,
8063 .ips = ctx->addresses_best,
8064 .apply_expected = true
8066 .defend = {
8067 .timeout = 10,
8068 .positive = true,
8070 .replica= {
8071 .type = WREPL_TYPE_UNIQUE,
8072 .state = WREPL_STATE_ACTIVE,
8073 .node = WREPL_NODE_B,
8074 .is_static = false,
8075 .num_ips = ARRAY_SIZE(addresses_B_1),
8076 .ips = addresses_B_1,
8077 .apply_expected = false
8081 * mhomed,active vs. unique,active with different ip(s), positive response other ips
8084 .line = __location__,
8085 .name = _NBT_NAME("_MA_UA_DI_O", 0x00, NULL),
8086 .wins = {
8087 .nb_flags = 0,
8088 .mhomed = true,
8089 .num_ips = ctx->addresses_best_num,
8090 .ips = ctx->addresses_best,
8091 .apply_expected = true
8093 .defend = {
8094 .timeout = 10,
8095 .positive = true,
8096 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8097 .ips = addresses_A_3_4,
8099 .replica= {
8100 .type = WREPL_TYPE_UNIQUE,
8101 .state = WREPL_STATE_ACTIVE,
8102 .node = WREPL_NODE_B,
8103 .is_static = false,
8104 .num_ips = ARRAY_SIZE(addresses_B_1),
8105 .ips = addresses_B_1,
8106 .apply_expected = false
8110 * mhomed,active vs. unique,active with different ip(s), negative response
8113 .line = __location__,
8114 .name = _NBT_NAME("_MA_UA_DI_N", 0x00, NULL),
8115 .wins = {
8116 .nb_flags = 0,
8117 .mhomed = true,
8118 .num_ips = ctx->addresses_best_num,
8119 .ips = ctx->addresses_best,
8120 .apply_expected = true
8122 .defend = {
8123 .timeout = 10,
8124 .positive = false,
8126 .replica= {
8127 .type = WREPL_TYPE_UNIQUE,
8128 .state = WREPL_STATE_ACTIVE,
8129 .node = WREPL_NODE_B,
8130 .is_static = false,
8131 .num_ips = ARRAY_SIZE(addresses_B_1),
8132 .ips = addresses_B_1,
8133 .apply_expected = true
8137 * mhomed,active vs. unique,tombstone with same ip(s), unchecked
8140 .line = __location__,
8141 .name = _NBT_NAME("_MA_UT_SI_U", 0x00, NULL),
8142 .wins = {
8143 .nb_flags = 0,
8144 .mhomed = true,
8145 .num_ips = ctx->addresses_best_num,
8146 .ips = ctx->addresses_best,
8147 .apply_expected = true
8149 .defend = {
8150 .timeout = 0,
8152 .replica= {
8153 .type = WREPL_TYPE_UNIQUE,
8154 .state = WREPL_STATE_TOMBSTONE,
8155 .node = WREPL_NODE_B,
8156 .is_static = false,
8157 .num_ips = ctx->addresses_best_num,
8158 .ips = ctx->addresses_best,
8159 .apply_expected = false
8163 * mhomed,active vs. unique,tombstone with different ip(s), unchecked
8166 .line = __location__,
8167 .name = _NBT_NAME("_MA_UT_DI_U", 0x00, NULL),
8168 .wins = {
8169 .nb_flags = 0,
8170 .mhomed = true,
8171 .num_ips = ctx->addresses_best_num,
8172 .ips = ctx->addresses_best,
8173 .apply_expected = true
8175 .defend = {
8176 .timeout = 0,
8178 .replica= {
8179 .type = WREPL_TYPE_UNIQUE,
8180 .state = WREPL_STATE_TOMBSTONE,
8181 .node = WREPL_NODE_B,
8182 .is_static = false,
8183 .num_ips = ARRAY_SIZE(addresses_B_1),
8184 .ips = addresses_B_1,
8185 .apply_expected = false
8189 * multi homed vs. normal group section
8192 * mhomed,active vs. group,active with same ip(s), release expected
8195 .line = __location__,
8196 .name = _NBT_NAME("_MA_GA_SI_R", 0x00, NULL),
8197 .wins = {
8198 .nb_flags = 0,
8199 .mhomed = true,
8200 .num_ips = ctx->addresses_best_num,
8201 .ips = ctx->addresses_best,
8202 .apply_expected = true
8204 .defend = {
8205 .timeout = 10,
8206 .expect_release = true,
8208 .replica= {
8209 .type = WREPL_TYPE_GROUP,
8210 .state = WREPL_STATE_ACTIVE,
8211 .node = WREPL_NODE_B,
8212 .is_static = false,
8213 .num_ips = ctx->addresses_best_num,
8214 .ips = ctx->addresses_best,
8215 .apply_expected = true
8219 * mhomed,active vs. group,active with different ip(s), release expected
8222 .line = __location__,
8223 .name = _NBT_NAME("_MA_GA_DI_R", 0x00, NULL),
8224 .wins = {
8225 .nb_flags = 0,
8226 .mhomed = true,
8227 .num_ips = ctx->addresses_best_num,
8228 .ips = ctx->addresses_best,
8229 .apply_expected = true
8231 .defend = {
8232 .timeout = 10,
8233 .expect_release = true,
8235 .replica= {
8236 .type = WREPL_TYPE_GROUP,
8237 .state = WREPL_STATE_ACTIVE,
8238 .node = WREPL_NODE_B,
8239 .is_static = false,
8240 .num_ips = ARRAY_SIZE(addresses_B_1),
8241 .ips = addresses_B_1,
8242 .apply_expected = true
8246 * mhomed,active vs. group,tombstone with same ip(s), unchecked
8249 .line = __location__,
8250 .name = _NBT_NAME("_MA_GT_SI_U", 0x00, NULL),
8251 .wins = {
8252 .nb_flags = 0,
8253 .mhomed = true,
8254 .num_ips = ctx->addresses_best_num,
8255 .ips = ctx->addresses_best,
8256 .apply_expected = true
8258 .defend = {
8259 .timeout = 0,
8261 .replica= {
8262 .type = WREPL_TYPE_GROUP,
8263 .state = WREPL_STATE_TOMBSTONE,
8264 .node = WREPL_NODE_B,
8265 .is_static = false,
8266 .num_ips = ctx->addresses_best_num,
8267 .ips = ctx->addresses_best,
8268 .apply_expected = false
8272 * mhomed,active vs. group,tombstone with different ip(s), unchecked
8275 .line = __location__,
8276 .name = _NBT_NAME("_MA_GT_DI_U", 0x00, NULL),
8277 .wins = {
8278 .nb_flags = 0,
8279 .mhomed = true,
8280 .num_ips = ctx->addresses_best_num,
8281 .ips = ctx->addresses_best,
8282 .apply_expected = true
8284 .defend = {
8285 .timeout = 0,
8287 .replica= {
8288 .type = WREPL_TYPE_GROUP,
8289 .state = WREPL_STATE_TOMBSTONE,
8290 .node = WREPL_NODE_B,
8291 .is_static = false,
8292 .num_ips = ARRAY_SIZE(addresses_B_1),
8293 .ips = addresses_B_1,
8294 .apply_expected = false
8298 * multi homed vs. special group section
8301 * mhomed,active vs. sgroup,active with same ip(s), release expected
8304 .line = __location__,
8305 .name = _NBT_NAME("_MA_SA_SI_R", 0x00, NULL),
8306 .wins = {
8307 .nb_flags = 0,
8308 .mhomed = true,
8309 .num_ips = ctx->addresses_best_num,
8310 .ips = ctx->addresses_best,
8311 .apply_expected = true
8313 .defend = {
8314 .timeout = 10,
8315 .expect_release = true,
8317 .replica= {
8318 .type = WREPL_TYPE_SGROUP,
8319 .state = WREPL_STATE_ACTIVE,
8320 .node = WREPL_NODE_B,
8321 .is_static = false,
8322 .num_ips = ctx->addresses_best_num,
8323 .ips = ctx->addresses_best,
8324 .apply_expected = true
8328 * mhomed,active vs. group,active with different ip(s), release expected
8331 .line = __location__,
8332 .name = _NBT_NAME("_MA_SA_DI_R", 0x00, NULL),
8333 .wins = {
8334 .nb_flags = 0,
8335 .mhomed = true,
8336 .num_ips = ctx->addresses_best_num,
8337 .ips = ctx->addresses_best,
8338 .apply_expected = true
8340 .defend = {
8341 .timeout = 10,
8342 .expect_release = true,
8344 .replica= {
8345 .type = WREPL_TYPE_SGROUP,
8346 .state = WREPL_STATE_ACTIVE,
8347 .node = WREPL_NODE_B,
8348 .is_static = false,
8349 .num_ips = ARRAY_SIZE(addresses_B_1),
8350 .ips = addresses_B_1,
8351 .apply_expected = true
8355 * mhomed,active vs. sgroup,tombstone with same ip(s), unchecked
8358 .line = __location__,
8359 .name = _NBT_NAME("_MA_ST_SI_U", 0x00, NULL),
8360 .wins = {
8361 .nb_flags = 0,
8362 .mhomed = true,
8363 .num_ips = ctx->addresses_best_num,
8364 .ips = ctx->addresses_best,
8365 .apply_expected = true
8367 .defend = {
8368 .timeout = 0,
8370 .replica= {
8371 .type = WREPL_TYPE_SGROUP,
8372 .state = WREPL_STATE_TOMBSTONE,
8373 .node = WREPL_NODE_B,
8374 .is_static = false,
8375 .num_ips = ctx->addresses_best_num,
8376 .ips = ctx->addresses_best,
8377 .apply_expected = false
8381 * mhomed,active vs. sgroup,tombstone with different ip(s), unchecked
8384 .line = __location__,
8385 .name = _NBT_NAME("_MA_ST_DI_U", 0x00, NULL),
8386 .wins = {
8387 .nb_flags = 0,
8388 .mhomed = true,
8389 .num_ips = ctx->addresses_best_num,
8390 .ips = ctx->addresses_best,
8391 .apply_expected = true
8393 .defend = {
8394 .timeout = 0,
8396 .replica= {
8397 .type = WREPL_TYPE_SGROUP,
8398 .state = WREPL_STATE_TOMBSTONE,
8399 .node = WREPL_NODE_B,
8400 .is_static = false,
8401 .num_ips = ARRAY_SIZE(addresses_B_1),
8402 .ips = addresses_B_1,
8403 .apply_expected = false
8407 * multi homed vs. multi homed section
8410 * mhomed,active vs. mhomed,active with same ip(s), unchecked
8413 .line = __location__,
8414 .name = _NBT_NAME("_MA_MA_SI_U", 0x00, NULL),
8415 .wins = {
8416 .nb_flags = 0,
8417 .mhomed = true,
8418 .num_ips = ctx->addresses_best_num,
8419 .ips = ctx->addresses_best,
8420 .apply_expected = true
8422 .defend = {
8423 .timeout = 0,
8425 .replica= {
8426 .type = WREPL_TYPE_MHOMED,
8427 .state = WREPL_STATE_ACTIVE,
8428 .node = WREPL_NODE_B,
8429 .is_static = false,
8430 .num_ips = ctx->addresses_best_num,
8431 .ips = ctx->addresses_best,
8432 .apply_expected = true
8436 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8439 .line = __location__,
8440 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8441 .wins = {
8442 .nb_flags = 0,
8443 .mhomed = true,
8444 .num_ips = ctx->addresses_best_num,
8445 .ips = ctx->addresses_best,
8446 .apply_expected = true
8448 .defend = {
8449 .timeout = 0,
8451 .replica= {
8452 .type = WREPL_TYPE_MHOMED,
8453 .state = WREPL_STATE_ACTIVE,
8454 .node = WREPL_NODE_B,
8455 .is_static = false,
8456 .num_ips = ctx->addresses_all_num,
8457 .ips = ctx->addresses_all,
8458 .apply_expected = true
8462 * mhomed,active vs. mhomed,active with different ip(s), positive response
8465 .line = __location__,
8466 .name = _NBT_NAME("_MA_MA_DI_P", 0x00, NULL),
8467 .wins = {
8468 .nb_flags = 0,
8469 .mhomed = true,
8470 .num_ips = ctx->addresses_best_num,
8471 .ips = ctx->addresses_best,
8472 .apply_expected = true
8474 .defend = {
8475 .timeout = 10,
8476 .positive = true,
8478 .replica= {
8479 .type = WREPL_TYPE_MHOMED,
8480 .state = WREPL_STATE_ACTIVE,
8481 .node = WREPL_NODE_B,
8482 .is_static = false,
8483 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8484 .ips = addresses_B_3_4,
8485 .apply_expected = false
8489 * mhomed,active vs. mhomed,active with different ip(s), positive response other ips
8492 .line = __location__,
8493 .name = _NBT_NAME("_MA_MA_DI_O", 0x00, NULL),
8494 .wins = {
8495 .nb_flags = 0,
8496 .mhomed = true,
8497 .num_ips = ctx->addresses_best_num,
8498 .ips = ctx->addresses_best,
8499 .apply_expected = true
8501 .defend = {
8502 .timeout = 10,
8503 .positive = true,
8504 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8505 .ips = addresses_A_3_4,
8507 .replica= {
8508 .type = WREPL_TYPE_MHOMED,
8509 .state = WREPL_STATE_ACTIVE,
8510 .node = WREPL_NODE_B,
8511 .is_static = false,
8512 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8513 .ips = addresses_B_3_4,
8514 .apply_expected = false
8518 * mhomed,active vs. mhomed,active with different ip(s), negative response
8521 .line = __location__,
8522 .name = _NBT_NAME("_MA_MA_DI_N", 0x00, NULL),
8523 .wins = {
8524 .nb_flags = 0,
8525 .mhomed = true,
8526 .num_ips = ctx->addresses_best_num,
8527 .ips = ctx->addresses_best,
8528 .apply_expected = true
8530 .defend = {
8531 .timeout = 10,
8532 .positive = false,
8534 .replica= {
8535 .type = WREPL_TYPE_MHOMED,
8536 .state = WREPL_STATE_ACTIVE,
8537 .node = WREPL_NODE_B,
8538 .is_static = false,
8539 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8540 .ips = addresses_B_3_4,
8541 .apply_expected = true
8545 * mhomed,active vs. mhomed,tombstone with same ip(s), unchecked
8548 .line = __location__,
8549 .name = _NBT_NAME("_MA_MT_SI_U", 0x00, NULL),
8550 .wins = {
8551 .nb_flags = 0,
8552 .mhomed = true,
8553 .num_ips = ctx->addresses_best_num,
8554 .ips = ctx->addresses_best,
8555 .apply_expected = true
8557 .defend = {
8558 .timeout = 0,
8560 .replica= {
8561 .type = WREPL_TYPE_MHOMED,
8562 .state = WREPL_STATE_TOMBSTONE,
8563 .node = WREPL_NODE_B,
8564 .is_static = false,
8565 .num_ips = ctx->addresses_best_num,
8566 .ips = ctx->addresses_best,
8567 .apply_expected = false
8571 * mhomed,active vs. mhomed,tombstone with different ip(s), unchecked
8574 .line = __location__,
8575 .name = _NBT_NAME("_MA_MT_DI_U", 0x00, NULL),
8576 .wins = {
8577 .nb_flags = 0,
8578 .mhomed = true,
8579 .num_ips = ctx->addresses_best_num,
8580 .ips = ctx->addresses_best,
8581 .apply_expected = true
8583 .defend = {
8584 .timeout = 0,
8586 .replica= {
8587 .type = WREPL_TYPE_MHOMED,
8588 .state = WREPL_STATE_TOMBSTONE,
8589 .node = WREPL_NODE_B,
8590 .is_static = false,
8591 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8592 .ips = addresses_B_3_4,
8593 .apply_expected = false
8597 * some more multi homed test, including merging
8600 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8603 .line = __location__,
8604 .section= "Test Replica vs. owned active: some more MHOMED combinations",
8605 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8606 .comment= "C:MHOMED vs. B:ALL => B:ALL",
8607 .skip = (ctx->addresses_all_num < 3),
8608 .wins = {
8609 .nb_flags = 0,
8610 .mhomed = true,
8611 .num_ips = ctx->addresses_mhomed_num,
8612 .ips = ctx->addresses_mhomed,
8613 .apply_expected = true
8615 .defend = {
8616 .timeout = 0,
8618 .replica= {
8619 .type = WREPL_TYPE_MHOMED,
8620 .state = WREPL_STATE_ACTIVE,
8621 .node = WREPL_NODE_B,
8622 .is_static = false,
8623 .num_ips = ctx->addresses_all_num,
8624 .ips = ctx->addresses_all,
8625 .apply_expected = true
8629 * mhomed,active vs. mhomed,active with same ips, unchecked
8632 .line = __location__,
8633 .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL),
8634 .comment= "C:MHOMED vs. B:MHOMED => B:MHOMED",
8635 .skip = (ctx->addresses_mhomed_num < 2),
8636 .wins = {
8637 .nb_flags = 0,
8638 .mhomed = true,
8639 .num_ips = ctx->addresses_mhomed_num,
8640 .ips = ctx->addresses_mhomed,
8641 .apply_expected = true
8643 .defend = {
8644 .timeout = 0,
8646 .replica= {
8647 .type = WREPL_TYPE_MHOMED,
8648 .state = WREPL_STATE_ACTIVE,
8649 .node = WREPL_NODE_B,
8650 .is_static = false,
8651 .num_ips = ctx->addresses_mhomed_num,
8652 .ips = ctx->addresses_mhomed,
8653 .apply_expected = true
8657 * mhomed,active vs. mhomed,active with subset ip(s), positive response
8660 .line = __location__,
8661 .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL),
8662 .comment= "C:MHOMED vs. B:BEST (C:MHOMED) => B:MHOMED",
8663 .skip = (ctx->addresses_mhomed_num < 2),
8664 .wins = {
8665 .nb_flags = 0,
8666 .mhomed = true,
8667 .num_ips = ctx->addresses_mhomed_num,
8668 .ips = ctx->addresses_mhomed,
8669 .apply_expected = true
8671 .defend = {
8672 .timeout = 10,
8673 .positive = true
8675 .replica= {
8676 .type = WREPL_TYPE_MHOMED,
8677 .state = WREPL_STATE_ACTIVE,
8678 .node = WREPL_NODE_B,
8679 .is_static = false,
8680 .num_ips = ctx->addresses_best_num,
8681 .ips = ctx->addresses_best,
8682 .mhomed_merge = true
8686 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with all addresses
8689 .line = __location__,
8690 .name = _NBT_NAME("_MA_MA_SB_A", 0x00, NULL),
8691 .comment= "C:MHOMED vs. B:BEST (C:ALL) => B:MHOMED",
8692 .skip = (ctx->addresses_all_num < 3),
8693 .wins = {
8694 .nb_flags = 0,
8695 .mhomed = true,
8696 .num_ips = ctx->addresses_mhomed_num,
8697 .ips = ctx->addresses_mhomed,
8698 .apply_expected = true
8700 .defend = {
8701 .timeout = 10,
8702 .positive = true,
8703 .num_ips = ctx->addresses_all_num,
8704 .ips = ctx->addresses_all,
8706 .replica= {
8707 .type = WREPL_TYPE_MHOMED,
8708 .state = WREPL_STATE_ACTIVE,
8709 .node = WREPL_NODE_B,
8710 .is_static = false,
8711 .num_ips = ctx->addresses_best_num,
8712 .ips = ctx->addresses_best,
8713 .mhomed_merge = true
8717 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with replicas addresses
8718 * TODO: check why the server sends a name release demand for one address?
8719 * the release demand has no effect to the database record...
8722 .line = __location__,
8723 .name = _NBT_NAME("_MA_MA_SB_PRA", 0x00, NULL),
8724 .comment= "C:MHOMED vs. B:BEST (C:BEST) => C:MHOMED",
8725 .skip = (ctx->addresses_all_num < 2),
8726 .wins = {
8727 .nb_flags = 0,
8728 .mhomed = true,
8729 .num_ips = ctx->addresses_mhomed_num,
8730 .ips = ctx->addresses_mhomed,
8731 .apply_expected = true
8733 .defend = {
8734 .timeout = 10,
8735 .positive = true,
8736 .num_ips = ctx->addresses_best_num,
8737 .ips = ctx->addresses_best,
8738 .late_release = true
8740 .replica= {
8741 .type = WREPL_TYPE_MHOMED,
8742 .state = WREPL_STATE_ACTIVE,
8743 .node = WREPL_NODE_B,
8744 .is_static = false,
8745 .num_ips = ctx->addresses_best_num,
8746 .ips = ctx->addresses_best,
8747 .apply_expected = false
8751 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with other addresses
8754 .line = __location__,
8755 .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL),
8756 .comment= "C:MHOMED vs. B:BEST (B:B_3_4) =>C:MHOMED",
8757 .skip = (ctx->addresses_all_num < 2),
8758 .wins = {
8759 .nb_flags = 0,
8760 .mhomed = true,
8761 .num_ips = ctx->addresses_mhomed_num,
8762 .ips = ctx->addresses_mhomed,
8763 .apply_expected = true
8765 .defend = {
8766 .timeout = 10,
8767 .positive = true,
8768 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8769 .ips = addresses_B_3_4,
8771 .replica= {
8772 .type = WREPL_TYPE_MHOMED,
8773 .state = WREPL_STATE_ACTIVE,
8774 .node = WREPL_NODE_B,
8775 .is_static = false,
8776 .num_ips = ctx->addresses_best_num,
8777 .ips = ctx->addresses_best,
8778 .apply_expected = false
8782 * mhomed,active vs. mhomed,active with subset ip(s), negative response
8785 .line = __location__,
8786 .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL),
8787 .comment= "C:MHOMED vs. B:BEST (NEGATIVE) => B:BEST",
8788 .skip = (ctx->addresses_mhomed_num < 2),
8789 .wins = {
8790 .nb_flags = 0,
8791 .mhomed = true,
8792 .num_ips = ctx->addresses_mhomed_num,
8793 .ips = ctx->addresses_mhomed,
8794 .apply_expected = true
8796 .defend = {
8797 .timeout = 10,
8798 .positive = false
8800 .replica= {
8801 .type = WREPL_TYPE_MHOMED,
8802 .state = WREPL_STATE_ACTIVE,
8803 .node = WREPL_NODE_B,
8804 .is_static = false,
8805 .num_ips = ctx->addresses_best_num,
8806 .ips = ctx->addresses_best,
8807 .apply_expected = true
8811 * some more multi homed and unique test, including merging
8814 * mhomed,active vs. unique,active with subset ip(s), positive response
8817 .line = __location__,
8818 .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations",
8819 .name = _NBT_NAME("_MA_UA_SB_P", 0x00, NULL),
8820 .comment= "C:MHOMED vs. B:UNIQUE,BEST (C:MHOMED) => B:MHOMED",
8821 .skip = (ctx->addresses_all_num < 2),
8822 .wins = {
8823 .nb_flags = 0,
8824 .mhomed = true,
8825 .num_ips = ctx->addresses_mhomed_num,
8826 .ips = ctx->addresses_mhomed,
8827 .apply_expected = true
8829 .defend = {
8830 .timeout = 10,
8831 .positive = true,
8833 .replica= {
8834 .type = WREPL_TYPE_UNIQUE,
8835 .state = WREPL_STATE_ACTIVE,
8836 .node = WREPL_NODE_B,
8837 .is_static = false,
8838 .num_ips = ctx->addresses_best_num,
8839 .ips = ctx->addresses_best,
8840 .mhomed_merge = true
8844 * unique,active vs. unique,active with different ip(s), positive response, with replicas address
8845 * TODO: check why the server sends a name release demand for one address?
8846 * the release demand has no effect to the database record...
8849 .line = __location__,
8850 .name = _NBT_NAME("_UA_UA_DI_PRA", 0x00, NULL),
8851 .comment= "C:BEST vs. B:BEST2 (C:BEST2,LR:BEST2) => C:BEST",
8852 .skip = (ctx->addresses_all_num < 2),
8853 .wins = {
8854 .nb_flags = 0,
8855 .mhomed = false,
8856 .num_ips = ctx->addresses_best_num,
8857 .ips = ctx->addresses_best,
8858 .apply_expected = true
8860 .defend = {
8861 .timeout = 10,
8862 .positive = true,
8863 .num_ips = ctx->addresses_best2_num,
8864 .ips = ctx->addresses_best2,
8865 .late_release = true
8867 .replica= {
8868 .type = WREPL_TYPE_UNIQUE,
8869 .state = WREPL_STATE_ACTIVE,
8870 .node = WREPL_NODE_B,
8871 .is_static = false,
8872 .num_ips = ctx->addresses_best2_num,
8873 .ips = ctx->addresses_best2,
8874 .apply_expected = false,
8878 * unique,active vs. unique,active with different ip(s), positive response, with all addresses
8881 .line = __location__,
8882 .name = _NBT_NAME("_UA_UA_DI_A", 0x00, NULL),
8883 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
8884 .skip = (ctx->addresses_all_num < 3),
8885 .wins = {
8886 .nb_flags = 0,
8887 .mhomed = false,
8888 .num_ips = ctx->addresses_best_num,
8889 .ips = ctx->addresses_best,
8890 .apply_expected = true
8892 .defend = {
8893 .timeout = 10,
8894 .positive = true,
8895 .num_ips = ctx->addresses_all_num,
8896 .ips = ctx->addresses_all,
8898 .replica= {
8899 .type = WREPL_TYPE_UNIQUE,
8900 .state = WREPL_STATE_ACTIVE,
8901 .node = WREPL_NODE_B,
8902 .is_static = false,
8903 .num_ips = ctx->addresses_best2_num,
8904 .ips = ctx->addresses_best2,
8905 .mhomed_merge = true,
8909 * unique,active vs. mhomed,active with different ip(s), positive response, with all addresses
8912 .line = __location__,
8913 .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL),
8914 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
8915 .skip = (ctx->addresses_all_num < 3),
8916 .wins = {
8917 .nb_flags = 0,
8918 .mhomed = false,
8919 .num_ips = ctx->addresses_best_num,
8920 .ips = ctx->addresses_best,
8921 .apply_expected = true
8923 .defend = {
8924 .timeout = 10,
8925 .positive = true,
8926 .num_ips = ctx->addresses_all_num,
8927 .ips = ctx->addresses_all,
8929 .replica= {
8930 .type = WREPL_TYPE_MHOMED,
8931 .state = WREPL_STATE_ACTIVE,
8932 .node = WREPL_NODE_B,
8933 .is_static = false,
8934 .num_ips = ctx->addresses_best2_num,
8935 .ips = ctx->addresses_best2,
8936 .mhomed_merge = true,
8940 * special group vs. special group merging section
8943 * sgroup,active vs. sgroup,active with different ip(s)
8946 .line = __location__,
8947 .section= "Test Replica vs. owned active: SGROUP vs. SGROUP tests",
8948 .name = _NBT_NAME("_SA_SA_DI_U", 0x1C, NULL),
8949 .skip = (ctx->addresses_all_num < 3),
8950 .wins = {
8951 .nb_flags = NBT_NM_GROUP,
8952 .mhomed = false,
8953 .num_ips = ctx->addresses_mhomed_num,
8954 .ips = ctx->addresses_mhomed,
8955 .apply_expected = true
8957 .defend = {
8958 .timeout = 0,
8960 .replica= {
8961 .type = WREPL_TYPE_SGROUP,
8962 .state = WREPL_STATE_ACTIVE,
8963 .node = WREPL_NODE_B,
8964 .is_static = false,
8965 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8966 .ips = addresses_B_3_4,
8967 .sgroup_merge = true
8971 * sgroup,active vs. sgroup,active with same ip(s)
8974 .line = __location__,
8975 .name = _NBT_NAME("_SA_SA_SI_U", 0x1C, NULL),
8976 .skip = (ctx->addresses_all_num < 3),
8977 .wins = {
8978 .nb_flags = NBT_NM_GROUP,
8979 .mhomed = false,
8980 .num_ips = ctx->addresses_mhomed_num,
8981 .ips = ctx->addresses_mhomed,
8982 .apply_expected = true
8984 .defend = {
8985 .timeout = 0,
8987 .replica= {
8988 .type = WREPL_TYPE_SGROUP,
8989 .state = WREPL_STATE_ACTIVE,
8990 .node = WREPL_NODE_B,
8991 .is_static = false,
8992 .num_ips = ctx->addresses_mhomed_num,
8993 .ips = ctx->addresses_mhomed,
8994 .sgroup_merge = true
8998 * sgroup,active vs. sgroup,active with superset ip(s)
9001 .line = __location__,
9002 .name = _NBT_NAME("_SA_SA_SP_U", 0x1C, NULL),
9003 .skip = (ctx->addresses_all_num < 3),
9004 .wins = {
9005 .nb_flags = NBT_NM_GROUP,
9006 .mhomed = false,
9007 .num_ips = ctx->addresses_mhomed_num,
9008 .ips = ctx->addresses_mhomed,
9009 .apply_expected = true
9011 .defend = {
9012 .timeout = 0,
9014 .replica= {
9015 .type = WREPL_TYPE_SGROUP,
9016 .state = WREPL_STATE_ACTIVE,
9017 .node = WREPL_NODE_B,
9018 .is_static = false,
9019 .num_ips = ctx->addresses_all_num,
9020 .ips = ctx->addresses_all,
9021 .sgroup_merge = true
9025 * sgroup,active vs. sgroup,active with subset ip(s)
9028 .line = __location__,
9029 .name = _NBT_NAME("_SA_SA_SB_U", 0x1C, NULL),
9030 .skip = (ctx->addresses_all_num < 3),
9031 .wins = {
9032 .nb_flags = NBT_NM_GROUP,
9033 .mhomed = false,
9034 .num_ips = ctx->addresses_mhomed_num,
9035 .ips = ctx->addresses_mhomed,
9036 .apply_expected = true
9038 .defend = {
9039 .timeout = 0,
9041 .replica= {
9042 .type = WREPL_TYPE_SGROUP,
9043 .state = WREPL_STATE_ACTIVE,
9044 .node = WREPL_NODE_B,
9045 .is_static = false,
9046 .num_ips = ctx->addresses_best_num,
9047 .ips = ctx->addresses_best,
9048 .sgroup_merge = true
9052 * sgroup,active vs. sgroup,tombstone with different ip(s)
9055 .line = __location__,
9056 .name = _NBT_NAME("_SA_ST_DI_U", 0x1C, NULL),
9057 .skip = (ctx->addresses_all_num < 3),
9058 .wins = {
9059 .nb_flags = NBT_NM_GROUP,
9060 .mhomed = false,
9061 .num_ips = ctx->addresses_mhomed_num,
9062 .ips = ctx->addresses_mhomed,
9063 .apply_expected = true
9065 .defend = {
9066 .timeout = 0,
9068 .replica= {
9069 .type = WREPL_TYPE_SGROUP,
9070 .state = WREPL_STATE_TOMBSTONE,
9071 .node = WREPL_NODE_B,
9072 .is_static = false,
9073 .num_ips = ARRAY_SIZE(addresses_B_3_4),
9074 .ips = addresses_B_3_4,
9075 .apply_expected = false
9079 * sgroup,active vs. sgroup,tombstone with same ip(s)
9082 .line = __location__,
9083 .name = _NBT_NAME("_SA_ST_SI_U", 0x1C, NULL),
9084 .skip = (ctx->addresses_all_num < 3),
9085 .wins = {
9086 .nb_flags = NBT_NM_GROUP,
9087 .mhomed = false,
9088 .num_ips = ctx->addresses_mhomed_num,
9089 .ips = ctx->addresses_mhomed,
9090 .apply_expected = true
9092 .defend = {
9093 .timeout = 0,
9095 .replica= {
9096 .type = WREPL_TYPE_SGROUP,
9097 .state = WREPL_STATE_TOMBSTONE,
9098 .node = WREPL_NODE_B,
9099 .is_static = false,
9100 .num_ips = ctx->addresses_mhomed_num,
9101 .ips = ctx->addresses_mhomed,
9102 .apply_expected = false
9106 * sgroup,active vs. sgroup,tombstone with superset ip(s)
9109 .line = __location__,
9110 .name = _NBT_NAME("_SA_ST_SP_U", 0x1C, NULL),
9111 .skip = (ctx->addresses_all_num < 3),
9112 .wins = {
9113 .nb_flags = NBT_NM_GROUP,
9114 .mhomed = false,
9115 .num_ips = ctx->addresses_mhomed_num,
9116 .ips = ctx->addresses_mhomed,
9117 .apply_expected = true
9119 .defend = {
9120 .timeout = 0,
9122 .replica= {
9123 .type = WREPL_TYPE_SGROUP,
9124 .state = WREPL_STATE_TOMBSTONE,
9125 .node = WREPL_NODE_B,
9126 .is_static = false,
9127 .num_ips = ctx->addresses_all_num,
9128 .ips = ctx->addresses_all,
9129 .apply_expected = false
9133 * sgroup,active vs. sgroup,tombstone with subset ip(s)
9136 .line = __location__,
9137 .name = _NBT_NAME("_SA_ST_SB_U", 0x1C, NULL),
9138 .skip = (ctx->addresses_all_num < 3),
9139 .wins = {
9140 .nb_flags = NBT_NM_GROUP,
9141 .mhomed = false,
9142 .num_ips = ctx->addresses_mhomed_num,
9143 .ips = ctx->addresses_mhomed,
9144 .apply_expected = true
9146 .defend = {
9147 .timeout = 0,
9149 .replica= {
9150 .type = WREPL_TYPE_SGROUP,
9151 .state = WREPL_STATE_TOMBSTONE,
9152 .node = WREPL_NODE_B,
9153 .is_static = false,
9154 .num_ips = ctx->addresses_best_num,
9155 .ips = ctx->addresses_best,
9156 .apply_expected = false
9161 if (!ctx->nbtsock_srv) {
9162 torture_comment(tctx, "SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
9163 lp_nbt_port(tctx->lp_ctx));
9164 return true;
9167 torture_comment(tctx, "Test Replica records vs. owned active records\n");
9169 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
9170 struct timeval end;
9171 struct test_conflict_owned_active_vs_replica_struct record = records[i];
9172 uint32_t j, count = 1;
9173 const char *action;
9175 if (records[i].wins.mhomed || records[i].name.type == 0x1C) {
9176 count = records[i].wins.num_ips;
9179 if (records[i].section) {
9180 torture_comment(tctx, "%s\n", records[i].section);
9183 if (records[i].skip) {
9184 torture_comment(tctx, "%s => SKIPPED\n", nbt_name_string(ctx, &records[i].name));
9185 continue;
9188 if (records[i].replica.mhomed_merge) {
9189 action = "MHOMED_MERGE";
9190 } else if (records[i].replica.sgroup_merge) {
9191 action = "SGROUP_MERGE";
9192 } else if (records[i].replica.apply_expected) {
9193 action = "REPLACE";
9194 } else {
9195 action = "NOT REPLACE";
9198 torture_comment(tctx, "%s%s%s => %s\n",
9199 nbt_name_string(ctx, &records[i].name),
9200 (records[i].comment?": ":""),
9201 (records[i].comment?records[i].comment:""),
9202 action);
9204 /* Prepare for multi homed registration */
9205 ZERO_STRUCT(records[i].defend);
9206 records[i].defend.timeout = 10;
9207 records[i].defend.positive = true;
9208 nbt_set_incoming_handler(ctx->nbtsock_srv,
9209 test_conflict_owned_active_vs_replica_handler,
9210 &records[i]);
9211 if (ctx->nbtsock_srv2) {
9212 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9213 test_conflict_owned_active_vs_replica_handler,
9214 &records[i]);
9218 * Setup Register
9220 for (j=0; j < count; j++) {
9221 struct nbt_name_request *req;
9223 name_register->in.name = records[i].name;
9224 name_register->in.dest_addr = ctx->address;
9225 name_register->in.dest_port = lp_nbt_port(tctx->lp_ctx);
9226 name_register->in.address = records[i].wins.ips[j].ip;
9227 name_register->in.nb_flags = records[i].wins.nb_flags;
9228 name_register->in.register_demand= false;
9229 name_register->in.broadcast = false;
9230 name_register->in.multi_homed = records[i].wins.mhomed;
9231 name_register->in.ttl = 300000;
9232 name_register->in.timeout = 70;
9233 name_register->in.retries = 0;
9235 req = nbt_name_register_send(ctx->nbtsock, name_register);
9237 /* push the request on the wire */
9238 event_loop_once(ctx->nbtsock->event_ctx);
9241 * if we register multiple addresses,
9242 * the server will do name queries to see if the old addresses
9243 * are still alive
9245 if (records[i].wins.mhomed && j > 0) {
9246 end = timeval_current_ofs(records[i].defend.timeout,0);
9247 records[i].defend.ret = true;
9248 while (records[i].defend.timeout > 0) {
9249 event_loop_once(ctx->nbtsock_srv->event_ctx);
9250 if (timeval_expired(&end)) break;
9252 ret &= records[i].defend.ret;
9255 status = nbt_name_register_recv(req, ctx, name_register);
9256 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9257 torture_comment(tctx, "No response from %s for name register\n", ctx->address);
9258 ret = false;
9260 if (!NT_STATUS_IS_OK(status)) {
9261 torture_comment(tctx, "Bad response from %s for name register - %s\n",
9262 ctx->address, nt_errstr(status));
9263 ret = false;
9265 CHECK_VALUE(tctx, name_register->out.rcode, 0);
9266 CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address);
9267 CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type);
9268 CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name);
9269 CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope);
9270 CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[j].ip);
9273 /* Prepare for the current test */
9274 records[i].defend = record.defend;
9275 nbt_set_incoming_handler(ctx->nbtsock_srv,
9276 test_conflict_owned_active_vs_replica_handler,
9277 &records[i]);
9278 if (ctx->nbtsock_srv2) {
9279 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9280 test_conflict_owned_active_vs_replica_handler,
9281 &records[i]);
9285 * Setup Replica
9287 wins_name->name = &records[i].name;
9288 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
9289 records[i].replica.state,
9290 records[i].replica.node,
9291 records[i].replica.is_static);
9292 wins_name->id = ++ctx->b.max_version;
9293 if (wins_name->flags & 2) {
9294 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
9295 wins_name->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
9296 records[i].replica.ips);
9297 } else {
9298 wins_name->addresses.ip = records[i].replica.ips[0].ip;
9300 wins_name->unknown = "255.255.255.255";
9302 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9305 * wait for the name query, which is handled in
9306 * test_conflict_owned_active_vs_replica_handler()
9308 end = timeval_current_ofs(records[i].defend.timeout,0);
9309 records[i].defend.ret = true;
9310 while (records[i].defend.timeout > 0) {
9311 event_loop_once(ctx->nbtsock_srv->event_ctx);
9312 if (timeval_expired(&end)) break;
9314 ret &= records[i].defend.ret;
9316 if (records[i].defend.late_release) {
9317 records[i].defend = record.defend;
9318 records[i].defend.expect_release = true;
9320 * wait for the name release demand, which is handled in
9321 * test_conflict_owned_active_vs_replica_handler()
9323 end = timeval_current_ofs(records[i].defend.timeout,0);
9324 records[i].defend.ret = true;
9325 while (records[i].defend.timeout > 0) {
9326 event_loop_once(ctx->nbtsock_srv->event_ctx);
9327 if (timeval_expired(&end)) break;
9329 ret &= records[i].defend.ret;
9332 if (records[i].replica.mhomed_merge) {
9333 ret &= test_wrepl_mhomed_merged(tctx, ctx, &ctx->c,
9334 records[i].wins.num_ips, records[i].wins.ips,
9335 &ctx->b,
9336 records[i].replica.num_ips, records[i].replica.ips,
9337 wins_name);
9338 } else if (records[i].replica.sgroup_merge) {
9339 ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL,
9340 &ctx->c,
9341 records[i].wins.num_ips, records[i].wins.ips,
9342 &ctx->b,
9343 records[i].replica.num_ips, records[i].replica.ips,
9344 wins_name);
9345 } else {
9346 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name,
9347 records[i].replica.apply_expected);
9350 if (records[i].replica.apply_expected ||
9351 records[i].replica.mhomed_merge) {
9352 wins_name->name = &records[i].name;
9353 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9354 WREPL_STATE_TOMBSTONE,
9355 WREPL_NODE_B, false);
9356 wins_name->id = ++ctx->b.max_version;
9357 wins_name->addresses.ip = addresses_B_1[0].ip;
9358 wins_name->unknown = "255.255.255.255";
9360 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9361 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9362 } else {
9363 for (j=0; j < count; j++) {
9364 struct nbt_name_socket *nbtsock = ctx->nbtsock;
9366 if (ctx->myaddr2 && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2->addr) == 0) {
9367 nbtsock = ctx->nbtsock2;
9370 release->in.name = records[i].name;
9371 release->in.dest_addr = ctx->address;
9372 release->in.dest_port = lp_nbt_port(tctx->lp_ctx);
9373 release->in.address = records[i].wins.ips[j].ip;
9374 release->in.nb_flags = records[i].wins.nb_flags;
9375 release->in.broadcast = false;
9376 release->in.timeout = 30;
9377 release->in.retries = 0;
9379 status = nbt_name_release(nbtsock, ctx, release);
9380 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9381 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
9382 return false;
9384 if (!NT_STATUS_IS_OK(status)) {
9385 torture_comment(tctx, "Bad response from %s for name query - %s\n",
9386 ctx->address, nt_errstr(status));
9387 return false;
9389 CHECK_VALUE(tctx, release->out.rcode, 0);
9392 if (records[i].replica.sgroup_merge) {
9393 /* clean up the SGROUP record */
9394 wins_name->name = &records[i].name;
9395 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9396 WREPL_STATE_ACTIVE,
9397 WREPL_NODE_B, false);
9398 wins_name->id = ++ctx->b.max_version;
9399 wins_name->addresses.addresses.num_ips = 0;
9400 wins_name->addresses.addresses.ips = NULL;
9401 wins_name->unknown = "255.255.255.255";
9402 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9404 /* take ownership of the SGROUP record */
9405 wins_name->name = &records[i].name;
9406 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9407 WREPL_STATE_ACTIVE,
9408 WREPL_NODE_B, false);
9409 wins_name->id = ++ctx->b.max_version;
9410 wins_name->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
9411 wins_name->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
9412 addresses_B_1);
9413 wins_name->unknown = "255.255.255.255";
9414 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9415 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9417 /* overwrite the SGROUP record with unique,tombstone */
9418 wins_name->name = &records[i].name;
9419 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9420 WREPL_STATE_TOMBSTONE,
9421 WREPL_NODE_B, false);
9422 wins_name->id = ++ctx->b.max_version;
9423 wins_name->addresses.ip = addresses_A_1[0].ip;
9424 wins_name->unknown = "255.255.255.255";
9425 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9426 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9430 if (!ret) {
9431 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
9432 return ret;
9436 return ret;
9439 #define _NBT_ASSERT(v, correct) do { \
9440 if ((v) != (correct)) { \
9441 printf("(%s) Incorrect value %s=%d - should be %s (%d)\n", \
9442 __location__, #v, v, #correct, correct); \
9443 return; \
9445 } while (0)
9447 #define _NBT_ASSERT_STRING(v, correct) do { \
9448 if ( ((!v) && (correct)) || \
9449 ((v) && (!correct)) || \
9450 ((v) && (correct) && strcmp(v,correct) != 0)) { \
9451 printf("(%s) Incorrect value %s=%s - should be %s\n", \
9452 __location__, #v, v, correct); \
9453 return; \
9455 } while (0)
9457 static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
9458 struct nbt_name_packet *req_packet,
9459 struct socket_address *src)
9461 struct nbt_name *name;
9462 struct nbt_name_packet *rep_packet;
9463 struct test_conflict_owned_active_vs_replica_struct *rec =
9464 (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
9466 _NBT_ASSERT(req_packet->qdcount, 1);
9467 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9468 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9470 name = &req_packet->questions[0].name;
9472 _NBT_ASSERT(name->type, rec->name.type);
9473 _NBT_ASSERT_STRING(name->name, rec->name.name);
9474 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9476 _NBT_ASSERT(rec->defend.expect_release, false);
9478 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9479 if (rep_packet == NULL) return;
9481 rep_packet->name_trn_id = req_packet->name_trn_id;
9482 rep_packet->ancount = 1;
9484 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9485 if (rep_packet->answers == NULL) return;
9487 rep_packet->answers[0].name = *name;
9488 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9489 rep_packet->answers[0].ttl = 0;
9491 if (rec->defend.positive) {
9492 uint32_t i, num_ips;
9493 const struct wrepl_ip *ips;
9495 if (rec->defend.num_ips > 0) {
9496 num_ips = rec->defend.num_ips;
9497 ips = rec->defend.ips;
9498 } else {
9499 num_ips = rec->wins.num_ips;
9500 ips = rec->wins.ips;
9503 /* send a positive reply */
9504 rep_packet->operation =
9505 NBT_FLAG_REPLY |
9506 NBT_OPCODE_QUERY |
9507 NBT_FLAG_AUTHORITIVE |
9508 NBT_FLAG_RECURSION_DESIRED |
9509 NBT_FLAG_RECURSION_AVAIL;
9511 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9513 rep_packet->answers[0].rdata.netbios.length = num_ips*6;
9514 rep_packet->answers[0].rdata.netbios.addresses =
9515 talloc_array(rep_packet->answers, struct nbt_rdata_address, num_ips);
9516 if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return;
9518 for (i=0; i < num_ips; i++) {
9519 struct nbt_rdata_address *addr =
9520 &rep_packet->answers[0].rdata.netbios.addresses[i];
9521 addr->nb_flags = rec->wins.nb_flags;
9522 addr->ipaddr = ips[i].ip;
9524 DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
9525 nbt_name_string(rep_packet, name), src->addr, src->port));
9526 } else {
9527 /* send a negative reply */
9528 rep_packet->operation =
9529 NBT_FLAG_REPLY |
9530 NBT_OPCODE_QUERY |
9531 NBT_FLAG_AUTHORITIVE |
9532 NBT_RCODE_NAM;
9534 rep_packet->answers[0].rr_type = NBT_QTYPE_NULL;
9536 ZERO_STRUCT(rep_packet->answers[0].rdata);
9538 DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
9539 nbt_name_string(rep_packet, name), src->addr, src->port));
9542 nbt_name_reply_send(nbtsock, src, rep_packet);
9543 talloc_free(rep_packet);
9545 /* make sure we push the reply to the wire */
9546 while (nbtsock->send_queue) {
9547 event_loop_once(nbtsock->event_ctx);
9549 msleep(1000);
9551 rec->defend.timeout = 0;
9552 rec->defend.ret = true;
9555 static void test_conflict_owned_active_vs_replica_handler_release(
9556 struct nbt_name_socket *nbtsock,
9557 struct nbt_name_packet *req_packet,
9558 struct socket_address *src)
9560 struct nbt_name *name;
9561 struct nbt_name_packet *rep_packet;
9562 struct test_conflict_owned_active_vs_replica_struct *rec =
9563 (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
9565 _NBT_ASSERT(req_packet->qdcount, 1);
9566 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9567 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9569 name = &req_packet->questions[0].name;
9571 _NBT_ASSERT(name->type, rec->name.type);
9572 _NBT_ASSERT_STRING(name->name, rec->name.name);
9573 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9575 _NBT_ASSERT(rec->defend.expect_release, true);
9577 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9578 if (rep_packet == NULL) return;
9580 rep_packet->name_trn_id = req_packet->name_trn_id;
9581 rep_packet->ancount = 1;
9582 rep_packet->operation =
9583 NBT_FLAG_REPLY |
9584 NBT_OPCODE_RELEASE |
9585 NBT_FLAG_AUTHORITIVE;
9587 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9588 if (rep_packet->answers == NULL) return;
9590 rep_packet->answers[0].name = *name;
9591 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9592 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9593 rep_packet->answers[0].ttl = req_packet->additional[0].ttl;
9594 rep_packet->answers[0].rdata = req_packet->additional[0].rdata;
9596 DEBUG(2,("Sending name release reply for %s to %s:%d\n",
9597 nbt_name_string(rep_packet, name), src->addr, src->port));
9599 nbt_name_reply_send(nbtsock, src, rep_packet);
9600 talloc_free(rep_packet);
9602 /* make sure we push the reply to the wire */
9603 while (nbtsock->send_queue) {
9604 event_loop_once(nbtsock->event_ctx);
9606 msleep(1000);
9608 rec->defend.timeout = 0;
9609 rec->defend.ret = true;
9612 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
9613 struct nbt_name_packet *req_packet,
9614 struct socket_address *src)
9616 struct test_conflict_owned_active_vs_replica_struct *rec =
9617 (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
9619 rec->defend.ret = false;
9621 switch (req_packet->operation & NBT_OPCODE) {
9622 case NBT_OPCODE_QUERY:
9623 test_conflict_owned_active_vs_replica_handler_query(nbtsock, req_packet, src);
9624 break;
9625 case NBT_OPCODE_RELEASE:
9626 test_conflict_owned_active_vs_replica_handler_release(nbtsock, req_packet, src);
9627 break;
9628 default:
9629 printf("%s: unexpected incoming packet\n", __location__);
9630 return;
9635 test WINS replication replica conflicts operations
9637 static bool torture_nbt_winsreplication_replica(struct torture_context *tctx)
9639 bool ret = true;
9640 struct test_wrepl_conflict_conn *ctx;
9642 const char *address;
9643 struct nbt_name name;
9645 if (!torture_nbt_get_name(tctx, &name, &address))
9646 return false;
9648 ctx = test_create_conflict_ctx(tctx, address);
9649 if (!ctx) return false;
9651 ret &= test_conflict_same_owner(tctx, ctx);
9652 ret &= test_conflict_different_owner(tctx, ctx);
9654 return ret;
9658 test WINS replication owned conflicts operations
9660 static bool torture_nbt_winsreplication_owned(struct torture_context *tctx)
9662 const char *address;
9663 struct nbt_name name;
9664 bool ret = true;
9665 struct test_wrepl_conflict_conn *ctx;
9667 if (torture_setting_bool(tctx, "quick", false))
9668 torture_skip(tctx,
9669 "skip NBT-WINSREPLICATION-OWNED test in quick test mode\n");
9671 if (!torture_nbt_get_name(tctx, &name, &address))
9672 return false;
9674 ctx = test_create_conflict_ctx(tctx, address);
9675 torture_assert(tctx, ctx != NULL, "Creating context failed");
9677 ret &= test_conflict_owned_released_vs_replica(tctx, ctx);
9678 ret &= test_conflict_owned_active_vs_replica(tctx, ctx);
9680 return ret;
9684 test simple WINS replication operations
9686 struct torture_suite *torture_nbt_winsreplication(TALLOC_CTX *mem_ctx)
9688 struct torture_suite *suite = torture_suite_create(
9689 mem_ctx, "WINSREPLICATION");
9690 struct torture_tcase *tcase;
9692 tcase = torture_suite_add_simple_test(suite, "assoc_ctx1",
9693 test_assoc_ctx1);
9694 tcase->tests->dangerous = true;
9696 torture_suite_add_simple_test(suite, "assoc_ctx2",
9697 test_assoc_ctx2);
9699 torture_suite_add_simple_test(suite, "wins_replication",
9700 test_wins_replication);
9702 torture_suite_add_simple_test(suite, "replica",
9703 torture_nbt_winsreplication_replica);
9705 torture_suite_add_simple_test(suite, "owned",
9706 torture_nbt_winsreplication_owned);
9708 return suite;