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 2 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, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include "libcli/wrepl/winsrepl.h"
26 #include "lib/events/events.h"
27 #include "lib/socket/socket.h"
28 #include "libcli/resolve/resolve.h"
29 #include "system/network.h"
30 #include "netif/netif.h"
32 #define CHECK_STATUS(status, correct) do { \
33 if (!NT_STATUS_EQUAL(status, correct)) { \
34 printf("(%s) Incorrect status %s - should be %s\n", \
35 __location__, nt_errstr(status), nt_errstr(correct)); \
40 #define CHECK_VALUE(v, correct) do { \
41 if ((v) != (correct)) { \
42 printf("(%s) Incorrect value %s=%d - should be %d\n", \
43 __location__, #v, v, correct); \
48 #define CHECK_VALUE_UINT64(v, correct) do { \
49 if ((v) != (correct)) { \
50 printf("(%s) Incorrect value %s=%llu - should be %llu\n", \
51 __location__, #v, (long long)v, (long long)correct); \
56 #define CHECK_VALUE_STRING(v, correct) do { \
57 if ( ((!v) && (correct)) || \
58 ((v) && (!correct)) || \
59 ((v) && (correct) && strcmp(v,correct) != 0)) { \
60 printf("(%s) Incorrect value %s='%s' - should be '%s'\n", \
61 __location__, #v, v, correct); \
66 #define _NBT_NAME(n,t,s) {\
72 static const char *wrepl_name_type_string(enum wrepl_name_type type)
75 case WREPL_TYPE_UNIQUE: return "UNIQUE";
76 case WREPL_TYPE_GROUP: return "GROUP";
77 case WREPL_TYPE_SGROUP: return "SGROUP";
78 case WREPL_TYPE_MHOMED: return "MHOMED";
80 return "UNKNOWN_TYPE";
83 static const char *wrepl_name_state_string(enum wrepl_name_state state)
86 case WREPL_STATE_ACTIVE: return "ACTIVE";
87 case WREPL_STATE_RELEASED: return "RELEASED";
88 case WREPL_STATE_TOMBSTONE: return "TOMBSTONE";
89 case WREPL_STATE_RESERVED: return "RESERVED";
91 return "UNKNOWN_STATE";
95 test how assoc_ctx's are only usable on the connection
98 static BOOL test_assoc_ctx1(TALLOC_CTX *mem_ctx, const char *address)
101 struct wrepl_request *req;
102 struct wrepl_socket *wrepl_socket1;
103 struct wrepl_associate associate1;
104 struct wrepl_socket *wrepl_socket2;
105 struct wrepl_associate associate2;
106 struct wrepl_pull_table pull_table;
107 struct wrepl_packet packet;
108 struct wrepl_send_ctrl ctrl;
109 struct wrepl_packet *rep_packet;
110 struct wrepl_associate_stop assoc_stop;
113 if (!lp_parm_bool(-1, "torture", "dangerous", False)) {
114 printf("winsrepl: cross connection assoc_ctx usage disabled - enable dangerous tests to use\n");
118 printf("Test if assoc_ctx is only valid on the conection it was created on\n");
120 wrepl_socket1 = wrepl_socket_init(mem_ctx, NULL);
121 wrepl_socket2 = wrepl_socket_init(mem_ctx, NULL);
123 printf("Setup 2 wrepl connections\n");
124 status = wrepl_connect(wrepl_socket1, NULL, address);
125 CHECK_STATUS(status, NT_STATUS_OK);
127 status = wrepl_connect(wrepl_socket2, NULL, address);
128 CHECK_STATUS(status, NT_STATUS_OK);
130 printf("Send a start association request (conn1)\n");
131 status = wrepl_associate(wrepl_socket1, &associate1);
132 CHECK_STATUS(status, NT_STATUS_OK);
134 printf("association context (conn1): 0x%x\n", associate1.out.assoc_ctx);
136 printf("Send a start association request (conn2)\n");
137 status = wrepl_associate(wrepl_socket2, &associate2);
138 CHECK_STATUS(status, NT_STATUS_OK);
140 printf("association context (conn2): 0x%x\n", associate2.out.assoc_ctx);
142 printf("Send a replication table query, with assoc 1 (conn2), the anwser should be on conn1\n");
144 packet.opcode = WREPL_OPCODE_BITS;
145 packet.assoc_ctx = associate1.out.assoc_ctx;
146 packet.mess_type = WREPL_REPLICATION;
147 packet.message.replication.command = WREPL_REPL_TABLE_QUERY;
149 ctrl.send_only = True;
150 req = wrepl_request_send(wrepl_socket2, &packet, &ctrl);
151 status = wrepl_request_recv(req, mem_ctx, &rep_packet);
152 CHECK_STATUS(status, NT_STATUS_OK);
154 printf("Send a association request (conn2), to make sure the last request was ignored\n");
155 status = wrepl_associate(wrepl_socket2, &associate2);
156 CHECK_STATUS(status, NT_STATUS_OK);
158 printf("Send a replication table query, with invalid assoc (conn1), receive answer from conn2\n");
159 pull_table.in.assoc_ctx = 0;
160 req = wrepl_pull_table_send(wrepl_socket1, &pull_table);
161 status = wrepl_request_recv(req, mem_ctx, &rep_packet);
162 CHECK_STATUS(status, NT_STATUS_OK);
164 printf("Send a association request (conn1), to make sure the last request was handled correct\n");
165 status = wrepl_associate(wrepl_socket1, &associate2);
166 CHECK_STATUS(status, NT_STATUS_OK);
168 assoc_stop.in.assoc_ctx = associate1.out.assoc_ctx;
169 assoc_stop.in.reason = 4;
170 printf("Send a association stop request (conn1), reson: %u\n", assoc_stop.in.reason);
171 status = wrepl_associate_stop(wrepl_socket1, &assoc_stop);
172 CHECK_STATUS(status, NT_STATUS_END_OF_FILE);
174 assoc_stop.in.assoc_ctx = associate2.out.assoc_ctx;
175 assoc_stop.in.reason = 0;
176 printf("Send a association stop request (conn2), reson: %u\n", assoc_stop.in.reason);
177 status = wrepl_associate_stop(wrepl_socket2, &assoc_stop);
178 CHECK_STATUS(status, NT_STATUS_OK);
181 printf("Close 2 wrepl connections\n");
182 talloc_free(wrepl_socket1);
183 talloc_free(wrepl_socket2);
188 test if we always get back the same assoc_ctx
190 static BOOL test_assoc_ctx2(TALLOC_CTX *mem_ctx, const char *address)
193 struct wrepl_socket *wrepl_socket;
194 struct wrepl_associate associate;
198 printf("Test if we always get back the same assoc_ctx\n");
200 wrepl_socket = wrepl_socket_init(mem_ctx, NULL);
202 printf("Setup wrepl connections\n");
203 status = wrepl_connect(wrepl_socket, NULL, address);
204 CHECK_STATUS(status, NT_STATUS_OK);
207 printf("Send 1st start association request\n");
208 status = wrepl_associate(wrepl_socket, &associate);
209 CHECK_STATUS(status, NT_STATUS_OK);
210 assoc_ctx1 = associate.out.assoc_ctx;
211 printf("1st association context: 0x%x\n", associate.out.assoc_ctx);
213 printf("Send 2nd start association request\n");
214 status = wrepl_associate(wrepl_socket, &associate);
215 CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1);
216 CHECK_STATUS(status, NT_STATUS_OK);
217 printf("2nd association context: 0x%x\n", associate.out.assoc_ctx);
219 printf("Send 3rd start association request\n");
220 status = wrepl_associate(wrepl_socket, &associate);
221 CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1);
222 CHECK_STATUS(status, NT_STATUS_OK);
223 printf("3rd association context: 0x%x\n", associate.out.assoc_ctx);
226 printf("Close wrepl connections\n");
227 talloc_free(wrepl_socket);
233 display a replication entry
235 static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_name *name)
239 printf("%s\n", nbt_name_string(mem_ctx, &name->name));
240 printf("\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n",
241 name->type, name->state, name->node, name->is_static, (long long)name->version_id);
242 printf("\tRAW_FLAGS: 0x%08X OWNER: %-15s\n",
243 name->raw_flags, name->owner);
244 for (i=0;i<name->num_addresses;i++) {
245 printf("\tADDR: %-15s OWNER: %-15s\n",
246 name->addresses[i].address, name->addresses[i].owner);
251 test a full replication dump from a WINS server
253 static BOOL test_wins_replication(TALLOC_CTX *mem_ctx, const char *address)
256 struct wrepl_socket *wrepl_socket;
259 struct wrepl_associate associate;
260 struct wrepl_pull_table pull_table;
261 struct wrepl_pull_names pull_names;
263 printf("Test one pull replication cycle\n");
265 wrepl_socket = wrepl_socket_init(mem_ctx, NULL);
267 printf("Setup wrepl connections\n");
268 status = wrepl_connect(wrepl_socket, NULL, address);
269 CHECK_STATUS(status, NT_STATUS_OK);
271 printf("Send a start association request\n");
273 status = wrepl_associate(wrepl_socket, &associate);
274 CHECK_STATUS(status, NT_STATUS_OK);
276 printf("association context: 0x%x\n", associate.out.assoc_ctx);
278 printf("Send a replication table query\n");
279 pull_table.in.assoc_ctx = associate.out.assoc_ctx;
281 status = wrepl_pull_table(wrepl_socket, mem_ctx, &pull_table);
282 if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) {
283 struct wrepl_packet packet;
284 struct wrepl_request *req;
287 packet.opcode = WREPL_OPCODE_BITS;
288 packet.assoc_ctx = associate.out.assoc_ctx;
289 packet.mess_type = WREPL_STOP_ASSOCIATION;
290 packet.message.stop.reason = 0;
292 req = wrepl_request_send(wrepl_socket, &packet, NULL);
295 printf("failed - We are not a valid pull partner for the server\n");
299 CHECK_STATUS(status, NT_STATUS_OK);
301 printf("Found %d replication partners\n", pull_table.out.num_partners);
303 for (i=0;i<pull_table.out.num_partners;i++) {
304 struct wrepl_wins_owner *partner = &pull_table.out.partners[i];
305 printf("%s max_version=%6llu min_version=%6llu type=%d\n",
307 (long long)partner->max_version,
308 (long long)partner->min_version,
311 pull_names.in.assoc_ctx = associate.out.assoc_ctx;
312 pull_names.in.partner = *partner;
314 status = wrepl_pull_names(wrepl_socket, mem_ctx, &pull_names);
315 CHECK_STATUS(status, NT_STATUS_OK);
317 printf("Received %d names\n", pull_names.out.num_names);
319 for (j=0;j<pull_names.out.num_names;j++) {
320 display_entry(mem_ctx, &pull_names.out.names[j]);
325 printf("Close wrepl connections\n");
326 talloc_free(wrepl_socket);
330 struct test_wrepl_conflict_conn {
332 struct wrepl_socket *pull;
335 #define TEST_OWNER_A_ADDRESS "127.65.65.1"
336 #define TEST_ADDRESS_A_PREFIX "127.0.65"
337 #define TEST_OWNER_B_ADDRESS "127.66.66.1"
338 #define TEST_ADDRESS_B_PREFIX "127.0.66"
339 #define TEST_OWNER_X_ADDRESS "127.88.88.1"
340 #define TEST_ADDRESS_X_PREFIX "127.0.88"
342 struct wrepl_wins_owner a, b, c, x;
344 struct socket_address *myaddr;
345 struct socket_address *myaddr2;
346 struct nbt_name_socket *nbtsock;
347 struct nbt_name_socket *nbtsock2;
349 struct nbt_name_socket *nbtsock_srv;
350 struct nbt_name_socket *nbtsock_srv2;
352 uint32_t addresses_best_num;
353 struct wrepl_ip *addresses_best;
355 uint32_t addresses_best2_num;
356 struct wrepl_ip *addresses_best2;
358 uint32_t addresses_all_num;
359 struct wrepl_ip *addresses_all;
361 uint32_t addresses_mhomed_num;
362 struct wrepl_ip *addresses_mhomed;
365 static const struct wrepl_ip addresses_A_1[] = {
367 .owner = TEST_OWNER_A_ADDRESS,
368 .ip = TEST_ADDRESS_A_PREFIX".1"
371 static const struct wrepl_ip addresses_A_2[] = {
373 .owner = TEST_OWNER_A_ADDRESS,
374 .ip = TEST_ADDRESS_A_PREFIX".2"
377 static const struct wrepl_ip addresses_A_3_4[] = {
379 .owner = TEST_OWNER_A_ADDRESS,
380 .ip = TEST_ADDRESS_A_PREFIX".3"
383 .owner = TEST_OWNER_A_ADDRESS,
384 .ip = TEST_ADDRESS_A_PREFIX".4"
387 static const struct wrepl_ip addresses_A_3_4_X_3_4[] = {
389 .owner = TEST_OWNER_A_ADDRESS,
390 .ip = TEST_ADDRESS_A_PREFIX".3"
393 .owner = TEST_OWNER_A_ADDRESS,
394 .ip = TEST_ADDRESS_A_PREFIX".4"
397 .owner = TEST_OWNER_X_ADDRESS,
398 .ip = TEST_ADDRESS_X_PREFIX".3"
401 .owner = TEST_OWNER_X_ADDRESS,
402 .ip = TEST_ADDRESS_X_PREFIX".4"
405 static const struct wrepl_ip addresses_A_3_4_B_3_4[] = {
407 .owner = TEST_OWNER_A_ADDRESS,
408 .ip = TEST_ADDRESS_A_PREFIX".3"
411 .owner = TEST_OWNER_A_ADDRESS,
412 .ip = TEST_ADDRESS_A_PREFIX".4"
415 .owner = TEST_OWNER_B_ADDRESS,
416 .ip = TEST_ADDRESS_B_PREFIX".3"
419 .owner = TEST_OWNER_B_ADDRESS,
420 .ip = TEST_ADDRESS_B_PREFIX".4"
423 static const struct wrepl_ip addresses_A_3_4_OWNER_B[] = {
425 .owner = TEST_OWNER_B_ADDRESS,
426 .ip = TEST_ADDRESS_A_PREFIX".3"
429 .owner = TEST_OWNER_B_ADDRESS,
430 .ip = TEST_ADDRESS_A_PREFIX".4"
433 static const struct wrepl_ip addresses_A_3_4_X_3_4_OWNER_B[] = {
435 .owner = TEST_OWNER_B_ADDRESS,
436 .ip = TEST_ADDRESS_A_PREFIX".3"
439 .owner = TEST_OWNER_B_ADDRESS,
440 .ip = TEST_ADDRESS_A_PREFIX".4"
443 .owner = TEST_OWNER_B_ADDRESS,
444 .ip = TEST_ADDRESS_X_PREFIX".3"
447 .owner = TEST_OWNER_B_ADDRESS,
448 .ip = TEST_ADDRESS_X_PREFIX".4"
452 static const struct wrepl_ip addresses_A_3_4_X_1_2[] = {
454 .owner = TEST_OWNER_A_ADDRESS,
455 .ip = TEST_ADDRESS_A_PREFIX".3"
458 .owner = TEST_OWNER_A_ADDRESS,
459 .ip = TEST_ADDRESS_A_PREFIX".4"
462 .owner = TEST_OWNER_X_ADDRESS,
463 .ip = TEST_ADDRESS_X_PREFIX".1"
466 .owner = TEST_OWNER_X_ADDRESS,
467 .ip = TEST_ADDRESS_X_PREFIX".2"
471 static const struct wrepl_ip addresses_B_1[] = {
473 .owner = TEST_OWNER_B_ADDRESS,
474 .ip = TEST_ADDRESS_B_PREFIX".1"
477 static const struct wrepl_ip addresses_B_2[] = {
479 .owner = TEST_OWNER_B_ADDRESS,
480 .ip = TEST_ADDRESS_B_PREFIX".2"
483 static const struct wrepl_ip addresses_B_3_4[] = {
485 .owner = TEST_OWNER_B_ADDRESS,
486 .ip = TEST_ADDRESS_B_PREFIX".3"
489 .owner = TEST_OWNER_B_ADDRESS,
490 .ip = TEST_ADDRESS_B_PREFIX".4"
493 static const struct wrepl_ip addresses_B_3_4_X_3_4[] = {
495 .owner = TEST_OWNER_B_ADDRESS,
496 .ip = TEST_ADDRESS_B_PREFIX".3"
499 .owner = TEST_OWNER_B_ADDRESS,
500 .ip = TEST_ADDRESS_B_PREFIX".4"
503 .owner = TEST_OWNER_X_ADDRESS,
504 .ip = TEST_ADDRESS_X_PREFIX".3"
507 .owner = TEST_OWNER_X_ADDRESS,
508 .ip = TEST_ADDRESS_X_PREFIX".4"
511 static const struct wrepl_ip addresses_B_3_4_X_1_2[] = {
513 .owner = TEST_OWNER_B_ADDRESS,
514 .ip = TEST_ADDRESS_B_PREFIX".3"
517 .owner = TEST_OWNER_B_ADDRESS,
518 .ip = TEST_ADDRESS_B_PREFIX".4"
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"
530 static const struct wrepl_ip addresses_X_1_2[] = {
532 .owner = TEST_OWNER_X_ADDRESS,
533 .ip = TEST_ADDRESS_X_PREFIX".1"
536 .owner = TEST_OWNER_X_ADDRESS,
537 .ip = TEST_ADDRESS_X_PREFIX".2"
540 static const struct wrepl_ip addresses_X_3_4[] = {
542 .owner = TEST_OWNER_X_ADDRESS,
543 .ip = TEST_ADDRESS_X_PREFIX".3"
546 .owner = TEST_OWNER_X_ADDRESS,
547 .ip = TEST_ADDRESS_X_PREFIX".4"
551 static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem_ctx,
554 struct test_wrepl_conflict_conn *ctx;
555 struct wrepl_associate associate;
556 struct wrepl_pull_table pull_table;
557 struct socket_address *nbt_srv_addr;
561 ctx = talloc_zero(mem_ctx, struct test_wrepl_conflict_conn);
562 if (!ctx) return NULL;
564 ctx->address = address;
565 ctx->pull = wrepl_socket_init(ctx, NULL);
566 if (!ctx->pull) return NULL;
568 printf("Setup wrepl conflict pull connection\n");
569 status = wrepl_connect(ctx->pull, NULL, ctx->address);
570 if (!NT_STATUS_IS_OK(status)) return NULL;
572 status = wrepl_associate(ctx->pull, &associate);
573 if (!NT_STATUS_IS_OK(status)) return NULL;
575 ctx->pull_assoc = associate.out.assoc_ctx;
577 ctx->a.address = TEST_OWNER_A_ADDRESS;
578 ctx->a.max_version = 0;
579 ctx->a.min_version = 0;
582 ctx->b.address = TEST_OWNER_B_ADDRESS;
583 ctx->b.max_version = 0;
584 ctx->b.min_version = 0;
587 ctx->x.address = TEST_OWNER_X_ADDRESS;
588 ctx->x.max_version = 0;
589 ctx->x.min_version = 0;
592 ctx->c.address = address;
593 ctx->c.max_version = 0;
594 ctx->c.min_version = 0;
597 pull_table.in.assoc_ctx = ctx->pull_assoc;
598 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
599 if (!NT_STATUS_IS_OK(status)) return NULL;
601 for (i=0; i < pull_table.out.num_partners; i++) {
602 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
603 ctx->a.max_version = pull_table.out.partners[i].max_version;
604 ctx->a.min_version = pull_table.out.partners[i].min_version;
606 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
607 ctx->b.max_version = pull_table.out.partners[i].max_version;
608 ctx->b.min_version = pull_table.out.partners[i].min_version;
610 if (strcmp(TEST_OWNER_X_ADDRESS,pull_table.out.partners[i].address)==0) {
611 ctx->x.max_version = pull_table.out.partners[i].max_version;
612 ctx->x.min_version = pull_table.out.partners[i].min_version;
614 if (strcmp(address,pull_table.out.partners[i].address)==0) {
615 ctx->c.max_version = pull_table.out.partners[i].max_version;
616 ctx->c.min_version = pull_table.out.partners[i].min_version;
620 talloc_free(pull_table.out.partners);
622 ctx->nbtsock = nbt_name_socket_init(ctx, NULL);
623 if (!ctx->nbtsock) return NULL;
625 ctx->myaddr = socket_address_from_strings(mem_ctx, ctx->nbtsock->sock->backend_name, iface_best_ip(address), 0);
626 if (!ctx->myaddr) return NULL;
628 for (i = 0; i < iface_count(); i++) {
629 if (strcmp(ctx->myaddr->addr, iface_n_ip(i)) == 0) continue;
630 ctx->myaddr2 = socket_address_from_strings(mem_ctx, ctx->nbtsock->sock->backend_name, iface_n_ip(i), 0);
631 if (!ctx->myaddr2) return NULL;
635 status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0);
636 if (!NT_STATUS_IS_OK(status)) return NULL;
638 ctx->nbtsock_srv = nbt_name_socket_init(ctx, NULL);
639 if (!ctx->nbtsock_srv) return NULL;
641 /* Make a port 137 version of ctx->myaddr */
642 nbt_srv_addr = socket_address_from_strings(mem_ctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lp_nbt_port());
643 if (!nbt_srv_addr) return NULL;
645 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
646 status = socket_listen(ctx->nbtsock_srv->sock, nbt_srv_addr, 0, 0);
647 talloc_free(nbt_srv_addr);
648 if (!NT_STATUS_IS_OK(status)) {
649 /* this isn't fatal */
650 talloc_free(ctx->nbtsock_srv);
651 ctx->nbtsock_srv = NULL;
654 if (ctx->myaddr2 && ctx->nbtsock_srv) {
655 ctx->nbtsock2 = nbt_name_socket_init(ctx, NULL);
656 if (!ctx->nbtsock2) return NULL;
658 status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0);
659 if (!NT_STATUS_IS_OK(status)) return NULL;
661 ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx);
662 if (!ctx->nbtsock_srv2) return NULL;
664 /* Make a port 137 version of ctx->myaddr2 */
665 nbt_srv_addr = socket_address_from_strings(mem_ctx,
666 ctx->nbtsock_srv->sock->backend_name,
667 ctx->myaddr2->addr, lp_nbt_port());
668 if (!nbt_srv_addr) return NULL;
670 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
671 status = socket_listen(ctx->nbtsock_srv2->sock, ctx->myaddr2, 0, 0);
672 talloc_free(nbt_srv_addr);
673 if (!NT_STATUS_IS_OK(status)) {
674 /* this isn't fatal */
675 talloc_free(ctx->nbtsock_srv2);
676 ctx->nbtsock_srv2 = NULL;
680 ctx->addresses_best_num = 1;
681 ctx->addresses_best = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best_num);
682 if (!ctx->addresses_best) return NULL;
683 ctx->addresses_best[0].owner = ctx->b.address;
684 ctx->addresses_best[0].ip = ctx->myaddr->addr;
686 ctx->addresses_all_num = iface_count();
687 ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num);
688 if (!ctx->addresses_all) return NULL;
689 for (i=0; i < ctx->addresses_all_num; i++) {
690 ctx->addresses_all[i].owner = ctx->b.address;
691 ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(i));
692 if (!ctx->addresses_all[i].ip) return NULL;
695 if (ctx->nbtsock_srv2) {
696 ctx->addresses_best2_num = 1;
697 ctx->addresses_best2 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best2_num);
698 if (!ctx->addresses_best2) return NULL;
699 ctx->addresses_best2[0].owner = ctx->b.address;
700 ctx->addresses_best2[0].ip = ctx->myaddr2->addr;
702 ctx->addresses_mhomed_num = 2;
703 ctx->addresses_mhomed = talloc_array(ctx, struct wrepl_ip, ctx->addresses_mhomed_num);
704 if (!ctx->addresses_mhomed) return NULL;
705 ctx->addresses_mhomed[0].owner = ctx->b.address;
706 ctx->addresses_mhomed[0].ip = ctx->myaddr->addr;
707 ctx->addresses_mhomed[1].owner = ctx->b.address;
708 ctx->addresses_mhomed[1].ip = ctx->myaddr2->addr;
714 static BOOL test_wrepl_update_one(struct test_wrepl_conflict_conn *ctx,
715 const struct wrepl_wins_owner *owner,
716 const struct wrepl_wins_name *name)
719 struct wrepl_socket *wrepl_socket;
720 struct wrepl_associate associate;
721 struct wrepl_packet update_packet, repl_send;
722 struct wrepl_table *update;
723 struct wrepl_wins_owner wrepl_wins_owners[1];
724 struct wrepl_packet *repl_recv;
725 struct wrepl_wins_owner *send_request;
726 struct wrepl_send_reply *send_reply;
727 struct wrepl_wins_name wrepl_wins_names[1];
731 wrepl_socket = wrepl_socket_init(ctx, NULL);
733 status = wrepl_connect(wrepl_socket, NULL, ctx->address);
734 CHECK_STATUS(status, NT_STATUS_OK);
736 status = wrepl_associate(wrepl_socket, &associate);
737 CHECK_STATUS(status, NT_STATUS_OK);
738 assoc_ctx = associate.out.assoc_ctx;
740 /* now send a WREPL_REPL_UPDATE message */
741 ZERO_STRUCT(update_packet);
742 update_packet.opcode = WREPL_OPCODE_BITS;
743 update_packet.assoc_ctx = assoc_ctx;
744 update_packet.mess_type = WREPL_REPLICATION;
745 update_packet.message.replication.command = WREPL_REPL_UPDATE;
746 update = &update_packet.message.replication.info.table;
748 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
749 update->partners = wrepl_wins_owners;
750 update->initiator = "0.0.0.0";
752 wrepl_wins_owners[0] = *owner;
754 status = wrepl_request(wrepl_socket, wrepl_socket,
755 &update_packet, &repl_recv);
756 CHECK_STATUS(status, NT_STATUS_OK);
757 CHECK_VALUE(repl_recv->mess_type, WREPL_REPLICATION);
758 CHECK_VALUE(repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
759 send_request = &repl_recv->message.replication.info.owner;
761 ZERO_STRUCT(repl_send);
762 repl_send.opcode = WREPL_OPCODE_BITS;
763 repl_send.assoc_ctx = assoc_ctx;
764 repl_send.mess_type = WREPL_REPLICATION;
765 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
766 send_reply = &repl_send.message.replication.info.reply;
768 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
769 send_reply->names = wrepl_wins_names;
771 wrepl_wins_names[0] = *name;
773 status = wrepl_request(wrepl_socket, wrepl_socket,
774 &repl_send, &repl_recv);
775 CHECK_STATUS(status, NT_STATUS_OK);
776 CHECK_VALUE(repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
777 CHECK_VALUE(repl_recv->message.stop.reason, 0);
780 talloc_free(wrepl_socket);
784 static BOOL test_wrepl_is_applied(struct test_wrepl_conflict_conn *ctx,
785 const struct wrepl_wins_owner *owner,
786 const struct wrepl_wins_name *name,
791 struct wrepl_pull_names pull_names;
792 struct wrepl_name *names;
794 pull_names.in.assoc_ctx = ctx->pull_assoc;
795 pull_names.in.partner = *owner;
796 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
798 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
799 CHECK_STATUS(status, NT_STATUS_OK);
800 CHECK_VALUE(pull_names.out.num_names, (expected?1:0));
802 names = pull_names.out.names;
805 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
809 CHECK_VALUE(names[0].name.type, name->name->type);
810 CHECK_VALUE_STRING(names[0].name.name, name->name->name);
811 CHECK_VALUE_STRING(names[0].name.scope, name->name->scope);
812 CHECK_VALUE(flags, name->flags);
813 CHECK_VALUE_UINT64(names[0].version_id, name->id);
816 CHECK_VALUE(names[0].num_addresses,
817 name->addresses.addresses.num_ips);
819 CHECK_VALUE(names[0].num_addresses, 1);
820 CHECK_VALUE_STRING(names[0].addresses[0].address,
825 talloc_free(pull_names.out.names);
829 static BOOL test_wrepl_mhomed_merged(struct test_wrepl_conflict_conn *ctx,
830 const struct wrepl_wins_owner *owner1,
831 uint32_t num_ips1, const struct wrepl_ip *ips1,
832 const struct wrepl_wins_owner *owner2,
833 uint32_t num_ips2, const struct wrepl_ip *ips2,
834 const struct wrepl_wins_name *name2)
838 struct wrepl_pull_names pull_names;
839 struct wrepl_name *names;
842 uint32_t num_ips = num_ips1 + num_ips2;
844 for (i = 0; i < num_ips2; i++) {
845 for (j = 0; j < num_ips1; j++) {
846 if (strcmp(ips2[i].ip,ips1[j].ip) == 0) {
853 pull_names.in.assoc_ctx = ctx->pull_assoc;
854 pull_names.in.partner = *owner2;
855 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
857 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
858 CHECK_STATUS(status, NT_STATUS_OK);
859 CHECK_VALUE(pull_names.out.num_names, 1);
861 names = pull_names.out.names;
863 flags = WREPL_NAME_FLAGS(names[0].type,
867 CHECK_VALUE(names[0].name.type, name2->name->type);
868 CHECK_VALUE_STRING(names[0].name.name, name2->name->name);
869 CHECK_VALUE_STRING(names[0].name.scope, name2->name->scope);
870 CHECK_VALUE(flags, name2->flags | WREPL_TYPE_MHOMED);
871 CHECK_VALUE_UINT64(names[0].version_id, name2->id);
873 CHECK_VALUE(names[0].num_addresses, num_ips);
875 for (i = 0; i < names[0].num_addresses; i++) {
876 const char *addr = names[0].addresses[i].address;
877 const char *owner = names[0].addresses[i].owner;
880 for (j = 0; j < num_ips2; j++) {
881 if (strcmp(addr, ips2[j].ip) == 0) {
883 CHECK_VALUE_STRING(owner, owner2->address);
890 for (j = 0; j < num_ips1; j++) {
891 if (strcmp(addr, ips1[j].ip) == 0) {
893 CHECK_VALUE_STRING(owner, owner1->address);
900 CHECK_VALUE_STRING(addr, "not found in address list");
903 talloc_free(pull_names.out.names);
907 static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx,
908 struct wrepl_wins_owner *merge_owner,
909 struct wrepl_wins_owner *owner1,
910 uint32_t num_ips1, const struct wrepl_ip *ips1,
911 struct wrepl_wins_owner *owner2,
912 uint32_t num_ips2, const struct wrepl_ip *ips2,
913 const struct wrepl_wins_name *name2)
917 struct wrepl_pull_names pull_names;
918 struct wrepl_name *names;
919 struct wrepl_name *name = NULL;
922 uint32_t num_ips = num_ips1 + num_ips2;
925 merge_owner = &ctx->c;
928 for (i = 0; i < num_ips1; i++) {
929 if (owner1 != &ctx->c && strcmp(ips1[i].owner,owner2->address) == 0) {
933 for (j = 0; j < num_ips2; j++) {
934 if (strcmp(ips1[i].ip,ips2[j].ip) == 0) {
942 pull_names.in.assoc_ctx = ctx->pull_assoc;
943 pull_names.in.partner = *merge_owner;
944 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
945 pull_names.in.partner.max_version = 0;
947 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
948 CHECK_STATUS(status, NT_STATUS_OK);
950 names = pull_names.out.names;
952 for (i = 0; i < pull_names.out.num_names; i++) {
953 if (names[i].name.type != name2->name->type) continue;
954 if (!names[i].name.name) continue;
955 if (strcmp(names[i].name.name, name2->name->name) != 0) continue;
956 if (names[i].name.scope) continue;
961 if (pull_names.out.num_names > 0) {
962 merge_owner->max_version = names[pull_names.out.num_names-1].version_id;
966 printf("%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name));
970 flags = WREPL_NAME_FLAGS(name->type,
974 CHECK_VALUE(name->name.type, name2->name->type);
975 CHECK_VALUE_STRING(name->name.name, name2->name->name);
976 CHECK_VALUE_STRING(name->name.scope, name2->name->scope);
977 CHECK_VALUE(flags, name2->flags);
979 CHECK_VALUE(name->num_addresses, num_ips);
981 for (i = 0; i < name->num_addresses; i++) {
982 const char *addr = name->addresses[i].address;
983 const char *owner = name->addresses[i].owner;
986 for (j = 0; j < num_ips2; j++) {
987 if (strcmp(addr, ips2[j].ip) == 0) {
989 CHECK_VALUE_STRING(owner, ips2[j].owner);
996 for (j = 0; j < num_ips1; j++) {
997 if (strcmp(addr, ips1[j].ip) == 0) {
999 if (owner1 == &ctx->c) {
1000 CHECK_VALUE_STRING(owner, owner1->address);
1002 CHECK_VALUE_STRING(owner, ips1[j].owner);
1008 if (found) continue;
1010 CHECK_VALUE_STRING(addr, "not found in address list");
1013 talloc_free(pull_names.out.names);
1017 static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx)
1020 struct nbt_name name;
1021 struct wrepl_wins_name wins_name1;
1022 struct wrepl_wins_name wins_name2;
1023 struct wrepl_wins_name *wins_name_tmp;
1024 struct wrepl_wins_name *wins_name_last;
1025 struct wrepl_wins_name *wins_name_cur;
1027 uint8_t types[] = { 0x00, 0x1C };
1029 enum wrepl_name_type type;
1030 enum wrepl_name_state state;
1031 enum wrepl_name_node node;
1034 const struct wrepl_ip *ips;
1037 .type = WREPL_TYPE_GROUP,
1038 .state = WREPL_STATE_ACTIVE,
1039 .node = WREPL_NODE_B,
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,
1048 .num_ips = ARRAY_SIZE(addresses_A_1),
1049 .ips = addresses_A_1,
1051 .type = WREPL_TYPE_UNIQUE,
1052 .state = WREPL_STATE_ACTIVE,
1053 .node = WREPL_NODE_B,
1055 .num_ips = ARRAY_SIZE(addresses_A_2),
1056 .ips = addresses_A_2,
1058 .type = WREPL_TYPE_UNIQUE,
1059 .state = WREPL_STATE_ACTIVE,
1060 .node = WREPL_NODE_B,
1062 .num_ips = ARRAY_SIZE(addresses_A_1),
1063 .ips = addresses_A_1,
1065 .type = WREPL_TYPE_UNIQUE,
1066 .state = WREPL_STATE_ACTIVE,
1067 .node = WREPL_NODE_B,
1069 .num_ips = ARRAY_SIZE(addresses_A_2),
1070 .ips = addresses_A_2,
1072 .type = WREPL_TYPE_SGROUP,
1073 .state = WREPL_STATE_TOMBSTONE,
1074 .node = WREPL_NODE_B,
1076 .num_ips = ARRAY_SIZE(addresses_A_2),
1077 .ips = addresses_A_2,
1079 .type = WREPL_TYPE_MHOMED,
1080 .state = WREPL_STATE_TOMBSTONE,
1081 .node = WREPL_NODE_B,
1083 .num_ips = ARRAY_SIZE(addresses_A_1),
1084 .ips = addresses_A_1,
1086 .type = WREPL_TYPE_MHOMED,
1087 .state = WREPL_STATE_RELEASED,
1088 .node = WREPL_NODE_B,
1090 .num_ips = ARRAY_SIZE(addresses_A_2),
1091 .ips = addresses_A_2,
1093 .type = WREPL_TYPE_SGROUP,
1094 .state = WREPL_STATE_ACTIVE,
1095 .node = WREPL_NODE_B,
1097 .num_ips = ARRAY_SIZE(addresses_A_1),
1098 .ips = addresses_A_1,
1100 .type = WREPL_TYPE_SGROUP,
1101 .state = WREPL_STATE_ACTIVE,
1102 .node = WREPL_NODE_B,
1104 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1105 .ips = addresses_A_3_4,
1107 .type = WREPL_TYPE_SGROUP,
1108 .state = WREPL_STATE_TOMBSTONE,
1109 .node = WREPL_NODE_B,
1111 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1112 .ips = addresses_B_3_4,
1114 /* the last one should always be a unique,tomstone record! */
1115 .type = WREPL_TYPE_UNIQUE,
1116 .state = WREPL_STATE_TOMBSTONE,
1117 .node = WREPL_NODE_B,
1119 .num_ips = ARRAY_SIZE(addresses_A_1),
1120 .ips = addresses_A_1,
1124 name.name = "_SAME_OWNER_A";
1128 wins_name_tmp = NULL;
1129 wins_name_last = &wins_name2;
1130 wins_name_cur = &wins_name1;
1132 for (j=0; ret && j < ARRAY_SIZE(types); j++) {
1133 name.type = types[j];
1134 printf("Test Replica Conflicts with same owner[%s] for %s\n",
1135 nbt_name_string(ctx, &name), ctx->a.address);
1137 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
1138 wins_name_tmp = wins_name_last;
1139 wins_name_last = wins_name_cur;
1140 wins_name_cur = wins_name_tmp;
1143 printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
1144 wrepl_name_type_string(records[i-1].type),
1145 wrepl_name_state_string(records[i-1].state),
1146 (records[i-1].is_static?",static":""),
1147 wrepl_name_type_string(records[i].type),
1148 wrepl_name_state_string(records[i].state),
1149 (records[i].is_static?",static":""),
1150 (records[i-1].ips==records[i].ips?"same":"different"),
1154 wins_name_cur->name = &name;
1155 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
1158 records[i].is_static);
1159 wins_name_cur->id = ++ctx->a.max_version;
1160 if (wins_name_cur->flags & 2) {
1161 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
1162 wins_name_cur->addresses.addresses.ips = discard_const(records[i].ips);
1164 wins_name_cur->addresses.ip = records[i].ips[0].ip;
1166 wins_name_cur->unknown = "255.255.255.255";
1168 ret &= test_wrepl_update_one(ctx, &ctx->a,wins_name_cur);
1169 if (records[i].state == WREPL_STATE_RELEASED) {
1170 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_last, False);
1171 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, False);
1173 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, True);
1176 /* the first one is a cleanup run */
1177 if (!ret && i == 0) ret = True;
1180 printf("conflict handled wrong or record[%u]: %s\n", i, __location__);
1188 static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx)
1191 struct wrepl_wins_name wins_name1;
1192 struct wrepl_wins_name wins_name2;
1193 struct wrepl_wins_name *wins_name_r1;
1194 struct wrepl_wins_name *wins_name_r2;
1197 const char *line; /* just better debugging */
1198 struct nbt_name name;
1199 const char *comment;
1200 BOOL extra; /* not the worst case, this is an extra test */
1203 struct wrepl_wins_owner *owner;
1204 enum wrepl_name_type type;
1205 enum wrepl_name_state state;
1206 enum wrepl_name_node node;
1209 const struct wrepl_ip *ips;
1210 BOOL apply_expected;
1212 struct wrepl_wins_owner *merge_owner;
1213 BOOL sgroup_cleanup;
1217 * NOTE: the first record and the last applied one
1218 * needs to be from the same owner,
1219 * to not conflict in the next smbtorture run!!!
1222 .line = __location__,
1223 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1227 .type = WREPL_TYPE_UNIQUE,
1228 .state = WREPL_STATE_TOMBSTONE,
1229 .node = WREPL_NODE_B,
1231 .num_ips = ARRAY_SIZE(addresses_B_1),
1232 .ips = addresses_B_1,
1233 .apply_expected = True /* ignored */
1237 .type = WREPL_TYPE_UNIQUE,
1238 .state = WREPL_STATE_TOMBSTONE,
1239 .node = WREPL_NODE_B,
1241 .num_ips = ARRAY_SIZE(addresses_A_1),
1242 .ips = addresses_A_1,
1243 .apply_expected = True /* ignored */
1248 * unique vs unique section
1251 * unique,active vs. unique,active
1252 * => should be replaced
1255 .line = __location__,
1256 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1259 .type = WREPL_TYPE_UNIQUE,
1260 .state = WREPL_STATE_ACTIVE,
1261 .node = WREPL_NODE_B,
1263 .num_ips = ARRAY_SIZE(addresses_A_1),
1264 .ips = addresses_A_1,
1265 .apply_expected = True
1269 .type = WREPL_TYPE_UNIQUE,
1270 .state = WREPL_STATE_ACTIVE,
1271 .node = WREPL_NODE_B,
1273 .num_ips = ARRAY_SIZE(addresses_B_1),
1274 .ips = addresses_B_1,
1275 .apply_expected = True
1280 * unique,active vs. unique,tombstone
1281 * => should NOT be replaced
1284 .line = __location__,
1285 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1288 .type = WREPL_TYPE_UNIQUE,
1289 .state = WREPL_STATE_ACTIVE,
1290 .node = WREPL_NODE_B,
1292 .num_ips = ARRAY_SIZE(addresses_B_1),
1293 .ips = addresses_B_1,
1294 .apply_expected = True
1298 .type = WREPL_TYPE_UNIQUE,
1299 .state = WREPL_STATE_TOMBSTONE,
1300 .node = WREPL_NODE_B,
1302 .num_ips = ARRAY_SIZE(addresses_B_1),
1303 .ips = addresses_B_1,
1304 .apply_expected = False
1309 * unique,released vs. unique,active
1310 * => should be replaced
1313 .line = __location__,
1314 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1317 .type = WREPL_TYPE_UNIQUE,
1318 .state = WREPL_STATE_RELEASED,
1319 .node = WREPL_NODE_B,
1321 .num_ips = ARRAY_SIZE(addresses_B_1),
1322 .ips = addresses_B_1,
1323 .apply_expected = False
1327 .type = WREPL_TYPE_UNIQUE,
1328 .state = WREPL_STATE_ACTIVE,
1329 .node = WREPL_NODE_B,
1331 .num_ips = ARRAY_SIZE(addresses_A_1),
1332 .ips = addresses_A_1,
1333 .apply_expected = True
1338 * unique,released vs. unique,tombstone
1339 * => should be replaced
1342 .line = __location__,
1343 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1346 .type = WREPL_TYPE_UNIQUE,
1347 .state = WREPL_STATE_RELEASED,
1348 .node = WREPL_NODE_B,
1350 .num_ips = ARRAY_SIZE(addresses_A_1),
1351 .ips = addresses_A_1,
1352 .apply_expected = False
1356 .type = WREPL_TYPE_UNIQUE,
1357 .state = WREPL_STATE_TOMBSTONE,
1358 .node = WREPL_NODE_B,
1360 .num_ips = ARRAY_SIZE(addresses_B_1),
1361 .ips = addresses_B_1,
1362 .apply_expected = True
1367 * unique,tombstone vs. unique,active
1368 * => should be replaced
1371 .line = __location__,
1372 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1375 .type = WREPL_TYPE_UNIQUE,
1376 .state = WREPL_STATE_TOMBSTONE,
1377 .node = WREPL_NODE_B,
1379 .num_ips = ARRAY_SIZE(addresses_B_1),
1380 .ips = addresses_B_1,
1381 .apply_expected = True
1385 .type = WREPL_TYPE_UNIQUE,
1386 .state = WREPL_STATE_ACTIVE,
1387 .node = WREPL_NODE_B,
1389 .num_ips = ARRAY_SIZE(addresses_A_1),
1390 .ips = addresses_A_1,
1391 .apply_expected = True
1396 * unique,tombstone vs. unique,tombstone
1397 * => should be replaced
1400 .line = __location__,
1401 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1404 .type = WREPL_TYPE_UNIQUE,
1405 .state = WREPL_STATE_TOMBSTONE,
1406 .node = WREPL_NODE_B,
1408 .num_ips = ARRAY_SIZE(addresses_A_1),
1409 .ips = addresses_A_1,
1410 .apply_expected = True
1414 .type = WREPL_TYPE_UNIQUE,
1415 .state = WREPL_STATE_TOMBSTONE,
1416 .node = WREPL_NODE_B,
1418 .num_ips = ARRAY_SIZE(addresses_B_1),
1419 .ips = addresses_B_1,
1420 .apply_expected = True
1426 * unique vs normal groups section,
1429 * unique,active vs. group,active
1430 * => should be replaced
1433 .line = __location__,
1434 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1437 .type = WREPL_TYPE_UNIQUE,
1438 .state = WREPL_STATE_ACTIVE,
1439 .node = WREPL_NODE_B,
1441 .num_ips = ARRAY_SIZE(addresses_B_1),
1442 .ips = addresses_B_1,
1443 .apply_expected = True
1447 .type = WREPL_TYPE_GROUP,
1448 .state = WREPL_STATE_ACTIVE,
1449 .node = WREPL_NODE_B,
1451 .num_ips = ARRAY_SIZE(addresses_A_1),
1452 .ips = addresses_A_1,
1453 .apply_expected = True
1458 * unique,active vs. group,tombstone
1459 * => should NOT be replaced
1462 .line = __location__,
1463 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1466 .type = WREPL_TYPE_UNIQUE,
1467 .state = WREPL_STATE_ACTIVE,
1468 .node = WREPL_NODE_B,
1470 .num_ips = ARRAY_SIZE(addresses_A_1),
1471 .ips = addresses_A_1,
1472 .apply_expected = True
1476 .type = WREPL_TYPE_GROUP,
1477 .state = WREPL_STATE_TOMBSTONE,
1478 .node = WREPL_NODE_B,
1480 .num_ips = ARRAY_SIZE(addresses_A_1),
1481 .ips = addresses_A_1,
1482 .apply_expected = False
1487 * unique,released vs. group,active
1488 * => should be replaced
1491 .line = __location__,
1492 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1495 .type = WREPL_TYPE_UNIQUE,
1496 .state = WREPL_STATE_RELEASED,
1497 .node = WREPL_NODE_B,
1499 .num_ips = ARRAY_SIZE(addresses_A_1),
1500 .ips = addresses_A_1,
1501 .apply_expected = False
1505 .type = WREPL_TYPE_GROUP,
1506 .state = WREPL_STATE_ACTIVE,
1507 .node = WREPL_NODE_B,
1509 .num_ips = ARRAY_SIZE(addresses_B_1),
1510 .ips = addresses_B_1,
1511 .apply_expected = True
1516 * unique,released vs. group,tombstone
1517 * => should be replaced
1520 .line = __location__,
1521 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1524 .type = WREPL_TYPE_UNIQUE,
1525 .state = WREPL_STATE_RELEASED,
1526 .node = WREPL_NODE_B,
1528 .num_ips = ARRAY_SIZE(addresses_B_1),
1529 .ips = addresses_B_1,
1530 .apply_expected = False
1534 .type = WREPL_TYPE_GROUP,
1535 .state = WREPL_STATE_TOMBSTONE,
1536 .node = WREPL_NODE_B,
1538 .num_ips = ARRAY_SIZE(addresses_A_1),
1539 .ips = addresses_A_1,
1540 .apply_expected = True
1545 * unique,tombstone vs. group,active
1546 * => should be replaced
1549 .line = __location__,
1550 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1553 .type = WREPL_TYPE_UNIQUE,
1554 .state = WREPL_STATE_TOMBSTONE,
1555 .node = WREPL_NODE_B,
1557 .num_ips = ARRAY_SIZE(addresses_A_1),
1558 .ips = addresses_A_1,
1559 .apply_expected = True
1563 .type = WREPL_TYPE_GROUP,
1564 .state = WREPL_STATE_ACTIVE,
1565 .node = WREPL_NODE_B,
1567 .num_ips = ARRAY_SIZE(addresses_B_1),
1568 .ips = addresses_B_1,
1569 .apply_expected = True
1574 * unique,tombstone vs. group,tombstone
1575 * => should be replaced
1578 .line = __location__,
1579 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1582 .type = WREPL_TYPE_UNIQUE,
1583 .state = WREPL_STATE_TOMBSTONE,
1584 .node = WREPL_NODE_B,
1586 .num_ips = ARRAY_SIZE(addresses_B_1),
1587 .ips = addresses_B_1,
1588 .apply_expected = True
1592 .type = WREPL_TYPE_GROUP,
1593 .state = WREPL_STATE_TOMBSTONE,
1594 .node = WREPL_NODE_B,
1596 .num_ips = ARRAY_SIZE(addresses_A_1),
1597 .ips = addresses_A_1,
1598 .apply_expected = True
1603 * unique vs special groups section,
1606 * unique,active vs. sgroup,active
1607 * => should NOT be replaced
1610 .line = __location__,
1611 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1614 .type = WREPL_TYPE_UNIQUE,
1615 .state = WREPL_STATE_ACTIVE,
1616 .node = WREPL_NODE_B,
1618 .num_ips = ARRAY_SIZE(addresses_A_1),
1619 .ips = addresses_A_1,
1620 .apply_expected = True
1624 .type = WREPL_TYPE_SGROUP,
1625 .state = WREPL_STATE_ACTIVE,
1626 .node = WREPL_NODE_B,
1628 .num_ips = ARRAY_SIZE(addresses_A_1),
1629 .ips = addresses_A_1,
1630 .apply_expected = False
1635 * unique,active vs. sgroup,tombstone
1636 * => should NOT be replaced
1639 .line = __location__,
1640 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1643 .type = WREPL_TYPE_UNIQUE,
1644 .state = WREPL_STATE_ACTIVE,
1645 .node = WREPL_NODE_B,
1647 .num_ips = ARRAY_SIZE(addresses_A_1),
1648 .ips = addresses_A_1,
1649 .apply_expected = True
1653 .type = WREPL_TYPE_SGROUP,
1654 .state = WREPL_STATE_TOMBSTONE,
1655 .node = WREPL_NODE_B,
1657 .num_ips = ARRAY_SIZE(addresses_A_1),
1658 .ips = addresses_A_1,
1659 .apply_expected = False
1664 * unique,released vs. sgroup,active
1665 * => should be replaced
1668 .line = __location__,
1669 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1672 .type = WREPL_TYPE_UNIQUE,
1673 .state = WREPL_STATE_RELEASED,
1674 .node = WREPL_NODE_B,
1676 .num_ips = ARRAY_SIZE(addresses_A_1),
1677 .ips = addresses_A_1,
1678 .apply_expected = False
1682 .type = WREPL_TYPE_SGROUP,
1683 .state = WREPL_STATE_ACTIVE,
1684 .node = WREPL_NODE_B,
1686 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1687 .ips = addresses_B_3_4,
1688 .apply_expected = True
1693 * unique,released vs. sgroup,tombstone
1694 * => should be replaced
1697 .line = __location__,
1698 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1701 .type = WREPL_TYPE_UNIQUE,
1702 .state = WREPL_STATE_RELEASED,
1703 .node = WREPL_NODE_B,
1705 .num_ips = ARRAY_SIZE(addresses_B_1),
1706 .ips = addresses_B_1,
1707 .apply_expected = False
1711 .type = WREPL_TYPE_SGROUP,
1712 .state = WREPL_STATE_TOMBSTONE,
1713 .node = WREPL_NODE_B,
1715 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1716 .ips = addresses_A_3_4,
1717 .apply_expected = True
1722 * unique,tombstone vs. sgroup,active
1723 * => should be replaced
1726 .line = __location__,
1727 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1730 .type = WREPL_TYPE_UNIQUE,
1731 .state = WREPL_STATE_TOMBSTONE,
1732 .node = WREPL_NODE_B,
1734 .num_ips = ARRAY_SIZE(addresses_A_1),
1735 .ips = addresses_A_1,
1736 .apply_expected = True
1740 .type = WREPL_TYPE_SGROUP,
1741 .state = WREPL_STATE_ACTIVE,
1742 .node = WREPL_NODE_B,
1744 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1745 .ips = addresses_B_3_4,
1746 .apply_expected = True
1751 * unique,tombstone vs. sgroup,tombstone
1752 * => should be replaced
1755 .line = __location__,
1756 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1759 .type = WREPL_TYPE_UNIQUE,
1760 .state = WREPL_STATE_TOMBSTONE,
1761 .node = WREPL_NODE_B,
1763 .num_ips = ARRAY_SIZE(addresses_B_1),
1764 .ips = addresses_B_1,
1765 .apply_expected = True
1769 .type = WREPL_TYPE_SGROUP,
1770 .state = WREPL_STATE_TOMBSTONE,
1771 .node = WREPL_NODE_B,
1773 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1774 .ips = addresses_A_3_4,
1775 .apply_expected = True
1780 * unique vs multi homed section,
1783 * unique,active vs. mhomed,active
1784 * => should be replaced
1787 .line = __location__,
1788 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1791 .type = WREPL_TYPE_UNIQUE,
1792 .state = WREPL_STATE_ACTIVE,
1793 .node = WREPL_NODE_B,
1795 .num_ips = ARRAY_SIZE(addresses_A_1),
1796 .ips = addresses_A_1,
1797 .apply_expected = True
1801 .type = WREPL_TYPE_MHOMED,
1802 .state = WREPL_STATE_ACTIVE,
1803 .node = WREPL_NODE_B,
1805 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1806 .ips = addresses_B_3_4,
1807 .apply_expected = True
1812 * unique,active vs. mhomed,tombstone
1813 * => should NOT be replaced
1816 .line = __location__,
1817 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1820 .type = WREPL_TYPE_UNIQUE,
1821 .state = WREPL_STATE_ACTIVE,
1822 .node = WREPL_NODE_B,
1824 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1825 .ips = addresses_B_3_4,
1826 .apply_expected = True
1830 .type = WREPL_TYPE_MHOMED,
1831 .state = WREPL_STATE_TOMBSTONE,
1832 .node = WREPL_NODE_B,
1834 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1835 .ips = addresses_B_3_4,
1836 .apply_expected = False
1841 * unique,released vs. mhomed,active
1842 * => should be replaced
1845 .line = __location__,
1846 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1849 .type = WREPL_TYPE_UNIQUE,
1850 .state = WREPL_STATE_RELEASED,
1851 .node = WREPL_NODE_B,
1853 .num_ips = ARRAY_SIZE(addresses_B_1),
1854 .ips = addresses_B_1,
1855 .apply_expected = False
1859 .type = WREPL_TYPE_MHOMED,
1860 .state = WREPL_STATE_ACTIVE,
1861 .node = WREPL_NODE_B,
1863 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1864 .ips = addresses_A_3_4,
1865 .apply_expected = True
1870 * unique,released vs. mhomed,tombstone
1871 * => should be replaced
1874 .line = __location__,
1875 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1878 .type = WREPL_TYPE_UNIQUE,
1879 .state = WREPL_STATE_RELEASED,
1880 .node = WREPL_NODE_B,
1882 .num_ips = ARRAY_SIZE(addresses_A_1),
1883 .ips = addresses_A_1,
1884 .apply_expected = False
1888 .type = WREPL_TYPE_MHOMED,
1889 .state = WREPL_STATE_TOMBSTONE,
1890 .node = WREPL_NODE_B,
1892 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1893 .ips = addresses_B_3_4,
1894 .apply_expected = True
1899 * unique,tombstone vs. mhomed,active
1900 * => should be replaced
1903 .line = __location__,
1904 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1907 .type = WREPL_TYPE_UNIQUE,
1908 .state = WREPL_STATE_TOMBSTONE,
1909 .node = WREPL_NODE_B,
1911 .num_ips = ARRAY_SIZE(addresses_B_1),
1912 .ips = addresses_B_1,
1913 .apply_expected = True
1917 .type = WREPL_TYPE_MHOMED,
1918 .state = WREPL_STATE_ACTIVE,
1919 .node = WREPL_NODE_B,
1921 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1922 .ips = addresses_A_3_4,
1923 .apply_expected = True
1928 * unique,tombstone vs. mhomed,tombstone
1929 * => should be replaced
1932 .line = __location__,
1933 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1936 .type = WREPL_TYPE_UNIQUE,
1937 .state = WREPL_STATE_TOMBSTONE,
1938 .node = WREPL_NODE_B,
1940 .num_ips = ARRAY_SIZE(addresses_A_1),
1941 .ips = addresses_A_1,
1942 .apply_expected = True
1946 .type = WREPL_TYPE_MHOMED,
1947 .state = WREPL_STATE_TOMBSTONE,
1948 .node = WREPL_NODE_B,
1950 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1951 .ips = addresses_B_3_4,
1952 .apply_expected = True
1957 * normal groups vs unique section,
1960 * group,active vs. unique,active
1961 * => should NOT be replaced
1964 .line = __location__,
1965 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1968 .type = WREPL_TYPE_GROUP,
1969 .state = WREPL_STATE_ACTIVE,
1970 .node = WREPL_NODE_B,
1972 .num_ips = ARRAY_SIZE(addresses_A_1),
1973 .ips = addresses_A_1,
1974 .apply_expected = True
1978 .type = WREPL_TYPE_UNIQUE,
1979 .state = WREPL_STATE_ACTIVE,
1980 .node = WREPL_NODE_B,
1982 .num_ips = ARRAY_SIZE(addresses_A_1),
1983 .ips = addresses_A_1,
1984 .apply_expected = False
1989 * group,active vs. unique,tombstone
1990 * => should NOT be replaced
1993 .line = __location__,
1994 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1997 .type = WREPL_TYPE_GROUP,
1998 .state = WREPL_STATE_ACTIVE,
1999 .node = WREPL_NODE_B,
2001 .num_ips = ARRAY_SIZE(addresses_A_1),
2002 .ips = addresses_A_1,
2003 .apply_expected = True
2007 .type = WREPL_TYPE_UNIQUE,
2008 .state = WREPL_STATE_TOMBSTONE,
2009 .node = WREPL_NODE_B,
2011 .num_ips = ARRAY_SIZE(addresses_A_1),
2012 .ips = addresses_A_1,
2013 .apply_expected = False
2018 * group,released vs. unique,active
2019 * => should NOT be replaced
2022 .line = __location__,
2023 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2026 .type = WREPL_TYPE_GROUP,
2027 .state = WREPL_STATE_RELEASED,
2028 .node = WREPL_NODE_B,
2030 .num_ips = ARRAY_SIZE(addresses_A_1),
2031 .ips = addresses_A_1,
2032 .apply_expected = False
2036 .type = WREPL_TYPE_UNIQUE,
2037 .state = WREPL_STATE_ACTIVE,
2038 .node = WREPL_NODE_B,
2040 .num_ips = ARRAY_SIZE(addresses_A_1),
2041 .ips = addresses_A_1,
2042 .apply_expected = False
2047 * group,released vs. unique,tombstone
2048 * => should NOT be replaced
2051 .line = __location__,
2052 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2055 .type = WREPL_TYPE_GROUP,
2056 .state = WREPL_STATE_RELEASED,
2057 .node = WREPL_NODE_B,
2059 .num_ips = ARRAY_SIZE(addresses_A_1),
2060 .ips = addresses_A_1,
2061 .apply_expected = False
2065 .type = WREPL_TYPE_UNIQUE,
2066 .state = WREPL_STATE_TOMBSTONE,
2067 .node = WREPL_NODE_B,
2069 .num_ips = ARRAY_SIZE(addresses_A_1),
2070 .ips = addresses_A_1,
2071 .apply_expected = False
2076 * group,tombstone vs. unique,active
2077 * => should NOT be replaced
2080 .line = __location__,
2081 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2084 .type = WREPL_TYPE_GROUP,
2085 .state = WREPL_STATE_TOMBSTONE,
2086 .node = WREPL_NODE_B,
2088 .num_ips = ARRAY_SIZE(addresses_A_1),
2089 .ips = addresses_A_1,
2090 .apply_expected = True
2094 .type = WREPL_TYPE_UNIQUE,
2095 .state = WREPL_STATE_ACTIVE,
2096 .node = WREPL_NODE_B,
2098 .num_ips = ARRAY_SIZE(addresses_A_1),
2099 .ips = addresses_A_1,
2100 .apply_expected = False
2105 * group,tombstone vs. unique,tombstone
2106 * => should NOT be replaced
2109 .line = __location__,
2110 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2113 .type = WREPL_TYPE_GROUP,
2114 .state = WREPL_STATE_TOMBSTONE,
2115 .node = WREPL_NODE_B,
2117 .num_ips = ARRAY_SIZE(addresses_A_1),
2118 .ips = addresses_A_1,
2119 .apply_expected = True
2123 .type = WREPL_TYPE_UNIQUE,
2124 .state = WREPL_STATE_TOMBSTONE,
2125 .node = WREPL_NODE_B,
2127 .num_ips = ARRAY_SIZE(addresses_A_1),
2128 .ips = addresses_A_1,
2129 .apply_expected = False
2134 * normal groups vs normal groups section,
2137 * group,active vs. group,active
2138 * => should NOT be replaced
2141 .line = __location__,
2142 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2145 .type = WREPL_TYPE_GROUP,
2146 .state = WREPL_STATE_ACTIVE,
2147 .node = WREPL_NODE_B,
2149 .num_ips = ARRAY_SIZE(addresses_A_1),
2150 .ips = addresses_A_1,
2151 .apply_expected = True
2155 .type = WREPL_TYPE_GROUP,
2156 .state = WREPL_STATE_ACTIVE,
2157 .node = WREPL_NODE_B,
2159 .num_ips = ARRAY_SIZE(addresses_A_1),
2160 .ips = addresses_A_1,
2161 .apply_expected = False
2166 * group,active vs. group,tombstone
2167 * => should NOT be replaced
2170 .line = __location__,
2171 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2174 .type = WREPL_TYPE_GROUP,
2175 .state = WREPL_STATE_ACTIVE,
2176 .node = WREPL_NODE_B,
2178 .num_ips = ARRAY_SIZE(addresses_A_1),
2179 .ips = addresses_A_1,
2180 .apply_expected = True
2184 .type = WREPL_TYPE_GROUP,
2185 .state = WREPL_STATE_TOMBSTONE,
2186 .node = WREPL_NODE_B,
2188 .num_ips = ARRAY_SIZE(addresses_A_1),
2189 .ips = addresses_A_1,
2190 .apply_expected = False
2195 * group,released vs. group,active
2196 * => should be replaced
2199 .line = __location__,
2200 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2203 .type = WREPL_TYPE_GROUP,
2204 .state = WREPL_STATE_RELEASED,
2205 .node = WREPL_NODE_B,
2207 .num_ips = ARRAY_SIZE(addresses_A_1),
2208 .ips = addresses_A_1,
2209 .apply_expected = False
2213 .type = WREPL_TYPE_GROUP,
2214 .state = WREPL_STATE_ACTIVE,
2215 .node = WREPL_NODE_B,
2217 .num_ips = ARRAY_SIZE(addresses_B_1),
2218 .ips = addresses_B_1,
2219 .apply_expected = True
2224 * group,released vs. group,tombstone
2225 * => should be replaced
2228 .line = __location__,
2229 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2232 .type = WREPL_TYPE_GROUP,
2233 .state = WREPL_STATE_RELEASED,
2234 .node = WREPL_NODE_B,
2236 .num_ips = ARRAY_SIZE(addresses_A_1),
2237 .ips = addresses_A_1,
2238 .apply_expected = False
2242 .type = WREPL_TYPE_GROUP,
2243 .state = WREPL_STATE_TOMBSTONE,
2244 .node = WREPL_NODE_B,
2246 .num_ips = ARRAY_SIZE(addresses_B_1),
2247 .ips = addresses_B_1,
2248 .apply_expected = True
2253 * group,tombstone vs. group,active
2254 * => should be replaced
2257 .line = __location__,
2258 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2261 .type = WREPL_TYPE_GROUP,
2262 .state = WREPL_STATE_TOMBSTONE,
2263 .node = WREPL_NODE_B,
2265 .num_ips = ARRAY_SIZE(addresses_B_1),
2266 .ips = addresses_B_1,
2267 .apply_expected = True
2271 .type = WREPL_TYPE_GROUP,
2272 .state = WREPL_STATE_ACTIVE,
2273 .node = WREPL_NODE_B,
2275 .num_ips = ARRAY_SIZE(addresses_A_1),
2276 .ips = addresses_A_1,
2277 .apply_expected = True
2282 * group,tombstone vs. group,tombstone
2283 * => should be replaced
2286 .line = __location__,
2287 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2290 .type = WREPL_TYPE_GROUP,
2291 .state = WREPL_STATE_TOMBSTONE,
2292 .node = WREPL_NODE_B,
2294 .num_ips = ARRAY_SIZE(addresses_A_1),
2295 .ips = addresses_A_1,
2296 .apply_expected = True
2300 .type = WREPL_TYPE_GROUP,
2301 .state = WREPL_STATE_TOMBSTONE,
2302 .node = WREPL_NODE_B,
2304 .num_ips = ARRAY_SIZE(addresses_B_1),
2305 .ips = addresses_B_1,
2306 .apply_expected = True
2311 * normal groups vs special groups section,
2314 * group,active vs. sgroup,active
2315 * => should NOT be replaced
2318 .line = __location__,
2319 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2322 .type = WREPL_TYPE_GROUP,
2323 .state = WREPL_STATE_ACTIVE,
2324 .node = WREPL_NODE_B,
2326 .num_ips = ARRAY_SIZE(addresses_B_1),
2327 .ips = addresses_B_1,
2328 .apply_expected = True
2332 .type = WREPL_TYPE_SGROUP,
2333 .state = WREPL_STATE_ACTIVE,
2334 .node = WREPL_NODE_B,
2336 .num_ips = ARRAY_SIZE(addresses_B_1),
2337 .ips = addresses_B_1,
2338 .apply_expected = False
2343 * group,active vs. sgroup,tombstone
2344 * => should NOT be replaced
2347 .line = __location__,
2348 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2351 .type = WREPL_TYPE_GROUP,
2352 .state = WREPL_STATE_ACTIVE,
2353 .node = WREPL_NODE_B,
2355 .num_ips = ARRAY_SIZE(addresses_B_1),
2356 .ips = addresses_B_1,
2357 .apply_expected = True
2361 .type = WREPL_TYPE_SGROUP,
2362 .state = WREPL_STATE_TOMBSTONE,
2363 .node = WREPL_NODE_B,
2365 .num_ips = ARRAY_SIZE(addresses_B_1),
2366 .ips = addresses_B_1,
2367 .apply_expected = False
2372 * group,released vs. sgroup,active
2373 * => should be replaced
2376 .line = __location__,
2377 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2380 .type = WREPL_TYPE_GROUP,
2381 .state = WREPL_STATE_RELEASED,
2382 .node = WREPL_NODE_B,
2384 .num_ips = ARRAY_SIZE(addresses_A_1),
2385 .ips = addresses_A_1,
2386 .apply_expected = False
2390 .type = WREPL_TYPE_SGROUP,
2391 .state = WREPL_STATE_ACTIVE,
2392 .node = WREPL_NODE_B,
2394 .num_ips = ARRAY_SIZE(addresses_B_1),
2395 .ips = addresses_B_1,
2396 .apply_expected = True
2401 * group,released vs. sgroup,tombstone
2402 * => should NOT be replaced
2405 .line = __location__,
2406 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2409 .type = WREPL_TYPE_GROUP,
2410 .state = WREPL_STATE_RELEASED,
2411 .node = WREPL_NODE_B,
2413 .num_ips = ARRAY_SIZE(addresses_B_1),
2414 .ips = addresses_B_1,
2415 .apply_expected = False
2419 .type = WREPL_TYPE_SGROUP,
2420 .state = WREPL_STATE_TOMBSTONE,
2421 .node = WREPL_NODE_B,
2423 .num_ips = ARRAY_SIZE(addresses_B_1),
2424 .ips = addresses_B_1,
2425 .apply_expected = False
2430 * group,tombstone vs. sgroup,active
2431 * => should be replaced
2434 .line = __location__,
2435 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2438 .type = WREPL_TYPE_GROUP,
2439 .state = WREPL_STATE_TOMBSTONE,
2440 .node = WREPL_NODE_B,
2442 .num_ips = ARRAY_SIZE(addresses_B_1),
2443 .ips = addresses_B_1,
2444 .apply_expected = True
2448 .type = WREPL_TYPE_SGROUP,
2449 .state = WREPL_STATE_ACTIVE,
2450 .node = WREPL_NODE_B,
2452 .num_ips = ARRAY_SIZE(addresses_A_1),
2453 .ips = addresses_A_1,
2454 .apply_expected = True
2459 * group,tombstone vs. sgroup,tombstone
2460 * => should be replaced
2463 .line = __location__,
2464 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2467 .type = WREPL_TYPE_GROUP,
2468 .state = WREPL_STATE_TOMBSTONE,
2469 .node = WREPL_NODE_B,
2471 .num_ips = ARRAY_SIZE(addresses_A_1),
2472 .ips = addresses_A_1,
2473 .apply_expected = True
2477 .type = WREPL_TYPE_SGROUP,
2478 .state = WREPL_STATE_TOMBSTONE,
2479 .node = WREPL_NODE_B,
2481 .num_ips = ARRAY_SIZE(addresses_B_1),
2482 .ips = addresses_B_1,
2483 .apply_expected = True
2488 * normal groups vs multi homed section,
2491 * group,active vs. mhomed,active
2492 * => should NOT be replaced
2495 .line = __location__,
2496 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2499 .type = WREPL_TYPE_GROUP,
2500 .state = WREPL_STATE_ACTIVE,
2501 .node = WREPL_NODE_B,
2503 .num_ips = ARRAY_SIZE(addresses_B_1),
2504 .ips = addresses_B_1,
2505 .apply_expected = True
2509 .type = WREPL_TYPE_MHOMED,
2510 .state = WREPL_STATE_ACTIVE,
2511 .node = WREPL_NODE_B,
2513 .num_ips = ARRAY_SIZE(addresses_B_1),
2514 .ips = addresses_B_1,
2515 .apply_expected = False
2520 * group,active vs. mhomed,tombstone
2521 * => should NOT be replaced
2524 .line = __location__,
2525 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2528 .type = WREPL_TYPE_GROUP,
2529 .state = WREPL_STATE_ACTIVE,
2530 .node = WREPL_NODE_B,
2532 .num_ips = ARRAY_SIZE(addresses_B_1),
2533 .ips = addresses_B_1,
2534 .apply_expected = True
2538 .type = WREPL_TYPE_MHOMED,
2539 .state = WREPL_STATE_TOMBSTONE,
2540 .node = WREPL_NODE_B,
2542 .num_ips = ARRAY_SIZE(addresses_B_1),
2543 .ips = addresses_B_1,
2544 .apply_expected = False
2549 * group,released vs. mhomed,active
2550 * => should NOT be replaced
2553 .line = __location__,
2554 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2557 .type = WREPL_TYPE_GROUP,
2558 .state = WREPL_STATE_RELEASED,
2559 .node = WREPL_NODE_B,
2561 .num_ips = ARRAY_SIZE(addresses_B_1),
2562 .ips = addresses_B_1,
2563 .apply_expected = False
2567 .type = WREPL_TYPE_MHOMED,
2568 .state = WREPL_STATE_ACTIVE,
2569 .node = WREPL_NODE_B,
2571 .num_ips = ARRAY_SIZE(addresses_B_1),
2572 .ips = addresses_B_1,
2573 .apply_expected = False
2578 * group,released vs. mhomed,tombstone
2579 * => should NOT be replaced
2582 .line = __location__,
2583 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2586 .type = WREPL_TYPE_GROUP,
2587 .state = WREPL_STATE_RELEASED,
2588 .node = WREPL_NODE_B,
2590 .num_ips = ARRAY_SIZE(addresses_B_1),
2591 .ips = addresses_B_1,
2592 .apply_expected = False
2596 .type = WREPL_TYPE_MHOMED,
2597 .state = WREPL_STATE_TOMBSTONE,
2598 .node = WREPL_NODE_B,
2600 .num_ips = ARRAY_SIZE(addresses_B_1),
2601 .ips = addresses_B_1,
2602 .apply_expected = False
2607 * group,tombstone vs. mhomed,active
2608 * => should be replaced
2611 .line = __location__,
2612 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2615 .type = WREPL_TYPE_GROUP,
2616 .state = WREPL_STATE_TOMBSTONE,
2617 .node = WREPL_NODE_B,
2619 .num_ips = ARRAY_SIZE(addresses_B_1),
2620 .ips = addresses_B_1,
2621 .apply_expected = True
2625 .type = WREPL_TYPE_MHOMED,
2626 .state = WREPL_STATE_ACTIVE,
2627 .node = WREPL_NODE_B,
2629 .num_ips = ARRAY_SIZE(addresses_A_1),
2630 .ips = addresses_A_1,
2631 .apply_expected = True
2636 * group,tombstone vs. mhomed,tombstone
2637 * => should be replaced
2640 .line = __location__,
2641 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2644 .type = WREPL_TYPE_GROUP,
2645 .state = WREPL_STATE_TOMBSTONE,
2646 .node = WREPL_NODE_B,
2648 .num_ips = ARRAY_SIZE(addresses_A_1),
2649 .ips = addresses_A_1,
2650 .apply_expected = True
2654 .type = WREPL_TYPE_MHOMED,
2655 .state = WREPL_STATE_TOMBSTONE,
2656 .node = WREPL_NODE_B,
2658 .num_ips = ARRAY_SIZE(addresses_B_1),
2659 .ips = addresses_B_1,
2660 .apply_expected = True
2665 * special groups vs unique section,
2668 * sgroup,active vs. unique,active
2669 * => should NOT be replaced
2672 .line = __location__,
2673 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2676 .type = WREPL_TYPE_SGROUP,
2677 .state = WREPL_STATE_ACTIVE,
2678 .node = WREPL_NODE_B,
2680 .num_ips = ARRAY_SIZE(addresses_B_1),
2681 .ips = addresses_B_1,
2682 .apply_expected = True
2686 .type = WREPL_TYPE_UNIQUE,
2687 .state = WREPL_STATE_ACTIVE,
2688 .node = WREPL_NODE_B,
2690 .num_ips = ARRAY_SIZE(addresses_B_1),
2691 .ips = addresses_B_1,
2692 .apply_expected = False
2697 * sgroup,active vs. unique,tombstone
2698 * => should NOT be replaced
2701 .line = __location__,
2702 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2705 .type = WREPL_TYPE_SGROUP,
2706 .state = WREPL_STATE_ACTIVE,
2707 .node = WREPL_NODE_B,
2709 .num_ips = ARRAY_SIZE(addresses_B_1),
2710 .ips = addresses_B_1,
2711 .apply_expected = True
2715 .type = WREPL_TYPE_UNIQUE,
2716 .state = WREPL_STATE_TOMBSTONE,
2717 .node = WREPL_NODE_B,
2719 .num_ips = ARRAY_SIZE(addresses_B_1),
2720 .ips = addresses_B_1,
2721 .apply_expected = False
2726 * sgroup,released vs. unique,active
2727 * => should be replaced
2730 .line = __location__,
2731 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2734 .type = WREPL_TYPE_SGROUP,
2735 .state = WREPL_STATE_RELEASED,
2736 .node = WREPL_NODE_B,
2738 .num_ips = ARRAY_SIZE(addresses_B_1),
2739 .ips = addresses_B_1,
2740 .apply_expected = False
2744 .type = WREPL_TYPE_UNIQUE,
2745 .state = WREPL_STATE_ACTIVE,
2746 .node = WREPL_NODE_B,
2748 .num_ips = ARRAY_SIZE(addresses_A_1),
2749 .ips = addresses_A_1,
2750 .apply_expected = True
2755 * sgroup,released vs. unique,tombstone
2756 * => should be replaced
2759 .line = __location__,
2760 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2763 .type = WREPL_TYPE_SGROUP,
2764 .state = WREPL_STATE_RELEASED,
2765 .node = WREPL_NODE_B,
2767 .num_ips = ARRAY_SIZE(addresses_A_1),
2768 .ips = addresses_A_1,
2769 .apply_expected = False
2773 .type = WREPL_TYPE_UNIQUE,
2774 .state = WREPL_STATE_TOMBSTONE,
2775 .node = WREPL_NODE_B,
2777 .num_ips = ARRAY_SIZE(addresses_B_1),
2778 .ips = addresses_B_1,
2779 .apply_expected = True
2784 * sgroup,tombstone vs. unique,active
2785 * => should be replaced
2788 .line = __location__,
2789 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2792 .type = WREPL_TYPE_SGROUP,
2793 .state = WREPL_STATE_TOMBSTONE,
2794 .node = WREPL_NODE_B,
2796 .num_ips = ARRAY_SIZE(addresses_A_1),
2797 .ips = addresses_A_1,
2798 .apply_expected = True
2802 .type = WREPL_TYPE_UNIQUE,
2803 .state = WREPL_STATE_ACTIVE,
2804 .node = WREPL_NODE_B,
2806 .num_ips = ARRAY_SIZE(addresses_B_1),
2807 .ips = addresses_B_1,
2808 .apply_expected = True
2813 * sgroup,tombstone vs. unique,tombstone
2814 * => should be replaced
2817 .line = __location__,
2818 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2821 .type = WREPL_TYPE_SGROUP,
2822 .state = WREPL_STATE_TOMBSTONE,
2823 .node = WREPL_NODE_B,
2825 .num_ips = ARRAY_SIZE(addresses_B_1),
2826 .ips = addresses_B_1,
2827 .apply_expected = True
2831 .type = WREPL_TYPE_UNIQUE,
2832 .state = WREPL_STATE_TOMBSTONE,
2833 .node = WREPL_NODE_B,
2835 .num_ips = ARRAY_SIZE(addresses_A_1),
2836 .ips = addresses_A_1,
2837 .apply_expected = True
2842 * special groups vs normal group section,
2845 * sgroup,active vs. group,active
2846 * => should NOT be replaced
2849 .line = __location__,
2850 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2853 .type = WREPL_TYPE_SGROUP,
2854 .state = WREPL_STATE_ACTIVE,
2855 .node = WREPL_NODE_B,
2857 .num_ips = ARRAY_SIZE(addresses_A_1),
2858 .ips = addresses_A_1,
2859 .apply_expected = True
2863 .type = WREPL_TYPE_GROUP,
2864 .state = WREPL_STATE_ACTIVE,
2865 .node = WREPL_NODE_B,
2867 .num_ips = ARRAY_SIZE(addresses_A_1),
2868 .ips = addresses_A_1,
2869 .apply_expected = False
2874 * sgroup,active vs. group,tombstone
2875 * => should NOT be replaced
2878 .line = __location__,
2879 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2882 .type = WREPL_TYPE_SGROUP,
2883 .state = WREPL_STATE_ACTIVE,
2884 .node = WREPL_NODE_B,
2886 .num_ips = ARRAY_SIZE(addresses_A_1),
2887 .ips = addresses_A_1,
2888 .apply_expected = True
2892 .type = WREPL_TYPE_GROUP,
2893 .state = WREPL_STATE_TOMBSTONE,
2894 .node = WREPL_NODE_B,
2896 .num_ips = ARRAY_SIZE(addresses_A_1),
2897 .ips = addresses_A_1,
2898 .apply_expected = False
2903 * sgroup,released vs. group,active
2904 * => should be replaced
2907 .line = __location__,
2908 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2911 .type = WREPL_TYPE_SGROUP,
2912 .state = WREPL_STATE_RELEASED,
2913 .node = WREPL_NODE_B,
2915 .num_ips = ARRAY_SIZE(addresses_A_1),
2916 .ips = addresses_A_1,
2917 .apply_expected = False
2921 .type = WREPL_TYPE_GROUP,
2922 .state = WREPL_STATE_ACTIVE,
2923 .node = WREPL_NODE_B,
2925 .num_ips = ARRAY_SIZE(addresses_B_1),
2926 .ips = addresses_B_1,
2927 .apply_expected = True
2932 * sgroup,released vs. group,tombstone
2933 * => should be replaced
2936 .line = __location__,
2937 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2940 .type = WREPL_TYPE_SGROUP,
2941 .state = WREPL_STATE_RELEASED,
2942 .node = WREPL_NODE_B,
2944 .num_ips = ARRAY_SIZE(addresses_B_1),
2945 .ips = addresses_B_1,
2946 .apply_expected = False
2950 .type = WREPL_TYPE_GROUP,
2951 .state = WREPL_STATE_TOMBSTONE,
2952 .node = WREPL_NODE_B,
2954 .num_ips = ARRAY_SIZE(addresses_A_1),
2955 .ips = addresses_A_1,
2956 .apply_expected = True
2961 * sgroup,tombstone vs. group,active
2962 * => should NOT be replaced
2965 .line = __location__,
2966 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2969 .type = WREPL_TYPE_SGROUP,
2970 .state = WREPL_STATE_TOMBSTONE,
2971 .node = WREPL_NODE_B,
2973 .num_ips = ARRAY_SIZE(addresses_A_1),
2974 .ips = addresses_A_1,
2975 .apply_expected = True
2979 .type = WREPL_TYPE_GROUP,
2980 .state = WREPL_STATE_ACTIVE,
2981 .node = WREPL_NODE_B,
2983 .num_ips = ARRAY_SIZE(addresses_B_1),
2984 .ips = addresses_B_1,
2985 .apply_expected = True
2990 * sgroup,tombstone vs. group,tombstone
2991 * => should NOT be replaced
2994 .line = __location__,
2995 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2998 .type = WREPL_TYPE_SGROUP,
2999 .state = WREPL_STATE_TOMBSTONE,
3000 .node = WREPL_NODE_B,
3002 .num_ips = ARRAY_SIZE(addresses_B_1),
3003 .ips = addresses_B_1,
3004 .apply_expected = True
3008 .type = WREPL_TYPE_GROUP,
3009 .state = WREPL_STATE_TOMBSTONE,
3010 .node = WREPL_NODE_B,
3012 .num_ips = ARRAY_SIZE(addresses_A_1),
3013 .ips = addresses_A_1,
3014 .apply_expected = True
3019 * special groups (not active) vs special group section,
3022 * sgroup,released vs. sgroup,active
3023 * => should be replaced
3026 .line = __location__,
3027 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3030 .type = WREPL_TYPE_SGROUP,
3031 .state = WREPL_STATE_RELEASED,
3032 .node = WREPL_NODE_B,
3034 .num_ips = ARRAY_SIZE(addresses_A_1),
3035 .ips = addresses_A_1,
3036 .apply_expected = False
3040 .type = WREPL_TYPE_SGROUP,
3041 .state = WREPL_STATE_ACTIVE,
3042 .node = WREPL_NODE_B,
3044 .num_ips = ARRAY_SIZE(addresses_B_1),
3045 .ips = addresses_B_1,
3046 .apply_expected = True
3051 * sgroup,released vs. sgroup,tombstone
3052 * => should be replaced
3055 .line = __location__,
3056 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3059 .type = WREPL_TYPE_SGROUP,
3060 .state = WREPL_STATE_RELEASED,
3061 .node = WREPL_NODE_B,
3063 .num_ips = ARRAY_SIZE(addresses_B_1),
3064 .ips = addresses_B_1,
3065 .apply_expected = False
3069 .type = WREPL_TYPE_SGROUP,
3070 .state = WREPL_STATE_TOMBSTONE,
3071 .node = WREPL_NODE_B,
3073 .num_ips = ARRAY_SIZE(addresses_A_1),
3074 .ips = addresses_A_1,
3075 .apply_expected = True
3080 * sgroup,tombstone vs. sgroup,active
3081 * => should NOT be replaced
3084 .line = __location__,
3085 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3088 .type = WREPL_TYPE_SGROUP,
3089 .state = WREPL_STATE_TOMBSTONE,
3090 .node = WREPL_NODE_B,
3092 .num_ips = ARRAY_SIZE(addresses_A_1),
3093 .ips = addresses_A_1,
3094 .apply_expected = True
3098 .type = WREPL_TYPE_SGROUP,
3099 .state = WREPL_STATE_ACTIVE,
3100 .node = WREPL_NODE_B,
3102 .num_ips = ARRAY_SIZE(addresses_B_1),
3103 .ips = addresses_B_1,
3104 .apply_expected = True
3109 * sgroup,tombstone vs. sgroup,tombstone
3110 * => should NOT be replaced
3113 .line = __location__,
3114 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3117 .type = WREPL_TYPE_SGROUP,
3118 .state = WREPL_STATE_TOMBSTONE,
3119 .node = WREPL_NODE_B,
3121 .num_ips = ARRAY_SIZE(addresses_B_1),
3122 .ips = addresses_B_1,
3123 .apply_expected = True
3127 .type = WREPL_TYPE_SGROUP,
3128 .state = WREPL_STATE_TOMBSTONE,
3129 .node = WREPL_NODE_B,
3131 .num_ips = ARRAY_SIZE(addresses_A_1),
3132 .ips = addresses_A_1,
3133 .apply_expected = True
3138 * special groups vs multi homed section,
3141 * sgroup,active vs. mhomed,active
3142 * => should NOT be replaced
3145 .line = __location__,
3146 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3149 .type = WREPL_TYPE_SGROUP,
3150 .state = WREPL_STATE_ACTIVE,
3151 .node = WREPL_NODE_B,
3153 .num_ips = ARRAY_SIZE(addresses_A_1),
3154 .ips = addresses_A_1,
3155 .apply_expected = True
3159 .type = WREPL_TYPE_MHOMED,
3160 .state = WREPL_STATE_ACTIVE,
3161 .node = WREPL_NODE_B,
3163 .num_ips = ARRAY_SIZE(addresses_A_1),
3164 .ips = addresses_A_1,
3165 .apply_expected = False
3170 * sgroup,active vs. mhomed,tombstone
3171 * => should NOT be replaced
3174 .line = __location__,
3175 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3178 .type = WREPL_TYPE_SGROUP,
3179 .state = WREPL_STATE_ACTIVE,
3180 .node = WREPL_NODE_B,
3182 .num_ips = ARRAY_SIZE(addresses_A_1),
3183 .ips = addresses_A_1,
3184 .apply_expected = True
3188 .type = WREPL_TYPE_MHOMED,
3189 .state = WREPL_STATE_TOMBSTONE,
3190 .node = WREPL_NODE_B,
3192 .num_ips = ARRAY_SIZE(addresses_A_1),
3193 .ips = addresses_A_1,
3194 .apply_expected = False
3199 * sgroup,released vs. mhomed,active
3200 * => should be replaced
3203 .line = __location__,
3204 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3207 .type = WREPL_TYPE_SGROUP,
3208 .state = WREPL_STATE_RELEASED,
3209 .node = WREPL_NODE_B,
3211 .num_ips = ARRAY_SIZE(addresses_A_1),
3212 .ips = addresses_A_1,
3213 .apply_expected = False
3217 .type = WREPL_TYPE_MHOMED,
3218 .state = WREPL_STATE_ACTIVE,
3219 .node = WREPL_NODE_B,
3221 .num_ips = ARRAY_SIZE(addresses_B_1),
3222 .ips = addresses_B_1,
3223 .apply_expected = True
3228 * sgroup,released vs. mhomed,tombstone
3229 * => should be replaced
3232 .line = __location__,
3233 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3236 .type = WREPL_TYPE_SGROUP,
3237 .state = WREPL_STATE_RELEASED,
3238 .node = WREPL_NODE_B,
3240 .num_ips = ARRAY_SIZE(addresses_B_1),
3241 .ips = addresses_B_1,
3242 .apply_expected = False
3246 .type = WREPL_TYPE_MHOMED,
3247 .state = WREPL_STATE_TOMBSTONE,
3248 .node = WREPL_NODE_B,
3250 .num_ips = ARRAY_SIZE(addresses_A_1),
3251 .ips = addresses_A_1,
3252 .apply_expected = True
3257 * sgroup,tombstone vs. mhomed,active
3258 * => should be replaced
3261 .line = __location__,
3262 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3265 .type = WREPL_TYPE_SGROUP,
3266 .state = WREPL_STATE_TOMBSTONE,
3267 .node = WREPL_NODE_B,
3269 .num_ips = ARRAY_SIZE(addresses_A_1),
3270 .ips = addresses_A_1,
3271 .apply_expected = True
3275 .type = WREPL_TYPE_MHOMED,
3276 .state = WREPL_STATE_ACTIVE,
3277 .node = WREPL_NODE_B,
3279 .num_ips = ARRAY_SIZE(addresses_B_1),
3280 .ips = addresses_B_1,
3281 .apply_expected = True
3286 * sgroup,tombstone vs. mhomed,tombstone
3287 * => should be replaced
3290 .line = __location__,
3291 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3294 .type = WREPL_TYPE_SGROUP,
3295 .state = WREPL_STATE_TOMBSTONE,
3296 .node = WREPL_NODE_B,
3298 .num_ips = ARRAY_SIZE(addresses_B_1),
3299 .ips = addresses_B_1,
3300 .apply_expected = True
3304 .type = WREPL_TYPE_MHOMED,
3305 .state = WREPL_STATE_TOMBSTONE,
3306 .node = WREPL_NODE_B,
3308 .num_ips = ARRAY_SIZE(addresses_A_1),
3309 .ips = addresses_A_1,
3310 .apply_expected = True
3315 * multi homed vs. unique section,
3318 * mhomed,active vs. unique,active
3319 * => should be replaced
3322 .line = __location__,
3323 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3326 .type = WREPL_TYPE_MHOMED,
3327 .state = WREPL_STATE_ACTIVE,
3328 .node = WREPL_NODE_B,
3330 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3331 .ips = addresses_A_3_4,
3332 .apply_expected = True
3336 .type = WREPL_TYPE_UNIQUE,
3337 .state = WREPL_STATE_ACTIVE,
3338 .node = WREPL_NODE_B,
3340 .num_ips = ARRAY_SIZE(addresses_B_1),
3341 .ips = addresses_B_1,
3342 .apply_expected = True
3347 * mhomed,active vs. unique,tombstone
3348 * => should NOT be replaced
3351 .line = __location__,
3352 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3355 .type = WREPL_TYPE_MHOMED,
3356 .state = WREPL_STATE_ACTIVE,
3357 .node = WREPL_NODE_B,
3359 .num_ips = ARRAY_SIZE(addresses_B_1),
3360 .ips = addresses_B_1,
3361 .apply_expected = True
3365 .type = WREPL_TYPE_UNIQUE,
3366 .state = WREPL_STATE_TOMBSTONE,
3367 .node = WREPL_NODE_B,
3369 .num_ips = ARRAY_SIZE(addresses_B_1),
3370 .ips = addresses_B_1,
3371 .apply_expected = False
3376 * mhomed,released vs. unique,active
3377 * => should be replaced
3380 .line = __location__,
3381 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3384 .type = WREPL_TYPE_MHOMED,
3385 .state = WREPL_STATE_RELEASED,
3386 .node = WREPL_NODE_B,
3388 .num_ips = ARRAY_SIZE(addresses_A_1),
3389 .ips = addresses_A_1,
3390 .apply_expected = False
3394 .type = WREPL_TYPE_UNIQUE,
3395 .state = WREPL_STATE_ACTIVE,
3396 .node = WREPL_NODE_B,
3398 .num_ips = ARRAY_SIZE(addresses_B_1),
3399 .ips = addresses_B_1,
3400 .apply_expected = True
3405 * mhomed,released vs. uinique,tombstone
3406 * => should be replaced
3409 .line = __location__,
3410 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3413 .type = WREPL_TYPE_MHOMED,
3414 .state = WREPL_STATE_RELEASED,
3415 .node = WREPL_NODE_B,
3417 .num_ips = ARRAY_SIZE(addresses_B_1),
3418 .ips = addresses_B_1,
3419 .apply_expected = False
3423 .type = WREPL_TYPE_UNIQUE,
3424 .state = WREPL_STATE_TOMBSTONE,
3425 .node = WREPL_NODE_B,
3427 .num_ips = ARRAY_SIZE(addresses_A_1),
3428 .ips = addresses_A_1,
3429 .apply_expected = True
3434 * mhomed,tombstone vs. unique,active
3435 * => should be replaced
3438 .line = __location__,
3439 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3442 .type = WREPL_TYPE_MHOMED,
3443 .state = WREPL_STATE_TOMBSTONE,
3444 .node = WREPL_NODE_B,
3446 .num_ips = ARRAY_SIZE(addresses_A_1),
3447 .ips = addresses_A_1,
3448 .apply_expected = True
3452 .type = WREPL_TYPE_UNIQUE,
3453 .state = WREPL_STATE_ACTIVE,
3454 .node = WREPL_NODE_B,
3456 .num_ips = ARRAY_SIZE(addresses_B_1),
3457 .ips = addresses_B_1,
3458 .apply_expected = True
3463 * mhomed,tombstone vs. uinique,tombstone
3464 * => should be replaced
3467 .line = __location__,
3468 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3471 .type = WREPL_TYPE_MHOMED,
3472 .state = WREPL_STATE_TOMBSTONE,
3473 .node = WREPL_NODE_B,
3475 .num_ips = ARRAY_SIZE(addresses_B_1),
3476 .ips = addresses_B_1,
3477 .apply_expected = True
3481 .type = WREPL_TYPE_UNIQUE,
3482 .state = WREPL_STATE_TOMBSTONE,
3483 .node = WREPL_NODE_B,
3485 .num_ips = ARRAY_SIZE(addresses_A_1),
3486 .ips = addresses_A_1,
3487 .apply_expected = True
3492 * multi homed vs. normal group section,
3495 * mhomed,active vs. group,active
3496 * => should be replaced
3499 .line = __location__,
3500 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3503 .type = WREPL_TYPE_MHOMED,
3504 .state = WREPL_STATE_ACTIVE,
3505 .node = WREPL_NODE_B,
3507 .num_ips = ARRAY_SIZE(addresses_A_1),
3508 .ips = addresses_A_1,
3509 .apply_expected = True
3513 .type = WREPL_TYPE_GROUP,
3514 .state = WREPL_STATE_ACTIVE,
3515 .node = WREPL_NODE_B,
3517 .num_ips = ARRAY_SIZE(addresses_B_1),
3518 .ips = addresses_B_1,
3519 .apply_expected = True
3524 * mhomed,active vs. group,tombstone
3525 * => should NOT be replaced
3528 .line = __location__,
3529 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3532 .type = WREPL_TYPE_MHOMED,
3533 .state = WREPL_STATE_ACTIVE,
3534 .node = WREPL_NODE_B,
3536 .num_ips = ARRAY_SIZE(addresses_B_1),
3537 .ips = addresses_B_1,
3538 .apply_expected = True
3542 .type = WREPL_TYPE_GROUP,
3543 .state = WREPL_STATE_TOMBSTONE,
3544 .node = WREPL_NODE_B,
3546 .num_ips = ARRAY_SIZE(addresses_B_1),
3547 .ips = addresses_B_1,
3548 .apply_expected = False
3553 * mhomed,released vs. group,active
3554 * => should be replaced
3557 .line = __location__,
3558 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3561 .type = WREPL_TYPE_MHOMED,
3562 .state = WREPL_STATE_RELEASED,
3563 .node = WREPL_NODE_B,
3565 .num_ips = ARRAY_SIZE(addresses_B_1),
3566 .ips = addresses_B_1,
3567 .apply_expected = False
3571 .type = WREPL_TYPE_GROUP,
3572 .state = WREPL_STATE_ACTIVE,
3573 .node = WREPL_NODE_B,
3575 .num_ips = ARRAY_SIZE(addresses_A_1),
3576 .ips = addresses_A_1,
3577 .apply_expected = True
3582 * mhomed,released vs. group,tombstone
3583 * => should be replaced
3586 .line = __location__,
3587 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3590 .type = WREPL_TYPE_MHOMED,
3591 .state = WREPL_STATE_RELEASED,
3592 .node = WREPL_NODE_B,
3594 .num_ips = ARRAY_SIZE(addresses_A_1),
3595 .ips = addresses_A_1,
3596 .apply_expected = False
3600 .type = WREPL_TYPE_GROUP,
3601 .state = WREPL_STATE_TOMBSTONE,
3602 .node = WREPL_NODE_B,
3604 .num_ips = ARRAY_SIZE(addresses_B_1),
3605 .ips = addresses_B_1,
3606 .apply_expected = True
3611 * mhomed,tombstone vs. group,active
3612 * => should be replaced
3615 .line = __location__,
3616 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3619 .type = WREPL_TYPE_MHOMED,
3620 .state = WREPL_STATE_TOMBSTONE,
3621 .node = WREPL_NODE_B,
3623 .num_ips = ARRAY_SIZE(addresses_B_1),
3624 .ips = addresses_B_1,
3625 .apply_expected = True
3629 .type = WREPL_TYPE_GROUP,
3630 .state = WREPL_STATE_ACTIVE,
3631 .node = WREPL_NODE_B,
3633 .num_ips = ARRAY_SIZE(addresses_A_1),
3634 .ips = addresses_A_1,
3635 .apply_expected = True
3640 * mhomed,tombstone vs. group,tombstone
3641 * => should be replaced
3644 .line = __location__,
3645 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3648 .type = WREPL_TYPE_MHOMED,
3649 .state = WREPL_STATE_TOMBSTONE,
3650 .node = WREPL_NODE_B,
3652 .num_ips = ARRAY_SIZE(addresses_A_1),
3653 .ips = addresses_A_1,
3654 .apply_expected = True
3658 .type = WREPL_TYPE_GROUP,
3659 .state = WREPL_STATE_TOMBSTONE,
3660 .node = WREPL_NODE_B,
3662 .num_ips = ARRAY_SIZE(addresses_B_1),
3663 .ips = addresses_B_1,
3664 .apply_expected = True
3669 * multi homed vs. special group section,
3672 * mhomed,active vs. sgroup,active
3673 * => should NOT be replaced
3676 .line = __location__,
3677 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3680 .type = WREPL_TYPE_MHOMED,
3681 .state = WREPL_STATE_ACTIVE,
3682 .node = WREPL_NODE_B,
3684 .num_ips = ARRAY_SIZE(addresses_A_1),
3685 .ips = addresses_A_1,
3686 .apply_expected = True
3690 .type = WREPL_TYPE_SGROUP,
3691 .state = WREPL_STATE_ACTIVE,
3692 .node = WREPL_NODE_B,
3694 .num_ips = ARRAY_SIZE(addresses_A_1),
3695 .ips = addresses_A_1,
3696 .apply_expected = False
3701 * mhomed,active vs. sgroup,tombstone
3702 * => should NOT be replaced
3705 .line = __location__,
3706 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3709 .type = WREPL_TYPE_MHOMED,
3710 .state = WREPL_STATE_ACTIVE,
3711 .node = WREPL_NODE_B,
3713 .num_ips = ARRAY_SIZE(addresses_A_1),
3714 .ips = addresses_A_1,
3715 .apply_expected = True
3719 .type = WREPL_TYPE_SGROUP,
3720 .state = WREPL_STATE_TOMBSTONE,
3721 .node = WREPL_NODE_B,
3723 .num_ips = ARRAY_SIZE(addresses_A_1),
3724 .ips = addresses_A_1,
3725 .apply_expected = False
3730 * mhomed,released vs. sgroup,active
3731 * => should be replaced
3734 .line = __location__,
3735 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3738 .type = WREPL_TYPE_MHOMED,
3739 .state = WREPL_STATE_RELEASED,
3740 .node = WREPL_NODE_B,
3742 .num_ips = ARRAY_SIZE(addresses_A_1),
3743 .ips = addresses_A_1,
3744 .apply_expected = False
3748 .type = WREPL_TYPE_SGROUP,
3749 .state = WREPL_STATE_ACTIVE,
3750 .node = WREPL_NODE_B,
3752 .num_ips = ARRAY_SIZE(addresses_B_1),
3753 .ips = addresses_B_1,
3754 .apply_expected = True
3759 * mhomed,released vs. sgroup,tombstone
3760 * => should be replaced
3763 .line = __location__,
3764 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3767 .type = WREPL_TYPE_MHOMED,
3768 .state = WREPL_STATE_RELEASED,
3769 .node = WREPL_NODE_B,
3771 .num_ips = ARRAY_SIZE(addresses_B_1),
3772 .ips = addresses_B_1,
3773 .apply_expected = False
3777 .type = WREPL_TYPE_SGROUP,
3778 .state = WREPL_STATE_TOMBSTONE,
3779 .node = WREPL_NODE_B,
3781 .num_ips = ARRAY_SIZE(addresses_A_1),
3782 .ips = addresses_A_1,
3783 .apply_expected = True
3788 * mhomed,tombstone vs. sgroup,active
3789 * => should be replaced
3792 .line = __location__,
3793 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3796 .type = WREPL_TYPE_MHOMED,
3797 .state = WREPL_STATE_TOMBSTONE,
3798 .node = WREPL_NODE_B,
3800 .num_ips = ARRAY_SIZE(addresses_A_1),
3801 .ips = addresses_A_1,
3802 .apply_expected = True
3806 .type = WREPL_TYPE_SGROUP,
3807 .state = WREPL_STATE_ACTIVE,
3808 .node = WREPL_NODE_B,
3810 .num_ips = ARRAY_SIZE(addresses_B_1),
3811 .ips = addresses_B_1,
3812 .apply_expected = True
3817 * mhomed,tombstone vs. sgroup,tombstone
3818 * => should be replaced
3821 .line = __location__,
3822 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3825 .type = WREPL_TYPE_MHOMED,
3826 .state = WREPL_STATE_TOMBSTONE,
3827 .node = WREPL_NODE_B,
3829 .num_ips = ARRAY_SIZE(addresses_B_1),
3830 .ips = addresses_B_1,
3831 .apply_expected = True
3835 .type = WREPL_TYPE_SGROUP,
3836 .state = WREPL_STATE_TOMBSTONE,
3837 .node = WREPL_NODE_B,
3839 .num_ips = ARRAY_SIZE(addresses_A_1),
3840 .ips = addresses_A_1,
3841 .apply_expected = True
3846 * multi homed vs. mlti homed section,
3849 * mhomed,active vs. mhomed,active
3850 * => should be replaced
3853 .line = __location__,
3854 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3857 .type = WREPL_TYPE_MHOMED,
3858 .state = WREPL_STATE_ACTIVE,
3859 .node = WREPL_NODE_B,
3861 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3862 .ips = addresses_A_3_4,
3863 .apply_expected = True
3867 .type = WREPL_TYPE_MHOMED,
3868 .state = WREPL_STATE_ACTIVE,
3869 .node = WREPL_NODE_B,
3871 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3872 .ips = addresses_B_3_4,
3873 .apply_expected = True
3878 * mhomed,active vs. mhomed,tombstone
3879 * => should NOT be replaced
3882 .line = __location__,
3883 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3886 .type = WREPL_TYPE_MHOMED,
3887 .state = WREPL_STATE_ACTIVE,
3888 .node = WREPL_NODE_B,
3890 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3891 .ips = addresses_B_3_4,
3892 .apply_expected = True
3896 .type = WREPL_TYPE_MHOMED,
3897 .state = WREPL_STATE_TOMBSTONE,
3898 .node = WREPL_NODE_B,
3900 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3901 .ips = addresses_B_3_4,
3902 .apply_expected = False
3907 * mhomed,released vs. mhomed,active
3908 * => should be replaced
3911 .line = __location__,
3912 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3915 .type = WREPL_TYPE_MHOMED,
3916 .state = WREPL_STATE_RELEASED,
3917 .node = WREPL_NODE_B,
3919 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3920 .ips = addresses_B_3_4,
3921 .apply_expected = False
3925 .type = WREPL_TYPE_MHOMED,
3926 .state = WREPL_STATE_ACTIVE,
3927 .node = WREPL_NODE_B,
3929 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3930 .ips = addresses_A_3_4,
3931 .apply_expected = True
3936 * mhomed,released vs. mhomed,tombstone
3937 * => should be replaced
3940 .line = __location__,
3941 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3944 .type = WREPL_TYPE_MHOMED,
3945 .state = WREPL_STATE_RELEASED,
3946 .node = WREPL_NODE_B,
3948 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3949 .ips = addresses_A_3_4,
3950 .apply_expected = False
3954 .type = WREPL_TYPE_MHOMED,
3955 .state = WREPL_STATE_TOMBSTONE,
3956 .node = WREPL_NODE_B,
3958 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3959 .ips = addresses_B_3_4,
3960 .apply_expected = True
3965 * mhomed,tombstone vs. mhomed,active
3966 * => should be replaced
3969 .line = __location__,
3970 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3973 .type = WREPL_TYPE_MHOMED,
3974 .state = WREPL_STATE_TOMBSTONE,
3975 .node = WREPL_NODE_B,
3977 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3978 .ips = addresses_B_3_4,
3979 .apply_expected = True
3983 .type = WREPL_TYPE_MHOMED,
3984 .state = WREPL_STATE_ACTIVE,
3985 .node = WREPL_NODE_B,
3987 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3988 .ips = addresses_A_3_4,
3989 .apply_expected = True
3994 * mhomed,tombstone vs. mhomed,tombstone
3995 * => should be replaced
3998 .line = __location__,
3999 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4002 .type = WREPL_TYPE_MHOMED,
4003 .state = WREPL_STATE_TOMBSTONE,
4004 .node = WREPL_NODE_B,
4006 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4007 .ips = addresses_A_3_4,
4008 .apply_expected = True
4012 .type = WREPL_TYPE_MHOMED,
4013 .state = WREPL_STATE_TOMBSTONE,
4014 .node = WREPL_NODE_B,
4016 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4017 .ips = addresses_B_3_4,
4018 .apply_expected = True
4022 .line = __location__,
4023 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4027 .type = WREPL_TYPE_UNIQUE,
4028 .state = WREPL_STATE_TOMBSTONE,
4029 .node = WREPL_NODE_B,
4031 .num_ips = ARRAY_SIZE(addresses_B_1),
4032 .ips = addresses_B_1,
4033 .apply_expected = True,
4037 .type = WREPL_TYPE_UNIQUE,
4038 .state = WREPL_STATE_TOMBSTONE,
4039 .node = WREPL_NODE_B,
4041 .num_ips = ARRAY_SIZE(addresses_A_1),
4042 .ips = addresses_A_1,
4043 .apply_expected = True,
4047 * special group vs special group section,
4050 * sgroup,active vs. sgroup,active same addresses
4051 * => should be NOT replaced
4054 .line = __location__,
4055 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4056 .comment= "A:A_3_4 vs. B:A_3_4",
4060 .type = WREPL_TYPE_SGROUP,
4061 .state = WREPL_STATE_ACTIVE,
4062 .node = WREPL_NODE_B,
4064 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4065 .ips = addresses_A_3_4,
4066 .apply_expected = True
4070 .type = WREPL_TYPE_SGROUP,
4071 .state = WREPL_STATE_ACTIVE,
4072 .node = WREPL_NODE_B,
4074 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4075 .ips = addresses_A_3_4,
4076 .apply_expected = False,
4077 .sgroup_cleanup = True
4081 * sgroup,active vs. sgroup,active same addresses
4082 * => should be NOT replaced
4085 .line = __location__,
4086 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4087 .comment= "A:A_3_4 vs. B:NULL",
4091 .type = WREPL_TYPE_SGROUP,
4092 .state = WREPL_STATE_ACTIVE,
4093 .node = WREPL_NODE_B,
4095 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4096 .ips = addresses_A_3_4,
4097 .apply_expected = True
4101 .type = WREPL_TYPE_SGROUP,
4102 .state = WREPL_STATE_ACTIVE,
4103 .node = WREPL_NODE_B,
4107 .apply_expected = False,
4108 .sgroup_cleanup = True
4112 * sgroup,active vs. sgroup,active subset addresses, special case...
4113 * => should NOT be replaced
4116 .line = __location__,
4117 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4118 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4",
4122 .type = WREPL_TYPE_SGROUP,
4123 .state = WREPL_STATE_ACTIVE,
4124 .node = WREPL_NODE_B,
4126 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4127 .ips = addresses_A_3_4_X_3_4,
4128 .apply_expected = True,
4132 .type = WREPL_TYPE_SGROUP,
4133 .state = WREPL_STATE_ACTIVE,
4134 .node = WREPL_NODE_B,
4136 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4137 .ips = addresses_A_3_4,
4138 .apply_expected = False,
4142 .line = __location__,
4143 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4147 .type = WREPL_TYPE_SGROUP,
4148 .state = WREPL_STATE_ACTIVE,
4149 .node = WREPL_NODE_B,
4153 .apply_expected = False,
4157 .type = WREPL_TYPE_SGROUP,
4158 .state = WREPL_STATE_ACTIVE,
4159 .node = WREPL_NODE_B,
4163 .apply_expected = False,
4167 * sgroup,active vs. sgroup,active different addresses, but owner changed
4168 * => should be replaced
4171 .line = __location__,
4172 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4173 .comment= "A:B_3_4 vs. B:A_3_4",
4177 .type = WREPL_TYPE_SGROUP,
4178 .state = WREPL_STATE_ACTIVE,
4179 .node = WREPL_NODE_B,
4181 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4182 .ips = addresses_B_3_4,
4183 .apply_expected = True,
4187 .type = WREPL_TYPE_SGROUP,
4188 .state = WREPL_STATE_ACTIVE,
4189 .node = WREPL_NODE_B,
4191 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4192 .ips = addresses_A_3_4,
4193 .apply_expected = True,
4194 .sgroup_cleanup = True
4198 * sgroup,active vs. sgroup,active different addresses, but owner changed
4199 * => should be replaced
4202 .line = __location__,
4203 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4204 .comment= "A:A_3_4 vs. B:A_3_4_OWNER_B",
4208 .type = WREPL_TYPE_SGROUP,
4209 .state = WREPL_STATE_ACTIVE,
4210 .node = WREPL_NODE_B,
4212 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4213 .ips = addresses_A_3_4,
4214 .apply_expected = True,
4218 .type = WREPL_TYPE_SGROUP,
4219 .state = WREPL_STATE_ACTIVE,
4220 .node = WREPL_NODE_B,
4222 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4223 .ips = addresses_A_3_4_OWNER_B,
4224 .apply_expected = True,
4225 .sgroup_cleanup = True
4229 * sgroup,active vs. sgroup,active different addresses, but owner changed
4230 * => should be replaced
4233 .line = __location__,
4234 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4235 .comment= "A:A_3_4_OWNER_B vs. B:A_3_4",
4239 .type = WREPL_TYPE_SGROUP,
4240 .state = WREPL_STATE_ACTIVE,
4241 .node = WREPL_NODE_B,
4243 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4244 .ips = addresses_A_3_4_OWNER_B,
4245 .apply_expected = True,
4249 .type = WREPL_TYPE_SGROUP,
4250 .state = WREPL_STATE_ACTIVE,
4251 .node = WREPL_NODE_B,
4253 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4254 .ips = addresses_A_3_4,
4255 .apply_expected = True,
4256 .sgroup_cleanup = True
4260 * sgroup,active vs. sgroup,active different addresses
4261 * => should be merged
4264 .line = __location__,
4265 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4266 .comment= "A:A_3_4 vs. B:B_3_4 => C:A_3_4_B_3_4",
4270 .type = WREPL_TYPE_SGROUP,
4271 .state = WREPL_STATE_ACTIVE,
4272 .node = WREPL_NODE_B,
4274 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4275 .ips = addresses_A_3_4,
4276 .apply_expected = True,
4280 .type = WREPL_TYPE_SGROUP,
4281 .state = WREPL_STATE_ACTIVE,
4282 .node = WREPL_NODE_B,
4284 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4285 .ips = addresses_B_3_4,
4286 .sgroup_merge = True,
4287 .sgroup_cleanup = True,
4291 * sgroup,active vs. sgroup,active different addresses, special case...
4292 * => should be merged
4295 .line = __location__,
4296 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4297 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4_X_3_4",
4301 .type = WREPL_TYPE_SGROUP,
4302 .state = WREPL_STATE_ACTIVE,
4303 .node = WREPL_NODE_B,
4305 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4306 .ips = addresses_B_3_4_X_3_4,
4307 .apply_expected = True,
4311 .type = WREPL_TYPE_SGROUP,
4312 .state = WREPL_STATE_ACTIVE,
4313 .node = WREPL_NODE_B,
4315 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4316 .ips = addresses_A_3_4,
4317 .sgroup_merge = True,
4318 .merge_owner = &ctx->b,
4319 .sgroup_cleanup = False
4323 .line = __location__,
4324 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4328 .type = WREPL_TYPE_SGROUP,
4329 .state = WREPL_STATE_ACTIVE,
4330 .node = WREPL_NODE_B,
4332 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4_OWNER_B),
4333 .ips = addresses_A_3_4_X_3_4_OWNER_B,
4334 .apply_expected = True,
4338 .type = WREPL_TYPE_SGROUP,
4339 .state = WREPL_STATE_ACTIVE,
4340 .node = WREPL_NODE_B,
4344 .apply_expected = False,
4348 * sgroup,active vs. sgroup,active different addresses, special case...
4349 * => should be merged
4352 .line = __location__,
4353 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4354 .comment= "A:X_3_4 vs. B:A_3_4 => C:A_3_4_X_3_4",
4358 .type = WREPL_TYPE_SGROUP,
4359 .state = WREPL_STATE_ACTIVE,
4360 .node = WREPL_NODE_B,
4362 .num_ips = ARRAY_SIZE(addresses_X_3_4),
4363 .ips = addresses_X_3_4,
4364 .apply_expected = True,
4368 .type = WREPL_TYPE_SGROUP,
4369 .state = WREPL_STATE_ACTIVE,
4370 .node = WREPL_NODE_B,
4372 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4373 .ips = addresses_A_3_4,
4374 .sgroup_merge = True,
4375 .sgroup_cleanup = False
4379 .line = __location__,
4380 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4384 .type = WREPL_TYPE_SGROUP,
4385 .state = WREPL_STATE_ACTIVE,
4386 .node = WREPL_NODE_B,
4390 .apply_expected = False,
4394 .type = WREPL_TYPE_SGROUP,
4395 .state = WREPL_STATE_ACTIVE,
4396 .node = WREPL_NODE_B,
4400 .apply_expected = False,
4404 * sgroup,active vs. sgroup,active different addresses, special case...
4405 * => should be merged
4408 .line = __location__,
4409 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4410 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4_OWNER_B => B:A_3_4_OWNER_B_X_3_4",
4414 .type = WREPL_TYPE_SGROUP,
4415 .state = WREPL_STATE_ACTIVE,
4416 .node = WREPL_NODE_B,
4418 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4419 .ips = addresses_A_3_4_X_3_4,
4420 .apply_expected = True,
4424 .type = WREPL_TYPE_SGROUP,
4425 .state = WREPL_STATE_ACTIVE,
4426 .node = WREPL_NODE_B,
4428 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4429 .ips = addresses_A_3_4_OWNER_B,
4430 .sgroup_merge = True,
4431 .merge_owner = &ctx->b,
4435 .line = __location__,
4436 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4440 .type = WREPL_TYPE_SGROUP,
4441 .state = WREPL_STATE_ACTIVE,
4442 .node = WREPL_NODE_B,
4446 .apply_expected = False,
4450 .type = WREPL_TYPE_SGROUP,
4451 .state = WREPL_STATE_ACTIVE,
4452 .node = WREPL_NODE_B,
4456 .apply_expected = False,
4460 * sgroup,active vs. sgroup,active partly different addresses, special case...
4461 * => should be merged
4464 .line = __location__,
4465 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4466 .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",
4470 .type = WREPL_TYPE_SGROUP,
4471 .state = WREPL_STATE_ACTIVE,
4472 .node = WREPL_NODE_B,
4474 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4475 .ips = addresses_B_3_4_X_3_4,
4476 .apply_expected = True,
4480 .type = WREPL_TYPE_SGROUP,
4481 .state = WREPL_STATE_ACTIVE,
4482 .node = WREPL_NODE_B,
4484 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_1_2),
4485 .ips = addresses_B_3_4_X_1_2,
4486 .sgroup_merge = True,
4487 .sgroup_cleanup = False
4491 .line = __location__,
4492 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4496 .type = WREPL_TYPE_SGROUP,
4497 .state = WREPL_STATE_ACTIVE,
4498 .node = WREPL_NODE_B,
4502 .apply_expected = False,
4506 .type = WREPL_TYPE_SGROUP,
4507 .state = WREPL_STATE_ACTIVE,
4508 .node = WREPL_NODE_B,
4512 .apply_expected = False,
4516 * sgroup,active vs. sgroup,active different addresses, special case...
4517 * => should be merged
4520 .line = __location__,
4521 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4522 .comment= "A:A_3_4_B_3_4 vs. B:NULL => B:A_3_4",
4526 .type = WREPL_TYPE_SGROUP,
4527 .state = WREPL_STATE_ACTIVE,
4528 .node = WREPL_NODE_B,
4530 .num_ips = ARRAY_SIZE(addresses_A_3_4_B_3_4),
4531 .ips = addresses_A_3_4_B_3_4,
4532 .apply_expected = True,
4536 .type = WREPL_TYPE_SGROUP,
4537 .state = WREPL_STATE_ACTIVE,
4538 .node = WREPL_NODE_B,
4542 .sgroup_merge = True,
4543 .merge_owner = &ctx->b,
4544 .sgroup_cleanup = True
4548 .line = __location__,
4549 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4553 .type = WREPL_TYPE_SGROUP,
4554 .state = WREPL_STATE_ACTIVE,
4555 .node = WREPL_NODE_B,
4559 .apply_expected = False,
4563 .type = WREPL_TYPE_UNIQUE,
4564 .state = WREPL_STATE_TOMBSTONE,
4565 .node = WREPL_NODE_B,
4567 .num_ips = ARRAY_SIZE(addresses_A_1),
4568 .ips = addresses_A_1,
4569 .apply_expected = True,
4573 * sgroup,active vs. sgroup,active different addresses, special case...
4574 * => should be merged
4577 .line = __location__,
4578 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4579 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:X_3_4",
4583 .type = WREPL_TYPE_SGROUP,
4584 .state = WREPL_STATE_ACTIVE,
4585 .node = WREPL_NODE_B,
4587 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4588 .ips = addresses_B_3_4_X_3_4,
4589 .apply_expected = True,
4593 .type = WREPL_TYPE_SGROUP,
4594 .state = WREPL_STATE_ACTIVE,
4595 .node = WREPL_NODE_B,
4599 .sgroup_merge = True,
4600 .merge_owner = &ctx->b,
4601 .sgroup_cleanup = True
4605 .line = __location__,
4606 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4610 .type = WREPL_TYPE_SGROUP,
4611 .state = WREPL_STATE_ACTIVE,
4612 .node = WREPL_NODE_B,
4616 .apply_expected = False,
4620 .type = WREPL_TYPE_UNIQUE,
4621 .state = WREPL_STATE_TOMBSTONE,
4622 .node = WREPL_NODE_B,
4624 .num_ips = ARRAY_SIZE(addresses_A_1),
4625 .ips = addresses_A_1,
4626 .apply_expected = True,
4631 * sgroup,active vs. sgroup,tombstone different no addresses, special
4632 * => should be replaced
4635 .line = __location__,
4636 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4637 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:NULL",
4641 .type = WREPL_TYPE_SGROUP,
4642 .state = WREPL_STATE_ACTIVE,
4643 .node = WREPL_NODE_B,
4645 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4646 .ips = addresses_B_3_4_X_3_4,
4647 .apply_expected = True,
4651 .type = WREPL_TYPE_SGROUP,
4652 .state = WREPL_STATE_TOMBSTONE,
4653 .node = WREPL_NODE_B,
4657 .apply_expected = True,
4661 * sgroup,active vs. sgroup,tombstone different addresses
4662 * => should be replaced
4665 .line = __location__,
4666 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4667 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4",
4671 .type = WREPL_TYPE_SGROUP,
4672 .state = WREPL_STATE_ACTIVE,
4673 .node = WREPL_NODE_B,
4675 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4676 .ips = addresses_B_3_4_X_3_4,
4677 .apply_expected = True,
4681 .type = WREPL_TYPE_SGROUP,
4682 .state = WREPL_STATE_TOMBSTONE,
4683 .node = WREPL_NODE_B,
4685 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4686 .ips = addresses_A_3_4,
4687 .apply_expected = True,
4691 * sgroup,active vs. sgroup,tombstone subset addresses
4692 * => should be replaced
4695 .line = __location__,
4696 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4697 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4 => B:B_3_4",
4701 .type = WREPL_TYPE_SGROUP,
4702 .state = WREPL_STATE_ACTIVE,
4703 .node = WREPL_NODE_B,
4705 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4706 .ips = addresses_B_3_4_X_3_4,
4707 .apply_expected = True,
4711 .type = WREPL_TYPE_SGROUP,
4712 .state = WREPL_STATE_TOMBSTONE,
4713 .node = WREPL_NODE_B,
4715 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4716 .ips = addresses_B_3_4,
4717 .apply_expected = True,
4721 * sgroup,active vs. sgroup,active same addresses
4722 * => should be replaced
4725 .line = __location__,
4726 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4727 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4_X_3_4 => B:B_3_4_X_3_4",
4731 .type = WREPL_TYPE_SGROUP,
4732 .state = WREPL_STATE_ACTIVE,
4733 .node = WREPL_NODE_B,
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,
4741 .type = WREPL_TYPE_SGROUP,
4742 .state = WREPL_STATE_TOMBSTONE,
4743 .node = WREPL_NODE_B,
4745 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4746 .ips = addresses_B_3_4_X_3_4,
4747 .apply_expected = True,
4752 * This should be the last record in this array,
4753 * we need to make sure the we leave a tombstoned unique entry
4757 .line = __location__,
4758 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4762 .type = WREPL_TYPE_UNIQUE,
4763 .state = WREPL_STATE_TOMBSTONE,
4764 .node = WREPL_NODE_B,
4766 .num_ips = ARRAY_SIZE(addresses_A_1),
4767 .ips = addresses_A_1,
4768 .apply_expected = True
4772 .type = WREPL_TYPE_UNIQUE,
4773 .state = WREPL_STATE_TOMBSTONE,
4774 .node = WREPL_NODE_B,
4776 .num_ips = ARRAY_SIZE(addresses_A_1),
4777 .ips = addresses_A_1,
4778 .apply_expected = True
4780 }}; /* do not add entries here, this should be the last record! */
4782 wins_name_r1 = &wins_name1;
4783 wins_name_r2 = &wins_name2;
4785 printf("Test Replica Conflicts with different owners\n");
4787 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
4789 if (!records[i].extra && !records[i].cleanup) {
4790 /* we should test the worst cases */
4791 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
4792 printf("(%s) Programmer error, invalid record[%u]: %s\n",
4793 __location__, i, records[i].line);
4795 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
4796 printf("(%s) Programmer error, invalid record[%u]: %s\n",
4797 __location__, i, records[i].line);
4802 if (!records[i].cleanup) {
4803 const char *expected;
4806 if (records[i].r2.sgroup_merge) {
4807 expected = "SGROUP_MERGE";
4808 } else if (records[i].r2.apply_expected) {
4809 expected = "REPLACE";
4811 expected = "NOT REPLACE";
4814 if (!records[i].r1.ips && !records[i].r2.ips) {
4815 ips = "with no ip(s)";
4816 } else if (records[i].r1.ips==records[i].r2.ips) {
4817 ips = "with same ip(s)";
4819 ips = "with different ip(s)";
4822 printf("%s,%s%s vs. %s,%s%s %s => %s\n",
4823 wrepl_name_type_string(records[i].r1.type),
4824 wrepl_name_state_string(records[i].r1.state),
4825 (records[i].r1.is_static?",static":""),
4826 wrepl_name_type_string(records[i].r2.type),
4827 wrepl_name_state_string(records[i].r2.state),
4828 (records[i].r2.is_static?",static":""),
4829 (records[i].comment?records[i].comment:ips),
4836 wins_name_r1->name = &records[i].name;
4837 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
4838 records[i].r1.state,
4840 records[i].r1.is_static);
4841 wins_name_r1->id = ++records[i].r1.owner->max_version;
4842 if (wins_name_r1->flags & 2) {
4843 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
4844 wins_name_r1->addresses.addresses.ips = discard_const(records[i].r1.ips);
4846 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
4848 wins_name_r1->unknown = "255.255.255.255";
4851 ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1);
4852 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4853 wins_name_r1, records[i].r1.apply_expected);
4858 wins_name_r2->name = &records[i].name;
4859 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
4860 records[i].r2.state,
4862 records[i].r2.is_static);
4863 wins_name_r2->id = ++records[i].r2.owner->max_version;
4864 if (wins_name_r2->flags & 2) {
4865 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
4866 wins_name_r2->addresses.addresses.ips = discard_const(records[i].r2.ips);
4868 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
4870 wins_name_r2->unknown = "255.255.255.255";
4873 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4874 if (records[i].r1.state == WREPL_STATE_RELEASED) {
4875 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4876 wins_name_r1, False);
4877 } else if (records[i].r2.sgroup_merge) {
4878 ret &= test_wrepl_sgroup_merged(ctx, records[i].r2.merge_owner,
4879 records[i].r1.owner,
4880 records[i].r1.num_ips, records[i].r1.ips,
4881 records[i].r2.owner,
4882 records[i].r2.num_ips, records[i].r2.ips,
4884 } else if (records[i].r1.owner != records[i].r2.owner) {
4886 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
4887 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4888 wins_name_r1, _expected);
4890 if (records[i].r2.state == WREPL_STATE_RELEASED) {
4891 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
4892 wins_name_r2, False);
4893 } else if (!records[i].r2.sgroup_merge) {
4894 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
4895 wins_name_r2, records[i].r2.apply_expected);
4898 if (records[i].r2.sgroup_cleanup) {
4900 printf("failed before sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4904 /* clean up the SGROUP record */
4905 wins_name_r1->name = &records[i].name;
4906 wins_name_r1->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4908 WREPL_NODE_B, False);
4909 wins_name_r1->id = ++records[i].r1.owner->max_version;
4910 wins_name_r1->addresses.addresses.num_ips = 0;
4911 wins_name_r1->addresses.addresses.ips = NULL;
4912 wins_name_r1->unknown = "255.255.255.255";
4913 ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1);
4915 /* here we test how names from an owner are deleted */
4916 if (records[i].r2.sgroup_merge && records[i].r2.num_ips) {
4917 ret &= test_wrepl_sgroup_merged(ctx, NULL,
4918 records[i].r2.owner,
4919 records[i].r2.num_ips, records[i].r2.ips,
4920 records[i].r1.owner,
4925 /* clean up the SGROUP record */
4926 wins_name_r2->name = &records[i].name;
4927 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4929 WREPL_NODE_B, False);
4930 wins_name_r2->id = ++records[i].r2.owner->max_version;
4931 wins_name_r2->addresses.addresses.num_ips = 0;
4932 wins_name_r2->addresses.addresses.ips = NULL;
4933 wins_name_r2->unknown = "255.255.255.255";
4934 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4936 /* take ownership of the SGROUP record */
4937 wins_name_r2->name = &records[i].name;
4938 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4940 WREPL_NODE_B, False);
4941 wins_name_r2->id = ++records[i].r2.owner->max_version;
4942 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4943 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4944 wins_name_r2->unknown = "255.255.255.255";
4945 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4946 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, True);
4948 /* overwrite the SGROUP record with unique,tombstone */
4949 wins_name_r2->name = &records[i].name;
4950 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4951 WREPL_STATE_TOMBSTONE,
4952 WREPL_NODE_B, False);
4953 wins_name_r2->id = ++records[i].r2.owner->max_version;
4954 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4955 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4956 wins_name_r2->unknown = "255.255.255.255";
4957 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4958 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, True);
4961 printf("failed in sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4966 /* the first one is a cleanup run */
4967 if (!ret && i == 0) ret = True;
4970 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
4978 static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_conn *ctx)
4982 struct wrepl_wins_name wins_name_;
4983 struct wrepl_wins_name *wins_name = &wins_name_;
4984 struct nbt_name_register name_register_;
4985 struct nbt_name_register *name_register = &name_register_;
4986 struct nbt_name_release release_;
4987 struct nbt_name_release *release = &release_;
4990 const char *line; /* just better debugging */
4991 struct nbt_name name;
4996 const struct wrepl_ip *ips;
4997 BOOL apply_expected;
5000 enum wrepl_name_type type;
5001 enum wrepl_name_state state;
5002 enum wrepl_name_node node;
5005 const struct wrepl_ip *ips;
5006 BOOL apply_expected;
5010 * unique vs. unique section
5013 * unique,released vs. unique,active with same ip(s)
5016 .line = __location__,
5017 .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL),
5021 .num_ips = ctx->addresses_best_num,
5022 .ips = ctx->addresses_best,
5023 .apply_expected = True
5026 .type = WREPL_TYPE_UNIQUE,
5027 .state = WREPL_STATE_ACTIVE,
5028 .node = WREPL_NODE_B,
5030 .num_ips = ctx->addresses_best_num,
5031 .ips = ctx->addresses_best,
5032 .apply_expected = True
5036 * unique,released vs. unique,active with different ip(s)
5039 .line = __location__,
5040 .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL),
5044 .num_ips = ctx->addresses_best_num,
5045 .ips = ctx->addresses_best,
5046 .apply_expected = True
5049 .type = WREPL_TYPE_UNIQUE,
5050 .state = WREPL_STATE_ACTIVE,
5051 .node = WREPL_NODE_B,
5053 .num_ips = ARRAY_SIZE(addresses_B_1),
5054 .ips = addresses_B_1,
5055 .apply_expected = True
5059 * unique,released vs. unique,tombstone with same ip(s)
5062 .line = __location__,
5063 .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL),
5067 .num_ips = ctx->addresses_best_num,
5068 .ips = ctx->addresses_best,
5069 .apply_expected = True
5072 .type = WREPL_TYPE_UNIQUE,
5073 .state = WREPL_STATE_TOMBSTONE,
5074 .node = WREPL_NODE_B,
5076 .num_ips = ctx->addresses_best_num,
5077 .ips = ctx->addresses_best,
5078 .apply_expected = True
5082 * unique,released vs. unique,tombstone with different ip(s)
5085 .line = __location__,
5086 .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL),
5090 .num_ips = ctx->addresses_best_num,
5091 .ips = ctx->addresses_best,
5092 .apply_expected = True
5095 .type = WREPL_TYPE_UNIQUE,
5096 .state = WREPL_STATE_TOMBSTONE,
5097 .node = WREPL_NODE_B,
5099 .num_ips = ARRAY_SIZE(addresses_B_1),
5100 .ips = addresses_B_1,
5101 .apply_expected = True
5105 * unique vs. group section
5108 * unique,released vs. group,active with same ip(s)
5111 .line = __location__,
5112 .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL),
5116 .num_ips = ctx->addresses_best_num,
5117 .ips = ctx->addresses_best,
5118 .apply_expected = True
5121 .type = WREPL_TYPE_GROUP,
5122 .state = WREPL_STATE_ACTIVE,
5123 .node = WREPL_NODE_B,
5125 .num_ips = ctx->addresses_best_num,
5126 .ips = ctx->addresses_best,
5127 .apply_expected = True
5131 * unique,released vs. group,active with different ip(s)
5134 .line = __location__,
5135 .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL),
5139 .num_ips = ctx->addresses_best_num,
5140 .ips = ctx->addresses_best,
5141 .apply_expected = True
5144 .type = WREPL_TYPE_GROUP,
5145 .state = WREPL_STATE_ACTIVE,
5146 .node = WREPL_NODE_B,
5148 .num_ips = ARRAY_SIZE(addresses_B_1),
5149 .ips = addresses_B_1,
5150 .apply_expected = True
5154 * unique,released vs. group,tombstone with same ip(s)
5157 .line = __location__,
5158 .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL),
5162 .num_ips = ctx->addresses_best_num,
5163 .ips = ctx->addresses_best,
5164 .apply_expected = True
5167 .type = WREPL_TYPE_GROUP,
5168 .state = WREPL_STATE_TOMBSTONE,
5169 .node = WREPL_NODE_B,
5171 .num_ips = ctx->addresses_best_num,
5172 .ips = ctx->addresses_best,
5173 .apply_expected = True
5177 * unique,released vs. group,tombstone with different ip(s)
5180 .line = __location__,
5181 .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL),
5185 .num_ips = ctx->addresses_best_num,
5186 .ips = ctx->addresses_best,
5187 .apply_expected = True
5190 .type = WREPL_TYPE_GROUP,
5191 .state = WREPL_STATE_TOMBSTONE,
5192 .node = WREPL_NODE_B,
5194 .num_ips = ARRAY_SIZE(addresses_B_1),
5195 .ips = addresses_B_1,
5196 .apply_expected = True
5200 * unique vs. special group section
5203 * unique,released vs. sgroup,active with same ip(s)
5206 .line = __location__,
5207 .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL),
5211 .num_ips = ctx->addresses_best_num,
5212 .ips = ctx->addresses_best,
5213 .apply_expected = True
5216 .type = WREPL_TYPE_SGROUP,
5217 .state = WREPL_STATE_ACTIVE,
5218 .node = WREPL_NODE_B,
5220 .num_ips = ctx->addresses_best_num,
5221 .ips = ctx->addresses_best,
5222 .apply_expected = True
5226 * unique,released vs. sgroup,active with different ip(s)
5229 .line = __location__,
5230 .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL),
5234 .num_ips = ctx->addresses_best_num,
5235 .ips = ctx->addresses_best,
5236 .apply_expected = True
5239 .type = WREPL_TYPE_SGROUP,
5240 .state = WREPL_STATE_ACTIVE,
5241 .node = WREPL_NODE_B,
5243 .num_ips = ARRAY_SIZE(addresses_B_1),
5244 .ips = addresses_B_1,
5245 .apply_expected = True
5249 * unique,released vs. sgroup,tombstone with same ip(s)
5252 .line = __location__,
5253 .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL),
5257 .num_ips = ctx->addresses_best_num,
5258 .ips = ctx->addresses_best,
5259 .apply_expected = True
5262 .type = WREPL_TYPE_SGROUP,
5263 .state = WREPL_STATE_TOMBSTONE,
5264 .node = WREPL_NODE_B,
5266 .num_ips = ctx->addresses_best_num,
5267 .ips = ctx->addresses_best,
5268 .apply_expected = True
5272 * unique,released vs. sgroup,tombstone with different ip(s)
5275 .line = __location__,
5276 .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL),
5280 .num_ips = ctx->addresses_best_num,
5281 .ips = ctx->addresses_best,
5282 .apply_expected = True
5285 .type = WREPL_TYPE_SGROUP,
5286 .state = WREPL_STATE_TOMBSTONE,
5287 .node = WREPL_NODE_B,
5289 .num_ips = ARRAY_SIZE(addresses_B_1),
5290 .ips = addresses_B_1,
5291 .apply_expected = True
5295 * unique vs. multi homed section
5298 * unique,released vs. mhomed,active with same ip(s)
5301 .line = __location__,
5302 .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL),
5306 .num_ips = ctx->addresses_best_num,
5307 .ips = ctx->addresses_best,
5308 .apply_expected = True
5311 .type = WREPL_TYPE_MHOMED,
5312 .state = WREPL_STATE_ACTIVE,
5313 .node = WREPL_NODE_B,
5315 .num_ips = ctx->addresses_best_num,
5316 .ips = ctx->addresses_best,
5317 .apply_expected = True
5321 * unique,released vs. mhomed,active with different ip(s)
5324 .line = __location__,
5325 .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL),
5329 .num_ips = ctx->addresses_best_num,
5330 .ips = ctx->addresses_best,
5331 .apply_expected = True
5334 .type = WREPL_TYPE_MHOMED,
5335 .state = WREPL_STATE_ACTIVE,
5336 .node = WREPL_NODE_B,
5338 .num_ips = ARRAY_SIZE(addresses_B_1),
5339 .ips = addresses_B_1,
5340 .apply_expected = True
5344 * unique,released vs. mhomed,tombstone with same ip(s)
5347 .line = __location__,
5348 .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL),
5352 .num_ips = ctx->addresses_best_num,
5353 .ips = ctx->addresses_best,
5354 .apply_expected = True
5357 .type = WREPL_TYPE_MHOMED,
5358 .state = WREPL_STATE_TOMBSTONE,
5359 .node = WREPL_NODE_B,
5361 .num_ips = ctx->addresses_best_num,
5362 .ips = ctx->addresses_best,
5363 .apply_expected = True
5367 * unique,released vs. mhomed,tombstone with different ip(s)
5370 .line = __location__,
5371 .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL),
5375 .num_ips = ctx->addresses_best_num,
5376 .ips = ctx->addresses_best,
5377 .apply_expected = True
5380 .type = WREPL_TYPE_MHOMED,
5381 .state = WREPL_STATE_TOMBSTONE,
5382 .node = WREPL_NODE_B,
5384 .num_ips = ARRAY_SIZE(addresses_B_1),
5385 .ips = addresses_B_1,
5386 .apply_expected = True
5390 * group vs. unique section
5393 * group,released vs. unique,active with same ip(s)
5396 .line = __location__,
5397 .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL),
5399 .nb_flags = NBT_NM_GROUP,
5401 .num_ips = ctx->addresses_best_num,
5402 .ips = ctx->addresses_best,
5403 .apply_expected = True
5406 .type = WREPL_TYPE_UNIQUE,
5407 .state = WREPL_STATE_ACTIVE,
5408 .node = WREPL_NODE_B,
5410 .num_ips = ctx->addresses_best_num,
5411 .ips = ctx->addresses_best,
5412 .apply_expected = False
5416 * group,released vs. unique,active with different ip(s)
5419 .line = __location__,
5420 .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL),
5422 .nb_flags = NBT_NM_GROUP,
5424 .num_ips = ctx->addresses_best_num,
5425 .ips = ctx->addresses_best,
5426 .apply_expected = True
5429 .type = WREPL_TYPE_UNIQUE,
5430 .state = WREPL_STATE_ACTIVE,
5431 .node = WREPL_NODE_B,
5433 .num_ips = ARRAY_SIZE(addresses_B_1),
5434 .ips = addresses_B_1,
5435 .apply_expected = False
5439 * group,released vs. unique,tombstone with same ip(s)
5442 .line = __location__,
5443 .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL),
5445 .nb_flags = NBT_NM_GROUP,
5447 .num_ips = ctx->addresses_best_num,
5448 .ips = ctx->addresses_best,
5449 .apply_expected = True
5452 .type = WREPL_TYPE_UNIQUE,
5453 .state = WREPL_STATE_TOMBSTONE,
5454 .node = WREPL_NODE_B,
5456 .num_ips = ctx->addresses_best_num,
5457 .ips = ctx->addresses_best,
5458 .apply_expected = False
5462 * group,released vs. unique,tombstone with different ip(s)
5465 .line = __location__,
5466 .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL),
5468 .nb_flags = NBT_NM_GROUP,
5470 .num_ips = ctx->addresses_best_num,
5471 .ips = ctx->addresses_best,
5472 .apply_expected = True
5475 .type = WREPL_TYPE_UNIQUE,
5476 .state = WREPL_STATE_TOMBSTONE,
5477 .node = WREPL_NODE_B,
5479 .num_ips = ARRAY_SIZE(addresses_B_1),
5480 .ips = addresses_B_1,
5481 .apply_expected = False
5485 * group vs. group section
5488 * group,released vs. group,active with same ip(s)
5491 .line = __location__,
5492 .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL),
5494 .nb_flags = NBT_NM_GROUP,
5496 .num_ips = ctx->addresses_best_num,
5497 .ips = ctx->addresses_best,
5498 .apply_expected = True
5501 .type = WREPL_TYPE_GROUP,
5502 .state = WREPL_STATE_ACTIVE,
5503 .node = WREPL_NODE_B,
5505 .num_ips = ctx->addresses_best_num,
5506 .ips = ctx->addresses_best,
5507 .apply_expected = True
5511 * group,released vs. group,active with different ip(s)
5514 .line = __location__,
5515 .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL),
5517 .nb_flags = NBT_NM_GROUP,
5519 .num_ips = ctx->addresses_best_num,
5520 .ips = ctx->addresses_best,
5521 .apply_expected = True
5524 .type = WREPL_TYPE_GROUP,
5525 .state = WREPL_STATE_ACTIVE,
5526 .node = WREPL_NODE_B,
5528 .num_ips = ARRAY_SIZE(addresses_B_1),
5529 .ips = addresses_B_1,
5530 .apply_expected = True
5534 * group,released vs. group,tombstone with same ip(s)
5537 .line = __location__,
5538 .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL),
5540 .nb_flags = NBT_NM_GROUP,
5542 .num_ips = ctx->addresses_best_num,
5543 .ips = ctx->addresses_best,
5544 .apply_expected = True
5547 .type = WREPL_TYPE_GROUP,
5548 .state = WREPL_STATE_TOMBSTONE,
5549 .node = WREPL_NODE_B,
5551 .num_ips = ctx->addresses_best_num,
5552 .ips = ctx->addresses_best,
5553 .apply_expected = True
5557 * group,released vs. group,tombstone with different ip(s)
5560 .line = __location__,
5561 .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL),
5563 .nb_flags = NBT_NM_GROUP,
5565 .num_ips = ctx->addresses_best_num,
5566 .ips = ctx->addresses_best,
5567 .apply_expected = True
5570 .type = WREPL_TYPE_GROUP,
5571 .state = WREPL_STATE_TOMBSTONE,
5572 .node = WREPL_NODE_B,
5574 .num_ips = ARRAY_SIZE(addresses_B_1),
5575 .ips = addresses_B_1,
5576 .apply_expected = True
5580 * group vs. special group section
5583 * group,released vs. sgroup,active with same ip(s)
5586 .line = __location__,
5587 .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL),
5589 .nb_flags = NBT_NM_GROUP,
5591 .num_ips = ctx->addresses_best_num,
5592 .ips = ctx->addresses_best,
5593 .apply_expected = True
5596 .type = WREPL_TYPE_SGROUP,
5597 .state = WREPL_STATE_ACTIVE,
5598 .node = WREPL_NODE_B,
5600 .num_ips = ctx->addresses_best_num,
5601 .ips = ctx->addresses_best,
5602 .apply_expected = False
5606 * group,released vs. sgroup,active with different ip(s)
5609 .line = __location__,
5610 .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL),
5612 .nb_flags = NBT_NM_GROUP,
5614 .num_ips = ctx->addresses_best_num,
5615 .ips = ctx->addresses_best,
5616 .apply_expected = True
5619 .type = WREPL_TYPE_SGROUP,
5620 .state = WREPL_STATE_ACTIVE,
5621 .node = WREPL_NODE_B,
5623 .num_ips = ARRAY_SIZE(addresses_B_1),
5624 .ips = addresses_B_1,
5625 .apply_expected = False
5629 * group,released vs. sgroup,tombstone with same ip(s)
5632 .line = __location__,
5633 .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL),
5635 .nb_flags = NBT_NM_GROUP,
5637 .num_ips = ctx->addresses_best_num,
5638 .ips = ctx->addresses_best,
5639 .apply_expected = True
5642 .type = WREPL_TYPE_SGROUP,
5643 .state = WREPL_STATE_TOMBSTONE,
5644 .node = WREPL_NODE_B,
5646 .num_ips = ctx->addresses_best_num,
5647 .ips = ctx->addresses_best,
5648 .apply_expected = False
5652 * group,released vs. sgroup,tombstone with different ip(s)
5655 .line = __location__,
5656 .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL),
5658 .nb_flags = NBT_NM_GROUP,
5660 .num_ips = ctx->addresses_best_num,
5661 .ips = ctx->addresses_best,
5662 .apply_expected = True
5665 .type = WREPL_TYPE_SGROUP,
5666 .state = WREPL_STATE_TOMBSTONE,
5667 .node = WREPL_NODE_B,
5669 .num_ips = ARRAY_SIZE(addresses_B_1),
5670 .ips = addresses_B_1,
5671 .apply_expected = False
5675 * group vs. multi homed section
5678 * group,released vs. mhomed,active with same ip(s)
5681 .line = __location__,
5682 .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL),
5684 .nb_flags = NBT_NM_GROUP,
5686 .num_ips = ctx->addresses_best_num,
5687 .ips = ctx->addresses_best,
5688 .apply_expected = True
5691 .type = WREPL_TYPE_MHOMED,
5692 .state = WREPL_STATE_ACTIVE,
5693 .node = WREPL_NODE_B,
5695 .num_ips = ctx->addresses_best_num,
5696 .ips = ctx->addresses_best,
5697 .apply_expected = False
5701 * group,released vs. mhomed,active with different ip(s)
5704 .line = __location__,
5705 .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL),
5707 .nb_flags = NBT_NM_GROUP,
5709 .num_ips = ctx->addresses_best_num,
5710 .ips = ctx->addresses_best,
5711 .apply_expected = True
5714 .type = WREPL_TYPE_MHOMED,
5715 .state = WREPL_STATE_ACTIVE,
5716 .node = WREPL_NODE_B,
5718 .num_ips = ARRAY_SIZE(addresses_B_1),
5719 .ips = addresses_B_1,
5720 .apply_expected = False
5724 * group,released vs. mhomed,tombstone with same ip(s)
5727 .line = __location__,
5728 .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL),
5730 .nb_flags = NBT_NM_GROUP,
5732 .num_ips = ctx->addresses_best_num,
5733 .ips = ctx->addresses_best,
5734 .apply_expected = True
5737 .type = WREPL_TYPE_MHOMED,
5738 .state = WREPL_STATE_TOMBSTONE,
5739 .node = WREPL_NODE_B,
5741 .num_ips = ctx->addresses_best_num,
5742 .ips = ctx->addresses_best,
5743 .apply_expected = False
5747 * group,released vs. mhomed,tombstone with different ip(s)
5750 .line = __location__,
5751 .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL),
5753 .nb_flags = NBT_NM_GROUP,
5755 .num_ips = ctx->addresses_best_num,
5756 .ips = ctx->addresses_best,
5757 .apply_expected = True
5760 .type = WREPL_TYPE_MHOMED,
5761 .state = WREPL_STATE_TOMBSTONE,
5762 .node = WREPL_NODE_B,
5764 .num_ips = ARRAY_SIZE(addresses_B_1),
5765 .ips = addresses_B_1,
5766 .apply_expected = False
5770 * special group vs. unique section
5773 * sgroup,released vs. unique,active with same ip(s)
5776 .line = __location__,
5777 .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL),
5779 .nb_flags = NBT_NM_GROUP,
5781 .num_ips = ctx->addresses_best_num,
5782 .ips = ctx->addresses_best,
5783 .apply_expected = True
5786 .type = WREPL_TYPE_UNIQUE,
5787 .state = WREPL_STATE_ACTIVE,
5788 .node = WREPL_NODE_B,
5790 .num_ips = ctx->addresses_best_num,
5791 .ips = ctx->addresses_best,
5792 .apply_expected = True
5796 * sgroup,released vs. unique,active with different ip(s)
5799 .line = __location__,
5800 .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL),
5802 .nb_flags = NBT_NM_GROUP,
5804 .num_ips = ctx->addresses_best_num,
5805 .ips = ctx->addresses_best,
5806 .apply_expected = True
5809 .type = WREPL_TYPE_UNIQUE,
5810 .state = WREPL_STATE_ACTIVE,
5811 .node = WREPL_NODE_B,
5813 .num_ips = ARRAY_SIZE(addresses_B_1),
5814 .ips = addresses_B_1,
5815 .apply_expected = True
5819 * sgroup,released vs. unique,tombstone with same ip(s)
5822 .line = __location__,
5823 .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL),
5825 .nb_flags = NBT_NM_GROUP,
5827 .num_ips = ctx->addresses_best_num,
5828 .ips = ctx->addresses_best,
5829 .apply_expected = True
5832 .type = WREPL_TYPE_UNIQUE,
5833 .state = WREPL_STATE_TOMBSTONE,
5834 .node = WREPL_NODE_B,
5836 .num_ips = ctx->addresses_best_num,
5837 .ips = ctx->addresses_best,
5838 .apply_expected = True
5842 * sgroup,released vs. unique,tombstone with different ip(s)
5845 .line = __location__,
5846 .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL),
5848 .nb_flags = NBT_NM_GROUP,
5850 .num_ips = ctx->addresses_best_num,
5851 .ips = ctx->addresses_best,
5852 .apply_expected = True
5855 .type = WREPL_TYPE_UNIQUE,
5856 .state = WREPL_STATE_TOMBSTONE,
5857 .node = WREPL_NODE_B,
5859 .num_ips = ARRAY_SIZE(addresses_B_1),
5860 .ips = addresses_B_1,
5861 .apply_expected = True
5865 * special group vs. group section
5868 * sgroup,released vs. group,active with same ip(s)
5871 .line = __location__,
5872 .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL),
5874 .nb_flags = NBT_NM_GROUP,
5876 .num_ips = ctx->addresses_best_num,
5877 .ips = ctx->addresses_best,
5878 .apply_expected = True
5881 .type = WREPL_TYPE_GROUP,
5882 .state = WREPL_STATE_ACTIVE,
5883 .node = WREPL_NODE_B,
5885 .num_ips = ctx->addresses_best_num,
5886 .ips = ctx->addresses_best,
5887 .apply_expected = True
5891 * sgroup,released vs. group,active with different ip(s)
5894 .line = __location__,
5895 .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL),
5897 .nb_flags = NBT_NM_GROUP,
5899 .num_ips = ctx->addresses_best_num,
5900 .ips = ctx->addresses_best,
5901 .apply_expected = True
5904 .type = WREPL_TYPE_GROUP,
5905 .state = WREPL_STATE_ACTIVE,
5906 .node = WREPL_NODE_B,
5908 .num_ips = ARRAY_SIZE(addresses_B_1),
5909 .ips = addresses_B_1,
5910 .apply_expected = True
5914 * sgroup,released vs. group,tombstone with same ip(s)
5917 .line = __location__,
5918 .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL),
5920 .nb_flags = NBT_NM_GROUP,
5922 .num_ips = ctx->addresses_best_num,
5923 .ips = ctx->addresses_best,
5924 .apply_expected = True
5927 .type = WREPL_TYPE_GROUP,
5928 .state = WREPL_STATE_TOMBSTONE,
5929 .node = WREPL_NODE_B,
5931 .num_ips = ctx->addresses_best_num,
5932 .ips = ctx->addresses_best,
5933 .apply_expected = True
5937 * sgroup,released vs. group,tombstone with different ip(s)
5940 .line = __location__,
5941 .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL),
5943 .nb_flags = NBT_NM_GROUP,
5945 .num_ips = ctx->addresses_best_num,
5946 .ips = ctx->addresses_best,
5947 .apply_expected = True
5950 .type = WREPL_TYPE_GROUP,
5951 .state = WREPL_STATE_TOMBSTONE,
5952 .node = WREPL_NODE_B,
5954 .num_ips = ARRAY_SIZE(addresses_B_1),
5955 .ips = addresses_B_1,
5956 .apply_expected = True
5960 * special group vs. special group section
5963 * sgroup,released vs. sgroup,active with same ip(s)
5966 .line = __location__,
5967 .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL),
5969 .nb_flags = NBT_NM_GROUP,
5971 .num_ips = ctx->addresses_best_num,
5972 .ips = ctx->addresses_best,
5973 .apply_expected = True
5976 .type = WREPL_TYPE_SGROUP,
5977 .state = WREPL_STATE_ACTIVE,
5978 .node = WREPL_NODE_B,
5980 .num_ips = ctx->addresses_best_num,
5981 .ips = ctx->addresses_best,
5982 .apply_expected = True
5986 * sgroup,released vs. sgroup,active with different ip(s)
5989 .line = __location__,
5990 .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL),
5992 .nb_flags = NBT_NM_GROUP,
5994 .num_ips = ctx->addresses_best_num,
5995 .ips = ctx->addresses_best,
5996 .apply_expected = True
5999 .type = WREPL_TYPE_SGROUP,
6000 .state = WREPL_STATE_ACTIVE,
6001 .node = WREPL_NODE_B,
6003 .num_ips = ARRAY_SIZE(addresses_B_1),
6004 .ips = addresses_B_1,
6005 .apply_expected = True
6009 * sgroup,released vs. sgroup,tombstone with same ip(s)
6012 .line = __location__,
6013 .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL),
6015 .nb_flags = NBT_NM_GROUP,
6017 .num_ips = ctx->addresses_best_num,
6018 .ips = ctx->addresses_best,
6019 .apply_expected = True
6022 .type = WREPL_TYPE_SGROUP,
6023 .state = WREPL_STATE_TOMBSTONE,
6024 .node = WREPL_NODE_B,
6026 .num_ips = ctx->addresses_best_num,
6027 .ips = ctx->addresses_best,
6028 .apply_expected = True
6032 * sgroup,released vs. sgroup,tombstone with different ip(s)
6035 .line = __location__,
6036 .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL),
6038 .nb_flags = NBT_NM_GROUP,
6040 .num_ips = ctx->addresses_best_num,
6041 .ips = ctx->addresses_best,
6042 .apply_expected = True
6045 .type = WREPL_TYPE_SGROUP,
6046 .state = WREPL_STATE_TOMBSTONE,
6047 .node = WREPL_NODE_B,
6049 .num_ips = ARRAY_SIZE(addresses_B_1),
6050 .ips = addresses_B_1,
6051 .apply_expected = True
6055 * special group vs. multi homed section
6058 * sgroup,released vs. mhomed,active with same ip(s)
6061 .line = __location__,
6062 .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL),
6064 .nb_flags = NBT_NM_GROUP,
6066 .num_ips = ctx->addresses_best_num,
6067 .ips = ctx->addresses_best,
6068 .apply_expected = True
6071 .type = WREPL_TYPE_MHOMED,
6072 .state = WREPL_STATE_ACTIVE,
6073 .node = WREPL_NODE_B,
6075 .num_ips = ctx->addresses_best_num,
6076 .ips = ctx->addresses_best,
6077 .apply_expected = True
6081 * sgroup,released vs. mhomed,active with different ip(s)
6084 .line = __location__,
6085 .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL),
6087 .nb_flags = NBT_NM_GROUP,
6089 .num_ips = ctx->addresses_best_num,
6090 .ips = ctx->addresses_best,
6091 .apply_expected = True
6094 .type = WREPL_TYPE_MHOMED,
6095 .state = WREPL_STATE_ACTIVE,
6096 .node = WREPL_NODE_B,
6098 .num_ips = ARRAY_SIZE(addresses_B_1),
6099 .ips = addresses_B_1,
6100 .apply_expected = True
6104 * sgroup,released vs. mhomed,tombstone with same ip(s)
6107 .line = __location__,
6108 .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL),
6110 .nb_flags = NBT_NM_GROUP,
6112 .num_ips = ctx->addresses_best_num,
6113 .ips = ctx->addresses_best,
6114 .apply_expected = True
6117 .type = WREPL_TYPE_MHOMED,
6118 .state = WREPL_STATE_TOMBSTONE,
6119 .node = WREPL_NODE_B,
6121 .num_ips = ctx->addresses_best_num,
6122 .ips = ctx->addresses_best,
6123 .apply_expected = True
6127 * sgroup,released vs. mhomed,tombstone with different ip(s)
6130 .line = __location__,
6131 .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL),
6133 .nb_flags = NBT_NM_GROUP,
6135 .num_ips = ctx->addresses_best_num,
6136 .ips = ctx->addresses_best,
6137 .apply_expected = True
6140 .type = WREPL_TYPE_MHOMED,
6141 .state = WREPL_STATE_TOMBSTONE,
6142 .node = WREPL_NODE_B,
6144 .num_ips = ARRAY_SIZE(addresses_B_1),
6145 .ips = addresses_B_1,
6146 .apply_expected = True
6150 * multi homed vs. unique section
6153 * mhomed,released vs. unique,active with same ip(s)
6156 .line = __location__,
6157 .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL),
6161 .num_ips = ctx->addresses_best_num,
6162 .ips = ctx->addresses_best,
6163 .apply_expected = True
6166 .type = WREPL_TYPE_UNIQUE,
6167 .state = WREPL_STATE_ACTIVE,
6168 .node = WREPL_NODE_B,
6170 .num_ips = ctx->addresses_best_num,
6171 .ips = ctx->addresses_best,
6172 .apply_expected = True
6176 * mhomed,released vs. unique,active with different ip(s)
6179 .line = __location__,
6180 .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL),
6184 .num_ips = ctx->addresses_best_num,
6185 .ips = ctx->addresses_best,
6186 .apply_expected = True
6189 .type = WREPL_TYPE_UNIQUE,
6190 .state = WREPL_STATE_ACTIVE,
6191 .node = WREPL_NODE_B,
6193 .num_ips = ARRAY_SIZE(addresses_B_1),
6194 .ips = addresses_B_1,
6195 .apply_expected = True
6199 * mhomed,released vs. unique,tombstone with same ip(s)
6202 .line = __location__,
6203 .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL),
6207 .num_ips = ctx->addresses_best_num,
6208 .ips = ctx->addresses_best,
6209 .apply_expected = True
6212 .type = WREPL_TYPE_UNIQUE,
6213 .state = WREPL_STATE_TOMBSTONE,
6214 .node = WREPL_NODE_B,
6216 .num_ips = ctx->addresses_best_num,
6217 .ips = ctx->addresses_best,
6218 .apply_expected = True
6222 * mhomed,released vs. unique,tombstone with different ip(s)
6225 .line = __location__,
6226 .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL),
6230 .num_ips = ctx->addresses_best_num,
6231 .ips = ctx->addresses_best,
6232 .apply_expected = True
6235 .type = WREPL_TYPE_UNIQUE,
6236 .state = WREPL_STATE_TOMBSTONE,
6237 .node = WREPL_NODE_B,
6239 .num_ips = ARRAY_SIZE(addresses_B_1),
6240 .ips = addresses_B_1,
6241 .apply_expected = True
6245 * multi homed vs. group section
6248 * mhomed,released vs. group,active with same ip(s)
6251 .line = __location__,
6252 .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL),
6256 .num_ips = ctx->addresses_best_num,
6257 .ips = ctx->addresses_best,
6258 .apply_expected = True
6261 .type = WREPL_TYPE_GROUP,
6262 .state = WREPL_STATE_ACTIVE,
6263 .node = WREPL_NODE_B,
6265 .num_ips = ctx->addresses_best_num,
6266 .ips = ctx->addresses_best,
6267 .apply_expected = True
6271 * mhomed,released vs. group,active with different ip(s)
6274 .line = __location__,
6275 .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL),
6279 .num_ips = ctx->addresses_best_num,
6280 .ips = ctx->addresses_best,
6281 .apply_expected = True
6284 .type = WREPL_TYPE_GROUP,
6285 .state = WREPL_STATE_ACTIVE,
6286 .node = WREPL_NODE_B,
6288 .num_ips = ARRAY_SIZE(addresses_B_1),
6289 .ips = addresses_B_1,
6290 .apply_expected = True
6294 * mhomed,released vs. group,tombstone with same ip(s)
6297 .line = __location__,
6298 .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL),
6302 .num_ips = ctx->addresses_best_num,
6303 .ips = ctx->addresses_best,
6304 .apply_expected = True
6307 .type = WREPL_TYPE_GROUP,
6308 .state = WREPL_STATE_TOMBSTONE,
6309 .node = WREPL_NODE_B,
6311 .num_ips = ctx->addresses_best_num,
6312 .ips = ctx->addresses_best,
6313 .apply_expected = True
6317 * mhomed,released vs. group,tombstone with different ip(s)
6320 .line = __location__,
6321 .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL),
6325 .num_ips = ctx->addresses_best_num,
6326 .ips = ctx->addresses_best,
6327 .apply_expected = True
6330 .type = WREPL_TYPE_GROUP,
6331 .state = WREPL_STATE_TOMBSTONE,
6332 .node = WREPL_NODE_B,
6334 .num_ips = ARRAY_SIZE(addresses_B_1),
6335 .ips = addresses_B_1,
6336 .apply_expected = True
6340 * multi homed vs. special group section
6343 * mhomed,released vs. sgroup,active with same ip(s)
6346 .line = __location__,
6347 .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL),
6351 .num_ips = ctx->addresses_best_num,
6352 .ips = ctx->addresses_best,
6353 .apply_expected = True
6356 .type = WREPL_TYPE_SGROUP,
6357 .state = WREPL_STATE_ACTIVE,
6358 .node = WREPL_NODE_B,
6360 .num_ips = ctx->addresses_best_num,
6361 .ips = ctx->addresses_best,
6362 .apply_expected = True
6366 * mhomed,released vs. sgroup,active with different ip(s)
6369 .line = __location__,
6370 .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL),
6374 .num_ips = ctx->addresses_best_num,
6375 .ips = ctx->addresses_best,
6376 .apply_expected = True
6379 .type = WREPL_TYPE_SGROUP,
6380 .state = WREPL_STATE_ACTIVE,
6381 .node = WREPL_NODE_B,
6383 .num_ips = ARRAY_SIZE(addresses_B_1),
6384 .ips = addresses_B_1,
6385 .apply_expected = True
6389 * mhomed,released vs. sgroup,tombstone with same ip(s)
6392 .line = __location__,
6393 .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL),
6397 .num_ips = ctx->addresses_best_num,
6398 .ips = ctx->addresses_best,
6399 .apply_expected = True
6402 .type = WREPL_TYPE_SGROUP,
6403 .state = WREPL_STATE_TOMBSTONE,
6404 .node = WREPL_NODE_B,
6406 .num_ips = ctx->addresses_best_num,
6407 .ips = ctx->addresses_best,
6408 .apply_expected = True
6412 * mhomed,released vs. sgroup,tombstone with different ip(s)
6415 .line = __location__,
6416 .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL),
6420 .num_ips = ctx->addresses_best_num,
6421 .ips = ctx->addresses_best,
6422 .apply_expected = True
6425 .type = WREPL_TYPE_SGROUP,
6426 .state = WREPL_STATE_TOMBSTONE,
6427 .node = WREPL_NODE_B,
6429 .num_ips = ARRAY_SIZE(addresses_B_1),
6430 .ips = addresses_B_1,
6431 .apply_expected = True
6435 * multi homed vs. multi homed section
6438 * mhomed,released vs. mhomed,active with same ip(s)
6441 .line = __location__,
6442 .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL),
6446 .num_ips = ctx->addresses_best_num,
6447 .ips = ctx->addresses_best,
6448 .apply_expected = True
6451 .type = WREPL_TYPE_MHOMED,
6452 .state = WREPL_STATE_ACTIVE,
6453 .node = WREPL_NODE_B,
6455 .num_ips = ctx->addresses_best_num,
6456 .ips = ctx->addresses_best,
6457 .apply_expected = True
6461 * mhomed,released vs. mhomed,active with different ip(s)
6464 .line = __location__,
6465 .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL),
6469 .num_ips = ctx->addresses_best_num,
6470 .ips = ctx->addresses_best,
6471 .apply_expected = True
6474 .type = WREPL_TYPE_MHOMED,
6475 .state = WREPL_STATE_ACTIVE,
6476 .node = WREPL_NODE_B,
6478 .num_ips = ARRAY_SIZE(addresses_B_1),
6479 .ips = addresses_B_1,
6480 .apply_expected = True
6484 * mhomed,released vs. mhomed,tombstone with same ip(s)
6487 .line = __location__,
6488 .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL),
6492 .num_ips = ctx->addresses_best_num,
6493 .ips = ctx->addresses_best,
6494 .apply_expected = True
6497 .type = WREPL_TYPE_MHOMED,
6498 .state = WREPL_STATE_TOMBSTONE,
6499 .node = WREPL_NODE_B,
6501 .num_ips = ctx->addresses_best_num,
6502 .ips = ctx->addresses_best,
6503 .apply_expected = True
6507 * mhomed,released vs. mhomed,tombstone with different ip(s)
6510 .line = __location__,
6511 .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL),
6515 .num_ips = ctx->addresses_best_num,
6516 .ips = ctx->addresses_best,
6517 .apply_expected = True
6520 .type = WREPL_TYPE_MHOMED,
6521 .state = WREPL_STATE_TOMBSTONE,
6522 .node = WREPL_NODE_B,
6524 .num_ips = ARRAY_SIZE(addresses_B_1),
6525 .ips = addresses_B_1,
6526 .apply_expected = True
6531 printf("Test Replica records vs. owned released records\n");
6533 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
6534 printf("%s => %s\n", nbt_name_string(ctx, &records[i].name),
6535 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
6540 name_register->in.name = records[i].name;
6541 name_register->in.dest_addr = ctx->address;
6542 name_register->in.address = records[i].wins.ips[0].ip;
6543 name_register->in.nb_flags = records[i].wins.nb_flags;
6544 name_register->in.register_demand= False;
6545 name_register->in.broadcast = False;
6546 name_register->in.multi_homed = records[i].wins.mhomed;
6547 name_register->in.ttl = 300000;
6548 name_register->in.timeout = 70;
6549 name_register->in.retries = 0;
6551 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
6552 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6553 printf("No response from %s for name register\n", ctx->address);
6556 if (!NT_STATUS_IS_OK(status)) {
6557 printf("Bad response from %s for name register - %s\n",
6558 ctx->address, nt_errstr(status));
6561 CHECK_VALUE(name_register->out.rcode, 0);
6562 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
6563 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
6564 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
6565 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
6566 CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[0].ip);
6568 /* release the record */
6569 release->in.name = records[i].name;
6570 release->in.dest_addr = ctx->address;
6571 release->in.address = records[i].wins.ips[0].ip;
6572 release->in.nb_flags = records[i].wins.nb_flags;
6573 release->in.broadcast = False;
6574 release->in.timeout = 30;
6575 release->in.retries = 0;
6577 status = nbt_name_release(ctx->nbtsock, ctx, release);
6578 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6579 printf("No response from %s for name release\n", ctx->address);
6582 if (!NT_STATUS_IS_OK(status)) {
6583 printf("Bad response from %s for name query - %s\n",
6584 ctx->address, nt_errstr(status));
6587 CHECK_VALUE(release->out.rcode, 0);
6592 wins_name->name = &records[i].name;
6593 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
6594 records[i].replica.state,
6595 records[i].replica.node,
6596 records[i].replica.is_static);
6597 wins_name->id = ++ctx->b.max_version;
6598 if (wins_name->flags & 2) {
6599 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
6600 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
6602 wins_name->addresses.ip = records[i].replica.ips[0].ip;
6604 wins_name->unknown = "255.255.255.255";
6606 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
6607 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
6608 records[i].replica.apply_expected);
6610 if (records[i].replica.apply_expected) {
6611 wins_name->name = &records[i].name;
6612 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
6613 WREPL_STATE_TOMBSTONE,
6614 WREPL_NODE_B, False);
6615 wins_name->id = ++ctx->b.max_version;
6616 wins_name->addresses.ip = addresses_B_1[0].ip;
6617 wins_name->unknown = "255.255.255.255";
6619 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
6620 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
6622 release->in.name = records[i].name;
6623 release->in.dest_addr = ctx->address;
6624 release->in.address = records[i].wins.ips[0].ip;
6625 release->in.nb_flags = records[i].wins.nb_flags;
6626 release->in.broadcast = False;
6627 release->in.timeout = 30;
6628 release->in.retries = 0;
6630 status = nbt_name_release(ctx->nbtsock, ctx, release);
6631 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6632 printf("No response from %s for name release\n", ctx->address);
6635 if (!NT_STATUS_IS_OK(status)) {
6636 printf("Bad response from %s for name query - %s\n",
6637 ctx->address, nt_errstr(status));
6640 CHECK_VALUE(release->out.rcode, 0);
6644 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
6652 struct test_conflict_owned_active_vs_replica_struct {
6653 const char *line; /* just better debugging */
6654 const char *section; /* just better debugging */
6655 struct nbt_name name;
6656 const char *comment;
6662 const struct wrepl_ip *ips;
6663 BOOL apply_expected;
6668 BOOL expect_release;
6671 /* when num_ips == 0, then .wins.ips are used */
6673 const struct wrepl_ip *ips;
6676 enum wrepl_name_type type;
6677 enum wrepl_name_state state;
6678 enum wrepl_name_node node;
6681 const struct wrepl_ip *ips;
6682 BOOL apply_expected;
6688 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
6689 struct nbt_name_packet *req_packet,
6690 struct socket_address *src);
6692 static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_conn *ctx)
6696 struct wrepl_wins_name wins_name_;
6697 struct wrepl_wins_name *wins_name = &wins_name_;
6698 struct nbt_name_register name_register_;
6699 struct nbt_name_register *name_register = &name_register_;
6700 struct nbt_name_release release_;
6701 struct nbt_name_release *release = &release_;
6703 struct test_conflict_owned_active_vs_replica_struct records[] = {
6705 * unique vs. unique section
6708 * unique,active vs. unique,active with same ip(s), unchecked
6711 .line = __location__,
6712 .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL),
6716 .num_ips = ctx->addresses_best_num,
6717 .ips = ctx->addresses_best,
6718 .apply_expected = True
6724 .type = WREPL_TYPE_UNIQUE,
6725 .state = WREPL_STATE_ACTIVE,
6726 .node = WREPL_NODE_B,
6728 .num_ips = ctx->addresses_best_num,
6729 .ips = ctx->addresses_best,
6730 .apply_expected = True
6734 * unique,active vs. unique,active with different ip(s), positive response
6737 .line = __location__,
6738 .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL),
6742 .num_ips = ctx->addresses_best_num,
6743 .ips = ctx->addresses_best,
6744 .apply_expected = True
6751 .type = WREPL_TYPE_UNIQUE,
6752 .state = WREPL_STATE_ACTIVE,
6753 .node = WREPL_NODE_B,
6755 .num_ips = ARRAY_SIZE(addresses_B_1),
6756 .ips = addresses_B_1,
6757 .apply_expected = False
6761 * unique,active vs. unique,active with different ip(s), positive response other ips
6764 .line = __location__,
6765 .name = _NBT_NAME("_UA_UA_DI_O", 0x00, NULL),
6769 .num_ips = ctx->addresses_best_num,
6770 .ips = ctx->addresses_best,
6771 .apply_expected = True
6776 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6777 .ips = addresses_A_3_4,
6780 .type = WREPL_TYPE_UNIQUE,
6781 .state = WREPL_STATE_ACTIVE,
6782 .node = WREPL_NODE_B,
6784 .num_ips = ARRAY_SIZE(addresses_B_1),
6785 .ips = addresses_B_1,
6786 .apply_expected = False
6790 * unique,active vs. unique,active with different ip(s), negative response
6793 .line = __location__,
6794 .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL),
6798 .num_ips = ctx->addresses_best_num,
6799 .ips = ctx->addresses_best,
6800 .apply_expected = True
6807 .type = WREPL_TYPE_UNIQUE,
6808 .state = WREPL_STATE_ACTIVE,
6809 .node = WREPL_NODE_B,
6811 .num_ips = ARRAY_SIZE(addresses_B_1),
6812 .ips = addresses_B_1,
6813 .apply_expected = True
6817 * unique,active vs. unique,tombstone with same ip(s), unchecked
6820 .line = __location__,
6821 .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL),
6825 .num_ips = ctx->addresses_best_num,
6826 .ips = ctx->addresses_best,
6827 .apply_expected = True
6833 .type = WREPL_TYPE_UNIQUE,
6834 .state = WREPL_STATE_TOMBSTONE,
6835 .node = WREPL_NODE_B,
6837 .num_ips = ctx->addresses_best_num,
6838 .ips = ctx->addresses_best,
6839 .apply_expected = False
6843 * unique,active vs. unique,tombstone with different ip(s), unchecked
6846 .line = __location__,
6847 .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL),
6851 .num_ips = ctx->addresses_best_num,
6852 .ips = ctx->addresses_best,
6853 .apply_expected = True
6859 .type = WREPL_TYPE_UNIQUE,
6860 .state = WREPL_STATE_TOMBSTONE,
6861 .node = WREPL_NODE_B,
6863 .num_ips = ARRAY_SIZE(addresses_B_1),
6864 .ips = addresses_B_1,
6865 .apply_expected = False
6869 * unique vs. group section
6872 * unique,active vs. group,active with same ip(s), release expected
6875 .line = __location__,
6876 .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL),
6880 .num_ips = ctx->addresses_best_num,
6881 .ips = ctx->addresses_best,
6882 .apply_expected = True
6886 .expect_release = True,
6889 .type = WREPL_TYPE_GROUP,
6890 .state = WREPL_STATE_ACTIVE,
6891 .node = WREPL_NODE_B,
6893 .num_ips = ctx->addresses_best_num,
6894 .ips = ctx->addresses_best,
6895 .apply_expected = True
6899 * unique,active vs. group,active with different ip(s), release expected
6902 .line = __location__,
6903 .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL),
6907 .num_ips = ctx->addresses_best_num,
6908 .ips = ctx->addresses_best,
6909 .apply_expected = True
6913 .expect_release = True,
6916 .type = WREPL_TYPE_GROUP,
6917 .state = WREPL_STATE_ACTIVE,
6918 .node = WREPL_NODE_B,
6920 .num_ips = ARRAY_SIZE(addresses_B_1),
6921 .ips = addresses_B_1,
6922 .apply_expected = True
6926 * unique,active vs. group,tombstone with same ip(s), unchecked
6929 .line = __location__,
6930 .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL),
6934 .num_ips = ctx->addresses_best_num,
6935 .ips = ctx->addresses_best,
6936 .apply_expected = True
6942 .type = WREPL_TYPE_GROUP,
6943 .state = WREPL_STATE_TOMBSTONE,
6944 .node = WREPL_NODE_B,
6946 .num_ips = ctx->addresses_best_num,
6947 .ips = ctx->addresses_best,
6948 .apply_expected = False
6952 * unique,active vs. group,tombstone with different ip(s), unchecked
6955 .line = __location__,
6956 .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL),
6960 .num_ips = ctx->addresses_best_num,
6961 .ips = ctx->addresses_best,
6962 .apply_expected = True
6968 .type = WREPL_TYPE_GROUP,
6969 .state = WREPL_STATE_TOMBSTONE,
6970 .node = WREPL_NODE_B,
6972 .num_ips = ARRAY_SIZE(addresses_B_1),
6973 .ips = addresses_B_1,
6974 .apply_expected = False
6978 * unique vs. special group section
6981 * unique,active vs. sgroup,active with same ip(s), release expected
6984 .line = __location__,
6985 .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL),
6989 .num_ips = ctx->addresses_best_num,
6990 .ips = ctx->addresses_best,
6991 .apply_expected = True
6995 .expect_release = True,
6998 .type = WREPL_TYPE_SGROUP,
6999 .state = WREPL_STATE_ACTIVE,
7000 .node = WREPL_NODE_B,
7002 .num_ips = ctx->addresses_best_num,
7003 .ips = ctx->addresses_best,
7004 .apply_expected = True
7008 * unique,active vs. group,active with different ip(s), release expected
7011 .line = __location__,
7012 .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL),
7016 .num_ips = ctx->addresses_best_num,
7017 .ips = ctx->addresses_best,
7018 .apply_expected = True
7022 .expect_release = True,
7025 .type = WREPL_TYPE_SGROUP,
7026 .state = WREPL_STATE_ACTIVE,
7027 .node = WREPL_NODE_B,
7029 .num_ips = ARRAY_SIZE(addresses_B_1),
7030 .ips = addresses_B_1,
7031 .apply_expected = True
7035 * unique,active vs. sgroup,tombstone with same ip(s), unchecked
7038 .line = __location__,
7039 .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL),
7043 .num_ips = ctx->addresses_best_num,
7044 .ips = ctx->addresses_best,
7045 .apply_expected = True
7051 .type = WREPL_TYPE_SGROUP,
7052 .state = WREPL_STATE_TOMBSTONE,
7053 .node = WREPL_NODE_B,
7055 .num_ips = ctx->addresses_best_num,
7056 .ips = ctx->addresses_best,
7057 .apply_expected = False
7061 * unique,active vs. sgroup,tombstone with different ip(s), unchecked
7064 .line = __location__,
7065 .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL),
7069 .num_ips = ctx->addresses_best_num,
7070 .ips = ctx->addresses_best,
7071 .apply_expected = True
7077 .type = WREPL_TYPE_SGROUP,
7078 .state = WREPL_STATE_TOMBSTONE,
7079 .node = WREPL_NODE_B,
7081 .num_ips = ARRAY_SIZE(addresses_B_1),
7082 .ips = addresses_B_1,
7083 .apply_expected = False
7087 * unique vs. multi homed section
7090 * unique,active vs. mhomed,active with same ip(s), unchecked
7093 .line = __location__,
7094 .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL),
7098 .num_ips = ctx->addresses_best_num,
7099 .ips = ctx->addresses_best,
7100 .apply_expected = True
7106 .type = WREPL_TYPE_MHOMED,
7107 .state = WREPL_STATE_ACTIVE,
7108 .node = WREPL_NODE_B,
7110 .num_ips = ctx->addresses_best_num,
7111 .ips = ctx->addresses_best,
7112 .apply_expected = True
7116 * unique,active vs. mhomed,active with superset ip(s), unchecked
7119 .line = __location__,
7120 .name = _NBT_NAME("_UA_MA_SP_U", 0x00, NULL),
7124 .num_ips = ctx->addresses_best_num,
7125 .ips = ctx->addresses_best,
7126 .apply_expected = True
7132 .type = WREPL_TYPE_MHOMED,
7133 .state = WREPL_STATE_ACTIVE,
7134 .node = WREPL_NODE_B,
7136 .num_ips = ctx->addresses_all_num,
7137 .ips = ctx->addresses_all,
7138 .apply_expected = True
7142 * unique,active vs. mhomed,active with different ip(s), positive response
7145 .line = __location__,
7146 .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL),
7150 .num_ips = ctx->addresses_best_num,
7151 .ips = ctx->addresses_best,
7152 .apply_expected = True
7159 .type = WREPL_TYPE_MHOMED,
7160 .state = WREPL_STATE_ACTIVE,
7161 .node = WREPL_NODE_B,
7163 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7164 .ips = addresses_B_3_4,
7165 .apply_expected = False
7169 * unique,active vs. mhomed,active with different ip(s), positive response other ips
7172 .line = __location__,
7173 .name = _NBT_NAME("_UA_MA_DI_O", 0x00, NULL),
7177 .num_ips = ctx->addresses_best_num,
7178 .ips = ctx->addresses_best,
7179 .apply_expected = True
7184 .num_ips = ARRAY_SIZE(addresses_A_3_4),
7185 .ips = addresses_A_3_4,
7188 .type = WREPL_TYPE_MHOMED,
7189 .state = WREPL_STATE_ACTIVE,
7190 .node = WREPL_NODE_B,
7192 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7193 .ips = addresses_B_3_4,
7194 .apply_expected = False
7198 * unique,active vs. mhomed,active with different ip(s), negative response
7201 .line = __location__,
7202 .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL),
7206 .num_ips = ctx->addresses_best_num,
7207 .ips = ctx->addresses_best,
7208 .apply_expected = True
7215 .type = WREPL_TYPE_MHOMED,
7216 .state = WREPL_STATE_ACTIVE,
7217 .node = WREPL_NODE_B,
7219 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7220 .ips = addresses_B_3_4,
7221 .apply_expected = True
7225 * unique,active vs. mhomed,tombstone with same ip(s), unchecked
7228 .line = __location__,
7229 .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL),
7233 .num_ips = ctx->addresses_best_num,
7234 .ips = ctx->addresses_best,
7235 .apply_expected = True
7241 .type = WREPL_TYPE_MHOMED,
7242 .state = WREPL_STATE_TOMBSTONE,
7243 .node = WREPL_NODE_B,
7245 .num_ips = ctx->addresses_best_num,
7246 .ips = ctx->addresses_best,
7247 .apply_expected = False
7251 * unique,active vs. mhomed,tombstone with different ip(s), unchecked
7254 .line = __location__,
7255 .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL),
7259 .num_ips = ctx->addresses_best_num,
7260 .ips = ctx->addresses_best,
7261 .apply_expected = True
7267 .type = WREPL_TYPE_MHOMED,
7268 .state = WREPL_STATE_TOMBSTONE,
7269 .node = WREPL_NODE_B,
7271 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7272 .ips = addresses_B_3_4,
7273 .apply_expected = False
7277 * normal group vs. unique section
7280 * group,active vs. unique,active with same ip(s), unchecked
7283 .line = __location__,
7284 .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL),
7286 .nb_flags = NBT_NM_GROUP,
7288 .num_ips = ctx->addresses_best_num,
7289 .ips = ctx->addresses_best,
7290 .apply_expected = True
7296 .type = WREPL_TYPE_UNIQUE,
7297 .state = WREPL_STATE_ACTIVE,
7298 .node = WREPL_NODE_B,
7300 .num_ips = ctx->addresses_best_num,
7301 .ips = ctx->addresses_best,
7302 .apply_expected = False
7306 * group,active vs. unique,active with different ip(s), unchecked
7309 .line = __location__,
7310 .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL),
7312 .nb_flags = NBT_NM_GROUP,
7314 .num_ips = ctx->addresses_best_num,
7315 .ips = ctx->addresses_best,
7316 .apply_expected = True
7322 .type = WREPL_TYPE_UNIQUE,
7323 .state = WREPL_STATE_ACTIVE,
7324 .node = WREPL_NODE_B,
7326 .num_ips = ARRAY_SIZE(addresses_B_1),
7327 .ips = addresses_B_1,
7328 .apply_expected = False
7332 * group,active vs. unique,tombstone with same ip(s), unchecked
7335 .line = __location__,
7336 .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL),
7338 .nb_flags = NBT_NM_GROUP,
7340 .num_ips = ctx->addresses_best_num,
7341 .ips = ctx->addresses_best,
7342 .apply_expected = True
7348 .type = WREPL_TYPE_UNIQUE,
7349 .state = WREPL_STATE_TOMBSTONE,
7350 .node = WREPL_NODE_B,
7352 .num_ips = ctx->addresses_best_num,
7353 .ips = ctx->addresses_best,
7354 .apply_expected = False
7358 * group,active vs. unique,tombstone with different ip(s), unchecked
7361 .line = __location__,
7362 .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL),
7364 .nb_flags = NBT_NM_GROUP,
7366 .num_ips = ctx->addresses_best_num,
7367 .ips = ctx->addresses_best,
7368 .apply_expected = True
7374 .type = WREPL_TYPE_UNIQUE,
7375 .state = WREPL_STATE_TOMBSTONE,
7376 .node = WREPL_NODE_B,
7378 .num_ips = ARRAY_SIZE(addresses_B_1),
7379 .ips = addresses_B_1,
7380 .apply_expected = False
7384 * normal group vs. normal group section
7387 * group,active vs. group,active with same ip(s), unchecked
7390 .line = __location__,
7391 .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL),
7393 .nb_flags = NBT_NM_GROUP,
7395 .num_ips = ctx->addresses_best_num,
7396 .ips = ctx->addresses_best,
7397 .apply_expected = True
7403 .type = WREPL_TYPE_GROUP,
7404 .state = WREPL_STATE_ACTIVE,
7405 .node = WREPL_NODE_B,
7407 .num_ips = ctx->addresses_best_num,
7408 .ips = ctx->addresses_best,
7409 .apply_expected = True
7413 * group,active vs. group,active with different ip(s), unchecked
7416 .line = __location__,
7417 .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL),
7419 .nb_flags = NBT_NM_GROUP,
7421 .num_ips = ctx->addresses_best_num,
7422 .ips = ctx->addresses_best,
7423 .apply_expected = True
7429 .type = WREPL_TYPE_GROUP,
7430 .state = WREPL_STATE_ACTIVE,
7431 .node = WREPL_NODE_B,
7433 .num_ips = ARRAY_SIZE(addresses_B_1),
7434 .ips = addresses_B_1,
7435 .apply_expected = True
7439 * group,active vs. group,tombstone with same ip(s), unchecked
7442 .line = __location__,
7443 .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL),
7445 .nb_flags = NBT_NM_GROUP,
7447 .num_ips = ctx->addresses_best_num,
7448 .ips = ctx->addresses_best,
7449 .apply_expected = True
7455 .type = WREPL_TYPE_GROUP,
7456 .state = WREPL_STATE_TOMBSTONE,
7457 .node = WREPL_NODE_B,
7459 .num_ips = ctx->addresses_best_num,
7460 .ips = ctx->addresses_best,
7461 .apply_expected = False
7465 * group,active vs. group,tombstone with different ip(s), unchecked
7468 .line = __location__,
7469 .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL),
7471 .nb_flags = NBT_NM_GROUP,
7473 .num_ips = ctx->addresses_best_num,
7474 .ips = ctx->addresses_best,
7475 .apply_expected = True
7481 .type = WREPL_TYPE_GROUP,
7482 .state = WREPL_STATE_TOMBSTONE,
7483 .node = WREPL_NODE_B,
7485 .num_ips = ARRAY_SIZE(addresses_B_1),
7486 .ips = addresses_B_1,
7487 .apply_expected = False
7491 * normal group vs. special group section
7494 * group,active vs. sgroup,active with same ip(s), unchecked
7497 .line = __location__,
7498 .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL),
7500 .nb_flags = NBT_NM_GROUP,
7502 .num_ips = ctx->addresses_best_num,
7503 .ips = ctx->addresses_best,
7504 .apply_expected = True
7510 .type = WREPL_TYPE_SGROUP,
7511 .state = WREPL_STATE_ACTIVE,
7512 .node = WREPL_NODE_B,
7514 .num_ips = ctx->addresses_best_num,
7515 .ips = ctx->addresses_best,
7516 .apply_expected = False
7520 * group,active vs. sgroup,active with different ip(s), unchecked
7523 .line = __location__,
7524 .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL),
7526 .nb_flags = NBT_NM_GROUP,
7528 .num_ips = ctx->addresses_best_num,
7529 .ips = ctx->addresses_best,
7530 .apply_expected = True
7536 .type = WREPL_TYPE_SGROUP,
7537 .state = WREPL_STATE_ACTIVE,
7538 .node = WREPL_NODE_B,
7540 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7541 .ips = addresses_B_3_4,
7542 .apply_expected = False
7546 * group,active vs. sgroup,tombstone with same ip(s), unchecked
7549 .line = __location__,
7550 .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL),
7552 .nb_flags = NBT_NM_GROUP,
7554 .num_ips = ctx->addresses_best_num,
7555 .ips = ctx->addresses_best,
7556 .apply_expected = True
7562 .type = WREPL_TYPE_SGROUP,
7563 .state = WREPL_STATE_TOMBSTONE,
7564 .node = WREPL_NODE_B,
7566 .num_ips = ctx->addresses_best_num,
7567 .ips = ctx->addresses_best,
7568 .apply_expected = False
7572 * group,active vs. sgroup,tombstone with different ip(s), unchecked
7575 .line = __location__,
7576 .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL),
7578 .nb_flags = NBT_NM_GROUP,
7580 .num_ips = ctx->addresses_best_num,
7581 .ips = ctx->addresses_best,
7582 .apply_expected = True
7588 .type = WREPL_TYPE_SGROUP,
7589 .state = WREPL_STATE_TOMBSTONE,
7590 .node = WREPL_NODE_B,
7592 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7593 .ips = addresses_B_3_4,
7594 .apply_expected = False
7598 * normal group vs. multi homed section
7601 * group,active vs. mhomed,active with same ip(s), unchecked
7604 .line = __location__,
7605 .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL),
7607 .nb_flags = NBT_NM_GROUP,
7609 .num_ips = ctx->addresses_best_num,
7610 .ips = ctx->addresses_best,
7611 .apply_expected = True
7617 .type = WREPL_TYPE_MHOMED,
7618 .state = WREPL_STATE_ACTIVE,
7619 .node = WREPL_NODE_B,
7621 .num_ips = ctx->addresses_best_num,
7622 .ips = ctx->addresses_best,
7623 .apply_expected = False
7627 * group,active vs. mhomed,active with different ip(s), unchecked
7630 .line = __location__,
7631 .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL),
7633 .nb_flags = NBT_NM_GROUP,
7635 .num_ips = ctx->addresses_best_num,
7636 .ips = ctx->addresses_best,
7637 .apply_expected = True
7643 .type = WREPL_TYPE_MHOMED,
7644 .state = WREPL_STATE_ACTIVE,
7645 .node = WREPL_NODE_B,
7647 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7648 .ips = addresses_B_3_4,
7649 .apply_expected = False
7653 * group,active vs. mhomed,tombstone with same ip(s), unchecked
7656 .line = __location__,
7657 .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL),
7659 .nb_flags = NBT_NM_GROUP,
7661 .num_ips = ctx->addresses_best_num,
7662 .ips = ctx->addresses_best,
7663 .apply_expected = True
7669 .type = WREPL_TYPE_MHOMED,
7670 .state = WREPL_STATE_TOMBSTONE,
7671 .node = WREPL_NODE_B,
7673 .num_ips = ctx->addresses_best_num,
7674 .ips = ctx->addresses_best,
7675 .apply_expected = False
7679 * group,active vs. mhomed,tombstone with different ip(s), unchecked
7682 .line = __location__,
7683 .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL),
7685 .nb_flags = NBT_NM_GROUP,
7687 .num_ips = ctx->addresses_best_num,
7688 .ips = ctx->addresses_best,
7689 .apply_expected = True
7695 .type = WREPL_TYPE_MHOMED,
7696 .state = WREPL_STATE_TOMBSTONE,
7697 .node = WREPL_NODE_B,
7699 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7700 .ips = addresses_B_3_4,
7701 .apply_expected = False
7705 * special group vs. unique section
7708 * sgroup,active vs. unique,active with same ip(s), unchecked
7711 .line = __location__,
7712 .name = _NBT_NAME("_SA_UA_SI_U", 0x1C, NULL),
7714 .nb_flags = NBT_NM_GROUP,
7716 .num_ips = ctx->addresses_best_num,
7717 .ips = ctx->addresses_best,
7718 .apply_expected = True
7724 .type = WREPL_TYPE_UNIQUE,
7725 .state = WREPL_STATE_ACTIVE,
7726 .node = WREPL_NODE_B,
7728 .num_ips = ctx->addresses_best_num,
7729 .ips = ctx->addresses_best,
7730 .apply_expected = False
7734 * sgroup,active vs. unique,active with different ip(s), unchecked
7737 .line = __location__,
7738 .name = _NBT_NAME("_SA_UA_DI_U", 0x1C, NULL),
7740 .nb_flags = NBT_NM_GROUP,
7742 .num_ips = ctx->addresses_best_num,
7743 .ips = ctx->addresses_best,
7744 .apply_expected = True
7750 .type = WREPL_TYPE_UNIQUE,
7751 .state = WREPL_STATE_ACTIVE,
7752 .node = WREPL_NODE_B,
7754 .num_ips = ARRAY_SIZE(addresses_B_1),
7755 .ips = addresses_B_1,
7756 .apply_expected = False
7760 * sgroup,active vs. unique,tombstone with same ip(s), unchecked
7763 .line = __location__,
7764 .name = _NBT_NAME("_SA_UT_SI_U", 0x1C, NULL),
7766 .nb_flags = NBT_NM_GROUP,
7768 .num_ips = ctx->addresses_best_num,
7769 .ips = ctx->addresses_best,
7770 .apply_expected = True
7776 .type = WREPL_TYPE_UNIQUE,
7777 .state = WREPL_STATE_TOMBSTONE,
7778 .node = WREPL_NODE_B,
7780 .num_ips = ctx->addresses_best_num,
7781 .ips = ctx->addresses_best,
7782 .apply_expected = False
7786 * sgroup,active vs. unique,tombstone with different ip(s), unchecked
7789 .line = __location__,
7790 .name = _NBT_NAME("_SA_UT_DI_U", 0x1C, NULL),
7792 .nb_flags = NBT_NM_GROUP,
7794 .num_ips = ctx->addresses_best_num,
7795 .ips = ctx->addresses_best,
7796 .apply_expected = True
7802 .type = WREPL_TYPE_UNIQUE,
7803 .state = WREPL_STATE_TOMBSTONE,
7804 .node = WREPL_NODE_B,
7806 .num_ips = ARRAY_SIZE(addresses_B_1),
7807 .ips = addresses_B_1,
7808 .apply_expected = False
7812 * special group vs. normal group section
7815 * sgroup,active vs. group,active with same ip(s), unchecked
7818 .line = __location__,
7819 .name = _NBT_NAME("_SA_GA_SI_U", 0x1C, NULL),
7821 .nb_flags = NBT_NM_GROUP,
7823 .num_ips = ctx->addresses_best_num,
7824 .ips = ctx->addresses_best,
7825 .apply_expected = True
7831 .type = WREPL_TYPE_GROUP,
7832 .state = WREPL_STATE_ACTIVE,
7833 .node = WREPL_NODE_B,
7835 .num_ips = ctx->addresses_best_num,
7836 .ips = ctx->addresses_best,
7837 .apply_expected = False
7841 * sgroup,active vs. group,active with different ip(s), unchecked
7844 .line = __location__,
7845 .name = _NBT_NAME("_SA_GA_DI_U", 0x1C, NULL),
7847 .nb_flags = NBT_NM_GROUP,
7849 .num_ips = ctx->addresses_best_num,
7850 .ips = ctx->addresses_best,
7851 .apply_expected = True
7857 .type = WREPL_TYPE_GROUP,
7858 .state = WREPL_STATE_ACTIVE,
7859 .node = WREPL_NODE_B,
7861 .num_ips = ARRAY_SIZE(addresses_B_1),
7862 .ips = addresses_B_1,
7863 .apply_expected = False
7867 * sgroup,active vs. group,tombstone with same ip(s), unchecked
7870 .line = __location__,
7871 .name = _NBT_NAME("_SA_GT_SI_U", 0x1C, NULL),
7873 .nb_flags = NBT_NM_GROUP,
7875 .num_ips = ctx->addresses_best_num,
7876 .ips = ctx->addresses_best,
7877 .apply_expected = True
7883 .type = WREPL_TYPE_GROUP,
7884 .state = WREPL_STATE_TOMBSTONE,
7885 .node = WREPL_NODE_B,
7887 .num_ips = ctx->addresses_best_num,
7888 .ips = ctx->addresses_best,
7889 .apply_expected = False
7893 * sgroup,active vs. group,tombstone with different ip(s), unchecked
7896 .line = __location__,
7897 .name = _NBT_NAME("_SA_GT_DI_U", 0x1C, NULL),
7899 .nb_flags = NBT_NM_GROUP,
7901 .num_ips = ctx->addresses_best_num,
7902 .ips = ctx->addresses_best,
7903 .apply_expected = True
7909 .type = WREPL_TYPE_GROUP,
7910 .state = WREPL_STATE_TOMBSTONE,
7911 .node = WREPL_NODE_B,
7913 .num_ips = ARRAY_SIZE(addresses_B_1),
7914 .ips = addresses_B_1,
7915 .apply_expected = False
7919 * special group vs. multi homed section
7922 * sgroup,active vs. mhomed,active with same ip(s), unchecked
7925 .line = __location__,
7926 .name = _NBT_NAME("_SA_MA_SI_U", 0x1C, NULL),
7928 .nb_flags = NBT_NM_GROUP,
7930 .num_ips = ctx->addresses_best_num,
7931 .ips = ctx->addresses_best,
7932 .apply_expected = True
7938 .type = WREPL_TYPE_MHOMED,
7939 .state = WREPL_STATE_ACTIVE,
7940 .node = WREPL_NODE_B,
7942 .num_ips = ctx->addresses_best_num,
7943 .ips = ctx->addresses_best,
7944 .apply_expected = False
7948 * sgroup,active vs. mhomed,active with different ip(s), unchecked
7951 .line = __location__,
7952 .name = _NBT_NAME("_SA_MA_DI_U", 0x1C, NULL),
7954 .nb_flags = NBT_NM_GROUP,
7956 .num_ips = ctx->addresses_best_num,
7957 .ips = ctx->addresses_best,
7958 .apply_expected = True
7964 .type = WREPL_TYPE_MHOMED,
7965 .state = WREPL_STATE_ACTIVE,
7966 .node = WREPL_NODE_B,
7968 .num_ips = ARRAY_SIZE(addresses_B_1),
7969 .ips = addresses_B_1,
7970 .apply_expected = False
7974 * sgroup,active vs. mhomed,tombstone with same ip(s), unchecked
7977 .line = __location__,
7978 .name = _NBT_NAME("_SA_MT_SI_U", 0x1C, NULL),
7980 .nb_flags = NBT_NM_GROUP,
7982 .num_ips = ctx->addresses_best_num,
7983 .ips = ctx->addresses_best,
7984 .apply_expected = True
7990 .type = WREPL_TYPE_MHOMED,
7991 .state = WREPL_STATE_TOMBSTONE,
7992 .node = WREPL_NODE_B,
7994 .num_ips = ctx->addresses_best_num,
7995 .ips = ctx->addresses_best,
7996 .apply_expected = False
8000 * sgroup,active vs. mhomed,tombstone with different ip(s), unchecked
8003 .line = __location__,
8004 .name = _NBT_NAME("_SA_MT_DI_U", 0x1C, NULL),
8006 .nb_flags = NBT_NM_GROUP,
8008 .num_ips = ctx->addresses_best_num,
8009 .ips = ctx->addresses_best,
8010 .apply_expected = True
8016 .type = WREPL_TYPE_MHOMED,
8017 .state = WREPL_STATE_TOMBSTONE,
8018 .node = WREPL_NODE_B,
8020 .num_ips = ARRAY_SIZE(addresses_B_1),
8021 .ips = addresses_B_1,
8022 .apply_expected = False
8026 * multi homed vs. unique section
8029 * mhomed,active vs. unique,active with same ip(s), unchecked
8032 .line = __location__,
8033 .name = _NBT_NAME("_MA_UA_SI_U", 0x00, NULL),
8037 .num_ips = ctx->addresses_best_num,
8038 .ips = ctx->addresses_best,
8039 .apply_expected = True
8045 .type = WREPL_TYPE_UNIQUE,
8046 .state = WREPL_STATE_ACTIVE,
8047 .node = WREPL_NODE_B,
8049 .num_ips = ctx->addresses_best_num,
8050 .ips = ctx->addresses_best,
8051 .apply_expected = True
8055 * mhomed,active vs. unique,active with different ip(s), positive response
8058 .line = __location__,
8059 .name = _NBT_NAME("_MA_UA_DI_P", 0x00, NULL),
8063 .num_ips = ctx->addresses_best_num,
8064 .ips = ctx->addresses_best,
8065 .apply_expected = True
8072 .type = WREPL_TYPE_UNIQUE,
8073 .state = WREPL_STATE_ACTIVE,
8074 .node = WREPL_NODE_B,
8076 .num_ips = ARRAY_SIZE(addresses_B_1),
8077 .ips = addresses_B_1,
8078 .apply_expected = False
8082 * mhomed,active vs. unique,active with different ip(s), positive response other ips
8085 .line = __location__,
8086 .name = _NBT_NAME("_MA_UA_DI_O", 0x00, NULL),
8090 .num_ips = ctx->addresses_best_num,
8091 .ips = ctx->addresses_best,
8092 .apply_expected = True
8097 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8098 .ips = addresses_A_3_4,
8101 .type = WREPL_TYPE_UNIQUE,
8102 .state = WREPL_STATE_ACTIVE,
8103 .node = WREPL_NODE_B,
8105 .num_ips = ARRAY_SIZE(addresses_B_1),
8106 .ips = addresses_B_1,
8107 .apply_expected = False
8111 * mhomed,active vs. unique,active with different ip(s), negative response
8114 .line = __location__,
8115 .name = _NBT_NAME("_MA_UA_DI_N", 0x00, NULL),
8119 .num_ips = ctx->addresses_best_num,
8120 .ips = ctx->addresses_best,
8121 .apply_expected = True
8128 .type = WREPL_TYPE_UNIQUE,
8129 .state = WREPL_STATE_ACTIVE,
8130 .node = WREPL_NODE_B,
8132 .num_ips = ARRAY_SIZE(addresses_B_1),
8133 .ips = addresses_B_1,
8134 .apply_expected = True
8138 * mhomed,active vs. unique,tombstone with same ip(s), unchecked
8141 .line = __location__,
8142 .name = _NBT_NAME("_MA_UT_SI_U", 0x00, NULL),
8146 .num_ips = ctx->addresses_best_num,
8147 .ips = ctx->addresses_best,
8148 .apply_expected = True
8154 .type = WREPL_TYPE_UNIQUE,
8155 .state = WREPL_STATE_TOMBSTONE,
8156 .node = WREPL_NODE_B,
8158 .num_ips = ctx->addresses_best_num,
8159 .ips = ctx->addresses_best,
8160 .apply_expected = False
8164 * mhomed,active vs. unique,tombstone with different ip(s), unchecked
8167 .line = __location__,
8168 .name = _NBT_NAME("_MA_UT_DI_U", 0x00, NULL),
8172 .num_ips = ctx->addresses_best_num,
8173 .ips = ctx->addresses_best,
8174 .apply_expected = True
8180 .type = WREPL_TYPE_UNIQUE,
8181 .state = WREPL_STATE_TOMBSTONE,
8182 .node = WREPL_NODE_B,
8184 .num_ips = ARRAY_SIZE(addresses_B_1),
8185 .ips = addresses_B_1,
8186 .apply_expected = False
8190 * multi homed vs. normal group section
8193 * mhomed,active vs. group,active with same ip(s), release expected
8196 .line = __location__,
8197 .name = _NBT_NAME("_MA_GA_SI_R", 0x00, NULL),
8201 .num_ips = ctx->addresses_best_num,
8202 .ips = ctx->addresses_best,
8203 .apply_expected = True
8207 .expect_release = True,
8210 .type = WREPL_TYPE_GROUP,
8211 .state = WREPL_STATE_ACTIVE,
8212 .node = WREPL_NODE_B,
8214 .num_ips = ctx->addresses_best_num,
8215 .ips = ctx->addresses_best,
8216 .apply_expected = True
8220 * mhomed,active vs. group,active with different ip(s), release expected
8223 .line = __location__,
8224 .name = _NBT_NAME("_MA_GA_DI_R", 0x00, NULL),
8228 .num_ips = ctx->addresses_best_num,
8229 .ips = ctx->addresses_best,
8230 .apply_expected = True
8234 .expect_release = True,
8237 .type = WREPL_TYPE_GROUP,
8238 .state = WREPL_STATE_ACTIVE,
8239 .node = WREPL_NODE_B,
8241 .num_ips = ARRAY_SIZE(addresses_B_1),
8242 .ips = addresses_B_1,
8243 .apply_expected = True
8247 * mhomed,active vs. group,tombstone with same ip(s), unchecked
8250 .line = __location__,
8251 .name = _NBT_NAME("_MA_GT_SI_U", 0x00, NULL),
8255 .num_ips = ctx->addresses_best_num,
8256 .ips = ctx->addresses_best,
8257 .apply_expected = True
8263 .type = WREPL_TYPE_GROUP,
8264 .state = WREPL_STATE_TOMBSTONE,
8265 .node = WREPL_NODE_B,
8267 .num_ips = ctx->addresses_best_num,
8268 .ips = ctx->addresses_best,
8269 .apply_expected = False
8273 * mhomed,active vs. group,tombstone with different ip(s), unchecked
8276 .line = __location__,
8277 .name = _NBT_NAME("_MA_GT_DI_U", 0x00, NULL),
8281 .num_ips = ctx->addresses_best_num,
8282 .ips = ctx->addresses_best,
8283 .apply_expected = True
8289 .type = WREPL_TYPE_GROUP,
8290 .state = WREPL_STATE_TOMBSTONE,
8291 .node = WREPL_NODE_B,
8293 .num_ips = ARRAY_SIZE(addresses_B_1),
8294 .ips = addresses_B_1,
8295 .apply_expected = False
8299 * multi homed vs. special group section
8302 * mhomed,active vs. sgroup,active with same ip(s), release expected
8305 .line = __location__,
8306 .name = _NBT_NAME("_MA_SA_SI_R", 0x00, NULL),
8310 .num_ips = ctx->addresses_best_num,
8311 .ips = ctx->addresses_best,
8312 .apply_expected = True
8316 .expect_release = True,
8319 .type = WREPL_TYPE_SGROUP,
8320 .state = WREPL_STATE_ACTIVE,
8321 .node = WREPL_NODE_B,
8323 .num_ips = ctx->addresses_best_num,
8324 .ips = ctx->addresses_best,
8325 .apply_expected = True
8329 * mhomed,active vs. group,active with different ip(s), release expected
8332 .line = __location__,
8333 .name = _NBT_NAME("_MA_SA_DI_R", 0x00, NULL),
8337 .num_ips = ctx->addresses_best_num,
8338 .ips = ctx->addresses_best,
8339 .apply_expected = True
8343 .expect_release = True,
8346 .type = WREPL_TYPE_SGROUP,
8347 .state = WREPL_STATE_ACTIVE,
8348 .node = WREPL_NODE_B,
8350 .num_ips = ARRAY_SIZE(addresses_B_1),
8351 .ips = addresses_B_1,
8352 .apply_expected = True
8356 * mhomed,active vs. sgroup,tombstone with same ip(s), unchecked
8359 .line = __location__,
8360 .name = _NBT_NAME("_MA_ST_SI_U", 0x00, NULL),
8364 .num_ips = ctx->addresses_best_num,
8365 .ips = ctx->addresses_best,
8366 .apply_expected = True
8372 .type = WREPL_TYPE_SGROUP,
8373 .state = WREPL_STATE_TOMBSTONE,
8374 .node = WREPL_NODE_B,
8376 .num_ips = ctx->addresses_best_num,
8377 .ips = ctx->addresses_best,
8378 .apply_expected = False
8382 * mhomed,active vs. sgroup,tombstone with different ip(s), unchecked
8385 .line = __location__,
8386 .name = _NBT_NAME("_MA_ST_DI_U", 0x00, NULL),
8390 .num_ips = ctx->addresses_best_num,
8391 .ips = ctx->addresses_best,
8392 .apply_expected = True
8398 .type = WREPL_TYPE_SGROUP,
8399 .state = WREPL_STATE_TOMBSTONE,
8400 .node = WREPL_NODE_B,
8402 .num_ips = ARRAY_SIZE(addresses_B_1),
8403 .ips = addresses_B_1,
8404 .apply_expected = False
8408 * multi homed vs. multi homed section
8411 * mhomed,active vs. mhomed,active with same ip(s), unchecked
8414 .line = __location__,
8415 .name = _NBT_NAME("_MA_MA_SI_U", 0x00, NULL),
8419 .num_ips = ctx->addresses_best_num,
8420 .ips = ctx->addresses_best,
8421 .apply_expected = True
8427 .type = WREPL_TYPE_MHOMED,
8428 .state = WREPL_STATE_ACTIVE,
8429 .node = WREPL_NODE_B,
8431 .num_ips = ctx->addresses_best_num,
8432 .ips = ctx->addresses_best,
8433 .apply_expected = True
8437 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8440 .line = __location__,
8441 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8445 .num_ips = ctx->addresses_best_num,
8446 .ips = ctx->addresses_best,
8447 .apply_expected = True
8453 .type = WREPL_TYPE_MHOMED,
8454 .state = WREPL_STATE_ACTIVE,
8455 .node = WREPL_NODE_B,
8457 .num_ips = ctx->addresses_all_num,
8458 .ips = ctx->addresses_all,
8459 .apply_expected = True
8463 * mhomed,active vs. mhomed,active with different ip(s), positive response
8466 .line = __location__,
8467 .name = _NBT_NAME("_MA_MA_DI_P", 0x00, NULL),
8471 .num_ips = ctx->addresses_best_num,
8472 .ips = ctx->addresses_best,
8473 .apply_expected = True
8480 .type = WREPL_TYPE_MHOMED,
8481 .state = WREPL_STATE_ACTIVE,
8482 .node = WREPL_NODE_B,
8484 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8485 .ips = addresses_B_3_4,
8486 .apply_expected = False
8490 * mhomed,active vs. mhomed,active with different ip(s), positive response other ips
8493 .line = __location__,
8494 .name = _NBT_NAME("_MA_MA_DI_O", 0x00, NULL),
8498 .num_ips = ctx->addresses_best_num,
8499 .ips = ctx->addresses_best,
8500 .apply_expected = True
8505 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8506 .ips = addresses_A_3_4,
8509 .type = WREPL_TYPE_MHOMED,
8510 .state = WREPL_STATE_ACTIVE,
8511 .node = WREPL_NODE_B,
8513 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8514 .ips = addresses_B_3_4,
8515 .apply_expected = False
8519 * mhomed,active vs. mhomed,active with different ip(s), negative response
8522 .line = __location__,
8523 .name = _NBT_NAME("_MA_MA_DI_N", 0x00, NULL),
8527 .num_ips = ctx->addresses_best_num,
8528 .ips = ctx->addresses_best,
8529 .apply_expected = True
8536 .type = WREPL_TYPE_MHOMED,
8537 .state = WREPL_STATE_ACTIVE,
8538 .node = WREPL_NODE_B,
8540 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8541 .ips = addresses_B_3_4,
8542 .apply_expected = True
8546 * mhomed,active vs. mhomed,tombstone with same ip(s), unchecked
8549 .line = __location__,
8550 .name = _NBT_NAME("_MA_MT_SI_U", 0x00, NULL),
8554 .num_ips = ctx->addresses_best_num,
8555 .ips = ctx->addresses_best,
8556 .apply_expected = True
8562 .type = WREPL_TYPE_MHOMED,
8563 .state = WREPL_STATE_TOMBSTONE,
8564 .node = WREPL_NODE_B,
8566 .num_ips = ctx->addresses_best_num,
8567 .ips = ctx->addresses_best,
8568 .apply_expected = False
8572 * mhomed,active vs. mhomed,tombstone with different ip(s), unchecked
8575 .line = __location__,
8576 .name = _NBT_NAME("_MA_MT_DI_U", 0x00, NULL),
8580 .num_ips = ctx->addresses_best_num,
8581 .ips = ctx->addresses_best,
8582 .apply_expected = True
8588 .type = WREPL_TYPE_MHOMED,
8589 .state = WREPL_STATE_TOMBSTONE,
8590 .node = WREPL_NODE_B,
8592 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8593 .ips = addresses_B_3_4,
8594 .apply_expected = False
8598 * some more multi homed test, including merging
8601 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8604 .line = __location__,
8605 .section= "Test Replica vs. owned active: some more MHOMED combinations",
8606 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8607 .comment= "C:MHOMED vs. B:ALL => B:ALL",
8608 .skip = (ctx->addresses_all_num < 3),
8612 .num_ips = ctx->addresses_mhomed_num,
8613 .ips = ctx->addresses_mhomed,
8614 .apply_expected = True
8620 .type = WREPL_TYPE_MHOMED,
8621 .state = WREPL_STATE_ACTIVE,
8622 .node = WREPL_NODE_B,
8624 .num_ips = ctx->addresses_all_num,
8625 .ips = ctx->addresses_all,
8626 .apply_expected = True
8630 * mhomed,active vs. mhomed,active with same ips, unchecked
8633 .line = __location__,
8634 .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL),
8635 .comment= "C:MHOMED vs. B:MHOMED => B:MHOMED",
8636 .skip = (ctx->addresses_mhomed_num < 2),
8640 .num_ips = ctx->addresses_mhomed_num,
8641 .ips = ctx->addresses_mhomed,
8642 .apply_expected = True
8648 .type = WREPL_TYPE_MHOMED,
8649 .state = WREPL_STATE_ACTIVE,
8650 .node = WREPL_NODE_B,
8652 .num_ips = ctx->addresses_mhomed_num,
8653 .ips = ctx->addresses_mhomed,
8654 .apply_expected = True
8658 * mhomed,active vs. mhomed,active with subset ip(s), positive response
8661 .line = __location__,
8662 .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL),
8663 .comment= "C:MHOMED vs. B:BEST (C:MHOMED) => B:MHOMED",
8664 .skip = (ctx->addresses_mhomed_num < 2),
8668 .num_ips = ctx->addresses_mhomed_num,
8669 .ips = ctx->addresses_mhomed,
8670 .apply_expected = True
8677 .type = WREPL_TYPE_MHOMED,
8678 .state = WREPL_STATE_ACTIVE,
8679 .node = WREPL_NODE_B,
8681 .num_ips = ctx->addresses_best_num,
8682 .ips = ctx->addresses_best,
8683 .mhomed_merge = True
8687 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with all addresses
8690 .line = __location__,
8691 .name = _NBT_NAME("_MA_MA_SB_A", 0x00, NULL),
8692 .comment= "C:MHOMED vs. B:BEST (C:ALL) => B:MHOMED",
8693 .skip = (ctx->addresses_all_num < 3),
8697 .num_ips = ctx->addresses_mhomed_num,
8698 .ips = ctx->addresses_mhomed,
8699 .apply_expected = True
8704 .num_ips = ctx->addresses_all_num,
8705 .ips = ctx->addresses_all,
8708 .type = WREPL_TYPE_MHOMED,
8709 .state = WREPL_STATE_ACTIVE,
8710 .node = WREPL_NODE_B,
8712 .num_ips = ctx->addresses_best_num,
8713 .ips = ctx->addresses_best,
8714 .mhomed_merge = True
8718 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with replicas addresses
8719 * TODO: check why the server sends a name release demand for one address?
8720 * the release demand has no effect to the database record...
8723 .line = __location__,
8724 .name = _NBT_NAME("_MA_MA_SB_PRA", 0x00, NULL),
8725 .comment= "C:MHOMED vs. B:BEST (C:BEST) => C:MHOMED",
8726 .skip = (ctx->addresses_all_num < 2),
8730 .num_ips = ctx->addresses_mhomed_num,
8731 .ips = ctx->addresses_mhomed,
8732 .apply_expected = True
8737 .num_ips = ctx->addresses_best_num,
8738 .ips = ctx->addresses_best,
8739 .late_release = True
8742 .type = WREPL_TYPE_MHOMED,
8743 .state = WREPL_STATE_ACTIVE,
8744 .node = WREPL_NODE_B,
8746 .num_ips = ctx->addresses_best_num,
8747 .ips = ctx->addresses_best,
8748 .apply_expected = False
8752 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with other addresses
8755 .line = __location__,
8756 .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL),
8757 .comment= "C:MHOMED vs. B:BEST (B:B_3_4) =>C:MHOMED",
8758 .skip = (ctx->addresses_all_num < 2),
8762 .num_ips = ctx->addresses_mhomed_num,
8763 .ips = ctx->addresses_mhomed,
8764 .apply_expected = True
8769 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8770 .ips = addresses_B_3_4,
8773 .type = WREPL_TYPE_MHOMED,
8774 .state = WREPL_STATE_ACTIVE,
8775 .node = WREPL_NODE_B,
8777 .num_ips = ctx->addresses_best_num,
8778 .ips = ctx->addresses_best,
8779 .apply_expected = False
8783 * mhomed,active vs. mhomed,active with subset ip(s), negative response
8786 .line = __location__,
8787 .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL),
8788 .comment= "C:MHOMED vs. B:BEST (NEGATIVE) => B:BEST",
8789 .skip = (ctx->addresses_mhomed_num < 2),
8793 .num_ips = ctx->addresses_mhomed_num,
8794 .ips = ctx->addresses_mhomed,
8795 .apply_expected = True
8802 .type = WREPL_TYPE_MHOMED,
8803 .state = WREPL_STATE_ACTIVE,
8804 .node = WREPL_NODE_B,
8806 .num_ips = ctx->addresses_best_num,
8807 .ips = ctx->addresses_best,
8808 .apply_expected = True
8812 * some more multi homed and unique test, including merging
8815 * mhomed,active vs. unique,active with subset ip(s), positive response
8818 .line = __location__,
8819 .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations",
8820 .name = _NBT_NAME("_MA_UA_SB_P", 0x00, NULL),
8821 .comment= "C:MHOMED vs. B:UNIQUE,BEST (C:MHOMED) => B:MHOMED",
8822 .skip = (ctx->addresses_all_num < 2),
8826 .num_ips = ctx->addresses_mhomed_num,
8827 .ips = ctx->addresses_mhomed,
8828 .apply_expected = True
8835 .type = WREPL_TYPE_UNIQUE,
8836 .state = WREPL_STATE_ACTIVE,
8837 .node = WREPL_NODE_B,
8839 .num_ips = ctx->addresses_best_num,
8840 .ips = ctx->addresses_best,
8841 .mhomed_merge = True
8845 * unique,active vs. unique,active with different ip(s), positive response, with replicas address
8846 * TODO: check why the server sends a name release demand for one address?
8847 * the release demand has no effect to the database record...
8850 .line = __location__,
8851 .name = _NBT_NAME("_UA_UA_DI_PRA", 0x00, NULL),
8852 .comment= "C:BEST vs. B:BEST2 (C:BEST2,LR:BEST2) => C:BEST",
8853 .skip = (ctx->addresses_all_num < 2),
8857 .num_ips = ctx->addresses_best_num,
8858 .ips = ctx->addresses_best,
8859 .apply_expected = True
8864 .num_ips = ctx->addresses_best2_num,
8865 .ips = ctx->addresses_best2,
8866 .late_release = True
8869 .type = WREPL_TYPE_UNIQUE,
8870 .state = WREPL_STATE_ACTIVE,
8871 .node = WREPL_NODE_B,
8873 .num_ips = ctx->addresses_best2_num,
8874 .ips = ctx->addresses_best2,
8875 .apply_expected = False,
8879 * unique,active vs. unique,active with different ip(s), positive response, with all addresses
8882 .line = __location__,
8883 .name = _NBT_NAME("_UA_UA_DI_A", 0x00, NULL),
8884 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
8885 .skip = (ctx->addresses_all_num < 3),
8889 .num_ips = ctx->addresses_best_num,
8890 .ips = ctx->addresses_best,
8891 .apply_expected = True
8896 .num_ips = ctx->addresses_all_num,
8897 .ips = ctx->addresses_all,
8900 .type = WREPL_TYPE_UNIQUE,
8901 .state = WREPL_STATE_ACTIVE,
8902 .node = WREPL_NODE_B,
8904 .num_ips = ctx->addresses_best2_num,
8905 .ips = ctx->addresses_best2,
8906 .mhomed_merge = True,
8910 * unique,active vs. mhomed,active with different ip(s), positive response, with all addresses
8913 .line = __location__,
8914 .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL),
8915 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
8916 .skip = (ctx->addresses_all_num < 3),
8920 .num_ips = ctx->addresses_best_num,
8921 .ips = ctx->addresses_best,
8922 .apply_expected = True
8927 .num_ips = ctx->addresses_all_num,
8928 .ips = ctx->addresses_all,
8931 .type = WREPL_TYPE_MHOMED,
8932 .state = WREPL_STATE_ACTIVE,
8933 .node = WREPL_NODE_B,
8935 .num_ips = ctx->addresses_best2_num,
8936 .ips = ctx->addresses_best2,
8937 .mhomed_merge = True,
8941 * special group vs. special group merging section
8944 * sgroup,active vs. sgroup,active with different ip(s)
8947 .line = __location__,
8948 .section= "Test Replica vs. owned active: SGROUP vs. SGROUP tests",
8949 .name = _NBT_NAME("_SA_SA_DI_U", 0x1C, NULL),
8950 .skip = (ctx->addresses_all_num < 3),
8952 .nb_flags = NBT_NM_GROUP,
8954 .num_ips = ctx->addresses_mhomed_num,
8955 .ips = ctx->addresses_mhomed,
8956 .apply_expected = True
8962 .type = WREPL_TYPE_SGROUP,
8963 .state = WREPL_STATE_ACTIVE,
8964 .node = WREPL_NODE_B,
8966 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8967 .ips = addresses_B_3_4,
8968 .sgroup_merge = True
8972 * sgroup,active vs. sgroup,active with same ip(s)
8975 .line = __location__,
8976 .name = _NBT_NAME("_SA_SA_SI_U", 0x1C, NULL),
8977 .skip = (ctx->addresses_all_num < 3),
8979 .nb_flags = NBT_NM_GROUP,
8981 .num_ips = ctx->addresses_mhomed_num,
8982 .ips = ctx->addresses_mhomed,
8983 .apply_expected = True
8989 .type = WREPL_TYPE_SGROUP,
8990 .state = WREPL_STATE_ACTIVE,
8991 .node = WREPL_NODE_B,
8993 .num_ips = ctx->addresses_mhomed_num,
8994 .ips = ctx->addresses_mhomed,
8995 .sgroup_merge = True
8999 * sgroup,active vs. sgroup,active with superset ip(s)
9002 .line = __location__,
9003 .name = _NBT_NAME("_SA_SA_SP_U", 0x1C, NULL),
9004 .skip = (ctx->addresses_all_num < 3),
9006 .nb_flags = NBT_NM_GROUP,
9008 .num_ips = ctx->addresses_mhomed_num,
9009 .ips = ctx->addresses_mhomed,
9010 .apply_expected = True
9016 .type = WREPL_TYPE_SGROUP,
9017 .state = WREPL_STATE_ACTIVE,
9018 .node = WREPL_NODE_B,
9020 .num_ips = ctx->addresses_all_num,
9021 .ips = ctx->addresses_all,
9022 .sgroup_merge = True
9026 * sgroup,active vs. sgroup,active with subset ip(s)
9029 .line = __location__,
9030 .name = _NBT_NAME("_SA_SA_SB_U", 0x1C, NULL),
9031 .skip = (ctx->addresses_all_num < 3),
9033 .nb_flags = NBT_NM_GROUP,
9035 .num_ips = ctx->addresses_mhomed_num,
9036 .ips = ctx->addresses_mhomed,
9037 .apply_expected = True
9043 .type = WREPL_TYPE_SGROUP,
9044 .state = WREPL_STATE_ACTIVE,
9045 .node = WREPL_NODE_B,
9047 .num_ips = ctx->addresses_best_num,
9048 .ips = ctx->addresses_best,
9049 .sgroup_merge = True
9053 * sgroup,active vs. sgroup,tombstone with different ip(s)
9056 .line = __location__,
9057 .name = _NBT_NAME("_SA_ST_DI_U", 0x1C, NULL),
9058 .skip = (ctx->addresses_all_num < 3),
9060 .nb_flags = NBT_NM_GROUP,
9062 .num_ips = ctx->addresses_mhomed_num,
9063 .ips = ctx->addresses_mhomed,
9064 .apply_expected = True
9070 .type = WREPL_TYPE_SGROUP,
9071 .state = WREPL_STATE_TOMBSTONE,
9072 .node = WREPL_NODE_B,
9074 .num_ips = ARRAY_SIZE(addresses_B_3_4),
9075 .ips = addresses_B_3_4,
9076 .apply_expected = False
9080 * sgroup,active vs. sgroup,tombstone with same ip(s)
9083 .line = __location__,
9084 .name = _NBT_NAME("_SA_ST_SI_U", 0x1C, NULL),
9085 .skip = (ctx->addresses_all_num < 3),
9087 .nb_flags = NBT_NM_GROUP,
9089 .num_ips = ctx->addresses_mhomed_num,
9090 .ips = ctx->addresses_mhomed,
9091 .apply_expected = True
9097 .type = WREPL_TYPE_SGROUP,
9098 .state = WREPL_STATE_TOMBSTONE,
9099 .node = WREPL_NODE_B,
9101 .num_ips = ctx->addresses_mhomed_num,
9102 .ips = ctx->addresses_mhomed,
9103 .apply_expected = False
9107 * sgroup,active vs. sgroup,tombstone with superset ip(s)
9110 .line = __location__,
9111 .name = _NBT_NAME("_SA_ST_SP_U", 0x1C, NULL),
9112 .skip = (ctx->addresses_all_num < 3),
9114 .nb_flags = NBT_NM_GROUP,
9116 .num_ips = ctx->addresses_mhomed_num,
9117 .ips = ctx->addresses_mhomed,
9118 .apply_expected = True
9124 .type = WREPL_TYPE_SGROUP,
9125 .state = WREPL_STATE_TOMBSTONE,
9126 .node = WREPL_NODE_B,
9128 .num_ips = ctx->addresses_all_num,
9129 .ips = ctx->addresses_all,
9130 .apply_expected = False
9134 * sgroup,active vs. sgroup,tombstone with subset ip(s)
9137 .line = __location__,
9138 .name = _NBT_NAME("_SA_ST_SB_U", 0x1C, NULL),
9139 .skip = (ctx->addresses_all_num < 3),
9141 .nb_flags = NBT_NM_GROUP,
9143 .num_ips = ctx->addresses_mhomed_num,
9144 .ips = ctx->addresses_mhomed,
9145 .apply_expected = True
9151 .type = WREPL_TYPE_SGROUP,
9152 .state = WREPL_STATE_TOMBSTONE,
9153 .node = WREPL_NODE_B,
9155 .num_ips = ctx->addresses_best_num,
9156 .ips = ctx->addresses_best,
9157 .apply_expected = False
9162 if (!ctx->nbtsock_srv) {
9163 printf("SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
9168 printf("Test Replica records vs. owned active records\n");
9170 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
9172 struct test_conflict_owned_active_vs_replica_struct record = records[i];
9173 uint32_t j, count = 1;
9176 if (records[i].wins.mhomed || records[i].name.type == 0x1C) {
9177 count = records[i].wins.num_ips;
9180 if (records[i].section) {
9181 printf("%s\n", records[i].section);
9184 if (records[i].skip) {
9185 printf("%s => SKIPPED\n", nbt_name_string(ctx, &records[i].name));
9189 if (records[i].replica.mhomed_merge) {
9190 action = "MHOMED_MERGE";
9191 } else if (records[i].replica.sgroup_merge) {
9192 action = "SGROUP_MERGE";
9193 } else if (records[i].replica.apply_expected) {
9196 action = "NOT REPLACE";
9199 printf("%s%s%s => %s\n",
9200 nbt_name_string(ctx, &records[i].name),
9201 (records[i].comment?": ":""),
9202 (records[i].comment?records[i].comment:""),
9205 /* Prepare for multi homed registration */
9206 ZERO_STRUCT(records[i].defend);
9207 records[i].defend.timeout = 10;
9208 records[i].defend.positive = True;
9209 nbt_set_incoming_handler(ctx->nbtsock_srv,
9210 test_conflict_owned_active_vs_replica_handler,
9212 if (ctx->nbtsock_srv2) {
9213 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9214 test_conflict_owned_active_vs_replica_handler,
9221 for (j=0; j < count; j++) {
9222 struct nbt_name_request *req;
9224 name_register->in.name = records[i].name;
9225 name_register->in.dest_addr = ctx->address;
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
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 printf("No response from %s for name register\n", ctx->address);
9260 if (!NT_STATUS_IS_OK(status)) {
9261 printf("Bad response from %s for name register - %s\n",
9262 ctx->address, nt_errstr(status));
9265 CHECK_VALUE(name_register->out.rcode, 0);
9266 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
9267 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
9268 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
9269 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
9270 CHECK_VALUE_STRING(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,
9278 if (ctx->nbtsock_srv2) {
9279 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9280 test_conflict_owned_active_vs_replica_handler,
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(records[i].replica.ips);
9297 wins_name->addresses.ip = records[i].replica.ips[0].ip;
9299 wins_name->unknown = "255.255.255.255";
9301 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9304 * wait for the name query, which is handled in
9305 * test_conflict_owned_active_vs_replica_handler()
9307 end = timeval_current_ofs(records[i].defend.timeout,0);
9308 records[i].defend.ret = True;
9309 while (records[i].defend.timeout > 0) {
9310 event_loop_once(ctx->nbtsock_srv->event_ctx);
9311 if (timeval_expired(&end)) break;
9313 ret &= records[i].defend.ret;
9315 if (records[i].defend.late_release) {
9316 records[i].defend = record.defend;
9317 records[i].defend.expect_release = True;
9319 * wait for the name release demand, which is handled in
9320 * test_conflict_owned_active_vs_replica_handler()
9322 end = timeval_current_ofs(records[i].defend.timeout,0);
9323 records[i].defend.ret = True;
9324 while (records[i].defend.timeout > 0) {
9325 event_loop_once(ctx->nbtsock_srv->event_ctx);
9326 if (timeval_expired(&end)) break;
9328 ret &= records[i].defend.ret;
9331 if (records[i].replica.mhomed_merge) {
9332 ret &= test_wrepl_mhomed_merged(ctx, &ctx->c,
9333 records[i].wins.num_ips, records[i].wins.ips,
9335 records[i].replica.num_ips, records[i].replica.ips,
9337 } else if (records[i].replica.sgroup_merge) {
9338 ret &= test_wrepl_sgroup_merged(ctx, NULL,
9340 records[i].wins.num_ips, records[i].wins.ips,
9342 records[i].replica.num_ips, records[i].replica.ips,
9345 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
9346 records[i].replica.apply_expected);
9349 if (records[i].replica.apply_expected ||
9350 records[i].replica.mhomed_merge) {
9351 wins_name->name = &records[i].name;
9352 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9353 WREPL_STATE_TOMBSTONE,
9354 WREPL_NODE_B, False);
9355 wins_name->id = ++ctx->b.max_version;
9356 wins_name->addresses.ip = addresses_B_1[0].ip;
9357 wins_name->unknown = "255.255.255.255";
9359 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9360 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
9362 for (j=0; j < count; j++) {
9363 struct nbt_name_socket *nbtsock = ctx->nbtsock;
9365 if (ctx->myaddr2 && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2->addr) == 0) {
9366 nbtsock = ctx->nbtsock2;
9369 release->in.name = records[i].name;
9370 release->in.dest_addr = ctx->address;
9371 release->in.address = records[i].wins.ips[j].ip;
9372 release->in.nb_flags = records[i].wins.nb_flags;
9373 release->in.broadcast = False;
9374 release->in.timeout = 30;
9375 release->in.retries = 0;
9377 status = nbt_name_release(nbtsock, ctx, release);
9378 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9379 printf("No response from %s for name release\n", ctx->address);
9382 if (!NT_STATUS_IS_OK(status)) {
9383 printf("Bad response from %s for name query - %s\n",
9384 ctx->address, nt_errstr(status));
9387 CHECK_VALUE(release->out.rcode, 0);
9390 if (records[i].replica.sgroup_merge) {
9391 /* clean up the SGROUP record */
9392 wins_name->name = &records[i].name;
9393 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9395 WREPL_NODE_B, False);
9396 wins_name->id = ++ctx->b.max_version;
9397 wins_name->addresses.addresses.num_ips = 0;
9398 wins_name->addresses.addresses.ips = NULL;
9399 wins_name->unknown = "255.255.255.255";
9400 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9402 /* take ownership of the SGROUP record */
9403 wins_name->name = &records[i].name;
9404 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9406 WREPL_NODE_B, False);
9407 wins_name->id = ++ctx->b.max_version;
9408 wins_name->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
9409 wins_name->addresses.addresses.ips = discard_const(addresses_B_1);
9410 wins_name->unknown = "255.255.255.255";
9411 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9412 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
9414 /* overwrite the SGROUP record with unique,tombstone */
9415 wins_name->name = &records[i].name;
9416 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9417 WREPL_STATE_TOMBSTONE,
9418 WREPL_NODE_B, False);
9419 wins_name->id = ++ctx->b.max_version;
9420 wins_name->addresses.ip = addresses_A_1[0].ip;
9421 wins_name->unknown = "255.255.255.255";
9422 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9423 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
9429 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
9437 #define _NBT_ASSERT(v, correct) do { \
9438 if ((v) != (correct)) { \
9439 printf("(%s) Incorrect value %s=%d - should be %s (%d)\n", \
9440 __location__, #v, v, #correct, correct); \
9445 #define _NBT_ASSERT_STRING(v, correct) do { \
9446 if ( ((!v) && (correct)) || \
9447 ((v) && (!correct)) || \
9448 ((v) && (correct) && strcmp(v,correct) != 0)) { \
9449 printf("(%s) Incorrect value %s=%s - should be %s\n", \
9450 __location__, #v, v, correct); \
9455 static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
9456 struct nbt_name_packet *req_packet,
9457 struct socket_address *src)
9459 struct nbt_name *name;
9460 struct nbt_name_packet *rep_packet;
9461 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9463 _NBT_ASSERT(req_packet->qdcount, 1);
9464 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9465 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9467 name = &req_packet->questions[0].name;
9469 _NBT_ASSERT(name->type, rec->name.type);
9470 _NBT_ASSERT_STRING(name->name, rec->name.name);
9471 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9473 _NBT_ASSERT(rec->defend.expect_release, False);
9475 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9476 if (rep_packet == NULL) return;
9478 rep_packet->name_trn_id = req_packet->name_trn_id;
9479 rep_packet->ancount = 1;
9481 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9482 if (rep_packet->answers == NULL) return;
9484 rep_packet->answers[0].name = *name;
9485 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9486 rep_packet->answers[0].ttl = 0;
9488 if (rec->defend.positive) {
9489 uint32_t i, num_ips;
9490 const struct wrepl_ip *ips;
9492 if (rec->defend.num_ips > 0) {
9493 num_ips = rec->defend.num_ips;
9494 ips = rec->defend.ips;
9496 num_ips = rec->wins.num_ips;
9497 ips = rec->wins.ips;
9500 /* send a positive reply */
9501 rep_packet->operation =
9504 NBT_FLAG_AUTHORITIVE |
9505 NBT_FLAG_RECURSION_DESIRED |
9506 NBT_FLAG_RECURSION_AVAIL;
9508 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9510 rep_packet->answers[0].rdata.netbios.length = num_ips*6;
9511 rep_packet->answers[0].rdata.netbios.addresses =
9512 talloc_array(rep_packet->answers, struct nbt_rdata_address, num_ips);
9513 if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return;
9515 for (i=0; i < num_ips; i++) {
9516 struct nbt_rdata_address *addr =
9517 &rep_packet->answers[0].rdata.netbios.addresses[i];
9518 addr->nb_flags = rec->wins.nb_flags;
9519 addr->ipaddr = ips[i].ip;
9521 DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
9522 nbt_name_string(rep_packet, name), src->addr, src->port));
9524 /* send a negative reply */
9525 rep_packet->operation =
9528 NBT_FLAG_AUTHORITIVE |
9531 rep_packet->answers[0].rr_type = NBT_QTYPE_NULL;
9533 ZERO_STRUCT(rep_packet->answers[0].rdata);
9535 DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
9536 nbt_name_string(rep_packet, name), src->addr, src->port));
9539 nbt_name_reply_send(nbtsock, src, rep_packet);
9540 talloc_free(rep_packet);
9542 /* make sure we push the reply to the wire */
9543 event_loop_once(nbtsock->event_ctx);
9546 rec->defend.timeout = 0;
9547 rec->defend.ret = True;
9550 static void test_conflict_owned_active_vs_replica_handler_release(struct nbt_name_socket *nbtsock,
9551 struct nbt_name_packet *req_packet,
9552 struct socket_address *src)
9554 struct nbt_name *name;
9555 struct nbt_name_packet *rep_packet;
9556 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9558 _NBT_ASSERT(req_packet->qdcount, 1);
9559 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9560 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9562 name = &req_packet->questions[0].name;
9564 _NBT_ASSERT(name->type, rec->name.type);
9565 _NBT_ASSERT_STRING(name->name, rec->name.name);
9566 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9568 _NBT_ASSERT(rec->defend.expect_release, True);
9570 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9571 if (rep_packet == NULL) return;
9573 rep_packet->name_trn_id = req_packet->name_trn_id;
9574 rep_packet->ancount = 1;
9575 rep_packet->operation =
9577 NBT_OPCODE_RELEASE |
9578 NBT_FLAG_AUTHORITIVE;
9580 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9581 if (rep_packet->answers == NULL) return;
9583 rep_packet->answers[0].name = *name;
9584 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9585 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9586 rep_packet->answers[0].ttl = req_packet->additional[0].ttl;
9587 rep_packet->answers[0].rdata = req_packet->additional[0].rdata;
9589 DEBUG(2,("Sending name release reply for %s to %s:%d\n",
9590 nbt_name_string(rep_packet, name), src->addr, src->port));
9592 nbt_name_reply_send(nbtsock, src, rep_packet);
9593 talloc_free(rep_packet);
9595 /* make sure we push the reply to the wire */
9596 event_loop_once(nbtsock->event_ctx);
9599 rec->defend.timeout = 0;
9600 rec->defend.ret = True;
9603 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
9604 struct nbt_name_packet *req_packet,
9605 struct socket_address *src)
9607 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9609 rec->defend.ret = False;
9611 switch (req_packet->operation & NBT_OPCODE) {
9612 case NBT_OPCODE_QUERY:
9613 test_conflict_owned_active_vs_replica_handler_query(nbtsock, req_packet, src);
9615 case NBT_OPCODE_RELEASE:
9616 test_conflict_owned_active_vs_replica_handler_release(nbtsock, req_packet, src);
9619 printf("%s: unexpected incoming packet\n", __location__);
9625 test simple WINS replication operations
9627 BOOL torture_nbt_winsreplication_simple(void)
9629 const char *address;
9630 struct nbt_name name;
9631 TALLOC_CTX *mem_ctx = talloc_new(NULL);
9635 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
9637 /* do an initial name resolution to find its IP */
9638 status = resolve_name(&name, mem_ctx, &address, NULL);
9639 if (!NT_STATUS_IS_OK(status)) {
9640 printf("Failed to resolve %s - %s\n",
9641 name.name, nt_errstr(status));
9642 talloc_free(mem_ctx);
9646 ret &= test_assoc_ctx1(mem_ctx, address);
9647 ret &= test_assoc_ctx2(mem_ctx, address);
9649 ret &= test_wins_replication(mem_ctx, address);
9652 talloc_free(mem_ctx);
9658 test WINS replication replica conflicts operations
9660 BOOL torture_nbt_winsreplication_replica(void)
9662 const char *address;
9663 struct nbt_name name;
9664 TALLOC_CTX *mem_ctx = talloc_new(NULL);
9667 struct test_wrepl_conflict_conn *ctx;
9669 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
9671 /* do an initial name resolution to find its IP */
9672 status = resolve_name(&name, mem_ctx, &address, NULL);
9673 if (!NT_STATUS_IS_OK(status)) {
9674 printf("Failed to resolve %s - %s\n",
9675 name.name, nt_errstr(status));
9676 talloc_free(mem_ctx);
9680 ctx = test_create_conflict_ctx(mem_ctx, address);
9681 if (!ctx) return False;
9683 ret &= test_conflict_same_owner(ctx);
9684 ret &= test_conflict_different_owner(ctx);
9687 talloc_free(mem_ctx);
9693 test WINS replication owned conflicts operations
9695 BOOL torture_nbt_winsreplication_owned(void)
9697 const char *address;
9698 struct nbt_name name;
9699 TALLOC_CTX *mem_ctx = talloc_new(NULL);
9702 struct test_wrepl_conflict_conn *ctx;
9704 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
9706 /* do an initial name resolution to find its IP */
9707 status = resolve_name(&name, mem_ctx, &address, NULL);
9708 if (!NT_STATUS_IS_OK(status)) {
9709 printf("Failed to resolve %s - %s\n",
9710 name.name, nt_errstr(status));
9711 talloc_free(mem_ctx);
9715 ctx = test_create_conflict_ctx(mem_ctx, address);
9716 if (!ctx) return False;
9718 ret &= test_conflict_owned_released_vs_replica(ctx);
9719 ret &= test_conflict_owned_active_vs_replica(ctx);
9722 talloc_free(mem_ctx);