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 "lib/socket/netif.h"
31 #include "librpc/gen_ndr/ndr_nbt.h"
32 #include "torture/torture.h"
34 #define CHECK_STATUS(status, correct) do { \
35 if (!NT_STATUS_EQUAL(status, correct)) { \
36 printf("(%s) Incorrect status %s - should be %s\n", \
37 __location__, nt_errstr(status), nt_errstr(correct)); \
42 #define CHECK_VALUE(v, correct) do { \
43 if ((v) != (correct)) { \
44 printf("(%s) Incorrect value %s=%d - should be %d\n", \
45 __location__, #v, v, correct); \
50 #define CHECK_VALUE_UINT64(v, correct) do { \
51 if ((v) != (correct)) { \
52 printf("(%s) Incorrect value %s=%llu - should be %llu\n", \
53 __location__, #v, (long long)v, (long long)correct); \
58 #define CHECK_VALUE_STRING(v, correct) do { \
59 if ( ((!v) && (correct)) || \
60 ((v) && (!correct)) || \
61 ((v) && (correct) && strcmp(v,correct) != 0)) { \
62 printf("(%s) Incorrect value %s='%s' - should be '%s'\n", \
63 __location__, #v, v, correct); \
68 #define _NBT_NAME(n,t,s) {\
74 static const char *wrepl_name_type_string(enum wrepl_name_type type)
77 case WREPL_TYPE_UNIQUE: return "UNIQUE";
78 case WREPL_TYPE_GROUP: return "GROUP";
79 case WREPL_TYPE_SGROUP: return "SGROUP";
80 case WREPL_TYPE_MHOMED: return "MHOMED";
82 return "UNKNOWN_TYPE";
85 static const char *wrepl_name_state_string(enum wrepl_name_state state)
88 case WREPL_STATE_ACTIVE: return "ACTIVE";
89 case WREPL_STATE_RELEASED: return "RELEASED";
90 case WREPL_STATE_TOMBSTONE: return "TOMBSTONE";
91 case WREPL_STATE_RESERVED: return "RESERVED";
93 return "UNKNOWN_STATE";
97 test how assoc_ctx's are only usable on the connection
100 static BOOL test_assoc_ctx1(TALLOC_CTX *mem_ctx, const char *address)
103 struct wrepl_request *req;
104 struct wrepl_socket *wrepl_socket1;
105 struct wrepl_associate associate1;
106 struct wrepl_socket *wrepl_socket2;
107 struct wrepl_associate associate2;
108 struct wrepl_pull_table pull_table;
109 struct wrepl_packet packet;
110 struct wrepl_send_ctrl ctrl;
111 struct wrepl_packet *rep_packet;
112 struct wrepl_associate_stop assoc_stop;
115 if (!lp_parm_bool(-1, "torture", "dangerous", False)) {
116 printf("winsrepl: cross connection assoc_ctx usage disabled - enable dangerous tests to use\n");
120 printf("Test if assoc_ctx is only valid on the conection it was created on\n");
122 wrepl_socket1 = wrepl_socket_init(mem_ctx, NULL);
123 wrepl_socket2 = wrepl_socket_init(mem_ctx, NULL);
125 printf("Setup 2 wrepl connections\n");
126 status = wrepl_connect(wrepl_socket1, NULL, address);
127 CHECK_STATUS(status, NT_STATUS_OK);
129 status = wrepl_connect(wrepl_socket2, NULL, address);
130 CHECK_STATUS(status, NT_STATUS_OK);
132 printf("Send a start association request (conn1)\n");
133 status = wrepl_associate(wrepl_socket1, &associate1);
134 CHECK_STATUS(status, NT_STATUS_OK);
136 printf("association context (conn1): 0x%x\n", associate1.out.assoc_ctx);
138 printf("Send a start association request (conn2)\n");
139 status = wrepl_associate(wrepl_socket2, &associate2);
140 CHECK_STATUS(status, NT_STATUS_OK);
142 printf("association context (conn2): 0x%x\n", associate2.out.assoc_ctx);
144 printf("Send a replication table query, with assoc 1 (conn2), the anwser should be on conn1\n");
146 packet.opcode = WREPL_OPCODE_BITS;
147 packet.assoc_ctx = associate1.out.assoc_ctx;
148 packet.mess_type = WREPL_REPLICATION;
149 packet.message.replication.command = WREPL_REPL_TABLE_QUERY;
151 ctrl.send_only = True;
152 req = wrepl_request_send(wrepl_socket2, &packet, &ctrl);
153 status = wrepl_request_recv(req, mem_ctx, &rep_packet);
154 CHECK_STATUS(status, NT_STATUS_OK);
156 printf("Send a association request (conn2), to make sure the last request was ignored\n");
157 status = wrepl_associate(wrepl_socket2, &associate2);
158 CHECK_STATUS(status, NT_STATUS_OK);
160 printf("Send a replication table query, with invalid assoc (conn1), receive answer from conn2\n");
161 pull_table.in.assoc_ctx = 0;
162 req = wrepl_pull_table_send(wrepl_socket1, &pull_table);
163 status = wrepl_request_recv(req, mem_ctx, &rep_packet);
164 CHECK_STATUS(status, NT_STATUS_OK);
166 printf("Send a association request (conn1), to make sure the last request was handled correct\n");
167 status = wrepl_associate(wrepl_socket1, &associate2);
168 CHECK_STATUS(status, NT_STATUS_OK);
170 assoc_stop.in.assoc_ctx = associate1.out.assoc_ctx;
171 assoc_stop.in.reason = 4;
172 printf("Send a association stop request (conn1), reson: %u\n", assoc_stop.in.reason);
173 status = wrepl_associate_stop(wrepl_socket1, &assoc_stop);
174 CHECK_STATUS(status, NT_STATUS_END_OF_FILE);
176 assoc_stop.in.assoc_ctx = associate2.out.assoc_ctx;
177 assoc_stop.in.reason = 0;
178 printf("Send a association stop request (conn2), reson: %u\n", assoc_stop.in.reason);
179 status = wrepl_associate_stop(wrepl_socket2, &assoc_stop);
180 CHECK_STATUS(status, NT_STATUS_OK);
183 printf("Close 2 wrepl connections\n");
184 talloc_free(wrepl_socket1);
185 talloc_free(wrepl_socket2);
190 test if we always get back the same assoc_ctx
192 static BOOL test_assoc_ctx2(TALLOC_CTX *mem_ctx, const char *address)
195 struct wrepl_socket *wrepl_socket;
196 struct wrepl_associate associate;
200 printf("Test if we always get back the same assoc_ctx\n");
202 wrepl_socket = wrepl_socket_init(mem_ctx, NULL);
204 printf("Setup wrepl connections\n");
205 status = wrepl_connect(wrepl_socket, NULL, address);
206 CHECK_STATUS(status, NT_STATUS_OK);
209 printf("Send 1st start association request\n");
210 status = wrepl_associate(wrepl_socket, &associate);
211 CHECK_STATUS(status, NT_STATUS_OK);
212 assoc_ctx1 = associate.out.assoc_ctx;
213 printf("1st association context: 0x%x\n", associate.out.assoc_ctx);
215 printf("Send 2nd start association request\n");
216 status = wrepl_associate(wrepl_socket, &associate);
217 CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1);
218 CHECK_STATUS(status, NT_STATUS_OK);
219 printf("2nd association context: 0x%x\n", associate.out.assoc_ctx);
221 printf("Send 3rd start association request\n");
222 status = wrepl_associate(wrepl_socket, &associate);
223 CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1);
224 CHECK_STATUS(status, NT_STATUS_OK);
225 printf("3rd association context: 0x%x\n", associate.out.assoc_ctx);
228 printf("Close wrepl connections\n");
229 talloc_free(wrepl_socket);
235 display a replication entry
237 static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_name *name)
241 printf("%s\n", nbt_name_string(mem_ctx, &name->name));
242 printf("\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n",
243 name->type, name->state, name->node, name->is_static, (long long)name->version_id);
244 printf("\tRAW_FLAGS: 0x%08X OWNER: %-15s\n",
245 name->raw_flags, name->owner);
246 for (i=0;i<name->num_addresses;i++) {
247 printf("\tADDR: %-15s OWNER: %-15s\n",
248 name->addresses[i].address, name->addresses[i].owner);
253 test a full replication dump from a WINS server
255 static BOOL test_wins_replication(TALLOC_CTX *mem_ctx, const char *address)
258 struct wrepl_socket *wrepl_socket;
261 struct wrepl_associate associate;
262 struct wrepl_pull_table pull_table;
263 struct wrepl_pull_names pull_names;
265 printf("Test one pull replication cycle\n");
267 wrepl_socket = wrepl_socket_init(mem_ctx, NULL);
269 printf("Setup wrepl connections\n");
270 status = wrepl_connect(wrepl_socket, NULL, address);
271 CHECK_STATUS(status, NT_STATUS_OK);
273 printf("Send a start association request\n");
275 status = wrepl_associate(wrepl_socket, &associate);
276 CHECK_STATUS(status, NT_STATUS_OK);
278 printf("association context: 0x%x\n", associate.out.assoc_ctx);
280 printf("Send a replication table query\n");
281 pull_table.in.assoc_ctx = associate.out.assoc_ctx;
283 status = wrepl_pull_table(wrepl_socket, mem_ctx, &pull_table);
284 if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) {
285 struct wrepl_packet packet;
286 struct wrepl_request *req;
289 packet.opcode = WREPL_OPCODE_BITS;
290 packet.assoc_ctx = associate.out.assoc_ctx;
291 packet.mess_type = WREPL_STOP_ASSOCIATION;
292 packet.message.stop.reason = 0;
294 req = wrepl_request_send(wrepl_socket, &packet, NULL);
297 printf("failed - We are not a valid pull partner for the server\n");
301 CHECK_STATUS(status, NT_STATUS_OK);
303 printf("Found %d replication partners\n", pull_table.out.num_partners);
305 for (i=0;i<pull_table.out.num_partners;i++) {
306 struct wrepl_wins_owner *partner = &pull_table.out.partners[i];
307 printf("%s max_version=%6llu min_version=%6llu type=%d\n",
309 (long long)partner->max_version,
310 (long long)partner->min_version,
313 pull_names.in.assoc_ctx = associate.out.assoc_ctx;
314 pull_names.in.partner = *partner;
316 status = wrepl_pull_names(wrepl_socket, mem_ctx, &pull_names);
317 CHECK_STATUS(status, NT_STATUS_OK);
319 printf("Received %d names\n", pull_names.out.num_names);
321 for (j=0;j<pull_names.out.num_names;j++) {
322 display_entry(mem_ctx, &pull_names.out.names[j]);
327 printf("Close wrepl connections\n");
328 talloc_free(wrepl_socket);
332 struct test_wrepl_conflict_conn {
334 struct wrepl_socket *pull;
337 #define TEST_OWNER_A_ADDRESS "127.65.65.1"
338 #define TEST_ADDRESS_A_PREFIX "127.0.65"
339 #define TEST_OWNER_B_ADDRESS "127.66.66.1"
340 #define TEST_ADDRESS_B_PREFIX "127.0.66"
341 #define TEST_OWNER_X_ADDRESS "127.88.88.1"
342 #define TEST_ADDRESS_X_PREFIX "127.0.88"
344 struct wrepl_wins_owner a, b, c, x;
346 struct socket_address *myaddr;
347 struct socket_address *myaddr2;
348 struct nbt_name_socket *nbtsock;
349 struct nbt_name_socket *nbtsock2;
351 struct nbt_name_socket *nbtsock_srv;
352 struct nbt_name_socket *nbtsock_srv2;
354 uint32_t addresses_best_num;
355 struct wrepl_ip *addresses_best;
357 uint32_t addresses_best2_num;
358 struct wrepl_ip *addresses_best2;
360 uint32_t addresses_all_num;
361 struct wrepl_ip *addresses_all;
363 uint32_t addresses_mhomed_num;
364 struct wrepl_ip *addresses_mhomed;
367 static const struct wrepl_ip addresses_A_1[] = {
369 .owner = TEST_OWNER_A_ADDRESS,
370 .ip = TEST_ADDRESS_A_PREFIX".1"
373 static const struct wrepl_ip addresses_A_2[] = {
375 .owner = TEST_OWNER_A_ADDRESS,
376 .ip = TEST_ADDRESS_A_PREFIX".2"
379 static const struct wrepl_ip addresses_A_3_4[] = {
381 .owner = TEST_OWNER_A_ADDRESS,
382 .ip = TEST_ADDRESS_A_PREFIX".3"
385 .owner = TEST_OWNER_A_ADDRESS,
386 .ip = TEST_ADDRESS_A_PREFIX".4"
389 static const struct wrepl_ip addresses_A_3_4_X_3_4[] = {
391 .owner = TEST_OWNER_A_ADDRESS,
392 .ip = TEST_ADDRESS_A_PREFIX".3"
395 .owner = TEST_OWNER_A_ADDRESS,
396 .ip = TEST_ADDRESS_A_PREFIX".4"
399 .owner = TEST_OWNER_X_ADDRESS,
400 .ip = TEST_ADDRESS_X_PREFIX".3"
403 .owner = TEST_OWNER_X_ADDRESS,
404 .ip = TEST_ADDRESS_X_PREFIX".4"
407 static const struct wrepl_ip addresses_A_3_4_B_3_4[] = {
409 .owner = TEST_OWNER_A_ADDRESS,
410 .ip = TEST_ADDRESS_A_PREFIX".3"
413 .owner = TEST_OWNER_A_ADDRESS,
414 .ip = TEST_ADDRESS_A_PREFIX".4"
417 .owner = TEST_OWNER_B_ADDRESS,
418 .ip = TEST_ADDRESS_B_PREFIX".3"
421 .owner = TEST_OWNER_B_ADDRESS,
422 .ip = TEST_ADDRESS_B_PREFIX".4"
425 static const struct wrepl_ip addresses_A_3_4_OWNER_B[] = {
427 .owner = TEST_OWNER_B_ADDRESS,
428 .ip = TEST_ADDRESS_A_PREFIX".3"
431 .owner = TEST_OWNER_B_ADDRESS,
432 .ip = TEST_ADDRESS_A_PREFIX".4"
435 static const struct wrepl_ip addresses_A_3_4_X_3_4_OWNER_B[] = {
437 .owner = TEST_OWNER_B_ADDRESS,
438 .ip = TEST_ADDRESS_A_PREFIX".3"
441 .owner = TEST_OWNER_B_ADDRESS,
442 .ip = TEST_ADDRESS_A_PREFIX".4"
445 .owner = TEST_OWNER_B_ADDRESS,
446 .ip = TEST_ADDRESS_X_PREFIX".3"
449 .owner = TEST_OWNER_B_ADDRESS,
450 .ip = TEST_ADDRESS_X_PREFIX".4"
454 static const struct wrepl_ip addresses_A_3_4_X_1_2[] = {
456 .owner = TEST_OWNER_A_ADDRESS,
457 .ip = TEST_ADDRESS_A_PREFIX".3"
460 .owner = TEST_OWNER_A_ADDRESS,
461 .ip = TEST_ADDRESS_A_PREFIX".4"
464 .owner = TEST_OWNER_X_ADDRESS,
465 .ip = TEST_ADDRESS_X_PREFIX".1"
468 .owner = TEST_OWNER_X_ADDRESS,
469 .ip = TEST_ADDRESS_X_PREFIX".2"
473 static const struct wrepl_ip addresses_B_1[] = {
475 .owner = TEST_OWNER_B_ADDRESS,
476 .ip = TEST_ADDRESS_B_PREFIX".1"
479 static const struct wrepl_ip addresses_B_2[] = {
481 .owner = TEST_OWNER_B_ADDRESS,
482 .ip = TEST_ADDRESS_B_PREFIX".2"
485 static const struct wrepl_ip addresses_B_3_4[] = {
487 .owner = TEST_OWNER_B_ADDRESS,
488 .ip = TEST_ADDRESS_B_PREFIX".3"
491 .owner = TEST_OWNER_B_ADDRESS,
492 .ip = TEST_ADDRESS_B_PREFIX".4"
495 static const struct wrepl_ip addresses_B_3_4_X_3_4[] = {
497 .owner = TEST_OWNER_B_ADDRESS,
498 .ip = TEST_ADDRESS_B_PREFIX".3"
501 .owner = TEST_OWNER_B_ADDRESS,
502 .ip = TEST_ADDRESS_B_PREFIX".4"
505 .owner = TEST_OWNER_X_ADDRESS,
506 .ip = TEST_ADDRESS_X_PREFIX".3"
509 .owner = TEST_OWNER_X_ADDRESS,
510 .ip = TEST_ADDRESS_X_PREFIX".4"
513 static const struct wrepl_ip addresses_B_3_4_X_1_2[] = {
515 .owner = TEST_OWNER_B_ADDRESS,
516 .ip = TEST_ADDRESS_B_PREFIX".3"
519 .owner = TEST_OWNER_B_ADDRESS,
520 .ip = TEST_ADDRESS_B_PREFIX".4"
523 .owner = TEST_OWNER_X_ADDRESS,
524 .ip = TEST_ADDRESS_X_PREFIX".1"
527 .owner = TEST_OWNER_X_ADDRESS,
528 .ip = TEST_ADDRESS_X_PREFIX".2"
532 static const struct wrepl_ip addresses_X_1_2[] = {
534 .owner = TEST_OWNER_X_ADDRESS,
535 .ip = TEST_ADDRESS_X_PREFIX".1"
538 .owner = TEST_OWNER_X_ADDRESS,
539 .ip = TEST_ADDRESS_X_PREFIX".2"
542 static const struct wrepl_ip addresses_X_3_4[] = {
544 .owner = TEST_OWNER_X_ADDRESS,
545 .ip = TEST_ADDRESS_X_PREFIX".3"
548 .owner = TEST_OWNER_X_ADDRESS,
549 .ip = TEST_ADDRESS_X_PREFIX".4"
553 static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem_ctx,
556 struct test_wrepl_conflict_conn *ctx;
557 struct wrepl_associate associate;
558 struct wrepl_pull_table pull_table;
559 struct socket_address *nbt_srv_addr;
563 ctx = talloc_zero(mem_ctx, struct test_wrepl_conflict_conn);
564 if (!ctx) return NULL;
566 ctx->address = address;
567 ctx->pull = wrepl_socket_init(ctx, NULL);
568 if (!ctx->pull) return NULL;
570 printf("Setup wrepl conflict pull connection\n");
571 status = wrepl_connect(ctx->pull, NULL, ctx->address);
572 if (!NT_STATUS_IS_OK(status)) return NULL;
574 status = wrepl_associate(ctx->pull, &associate);
575 if (!NT_STATUS_IS_OK(status)) return NULL;
577 ctx->pull_assoc = associate.out.assoc_ctx;
579 ctx->a.address = TEST_OWNER_A_ADDRESS;
580 ctx->a.max_version = 0;
581 ctx->a.min_version = 0;
584 ctx->b.address = TEST_OWNER_B_ADDRESS;
585 ctx->b.max_version = 0;
586 ctx->b.min_version = 0;
589 ctx->x.address = TEST_OWNER_X_ADDRESS;
590 ctx->x.max_version = 0;
591 ctx->x.min_version = 0;
594 ctx->c.address = address;
595 ctx->c.max_version = 0;
596 ctx->c.min_version = 0;
599 pull_table.in.assoc_ctx = ctx->pull_assoc;
600 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
601 if (!NT_STATUS_IS_OK(status)) return NULL;
603 for (i=0; i < pull_table.out.num_partners; i++) {
604 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
605 ctx->a.max_version = pull_table.out.partners[i].max_version;
606 ctx->a.min_version = pull_table.out.partners[i].min_version;
608 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
609 ctx->b.max_version = pull_table.out.partners[i].max_version;
610 ctx->b.min_version = pull_table.out.partners[i].min_version;
612 if (strcmp(TEST_OWNER_X_ADDRESS,pull_table.out.partners[i].address)==0) {
613 ctx->x.max_version = pull_table.out.partners[i].max_version;
614 ctx->x.min_version = pull_table.out.partners[i].min_version;
616 if (strcmp(address,pull_table.out.partners[i].address)==0) {
617 ctx->c.max_version = pull_table.out.partners[i].max_version;
618 ctx->c.min_version = pull_table.out.partners[i].min_version;
622 talloc_free(pull_table.out.partners);
624 ctx->nbtsock = nbt_name_socket_init(ctx, NULL);
625 if (!ctx->nbtsock) return NULL;
627 ctx->myaddr = socket_address_from_strings(mem_ctx, ctx->nbtsock->sock->backend_name, iface_best_ip(address), 0);
628 if (!ctx->myaddr) return NULL;
630 for (i = 0; i < iface_count(); i++) {
631 if (strcmp(ctx->myaddr->addr, iface_n_ip(i)) == 0) continue;
632 ctx->myaddr2 = socket_address_from_strings(mem_ctx, ctx->nbtsock->sock->backend_name, iface_n_ip(i), 0);
633 if (!ctx->myaddr2) return NULL;
637 status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0);
638 if (!NT_STATUS_IS_OK(status)) return NULL;
640 ctx->nbtsock_srv = nbt_name_socket_init(ctx, NULL);
641 if (!ctx->nbtsock_srv) return NULL;
643 /* Make a port 137 version of ctx->myaddr */
644 nbt_srv_addr = socket_address_from_strings(mem_ctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lp_nbt_port());
645 if (!nbt_srv_addr) return NULL;
647 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
648 status = socket_listen(ctx->nbtsock_srv->sock, nbt_srv_addr, 0, 0);
649 talloc_free(nbt_srv_addr);
650 if (!NT_STATUS_IS_OK(status)) {
651 /* this isn't fatal */
652 talloc_free(ctx->nbtsock_srv);
653 ctx->nbtsock_srv = NULL;
656 if (ctx->myaddr2 && ctx->nbtsock_srv) {
657 ctx->nbtsock2 = nbt_name_socket_init(ctx, NULL);
658 if (!ctx->nbtsock2) return NULL;
660 status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0);
661 if (!NT_STATUS_IS_OK(status)) return NULL;
663 ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx);
664 if (!ctx->nbtsock_srv2) return NULL;
666 /* Make a port 137 version of ctx->myaddr2 */
667 nbt_srv_addr = socket_address_from_strings(mem_ctx,
668 ctx->nbtsock_srv->sock->backend_name,
669 ctx->myaddr2->addr, lp_nbt_port());
670 if (!nbt_srv_addr) return NULL;
672 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
673 status = socket_listen(ctx->nbtsock_srv2->sock, ctx->myaddr2, 0, 0);
674 talloc_free(nbt_srv_addr);
675 if (!NT_STATUS_IS_OK(status)) {
676 /* this isn't fatal */
677 talloc_free(ctx->nbtsock_srv2);
678 ctx->nbtsock_srv2 = NULL;
682 ctx->addresses_best_num = 1;
683 ctx->addresses_best = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best_num);
684 if (!ctx->addresses_best) return NULL;
685 ctx->addresses_best[0].owner = ctx->b.address;
686 ctx->addresses_best[0].ip = ctx->myaddr->addr;
688 ctx->addresses_all_num = iface_count();
689 ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num);
690 if (!ctx->addresses_all) return NULL;
691 for (i=0; i < ctx->addresses_all_num; i++) {
692 ctx->addresses_all[i].owner = ctx->b.address;
693 ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(i));
694 if (!ctx->addresses_all[i].ip) return NULL;
697 if (ctx->nbtsock_srv2) {
698 ctx->addresses_best2_num = 1;
699 ctx->addresses_best2 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best2_num);
700 if (!ctx->addresses_best2) return NULL;
701 ctx->addresses_best2[0].owner = ctx->b.address;
702 ctx->addresses_best2[0].ip = ctx->myaddr2->addr;
704 ctx->addresses_mhomed_num = 2;
705 ctx->addresses_mhomed = talloc_array(ctx, struct wrepl_ip, ctx->addresses_mhomed_num);
706 if (!ctx->addresses_mhomed) return NULL;
707 ctx->addresses_mhomed[0].owner = ctx->b.address;
708 ctx->addresses_mhomed[0].ip = ctx->myaddr->addr;
709 ctx->addresses_mhomed[1].owner = ctx->b.address;
710 ctx->addresses_mhomed[1].ip = ctx->myaddr2->addr;
716 static BOOL test_wrepl_update_one(struct test_wrepl_conflict_conn *ctx,
717 const struct wrepl_wins_owner *owner,
718 const struct wrepl_wins_name *name)
721 struct wrepl_socket *wrepl_socket;
722 struct wrepl_associate associate;
723 struct wrepl_packet update_packet, repl_send;
724 struct wrepl_table *update;
725 struct wrepl_wins_owner wrepl_wins_owners[1];
726 struct wrepl_packet *repl_recv;
727 struct wrepl_wins_owner *send_request;
728 struct wrepl_send_reply *send_reply;
729 struct wrepl_wins_name wrepl_wins_names[1];
733 wrepl_socket = wrepl_socket_init(ctx, NULL);
735 status = wrepl_connect(wrepl_socket, NULL, ctx->address);
736 CHECK_STATUS(status, NT_STATUS_OK);
738 status = wrepl_associate(wrepl_socket, &associate);
739 CHECK_STATUS(status, NT_STATUS_OK);
740 assoc_ctx = associate.out.assoc_ctx;
742 /* now send a WREPL_REPL_UPDATE message */
743 ZERO_STRUCT(update_packet);
744 update_packet.opcode = WREPL_OPCODE_BITS;
745 update_packet.assoc_ctx = assoc_ctx;
746 update_packet.mess_type = WREPL_REPLICATION;
747 update_packet.message.replication.command = WREPL_REPL_UPDATE;
748 update = &update_packet.message.replication.info.table;
750 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
751 update->partners = wrepl_wins_owners;
752 update->initiator = "0.0.0.0";
754 wrepl_wins_owners[0] = *owner;
756 status = wrepl_request(wrepl_socket, wrepl_socket,
757 &update_packet, &repl_recv);
758 CHECK_STATUS(status, NT_STATUS_OK);
759 CHECK_VALUE(repl_recv->mess_type, WREPL_REPLICATION);
760 CHECK_VALUE(repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
761 send_request = &repl_recv->message.replication.info.owner;
763 ZERO_STRUCT(repl_send);
764 repl_send.opcode = WREPL_OPCODE_BITS;
765 repl_send.assoc_ctx = assoc_ctx;
766 repl_send.mess_type = WREPL_REPLICATION;
767 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
768 send_reply = &repl_send.message.replication.info.reply;
770 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
771 send_reply->names = wrepl_wins_names;
773 wrepl_wins_names[0] = *name;
775 status = wrepl_request(wrepl_socket, wrepl_socket,
776 &repl_send, &repl_recv);
777 CHECK_STATUS(status, NT_STATUS_OK);
778 CHECK_VALUE(repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
779 CHECK_VALUE(repl_recv->message.stop.reason, 0);
782 talloc_free(wrepl_socket);
786 static BOOL test_wrepl_is_applied(struct test_wrepl_conflict_conn *ctx,
787 const struct wrepl_wins_owner *owner,
788 const struct wrepl_wins_name *name,
793 struct wrepl_pull_names pull_names;
794 struct wrepl_name *names;
796 pull_names.in.assoc_ctx = ctx->pull_assoc;
797 pull_names.in.partner = *owner;
798 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
800 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
801 CHECK_STATUS(status, NT_STATUS_OK);
802 CHECK_VALUE(pull_names.out.num_names, (expected?1:0));
804 names = pull_names.out.names;
807 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
811 CHECK_VALUE(names[0].name.type, name->name->type);
812 CHECK_VALUE_STRING(names[0].name.name, name->name->name);
813 CHECK_VALUE_STRING(names[0].name.scope, name->name->scope);
814 CHECK_VALUE(flags, name->flags);
815 CHECK_VALUE_UINT64(names[0].version_id, name->id);
818 CHECK_VALUE(names[0].num_addresses,
819 name->addresses.addresses.num_ips);
821 CHECK_VALUE(names[0].num_addresses, 1);
822 CHECK_VALUE_STRING(names[0].addresses[0].address,
827 talloc_free(pull_names.out.names);
831 static BOOL test_wrepl_mhomed_merged(struct test_wrepl_conflict_conn *ctx,
832 const struct wrepl_wins_owner *owner1,
833 uint32_t num_ips1, const struct wrepl_ip *ips1,
834 const struct wrepl_wins_owner *owner2,
835 uint32_t num_ips2, const struct wrepl_ip *ips2,
836 const struct wrepl_wins_name *name2)
840 struct wrepl_pull_names pull_names;
841 struct wrepl_name *names;
844 uint32_t num_ips = num_ips1 + num_ips2;
846 for (i = 0; i < num_ips2; i++) {
847 for (j = 0; j < num_ips1; j++) {
848 if (strcmp(ips2[i].ip,ips1[j].ip) == 0) {
855 pull_names.in.assoc_ctx = ctx->pull_assoc;
856 pull_names.in.partner = *owner2;
857 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
859 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
860 CHECK_STATUS(status, NT_STATUS_OK);
861 CHECK_VALUE(pull_names.out.num_names, 1);
863 names = pull_names.out.names;
865 flags = WREPL_NAME_FLAGS(names[0].type,
869 CHECK_VALUE(names[0].name.type, name2->name->type);
870 CHECK_VALUE_STRING(names[0].name.name, name2->name->name);
871 CHECK_VALUE_STRING(names[0].name.scope, name2->name->scope);
872 CHECK_VALUE(flags, name2->flags | WREPL_TYPE_MHOMED);
873 CHECK_VALUE_UINT64(names[0].version_id, name2->id);
875 CHECK_VALUE(names[0].num_addresses, num_ips);
877 for (i = 0; i < names[0].num_addresses; i++) {
878 const char *addr = names[0].addresses[i].address;
879 const char *owner = names[0].addresses[i].owner;
882 for (j = 0; j < num_ips2; j++) {
883 if (strcmp(addr, ips2[j].ip) == 0) {
885 CHECK_VALUE_STRING(owner, owner2->address);
892 for (j = 0; j < num_ips1; j++) {
893 if (strcmp(addr, ips1[j].ip) == 0) {
895 CHECK_VALUE_STRING(owner, owner1->address);
902 CHECK_VALUE_STRING(addr, "not found in address list");
905 talloc_free(pull_names.out.names);
909 static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx,
910 struct wrepl_wins_owner *merge_owner,
911 struct wrepl_wins_owner *owner1,
912 uint32_t num_ips1, const struct wrepl_ip *ips1,
913 struct wrepl_wins_owner *owner2,
914 uint32_t num_ips2, const struct wrepl_ip *ips2,
915 const struct wrepl_wins_name *name2)
919 struct wrepl_pull_names pull_names;
920 struct wrepl_name *names;
921 struct wrepl_name *name = NULL;
924 uint32_t num_ips = num_ips1 + num_ips2;
927 merge_owner = &ctx->c;
930 for (i = 0; i < num_ips1; i++) {
931 if (owner1 != &ctx->c && strcmp(ips1[i].owner,owner2->address) == 0) {
935 for (j = 0; j < num_ips2; j++) {
936 if (strcmp(ips1[i].ip,ips2[j].ip) == 0) {
944 pull_names.in.assoc_ctx = ctx->pull_assoc;
945 pull_names.in.partner = *merge_owner;
946 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
947 pull_names.in.partner.max_version = 0;
949 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
950 CHECK_STATUS(status, NT_STATUS_OK);
952 names = pull_names.out.names;
954 for (i = 0; i < pull_names.out.num_names; i++) {
955 if (names[i].name.type != name2->name->type) continue;
956 if (!names[i].name.name) continue;
957 if (strcmp(names[i].name.name, name2->name->name) != 0) continue;
958 if (names[i].name.scope) continue;
963 if (pull_names.out.num_names > 0) {
964 merge_owner->max_version = names[pull_names.out.num_names-1].version_id;
968 printf("%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name));
972 flags = WREPL_NAME_FLAGS(name->type,
976 CHECK_VALUE(name->name.type, name2->name->type);
977 CHECK_VALUE_STRING(name->name.name, name2->name->name);
978 CHECK_VALUE_STRING(name->name.scope, name2->name->scope);
979 CHECK_VALUE(flags, name2->flags);
981 CHECK_VALUE(name->num_addresses, num_ips);
983 for (i = 0; i < name->num_addresses; i++) {
984 const char *addr = name->addresses[i].address;
985 const char *owner = name->addresses[i].owner;
988 for (j = 0; j < num_ips2; j++) {
989 if (strcmp(addr, ips2[j].ip) == 0) {
991 CHECK_VALUE_STRING(owner, ips2[j].owner);
998 for (j = 0; j < num_ips1; j++) {
999 if (strcmp(addr, ips1[j].ip) == 0) {
1001 if (owner1 == &ctx->c) {
1002 CHECK_VALUE_STRING(owner, owner1->address);
1004 CHECK_VALUE_STRING(owner, ips1[j].owner);
1010 if (found) continue;
1012 CHECK_VALUE_STRING(addr, "not found in address list");
1015 talloc_free(pull_names.out.names);
1019 static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx)
1022 struct nbt_name name;
1023 struct wrepl_wins_name wins_name1;
1024 struct wrepl_wins_name wins_name2;
1025 struct wrepl_wins_name *wins_name_tmp;
1026 struct wrepl_wins_name *wins_name_last;
1027 struct wrepl_wins_name *wins_name_cur;
1029 uint8_t types[] = { 0x00, 0x1C };
1031 enum wrepl_name_type type;
1032 enum wrepl_name_state state;
1033 enum wrepl_name_node node;
1036 const struct wrepl_ip *ips;
1039 .type = WREPL_TYPE_GROUP,
1040 .state = WREPL_STATE_ACTIVE,
1041 .node = WREPL_NODE_B,
1043 .num_ips = ARRAY_SIZE(addresses_A_1),
1044 .ips = addresses_A_1,
1046 .type = WREPL_TYPE_UNIQUE,
1047 .state = WREPL_STATE_ACTIVE,
1048 .node = WREPL_NODE_B,
1050 .num_ips = ARRAY_SIZE(addresses_A_1),
1051 .ips = addresses_A_1,
1053 .type = WREPL_TYPE_UNIQUE,
1054 .state = WREPL_STATE_ACTIVE,
1055 .node = WREPL_NODE_B,
1057 .num_ips = ARRAY_SIZE(addresses_A_2),
1058 .ips = addresses_A_2,
1060 .type = WREPL_TYPE_UNIQUE,
1061 .state = WREPL_STATE_ACTIVE,
1062 .node = WREPL_NODE_B,
1064 .num_ips = ARRAY_SIZE(addresses_A_1),
1065 .ips = addresses_A_1,
1067 .type = WREPL_TYPE_UNIQUE,
1068 .state = WREPL_STATE_ACTIVE,
1069 .node = WREPL_NODE_B,
1071 .num_ips = ARRAY_SIZE(addresses_A_2),
1072 .ips = addresses_A_2,
1074 .type = WREPL_TYPE_SGROUP,
1075 .state = WREPL_STATE_TOMBSTONE,
1076 .node = WREPL_NODE_B,
1078 .num_ips = ARRAY_SIZE(addresses_A_2),
1079 .ips = addresses_A_2,
1081 .type = WREPL_TYPE_MHOMED,
1082 .state = WREPL_STATE_TOMBSTONE,
1083 .node = WREPL_NODE_B,
1085 .num_ips = ARRAY_SIZE(addresses_A_1),
1086 .ips = addresses_A_1,
1088 .type = WREPL_TYPE_MHOMED,
1089 .state = WREPL_STATE_RELEASED,
1090 .node = WREPL_NODE_B,
1092 .num_ips = ARRAY_SIZE(addresses_A_2),
1093 .ips = addresses_A_2,
1095 .type = WREPL_TYPE_SGROUP,
1096 .state = WREPL_STATE_ACTIVE,
1097 .node = WREPL_NODE_B,
1099 .num_ips = ARRAY_SIZE(addresses_A_1),
1100 .ips = addresses_A_1,
1102 .type = WREPL_TYPE_SGROUP,
1103 .state = WREPL_STATE_ACTIVE,
1104 .node = WREPL_NODE_B,
1106 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1107 .ips = addresses_A_3_4,
1109 .type = WREPL_TYPE_SGROUP,
1110 .state = WREPL_STATE_TOMBSTONE,
1111 .node = WREPL_NODE_B,
1113 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1114 .ips = addresses_B_3_4,
1116 /* the last one should always be a unique,tomstone record! */
1117 .type = WREPL_TYPE_UNIQUE,
1118 .state = WREPL_STATE_TOMBSTONE,
1119 .node = WREPL_NODE_B,
1121 .num_ips = ARRAY_SIZE(addresses_A_1),
1122 .ips = addresses_A_1,
1126 name.name = "_SAME_OWNER_A";
1130 wins_name_tmp = NULL;
1131 wins_name_last = &wins_name2;
1132 wins_name_cur = &wins_name1;
1134 for (j=0; ret && j < ARRAY_SIZE(types); j++) {
1135 name.type = types[j];
1136 printf("Test Replica Conflicts with same owner[%s] for %s\n",
1137 nbt_name_string(ctx, &name), ctx->a.address);
1139 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
1140 wins_name_tmp = wins_name_last;
1141 wins_name_last = wins_name_cur;
1142 wins_name_cur = wins_name_tmp;
1145 printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
1146 wrepl_name_type_string(records[i-1].type),
1147 wrepl_name_state_string(records[i-1].state),
1148 (records[i-1].is_static?",static":""),
1149 wrepl_name_type_string(records[i].type),
1150 wrepl_name_state_string(records[i].state),
1151 (records[i].is_static?",static":""),
1152 (records[i-1].ips==records[i].ips?"same":"different"),
1156 wins_name_cur->name = &name;
1157 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
1160 records[i].is_static);
1161 wins_name_cur->id = ++ctx->a.max_version;
1162 if (wins_name_cur->flags & 2) {
1163 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
1164 wins_name_cur->addresses.addresses.ips = discard_const(records[i].ips);
1166 wins_name_cur->addresses.ip = records[i].ips[0].ip;
1168 wins_name_cur->unknown = "255.255.255.255";
1170 ret &= test_wrepl_update_one(ctx, &ctx->a,wins_name_cur);
1171 if (records[i].state == WREPL_STATE_RELEASED) {
1172 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_last, False);
1173 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, False);
1175 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, True);
1178 /* the first one is a cleanup run */
1179 if (!ret && i == 0) ret = True;
1182 printf("conflict handled wrong or record[%u]: %s\n", i, __location__);
1190 static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx)
1193 struct wrepl_wins_name wins_name1;
1194 struct wrepl_wins_name wins_name2;
1195 struct wrepl_wins_name *wins_name_r1;
1196 struct wrepl_wins_name *wins_name_r2;
1199 const char *line; /* just better debugging */
1200 struct nbt_name name;
1201 const char *comment;
1202 BOOL extra; /* not the worst case, this is an extra test */
1205 struct wrepl_wins_owner *owner;
1206 enum wrepl_name_type type;
1207 enum wrepl_name_state state;
1208 enum wrepl_name_node node;
1211 const struct wrepl_ip *ips;
1212 BOOL apply_expected;
1214 struct wrepl_wins_owner *merge_owner;
1215 BOOL sgroup_cleanup;
1219 * NOTE: the first record and the last applied one
1220 * needs to be from the same owner,
1221 * to not conflict in the next smbtorture run!!!
1224 .line = __location__,
1225 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1229 .type = WREPL_TYPE_UNIQUE,
1230 .state = WREPL_STATE_TOMBSTONE,
1231 .node = WREPL_NODE_B,
1233 .num_ips = ARRAY_SIZE(addresses_B_1),
1234 .ips = addresses_B_1,
1235 .apply_expected = True /* ignored */
1239 .type = WREPL_TYPE_UNIQUE,
1240 .state = WREPL_STATE_TOMBSTONE,
1241 .node = WREPL_NODE_B,
1243 .num_ips = ARRAY_SIZE(addresses_A_1),
1244 .ips = addresses_A_1,
1245 .apply_expected = True /* ignored */
1250 * unique vs unique section
1253 * unique,active vs. unique,active
1254 * => should be replaced
1257 .line = __location__,
1258 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1261 .type = WREPL_TYPE_UNIQUE,
1262 .state = WREPL_STATE_ACTIVE,
1263 .node = WREPL_NODE_B,
1265 .num_ips = ARRAY_SIZE(addresses_A_1),
1266 .ips = addresses_A_1,
1267 .apply_expected = True
1271 .type = WREPL_TYPE_UNIQUE,
1272 .state = WREPL_STATE_ACTIVE,
1273 .node = WREPL_NODE_B,
1275 .num_ips = ARRAY_SIZE(addresses_B_1),
1276 .ips = addresses_B_1,
1277 .apply_expected = True
1282 * unique,active vs. unique,tombstone
1283 * => should NOT be replaced
1286 .line = __location__,
1287 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1290 .type = WREPL_TYPE_UNIQUE,
1291 .state = WREPL_STATE_ACTIVE,
1292 .node = WREPL_NODE_B,
1294 .num_ips = ARRAY_SIZE(addresses_B_1),
1295 .ips = addresses_B_1,
1296 .apply_expected = True
1300 .type = WREPL_TYPE_UNIQUE,
1301 .state = WREPL_STATE_TOMBSTONE,
1302 .node = WREPL_NODE_B,
1304 .num_ips = ARRAY_SIZE(addresses_B_1),
1305 .ips = addresses_B_1,
1306 .apply_expected = False
1311 * unique,released vs. unique,active
1312 * => should be replaced
1315 .line = __location__,
1316 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1319 .type = WREPL_TYPE_UNIQUE,
1320 .state = WREPL_STATE_RELEASED,
1321 .node = WREPL_NODE_B,
1323 .num_ips = ARRAY_SIZE(addresses_B_1),
1324 .ips = addresses_B_1,
1325 .apply_expected = False
1329 .type = WREPL_TYPE_UNIQUE,
1330 .state = WREPL_STATE_ACTIVE,
1331 .node = WREPL_NODE_B,
1333 .num_ips = ARRAY_SIZE(addresses_A_1),
1334 .ips = addresses_A_1,
1335 .apply_expected = True
1340 * unique,released vs. unique,tombstone
1341 * => should be replaced
1344 .line = __location__,
1345 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1348 .type = WREPL_TYPE_UNIQUE,
1349 .state = WREPL_STATE_RELEASED,
1350 .node = WREPL_NODE_B,
1352 .num_ips = ARRAY_SIZE(addresses_A_1),
1353 .ips = addresses_A_1,
1354 .apply_expected = False
1358 .type = WREPL_TYPE_UNIQUE,
1359 .state = WREPL_STATE_TOMBSTONE,
1360 .node = WREPL_NODE_B,
1362 .num_ips = ARRAY_SIZE(addresses_B_1),
1363 .ips = addresses_B_1,
1364 .apply_expected = True
1369 * unique,tombstone vs. unique,active
1370 * => should be replaced
1373 .line = __location__,
1374 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1377 .type = WREPL_TYPE_UNIQUE,
1378 .state = WREPL_STATE_TOMBSTONE,
1379 .node = WREPL_NODE_B,
1381 .num_ips = ARRAY_SIZE(addresses_B_1),
1382 .ips = addresses_B_1,
1383 .apply_expected = True
1387 .type = WREPL_TYPE_UNIQUE,
1388 .state = WREPL_STATE_ACTIVE,
1389 .node = WREPL_NODE_B,
1391 .num_ips = ARRAY_SIZE(addresses_A_1),
1392 .ips = addresses_A_1,
1393 .apply_expected = True
1398 * unique,tombstone vs. unique,tombstone
1399 * => should be replaced
1402 .line = __location__,
1403 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1406 .type = WREPL_TYPE_UNIQUE,
1407 .state = WREPL_STATE_TOMBSTONE,
1408 .node = WREPL_NODE_B,
1410 .num_ips = ARRAY_SIZE(addresses_A_1),
1411 .ips = addresses_A_1,
1412 .apply_expected = True
1416 .type = WREPL_TYPE_UNIQUE,
1417 .state = WREPL_STATE_TOMBSTONE,
1418 .node = WREPL_NODE_B,
1420 .num_ips = ARRAY_SIZE(addresses_B_1),
1421 .ips = addresses_B_1,
1422 .apply_expected = True
1428 * unique vs normal groups section,
1431 * unique,active vs. group,active
1432 * => should be replaced
1435 .line = __location__,
1436 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1439 .type = WREPL_TYPE_UNIQUE,
1440 .state = WREPL_STATE_ACTIVE,
1441 .node = WREPL_NODE_B,
1443 .num_ips = ARRAY_SIZE(addresses_B_1),
1444 .ips = addresses_B_1,
1445 .apply_expected = True
1449 .type = WREPL_TYPE_GROUP,
1450 .state = WREPL_STATE_ACTIVE,
1451 .node = WREPL_NODE_B,
1453 .num_ips = ARRAY_SIZE(addresses_A_1),
1454 .ips = addresses_A_1,
1455 .apply_expected = True
1460 * unique,active vs. group,tombstone
1461 * => should NOT be replaced
1464 .line = __location__,
1465 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1468 .type = WREPL_TYPE_UNIQUE,
1469 .state = WREPL_STATE_ACTIVE,
1470 .node = WREPL_NODE_B,
1472 .num_ips = ARRAY_SIZE(addresses_A_1),
1473 .ips = addresses_A_1,
1474 .apply_expected = True
1478 .type = WREPL_TYPE_GROUP,
1479 .state = WREPL_STATE_TOMBSTONE,
1480 .node = WREPL_NODE_B,
1482 .num_ips = ARRAY_SIZE(addresses_A_1),
1483 .ips = addresses_A_1,
1484 .apply_expected = False
1489 * unique,released vs. group,active
1490 * => should be replaced
1493 .line = __location__,
1494 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1497 .type = WREPL_TYPE_UNIQUE,
1498 .state = WREPL_STATE_RELEASED,
1499 .node = WREPL_NODE_B,
1501 .num_ips = ARRAY_SIZE(addresses_A_1),
1502 .ips = addresses_A_1,
1503 .apply_expected = False
1507 .type = WREPL_TYPE_GROUP,
1508 .state = WREPL_STATE_ACTIVE,
1509 .node = WREPL_NODE_B,
1511 .num_ips = ARRAY_SIZE(addresses_B_1),
1512 .ips = addresses_B_1,
1513 .apply_expected = True
1518 * unique,released vs. group,tombstone
1519 * => should be replaced
1522 .line = __location__,
1523 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1526 .type = WREPL_TYPE_UNIQUE,
1527 .state = WREPL_STATE_RELEASED,
1528 .node = WREPL_NODE_B,
1530 .num_ips = ARRAY_SIZE(addresses_B_1),
1531 .ips = addresses_B_1,
1532 .apply_expected = False
1536 .type = WREPL_TYPE_GROUP,
1537 .state = WREPL_STATE_TOMBSTONE,
1538 .node = WREPL_NODE_B,
1540 .num_ips = ARRAY_SIZE(addresses_A_1),
1541 .ips = addresses_A_1,
1542 .apply_expected = True
1547 * unique,tombstone vs. group,active
1548 * => should be replaced
1551 .line = __location__,
1552 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1555 .type = WREPL_TYPE_UNIQUE,
1556 .state = WREPL_STATE_TOMBSTONE,
1557 .node = WREPL_NODE_B,
1559 .num_ips = ARRAY_SIZE(addresses_A_1),
1560 .ips = addresses_A_1,
1561 .apply_expected = True
1565 .type = WREPL_TYPE_GROUP,
1566 .state = WREPL_STATE_ACTIVE,
1567 .node = WREPL_NODE_B,
1569 .num_ips = ARRAY_SIZE(addresses_B_1),
1570 .ips = addresses_B_1,
1571 .apply_expected = True
1576 * unique,tombstone vs. group,tombstone
1577 * => should be replaced
1580 .line = __location__,
1581 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1584 .type = WREPL_TYPE_UNIQUE,
1585 .state = WREPL_STATE_TOMBSTONE,
1586 .node = WREPL_NODE_B,
1588 .num_ips = ARRAY_SIZE(addresses_B_1),
1589 .ips = addresses_B_1,
1590 .apply_expected = True
1594 .type = WREPL_TYPE_GROUP,
1595 .state = WREPL_STATE_TOMBSTONE,
1596 .node = WREPL_NODE_B,
1598 .num_ips = ARRAY_SIZE(addresses_A_1),
1599 .ips = addresses_A_1,
1600 .apply_expected = True
1605 * unique vs special groups section,
1608 * unique,active vs. sgroup,active
1609 * => should NOT be replaced
1612 .line = __location__,
1613 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1616 .type = WREPL_TYPE_UNIQUE,
1617 .state = WREPL_STATE_ACTIVE,
1618 .node = WREPL_NODE_B,
1620 .num_ips = ARRAY_SIZE(addresses_A_1),
1621 .ips = addresses_A_1,
1622 .apply_expected = True
1626 .type = WREPL_TYPE_SGROUP,
1627 .state = WREPL_STATE_ACTIVE,
1628 .node = WREPL_NODE_B,
1630 .num_ips = ARRAY_SIZE(addresses_A_1),
1631 .ips = addresses_A_1,
1632 .apply_expected = False
1637 * unique,active vs. sgroup,tombstone
1638 * => should NOT be replaced
1641 .line = __location__,
1642 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1645 .type = WREPL_TYPE_UNIQUE,
1646 .state = WREPL_STATE_ACTIVE,
1647 .node = WREPL_NODE_B,
1649 .num_ips = ARRAY_SIZE(addresses_A_1),
1650 .ips = addresses_A_1,
1651 .apply_expected = True
1655 .type = WREPL_TYPE_SGROUP,
1656 .state = WREPL_STATE_TOMBSTONE,
1657 .node = WREPL_NODE_B,
1659 .num_ips = ARRAY_SIZE(addresses_A_1),
1660 .ips = addresses_A_1,
1661 .apply_expected = False
1666 * unique,released vs. sgroup,active
1667 * => should be replaced
1670 .line = __location__,
1671 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1674 .type = WREPL_TYPE_UNIQUE,
1675 .state = WREPL_STATE_RELEASED,
1676 .node = WREPL_NODE_B,
1678 .num_ips = ARRAY_SIZE(addresses_A_1),
1679 .ips = addresses_A_1,
1680 .apply_expected = False
1684 .type = WREPL_TYPE_SGROUP,
1685 .state = WREPL_STATE_ACTIVE,
1686 .node = WREPL_NODE_B,
1688 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1689 .ips = addresses_B_3_4,
1690 .apply_expected = True
1695 * unique,released vs. sgroup,tombstone
1696 * => should be replaced
1699 .line = __location__,
1700 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1703 .type = WREPL_TYPE_UNIQUE,
1704 .state = WREPL_STATE_RELEASED,
1705 .node = WREPL_NODE_B,
1707 .num_ips = ARRAY_SIZE(addresses_B_1),
1708 .ips = addresses_B_1,
1709 .apply_expected = False
1713 .type = WREPL_TYPE_SGROUP,
1714 .state = WREPL_STATE_TOMBSTONE,
1715 .node = WREPL_NODE_B,
1717 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1718 .ips = addresses_A_3_4,
1719 .apply_expected = True
1724 * unique,tombstone vs. sgroup,active
1725 * => should be replaced
1728 .line = __location__,
1729 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1732 .type = WREPL_TYPE_UNIQUE,
1733 .state = WREPL_STATE_TOMBSTONE,
1734 .node = WREPL_NODE_B,
1736 .num_ips = ARRAY_SIZE(addresses_A_1),
1737 .ips = addresses_A_1,
1738 .apply_expected = True
1742 .type = WREPL_TYPE_SGROUP,
1743 .state = WREPL_STATE_ACTIVE,
1744 .node = WREPL_NODE_B,
1746 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1747 .ips = addresses_B_3_4,
1748 .apply_expected = True
1753 * unique,tombstone vs. sgroup,tombstone
1754 * => should be replaced
1757 .line = __location__,
1758 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1761 .type = WREPL_TYPE_UNIQUE,
1762 .state = WREPL_STATE_TOMBSTONE,
1763 .node = WREPL_NODE_B,
1765 .num_ips = ARRAY_SIZE(addresses_B_1),
1766 .ips = addresses_B_1,
1767 .apply_expected = True
1771 .type = WREPL_TYPE_SGROUP,
1772 .state = WREPL_STATE_TOMBSTONE,
1773 .node = WREPL_NODE_B,
1775 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1776 .ips = addresses_A_3_4,
1777 .apply_expected = True
1782 * unique vs multi homed section,
1785 * unique,active vs. mhomed,active
1786 * => should be replaced
1789 .line = __location__,
1790 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1793 .type = WREPL_TYPE_UNIQUE,
1794 .state = WREPL_STATE_ACTIVE,
1795 .node = WREPL_NODE_B,
1797 .num_ips = ARRAY_SIZE(addresses_A_1),
1798 .ips = addresses_A_1,
1799 .apply_expected = True
1803 .type = WREPL_TYPE_MHOMED,
1804 .state = WREPL_STATE_ACTIVE,
1805 .node = WREPL_NODE_B,
1807 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1808 .ips = addresses_B_3_4,
1809 .apply_expected = True
1814 * unique,active vs. mhomed,tombstone
1815 * => should NOT be replaced
1818 .line = __location__,
1819 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1822 .type = WREPL_TYPE_UNIQUE,
1823 .state = WREPL_STATE_ACTIVE,
1824 .node = WREPL_NODE_B,
1826 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1827 .ips = addresses_B_3_4,
1828 .apply_expected = True
1832 .type = WREPL_TYPE_MHOMED,
1833 .state = WREPL_STATE_TOMBSTONE,
1834 .node = WREPL_NODE_B,
1836 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1837 .ips = addresses_B_3_4,
1838 .apply_expected = False
1843 * unique,released vs. mhomed,active
1844 * => should be replaced
1847 .line = __location__,
1848 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1851 .type = WREPL_TYPE_UNIQUE,
1852 .state = WREPL_STATE_RELEASED,
1853 .node = WREPL_NODE_B,
1855 .num_ips = ARRAY_SIZE(addresses_B_1),
1856 .ips = addresses_B_1,
1857 .apply_expected = False
1861 .type = WREPL_TYPE_MHOMED,
1862 .state = WREPL_STATE_ACTIVE,
1863 .node = WREPL_NODE_B,
1865 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1866 .ips = addresses_A_3_4,
1867 .apply_expected = True
1872 * unique,released vs. mhomed,tombstone
1873 * => should be replaced
1876 .line = __location__,
1877 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1880 .type = WREPL_TYPE_UNIQUE,
1881 .state = WREPL_STATE_RELEASED,
1882 .node = WREPL_NODE_B,
1884 .num_ips = ARRAY_SIZE(addresses_A_1),
1885 .ips = addresses_A_1,
1886 .apply_expected = False
1890 .type = WREPL_TYPE_MHOMED,
1891 .state = WREPL_STATE_TOMBSTONE,
1892 .node = WREPL_NODE_B,
1894 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1895 .ips = addresses_B_3_4,
1896 .apply_expected = True
1901 * unique,tombstone vs. mhomed,active
1902 * => should be replaced
1905 .line = __location__,
1906 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1909 .type = WREPL_TYPE_UNIQUE,
1910 .state = WREPL_STATE_TOMBSTONE,
1911 .node = WREPL_NODE_B,
1913 .num_ips = ARRAY_SIZE(addresses_B_1),
1914 .ips = addresses_B_1,
1915 .apply_expected = True
1919 .type = WREPL_TYPE_MHOMED,
1920 .state = WREPL_STATE_ACTIVE,
1921 .node = WREPL_NODE_B,
1923 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1924 .ips = addresses_A_3_4,
1925 .apply_expected = True
1930 * unique,tombstone vs. mhomed,tombstone
1931 * => should be replaced
1934 .line = __location__,
1935 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1938 .type = WREPL_TYPE_UNIQUE,
1939 .state = WREPL_STATE_TOMBSTONE,
1940 .node = WREPL_NODE_B,
1942 .num_ips = ARRAY_SIZE(addresses_A_1),
1943 .ips = addresses_A_1,
1944 .apply_expected = True
1948 .type = WREPL_TYPE_MHOMED,
1949 .state = WREPL_STATE_TOMBSTONE,
1950 .node = WREPL_NODE_B,
1952 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1953 .ips = addresses_B_3_4,
1954 .apply_expected = True
1959 * normal groups vs unique section,
1962 * group,active vs. unique,active
1963 * => should NOT be replaced
1966 .line = __location__,
1967 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1970 .type = WREPL_TYPE_GROUP,
1971 .state = WREPL_STATE_ACTIVE,
1972 .node = WREPL_NODE_B,
1974 .num_ips = ARRAY_SIZE(addresses_A_1),
1975 .ips = addresses_A_1,
1976 .apply_expected = True
1980 .type = WREPL_TYPE_UNIQUE,
1981 .state = WREPL_STATE_ACTIVE,
1982 .node = WREPL_NODE_B,
1984 .num_ips = ARRAY_SIZE(addresses_A_1),
1985 .ips = addresses_A_1,
1986 .apply_expected = False
1991 * group,active vs. unique,tombstone
1992 * => should NOT be replaced
1995 .line = __location__,
1996 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1999 .type = WREPL_TYPE_GROUP,
2000 .state = WREPL_STATE_ACTIVE,
2001 .node = WREPL_NODE_B,
2003 .num_ips = ARRAY_SIZE(addresses_A_1),
2004 .ips = addresses_A_1,
2005 .apply_expected = True
2009 .type = WREPL_TYPE_UNIQUE,
2010 .state = WREPL_STATE_TOMBSTONE,
2011 .node = WREPL_NODE_B,
2013 .num_ips = ARRAY_SIZE(addresses_A_1),
2014 .ips = addresses_A_1,
2015 .apply_expected = False
2020 * group,released vs. unique,active
2021 * => should NOT be replaced
2024 .line = __location__,
2025 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2028 .type = WREPL_TYPE_GROUP,
2029 .state = WREPL_STATE_RELEASED,
2030 .node = WREPL_NODE_B,
2032 .num_ips = ARRAY_SIZE(addresses_A_1),
2033 .ips = addresses_A_1,
2034 .apply_expected = False
2038 .type = WREPL_TYPE_UNIQUE,
2039 .state = WREPL_STATE_ACTIVE,
2040 .node = WREPL_NODE_B,
2042 .num_ips = ARRAY_SIZE(addresses_A_1),
2043 .ips = addresses_A_1,
2044 .apply_expected = False
2049 * group,released vs. unique,tombstone
2050 * => should NOT be replaced
2053 .line = __location__,
2054 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2057 .type = WREPL_TYPE_GROUP,
2058 .state = WREPL_STATE_RELEASED,
2059 .node = WREPL_NODE_B,
2061 .num_ips = ARRAY_SIZE(addresses_A_1),
2062 .ips = addresses_A_1,
2063 .apply_expected = False
2067 .type = WREPL_TYPE_UNIQUE,
2068 .state = WREPL_STATE_TOMBSTONE,
2069 .node = WREPL_NODE_B,
2071 .num_ips = ARRAY_SIZE(addresses_A_1),
2072 .ips = addresses_A_1,
2073 .apply_expected = False
2078 * group,tombstone vs. unique,active
2079 * => should NOT be replaced
2082 .line = __location__,
2083 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2086 .type = WREPL_TYPE_GROUP,
2087 .state = WREPL_STATE_TOMBSTONE,
2088 .node = WREPL_NODE_B,
2090 .num_ips = ARRAY_SIZE(addresses_A_1),
2091 .ips = addresses_A_1,
2092 .apply_expected = True
2096 .type = WREPL_TYPE_UNIQUE,
2097 .state = WREPL_STATE_ACTIVE,
2098 .node = WREPL_NODE_B,
2100 .num_ips = ARRAY_SIZE(addresses_A_1),
2101 .ips = addresses_A_1,
2102 .apply_expected = False
2107 * group,tombstone vs. unique,tombstone
2108 * => should NOT be replaced
2111 .line = __location__,
2112 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2115 .type = WREPL_TYPE_GROUP,
2116 .state = WREPL_STATE_TOMBSTONE,
2117 .node = WREPL_NODE_B,
2119 .num_ips = ARRAY_SIZE(addresses_A_1),
2120 .ips = addresses_A_1,
2121 .apply_expected = True
2125 .type = WREPL_TYPE_UNIQUE,
2126 .state = WREPL_STATE_TOMBSTONE,
2127 .node = WREPL_NODE_B,
2129 .num_ips = ARRAY_SIZE(addresses_A_1),
2130 .ips = addresses_A_1,
2131 .apply_expected = False
2136 * normal groups vs normal groups section,
2139 * group,active vs. group,active
2140 * => should NOT be replaced
2143 .line = __location__,
2144 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2147 .type = WREPL_TYPE_GROUP,
2148 .state = WREPL_STATE_ACTIVE,
2149 .node = WREPL_NODE_B,
2151 .num_ips = ARRAY_SIZE(addresses_A_1),
2152 .ips = addresses_A_1,
2153 .apply_expected = True
2157 .type = WREPL_TYPE_GROUP,
2158 .state = WREPL_STATE_ACTIVE,
2159 .node = WREPL_NODE_B,
2161 .num_ips = ARRAY_SIZE(addresses_A_1),
2162 .ips = addresses_A_1,
2163 .apply_expected = False
2168 * group,active vs. group,tombstone
2169 * => should NOT be replaced
2172 .line = __location__,
2173 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2176 .type = WREPL_TYPE_GROUP,
2177 .state = WREPL_STATE_ACTIVE,
2178 .node = WREPL_NODE_B,
2180 .num_ips = ARRAY_SIZE(addresses_A_1),
2181 .ips = addresses_A_1,
2182 .apply_expected = True
2186 .type = WREPL_TYPE_GROUP,
2187 .state = WREPL_STATE_TOMBSTONE,
2188 .node = WREPL_NODE_B,
2190 .num_ips = ARRAY_SIZE(addresses_A_1),
2191 .ips = addresses_A_1,
2192 .apply_expected = False
2197 * group,released vs. group,active
2198 * => should be replaced
2201 .line = __location__,
2202 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2205 .type = WREPL_TYPE_GROUP,
2206 .state = WREPL_STATE_RELEASED,
2207 .node = WREPL_NODE_B,
2209 .num_ips = ARRAY_SIZE(addresses_A_1),
2210 .ips = addresses_A_1,
2211 .apply_expected = False
2215 .type = WREPL_TYPE_GROUP,
2216 .state = WREPL_STATE_ACTIVE,
2217 .node = WREPL_NODE_B,
2219 .num_ips = ARRAY_SIZE(addresses_B_1),
2220 .ips = addresses_B_1,
2221 .apply_expected = True
2226 * group,released vs. group,tombstone
2227 * => should be replaced
2230 .line = __location__,
2231 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2234 .type = WREPL_TYPE_GROUP,
2235 .state = WREPL_STATE_RELEASED,
2236 .node = WREPL_NODE_B,
2238 .num_ips = ARRAY_SIZE(addresses_A_1),
2239 .ips = addresses_A_1,
2240 .apply_expected = False
2244 .type = WREPL_TYPE_GROUP,
2245 .state = WREPL_STATE_TOMBSTONE,
2246 .node = WREPL_NODE_B,
2248 .num_ips = ARRAY_SIZE(addresses_B_1),
2249 .ips = addresses_B_1,
2250 .apply_expected = True
2255 * group,tombstone vs. group,active
2256 * => should be replaced
2259 .line = __location__,
2260 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2263 .type = WREPL_TYPE_GROUP,
2264 .state = WREPL_STATE_TOMBSTONE,
2265 .node = WREPL_NODE_B,
2267 .num_ips = ARRAY_SIZE(addresses_B_1),
2268 .ips = addresses_B_1,
2269 .apply_expected = True
2273 .type = WREPL_TYPE_GROUP,
2274 .state = WREPL_STATE_ACTIVE,
2275 .node = WREPL_NODE_B,
2277 .num_ips = ARRAY_SIZE(addresses_A_1),
2278 .ips = addresses_A_1,
2279 .apply_expected = True
2284 * group,tombstone vs. group,tombstone
2285 * => should be replaced
2288 .line = __location__,
2289 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2292 .type = WREPL_TYPE_GROUP,
2293 .state = WREPL_STATE_TOMBSTONE,
2294 .node = WREPL_NODE_B,
2296 .num_ips = ARRAY_SIZE(addresses_A_1),
2297 .ips = addresses_A_1,
2298 .apply_expected = True
2302 .type = WREPL_TYPE_GROUP,
2303 .state = WREPL_STATE_TOMBSTONE,
2304 .node = WREPL_NODE_B,
2306 .num_ips = ARRAY_SIZE(addresses_B_1),
2307 .ips = addresses_B_1,
2308 .apply_expected = True
2313 * normal groups vs special groups section,
2316 * group,active vs. sgroup,active
2317 * => should NOT be replaced
2320 .line = __location__,
2321 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2324 .type = WREPL_TYPE_GROUP,
2325 .state = WREPL_STATE_ACTIVE,
2326 .node = WREPL_NODE_B,
2328 .num_ips = ARRAY_SIZE(addresses_B_1),
2329 .ips = addresses_B_1,
2330 .apply_expected = True
2334 .type = WREPL_TYPE_SGROUP,
2335 .state = WREPL_STATE_ACTIVE,
2336 .node = WREPL_NODE_B,
2338 .num_ips = ARRAY_SIZE(addresses_B_1),
2339 .ips = addresses_B_1,
2340 .apply_expected = False
2345 * group,active vs. sgroup,tombstone
2346 * => should NOT be replaced
2349 .line = __location__,
2350 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2353 .type = WREPL_TYPE_GROUP,
2354 .state = WREPL_STATE_ACTIVE,
2355 .node = WREPL_NODE_B,
2357 .num_ips = ARRAY_SIZE(addresses_B_1),
2358 .ips = addresses_B_1,
2359 .apply_expected = True
2363 .type = WREPL_TYPE_SGROUP,
2364 .state = WREPL_STATE_TOMBSTONE,
2365 .node = WREPL_NODE_B,
2367 .num_ips = ARRAY_SIZE(addresses_B_1),
2368 .ips = addresses_B_1,
2369 .apply_expected = False
2374 * group,released vs. sgroup,active
2375 * => should be replaced
2378 .line = __location__,
2379 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2382 .type = WREPL_TYPE_GROUP,
2383 .state = WREPL_STATE_RELEASED,
2384 .node = WREPL_NODE_B,
2386 .num_ips = ARRAY_SIZE(addresses_A_1),
2387 .ips = addresses_A_1,
2388 .apply_expected = False
2392 .type = WREPL_TYPE_SGROUP,
2393 .state = WREPL_STATE_ACTIVE,
2394 .node = WREPL_NODE_B,
2396 .num_ips = ARRAY_SIZE(addresses_B_1),
2397 .ips = addresses_B_1,
2398 .apply_expected = True
2403 * group,released vs. sgroup,tombstone
2404 * => should NOT be replaced
2407 .line = __location__,
2408 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2411 .type = WREPL_TYPE_GROUP,
2412 .state = WREPL_STATE_RELEASED,
2413 .node = WREPL_NODE_B,
2415 .num_ips = ARRAY_SIZE(addresses_B_1),
2416 .ips = addresses_B_1,
2417 .apply_expected = False
2421 .type = WREPL_TYPE_SGROUP,
2422 .state = WREPL_STATE_TOMBSTONE,
2423 .node = WREPL_NODE_B,
2425 .num_ips = ARRAY_SIZE(addresses_B_1),
2426 .ips = addresses_B_1,
2427 .apply_expected = False
2432 * group,tombstone vs. sgroup,active
2433 * => should be replaced
2436 .line = __location__,
2437 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2440 .type = WREPL_TYPE_GROUP,
2441 .state = WREPL_STATE_TOMBSTONE,
2442 .node = WREPL_NODE_B,
2444 .num_ips = ARRAY_SIZE(addresses_B_1),
2445 .ips = addresses_B_1,
2446 .apply_expected = True
2450 .type = WREPL_TYPE_SGROUP,
2451 .state = WREPL_STATE_ACTIVE,
2452 .node = WREPL_NODE_B,
2454 .num_ips = ARRAY_SIZE(addresses_A_1),
2455 .ips = addresses_A_1,
2456 .apply_expected = True
2461 * group,tombstone vs. sgroup,tombstone
2462 * => should be replaced
2465 .line = __location__,
2466 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2469 .type = WREPL_TYPE_GROUP,
2470 .state = WREPL_STATE_TOMBSTONE,
2471 .node = WREPL_NODE_B,
2473 .num_ips = ARRAY_SIZE(addresses_A_1),
2474 .ips = addresses_A_1,
2475 .apply_expected = True
2479 .type = WREPL_TYPE_SGROUP,
2480 .state = WREPL_STATE_TOMBSTONE,
2481 .node = WREPL_NODE_B,
2483 .num_ips = ARRAY_SIZE(addresses_B_1),
2484 .ips = addresses_B_1,
2485 .apply_expected = True
2490 * normal groups vs multi homed section,
2493 * group,active vs. mhomed,active
2494 * => should NOT be replaced
2497 .line = __location__,
2498 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2501 .type = WREPL_TYPE_GROUP,
2502 .state = WREPL_STATE_ACTIVE,
2503 .node = WREPL_NODE_B,
2505 .num_ips = ARRAY_SIZE(addresses_B_1),
2506 .ips = addresses_B_1,
2507 .apply_expected = True
2511 .type = WREPL_TYPE_MHOMED,
2512 .state = WREPL_STATE_ACTIVE,
2513 .node = WREPL_NODE_B,
2515 .num_ips = ARRAY_SIZE(addresses_B_1),
2516 .ips = addresses_B_1,
2517 .apply_expected = False
2522 * group,active vs. mhomed,tombstone
2523 * => should NOT be replaced
2526 .line = __location__,
2527 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2530 .type = WREPL_TYPE_GROUP,
2531 .state = WREPL_STATE_ACTIVE,
2532 .node = WREPL_NODE_B,
2534 .num_ips = ARRAY_SIZE(addresses_B_1),
2535 .ips = addresses_B_1,
2536 .apply_expected = True
2540 .type = WREPL_TYPE_MHOMED,
2541 .state = WREPL_STATE_TOMBSTONE,
2542 .node = WREPL_NODE_B,
2544 .num_ips = ARRAY_SIZE(addresses_B_1),
2545 .ips = addresses_B_1,
2546 .apply_expected = False
2551 * group,released vs. mhomed,active
2552 * => should NOT be replaced
2555 .line = __location__,
2556 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2559 .type = WREPL_TYPE_GROUP,
2560 .state = WREPL_STATE_RELEASED,
2561 .node = WREPL_NODE_B,
2563 .num_ips = ARRAY_SIZE(addresses_B_1),
2564 .ips = addresses_B_1,
2565 .apply_expected = False
2569 .type = WREPL_TYPE_MHOMED,
2570 .state = WREPL_STATE_ACTIVE,
2571 .node = WREPL_NODE_B,
2573 .num_ips = ARRAY_SIZE(addresses_B_1),
2574 .ips = addresses_B_1,
2575 .apply_expected = False
2580 * group,released vs. mhomed,tombstone
2581 * => should NOT be replaced
2584 .line = __location__,
2585 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2588 .type = WREPL_TYPE_GROUP,
2589 .state = WREPL_STATE_RELEASED,
2590 .node = WREPL_NODE_B,
2592 .num_ips = ARRAY_SIZE(addresses_B_1),
2593 .ips = addresses_B_1,
2594 .apply_expected = False
2598 .type = WREPL_TYPE_MHOMED,
2599 .state = WREPL_STATE_TOMBSTONE,
2600 .node = WREPL_NODE_B,
2602 .num_ips = ARRAY_SIZE(addresses_B_1),
2603 .ips = addresses_B_1,
2604 .apply_expected = False
2609 * group,tombstone vs. mhomed,active
2610 * => should be replaced
2613 .line = __location__,
2614 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2617 .type = WREPL_TYPE_GROUP,
2618 .state = WREPL_STATE_TOMBSTONE,
2619 .node = WREPL_NODE_B,
2621 .num_ips = ARRAY_SIZE(addresses_B_1),
2622 .ips = addresses_B_1,
2623 .apply_expected = True
2627 .type = WREPL_TYPE_MHOMED,
2628 .state = WREPL_STATE_ACTIVE,
2629 .node = WREPL_NODE_B,
2631 .num_ips = ARRAY_SIZE(addresses_A_1),
2632 .ips = addresses_A_1,
2633 .apply_expected = True
2638 * group,tombstone vs. mhomed,tombstone
2639 * => should be replaced
2642 .line = __location__,
2643 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2646 .type = WREPL_TYPE_GROUP,
2647 .state = WREPL_STATE_TOMBSTONE,
2648 .node = WREPL_NODE_B,
2650 .num_ips = ARRAY_SIZE(addresses_A_1),
2651 .ips = addresses_A_1,
2652 .apply_expected = True
2656 .type = WREPL_TYPE_MHOMED,
2657 .state = WREPL_STATE_TOMBSTONE,
2658 .node = WREPL_NODE_B,
2660 .num_ips = ARRAY_SIZE(addresses_B_1),
2661 .ips = addresses_B_1,
2662 .apply_expected = True
2667 * special groups vs unique section,
2670 * sgroup,active vs. unique,active
2671 * => should NOT be replaced
2674 .line = __location__,
2675 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2678 .type = WREPL_TYPE_SGROUP,
2679 .state = WREPL_STATE_ACTIVE,
2680 .node = WREPL_NODE_B,
2682 .num_ips = ARRAY_SIZE(addresses_B_1),
2683 .ips = addresses_B_1,
2684 .apply_expected = True
2688 .type = WREPL_TYPE_UNIQUE,
2689 .state = WREPL_STATE_ACTIVE,
2690 .node = WREPL_NODE_B,
2692 .num_ips = ARRAY_SIZE(addresses_B_1),
2693 .ips = addresses_B_1,
2694 .apply_expected = False
2699 * sgroup,active vs. unique,tombstone
2700 * => should NOT be replaced
2703 .line = __location__,
2704 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2707 .type = WREPL_TYPE_SGROUP,
2708 .state = WREPL_STATE_ACTIVE,
2709 .node = WREPL_NODE_B,
2711 .num_ips = ARRAY_SIZE(addresses_B_1),
2712 .ips = addresses_B_1,
2713 .apply_expected = True
2717 .type = WREPL_TYPE_UNIQUE,
2718 .state = WREPL_STATE_TOMBSTONE,
2719 .node = WREPL_NODE_B,
2721 .num_ips = ARRAY_SIZE(addresses_B_1),
2722 .ips = addresses_B_1,
2723 .apply_expected = False
2728 * sgroup,released vs. unique,active
2729 * => should be replaced
2732 .line = __location__,
2733 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2736 .type = WREPL_TYPE_SGROUP,
2737 .state = WREPL_STATE_RELEASED,
2738 .node = WREPL_NODE_B,
2740 .num_ips = ARRAY_SIZE(addresses_B_1),
2741 .ips = addresses_B_1,
2742 .apply_expected = False
2746 .type = WREPL_TYPE_UNIQUE,
2747 .state = WREPL_STATE_ACTIVE,
2748 .node = WREPL_NODE_B,
2750 .num_ips = ARRAY_SIZE(addresses_A_1),
2751 .ips = addresses_A_1,
2752 .apply_expected = True
2757 * sgroup,released vs. unique,tombstone
2758 * => should be replaced
2761 .line = __location__,
2762 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2765 .type = WREPL_TYPE_SGROUP,
2766 .state = WREPL_STATE_RELEASED,
2767 .node = WREPL_NODE_B,
2769 .num_ips = ARRAY_SIZE(addresses_A_1),
2770 .ips = addresses_A_1,
2771 .apply_expected = False
2775 .type = WREPL_TYPE_UNIQUE,
2776 .state = WREPL_STATE_TOMBSTONE,
2777 .node = WREPL_NODE_B,
2779 .num_ips = ARRAY_SIZE(addresses_B_1),
2780 .ips = addresses_B_1,
2781 .apply_expected = True
2786 * sgroup,tombstone vs. unique,active
2787 * => should be replaced
2790 .line = __location__,
2791 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2794 .type = WREPL_TYPE_SGROUP,
2795 .state = WREPL_STATE_TOMBSTONE,
2796 .node = WREPL_NODE_B,
2798 .num_ips = ARRAY_SIZE(addresses_A_1),
2799 .ips = addresses_A_1,
2800 .apply_expected = True
2804 .type = WREPL_TYPE_UNIQUE,
2805 .state = WREPL_STATE_ACTIVE,
2806 .node = WREPL_NODE_B,
2808 .num_ips = ARRAY_SIZE(addresses_B_1),
2809 .ips = addresses_B_1,
2810 .apply_expected = True
2815 * sgroup,tombstone vs. unique,tombstone
2816 * => should be replaced
2819 .line = __location__,
2820 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2823 .type = WREPL_TYPE_SGROUP,
2824 .state = WREPL_STATE_TOMBSTONE,
2825 .node = WREPL_NODE_B,
2827 .num_ips = ARRAY_SIZE(addresses_B_1),
2828 .ips = addresses_B_1,
2829 .apply_expected = True
2833 .type = WREPL_TYPE_UNIQUE,
2834 .state = WREPL_STATE_TOMBSTONE,
2835 .node = WREPL_NODE_B,
2837 .num_ips = ARRAY_SIZE(addresses_A_1),
2838 .ips = addresses_A_1,
2839 .apply_expected = True
2844 * special groups vs normal group section,
2847 * sgroup,active vs. group,active
2848 * => should NOT be replaced
2851 .line = __location__,
2852 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2855 .type = WREPL_TYPE_SGROUP,
2856 .state = WREPL_STATE_ACTIVE,
2857 .node = WREPL_NODE_B,
2859 .num_ips = ARRAY_SIZE(addresses_A_1),
2860 .ips = addresses_A_1,
2861 .apply_expected = True
2865 .type = WREPL_TYPE_GROUP,
2866 .state = WREPL_STATE_ACTIVE,
2867 .node = WREPL_NODE_B,
2869 .num_ips = ARRAY_SIZE(addresses_A_1),
2870 .ips = addresses_A_1,
2871 .apply_expected = False
2876 * sgroup,active vs. group,tombstone
2877 * => should NOT be replaced
2880 .line = __location__,
2881 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2884 .type = WREPL_TYPE_SGROUP,
2885 .state = WREPL_STATE_ACTIVE,
2886 .node = WREPL_NODE_B,
2888 .num_ips = ARRAY_SIZE(addresses_A_1),
2889 .ips = addresses_A_1,
2890 .apply_expected = True
2894 .type = WREPL_TYPE_GROUP,
2895 .state = WREPL_STATE_TOMBSTONE,
2896 .node = WREPL_NODE_B,
2898 .num_ips = ARRAY_SIZE(addresses_A_1),
2899 .ips = addresses_A_1,
2900 .apply_expected = False
2905 * sgroup,released vs. group,active
2906 * => should be replaced
2909 .line = __location__,
2910 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2913 .type = WREPL_TYPE_SGROUP,
2914 .state = WREPL_STATE_RELEASED,
2915 .node = WREPL_NODE_B,
2917 .num_ips = ARRAY_SIZE(addresses_A_1),
2918 .ips = addresses_A_1,
2919 .apply_expected = False
2923 .type = WREPL_TYPE_GROUP,
2924 .state = WREPL_STATE_ACTIVE,
2925 .node = WREPL_NODE_B,
2927 .num_ips = ARRAY_SIZE(addresses_B_1),
2928 .ips = addresses_B_1,
2929 .apply_expected = True
2934 * sgroup,released vs. group,tombstone
2935 * => should be replaced
2938 .line = __location__,
2939 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2942 .type = WREPL_TYPE_SGROUP,
2943 .state = WREPL_STATE_RELEASED,
2944 .node = WREPL_NODE_B,
2946 .num_ips = ARRAY_SIZE(addresses_B_1),
2947 .ips = addresses_B_1,
2948 .apply_expected = False
2952 .type = WREPL_TYPE_GROUP,
2953 .state = WREPL_STATE_TOMBSTONE,
2954 .node = WREPL_NODE_B,
2956 .num_ips = ARRAY_SIZE(addresses_A_1),
2957 .ips = addresses_A_1,
2958 .apply_expected = True
2963 * sgroup,tombstone vs. group,active
2964 * => should NOT be replaced
2967 .line = __location__,
2968 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2971 .type = WREPL_TYPE_SGROUP,
2972 .state = WREPL_STATE_TOMBSTONE,
2973 .node = WREPL_NODE_B,
2975 .num_ips = ARRAY_SIZE(addresses_A_1),
2976 .ips = addresses_A_1,
2977 .apply_expected = True
2981 .type = WREPL_TYPE_GROUP,
2982 .state = WREPL_STATE_ACTIVE,
2983 .node = WREPL_NODE_B,
2985 .num_ips = ARRAY_SIZE(addresses_B_1),
2986 .ips = addresses_B_1,
2987 .apply_expected = True
2992 * sgroup,tombstone vs. group,tombstone
2993 * => should NOT be replaced
2996 .line = __location__,
2997 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3000 .type = WREPL_TYPE_SGROUP,
3001 .state = WREPL_STATE_TOMBSTONE,
3002 .node = WREPL_NODE_B,
3004 .num_ips = ARRAY_SIZE(addresses_B_1),
3005 .ips = addresses_B_1,
3006 .apply_expected = True
3010 .type = WREPL_TYPE_GROUP,
3011 .state = WREPL_STATE_TOMBSTONE,
3012 .node = WREPL_NODE_B,
3014 .num_ips = ARRAY_SIZE(addresses_A_1),
3015 .ips = addresses_A_1,
3016 .apply_expected = True
3021 * special groups (not active) vs special group section,
3024 * sgroup,released vs. sgroup,active
3025 * => should be replaced
3028 .line = __location__,
3029 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3032 .type = WREPL_TYPE_SGROUP,
3033 .state = WREPL_STATE_RELEASED,
3034 .node = WREPL_NODE_B,
3036 .num_ips = ARRAY_SIZE(addresses_A_1),
3037 .ips = addresses_A_1,
3038 .apply_expected = False
3042 .type = WREPL_TYPE_SGROUP,
3043 .state = WREPL_STATE_ACTIVE,
3044 .node = WREPL_NODE_B,
3046 .num_ips = ARRAY_SIZE(addresses_B_1),
3047 .ips = addresses_B_1,
3048 .apply_expected = True
3053 * sgroup,released vs. sgroup,tombstone
3054 * => should be replaced
3057 .line = __location__,
3058 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3061 .type = WREPL_TYPE_SGROUP,
3062 .state = WREPL_STATE_RELEASED,
3063 .node = WREPL_NODE_B,
3065 .num_ips = ARRAY_SIZE(addresses_B_1),
3066 .ips = addresses_B_1,
3067 .apply_expected = False
3071 .type = WREPL_TYPE_SGROUP,
3072 .state = WREPL_STATE_TOMBSTONE,
3073 .node = WREPL_NODE_B,
3075 .num_ips = ARRAY_SIZE(addresses_A_1),
3076 .ips = addresses_A_1,
3077 .apply_expected = True
3082 * sgroup,tombstone vs. sgroup,active
3083 * => should NOT be replaced
3086 .line = __location__,
3087 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3090 .type = WREPL_TYPE_SGROUP,
3091 .state = WREPL_STATE_TOMBSTONE,
3092 .node = WREPL_NODE_B,
3094 .num_ips = ARRAY_SIZE(addresses_A_1),
3095 .ips = addresses_A_1,
3096 .apply_expected = True
3100 .type = WREPL_TYPE_SGROUP,
3101 .state = WREPL_STATE_ACTIVE,
3102 .node = WREPL_NODE_B,
3104 .num_ips = ARRAY_SIZE(addresses_B_1),
3105 .ips = addresses_B_1,
3106 .apply_expected = True
3111 * sgroup,tombstone vs. sgroup,tombstone
3112 * => should NOT be replaced
3115 .line = __location__,
3116 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3119 .type = WREPL_TYPE_SGROUP,
3120 .state = WREPL_STATE_TOMBSTONE,
3121 .node = WREPL_NODE_B,
3123 .num_ips = ARRAY_SIZE(addresses_B_1),
3124 .ips = addresses_B_1,
3125 .apply_expected = True
3129 .type = WREPL_TYPE_SGROUP,
3130 .state = WREPL_STATE_TOMBSTONE,
3131 .node = WREPL_NODE_B,
3133 .num_ips = ARRAY_SIZE(addresses_A_1),
3134 .ips = addresses_A_1,
3135 .apply_expected = True
3140 * special groups vs multi homed section,
3143 * sgroup,active vs. mhomed,active
3144 * => should NOT be replaced
3147 .line = __location__,
3148 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3151 .type = WREPL_TYPE_SGROUP,
3152 .state = WREPL_STATE_ACTIVE,
3153 .node = WREPL_NODE_B,
3155 .num_ips = ARRAY_SIZE(addresses_A_1),
3156 .ips = addresses_A_1,
3157 .apply_expected = True
3161 .type = WREPL_TYPE_MHOMED,
3162 .state = WREPL_STATE_ACTIVE,
3163 .node = WREPL_NODE_B,
3165 .num_ips = ARRAY_SIZE(addresses_A_1),
3166 .ips = addresses_A_1,
3167 .apply_expected = False
3172 * sgroup,active vs. mhomed,tombstone
3173 * => should NOT be replaced
3176 .line = __location__,
3177 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3180 .type = WREPL_TYPE_SGROUP,
3181 .state = WREPL_STATE_ACTIVE,
3182 .node = WREPL_NODE_B,
3184 .num_ips = ARRAY_SIZE(addresses_A_1),
3185 .ips = addresses_A_1,
3186 .apply_expected = True
3190 .type = WREPL_TYPE_MHOMED,
3191 .state = WREPL_STATE_TOMBSTONE,
3192 .node = WREPL_NODE_B,
3194 .num_ips = ARRAY_SIZE(addresses_A_1),
3195 .ips = addresses_A_1,
3196 .apply_expected = False
3201 * sgroup,released vs. mhomed,active
3202 * => should be replaced
3205 .line = __location__,
3206 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3209 .type = WREPL_TYPE_SGROUP,
3210 .state = WREPL_STATE_RELEASED,
3211 .node = WREPL_NODE_B,
3213 .num_ips = ARRAY_SIZE(addresses_A_1),
3214 .ips = addresses_A_1,
3215 .apply_expected = False
3219 .type = WREPL_TYPE_MHOMED,
3220 .state = WREPL_STATE_ACTIVE,
3221 .node = WREPL_NODE_B,
3223 .num_ips = ARRAY_SIZE(addresses_B_1),
3224 .ips = addresses_B_1,
3225 .apply_expected = True
3230 * sgroup,released vs. mhomed,tombstone
3231 * => should be replaced
3234 .line = __location__,
3235 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3238 .type = WREPL_TYPE_SGROUP,
3239 .state = WREPL_STATE_RELEASED,
3240 .node = WREPL_NODE_B,
3242 .num_ips = ARRAY_SIZE(addresses_B_1),
3243 .ips = addresses_B_1,
3244 .apply_expected = False
3248 .type = WREPL_TYPE_MHOMED,
3249 .state = WREPL_STATE_TOMBSTONE,
3250 .node = WREPL_NODE_B,
3252 .num_ips = ARRAY_SIZE(addresses_A_1),
3253 .ips = addresses_A_1,
3254 .apply_expected = True
3259 * sgroup,tombstone vs. mhomed,active
3260 * => should be replaced
3263 .line = __location__,
3264 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3267 .type = WREPL_TYPE_SGROUP,
3268 .state = WREPL_STATE_TOMBSTONE,
3269 .node = WREPL_NODE_B,
3271 .num_ips = ARRAY_SIZE(addresses_A_1),
3272 .ips = addresses_A_1,
3273 .apply_expected = True
3277 .type = WREPL_TYPE_MHOMED,
3278 .state = WREPL_STATE_ACTIVE,
3279 .node = WREPL_NODE_B,
3281 .num_ips = ARRAY_SIZE(addresses_B_1),
3282 .ips = addresses_B_1,
3283 .apply_expected = True
3288 * sgroup,tombstone vs. mhomed,tombstone
3289 * => should be replaced
3292 .line = __location__,
3293 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3296 .type = WREPL_TYPE_SGROUP,
3297 .state = WREPL_STATE_TOMBSTONE,
3298 .node = WREPL_NODE_B,
3300 .num_ips = ARRAY_SIZE(addresses_B_1),
3301 .ips = addresses_B_1,
3302 .apply_expected = True
3306 .type = WREPL_TYPE_MHOMED,
3307 .state = WREPL_STATE_TOMBSTONE,
3308 .node = WREPL_NODE_B,
3310 .num_ips = ARRAY_SIZE(addresses_A_1),
3311 .ips = addresses_A_1,
3312 .apply_expected = True
3317 * multi homed vs. unique section,
3320 * mhomed,active vs. unique,active
3321 * => should be replaced
3324 .line = __location__,
3325 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3328 .type = WREPL_TYPE_MHOMED,
3329 .state = WREPL_STATE_ACTIVE,
3330 .node = WREPL_NODE_B,
3332 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3333 .ips = addresses_A_3_4,
3334 .apply_expected = True
3338 .type = WREPL_TYPE_UNIQUE,
3339 .state = WREPL_STATE_ACTIVE,
3340 .node = WREPL_NODE_B,
3342 .num_ips = ARRAY_SIZE(addresses_B_1),
3343 .ips = addresses_B_1,
3344 .apply_expected = True
3349 * mhomed,active vs. unique,tombstone
3350 * => should NOT be replaced
3353 .line = __location__,
3354 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3357 .type = WREPL_TYPE_MHOMED,
3358 .state = WREPL_STATE_ACTIVE,
3359 .node = WREPL_NODE_B,
3361 .num_ips = ARRAY_SIZE(addresses_B_1),
3362 .ips = addresses_B_1,
3363 .apply_expected = True
3367 .type = WREPL_TYPE_UNIQUE,
3368 .state = WREPL_STATE_TOMBSTONE,
3369 .node = WREPL_NODE_B,
3371 .num_ips = ARRAY_SIZE(addresses_B_1),
3372 .ips = addresses_B_1,
3373 .apply_expected = False
3378 * mhomed,released vs. unique,active
3379 * => should be replaced
3382 .line = __location__,
3383 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3386 .type = WREPL_TYPE_MHOMED,
3387 .state = WREPL_STATE_RELEASED,
3388 .node = WREPL_NODE_B,
3390 .num_ips = ARRAY_SIZE(addresses_A_1),
3391 .ips = addresses_A_1,
3392 .apply_expected = False
3396 .type = WREPL_TYPE_UNIQUE,
3397 .state = WREPL_STATE_ACTIVE,
3398 .node = WREPL_NODE_B,
3400 .num_ips = ARRAY_SIZE(addresses_B_1),
3401 .ips = addresses_B_1,
3402 .apply_expected = True
3407 * mhomed,released vs. uinique,tombstone
3408 * => should be replaced
3411 .line = __location__,
3412 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3415 .type = WREPL_TYPE_MHOMED,
3416 .state = WREPL_STATE_RELEASED,
3417 .node = WREPL_NODE_B,
3419 .num_ips = ARRAY_SIZE(addresses_B_1),
3420 .ips = addresses_B_1,
3421 .apply_expected = False
3425 .type = WREPL_TYPE_UNIQUE,
3426 .state = WREPL_STATE_TOMBSTONE,
3427 .node = WREPL_NODE_B,
3429 .num_ips = ARRAY_SIZE(addresses_A_1),
3430 .ips = addresses_A_1,
3431 .apply_expected = True
3436 * mhomed,tombstone vs. unique,active
3437 * => should be replaced
3440 .line = __location__,
3441 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3444 .type = WREPL_TYPE_MHOMED,
3445 .state = WREPL_STATE_TOMBSTONE,
3446 .node = WREPL_NODE_B,
3448 .num_ips = ARRAY_SIZE(addresses_A_1),
3449 .ips = addresses_A_1,
3450 .apply_expected = True
3454 .type = WREPL_TYPE_UNIQUE,
3455 .state = WREPL_STATE_ACTIVE,
3456 .node = WREPL_NODE_B,
3458 .num_ips = ARRAY_SIZE(addresses_B_1),
3459 .ips = addresses_B_1,
3460 .apply_expected = True
3465 * mhomed,tombstone vs. uinique,tombstone
3466 * => should be replaced
3469 .line = __location__,
3470 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3473 .type = WREPL_TYPE_MHOMED,
3474 .state = WREPL_STATE_TOMBSTONE,
3475 .node = WREPL_NODE_B,
3477 .num_ips = ARRAY_SIZE(addresses_B_1),
3478 .ips = addresses_B_1,
3479 .apply_expected = True
3483 .type = WREPL_TYPE_UNIQUE,
3484 .state = WREPL_STATE_TOMBSTONE,
3485 .node = WREPL_NODE_B,
3487 .num_ips = ARRAY_SIZE(addresses_A_1),
3488 .ips = addresses_A_1,
3489 .apply_expected = True
3494 * multi homed vs. normal group section,
3497 * mhomed,active vs. group,active
3498 * => should be replaced
3501 .line = __location__,
3502 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3505 .type = WREPL_TYPE_MHOMED,
3506 .state = WREPL_STATE_ACTIVE,
3507 .node = WREPL_NODE_B,
3509 .num_ips = ARRAY_SIZE(addresses_A_1),
3510 .ips = addresses_A_1,
3511 .apply_expected = True
3515 .type = WREPL_TYPE_GROUP,
3516 .state = WREPL_STATE_ACTIVE,
3517 .node = WREPL_NODE_B,
3519 .num_ips = ARRAY_SIZE(addresses_B_1),
3520 .ips = addresses_B_1,
3521 .apply_expected = True
3526 * mhomed,active vs. group,tombstone
3527 * => should NOT be replaced
3530 .line = __location__,
3531 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3534 .type = WREPL_TYPE_MHOMED,
3535 .state = WREPL_STATE_ACTIVE,
3536 .node = WREPL_NODE_B,
3538 .num_ips = ARRAY_SIZE(addresses_B_1),
3539 .ips = addresses_B_1,
3540 .apply_expected = True
3544 .type = WREPL_TYPE_GROUP,
3545 .state = WREPL_STATE_TOMBSTONE,
3546 .node = WREPL_NODE_B,
3548 .num_ips = ARRAY_SIZE(addresses_B_1),
3549 .ips = addresses_B_1,
3550 .apply_expected = False
3555 * mhomed,released vs. group,active
3556 * => should be replaced
3559 .line = __location__,
3560 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3563 .type = WREPL_TYPE_MHOMED,
3564 .state = WREPL_STATE_RELEASED,
3565 .node = WREPL_NODE_B,
3567 .num_ips = ARRAY_SIZE(addresses_B_1),
3568 .ips = addresses_B_1,
3569 .apply_expected = False
3573 .type = WREPL_TYPE_GROUP,
3574 .state = WREPL_STATE_ACTIVE,
3575 .node = WREPL_NODE_B,
3577 .num_ips = ARRAY_SIZE(addresses_A_1),
3578 .ips = addresses_A_1,
3579 .apply_expected = True
3584 * mhomed,released vs. group,tombstone
3585 * => should be replaced
3588 .line = __location__,
3589 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3592 .type = WREPL_TYPE_MHOMED,
3593 .state = WREPL_STATE_RELEASED,
3594 .node = WREPL_NODE_B,
3596 .num_ips = ARRAY_SIZE(addresses_A_1),
3597 .ips = addresses_A_1,
3598 .apply_expected = False
3602 .type = WREPL_TYPE_GROUP,
3603 .state = WREPL_STATE_TOMBSTONE,
3604 .node = WREPL_NODE_B,
3606 .num_ips = ARRAY_SIZE(addresses_B_1),
3607 .ips = addresses_B_1,
3608 .apply_expected = True
3613 * mhomed,tombstone vs. group,active
3614 * => should be replaced
3617 .line = __location__,
3618 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3621 .type = WREPL_TYPE_MHOMED,
3622 .state = WREPL_STATE_TOMBSTONE,
3623 .node = WREPL_NODE_B,
3625 .num_ips = ARRAY_SIZE(addresses_B_1),
3626 .ips = addresses_B_1,
3627 .apply_expected = True
3631 .type = WREPL_TYPE_GROUP,
3632 .state = WREPL_STATE_ACTIVE,
3633 .node = WREPL_NODE_B,
3635 .num_ips = ARRAY_SIZE(addresses_A_1),
3636 .ips = addresses_A_1,
3637 .apply_expected = True
3642 * mhomed,tombstone vs. group,tombstone
3643 * => should be replaced
3646 .line = __location__,
3647 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3650 .type = WREPL_TYPE_MHOMED,
3651 .state = WREPL_STATE_TOMBSTONE,
3652 .node = WREPL_NODE_B,
3654 .num_ips = ARRAY_SIZE(addresses_A_1),
3655 .ips = addresses_A_1,
3656 .apply_expected = True
3660 .type = WREPL_TYPE_GROUP,
3661 .state = WREPL_STATE_TOMBSTONE,
3662 .node = WREPL_NODE_B,
3664 .num_ips = ARRAY_SIZE(addresses_B_1),
3665 .ips = addresses_B_1,
3666 .apply_expected = True
3671 * multi homed vs. special group section,
3674 * mhomed,active vs. sgroup,active
3675 * => should NOT be replaced
3678 .line = __location__,
3679 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3682 .type = WREPL_TYPE_MHOMED,
3683 .state = WREPL_STATE_ACTIVE,
3684 .node = WREPL_NODE_B,
3686 .num_ips = ARRAY_SIZE(addresses_A_1),
3687 .ips = addresses_A_1,
3688 .apply_expected = True
3692 .type = WREPL_TYPE_SGROUP,
3693 .state = WREPL_STATE_ACTIVE,
3694 .node = WREPL_NODE_B,
3696 .num_ips = ARRAY_SIZE(addresses_A_1),
3697 .ips = addresses_A_1,
3698 .apply_expected = False
3703 * mhomed,active vs. sgroup,tombstone
3704 * => should NOT be replaced
3707 .line = __location__,
3708 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3711 .type = WREPL_TYPE_MHOMED,
3712 .state = WREPL_STATE_ACTIVE,
3713 .node = WREPL_NODE_B,
3715 .num_ips = ARRAY_SIZE(addresses_A_1),
3716 .ips = addresses_A_1,
3717 .apply_expected = True
3721 .type = WREPL_TYPE_SGROUP,
3722 .state = WREPL_STATE_TOMBSTONE,
3723 .node = WREPL_NODE_B,
3725 .num_ips = ARRAY_SIZE(addresses_A_1),
3726 .ips = addresses_A_1,
3727 .apply_expected = False
3732 * mhomed,released vs. sgroup,active
3733 * => should be replaced
3736 .line = __location__,
3737 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3740 .type = WREPL_TYPE_MHOMED,
3741 .state = WREPL_STATE_RELEASED,
3742 .node = WREPL_NODE_B,
3744 .num_ips = ARRAY_SIZE(addresses_A_1),
3745 .ips = addresses_A_1,
3746 .apply_expected = False
3750 .type = WREPL_TYPE_SGROUP,
3751 .state = WREPL_STATE_ACTIVE,
3752 .node = WREPL_NODE_B,
3754 .num_ips = ARRAY_SIZE(addresses_B_1),
3755 .ips = addresses_B_1,
3756 .apply_expected = True
3761 * mhomed,released vs. sgroup,tombstone
3762 * => should be replaced
3765 .line = __location__,
3766 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3769 .type = WREPL_TYPE_MHOMED,
3770 .state = WREPL_STATE_RELEASED,
3771 .node = WREPL_NODE_B,
3773 .num_ips = ARRAY_SIZE(addresses_B_1),
3774 .ips = addresses_B_1,
3775 .apply_expected = False
3779 .type = WREPL_TYPE_SGROUP,
3780 .state = WREPL_STATE_TOMBSTONE,
3781 .node = WREPL_NODE_B,
3783 .num_ips = ARRAY_SIZE(addresses_A_1),
3784 .ips = addresses_A_1,
3785 .apply_expected = True
3790 * mhomed,tombstone vs. sgroup,active
3791 * => should be replaced
3794 .line = __location__,
3795 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3798 .type = WREPL_TYPE_MHOMED,
3799 .state = WREPL_STATE_TOMBSTONE,
3800 .node = WREPL_NODE_B,
3802 .num_ips = ARRAY_SIZE(addresses_A_1),
3803 .ips = addresses_A_1,
3804 .apply_expected = True
3808 .type = WREPL_TYPE_SGROUP,
3809 .state = WREPL_STATE_ACTIVE,
3810 .node = WREPL_NODE_B,
3812 .num_ips = ARRAY_SIZE(addresses_B_1),
3813 .ips = addresses_B_1,
3814 .apply_expected = True
3819 * mhomed,tombstone vs. sgroup,tombstone
3820 * => should be replaced
3823 .line = __location__,
3824 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3827 .type = WREPL_TYPE_MHOMED,
3828 .state = WREPL_STATE_TOMBSTONE,
3829 .node = WREPL_NODE_B,
3831 .num_ips = ARRAY_SIZE(addresses_B_1),
3832 .ips = addresses_B_1,
3833 .apply_expected = True
3837 .type = WREPL_TYPE_SGROUP,
3838 .state = WREPL_STATE_TOMBSTONE,
3839 .node = WREPL_NODE_B,
3841 .num_ips = ARRAY_SIZE(addresses_A_1),
3842 .ips = addresses_A_1,
3843 .apply_expected = True
3848 * multi homed vs. mlti homed section,
3851 * mhomed,active vs. mhomed,active
3852 * => should be replaced
3855 .line = __location__,
3856 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3859 .type = WREPL_TYPE_MHOMED,
3860 .state = WREPL_STATE_ACTIVE,
3861 .node = WREPL_NODE_B,
3863 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3864 .ips = addresses_A_3_4,
3865 .apply_expected = True
3869 .type = WREPL_TYPE_MHOMED,
3870 .state = WREPL_STATE_ACTIVE,
3871 .node = WREPL_NODE_B,
3873 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3874 .ips = addresses_B_3_4,
3875 .apply_expected = True
3880 * mhomed,active vs. mhomed,tombstone
3881 * => should NOT be replaced
3884 .line = __location__,
3885 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3888 .type = WREPL_TYPE_MHOMED,
3889 .state = WREPL_STATE_ACTIVE,
3890 .node = WREPL_NODE_B,
3892 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3893 .ips = addresses_B_3_4,
3894 .apply_expected = True
3898 .type = WREPL_TYPE_MHOMED,
3899 .state = WREPL_STATE_TOMBSTONE,
3900 .node = WREPL_NODE_B,
3902 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3903 .ips = addresses_B_3_4,
3904 .apply_expected = False
3909 * mhomed,released vs. mhomed,active
3910 * => should be replaced
3913 .line = __location__,
3914 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3917 .type = WREPL_TYPE_MHOMED,
3918 .state = WREPL_STATE_RELEASED,
3919 .node = WREPL_NODE_B,
3921 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3922 .ips = addresses_B_3_4,
3923 .apply_expected = False
3927 .type = WREPL_TYPE_MHOMED,
3928 .state = WREPL_STATE_ACTIVE,
3929 .node = WREPL_NODE_B,
3931 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3932 .ips = addresses_A_3_4,
3933 .apply_expected = True
3938 * mhomed,released vs. mhomed,tombstone
3939 * => should be replaced
3942 .line = __location__,
3943 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3946 .type = WREPL_TYPE_MHOMED,
3947 .state = WREPL_STATE_RELEASED,
3948 .node = WREPL_NODE_B,
3950 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3951 .ips = addresses_A_3_4,
3952 .apply_expected = False
3956 .type = WREPL_TYPE_MHOMED,
3957 .state = WREPL_STATE_TOMBSTONE,
3958 .node = WREPL_NODE_B,
3960 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3961 .ips = addresses_B_3_4,
3962 .apply_expected = True
3967 * mhomed,tombstone vs. mhomed,active
3968 * => should be replaced
3971 .line = __location__,
3972 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3975 .type = WREPL_TYPE_MHOMED,
3976 .state = WREPL_STATE_TOMBSTONE,
3977 .node = WREPL_NODE_B,
3979 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3980 .ips = addresses_B_3_4,
3981 .apply_expected = True
3985 .type = WREPL_TYPE_MHOMED,
3986 .state = WREPL_STATE_ACTIVE,
3987 .node = WREPL_NODE_B,
3989 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3990 .ips = addresses_A_3_4,
3991 .apply_expected = True
3996 * mhomed,tombstone vs. mhomed,tombstone
3997 * => should be replaced
4000 .line = __location__,
4001 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4004 .type = WREPL_TYPE_MHOMED,
4005 .state = WREPL_STATE_TOMBSTONE,
4006 .node = WREPL_NODE_B,
4008 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4009 .ips = addresses_A_3_4,
4010 .apply_expected = True
4014 .type = WREPL_TYPE_MHOMED,
4015 .state = WREPL_STATE_TOMBSTONE,
4016 .node = WREPL_NODE_B,
4018 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4019 .ips = addresses_B_3_4,
4020 .apply_expected = True
4024 .line = __location__,
4025 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4029 .type = WREPL_TYPE_UNIQUE,
4030 .state = WREPL_STATE_TOMBSTONE,
4031 .node = WREPL_NODE_B,
4033 .num_ips = ARRAY_SIZE(addresses_B_1),
4034 .ips = addresses_B_1,
4035 .apply_expected = True,
4039 .type = WREPL_TYPE_UNIQUE,
4040 .state = WREPL_STATE_TOMBSTONE,
4041 .node = WREPL_NODE_B,
4043 .num_ips = ARRAY_SIZE(addresses_A_1),
4044 .ips = addresses_A_1,
4045 .apply_expected = True,
4049 * special group vs special group section,
4052 * sgroup,active vs. sgroup,active same addresses
4053 * => should be NOT replaced
4056 .line = __location__,
4057 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4058 .comment= "A:A_3_4 vs. B:A_3_4",
4062 .type = WREPL_TYPE_SGROUP,
4063 .state = WREPL_STATE_ACTIVE,
4064 .node = WREPL_NODE_B,
4066 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4067 .ips = addresses_A_3_4,
4068 .apply_expected = True
4072 .type = WREPL_TYPE_SGROUP,
4073 .state = WREPL_STATE_ACTIVE,
4074 .node = WREPL_NODE_B,
4076 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4077 .ips = addresses_A_3_4,
4078 .apply_expected = False,
4079 .sgroup_cleanup = True
4083 * sgroup,active vs. sgroup,active same addresses
4084 * => should be NOT replaced
4087 .line = __location__,
4088 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4089 .comment= "A:A_3_4 vs. B:NULL",
4093 .type = WREPL_TYPE_SGROUP,
4094 .state = WREPL_STATE_ACTIVE,
4095 .node = WREPL_NODE_B,
4097 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4098 .ips = addresses_A_3_4,
4099 .apply_expected = True
4103 .type = WREPL_TYPE_SGROUP,
4104 .state = WREPL_STATE_ACTIVE,
4105 .node = WREPL_NODE_B,
4109 .apply_expected = False,
4110 .sgroup_cleanup = True
4114 * sgroup,active vs. sgroup,active subset addresses, special case...
4115 * => should NOT be replaced
4118 .line = __location__,
4119 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4120 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4",
4124 .type = WREPL_TYPE_SGROUP,
4125 .state = WREPL_STATE_ACTIVE,
4126 .node = WREPL_NODE_B,
4128 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4129 .ips = addresses_A_3_4_X_3_4,
4130 .apply_expected = True,
4134 .type = WREPL_TYPE_SGROUP,
4135 .state = WREPL_STATE_ACTIVE,
4136 .node = WREPL_NODE_B,
4138 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4139 .ips = addresses_A_3_4,
4140 .apply_expected = False,
4144 .line = __location__,
4145 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4149 .type = WREPL_TYPE_SGROUP,
4150 .state = WREPL_STATE_ACTIVE,
4151 .node = WREPL_NODE_B,
4155 .apply_expected = False,
4159 .type = WREPL_TYPE_SGROUP,
4160 .state = WREPL_STATE_ACTIVE,
4161 .node = WREPL_NODE_B,
4165 .apply_expected = False,
4169 * sgroup,active vs. sgroup,active different addresses, but owner changed
4170 * => should be replaced
4173 .line = __location__,
4174 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4175 .comment= "A:B_3_4 vs. B:A_3_4",
4179 .type = WREPL_TYPE_SGROUP,
4180 .state = WREPL_STATE_ACTIVE,
4181 .node = WREPL_NODE_B,
4183 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4184 .ips = addresses_B_3_4,
4185 .apply_expected = True,
4189 .type = WREPL_TYPE_SGROUP,
4190 .state = WREPL_STATE_ACTIVE,
4191 .node = WREPL_NODE_B,
4193 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4194 .ips = addresses_A_3_4,
4195 .apply_expected = True,
4196 .sgroup_cleanup = True
4200 * sgroup,active vs. sgroup,active different addresses, but owner changed
4201 * => should be replaced
4204 .line = __location__,
4205 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4206 .comment= "A:A_3_4 vs. B:A_3_4_OWNER_B",
4210 .type = WREPL_TYPE_SGROUP,
4211 .state = WREPL_STATE_ACTIVE,
4212 .node = WREPL_NODE_B,
4214 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4215 .ips = addresses_A_3_4,
4216 .apply_expected = True,
4220 .type = WREPL_TYPE_SGROUP,
4221 .state = WREPL_STATE_ACTIVE,
4222 .node = WREPL_NODE_B,
4224 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4225 .ips = addresses_A_3_4_OWNER_B,
4226 .apply_expected = True,
4227 .sgroup_cleanup = True
4231 * sgroup,active vs. sgroup,active different addresses, but owner changed
4232 * => should be replaced
4235 .line = __location__,
4236 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4237 .comment= "A:A_3_4_OWNER_B vs. B:A_3_4",
4241 .type = WREPL_TYPE_SGROUP,
4242 .state = WREPL_STATE_ACTIVE,
4243 .node = WREPL_NODE_B,
4245 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4246 .ips = addresses_A_3_4_OWNER_B,
4247 .apply_expected = True,
4251 .type = WREPL_TYPE_SGROUP,
4252 .state = WREPL_STATE_ACTIVE,
4253 .node = WREPL_NODE_B,
4255 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4256 .ips = addresses_A_3_4,
4257 .apply_expected = True,
4258 .sgroup_cleanup = True
4262 * sgroup,active vs. sgroup,active different addresses
4263 * => should be merged
4266 .line = __location__,
4267 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4268 .comment= "A:A_3_4 vs. B:B_3_4 => C:A_3_4_B_3_4",
4272 .type = WREPL_TYPE_SGROUP,
4273 .state = WREPL_STATE_ACTIVE,
4274 .node = WREPL_NODE_B,
4276 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4277 .ips = addresses_A_3_4,
4278 .apply_expected = True,
4282 .type = WREPL_TYPE_SGROUP,
4283 .state = WREPL_STATE_ACTIVE,
4284 .node = WREPL_NODE_B,
4286 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4287 .ips = addresses_B_3_4,
4288 .sgroup_merge = True,
4289 .sgroup_cleanup = True,
4293 * sgroup,active vs. sgroup,active different addresses, special case...
4294 * => should be merged
4297 .line = __location__,
4298 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4299 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4_X_3_4",
4303 .type = WREPL_TYPE_SGROUP,
4304 .state = WREPL_STATE_ACTIVE,
4305 .node = WREPL_NODE_B,
4307 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4308 .ips = addresses_B_3_4_X_3_4,
4309 .apply_expected = True,
4313 .type = WREPL_TYPE_SGROUP,
4314 .state = WREPL_STATE_ACTIVE,
4315 .node = WREPL_NODE_B,
4317 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4318 .ips = addresses_A_3_4,
4319 .sgroup_merge = True,
4320 .merge_owner = &ctx->b,
4321 .sgroup_cleanup = False
4325 .line = __location__,
4326 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4330 .type = WREPL_TYPE_SGROUP,
4331 .state = WREPL_STATE_ACTIVE,
4332 .node = WREPL_NODE_B,
4334 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4_OWNER_B),
4335 .ips = addresses_A_3_4_X_3_4_OWNER_B,
4336 .apply_expected = True,
4340 .type = WREPL_TYPE_SGROUP,
4341 .state = WREPL_STATE_ACTIVE,
4342 .node = WREPL_NODE_B,
4346 .apply_expected = False,
4350 * sgroup,active vs. sgroup,active different addresses, special case...
4351 * => should be merged
4354 .line = __location__,
4355 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4356 .comment= "A:X_3_4 vs. B:A_3_4 => C:A_3_4_X_3_4",
4360 .type = WREPL_TYPE_SGROUP,
4361 .state = WREPL_STATE_ACTIVE,
4362 .node = WREPL_NODE_B,
4364 .num_ips = ARRAY_SIZE(addresses_X_3_4),
4365 .ips = addresses_X_3_4,
4366 .apply_expected = True,
4370 .type = WREPL_TYPE_SGROUP,
4371 .state = WREPL_STATE_ACTIVE,
4372 .node = WREPL_NODE_B,
4374 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4375 .ips = addresses_A_3_4,
4376 .sgroup_merge = True,
4377 .sgroup_cleanup = False
4381 .line = __location__,
4382 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4386 .type = WREPL_TYPE_SGROUP,
4387 .state = WREPL_STATE_ACTIVE,
4388 .node = WREPL_NODE_B,
4392 .apply_expected = False,
4396 .type = WREPL_TYPE_SGROUP,
4397 .state = WREPL_STATE_ACTIVE,
4398 .node = WREPL_NODE_B,
4402 .apply_expected = False,
4406 * sgroup,active vs. sgroup,active different addresses, special case...
4407 * => should be merged
4410 .line = __location__,
4411 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4412 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4_OWNER_B => B:A_3_4_OWNER_B_X_3_4",
4416 .type = WREPL_TYPE_SGROUP,
4417 .state = WREPL_STATE_ACTIVE,
4418 .node = WREPL_NODE_B,
4420 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4421 .ips = addresses_A_3_4_X_3_4,
4422 .apply_expected = True,
4426 .type = WREPL_TYPE_SGROUP,
4427 .state = WREPL_STATE_ACTIVE,
4428 .node = WREPL_NODE_B,
4430 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4431 .ips = addresses_A_3_4_OWNER_B,
4432 .sgroup_merge = True,
4433 .merge_owner = &ctx->b,
4437 .line = __location__,
4438 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4442 .type = WREPL_TYPE_SGROUP,
4443 .state = WREPL_STATE_ACTIVE,
4444 .node = WREPL_NODE_B,
4448 .apply_expected = False,
4452 .type = WREPL_TYPE_SGROUP,
4453 .state = WREPL_STATE_ACTIVE,
4454 .node = WREPL_NODE_B,
4458 .apply_expected = False,
4462 * sgroup,active vs. sgroup,active partly different addresses, special case...
4463 * => should be merged
4466 .line = __location__,
4467 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4468 .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",
4472 .type = WREPL_TYPE_SGROUP,
4473 .state = WREPL_STATE_ACTIVE,
4474 .node = WREPL_NODE_B,
4476 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4477 .ips = addresses_B_3_4_X_3_4,
4478 .apply_expected = True,
4482 .type = WREPL_TYPE_SGROUP,
4483 .state = WREPL_STATE_ACTIVE,
4484 .node = WREPL_NODE_B,
4486 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_1_2),
4487 .ips = addresses_B_3_4_X_1_2,
4488 .sgroup_merge = True,
4489 .sgroup_cleanup = False
4493 .line = __location__,
4494 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4498 .type = WREPL_TYPE_SGROUP,
4499 .state = WREPL_STATE_ACTIVE,
4500 .node = WREPL_NODE_B,
4504 .apply_expected = False,
4508 .type = WREPL_TYPE_SGROUP,
4509 .state = WREPL_STATE_ACTIVE,
4510 .node = WREPL_NODE_B,
4514 .apply_expected = False,
4518 * sgroup,active vs. sgroup,active different addresses, special case...
4519 * => should be merged
4522 .line = __location__,
4523 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4524 .comment= "A:A_3_4_B_3_4 vs. B:NULL => B:A_3_4",
4528 .type = WREPL_TYPE_SGROUP,
4529 .state = WREPL_STATE_ACTIVE,
4530 .node = WREPL_NODE_B,
4532 .num_ips = ARRAY_SIZE(addresses_A_3_4_B_3_4),
4533 .ips = addresses_A_3_4_B_3_4,
4534 .apply_expected = True,
4538 .type = WREPL_TYPE_SGROUP,
4539 .state = WREPL_STATE_ACTIVE,
4540 .node = WREPL_NODE_B,
4544 .sgroup_merge = True,
4545 .merge_owner = &ctx->b,
4546 .sgroup_cleanup = True
4550 .line = __location__,
4551 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4555 .type = WREPL_TYPE_SGROUP,
4556 .state = WREPL_STATE_ACTIVE,
4557 .node = WREPL_NODE_B,
4561 .apply_expected = False,
4565 .type = WREPL_TYPE_UNIQUE,
4566 .state = WREPL_STATE_TOMBSTONE,
4567 .node = WREPL_NODE_B,
4569 .num_ips = ARRAY_SIZE(addresses_A_1),
4570 .ips = addresses_A_1,
4571 .apply_expected = True,
4575 * sgroup,active vs. sgroup,active different addresses, special case...
4576 * => should be merged
4579 .line = __location__,
4580 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4581 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:X_3_4",
4585 .type = WREPL_TYPE_SGROUP,
4586 .state = WREPL_STATE_ACTIVE,
4587 .node = WREPL_NODE_B,
4589 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4590 .ips = addresses_B_3_4_X_3_4,
4591 .apply_expected = True,
4595 .type = WREPL_TYPE_SGROUP,
4596 .state = WREPL_STATE_ACTIVE,
4597 .node = WREPL_NODE_B,
4601 .sgroup_merge = True,
4602 .merge_owner = &ctx->b,
4603 .sgroup_cleanup = True
4607 .line = __location__,
4608 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4612 .type = WREPL_TYPE_SGROUP,
4613 .state = WREPL_STATE_ACTIVE,
4614 .node = WREPL_NODE_B,
4618 .apply_expected = False,
4622 .type = WREPL_TYPE_UNIQUE,
4623 .state = WREPL_STATE_TOMBSTONE,
4624 .node = WREPL_NODE_B,
4626 .num_ips = ARRAY_SIZE(addresses_A_1),
4627 .ips = addresses_A_1,
4628 .apply_expected = True,
4633 * sgroup,active vs. sgroup,tombstone different no addresses, special
4634 * => should be replaced
4637 .line = __location__,
4638 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4639 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:NULL",
4643 .type = WREPL_TYPE_SGROUP,
4644 .state = WREPL_STATE_ACTIVE,
4645 .node = WREPL_NODE_B,
4647 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4648 .ips = addresses_B_3_4_X_3_4,
4649 .apply_expected = True,
4653 .type = WREPL_TYPE_SGROUP,
4654 .state = WREPL_STATE_TOMBSTONE,
4655 .node = WREPL_NODE_B,
4659 .apply_expected = True,
4663 * sgroup,active vs. sgroup,tombstone different addresses
4664 * => should be replaced
4667 .line = __location__,
4668 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4669 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4",
4673 .type = WREPL_TYPE_SGROUP,
4674 .state = WREPL_STATE_ACTIVE,
4675 .node = WREPL_NODE_B,
4677 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4678 .ips = addresses_B_3_4_X_3_4,
4679 .apply_expected = True,
4683 .type = WREPL_TYPE_SGROUP,
4684 .state = WREPL_STATE_TOMBSTONE,
4685 .node = WREPL_NODE_B,
4687 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4688 .ips = addresses_A_3_4,
4689 .apply_expected = True,
4693 * sgroup,active vs. sgroup,tombstone subset addresses
4694 * => should be replaced
4697 .line = __location__,
4698 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4699 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4 => B:B_3_4",
4703 .type = WREPL_TYPE_SGROUP,
4704 .state = WREPL_STATE_ACTIVE,
4705 .node = WREPL_NODE_B,
4707 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4708 .ips = addresses_B_3_4_X_3_4,
4709 .apply_expected = True,
4713 .type = WREPL_TYPE_SGROUP,
4714 .state = WREPL_STATE_TOMBSTONE,
4715 .node = WREPL_NODE_B,
4717 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4718 .ips = addresses_B_3_4,
4719 .apply_expected = True,
4723 * sgroup,active vs. sgroup,active same addresses
4724 * => should be replaced
4727 .line = __location__,
4728 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4729 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4_X_3_4 => B:B_3_4_X_3_4",
4733 .type = WREPL_TYPE_SGROUP,
4734 .state = WREPL_STATE_ACTIVE,
4735 .node = WREPL_NODE_B,
4737 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4738 .ips = addresses_B_3_4_X_3_4,
4739 .apply_expected = True,
4743 .type = WREPL_TYPE_SGROUP,
4744 .state = WREPL_STATE_TOMBSTONE,
4745 .node = WREPL_NODE_B,
4747 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4748 .ips = addresses_B_3_4_X_3_4,
4749 .apply_expected = True,
4754 * This should be the last record in this array,
4755 * we need to make sure the we leave a tombstoned unique entry
4759 .line = __location__,
4760 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4764 .type = WREPL_TYPE_UNIQUE,
4765 .state = WREPL_STATE_TOMBSTONE,
4766 .node = WREPL_NODE_B,
4768 .num_ips = ARRAY_SIZE(addresses_A_1),
4769 .ips = addresses_A_1,
4770 .apply_expected = True
4774 .type = WREPL_TYPE_UNIQUE,
4775 .state = WREPL_STATE_TOMBSTONE,
4776 .node = WREPL_NODE_B,
4778 .num_ips = ARRAY_SIZE(addresses_A_1),
4779 .ips = addresses_A_1,
4780 .apply_expected = True
4782 }}; /* do not add entries here, this should be the last record! */
4784 wins_name_r1 = &wins_name1;
4785 wins_name_r2 = &wins_name2;
4787 printf("Test Replica Conflicts with different owners\n");
4789 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
4791 if (!records[i].extra && !records[i].cleanup) {
4792 /* we should test the worst cases */
4793 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
4794 printf("(%s) Programmer error, invalid record[%u]: %s\n",
4795 __location__, i, records[i].line);
4797 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
4798 printf("(%s) Programmer error, invalid record[%u]: %s\n",
4799 __location__, i, records[i].line);
4804 if (!records[i].cleanup) {
4805 const char *expected;
4808 if (records[i].r2.sgroup_merge) {
4809 expected = "SGROUP_MERGE";
4810 } else if (records[i].r2.apply_expected) {
4811 expected = "REPLACE";
4813 expected = "NOT REPLACE";
4816 if (!records[i].r1.ips && !records[i].r2.ips) {
4817 ips = "with no ip(s)";
4818 } else if (records[i].r1.ips==records[i].r2.ips) {
4819 ips = "with same ip(s)";
4821 ips = "with different ip(s)";
4824 printf("%s,%s%s vs. %s,%s%s %s => %s\n",
4825 wrepl_name_type_string(records[i].r1.type),
4826 wrepl_name_state_string(records[i].r1.state),
4827 (records[i].r1.is_static?",static":""),
4828 wrepl_name_type_string(records[i].r2.type),
4829 wrepl_name_state_string(records[i].r2.state),
4830 (records[i].r2.is_static?",static":""),
4831 (records[i].comment?records[i].comment:ips),
4838 wins_name_r1->name = &records[i].name;
4839 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
4840 records[i].r1.state,
4842 records[i].r1.is_static);
4843 wins_name_r1->id = ++records[i].r1.owner->max_version;
4844 if (wins_name_r1->flags & 2) {
4845 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
4846 wins_name_r1->addresses.addresses.ips = discard_const(records[i].r1.ips);
4848 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
4850 wins_name_r1->unknown = "255.255.255.255";
4853 ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1);
4854 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4855 wins_name_r1, records[i].r1.apply_expected);
4860 wins_name_r2->name = &records[i].name;
4861 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
4862 records[i].r2.state,
4864 records[i].r2.is_static);
4865 wins_name_r2->id = ++records[i].r2.owner->max_version;
4866 if (wins_name_r2->flags & 2) {
4867 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
4868 wins_name_r2->addresses.addresses.ips = discard_const(records[i].r2.ips);
4870 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
4872 wins_name_r2->unknown = "255.255.255.255";
4875 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4876 if (records[i].r1.state == WREPL_STATE_RELEASED) {
4877 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4878 wins_name_r1, False);
4879 } else if (records[i].r2.sgroup_merge) {
4880 ret &= test_wrepl_sgroup_merged(ctx, records[i].r2.merge_owner,
4881 records[i].r1.owner,
4882 records[i].r1.num_ips, records[i].r1.ips,
4883 records[i].r2.owner,
4884 records[i].r2.num_ips, records[i].r2.ips,
4886 } else if (records[i].r1.owner != records[i].r2.owner) {
4888 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
4889 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4890 wins_name_r1, _expected);
4892 if (records[i].r2.state == WREPL_STATE_RELEASED) {
4893 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
4894 wins_name_r2, False);
4895 } else if (!records[i].r2.sgroup_merge) {
4896 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
4897 wins_name_r2, records[i].r2.apply_expected);
4900 if (records[i].r2.sgroup_cleanup) {
4902 printf("failed before sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4906 /* clean up the SGROUP record */
4907 wins_name_r1->name = &records[i].name;
4908 wins_name_r1->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4910 WREPL_NODE_B, False);
4911 wins_name_r1->id = ++records[i].r1.owner->max_version;
4912 wins_name_r1->addresses.addresses.num_ips = 0;
4913 wins_name_r1->addresses.addresses.ips = NULL;
4914 wins_name_r1->unknown = "255.255.255.255";
4915 ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1);
4917 /* here we test how names from an owner are deleted */
4918 if (records[i].r2.sgroup_merge && records[i].r2.num_ips) {
4919 ret &= test_wrepl_sgroup_merged(ctx, NULL,
4920 records[i].r2.owner,
4921 records[i].r2.num_ips, records[i].r2.ips,
4922 records[i].r1.owner,
4927 /* clean up the SGROUP record */
4928 wins_name_r2->name = &records[i].name;
4929 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4931 WREPL_NODE_B, False);
4932 wins_name_r2->id = ++records[i].r2.owner->max_version;
4933 wins_name_r2->addresses.addresses.num_ips = 0;
4934 wins_name_r2->addresses.addresses.ips = NULL;
4935 wins_name_r2->unknown = "255.255.255.255";
4936 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4938 /* take ownership of the SGROUP record */
4939 wins_name_r2->name = &records[i].name;
4940 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4942 WREPL_NODE_B, False);
4943 wins_name_r2->id = ++records[i].r2.owner->max_version;
4944 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4945 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4946 wins_name_r2->unknown = "255.255.255.255";
4947 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4948 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, True);
4950 /* overwrite the SGROUP record with unique,tombstone */
4951 wins_name_r2->name = &records[i].name;
4952 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4953 WREPL_STATE_TOMBSTONE,
4954 WREPL_NODE_B, False);
4955 wins_name_r2->id = ++records[i].r2.owner->max_version;
4956 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4957 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4958 wins_name_r2->unknown = "255.255.255.255";
4959 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4960 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, True);
4963 printf("failed in sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4968 /* the first one is a cleanup run */
4969 if (!ret && i == 0) ret = True;
4972 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
4980 static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_conn *ctx)
4984 struct wrepl_wins_name wins_name_;
4985 struct wrepl_wins_name *wins_name = &wins_name_;
4986 struct nbt_name_register name_register_;
4987 struct nbt_name_register *name_register = &name_register_;
4988 struct nbt_name_release release_;
4989 struct nbt_name_release *release = &release_;
4992 const char *line; /* just better debugging */
4993 struct nbt_name name;
4998 const struct wrepl_ip *ips;
4999 BOOL apply_expected;
5002 enum wrepl_name_type type;
5003 enum wrepl_name_state state;
5004 enum wrepl_name_node node;
5007 const struct wrepl_ip *ips;
5008 BOOL apply_expected;
5012 * unique vs. unique section
5015 * unique,released vs. unique,active with same ip(s)
5018 .line = __location__,
5019 .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL),
5023 .num_ips = ctx->addresses_best_num,
5024 .ips = ctx->addresses_best,
5025 .apply_expected = True
5028 .type = WREPL_TYPE_UNIQUE,
5029 .state = WREPL_STATE_ACTIVE,
5030 .node = WREPL_NODE_B,
5032 .num_ips = ctx->addresses_best_num,
5033 .ips = ctx->addresses_best,
5034 .apply_expected = True
5038 * unique,released vs. unique,active with different ip(s)
5041 .line = __location__,
5042 .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL),
5046 .num_ips = ctx->addresses_best_num,
5047 .ips = ctx->addresses_best,
5048 .apply_expected = True
5051 .type = WREPL_TYPE_UNIQUE,
5052 .state = WREPL_STATE_ACTIVE,
5053 .node = WREPL_NODE_B,
5055 .num_ips = ARRAY_SIZE(addresses_B_1),
5056 .ips = addresses_B_1,
5057 .apply_expected = True
5061 * unique,released vs. unique,tombstone with same ip(s)
5064 .line = __location__,
5065 .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL),
5069 .num_ips = ctx->addresses_best_num,
5070 .ips = ctx->addresses_best,
5071 .apply_expected = True
5074 .type = WREPL_TYPE_UNIQUE,
5075 .state = WREPL_STATE_TOMBSTONE,
5076 .node = WREPL_NODE_B,
5078 .num_ips = ctx->addresses_best_num,
5079 .ips = ctx->addresses_best,
5080 .apply_expected = True
5084 * unique,released vs. unique,tombstone with different ip(s)
5087 .line = __location__,
5088 .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL),
5092 .num_ips = ctx->addresses_best_num,
5093 .ips = ctx->addresses_best,
5094 .apply_expected = True
5097 .type = WREPL_TYPE_UNIQUE,
5098 .state = WREPL_STATE_TOMBSTONE,
5099 .node = WREPL_NODE_B,
5101 .num_ips = ARRAY_SIZE(addresses_B_1),
5102 .ips = addresses_B_1,
5103 .apply_expected = True
5107 * unique vs. group section
5110 * unique,released vs. group,active with same ip(s)
5113 .line = __location__,
5114 .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL),
5118 .num_ips = ctx->addresses_best_num,
5119 .ips = ctx->addresses_best,
5120 .apply_expected = True
5123 .type = WREPL_TYPE_GROUP,
5124 .state = WREPL_STATE_ACTIVE,
5125 .node = WREPL_NODE_B,
5127 .num_ips = ctx->addresses_best_num,
5128 .ips = ctx->addresses_best,
5129 .apply_expected = True
5133 * unique,released vs. group,active with different ip(s)
5136 .line = __location__,
5137 .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL),
5141 .num_ips = ctx->addresses_best_num,
5142 .ips = ctx->addresses_best,
5143 .apply_expected = True
5146 .type = WREPL_TYPE_GROUP,
5147 .state = WREPL_STATE_ACTIVE,
5148 .node = WREPL_NODE_B,
5150 .num_ips = ARRAY_SIZE(addresses_B_1),
5151 .ips = addresses_B_1,
5152 .apply_expected = True
5156 * unique,released vs. group,tombstone with same ip(s)
5159 .line = __location__,
5160 .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL),
5164 .num_ips = ctx->addresses_best_num,
5165 .ips = ctx->addresses_best,
5166 .apply_expected = True
5169 .type = WREPL_TYPE_GROUP,
5170 .state = WREPL_STATE_TOMBSTONE,
5171 .node = WREPL_NODE_B,
5173 .num_ips = ctx->addresses_best_num,
5174 .ips = ctx->addresses_best,
5175 .apply_expected = True
5179 * unique,released vs. group,tombstone with different ip(s)
5182 .line = __location__,
5183 .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL),
5187 .num_ips = ctx->addresses_best_num,
5188 .ips = ctx->addresses_best,
5189 .apply_expected = True
5192 .type = WREPL_TYPE_GROUP,
5193 .state = WREPL_STATE_TOMBSTONE,
5194 .node = WREPL_NODE_B,
5196 .num_ips = ARRAY_SIZE(addresses_B_1),
5197 .ips = addresses_B_1,
5198 .apply_expected = True
5202 * unique vs. special group section
5205 * unique,released vs. sgroup,active with same ip(s)
5208 .line = __location__,
5209 .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL),
5213 .num_ips = ctx->addresses_best_num,
5214 .ips = ctx->addresses_best,
5215 .apply_expected = True
5218 .type = WREPL_TYPE_SGROUP,
5219 .state = WREPL_STATE_ACTIVE,
5220 .node = WREPL_NODE_B,
5222 .num_ips = ctx->addresses_best_num,
5223 .ips = ctx->addresses_best,
5224 .apply_expected = True
5228 * unique,released vs. sgroup,active with different ip(s)
5231 .line = __location__,
5232 .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL),
5236 .num_ips = ctx->addresses_best_num,
5237 .ips = ctx->addresses_best,
5238 .apply_expected = True
5241 .type = WREPL_TYPE_SGROUP,
5242 .state = WREPL_STATE_ACTIVE,
5243 .node = WREPL_NODE_B,
5245 .num_ips = ARRAY_SIZE(addresses_B_1),
5246 .ips = addresses_B_1,
5247 .apply_expected = True
5251 * unique,released vs. sgroup,tombstone with same ip(s)
5254 .line = __location__,
5255 .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL),
5259 .num_ips = ctx->addresses_best_num,
5260 .ips = ctx->addresses_best,
5261 .apply_expected = True
5264 .type = WREPL_TYPE_SGROUP,
5265 .state = WREPL_STATE_TOMBSTONE,
5266 .node = WREPL_NODE_B,
5268 .num_ips = ctx->addresses_best_num,
5269 .ips = ctx->addresses_best,
5270 .apply_expected = True
5274 * unique,released vs. sgroup,tombstone with different ip(s)
5277 .line = __location__,
5278 .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL),
5282 .num_ips = ctx->addresses_best_num,
5283 .ips = ctx->addresses_best,
5284 .apply_expected = True
5287 .type = WREPL_TYPE_SGROUP,
5288 .state = WREPL_STATE_TOMBSTONE,
5289 .node = WREPL_NODE_B,
5291 .num_ips = ARRAY_SIZE(addresses_B_1),
5292 .ips = addresses_B_1,
5293 .apply_expected = True
5297 * unique vs. multi homed section
5300 * unique,released vs. mhomed,active with same ip(s)
5303 .line = __location__,
5304 .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL),
5308 .num_ips = ctx->addresses_best_num,
5309 .ips = ctx->addresses_best,
5310 .apply_expected = True
5313 .type = WREPL_TYPE_MHOMED,
5314 .state = WREPL_STATE_ACTIVE,
5315 .node = WREPL_NODE_B,
5317 .num_ips = ctx->addresses_best_num,
5318 .ips = ctx->addresses_best,
5319 .apply_expected = True
5323 * unique,released vs. mhomed,active with different ip(s)
5326 .line = __location__,
5327 .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL),
5331 .num_ips = ctx->addresses_best_num,
5332 .ips = ctx->addresses_best,
5333 .apply_expected = True
5336 .type = WREPL_TYPE_MHOMED,
5337 .state = WREPL_STATE_ACTIVE,
5338 .node = WREPL_NODE_B,
5340 .num_ips = ARRAY_SIZE(addresses_B_1),
5341 .ips = addresses_B_1,
5342 .apply_expected = True
5346 * unique,released vs. mhomed,tombstone with same ip(s)
5349 .line = __location__,
5350 .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL),
5354 .num_ips = ctx->addresses_best_num,
5355 .ips = ctx->addresses_best,
5356 .apply_expected = True
5359 .type = WREPL_TYPE_MHOMED,
5360 .state = WREPL_STATE_TOMBSTONE,
5361 .node = WREPL_NODE_B,
5363 .num_ips = ctx->addresses_best_num,
5364 .ips = ctx->addresses_best,
5365 .apply_expected = True
5369 * unique,released vs. mhomed,tombstone with different ip(s)
5372 .line = __location__,
5373 .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL),
5377 .num_ips = ctx->addresses_best_num,
5378 .ips = ctx->addresses_best,
5379 .apply_expected = True
5382 .type = WREPL_TYPE_MHOMED,
5383 .state = WREPL_STATE_TOMBSTONE,
5384 .node = WREPL_NODE_B,
5386 .num_ips = ARRAY_SIZE(addresses_B_1),
5387 .ips = addresses_B_1,
5388 .apply_expected = True
5392 * group vs. unique section
5395 * group,released vs. unique,active with same ip(s)
5398 .line = __location__,
5399 .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL),
5401 .nb_flags = NBT_NM_GROUP,
5403 .num_ips = ctx->addresses_best_num,
5404 .ips = ctx->addresses_best,
5405 .apply_expected = True
5408 .type = WREPL_TYPE_UNIQUE,
5409 .state = WREPL_STATE_ACTIVE,
5410 .node = WREPL_NODE_B,
5412 .num_ips = ctx->addresses_best_num,
5413 .ips = ctx->addresses_best,
5414 .apply_expected = False
5418 * group,released vs. unique,active with different ip(s)
5421 .line = __location__,
5422 .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL),
5424 .nb_flags = NBT_NM_GROUP,
5426 .num_ips = ctx->addresses_best_num,
5427 .ips = ctx->addresses_best,
5428 .apply_expected = True
5431 .type = WREPL_TYPE_UNIQUE,
5432 .state = WREPL_STATE_ACTIVE,
5433 .node = WREPL_NODE_B,
5435 .num_ips = ARRAY_SIZE(addresses_B_1),
5436 .ips = addresses_B_1,
5437 .apply_expected = False
5441 * group,released vs. unique,tombstone with same ip(s)
5444 .line = __location__,
5445 .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL),
5447 .nb_flags = NBT_NM_GROUP,
5449 .num_ips = ctx->addresses_best_num,
5450 .ips = ctx->addresses_best,
5451 .apply_expected = True
5454 .type = WREPL_TYPE_UNIQUE,
5455 .state = WREPL_STATE_TOMBSTONE,
5456 .node = WREPL_NODE_B,
5458 .num_ips = ctx->addresses_best_num,
5459 .ips = ctx->addresses_best,
5460 .apply_expected = False
5464 * group,released vs. unique,tombstone with different ip(s)
5467 .line = __location__,
5468 .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL),
5470 .nb_flags = NBT_NM_GROUP,
5472 .num_ips = ctx->addresses_best_num,
5473 .ips = ctx->addresses_best,
5474 .apply_expected = True
5477 .type = WREPL_TYPE_UNIQUE,
5478 .state = WREPL_STATE_TOMBSTONE,
5479 .node = WREPL_NODE_B,
5481 .num_ips = ARRAY_SIZE(addresses_B_1),
5482 .ips = addresses_B_1,
5483 .apply_expected = False
5487 * group vs. group section
5490 * group,released vs. group,active with same ip(s)
5493 .line = __location__,
5494 .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL),
5496 .nb_flags = NBT_NM_GROUP,
5498 .num_ips = ctx->addresses_best_num,
5499 .ips = ctx->addresses_best,
5500 .apply_expected = True
5503 .type = WREPL_TYPE_GROUP,
5504 .state = WREPL_STATE_ACTIVE,
5505 .node = WREPL_NODE_B,
5507 .num_ips = ctx->addresses_best_num,
5508 .ips = ctx->addresses_best,
5509 .apply_expected = True
5513 * group,released vs. group,active with different ip(s)
5516 .line = __location__,
5517 .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL),
5519 .nb_flags = NBT_NM_GROUP,
5521 .num_ips = ctx->addresses_best_num,
5522 .ips = ctx->addresses_best,
5523 .apply_expected = True
5526 .type = WREPL_TYPE_GROUP,
5527 .state = WREPL_STATE_ACTIVE,
5528 .node = WREPL_NODE_B,
5530 .num_ips = ARRAY_SIZE(addresses_B_1),
5531 .ips = addresses_B_1,
5532 .apply_expected = True
5536 * group,released vs. group,tombstone with same ip(s)
5539 .line = __location__,
5540 .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL),
5542 .nb_flags = NBT_NM_GROUP,
5544 .num_ips = ctx->addresses_best_num,
5545 .ips = ctx->addresses_best,
5546 .apply_expected = True
5549 .type = WREPL_TYPE_GROUP,
5550 .state = WREPL_STATE_TOMBSTONE,
5551 .node = WREPL_NODE_B,
5553 .num_ips = ctx->addresses_best_num,
5554 .ips = ctx->addresses_best,
5555 .apply_expected = True
5559 * group,released vs. group,tombstone with different ip(s)
5562 .line = __location__,
5563 .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL),
5565 .nb_flags = NBT_NM_GROUP,
5567 .num_ips = ctx->addresses_best_num,
5568 .ips = ctx->addresses_best,
5569 .apply_expected = True
5572 .type = WREPL_TYPE_GROUP,
5573 .state = WREPL_STATE_TOMBSTONE,
5574 .node = WREPL_NODE_B,
5576 .num_ips = ARRAY_SIZE(addresses_B_1),
5577 .ips = addresses_B_1,
5578 .apply_expected = True
5582 * group vs. special group section
5585 * group,released vs. sgroup,active with same ip(s)
5588 .line = __location__,
5589 .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL),
5591 .nb_flags = NBT_NM_GROUP,
5593 .num_ips = ctx->addresses_best_num,
5594 .ips = ctx->addresses_best,
5595 .apply_expected = True
5598 .type = WREPL_TYPE_SGROUP,
5599 .state = WREPL_STATE_ACTIVE,
5600 .node = WREPL_NODE_B,
5602 .num_ips = ctx->addresses_best_num,
5603 .ips = ctx->addresses_best,
5604 .apply_expected = False
5608 * group,released vs. sgroup,active with different ip(s)
5611 .line = __location__,
5612 .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL),
5614 .nb_flags = NBT_NM_GROUP,
5616 .num_ips = ctx->addresses_best_num,
5617 .ips = ctx->addresses_best,
5618 .apply_expected = True
5621 .type = WREPL_TYPE_SGROUP,
5622 .state = WREPL_STATE_ACTIVE,
5623 .node = WREPL_NODE_B,
5625 .num_ips = ARRAY_SIZE(addresses_B_1),
5626 .ips = addresses_B_1,
5627 .apply_expected = False
5631 * group,released vs. sgroup,tombstone with same ip(s)
5634 .line = __location__,
5635 .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL),
5637 .nb_flags = NBT_NM_GROUP,
5639 .num_ips = ctx->addresses_best_num,
5640 .ips = ctx->addresses_best,
5641 .apply_expected = True
5644 .type = WREPL_TYPE_SGROUP,
5645 .state = WREPL_STATE_TOMBSTONE,
5646 .node = WREPL_NODE_B,
5648 .num_ips = ctx->addresses_best_num,
5649 .ips = ctx->addresses_best,
5650 .apply_expected = False
5654 * group,released vs. sgroup,tombstone with different ip(s)
5657 .line = __location__,
5658 .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL),
5660 .nb_flags = NBT_NM_GROUP,
5662 .num_ips = ctx->addresses_best_num,
5663 .ips = ctx->addresses_best,
5664 .apply_expected = True
5667 .type = WREPL_TYPE_SGROUP,
5668 .state = WREPL_STATE_TOMBSTONE,
5669 .node = WREPL_NODE_B,
5671 .num_ips = ARRAY_SIZE(addresses_B_1),
5672 .ips = addresses_B_1,
5673 .apply_expected = False
5677 * group vs. multi homed section
5680 * group,released vs. mhomed,active with same ip(s)
5683 .line = __location__,
5684 .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL),
5686 .nb_flags = NBT_NM_GROUP,
5688 .num_ips = ctx->addresses_best_num,
5689 .ips = ctx->addresses_best,
5690 .apply_expected = True
5693 .type = WREPL_TYPE_MHOMED,
5694 .state = WREPL_STATE_ACTIVE,
5695 .node = WREPL_NODE_B,
5697 .num_ips = ctx->addresses_best_num,
5698 .ips = ctx->addresses_best,
5699 .apply_expected = False
5703 * group,released vs. mhomed,active with different ip(s)
5706 .line = __location__,
5707 .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL),
5709 .nb_flags = NBT_NM_GROUP,
5711 .num_ips = ctx->addresses_best_num,
5712 .ips = ctx->addresses_best,
5713 .apply_expected = True
5716 .type = WREPL_TYPE_MHOMED,
5717 .state = WREPL_STATE_ACTIVE,
5718 .node = WREPL_NODE_B,
5720 .num_ips = ARRAY_SIZE(addresses_B_1),
5721 .ips = addresses_B_1,
5722 .apply_expected = False
5726 * group,released vs. mhomed,tombstone with same ip(s)
5729 .line = __location__,
5730 .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL),
5732 .nb_flags = NBT_NM_GROUP,
5734 .num_ips = ctx->addresses_best_num,
5735 .ips = ctx->addresses_best,
5736 .apply_expected = True
5739 .type = WREPL_TYPE_MHOMED,
5740 .state = WREPL_STATE_TOMBSTONE,
5741 .node = WREPL_NODE_B,
5743 .num_ips = ctx->addresses_best_num,
5744 .ips = ctx->addresses_best,
5745 .apply_expected = False
5749 * group,released vs. mhomed,tombstone with different ip(s)
5752 .line = __location__,
5753 .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL),
5755 .nb_flags = NBT_NM_GROUP,
5757 .num_ips = ctx->addresses_best_num,
5758 .ips = ctx->addresses_best,
5759 .apply_expected = True
5762 .type = WREPL_TYPE_MHOMED,
5763 .state = WREPL_STATE_TOMBSTONE,
5764 .node = WREPL_NODE_B,
5766 .num_ips = ARRAY_SIZE(addresses_B_1),
5767 .ips = addresses_B_1,
5768 .apply_expected = False
5772 * special group vs. unique section
5775 * sgroup,released vs. unique,active with same ip(s)
5778 .line = __location__,
5779 .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL),
5781 .nb_flags = NBT_NM_GROUP,
5783 .num_ips = ctx->addresses_best_num,
5784 .ips = ctx->addresses_best,
5785 .apply_expected = True
5788 .type = WREPL_TYPE_UNIQUE,
5789 .state = WREPL_STATE_ACTIVE,
5790 .node = WREPL_NODE_B,
5792 .num_ips = ctx->addresses_best_num,
5793 .ips = ctx->addresses_best,
5794 .apply_expected = True
5798 * sgroup,released vs. unique,active with different ip(s)
5801 .line = __location__,
5802 .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL),
5804 .nb_flags = NBT_NM_GROUP,
5806 .num_ips = ctx->addresses_best_num,
5807 .ips = ctx->addresses_best,
5808 .apply_expected = True
5811 .type = WREPL_TYPE_UNIQUE,
5812 .state = WREPL_STATE_ACTIVE,
5813 .node = WREPL_NODE_B,
5815 .num_ips = ARRAY_SIZE(addresses_B_1),
5816 .ips = addresses_B_1,
5817 .apply_expected = True
5821 * sgroup,released vs. unique,tombstone with same ip(s)
5824 .line = __location__,
5825 .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL),
5827 .nb_flags = NBT_NM_GROUP,
5829 .num_ips = ctx->addresses_best_num,
5830 .ips = ctx->addresses_best,
5831 .apply_expected = True
5834 .type = WREPL_TYPE_UNIQUE,
5835 .state = WREPL_STATE_TOMBSTONE,
5836 .node = WREPL_NODE_B,
5838 .num_ips = ctx->addresses_best_num,
5839 .ips = ctx->addresses_best,
5840 .apply_expected = True
5844 * sgroup,released vs. unique,tombstone with different ip(s)
5847 .line = __location__,
5848 .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL),
5850 .nb_flags = NBT_NM_GROUP,
5852 .num_ips = ctx->addresses_best_num,
5853 .ips = ctx->addresses_best,
5854 .apply_expected = True
5857 .type = WREPL_TYPE_UNIQUE,
5858 .state = WREPL_STATE_TOMBSTONE,
5859 .node = WREPL_NODE_B,
5861 .num_ips = ARRAY_SIZE(addresses_B_1),
5862 .ips = addresses_B_1,
5863 .apply_expected = True
5867 * special group vs. group section
5870 * sgroup,released vs. group,active with same ip(s)
5873 .line = __location__,
5874 .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL),
5876 .nb_flags = NBT_NM_GROUP,
5878 .num_ips = ctx->addresses_best_num,
5879 .ips = ctx->addresses_best,
5880 .apply_expected = True
5883 .type = WREPL_TYPE_GROUP,
5884 .state = WREPL_STATE_ACTIVE,
5885 .node = WREPL_NODE_B,
5887 .num_ips = ctx->addresses_best_num,
5888 .ips = ctx->addresses_best,
5889 .apply_expected = True
5893 * sgroup,released vs. group,active with different ip(s)
5896 .line = __location__,
5897 .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL),
5899 .nb_flags = NBT_NM_GROUP,
5901 .num_ips = ctx->addresses_best_num,
5902 .ips = ctx->addresses_best,
5903 .apply_expected = True
5906 .type = WREPL_TYPE_GROUP,
5907 .state = WREPL_STATE_ACTIVE,
5908 .node = WREPL_NODE_B,
5910 .num_ips = ARRAY_SIZE(addresses_B_1),
5911 .ips = addresses_B_1,
5912 .apply_expected = True
5916 * sgroup,released vs. group,tombstone with same ip(s)
5919 .line = __location__,
5920 .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL),
5922 .nb_flags = NBT_NM_GROUP,
5924 .num_ips = ctx->addresses_best_num,
5925 .ips = ctx->addresses_best,
5926 .apply_expected = True
5929 .type = WREPL_TYPE_GROUP,
5930 .state = WREPL_STATE_TOMBSTONE,
5931 .node = WREPL_NODE_B,
5933 .num_ips = ctx->addresses_best_num,
5934 .ips = ctx->addresses_best,
5935 .apply_expected = True
5939 * sgroup,released vs. group,tombstone with different ip(s)
5942 .line = __location__,
5943 .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL),
5945 .nb_flags = NBT_NM_GROUP,
5947 .num_ips = ctx->addresses_best_num,
5948 .ips = ctx->addresses_best,
5949 .apply_expected = True
5952 .type = WREPL_TYPE_GROUP,
5953 .state = WREPL_STATE_TOMBSTONE,
5954 .node = WREPL_NODE_B,
5956 .num_ips = ARRAY_SIZE(addresses_B_1),
5957 .ips = addresses_B_1,
5958 .apply_expected = True
5962 * special group vs. special group section
5965 * sgroup,released vs. sgroup,active with same ip(s)
5968 .line = __location__,
5969 .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL),
5971 .nb_flags = NBT_NM_GROUP,
5973 .num_ips = ctx->addresses_best_num,
5974 .ips = ctx->addresses_best,
5975 .apply_expected = True
5978 .type = WREPL_TYPE_SGROUP,
5979 .state = WREPL_STATE_ACTIVE,
5980 .node = WREPL_NODE_B,
5982 .num_ips = ctx->addresses_best_num,
5983 .ips = ctx->addresses_best,
5984 .apply_expected = True
5988 * sgroup,released vs. sgroup,active with different ip(s)
5991 .line = __location__,
5992 .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL),
5994 .nb_flags = NBT_NM_GROUP,
5996 .num_ips = ctx->addresses_best_num,
5997 .ips = ctx->addresses_best,
5998 .apply_expected = True
6001 .type = WREPL_TYPE_SGROUP,
6002 .state = WREPL_STATE_ACTIVE,
6003 .node = WREPL_NODE_B,
6005 .num_ips = ARRAY_SIZE(addresses_B_1),
6006 .ips = addresses_B_1,
6007 .apply_expected = True
6011 * sgroup,released vs. sgroup,tombstone with same ip(s)
6014 .line = __location__,
6015 .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL),
6017 .nb_flags = NBT_NM_GROUP,
6019 .num_ips = ctx->addresses_best_num,
6020 .ips = ctx->addresses_best,
6021 .apply_expected = True
6024 .type = WREPL_TYPE_SGROUP,
6025 .state = WREPL_STATE_TOMBSTONE,
6026 .node = WREPL_NODE_B,
6028 .num_ips = ctx->addresses_best_num,
6029 .ips = ctx->addresses_best,
6030 .apply_expected = True
6034 * sgroup,released vs. sgroup,tombstone with different ip(s)
6037 .line = __location__,
6038 .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL),
6040 .nb_flags = NBT_NM_GROUP,
6042 .num_ips = ctx->addresses_best_num,
6043 .ips = ctx->addresses_best,
6044 .apply_expected = True
6047 .type = WREPL_TYPE_SGROUP,
6048 .state = WREPL_STATE_TOMBSTONE,
6049 .node = WREPL_NODE_B,
6051 .num_ips = ARRAY_SIZE(addresses_B_1),
6052 .ips = addresses_B_1,
6053 .apply_expected = True
6057 * special group vs. multi homed section
6060 * sgroup,released vs. mhomed,active with same ip(s)
6063 .line = __location__,
6064 .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL),
6066 .nb_flags = NBT_NM_GROUP,
6068 .num_ips = ctx->addresses_best_num,
6069 .ips = ctx->addresses_best,
6070 .apply_expected = True
6073 .type = WREPL_TYPE_MHOMED,
6074 .state = WREPL_STATE_ACTIVE,
6075 .node = WREPL_NODE_B,
6077 .num_ips = ctx->addresses_best_num,
6078 .ips = ctx->addresses_best,
6079 .apply_expected = True
6083 * sgroup,released vs. mhomed,active with different ip(s)
6086 .line = __location__,
6087 .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL),
6089 .nb_flags = NBT_NM_GROUP,
6091 .num_ips = ctx->addresses_best_num,
6092 .ips = ctx->addresses_best,
6093 .apply_expected = True
6096 .type = WREPL_TYPE_MHOMED,
6097 .state = WREPL_STATE_ACTIVE,
6098 .node = WREPL_NODE_B,
6100 .num_ips = ARRAY_SIZE(addresses_B_1),
6101 .ips = addresses_B_1,
6102 .apply_expected = True
6106 * sgroup,released vs. mhomed,tombstone with same ip(s)
6109 .line = __location__,
6110 .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL),
6112 .nb_flags = NBT_NM_GROUP,
6114 .num_ips = ctx->addresses_best_num,
6115 .ips = ctx->addresses_best,
6116 .apply_expected = True
6119 .type = WREPL_TYPE_MHOMED,
6120 .state = WREPL_STATE_TOMBSTONE,
6121 .node = WREPL_NODE_B,
6123 .num_ips = ctx->addresses_best_num,
6124 .ips = ctx->addresses_best,
6125 .apply_expected = True
6129 * sgroup,released vs. mhomed,tombstone with different ip(s)
6132 .line = __location__,
6133 .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL),
6135 .nb_flags = NBT_NM_GROUP,
6137 .num_ips = ctx->addresses_best_num,
6138 .ips = ctx->addresses_best,
6139 .apply_expected = True
6142 .type = WREPL_TYPE_MHOMED,
6143 .state = WREPL_STATE_TOMBSTONE,
6144 .node = WREPL_NODE_B,
6146 .num_ips = ARRAY_SIZE(addresses_B_1),
6147 .ips = addresses_B_1,
6148 .apply_expected = True
6152 * multi homed vs. unique section
6155 * mhomed,released vs. unique,active with same ip(s)
6158 .line = __location__,
6159 .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL),
6163 .num_ips = ctx->addresses_best_num,
6164 .ips = ctx->addresses_best,
6165 .apply_expected = True
6168 .type = WREPL_TYPE_UNIQUE,
6169 .state = WREPL_STATE_ACTIVE,
6170 .node = WREPL_NODE_B,
6172 .num_ips = ctx->addresses_best_num,
6173 .ips = ctx->addresses_best,
6174 .apply_expected = True
6178 * mhomed,released vs. unique,active with different ip(s)
6181 .line = __location__,
6182 .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL),
6186 .num_ips = ctx->addresses_best_num,
6187 .ips = ctx->addresses_best,
6188 .apply_expected = True
6191 .type = WREPL_TYPE_UNIQUE,
6192 .state = WREPL_STATE_ACTIVE,
6193 .node = WREPL_NODE_B,
6195 .num_ips = ARRAY_SIZE(addresses_B_1),
6196 .ips = addresses_B_1,
6197 .apply_expected = True
6201 * mhomed,released vs. unique,tombstone with same ip(s)
6204 .line = __location__,
6205 .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL),
6209 .num_ips = ctx->addresses_best_num,
6210 .ips = ctx->addresses_best,
6211 .apply_expected = True
6214 .type = WREPL_TYPE_UNIQUE,
6215 .state = WREPL_STATE_TOMBSTONE,
6216 .node = WREPL_NODE_B,
6218 .num_ips = ctx->addresses_best_num,
6219 .ips = ctx->addresses_best,
6220 .apply_expected = True
6224 * mhomed,released vs. unique,tombstone with different ip(s)
6227 .line = __location__,
6228 .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL),
6232 .num_ips = ctx->addresses_best_num,
6233 .ips = ctx->addresses_best,
6234 .apply_expected = True
6237 .type = WREPL_TYPE_UNIQUE,
6238 .state = WREPL_STATE_TOMBSTONE,
6239 .node = WREPL_NODE_B,
6241 .num_ips = ARRAY_SIZE(addresses_B_1),
6242 .ips = addresses_B_1,
6243 .apply_expected = True
6247 * multi homed vs. group section
6250 * mhomed,released vs. group,active with same ip(s)
6253 .line = __location__,
6254 .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL),
6258 .num_ips = ctx->addresses_best_num,
6259 .ips = ctx->addresses_best,
6260 .apply_expected = True
6263 .type = WREPL_TYPE_GROUP,
6264 .state = WREPL_STATE_ACTIVE,
6265 .node = WREPL_NODE_B,
6267 .num_ips = ctx->addresses_best_num,
6268 .ips = ctx->addresses_best,
6269 .apply_expected = True
6273 * mhomed,released vs. group,active with different ip(s)
6276 .line = __location__,
6277 .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL),
6281 .num_ips = ctx->addresses_best_num,
6282 .ips = ctx->addresses_best,
6283 .apply_expected = True
6286 .type = WREPL_TYPE_GROUP,
6287 .state = WREPL_STATE_ACTIVE,
6288 .node = WREPL_NODE_B,
6290 .num_ips = ARRAY_SIZE(addresses_B_1),
6291 .ips = addresses_B_1,
6292 .apply_expected = True
6296 * mhomed,released vs. group,tombstone with same ip(s)
6299 .line = __location__,
6300 .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL),
6304 .num_ips = ctx->addresses_best_num,
6305 .ips = ctx->addresses_best,
6306 .apply_expected = True
6309 .type = WREPL_TYPE_GROUP,
6310 .state = WREPL_STATE_TOMBSTONE,
6311 .node = WREPL_NODE_B,
6313 .num_ips = ctx->addresses_best_num,
6314 .ips = ctx->addresses_best,
6315 .apply_expected = True
6319 * mhomed,released vs. group,tombstone with different ip(s)
6322 .line = __location__,
6323 .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL),
6327 .num_ips = ctx->addresses_best_num,
6328 .ips = ctx->addresses_best,
6329 .apply_expected = True
6332 .type = WREPL_TYPE_GROUP,
6333 .state = WREPL_STATE_TOMBSTONE,
6334 .node = WREPL_NODE_B,
6336 .num_ips = ARRAY_SIZE(addresses_B_1),
6337 .ips = addresses_B_1,
6338 .apply_expected = True
6342 * multi homed vs. special group section
6345 * mhomed,released vs. sgroup,active with same ip(s)
6348 .line = __location__,
6349 .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL),
6353 .num_ips = ctx->addresses_best_num,
6354 .ips = ctx->addresses_best,
6355 .apply_expected = True
6358 .type = WREPL_TYPE_SGROUP,
6359 .state = WREPL_STATE_ACTIVE,
6360 .node = WREPL_NODE_B,
6362 .num_ips = ctx->addresses_best_num,
6363 .ips = ctx->addresses_best,
6364 .apply_expected = True
6368 * mhomed,released vs. sgroup,active with different ip(s)
6371 .line = __location__,
6372 .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL),
6376 .num_ips = ctx->addresses_best_num,
6377 .ips = ctx->addresses_best,
6378 .apply_expected = True
6381 .type = WREPL_TYPE_SGROUP,
6382 .state = WREPL_STATE_ACTIVE,
6383 .node = WREPL_NODE_B,
6385 .num_ips = ARRAY_SIZE(addresses_B_1),
6386 .ips = addresses_B_1,
6387 .apply_expected = True
6391 * mhomed,released vs. sgroup,tombstone with same ip(s)
6394 .line = __location__,
6395 .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL),
6399 .num_ips = ctx->addresses_best_num,
6400 .ips = ctx->addresses_best,
6401 .apply_expected = True
6404 .type = WREPL_TYPE_SGROUP,
6405 .state = WREPL_STATE_TOMBSTONE,
6406 .node = WREPL_NODE_B,
6408 .num_ips = ctx->addresses_best_num,
6409 .ips = ctx->addresses_best,
6410 .apply_expected = True
6414 * mhomed,released vs. sgroup,tombstone with different ip(s)
6417 .line = __location__,
6418 .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL),
6422 .num_ips = ctx->addresses_best_num,
6423 .ips = ctx->addresses_best,
6424 .apply_expected = True
6427 .type = WREPL_TYPE_SGROUP,
6428 .state = WREPL_STATE_TOMBSTONE,
6429 .node = WREPL_NODE_B,
6431 .num_ips = ARRAY_SIZE(addresses_B_1),
6432 .ips = addresses_B_1,
6433 .apply_expected = True
6437 * multi homed vs. multi homed section
6440 * mhomed,released vs. mhomed,active with same ip(s)
6443 .line = __location__,
6444 .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL),
6448 .num_ips = ctx->addresses_best_num,
6449 .ips = ctx->addresses_best,
6450 .apply_expected = True
6453 .type = WREPL_TYPE_MHOMED,
6454 .state = WREPL_STATE_ACTIVE,
6455 .node = WREPL_NODE_B,
6457 .num_ips = ctx->addresses_best_num,
6458 .ips = ctx->addresses_best,
6459 .apply_expected = True
6463 * mhomed,released vs. mhomed,active with different ip(s)
6466 .line = __location__,
6467 .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL),
6471 .num_ips = ctx->addresses_best_num,
6472 .ips = ctx->addresses_best,
6473 .apply_expected = True
6476 .type = WREPL_TYPE_MHOMED,
6477 .state = WREPL_STATE_ACTIVE,
6478 .node = WREPL_NODE_B,
6480 .num_ips = ARRAY_SIZE(addresses_B_1),
6481 .ips = addresses_B_1,
6482 .apply_expected = True
6486 * mhomed,released vs. mhomed,tombstone with same ip(s)
6489 .line = __location__,
6490 .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL),
6494 .num_ips = ctx->addresses_best_num,
6495 .ips = ctx->addresses_best,
6496 .apply_expected = True
6499 .type = WREPL_TYPE_MHOMED,
6500 .state = WREPL_STATE_TOMBSTONE,
6501 .node = WREPL_NODE_B,
6503 .num_ips = ctx->addresses_best_num,
6504 .ips = ctx->addresses_best,
6505 .apply_expected = True
6509 * mhomed,released vs. mhomed,tombstone with different ip(s)
6512 .line = __location__,
6513 .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL),
6517 .num_ips = ctx->addresses_best_num,
6518 .ips = ctx->addresses_best,
6519 .apply_expected = True
6522 .type = WREPL_TYPE_MHOMED,
6523 .state = WREPL_STATE_TOMBSTONE,
6524 .node = WREPL_NODE_B,
6526 .num_ips = ARRAY_SIZE(addresses_B_1),
6527 .ips = addresses_B_1,
6528 .apply_expected = True
6533 printf("Test Replica records vs. owned released records\n");
6535 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
6536 printf("%s => %s\n", nbt_name_string(ctx, &records[i].name),
6537 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
6542 name_register->in.name = records[i].name;
6543 name_register->in.dest_addr = ctx->address;
6544 name_register->in.address = records[i].wins.ips[0].ip;
6545 name_register->in.nb_flags = records[i].wins.nb_flags;
6546 name_register->in.register_demand= False;
6547 name_register->in.broadcast = False;
6548 name_register->in.multi_homed = records[i].wins.mhomed;
6549 name_register->in.ttl = 300000;
6550 name_register->in.timeout = 70;
6551 name_register->in.retries = 0;
6553 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
6554 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6555 printf("No response from %s for name register\n", ctx->address);
6558 if (!NT_STATUS_IS_OK(status)) {
6559 printf("Bad response from %s for name register - %s\n",
6560 ctx->address, nt_errstr(status));
6563 CHECK_VALUE(name_register->out.rcode, 0);
6564 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
6565 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
6566 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
6567 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
6568 CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[0].ip);
6570 /* release the record */
6571 release->in.name = records[i].name;
6572 release->in.dest_addr = ctx->address;
6573 release->in.address = records[i].wins.ips[0].ip;
6574 release->in.nb_flags = records[i].wins.nb_flags;
6575 release->in.broadcast = False;
6576 release->in.timeout = 30;
6577 release->in.retries = 0;
6579 status = nbt_name_release(ctx->nbtsock, ctx, release);
6580 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6581 printf("No response from %s for name release\n", ctx->address);
6584 if (!NT_STATUS_IS_OK(status)) {
6585 printf("Bad response from %s for name query - %s\n",
6586 ctx->address, nt_errstr(status));
6589 CHECK_VALUE(release->out.rcode, 0);
6594 wins_name->name = &records[i].name;
6595 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
6596 records[i].replica.state,
6597 records[i].replica.node,
6598 records[i].replica.is_static);
6599 wins_name->id = ++ctx->b.max_version;
6600 if (wins_name->flags & 2) {
6601 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
6602 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
6604 wins_name->addresses.ip = records[i].replica.ips[0].ip;
6606 wins_name->unknown = "255.255.255.255";
6608 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
6609 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
6610 records[i].replica.apply_expected);
6612 if (records[i].replica.apply_expected) {
6613 wins_name->name = &records[i].name;
6614 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
6615 WREPL_STATE_TOMBSTONE,
6616 WREPL_NODE_B, False);
6617 wins_name->id = ++ctx->b.max_version;
6618 wins_name->addresses.ip = addresses_B_1[0].ip;
6619 wins_name->unknown = "255.255.255.255";
6621 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
6622 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
6624 release->in.name = records[i].name;
6625 release->in.dest_addr = ctx->address;
6626 release->in.address = records[i].wins.ips[0].ip;
6627 release->in.nb_flags = records[i].wins.nb_flags;
6628 release->in.broadcast = False;
6629 release->in.timeout = 30;
6630 release->in.retries = 0;
6632 status = nbt_name_release(ctx->nbtsock, ctx, release);
6633 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6634 printf("No response from %s for name release\n", ctx->address);
6637 if (!NT_STATUS_IS_OK(status)) {
6638 printf("Bad response from %s for name query - %s\n",
6639 ctx->address, nt_errstr(status));
6642 CHECK_VALUE(release->out.rcode, 0);
6646 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
6654 struct test_conflict_owned_active_vs_replica_struct {
6655 const char *line; /* just better debugging */
6656 const char *section; /* just better debugging */
6657 struct nbt_name name;
6658 const char *comment;
6664 const struct wrepl_ip *ips;
6665 BOOL apply_expected;
6670 BOOL expect_release;
6673 /* when num_ips == 0, then .wins.ips are used */
6675 const struct wrepl_ip *ips;
6678 enum wrepl_name_type type;
6679 enum wrepl_name_state state;
6680 enum wrepl_name_node node;
6683 const struct wrepl_ip *ips;
6684 BOOL apply_expected;
6690 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
6691 struct nbt_name_packet *req_packet,
6692 struct socket_address *src);
6694 static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_conn *ctx)
6698 struct wrepl_wins_name wins_name_;
6699 struct wrepl_wins_name *wins_name = &wins_name_;
6700 struct nbt_name_register name_register_;
6701 struct nbt_name_register *name_register = &name_register_;
6702 struct nbt_name_release release_;
6703 struct nbt_name_release *release = &release_;
6705 struct test_conflict_owned_active_vs_replica_struct records[] = {
6707 * unique vs. unique section
6710 * unique,active vs. unique,active with same ip(s), unchecked
6713 .line = __location__,
6714 .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL),
6718 .num_ips = ctx->addresses_best_num,
6719 .ips = ctx->addresses_best,
6720 .apply_expected = True
6726 .type = WREPL_TYPE_UNIQUE,
6727 .state = WREPL_STATE_ACTIVE,
6728 .node = WREPL_NODE_B,
6730 .num_ips = ctx->addresses_best_num,
6731 .ips = ctx->addresses_best,
6732 .apply_expected = True
6736 * unique,active vs. unique,active with different ip(s), positive response
6739 .line = __location__,
6740 .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL),
6744 .num_ips = ctx->addresses_best_num,
6745 .ips = ctx->addresses_best,
6746 .apply_expected = True
6753 .type = WREPL_TYPE_UNIQUE,
6754 .state = WREPL_STATE_ACTIVE,
6755 .node = WREPL_NODE_B,
6757 .num_ips = ARRAY_SIZE(addresses_B_1),
6758 .ips = addresses_B_1,
6759 .apply_expected = False
6763 * unique,active vs. unique,active with different ip(s), positive response other ips
6766 .line = __location__,
6767 .name = _NBT_NAME("_UA_UA_DI_O", 0x00, NULL),
6771 .num_ips = ctx->addresses_best_num,
6772 .ips = ctx->addresses_best,
6773 .apply_expected = True
6778 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6779 .ips = addresses_A_3_4,
6782 .type = WREPL_TYPE_UNIQUE,
6783 .state = WREPL_STATE_ACTIVE,
6784 .node = WREPL_NODE_B,
6786 .num_ips = ARRAY_SIZE(addresses_B_1),
6787 .ips = addresses_B_1,
6788 .apply_expected = False
6792 * unique,active vs. unique,active with different ip(s), negative response
6795 .line = __location__,
6796 .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL),
6800 .num_ips = ctx->addresses_best_num,
6801 .ips = ctx->addresses_best,
6802 .apply_expected = True
6809 .type = WREPL_TYPE_UNIQUE,
6810 .state = WREPL_STATE_ACTIVE,
6811 .node = WREPL_NODE_B,
6813 .num_ips = ARRAY_SIZE(addresses_B_1),
6814 .ips = addresses_B_1,
6815 .apply_expected = True
6819 * unique,active vs. unique,tombstone with same ip(s), unchecked
6822 .line = __location__,
6823 .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL),
6827 .num_ips = ctx->addresses_best_num,
6828 .ips = ctx->addresses_best,
6829 .apply_expected = True
6835 .type = WREPL_TYPE_UNIQUE,
6836 .state = WREPL_STATE_TOMBSTONE,
6837 .node = WREPL_NODE_B,
6839 .num_ips = ctx->addresses_best_num,
6840 .ips = ctx->addresses_best,
6841 .apply_expected = False
6845 * unique,active vs. unique,tombstone with different ip(s), unchecked
6848 .line = __location__,
6849 .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL),
6853 .num_ips = ctx->addresses_best_num,
6854 .ips = ctx->addresses_best,
6855 .apply_expected = True
6861 .type = WREPL_TYPE_UNIQUE,
6862 .state = WREPL_STATE_TOMBSTONE,
6863 .node = WREPL_NODE_B,
6865 .num_ips = ARRAY_SIZE(addresses_B_1),
6866 .ips = addresses_B_1,
6867 .apply_expected = False
6871 * unique vs. group section
6874 * unique,active vs. group,active with same ip(s), release expected
6877 .line = __location__,
6878 .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL),
6882 .num_ips = ctx->addresses_best_num,
6883 .ips = ctx->addresses_best,
6884 .apply_expected = True
6888 .expect_release = True,
6891 .type = WREPL_TYPE_GROUP,
6892 .state = WREPL_STATE_ACTIVE,
6893 .node = WREPL_NODE_B,
6895 .num_ips = ctx->addresses_best_num,
6896 .ips = ctx->addresses_best,
6897 .apply_expected = True
6901 * unique,active vs. group,active with different ip(s), release expected
6904 .line = __location__,
6905 .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL),
6909 .num_ips = ctx->addresses_best_num,
6910 .ips = ctx->addresses_best,
6911 .apply_expected = True
6915 .expect_release = True,
6918 .type = WREPL_TYPE_GROUP,
6919 .state = WREPL_STATE_ACTIVE,
6920 .node = WREPL_NODE_B,
6922 .num_ips = ARRAY_SIZE(addresses_B_1),
6923 .ips = addresses_B_1,
6924 .apply_expected = True
6928 * unique,active vs. group,tombstone with same ip(s), unchecked
6931 .line = __location__,
6932 .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL),
6936 .num_ips = ctx->addresses_best_num,
6937 .ips = ctx->addresses_best,
6938 .apply_expected = True
6944 .type = WREPL_TYPE_GROUP,
6945 .state = WREPL_STATE_TOMBSTONE,
6946 .node = WREPL_NODE_B,
6948 .num_ips = ctx->addresses_best_num,
6949 .ips = ctx->addresses_best,
6950 .apply_expected = False
6954 * unique,active vs. group,tombstone with different ip(s), unchecked
6957 .line = __location__,
6958 .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL),
6962 .num_ips = ctx->addresses_best_num,
6963 .ips = ctx->addresses_best,
6964 .apply_expected = True
6970 .type = WREPL_TYPE_GROUP,
6971 .state = WREPL_STATE_TOMBSTONE,
6972 .node = WREPL_NODE_B,
6974 .num_ips = ARRAY_SIZE(addresses_B_1),
6975 .ips = addresses_B_1,
6976 .apply_expected = False
6980 * unique vs. special group section
6983 * unique,active vs. sgroup,active with same ip(s), release expected
6986 .line = __location__,
6987 .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL),
6991 .num_ips = ctx->addresses_best_num,
6992 .ips = ctx->addresses_best,
6993 .apply_expected = True
6997 .expect_release = True,
7000 .type = WREPL_TYPE_SGROUP,
7001 .state = WREPL_STATE_ACTIVE,
7002 .node = WREPL_NODE_B,
7004 .num_ips = ctx->addresses_best_num,
7005 .ips = ctx->addresses_best,
7006 .apply_expected = True
7010 * unique,active vs. group,active with different ip(s), release expected
7013 .line = __location__,
7014 .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL),
7018 .num_ips = ctx->addresses_best_num,
7019 .ips = ctx->addresses_best,
7020 .apply_expected = True
7024 .expect_release = True,
7027 .type = WREPL_TYPE_SGROUP,
7028 .state = WREPL_STATE_ACTIVE,
7029 .node = WREPL_NODE_B,
7031 .num_ips = ARRAY_SIZE(addresses_B_1),
7032 .ips = addresses_B_1,
7033 .apply_expected = True
7037 * unique,active vs. sgroup,tombstone with same ip(s), unchecked
7040 .line = __location__,
7041 .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL),
7045 .num_ips = ctx->addresses_best_num,
7046 .ips = ctx->addresses_best,
7047 .apply_expected = True
7053 .type = WREPL_TYPE_SGROUP,
7054 .state = WREPL_STATE_TOMBSTONE,
7055 .node = WREPL_NODE_B,
7057 .num_ips = ctx->addresses_best_num,
7058 .ips = ctx->addresses_best,
7059 .apply_expected = False
7063 * unique,active vs. sgroup,tombstone with different ip(s), unchecked
7066 .line = __location__,
7067 .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL),
7071 .num_ips = ctx->addresses_best_num,
7072 .ips = ctx->addresses_best,
7073 .apply_expected = True
7079 .type = WREPL_TYPE_SGROUP,
7080 .state = WREPL_STATE_TOMBSTONE,
7081 .node = WREPL_NODE_B,
7083 .num_ips = ARRAY_SIZE(addresses_B_1),
7084 .ips = addresses_B_1,
7085 .apply_expected = False
7089 * unique vs. multi homed section
7092 * unique,active vs. mhomed,active with same ip(s), unchecked
7095 .line = __location__,
7096 .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL),
7100 .num_ips = ctx->addresses_best_num,
7101 .ips = ctx->addresses_best,
7102 .apply_expected = True
7108 .type = WREPL_TYPE_MHOMED,
7109 .state = WREPL_STATE_ACTIVE,
7110 .node = WREPL_NODE_B,
7112 .num_ips = ctx->addresses_best_num,
7113 .ips = ctx->addresses_best,
7114 .apply_expected = True
7118 * unique,active vs. mhomed,active with superset ip(s), unchecked
7121 .line = __location__,
7122 .name = _NBT_NAME("_UA_MA_SP_U", 0x00, NULL),
7126 .num_ips = ctx->addresses_best_num,
7127 .ips = ctx->addresses_best,
7128 .apply_expected = True
7134 .type = WREPL_TYPE_MHOMED,
7135 .state = WREPL_STATE_ACTIVE,
7136 .node = WREPL_NODE_B,
7138 .num_ips = ctx->addresses_all_num,
7139 .ips = ctx->addresses_all,
7140 .apply_expected = True
7144 * unique,active vs. mhomed,active with different ip(s), positive response
7147 .line = __location__,
7148 .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL),
7152 .num_ips = ctx->addresses_best_num,
7153 .ips = ctx->addresses_best,
7154 .apply_expected = True
7161 .type = WREPL_TYPE_MHOMED,
7162 .state = WREPL_STATE_ACTIVE,
7163 .node = WREPL_NODE_B,
7165 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7166 .ips = addresses_B_3_4,
7167 .apply_expected = False
7171 * unique,active vs. mhomed,active with different ip(s), positive response other ips
7174 .line = __location__,
7175 .name = _NBT_NAME("_UA_MA_DI_O", 0x00, NULL),
7179 .num_ips = ctx->addresses_best_num,
7180 .ips = ctx->addresses_best,
7181 .apply_expected = True
7186 .num_ips = ARRAY_SIZE(addresses_A_3_4),
7187 .ips = addresses_A_3_4,
7190 .type = WREPL_TYPE_MHOMED,
7191 .state = WREPL_STATE_ACTIVE,
7192 .node = WREPL_NODE_B,
7194 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7195 .ips = addresses_B_3_4,
7196 .apply_expected = False
7200 * unique,active vs. mhomed,active with different ip(s), negative response
7203 .line = __location__,
7204 .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL),
7208 .num_ips = ctx->addresses_best_num,
7209 .ips = ctx->addresses_best,
7210 .apply_expected = True
7217 .type = WREPL_TYPE_MHOMED,
7218 .state = WREPL_STATE_ACTIVE,
7219 .node = WREPL_NODE_B,
7221 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7222 .ips = addresses_B_3_4,
7223 .apply_expected = True
7227 * unique,active vs. mhomed,tombstone with same ip(s), unchecked
7230 .line = __location__,
7231 .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL),
7235 .num_ips = ctx->addresses_best_num,
7236 .ips = ctx->addresses_best,
7237 .apply_expected = True
7243 .type = WREPL_TYPE_MHOMED,
7244 .state = WREPL_STATE_TOMBSTONE,
7245 .node = WREPL_NODE_B,
7247 .num_ips = ctx->addresses_best_num,
7248 .ips = ctx->addresses_best,
7249 .apply_expected = False
7253 * unique,active vs. mhomed,tombstone with different ip(s), unchecked
7256 .line = __location__,
7257 .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL),
7261 .num_ips = ctx->addresses_best_num,
7262 .ips = ctx->addresses_best,
7263 .apply_expected = True
7269 .type = WREPL_TYPE_MHOMED,
7270 .state = WREPL_STATE_TOMBSTONE,
7271 .node = WREPL_NODE_B,
7273 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7274 .ips = addresses_B_3_4,
7275 .apply_expected = False
7279 * normal group vs. unique section
7282 * group,active vs. unique,active with same ip(s), unchecked
7285 .line = __location__,
7286 .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL),
7288 .nb_flags = NBT_NM_GROUP,
7290 .num_ips = ctx->addresses_best_num,
7291 .ips = ctx->addresses_best,
7292 .apply_expected = True
7298 .type = WREPL_TYPE_UNIQUE,
7299 .state = WREPL_STATE_ACTIVE,
7300 .node = WREPL_NODE_B,
7302 .num_ips = ctx->addresses_best_num,
7303 .ips = ctx->addresses_best,
7304 .apply_expected = False
7308 * group,active vs. unique,active with different ip(s), unchecked
7311 .line = __location__,
7312 .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL),
7314 .nb_flags = NBT_NM_GROUP,
7316 .num_ips = ctx->addresses_best_num,
7317 .ips = ctx->addresses_best,
7318 .apply_expected = True
7324 .type = WREPL_TYPE_UNIQUE,
7325 .state = WREPL_STATE_ACTIVE,
7326 .node = WREPL_NODE_B,
7328 .num_ips = ARRAY_SIZE(addresses_B_1),
7329 .ips = addresses_B_1,
7330 .apply_expected = False
7334 * group,active vs. unique,tombstone with same ip(s), unchecked
7337 .line = __location__,
7338 .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL),
7340 .nb_flags = NBT_NM_GROUP,
7342 .num_ips = ctx->addresses_best_num,
7343 .ips = ctx->addresses_best,
7344 .apply_expected = True
7350 .type = WREPL_TYPE_UNIQUE,
7351 .state = WREPL_STATE_TOMBSTONE,
7352 .node = WREPL_NODE_B,
7354 .num_ips = ctx->addresses_best_num,
7355 .ips = ctx->addresses_best,
7356 .apply_expected = False
7360 * group,active vs. unique,tombstone with different ip(s), unchecked
7363 .line = __location__,
7364 .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL),
7366 .nb_flags = NBT_NM_GROUP,
7368 .num_ips = ctx->addresses_best_num,
7369 .ips = ctx->addresses_best,
7370 .apply_expected = True
7376 .type = WREPL_TYPE_UNIQUE,
7377 .state = WREPL_STATE_TOMBSTONE,
7378 .node = WREPL_NODE_B,
7380 .num_ips = ARRAY_SIZE(addresses_B_1),
7381 .ips = addresses_B_1,
7382 .apply_expected = False
7386 * normal group vs. normal group section
7389 * group,active vs. group,active with same ip(s), unchecked
7392 .line = __location__,
7393 .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL),
7395 .nb_flags = NBT_NM_GROUP,
7397 .num_ips = ctx->addresses_best_num,
7398 .ips = ctx->addresses_best,
7399 .apply_expected = True
7405 .type = WREPL_TYPE_GROUP,
7406 .state = WREPL_STATE_ACTIVE,
7407 .node = WREPL_NODE_B,
7409 .num_ips = ctx->addresses_best_num,
7410 .ips = ctx->addresses_best,
7411 .apply_expected = True
7415 * group,active vs. group,active with different ip(s), unchecked
7418 .line = __location__,
7419 .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL),
7421 .nb_flags = NBT_NM_GROUP,
7423 .num_ips = ctx->addresses_best_num,
7424 .ips = ctx->addresses_best,
7425 .apply_expected = True
7431 .type = WREPL_TYPE_GROUP,
7432 .state = WREPL_STATE_ACTIVE,
7433 .node = WREPL_NODE_B,
7435 .num_ips = ARRAY_SIZE(addresses_B_1),
7436 .ips = addresses_B_1,
7437 .apply_expected = True
7441 * group,active vs. group,tombstone with same ip(s), unchecked
7444 .line = __location__,
7445 .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL),
7447 .nb_flags = NBT_NM_GROUP,
7449 .num_ips = ctx->addresses_best_num,
7450 .ips = ctx->addresses_best,
7451 .apply_expected = True
7457 .type = WREPL_TYPE_GROUP,
7458 .state = WREPL_STATE_TOMBSTONE,
7459 .node = WREPL_NODE_B,
7461 .num_ips = ctx->addresses_best_num,
7462 .ips = ctx->addresses_best,
7463 .apply_expected = False
7467 * group,active vs. group,tombstone with different ip(s), unchecked
7470 .line = __location__,
7471 .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL),
7473 .nb_flags = NBT_NM_GROUP,
7475 .num_ips = ctx->addresses_best_num,
7476 .ips = ctx->addresses_best,
7477 .apply_expected = True
7483 .type = WREPL_TYPE_GROUP,
7484 .state = WREPL_STATE_TOMBSTONE,
7485 .node = WREPL_NODE_B,
7487 .num_ips = ARRAY_SIZE(addresses_B_1),
7488 .ips = addresses_B_1,
7489 .apply_expected = False
7493 * normal group vs. special group section
7496 * group,active vs. sgroup,active with same ip(s), unchecked
7499 .line = __location__,
7500 .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL),
7502 .nb_flags = NBT_NM_GROUP,
7504 .num_ips = ctx->addresses_best_num,
7505 .ips = ctx->addresses_best,
7506 .apply_expected = True
7512 .type = WREPL_TYPE_SGROUP,
7513 .state = WREPL_STATE_ACTIVE,
7514 .node = WREPL_NODE_B,
7516 .num_ips = ctx->addresses_best_num,
7517 .ips = ctx->addresses_best,
7518 .apply_expected = False
7522 * group,active vs. sgroup,active with different ip(s), unchecked
7525 .line = __location__,
7526 .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL),
7528 .nb_flags = NBT_NM_GROUP,
7530 .num_ips = ctx->addresses_best_num,
7531 .ips = ctx->addresses_best,
7532 .apply_expected = True
7538 .type = WREPL_TYPE_SGROUP,
7539 .state = WREPL_STATE_ACTIVE,
7540 .node = WREPL_NODE_B,
7542 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7543 .ips = addresses_B_3_4,
7544 .apply_expected = False
7548 * group,active vs. sgroup,tombstone with same ip(s), unchecked
7551 .line = __location__,
7552 .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL),
7554 .nb_flags = NBT_NM_GROUP,
7556 .num_ips = ctx->addresses_best_num,
7557 .ips = ctx->addresses_best,
7558 .apply_expected = True
7564 .type = WREPL_TYPE_SGROUP,
7565 .state = WREPL_STATE_TOMBSTONE,
7566 .node = WREPL_NODE_B,
7568 .num_ips = ctx->addresses_best_num,
7569 .ips = ctx->addresses_best,
7570 .apply_expected = False
7574 * group,active vs. sgroup,tombstone with different ip(s), unchecked
7577 .line = __location__,
7578 .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL),
7580 .nb_flags = NBT_NM_GROUP,
7582 .num_ips = ctx->addresses_best_num,
7583 .ips = ctx->addresses_best,
7584 .apply_expected = True
7590 .type = WREPL_TYPE_SGROUP,
7591 .state = WREPL_STATE_TOMBSTONE,
7592 .node = WREPL_NODE_B,
7594 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7595 .ips = addresses_B_3_4,
7596 .apply_expected = False
7600 * normal group vs. multi homed section
7603 * group,active vs. mhomed,active with same ip(s), unchecked
7606 .line = __location__,
7607 .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL),
7609 .nb_flags = NBT_NM_GROUP,
7611 .num_ips = ctx->addresses_best_num,
7612 .ips = ctx->addresses_best,
7613 .apply_expected = True
7619 .type = WREPL_TYPE_MHOMED,
7620 .state = WREPL_STATE_ACTIVE,
7621 .node = WREPL_NODE_B,
7623 .num_ips = ctx->addresses_best_num,
7624 .ips = ctx->addresses_best,
7625 .apply_expected = False
7629 * group,active vs. mhomed,active with different ip(s), unchecked
7632 .line = __location__,
7633 .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL),
7635 .nb_flags = NBT_NM_GROUP,
7637 .num_ips = ctx->addresses_best_num,
7638 .ips = ctx->addresses_best,
7639 .apply_expected = True
7645 .type = WREPL_TYPE_MHOMED,
7646 .state = WREPL_STATE_ACTIVE,
7647 .node = WREPL_NODE_B,
7649 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7650 .ips = addresses_B_3_4,
7651 .apply_expected = False
7655 * group,active vs. mhomed,tombstone with same ip(s), unchecked
7658 .line = __location__,
7659 .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL),
7661 .nb_flags = NBT_NM_GROUP,
7663 .num_ips = ctx->addresses_best_num,
7664 .ips = ctx->addresses_best,
7665 .apply_expected = True
7671 .type = WREPL_TYPE_MHOMED,
7672 .state = WREPL_STATE_TOMBSTONE,
7673 .node = WREPL_NODE_B,
7675 .num_ips = ctx->addresses_best_num,
7676 .ips = ctx->addresses_best,
7677 .apply_expected = False
7681 * group,active vs. mhomed,tombstone with different ip(s), unchecked
7684 .line = __location__,
7685 .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL),
7687 .nb_flags = NBT_NM_GROUP,
7689 .num_ips = ctx->addresses_best_num,
7690 .ips = ctx->addresses_best,
7691 .apply_expected = True
7697 .type = WREPL_TYPE_MHOMED,
7698 .state = WREPL_STATE_TOMBSTONE,
7699 .node = WREPL_NODE_B,
7701 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7702 .ips = addresses_B_3_4,
7703 .apply_expected = False
7707 * special group vs. unique section
7710 * sgroup,active vs. unique,active with same ip(s), unchecked
7713 .line = __location__,
7714 .name = _NBT_NAME("_SA_UA_SI_U", 0x1C, NULL),
7716 .nb_flags = NBT_NM_GROUP,
7718 .num_ips = ctx->addresses_best_num,
7719 .ips = ctx->addresses_best,
7720 .apply_expected = True
7726 .type = WREPL_TYPE_UNIQUE,
7727 .state = WREPL_STATE_ACTIVE,
7728 .node = WREPL_NODE_B,
7730 .num_ips = ctx->addresses_best_num,
7731 .ips = ctx->addresses_best,
7732 .apply_expected = False
7736 * sgroup,active vs. unique,active with different ip(s), unchecked
7739 .line = __location__,
7740 .name = _NBT_NAME("_SA_UA_DI_U", 0x1C, NULL),
7742 .nb_flags = NBT_NM_GROUP,
7744 .num_ips = ctx->addresses_best_num,
7745 .ips = ctx->addresses_best,
7746 .apply_expected = True
7752 .type = WREPL_TYPE_UNIQUE,
7753 .state = WREPL_STATE_ACTIVE,
7754 .node = WREPL_NODE_B,
7756 .num_ips = ARRAY_SIZE(addresses_B_1),
7757 .ips = addresses_B_1,
7758 .apply_expected = False
7762 * sgroup,active vs. unique,tombstone with same ip(s), unchecked
7765 .line = __location__,
7766 .name = _NBT_NAME("_SA_UT_SI_U", 0x1C, NULL),
7768 .nb_flags = NBT_NM_GROUP,
7770 .num_ips = ctx->addresses_best_num,
7771 .ips = ctx->addresses_best,
7772 .apply_expected = True
7778 .type = WREPL_TYPE_UNIQUE,
7779 .state = WREPL_STATE_TOMBSTONE,
7780 .node = WREPL_NODE_B,
7782 .num_ips = ctx->addresses_best_num,
7783 .ips = ctx->addresses_best,
7784 .apply_expected = False
7788 * sgroup,active vs. unique,tombstone with different ip(s), unchecked
7791 .line = __location__,
7792 .name = _NBT_NAME("_SA_UT_DI_U", 0x1C, NULL),
7794 .nb_flags = NBT_NM_GROUP,
7796 .num_ips = ctx->addresses_best_num,
7797 .ips = ctx->addresses_best,
7798 .apply_expected = True
7804 .type = WREPL_TYPE_UNIQUE,
7805 .state = WREPL_STATE_TOMBSTONE,
7806 .node = WREPL_NODE_B,
7808 .num_ips = ARRAY_SIZE(addresses_B_1),
7809 .ips = addresses_B_1,
7810 .apply_expected = False
7814 * special group vs. normal group section
7817 * sgroup,active vs. group,active with same ip(s), unchecked
7820 .line = __location__,
7821 .name = _NBT_NAME("_SA_GA_SI_U", 0x1C, NULL),
7823 .nb_flags = NBT_NM_GROUP,
7825 .num_ips = ctx->addresses_best_num,
7826 .ips = ctx->addresses_best,
7827 .apply_expected = True
7833 .type = WREPL_TYPE_GROUP,
7834 .state = WREPL_STATE_ACTIVE,
7835 .node = WREPL_NODE_B,
7837 .num_ips = ctx->addresses_best_num,
7838 .ips = ctx->addresses_best,
7839 .apply_expected = False
7843 * sgroup,active vs. group,active with different ip(s), unchecked
7846 .line = __location__,
7847 .name = _NBT_NAME("_SA_GA_DI_U", 0x1C, NULL),
7849 .nb_flags = NBT_NM_GROUP,
7851 .num_ips = ctx->addresses_best_num,
7852 .ips = ctx->addresses_best,
7853 .apply_expected = True
7859 .type = WREPL_TYPE_GROUP,
7860 .state = WREPL_STATE_ACTIVE,
7861 .node = WREPL_NODE_B,
7863 .num_ips = ARRAY_SIZE(addresses_B_1),
7864 .ips = addresses_B_1,
7865 .apply_expected = False
7869 * sgroup,active vs. group,tombstone with same ip(s), unchecked
7872 .line = __location__,
7873 .name = _NBT_NAME("_SA_GT_SI_U", 0x1C, NULL),
7875 .nb_flags = NBT_NM_GROUP,
7877 .num_ips = ctx->addresses_best_num,
7878 .ips = ctx->addresses_best,
7879 .apply_expected = True
7885 .type = WREPL_TYPE_GROUP,
7886 .state = WREPL_STATE_TOMBSTONE,
7887 .node = WREPL_NODE_B,
7889 .num_ips = ctx->addresses_best_num,
7890 .ips = ctx->addresses_best,
7891 .apply_expected = False
7895 * sgroup,active vs. group,tombstone with different ip(s), unchecked
7898 .line = __location__,
7899 .name = _NBT_NAME("_SA_GT_DI_U", 0x1C, NULL),
7901 .nb_flags = NBT_NM_GROUP,
7903 .num_ips = ctx->addresses_best_num,
7904 .ips = ctx->addresses_best,
7905 .apply_expected = True
7911 .type = WREPL_TYPE_GROUP,
7912 .state = WREPL_STATE_TOMBSTONE,
7913 .node = WREPL_NODE_B,
7915 .num_ips = ARRAY_SIZE(addresses_B_1),
7916 .ips = addresses_B_1,
7917 .apply_expected = False
7921 * special group vs. multi homed section
7924 * sgroup,active vs. mhomed,active with same ip(s), unchecked
7927 .line = __location__,
7928 .name = _NBT_NAME("_SA_MA_SI_U", 0x1C, NULL),
7930 .nb_flags = NBT_NM_GROUP,
7932 .num_ips = ctx->addresses_best_num,
7933 .ips = ctx->addresses_best,
7934 .apply_expected = True
7940 .type = WREPL_TYPE_MHOMED,
7941 .state = WREPL_STATE_ACTIVE,
7942 .node = WREPL_NODE_B,
7944 .num_ips = ctx->addresses_best_num,
7945 .ips = ctx->addresses_best,
7946 .apply_expected = False
7950 * sgroup,active vs. mhomed,active with different ip(s), unchecked
7953 .line = __location__,
7954 .name = _NBT_NAME("_SA_MA_DI_U", 0x1C, NULL),
7956 .nb_flags = NBT_NM_GROUP,
7958 .num_ips = ctx->addresses_best_num,
7959 .ips = ctx->addresses_best,
7960 .apply_expected = True
7966 .type = WREPL_TYPE_MHOMED,
7967 .state = WREPL_STATE_ACTIVE,
7968 .node = WREPL_NODE_B,
7970 .num_ips = ARRAY_SIZE(addresses_B_1),
7971 .ips = addresses_B_1,
7972 .apply_expected = False
7976 * sgroup,active vs. mhomed,tombstone with same ip(s), unchecked
7979 .line = __location__,
7980 .name = _NBT_NAME("_SA_MT_SI_U", 0x1C, NULL),
7982 .nb_flags = NBT_NM_GROUP,
7984 .num_ips = ctx->addresses_best_num,
7985 .ips = ctx->addresses_best,
7986 .apply_expected = True
7992 .type = WREPL_TYPE_MHOMED,
7993 .state = WREPL_STATE_TOMBSTONE,
7994 .node = WREPL_NODE_B,
7996 .num_ips = ctx->addresses_best_num,
7997 .ips = ctx->addresses_best,
7998 .apply_expected = False
8002 * sgroup,active vs. mhomed,tombstone with different ip(s), unchecked
8005 .line = __location__,
8006 .name = _NBT_NAME("_SA_MT_DI_U", 0x1C, NULL),
8008 .nb_flags = NBT_NM_GROUP,
8010 .num_ips = ctx->addresses_best_num,
8011 .ips = ctx->addresses_best,
8012 .apply_expected = True
8018 .type = WREPL_TYPE_MHOMED,
8019 .state = WREPL_STATE_TOMBSTONE,
8020 .node = WREPL_NODE_B,
8022 .num_ips = ARRAY_SIZE(addresses_B_1),
8023 .ips = addresses_B_1,
8024 .apply_expected = False
8028 * multi homed vs. unique section
8031 * mhomed,active vs. unique,active with same ip(s), unchecked
8034 .line = __location__,
8035 .name = _NBT_NAME("_MA_UA_SI_U", 0x00, NULL),
8039 .num_ips = ctx->addresses_best_num,
8040 .ips = ctx->addresses_best,
8041 .apply_expected = True
8047 .type = WREPL_TYPE_UNIQUE,
8048 .state = WREPL_STATE_ACTIVE,
8049 .node = WREPL_NODE_B,
8051 .num_ips = ctx->addresses_best_num,
8052 .ips = ctx->addresses_best,
8053 .apply_expected = True
8057 * mhomed,active vs. unique,active with different ip(s), positive response
8060 .line = __location__,
8061 .name = _NBT_NAME("_MA_UA_DI_P", 0x00, NULL),
8065 .num_ips = ctx->addresses_best_num,
8066 .ips = ctx->addresses_best,
8067 .apply_expected = True
8074 .type = WREPL_TYPE_UNIQUE,
8075 .state = WREPL_STATE_ACTIVE,
8076 .node = WREPL_NODE_B,
8078 .num_ips = ARRAY_SIZE(addresses_B_1),
8079 .ips = addresses_B_1,
8080 .apply_expected = False
8084 * mhomed,active vs. unique,active with different ip(s), positive response other ips
8087 .line = __location__,
8088 .name = _NBT_NAME("_MA_UA_DI_O", 0x00, NULL),
8092 .num_ips = ctx->addresses_best_num,
8093 .ips = ctx->addresses_best,
8094 .apply_expected = True
8099 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8100 .ips = addresses_A_3_4,
8103 .type = WREPL_TYPE_UNIQUE,
8104 .state = WREPL_STATE_ACTIVE,
8105 .node = WREPL_NODE_B,
8107 .num_ips = ARRAY_SIZE(addresses_B_1),
8108 .ips = addresses_B_1,
8109 .apply_expected = False
8113 * mhomed,active vs. unique,active with different ip(s), negative response
8116 .line = __location__,
8117 .name = _NBT_NAME("_MA_UA_DI_N", 0x00, NULL),
8121 .num_ips = ctx->addresses_best_num,
8122 .ips = ctx->addresses_best,
8123 .apply_expected = True
8130 .type = WREPL_TYPE_UNIQUE,
8131 .state = WREPL_STATE_ACTIVE,
8132 .node = WREPL_NODE_B,
8134 .num_ips = ARRAY_SIZE(addresses_B_1),
8135 .ips = addresses_B_1,
8136 .apply_expected = True
8140 * mhomed,active vs. unique,tombstone with same ip(s), unchecked
8143 .line = __location__,
8144 .name = _NBT_NAME("_MA_UT_SI_U", 0x00, NULL),
8148 .num_ips = ctx->addresses_best_num,
8149 .ips = ctx->addresses_best,
8150 .apply_expected = True
8156 .type = WREPL_TYPE_UNIQUE,
8157 .state = WREPL_STATE_TOMBSTONE,
8158 .node = WREPL_NODE_B,
8160 .num_ips = ctx->addresses_best_num,
8161 .ips = ctx->addresses_best,
8162 .apply_expected = False
8166 * mhomed,active vs. unique,tombstone with different ip(s), unchecked
8169 .line = __location__,
8170 .name = _NBT_NAME("_MA_UT_DI_U", 0x00, NULL),
8174 .num_ips = ctx->addresses_best_num,
8175 .ips = ctx->addresses_best,
8176 .apply_expected = True
8182 .type = WREPL_TYPE_UNIQUE,
8183 .state = WREPL_STATE_TOMBSTONE,
8184 .node = WREPL_NODE_B,
8186 .num_ips = ARRAY_SIZE(addresses_B_1),
8187 .ips = addresses_B_1,
8188 .apply_expected = False
8192 * multi homed vs. normal group section
8195 * mhomed,active vs. group,active with same ip(s), release expected
8198 .line = __location__,
8199 .name = _NBT_NAME("_MA_GA_SI_R", 0x00, NULL),
8203 .num_ips = ctx->addresses_best_num,
8204 .ips = ctx->addresses_best,
8205 .apply_expected = True
8209 .expect_release = True,
8212 .type = WREPL_TYPE_GROUP,
8213 .state = WREPL_STATE_ACTIVE,
8214 .node = WREPL_NODE_B,
8216 .num_ips = ctx->addresses_best_num,
8217 .ips = ctx->addresses_best,
8218 .apply_expected = True
8222 * mhomed,active vs. group,active with different ip(s), release expected
8225 .line = __location__,
8226 .name = _NBT_NAME("_MA_GA_DI_R", 0x00, NULL),
8230 .num_ips = ctx->addresses_best_num,
8231 .ips = ctx->addresses_best,
8232 .apply_expected = True
8236 .expect_release = True,
8239 .type = WREPL_TYPE_GROUP,
8240 .state = WREPL_STATE_ACTIVE,
8241 .node = WREPL_NODE_B,
8243 .num_ips = ARRAY_SIZE(addresses_B_1),
8244 .ips = addresses_B_1,
8245 .apply_expected = True
8249 * mhomed,active vs. group,tombstone with same ip(s), unchecked
8252 .line = __location__,
8253 .name = _NBT_NAME("_MA_GT_SI_U", 0x00, NULL),
8257 .num_ips = ctx->addresses_best_num,
8258 .ips = ctx->addresses_best,
8259 .apply_expected = True
8265 .type = WREPL_TYPE_GROUP,
8266 .state = WREPL_STATE_TOMBSTONE,
8267 .node = WREPL_NODE_B,
8269 .num_ips = ctx->addresses_best_num,
8270 .ips = ctx->addresses_best,
8271 .apply_expected = False
8275 * mhomed,active vs. group,tombstone with different ip(s), unchecked
8278 .line = __location__,
8279 .name = _NBT_NAME("_MA_GT_DI_U", 0x00, NULL),
8283 .num_ips = ctx->addresses_best_num,
8284 .ips = ctx->addresses_best,
8285 .apply_expected = True
8291 .type = WREPL_TYPE_GROUP,
8292 .state = WREPL_STATE_TOMBSTONE,
8293 .node = WREPL_NODE_B,
8295 .num_ips = ARRAY_SIZE(addresses_B_1),
8296 .ips = addresses_B_1,
8297 .apply_expected = False
8301 * multi homed vs. special group section
8304 * mhomed,active vs. sgroup,active with same ip(s), release expected
8307 .line = __location__,
8308 .name = _NBT_NAME("_MA_SA_SI_R", 0x00, NULL),
8312 .num_ips = ctx->addresses_best_num,
8313 .ips = ctx->addresses_best,
8314 .apply_expected = True
8318 .expect_release = True,
8321 .type = WREPL_TYPE_SGROUP,
8322 .state = WREPL_STATE_ACTIVE,
8323 .node = WREPL_NODE_B,
8325 .num_ips = ctx->addresses_best_num,
8326 .ips = ctx->addresses_best,
8327 .apply_expected = True
8331 * mhomed,active vs. group,active with different ip(s), release expected
8334 .line = __location__,
8335 .name = _NBT_NAME("_MA_SA_DI_R", 0x00, NULL),
8339 .num_ips = ctx->addresses_best_num,
8340 .ips = ctx->addresses_best,
8341 .apply_expected = True
8345 .expect_release = True,
8348 .type = WREPL_TYPE_SGROUP,
8349 .state = WREPL_STATE_ACTIVE,
8350 .node = WREPL_NODE_B,
8352 .num_ips = ARRAY_SIZE(addresses_B_1),
8353 .ips = addresses_B_1,
8354 .apply_expected = True
8358 * mhomed,active vs. sgroup,tombstone with same ip(s), unchecked
8361 .line = __location__,
8362 .name = _NBT_NAME("_MA_ST_SI_U", 0x00, NULL),
8366 .num_ips = ctx->addresses_best_num,
8367 .ips = ctx->addresses_best,
8368 .apply_expected = True
8374 .type = WREPL_TYPE_SGROUP,
8375 .state = WREPL_STATE_TOMBSTONE,
8376 .node = WREPL_NODE_B,
8378 .num_ips = ctx->addresses_best_num,
8379 .ips = ctx->addresses_best,
8380 .apply_expected = False
8384 * mhomed,active vs. sgroup,tombstone with different ip(s), unchecked
8387 .line = __location__,
8388 .name = _NBT_NAME("_MA_ST_DI_U", 0x00, NULL),
8392 .num_ips = ctx->addresses_best_num,
8393 .ips = ctx->addresses_best,
8394 .apply_expected = True
8400 .type = WREPL_TYPE_SGROUP,
8401 .state = WREPL_STATE_TOMBSTONE,
8402 .node = WREPL_NODE_B,
8404 .num_ips = ARRAY_SIZE(addresses_B_1),
8405 .ips = addresses_B_1,
8406 .apply_expected = False
8410 * multi homed vs. multi homed section
8413 * mhomed,active vs. mhomed,active with same ip(s), unchecked
8416 .line = __location__,
8417 .name = _NBT_NAME("_MA_MA_SI_U", 0x00, NULL),
8421 .num_ips = ctx->addresses_best_num,
8422 .ips = ctx->addresses_best,
8423 .apply_expected = True
8429 .type = WREPL_TYPE_MHOMED,
8430 .state = WREPL_STATE_ACTIVE,
8431 .node = WREPL_NODE_B,
8433 .num_ips = ctx->addresses_best_num,
8434 .ips = ctx->addresses_best,
8435 .apply_expected = True
8439 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8442 .line = __location__,
8443 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8447 .num_ips = ctx->addresses_best_num,
8448 .ips = ctx->addresses_best,
8449 .apply_expected = True
8455 .type = WREPL_TYPE_MHOMED,
8456 .state = WREPL_STATE_ACTIVE,
8457 .node = WREPL_NODE_B,
8459 .num_ips = ctx->addresses_all_num,
8460 .ips = ctx->addresses_all,
8461 .apply_expected = True
8465 * mhomed,active vs. mhomed,active with different ip(s), positive response
8468 .line = __location__,
8469 .name = _NBT_NAME("_MA_MA_DI_P", 0x00, NULL),
8473 .num_ips = ctx->addresses_best_num,
8474 .ips = ctx->addresses_best,
8475 .apply_expected = True
8482 .type = WREPL_TYPE_MHOMED,
8483 .state = WREPL_STATE_ACTIVE,
8484 .node = WREPL_NODE_B,
8486 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8487 .ips = addresses_B_3_4,
8488 .apply_expected = False
8492 * mhomed,active vs. mhomed,active with different ip(s), positive response other ips
8495 .line = __location__,
8496 .name = _NBT_NAME("_MA_MA_DI_O", 0x00, NULL),
8500 .num_ips = ctx->addresses_best_num,
8501 .ips = ctx->addresses_best,
8502 .apply_expected = True
8507 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8508 .ips = addresses_A_3_4,
8511 .type = WREPL_TYPE_MHOMED,
8512 .state = WREPL_STATE_ACTIVE,
8513 .node = WREPL_NODE_B,
8515 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8516 .ips = addresses_B_3_4,
8517 .apply_expected = False
8521 * mhomed,active vs. mhomed,active with different ip(s), negative response
8524 .line = __location__,
8525 .name = _NBT_NAME("_MA_MA_DI_N", 0x00, NULL),
8529 .num_ips = ctx->addresses_best_num,
8530 .ips = ctx->addresses_best,
8531 .apply_expected = True
8538 .type = WREPL_TYPE_MHOMED,
8539 .state = WREPL_STATE_ACTIVE,
8540 .node = WREPL_NODE_B,
8542 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8543 .ips = addresses_B_3_4,
8544 .apply_expected = True
8548 * mhomed,active vs. mhomed,tombstone with same ip(s), unchecked
8551 .line = __location__,
8552 .name = _NBT_NAME("_MA_MT_SI_U", 0x00, NULL),
8556 .num_ips = ctx->addresses_best_num,
8557 .ips = ctx->addresses_best,
8558 .apply_expected = True
8564 .type = WREPL_TYPE_MHOMED,
8565 .state = WREPL_STATE_TOMBSTONE,
8566 .node = WREPL_NODE_B,
8568 .num_ips = ctx->addresses_best_num,
8569 .ips = ctx->addresses_best,
8570 .apply_expected = False
8574 * mhomed,active vs. mhomed,tombstone with different ip(s), unchecked
8577 .line = __location__,
8578 .name = _NBT_NAME("_MA_MT_DI_U", 0x00, NULL),
8582 .num_ips = ctx->addresses_best_num,
8583 .ips = ctx->addresses_best,
8584 .apply_expected = True
8590 .type = WREPL_TYPE_MHOMED,
8591 .state = WREPL_STATE_TOMBSTONE,
8592 .node = WREPL_NODE_B,
8594 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8595 .ips = addresses_B_3_4,
8596 .apply_expected = False
8600 * some more multi homed test, including merging
8603 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8606 .line = __location__,
8607 .section= "Test Replica vs. owned active: some more MHOMED combinations",
8608 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8609 .comment= "C:MHOMED vs. B:ALL => B:ALL",
8610 .skip = (ctx->addresses_all_num < 3),
8614 .num_ips = ctx->addresses_mhomed_num,
8615 .ips = ctx->addresses_mhomed,
8616 .apply_expected = True
8622 .type = WREPL_TYPE_MHOMED,
8623 .state = WREPL_STATE_ACTIVE,
8624 .node = WREPL_NODE_B,
8626 .num_ips = ctx->addresses_all_num,
8627 .ips = ctx->addresses_all,
8628 .apply_expected = True
8632 * mhomed,active vs. mhomed,active with same ips, unchecked
8635 .line = __location__,
8636 .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL),
8637 .comment= "C:MHOMED vs. B:MHOMED => B:MHOMED",
8638 .skip = (ctx->addresses_mhomed_num < 2),
8642 .num_ips = ctx->addresses_mhomed_num,
8643 .ips = ctx->addresses_mhomed,
8644 .apply_expected = True
8650 .type = WREPL_TYPE_MHOMED,
8651 .state = WREPL_STATE_ACTIVE,
8652 .node = WREPL_NODE_B,
8654 .num_ips = ctx->addresses_mhomed_num,
8655 .ips = ctx->addresses_mhomed,
8656 .apply_expected = True
8660 * mhomed,active vs. mhomed,active with subset ip(s), positive response
8663 .line = __location__,
8664 .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL),
8665 .comment= "C:MHOMED vs. B:BEST (C:MHOMED) => B:MHOMED",
8666 .skip = (ctx->addresses_mhomed_num < 2),
8670 .num_ips = ctx->addresses_mhomed_num,
8671 .ips = ctx->addresses_mhomed,
8672 .apply_expected = True
8679 .type = WREPL_TYPE_MHOMED,
8680 .state = WREPL_STATE_ACTIVE,
8681 .node = WREPL_NODE_B,
8683 .num_ips = ctx->addresses_best_num,
8684 .ips = ctx->addresses_best,
8685 .mhomed_merge = True
8689 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with all addresses
8692 .line = __location__,
8693 .name = _NBT_NAME("_MA_MA_SB_A", 0x00, NULL),
8694 .comment= "C:MHOMED vs. B:BEST (C:ALL) => B:MHOMED",
8695 .skip = (ctx->addresses_all_num < 3),
8699 .num_ips = ctx->addresses_mhomed_num,
8700 .ips = ctx->addresses_mhomed,
8701 .apply_expected = True
8706 .num_ips = ctx->addresses_all_num,
8707 .ips = ctx->addresses_all,
8710 .type = WREPL_TYPE_MHOMED,
8711 .state = WREPL_STATE_ACTIVE,
8712 .node = WREPL_NODE_B,
8714 .num_ips = ctx->addresses_best_num,
8715 .ips = ctx->addresses_best,
8716 .mhomed_merge = True
8720 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with replicas addresses
8721 * TODO: check why the server sends a name release demand for one address?
8722 * the release demand has no effect to the database record...
8725 .line = __location__,
8726 .name = _NBT_NAME("_MA_MA_SB_PRA", 0x00, NULL),
8727 .comment= "C:MHOMED vs. B:BEST (C:BEST) => C:MHOMED",
8728 .skip = (ctx->addresses_all_num < 2),
8732 .num_ips = ctx->addresses_mhomed_num,
8733 .ips = ctx->addresses_mhomed,
8734 .apply_expected = True
8739 .num_ips = ctx->addresses_best_num,
8740 .ips = ctx->addresses_best,
8741 .late_release = True
8744 .type = WREPL_TYPE_MHOMED,
8745 .state = WREPL_STATE_ACTIVE,
8746 .node = WREPL_NODE_B,
8748 .num_ips = ctx->addresses_best_num,
8749 .ips = ctx->addresses_best,
8750 .apply_expected = False
8754 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with other addresses
8757 .line = __location__,
8758 .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL),
8759 .comment= "C:MHOMED vs. B:BEST (B:B_3_4) =>C:MHOMED",
8760 .skip = (ctx->addresses_all_num < 2),
8764 .num_ips = ctx->addresses_mhomed_num,
8765 .ips = ctx->addresses_mhomed,
8766 .apply_expected = True
8771 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8772 .ips = addresses_B_3_4,
8775 .type = WREPL_TYPE_MHOMED,
8776 .state = WREPL_STATE_ACTIVE,
8777 .node = WREPL_NODE_B,
8779 .num_ips = ctx->addresses_best_num,
8780 .ips = ctx->addresses_best,
8781 .apply_expected = False
8785 * mhomed,active vs. mhomed,active with subset ip(s), negative response
8788 .line = __location__,
8789 .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL),
8790 .comment= "C:MHOMED vs. B:BEST (NEGATIVE) => B:BEST",
8791 .skip = (ctx->addresses_mhomed_num < 2),
8795 .num_ips = ctx->addresses_mhomed_num,
8796 .ips = ctx->addresses_mhomed,
8797 .apply_expected = True
8804 .type = WREPL_TYPE_MHOMED,
8805 .state = WREPL_STATE_ACTIVE,
8806 .node = WREPL_NODE_B,
8808 .num_ips = ctx->addresses_best_num,
8809 .ips = ctx->addresses_best,
8810 .apply_expected = True
8814 * some more multi homed and unique test, including merging
8817 * mhomed,active vs. unique,active with subset ip(s), positive response
8820 .line = __location__,
8821 .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations",
8822 .name = _NBT_NAME("_MA_UA_SB_P", 0x00, NULL),
8823 .comment= "C:MHOMED vs. B:UNIQUE,BEST (C:MHOMED) => B:MHOMED",
8824 .skip = (ctx->addresses_all_num < 2),
8828 .num_ips = ctx->addresses_mhomed_num,
8829 .ips = ctx->addresses_mhomed,
8830 .apply_expected = True
8837 .type = WREPL_TYPE_UNIQUE,
8838 .state = WREPL_STATE_ACTIVE,
8839 .node = WREPL_NODE_B,
8841 .num_ips = ctx->addresses_best_num,
8842 .ips = ctx->addresses_best,
8843 .mhomed_merge = True
8847 * unique,active vs. unique,active with different ip(s), positive response, with replicas address
8848 * TODO: check why the server sends a name release demand for one address?
8849 * the release demand has no effect to the database record...
8852 .line = __location__,
8853 .name = _NBT_NAME("_UA_UA_DI_PRA", 0x00, NULL),
8854 .comment= "C:BEST vs. B:BEST2 (C:BEST2,LR:BEST2) => C:BEST",
8855 .skip = (ctx->addresses_all_num < 2),
8859 .num_ips = ctx->addresses_best_num,
8860 .ips = ctx->addresses_best,
8861 .apply_expected = True
8866 .num_ips = ctx->addresses_best2_num,
8867 .ips = ctx->addresses_best2,
8868 .late_release = True
8871 .type = WREPL_TYPE_UNIQUE,
8872 .state = WREPL_STATE_ACTIVE,
8873 .node = WREPL_NODE_B,
8875 .num_ips = ctx->addresses_best2_num,
8876 .ips = ctx->addresses_best2,
8877 .apply_expected = False,
8881 * unique,active vs. unique,active with different ip(s), positive response, with all addresses
8884 .line = __location__,
8885 .name = _NBT_NAME("_UA_UA_DI_A", 0x00, NULL),
8886 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
8887 .skip = (ctx->addresses_all_num < 3),
8891 .num_ips = ctx->addresses_best_num,
8892 .ips = ctx->addresses_best,
8893 .apply_expected = True
8898 .num_ips = ctx->addresses_all_num,
8899 .ips = ctx->addresses_all,
8902 .type = WREPL_TYPE_UNIQUE,
8903 .state = WREPL_STATE_ACTIVE,
8904 .node = WREPL_NODE_B,
8906 .num_ips = ctx->addresses_best2_num,
8907 .ips = ctx->addresses_best2,
8908 .mhomed_merge = True,
8912 * unique,active vs. mhomed,active with different ip(s), positive response, with all addresses
8915 .line = __location__,
8916 .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL),
8917 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
8918 .skip = (ctx->addresses_all_num < 3),
8922 .num_ips = ctx->addresses_best_num,
8923 .ips = ctx->addresses_best,
8924 .apply_expected = True
8929 .num_ips = ctx->addresses_all_num,
8930 .ips = ctx->addresses_all,
8933 .type = WREPL_TYPE_MHOMED,
8934 .state = WREPL_STATE_ACTIVE,
8935 .node = WREPL_NODE_B,
8937 .num_ips = ctx->addresses_best2_num,
8938 .ips = ctx->addresses_best2,
8939 .mhomed_merge = True,
8943 * special group vs. special group merging section
8946 * sgroup,active vs. sgroup,active with different ip(s)
8949 .line = __location__,
8950 .section= "Test Replica vs. owned active: SGROUP vs. SGROUP tests",
8951 .name = _NBT_NAME("_SA_SA_DI_U", 0x1C, NULL),
8952 .skip = (ctx->addresses_all_num < 3),
8954 .nb_flags = NBT_NM_GROUP,
8956 .num_ips = ctx->addresses_mhomed_num,
8957 .ips = ctx->addresses_mhomed,
8958 .apply_expected = True
8964 .type = WREPL_TYPE_SGROUP,
8965 .state = WREPL_STATE_ACTIVE,
8966 .node = WREPL_NODE_B,
8968 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8969 .ips = addresses_B_3_4,
8970 .sgroup_merge = True
8974 * sgroup,active vs. sgroup,active with same ip(s)
8977 .line = __location__,
8978 .name = _NBT_NAME("_SA_SA_SI_U", 0x1C, NULL),
8979 .skip = (ctx->addresses_all_num < 3),
8981 .nb_flags = NBT_NM_GROUP,
8983 .num_ips = ctx->addresses_mhomed_num,
8984 .ips = ctx->addresses_mhomed,
8985 .apply_expected = True
8991 .type = WREPL_TYPE_SGROUP,
8992 .state = WREPL_STATE_ACTIVE,
8993 .node = WREPL_NODE_B,
8995 .num_ips = ctx->addresses_mhomed_num,
8996 .ips = ctx->addresses_mhomed,
8997 .sgroup_merge = True
9001 * sgroup,active vs. sgroup,active with superset ip(s)
9004 .line = __location__,
9005 .name = _NBT_NAME("_SA_SA_SP_U", 0x1C, NULL),
9006 .skip = (ctx->addresses_all_num < 3),
9008 .nb_flags = NBT_NM_GROUP,
9010 .num_ips = ctx->addresses_mhomed_num,
9011 .ips = ctx->addresses_mhomed,
9012 .apply_expected = True
9018 .type = WREPL_TYPE_SGROUP,
9019 .state = WREPL_STATE_ACTIVE,
9020 .node = WREPL_NODE_B,
9022 .num_ips = ctx->addresses_all_num,
9023 .ips = ctx->addresses_all,
9024 .sgroup_merge = True
9028 * sgroup,active vs. sgroup,active with subset ip(s)
9031 .line = __location__,
9032 .name = _NBT_NAME("_SA_SA_SB_U", 0x1C, NULL),
9033 .skip = (ctx->addresses_all_num < 3),
9035 .nb_flags = NBT_NM_GROUP,
9037 .num_ips = ctx->addresses_mhomed_num,
9038 .ips = ctx->addresses_mhomed,
9039 .apply_expected = True
9045 .type = WREPL_TYPE_SGROUP,
9046 .state = WREPL_STATE_ACTIVE,
9047 .node = WREPL_NODE_B,
9049 .num_ips = ctx->addresses_best_num,
9050 .ips = ctx->addresses_best,
9051 .sgroup_merge = True
9055 * sgroup,active vs. sgroup,tombstone with different ip(s)
9058 .line = __location__,
9059 .name = _NBT_NAME("_SA_ST_DI_U", 0x1C, NULL),
9060 .skip = (ctx->addresses_all_num < 3),
9062 .nb_flags = NBT_NM_GROUP,
9064 .num_ips = ctx->addresses_mhomed_num,
9065 .ips = ctx->addresses_mhomed,
9066 .apply_expected = True
9072 .type = WREPL_TYPE_SGROUP,
9073 .state = WREPL_STATE_TOMBSTONE,
9074 .node = WREPL_NODE_B,
9076 .num_ips = ARRAY_SIZE(addresses_B_3_4),
9077 .ips = addresses_B_3_4,
9078 .apply_expected = False
9082 * sgroup,active vs. sgroup,tombstone with same ip(s)
9085 .line = __location__,
9086 .name = _NBT_NAME("_SA_ST_SI_U", 0x1C, NULL),
9087 .skip = (ctx->addresses_all_num < 3),
9089 .nb_flags = NBT_NM_GROUP,
9091 .num_ips = ctx->addresses_mhomed_num,
9092 .ips = ctx->addresses_mhomed,
9093 .apply_expected = True
9099 .type = WREPL_TYPE_SGROUP,
9100 .state = WREPL_STATE_TOMBSTONE,
9101 .node = WREPL_NODE_B,
9103 .num_ips = ctx->addresses_mhomed_num,
9104 .ips = ctx->addresses_mhomed,
9105 .apply_expected = False
9109 * sgroup,active vs. sgroup,tombstone with superset ip(s)
9112 .line = __location__,
9113 .name = _NBT_NAME("_SA_ST_SP_U", 0x1C, NULL),
9114 .skip = (ctx->addresses_all_num < 3),
9116 .nb_flags = NBT_NM_GROUP,
9118 .num_ips = ctx->addresses_mhomed_num,
9119 .ips = ctx->addresses_mhomed,
9120 .apply_expected = True
9126 .type = WREPL_TYPE_SGROUP,
9127 .state = WREPL_STATE_TOMBSTONE,
9128 .node = WREPL_NODE_B,
9130 .num_ips = ctx->addresses_all_num,
9131 .ips = ctx->addresses_all,
9132 .apply_expected = False
9136 * sgroup,active vs. sgroup,tombstone with subset ip(s)
9139 .line = __location__,
9140 .name = _NBT_NAME("_SA_ST_SB_U", 0x1C, NULL),
9141 .skip = (ctx->addresses_all_num < 3),
9143 .nb_flags = NBT_NM_GROUP,
9145 .num_ips = ctx->addresses_mhomed_num,
9146 .ips = ctx->addresses_mhomed,
9147 .apply_expected = True
9153 .type = WREPL_TYPE_SGROUP,
9154 .state = WREPL_STATE_TOMBSTONE,
9155 .node = WREPL_NODE_B,
9157 .num_ips = ctx->addresses_best_num,
9158 .ips = ctx->addresses_best,
9159 .apply_expected = False
9164 if (!ctx->nbtsock_srv) {
9165 printf("SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
9170 printf("Test Replica records vs. owned active records\n");
9172 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
9174 struct test_conflict_owned_active_vs_replica_struct record = records[i];
9175 uint32_t j, count = 1;
9178 if (records[i].wins.mhomed || records[i].name.type == 0x1C) {
9179 count = records[i].wins.num_ips;
9182 if (records[i].section) {
9183 printf("%s\n", records[i].section);
9186 if (records[i].skip) {
9187 printf("%s => SKIPPED\n", nbt_name_string(ctx, &records[i].name));
9191 if (records[i].replica.mhomed_merge) {
9192 action = "MHOMED_MERGE";
9193 } else if (records[i].replica.sgroup_merge) {
9194 action = "SGROUP_MERGE";
9195 } else if (records[i].replica.apply_expected) {
9198 action = "NOT REPLACE";
9201 printf("%s%s%s => %s\n",
9202 nbt_name_string(ctx, &records[i].name),
9203 (records[i].comment?": ":""),
9204 (records[i].comment?records[i].comment:""),
9207 /* Prepare for multi homed registration */
9208 ZERO_STRUCT(records[i].defend);
9209 records[i].defend.timeout = 10;
9210 records[i].defend.positive = True;
9211 nbt_set_incoming_handler(ctx->nbtsock_srv,
9212 test_conflict_owned_active_vs_replica_handler,
9214 if (ctx->nbtsock_srv2) {
9215 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9216 test_conflict_owned_active_vs_replica_handler,
9223 for (j=0; j < count; j++) {
9224 struct nbt_name_request *req;
9226 name_register->in.name = records[i].name;
9227 name_register->in.dest_addr = ctx->address;
9228 name_register->in.address = records[i].wins.ips[j].ip;
9229 name_register->in.nb_flags = records[i].wins.nb_flags;
9230 name_register->in.register_demand= False;
9231 name_register->in.broadcast = False;
9232 name_register->in.multi_homed = records[i].wins.mhomed;
9233 name_register->in.ttl = 300000;
9234 name_register->in.timeout = 70;
9235 name_register->in.retries = 0;
9237 req = nbt_name_register_send(ctx->nbtsock, name_register);
9239 /* push the request on the wire */
9240 event_loop_once(ctx->nbtsock->event_ctx);
9243 * if we register multiple addresses,
9244 * the server will do name queries to see if the old addresses
9247 if (records[i].wins.mhomed && j > 0) {
9248 end = timeval_current_ofs(records[i].defend.timeout,0);
9249 records[i].defend.ret = True;
9250 while (records[i].defend.timeout > 0) {
9251 event_loop_once(ctx->nbtsock_srv->event_ctx);
9252 if (timeval_expired(&end)) break;
9254 ret &= records[i].defend.ret;
9257 status = nbt_name_register_recv(req, ctx, name_register);
9258 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9259 printf("No response from %s for name register\n", ctx->address);
9262 if (!NT_STATUS_IS_OK(status)) {
9263 printf("Bad response from %s for name register - %s\n",
9264 ctx->address, nt_errstr(status));
9267 CHECK_VALUE(name_register->out.rcode, 0);
9268 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
9269 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
9270 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
9271 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
9272 CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[j].ip);
9275 /* Prepare for the current test */
9276 records[i].defend = record.defend;
9277 nbt_set_incoming_handler(ctx->nbtsock_srv,
9278 test_conflict_owned_active_vs_replica_handler,
9280 if (ctx->nbtsock_srv2) {
9281 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9282 test_conflict_owned_active_vs_replica_handler,
9289 wins_name->name = &records[i].name;
9290 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
9291 records[i].replica.state,
9292 records[i].replica.node,
9293 records[i].replica.is_static);
9294 wins_name->id = ++ctx->b.max_version;
9295 if (wins_name->flags & 2) {
9296 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
9297 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
9299 wins_name->addresses.ip = records[i].replica.ips[0].ip;
9301 wins_name->unknown = "255.255.255.255";
9303 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9306 * wait for the name query, which is handled in
9307 * test_conflict_owned_active_vs_replica_handler()
9309 end = timeval_current_ofs(records[i].defend.timeout,0);
9310 records[i].defend.ret = True;
9311 while (records[i].defend.timeout > 0) {
9312 event_loop_once(ctx->nbtsock_srv->event_ctx);
9313 if (timeval_expired(&end)) break;
9315 ret &= records[i].defend.ret;
9317 if (records[i].defend.late_release) {
9318 records[i].defend = record.defend;
9319 records[i].defend.expect_release = True;
9321 * wait for the name release demand, which is handled in
9322 * test_conflict_owned_active_vs_replica_handler()
9324 end = timeval_current_ofs(records[i].defend.timeout,0);
9325 records[i].defend.ret = True;
9326 while (records[i].defend.timeout > 0) {
9327 event_loop_once(ctx->nbtsock_srv->event_ctx);
9328 if (timeval_expired(&end)) break;
9330 ret &= records[i].defend.ret;
9333 if (records[i].replica.mhomed_merge) {
9334 ret &= test_wrepl_mhomed_merged(ctx, &ctx->c,
9335 records[i].wins.num_ips, records[i].wins.ips,
9337 records[i].replica.num_ips, records[i].replica.ips,
9339 } else if (records[i].replica.sgroup_merge) {
9340 ret &= test_wrepl_sgroup_merged(ctx, NULL,
9342 records[i].wins.num_ips, records[i].wins.ips,
9344 records[i].replica.num_ips, records[i].replica.ips,
9347 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
9348 records[i].replica.apply_expected);
9351 if (records[i].replica.apply_expected ||
9352 records[i].replica.mhomed_merge) {
9353 wins_name->name = &records[i].name;
9354 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9355 WREPL_STATE_TOMBSTONE,
9356 WREPL_NODE_B, False);
9357 wins_name->id = ++ctx->b.max_version;
9358 wins_name->addresses.ip = addresses_B_1[0].ip;
9359 wins_name->unknown = "255.255.255.255";
9361 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9362 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
9364 for (j=0; j < count; j++) {
9365 struct nbt_name_socket *nbtsock = ctx->nbtsock;
9367 if (ctx->myaddr2 && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2->addr) == 0) {
9368 nbtsock = ctx->nbtsock2;
9371 release->in.name = records[i].name;
9372 release->in.dest_addr = ctx->address;
9373 release->in.address = records[i].wins.ips[j].ip;
9374 release->in.nb_flags = records[i].wins.nb_flags;
9375 release->in.broadcast = False;
9376 release->in.timeout = 30;
9377 release->in.retries = 0;
9379 status = nbt_name_release(nbtsock, ctx, release);
9380 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9381 printf("No response from %s for name release\n", ctx->address);
9384 if (!NT_STATUS_IS_OK(status)) {
9385 printf("Bad response from %s for name query - %s\n",
9386 ctx->address, nt_errstr(status));
9389 CHECK_VALUE(release->out.rcode, 0);
9392 if (records[i].replica.sgroup_merge) {
9393 /* clean up the SGROUP record */
9394 wins_name->name = &records[i].name;
9395 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9397 WREPL_NODE_B, False);
9398 wins_name->id = ++ctx->b.max_version;
9399 wins_name->addresses.addresses.num_ips = 0;
9400 wins_name->addresses.addresses.ips = NULL;
9401 wins_name->unknown = "255.255.255.255";
9402 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9404 /* take ownership of the SGROUP record */
9405 wins_name->name = &records[i].name;
9406 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9408 WREPL_NODE_B, False);
9409 wins_name->id = ++ctx->b.max_version;
9410 wins_name->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
9411 wins_name->addresses.addresses.ips = discard_const(addresses_B_1);
9412 wins_name->unknown = "255.255.255.255";
9413 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9414 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
9416 /* overwrite the SGROUP record with unique,tombstone */
9417 wins_name->name = &records[i].name;
9418 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9419 WREPL_STATE_TOMBSTONE,
9420 WREPL_NODE_B, False);
9421 wins_name->id = ++ctx->b.max_version;
9422 wins_name->addresses.ip = addresses_A_1[0].ip;
9423 wins_name->unknown = "255.255.255.255";
9424 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9425 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
9431 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
9439 #define _NBT_ASSERT(v, correct) do { \
9440 if ((v) != (correct)) { \
9441 printf("(%s) Incorrect value %s=%d - should be %s (%d)\n", \
9442 __location__, #v, v, #correct, correct); \
9447 #define _NBT_ASSERT_STRING(v, correct) do { \
9448 if ( ((!v) && (correct)) || \
9449 ((v) && (!correct)) || \
9450 ((v) && (correct) && strcmp(v,correct) != 0)) { \
9451 printf("(%s) Incorrect value %s=%s - should be %s\n", \
9452 __location__, #v, v, correct); \
9457 static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
9458 struct nbt_name_packet *req_packet,
9459 struct socket_address *src)
9461 struct nbt_name *name;
9462 struct nbt_name_packet *rep_packet;
9463 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9465 _NBT_ASSERT(req_packet->qdcount, 1);
9466 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9467 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9469 name = &req_packet->questions[0].name;
9471 _NBT_ASSERT(name->type, rec->name.type);
9472 _NBT_ASSERT_STRING(name->name, rec->name.name);
9473 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9475 _NBT_ASSERT(rec->defend.expect_release, False);
9477 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9478 if (rep_packet == NULL) return;
9480 rep_packet->name_trn_id = req_packet->name_trn_id;
9481 rep_packet->ancount = 1;
9483 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9484 if (rep_packet->answers == NULL) return;
9486 rep_packet->answers[0].name = *name;
9487 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9488 rep_packet->answers[0].ttl = 0;
9490 if (rec->defend.positive) {
9491 uint32_t i, num_ips;
9492 const struct wrepl_ip *ips;
9494 if (rec->defend.num_ips > 0) {
9495 num_ips = rec->defend.num_ips;
9496 ips = rec->defend.ips;
9498 num_ips = rec->wins.num_ips;
9499 ips = rec->wins.ips;
9502 /* send a positive reply */
9503 rep_packet->operation =
9506 NBT_FLAG_AUTHORITIVE |
9507 NBT_FLAG_RECURSION_DESIRED |
9508 NBT_FLAG_RECURSION_AVAIL;
9510 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9512 rep_packet->answers[0].rdata.netbios.length = num_ips*6;
9513 rep_packet->answers[0].rdata.netbios.addresses =
9514 talloc_array(rep_packet->answers, struct nbt_rdata_address, num_ips);
9515 if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return;
9517 for (i=0; i < num_ips; i++) {
9518 struct nbt_rdata_address *addr =
9519 &rep_packet->answers[0].rdata.netbios.addresses[i];
9520 addr->nb_flags = rec->wins.nb_flags;
9521 addr->ipaddr = ips[i].ip;
9523 DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
9524 nbt_name_string(rep_packet, name), src->addr, src->port));
9526 /* send a negative reply */
9527 rep_packet->operation =
9530 NBT_FLAG_AUTHORITIVE |
9533 rep_packet->answers[0].rr_type = NBT_QTYPE_NULL;
9535 ZERO_STRUCT(rep_packet->answers[0].rdata);
9537 DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
9538 nbt_name_string(rep_packet, name), src->addr, src->port));
9541 nbt_name_reply_send(nbtsock, src, rep_packet);
9542 talloc_free(rep_packet);
9544 /* make sure we push the reply to the wire */
9545 event_loop_once(nbtsock->event_ctx);
9548 rec->defend.timeout = 0;
9549 rec->defend.ret = True;
9552 static void test_conflict_owned_active_vs_replica_handler_release(struct nbt_name_socket *nbtsock,
9553 struct nbt_name_packet *req_packet,
9554 struct socket_address *src)
9556 struct nbt_name *name;
9557 struct nbt_name_packet *rep_packet;
9558 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9560 _NBT_ASSERT(req_packet->qdcount, 1);
9561 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9562 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9564 name = &req_packet->questions[0].name;
9566 _NBT_ASSERT(name->type, rec->name.type);
9567 _NBT_ASSERT_STRING(name->name, rec->name.name);
9568 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9570 _NBT_ASSERT(rec->defend.expect_release, True);
9572 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9573 if (rep_packet == NULL) return;
9575 rep_packet->name_trn_id = req_packet->name_trn_id;
9576 rep_packet->ancount = 1;
9577 rep_packet->operation =
9579 NBT_OPCODE_RELEASE |
9580 NBT_FLAG_AUTHORITIVE;
9582 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9583 if (rep_packet->answers == NULL) return;
9585 rep_packet->answers[0].name = *name;
9586 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9587 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9588 rep_packet->answers[0].ttl = req_packet->additional[0].ttl;
9589 rep_packet->answers[0].rdata = req_packet->additional[0].rdata;
9591 DEBUG(2,("Sending name release reply for %s to %s:%d\n",
9592 nbt_name_string(rep_packet, name), src->addr, src->port));
9594 nbt_name_reply_send(nbtsock, src, rep_packet);
9595 talloc_free(rep_packet);
9597 /* make sure we push the reply to the wire */
9598 event_loop_once(nbtsock->event_ctx);
9601 rec->defend.timeout = 0;
9602 rec->defend.ret = True;
9605 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
9606 struct nbt_name_packet *req_packet,
9607 struct socket_address *src)
9609 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9611 rec->defend.ret = False;
9613 switch (req_packet->operation & NBT_OPCODE) {
9614 case NBT_OPCODE_QUERY:
9615 test_conflict_owned_active_vs_replica_handler_query(nbtsock, req_packet, src);
9617 case NBT_OPCODE_RELEASE:
9618 test_conflict_owned_active_vs_replica_handler_release(nbtsock, req_packet, src);
9621 printf("%s: unexpected incoming packet\n", __location__);
9627 test simple WINS replication operations
9629 BOOL torture_nbt_winsreplication_simple(struct torture_context *torture)
9631 const char *address;
9632 struct nbt_name name;
9633 TALLOC_CTX *mem_ctx = talloc_new(NULL);
9637 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
9639 /* do an initial name resolution to find its IP */
9640 status = resolve_name(&name, mem_ctx, &address, NULL);
9641 if (!NT_STATUS_IS_OK(status)) {
9642 printf("Failed to resolve %s - %s\n",
9643 name.name, nt_errstr(status));
9644 talloc_free(mem_ctx);
9648 ret &= test_assoc_ctx1(mem_ctx, address);
9649 ret &= test_assoc_ctx2(mem_ctx, address);
9651 ret &= test_wins_replication(mem_ctx, address);
9653 talloc_free(mem_ctx);
9659 test WINS replication replica conflicts operations
9661 BOOL torture_nbt_winsreplication_replica(struct torture_context *torture)
9663 const char *address;
9664 struct nbt_name name;
9665 TALLOC_CTX *mem_ctx = talloc_new(NULL);
9668 struct test_wrepl_conflict_conn *ctx;
9670 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
9672 /* do an initial name resolution to find its IP */
9673 status = resolve_name(&name, mem_ctx, &address, NULL);
9674 if (!NT_STATUS_IS_OK(status)) {
9675 printf("Failed to resolve %s - %s\n",
9676 name.name, nt_errstr(status));
9677 talloc_free(mem_ctx);
9681 ctx = test_create_conflict_ctx(mem_ctx, address);
9682 if (!ctx) return False;
9684 ret &= test_conflict_same_owner(ctx);
9685 ret &= test_conflict_different_owner(ctx);
9687 talloc_free(mem_ctx);
9693 test WINS replication owned conflicts operations
9695 BOOL torture_nbt_winsreplication_owned(struct torture_context *torture)
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);
9721 talloc_free(mem_ctx);