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/nbt/libnbt.h"
26 #include "libcli/wrepl/winsrepl.h"
27 #include "lib/events/events.h"
28 #include "lib/socket/socket.h"
29 #include "system/time.h"
31 #define CHECK_STATUS(status, correct) do { \
32 if (!NT_STATUS_EQUAL(status, correct)) { \
33 printf("(%s) Incorrect status %s - should be %s\n", \
34 __location__, nt_errstr(status), nt_errstr(correct)); \
39 #define CHECK_VALUE(v, correct) do { \
40 if ((v) != (correct)) { \
41 printf("(%s) Incorrect value %s=%d - should be %d\n", \
42 __location__, #v, v, correct); \
47 #define CHECK_VALUE_UINT64(v, correct) do { \
48 if ((v) != (correct)) { \
49 printf("(%s) Incorrect value %s=%llu - should be %llu\n", \
50 __location__, #v, v, correct); \
55 #define CHECK_VALUE_STRING(v, correct) do { \
56 if ( ((!v) && (correct)) || \
57 ((v) && (!correct)) || \
58 ((v) && (correct) && strcmp(v,correct) != 0)) { \
59 printf("(%s) Incorrect value %s='%s' - should be '%s'\n", \
60 __location__, #v, v, correct); \
65 #define _NBT_NAME(n,t,s) {\
71 static const char *wrepl_name_type_string(enum wrepl_name_type type)
74 case WREPL_TYPE_UNIQUE: return "UNIQUE";
75 case WREPL_TYPE_GROUP: return "GROUP";
76 case WREPL_TYPE_SGROUP: return "SGROUP";
77 case WREPL_TYPE_MHOMED: return "MHOMED";
79 return "UNKNOWN_TYPE";
82 static const char *wrepl_name_state_string(enum wrepl_name_state state)
85 case WREPL_STATE_ACTIVE: return "ACTIVE";
86 case WREPL_STATE_RELEASED: return "RELEASED";
87 case WREPL_STATE_TOMBSTONE: return "TOMBSTONE";
88 case WREPL_STATE_RESERVED: return "RESERVED";
90 return "UNKNOWN_STATE";
94 test how assoc_ctx's are only usable on the connection
97 static BOOL test_assoc_ctx1(TALLOC_CTX *mem_ctx, const char *address)
100 struct wrepl_request *req;
101 struct wrepl_socket *wrepl_socket1;
102 struct wrepl_associate associate1;
103 struct wrepl_socket *wrepl_socket2;
104 struct wrepl_associate associate2;
105 struct wrepl_pull_table pull_table;
106 struct wrepl_packet *rep_packet;
107 struct wrepl_associate_stop assoc_stop;
110 if (!lp_parm_bool(-1, "torture", "dangerous", False)) {
111 printf("winsrepl: cross connection assoc_ctx usage disabled - enable dangerous tests to use\n");
115 printf("Test if assoc_ctx is only valid on the conection it was created on\n");
117 wrepl_socket1 = wrepl_socket_init(mem_ctx, NULL);
118 wrepl_socket2 = wrepl_socket_init(mem_ctx, NULL);
120 printf("Setup 2 wrepl connections\n");
121 status = wrepl_connect(wrepl_socket1, NULL, address);
122 CHECK_STATUS(status, NT_STATUS_OK);
124 status = wrepl_connect(wrepl_socket2, NULL, address);
125 CHECK_STATUS(status, NT_STATUS_OK);
127 printf("Send a start association request (conn1)\n");
128 status = wrepl_associate(wrepl_socket1, &associate1);
129 CHECK_STATUS(status, NT_STATUS_OK);
131 printf("association context (conn1): 0x%x\n", associate1.out.assoc_ctx);
133 printf("Send a start association request (conn2)\n");
134 status = wrepl_associate(wrepl_socket2, &associate2);
135 CHECK_STATUS(status, NT_STATUS_OK);
137 printf("association context (conn2): 0x%x\n", associate2.out.assoc_ctx);
139 printf("Send a replication table query, with assoc 1 (conn2), the anwser should be on conn1\n");
140 pull_table.in.assoc_ctx = associate1.out.assoc_ctx;
141 req = wrepl_pull_table_send(wrepl_socket2, &pull_table);
142 req->send_only = True;
143 status = wrepl_request_recv(req, mem_ctx, &rep_packet);
144 CHECK_STATUS(status, NT_STATUS_OK);
146 printf("Send a association request (conn2), to make sure the last request was ignored\n");
147 status = wrepl_associate(wrepl_socket2, &associate2);
148 CHECK_STATUS(status, NT_STATUS_OK);
150 printf("Send a replication table query, with invalid assoc (conn1), receive answer from conn2\n");
151 pull_table.in.assoc_ctx = 0;
152 req = wrepl_pull_table_send(wrepl_socket1, &pull_table);
153 status = wrepl_request_recv(req, mem_ctx, &rep_packet);
154 CHECK_STATUS(status, NT_STATUS_OK);
156 printf("Send a association request (conn1), to make sure the last request was handled correct\n");
157 status = wrepl_associate(wrepl_socket1, &associate2);
158 CHECK_STATUS(status, NT_STATUS_OK);
160 assoc_stop.in.assoc_ctx = associate1.out.assoc_ctx;
161 assoc_stop.in.reason = 4;
162 printf("Send a association stop request (conn1), reson: %u\n", assoc_stop.in.reason);
163 status = wrepl_associate_stop(wrepl_socket1, &assoc_stop);
164 CHECK_STATUS(status, NT_STATUS_END_OF_FILE);
166 assoc_stop.in.assoc_ctx = associate2.out.assoc_ctx;
167 assoc_stop.in.reason = 0;
168 printf("Send a association stop request (conn2), reson: %u\n", assoc_stop.in.reason);
169 status = wrepl_associate_stop(wrepl_socket2, &assoc_stop);
170 CHECK_STATUS(status, NT_STATUS_OK);
173 printf("Close 2 wrepl connections\n");
174 talloc_free(wrepl_socket1);
175 talloc_free(wrepl_socket2);
180 test if we always get back the same assoc_ctx
182 static BOOL test_assoc_ctx2(TALLOC_CTX *mem_ctx, const char *address)
185 struct wrepl_socket *wrepl_socket;
186 struct wrepl_associate associate;
190 printf("Test if we always get back the same assoc_ctx\n");
192 wrepl_socket = wrepl_socket_init(mem_ctx, NULL);
194 printf("Setup wrepl connections\n");
195 status = wrepl_connect(wrepl_socket, NULL, address);
196 CHECK_STATUS(status, NT_STATUS_OK);
199 printf("Send 1st start association request\n");
200 status = wrepl_associate(wrepl_socket, &associate);
201 CHECK_STATUS(status, NT_STATUS_OK);
202 assoc_ctx1 = associate.out.assoc_ctx;
203 printf("1st association context: 0x%x\n", associate.out.assoc_ctx);
205 printf("Send 2nd start association request\n");
206 status = wrepl_associate(wrepl_socket, &associate);
207 CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1);
208 CHECK_STATUS(status, NT_STATUS_OK);
209 printf("2nd association context: 0x%x\n", associate.out.assoc_ctx);
211 printf("Send 3rd start association request\n");
212 status = wrepl_associate(wrepl_socket, &associate);
213 CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1);
214 CHECK_STATUS(status, NT_STATUS_OK);
215 printf("3rd association context: 0x%x\n", associate.out.assoc_ctx);
218 printf("Close wrepl connections\n");
219 talloc_free(wrepl_socket);
225 display a replication entry
227 static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_name *name)
231 printf("%s\n", nbt_name_string(mem_ctx, &name->name));
232 printf("\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n",
233 name->type, name->state, name->node, name->is_static, name->version_id);
234 printf("\tRAW_FLAGS: 0x%08X OWNER: %-15s\n",
235 name->raw_flags, name->owner);
236 for (i=0;i<name->num_addresses;i++) {
237 printf("\tADDR: %-15s OWNER: %-15s\n",
238 name->addresses[i].address, name->addresses[i].owner);
243 test a full replication dump from a WINS server
245 static BOOL test_wins_replication(TALLOC_CTX *mem_ctx, const char *address)
248 struct wrepl_socket *wrepl_socket;
251 struct wrepl_associate associate;
252 struct wrepl_pull_table pull_table;
253 struct wrepl_pull_names pull_names;
255 printf("Test one pull replication cycle\n");
257 wrepl_socket = wrepl_socket_init(mem_ctx, NULL);
259 printf("Setup wrepl connections\n");
260 status = wrepl_connect(wrepl_socket, NULL, address);
261 CHECK_STATUS(status, NT_STATUS_OK);
263 printf("Send a start association request\n");
265 status = wrepl_associate(wrepl_socket, &associate);
266 CHECK_STATUS(status, NT_STATUS_OK);
268 printf("association context: 0x%x\n", associate.out.assoc_ctx);
270 printf("Send a replication table query\n");
271 pull_table.in.assoc_ctx = associate.out.assoc_ctx;
273 status = wrepl_pull_table(wrepl_socket, mem_ctx, &pull_table);
274 if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) {
275 struct wrepl_packet packet;
276 struct wrepl_request *req;
279 packet.opcode = WREPL_OPCODE_BITS;
280 packet.assoc_ctx = associate.out.assoc_ctx;
281 packet.mess_type = WREPL_STOP_ASSOCIATION;
282 packet.message.stop.reason = 0;
284 req = wrepl_request_send(wrepl_socket, &packet);
287 printf("failed - We are not a valid pull partner for the server\n");
291 CHECK_STATUS(status, NT_STATUS_OK);
293 printf("Found %d replication partners\n", pull_table.out.num_partners);
295 for (i=0;i<pull_table.out.num_partners;i++) {
296 struct wrepl_wins_owner *partner = &pull_table.out.partners[i];
297 printf("%s max_version=%6llu min_version=%6llu type=%d\n",
299 partner->max_version,
300 partner->min_version,
303 pull_names.in.assoc_ctx = associate.out.assoc_ctx;
304 pull_names.in.partner = *partner;
306 status = wrepl_pull_names(wrepl_socket, mem_ctx, &pull_names);
307 CHECK_STATUS(status, NT_STATUS_OK);
309 printf("Received %d names\n", pull_names.out.num_names);
311 for (j=0;j<pull_names.out.num_names;j++) {
312 display_entry(mem_ctx, &pull_names.out.names[j]);
317 printf("Close wrepl connections\n");
318 talloc_free(wrepl_socket);
322 struct test_wrepl_conflict_conn {
324 struct wrepl_socket *pull;
327 #define TEST_OWNER_A_ADDRESS "127.65.65.1"
328 #define TEST_ADDRESS_A_PREFIX "127.0.65"
329 #define TEST_OWNER_B_ADDRESS "127.66.66.1"
330 #define TEST_ADDRESS_B_PREFIX "127.0.66"
331 #define TEST_OWNER_X_ADDRESS "127.88.88.1"
332 #define TEST_ADDRESS_X_PREFIX "127.0.88"
334 struct wrepl_wins_owner a, b, c, x;
338 struct nbt_name_socket *nbtsock;
339 struct nbt_name_socket *nbtsock2;
341 struct nbt_name_socket *nbtsock_srv;
342 struct nbt_name_socket *nbtsock_srv2;
344 uint32_t addresses_best_num;
345 struct wrepl_ip *addresses_best;
347 uint32_t addresses_best2_num;
348 struct wrepl_ip *addresses_best2;
350 uint32_t addresses_all_num;
351 struct wrepl_ip *addresses_all;
353 uint32_t addresses_mhomed_num;
354 struct wrepl_ip *addresses_mhomed;
357 static const struct wrepl_ip addresses_A_1[] = {
359 .owner = TEST_OWNER_A_ADDRESS,
360 .ip = TEST_ADDRESS_A_PREFIX".1"
363 static const struct wrepl_ip addresses_A_2[] = {
365 .owner = TEST_OWNER_A_ADDRESS,
366 .ip = TEST_ADDRESS_A_PREFIX".2"
369 static const struct wrepl_ip addresses_A_3_4[] = {
371 .owner = TEST_OWNER_A_ADDRESS,
372 .ip = TEST_ADDRESS_A_PREFIX".3"
375 .owner = TEST_OWNER_A_ADDRESS,
376 .ip = TEST_ADDRESS_A_PREFIX".4"
379 static const struct wrepl_ip addresses_A_3_4_X_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 .owner = TEST_OWNER_X_ADDRESS,
390 .ip = TEST_ADDRESS_X_PREFIX".3"
393 .owner = TEST_OWNER_X_ADDRESS,
394 .ip = TEST_ADDRESS_X_PREFIX".4"
397 static const struct wrepl_ip addresses_A_3_4_OWNER_B[] = {
399 .owner = TEST_OWNER_B_ADDRESS,
400 .ip = TEST_ADDRESS_A_PREFIX".3"
403 .owner = TEST_OWNER_B_ADDRESS,
404 .ip = TEST_ADDRESS_A_PREFIX".4"
407 static const struct wrepl_ip addresses_A_3_4_X_3_4_OWNER_B[] = {
409 .owner = TEST_OWNER_B_ADDRESS,
410 .ip = TEST_ADDRESS_A_PREFIX".3"
413 .owner = TEST_OWNER_B_ADDRESS,
414 .ip = TEST_ADDRESS_A_PREFIX".4"
417 .owner = TEST_OWNER_B_ADDRESS,
418 .ip = TEST_ADDRESS_X_PREFIX".3"
421 .owner = TEST_OWNER_B_ADDRESS,
422 .ip = TEST_ADDRESS_X_PREFIX".4"
426 static const struct wrepl_ip addresses_A_3_4_X_1_2[] = {
428 .owner = TEST_OWNER_A_ADDRESS,
429 .ip = TEST_ADDRESS_A_PREFIX".3"
432 .owner = TEST_OWNER_A_ADDRESS,
433 .ip = TEST_ADDRESS_A_PREFIX".4"
436 .owner = TEST_OWNER_X_ADDRESS,
437 .ip = TEST_ADDRESS_X_PREFIX".1"
440 .owner = TEST_OWNER_X_ADDRESS,
441 .ip = TEST_ADDRESS_X_PREFIX".2"
445 static const struct wrepl_ip addresses_B_1[] = {
447 .owner = TEST_OWNER_B_ADDRESS,
448 .ip = TEST_ADDRESS_B_PREFIX".1"
451 static const struct wrepl_ip addresses_B_2[] = {
453 .owner = TEST_OWNER_B_ADDRESS,
454 .ip = TEST_ADDRESS_B_PREFIX".2"
457 static const struct wrepl_ip addresses_B_3_4[] = {
459 .owner = TEST_OWNER_B_ADDRESS,
460 .ip = TEST_ADDRESS_B_PREFIX".3"
463 .owner = TEST_OWNER_B_ADDRESS,
464 .ip = TEST_ADDRESS_B_PREFIX".4"
467 static const struct wrepl_ip addresses_B_3_4_X_3_4[] = {
469 .owner = TEST_OWNER_B_ADDRESS,
470 .ip = TEST_ADDRESS_B_PREFIX".3"
473 .owner = TEST_OWNER_B_ADDRESS,
474 .ip = TEST_ADDRESS_B_PREFIX".4"
477 .owner = TEST_OWNER_X_ADDRESS,
478 .ip = TEST_ADDRESS_X_PREFIX".3"
481 .owner = TEST_OWNER_X_ADDRESS,
482 .ip = TEST_ADDRESS_X_PREFIX".4"
485 static const struct wrepl_ip addresses_B_3_4_X_1_2[] = {
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 .owner = TEST_OWNER_X_ADDRESS,
496 .ip = TEST_ADDRESS_X_PREFIX".1"
499 .owner = TEST_OWNER_X_ADDRESS,
500 .ip = TEST_ADDRESS_X_PREFIX".2"
504 static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem_ctx,
507 struct test_wrepl_conflict_conn *ctx;
508 struct wrepl_associate associate;
509 struct wrepl_pull_table pull_table;
513 ctx = talloc_zero(mem_ctx, struct test_wrepl_conflict_conn);
514 if (!ctx) return NULL;
516 ctx->address = address;
517 ctx->pull = wrepl_socket_init(ctx, NULL);
518 if (!ctx->pull) return NULL;
520 printf("Setup wrepl conflict pull connection\n");
521 status = wrepl_connect(ctx->pull, NULL, ctx->address);
522 if (!NT_STATUS_IS_OK(status)) return NULL;
524 status = wrepl_associate(ctx->pull, &associate);
525 if (!NT_STATUS_IS_OK(status)) return NULL;
527 ctx->pull_assoc = associate.out.assoc_ctx;
529 ctx->a.address = TEST_OWNER_A_ADDRESS;
530 ctx->a.max_version = 0;
531 ctx->a.min_version = 0;
534 ctx->b.address = TEST_OWNER_B_ADDRESS;
535 ctx->b.max_version = 0;
536 ctx->b.min_version = 0;
539 ctx->x.address = TEST_OWNER_X_ADDRESS;
540 ctx->x.max_version = 0;
541 ctx->x.min_version = 0;
544 ctx->c.address = address;
545 ctx->c.max_version = 0;
546 ctx->c.min_version = 0;
549 pull_table.in.assoc_ctx = ctx->pull_assoc;
550 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
551 if (!NT_STATUS_IS_OK(status)) return NULL;
553 for (i=0; i < pull_table.out.num_partners; i++) {
554 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
555 ctx->a.max_version = pull_table.out.partners[i].max_version;
556 ctx->a.min_version = pull_table.out.partners[i].min_version;
558 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
559 ctx->b.max_version = pull_table.out.partners[i].max_version;
560 ctx->b.min_version = pull_table.out.partners[i].min_version;
562 if (strcmp(TEST_OWNER_X_ADDRESS,pull_table.out.partners[i].address)==0) {
563 ctx->x.max_version = pull_table.out.partners[i].max_version;
564 ctx->x.min_version = pull_table.out.partners[i].min_version;
566 if (strcmp(address,pull_table.out.partners[i].address)==0) {
567 ctx->c.max_version = pull_table.out.partners[i].max_version;
568 ctx->c.min_version = pull_table.out.partners[i].min_version;
572 talloc_free(pull_table.out.partners);
574 ctx->myaddr = talloc_strdup(mem_ctx, iface_best_ip(address));
575 if (!ctx->myaddr) return NULL;
577 for (i = 0; i < iface_count(); i++) {
578 if (strcmp(ctx->myaddr, iface_n_ip(i)) == 0) continue;
579 ctx->myaddr2 = talloc_strdup(mem_ctx, iface_n_ip(i));
580 if (!ctx->myaddr2) return NULL;
584 ctx->nbtsock = nbt_name_socket_init(ctx, NULL);
585 if (!ctx->nbtsock) return NULL;
587 status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0, 0);
588 if (!NT_STATUS_IS_OK(status)) return NULL;
590 ctx->nbtsock_srv = nbt_name_socket_init(ctx, NULL);
591 if (!ctx->nbtsock_srv) return NULL;
593 status = socket_listen(ctx->nbtsock_srv->sock, ctx->myaddr, lp_nbt_port(), 0, 0);
594 if (!NT_STATUS_IS_OK(status)) {
595 talloc_free(ctx->nbtsock_srv);
596 ctx->nbtsock_srv = NULL;
599 if (ctx->myaddr2 && ctx->nbtsock_srv) {
600 ctx->nbtsock2 = nbt_name_socket_init(ctx, NULL);
601 if (!ctx->nbtsock2) return NULL;
603 status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0, 0);
604 if (!NT_STATUS_IS_OK(status)) return NULL;
606 ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx);
607 if (!ctx->nbtsock_srv2) return NULL;
609 status = socket_listen(ctx->nbtsock_srv2->sock, ctx->myaddr2, lp_nbt_port(), 0, 0);
610 if (!NT_STATUS_IS_OK(status)) {
611 talloc_free(ctx->nbtsock_srv2);
612 ctx->nbtsock_srv2 = NULL;
616 ctx->addresses_best_num = 1;
617 ctx->addresses_best = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best_num);
618 if (!ctx->addresses_best) return NULL;
619 ctx->addresses_best[0].owner = ctx->b.address;
620 ctx->addresses_best[0].ip = ctx->myaddr;
622 ctx->addresses_all_num = iface_count();
623 ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num);
624 if (!ctx->addresses_all) return NULL;
625 for (i=0; i < ctx->addresses_all_num; i++) {
626 ctx->addresses_all[i].owner = ctx->b.address;
627 ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(i));
628 if (!ctx->addresses_all[i].ip) return NULL;
631 if (ctx->nbtsock_srv2) {
632 ctx->addresses_best2_num = 1;
633 ctx->addresses_best2 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best2_num);
634 if (!ctx->addresses_best2) return NULL;
635 ctx->addresses_best2[0].owner = ctx->b.address;
636 ctx->addresses_best2[0].ip = ctx->myaddr2;
638 ctx->addresses_mhomed_num = 2;
639 ctx->addresses_mhomed = talloc_array(ctx, struct wrepl_ip, ctx->addresses_mhomed_num);
640 if (!ctx->addresses_mhomed) return NULL;
641 ctx->addresses_mhomed[0].owner = ctx->b.address;
642 ctx->addresses_mhomed[0].ip = ctx->myaddr;
643 ctx->addresses_mhomed[1].owner = ctx->b.address;
644 ctx->addresses_mhomed[1].ip = ctx->myaddr2;
650 static BOOL test_wrepl_update_one(struct test_wrepl_conflict_conn *ctx,
651 const struct wrepl_wins_owner *owner,
652 const struct wrepl_wins_name *name)
655 struct wrepl_socket *wrepl_socket;
656 struct wrepl_associate associate;
657 struct wrepl_packet update_packet, repl_send;
658 struct wrepl_table *update;
659 struct wrepl_wins_owner wrepl_wins_owners[1];
660 struct wrepl_packet *repl_recv;
661 struct wrepl_wins_owner *send_request;
662 struct wrepl_send_reply *send_reply;
663 struct wrepl_wins_name wrepl_wins_names[1];
667 wrepl_socket = wrepl_socket_init(ctx, NULL);
669 status = wrepl_connect(wrepl_socket, NULL, ctx->address);
670 CHECK_STATUS(status, NT_STATUS_OK);
672 status = wrepl_associate(wrepl_socket, &associate);
673 CHECK_STATUS(status, NT_STATUS_OK);
674 assoc_ctx = associate.out.assoc_ctx;
676 /* now send a WREPL_REPL_UPDATE message */
677 ZERO_STRUCT(update_packet);
678 update_packet.opcode = WREPL_OPCODE_BITS;
679 update_packet.assoc_ctx = assoc_ctx;
680 update_packet.mess_type = WREPL_REPLICATION;
681 update_packet.message.replication.command = WREPL_REPL_UPDATE;
682 update = &update_packet.message.replication.info.table;
684 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
685 update->partners = wrepl_wins_owners;
686 update->initiator = "0.0.0.0";
688 wrepl_wins_owners[0] = *owner;
690 status = wrepl_request(wrepl_socket, wrepl_socket,
691 &update_packet, &repl_recv);
692 CHECK_STATUS(status, NT_STATUS_OK);
693 CHECK_VALUE(repl_recv->mess_type, WREPL_REPLICATION);
694 CHECK_VALUE(repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
695 send_request = &repl_recv->message.replication.info.owner;
697 ZERO_STRUCT(repl_send);
698 repl_send.opcode = WREPL_OPCODE_BITS;
699 repl_send.assoc_ctx = assoc_ctx;
700 repl_send.mess_type = WREPL_REPLICATION;
701 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
702 send_reply = &repl_send.message.replication.info.reply;
704 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
705 send_reply->names = wrepl_wins_names;
707 wrepl_wins_names[0] = *name;
709 status = wrepl_request(wrepl_socket, wrepl_socket,
710 &repl_send, &repl_recv);
711 CHECK_STATUS(status, NT_STATUS_OK);
712 CHECK_VALUE(repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
713 CHECK_VALUE(repl_recv->message.stop.reason, 0);
716 talloc_free(wrepl_socket);
720 static BOOL test_wrepl_is_applied(struct test_wrepl_conflict_conn *ctx,
721 const struct wrepl_wins_owner *owner,
722 const struct wrepl_wins_name *name,
727 struct wrepl_pull_names pull_names;
728 struct wrepl_name *names;
730 pull_names.in.assoc_ctx = ctx->pull_assoc;
731 pull_names.in.partner = *owner;
732 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
734 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
735 CHECK_STATUS(status, NT_STATUS_OK);
736 CHECK_VALUE(pull_names.out.num_names, (expected?1:0));
738 names = pull_names.out.names;
741 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
745 CHECK_VALUE(names[0].name.type, name->name->type);
746 CHECK_VALUE_STRING(names[0].name.name, name->name->name);
747 CHECK_VALUE_STRING(names[0].name.scope, name->name->scope);
748 CHECK_VALUE(flags, name->flags);
749 CHECK_VALUE_UINT64(names[0].version_id, name->id);
752 CHECK_VALUE(names[0].num_addresses,
753 name->addresses.addresses.num_ips);
755 CHECK_VALUE(names[0].num_addresses, 1);
756 CHECK_VALUE_STRING(names[0].addresses[0].address,
761 talloc_free(pull_names.out.names);
765 static BOOL test_wrepl_mhomed_merged(struct test_wrepl_conflict_conn *ctx,
766 const struct wrepl_wins_owner *owner1,
767 uint32_t num_ips1, const struct wrepl_ip *ips1,
768 const struct wrepl_wins_owner *owner2,
769 uint32_t num_ips2, const struct wrepl_ip *ips2,
770 const struct wrepl_wins_name *name2)
774 struct wrepl_pull_names pull_names;
775 struct wrepl_name *names;
778 uint32_t num_ips = num_ips1 + num_ips2;
780 for (i = 0; i < num_ips2; i++) {
781 for (j = 0; j < num_ips1; j++) {
782 if (strcmp(ips2[i].ip,ips1[j].ip) == 0) {
789 pull_names.in.assoc_ctx = ctx->pull_assoc;
790 pull_names.in.partner = *owner2;
791 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
793 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
794 CHECK_STATUS(status, NT_STATUS_OK);
795 CHECK_VALUE(pull_names.out.num_names, 1);
797 names = pull_names.out.names;
799 flags = WREPL_NAME_FLAGS(names[0].type,
803 CHECK_VALUE(names[0].name.type, name2->name->type);
804 CHECK_VALUE_STRING(names[0].name.name, name2->name->name);
805 CHECK_VALUE_STRING(names[0].name.scope, name2->name->scope);
806 CHECK_VALUE(flags, name2->flags | WREPL_TYPE_MHOMED);
807 CHECK_VALUE_UINT64(names[0].version_id, name2->id);
809 CHECK_VALUE(names[0].num_addresses, num_ips);
811 for (i = 0; i < names[0].num_addresses; i++) {
812 const char *addr = names[0].addresses[i].address;
813 const char *owner = names[0].addresses[i].owner;
816 for (j = 0; j < num_ips2; j++) {
817 if (strcmp(addr, ips2[j].ip) == 0) {
819 CHECK_VALUE_STRING(owner, owner2->address);
826 for (j = 0; j < num_ips1; j++) {
827 if (strcmp(addr, ips1[j].ip) == 0) {
829 CHECK_VALUE_STRING(owner, owner1->address);
836 CHECK_VALUE_STRING(addr, "not found in address list");
839 talloc_free(pull_names.out.names);
843 static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx,
844 struct wrepl_wins_owner *merge_owner,
845 struct wrepl_wins_owner *owner1,
846 uint32_t num_ips1, const struct wrepl_ip *ips1,
847 struct wrepl_wins_owner *owner2,
848 uint32_t num_ips2, const struct wrepl_ip *ips2,
849 const struct wrepl_wins_name *name2)
853 struct wrepl_pull_names pull_names;
854 struct wrepl_name *names;
855 struct wrepl_name *name = NULL;
858 uint32_t num_ips = num_ips1 + num_ips2;
861 merge_owner = &ctx->c;
864 for (i = 0; i < num_ips1; i++) {
865 if (owner1 != &ctx->c && strcmp(ips1[i].owner,owner2->address) == 0) {
869 for (j = 0; j < num_ips2; j++) {
870 if (strcmp(ips1[i].ip,ips2[j].ip) == 0) {
878 pull_names.in.assoc_ctx = ctx->pull_assoc;
879 pull_names.in.partner = *merge_owner;
880 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
881 pull_names.in.partner.max_version = 0;
883 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
884 CHECK_STATUS(status, NT_STATUS_OK);
886 names = pull_names.out.names;
888 for (i = 0; i < pull_names.out.num_names; i++) {
889 if (names[i].name.type != name2->name->type) continue;
890 if (!names[i].name.name) continue;
891 if (strcmp(names[i].name.name, name2->name->name) != 0) continue;
892 if (names[i].name.scope) continue;
897 if (pull_names.out.num_names > 0) {
898 merge_owner->max_version = names[pull_names.out.num_names-1].version_id;
902 printf("%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name));
906 flags = WREPL_NAME_FLAGS(name->type,
910 CHECK_VALUE(name->name.type, name2->name->type);
911 CHECK_VALUE_STRING(name->name.name, name2->name->name);
912 CHECK_VALUE_STRING(name->name.scope, name2->name->scope);
913 CHECK_VALUE(flags, name2->flags);
915 CHECK_VALUE(name->num_addresses, num_ips);
917 for (i = 0; i < name->num_addresses; i++) {
918 const char *addr = name->addresses[i].address;
919 const char *owner = name->addresses[i].owner;
922 for (j = 0; j < num_ips2; j++) {
923 if (strcmp(addr, ips2[j].ip) == 0) {
925 CHECK_VALUE_STRING(owner, ips2[j].owner);
932 for (j = 0; j < num_ips1; j++) {
933 if (strcmp(addr, ips1[j].ip) == 0) {
935 if (owner1 == &ctx->c) {
936 CHECK_VALUE_STRING(owner, owner1->address);
938 CHECK_VALUE_STRING(owner, ips1[j].owner);
946 CHECK_VALUE_STRING(addr, "not found in address list");
949 talloc_free(pull_names.out.names);
953 static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx)
956 struct nbt_name name;
957 struct wrepl_wins_name wins_name1;
958 struct wrepl_wins_name wins_name2;
959 struct wrepl_wins_name *wins_name_tmp;
960 struct wrepl_wins_name *wins_name_last;
961 struct wrepl_wins_name *wins_name_cur;
963 uint8_t types[] = { 0x00, 0x1C };
965 enum wrepl_name_type type;
966 enum wrepl_name_state state;
967 enum wrepl_name_node node;
970 const struct wrepl_ip *ips;
973 .type = WREPL_TYPE_GROUP,
974 .state = WREPL_STATE_ACTIVE,
975 .node = WREPL_NODE_B,
977 .num_ips = ARRAY_SIZE(addresses_A_1),
978 .ips = addresses_A_1,
980 .type = WREPL_TYPE_UNIQUE,
981 .state = WREPL_STATE_ACTIVE,
982 .node = WREPL_NODE_B,
984 .num_ips = ARRAY_SIZE(addresses_A_1),
985 .ips = addresses_A_1,
987 .type = WREPL_TYPE_UNIQUE,
988 .state = WREPL_STATE_ACTIVE,
989 .node = WREPL_NODE_B,
991 .num_ips = ARRAY_SIZE(addresses_A_2),
992 .ips = addresses_A_2,
994 .type = WREPL_TYPE_UNIQUE,
995 .state = WREPL_STATE_ACTIVE,
996 .node = WREPL_NODE_B,
998 .num_ips = ARRAY_SIZE(addresses_A_1),
999 .ips = addresses_A_1,
1001 .type = WREPL_TYPE_UNIQUE,
1002 .state = WREPL_STATE_ACTIVE,
1003 .node = WREPL_NODE_B,
1005 .num_ips = ARRAY_SIZE(addresses_A_2),
1006 .ips = addresses_A_2,
1008 .type = WREPL_TYPE_SGROUP,
1009 .state = WREPL_STATE_TOMBSTONE,
1010 .node = WREPL_NODE_B,
1012 .num_ips = ARRAY_SIZE(addresses_A_2),
1013 .ips = addresses_A_2,
1015 .type = WREPL_TYPE_MHOMED,
1016 .state = WREPL_STATE_TOMBSTONE,
1017 .node = WREPL_NODE_B,
1019 .num_ips = ARRAY_SIZE(addresses_A_1),
1020 .ips = addresses_A_1,
1022 .type = WREPL_TYPE_MHOMED,
1023 .state = WREPL_STATE_RELEASED,
1024 .node = WREPL_NODE_B,
1026 .num_ips = ARRAY_SIZE(addresses_A_2),
1027 .ips = addresses_A_2,
1029 .type = WREPL_TYPE_SGROUP,
1030 .state = WREPL_STATE_ACTIVE,
1031 .node = WREPL_NODE_B,
1033 .num_ips = ARRAY_SIZE(addresses_A_1),
1034 .ips = addresses_A_1,
1036 .type = WREPL_TYPE_SGROUP,
1037 .state = WREPL_STATE_ACTIVE,
1038 .node = WREPL_NODE_B,
1040 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1041 .ips = addresses_A_3_4,
1043 .type = WREPL_TYPE_SGROUP,
1044 .state = WREPL_STATE_TOMBSTONE,
1045 .node = WREPL_NODE_B,
1047 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1048 .ips = addresses_B_3_4,
1050 /* the last one should always be a unique,tomstone record! */
1051 .type = WREPL_TYPE_UNIQUE,
1052 .state = WREPL_STATE_TOMBSTONE,
1053 .node = WREPL_NODE_B,
1055 .num_ips = ARRAY_SIZE(addresses_A_1),
1056 .ips = addresses_A_1,
1060 if (!ctx) return False;
1062 name.name = "_SAME_OWNER_A";
1066 wins_name_tmp = NULL;
1067 wins_name_last = &wins_name2;
1068 wins_name_cur = &wins_name1;
1070 for (j=0; ret && j < ARRAY_SIZE(types); j++) {
1071 name.type = types[j];
1072 printf("Test Replica Conflicts with same owner[%s] for %s\n",
1073 nbt_name_string(ctx, &name), ctx->a.address);
1075 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
1076 wins_name_tmp = wins_name_last;
1077 wins_name_last = wins_name_cur;
1078 wins_name_cur = wins_name_tmp;
1081 printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
1082 wrepl_name_type_string(records[i-1].type),
1083 wrepl_name_state_string(records[i-1].state),
1084 (records[i-1].is_static?",static":""),
1085 wrepl_name_type_string(records[i].type),
1086 wrepl_name_state_string(records[i].state),
1087 (records[i].is_static?",static":""),
1088 (records[i-1].ips==records[i].ips?"same":"different"),
1092 wins_name_cur->name = &name;
1093 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
1096 records[i].is_static);
1097 wins_name_cur->id = ++ctx->a.max_version;
1098 if (wins_name_cur->flags & 2) {
1099 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
1100 wins_name_cur->addresses.addresses.ips = discard_const(records[i].ips);
1102 wins_name_cur->addresses.ip = records[i].ips[0].ip;
1104 wins_name_cur->unknown = "255.255.255.255";
1106 ret &= test_wrepl_update_one(ctx, &ctx->a,wins_name_cur);
1107 if (records[i].state == WREPL_STATE_RELEASED) {
1108 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_last, False);
1109 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, False);
1111 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, True);
1114 /* the first one is a cleanup run */
1115 if (!ret && i == 0) ret = True;
1118 printf("conflict handled wrong or record[%u]: %s\n", i, __location__);
1126 static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx)
1129 struct wrepl_wins_name wins_name1;
1130 struct wrepl_wins_name wins_name2;
1131 struct wrepl_wins_name *wins_name_r1;
1132 struct wrepl_wins_name *wins_name_r2;
1135 const char *line; /* just better debugging */
1136 struct nbt_name name;
1137 const char *comment;
1138 BOOL extra; /* not the worst case, this is an extra test */
1141 struct wrepl_wins_owner *owner;
1142 enum wrepl_name_type type;
1143 enum wrepl_name_state state;
1144 enum wrepl_name_node node;
1147 const struct wrepl_ip *ips;
1148 BOOL apply_expected;
1150 struct wrepl_wins_owner *merge_owner;
1151 BOOL sgroup_cleanup;
1155 * NOTE: the first record and the last applied one
1156 * needs to be from the same owner,
1157 * to not conflict in the next smbtorture run!!!
1160 .line = __location__,
1161 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1165 .type = WREPL_TYPE_UNIQUE,
1166 .state = WREPL_STATE_TOMBSTONE,
1167 .node = WREPL_NODE_B,
1169 .num_ips = ARRAY_SIZE(addresses_B_1),
1170 .ips = addresses_B_1,
1171 .apply_expected = True /* ignored */
1175 .type = WREPL_TYPE_UNIQUE,
1176 .state = WREPL_STATE_TOMBSTONE,
1177 .node = WREPL_NODE_B,
1179 .num_ips = ARRAY_SIZE(addresses_A_1),
1180 .ips = addresses_A_1,
1181 .apply_expected = True /* ignored */
1186 * unique vs unique section
1189 * unique,active vs. unique,active
1190 * => should be replaced
1193 .line = __location__,
1194 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1197 .type = WREPL_TYPE_UNIQUE,
1198 .state = WREPL_STATE_ACTIVE,
1199 .node = WREPL_NODE_B,
1201 .num_ips = ARRAY_SIZE(addresses_A_1),
1202 .ips = addresses_A_1,
1203 .apply_expected = True
1207 .type = WREPL_TYPE_UNIQUE,
1208 .state = WREPL_STATE_ACTIVE,
1209 .node = WREPL_NODE_B,
1211 .num_ips = ARRAY_SIZE(addresses_B_1),
1212 .ips = addresses_B_1,
1213 .apply_expected = True
1218 * unique,active vs. unique,tombstone
1219 * => should NOT be replaced
1222 .line = __location__,
1223 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1226 .type = WREPL_TYPE_UNIQUE,
1227 .state = WREPL_STATE_ACTIVE,
1228 .node = WREPL_NODE_B,
1230 .num_ips = ARRAY_SIZE(addresses_B_1),
1231 .ips = addresses_B_1,
1232 .apply_expected = True
1236 .type = WREPL_TYPE_UNIQUE,
1237 .state = WREPL_STATE_TOMBSTONE,
1238 .node = WREPL_NODE_B,
1240 .num_ips = ARRAY_SIZE(addresses_B_1),
1241 .ips = addresses_B_1,
1242 .apply_expected = False
1247 * unique,released vs. unique,active
1248 * => should be replaced
1251 .line = __location__,
1252 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1255 .type = WREPL_TYPE_UNIQUE,
1256 .state = WREPL_STATE_RELEASED,
1257 .node = WREPL_NODE_B,
1259 .num_ips = ARRAY_SIZE(addresses_B_1),
1260 .ips = addresses_B_1,
1261 .apply_expected = False
1265 .type = WREPL_TYPE_UNIQUE,
1266 .state = WREPL_STATE_ACTIVE,
1267 .node = WREPL_NODE_B,
1269 .num_ips = ARRAY_SIZE(addresses_A_1),
1270 .ips = addresses_A_1,
1271 .apply_expected = True
1276 * unique,released vs. unique,tombstone
1277 * => should be replaced
1280 .line = __location__,
1281 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1284 .type = WREPL_TYPE_UNIQUE,
1285 .state = WREPL_STATE_RELEASED,
1286 .node = WREPL_NODE_B,
1288 .num_ips = ARRAY_SIZE(addresses_A_1),
1289 .ips = addresses_A_1,
1290 .apply_expected = False
1294 .type = WREPL_TYPE_UNIQUE,
1295 .state = WREPL_STATE_TOMBSTONE,
1296 .node = WREPL_NODE_B,
1298 .num_ips = ARRAY_SIZE(addresses_B_1),
1299 .ips = addresses_B_1,
1300 .apply_expected = True
1305 * unique,tombstone vs. unique,active
1306 * => should be replaced
1309 .line = __location__,
1310 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1313 .type = WREPL_TYPE_UNIQUE,
1314 .state = WREPL_STATE_TOMBSTONE,
1315 .node = WREPL_NODE_B,
1317 .num_ips = ARRAY_SIZE(addresses_B_1),
1318 .ips = addresses_B_1,
1319 .apply_expected = True
1323 .type = WREPL_TYPE_UNIQUE,
1324 .state = WREPL_STATE_ACTIVE,
1325 .node = WREPL_NODE_B,
1327 .num_ips = ARRAY_SIZE(addresses_A_1),
1328 .ips = addresses_A_1,
1329 .apply_expected = True
1334 * unique,tombstone vs. unique,tombstone
1335 * => should be replaced
1338 .line = __location__,
1339 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1342 .type = WREPL_TYPE_UNIQUE,
1343 .state = WREPL_STATE_TOMBSTONE,
1344 .node = WREPL_NODE_B,
1346 .num_ips = ARRAY_SIZE(addresses_A_1),
1347 .ips = addresses_A_1,
1348 .apply_expected = True
1352 .type = WREPL_TYPE_UNIQUE,
1353 .state = WREPL_STATE_TOMBSTONE,
1354 .node = WREPL_NODE_B,
1356 .num_ips = ARRAY_SIZE(addresses_B_1),
1357 .ips = addresses_B_1,
1358 .apply_expected = True
1364 * unique vs normal groups section,
1367 * unique,active vs. group,active
1368 * => should be replaced
1371 .line = __location__,
1372 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1375 .type = WREPL_TYPE_UNIQUE,
1376 .state = WREPL_STATE_ACTIVE,
1377 .node = WREPL_NODE_B,
1379 .num_ips = ARRAY_SIZE(addresses_B_1),
1380 .ips = addresses_B_1,
1381 .apply_expected = True
1385 .type = WREPL_TYPE_GROUP,
1386 .state = WREPL_STATE_ACTIVE,
1387 .node = WREPL_NODE_B,
1389 .num_ips = ARRAY_SIZE(addresses_A_1),
1390 .ips = addresses_A_1,
1391 .apply_expected = True
1396 * unique,active vs. group,tombstone
1397 * => should NOT be replaced
1400 .line = __location__,
1401 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1404 .type = WREPL_TYPE_UNIQUE,
1405 .state = WREPL_STATE_ACTIVE,
1406 .node = WREPL_NODE_B,
1408 .num_ips = ARRAY_SIZE(addresses_A_1),
1409 .ips = addresses_A_1,
1410 .apply_expected = True
1414 .type = WREPL_TYPE_GROUP,
1415 .state = WREPL_STATE_TOMBSTONE,
1416 .node = WREPL_NODE_B,
1418 .num_ips = ARRAY_SIZE(addresses_A_1),
1419 .ips = addresses_A_1,
1420 .apply_expected = False
1425 * unique,released vs. group,active
1426 * => should be replaced
1429 .line = __location__,
1430 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1433 .type = WREPL_TYPE_UNIQUE,
1434 .state = WREPL_STATE_RELEASED,
1435 .node = WREPL_NODE_B,
1437 .num_ips = ARRAY_SIZE(addresses_A_1),
1438 .ips = addresses_A_1,
1439 .apply_expected = False
1443 .type = WREPL_TYPE_GROUP,
1444 .state = WREPL_STATE_ACTIVE,
1445 .node = WREPL_NODE_B,
1447 .num_ips = ARRAY_SIZE(addresses_B_1),
1448 .ips = addresses_B_1,
1449 .apply_expected = True
1454 * unique,released vs. group,tombstone
1455 * => should be replaced
1458 .line = __location__,
1459 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1462 .type = WREPL_TYPE_UNIQUE,
1463 .state = WREPL_STATE_RELEASED,
1464 .node = WREPL_NODE_B,
1466 .num_ips = ARRAY_SIZE(addresses_B_1),
1467 .ips = addresses_B_1,
1468 .apply_expected = False
1472 .type = WREPL_TYPE_GROUP,
1473 .state = WREPL_STATE_TOMBSTONE,
1474 .node = WREPL_NODE_B,
1476 .num_ips = ARRAY_SIZE(addresses_A_1),
1477 .ips = addresses_A_1,
1478 .apply_expected = True
1483 * unique,tombstone vs. group,active
1484 * => should be replaced
1487 .line = __location__,
1488 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1491 .type = WREPL_TYPE_UNIQUE,
1492 .state = WREPL_STATE_TOMBSTONE,
1493 .node = WREPL_NODE_B,
1495 .num_ips = ARRAY_SIZE(addresses_A_1),
1496 .ips = addresses_A_1,
1497 .apply_expected = True
1501 .type = WREPL_TYPE_GROUP,
1502 .state = WREPL_STATE_ACTIVE,
1503 .node = WREPL_NODE_B,
1505 .num_ips = ARRAY_SIZE(addresses_B_1),
1506 .ips = addresses_B_1,
1507 .apply_expected = True
1512 * unique,tombstone vs. group,tombstone
1513 * => should be replaced
1516 .line = __location__,
1517 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1520 .type = WREPL_TYPE_UNIQUE,
1521 .state = WREPL_STATE_TOMBSTONE,
1522 .node = WREPL_NODE_B,
1524 .num_ips = ARRAY_SIZE(addresses_B_1),
1525 .ips = addresses_B_1,
1526 .apply_expected = True
1530 .type = WREPL_TYPE_GROUP,
1531 .state = WREPL_STATE_TOMBSTONE,
1532 .node = WREPL_NODE_B,
1534 .num_ips = ARRAY_SIZE(addresses_A_1),
1535 .ips = addresses_A_1,
1536 .apply_expected = True
1541 * unique vs special groups section,
1544 * unique,active vs. sgroup,active
1545 * => should NOT be replaced
1548 .line = __location__,
1549 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1552 .type = WREPL_TYPE_UNIQUE,
1553 .state = WREPL_STATE_ACTIVE,
1554 .node = WREPL_NODE_B,
1556 .num_ips = ARRAY_SIZE(addresses_A_1),
1557 .ips = addresses_A_1,
1558 .apply_expected = True
1562 .type = WREPL_TYPE_SGROUP,
1563 .state = WREPL_STATE_ACTIVE,
1564 .node = WREPL_NODE_B,
1566 .num_ips = ARRAY_SIZE(addresses_A_1),
1567 .ips = addresses_A_1,
1568 .apply_expected = False
1573 * unique,active vs. sgroup,tombstone
1574 * => should NOT be replaced
1577 .line = __location__,
1578 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1581 .type = WREPL_TYPE_UNIQUE,
1582 .state = WREPL_STATE_ACTIVE,
1583 .node = WREPL_NODE_B,
1585 .num_ips = ARRAY_SIZE(addresses_A_1),
1586 .ips = addresses_A_1,
1587 .apply_expected = True
1591 .type = WREPL_TYPE_SGROUP,
1592 .state = WREPL_STATE_TOMBSTONE,
1593 .node = WREPL_NODE_B,
1595 .num_ips = ARRAY_SIZE(addresses_A_1),
1596 .ips = addresses_A_1,
1597 .apply_expected = False
1602 * unique,released vs. sgroup,active
1603 * => should be replaced
1606 .line = __location__,
1607 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1610 .type = WREPL_TYPE_UNIQUE,
1611 .state = WREPL_STATE_RELEASED,
1612 .node = WREPL_NODE_B,
1614 .num_ips = ARRAY_SIZE(addresses_A_1),
1615 .ips = addresses_A_1,
1616 .apply_expected = False
1620 .type = WREPL_TYPE_SGROUP,
1621 .state = WREPL_STATE_ACTIVE,
1622 .node = WREPL_NODE_B,
1624 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1625 .ips = addresses_B_3_4,
1626 .apply_expected = True
1631 * unique,released vs. sgroup,tombstone
1632 * => should be replaced
1635 .line = __location__,
1636 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1639 .type = WREPL_TYPE_UNIQUE,
1640 .state = WREPL_STATE_RELEASED,
1641 .node = WREPL_NODE_B,
1643 .num_ips = ARRAY_SIZE(addresses_B_1),
1644 .ips = addresses_B_1,
1645 .apply_expected = False
1649 .type = WREPL_TYPE_SGROUP,
1650 .state = WREPL_STATE_TOMBSTONE,
1651 .node = WREPL_NODE_B,
1653 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1654 .ips = addresses_A_3_4,
1655 .apply_expected = True
1660 * unique,tombstone vs. sgroup,active
1661 * => should be replaced
1664 .line = __location__,
1665 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1668 .type = WREPL_TYPE_UNIQUE,
1669 .state = WREPL_STATE_TOMBSTONE,
1670 .node = WREPL_NODE_B,
1672 .num_ips = ARRAY_SIZE(addresses_A_1),
1673 .ips = addresses_A_1,
1674 .apply_expected = True
1678 .type = WREPL_TYPE_SGROUP,
1679 .state = WREPL_STATE_ACTIVE,
1680 .node = WREPL_NODE_B,
1682 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1683 .ips = addresses_B_3_4,
1684 .apply_expected = True
1689 * unique,tombstone vs. sgroup,tombstone
1690 * => should be replaced
1693 .line = __location__,
1694 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1697 .type = WREPL_TYPE_UNIQUE,
1698 .state = WREPL_STATE_TOMBSTONE,
1699 .node = WREPL_NODE_B,
1701 .num_ips = ARRAY_SIZE(addresses_B_1),
1702 .ips = addresses_B_1,
1703 .apply_expected = True
1707 .type = WREPL_TYPE_SGROUP,
1708 .state = WREPL_STATE_TOMBSTONE,
1709 .node = WREPL_NODE_B,
1711 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1712 .ips = addresses_A_3_4,
1713 .apply_expected = True
1718 * unique vs multi homed section,
1721 * unique,active vs. mhomed,active
1722 * => should be replaced
1725 .line = __location__,
1726 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1729 .type = WREPL_TYPE_UNIQUE,
1730 .state = WREPL_STATE_ACTIVE,
1731 .node = WREPL_NODE_B,
1733 .num_ips = ARRAY_SIZE(addresses_A_1),
1734 .ips = addresses_A_1,
1735 .apply_expected = True
1739 .type = WREPL_TYPE_MHOMED,
1740 .state = WREPL_STATE_ACTIVE,
1741 .node = WREPL_NODE_B,
1743 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1744 .ips = addresses_B_3_4,
1745 .apply_expected = True
1750 * unique,active vs. mhomed,tombstone
1751 * => should NOT be replaced
1754 .line = __location__,
1755 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1758 .type = WREPL_TYPE_UNIQUE,
1759 .state = WREPL_STATE_ACTIVE,
1760 .node = WREPL_NODE_B,
1762 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1763 .ips = addresses_B_3_4,
1764 .apply_expected = True
1768 .type = WREPL_TYPE_MHOMED,
1769 .state = WREPL_STATE_TOMBSTONE,
1770 .node = WREPL_NODE_B,
1772 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1773 .ips = addresses_B_3_4,
1774 .apply_expected = False
1779 * unique,released vs. mhomed,active
1780 * => should be replaced
1783 .line = __location__,
1784 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1787 .type = WREPL_TYPE_UNIQUE,
1788 .state = WREPL_STATE_RELEASED,
1789 .node = WREPL_NODE_B,
1791 .num_ips = ARRAY_SIZE(addresses_B_1),
1792 .ips = addresses_B_1,
1793 .apply_expected = False
1797 .type = WREPL_TYPE_MHOMED,
1798 .state = WREPL_STATE_ACTIVE,
1799 .node = WREPL_NODE_B,
1801 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1802 .ips = addresses_A_3_4,
1803 .apply_expected = True
1808 * unique,released vs. mhomed,tombstone
1809 * => should be replaced
1812 .line = __location__,
1813 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1816 .type = WREPL_TYPE_UNIQUE,
1817 .state = WREPL_STATE_RELEASED,
1818 .node = WREPL_NODE_B,
1820 .num_ips = ARRAY_SIZE(addresses_A_1),
1821 .ips = addresses_A_1,
1822 .apply_expected = False
1826 .type = WREPL_TYPE_MHOMED,
1827 .state = WREPL_STATE_TOMBSTONE,
1828 .node = WREPL_NODE_B,
1830 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1831 .ips = addresses_B_3_4,
1832 .apply_expected = True
1837 * unique,tombstone vs. mhomed,active
1838 * => should be replaced
1841 .line = __location__,
1842 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1845 .type = WREPL_TYPE_UNIQUE,
1846 .state = WREPL_STATE_TOMBSTONE,
1847 .node = WREPL_NODE_B,
1849 .num_ips = ARRAY_SIZE(addresses_B_1),
1850 .ips = addresses_B_1,
1851 .apply_expected = True
1855 .type = WREPL_TYPE_MHOMED,
1856 .state = WREPL_STATE_ACTIVE,
1857 .node = WREPL_NODE_B,
1859 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1860 .ips = addresses_A_3_4,
1861 .apply_expected = True
1866 * unique,tombstone vs. mhomed,tombstone
1867 * => should be replaced
1870 .line = __location__,
1871 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1874 .type = WREPL_TYPE_UNIQUE,
1875 .state = WREPL_STATE_TOMBSTONE,
1876 .node = WREPL_NODE_B,
1878 .num_ips = ARRAY_SIZE(addresses_A_1),
1879 .ips = addresses_A_1,
1880 .apply_expected = True
1884 .type = WREPL_TYPE_MHOMED,
1885 .state = WREPL_STATE_TOMBSTONE,
1886 .node = WREPL_NODE_B,
1888 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1889 .ips = addresses_B_3_4,
1890 .apply_expected = True
1895 * normal groups vs unique section,
1898 * group,active vs. unique,active
1899 * => should NOT be replaced
1902 .line = __location__,
1903 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1906 .type = WREPL_TYPE_GROUP,
1907 .state = WREPL_STATE_ACTIVE,
1908 .node = WREPL_NODE_B,
1910 .num_ips = ARRAY_SIZE(addresses_A_1),
1911 .ips = addresses_A_1,
1912 .apply_expected = True
1916 .type = WREPL_TYPE_UNIQUE,
1917 .state = WREPL_STATE_ACTIVE,
1918 .node = WREPL_NODE_B,
1920 .num_ips = ARRAY_SIZE(addresses_A_1),
1921 .ips = addresses_A_1,
1922 .apply_expected = False
1927 * group,active vs. unique,tombstone
1928 * => should NOT be replaced
1931 .line = __location__,
1932 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1935 .type = WREPL_TYPE_GROUP,
1936 .state = WREPL_STATE_ACTIVE,
1937 .node = WREPL_NODE_B,
1939 .num_ips = ARRAY_SIZE(addresses_A_1),
1940 .ips = addresses_A_1,
1941 .apply_expected = True
1945 .type = WREPL_TYPE_UNIQUE,
1946 .state = WREPL_STATE_TOMBSTONE,
1947 .node = WREPL_NODE_B,
1949 .num_ips = ARRAY_SIZE(addresses_A_1),
1950 .ips = addresses_A_1,
1951 .apply_expected = False
1956 * group,released vs. unique,active
1957 * => should NOT be replaced
1960 .line = __location__,
1961 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1964 .type = WREPL_TYPE_GROUP,
1965 .state = WREPL_STATE_RELEASED,
1966 .node = WREPL_NODE_B,
1968 .num_ips = ARRAY_SIZE(addresses_A_1),
1969 .ips = addresses_A_1,
1970 .apply_expected = False
1974 .type = WREPL_TYPE_UNIQUE,
1975 .state = WREPL_STATE_ACTIVE,
1976 .node = WREPL_NODE_B,
1978 .num_ips = ARRAY_SIZE(addresses_A_1),
1979 .ips = addresses_A_1,
1980 .apply_expected = False
1985 * group,released vs. unique,tombstone
1986 * => should NOT be replaced
1989 .line = __location__,
1990 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1993 .type = WREPL_TYPE_GROUP,
1994 .state = WREPL_STATE_RELEASED,
1995 .node = WREPL_NODE_B,
1997 .num_ips = ARRAY_SIZE(addresses_A_1),
1998 .ips = addresses_A_1,
1999 .apply_expected = False
2003 .type = WREPL_TYPE_UNIQUE,
2004 .state = WREPL_STATE_TOMBSTONE,
2005 .node = WREPL_NODE_B,
2007 .num_ips = ARRAY_SIZE(addresses_A_1),
2008 .ips = addresses_A_1,
2009 .apply_expected = False
2014 * group,tombstone vs. unique,active
2015 * => should NOT be replaced
2018 .line = __location__,
2019 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2022 .type = WREPL_TYPE_GROUP,
2023 .state = WREPL_STATE_TOMBSTONE,
2024 .node = WREPL_NODE_B,
2026 .num_ips = ARRAY_SIZE(addresses_A_1),
2027 .ips = addresses_A_1,
2028 .apply_expected = True
2032 .type = WREPL_TYPE_UNIQUE,
2033 .state = WREPL_STATE_ACTIVE,
2034 .node = WREPL_NODE_B,
2036 .num_ips = ARRAY_SIZE(addresses_A_1),
2037 .ips = addresses_A_1,
2038 .apply_expected = False
2043 * group,tombstone vs. unique,tombstone
2044 * => should NOT be replaced
2047 .line = __location__,
2048 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2051 .type = WREPL_TYPE_GROUP,
2052 .state = WREPL_STATE_TOMBSTONE,
2053 .node = WREPL_NODE_B,
2055 .num_ips = ARRAY_SIZE(addresses_A_1),
2056 .ips = addresses_A_1,
2057 .apply_expected = True
2061 .type = WREPL_TYPE_UNIQUE,
2062 .state = WREPL_STATE_TOMBSTONE,
2063 .node = WREPL_NODE_B,
2065 .num_ips = ARRAY_SIZE(addresses_A_1),
2066 .ips = addresses_A_1,
2067 .apply_expected = False
2072 * normal groups vs normal groups section,
2075 * group,active vs. group,active
2076 * => should NOT be replaced
2079 .line = __location__,
2080 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2083 .type = WREPL_TYPE_GROUP,
2084 .state = WREPL_STATE_ACTIVE,
2085 .node = WREPL_NODE_B,
2087 .num_ips = ARRAY_SIZE(addresses_A_1),
2088 .ips = addresses_A_1,
2089 .apply_expected = True
2093 .type = WREPL_TYPE_GROUP,
2094 .state = WREPL_STATE_ACTIVE,
2095 .node = WREPL_NODE_B,
2097 .num_ips = ARRAY_SIZE(addresses_A_1),
2098 .ips = addresses_A_1,
2099 .apply_expected = False
2104 * group,active vs. group,tombstone
2105 * => should NOT be replaced
2108 .line = __location__,
2109 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2112 .type = WREPL_TYPE_GROUP,
2113 .state = WREPL_STATE_ACTIVE,
2114 .node = WREPL_NODE_B,
2116 .num_ips = ARRAY_SIZE(addresses_A_1),
2117 .ips = addresses_A_1,
2118 .apply_expected = True
2122 .type = WREPL_TYPE_GROUP,
2123 .state = WREPL_STATE_TOMBSTONE,
2124 .node = WREPL_NODE_B,
2126 .num_ips = ARRAY_SIZE(addresses_A_1),
2127 .ips = addresses_A_1,
2128 .apply_expected = False
2133 * group,released vs. group,active
2134 * => should be replaced
2137 .line = __location__,
2138 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2141 .type = WREPL_TYPE_GROUP,
2142 .state = WREPL_STATE_RELEASED,
2143 .node = WREPL_NODE_B,
2145 .num_ips = ARRAY_SIZE(addresses_A_1),
2146 .ips = addresses_A_1,
2147 .apply_expected = False
2151 .type = WREPL_TYPE_GROUP,
2152 .state = WREPL_STATE_ACTIVE,
2153 .node = WREPL_NODE_B,
2155 .num_ips = ARRAY_SIZE(addresses_B_1),
2156 .ips = addresses_B_1,
2157 .apply_expected = True
2162 * group,released vs. group,tombstone
2163 * => should be replaced
2166 .line = __location__,
2167 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2170 .type = WREPL_TYPE_GROUP,
2171 .state = WREPL_STATE_RELEASED,
2172 .node = WREPL_NODE_B,
2174 .num_ips = ARRAY_SIZE(addresses_A_1),
2175 .ips = addresses_A_1,
2176 .apply_expected = False
2180 .type = WREPL_TYPE_GROUP,
2181 .state = WREPL_STATE_TOMBSTONE,
2182 .node = WREPL_NODE_B,
2184 .num_ips = ARRAY_SIZE(addresses_B_1),
2185 .ips = addresses_B_1,
2186 .apply_expected = True
2191 * group,tombstone vs. group,active
2192 * => should be replaced
2195 .line = __location__,
2196 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2199 .type = WREPL_TYPE_GROUP,
2200 .state = WREPL_STATE_TOMBSTONE,
2201 .node = WREPL_NODE_B,
2203 .num_ips = ARRAY_SIZE(addresses_B_1),
2204 .ips = addresses_B_1,
2205 .apply_expected = True
2209 .type = WREPL_TYPE_GROUP,
2210 .state = WREPL_STATE_ACTIVE,
2211 .node = WREPL_NODE_B,
2213 .num_ips = ARRAY_SIZE(addresses_A_1),
2214 .ips = addresses_A_1,
2215 .apply_expected = True
2220 * group,tombstone vs. group,tombstone
2221 * => should be replaced
2224 .line = __location__,
2225 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2228 .type = WREPL_TYPE_GROUP,
2229 .state = WREPL_STATE_TOMBSTONE,
2230 .node = WREPL_NODE_B,
2232 .num_ips = ARRAY_SIZE(addresses_A_1),
2233 .ips = addresses_A_1,
2234 .apply_expected = True
2238 .type = WREPL_TYPE_GROUP,
2239 .state = WREPL_STATE_TOMBSTONE,
2240 .node = WREPL_NODE_B,
2242 .num_ips = ARRAY_SIZE(addresses_B_1),
2243 .ips = addresses_B_1,
2244 .apply_expected = True
2249 * normal groups vs special groups section,
2252 * group,active vs. sgroup,active
2253 * => should NOT be replaced
2256 .line = __location__,
2257 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2260 .type = WREPL_TYPE_GROUP,
2261 .state = WREPL_STATE_ACTIVE,
2262 .node = WREPL_NODE_B,
2264 .num_ips = ARRAY_SIZE(addresses_B_1),
2265 .ips = addresses_B_1,
2266 .apply_expected = True
2270 .type = WREPL_TYPE_SGROUP,
2271 .state = WREPL_STATE_ACTIVE,
2272 .node = WREPL_NODE_B,
2274 .num_ips = ARRAY_SIZE(addresses_B_1),
2275 .ips = addresses_B_1,
2276 .apply_expected = False
2281 * group,active vs. sgroup,tombstone
2282 * => should NOT be replaced
2285 .line = __location__,
2286 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2289 .type = WREPL_TYPE_GROUP,
2290 .state = WREPL_STATE_ACTIVE,
2291 .node = WREPL_NODE_B,
2293 .num_ips = ARRAY_SIZE(addresses_B_1),
2294 .ips = addresses_B_1,
2295 .apply_expected = True
2299 .type = WREPL_TYPE_SGROUP,
2300 .state = WREPL_STATE_TOMBSTONE,
2301 .node = WREPL_NODE_B,
2303 .num_ips = ARRAY_SIZE(addresses_B_1),
2304 .ips = addresses_B_1,
2305 .apply_expected = False
2310 * group,released vs. sgroup,active
2311 * => should be replaced
2314 .line = __location__,
2315 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2318 .type = WREPL_TYPE_GROUP,
2319 .state = WREPL_STATE_RELEASED,
2320 .node = WREPL_NODE_B,
2322 .num_ips = ARRAY_SIZE(addresses_A_1),
2323 .ips = addresses_A_1,
2324 .apply_expected = False
2328 .type = WREPL_TYPE_SGROUP,
2329 .state = WREPL_STATE_ACTIVE,
2330 .node = WREPL_NODE_B,
2332 .num_ips = ARRAY_SIZE(addresses_B_1),
2333 .ips = addresses_B_1,
2334 .apply_expected = True
2339 * group,released vs. sgroup,tombstone
2340 * => should NOT be replaced
2343 .line = __location__,
2344 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2347 .type = WREPL_TYPE_GROUP,
2348 .state = WREPL_STATE_RELEASED,
2349 .node = WREPL_NODE_B,
2351 .num_ips = ARRAY_SIZE(addresses_B_1),
2352 .ips = addresses_B_1,
2353 .apply_expected = False
2357 .type = WREPL_TYPE_SGROUP,
2358 .state = WREPL_STATE_TOMBSTONE,
2359 .node = WREPL_NODE_B,
2361 .num_ips = ARRAY_SIZE(addresses_B_1),
2362 .ips = addresses_B_1,
2363 .apply_expected = False
2368 * group,tombstone vs. sgroup,active
2369 * => should be replaced
2372 .line = __location__,
2373 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2376 .type = WREPL_TYPE_GROUP,
2377 .state = WREPL_STATE_TOMBSTONE,
2378 .node = WREPL_NODE_B,
2380 .num_ips = ARRAY_SIZE(addresses_B_1),
2381 .ips = addresses_B_1,
2382 .apply_expected = True
2386 .type = WREPL_TYPE_SGROUP,
2387 .state = WREPL_STATE_ACTIVE,
2388 .node = WREPL_NODE_B,
2390 .num_ips = ARRAY_SIZE(addresses_A_1),
2391 .ips = addresses_A_1,
2392 .apply_expected = True
2397 * group,tombstone vs. sgroup,tombstone
2398 * => should be replaced
2401 .line = __location__,
2402 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2405 .type = WREPL_TYPE_GROUP,
2406 .state = WREPL_STATE_TOMBSTONE,
2407 .node = WREPL_NODE_B,
2409 .num_ips = ARRAY_SIZE(addresses_A_1),
2410 .ips = addresses_A_1,
2411 .apply_expected = True
2415 .type = WREPL_TYPE_SGROUP,
2416 .state = WREPL_STATE_TOMBSTONE,
2417 .node = WREPL_NODE_B,
2419 .num_ips = ARRAY_SIZE(addresses_B_1),
2420 .ips = addresses_B_1,
2421 .apply_expected = True
2426 * normal groups vs multi homed section,
2429 * group,active vs. mhomed,active
2430 * => should NOT be replaced
2433 .line = __location__,
2434 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2437 .type = WREPL_TYPE_GROUP,
2438 .state = WREPL_STATE_ACTIVE,
2439 .node = WREPL_NODE_B,
2441 .num_ips = ARRAY_SIZE(addresses_B_1),
2442 .ips = addresses_B_1,
2443 .apply_expected = True
2447 .type = WREPL_TYPE_MHOMED,
2448 .state = WREPL_STATE_ACTIVE,
2449 .node = WREPL_NODE_B,
2451 .num_ips = ARRAY_SIZE(addresses_B_1),
2452 .ips = addresses_B_1,
2453 .apply_expected = False
2458 * group,active vs. mhomed,tombstone
2459 * => should NOT be replaced
2462 .line = __location__,
2463 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2466 .type = WREPL_TYPE_GROUP,
2467 .state = WREPL_STATE_ACTIVE,
2468 .node = WREPL_NODE_B,
2470 .num_ips = ARRAY_SIZE(addresses_B_1),
2471 .ips = addresses_B_1,
2472 .apply_expected = True
2476 .type = WREPL_TYPE_MHOMED,
2477 .state = WREPL_STATE_TOMBSTONE,
2478 .node = WREPL_NODE_B,
2480 .num_ips = ARRAY_SIZE(addresses_B_1),
2481 .ips = addresses_B_1,
2482 .apply_expected = False
2487 * group,released vs. mhomed,active
2488 * => should NOT be replaced
2491 .line = __location__,
2492 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2495 .type = WREPL_TYPE_GROUP,
2496 .state = WREPL_STATE_RELEASED,
2497 .node = WREPL_NODE_B,
2499 .num_ips = ARRAY_SIZE(addresses_B_1),
2500 .ips = addresses_B_1,
2501 .apply_expected = False
2505 .type = WREPL_TYPE_MHOMED,
2506 .state = WREPL_STATE_ACTIVE,
2507 .node = WREPL_NODE_B,
2509 .num_ips = ARRAY_SIZE(addresses_B_1),
2510 .ips = addresses_B_1,
2511 .apply_expected = False
2516 * group,released vs. mhomed,tombstone
2517 * => should NOT be replaced
2520 .line = __location__,
2521 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2524 .type = WREPL_TYPE_GROUP,
2525 .state = WREPL_STATE_RELEASED,
2526 .node = WREPL_NODE_B,
2528 .num_ips = ARRAY_SIZE(addresses_B_1),
2529 .ips = addresses_B_1,
2530 .apply_expected = False
2534 .type = WREPL_TYPE_MHOMED,
2535 .state = WREPL_STATE_TOMBSTONE,
2536 .node = WREPL_NODE_B,
2538 .num_ips = ARRAY_SIZE(addresses_B_1),
2539 .ips = addresses_B_1,
2540 .apply_expected = False
2545 * group,tombstone vs. mhomed,active
2546 * => should be replaced
2549 .line = __location__,
2550 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2553 .type = WREPL_TYPE_GROUP,
2554 .state = WREPL_STATE_TOMBSTONE,
2555 .node = WREPL_NODE_B,
2557 .num_ips = ARRAY_SIZE(addresses_B_1),
2558 .ips = addresses_B_1,
2559 .apply_expected = True
2563 .type = WREPL_TYPE_MHOMED,
2564 .state = WREPL_STATE_ACTIVE,
2565 .node = WREPL_NODE_B,
2567 .num_ips = ARRAY_SIZE(addresses_A_1),
2568 .ips = addresses_A_1,
2569 .apply_expected = True
2574 * group,tombstone vs. mhomed,tombstone
2575 * => should be replaced
2578 .line = __location__,
2579 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2582 .type = WREPL_TYPE_GROUP,
2583 .state = WREPL_STATE_TOMBSTONE,
2584 .node = WREPL_NODE_B,
2586 .num_ips = ARRAY_SIZE(addresses_A_1),
2587 .ips = addresses_A_1,
2588 .apply_expected = True
2592 .type = WREPL_TYPE_MHOMED,
2593 .state = WREPL_STATE_TOMBSTONE,
2594 .node = WREPL_NODE_B,
2596 .num_ips = ARRAY_SIZE(addresses_B_1),
2597 .ips = addresses_B_1,
2598 .apply_expected = True
2603 * special groups vs unique section,
2606 * sgroup,active vs. unique,active
2607 * => should NOT be replaced
2610 .line = __location__,
2611 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2614 .type = WREPL_TYPE_SGROUP,
2615 .state = WREPL_STATE_ACTIVE,
2616 .node = WREPL_NODE_B,
2618 .num_ips = ARRAY_SIZE(addresses_B_1),
2619 .ips = addresses_B_1,
2620 .apply_expected = True
2624 .type = WREPL_TYPE_UNIQUE,
2625 .state = WREPL_STATE_ACTIVE,
2626 .node = WREPL_NODE_B,
2628 .num_ips = ARRAY_SIZE(addresses_B_1),
2629 .ips = addresses_B_1,
2630 .apply_expected = False
2635 * sgroup,active vs. unique,tombstone
2636 * => should NOT be replaced
2639 .line = __location__,
2640 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2643 .type = WREPL_TYPE_SGROUP,
2644 .state = WREPL_STATE_ACTIVE,
2645 .node = WREPL_NODE_B,
2647 .num_ips = ARRAY_SIZE(addresses_B_1),
2648 .ips = addresses_B_1,
2649 .apply_expected = True
2653 .type = WREPL_TYPE_UNIQUE,
2654 .state = WREPL_STATE_TOMBSTONE,
2655 .node = WREPL_NODE_B,
2657 .num_ips = ARRAY_SIZE(addresses_B_1),
2658 .ips = addresses_B_1,
2659 .apply_expected = False
2664 * sgroup,released vs. unique,active
2665 * => should be replaced
2668 .line = __location__,
2669 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2672 .type = WREPL_TYPE_SGROUP,
2673 .state = WREPL_STATE_RELEASED,
2674 .node = WREPL_NODE_B,
2676 .num_ips = ARRAY_SIZE(addresses_B_1),
2677 .ips = addresses_B_1,
2678 .apply_expected = False
2682 .type = WREPL_TYPE_UNIQUE,
2683 .state = WREPL_STATE_ACTIVE,
2684 .node = WREPL_NODE_B,
2686 .num_ips = ARRAY_SIZE(addresses_A_1),
2687 .ips = addresses_A_1,
2688 .apply_expected = True
2693 * sgroup,released vs. unique,tombstone
2694 * => should be replaced
2697 .line = __location__,
2698 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2701 .type = WREPL_TYPE_SGROUP,
2702 .state = WREPL_STATE_RELEASED,
2703 .node = WREPL_NODE_B,
2705 .num_ips = ARRAY_SIZE(addresses_A_1),
2706 .ips = addresses_A_1,
2707 .apply_expected = False
2711 .type = WREPL_TYPE_UNIQUE,
2712 .state = WREPL_STATE_TOMBSTONE,
2713 .node = WREPL_NODE_B,
2715 .num_ips = ARRAY_SIZE(addresses_B_1),
2716 .ips = addresses_B_1,
2717 .apply_expected = True
2722 * sgroup,tombstone vs. unique,active
2723 * => should be replaced
2726 .line = __location__,
2727 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2730 .type = WREPL_TYPE_SGROUP,
2731 .state = WREPL_STATE_TOMBSTONE,
2732 .node = WREPL_NODE_B,
2734 .num_ips = ARRAY_SIZE(addresses_A_1),
2735 .ips = addresses_A_1,
2736 .apply_expected = True
2740 .type = WREPL_TYPE_UNIQUE,
2741 .state = WREPL_STATE_ACTIVE,
2742 .node = WREPL_NODE_B,
2744 .num_ips = ARRAY_SIZE(addresses_B_1),
2745 .ips = addresses_B_1,
2746 .apply_expected = True
2751 * sgroup,tombstone vs. unique,tombstone
2752 * => should be replaced
2755 .line = __location__,
2756 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2759 .type = WREPL_TYPE_SGROUP,
2760 .state = WREPL_STATE_TOMBSTONE,
2761 .node = WREPL_NODE_B,
2763 .num_ips = ARRAY_SIZE(addresses_B_1),
2764 .ips = addresses_B_1,
2765 .apply_expected = True
2769 .type = WREPL_TYPE_UNIQUE,
2770 .state = WREPL_STATE_TOMBSTONE,
2771 .node = WREPL_NODE_B,
2773 .num_ips = ARRAY_SIZE(addresses_A_1),
2774 .ips = addresses_A_1,
2775 .apply_expected = True
2780 * special groups vs normal group section,
2783 * sgroup,active vs. group,active
2784 * => should NOT be replaced
2787 .line = __location__,
2788 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2791 .type = WREPL_TYPE_SGROUP,
2792 .state = WREPL_STATE_ACTIVE,
2793 .node = WREPL_NODE_B,
2795 .num_ips = ARRAY_SIZE(addresses_A_1),
2796 .ips = addresses_A_1,
2797 .apply_expected = True
2801 .type = WREPL_TYPE_GROUP,
2802 .state = WREPL_STATE_ACTIVE,
2803 .node = WREPL_NODE_B,
2805 .num_ips = ARRAY_SIZE(addresses_A_1),
2806 .ips = addresses_A_1,
2807 .apply_expected = False
2812 * sgroup,active vs. group,tombstone
2813 * => should NOT be replaced
2816 .line = __location__,
2817 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2820 .type = WREPL_TYPE_SGROUP,
2821 .state = WREPL_STATE_ACTIVE,
2822 .node = WREPL_NODE_B,
2824 .num_ips = ARRAY_SIZE(addresses_A_1),
2825 .ips = addresses_A_1,
2826 .apply_expected = True
2830 .type = WREPL_TYPE_GROUP,
2831 .state = WREPL_STATE_TOMBSTONE,
2832 .node = WREPL_NODE_B,
2834 .num_ips = ARRAY_SIZE(addresses_A_1),
2835 .ips = addresses_A_1,
2836 .apply_expected = False
2841 * sgroup,released vs. group,active
2842 * => should be replaced
2845 .line = __location__,
2846 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2849 .type = WREPL_TYPE_SGROUP,
2850 .state = WREPL_STATE_RELEASED,
2851 .node = WREPL_NODE_B,
2853 .num_ips = ARRAY_SIZE(addresses_A_1),
2854 .ips = addresses_A_1,
2855 .apply_expected = False
2859 .type = WREPL_TYPE_GROUP,
2860 .state = WREPL_STATE_ACTIVE,
2861 .node = WREPL_NODE_B,
2863 .num_ips = ARRAY_SIZE(addresses_B_1),
2864 .ips = addresses_B_1,
2865 .apply_expected = True
2870 * sgroup,released vs. group,tombstone
2871 * => should be replaced
2874 .line = __location__,
2875 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2878 .type = WREPL_TYPE_SGROUP,
2879 .state = WREPL_STATE_RELEASED,
2880 .node = WREPL_NODE_B,
2882 .num_ips = ARRAY_SIZE(addresses_B_1),
2883 .ips = addresses_B_1,
2884 .apply_expected = False
2888 .type = WREPL_TYPE_GROUP,
2889 .state = WREPL_STATE_TOMBSTONE,
2890 .node = WREPL_NODE_B,
2892 .num_ips = ARRAY_SIZE(addresses_A_1),
2893 .ips = addresses_A_1,
2894 .apply_expected = True
2899 * sgroup,tombstone vs. group,active
2900 * => should NOT be replaced
2903 .line = __location__,
2904 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2907 .type = WREPL_TYPE_SGROUP,
2908 .state = WREPL_STATE_TOMBSTONE,
2909 .node = WREPL_NODE_B,
2911 .num_ips = ARRAY_SIZE(addresses_A_1),
2912 .ips = addresses_A_1,
2913 .apply_expected = True
2917 .type = WREPL_TYPE_GROUP,
2918 .state = WREPL_STATE_ACTIVE,
2919 .node = WREPL_NODE_B,
2921 .num_ips = ARRAY_SIZE(addresses_B_1),
2922 .ips = addresses_B_1,
2923 .apply_expected = True
2928 * sgroup,tombstone vs. group,tombstone
2929 * => should NOT be replaced
2932 .line = __location__,
2933 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2936 .type = WREPL_TYPE_SGROUP,
2937 .state = WREPL_STATE_TOMBSTONE,
2938 .node = WREPL_NODE_B,
2940 .num_ips = ARRAY_SIZE(addresses_B_1),
2941 .ips = addresses_B_1,
2942 .apply_expected = True
2946 .type = WREPL_TYPE_GROUP,
2947 .state = WREPL_STATE_TOMBSTONE,
2948 .node = WREPL_NODE_B,
2950 .num_ips = ARRAY_SIZE(addresses_A_1),
2951 .ips = addresses_A_1,
2952 .apply_expected = True
2957 * special groups (not active) vs special group section,
2960 * sgroup,released vs. sgroup,active
2961 * => should be replaced
2964 .line = __location__,
2965 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2968 .type = WREPL_TYPE_SGROUP,
2969 .state = WREPL_STATE_RELEASED,
2970 .node = WREPL_NODE_B,
2972 .num_ips = ARRAY_SIZE(addresses_A_1),
2973 .ips = addresses_A_1,
2974 .apply_expected = False
2978 .type = WREPL_TYPE_SGROUP,
2979 .state = WREPL_STATE_ACTIVE,
2980 .node = WREPL_NODE_B,
2982 .num_ips = ARRAY_SIZE(addresses_B_1),
2983 .ips = addresses_B_1,
2984 .apply_expected = True
2989 * sgroup,released vs. sgroup,tombstone
2990 * => should be replaced
2993 .line = __location__,
2994 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2997 .type = WREPL_TYPE_SGROUP,
2998 .state = WREPL_STATE_RELEASED,
2999 .node = WREPL_NODE_B,
3001 .num_ips = ARRAY_SIZE(addresses_B_1),
3002 .ips = addresses_B_1,
3003 .apply_expected = False
3007 .type = WREPL_TYPE_SGROUP,
3008 .state = WREPL_STATE_TOMBSTONE,
3009 .node = WREPL_NODE_B,
3011 .num_ips = ARRAY_SIZE(addresses_A_1),
3012 .ips = addresses_A_1,
3013 .apply_expected = True
3018 * sgroup,tombstone vs. sgroup,active
3019 * => should NOT be replaced
3022 .line = __location__,
3023 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3026 .type = WREPL_TYPE_SGROUP,
3027 .state = WREPL_STATE_TOMBSTONE,
3028 .node = WREPL_NODE_B,
3030 .num_ips = ARRAY_SIZE(addresses_A_1),
3031 .ips = addresses_A_1,
3032 .apply_expected = True
3036 .type = WREPL_TYPE_SGROUP,
3037 .state = WREPL_STATE_ACTIVE,
3038 .node = WREPL_NODE_B,
3040 .num_ips = ARRAY_SIZE(addresses_B_1),
3041 .ips = addresses_B_1,
3042 .apply_expected = True
3047 * sgroup,tombstone vs. sgroup,tombstone
3048 * => should NOT be replaced
3051 .line = __location__,
3052 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3055 .type = WREPL_TYPE_SGROUP,
3056 .state = WREPL_STATE_TOMBSTONE,
3057 .node = WREPL_NODE_B,
3059 .num_ips = ARRAY_SIZE(addresses_B_1),
3060 .ips = addresses_B_1,
3061 .apply_expected = True
3065 .type = WREPL_TYPE_SGROUP,
3066 .state = WREPL_STATE_TOMBSTONE,
3067 .node = WREPL_NODE_B,
3069 .num_ips = ARRAY_SIZE(addresses_A_1),
3070 .ips = addresses_A_1,
3071 .apply_expected = True
3076 * special groups vs multi homed section,
3079 * sgroup,active vs. mhomed,active
3080 * => should NOT be replaced
3083 .line = __location__,
3084 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3087 .type = WREPL_TYPE_SGROUP,
3088 .state = WREPL_STATE_ACTIVE,
3089 .node = WREPL_NODE_B,
3091 .num_ips = ARRAY_SIZE(addresses_A_1),
3092 .ips = addresses_A_1,
3093 .apply_expected = True
3097 .type = WREPL_TYPE_MHOMED,
3098 .state = WREPL_STATE_ACTIVE,
3099 .node = WREPL_NODE_B,
3101 .num_ips = ARRAY_SIZE(addresses_A_1),
3102 .ips = addresses_A_1,
3103 .apply_expected = False
3108 * sgroup,active vs. mhomed,tombstone
3109 * => should NOT be replaced
3112 .line = __location__,
3113 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3116 .type = WREPL_TYPE_SGROUP,
3117 .state = WREPL_STATE_ACTIVE,
3118 .node = WREPL_NODE_B,
3120 .num_ips = ARRAY_SIZE(addresses_A_1),
3121 .ips = addresses_A_1,
3122 .apply_expected = True
3126 .type = WREPL_TYPE_MHOMED,
3127 .state = WREPL_STATE_TOMBSTONE,
3128 .node = WREPL_NODE_B,
3130 .num_ips = ARRAY_SIZE(addresses_A_1),
3131 .ips = addresses_A_1,
3132 .apply_expected = False
3137 * sgroup,released vs. mhomed,active
3138 * => should be replaced
3141 .line = __location__,
3142 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3145 .type = WREPL_TYPE_SGROUP,
3146 .state = WREPL_STATE_RELEASED,
3147 .node = WREPL_NODE_B,
3149 .num_ips = ARRAY_SIZE(addresses_A_1),
3150 .ips = addresses_A_1,
3151 .apply_expected = False
3155 .type = WREPL_TYPE_MHOMED,
3156 .state = WREPL_STATE_ACTIVE,
3157 .node = WREPL_NODE_B,
3159 .num_ips = ARRAY_SIZE(addresses_B_1),
3160 .ips = addresses_B_1,
3161 .apply_expected = True
3166 * sgroup,released vs. mhomed,tombstone
3167 * => should be replaced
3170 .line = __location__,
3171 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3174 .type = WREPL_TYPE_SGROUP,
3175 .state = WREPL_STATE_RELEASED,
3176 .node = WREPL_NODE_B,
3178 .num_ips = ARRAY_SIZE(addresses_B_1),
3179 .ips = addresses_B_1,
3180 .apply_expected = False
3184 .type = WREPL_TYPE_MHOMED,
3185 .state = WREPL_STATE_TOMBSTONE,
3186 .node = WREPL_NODE_B,
3188 .num_ips = ARRAY_SIZE(addresses_A_1),
3189 .ips = addresses_A_1,
3190 .apply_expected = True
3195 * sgroup,tombstone vs. mhomed,active
3196 * => should be replaced
3199 .line = __location__,
3200 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3203 .type = WREPL_TYPE_SGROUP,
3204 .state = WREPL_STATE_TOMBSTONE,
3205 .node = WREPL_NODE_B,
3207 .num_ips = ARRAY_SIZE(addresses_A_1),
3208 .ips = addresses_A_1,
3209 .apply_expected = True
3213 .type = WREPL_TYPE_MHOMED,
3214 .state = WREPL_STATE_ACTIVE,
3215 .node = WREPL_NODE_B,
3217 .num_ips = ARRAY_SIZE(addresses_B_1),
3218 .ips = addresses_B_1,
3219 .apply_expected = True
3224 * sgroup,tombstone vs. mhomed,tombstone
3225 * => should be replaced
3228 .line = __location__,
3229 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3232 .type = WREPL_TYPE_SGROUP,
3233 .state = WREPL_STATE_TOMBSTONE,
3234 .node = WREPL_NODE_B,
3236 .num_ips = ARRAY_SIZE(addresses_B_1),
3237 .ips = addresses_B_1,
3238 .apply_expected = True
3242 .type = WREPL_TYPE_MHOMED,
3243 .state = WREPL_STATE_TOMBSTONE,
3244 .node = WREPL_NODE_B,
3246 .num_ips = ARRAY_SIZE(addresses_A_1),
3247 .ips = addresses_A_1,
3248 .apply_expected = True
3253 * multi homed vs. unique section,
3256 * mhomed,active vs. unique,active
3257 * => should be replaced
3260 .line = __location__,
3261 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3264 .type = WREPL_TYPE_MHOMED,
3265 .state = WREPL_STATE_ACTIVE,
3266 .node = WREPL_NODE_B,
3268 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3269 .ips = addresses_A_3_4,
3270 .apply_expected = True
3274 .type = WREPL_TYPE_UNIQUE,
3275 .state = WREPL_STATE_ACTIVE,
3276 .node = WREPL_NODE_B,
3278 .num_ips = ARRAY_SIZE(addresses_B_1),
3279 .ips = addresses_B_1,
3280 .apply_expected = True
3285 * mhomed,active vs. unique,tombstone
3286 * => should NOT be replaced
3289 .line = __location__,
3290 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3293 .type = WREPL_TYPE_MHOMED,
3294 .state = WREPL_STATE_ACTIVE,
3295 .node = WREPL_NODE_B,
3297 .num_ips = ARRAY_SIZE(addresses_B_1),
3298 .ips = addresses_B_1,
3299 .apply_expected = True
3303 .type = WREPL_TYPE_UNIQUE,
3304 .state = WREPL_STATE_TOMBSTONE,
3305 .node = WREPL_NODE_B,
3307 .num_ips = ARRAY_SIZE(addresses_B_1),
3308 .ips = addresses_B_1,
3309 .apply_expected = False
3314 * mhomed,released vs. unique,active
3315 * => should be replaced
3318 .line = __location__,
3319 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3322 .type = WREPL_TYPE_MHOMED,
3323 .state = WREPL_STATE_RELEASED,
3324 .node = WREPL_NODE_B,
3326 .num_ips = ARRAY_SIZE(addresses_A_1),
3327 .ips = addresses_A_1,
3328 .apply_expected = False
3332 .type = WREPL_TYPE_UNIQUE,
3333 .state = WREPL_STATE_ACTIVE,
3334 .node = WREPL_NODE_B,
3336 .num_ips = ARRAY_SIZE(addresses_B_1),
3337 .ips = addresses_B_1,
3338 .apply_expected = True
3343 * mhomed,released vs. uinique,tombstone
3344 * => should be replaced
3347 .line = __location__,
3348 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3351 .type = WREPL_TYPE_MHOMED,
3352 .state = WREPL_STATE_RELEASED,
3353 .node = WREPL_NODE_B,
3355 .num_ips = ARRAY_SIZE(addresses_B_1),
3356 .ips = addresses_B_1,
3357 .apply_expected = False
3361 .type = WREPL_TYPE_UNIQUE,
3362 .state = WREPL_STATE_TOMBSTONE,
3363 .node = WREPL_NODE_B,
3365 .num_ips = ARRAY_SIZE(addresses_A_1),
3366 .ips = addresses_A_1,
3367 .apply_expected = True
3372 * mhomed,tombstone vs. unique,active
3373 * => should be replaced
3376 .line = __location__,
3377 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3380 .type = WREPL_TYPE_MHOMED,
3381 .state = WREPL_STATE_TOMBSTONE,
3382 .node = WREPL_NODE_B,
3384 .num_ips = ARRAY_SIZE(addresses_A_1),
3385 .ips = addresses_A_1,
3386 .apply_expected = True
3390 .type = WREPL_TYPE_UNIQUE,
3391 .state = WREPL_STATE_ACTIVE,
3392 .node = WREPL_NODE_B,
3394 .num_ips = ARRAY_SIZE(addresses_B_1),
3395 .ips = addresses_B_1,
3396 .apply_expected = True
3401 * mhomed,tombstone vs. uinique,tombstone
3402 * => should be replaced
3405 .line = __location__,
3406 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3409 .type = WREPL_TYPE_MHOMED,
3410 .state = WREPL_STATE_TOMBSTONE,
3411 .node = WREPL_NODE_B,
3413 .num_ips = ARRAY_SIZE(addresses_B_1),
3414 .ips = addresses_B_1,
3415 .apply_expected = True
3419 .type = WREPL_TYPE_UNIQUE,
3420 .state = WREPL_STATE_TOMBSTONE,
3421 .node = WREPL_NODE_B,
3423 .num_ips = ARRAY_SIZE(addresses_A_1),
3424 .ips = addresses_A_1,
3425 .apply_expected = True
3430 * multi homed vs. normal group section,
3433 * mhomed,active vs. group,active
3434 * => should be replaced
3437 .line = __location__,
3438 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3441 .type = WREPL_TYPE_MHOMED,
3442 .state = WREPL_STATE_ACTIVE,
3443 .node = WREPL_NODE_B,
3445 .num_ips = ARRAY_SIZE(addresses_A_1),
3446 .ips = addresses_A_1,
3447 .apply_expected = True
3451 .type = WREPL_TYPE_GROUP,
3452 .state = WREPL_STATE_ACTIVE,
3453 .node = WREPL_NODE_B,
3455 .num_ips = ARRAY_SIZE(addresses_B_1),
3456 .ips = addresses_B_1,
3457 .apply_expected = True
3462 * mhomed,active vs. group,tombstone
3463 * => should NOT be replaced
3466 .line = __location__,
3467 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3470 .type = WREPL_TYPE_MHOMED,
3471 .state = WREPL_STATE_ACTIVE,
3472 .node = WREPL_NODE_B,
3474 .num_ips = ARRAY_SIZE(addresses_B_1),
3475 .ips = addresses_B_1,
3476 .apply_expected = True
3480 .type = WREPL_TYPE_GROUP,
3481 .state = WREPL_STATE_TOMBSTONE,
3482 .node = WREPL_NODE_B,
3484 .num_ips = ARRAY_SIZE(addresses_B_1),
3485 .ips = addresses_B_1,
3486 .apply_expected = False
3491 * mhomed,released vs. group,active
3492 * => should be replaced
3495 .line = __location__,
3496 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3499 .type = WREPL_TYPE_MHOMED,
3500 .state = WREPL_STATE_RELEASED,
3501 .node = WREPL_NODE_B,
3503 .num_ips = ARRAY_SIZE(addresses_B_1),
3504 .ips = addresses_B_1,
3505 .apply_expected = False
3509 .type = WREPL_TYPE_GROUP,
3510 .state = WREPL_STATE_ACTIVE,
3511 .node = WREPL_NODE_B,
3513 .num_ips = ARRAY_SIZE(addresses_A_1),
3514 .ips = addresses_A_1,
3515 .apply_expected = True
3520 * mhomed,released vs. group,tombstone
3521 * => should be replaced
3524 .line = __location__,
3525 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3528 .type = WREPL_TYPE_MHOMED,
3529 .state = WREPL_STATE_RELEASED,
3530 .node = WREPL_NODE_B,
3532 .num_ips = ARRAY_SIZE(addresses_A_1),
3533 .ips = addresses_A_1,
3534 .apply_expected = False
3538 .type = WREPL_TYPE_GROUP,
3539 .state = WREPL_STATE_TOMBSTONE,
3540 .node = WREPL_NODE_B,
3542 .num_ips = ARRAY_SIZE(addresses_B_1),
3543 .ips = addresses_B_1,
3544 .apply_expected = True
3549 * mhomed,tombstone vs. group,active
3550 * => should be replaced
3553 .line = __location__,
3554 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3557 .type = WREPL_TYPE_MHOMED,
3558 .state = WREPL_STATE_TOMBSTONE,
3559 .node = WREPL_NODE_B,
3561 .num_ips = ARRAY_SIZE(addresses_B_1),
3562 .ips = addresses_B_1,
3563 .apply_expected = True
3567 .type = WREPL_TYPE_GROUP,
3568 .state = WREPL_STATE_ACTIVE,
3569 .node = WREPL_NODE_B,
3571 .num_ips = ARRAY_SIZE(addresses_A_1),
3572 .ips = addresses_A_1,
3573 .apply_expected = True
3578 * mhomed,tombstone vs. group,tombstone
3579 * => should be replaced
3582 .line = __location__,
3583 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3586 .type = WREPL_TYPE_MHOMED,
3587 .state = WREPL_STATE_TOMBSTONE,
3588 .node = WREPL_NODE_B,
3590 .num_ips = ARRAY_SIZE(addresses_A_1),
3591 .ips = addresses_A_1,
3592 .apply_expected = True
3596 .type = WREPL_TYPE_GROUP,
3597 .state = WREPL_STATE_TOMBSTONE,
3598 .node = WREPL_NODE_B,
3600 .num_ips = ARRAY_SIZE(addresses_B_1),
3601 .ips = addresses_B_1,
3602 .apply_expected = True
3607 * multi homed vs. special group section,
3610 * mhomed,active vs. sgroup,active
3611 * => should NOT be replaced
3614 .line = __location__,
3615 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3618 .type = WREPL_TYPE_MHOMED,
3619 .state = WREPL_STATE_ACTIVE,
3620 .node = WREPL_NODE_B,
3622 .num_ips = ARRAY_SIZE(addresses_A_1),
3623 .ips = addresses_A_1,
3624 .apply_expected = True
3628 .type = WREPL_TYPE_SGROUP,
3629 .state = WREPL_STATE_ACTIVE,
3630 .node = WREPL_NODE_B,
3632 .num_ips = ARRAY_SIZE(addresses_A_1),
3633 .ips = addresses_A_1,
3634 .apply_expected = False
3639 * mhomed,active vs. sgroup,tombstone
3640 * => should NOT be replaced
3643 .line = __location__,
3644 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3647 .type = WREPL_TYPE_MHOMED,
3648 .state = WREPL_STATE_ACTIVE,
3649 .node = WREPL_NODE_B,
3651 .num_ips = ARRAY_SIZE(addresses_A_1),
3652 .ips = addresses_A_1,
3653 .apply_expected = True
3657 .type = WREPL_TYPE_SGROUP,
3658 .state = WREPL_STATE_TOMBSTONE,
3659 .node = WREPL_NODE_B,
3661 .num_ips = ARRAY_SIZE(addresses_A_1),
3662 .ips = addresses_A_1,
3663 .apply_expected = False
3668 * mhomed,released vs. sgroup,active
3669 * => should be replaced
3672 .line = __location__,
3673 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3676 .type = WREPL_TYPE_MHOMED,
3677 .state = WREPL_STATE_RELEASED,
3678 .node = WREPL_NODE_B,
3680 .num_ips = ARRAY_SIZE(addresses_A_1),
3681 .ips = addresses_A_1,
3682 .apply_expected = False
3686 .type = WREPL_TYPE_SGROUP,
3687 .state = WREPL_STATE_ACTIVE,
3688 .node = WREPL_NODE_B,
3690 .num_ips = ARRAY_SIZE(addresses_B_1),
3691 .ips = addresses_B_1,
3692 .apply_expected = True
3697 * mhomed,released vs. sgroup,tombstone
3698 * => should be replaced
3701 .line = __location__,
3702 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3705 .type = WREPL_TYPE_MHOMED,
3706 .state = WREPL_STATE_RELEASED,
3707 .node = WREPL_NODE_B,
3709 .num_ips = ARRAY_SIZE(addresses_B_1),
3710 .ips = addresses_B_1,
3711 .apply_expected = False
3715 .type = WREPL_TYPE_SGROUP,
3716 .state = WREPL_STATE_TOMBSTONE,
3717 .node = WREPL_NODE_B,
3719 .num_ips = ARRAY_SIZE(addresses_A_1),
3720 .ips = addresses_A_1,
3721 .apply_expected = True
3726 * mhomed,tombstone vs. sgroup,active
3727 * => should be replaced
3730 .line = __location__,
3731 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3734 .type = WREPL_TYPE_MHOMED,
3735 .state = WREPL_STATE_TOMBSTONE,
3736 .node = WREPL_NODE_B,
3738 .num_ips = ARRAY_SIZE(addresses_A_1),
3739 .ips = addresses_A_1,
3740 .apply_expected = True
3744 .type = WREPL_TYPE_SGROUP,
3745 .state = WREPL_STATE_ACTIVE,
3746 .node = WREPL_NODE_B,
3748 .num_ips = ARRAY_SIZE(addresses_B_1),
3749 .ips = addresses_B_1,
3750 .apply_expected = True
3755 * mhomed,tombstone vs. sgroup,tombstone
3756 * => should be replaced
3759 .line = __location__,
3760 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3763 .type = WREPL_TYPE_MHOMED,
3764 .state = WREPL_STATE_TOMBSTONE,
3765 .node = WREPL_NODE_B,
3767 .num_ips = ARRAY_SIZE(addresses_B_1),
3768 .ips = addresses_B_1,
3769 .apply_expected = True
3773 .type = WREPL_TYPE_SGROUP,
3774 .state = WREPL_STATE_TOMBSTONE,
3775 .node = WREPL_NODE_B,
3777 .num_ips = ARRAY_SIZE(addresses_A_1),
3778 .ips = addresses_A_1,
3779 .apply_expected = True
3784 * multi homed vs. mlti homed section,
3787 * mhomed,active vs. mhomed,active
3788 * => should be replaced
3791 .line = __location__,
3792 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3795 .type = WREPL_TYPE_MHOMED,
3796 .state = WREPL_STATE_ACTIVE,
3797 .node = WREPL_NODE_B,
3799 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3800 .ips = addresses_A_3_4,
3801 .apply_expected = True
3805 .type = WREPL_TYPE_MHOMED,
3806 .state = WREPL_STATE_ACTIVE,
3807 .node = WREPL_NODE_B,
3809 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3810 .ips = addresses_B_3_4,
3811 .apply_expected = True
3816 * mhomed,active vs. mhomed,tombstone
3817 * => should NOT be replaced
3820 .line = __location__,
3821 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3824 .type = WREPL_TYPE_MHOMED,
3825 .state = WREPL_STATE_ACTIVE,
3826 .node = WREPL_NODE_B,
3828 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3829 .ips = addresses_B_3_4,
3830 .apply_expected = True
3834 .type = WREPL_TYPE_MHOMED,
3835 .state = WREPL_STATE_TOMBSTONE,
3836 .node = WREPL_NODE_B,
3838 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3839 .ips = addresses_B_3_4,
3840 .apply_expected = False
3845 * mhomed,released vs. mhomed,active
3846 * => should be replaced
3849 .line = __location__,
3850 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3853 .type = WREPL_TYPE_MHOMED,
3854 .state = WREPL_STATE_RELEASED,
3855 .node = WREPL_NODE_B,
3857 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3858 .ips = addresses_B_3_4,
3859 .apply_expected = False
3863 .type = WREPL_TYPE_MHOMED,
3864 .state = WREPL_STATE_ACTIVE,
3865 .node = WREPL_NODE_B,
3867 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3868 .ips = addresses_A_3_4,
3869 .apply_expected = True
3874 * mhomed,released vs. mhomed,tombstone
3875 * => should be replaced
3878 .line = __location__,
3879 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3882 .type = WREPL_TYPE_MHOMED,
3883 .state = WREPL_STATE_RELEASED,
3884 .node = WREPL_NODE_B,
3886 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3887 .ips = addresses_A_3_4,
3888 .apply_expected = False
3892 .type = WREPL_TYPE_MHOMED,
3893 .state = WREPL_STATE_TOMBSTONE,
3894 .node = WREPL_NODE_B,
3896 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3897 .ips = addresses_B_3_4,
3898 .apply_expected = True
3903 * mhomed,tombstone vs. mhomed,active
3904 * => should be replaced
3907 .line = __location__,
3908 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3911 .type = WREPL_TYPE_MHOMED,
3912 .state = WREPL_STATE_TOMBSTONE,
3913 .node = WREPL_NODE_B,
3915 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3916 .ips = addresses_B_3_4,
3917 .apply_expected = True
3921 .type = WREPL_TYPE_MHOMED,
3922 .state = WREPL_STATE_ACTIVE,
3923 .node = WREPL_NODE_B,
3925 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3926 .ips = addresses_A_3_4,
3927 .apply_expected = True
3932 * mhomed,tombstone vs. mhomed,tombstone
3933 * => should be replaced
3936 .line = __location__,
3937 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3940 .type = WREPL_TYPE_MHOMED,
3941 .state = WREPL_STATE_TOMBSTONE,
3942 .node = WREPL_NODE_B,
3944 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3945 .ips = addresses_A_3_4,
3946 .apply_expected = True
3950 .type = WREPL_TYPE_MHOMED,
3951 .state = WREPL_STATE_TOMBSTONE,
3952 .node = WREPL_NODE_B,
3954 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3955 .ips = addresses_B_3_4,
3956 .apply_expected = True
3960 .line = __location__,
3961 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3965 .type = WREPL_TYPE_UNIQUE,
3966 .state = WREPL_STATE_TOMBSTONE,
3967 .node = WREPL_NODE_B,
3969 .num_ips = ARRAY_SIZE(addresses_B_1),
3970 .ips = addresses_B_1,
3971 .apply_expected = True,
3975 .type = WREPL_TYPE_UNIQUE,
3976 .state = WREPL_STATE_TOMBSTONE,
3977 .node = WREPL_NODE_B,
3979 .num_ips = ARRAY_SIZE(addresses_A_1),
3980 .ips = addresses_A_1,
3981 .apply_expected = True,
3985 * special group vs special group section,
3988 * sgroup,active vs. sgroup,active different addresses
3989 * => should be merged
3992 .line = __location__,
3993 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3994 .comment= "A:A_3_4 vs. B:B_3_4 => C:A_3_4_B_3_4",
3998 .type = WREPL_TYPE_SGROUP,
3999 .state = WREPL_STATE_ACTIVE,
4000 .node = WREPL_NODE_B,
4002 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4003 .ips = addresses_A_3_4,
4004 .apply_expected = True,
4008 .type = WREPL_TYPE_SGROUP,
4009 .state = WREPL_STATE_ACTIVE,
4010 .node = WREPL_NODE_B,
4012 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4013 .ips = addresses_B_3_4,
4014 .sgroup_merge = True,
4015 .sgroup_cleanup = True,
4019 * sgroup,active vs. sgroup,active same addresses
4020 * => should be NOT replaced
4023 .line = __location__,
4024 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4025 .comment= "A:A_3_4 vs. B:A_3_4",
4029 .type = WREPL_TYPE_SGROUP,
4030 .state = WREPL_STATE_ACTIVE,
4031 .node = WREPL_NODE_B,
4033 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4034 .ips = addresses_A_3_4,
4035 .apply_expected = True
4039 .type = WREPL_TYPE_SGROUP,
4040 .state = WREPL_STATE_ACTIVE,
4041 .node = WREPL_NODE_B,
4043 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4044 .ips = addresses_A_3_4,
4045 .apply_expected = False,
4046 .sgroup_cleanup = True
4050 * sgroup,active vs. sgroup,active different addresses, but owner changed
4051 * => should be replaced
4054 .line = __location__,
4055 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4056 .comment= "A:B_3_4 vs. B:A_3_4",
4060 .type = WREPL_TYPE_SGROUP,
4061 .state = WREPL_STATE_ACTIVE,
4062 .node = WREPL_NODE_B,
4064 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4065 .ips = addresses_B_3_4,
4066 .apply_expected = True,
4070 .type = WREPL_TYPE_SGROUP,
4071 .state = WREPL_STATE_ACTIVE,
4072 .node = WREPL_NODE_B,
4074 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4075 .ips = addresses_A_3_4,
4076 .apply_expected = True,
4077 .sgroup_cleanup = True
4081 * sgroup,active vs. sgroup,active different addresses, but owner changed
4082 * => should be replaced
4085 .line = __location__,
4086 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4087 .comment= "A:A_3_4 vs. B:A_3_4_OWNER_B",
4091 .type = WREPL_TYPE_SGROUP,
4092 .state = WREPL_STATE_ACTIVE,
4093 .node = WREPL_NODE_B,
4095 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4096 .ips = addresses_A_3_4,
4097 .apply_expected = True,
4101 .type = WREPL_TYPE_SGROUP,
4102 .state = WREPL_STATE_ACTIVE,
4103 .node = WREPL_NODE_B,
4105 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4106 .ips = addresses_A_3_4_OWNER_B,
4107 .apply_expected = True,
4108 .sgroup_cleanup = True
4112 * sgroup,active vs. sgroup,active different addresses, but owner changed
4113 * => should be replaced
4116 .line = __location__,
4117 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4118 .comment= "A:A_3_4_OWNER_B vs. B:A_3_4",
4122 .type = WREPL_TYPE_SGROUP,
4123 .state = WREPL_STATE_ACTIVE,
4124 .node = WREPL_NODE_B,
4126 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4127 .ips = addresses_A_3_4_OWNER_B,
4128 .apply_expected = True,
4132 .type = WREPL_TYPE_SGROUP,
4133 .state = WREPL_STATE_ACTIVE,
4134 .node = WREPL_NODE_B,
4136 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4137 .ips = addresses_A_3_4,
4138 .apply_expected = True,
4139 .sgroup_cleanup = True
4143 * sgroup,active vs. sgroup,active different addresses, special case...
4144 * => should be merged
4147 .line = __location__,
4148 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4149 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:X_3_4",
4153 .type = WREPL_TYPE_SGROUP,
4154 .state = WREPL_STATE_ACTIVE,
4155 .node = WREPL_NODE_B,
4157 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4158 .ips = addresses_B_3_4_X_3_4,
4159 .apply_expected = True,
4163 .type = WREPL_TYPE_SGROUP,
4164 .state = WREPL_STATE_ACTIVE,
4165 .node = WREPL_NODE_B,
4167 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4168 .ips = addresses_A_3_4,
4169 .sgroup_merge = True,
4170 .merge_owner = &ctx->b,
4171 .sgroup_cleanup = False
4175 .line = __location__,
4176 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4180 .type = WREPL_TYPE_SGROUP,
4181 .state = WREPL_STATE_ACTIVE,
4182 .node = WREPL_NODE_B,
4184 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4_OWNER_B),
4185 .ips = addresses_A_3_4_X_3_4_OWNER_B,
4186 .apply_expected = True,
4190 .type = WREPL_TYPE_SGROUP,
4191 .state = WREPL_STATE_ACTIVE,
4192 .node = WREPL_NODE_B,
4196 .apply_expected = False,
4200 * sgroup,active vs. sgroup,active subset addresses, special case...
4201 * => should NOT be replaced
4204 .line = __location__,
4205 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4206 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4",
4210 .type = WREPL_TYPE_SGROUP,
4211 .state = WREPL_STATE_ACTIVE,
4212 .node = WREPL_NODE_B,
4214 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4215 .ips = addresses_A_3_4_X_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),
4225 .ips = addresses_A_3_4,
4226 .apply_expected = False,
4230 .line = __location__,
4231 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4235 .type = WREPL_TYPE_SGROUP,
4236 .state = WREPL_STATE_ACTIVE,
4237 .node = WREPL_NODE_B,
4241 .apply_expected = False,
4245 .type = WREPL_TYPE_SGROUP,
4246 .state = WREPL_STATE_ACTIVE,
4247 .node = WREPL_NODE_B,
4251 .apply_expected = False,
4255 * sgroup,active vs. sgroup,active different addresses, special case...
4256 * => should be merged
4259 .line = __location__,
4260 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4261 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4_OWNER_B => B:A_3_4_OWNER_B_X_3_4",
4265 .type = WREPL_TYPE_SGROUP,
4266 .state = WREPL_STATE_ACTIVE,
4267 .node = WREPL_NODE_B,
4269 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4270 .ips = addresses_A_3_4_X_3_4,
4271 .apply_expected = True,
4275 .type = WREPL_TYPE_SGROUP,
4276 .state = WREPL_STATE_ACTIVE,
4277 .node = WREPL_NODE_B,
4279 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4280 .ips = addresses_A_3_4_OWNER_B,
4281 .sgroup_merge = True,
4282 .merge_owner = &ctx->b,
4286 .line = __location__,
4287 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4291 .type = WREPL_TYPE_SGROUP,
4292 .state = WREPL_STATE_ACTIVE,
4293 .node = WREPL_NODE_B,
4297 .apply_expected = False,
4301 .type = WREPL_TYPE_SGROUP,
4302 .state = WREPL_STATE_ACTIVE,
4303 .node = WREPL_NODE_B,
4307 .apply_expected = False,
4311 * sgroup,active vs. sgroup,active partly different addresses, special case...
4312 * => should be merged
4315 .line = __location__,
4316 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4317 .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",
4321 .type = WREPL_TYPE_SGROUP,
4322 .state = WREPL_STATE_ACTIVE,
4323 .node = WREPL_NODE_B,
4325 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4326 .ips = addresses_B_3_4_X_3_4,
4327 .apply_expected = True,
4331 .type = WREPL_TYPE_SGROUP,
4332 .state = WREPL_STATE_ACTIVE,
4333 .node = WREPL_NODE_B,
4335 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_1_2),
4336 .ips = addresses_B_3_4_X_1_2,
4337 .sgroup_merge = True,
4338 .sgroup_cleanup = False
4342 .line = __location__,
4343 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4347 .type = WREPL_TYPE_SGROUP,
4348 .state = WREPL_STATE_ACTIVE,
4349 .node = WREPL_NODE_B,
4353 .apply_expected = False,
4357 .type = WREPL_TYPE_SGROUP,
4358 .state = WREPL_STATE_ACTIVE,
4359 .node = WREPL_NODE_B,
4363 .apply_expected = False,
4367 * sgroup,active vs. sgroup,active different addresses, special case...
4368 * => should be merged
4371 .line = __location__,
4372 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4373 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:X_3_4",
4377 .type = WREPL_TYPE_SGROUP,
4378 .state = WREPL_STATE_ACTIVE,
4379 .node = WREPL_NODE_B,
4381 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4382 .ips = addresses_B_3_4_X_3_4,
4383 .apply_expected = True,
4387 .type = WREPL_TYPE_SGROUP,
4388 .state = WREPL_STATE_ACTIVE,
4389 .node = WREPL_NODE_B,
4393 .sgroup_merge = True,
4394 .merge_owner = &ctx->b,
4395 .sgroup_cleanup = True
4399 .line = __location__,
4400 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4404 .type = WREPL_TYPE_SGROUP,
4405 .state = WREPL_STATE_ACTIVE,
4406 .node = WREPL_NODE_B,
4410 .apply_expected = False,
4414 .type = WREPL_TYPE_UNIQUE,
4415 .state = WREPL_STATE_TOMBSTONE,
4416 .node = WREPL_NODE_B,
4418 .num_ips = ARRAY_SIZE(addresses_A_1),
4419 .ips = addresses_A_1,
4420 .apply_expected = True,
4424 * This should be the last record in this array,
4425 * we need to make sure the we leave a tombstoned unique entry
4429 .line = __location__,
4430 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4434 .type = WREPL_TYPE_UNIQUE,
4435 .state = WREPL_STATE_TOMBSTONE,
4436 .node = WREPL_NODE_B,
4438 .num_ips = ARRAY_SIZE(addresses_A_1),
4439 .ips = addresses_A_1,
4440 .apply_expected = True
4444 .type = WREPL_TYPE_UNIQUE,
4445 .state = WREPL_STATE_TOMBSTONE,
4446 .node = WREPL_NODE_B,
4448 .num_ips = ARRAY_SIZE(addresses_A_1),
4449 .ips = addresses_A_1,
4450 .apply_expected = True
4452 }}; /* do not add entries here, this should be the last record! */
4454 if (!ctx) return False;
4456 wins_name_r1 = &wins_name1;
4457 wins_name_r2 = &wins_name2;
4459 printf("Test Replica Conflicts with different owners\n");
4461 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
4463 if (!records[i].extra && !records[i].cleanup) {
4464 /* we should test the worst cases */
4465 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
4466 printf("(%s) Programmer error, invalid record[%u]: %s\n",
4467 __location__, i, records[i].line);
4469 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
4470 printf("(%s) Programmer error, invalid record[%u]: %s\n",
4471 __location__, i, records[i].line);
4476 if (!records[i].cleanup) {
4477 const char *expected;
4480 if (records[i].r2.sgroup_merge) {
4481 expected = "SGROUP_MERGE";
4482 } else if (records[i].r2.apply_expected) {
4483 expected = "REPLACE";
4485 expected = "NOT REPLACE";
4488 if (!records[i].r1.ips && !records[i].r2.ips) {
4489 ips = "with no ip(s)";
4490 } else if (records[i].r1.ips==records[i].r2.ips) {
4491 ips = "with same ip(s)";
4493 ips = "with different ip(s)";
4496 printf("%s,%s%s vs. %s,%s%s %s => %s\n",
4497 wrepl_name_type_string(records[i].r1.type),
4498 wrepl_name_state_string(records[i].r1.state),
4499 (records[i].r1.is_static?",static":""),
4500 wrepl_name_type_string(records[i].r2.type),
4501 wrepl_name_state_string(records[i].r2.state),
4502 (records[i].r2.is_static?",static":""),
4503 (records[i].comment?records[i].comment:ips),
4510 wins_name_r1->name = &records[i].name;
4511 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
4512 records[i].r1.state,
4514 records[i].r1.is_static);
4515 wins_name_r1->id = ++records[i].r1.owner->max_version;
4516 if (wins_name_r1->flags & 2) {
4517 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
4518 wins_name_r1->addresses.addresses.ips = discard_const(records[i].r1.ips);
4520 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
4522 wins_name_r1->unknown = "255.255.255.255";
4525 ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1);
4526 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4527 wins_name_r1, records[i].r1.apply_expected);
4532 wins_name_r2->name = &records[i].name;
4533 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
4534 records[i].r2.state,
4536 records[i].r2.is_static);
4537 wins_name_r2->id = ++records[i].r2.owner->max_version;
4538 if (wins_name_r2->flags & 2) {
4539 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
4540 wins_name_r2->addresses.addresses.ips = discard_const(records[i].r2.ips);
4542 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
4544 wins_name_r2->unknown = "255.255.255.255";
4547 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4548 if (records[i].r1.state == WREPL_STATE_RELEASED) {
4549 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4550 wins_name_r1, False);
4551 } else if (records[i].r2.sgroup_merge) {
4552 ret &= test_wrepl_sgroup_merged(ctx, records[i].r2.merge_owner,
4553 records[i].r1.owner,
4554 records[i].r1.num_ips, records[i].r1.ips,
4555 records[i].r2.owner,
4556 records[i].r2.num_ips, records[i].r2.ips,
4558 } else if (records[i].r1.owner != records[i].r2.owner) {
4560 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
4561 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4562 wins_name_r1, _expected);
4564 if (records[i].r2.state == WREPL_STATE_RELEASED) {
4565 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
4566 wins_name_r2, False);
4567 } else if (!records[i].r2.sgroup_merge) {
4568 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
4569 wins_name_r2, records[i].r2.apply_expected);
4572 if (records[i].r2.sgroup_cleanup) {
4573 /* clean up the SGROUP record */
4574 wins_name_r1->name = &records[i].name;
4575 wins_name_r1->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4577 WREPL_NODE_B, False);
4578 wins_name_r1->id = ++records[i].r1.owner->max_version;
4579 wins_name_r1->addresses.addresses.num_ips = 0;
4580 wins_name_r1->addresses.addresses.ips = NULL;
4581 wins_name_r1->unknown = "255.255.255.255";
4582 ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1);
4584 /* here we test how names from an owner are deleted */
4585 if (records[i].r2.sgroup_merge && records[i].r2.num_ips) {
4586 ret &= test_wrepl_sgroup_merged(ctx, NULL,
4587 records[i].r2.owner,
4588 records[i].r2.num_ips, records[i].r2.ips,
4589 records[i].r1.owner,
4594 /* clean up the SGROUP record */
4595 wins_name_r2->name = &records[i].name;
4596 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4598 WREPL_NODE_B, False);
4599 wins_name_r2->id = ++records[i].r2.owner->max_version;
4600 wins_name_r2->addresses.addresses.num_ips = 0;
4601 wins_name_r2->addresses.addresses.ips = NULL;
4602 wins_name_r2->unknown = "255.255.255.255";
4603 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4605 /* take ownership of the SGROUP record */
4606 wins_name_r2->name = &records[i].name;
4607 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4609 WREPL_NODE_B, False);
4610 wins_name_r2->id = ++records[i].r2.owner->max_version;
4611 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4612 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4613 wins_name_r2->unknown = "255.255.255.255";
4614 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4615 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, True);
4617 /* overwrite the SGROUP record with unique,tombstone */
4618 wins_name_r2->name = &records[i].name;
4619 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4620 WREPL_STATE_TOMBSTONE,
4621 WREPL_NODE_B, False);
4622 wins_name_r2->id = ++records[i].r2.owner->max_version;
4623 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4624 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4625 wins_name_r2->unknown = "255.255.255.255";
4626 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4627 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, True);
4630 /* the first one is a cleanup run */
4631 if (!ret && i == 0) ret = True;
4634 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
4642 static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_conn *ctx)
4646 struct wrepl_wins_name wins_name_;
4647 struct wrepl_wins_name *wins_name = &wins_name_;
4648 struct nbt_name_register name_register_;
4649 struct nbt_name_register *name_register = &name_register_;
4650 struct nbt_name_release release_;
4651 struct nbt_name_release *release = &release_;
4654 const char *line; /* just better debugging */
4655 struct nbt_name name;
4660 const struct wrepl_ip *ips;
4661 BOOL apply_expected;
4664 enum wrepl_name_type type;
4665 enum wrepl_name_state state;
4666 enum wrepl_name_node node;
4669 const struct wrepl_ip *ips;
4670 BOOL apply_expected;
4674 * unique vs. unique section
4677 * unique,released vs. unique,active with same ip(s)
4680 .line = __location__,
4681 .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL),
4685 .num_ips = ctx->addresses_best_num,
4686 .ips = ctx->addresses_best,
4687 .apply_expected = True
4690 .type = WREPL_TYPE_UNIQUE,
4691 .state = WREPL_STATE_ACTIVE,
4692 .node = WREPL_NODE_B,
4694 .num_ips = ctx->addresses_best_num,
4695 .ips = ctx->addresses_best,
4696 .apply_expected = True
4700 * unique,released vs. unique,active with different ip(s)
4703 .line = __location__,
4704 .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL),
4708 .num_ips = ctx->addresses_best_num,
4709 .ips = ctx->addresses_best,
4710 .apply_expected = True
4713 .type = WREPL_TYPE_UNIQUE,
4714 .state = WREPL_STATE_ACTIVE,
4715 .node = WREPL_NODE_B,
4717 .num_ips = ARRAY_SIZE(addresses_B_1),
4718 .ips = addresses_B_1,
4719 .apply_expected = True
4723 * unique,released vs. unique,tombstone with same ip(s)
4726 .line = __location__,
4727 .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL),
4731 .num_ips = ctx->addresses_best_num,
4732 .ips = ctx->addresses_best,
4733 .apply_expected = True
4736 .type = WREPL_TYPE_UNIQUE,
4737 .state = WREPL_STATE_TOMBSTONE,
4738 .node = WREPL_NODE_B,
4740 .num_ips = ctx->addresses_best_num,
4741 .ips = ctx->addresses_best,
4742 .apply_expected = True
4746 * unique,released vs. unique,tombstone with different ip(s)
4749 .line = __location__,
4750 .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL),
4754 .num_ips = ctx->addresses_best_num,
4755 .ips = ctx->addresses_best,
4756 .apply_expected = True
4759 .type = WREPL_TYPE_UNIQUE,
4760 .state = WREPL_STATE_TOMBSTONE,
4761 .node = WREPL_NODE_B,
4763 .num_ips = ARRAY_SIZE(addresses_B_1),
4764 .ips = addresses_B_1,
4765 .apply_expected = True
4769 * unique vs. group section
4772 * unique,released vs. group,active with same ip(s)
4775 .line = __location__,
4776 .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL),
4780 .num_ips = ctx->addresses_best_num,
4781 .ips = ctx->addresses_best,
4782 .apply_expected = True
4785 .type = WREPL_TYPE_GROUP,
4786 .state = WREPL_STATE_ACTIVE,
4787 .node = WREPL_NODE_B,
4789 .num_ips = ctx->addresses_best_num,
4790 .ips = ctx->addresses_best,
4791 .apply_expected = True
4795 * unique,released vs. group,active with different ip(s)
4798 .line = __location__,
4799 .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL),
4803 .num_ips = ctx->addresses_best_num,
4804 .ips = ctx->addresses_best,
4805 .apply_expected = True
4808 .type = WREPL_TYPE_GROUP,
4809 .state = WREPL_STATE_ACTIVE,
4810 .node = WREPL_NODE_B,
4812 .num_ips = ARRAY_SIZE(addresses_B_1),
4813 .ips = addresses_B_1,
4814 .apply_expected = True
4818 * unique,released vs. group,tombstone with same ip(s)
4821 .line = __location__,
4822 .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL),
4826 .num_ips = ctx->addresses_best_num,
4827 .ips = ctx->addresses_best,
4828 .apply_expected = True
4831 .type = WREPL_TYPE_GROUP,
4832 .state = WREPL_STATE_TOMBSTONE,
4833 .node = WREPL_NODE_B,
4835 .num_ips = ctx->addresses_best_num,
4836 .ips = ctx->addresses_best,
4837 .apply_expected = True
4841 * unique,released vs. group,tombstone with different ip(s)
4844 .line = __location__,
4845 .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL),
4849 .num_ips = ctx->addresses_best_num,
4850 .ips = ctx->addresses_best,
4851 .apply_expected = True
4854 .type = WREPL_TYPE_GROUP,
4855 .state = WREPL_STATE_TOMBSTONE,
4856 .node = WREPL_NODE_B,
4858 .num_ips = ARRAY_SIZE(addresses_B_1),
4859 .ips = addresses_B_1,
4860 .apply_expected = True
4864 * unique vs. special group section
4867 * unique,released vs. sgroup,active with same ip(s)
4870 .line = __location__,
4871 .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL),
4875 .num_ips = ctx->addresses_best_num,
4876 .ips = ctx->addresses_best,
4877 .apply_expected = True
4880 .type = WREPL_TYPE_SGROUP,
4881 .state = WREPL_STATE_ACTIVE,
4882 .node = WREPL_NODE_B,
4884 .num_ips = ctx->addresses_best_num,
4885 .ips = ctx->addresses_best,
4886 .apply_expected = True
4890 * unique,released vs. sgroup,active with different ip(s)
4893 .line = __location__,
4894 .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL),
4898 .num_ips = ctx->addresses_best_num,
4899 .ips = ctx->addresses_best,
4900 .apply_expected = True
4903 .type = WREPL_TYPE_SGROUP,
4904 .state = WREPL_STATE_ACTIVE,
4905 .node = WREPL_NODE_B,
4907 .num_ips = ARRAY_SIZE(addresses_B_1),
4908 .ips = addresses_B_1,
4909 .apply_expected = True
4913 * unique,released vs. sgroup,tombstone with same ip(s)
4916 .line = __location__,
4917 .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL),
4921 .num_ips = ctx->addresses_best_num,
4922 .ips = ctx->addresses_best,
4923 .apply_expected = True
4926 .type = WREPL_TYPE_SGROUP,
4927 .state = WREPL_STATE_TOMBSTONE,
4928 .node = WREPL_NODE_B,
4930 .num_ips = ctx->addresses_best_num,
4931 .ips = ctx->addresses_best,
4932 .apply_expected = True
4936 * unique,released vs. sgroup,tombstone with different ip(s)
4939 .line = __location__,
4940 .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL),
4944 .num_ips = ctx->addresses_best_num,
4945 .ips = ctx->addresses_best,
4946 .apply_expected = True
4949 .type = WREPL_TYPE_SGROUP,
4950 .state = WREPL_STATE_TOMBSTONE,
4951 .node = WREPL_NODE_B,
4953 .num_ips = ARRAY_SIZE(addresses_B_1),
4954 .ips = addresses_B_1,
4955 .apply_expected = True
4959 * unique vs. multi homed section
4962 * unique,released vs. mhomed,active with same ip(s)
4965 .line = __location__,
4966 .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL),
4970 .num_ips = ctx->addresses_best_num,
4971 .ips = ctx->addresses_best,
4972 .apply_expected = True
4975 .type = WREPL_TYPE_MHOMED,
4976 .state = WREPL_STATE_ACTIVE,
4977 .node = WREPL_NODE_B,
4979 .num_ips = ctx->addresses_best_num,
4980 .ips = ctx->addresses_best,
4981 .apply_expected = True
4985 * unique,released vs. mhomed,active with different ip(s)
4988 .line = __location__,
4989 .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL),
4993 .num_ips = ctx->addresses_best_num,
4994 .ips = ctx->addresses_best,
4995 .apply_expected = True
4998 .type = WREPL_TYPE_MHOMED,
4999 .state = WREPL_STATE_ACTIVE,
5000 .node = WREPL_NODE_B,
5002 .num_ips = ARRAY_SIZE(addresses_B_1),
5003 .ips = addresses_B_1,
5004 .apply_expected = True
5008 * unique,released vs. mhomed,tombstone with same ip(s)
5011 .line = __location__,
5012 .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL),
5016 .num_ips = ctx->addresses_best_num,
5017 .ips = ctx->addresses_best,
5018 .apply_expected = True
5021 .type = WREPL_TYPE_MHOMED,
5022 .state = WREPL_STATE_TOMBSTONE,
5023 .node = WREPL_NODE_B,
5025 .num_ips = ctx->addresses_best_num,
5026 .ips = ctx->addresses_best,
5027 .apply_expected = True
5031 * unique,released vs. mhomed,tombstone with different ip(s)
5034 .line = __location__,
5035 .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL),
5039 .num_ips = ctx->addresses_best_num,
5040 .ips = ctx->addresses_best,
5041 .apply_expected = True
5044 .type = WREPL_TYPE_MHOMED,
5045 .state = WREPL_STATE_TOMBSTONE,
5046 .node = WREPL_NODE_B,
5048 .num_ips = ARRAY_SIZE(addresses_B_1),
5049 .ips = addresses_B_1,
5050 .apply_expected = True
5054 * group vs. unique section
5057 * group,released vs. unique,active with same ip(s)
5060 .line = __location__,
5061 .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL),
5063 .nb_flags = NBT_NM_GROUP,
5065 .num_ips = ctx->addresses_best_num,
5066 .ips = ctx->addresses_best,
5067 .apply_expected = True
5070 .type = WREPL_TYPE_UNIQUE,
5071 .state = WREPL_STATE_ACTIVE,
5072 .node = WREPL_NODE_B,
5074 .num_ips = ctx->addresses_best_num,
5075 .ips = ctx->addresses_best,
5076 .apply_expected = False
5080 * group,released vs. unique,active with different ip(s)
5083 .line = __location__,
5084 .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL),
5086 .nb_flags = NBT_NM_GROUP,
5088 .num_ips = ctx->addresses_best_num,
5089 .ips = ctx->addresses_best,
5090 .apply_expected = True
5093 .type = WREPL_TYPE_UNIQUE,
5094 .state = WREPL_STATE_ACTIVE,
5095 .node = WREPL_NODE_B,
5097 .num_ips = ARRAY_SIZE(addresses_B_1),
5098 .ips = addresses_B_1,
5099 .apply_expected = False
5103 * group,released vs. unique,tombstone with same ip(s)
5106 .line = __location__,
5107 .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL),
5109 .nb_flags = NBT_NM_GROUP,
5111 .num_ips = ctx->addresses_best_num,
5112 .ips = ctx->addresses_best,
5113 .apply_expected = True
5116 .type = WREPL_TYPE_UNIQUE,
5117 .state = WREPL_STATE_TOMBSTONE,
5118 .node = WREPL_NODE_B,
5120 .num_ips = ctx->addresses_best_num,
5121 .ips = ctx->addresses_best,
5122 .apply_expected = False
5126 * group,released vs. unique,tombstone with different ip(s)
5129 .line = __location__,
5130 .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL),
5132 .nb_flags = NBT_NM_GROUP,
5134 .num_ips = ctx->addresses_best_num,
5135 .ips = ctx->addresses_best,
5136 .apply_expected = True
5139 .type = WREPL_TYPE_UNIQUE,
5140 .state = WREPL_STATE_TOMBSTONE,
5141 .node = WREPL_NODE_B,
5143 .num_ips = ARRAY_SIZE(addresses_B_1),
5144 .ips = addresses_B_1,
5145 .apply_expected = False
5149 * group vs. group section
5152 * group,released vs. group,active with same ip(s)
5155 .line = __location__,
5156 .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL),
5158 .nb_flags = NBT_NM_GROUP,
5160 .num_ips = ctx->addresses_best_num,
5161 .ips = ctx->addresses_best,
5162 .apply_expected = True
5165 .type = WREPL_TYPE_GROUP,
5166 .state = WREPL_STATE_ACTIVE,
5167 .node = WREPL_NODE_B,
5169 .num_ips = ctx->addresses_best_num,
5170 .ips = ctx->addresses_best,
5171 .apply_expected = True
5175 * group,released vs. group,active with different ip(s)
5178 .line = __location__,
5179 .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL),
5181 .nb_flags = NBT_NM_GROUP,
5183 .num_ips = ctx->addresses_best_num,
5184 .ips = ctx->addresses_best,
5185 .apply_expected = True
5188 .type = WREPL_TYPE_GROUP,
5189 .state = WREPL_STATE_ACTIVE,
5190 .node = WREPL_NODE_B,
5192 .num_ips = ARRAY_SIZE(addresses_B_1),
5193 .ips = addresses_B_1,
5194 .apply_expected = True
5198 * group,released vs. group,tombstone with same ip(s)
5201 .line = __location__,
5202 .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL),
5204 .nb_flags = NBT_NM_GROUP,
5206 .num_ips = ctx->addresses_best_num,
5207 .ips = ctx->addresses_best,
5208 .apply_expected = True
5211 .type = WREPL_TYPE_GROUP,
5212 .state = WREPL_STATE_TOMBSTONE,
5213 .node = WREPL_NODE_B,
5215 .num_ips = ctx->addresses_best_num,
5216 .ips = ctx->addresses_best,
5217 .apply_expected = True
5221 * group,released vs. group,tombstone with different ip(s)
5224 .line = __location__,
5225 .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL),
5227 .nb_flags = NBT_NM_GROUP,
5229 .num_ips = ctx->addresses_best_num,
5230 .ips = ctx->addresses_best,
5231 .apply_expected = True
5234 .type = WREPL_TYPE_GROUP,
5235 .state = WREPL_STATE_TOMBSTONE,
5236 .node = WREPL_NODE_B,
5238 .num_ips = ARRAY_SIZE(addresses_B_1),
5239 .ips = addresses_B_1,
5240 .apply_expected = True
5244 * group vs. special group section
5247 * group,released vs. sgroup,active with same ip(s)
5250 .line = __location__,
5251 .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL),
5253 .nb_flags = NBT_NM_GROUP,
5255 .num_ips = ctx->addresses_best_num,
5256 .ips = ctx->addresses_best,
5257 .apply_expected = True
5260 .type = WREPL_TYPE_SGROUP,
5261 .state = WREPL_STATE_ACTIVE,
5262 .node = WREPL_NODE_B,
5264 .num_ips = ctx->addresses_best_num,
5265 .ips = ctx->addresses_best,
5266 .apply_expected = False
5270 * group,released vs. sgroup,active with different ip(s)
5273 .line = __location__,
5274 .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL),
5276 .nb_flags = NBT_NM_GROUP,
5278 .num_ips = ctx->addresses_best_num,
5279 .ips = ctx->addresses_best,
5280 .apply_expected = True
5283 .type = WREPL_TYPE_SGROUP,
5284 .state = WREPL_STATE_ACTIVE,
5285 .node = WREPL_NODE_B,
5287 .num_ips = ARRAY_SIZE(addresses_B_1),
5288 .ips = addresses_B_1,
5289 .apply_expected = False
5293 * group,released vs. sgroup,tombstone with same ip(s)
5296 .line = __location__,
5297 .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL),
5299 .nb_flags = NBT_NM_GROUP,
5301 .num_ips = ctx->addresses_best_num,
5302 .ips = ctx->addresses_best,
5303 .apply_expected = True
5306 .type = WREPL_TYPE_SGROUP,
5307 .state = WREPL_STATE_TOMBSTONE,
5308 .node = WREPL_NODE_B,
5310 .num_ips = ctx->addresses_best_num,
5311 .ips = ctx->addresses_best,
5312 .apply_expected = False
5316 * group,released vs. sgroup,tombstone with different ip(s)
5319 .line = __location__,
5320 .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL),
5322 .nb_flags = NBT_NM_GROUP,
5324 .num_ips = ctx->addresses_best_num,
5325 .ips = ctx->addresses_best,
5326 .apply_expected = True
5329 .type = WREPL_TYPE_SGROUP,
5330 .state = WREPL_STATE_TOMBSTONE,
5331 .node = WREPL_NODE_B,
5333 .num_ips = ARRAY_SIZE(addresses_B_1),
5334 .ips = addresses_B_1,
5335 .apply_expected = False
5339 * group vs. multi homed section
5342 * group,released vs. mhomed,active with same ip(s)
5345 .line = __location__,
5346 .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL),
5348 .nb_flags = NBT_NM_GROUP,
5350 .num_ips = ctx->addresses_best_num,
5351 .ips = ctx->addresses_best,
5352 .apply_expected = True
5355 .type = WREPL_TYPE_MHOMED,
5356 .state = WREPL_STATE_ACTIVE,
5357 .node = WREPL_NODE_B,
5359 .num_ips = ctx->addresses_best_num,
5360 .ips = ctx->addresses_best,
5361 .apply_expected = False
5365 * group,released vs. mhomed,active with different ip(s)
5368 .line = __location__,
5369 .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL),
5371 .nb_flags = NBT_NM_GROUP,
5373 .num_ips = ctx->addresses_best_num,
5374 .ips = ctx->addresses_best,
5375 .apply_expected = True
5378 .type = WREPL_TYPE_MHOMED,
5379 .state = WREPL_STATE_ACTIVE,
5380 .node = WREPL_NODE_B,
5382 .num_ips = ARRAY_SIZE(addresses_B_1),
5383 .ips = addresses_B_1,
5384 .apply_expected = False
5388 * group,released vs. mhomed,tombstone with same ip(s)
5391 .line = __location__,
5392 .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL),
5394 .nb_flags = NBT_NM_GROUP,
5396 .num_ips = ctx->addresses_best_num,
5397 .ips = ctx->addresses_best,
5398 .apply_expected = True
5401 .type = WREPL_TYPE_MHOMED,
5402 .state = WREPL_STATE_TOMBSTONE,
5403 .node = WREPL_NODE_B,
5405 .num_ips = ctx->addresses_best_num,
5406 .ips = ctx->addresses_best,
5407 .apply_expected = False
5411 * group,released vs. mhomed,tombstone with different ip(s)
5414 .line = __location__,
5415 .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL),
5417 .nb_flags = NBT_NM_GROUP,
5419 .num_ips = ctx->addresses_best_num,
5420 .ips = ctx->addresses_best,
5421 .apply_expected = True
5424 .type = WREPL_TYPE_MHOMED,
5425 .state = WREPL_STATE_TOMBSTONE,
5426 .node = WREPL_NODE_B,
5428 .num_ips = ARRAY_SIZE(addresses_B_1),
5429 .ips = addresses_B_1,
5430 .apply_expected = False
5434 * special group vs. unique section
5437 * sgroup,released vs. unique,active with same ip(s)
5440 .line = __location__,
5441 .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL),
5443 .nb_flags = NBT_NM_GROUP,
5445 .num_ips = ctx->addresses_best_num,
5446 .ips = ctx->addresses_best,
5447 .apply_expected = True
5450 .type = WREPL_TYPE_UNIQUE,
5451 .state = WREPL_STATE_ACTIVE,
5452 .node = WREPL_NODE_B,
5454 .num_ips = ctx->addresses_best_num,
5455 .ips = ctx->addresses_best,
5456 .apply_expected = True
5460 * sgroup,released vs. unique,active with different ip(s)
5463 .line = __location__,
5464 .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL),
5466 .nb_flags = NBT_NM_GROUP,
5468 .num_ips = ctx->addresses_best_num,
5469 .ips = ctx->addresses_best,
5470 .apply_expected = True
5473 .type = WREPL_TYPE_UNIQUE,
5474 .state = WREPL_STATE_ACTIVE,
5475 .node = WREPL_NODE_B,
5477 .num_ips = ARRAY_SIZE(addresses_B_1),
5478 .ips = addresses_B_1,
5479 .apply_expected = True
5483 * sgroup,released vs. unique,tombstone with same ip(s)
5486 .line = __location__,
5487 .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL),
5489 .nb_flags = NBT_NM_GROUP,
5491 .num_ips = ctx->addresses_best_num,
5492 .ips = ctx->addresses_best,
5493 .apply_expected = True
5496 .type = WREPL_TYPE_UNIQUE,
5497 .state = WREPL_STATE_TOMBSTONE,
5498 .node = WREPL_NODE_B,
5500 .num_ips = ctx->addresses_best_num,
5501 .ips = ctx->addresses_best,
5502 .apply_expected = True
5506 * sgroup,released vs. unique,tombstone with different ip(s)
5509 .line = __location__,
5510 .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL),
5512 .nb_flags = NBT_NM_GROUP,
5514 .num_ips = ctx->addresses_best_num,
5515 .ips = ctx->addresses_best,
5516 .apply_expected = True
5519 .type = WREPL_TYPE_UNIQUE,
5520 .state = WREPL_STATE_TOMBSTONE,
5521 .node = WREPL_NODE_B,
5523 .num_ips = ARRAY_SIZE(addresses_B_1),
5524 .ips = addresses_B_1,
5525 .apply_expected = True
5529 * special group vs. group section
5532 * sgroup,released vs. group,active with same ip(s)
5535 .line = __location__,
5536 .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL),
5538 .nb_flags = NBT_NM_GROUP,
5540 .num_ips = ctx->addresses_best_num,
5541 .ips = ctx->addresses_best,
5542 .apply_expected = True
5545 .type = WREPL_TYPE_GROUP,
5546 .state = WREPL_STATE_ACTIVE,
5547 .node = WREPL_NODE_B,
5549 .num_ips = ctx->addresses_best_num,
5550 .ips = ctx->addresses_best,
5551 .apply_expected = True
5555 * sgroup,released vs. group,active with different ip(s)
5558 .line = __location__,
5559 .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL),
5561 .nb_flags = NBT_NM_GROUP,
5563 .num_ips = ctx->addresses_best_num,
5564 .ips = ctx->addresses_best,
5565 .apply_expected = True
5568 .type = WREPL_TYPE_GROUP,
5569 .state = WREPL_STATE_ACTIVE,
5570 .node = WREPL_NODE_B,
5572 .num_ips = ARRAY_SIZE(addresses_B_1),
5573 .ips = addresses_B_1,
5574 .apply_expected = True
5578 * sgroup,released vs. group,tombstone with same ip(s)
5581 .line = __location__,
5582 .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL),
5584 .nb_flags = NBT_NM_GROUP,
5586 .num_ips = ctx->addresses_best_num,
5587 .ips = ctx->addresses_best,
5588 .apply_expected = True
5591 .type = WREPL_TYPE_GROUP,
5592 .state = WREPL_STATE_TOMBSTONE,
5593 .node = WREPL_NODE_B,
5595 .num_ips = ctx->addresses_best_num,
5596 .ips = ctx->addresses_best,
5597 .apply_expected = True
5601 * sgroup,released vs. group,tombstone with different ip(s)
5604 .line = __location__,
5605 .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL),
5607 .nb_flags = NBT_NM_GROUP,
5609 .num_ips = ctx->addresses_best_num,
5610 .ips = ctx->addresses_best,
5611 .apply_expected = True
5614 .type = WREPL_TYPE_GROUP,
5615 .state = WREPL_STATE_TOMBSTONE,
5616 .node = WREPL_NODE_B,
5618 .num_ips = ARRAY_SIZE(addresses_B_1),
5619 .ips = addresses_B_1,
5620 .apply_expected = True
5624 * special group vs. special group section
5627 * sgroup,released vs. sgroup,active with same ip(s)
5630 .line = __location__,
5631 .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL),
5633 .nb_flags = NBT_NM_GROUP,
5635 .num_ips = ctx->addresses_best_num,
5636 .ips = ctx->addresses_best,
5637 .apply_expected = True
5640 .type = WREPL_TYPE_SGROUP,
5641 .state = WREPL_STATE_ACTIVE,
5642 .node = WREPL_NODE_B,
5644 .num_ips = ctx->addresses_best_num,
5645 .ips = ctx->addresses_best,
5646 .apply_expected = True
5650 * sgroup,released vs. sgroup,active with different ip(s)
5653 .line = __location__,
5654 .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL),
5656 .nb_flags = NBT_NM_GROUP,
5658 .num_ips = ctx->addresses_best_num,
5659 .ips = ctx->addresses_best,
5660 .apply_expected = True
5663 .type = WREPL_TYPE_SGROUP,
5664 .state = WREPL_STATE_ACTIVE,
5665 .node = WREPL_NODE_B,
5667 .num_ips = ARRAY_SIZE(addresses_B_1),
5668 .ips = addresses_B_1,
5669 .apply_expected = True
5673 * sgroup,released vs. sgroup,tombstone with same ip(s)
5676 .line = __location__,
5677 .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL),
5679 .nb_flags = NBT_NM_GROUP,
5681 .num_ips = ctx->addresses_best_num,
5682 .ips = ctx->addresses_best,
5683 .apply_expected = True
5686 .type = WREPL_TYPE_SGROUP,
5687 .state = WREPL_STATE_TOMBSTONE,
5688 .node = WREPL_NODE_B,
5690 .num_ips = ctx->addresses_best_num,
5691 .ips = ctx->addresses_best,
5692 .apply_expected = True
5696 * sgroup,released vs. sgroup,tombstone with different ip(s)
5699 .line = __location__,
5700 .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL),
5702 .nb_flags = NBT_NM_GROUP,
5704 .num_ips = ctx->addresses_best_num,
5705 .ips = ctx->addresses_best,
5706 .apply_expected = True
5709 .type = WREPL_TYPE_SGROUP,
5710 .state = WREPL_STATE_TOMBSTONE,
5711 .node = WREPL_NODE_B,
5713 .num_ips = ARRAY_SIZE(addresses_B_1),
5714 .ips = addresses_B_1,
5715 .apply_expected = True
5719 * special group vs. multi homed section
5722 * sgroup,released vs. mhomed,active with same ip(s)
5725 .line = __location__,
5726 .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL),
5728 .nb_flags = NBT_NM_GROUP,
5730 .num_ips = ctx->addresses_best_num,
5731 .ips = ctx->addresses_best,
5732 .apply_expected = True
5735 .type = WREPL_TYPE_MHOMED,
5736 .state = WREPL_STATE_ACTIVE,
5737 .node = WREPL_NODE_B,
5739 .num_ips = ctx->addresses_best_num,
5740 .ips = ctx->addresses_best,
5741 .apply_expected = True
5745 * sgroup,released vs. mhomed,active with different ip(s)
5748 .line = __location__,
5749 .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL),
5751 .nb_flags = NBT_NM_GROUP,
5753 .num_ips = ctx->addresses_best_num,
5754 .ips = ctx->addresses_best,
5755 .apply_expected = True
5758 .type = WREPL_TYPE_MHOMED,
5759 .state = WREPL_STATE_ACTIVE,
5760 .node = WREPL_NODE_B,
5762 .num_ips = ARRAY_SIZE(addresses_B_1),
5763 .ips = addresses_B_1,
5764 .apply_expected = True
5768 * sgroup,released vs. mhomed,tombstone with same ip(s)
5771 .line = __location__,
5772 .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL),
5774 .nb_flags = NBT_NM_GROUP,
5776 .num_ips = ctx->addresses_best_num,
5777 .ips = ctx->addresses_best,
5778 .apply_expected = True
5781 .type = WREPL_TYPE_MHOMED,
5782 .state = WREPL_STATE_TOMBSTONE,
5783 .node = WREPL_NODE_B,
5785 .num_ips = ctx->addresses_best_num,
5786 .ips = ctx->addresses_best,
5787 .apply_expected = True
5791 * sgroup,released vs. mhomed,tombstone with different ip(s)
5794 .line = __location__,
5795 .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL),
5797 .nb_flags = NBT_NM_GROUP,
5799 .num_ips = ctx->addresses_best_num,
5800 .ips = ctx->addresses_best,
5801 .apply_expected = True
5804 .type = WREPL_TYPE_MHOMED,
5805 .state = WREPL_STATE_TOMBSTONE,
5806 .node = WREPL_NODE_B,
5808 .num_ips = ARRAY_SIZE(addresses_B_1),
5809 .ips = addresses_B_1,
5810 .apply_expected = True
5814 * multi homed vs. unique section
5817 * mhomed,released vs. unique,active with same ip(s)
5820 .line = __location__,
5821 .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL),
5825 .num_ips = ctx->addresses_best_num,
5826 .ips = ctx->addresses_best,
5827 .apply_expected = True
5830 .type = WREPL_TYPE_UNIQUE,
5831 .state = WREPL_STATE_ACTIVE,
5832 .node = WREPL_NODE_B,
5834 .num_ips = ctx->addresses_best_num,
5835 .ips = ctx->addresses_best,
5836 .apply_expected = True
5840 * mhomed,released vs. unique,active with different ip(s)
5843 .line = __location__,
5844 .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL),
5848 .num_ips = ctx->addresses_best_num,
5849 .ips = ctx->addresses_best,
5850 .apply_expected = True
5853 .type = WREPL_TYPE_UNIQUE,
5854 .state = WREPL_STATE_ACTIVE,
5855 .node = WREPL_NODE_B,
5857 .num_ips = ARRAY_SIZE(addresses_B_1),
5858 .ips = addresses_B_1,
5859 .apply_expected = True
5863 * mhomed,released vs. unique,tombstone with same ip(s)
5866 .line = __location__,
5867 .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL),
5871 .num_ips = ctx->addresses_best_num,
5872 .ips = ctx->addresses_best,
5873 .apply_expected = True
5876 .type = WREPL_TYPE_UNIQUE,
5877 .state = WREPL_STATE_TOMBSTONE,
5878 .node = WREPL_NODE_B,
5880 .num_ips = ctx->addresses_best_num,
5881 .ips = ctx->addresses_best,
5882 .apply_expected = True
5886 * mhomed,released vs. unique,tombstone with different ip(s)
5889 .line = __location__,
5890 .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL),
5894 .num_ips = ctx->addresses_best_num,
5895 .ips = ctx->addresses_best,
5896 .apply_expected = True
5899 .type = WREPL_TYPE_UNIQUE,
5900 .state = WREPL_STATE_TOMBSTONE,
5901 .node = WREPL_NODE_B,
5903 .num_ips = ARRAY_SIZE(addresses_B_1),
5904 .ips = addresses_B_1,
5905 .apply_expected = True
5909 * multi homed vs. group section
5912 * mhomed,released vs. group,active with same ip(s)
5915 .line = __location__,
5916 .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL),
5920 .num_ips = ctx->addresses_best_num,
5921 .ips = ctx->addresses_best,
5922 .apply_expected = True
5925 .type = WREPL_TYPE_GROUP,
5926 .state = WREPL_STATE_ACTIVE,
5927 .node = WREPL_NODE_B,
5929 .num_ips = ctx->addresses_best_num,
5930 .ips = ctx->addresses_best,
5931 .apply_expected = True
5935 * mhomed,released vs. group,active with different ip(s)
5938 .line = __location__,
5939 .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL),
5943 .num_ips = ctx->addresses_best_num,
5944 .ips = ctx->addresses_best,
5945 .apply_expected = True
5948 .type = WREPL_TYPE_GROUP,
5949 .state = WREPL_STATE_ACTIVE,
5950 .node = WREPL_NODE_B,
5952 .num_ips = ARRAY_SIZE(addresses_B_1),
5953 .ips = addresses_B_1,
5954 .apply_expected = True
5958 * mhomed,released vs. group,tombstone with same ip(s)
5961 .line = __location__,
5962 .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL),
5966 .num_ips = ctx->addresses_best_num,
5967 .ips = ctx->addresses_best,
5968 .apply_expected = True
5971 .type = WREPL_TYPE_GROUP,
5972 .state = WREPL_STATE_TOMBSTONE,
5973 .node = WREPL_NODE_B,
5975 .num_ips = ctx->addresses_best_num,
5976 .ips = ctx->addresses_best,
5977 .apply_expected = True
5981 * mhomed,released vs. group,tombstone with different ip(s)
5984 .line = __location__,
5985 .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL),
5989 .num_ips = ctx->addresses_best_num,
5990 .ips = ctx->addresses_best,
5991 .apply_expected = True
5994 .type = WREPL_TYPE_GROUP,
5995 .state = WREPL_STATE_TOMBSTONE,
5996 .node = WREPL_NODE_B,
5998 .num_ips = ARRAY_SIZE(addresses_B_1),
5999 .ips = addresses_B_1,
6000 .apply_expected = True
6004 * multi homed vs. special group section
6007 * mhomed,released vs. sgroup,active with same ip(s)
6010 .line = __location__,
6011 .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL),
6015 .num_ips = ctx->addresses_best_num,
6016 .ips = ctx->addresses_best,
6017 .apply_expected = True
6020 .type = WREPL_TYPE_SGROUP,
6021 .state = WREPL_STATE_ACTIVE,
6022 .node = WREPL_NODE_B,
6024 .num_ips = ctx->addresses_best_num,
6025 .ips = ctx->addresses_best,
6026 .apply_expected = True
6030 * mhomed,released vs. sgroup,active with different ip(s)
6033 .line = __location__,
6034 .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL),
6038 .num_ips = ctx->addresses_best_num,
6039 .ips = ctx->addresses_best,
6040 .apply_expected = True
6043 .type = WREPL_TYPE_SGROUP,
6044 .state = WREPL_STATE_ACTIVE,
6045 .node = WREPL_NODE_B,
6047 .num_ips = ARRAY_SIZE(addresses_B_1),
6048 .ips = addresses_B_1,
6049 .apply_expected = True
6053 * mhomed,released vs. sgroup,tombstone with same ip(s)
6056 .line = __location__,
6057 .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL),
6061 .num_ips = ctx->addresses_best_num,
6062 .ips = ctx->addresses_best,
6063 .apply_expected = True
6066 .type = WREPL_TYPE_SGROUP,
6067 .state = WREPL_STATE_TOMBSTONE,
6068 .node = WREPL_NODE_B,
6070 .num_ips = ctx->addresses_best_num,
6071 .ips = ctx->addresses_best,
6072 .apply_expected = True
6076 * mhomed,released vs. sgroup,tombstone with different ip(s)
6079 .line = __location__,
6080 .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL),
6084 .num_ips = ctx->addresses_best_num,
6085 .ips = ctx->addresses_best,
6086 .apply_expected = True
6089 .type = WREPL_TYPE_SGROUP,
6090 .state = WREPL_STATE_TOMBSTONE,
6091 .node = WREPL_NODE_B,
6093 .num_ips = ARRAY_SIZE(addresses_B_1),
6094 .ips = addresses_B_1,
6095 .apply_expected = True
6099 * multi homed vs. multi homed section
6102 * mhomed,released vs. mhomed,active with same ip(s)
6105 .line = __location__,
6106 .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL),
6110 .num_ips = ctx->addresses_best_num,
6111 .ips = ctx->addresses_best,
6112 .apply_expected = True
6115 .type = WREPL_TYPE_MHOMED,
6116 .state = WREPL_STATE_ACTIVE,
6117 .node = WREPL_NODE_B,
6119 .num_ips = ctx->addresses_best_num,
6120 .ips = ctx->addresses_best,
6121 .apply_expected = True
6125 * mhomed,released vs. mhomed,active with different ip(s)
6128 .line = __location__,
6129 .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL),
6133 .num_ips = ctx->addresses_best_num,
6134 .ips = ctx->addresses_best,
6135 .apply_expected = True
6138 .type = WREPL_TYPE_MHOMED,
6139 .state = WREPL_STATE_ACTIVE,
6140 .node = WREPL_NODE_B,
6142 .num_ips = ARRAY_SIZE(addresses_B_1),
6143 .ips = addresses_B_1,
6144 .apply_expected = True
6148 * mhomed,released vs. mhomed,tombstone with same ip(s)
6151 .line = __location__,
6152 .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL),
6156 .num_ips = ctx->addresses_best_num,
6157 .ips = ctx->addresses_best,
6158 .apply_expected = True
6161 .type = WREPL_TYPE_MHOMED,
6162 .state = WREPL_STATE_TOMBSTONE,
6163 .node = WREPL_NODE_B,
6165 .num_ips = ctx->addresses_best_num,
6166 .ips = ctx->addresses_best,
6167 .apply_expected = True
6171 * mhomed,released vs. mhomed,tombstone with different ip(s)
6174 .line = __location__,
6175 .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL),
6179 .num_ips = ctx->addresses_best_num,
6180 .ips = ctx->addresses_best,
6181 .apply_expected = True
6184 .type = WREPL_TYPE_MHOMED,
6185 .state = WREPL_STATE_TOMBSTONE,
6186 .node = WREPL_NODE_B,
6188 .num_ips = ARRAY_SIZE(addresses_B_1),
6189 .ips = addresses_B_1,
6190 .apply_expected = True
6195 if (!ctx) return False;
6197 printf("Test Replica records vs. owned released records\n");
6199 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
6200 printf("%s => %s\n", nbt_name_string(ctx, &records[i].name),
6201 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
6206 name_register->in.name = records[i].name;
6207 name_register->in.dest_addr = ctx->address;
6208 name_register->in.address = records[i].wins.ips[0].ip;
6209 name_register->in.nb_flags = records[i].wins.nb_flags;
6210 name_register->in.register_demand= False;
6211 name_register->in.broadcast = False;
6212 name_register->in.multi_homed = records[i].wins.mhomed;
6213 name_register->in.ttl = 300000;
6214 name_register->in.timeout = 70;
6215 name_register->in.retries = 0;
6217 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
6218 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6219 printf("No response from %s for name register\n", ctx->address);
6222 if (!NT_STATUS_IS_OK(status)) {
6223 printf("Bad response from %s for name register - %s\n",
6224 ctx->address, nt_errstr(status));
6227 CHECK_VALUE(name_register->out.rcode, 0);
6228 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
6229 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
6230 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
6231 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
6232 CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[0].ip);
6234 /* release the record */
6235 release->in.name = records[i].name;
6236 release->in.dest_addr = ctx->address;
6237 release->in.address = records[i].wins.ips[0].ip;
6238 release->in.nb_flags = records[i].wins.nb_flags;
6239 release->in.broadcast = False;
6240 release->in.timeout = 30;
6241 release->in.retries = 0;
6243 status = nbt_name_release(ctx->nbtsock, ctx, release);
6244 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6245 printf("No response from %s for name release\n", ctx->address);
6248 if (!NT_STATUS_IS_OK(status)) {
6249 printf("Bad response from %s for name query - %s\n",
6250 ctx->address, nt_errstr(status));
6253 CHECK_VALUE(release->out.rcode, 0);
6258 wins_name->name = &records[i].name;
6259 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
6260 records[i].replica.state,
6261 records[i].replica.node,
6262 records[i].replica.is_static);
6263 wins_name->id = ++ctx->b.max_version;
6264 if (wins_name->flags & 2) {
6265 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
6266 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
6268 wins_name->addresses.ip = records[i].replica.ips[0].ip;
6270 wins_name->unknown = "255.255.255.255";
6272 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
6273 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
6274 records[i].replica.apply_expected);
6276 if (records[i].replica.apply_expected) {
6277 wins_name->name = &records[i].name;
6278 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
6279 WREPL_STATE_TOMBSTONE,
6280 WREPL_NODE_B, False);
6281 wins_name->id = ++ctx->b.max_version;
6282 wins_name->addresses.ip = addresses_B_1[0].ip;
6283 wins_name->unknown = "255.255.255.255";
6285 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
6286 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
6288 release->in.name = records[i].name;
6289 release->in.dest_addr = ctx->address;
6290 release->in.address = records[i].wins.ips[0].ip;
6291 release->in.nb_flags = records[i].wins.nb_flags;
6292 release->in.broadcast = False;
6293 release->in.timeout = 30;
6294 release->in.retries = 0;
6296 status = nbt_name_release(ctx->nbtsock, ctx, release);
6297 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6298 printf("No response from %s for name release\n", ctx->address);
6301 if (!NT_STATUS_IS_OK(status)) {
6302 printf("Bad response from %s for name query - %s\n",
6303 ctx->address, nt_errstr(status));
6306 CHECK_VALUE(release->out.rcode, 0);
6310 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
6318 struct test_conflict_owned_active_vs_replica_struct {
6319 const char *line; /* just better debugging */
6320 const char *section; /* just better debugging */
6321 struct nbt_name name;
6327 const struct wrepl_ip *ips;
6328 BOOL apply_expected;
6333 BOOL expect_release;
6336 /* when num_ips == 0, then .wins.ips are used */
6338 const struct wrepl_ip *ips;
6341 enum wrepl_name_type type;
6342 enum wrepl_name_state state;
6343 enum wrepl_name_node node;
6346 const struct wrepl_ip *ips;
6347 BOOL apply_expected;
6353 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
6354 struct nbt_name_packet *req_packet,
6355 const struct nbt_peer_socket *src);
6357 static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_conn *ctx)
6361 struct wrepl_wins_name wins_name_;
6362 struct wrepl_wins_name *wins_name = &wins_name_;
6363 struct nbt_name_register name_register_;
6364 struct nbt_name_register *name_register = &name_register_;
6365 struct nbt_name_release release_;
6366 struct nbt_name_release *release = &release_;
6368 struct test_conflict_owned_active_vs_replica_struct records[] = {
6370 * unique vs. unique section
6373 * unique,active vs. unique,active with same ip(s), unchecked
6376 .line = __location__,
6377 .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL),
6381 .num_ips = ctx->addresses_best_num,
6382 .ips = ctx->addresses_best,
6383 .apply_expected = True
6389 .type = WREPL_TYPE_UNIQUE,
6390 .state = WREPL_STATE_ACTIVE,
6391 .node = WREPL_NODE_B,
6393 .num_ips = ctx->addresses_best_num,
6394 .ips = ctx->addresses_best,
6395 .apply_expected = True
6399 * unique,active vs. unique,active with different ip(s), positive response
6402 .line = __location__,
6403 .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL),
6407 .num_ips = ctx->addresses_best_num,
6408 .ips = ctx->addresses_best,
6409 .apply_expected = True
6416 .type = WREPL_TYPE_UNIQUE,
6417 .state = WREPL_STATE_ACTIVE,
6418 .node = WREPL_NODE_B,
6420 .num_ips = ARRAY_SIZE(addresses_B_1),
6421 .ips = addresses_B_1,
6422 .apply_expected = False
6426 * unique,active vs. unique,active with different ip(s), positive response other ips
6429 .line = __location__,
6430 .name = _NBT_NAME("_UA_UA_DI_O", 0x00, NULL),
6434 .num_ips = ctx->addresses_best_num,
6435 .ips = ctx->addresses_best,
6436 .apply_expected = True
6441 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6442 .ips = addresses_A_3_4,
6445 .type = WREPL_TYPE_UNIQUE,
6446 .state = WREPL_STATE_ACTIVE,
6447 .node = WREPL_NODE_B,
6449 .num_ips = ARRAY_SIZE(addresses_B_1),
6450 .ips = addresses_B_1,
6451 .apply_expected = False
6455 * unique,active vs. unique,active with different ip(s), negative response
6458 .line = __location__,
6459 .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL),
6463 .num_ips = ctx->addresses_best_num,
6464 .ips = ctx->addresses_best,
6465 .apply_expected = True
6472 .type = WREPL_TYPE_UNIQUE,
6473 .state = WREPL_STATE_ACTIVE,
6474 .node = WREPL_NODE_B,
6476 .num_ips = ARRAY_SIZE(addresses_B_1),
6477 .ips = addresses_B_1,
6478 .apply_expected = True
6482 * unique,active vs. unique,tombstone with same ip(s), unchecked
6485 .line = __location__,
6486 .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL),
6490 .num_ips = ctx->addresses_best_num,
6491 .ips = ctx->addresses_best,
6492 .apply_expected = True
6498 .type = WREPL_TYPE_UNIQUE,
6499 .state = WREPL_STATE_TOMBSTONE,
6500 .node = WREPL_NODE_B,
6502 .num_ips = ctx->addresses_best_num,
6503 .ips = ctx->addresses_best,
6504 .apply_expected = False
6508 * unique,active vs. unique,tombstone with different ip(s), unchecked
6511 .line = __location__,
6512 .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL),
6516 .num_ips = ctx->addresses_best_num,
6517 .ips = ctx->addresses_best,
6518 .apply_expected = True
6524 .type = WREPL_TYPE_UNIQUE,
6525 .state = WREPL_STATE_TOMBSTONE,
6526 .node = WREPL_NODE_B,
6528 .num_ips = ARRAY_SIZE(addresses_B_1),
6529 .ips = addresses_B_1,
6530 .apply_expected = False
6534 * unique vs. group section
6537 * unique,active vs. group,active with same ip(s), release expected
6540 .line = __location__,
6541 .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL),
6545 .num_ips = ctx->addresses_best_num,
6546 .ips = ctx->addresses_best,
6547 .apply_expected = True
6551 .expect_release = True,
6554 .type = WREPL_TYPE_GROUP,
6555 .state = WREPL_STATE_ACTIVE,
6556 .node = WREPL_NODE_B,
6558 .num_ips = ctx->addresses_best_num,
6559 .ips = ctx->addresses_best,
6560 .apply_expected = True
6564 * unique,active vs. group,active with different ip(s), release expected
6567 .line = __location__,
6568 .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL),
6572 .num_ips = ctx->addresses_best_num,
6573 .ips = ctx->addresses_best,
6574 .apply_expected = True
6578 .expect_release = True,
6581 .type = WREPL_TYPE_GROUP,
6582 .state = WREPL_STATE_ACTIVE,
6583 .node = WREPL_NODE_B,
6585 .num_ips = ARRAY_SIZE(addresses_B_1),
6586 .ips = addresses_B_1,
6587 .apply_expected = True
6591 * unique,active vs. group,tombstone with same ip(s), unchecked
6594 .line = __location__,
6595 .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL),
6599 .num_ips = ctx->addresses_best_num,
6600 .ips = ctx->addresses_best,
6601 .apply_expected = True
6607 .type = WREPL_TYPE_GROUP,
6608 .state = WREPL_STATE_TOMBSTONE,
6609 .node = WREPL_NODE_B,
6611 .num_ips = ctx->addresses_best_num,
6612 .ips = ctx->addresses_best,
6613 .apply_expected = False
6617 * unique,active vs. group,tombstone with different ip(s), unchecked
6620 .line = __location__,
6621 .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL),
6625 .num_ips = ctx->addresses_best_num,
6626 .ips = ctx->addresses_best,
6627 .apply_expected = True
6633 .type = WREPL_TYPE_GROUP,
6634 .state = WREPL_STATE_TOMBSTONE,
6635 .node = WREPL_NODE_B,
6637 .num_ips = ARRAY_SIZE(addresses_B_1),
6638 .ips = addresses_B_1,
6639 .apply_expected = False
6643 * unique vs. special group section
6646 * unique,active vs. sgroup,active with same ip(s), release expected
6649 .line = __location__,
6650 .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL),
6654 .num_ips = ctx->addresses_best_num,
6655 .ips = ctx->addresses_best,
6656 .apply_expected = True
6660 .expect_release = True,
6663 .type = WREPL_TYPE_SGROUP,
6664 .state = WREPL_STATE_ACTIVE,
6665 .node = WREPL_NODE_B,
6667 .num_ips = ctx->addresses_best_num,
6668 .ips = ctx->addresses_best,
6669 .apply_expected = True
6673 * unique,active vs. group,active with different ip(s), release expected
6676 .line = __location__,
6677 .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL),
6681 .num_ips = ctx->addresses_best_num,
6682 .ips = ctx->addresses_best,
6683 .apply_expected = True
6687 .expect_release = True,
6690 .type = WREPL_TYPE_SGROUP,
6691 .state = WREPL_STATE_ACTIVE,
6692 .node = WREPL_NODE_B,
6694 .num_ips = ARRAY_SIZE(addresses_B_1),
6695 .ips = addresses_B_1,
6696 .apply_expected = True
6700 * unique,active vs. sgroup,tombstone with same ip(s), unchecked
6703 .line = __location__,
6704 .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL),
6708 .num_ips = ctx->addresses_best_num,
6709 .ips = ctx->addresses_best,
6710 .apply_expected = True
6716 .type = WREPL_TYPE_SGROUP,
6717 .state = WREPL_STATE_TOMBSTONE,
6718 .node = WREPL_NODE_B,
6720 .num_ips = ctx->addresses_best_num,
6721 .ips = ctx->addresses_best,
6722 .apply_expected = False
6726 * unique,active vs. sgroup,tombstone with different ip(s), unchecked
6729 .line = __location__,
6730 .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL),
6734 .num_ips = ctx->addresses_best_num,
6735 .ips = ctx->addresses_best,
6736 .apply_expected = True
6742 .type = WREPL_TYPE_SGROUP,
6743 .state = WREPL_STATE_TOMBSTONE,
6744 .node = WREPL_NODE_B,
6746 .num_ips = ARRAY_SIZE(addresses_B_1),
6747 .ips = addresses_B_1,
6748 .apply_expected = False
6752 * unique vs. multi homed section
6755 * unique,active vs. mhomed,active with same ip(s), unchecked
6758 .line = __location__,
6759 .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL),
6763 .num_ips = ctx->addresses_best_num,
6764 .ips = ctx->addresses_best,
6765 .apply_expected = True
6771 .type = WREPL_TYPE_MHOMED,
6772 .state = WREPL_STATE_ACTIVE,
6773 .node = WREPL_NODE_B,
6775 .num_ips = ctx->addresses_best_num,
6776 .ips = ctx->addresses_best,
6777 .apply_expected = True
6781 * unique,active vs. mhomed,active with superset ip(s), unchecked
6784 .line = __location__,
6785 .name = _NBT_NAME("_UA_MA_SP_U", 0x00, NULL),
6789 .num_ips = ctx->addresses_best_num,
6790 .ips = ctx->addresses_best,
6791 .apply_expected = True
6797 .type = WREPL_TYPE_MHOMED,
6798 .state = WREPL_STATE_ACTIVE,
6799 .node = WREPL_NODE_B,
6801 .num_ips = ctx->addresses_all_num,
6802 .ips = ctx->addresses_all,
6803 .apply_expected = True
6807 * unique,active vs. mhomed,active with different ip(s), positive response
6810 .line = __location__,
6811 .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL),
6815 .num_ips = ctx->addresses_best_num,
6816 .ips = ctx->addresses_best,
6817 .apply_expected = True
6824 .type = WREPL_TYPE_MHOMED,
6825 .state = WREPL_STATE_ACTIVE,
6826 .node = WREPL_NODE_B,
6828 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6829 .ips = addresses_B_3_4,
6830 .apply_expected = False
6834 * unique,active vs. mhomed,active with different ip(s), positive response other ips
6837 .line = __location__,
6838 .name = _NBT_NAME("_UA_MA_DI_O", 0x00, NULL),
6842 .num_ips = ctx->addresses_best_num,
6843 .ips = ctx->addresses_best,
6844 .apply_expected = True
6849 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6850 .ips = addresses_A_3_4,
6853 .type = WREPL_TYPE_MHOMED,
6854 .state = WREPL_STATE_ACTIVE,
6855 .node = WREPL_NODE_B,
6857 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6858 .ips = addresses_B_3_4,
6859 .apply_expected = False
6863 * unique,active vs. mhomed,active with different ip(s), negative response
6866 .line = __location__,
6867 .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL),
6871 .num_ips = ctx->addresses_best_num,
6872 .ips = ctx->addresses_best,
6873 .apply_expected = True
6880 .type = WREPL_TYPE_MHOMED,
6881 .state = WREPL_STATE_ACTIVE,
6882 .node = WREPL_NODE_B,
6884 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6885 .ips = addresses_B_3_4,
6886 .apply_expected = True
6890 * unique,active vs. mhomed,tombstone with same ip(s), unchecked
6893 .line = __location__,
6894 .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL),
6898 .num_ips = ctx->addresses_best_num,
6899 .ips = ctx->addresses_best,
6900 .apply_expected = True
6906 .type = WREPL_TYPE_MHOMED,
6907 .state = WREPL_STATE_TOMBSTONE,
6908 .node = WREPL_NODE_B,
6910 .num_ips = ctx->addresses_best_num,
6911 .ips = ctx->addresses_best,
6912 .apply_expected = False
6916 * unique,active vs. mhomed,tombstone with different ip(s), unchecked
6919 .line = __location__,
6920 .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL),
6924 .num_ips = ctx->addresses_best_num,
6925 .ips = ctx->addresses_best,
6926 .apply_expected = True
6932 .type = WREPL_TYPE_MHOMED,
6933 .state = WREPL_STATE_TOMBSTONE,
6934 .node = WREPL_NODE_B,
6936 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6937 .ips = addresses_B_3_4,
6938 .apply_expected = False
6942 * normal group vs. unique section
6945 * group,active vs. unique,active with same ip(s), unchecked
6948 .line = __location__,
6949 .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL),
6951 .nb_flags = NBT_NM_GROUP,
6953 .num_ips = ctx->addresses_best_num,
6954 .ips = ctx->addresses_best,
6955 .apply_expected = True
6961 .type = WREPL_TYPE_UNIQUE,
6962 .state = WREPL_STATE_ACTIVE,
6963 .node = WREPL_NODE_B,
6965 .num_ips = ctx->addresses_best_num,
6966 .ips = ctx->addresses_best,
6967 .apply_expected = False
6971 * group,active vs. unique,active with different ip(s), unchecked
6974 .line = __location__,
6975 .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL),
6977 .nb_flags = NBT_NM_GROUP,
6979 .num_ips = ctx->addresses_best_num,
6980 .ips = ctx->addresses_best,
6981 .apply_expected = True
6987 .type = WREPL_TYPE_UNIQUE,
6988 .state = WREPL_STATE_ACTIVE,
6989 .node = WREPL_NODE_B,
6991 .num_ips = ARRAY_SIZE(addresses_B_1),
6992 .ips = addresses_B_1,
6993 .apply_expected = False
6997 * group,active vs. unique,tombstone with same ip(s), unchecked
7000 .line = __location__,
7001 .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL),
7003 .nb_flags = NBT_NM_GROUP,
7005 .num_ips = ctx->addresses_best_num,
7006 .ips = ctx->addresses_best,
7007 .apply_expected = True
7013 .type = WREPL_TYPE_UNIQUE,
7014 .state = WREPL_STATE_TOMBSTONE,
7015 .node = WREPL_NODE_B,
7017 .num_ips = ctx->addresses_best_num,
7018 .ips = ctx->addresses_best,
7019 .apply_expected = False
7023 * group,active vs. unique,tombstone with different ip(s), unchecked
7026 .line = __location__,
7027 .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL),
7029 .nb_flags = NBT_NM_GROUP,
7031 .num_ips = ctx->addresses_best_num,
7032 .ips = ctx->addresses_best,
7033 .apply_expected = True
7039 .type = WREPL_TYPE_UNIQUE,
7040 .state = WREPL_STATE_TOMBSTONE,
7041 .node = WREPL_NODE_B,
7043 .num_ips = ARRAY_SIZE(addresses_B_1),
7044 .ips = addresses_B_1,
7045 .apply_expected = False
7049 * normal group vs. normal group section
7052 * group,active vs. group,active with same ip(s), unchecked
7055 .line = __location__,
7056 .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL),
7058 .nb_flags = NBT_NM_GROUP,
7060 .num_ips = ctx->addresses_best_num,
7061 .ips = ctx->addresses_best,
7062 .apply_expected = True
7068 .type = WREPL_TYPE_GROUP,
7069 .state = WREPL_STATE_ACTIVE,
7070 .node = WREPL_NODE_B,
7072 .num_ips = ctx->addresses_best_num,
7073 .ips = ctx->addresses_best,
7074 .apply_expected = True
7078 * group,active vs. group,active with different ip(s), unchecked
7081 .line = __location__,
7082 .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL),
7084 .nb_flags = NBT_NM_GROUP,
7086 .num_ips = ctx->addresses_best_num,
7087 .ips = ctx->addresses_best,
7088 .apply_expected = True
7094 .type = WREPL_TYPE_GROUP,
7095 .state = WREPL_STATE_ACTIVE,
7096 .node = WREPL_NODE_B,
7098 .num_ips = ARRAY_SIZE(addresses_B_1),
7099 .ips = addresses_B_1,
7100 .apply_expected = True
7104 * group,active vs. group,tombstone with same ip(s), unchecked
7107 .line = __location__,
7108 .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL),
7110 .nb_flags = NBT_NM_GROUP,
7112 .num_ips = ctx->addresses_best_num,
7113 .ips = ctx->addresses_best,
7114 .apply_expected = True
7120 .type = WREPL_TYPE_GROUP,
7121 .state = WREPL_STATE_TOMBSTONE,
7122 .node = WREPL_NODE_B,
7124 .num_ips = ctx->addresses_best_num,
7125 .ips = ctx->addresses_best,
7126 .apply_expected = False
7130 * group,active vs. group,tombstone with different ip(s), unchecked
7133 .line = __location__,
7134 .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL),
7136 .nb_flags = NBT_NM_GROUP,
7138 .num_ips = ctx->addresses_best_num,
7139 .ips = ctx->addresses_best,
7140 .apply_expected = True
7146 .type = WREPL_TYPE_GROUP,
7147 .state = WREPL_STATE_TOMBSTONE,
7148 .node = WREPL_NODE_B,
7150 .num_ips = ARRAY_SIZE(addresses_B_1),
7151 .ips = addresses_B_1,
7152 .apply_expected = False
7156 * normal group vs. special group section
7159 * group,active vs. sgroup,active with same ip(s), unchecked
7162 .line = __location__,
7163 .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL),
7165 .nb_flags = NBT_NM_GROUP,
7167 .num_ips = ctx->addresses_best_num,
7168 .ips = ctx->addresses_best,
7169 .apply_expected = True
7175 .type = WREPL_TYPE_SGROUP,
7176 .state = WREPL_STATE_ACTIVE,
7177 .node = WREPL_NODE_B,
7179 .num_ips = ctx->addresses_best_num,
7180 .ips = ctx->addresses_best,
7181 .apply_expected = False
7185 * group,active vs. sgroup,active with different ip(s), unchecked
7188 .line = __location__,
7189 .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL),
7191 .nb_flags = NBT_NM_GROUP,
7193 .num_ips = ctx->addresses_best_num,
7194 .ips = ctx->addresses_best,
7195 .apply_expected = True
7201 .type = WREPL_TYPE_SGROUP,
7202 .state = WREPL_STATE_ACTIVE,
7203 .node = WREPL_NODE_B,
7205 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7206 .ips = addresses_B_3_4,
7207 .apply_expected = False
7211 * group,active vs. sgroup,tombstone with same ip(s), unchecked
7214 .line = __location__,
7215 .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL),
7217 .nb_flags = NBT_NM_GROUP,
7219 .num_ips = ctx->addresses_best_num,
7220 .ips = ctx->addresses_best,
7221 .apply_expected = True
7227 .type = WREPL_TYPE_SGROUP,
7228 .state = WREPL_STATE_TOMBSTONE,
7229 .node = WREPL_NODE_B,
7231 .num_ips = ctx->addresses_best_num,
7232 .ips = ctx->addresses_best,
7233 .apply_expected = False
7237 * group,active vs. sgroup,tombstone with different ip(s), unchecked
7240 .line = __location__,
7241 .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL),
7243 .nb_flags = NBT_NM_GROUP,
7245 .num_ips = ctx->addresses_best_num,
7246 .ips = ctx->addresses_best,
7247 .apply_expected = True
7253 .type = WREPL_TYPE_SGROUP,
7254 .state = WREPL_STATE_TOMBSTONE,
7255 .node = WREPL_NODE_B,
7257 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7258 .ips = addresses_B_3_4,
7259 .apply_expected = False
7263 * normal group vs. multi homed section
7266 * group,active vs. mhomed,active with same ip(s), unchecked
7269 .line = __location__,
7270 .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL),
7272 .nb_flags = NBT_NM_GROUP,
7274 .num_ips = ctx->addresses_best_num,
7275 .ips = ctx->addresses_best,
7276 .apply_expected = True
7282 .type = WREPL_TYPE_MHOMED,
7283 .state = WREPL_STATE_ACTIVE,
7284 .node = WREPL_NODE_B,
7286 .num_ips = ctx->addresses_best_num,
7287 .ips = ctx->addresses_best,
7288 .apply_expected = False
7292 * group,active vs. mhomed,active with different ip(s), unchecked
7295 .line = __location__,
7296 .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL),
7298 .nb_flags = NBT_NM_GROUP,
7300 .num_ips = ctx->addresses_best_num,
7301 .ips = ctx->addresses_best,
7302 .apply_expected = True
7308 .type = WREPL_TYPE_MHOMED,
7309 .state = WREPL_STATE_ACTIVE,
7310 .node = WREPL_NODE_B,
7312 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7313 .ips = addresses_B_3_4,
7314 .apply_expected = False
7318 * group,active vs. mhomed,tombstone with same ip(s), unchecked
7321 .line = __location__,
7322 .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL),
7324 .nb_flags = NBT_NM_GROUP,
7326 .num_ips = ctx->addresses_best_num,
7327 .ips = ctx->addresses_best,
7328 .apply_expected = True
7334 .type = WREPL_TYPE_MHOMED,
7335 .state = WREPL_STATE_TOMBSTONE,
7336 .node = WREPL_NODE_B,
7338 .num_ips = ctx->addresses_best_num,
7339 .ips = ctx->addresses_best,
7340 .apply_expected = False
7344 * group,active vs. mhomed,tombstone with different ip(s), unchecked
7347 .line = __location__,
7348 .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL),
7350 .nb_flags = NBT_NM_GROUP,
7352 .num_ips = ctx->addresses_best_num,
7353 .ips = ctx->addresses_best,
7354 .apply_expected = True
7360 .type = WREPL_TYPE_MHOMED,
7361 .state = WREPL_STATE_TOMBSTONE,
7362 .node = WREPL_NODE_B,
7364 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7365 .ips = addresses_B_3_4,
7366 .apply_expected = False
7370 * special group vs. unique section
7373 * sgroup,active vs. unique,active with same ip(s), unchecked
7376 .line = __location__,
7377 .name = _NBT_NAME("_SA_UA_SI_U", 0x1C, NULL),
7379 .nb_flags = NBT_NM_GROUP,
7381 .num_ips = ctx->addresses_best_num,
7382 .ips = ctx->addresses_best,
7383 .apply_expected = True
7389 .type = WREPL_TYPE_UNIQUE,
7390 .state = WREPL_STATE_ACTIVE,
7391 .node = WREPL_NODE_B,
7393 .num_ips = ctx->addresses_best_num,
7394 .ips = ctx->addresses_best,
7395 .apply_expected = False
7399 * sgroup,active vs. unique,active with different ip(s), unchecked
7402 .line = __location__,
7403 .name = _NBT_NAME("_SA_UA_DI_U", 0x1C, NULL),
7405 .nb_flags = NBT_NM_GROUP,
7407 .num_ips = ctx->addresses_best_num,
7408 .ips = ctx->addresses_best,
7409 .apply_expected = True
7415 .type = WREPL_TYPE_UNIQUE,
7416 .state = WREPL_STATE_ACTIVE,
7417 .node = WREPL_NODE_B,
7419 .num_ips = ARRAY_SIZE(addresses_B_1),
7420 .ips = addresses_B_1,
7421 .apply_expected = False
7425 * sgroup,active vs. unique,tombstone with same ip(s), unchecked
7428 .line = __location__,
7429 .name = _NBT_NAME("_SA_UT_SI_U", 0x1C, NULL),
7431 .nb_flags = NBT_NM_GROUP,
7433 .num_ips = ctx->addresses_best_num,
7434 .ips = ctx->addresses_best,
7435 .apply_expected = True
7441 .type = WREPL_TYPE_UNIQUE,
7442 .state = WREPL_STATE_TOMBSTONE,
7443 .node = WREPL_NODE_B,
7445 .num_ips = ctx->addresses_best_num,
7446 .ips = ctx->addresses_best,
7447 .apply_expected = False
7451 * sgroup,active vs. unique,tombstone with different ip(s), unchecked
7454 .line = __location__,
7455 .name = _NBT_NAME("_SA_UT_DI_U", 0x1C, NULL),
7457 .nb_flags = NBT_NM_GROUP,
7459 .num_ips = ctx->addresses_best_num,
7460 .ips = ctx->addresses_best,
7461 .apply_expected = True
7467 .type = WREPL_TYPE_UNIQUE,
7468 .state = WREPL_STATE_TOMBSTONE,
7469 .node = WREPL_NODE_B,
7471 .num_ips = ARRAY_SIZE(addresses_B_1),
7472 .ips = addresses_B_1,
7473 .apply_expected = False
7477 * special group vs. normal group section
7480 * sgroup,active vs. group,active with same ip(s), unchecked
7483 .line = __location__,
7484 .name = _NBT_NAME("_SA_GA_SI_U", 0x1C, NULL),
7486 .nb_flags = NBT_NM_GROUP,
7488 .num_ips = ctx->addresses_best_num,
7489 .ips = ctx->addresses_best,
7490 .apply_expected = True
7496 .type = WREPL_TYPE_GROUP,
7497 .state = WREPL_STATE_ACTIVE,
7498 .node = WREPL_NODE_B,
7500 .num_ips = ctx->addresses_best_num,
7501 .ips = ctx->addresses_best,
7502 .apply_expected = False
7506 * sgroup,active vs. group,active with different ip(s), unchecked
7509 .line = __location__,
7510 .name = _NBT_NAME("_SA_GA_DI_U", 0x1C, NULL),
7512 .nb_flags = NBT_NM_GROUP,
7514 .num_ips = ctx->addresses_best_num,
7515 .ips = ctx->addresses_best,
7516 .apply_expected = True
7522 .type = WREPL_TYPE_GROUP,
7523 .state = WREPL_STATE_ACTIVE,
7524 .node = WREPL_NODE_B,
7526 .num_ips = ARRAY_SIZE(addresses_B_1),
7527 .ips = addresses_B_1,
7528 .apply_expected = False
7532 * sgroup,active vs. group,tombstone with same ip(s), unchecked
7535 .line = __location__,
7536 .name = _NBT_NAME("_SA_GT_SI_U", 0x1C, NULL),
7538 .nb_flags = NBT_NM_GROUP,
7540 .num_ips = ctx->addresses_best_num,
7541 .ips = ctx->addresses_best,
7542 .apply_expected = True
7548 .type = WREPL_TYPE_GROUP,
7549 .state = WREPL_STATE_TOMBSTONE,
7550 .node = WREPL_NODE_B,
7552 .num_ips = ctx->addresses_best_num,
7553 .ips = ctx->addresses_best,
7554 .apply_expected = False
7558 * sgroup,active vs. group,tombstone with different ip(s), unchecked
7561 .line = __location__,
7562 .name = _NBT_NAME("_SA_GT_DI_U", 0x1C, NULL),
7564 .nb_flags = NBT_NM_GROUP,
7566 .num_ips = ctx->addresses_best_num,
7567 .ips = ctx->addresses_best,
7568 .apply_expected = True
7574 .type = WREPL_TYPE_GROUP,
7575 .state = WREPL_STATE_TOMBSTONE,
7576 .node = WREPL_NODE_B,
7578 .num_ips = ARRAY_SIZE(addresses_B_1),
7579 .ips = addresses_B_1,
7580 .apply_expected = False
7584 * special group vs. multi homed section
7587 * sgroup,active vs. mhomed,active with same ip(s), unchecked
7590 .line = __location__,
7591 .name = _NBT_NAME("_SA_MA_SI_U", 0x1C, NULL),
7593 .nb_flags = NBT_NM_GROUP,
7595 .num_ips = ctx->addresses_best_num,
7596 .ips = ctx->addresses_best,
7597 .apply_expected = True
7603 .type = WREPL_TYPE_MHOMED,
7604 .state = WREPL_STATE_ACTIVE,
7605 .node = WREPL_NODE_B,
7607 .num_ips = ctx->addresses_best_num,
7608 .ips = ctx->addresses_best,
7609 .apply_expected = False
7613 * sgroup,active vs. mhomed,active with different ip(s), unchecked
7616 .line = __location__,
7617 .name = _NBT_NAME("_SA_MA_DI_U", 0x1C, NULL),
7619 .nb_flags = NBT_NM_GROUP,
7621 .num_ips = ctx->addresses_best_num,
7622 .ips = ctx->addresses_best,
7623 .apply_expected = True
7629 .type = WREPL_TYPE_MHOMED,
7630 .state = WREPL_STATE_ACTIVE,
7631 .node = WREPL_NODE_B,
7633 .num_ips = ARRAY_SIZE(addresses_B_1),
7634 .ips = addresses_B_1,
7635 .apply_expected = False
7639 * sgroup,active vs. mhomed,tombstone with same ip(s), unchecked
7642 .line = __location__,
7643 .name = _NBT_NAME("_SA_MT_SI_U", 0x1C, NULL),
7645 .nb_flags = NBT_NM_GROUP,
7647 .num_ips = ctx->addresses_best_num,
7648 .ips = ctx->addresses_best,
7649 .apply_expected = True
7655 .type = WREPL_TYPE_MHOMED,
7656 .state = WREPL_STATE_TOMBSTONE,
7657 .node = WREPL_NODE_B,
7659 .num_ips = ctx->addresses_best_num,
7660 .ips = ctx->addresses_best,
7661 .apply_expected = False
7665 * sgroup,active vs. mhomed,tombstone with different ip(s), unchecked
7668 .line = __location__,
7669 .name = _NBT_NAME("_SA_MT_DI_U", 0x1C, NULL),
7671 .nb_flags = NBT_NM_GROUP,
7673 .num_ips = ctx->addresses_best_num,
7674 .ips = ctx->addresses_best,
7675 .apply_expected = True
7681 .type = WREPL_TYPE_MHOMED,
7682 .state = WREPL_STATE_TOMBSTONE,
7683 .node = WREPL_NODE_B,
7685 .num_ips = ARRAY_SIZE(addresses_B_1),
7686 .ips = addresses_B_1,
7687 .apply_expected = False
7691 * multi homed vs. unique section
7694 * mhomed,active vs. unique,active with same ip(s), unchecked
7697 .line = __location__,
7698 .name = _NBT_NAME("_MA_UA_SI_U", 0x00, NULL),
7702 .num_ips = ctx->addresses_best_num,
7703 .ips = ctx->addresses_best,
7704 .apply_expected = True
7710 .type = WREPL_TYPE_UNIQUE,
7711 .state = WREPL_STATE_ACTIVE,
7712 .node = WREPL_NODE_B,
7714 .num_ips = ctx->addresses_best_num,
7715 .ips = ctx->addresses_best,
7716 .apply_expected = True
7720 * mhomed,active vs. unique,active with different ip(s), positive response
7723 .line = __location__,
7724 .name = _NBT_NAME("_MA_UA_DI_P", 0x00, NULL),
7728 .num_ips = ctx->addresses_best_num,
7729 .ips = ctx->addresses_best,
7730 .apply_expected = True
7737 .type = WREPL_TYPE_UNIQUE,
7738 .state = WREPL_STATE_ACTIVE,
7739 .node = WREPL_NODE_B,
7741 .num_ips = ARRAY_SIZE(addresses_B_1),
7742 .ips = addresses_B_1,
7743 .apply_expected = False
7747 * mhomed,active vs. unique,active with different ip(s), positive response other ips
7750 .line = __location__,
7751 .name = _NBT_NAME("_MA_UA_DI_O", 0x00, NULL),
7755 .num_ips = ctx->addresses_best_num,
7756 .ips = ctx->addresses_best,
7757 .apply_expected = True
7762 .num_ips = ARRAY_SIZE(addresses_A_3_4),
7763 .ips = addresses_A_3_4,
7766 .type = WREPL_TYPE_UNIQUE,
7767 .state = WREPL_STATE_ACTIVE,
7768 .node = WREPL_NODE_B,
7770 .num_ips = ARRAY_SIZE(addresses_B_1),
7771 .ips = addresses_B_1,
7772 .apply_expected = False
7776 * mhomed,active vs. unique,active with different ip(s), negative response
7779 .line = __location__,
7780 .name = _NBT_NAME("_MA_UA_DI_N", 0x00, NULL),
7784 .num_ips = ctx->addresses_best_num,
7785 .ips = ctx->addresses_best,
7786 .apply_expected = True
7793 .type = WREPL_TYPE_UNIQUE,
7794 .state = WREPL_STATE_ACTIVE,
7795 .node = WREPL_NODE_B,
7797 .num_ips = ARRAY_SIZE(addresses_B_1),
7798 .ips = addresses_B_1,
7799 .apply_expected = True
7803 * mhomed,active vs. unique,tombstone with same ip(s), unchecked
7806 .line = __location__,
7807 .name = _NBT_NAME("_MA_UT_SI_U", 0x00, NULL),
7811 .num_ips = ctx->addresses_best_num,
7812 .ips = ctx->addresses_best,
7813 .apply_expected = True
7819 .type = WREPL_TYPE_UNIQUE,
7820 .state = WREPL_STATE_TOMBSTONE,
7821 .node = WREPL_NODE_B,
7823 .num_ips = ctx->addresses_best_num,
7824 .ips = ctx->addresses_best,
7825 .apply_expected = False
7829 * mhomed,active vs. unique,tombstone with different ip(s), unchecked
7832 .line = __location__,
7833 .name = _NBT_NAME("_MA_UT_DI_U", 0x00, NULL),
7837 .num_ips = ctx->addresses_best_num,
7838 .ips = ctx->addresses_best,
7839 .apply_expected = True
7845 .type = WREPL_TYPE_UNIQUE,
7846 .state = WREPL_STATE_TOMBSTONE,
7847 .node = WREPL_NODE_B,
7849 .num_ips = ARRAY_SIZE(addresses_B_1),
7850 .ips = addresses_B_1,
7851 .apply_expected = False
7855 * multi homed vs. normal group section
7858 * mhomed,active vs. group,active with same ip(s), release expected
7861 .line = __location__,
7862 .name = _NBT_NAME("_MA_GA_SI_R", 0x00, NULL),
7866 .num_ips = ctx->addresses_best_num,
7867 .ips = ctx->addresses_best,
7868 .apply_expected = True
7872 .expect_release = True,
7875 .type = WREPL_TYPE_GROUP,
7876 .state = WREPL_STATE_ACTIVE,
7877 .node = WREPL_NODE_B,
7879 .num_ips = ctx->addresses_best_num,
7880 .ips = ctx->addresses_best,
7881 .apply_expected = True
7885 * mhomed,active vs. group,active with different ip(s), release expected
7888 .line = __location__,
7889 .name = _NBT_NAME("_MA_GA_DI_R", 0x00, NULL),
7893 .num_ips = ctx->addresses_best_num,
7894 .ips = ctx->addresses_best,
7895 .apply_expected = True
7899 .expect_release = True,
7902 .type = WREPL_TYPE_GROUP,
7903 .state = WREPL_STATE_ACTIVE,
7904 .node = WREPL_NODE_B,
7906 .num_ips = ARRAY_SIZE(addresses_B_1),
7907 .ips = addresses_B_1,
7908 .apply_expected = True
7912 * mhomed,active vs. group,tombstone with same ip(s), unchecked
7915 .line = __location__,
7916 .name = _NBT_NAME("_MA_GT_SI_U", 0x00, NULL),
7920 .num_ips = ctx->addresses_best_num,
7921 .ips = ctx->addresses_best,
7922 .apply_expected = True
7928 .type = WREPL_TYPE_GROUP,
7929 .state = WREPL_STATE_TOMBSTONE,
7930 .node = WREPL_NODE_B,
7932 .num_ips = ctx->addresses_best_num,
7933 .ips = ctx->addresses_best,
7934 .apply_expected = False
7938 * mhomed,active vs. group,tombstone with different ip(s), unchecked
7941 .line = __location__,
7942 .name = _NBT_NAME("_MA_GT_DI_U", 0x00, NULL),
7946 .num_ips = ctx->addresses_best_num,
7947 .ips = ctx->addresses_best,
7948 .apply_expected = True
7954 .type = WREPL_TYPE_GROUP,
7955 .state = WREPL_STATE_TOMBSTONE,
7956 .node = WREPL_NODE_B,
7958 .num_ips = ARRAY_SIZE(addresses_B_1),
7959 .ips = addresses_B_1,
7960 .apply_expected = False
7964 * multi homed vs. special group section
7967 * mhomed,active vs. sgroup,active with same ip(s), release expected
7970 .line = __location__,
7971 .name = _NBT_NAME("_MA_SA_SI_R", 0x00, NULL),
7975 .num_ips = ctx->addresses_best_num,
7976 .ips = ctx->addresses_best,
7977 .apply_expected = True
7981 .expect_release = True,
7984 .type = WREPL_TYPE_SGROUP,
7985 .state = WREPL_STATE_ACTIVE,
7986 .node = WREPL_NODE_B,
7988 .num_ips = ctx->addresses_best_num,
7989 .ips = ctx->addresses_best,
7990 .apply_expected = True
7994 * mhomed,active vs. group,active with different ip(s), release expected
7997 .line = __location__,
7998 .name = _NBT_NAME("_MA_SA_DI_R", 0x00, NULL),
8002 .num_ips = ctx->addresses_best_num,
8003 .ips = ctx->addresses_best,
8004 .apply_expected = True
8008 .expect_release = True,
8011 .type = WREPL_TYPE_SGROUP,
8012 .state = WREPL_STATE_ACTIVE,
8013 .node = WREPL_NODE_B,
8015 .num_ips = ARRAY_SIZE(addresses_B_1),
8016 .ips = addresses_B_1,
8017 .apply_expected = True
8021 * mhomed,active vs. sgroup,tombstone with same ip(s), unchecked
8024 .line = __location__,
8025 .name = _NBT_NAME("_MA_ST_SI_U", 0x00, NULL),
8029 .num_ips = ctx->addresses_best_num,
8030 .ips = ctx->addresses_best,
8031 .apply_expected = True
8037 .type = WREPL_TYPE_SGROUP,
8038 .state = WREPL_STATE_TOMBSTONE,
8039 .node = WREPL_NODE_B,
8041 .num_ips = ctx->addresses_best_num,
8042 .ips = ctx->addresses_best,
8043 .apply_expected = False
8047 * mhomed,active vs. sgroup,tombstone with different ip(s), unchecked
8050 .line = __location__,
8051 .name = _NBT_NAME("_MA_ST_DI_U", 0x00, NULL),
8055 .num_ips = ctx->addresses_best_num,
8056 .ips = ctx->addresses_best,
8057 .apply_expected = True
8063 .type = WREPL_TYPE_SGROUP,
8064 .state = WREPL_STATE_TOMBSTONE,
8065 .node = WREPL_NODE_B,
8067 .num_ips = ARRAY_SIZE(addresses_B_1),
8068 .ips = addresses_B_1,
8069 .apply_expected = False
8073 * multi homed vs. multi homed section
8076 * mhomed,active vs. mhomed,active with same ip(s), unchecked
8079 .line = __location__,
8080 .name = _NBT_NAME("_MA_MA_SI_U", 0x00, NULL),
8084 .num_ips = ctx->addresses_best_num,
8085 .ips = ctx->addresses_best,
8086 .apply_expected = True
8092 .type = WREPL_TYPE_MHOMED,
8093 .state = WREPL_STATE_ACTIVE,
8094 .node = WREPL_NODE_B,
8096 .num_ips = ctx->addresses_best_num,
8097 .ips = ctx->addresses_best,
8098 .apply_expected = True
8102 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8105 .line = __location__,
8106 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8110 .num_ips = ctx->addresses_best_num,
8111 .ips = ctx->addresses_best,
8112 .apply_expected = True
8118 .type = WREPL_TYPE_MHOMED,
8119 .state = WREPL_STATE_ACTIVE,
8120 .node = WREPL_NODE_B,
8122 .num_ips = ctx->addresses_all_num,
8123 .ips = ctx->addresses_all,
8124 .apply_expected = True
8128 * mhomed,active vs. mhomed,active with different ip(s), positive response
8131 .line = __location__,
8132 .name = _NBT_NAME("_MA_MA_DI_P", 0x00, NULL),
8136 .num_ips = ctx->addresses_best_num,
8137 .ips = ctx->addresses_best,
8138 .apply_expected = True
8145 .type = WREPL_TYPE_MHOMED,
8146 .state = WREPL_STATE_ACTIVE,
8147 .node = WREPL_NODE_B,
8149 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8150 .ips = addresses_B_3_4,
8151 .apply_expected = False
8155 * mhomed,active vs. mhomed,active with different ip(s), positive response other ips
8158 .line = __location__,
8159 .name = _NBT_NAME("_MA_MA_DI_O", 0x00, NULL),
8163 .num_ips = ctx->addresses_best_num,
8164 .ips = ctx->addresses_best,
8165 .apply_expected = True
8170 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8171 .ips = addresses_A_3_4,
8174 .type = WREPL_TYPE_MHOMED,
8175 .state = WREPL_STATE_ACTIVE,
8176 .node = WREPL_NODE_B,
8178 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8179 .ips = addresses_B_3_4,
8180 .apply_expected = False
8184 * mhomed,active vs. mhomed,active with different ip(s), negative response
8187 .line = __location__,
8188 .name = _NBT_NAME("_MA_MA_DI_N", 0x00, NULL),
8192 .num_ips = ctx->addresses_best_num,
8193 .ips = ctx->addresses_best,
8194 .apply_expected = True
8201 .type = WREPL_TYPE_MHOMED,
8202 .state = WREPL_STATE_ACTIVE,
8203 .node = WREPL_NODE_B,
8205 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8206 .ips = addresses_B_3_4,
8207 .apply_expected = True
8211 * mhomed,active vs. mhomed,tombstone with same ip(s), unchecked
8214 .line = __location__,
8215 .name = _NBT_NAME("_MA_MT_SI_U", 0x00, NULL),
8219 .num_ips = ctx->addresses_best_num,
8220 .ips = ctx->addresses_best,
8221 .apply_expected = True
8227 .type = WREPL_TYPE_MHOMED,
8228 .state = WREPL_STATE_TOMBSTONE,
8229 .node = WREPL_NODE_B,
8231 .num_ips = ctx->addresses_best_num,
8232 .ips = ctx->addresses_best,
8233 .apply_expected = False
8237 * mhomed,active vs. mhomed,tombstone with different ip(s), unchecked
8240 .line = __location__,
8241 .name = _NBT_NAME("_MA_MT_DI_U", 0x00, NULL),
8245 .num_ips = ctx->addresses_best_num,
8246 .ips = ctx->addresses_best,
8247 .apply_expected = True
8253 .type = WREPL_TYPE_MHOMED,
8254 .state = WREPL_STATE_TOMBSTONE,
8255 .node = WREPL_NODE_B,
8257 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8258 .ips = addresses_B_3_4,
8259 .apply_expected = False
8263 * some more multi homed test, including merging
8266 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8269 .line = __location__,
8270 .section= "Test Replica vs. owned active: some more MHOMED combinations",
8271 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8272 .skip = (ctx->addresses_all_num < 3),
8276 .num_ips = ctx->addresses_mhomed_num,
8277 .ips = ctx->addresses_mhomed,
8278 .apply_expected = True
8284 .type = WREPL_TYPE_MHOMED,
8285 .state = WREPL_STATE_ACTIVE,
8286 .node = WREPL_NODE_B,
8288 .num_ips = ctx->addresses_all_num,
8289 .ips = ctx->addresses_all,
8290 .apply_expected = True
8294 * mhomed,active vs. mhomed,active with same ips, unchecked
8297 .line = __location__,
8298 .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL),
8299 .skip = (ctx->addresses_mhomed_num != 2),
8303 .num_ips = ctx->addresses_mhomed_num,
8304 .ips = ctx->addresses_mhomed,
8305 .apply_expected = True
8311 .type = WREPL_TYPE_MHOMED,
8312 .state = WREPL_STATE_ACTIVE,
8313 .node = WREPL_NODE_B,
8315 .num_ips = ctx->addresses_mhomed_num,
8316 .ips = ctx->addresses_mhomed,
8317 .apply_expected = True
8321 * mhomed,active vs. mhomed,active with subset ip(s), positive response
8324 .line = __location__,
8325 .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL),
8326 .skip = (ctx->addresses_mhomed_num != 2),
8330 .num_ips = ctx->addresses_mhomed_num,
8331 .ips = ctx->addresses_mhomed,
8332 .apply_expected = True
8339 .type = WREPL_TYPE_MHOMED,
8340 .state = WREPL_STATE_ACTIVE,
8341 .node = WREPL_NODE_B,
8343 .num_ips = ctx->addresses_best_num,
8344 .ips = ctx->addresses_best,
8345 .mhomed_merge = True
8349 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with all addresses
8352 .line = __location__,
8353 .name = _NBT_NAME("_MA_MA_SB_A", 0x00, NULL),
8354 .skip = (ctx->addresses_all_num < 3),
8358 .num_ips = ctx->addresses_mhomed_num,
8359 .ips = ctx->addresses_mhomed,
8360 .apply_expected = True
8365 .num_ips = ctx->addresses_all_num,
8366 .ips = ctx->addresses_all,
8369 .type = WREPL_TYPE_MHOMED,
8370 .state = WREPL_STATE_ACTIVE,
8371 .node = WREPL_NODE_B,
8373 .num_ips = ctx->addresses_best_num,
8374 .ips = ctx->addresses_best,
8375 .mhomed_merge = True
8379 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with replicas addresses
8380 * TODO: check why the server sends a name release demand for one address?
8381 * the release demand has no effect to the database record...
8384 .line = __location__,
8385 .name = _NBT_NAME("_MA_MA_SB_C", 0x00, NULL),
8386 .skip = (ctx->addresses_all_num < 3),
8390 .num_ips = ctx->addresses_mhomed_num,
8391 .ips = ctx->addresses_mhomed,
8392 .apply_expected = True
8397 .num_ips = ctx->addresses_best_num,
8398 .ips = ctx->addresses_best,
8399 .late_release = True
8402 .type = WREPL_TYPE_MHOMED,
8403 .state = WREPL_STATE_ACTIVE,
8404 .node = WREPL_NODE_B,
8406 .num_ips = ctx->addresses_best_num,
8407 .ips = ctx->addresses_best,
8408 .apply_expected = False
8412 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with other addresses
8415 .line = __location__,
8416 .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL),
8418 .skip = (ctx->addresses_all_num < 3),
8422 .num_ips = ctx->addresses_mhomed_num,
8423 .ips = ctx->addresses_mhomed,
8424 .apply_expected = True
8429 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8430 .ips = addresses_B_3_4,
8433 .type = WREPL_TYPE_MHOMED,
8434 .state = WREPL_STATE_ACTIVE,
8435 .node = WREPL_NODE_B,
8437 .num_ips = ctx->addresses_best_num,
8438 .ips = ctx->addresses_best,
8439 .apply_expected = False
8443 * mhomed,active vs. mhomed,active with subset ip(s), negative response
8446 .line = __location__,
8447 .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL),
8448 .skip = (ctx->addresses_mhomed_num != 2),
8452 .num_ips = ctx->addresses_mhomed_num,
8453 .ips = ctx->addresses_mhomed,
8454 .apply_expected = True
8461 .type = WREPL_TYPE_MHOMED,
8462 .state = WREPL_STATE_ACTIVE,
8463 .node = WREPL_NODE_B,
8465 .num_ips = ctx->addresses_best_num,
8466 .ips = ctx->addresses_best,
8467 .apply_expected = True
8471 * some more multi homed and unique test, including merging
8474 * mhomed,active vs. unique,active with subset ip(s), positive response
8477 .line = __location__,
8478 .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations",
8479 .name = _NBT_NAME("_MA_UA_SB_A", 0x00, NULL),
8480 .skip = (ctx->addresses_all_num < 3),
8484 .num_ips = ctx->addresses_mhomed_num,
8485 .ips = ctx->addresses_mhomed,
8486 .apply_expected = True
8493 .type = WREPL_TYPE_UNIQUE,
8494 .state = WREPL_STATE_ACTIVE,
8495 .node = WREPL_NODE_B,
8497 .num_ips = ctx->addresses_best_num,
8498 .ips = ctx->addresses_best,
8499 .mhomed_merge = True
8503 * unique,active vs. unique,active with different ip(s), positive response, with all addresses
8506 .line = __location__,
8507 .name = _NBT_NAME("_UA_UA_DI_A", 0x00, NULL),
8508 .skip = (ctx->addresses_all_num < 3),
8512 .num_ips = ctx->addresses_best_num,
8513 .ips = ctx->addresses_best,
8514 .apply_expected = True
8519 .num_ips = ctx->addresses_all_num,
8520 .ips = ctx->addresses_all,
8523 .type = WREPL_TYPE_UNIQUE,
8524 .state = WREPL_STATE_ACTIVE,
8525 .node = WREPL_NODE_B,
8527 .num_ips = ctx->addresses_best2_num,
8528 .ips = ctx->addresses_best2,
8529 .mhomed_merge = True,
8533 * unique,active vs. mhomed,active with different ip(s), positive response, with all addresses
8536 .line = __location__,
8537 .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL),
8538 .skip = (ctx->addresses_all_num < 3),
8542 .num_ips = ctx->addresses_best_num,
8543 .ips = ctx->addresses_best,
8544 .apply_expected = True
8549 .num_ips = ctx->addresses_all_num,
8550 .ips = ctx->addresses_all,
8553 .type = WREPL_TYPE_MHOMED,
8554 .state = WREPL_STATE_ACTIVE,
8555 .node = WREPL_NODE_B,
8557 .num_ips = ctx->addresses_best2_num,
8558 .ips = ctx->addresses_best2,
8559 .mhomed_merge = True,
8563 * special group vs. special group merging section
8566 * sgroup,active vs. sgroup,active with different ip(s)
8569 .line = __location__,
8570 .section= "Test Replica vs. owned active: SGROUP vs. SGROUP tests",
8571 .name = _NBT_NAME("_SA_SA_DI_U", 0x1C, NULL),
8572 .skip = (ctx->addresses_all_num < 3),
8574 .nb_flags = NBT_NM_GROUP,
8576 .num_ips = ctx->addresses_mhomed_num,
8577 .ips = ctx->addresses_mhomed,
8578 .apply_expected = True
8584 .type = WREPL_TYPE_SGROUP,
8585 .state = WREPL_STATE_ACTIVE,
8586 .node = WREPL_NODE_B,
8588 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8589 .ips = addresses_B_3_4,
8590 .sgroup_merge = True
8594 * sgroup,active vs. sgroup,active with same ip(s)
8597 .line = __location__,
8598 .name = _NBT_NAME("_SA_SA_SI_U", 0x1C, NULL),
8599 .skip = (ctx->addresses_all_num < 3),
8601 .nb_flags = NBT_NM_GROUP,
8603 .num_ips = ctx->addresses_mhomed_num,
8604 .ips = ctx->addresses_mhomed,
8605 .apply_expected = True
8611 .type = WREPL_TYPE_SGROUP,
8612 .state = WREPL_STATE_ACTIVE,
8613 .node = WREPL_NODE_B,
8615 .num_ips = ctx->addresses_mhomed_num,
8616 .ips = ctx->addresses_mhomed,
8617 .sgroup_merge = True
8621 * sgroup,active vs. sgroup,active with superset ip(s)
8624 .line = __location__,
8625 .name = _NBT_NAME("_SA_SA_SP_U", 0x1C, NULL),
8626 .skip = (ctx->addresses_all_num < 3),
8628 .nb_flags = NBT_NM_GROUP,
8630 .num_ips = ctx->addresses_mhomed_num,
8631 .ips = ctx->addresses_mhomed,
8632 .apply_expected = True
8638 .type = WREPL_TYPE_SGROUP,
8639 .state = WREPL_STATE_ACTIVE,
8640 .node = WREPL_NODE_B,
8642 .num_ips = ctx->addresses_all_num,
8643 .ips = ctx->addresses_all,
8644 .sgroup_merge = True
8648 * sgroup,active vs. sgroup,active with subset ip(s)
8651 .line = __location__,
8652 .name = _NBT_NAME("_SA_SA_SB_U", 0x1C, NULL),
8653 .skip = (ctx->addresses_all_num < 3),
8655 .nb_flags = NBT_NM_GROUP,
8657 .num_ips = ctx->addresses_mhomed_num,
8658 .ips = ctx->addresses_mhomed,
8659 .apply_expected = True
8665 .type = WREPL_TYPE_SGROUP,
8666 .state = WREPL_STATE_ACTIVE,
8667 .node = WREPL_NODE_B,
8669 .num_ips = ctx->addresses_best_num,
8670 .ips = ctx->addresses_best,
8671 .sgroup_merge = True
8675 * sgroup,active vs. sgroup,tombstone with different ip(s)
8678 .line = __location__,
8679 .name = _NBT_NAME("_SA_ST_DI_U", 0x1C, NULL),
8680 .skip = (ctx->addresses_all_num < 3),
8682 .nb_flags = NBT_NM_GROUP,
8684 .num_ips = ctx->addresses_mhomed_num,
8685 .ips = ctx->addresses_mhomed,
8686 .apply_expected = True
8692 .type = WREPL_TYPE_SGROUP,
8693 .state = WREPL_STATE_TOMBSTONE,
8694 .node = WREPL_NODE_B,
8696 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8697 .ips = addresses_B_3_4,
8698 .apply_expected = False
8702 * sgroup,active vs. sgroup,tombstone with same ip(s)
8705 .line = __location__,
8706 .name = _NBT_NAME("_SA_ST_SI_U", 0x1C, NULL),
8707 .skip = (ctx->addresses_all_num < 3),
8709 .nb_flags = NBT_NM_GROUP,
8711 .num_ips = ctx->addresses_mhomed_num,
8712 .ips = ctx->addresses_mhomed,
8713 .apply_expected = True
8719 .type = WREPL_TYPE_SGROUP,
8720 .state = WREPL_STATE_TOMBSTONE,
8721 .node = WREPL_NODE_B,
8723 .num_ips = ctx->addresses_mhomed_num,
8724 .ips = ctx->addresses_mhomed,
8725 .apply_expected = False
8729 * sgroup,active vs. sgroup,tombstone with superset ip(s)
8732 .line = __location__,
8733 .name = _NBT_NAME("_SA_ST_SP_U", 0x1C, NULL),
8734 .skip = (ctx->addresses_all_num < 3),
8736 .nb_flags = NBT_NM_GROUP,
8738 .num_ips = ctx->addresses_mhomed_num,
8739 .ips = ctx->addresses_mhomed,
8740 .apply_expected = True
8746 .type = WREPL_TYPE_SGROUP,
8747 .state = WREPL_STATE_TOMBSTONE,
8748 .node = WREPL_NODE_B,
8750 .num_ips = ctx->addresses_all_num,
8751 .ips = ctx->addresses_all,
8752 .apply_expected = False
8756 * sgroup,active vs. sgroup,tombstone with subset ip(s)
8759 .line = __location__,
8760 .name = _NBT_NAME("_SA_ST_SB_U", 0x1C, NULL),
8761 .skip = (ctx->addresses_all_num < 3),
8763 .nb_flags = NBT_NM_GROUP,
8765 .num_ips = ctx->addresses_mhomed_num,
8766 .ips = ctx->addresses_mhomed,
8767 .apply_expected = True
8773 .type = WREPL_TYPE_SGROUP,
8774 .state = WREPL_STATE_TOMBSTONE,
8775 .node = WREPL_NODE_B,
8777 .num_ips = ctx->addresses_best_num,
8778 .ips = ctx->addresses_best,
8779 .apply_expected = False
8784 if (!ctx) return False;
8786 if (!ctx->nbtsock_srv) {
8787 printf("SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
8792 printf("Test Replica records vs. owned active records\n");
8794 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
8796 struct test_conflict_owned_active_vs_replica_struct record = records[i];
8797 uint32_t j, count = 1;
8800 if (records[i].wins.mhomed || records[i].name.type == 0x1C) {
8801 count = records[i].wins.num_ips;
8804 if (records[i].section) {
8805 printf("%s\n", records[i].section);
8808 if (records[i].skip) {
8809 printf("%s => SKIPPED\n", nbt_name_string(ctx, &records[i].name));
8813 if (records[i].replica.mhomed_merge) {
8814 action = "MHOMED_MERGE";
8815 } else if (records[i].replica.sgroup_merge) {
8816 action = "SGROUP_MERGE";
8817 } else if (records[i].replica.apply_expected) {
8820 action = "NOT REPLACE";
8823 printf("%s => %s\n", nbt_name_string(ctx, &records[i].name), action);
8825 /* Prepare for multi homed registration */
8826 ZERO_STRUCT(records[i].defend);
8827 records[i].defend.timeout = 10;
8828 records[i].defend.positive = True;
8829 nbt_set_incoming_handler(ctx->nbtsock_srv,
8830 test_conflict_owned_active_vs_replica_handler,
8832 if (ctx->nbtsock_srv2) {
8833 nbt_set_incoming_handler(ctx->nbtsock_srv2,
8834 test_conflict_owned_active_vs_replica_handler,
8841 for (j=0; j < count; j++) {
8842 struct nbt_name_request *req;
8844 name_register->in.name = records[i].name;
8845 name_register->in.dest_addr = ctx->address;
8846 name_register->in.address = records[i].wins.ips[j].ip;
8847 name_register->in.nb_flags = records[i].wins.nb_flags;
8848 name_register->in.register_demand= False;
8849 name_register->in.broadcast = False;
8850 name_register->in.multi_homed = records[i].wins.mhomed;
8851 name_register->in.ttl = 300000;
8852 name_register->in.timeout = 70;
8853 name_register->in.retries = 0;
8855 req = nbt_name_register_send(ctx->nbtsock, name_register);
8857 /* push the request on the wire */
8858 event_loop_once(ctx->nbtsock->event_ctx);
8861 * if we register multiple addresses,
8862 * the server will do name queries to see if the old addresses
8865 if (records[i].wins.mhomed && j > 0) {
8866 end = timeval_current_ofs(records[i].defend.timeout,0);
8867 records[i].defend.ret = True;
8868 while (records[i].defend.timeout > 0) {
8869 event_loop_once(ctx->nbtsock_srv->event_ctx);
8870 if (timeval_expired(&end)) break;
8872 ret &= records[i].defend.ret;
8875 status = nbt_name_register_recv(req, ctx, name_register);
8876 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
8877 printf("No response from %s for name register\n", ctx->address);
8880 if (!NT_STATUS_IS_OK(status)) {
8881 printf("Bad response from %s for name register - %s\n",
8882 ctx->address, nt_errstr(status));
8885 CHECK_VALUE(name_register->out.rcode, 0);
8886 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
8887 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
8888 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
8889 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
8890 CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[j].ip);
8893 /* Prepare for the current test */
8894 records[i].defend = record.defend;
8895 nbt_set_incoming_handler(ctx->nbtsock_srv,
8896 test_conflict_owned_active_vs_replica_handler,
8898 if (ctx->nbtsock_srv2) {
8899 nbt_set_incoming_handler(ctx->nbtsock_srv2,
8900 test_conflict_owned_active_vs_replica_handler,
8907 wins_name->name = &records[i].name;
8908 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
8909 records[i].replica.state,
8910 records[i].replica.node,
8911 records[i].replica.is_static);
8912 wins_name->id = ++ctx->b.max_version;
8913 if (wins_name->flags & 2) {
8914 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
8915 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
8917 wins_name->addresses.ip = records[i].replica.ips[0].ip;
8919 wins_name->unknown = "255.255.255.255";
8921 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
8924 * wait for the name query, which is handled in
8925 * test_conflict_owned_active_vs_replica_handler()
8927 end = timeval_current_ofs(records[i].defend.timeout,0);
8928 records[i].defend.ret = True;
8929 while (records[i].defend.timeout > 0) {
8930 event_loop_once(ctx->nbtsock_srv->event_ctx);
8931 if (timeval_expired(&end)) break;
8933 ret &= records[i].defend.ret;
8935 if (records[i].defend.late_release) {
8936 records[i].defend = record.defend;
8937 records[i].defend.expect_release = True;
8939 * wait for the name release demand, which is handled in
8940 * test_conflict_owned_active_vs_replica_handler()
8942 end = timeval_current_ofs(records[i].defend.timeout,0);
8943 records[i].defend.ret = True;
8944 while (records[i].defend.timeout > 0) {
8945 event_loop_once(ctx->nbtsock_srv->event_ctx);
8946 if (timeval_expired(&end)) break;
8948 ret &= records[i].defend.ret;
8951 if (records[i].replica.mhomed_merge) {
8952 ret &= test_wrepl_mhomed_merged(ctx, &ctx->c,
8953 records[i].wins.num_ips, records[i].wins.ips,
8955 records[i].replica.num_ips, records[i].replica.ips,
8957 } else if (records[i].replica.sgroup_merge) {
8958 ret &= test_wrepl_sgroup_merged(ctx, NULL,
8960 records[i].wins.num_ips, records[i].wins.ips,
8962 records[i].replica.num_ips, records[i].replica.ips,
8965 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
8966 records[i].replica.apply_expected);
8969 if (records[i].replica.apply_expected ||
8970 records[i].replica.mhomed_merge) {
8971 wins_name->name = &records[i].name;
8972 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
8973 WREPL_STATE_TOMBSTONE,
8974 WREPL_NODE_B, False);
8975 wins_name->id = ++ctx->b.max_version;
8976 wins_name->addresses.ip = addresses_B_1[0].ip;
8977 wins_name->unknown = "255.255.255.255";
8979 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
8980 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
8982 for (j=0; j < count; j++) {
8983 struct nbt_name_socket *nbtsock = ctx->nbtsock;
8985 if (ctx->myaddr2 && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2) == 0) {
8986 nbtsock = ctx->nbtsock2;
8989 release->in.name = records[i].name;
8990 release->in.dest_addr = ctx->address;
8991 release->in.address = records[i].wins.ips[j].ip;
8992 release->in.nb_flags = records[i].wins.nb_flags;
8993 release->in.broadcast = False;
8994 release->in.timeout = 30;
8995 release->in.retries = 0;
8997 status = nbt_name_release(nbtsock, ctx, release);
8998 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
8999 printf("No response from %s for name release\n", ctx->address);
9002 if (!NT_STATUS_IS_OK(status)) {
9003 printf("Bad response from %s for name query - %s\n",
9004 ctx->address, nt_errstr(status));
9007 CHECK_VALUE(release->out.rcode, 0);
9010 if (records[i].replica.sgroup_merge) {
9011 /* clean up the SGROUP record */
9012 wins_name->name = &records[i].name;
9013 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9015 WREPL_NODE_B, False);
9016 wins_name->id = ++ctx->b.max_version;
9017 wins_name->addresses.addresses.num_ips = 0;
9018 wins_name->addresses.addresses.ips = NULL;
9019 wins_name->unknown = "255.255.255.255";
9020 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9022 /* take ownership of the SGROUP record */
9023 wins_name->name = &records[i].name;
9024 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9026 WREPL_NODE_B, False);
9027 wins_name->id = ++ctx->b.max_version;
9028 wins_name->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
9029 wins_name->addresses.addresses.ips = discard_const(addresses_B_1);
9030 wins_name->unknown = "255.255.255.255";
9031 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9032 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
9034 /* overwrite the SGROUP record with unique,tombstone */
9035 wins_name->name = &records[i].name;
9036 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9037 WREPL_STATE_TOMBSTONE,
9038 WREPL_NODE_B, False);
9039 wins_name->id = ++ctx->b.max_version;
9040 wins_name->addresses.ip = addresses_A_1[0].ip;
9041 wins_name->unknown = "255.255.255.255";
9042 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9043 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
9049 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
9057 #define _NBT_ASSERT(v, correct) do { \
9058 if ((v) != (correct)) { \
9059 printf("(%s) Incorrect value %s=%d - should be %s (%d)\n", \
9060 __location__, #v, v, #correct, correct); \
9065 #define _NBT_ASSERT_STRING(v, correct) do { \
9066 if ( ((!v) && (correct)) || \
9067 ((v) && (!correct)) || \
9068 ((v) && (correct) && strcmp(v,correct) != 0)) { \
9069 printf("(%s) Incorrect value %s=%s - should be %s\n", \
9070 __location__, #v, v, correct); \
9075 static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
9076 struct nbt_name_packet *req_packet,
9077 const struct nbt_peer_socket *src)
9079 struct nbt_name *name;
9080 struct nbt_name_packet *rep_packet;
9081 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9083 _NBT_ASSERT(req_packet->qdcount, 1);
9084 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9085 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9087 name = &req_packet->questions[0].name;
9089 _NBT_ASSERT(name->type, rec->name.type);
9090 _NBT_ASSERT_STRING(name->name, rec->name.name);
9091 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9093 _NBT_ASSERT(rec->defend.expect_release, False);
9095 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9096 if (rep_packet == NULL) return;
9098 rep_packet->name_trn_id = req_packet->name_trn_id;
9099 rep_packet->ancount = 1;
9101 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9102 if (rep_packet->answers == NULL) return;
9104 rep_packet->answers[0].name = *name;
9105 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9106 rep_packet->answers[0].ttl = 0;
9108 if (rec->defend.positive) {
9109 uint32_t i, num_ips;
9110 const struct wrepl_ip *ips;
9112 if (rec->defend.num_ips > 0) {
9113 num_ips = rec->defend.num_ips;
9114 ips = rec->defend.ips;
9116 num_ips = rec->wins.num_ips;
9117 ips = rec->wins.ips;
9120 /* send a positive reply */
9121 rep_packet->operation =
9124 NBT_FLAG_AUTHORITIVE |
9125 NBT_FLAG_RECURSION_DESIRED |
9126 NBT_FLAG_RECURSION_AVAIL;
9128 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9130 rep_packet->answers[0].rdata.netbios.length = num_ips*6;
9131 rep_packet->answers[0].rdata.netbios.addresses =
9132 talloc_array(rep_packet->answers, struct nbt_rdata_address, num_ips);
9133 if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return;
9135 for (i=0; i < num_ips; i++) {
9136 struct nbt_rdata_address *addr =
9137 &rep_packet->answers[0].rdata.netbios.addresses[i];
9138 addr->nb_flags = rec->wins.nb_flags;
9139 addr->ipaddr = ips[i].ip;
9141 DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
9142 nbt_name_string(rep_packet, name), src->addr, src->port));
9144 /* send a negative reply */
9145 rep_packet->operation =
9148 NBT_FLAG_AUTHORITIVE |
9151 rep_packet->answers[0].rr_type = NBT_QTYPE_NULL;
9153 ZERO_STRUCT(rep_packet->answers[0].rdata);
9155 DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
9156 nbt_name_string(rep_packet, name), src->addr, src->port));
9159 nbt_name_reply_send(nbtsock, src, rep_packet);
9160 talloc_free(rep_packet);
9162 /* make sure we push the reply to the wire */
9163 event_loop_once(nbtsock->event_ctx);
9165 rec->defend.timeout = 0;
9166 rec->defend.ret = True;
9169 static void test_conflict_owned_active_vs_replica_handler_release(struct nbt_name_socket *nbtsock,
9170 struct nbt_name_packet *req_packet,
9171 const struct nbt_peer_socket *src)
9173 struct nbt_name *name;
9174 struct nbt_name_packet *rep_packet;
9175 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9177 _NBT_ASSERT(req_packet->qdcount, 1);
9178 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9179 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9181 name = &req_packet->questions[0].name;
9183 _NBT_ASSERT(name->type, rec->name.type);
9184 _NBT_ASSERT_STRING(name->name, rec->name.name);
9185 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9187 _NBT_ASSERT(rec->defend.expect_release, True);
9189 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9190 if (rep_packet == NULL) return;
9192 rep_packet->name_trn_id = req_packet->name_trn_id;
9193 rep_packet->ancount = 1;
9194 rep_packet->operation =
9196 NBT_OPCODE_RELEASE |
9197 NBT_FLAG_AUTHORITIVE;
9199 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9200 if (rep_packet->answers == NULL) return;
9202 rep_packet->answers[0].name = *name;
9203 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9204 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9205 rep_packet->answers[0].ttl = req_packet->additional[0].ttl;
9206 rep_packet->answers[0].rdata = req_packet->additional[0].rdata;
9208 DEBUG(2,("Sending name release reply for %s to %s:%d\n",
9209 nbt_name_string(rep_packet, name), src->addr, src->port));
9211 nbt_name_reply_send(nbtsock, src, rep_packet);
9212 talloc_free(rep_packet);
9214 /* make sure we push the reply to the wire */
9215 event_loop_once(nbtsock->event_ctx);
9217 rec->defend.timeout = 0;
9218 rec->defend.ret = True;
9221 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
9222 struct nbt_name_packet *req_packet,
9223 const struct nbt_peer_socket *src)
9225 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9227 rec->defend.ret = False;
9229 switch (req_packet->operation & NBT_OPCODE) {
9230 case NBT_OPCODE_QUERY:
9231 test_conflict_owned_active_vs_replica_handler_query(nbtsock, req_packet, src);
9233 case NBT_OPCODE_RELEASE:
9234 test_conflict_owned_active_vs_replica_handler_release(nbtsock, req_packet, src);
9237 printf("%s: unexpected incoming packet\n", __location__);
9243 test WINS replication operations
9245 BOOL torture_nbt_winsreplication_quick(void)
9247 const char *address;
9248 struct nbt_name name;
9249 TALLOC_CTX *mem_ctx = talloc_new(NULL);
9253 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
9255 /* do an initial name resolution to find its IP */
9256 status = resolve_name(&name, mem_ctx, &address, NULL);
9257 if (!NT_STATUS_IS_OK(status)) {
9258 printf("Failed to resolve %s - %s\n",
9259 name.name, nt_errstr(status));
9260 talloc_free(mem_ctx);
9264 ret &= test_assoc_ctx1(mem_ctx, address);
9265 ret &= test_assoc_ctx2(mem_ctx, address);
9267 ret &= test_wins_replication(mem_ctx, address);
9269 talloc_free(mem_ctx);
9275 test WINS replication operations
9277 BOOL torture_nbt_winsreplication(void)
9279 const char *address;
9280 struct nbt_name name;
9281 TALLOC_CTX *mem_ctx = talloc_new(NULL);
9284 struct test_wrepl_conflict_conn *ctx;
9286 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
9288 /* do an initial name resolution to find its IP */
9289 status = resolve_name(&name, mem_ctx, &address, NULL);
9290 if (!NT_STATUS_IS_OK(status)) {
9291 printf("Failed to resolve %s - %s\n",
9292 name.name, nt_errstr(status));
9293 talloc_free(mem_ctx);
9297 ret &= test_assoc_ctx1(mem_ctx, address);
9298 ret &= test_assoc_ctx2(mem_ctx, address);
9300 ret &= test_wins_replication(mem_ctx, address);
9302 ctx = test_create_conflict_ctx(mem_ctx, address);
9304 ret &= test_conflict_same_owner(ctx);
9305 ret &= test_conflict_different_owner(ctx);
9306 ret &= test_conflict_owned_released_vs_replica(ctx);
9307 ret &= test_conflict_owned_active_vs_replica(ctx);
9309 talloc_free(mem_ctx);