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 const struct wrepl_ip addresses_X_1_2[] = {
506 .owner = TEST_OWNER_X_ADDRESS,
507 .ip = TEST_ADDRESS_X_PREFIX".1"
510 .owner = TEST_OWNER_X_ADDRESS,
511 .ip = TEST_ADDRESS_X_PREFIX".2"
514 static const struct wrepl_ip addresses_X_3_4[] = {
516 .owner = TEST_OWNER_X_ADDRESS,
517 .ip = TEST_ADDRESS_X_PREFIX".3"
520 .owner = TEST_OWNER_X_ADDRESS,
521 .ip = TEST_ADDRESS_X_PREFIX".4"
525 static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem_ctx,
528 struct test_wrepl_conflict_conn *ctx;
529 struct wrepl_associate associate;
530 struct wrepl_pull_table pull_table;
534 ctx = talloc_zero(mem_ctx, struct test_wrepl_conflict_conn);
535 if (!ctx) return NULL;
537 ctx->address = address;
538 ctx->pull = wrepl_socket_init(ctx, NULL);
539 if (!ctx->pull) return NULL;
541 printf("Setup wrepl conflict pull connection\n");
542 status = wrepl_connect(ctx->pull, NULL, ctx->address);
543 if (!NT_STATUS_IS_OK(status)) return NULL;
545 status = wrepl_associate(ctx->pull, &associate);
546 if (!NT_STATUS_IS_OK(status)) return NULL;
548 ctx->pull_assoc = associate.out.assoc_ctx;
550 ctx->a.address = TEST_OWNER_A_ADDRESS;
551 ctx->a.max_version = 0;
552 ctx->a.min_version = 0;
555 ctx->b.address = TEST_OWNER_B_ADDRESS;
556 ctx->b.max_version = 0;
557 ctx->b.min_version = 0;
560 ctx->x.address = TEST_OWNER_X_ADDRESS;
561 ctx->x.max_version = 0;
562 ctx->x.min_version = 0;
565 ctx->c.address = address;
566 ctx->c.max_version = 0;
567 ctx->c.min_version = 0;
570 pull_table.in.assoc_ctx = ctx->pull_assoc;
571 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
572 if (!NT_STATUS_IS_OK(status)) return NULL;
574 for (i=0; i < pull_table.out.num_partners; i++) {
575 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
576 ctx->a.max_version = pull_table.out.partners[i].max_version;
577 ctx->a.min_version = pull_table.out.partners[i].min_version;
579 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
580 ctx->b.max_version = pull_table.out.partners[i].max_version;
581 ctx->b.min_version = pull_table.out.partners[i].min_version;
583 if (strcmp(TEST_OWNER_X_ADDRESS,pull_table.out.partners[i].address)==0) {
584 ctx->x.max_version = pull_table.out.partners[i].max_version;
585 ctx->x.min_version = pull_table.out.partners[i].min_version;
587 if (strcmp(address,pull_table.out.partners[i].address)==0) {
588 ctx->c.max_version = pull_table.out.partners[i].max_version;
589 ctx->c.min_version = pull_table.out.partners[i].min_version;
593 talloc_free(pull_table.out.partners);
595 ctx->myaddr = talloc_strdup(mem_ctx, iface_best_ip(address));
596 if (!ctx->myaddr) return NULL;
598 for (i = 0; i < iface_count(); i++) {
599 if (strcmp(ctx->myaddr, iface_n_ip(i)) == 0) continue;
600 ctx->myaddr2 = talloc_strdup(mem_ctx, iface_n_ip(i));
601 if (!ctx->myaddr2) return NULL;
605 ctx->nbtsock = nbt_name_socket_init(ctx, NULL);
606 if (!ctx->nbtsock) return NULL;
608 status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0, 0);
609 if (!NT_STATUS_IS_OK(status)) return NULL;
611 ctx->nbtsock_srv = nbt_name_socket_init(ctx, NULL);
612 if (!ctx->nbtsock_srv) return NULL;
614 status = socket_listen(ctx->nbtsock_srv->sock, ctx->myaddr, lp_nbt_port(), 0, 0);
615 if (!NT_STATUS_IS_OK(status)) {
616 talloc_free(ctx->nbtsock_srv);
617 ctx->nbtsock_srv = NULL;
620 if (ctx->myaddr2 && ctx->nbtsock_srv) {
621 ctx->nbtsock2 = nbt_name_socket_init(ctx, NULL);
622 if (!ctx->nbtsock2) return NULL;
624 status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0, 0);
625 if (!NT_STATUS_IS_OK(status)) return NULL;
627 ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx);
628 if (!ctx->nbtsock_srv2) return NULL;
630 status = socket_listen(ctx->nbtsock_srv2->sock, ctx->myaddr2, lp_nbt_port(), 0, 0);
631 if (!NT_STATUS_IS_OK(status)) {
632 talloc_free(ctx->nbtsock_srv2);
633 ctx->nbtsock_srv2 = NULL;
637 ctx->addresses_best_num = 1;
638 ctx->addresses_best = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best_num);
639 if (!ctx->addresses_best) return NULL;
640 ctx->addresses_best[0].owner = ctx->b.address;
641 ctx->addresses_best[0].ip = ctx->myaddr;
643 ctx->addresses_all_num = iface_count();
644 ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num);
645 if (!ctx->addresses_all) return NULL;
646 for (i=0; i < ctx->addresses_all_num; i++) {
647 ctx->addresses_all[i].owner = ctx->b.address;
648 ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(i));
649 if (!ctx->addresses_all[i].ip) return NULL;
652 if (ctx->nbtsock_srv2) {
653 ctx->addresses_best2_num = 1;
654 ctx->addresses_best2 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best2_num);
655 if (!ctx->addresses_best2) return NULL;
656 ctx->addresses_best2[0].owner = ctx->b.address;
657 ctx->addresses_best2[0].ip = ctx->myaddr2;
659 ctx->addresses_mhomed_num = 2;
660 ctx->addresses_mhomed = talloc_array(ctx, struct wrepl_ip, ctx->addresses_mhomed_num);
661 if (!ctx->addresses_mhomed) return NULL;
662 ctx->addresses_mhomed[0].owner = ctx->b.address;
663 ctx->addresses_mhomed[0].ip = ctx->myaddr;
664 ctx->addresses_mhomed[1].owner = ctx->b.address;
665 ctx->addresses_mhomed[1].ip = ctx->myaddr2;
671 static BOOL test_wrepl_update_one(struct test_wrepl_conflict_conn *ctx,
672 const struct wrepl_wins_owner *owner,
673 const struct wrepl_wins_name *name)
676 struct wrepl_socket *wrepl_socket;
677 struct wrepl_associate associate;
678 struct wrepl_packet update_packet, repl_send;
679 struct wrepl_table *update;
680 struct wrepl_wins_owner wrepl_wins_owners[1];
681 struct wrepl_packet *repl_recv;
682 struct wrepl_wins_owner *send_request;
683 struct wrepl_send_reply *send_reply;
684 struct wrepl_wins_name wrepl_wins_names[1];
688 wrepl_socket = wrepl_socket_init(ctx, NULL);
690 status = wrepl_connect(wrepl_socket, NULL, ctx->address);
691 CHECK_STATUS(status, NT_STATUS_OK);
693 status = wrepl_associate(wrepl_socket, &associate);
694 CHECK_STATUS(status, NT_STATUS_OK);
695 assoc_ctx = associate.out.assoc_ctx;
697 /* now send a WREPL_REPL_UPDATE message */
698 ZERO_STRUCT(update_packet);
699 update_packet.opcode = WREPL_OPCODE_BITS;
700 update_packet.assoc_ctx = assoc_ctx;
701 update_packet.mess_type = WREPL_REPLICATION;
702 update_packet.message.replication.command = WREPL_REPL_UPDATE;
703 update = &update_packet.message.replication.info.table;
705 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
706 update->partners = wrepl_wins_owners;
707 update->initiator = "0.0.0.0";
709 wrepl_wins_owners[0] = *owner;
711 status = wrepl_request(wrepl_socket, wrepl_socket,
712 &update_packet, &repl_recv);
713 CHECK_STATUS(status, NT_STATUS_OK);
714 CHECK_VALUE(repl_recv->mess_type, WREPL_REPLICATION);
715 CHECK_VALUE(repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
716 send_request = &repl_recv->message.replication.info.owner;
718 ZERO_STRUCT(repl_send);
719 repl_send.opcode = WREPL_OPCODE_BITS;
720 repl_send.assoc_ctx = assoc_ctx;
721 repl_send.mess_type = WREPL_REPLICATION;
722 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
723 send_reply = &repl_send.message.replication.info.reply;
725 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
726 send_reply->names = wrepl_wins_names;
728 wrepl_wins_names[0] = *name;
730 status = wrepl_request(wrepl_socket, wrepl_socket,
731 &repl_send, &repl_recv);
732 CHECK_STATUS(status, NT_STATUS_OK);
733 CHECK_VALUE(repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
734 CHECK_VALUE(repl_recv->message.stop.reason, 0);
737 talloc_free(wrepl_socket);
741 static BOOL test_wrepl_is_applied(struct test_wrepl_conflict_conn *ctx,
742 const struct wrepl_wins_owner *owner,
743 const struct wrepl_wins_name *name,
748 struct wrepl_pull_names pull_names;
749 struct wrepl_name *names;
751 pull_names.in.assoc_ctx = ctx->pull_assoc;
752 pull_names.in.partner = *owner;
753 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
755 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
756 CHECK_STATUS(status, NT_STATUS_OK);
757 CHECK_VALUE(pull_names.out.num_names, (expected?1:0));
759 names = pull_names.out.names;
762 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
766 CHECK_VALUE(names[0].name.type, name->name->type);
767 CHECK_VALUE_STRING(names[0].name.name, name->name->name);
768 CHECK_VALUE_STRING(names[0].name.scope, name->name->scope);
769 CHECK_VALUE(flags, name->flags);
770 CHECK_VALUE_UINT64(names[0].version_id, name->id);
773 CHECK_VALUE(names[0].num_addresses,
774 name->addresses.addresses.num_ips);
776 CHECK_VALUE(names[0].num_addresses, 1);
777 CHECK_VALUE_STRING(names[0].addresses[0].address,
782 talloc_free(pull_names.out.names);
786 static BOOL test_wrepl_mhomed_merged(struct test_wrepl_conflict_conn *ctx,
787 const struct wrepl_wins_owner *owner1,
788 uint32_t num_ips1, const struct wrepl_ip *ips1,
789 const struct wrepl_wins_owner *owner2,
790 uint32_t num_ips2, const struct wrepl_ip *ips2,
791 const struct wrepl_wins_name *name2)
795 struct wrepl_pull_names pull_names;
796 struct wrepl_name *names;
799 uint32_t num_ips = num_ips1 + num_ips2;
801 for (i = 0; i < num_ips2; i++) {
802 for (j = 0; j < num_ips1; j++) {
803 if (strcmp(ips2[i].ip,ips1[j].ip) == 0) {
810 pull_names.in.assoc_ctx = ctx->pull_assoc;
811 pull_names.in.partner = *owner2;
812 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
814 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
815 CHECK_STATUS(status, NT_STATUS_OK);
816 CHECK_VALUE(pull_names.out.num_names, 1);
818 names = pull_names.out.names;
820 flags = WREPL_NAME_FLAGS(names[0].type,
824 CHECK_VALUE(names[0].name.type, name2->name->type);
825 CHECK_VALUE_STRING(names[0].name.name, name2->name->name);
826 CHECK_VALUE_STRING(names[0].name.scope, name2->name->scope);
827 CHECK_VALUE(flags, name2->flags | WREPL_TYPE_MHOMED);
828 CHECK_VALUE_UINT64(names[0].version_id, name2->id);
830 CHECK_VALUE(names[0].num_addresses, num_ips);
832 for (i = 0; i < names[0].num_addresses; i++) {
833 const char *addr = names[0].addresses[i].address;
834 const char *owner = names[0].addresses[i].owner;
837 for (j = 0; j < num_ips2; j++) {
838 if (strcmp(addr, ips2[j].ip) == 0) {
840 CHECK_VALUE_STRING(owner, owner2->address);
847 for (j = 0; j < num_ips1; j++) {
848 if (strcmp(addr, ips1[j].ip) == 0) {
850 CHECK_VALUE_STRING(owner, owner1->address);
857 CHECK_VALUE_STRING(addr, "not found in address list");
860 talloc_free(pull_names.out.names);
864 static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx,
865 struct wrepl_wins_owner *merge_owner,
866 struct wrepl_wins_owner *owner1,
867 uint32_t num_ips1, const struct wrepl_ip *ips1,
868 struct wrepl_wins_owner *owner2,
869 uint32_t num_ips2, const struct wrepl_ip *ips2,
870 const struct wrepl_wins_name *name2)
874 struct wrepl_pull_names pull_names;
875 struct wrepl_name *names;
876 struct wrepl_name *name = NULL;
879 uint32_t num_ips = num_ips1 + num_ips2;
882 merge_owner = &ctx->c;
885 for (i = 0; i < num_ips1; i++) {
886 if (owner1 != &ctx->c && strcmp(ips1[i].owner,owner2->address) == 0) {
890 for (j = 0; j < num_ips2; j++) {
891 if (strcmp(ips1[i].ip,ips2[j].ip) == 0) {
899 pull_names.in.assoc_ctx = ctx->pull_assoc;
900 pull_names.in.partner = *merge_owner;
901 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
902 pull_names.in.partner.max_version = 0;
904 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
905 CHECK_STATUS(status, NT_STATUS_OK);
907 names = pull_names.out.names;
909 for (i = 0; i < pull_names.out.num_names; i++) {
910 if (names[i].name.type != name2->name->type) continue;
911 if (!names[i].name.name) continue;
912 if (strcmp(names[i].name.name, name2->name->name) != 0) continue;
913 if (names[i].name.scope) continue;
918 if (pull_names.out.num_names > 0) {
919 merge_owner->max_version = names[pull_names.out.num_names-1].version_id;
923 printf("%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name));
927 flags = WREPL_NAME_FLAGS(name->type,
931 CHECK_VALUE(name->name.type, name2->name->type);
932 CHECK_VALUE_STRING(name->name.name, name2->name->name);
933 CHECK_VALUE_STRING(name->name.scope, name2->name->scope);
934 CHECK_VALUE(flags, name2->flags);
936 CHECK_VALUE(name->num_addresses, num_ips);
938 for (i = 0; i < name->num_addresses; i++) {
939 const char *addr = name->addresses[i].address;
940 const char *owner = name->addresses[i].owner;
943 for (j = 0; j < num_ips2; j++) {
944 if (strcmp(addr, ips2[j].ip) == 0) {
946 CHECK_VALUE_STRING(owner, ips2[j].owner);
953 for (j = 0; j < num_ips1; j++) {
954 if (strcmp(addr, ips1[j].ip) == 0) {
956 if (owner1 == &ctx->c) {
957 CHECK_VALUE_STRING(owner, owner1->address);
959 CHECK_VALUE_STRING(owner, ips1[j].owner);
967 CHECK_VALUE_STRING(addr, "not found in address list");
970 talloc_free(pull_names.out.names);
974 static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx)
977 struct nbt_name name;
978 struct wrepl_wins_name wins_name1;
979 struct wrepl_wins_name wins_name2;
980 struct wrepl_wins_name *wins_name_tmp;
981 struct wrepl_wins_name *wins_name_last;
982 struct wrepl_wins_name *wins_name_cur;
984 uint8_t types[] = { 0x00, 0x1C };
986 enum wrepl_name_type type;
987 enum wrepl_name_state state;
988 enum wrepl_name_node node;
991 const struct wrepl_ip *ips;
994 .type = WREPL_TYPE_GROUP,
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_1),
1006 .ips = addresses_A_1,
1008 .type = WREPL_TYPE_UNIQUE,
1009 .state = WREPL_STATE_ACTIVE,
1010 .node = WREPL_NODE_B,
1012 .num_ips = ARRAY_SIZE(addresses_A_2),
1013 .ips = addresses_A_2,
1015 .type = WREPL_TYPE_UNIQUE,
1016 .state = WREPL_STATE_ACTIVE,
1017 .node = WREPL_NODE_B,
1019 .num_ips = ARRAY_SIZE(addresses_A_1),
1020 .ips = addresses_A_1,
1022 .type = WREPL_TYPE_UNIQUE,
1023 .state = WREPL_STATE_ACTIVE,
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_TOMBSTONE,
1031 .node = WREPL_NODE_B,
1033 .num_ips = ARRAY_SIZE(addresses_A_2),
1034 .ips = addresses_A_2,
1036 .type = WREPL_TYPE_MHOMED,
1037 .state = WREPL_STATE_TOMBSTONE,
1038 .node = WREPL_NODE_B,
1040 .num_ips = ARRAY_SIZE(addresses_A_1),
1041 .ips = addresses_A_1,
1043 .type = WREPL_TYPE_MHOMED,
1044 .state = WREPL_STATE_RELEASED,
1045 .node = WREPL_NODE_B,
1047 .num_ips = ARRAY_SIZE(addresses_A_2),
1048 .ips = addresses_A_2,
1050 .type = WREPL_TYPE_SGROUP,
1051 .state = WREPL_STATE_ACTIVE,
1052 .node = WREPL_NODE_B,
1054 .num_ips = ARRAY_SIZE(addresses_A_1),
1055 .ips = addresses_A_1,
1057 .type = WREPL_TYPE_SGROUP,
1058 .state = WREPL_STATE_ACTIVE,
1059 .node = WREPL_NODE_B,
1061 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1062 .ips = addresses_A_3_4,
1064 .type = WREPL_TYPE_SGROUP,
1065 .state = WREPL_STATE_TOMBSTONE,
1066 .node = WREPL_NODE_B,
1068 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1069 .ips = addresses_B_3_4,
1071 /* the last one should always be a unique,tomstone record! */
1072 .type = WREPL_TYPE_UNIQUE,
1073 .state = WREPL_STATE_TOMBSTONE,
1074 .node = WREPL_NODE_B,
1076 .num_ips = ARRAY_SIZE(addresses_A_1),
1077 .ips = addresses_A_1,
1081 if (!ctx) return False;
1083 name.name = "_SAME_OWNER_A";
1087 wins_name_tmp = NULL;
1088 wins_name_last = &wins_name2;
1089 wins_name_cur = &wins_name1;
1091 for (j=0; ret && j < ARRAY_SIZE(types); j++) {
1092 name.type = types[j];
1093 printf("Test Replica Conflicts with same owner[%s] for %s\n",
1094 nbt_name_string(ctx, &name), ctx->a.address);
1096 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
1097 wins_name_tmp = wins_name_last;
1098 wins_name_last = wins_name_cur;
1099 wins_name_cur = wins_name_tmp;
1102 printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
1103 wrepl_name_type_string(records[i-1].type),
1104 wrepl_name_state_string(records[i-1].state),
1105 (records[i-1].is_static?",static":""),
1106 wrepl_name_type_string(records[i].type),
1107 wrepl_name_state_string(records[i].state),
1108 (records[i].is_static?",static":""),
1109 (records[i-1].ips==records[i].ips?"same":"different"),
1113 wins_name_cur->name = &name;
1114 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
1117 records[i].is_static);
1118 wins_name_cur->id = ++ctx->a.max_version;
1119 if (wins_name_cur->flags & 2) {
1120 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
1121 wins_name_cur->addresses.addresses.ips = discard_const(records[i].ips);
1123 wins_name_cur->addresses.ip = records[i].ips[0].ip;
1125 wins_name_cur->unknown = "255.255.255.255";
1127 ret &= test_wrepl_update_one(ctx, &ctx->a,wins_name_cur);
1128 if (records[i].state == WREPL_STATE_RELEASED) {
1129 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_last, False);
1130 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, False);
1132 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, True);
1135 /* the first one is a cleanup run */
1136 if (!ret && i == 0) ret = True;
1139 printf("conflict handled wrong or record[%u]: %s\n", i, __location__);
1147 static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx)
1150 struct wrepl_wins_name wins_name1;
1151 struct wrepl_wins_name wins_name2;
1152 struct wrepl_wins_name *wins_name_r1;
1153 struct wrepl_wins_name *wins_name_r2;
1156 const char *line; /* just better debugging */
1157 struct nbt_name name;
1158 const char *comment;
1159 BOOL extra; /* not the worst case, this is an extra test */
1162 struct wrepl_wins_owner *owner;
1163 enum wrepl_name_type type;
1164 enum wrepl_name_state state;
1165 enum wrepl_name_node node;
1168 const struct wrepl_ip *ips;
1169 BOOL apply_expected;
1171 struct wrepl_wins_owner *merge_owner;
1172 BOOL sgroup_cleanup;
1176 * NOTE: the first record and the last applied one
1177 * needs to be from the same owner,
1178 * to not conflict in the next smbtorture run!!!
1181 .line = __location__,
1182 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1186 .type = WREPL_TYPE_UNIQUE,
1187 .state = WREPL_STATE_TOMBSTONE,
1188 .node = WREPL_NODE_B,
1190 .num_ips = ARRAY_SIZE(addresses_B_1),
1191 .ips = addresses_B_1,
1192 .apply_expected = True /* ignored */
1196 .type = WREPL_TYPE_UNIQUE,
1197 .state = WREPL_STATE_TOMBSTONE,
1198 .node = WREPL_NODE_B,
1200 .num_ips = ARRAY_SIZE(addresses_A_1),
1201 .ips = addresses_A_1,
1202 .apply_expected = True /* ignored */
1207 * unique vs unique section
1210 * unique,active vs. unique,active
1211 * => should be replaced
1214 .line = __location__,
1215 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1218 .type = WREPL_TYPE_UNIQUE,
1219 .state = WREPL_STATE_ACTIVE,
1220 .node = WREPL_NODE_B,
1222 .num_ips = ARRAY_SIZE(addresses_A_1),
1223 .ips = addresses_A_1,
1224 .apply_expected = True
1228 .type = WREPL_TYPE_UNIQUE,
1229 .state = WREPL_STATE_ACTIVE,
1230 .node = WREPL_NODE_B,
1232 .num_ips = ARRAY_SIZE(addresses_B_1),
1233 .ips = addresses_B_1,
1234 .apply_expected = True
1239 * unique,active vs. unique,tombstone
1240 * => should NOT be replaced
1243 .line = __location__,
1244 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1247 .type = WREPL_TYPE_UNIQUE,
1248 .state = WREPL_STATE_ACTIVE,
1249 .node = WREPL_NODE_B,
1251 .num_ips = ARRAY_SIZE(addresses_B_1),
1252 .ips = addresses_B_1,
1253 .apply_expected = True
1257 .type = WREPL_TYPE_UNIQUE,
1258 .state = WREPL_STATE_TOMBSTONE,
1259 .node = WREPL_NODE_B,
1261 .num_ips = ARRAY_SIZE(addresses_B_1),
1262 .ips = addresses_B_1,
1263 .apply_expected = False
1268 * unique,released vs. unique,active
1269 * => should be replaced
1272 .line = __location__,
1273 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1276 .type = WREPL_TYPE_UNIQUE,
1277 .state = WREPL_STATE_RELEASED,
1278 .node = WREPL_NODE_B,
1280 .num_ips = ARRAY_SIZE(addresses_B_1),
1281 .ips = addresses_B_1,
1282 .apply_expected = False
1286 .type = WREPL_TYPE_UNIQUE,
1287 .state = WREPL_STATE_ACTIVE,
1288 .node = WREPL_NODE_B,
1290 .num_ips = ARRAY_SIZE(addresses_A_1),
1291 .ips = addresses_A_1,
1292 .apply_expected = True
1297 * unique,released vs. unique,tombstone
1298 * => should be replaced
1301 .line = __location__,
1302 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1305 .type = WREPL_TYPE_UNIQUE,
1306 .state = WREPL_STATE_RELEASED,
1307 .node = WREPL_NODE_B,
1309 .num_ips = ARRAY_SIZE(addresses_A_1),
1310 .ips = addresses_A_1,
1311 .apply_expected = False
1315 .type = WREPL_TYPE_UNIQUE,
1316 .state = WREPL_STATE_TOMBSTONE,
1317 .node = WREPL_NODE_B,
1319 .num_ips = ARRAY_SIZE(addresses_B_1),
1320 .ips = addresses_B_1,
1321 .apply_expected = True
1326 * unique,tombstone vs. unique,active
1327 * => should be replaced
1330 .line = __location__,
1331 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1334 .type = WREPL_TYPE_UNIQUE,
1335 .state = WREPL_STATE_TOMBSTONE,
1336 .node = WREPL_NODE_B,
1338 .num_ips = ARRAY_SIZE(addresses_B_1),
1339 .ips = addresses_B_1,
1340 .apply_expected = True
1344 .type = WREPL_TYPE_UNIQUE,
1345 .state = WREPL_STATE_ACTIVE,
1346 .node = WREPL_NODE_B,
1348 .num_ips = ARRAY_SIZE(addresses_A_1),
1349 .ips = addresses_A_1,
1350 .apply_expected = True
1355 * unique,tombstone vs. unique,tombstone
1356 * => should be replaced
1359 .line = __location__,
1360 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1363 .type = WREPL_TYPE_UNIQUE,
1364 .state = WREPL_STATE_TOMBSTONE,
1365 .node = WREPL_NODE_B,
1367 .num_ips = ARRAY_SIZE(addresses_A_1),
1368 .ips = addresses_A_1,
1369 .apply_expected = True
1373 .type = WREPL_TYPE_UNIQUE,
1374 .state = WREPL_STATE_TOMBSTONE,
1375 .node = WREPL_NODE_B,
1377 .num_ips = ARRAY_SIZE(addresses_B_1),
1378 .ips = addresses_B_1,
1379 .apply_expected = True
1385 * unique vs normal groups section,
1388 * unique,active vs. group,active
1389 * => should be replaced
1392 .line = __location__,
1393 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1396 .type = WREPL_TYPE_UNIQUE,
1397 .state = WREPL_STATE_ACTIVE,
1398 .node = WREPL_NODE_B,
1400 .num_ips = ARRAY_SIZE(addresses_B_1),
1401 .ips = addresses_B_1,
1402 .apply_expected = True
1406 .type = WREPL_TYPE_GROUP,
1407 .state = WREPL_STATE_ACTIVE,
1408 .node = WREPL_NODE_B,
1410 .num_ips = ARRAY_SIZE(addresses_A_1),
1411 .ips = addresses_A_1,
1412 .apply_expected = True
1417 * unique,active vs. group,tombstone
1418 * => should NOT be replaced
1421 .line = __location__,
1422 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1425 .type = WREPL_TYPE_UNIQUE,
1426 .state = WREPL_STATE_ACTIVE,
1427 .node = WREPL_NODE_B,
1429 .num_ips = ARRAY_SIZE(addresses_A_1),
1430 .ips = addresses_A_1,
1431 .apply_expected = True
1435 .type = WREPL_TYPE_GROUP,
1436 .state = WREPL_STATE_TOMBSTONE,
1437 .node = WREPL_NODE_B,
1439 .num_ips = ARRAY_SIZE(addresses_A_1),
1440 .ips = addresses_A_1,
1441 .apply_expected = False
1446 * unique,released vs. group,active
1447 * => should be replaced
1450 .line = __location__,
1451 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1454 .type = WREPL_TYPE_UNIQUE,
1455 .state = WREPL_STATE_RELEASED,
1456 .node = WREPL_NODE_B,
1458 .num_ips = ARRAY_SIZE(addresses_A_1),
1459 .ips = addresses_A_1,
1460 .apply_expected = False
1464 .type = WREPL_TYPE_GROUP,
1465 .state = WREPL_STATE_ACTIVE,
1466 .node = WREPL_NODE_B,
1468 .num_ips = ARRAY_SIZE(addresses_B_1),
1469 .ips = addresses_B_1,
1470 .apply_expected = True
1475 * unique,released vs. group,tombstone
1476 * => should be replaced
1479 .line = __location__,
1480 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1483 .type = WREPL_TYPE_UNIQUE,
1484 .state = WREPL_STATE_RELEASED,
1485 .node = WREPL_NODE_B,
1487 .num_ips = ARRAY_SIZE(addresses_B_1),
1488 .ips = addresses_B_1,
1489 .apply_expected = False
1493 .type = WREPL_TYPE_GROUP,
1494 .state = WREPL_STATE_TOMBSTONE,
1495 .node = WREPL_NODE_B,
1497 .num_ips = ARRAY_SIZE(addresses_A_1),
1498 .ips = addresses_A_1,
1499 .apply_expected = True
1504 * unique,tombstone vs. group,active
1505 * => should be replaced
1508 .line = __location__,
1509 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1512 .type = WREPL_TYPE_UNIQUE,
1513 .state = WREPL_STATE_TOMBSTONE,
1514 .node = WREPL_NODE_B,
1516 .num_ips = ARRAY_SIZE(addresses_A_1),
1517 .ips = addresses_A_1,
1518 .apply_expected = True
1522 .type = WREPL_TYPE_GROUP,
1523 .state = WREPL_STATE_ACTIVE,
1524 .node = WREPL_NODE_B,
1526 .num_ips = ARRAY_SIZE(addresses_B_1),
1527 .ips = addresses_B_1,
1528 .apply_expected = True
1533 * unique,tombstone vs. group,tombstone
1534 * => should be replaced
1537 .line = __location__,
1538 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1541 .type = WREPL_TYPE_UNIQUE,
1542 .state = WREPL_STATE_TOMBSTONE,
1543 .node = WREPL_NODE_B,
1545 .num_ips = ARRAY_SIZE(addresses_B_1),
1546 .ips = addresses_B_1,
1547 .apply_expected = True
1551 .type = WREPL_TYPE_GROUP,
1552 .state = WREPL_STATE_TOMBSTONE,
1553 .node = WREPL_NODE_B,
1555 .num_ips = ARRAY_SIZE(addresses_A_1),
1556 .ips = addresses_A_1,
1557 .apply_expected = True
1562 * unique vs special groups section,
1565 * unique,active vs. sgroup,active
1566 * => should NOT be replaced
1569 .line = __location__,
1570 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1573 .type = WREPL_TYPE_UNIQUE,
1574 .state = WREPL_STATE_ACTIVE,
1575 .node = WREPL_NODE_B,
1577 .num_ips = ARRAY_SIZE(addresses_A_1),
1578 .ips = addresses_A_1,
1579 .apply_expected = True
1583 .type = WREPL_TYPE_SGROUP,
1584 .state = WREPL_STATE_ACTIVE,
1585 .node = WREPL_NODE_B,
1587 .num_ips = ARRAY_SIZE(addresses_A_1),
1588 .ips = addresses_A_1,
1589 .apply_expected = False
1594 * unique,active vs. sgroup,tombstone
1595 * => should NOT be replaced
1598 .line = __location__,
1599 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1602 .type = WREPL_TYPE_UNIQUE,
1603 .state = WREPL_STATE_ACTIVE,
1604 .node = WREPL_NODE_B,
1606 .num_ips = ARRAY_SIZE(addresses_A_1),
1607 .ips = addresses_A_1,
1608 .apply_expected = True
1612 .type = WREPL_TYPE_SGROUP,
1613 .state = WREPL_STATE_TOMBSTONE,
1614 .node = WREPL_NODE_B,
1616 .num_ips = ARRAY_SIZE(addresses_A_1),
1617 .ips = addresses_A_1,
1618 .apply_expected = False
1623 * unique,released vs. sgroup,active
1624 * => should be replaced
1627 .line = __location__,
1628 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1631 .type = WREPL_TYPE_UNIQUE,
1632 .state = WREPL_STATE_RELEASED,
1633 .node = WREPL_NODE_B,
1635 .num_ips = ARRAY_SIZE(addresses_A_1),
1636 .ips = addresses_A_1,
1637 .apply_expected = False
1641 .type = WREPL_TYPE_SGROUP,
1642 .state = WREPL_STATE_ACTIVE,
1643 .node = WREPL_NODE_B,
1645 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1646 .ips = addresses_B_3_4,
1647 .apply_expected = True
1652 * unique,released vs. sgroup,tombstone
1653 * => should be replaced
1656 .line = __location__,
1657 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1660 .type = WREPL_TYPE_UNIQUE,
1661 .state = WREPL_STATE_RELEASED,
1662 .node = WREPL_NODE_B,
1664 .num_ips = ARRAY_SIZE(addresses_B_1),
1665 .ips = addresses_B_1,
1666 .apply_expected = False
1670 .type = WREPL_TYPE_SGROUP,
1671 .state = WREPL_STATE_TOMBSTONE,
1672 .node = WREPL_NODE_B,
1674 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1675 .ips = addresses_A_3_4,
1676 .apply_expected = True
1681 * unique,tombstone vs. sgroup,active
1682 * => should be replaced
1685 .line = __location__,
1686 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1689 .type = WREPL_TYPE_UNIQUE,
1690 .state = WREPL_STATE_TOMBSTONE,
1691 .node = WREPL_NODE_B,
1693 .num_ips = ARRAY_SIZE(addresses_A_1),
1694 .ips = addresses_A_1,
1695 .apply_expected = True
1699 .type = WREPL_TYPE_SGROUP,
1700 .state = WREPL_STATE_ACTIVE,
1701 .node = WREPL_NODE_B,
1703 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1704 .ips = addresses_B_3_4,
1705 .apply_expected = True
1710 * unique,tombstone vs. sgroup,tombstone
1711 * => should be replaced
1714 .line = __location__,
1715 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1718 .type = WREPL_TYPE_UNIQUE,
1719 .state = WREPL_STATE_TOMBSTONE,
1720 .node = WREPL_NODE_B,
1722 .num_ips = ARRAY_SIZE(addresses_B_1),
1723 .ips = addresses_B_1,
1724 .apply_expected = True
1728 .type = WREPL_TYPE_SGROUP,
1729 .state = WREPL_STATE_TOMBSTONE,
1730 .node = WREPL_NODE_B,
1732 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1733 .ips = addresses_A_3_4,
1734 .apply_expected = True
1739 * unique vs multi homed section,
1742 * unique,active vs. mhomed,active
1743 * => should be replaced
1746 .line = __location__,
1747 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1750 .type = WREPL_TYPE_UNIQUE,
1751 .state = WREPL_STATE_ACTIVE,
1752 .node = WREPL_NODE_B,
1754 .num_ips = ARRAY_SIZE(addresses_A_1),
1755 .ips = addresses_A_1,
1756 .apply_expected = True
1760 .type = WREPL_TYPE_MHOMED,
1761 .state = WREPL_STATE_ACTIVE,
1762 .node = WREPL_NODE_B,
1764 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1765 .ips = addresses_B_3_4,
1766 .apply_expected = True
1771 * unique,active vs. mhomed,tombstone
1772 * => should NOT be replaced
1775 .line = __location__,
1776 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1779 .type = WREPL_TYPE_UNIQUE,
1780 .state = WREPL_STATE_ACTIVE,
1781 .node = WREPL_NODE_B,
1783 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1784 .ips = addresses_B_3_4,
1785 .apply_expected = True
1789 .type = WREPL_TYPE_MHOMED,
1790 .state = WREPL_STATE_TOMBSTONE,
1791 .node = WREPL_NODE_B,
1793 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1794 .ips = addresses_B_3_4,
1795 .apply_expected = False
1800 * unique,released vs. mhomed,active
1801 * => should be replaced
1804 .line = __location__,
1805 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1808 .type = WREPL_TYPE_UNIQUE,
1809 .state = WREPL_STATE_RELEASED,
1810 .node = WREPL_NODE_B,
1812 .num_ips = ARRAY_SIZE(addresses_B_1),
1813 .ips = addresses_B_1,
1814 .apply_expected = False
1818 .type = WREPL_TYPE_MHOMED,
1819 .state = WREPL_STATE_ACTIVE,
1820 .node = WREPL_NODE_B,
1822 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1823 .ips = addresses_A_3_4,
1824 .apply_expected = True
1829 * unique,released vs. mhomed,tombstone
1830 * => should be replaced
1833 .line = __location__,
1834 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1837 .type = WREPL_TYPE_UNIQUE,
1838 .state = WREPL_STATE_RELEASED,
1839 .node = WREPL_NODE_B,
1841 .num_ips = ARRAY_SIZE(addresses_A_1),
1842 .ips = addresses_A_1,
1843 .apply_expected = False
1847 .type = WREPL_TYPE_MHOMED,
1848 .state = WREPL_STATE_TOMBSTONE,
1849 .node = WREPL_NODE_B,
1851 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1852 .ips = addresses_B_3_4,
1853 .apply_expected = True
1858 * unique,tombstone vs. mhomed,active
1859 * => should be replaced
1862 .line = __location__,
1863 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1866 .type = WREPL_TYPE_UNIQUE,
1867 .state = WREPL_STATE_TOMBSTONE,
1868 .node = WREPL_NODE_B,
1870 .num_ips = ARRAY_SIZE(addresses_B_1),
1871 .ips = addresses_B_1,
1872 .apply_expected = True
1876 .type = WREPL_TYPE_MHOMED,
1877 .state = WREPL_STATE_ACTIVE,
1878 .node = WREPL_NODE_B,
1880 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1881 .ips = addresses_A_3_4,
1882 .apply_expected = True
1887 * unique,tombstone vs. mhomed,tombstone
1888 * => should be replaced
1891 .line = __location__,
1892 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1895 .type = WREPL_TYPE_UNIQUE,
1896 .state = WREPL_STATE_TOMBSTONE,
1897 .node = WREPL_NODE_B,
1899 .num_ips = ARRAY_SIZE(addresses_A_1),
1900 .ips = addresses_A_1,
1901 .apply_expected = True
1905 .type = WREPL_TYPE_MHOMED,
1906 .state = WREPL_STATE_TOMBSTONE,
1907 .node = WREPL_NODE_B,
1909 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1910 .ips = addresses_B_3_4,
1911 .apply_expected = True
1916 * normal groups vs unique section,
1919 * group,active vs. unique,active
1920 * => should NOT be replaced
1923 .line = __location__,
1924 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1927 .type = WREPL_TYPE_GROUP,
1928 .state = WREPL_STATE_ACTIVE,
1929 .node = WREPL_NODE_B,
1931 .num_ips = ARRAY_SIZE(addresses_A_1),
1932 .ips = addresses_A_1,
1933 .apply_expected = True
1937 .type = WREPL_TYPE_UNIQUE,
1938 .state = WREPL_STATE_ACTIVE,
1939 .node = WREPL_NODE_B,
1941 .num_ips = ARRAY_SIZE(addresses_A_1),
1942 .ips = addresses_A_1,
1943 .apply_expected = False
1948 * group,active vs. unique,tombstone
1949 * => should NOT be replaced
1952 .line = __location__,
1953 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1956 .type = WREPL_TYPE_GROUP,
1957 .state = WREPL_STATE_ACTIVE,
1958 .node = WREPL_NODE_B,
1960 .num_ips = ARRAY_SIZE(addresses_A_1),
1961 .ips = addresses_A_1,
1962 .apply_expected = True
1966 .type = WREPL_TYPE_UNIQUE,
1967 .state = WREPL_STATE_TOMBSTONE,
1968 .node = WREPL_NODE_B,
1970 .num_ips = ARRAY_SIZE(addresses_A_1),
1971 .ips = addresses_A_1,
1972 .apply_expected = False
1977 * group,released vs. unique,active
1978 * => should NOT be replaced
1981 .line = __location__,
1982 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1985 .type = WREPL_TYPE_GROUP,
1986 .state = WREPL_STATE_RELEASED,
1987 .node = WREPL_NODE_B,
1989 .num_ips = ARRAY_SIZE(addresses_A_1),
1990 .ips = addresses_A_1,
1991 .apply_expected = False
1995 .type = WREPL_TYPE_UNIQUE,
1996 .state = WREPL_STATE_ACTIVE,
1997 .node = WREPL_NODE_B,
1999 .num_ips = ARRAY_SIZE(addresses_A_1),
2000 .ips = addresses_A_1,
2001 .apply_expected = False
2006 * group,released vs. unique,tombstone
2007 * => should NOT be replaced
2010 .line = __location__,
2011 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2014 .type = WREPL_TYPE_GROUP,
2015 .state = WREPL_STATE_RELEASED,
2016 .node = WREPL_NODE_B,
2018 .num_ips = ARRAY_SIZE(addresses_A_1),
2019 .ips = addresses_A_1,
2020 .apply_expected = False
2024 .type = WREPL_TYPE_UNIQUE,
2025 .state = WREPL_STATE_TOMBSTONE,
2026 .node = WREPL_NODE_B,
2028 .num_ips = ARRAY_SIZE(addresses_A_1),
2029 .ips = addresses_A_1,
2030 .apply_expected = False
2035 * group,tombstone vs. unique,active
2036 * => should NOT be replaced
2039 .line = __location__,
2040 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2043 .type = WREPL_TYPE_GROUP,
2044 .state = WREPL_STATE_TOMBSTONE,
2045 .node = WREPL_NODE_B,
2047 .num_ips = ARRAY_SIZE(addresses_A_1),
2048 .ips = addresses_A_1,
2049 .apply_expected = True
2053 .type = WREPL_TYPE_UNIQUE,
2054 .state = WREPL_STATE_ACTIVE,
2055 .node = WREPL_NODE_B,
2057 .num_ips = ARRAY_SIZE(addresses_A_1),
2058 .ips = addresses_A_1,
2059 .apply_expected = False
2064 * group,tombstone vs. unique,tombstone
2065 * => should NOT be replaced
2068 .line = __location__,
2069 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2072 .type = WREPL_TYPE_GROUP,
2073 .state = WREPL_STATE_TOMBSTONE,
2074 .node = WREPL_NODE_B,
2076 .num_ips = ARRAY_SIZE(addresses_A_1),
2077 .ips = addresses_A_1,
2078 .apply_expected = True
2082 .type = WREPL_TYPE_UNIQUE,
2083 .state = WREPL_STATE_TOMBSTONE,
2084 .node = WREPL_NODE_B,
2086 .num_ips = ARRAY_SIZE(addresses_A_1),
2087 .ips = addresses_A_1,
2088 .apply_expected = False
2093 * normal groups vs normal groups section,
2096 * group,active vs. group,active
2097 * => should NOT be replaced
2100 .line = __location__,
2101 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2104 .type = WREPL_TYPE_GROUP,
2105 .state = WREPL_STATE_ACTIVE,
2106 .node = WREPL_NODE_B,
2108 .num_ips = ARRAY_SIZE(addresses_A_1),
2109 .ips = addresses_A_1,
2110 .apply_expected = True
2114 .type = WREPL_TYPE_GROUP,
2115 .state = WREPL_STATE_ACTIVE,
2116 .node = WREPL_NODE_B,
2118 .num_ips = ARRAY_SIZE(addresses_A_1),
2119 .ips = addresses_A_1,
2120 .apply_expected = False
2125 * group,active vs. group,tombstone
2126 * => should NOT be replaced
2129 .line = __location__,
2130 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2133 .type = WREPL_TYPE_GROUP,
2134 .state = WREPL_STATE_ACTIVE,
2135 .node = WREPL_NODE_B,
2137 .num_ips = ARRAY_SIZE(addresses_A_1),
2138 .ips = addresses_A_1,
2139 .apply_expected = True
2143 .type = WREPL_TYPE_GROUP,
2144 .state = WREPL_STATE_TOMBSTONE,
2145 .node = WREPL_NODE_B,
2147 .num_ips = ARRAY_SIZE(addresses_A_1),
2148 .ips = addresses_A_1,
2149 .apply_expected = False
2154 * group,released vs. group,active
2155 * => should be replaced
2158 .line = __location__,
2159 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2162 .type = WREPL_TYPE_GROUP,
2163 .state = WREPL_STATE_RELEASED,
2164 .node = WREPL_NODE_B,
2166 .num_ips = ARRAY_SIZE(addresses_A_1),
2167 .ips = addresses_A_1,
2168 .apply_expected = False
2172 .type = WREPL_TYPE_GROUP,
2173 .state = WREPL_STATE_ACTIVE,
2174 .node = WREPL_NODE_B,
2176 .num_ips = ARRAY_SIZE(addresses_B_1),
2177 .ips = addresses_B_1,
2178 .apply_expected = True
2183 * group,released vs. group,tombstone
2184 * => should be replaced
2187 .line = __location__,
2188 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2191 .type = WREPL_TYPE_GROUP,
2192 .state = WREPL_STATE_RELEASED,
2193 .node = WREPL_NODE_B,
2195 .num_ips = ARRAY_SIZE(addresses_A_1),
2196 .ips = addresses_A_1,
2197 .apply_expected = False
2201 .type = WREPL_TYPE_GROUP,
2202 .state = WREPL_STATE_TOMBSTONE,
2203 .node = WREPL_NODE_B,
2205 .num_ips = ARRAY_SIZE(addresses_B_1),
2206 .ips = addresses_B_1,
2207 .apply_expected = True
2212 * group,tombstone vs. group,active
2213 * => should be replaced
2216 .line = __location__,
2217 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2220 .type = WREPL_TYPE_GROUP,
2221 .state = WREPL_STATE_TOMBSTONE,
2222 .node = WREPL_NODE_B,
2224 .num_ips = ARRAY_SIZE(addresses_B_1),
2225 .ips = addresses_B_1,
2226 .apply_expected = True
2230 .type = WREPL_TYPE_GROUP,
2231 .state = WREPL_STATE_ACTIVE,
2232 .node = WREPL_NODE_B,
2234 .num_ips = ARRAY_SIZE(addresses_A_1),
2235 .ips = addresses_A_1,
2236 .apply_expected = True
2241 * group,tombstone vs. group,tombstone
2242 * => should be replaced
2245 .line = __location__,
2246 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2249 .type = WREPL_TYPE_GROUP,
2250 .state = WREPL_STATE_TOMBSTONE,
2251 .node = WREPL_NODE_B,
2253 .num_ips = ARRAY_SIZE(addresses_A_1),
2254 .ips = addresses_A_1,
2255 .apply_expected = True
2259 .type = WREPL_TYPE_GROUP,
2260 .state = WREPL_STATE_TOMBSTONE,
2261 .node = WREPL_NODE_B,
2263 .num_ips = ARRAY_SIZE(addresses_B_1),
2264 .ips = addresses_B_1,
2265 .apply_expected = True
2270 * normal groups vs special groups section,
2273 * group,active vs. sgroup,active
2274 * => should NOT be replaced
2277 .line = __location__,
2278 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2281 .type = WREPL_TYPE_GROUP,
2282 .state = WREPL_STATE_ACTIVE,
2283 .node = WREPL_NODE_B,
2285 .num_ips = ARRAY_SIZE(addresses_B_1),
2286 .ips = addresses_B_1,
2287 .apply_expected = True
2291 .type = WREPL_TYPE_SGROUP,
2292 .state = WREPL_STATE_ACTIVE,
2293 .node = WREPL_NODE_B,
2295 .num_ips = ARRAY_SIZE(addresses_B_1),
2296 .ips = addresses_B_1,
2297 .apply_expected = False
2302 * group,active vs. sgroup,tombstone
2303 * => should NOT be replaced
2306 .line = __location__,
2307 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2310 .type = WREPL_TYPE_GROUP,
2311 .state = WREPL_STATE_ACTIVE,
2312 .node = WREPL_NODE_B,
2314 .num_ips = ARRAY_SIZE(addresses_B_1),
2315 .ips = addresses_B_1,
2316 .apply_expected = True
2320 .type = WREPL_TYPE_SGROUP,
2321 .state = WREPL_STATE_TOMBSTONE,
2322 .node = WREPL_NODE_B,
2324 .num_ips = ARRAY_SIZE(addresses_B_1),
2325 .ips = addresses_B_1,
2326 .apply_expected = False
2331 * group,released vs. sgroup,active
2332 * => should be replaced
2335 .line = __location__,
2336 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2339 .type = WREPL_TYPE_GROUP,
2340 .state = WREPL_STATE_RELEASED,
2341 .node = WREPL_NODE_B,
2343 .num_ips = ARRAY_SIZE(addresses_A_1),
2344 .ips = addresses_A_1,
2345 .apply_expected = False
2349 .type = WREPL_TYPE_SGROUP,
2350 .state = WREPL_STATE_ACTIVE,
2351 .node = WREPL_NODE_B,
2353 .num_ips = ARRAY_SIZE(addresses_B_1),
2354 .ips = addresses_B_1,
2355 .apply_expected = True
2360 * group,released vs. sgroup,tombstone
2361 * => should NOT be replaced
2364 .line = __location__,
2365 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2368 .type = WREPL_TYPE_GROUP,
2369 .state = WREPL_STATE_RELEASED,
2370 .node = WREPL_NODE_B,
2372 .num_ips = ARRAY_SIZE(addresses_B_1),
2373 .ips = addresses_B_1,
2374 .apply_expected = False
2378 .type = WREPL_TYPE_SGROUP,
2379 .state = WREPL_STATE_TOMBSTONE,
2380 .node = WREPL_NODE_B,
2382 .num_ips = ARRAY_SIZE(addresses_B_1),
2383 .ips = addresses_B_1,
2384 .apply_expected = False
2389 * group,tombstone vs. sgroup,active
2390 * => should be replaced
2393 .line = __location__,
2394 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2397 .type = WREPL_TYPE_GROUP,
2398 .state = WREPL_STATE_TOMBSTONE,
2399 .node = WREPL_NODE_B,
2401 .num_ips = ARRAY_SIZE(addresses_B_1),
2402 .ips = addresses_B_1,
2403 .apply_expected = True
2407 .type = WREPL_TYPE_SGROUP,
2408 .state = WREPL_STATE_ACTIVE,
2409 .node = WREPL_NODE_B,
2411 .num_ips = ARRAY_SIZE(addresses_A_1),
2412 .ips = addresses_A_1,
2413 .apply_expected = True
2418 * group,tombstone vs. sgroup,tombstone
2419 * => should be replaced
2422 .line = __location__,
2423 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2426 .type = WREPL_TYPE_GROUP,
2427 .state = WREPL_STATE_TOMBSTONE,
2428 .node = WREPL_NODE_B,
2430 .num_ips = ARRAY_SIZE(addresses_A_1),
2431 .ips = addresses_A_1,
2432 .apply_expected = True
2436 .type = WREPL_TYPE_SGROUP,
2437 .state = WREPL_STATE_TOMBSTONE,
2438 .node = WREPL_NODE_B,
2440 .num_ips = ARRAY_SIZE(addresses_B_1),
2441 .ips = addresses_B_1,
2442 .apply_expected = True
2447 * normal groups vs multi homed section,
2450 * group,active vs. mhomed,active
2451 * => should NOT be replaced
2454 .line = __location__,
2455 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2458 .type = WREPL_TYPE_GROUP,
2459 .state = WREPL_STATE_ACTIVE,
2460 .node = WREPL_NODE_B,
2462 .num_ips = ARRAY_SIZE(addresses_B_1),
2463 .ips = addresses_B_1,
2464 .apply_expected = True
2468 .type = WREPL_TYPE_MHOMED,
2469 .state = WREPL_STATE_ACTIVE,
2470 .node = WREPL_NODE_B,
2472 .num_ips = ARRAY_SIZE(addresses_B_1),
2473 .ips = addresses_B_1,
2474 .apply_expected = False
2479 * group,active vs. mhomed,tombstone
2480 * => should NOT be replaced
2483 .line = __location__,
2484 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2487 .type = WREPL_TYPE_GROUP,
2488 .state = WREPL_STATE_ACTIVE,
2489 .node = WREPL_NODE_B,
2491 .num_ips = ARRAY_SIZE(addresses_B_1),
2492 .ips = addresses_B_1,
2493 .apply_expected = True
2497 .type = WREPL_TYPE_MHOMED,
2498 .state = WREPL_STATE_TOMBSTONE,
2499 .node = WREPL_NODE_B,
2501 .num_ips = ARRAY_SIZE(addresses_B_1),
2502 .ips = addresses_B_1,
2503 .apply_expected = False
2508 * group,released vs. mhomed,active
2509 * => should NOT be replaced
2512 .line = __location__,
2513 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2516 .type = WREPL_TYPE_GROUP,
2517 .state = WREPL_STATE_RELEASED,
2518 .node = WREPL_NODE_B,
2520 .num_ips = ARRAY_SIZE(addresses_B_1),
2521 .ips = addresses_B_1,
2522 .apply_expected = False
2526 .type = WREPL_TYPE_MHOMED,
2527 .state = WREPL_STATE_ACTIVE,
2528 .node = WREPL_NODE_B,
2530 .num_ips = ARRAY_SIZE(addresses_B_1),
2531 .ips = addresses_B_1,
2532 .apply_expected = False
2537 * group,released vs. mhomed,tombstone
2538 * => should NOT be replaced
2541 .line = __location__,
2542 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2545 .type = WREPL_TYPE_GROUP,
2546 .state = WREPL_STATE_RELEASED,
2547 .node = WREPL_NODE_B,
2549 .num_ips = ARRAY_SIZE(addresses_B_1),
2550 .ips = addresses_B_1,
2551 .apply_expected = False
2555 .type = WREPL_TYPE_MHOMED,
2556 .state = WREPL_STATE_TOMBSTONE,
2557 .node = WREPL_NODE_B,
2559 .num_ips = ARRAY_SIZE(addresses_B_1),
2560 .ips = addresses_B_1,
2561 .apply_expected = False
2566 * group,tombstone vs. mhomed,active
2567 * => should be replaced
2570 .line = __location__,
2571 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2574 .type = WREPL_TYPE_GROUP,
2575 .state = WREPL_STATE_TOMBSTONE,
2576 .node = WREPL_NODE_B,
2578 .num_ips = ARRAY_SIZE(addresses_B_1),
2579 .ips = addresses_B_1,
2580 .apply_expected = True
2584 .type = WREPL_TYPE_MHOMED,
2585 .state = WREPL_STATE_ACTIVE,
2586 .node = WREPL_NODE_B,
2588 .num_ips = ARRAY_SIZE(addresses_A_1),
2589 .ips = addresses_A_1,
2590 .apply_expected = True
2595 * group,tombstone vs. mhomed,tombstone
2596 * => should be replaced
2599 .line = __location__,
2600 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2603 .type = WREPL_TYPE_GROUP,
2604 .state = WREPL_STATE_TOMBSTONE,
2605 .node = WREPL_NODE_B,
2607 .num_ips = ARRAY_SIZE(addresses_A_1),
2608 .ips = addresses_A_1,
2609 .apply_expected = True
2613 .type = WREPL_TYPE_MHOMED,
2614 .state = WREPL_STATE_TOMBSTONE,
2615 .node = WREPL_NODE_B,
2617 .num_ips = ARRAY_SIZE(addresses_B_1),
2618 .ips = addresses_B_1,
2619 .apply_expected = True
2624 * special groups vs unique section,
2627 * sgroup,active vs. unique,active
2628 * => should NOT be replaced
2631 .line = __location__,
2632 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2635 .type = WREPL_TYPE_SGROUP,
2636 .state = WREPL_STATE_ACTIVE,
2637 .node = WREPL_NODE_B,
2639 .num_ips = ARRAY_SIZE(addresses_B_1),
2640 .ips = addresses_B_1,
2641 .apply_expected = True
2645 .type = WREPL_TYPE_UNIQUE,
2646 .state = WREPL_STATE_ACTIVE,
2647 .node = WREPL_NODE_B,
2649 .num_ips = ARRAY_SIZE(addresses_B_1),
2650 .ips = addresses_B_1,
2651 .apply_expected = False
2656 * sgroup,active vs. unique,tombstone
2657 * => should NOT be replaced
2660 .line = __location__,
2661 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2664 .type = WREPL_TYPE_SGROUP,
2665 .state = WREPL_STATE_ACTIVE,
2666 .node = WREPL_NODE_B,
2668 .num_ips = ARRAY_SIZE(addresses_B_1),
2669 .ips = addresses_B_1,
2670 .apply_expected = True
2674 .type = WREPL_TYPE_UNIQUE,
2675 .state = WREPL_STATE_TOMBSTONE,
2676 .node = WREPL_NODE_B,
2678 .num_ips = ARRAY_SIZE(addresses_B_1),
2679 .ips = addresses_B_1,
2680 .apply_expected = False
2685 * sgroup,released vs. unique,active
2686 * => should be replaced
2689 .line = __location__,
2690 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2693 .type = WREPL_TYPE_SGROUP,
2694 .state = WREPL_STATE_RELEASED,
2695 .node = WREPL_NODE_B,
2697 .num_ips = ARRAY_SIZE(addresses_B_1),
2698 .ips = addresses_B_1,
2699 .apply_expected = False
2703 .type = WREPL_TYPE_UNIQUE,
2704 .state = WREPL_STATE_ACTIVE,
2705 .node = WREPL_NODE_B,
2707 .num_ips = ARRAY_SIZE(addresses_A_1),
2708 .ips = addresses_A_1,
2709 .apply_expected = True
2714 * sgroup,released vs. unique,tombstone
2715 * => should be replaced
2718 .line = __location__,
2719 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2722 .type = WREPL_TYPE_SGROUP,
2723 .state = WREPL_STATE_RELEASED,
2724 .node = WREPL_NODE_B,
2726 .num_ips = ARRAY_SIZE(addresses_A_1),
2727 .ips = addresses_A_1,
2728 .apply_expected = False
2732 .type = WREPL_TYPE_UNIQUE,
2733 .state = WREPL_STATE_TOMBSTONE,
2734 .node = WREPL_NODE_B,
2736 .num_ips = ARRAY_SIZE(addresses_B_1),
2737 .ips = addresses_B_1,
2738 .apply_expected = True
2743 * sgroup,tombstone vs. unique,active
2744 * => should be replaced
2747 .line = __location__,
2748 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2751 .type = WREPL_TYPE_SGROUP,
2752 .state = WREPL_STATE_TOMBSTONE,
2753 .node = WREPL_NODE_B,
2755 .num_ips = ARRAY_SIZE(addresses_A_1),
2756 .ips = addresses_A_1,
2757 .apply_expected = True
2761 .type = WREPL_TYPE_UNIQUE,
2762 .state = WREPL_STATE_ACTIVE,
2763 .node = WREPL_NODE_B,
2765 .num_ips = ARRAY_SIZE(addresses_B_1),
2766 .ips = addresses_B_1,
2767 .apply_expected = True
2772 * sgroup,tombstone vs. unique,tombstone
2773 * => should be replaced
2776 .line = __location__,
2777 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2780 .type = WREPL_TYPE_SGROUP,
2781 .state = WREPL_STATE_TOMBSTONE,
2782 .node = WREPL_NODE_B,
2784 .num_ips = ARRAY_SIZE(addresses_B_1),
2785 .ips = addresses_B_1,
2786 .apply_expected = True
2790 .type = WREPL_TYPE_UNIQUE,
2791 .state = WREPL_STATE_TOMBSTONE,
2792 .node = WREPL_NODE_B,
2794 .num_ips = ARRAY_SIZE(addresses_A_1),
2795 .ips = addresses_A_1,
2796 .apply_expected = True
2801 * special groups vs normal group section,
2804 * sgroup,active vs. group,active
2805 * => should NOT be replaced
2808 .line = __location__,
2809 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2812 .type = WREPL_TYPE_SGROUP,
2813 .state = WREPL_STATE_ACTIVE,
2814 .node = WREPL_NODE_B,
2816 .num_ips = ARRAY_SIZE(addresses_A_1),
2817 .ips = addresses_A_1,
2818 .apply_expected = True
2822 .type = WREPL_TYPE_GROUP,
2823 .state = WREPL_STATE_ACTIVE,
2824 .node = WREPL_NODE_B,
2826 .num_ips = ARRAY_SIZE(addresses_A_1),
2827 .ips = addresses_A_1,
2828 .apply_expected = False
2833 * sgroup,active vs. group,tombstone
2834 * => should NOT be replaced
2837 .line = __location__,
2838 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2841 .type = WREPL_TYPE_SGROUP,
2842 .state = WREPL_STATE_ACTIVE,
2843 .node = WREPL_NODE_B,
2845 .num_ips = ARRAY_SIZE(addresses_A_1),
2846 .ips = addresses_A_1,
2847 .apply_expected = True
2851 .type = WREPL_TYPE_GROUP,
2852 .state = WREPL_STATE_TOMBSTONE,
2853 .node = WREPL_NODE_B,
2855 .num_ips = ARRAY_SIZE(addresses_A_1),
2856 .ips = addresses_A_1,
2857 .apply_expected = False
2862 * sgroup,released vs. group,active
2863 * => should be replaced
2866 .line = __location__,
2867 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2870 .type = WREPL_TYPE_SGROUP,
2871 .state = WREPL_STATE_RELEASED,
2872 .node = WREPL_NODE_B,
2874 .num_ips = ARRAY_SIZE(addresses_A_1),
2875 .ips = addresses_A_1,
2876 .apply_expected = False
2880 .type = WREPL_TYPE_GROUP,
2881 .state = WREPL_STATE_ACTIVE,
2882 .node = WREPL_NODE_B,
2884 .num_ips = ARRAY_SIZE(addresses_B_1),
2885 .ips = addresses_B_1,
2886 .apply_expected = True
2891 * sgroup,released vs. group,tombstone
2892 * => should be replaced
2895 .line = __location__,
2896 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2899 .type = WREPL_TYPE_SGROUP,
2900 .state = WREPL_STATE_RELEASED,
2901 .node = WREPL_NODE_B,
2903 .num_ips = ARRAY_SIZE(addresses_B_1),
2904 .ips = addresses_B_1,
2905 .apply_expected = False
2909 .type = WREPL_TYPE_GROUP,
2910 .state = WREPL_STATE_TOMBSTONE,
2911 .node = WREPL_NODE_B,
2913 .num_ips = ARRAY_SIZE(addresses_A_1),
2914 .ips = addresses_A_1,
2915 .apply_expected = True
2920 * sgroup,tombstone vs. group,active
2921 * => should NOT be replaced
2924 .line = __location__,
2925 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2928 .type = WREPL_TYPE_SGROUP,
2929 .state = WREPL_STATE_TOMBSTONE,
2930 .node = WREPL_NODE_B,
2932 .num_ips = ARRAY_SIZE(addresses_A_1),
2933 .ips = addresses_A_1,
2934 .apply_expected = True
2938 .type = WREPL_TYPE_GROUP,
2939 .state = WREPL_STATE_ACTIVE,
2940 .node = WREPL_NODE_B,
2942 .num_ips = ARRAY_SIZE(addresses_B_1),
2943 .ips = addresses_B_1,
2944 .apply_expected = True
2949 * sgroup,tombstone vs. group,tombstone
2950 * => should NOT be replaced
2953 .line = __location__,
2954 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2957 .type = WREPL_TYPE_SGROUP,
2958 .state = WREPL_STATE_TOMBSTONE,
2959 .node = WREPL_NODE_B,
2961 .num_ips = ARRAY_SIZE(addresses_B_1),
2962 .ips = addresses_B_1,
2963 .apply_expected = True
2967 .type = WREPL_TYPE_GROUP,
2968 .state = WREPL_STATE_TOMBSTONE,
2969 .node = WREPL_NODE_B,
2971 .num_ips = ARRAY_SIZE(addresses_A_1),
2972 .ips = addresses_A_1,
2973 .apply_expected = True
2978 * special groups (not active) vs special group section,
2981 * sgroup,released vs. sgroup,active
2982 * => should be replaced
2985 .line = __location__,
2986 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2989 .type = WREPL_TYPE_SGROUP,
2990 .state = WREPL_STATE_RELEASED,
2991 .node = WREPL_NODE_B,
2993 .num_ips = ARRAY_SIZE(addresses_A_1),
2994 .ips = addresses_A_1,
2995 .apply_expected = False
2999 .type = WREPL_TYPE_SGROUP,
3000 .state = WREPL_STATE_ACTIVE,
3001 .node = WREPL_NODE_B,
3003 .num_ips = ARRAY_SIZE(addresses_B_1),
3004 .ips = addresses_B_1,
3005 .apply_expected = True
3010 * sgroup,released vs. sgroup,tombstone
3011 * => should be replaced
3014 .line = __location__,
3015 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3018 .type = WREPL_TYPE_SGROUP,
3019 .state = WREPL_STATE_RELEASED,
3020 .node = WREPL_NODE_B,
3022 .num_ips = ARRAY_SIZE(addresses_B_1),
3023 .ips = addresses_B_1,
3024 .apply_expected = False
3028 .type = WREPL_TYPE_SGROUP,
3029 .state = WREPL_STATE_TOMBSTONE,
3030 .node = WREPL_NODE_B,
3032 .num_ips = ARRAY_SIZE(addresses_A_1),
3033 .ips = addresses_A_1,
3034 .apply_expected = True
3039 * sgroup,tombstone vs. sgroup,active
3040 * => should NOT be replaced
3043 .line = __location__,
3044 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3047 .type = WREPL_TYPE_SGROUP,
3048 .state = WREPL_STATE_TOMBSTONE,
3049 .node = WREPL_NODE_B,
3051 .num_ips = ARRAY_SIZE(addresses_A_1),
3052 .ips = addresses_A_1,
3053 .apply_expected = True
3057 .type = WREPL_TYPE_SGROUP,
3058 .state = WREPL_STATE_ACTIVE,
3059 .node = WREPL_NODE_B,
3061 .num_ips = ARRAY_SIZE(addresses_B_1),
3062 .ips = addresses_B_1,
3063 .apply_expected = True
3068 * sgroup,tombstone vs. sgroup,tombstone
3069 * => should NOT be replaced
3072 .line = __location__,
3073 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3076 .type = WREPL_TYPE_SGROUP,
3077 .state = WREPL_STATE_TOMBSTONE,
3078 .node = WREPL_NODE_B,
3080 .num_ips = ARRAY_SIZE(addresses_B_1),
3081 .ips = addresses_B_1,
3082 .apply_expected = True
3086 .type = WREPL_TYPE_SGROUP,
3087 .state = WREPL_STATE_TOMBSTONE,
3088 .node = WREPL_NODE_B,
3090 .num_ips = ARRAY_SIZE(addresses_A_1),
3091 .ips = addresses_A_1,
3092 .apply_expected = True
3097 * special groups vs multi homed section,
3100 * sgroup,active vs. mhomed,active
3101 * => should NOT be replaced
3104 .line = __location__,
3105 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3108 .type = WREPL_TYPE_SGROUP,
3109 .state = WREPL_STATE_ACTIVE,
3110 .node = WREPL_NODE_B,
3112 .num_ips = ARRAY_SIZE(addresses_A_1),
3113 .ips = addresses_A_1,
3114 .apply_expected = True
3118 .type = WREPL_TYPE_MHOMED,
3119 .state = WREPL_STATE_ACTIVE,
3120 .node = WREPL_NODE_B,
3122 .num_ips = ARRAY_SIZE(addresses_A_1),
3123 .ips = addresses_A_1,
3124 .apply_expected = False
3129 * sgroup,active vs. mhomed,tombstone
3130 * => should NOT be replaced
3133 .line = __location__,
3134 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3137 .type = WREPL_TYPE_SGROUP,
3138 .state = WREPL_STATE_ACTIVE,
3139 .node = WREPL_NODE_B,
3141 .num_ips = ARRAY_SIZE(addresses_A_1),
3142 .ips = addresses_A_1,
3143 .apply_expected = True
3147 .type = WREPL_TYPE_MHOMED,
3148 .state = WREPL_STATE_TOMBSTONE,
3149 .node = WREPL_NODE_B,
3151 .num_ips = ARRAY_SIZE(addresses_A_1),
3152 .ips = addresses_A_1,
3153 .apply_expected = False
3158 * sgroup,released vs. mhomed,active
3159 * => should be replaced
3162 .line = __location__,
3163 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3166 .type = WREPL_TYPE_SGROUP,
3167 .state = WREPL_STATE_RELEASED,
3168 .node = WREPL_NODE_B,
3170 .num_ips = ARRAY_SIZE(addresses_A_1),
3171 .ips = addresses_A_1,
3172 .apply_expected = False
3176 .type = WREPL_TYPE_MHOMED,
3177 .state = WREPL_STATE_ACTIVE,
3178 .node = WREPL_NODE_B,
3180 .num_ips = ARRAY_SIZE(addresses_B_1),
3181 .ips = addresses_B_1,
3182 .apply_expected = True
3187 * sgroup,released vs. mhomed,tombstone
3188 * => should be replaced
3191 .line = __location__,
3192 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3195 .type = WREPL_TYPE_SGROUP,
3196 .state = WREPL_STATE_RELEASED,
3197 .node = WREPL_NODE_B,
3199 .num_ips = ARRAY_SIZE(addresses_B_1),
3200 .ips = addresses_B_1,
3201 .apply_expected = False
3205 .type = WREPL_TYPE_MHOMED,
3206 .state = WREPL_STATE_TOMBSTONE,
3207 .node = WREPL_NODE_B,
3209 .num_ips = ARRAY_SIZE(addresses_A_1),
3210 .ips = addresses_A_1,
3211 .apply_expected = True
3216 * sgroup,tombstone vs. mhomed,active
3217 * => should be replaced
3220 .line = __location__,
3221 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3224 .type = WREPL_TYPE_SGROUP,
3225 .state = WREPL_STATE_TOMBSTONE,
3226 .node = WREPL_NODE_B,
3228 .num_ips = ARRAY_SIZE(addresses_A_1),
3229 .ips = addresses_A_1,
3230 .apply_expected = True
3234 .type = WREPL_TYPE_MHOMED,
3235 .state = WREPL_STATE_ACTIVE,
3236 .node = WREPL_NODE_B,
3238 .num_ips = ARRAY_SIZE(addresses_B_1),
3239 .ips = addresses_B_1,
3240 .apply_expected = True
3245 * sgroup,tombstone vs. mhomed,tombstone
3246 * => should be replaced
3249 .line = __location__,
3250 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3253 .type = WREPL_TYPE_SGROUP,
3254 .state = WREPL_STATE_TOMBSTONE,
3255 .node = WREPL_NODE_B,
3257 .num_ips = ARRAY_SIZE(addresses_B_1),
3258 .ips = addresses_B_1,
3259 .apply_expected = True
3263 .type = WREPL_TYPE_MHOMED,
3264 .state = WREPL_STATE_TOMBSTONE,
3265 .node = WREPL_NODE_B,
3267 .num_ips = ARRAY_SIZE(addresses_A_1),
3268 .ips = addresses_A_1,
3269 .apply_expected = True
3274 * multi homed vs. unique section,
3277 * mhomed,active vs. unique,active
3278 * => should be replaced
3281 .line = __location__,
3282 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3285 .type = WREPL_TYPE_MHOMED,
3286 .state = WREPL_STATE_ACTIVE,
3287 .node = WREPL_NODE_B,
3289 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3290 .ips = addresses_A_3_4,
3291 .apply_expected = True
3295 .type = WREPL_TYPE_UNIQUE,
3296 .state = WREPL_STATE_ACTIVE,
3297 .node = WREPL_NODE_B,
3299 .num_ips = ARRAY_SIZE(addresses_B_1),
3300 .ips = addresses_B_1,
3301 .apply_expected = True
3306 * mhomed,active vs. unique,tombstone
3307 * => should NOT be replaced
3310 .line = __location__,
3311 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3314 .type = WREPL_TYPE_MHOMED,
3315 .state = WREPL_STATE_ACTIVE,
3316 .node = WREPL_NODE_B,
3318 .num_ips = ARRAY_SIZE(addresses_B_1),
3319 .ips = addresses_B_1,
3320 .apply_expected = True
3324 .type = WREPL_TYPE_UNIQUE,
3325 .state = WREPL_STATE_TOMBSTONE,
3326 .node = WREPL_NODE_B,
3328 .num_ips = ARRAY_SIZE(addresses_B_1),
3329 .ips = addresses_B_1,
3330 .apply_expected = False
3335 * mhomed,released vs. unique,active
3336 * => should be replaced
3339 .line = __location__,
3340 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3343 .type = WREPL_TYPE_MHOMED,
3344 .state = WREPL_STATE_RELEASED,
3345 .node = WREPL_NODE_B,
3347 .num_ips = ARRAY_SIZE(addresses_A_1),
3348 .ips = addresses_A_1,
3349 .apply_expected = False
3353 .type = WREPL_TYPE_UNIQUE,
3354 .state = WREPL_STATE_ACTIVE,
3355 .node = WREPL_NODE_B,
3357 .num_ips = ARRAY_SIZE(addresses_B_1),
3358 .ips = addresses_B_1,
3359 .apply_expected = True
3364 * mhomed,released vs. uinique,tombstone
3365 * => should be replaced
3368 .line = __location__,
3369 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3372 .type = WREPL_TYPE_MHOMED,
3373 .state = WREPL_STATE_RELEASED,
3374 .node = WREPL_NODE_B,
3376 .num_ips = ARRAY_SIZE(addresses_B_1),
3377 .ips = addresses_B_1,
3378 .apply_expected = False
3382 .type = WREPL_TYPE_UNIQUE,
3383 .state = WREPL_STATE_TOMBSTONE,
3384 .node = WREPL_NODE_B,
3386 .num_ips = ARRAY_SIZE(addresses_A_1),
3387 .ips = addresses_A_1,
3388 .apply_expected = True
3393 * mhomed,tombstone vs. unique,active
3394 * => should be replaced
3397 .line = __location__,
3398 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3401 .type = WREPL_TYPE_MHOMED,
3402 .state = WREPL_STATE_TOMBSTONE,
3403 .node = WREPL_NODE_B,
3405 .num_ips = ARRAY_SIZE(addresses_A_1),
3406 .ips = addresses_A_1,
3407 .apply_expected = True
3411 .type = WREPL_TYPE_UNIQUE,
3412 .state = WREPL_STATE_ACTIVE,
3413 .node = WREPL_NODE_B,
3415 .num_ips = ARRAY_SIZE(addresses_B_1),
3416 .ips = addresses_B_1,
3417 .apply_expected = True
3422 * mhomed,tombstone vs. uinique,tombstone
3423 * => should be replaced
3426 .line = __location__,
3427 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3430 .type = WREPL_TYPE_MHOMED,
3431 .state = WREPL_STATE_TOMBSTONE,
3432 .node = WREPL_NODE_B,
3434 .num_ips = ARRAY_SIZE(addresses_B_1),
3435 .ips = addresses_B_1,
3436 .apply_expected = True
3440 .type = WREPL_TYPE_UNIQUE,
3441 .state = WREPL_STATE_TOMBSTONE,
3442 .node = WREPL_NODE_B,
3444 .num_ips = ARRAY_SIZE(addresses_A_1),
3445 .ips = addresses_A_1,
3446 .apply_expected = True
3451 * multi homed vs. normal group section,
3454 * mhomed,active vs. group,active
3455 * => should be replaced
3458 .line = __location__,
3459 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3462 .type = WREPL_TYPE_MHOMED,
3463 .state = WREPL_STATE_ACTIVE,
3464 .node = WREPL_NODE_B,
3466 .num_ips = ARRAY_SIZE(addresses_A_1),
3467 .ips = addresses_A_1,
3468 .apply_expected = True
3472 .type = WREPL_TYPE_GROUP,
3473 .state = WREPL_STATE_ACTIVE,
3474 .node = WREPL_NODE_B,
3476 .num_ips = ARRAY_SIZE(addresses_B_1),
3477 .ips = addresses_B_1,
3478 .apply_expected = True
3483 * mhomed,active vs. group,tombstone
3484 * => should NOT be replaced
3487 .line = __location__,
3488 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3491 .type = WREPL_TYPE_MHOMED,
3492 .state = WREPL_STATE_ACTIVE,
3493 .node = WREPL_NODE_B,
3495 .num_ips = ARRAY_SIZE(addresses_B_1),
3496 .ips = addresses_B_1,
3497 .apply_expected = True
3501 .type = WREPL_TYPE_GROUP,
3502 .state = WREPL_STATE_TOMBSTONE,
3503 .node = WREPL_NODE_B,
3505 .num_ips = ARRAY_SIZE(addresses_B_1),
3506 .ips = addresses_B_1,
3507 .apply_expected = False
3512 * mhomed,released vs. group,active
3513 * => should be replaced
3516 .line = __location__,
3517 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3520 .type = WREPL_TYPE_MHOMED,
3521 .state = WREPL_STATE_RELEASED,
3522 .node = WREPL_NODE_B,
3524 .num_ips = ARRAY_SIZE(addresses_B_1),
3525 .ips = addresses_B_1,
3526 .apply_expected = False
3530 .type = WREPL_TYPE_GROUP,
3531 .state = WREPL_STATE_ACTIVE,
3532 .node = WREPL_NODE_B,
3534 .num_ips = ARRAY_SIZE(addresses_A_1),
3535 .ips = addresses_A_1,
3536 .apply_expected = True
3541 * mhomed,released vs. group,tombstone
3542 * => should be replaced
3545 .line = __location__,
3546 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3549 .type = WREPL_TYPE_MHOMED,
3550 .state = WREPL_STATE_RELEASED,
3551 .node = WREPL_NODE_B,
3553 .num_ips = ARRAY_SIZE(addresses_A_1),
3554 .ips = addresses_A_1,
3555 .apply_expected = False
3559 .type = WREPL_TYPE_GROUP,
3560 .state = WREPL_STATE_TOMBSTONE,
3561 .node = WREPL_NODE_B,
3563 .num_ips = ARRAY_SIZE(addresses_B_1),
3564 .ips = addresses_B_1,
3565 .apply_expected = True
3570 * mhomed,tombstone vs. group,active
3571 * => should be replaced
3574 .line = __location__,
3575 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3578 .type = WREPL_TYPE_MHOMED,
3579 .state = WREPL_STATE_TOMBSTONE,
3580 .node = WREPL_NODE_B,
3582 .num_ips = ARRAY_SIZE(addresses_B_1),
3583 .ips = addresses_B_1,
3584 .apply_expected = True
3588 .type = WREPL_TYPE_GROUP,
3589 .state = WREPL_STATE_ACTIVE,
3590 .node = WREPL_NODE_B,
3592 .num_ips = ARRAY_SIZE(addresses_A_1),
3593 .ips = addresses_A_1,
3594 .apply_expected = True
3599 * mhomed,tombstone vs. group,tombstone
3600 * => should be replaced
3603 .line = __location__,
3604 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3607 .type = WREPL_TYPE_MHOMED,
3608 .state = WREPL_STATE_TOMBSTONE,
3609 .node = WREPL_NODE_B,
3611 .num_ips = ARRAY_SIZE(addresses_A_1),
3612 .ips = addresses_A_1,
3613 .apply_expected = True
3617 .type = WREPL_TYPE_GROUP,
3618 .state = WREPL_STATE_TOMBSTONE,
3619 .node = WREPL_NODE_B,
3621 .num_ips = ARRAY_SIZE(addresses_B_1),
3622 .ips = addresses_B_1,
3623 .apply_expected = True
3628 * multi homed vs. special group section,
3631 * mhomed,active vs. sgroup,active
3632 * => should NOT be replaced
3635 .line = __location__,
3636 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3639 .type = WREPL_TYPE_MHOMED,
3640 .state = WREPL_STATE_ACTIVE,
3641 .node = WREPL_NODE_B,
3643 .num_ips = ARRAY_SIZE(addresses_A_1),
3644 .ips = addresses_A_1,
3645 .apply_expected = True
3649 .type = WREPL_TYPE_SGROUP,
3650 .state = WREPL_STATE_ACTIVE,
3651 .node = WREPL_NODE_B,
3653 .num_ips = ARRAY_SIZE(addresses_A_1),
3654 .ips = addresses_A_1,
3655 .apply_expected = False
3660 * mhomed,active vs. sgroup,tombstone
3661 * => should NOT be replaced
3664 .line = __location__,
3665 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3668 .type = WREPL_TYPE_MHOMED,
3669 .state = WREPL_STATE_ACTIVE,
3670 .node = WREPL_NODE_B,
3672 .num_ips = ARRAY_SIZE(addresses_A_1),
3673 .ips = addresses_A_1,
3674 .apply_expected = True
3678 .type = WREPL_TYPE_SGROUP,
3679 .state = WREPL_STATE_TOMBSTONE,
3680 .node = WREPL_NODE_B,
3682 .num_ips = ARRAY_SIZE(addresses_A_1),
3683 .ips = addresses_A_1,
3684 .apply_expected = False
3689 * mhomed,released vs. sgroup,active
3690 * => should be replaced
3693 .line = __location__,
3694 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3697 .type = WREPL_TYPE_MHOMED,
3698 .state = WREPL_STATE_RELEASED,
3699 .node = WREPL_NODE_B,
3701 .num_ips = ARRAY_SIZE(addresses_A_1),
3702 .ips = addresses_A_1,
3703 .apply_expected = False
3707 .type = WREPL_TYPE_SGROUP,
3708 .state = WREPL_STATE_ACTIVE,
3709 .node = WREPL_NODE_B,
3711 .num_ips = ARRAY_SIZE(addresses_B_1),
3712 .ips = addresses_B_1,
3713 .apply_expected = True
3718 * mhomed,released vs. sgroup,tombstone
3719 * => should be replaced
3722 .line = __location__,
3723 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3726 .type = WREPL_TYPE_MHOMED,
3727 .state = WREPL_STATE_RELEASED,
3728 .node = WREPL_NODE_B,
3730 .num_ips = ARRAY_SIZE(addresses_B_1),
3731 .ips = addresses_B_1,
3732 .apply_expected = False
3736 .type = WREPL_TYPE_SGROUP,
3737 .state = WREPL_STATE_TOMBSTONE,
3738 .node = WREPL_NODE_B,
3740 .num_ips = ARRAY_SIZE(addresses_A_1),
3741 .ips = addresses_A_1,
3742 .apply_expected = True
3747 * mhomed,tombstone vs. sgroup,active
3748 * => should be replaced
3751 .line = __location__,
3752 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3755 .type = WREPL_TYPE_MHOMED,
3756 .state = WREPL_STATE_TOMBSTONE,
3757 .node = WREPL_NODE_B,
3759 .num_ips = ARRAY_SIZE(addresses_A_1),
3760 .ips = addresses_A_1,
3761 .apply_expected = True
3765 .type = WREPL_TYPE_SGROUP,
3766 .state = WREPL_STATE_ACTIVE,
3767 .node = WREPL_NODE_B,
3769 .num_ips = ARRAY_SIZE(addresses_B_1),
3770 .ips = addresses_B_1,
3771 .apply_expected = True
3776 * mhomed,tombstone vs. sgroup,tombstone
3777 * => should be replaced
3780 .line = __location__,
3781 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3784 .type = WREPL_TYPE_MHOMED,
3785 .state = WREPL_STATE_TOMBSTONE,
3786 .node = WREPL_NODE_B,
3788 .num_ips = ARRAY_SIZE(addresses_B_1),
3789 .ips = addresses_B_1,
3790 .apply_expected = True
3794 .type = WREPL_TYPE_SGROUP,
3795 .state = WREPL_STATE_TOMBSTONE,
3796 .node = WREPL_NODE_B,
3798 .num_ips = ARRAY_SIZE(addresses_A_1),
3799 .ips = addresses_A_1,
3800 .apply_expected = True
3805 * multi homed vs. mlti homed section,
3808 * mhomed,active vs. mhomed,active
3809 * => should be replaced
3812 .line = __location__,
3813 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3816 .type = WREPL_TYPE_MHOMED,
3817 .state = WREPL_STATE_ACTIVE,
3818 .node = WREPL_NODE_B,
3820 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3821 .ips = addresses_A_3_4,
3822 .apply_expected = True
3826 .type = WREPL_TYPE_MHOMED,
3827 .state = WREPL_STATE_ACTIVE,
3828 .node = WREPL_NODE_B,
3830 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3831 .ips = addresses_B_3_4,
3832 .apply_expected = True
3837 * mhomed,active vs. mhomed,tombstone
3838 * => should NOT be replaced
3841 .line = __location__,
3842 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3845 .type = WREPL_TYPE_MHOMED,
3846 .state = WREPL_STATE_ACTIVE,
3847 .node = WREPL_NODE_B,
3849 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3850 .ips = addresses_B_3_4,
3851 .apply_expected = True
3855 .type = WREPL_TYPE_MHOMED,
3856 .state = WREPL_STATE_TOMBSTONE,
3857 .node = WREPL_NODE_B,
3859 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3860 .ips = addresses_B_3_4,
3861 .apply_expected = False
3866 * mhomed,released vs. mhomed,active
3867 * => should be replaced
3870 .line = __location__,
3871 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3874 .type = WREPL_TYPE_MHOMED,
3875 .state = WREPL_STATE_RELEASED,
3876 .node = WREPL_NODE_B,
3878 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3879 .ips = addresses_B_3_4,
3880 .apply_expected = False
3884 .type = WREPL_TYPE_MHOMED,
3885 .state = WREPL_STATE_ACTIVE,
3886 .node = WREPL_NODE_B,
3888 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3889 .ips = addresses_A_3_4,
3890 .apply_expected = True
3895 * mhomed,released vs. mhomed,tombstone
3896 * => should be replaced
3899 .line = __location__,
3900 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3903 .type = WREPL_TYPE_MHOMED,
3904 .state = WREPL_STATE_RELEASED,
3905 .node = WREPL_NODE_B,
3907 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3908 .ips = addresses_A_3_4,
3909 .apply_expected = False
3913 .type = WREPL_TYPE_MHOMED,
3914 .state = WREPL_STATE_TOMBSTONE,
3915 .node = WREPL_NODE_B,
3917 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3918 .ips = addresses_B_3_4,
3919 .apply_expected = True
3924 * mhomed,tombstone vs. mhomed,active
3925 * => should be replaced
3928 .line = __location__,
3929 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3932 .type = WREPL_TYPE_MHOMED,
3933 .state = WREPL_STATE_TOMBSTONE,
3934 .node = WREPL_NODE_B,
3936 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3937 .ips = addresses_B_3_4,
3938 .apply_expected = True
3942 .type = WREPL_TYPE_MHOMED,
3943 .state = WREPL_STATE_ACTIVE,
3944 .node = WREPL_NODE_B,
3946 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3947 .ips = addresses_A_3_4,
3948 .apply_expected = True
3953 * mhomed,tombstone vs. mhomed,tombstone
3954 * => should be replaced
3957 .line = __location__,
3958 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3961 .type = WREPL_TYPE_MHOMED,
3962 .state = WREPL_STATE_TOMBSTONE,
3963 .node = WREPL_NODE_B,
3965 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3966 .ips = addresses_A_3_4,
3967 .apply_expected = True
3971 .type = WREPL_TYPE_MHOMED,
3972 .state = WREPL_STATE_TOMBSTONE,
3973 .node = WREPL_NODE_B,
3975 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3976 .ips = addresses_B_3_4,
3977 .apply_expected = True
3981 .line = __location__,
3982 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3986 .type = WREPL_TYPE_UNIQUE,
3987 .state = WREPL_STATE_TOMBSTONE,
3988 .node = WREPL_NODE_B,
3990 .num_ips = ARRAY_SIZE(addresses_B_1),
3991 .ips = addresses_B_1,
3992 .apply_expected = True,
3996 .type = WREPL_TYPE_UNIQUE,
3997 .state = WREPL_STATE_TOMBSTONE,
3998 .node = WREPL_NODE_B,
4000 .num_ips = ARRAY_SIZE(addresses_A_1),
4001 .ips = addresses_A_1,
4002 .apply_expected = True,
4006 * special group vs special group section,
4009 * sgroup,active vs. sgroup,active same addresses
4010 * => should be NOT replaced
4013 .line = __location__,
4014 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4015 .comment= "A:A_3_4 vs. B:A_3_4",
4019 .type = WREPL_TYPE_SGROUP,
4020 .state = WREPL_STATE_ACTIVE,
4021 .node = WREPL_NODE_B,
4023 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4024 .ips = addresses_A_3_4,
4025 .apply_expected = True
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 = False,
4036 .sgroup_cleanup = True
4040 * sgroup,active vs. sgroup,active subset addresses, special case...
4041 * => should NOT be replaced
4044 .line = __location__,
4045 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4046 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4",
4050 .type = WREPL_TYPE_SGROUP,
4051 .state = WREPL_STATE_ACTIVE,
4052 .node = WREPL_NODE_B,
4054 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4055 .ips = addresses_A_3_4_X_3_4,
4056 .apply_expected = True,
4060 .type = WREPL_TYPE_SGROUP,
4061 .state = WREPL_STATE_ACTIVE,
4062 .node = WREPL_NODE_B,
4064 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4065 .ips = addresses_A_3_4,
4066 .apply_expected = False,
4070 .line = __location__,
4071 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4075 .type = WREPL_TYPE_SGROUP,
4076 .state = WREPL_STATE_ACTIVE,
4077 .node = WREPL_NODE_B,
4081 .apply_expected = False,
4085 .type = WREPL_TYPE_SGROUP,
4086 .state = WREPL_STATE_ACTIVE,
4087 .node = WREPL_NODE_B,
4091 .apply_expected = False,
4095 * sgroup,active vs. sgroup,active different addresses, but owner changed
4096 * => should be replaced
4099 .line = __location__,
4100 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4101 .comment= "A:B_3_4 vs. B:A_3_4",
4105 .type = WREPL_TYPE_SGROUP,
4106 .state = WREPL_STATE_ACTIVE,
4107 .node = WREPL_NODE_B,
4109 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4110 .ips = addresses_B_3_4,
4111 .apply_expected = True,
4115 .type = WREPL_TYPE_SGROUP,
4116 .state = WREPL_STATE_ACTIVE,
4117 .node = WREPL_NODE_B,
4119 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4120 .ips = addresses_A_3_4,
4121 .apply_expected = True,
4122 .sgroup_cleanup = True
4126 * sgroup,active vs. sgroup,active different addresses, but owner changed
4127 * => should be replaced
4130 .line = __location__,
4131 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4132 .comment= "A:A_3_4 vs. B:A_3_4_OWNER_B",
4136 .type = WREPL_TYPE_SGROUP,
4137 .state = WREPL_STATE_ACTIVE,
4138 .node = WREPL_NODE_B,
4140 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4141 .ips = addresses_A_3_4,
4142 .apply_expected = True,
4146 .type = WREPL_TYPE_SGROUP,
4147 .state = WREPL_STATE_ACTIVE,
4148 .node = WREPL_NODE_B,
4150 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4151 .ips = addresses_A_3_4_OWNER_B,
4152 .apply_expected = True,
4153 .sgroup_cleanup = True
4157 * sgroup,active vs. sgroup,active different addresses, but owner changed
4158 * => should be replaced
4161 .line = __location__,
4162 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4163 .comment= "A:A_3_4_OWNER_B vs. B:A_3_4",
4167 .type = WREPL_TYPE_SGROUP,
4168 .state = WREPL_STATE_ACTIVE,
4169 .node = WREPL_NODE_B,
4171 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4172 .ips = addresses_A_3_4_OWNER_B,
4173 .apply_expected = True,
4177 .type = WREPL_TYPE_SGROUP,
4178 .state = WREPL_STATE_ACTIVE,
4179 .node = WREPL_NODE_B,
4181 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4182 .ips = addresses_A_3_4,
4183 .apply_expected = True,
4184 .sgroup_cleanup = True
4188 * sgroup,active vs. sgroup,active different addresses
4189 * => should be merged
4192 .line = __location__,
4193 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4194 .comment= "A:A_3_4 vs. B:B_3_4 => C:A_3_4_B_3_4",
4198 .type = WREPL_TYPE_SGROUP,
4199 .state = WREPL_STATE_ACTIVE,
4200 .node = WREPL_NODE_B,
4202 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4203 .ips = addresses_A_3_4,
4204 .apply_expected = True,
4208 .type = WREPL_TYPE_SGROUP,
4209 .state = WREPL_STATE_ACTIVE,
4210 .node = WREPL_NODE_B,
4212 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4213 .ips = addresses_B_3_4,
4214 .sgroup_merge = True,
4215 .sgroup_cleanup = True,
4219 * sgroup,active vs. sgroup,active different addresses, special case...
4220 * => should be merged
4223 .line = __location__,
4224 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4225 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4_X_3_4",
4229 .type = WREPL_TYPE_SGROUP,
4230 .state = WREPL_STATE_ACTIVE,
4231 .node = WREPL_NODE_B,
4233 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4234 .ips = addresses_B_3_4_X_3_4,
4235 .apply_expected = True,
4239 .type = WREPL_TYPE_SGROUP,
4240 .state = WREPL_STATE_ACTIVE,
4241 .node = WREPL_NODE_B,
4243 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4244 .ips = addresses_A_3_4,
4245 .sgroup_merge = True,
4246 .merge_owner = &ctx->b,
4247 .sgroup_cleanup = False
4251 .line = __location__,
4252 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4256 .type = WREPL_TYPE_SGROUP,
4257 .state = WREPL_STATE_ACTIVE,
4258 .node = WREPL_NODE_B,
4260 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4_OWNER_B),
4261 .ips = addresses_A_3_4_X_3_4_OWNER_B,
4262 .apply_expected = True,
4266 .type = WREPL_TYPE_SGROUP,
4267 .state = WREPL_STATE_ACTIVE,
4268 .node = WREPL_NODE_B,
4272 .apply_expected = False,
4276 * sgroup,active vs. sgroup,active different addresses, special case...
4277 * => should be merged
4280 .line = __location__,
4281 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4282 .comment= "A:X_3_4 vs. B:A_3_4 => C:A_3_4_X_3_4",
4286 .type = WREPL_TYPE_SGROUP,
4287 .state = WREPL_STATE_ACTIVE,
4288 .node = WREPL_NODE_B,
4290 .num_ips = ARRAY_SIZE(addresses_X_3_4),
4291 .ips = addresses_X_3_4,
4292 .apply_expected = True,
4296 .type = WREPL_TYPE_SGROUP,
4297 .state = WREPL_STATE_ACTIVE,
4298 .node = WREPL_NODE_B,
4300 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4301 .ips = addresses_A_3_4,
4302 .sgroup_merge = True,
4303 .sgroup_cleanup = False
4307 .line = __location__,
4308 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4312 .type = WREPL_TYPE_SGROUP,
4313 .state = WREPL_STATE_ACTIVE,
4314 .node = WREPL_NODE_B,
4318 .apply_expected = False,
4322 .type = WREPL_TYPE_SGROUP,
4323 .state = WREPL_STATE_ACTIVE,
4324 .node = WREPL_NODE_B,
4328 .apply_expected = False,
4332 * sgroup,active vs. sgroup,active different addresses, special case...
4333 * => should be merged
4336 .line = __location__,
4337 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4338 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4_OWNER_B => B:A_3_4_OWNER_B_X_3_4",
4342 .type = WREPL_TYPE_SGROUP,
4343 .state = WREPL_STATE_ACTIVE,
4344 .node = WREPL_NODE_B,
4346 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4347 .ips = addresses_A_3_4_X_3_4,
4348 .apply_expected = True,
4352 .type = WREPL_TYPE_SGROUP,
4353 .state = WREPL_STATE_ACTIVE,
4354 .node = WREPL_NODE_B,
4356 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4357 .ips = addresses_A_3_4_OWNER_B,
4358 .sgroup_merge = True,
4359 .merge_owner = &ctx->b,
4363 .line = __location__,
4364 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4368 .type = WREPL_TYPE_SGROUP,
4369 .state = WREPL_STATE_ACTIVE,
4370 .node = WREPL_NODE_B,
4374 .apply_expected = False,
4378 .type = WREPL_TYPE_SGROUP,
4379 .state = WREPL_STATE_ACTIVE,
4380 .node = WREPL_NODE_B,
4384 .apply_expected = False,
4388 * sgroup,active vs. sgroup,active partly different addresses, special case...
4389 * => should be merged
4392 .line = __location__,
4393 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4394 .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",
4398 .type = WREPL_TYPE_SGROUP,
4399 .state = WREPL_STATE_ACTIVE,
4400 .node = WREPL_NODE_B,
4402 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4403 .ips = addresses_B_3_4_X_3_4,
4404 .apply_expected = True,
4408 .type = WREPL_TYPE_SGROUP,
4409 .state = WREPL_STATE_ACTIVE,
4410 .node = WREPL_NODE_B,
4412 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_1_2),
4413 .ips = addresses_B_3_4_X_1_2,
4414 .sgroup_merge = True,
4415 .sgroup_cleanup = False
4419 .line = __location__,
4420 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4424 .type = WREPL_TYPE_SGROUP,
4425 .state = WREPL_STATE_ACTIVE,
4426 .node = WREPL_NODE_B,
4430 .apply_expected = False,
4434 .type = WREPL_TYPE_SGROUP,
4435 .state = WREPL_STATE_ACTIVE,
4436 .node = WREPL_NODE_B,
4440 .apply_expected = False,
4444 * sgroup,active vs. sgroup,active different addresses, special case...
4445 * => should be merged
4448 .line = __location__,
4449 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4450 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:X_3_4",
4454 .type = WREPL_TYPE_SGROUP,
4455 .state = WREPL_STATE_ACTIVE,
4456 .node = WREPL_NODE_B,
4458 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4459 .ips = addresses_B_3_4_X_3_4,
4460 .apply_expected = True,
4464 .type = WREPL_TYPE_SGROUP,
4465 .state = WREPL_STATE_ACTIVE,
4466 .node = WREPL_NODE_B,
4470 .sgroup_merge = True,
4471 .merge_owner = &ctx->b,
4472 .sgroup_cleanup = True
4476 .line = __location__,
4477 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4481 .type = WREPL_TYPE_SGROUP,
4482 .state = WREPL_STATE_ACTIVE,
4483 .node = WREPL_NODE_B,
4487 .apply_expected = False,
4491 .type = WREPL_TYPE_UNIQUE,
4492 .state = WREPL_STATE_TOMBSTONE,
4493 .node = WREPL_NODE_B,
4495 .num_ips = ARRAY_SIZE(addresses_A_1),
4496 .ips = addresses_A_1,
4497 .apply_expected = True,
4501 * This should be the last record in this array,
4502 * we need to make sure the we leave a tombstoned unique entry
4506 .line = __location__,
4507 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4511 .type = WREPL_TYPE_UNIQUE,
4512 .state = WREPL_STATE_TOMBSTONE,
4513 .node = WREPL_NODE_B,
4515 .num_ips = ARRAY_SIZE(addresses_A_1),
4516 .ips = addresses_A_1,
4517 .apply_expected = True
4521 .type = WREPL_TYPE_UNIQUE,
4522 .state = WREPL_STATE_TOMBSTONE,
4523 .node = WREPL_NODE_B,
4525 .num_ips = ARRAY_SIZE(addresses_A_1),
4526 .ips = addresses_A_1,
4527 .apply_expected = True
4529 }}; /* do not add entries here, this should be the last record! */
4531 if (!ctx) return False;
4533 wins_name_r1 = &wins_name1;
4534 wins_name_r2 = &wins_name2;
4536 printf("Test Replica Conflicts with different owners\n");
4538 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
4540 if (!records[i].extra && !records[i].cleanup) {
4541 /* we should test the worst cases */
4542 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
4543 printf("(%s) Programmer error, invalid record[%u]: %s\n",
4544 __location__, i, records[i].line);
4546 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
4547 printf("(%s) Programmer error, invalid record[%u]: %s\n",
4548 __location__, i, records[i].line);
4553 if (!records[i].cleanup) {
4554 const char *expected;
4557 if (records[i].r2.sgroup_merge) {
4558 expected = "SGROUP_MERGE";
4559 } else if (records[i].r2.apply_expected) {
4560 expected = "REPLACE";
4562 expected = "NOT REPLACE";
4565 if (!records[i].r1.ips && !records[i].r2.ips) {
4566 ips = "with no ip(s)";
4567 } else if (records[i].r1.ips==records[i].r2.ips) {
4568 ips = "with same ip(s)";
4570 ips = "with different ip(s)";
4573 printf("%s,%s%s vs. %s,%s%s %s => %s\n",
4574 wrepl_name_type_string(records[i].r1.type),
4575 wrepl_name_state_string(records[i].r1.state),
4576 (records[i].r1.is_static?",static":""),
4577 wrepl_name_type_string(records[i].r2.type),
4578 wrepl_name_state_string(records[i].r2.state),
4579 (records[i].r2.is_static?",static":""),
4580 (records[i].comment?records[i].comment:ips),
4587 wins_name_r1->name = &records[i].name;
4588 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
4589 records[i].r1.state,
4591 records[i].r1.is_static);
4592 wins_name_r1->id = ++records[i].r1.owner->max_version;
4593 if (wins_name_r1->flags & 2) {
4594 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
4595 wins_name_r1->addresses.addresses.ips = discard_const(records[i].r1.ips);
4597 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
4599 wins_name_r1->unknown = "255.255.255.255";
4602 ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1);
4603 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4604 wins_name_r1, records[i].r1.apply_expected);
4609 wins_name_r2->name = &records[i].name;
4610 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
4611 records[i].r2.state,
4613 records[i].r2.is_static);
4614 wins_name_r2->id = ++records[i].r2.owner->max_version;
4615 if (wins_name_r2->flags & 2) {
4616 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
4617 wins_name_r2->addresses.addresses.ips = discard_const(records[i].r2.ips);
4619 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
4621 wins_name_r2->unknown = "255.255.255.255";
4624 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4625 if (records[i].r1.state == WREPL_STATE_RELEASED) {
4626 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4627 wins_name_r1, False);
4628 } else if (records[i].r2.sgroup_merge) {
4629 ret &= test_wrepl_sgroup_merged(ctx, records[i].r2.merge_owner,
4630 records[i].r1.owner,
4631 records[i].r1.num_ips, records[i].r1.ips,
4632 records[i].r2.owner,
4633 records[i].r2.num_ips, records[i].r2.ips,
4635 } else if (records[i].r1.owner != records[i].r2.owner) {
4637 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
4638 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4639 wins_name_r1, _expected);
4641 if (records[i].r2.state == WREPL_STATE_RELEASED) {
4642 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
4643 wins_name_r2, False);
4644 } else if (!records[i].r2.sgroup_merge) {
4645 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
4646 wins_name_r2, records[i].r2.apply_expected);
4649 if (records[i].r2.sgroup_cleanup) {
4650 /* clean up the SGROUP record */
4651 wins_name_r1->name = &records[i].name;
4652 wins_name_r1->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4654 WREPL_NODE_B, False);
4655 wins_name_r1->id = ++records[i].r1.owner->max_version;
4656 wins_name_r1->addresses.addresses.num_ips = 0;
4657 wins_name_r1->addresses.addresses.ips = NULL;
4658 wins_name_r1->unknown = "255.255.255.255";
4659 ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1);
4661 /* here we test how names from an owner are deleted */
4662 if (records[i].r2.sgroup_merge && records[i].r2.num_ips) {
4663 ret &= test_wrepl_sgroup_merged(ctx, NULL,
4664 records[i].r2.owner,
4665 records[i].r2.num_ips, records[i].r2.ips,
4666 records[i].r1.owner,
4671 /* clean up the SGROUP record */
4672 wins_name_r2->name = &records[i].name;
4673 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4675 WREPL_NODE_B, False);
4676 wins_name_r2->id = ++records[i].r2.owner->max_version;
4677 wins_name_r2->addresses.addresses.num_ips = 0;
4678 wins_name_r2->addresses.addresses.ips = NULL;
4679 wins_name_r2->unknown = "255.255.255.255";
4680 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4682 /* take ownership of the SGROUP record */
4683 wins_name_r2->name = &records[i].name;
4684 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4686 WREPL_NODE_B, False);
4687 wins_name_r2->id = ++records[i].r2.owner->max_version;
4688 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4689 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4690 wins_name_r2->unknown = "255.255.255.255";
4691 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4692 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, True);
4694 /* overwrite the SGROUP record with unique,tombstone */
4695 wins_name_r2->name = &records[i].name;
4696 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4697 WREPL_STATE_TOMBSTONE,
4698 WREPL_NODE_B, False);
4699 wins_name_r2->id = ++records[i].r2.owner->max_version;
4700 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4701 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4702 wins_name_r2->unknown = "255.255.255.255";
4703 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4704 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, True);
4707 /* the first one is a cleanup run */
4708 if (!ret && i == 0) ret = True;
4711 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
4719 static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_conn *ctx)
4723 struct wrepl_wins_name wins_name_;
4724 struct wrepl_wins_name *wins_name = &wins_name_;
4725 struct nbt_name_register name_register_;
4726 struct nbt_name_register *name_register = &name_register_;
4727 struct nbt_name_release release_;
4728 struct nbt_name_release *release = &release_;
4731 const char *line; /* just better debugging */
4732 struct nbt_name name;
4737 const struct wrepl_ip *ips;
4738 BOOL apply_expected;
4741 enum wrepl_name_type type;
4742 enum wrepl_name_state state;
4743 enum wrepl_name_node node;
4746 const struct wrepl_ip *ips;
4747 BOOL apply_expected;
4751 * unique vs. unique section
4754 * unique,released vs. unique,active with same ip(s)
4757 .line = __location__,
4758 .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL),
4762 .num_ips = ctx->addresses_best_num,
4763 .ips = ctx->addresses_best,
4764 .apply_expected = True
4767 .type = WREPL_TYPE_UNIQUE,
4768 .state = WREPL_STATE_ACTIVE,
4769 .node = WREPL_NODE_B,
4771 .num_ips = ctx->addresses_best_num,
4772 .ips = ctx->addresses_best,
4773 .apply_expected = True
4777 * unique,released vs. unique,active with different ip(s)
4780 .line = __location__,
4781 .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL),
4785 .num_ips = ctx->addresses_best_num,
4786 .ips = ctx->addresses_best,
4787 .apply_expected = True
4790 .type = WREPL_TYPE_UNIQUE,
4791 .state = WREPL_STATE_ACTIVE,
4792 .node = WREPL_NODE_B,
4794 .num_ips = ARRAY_SIZE(addresses_B_1),
4795 .ips = addresses_B_1,
4796 .apply_expected = True
4800 * unique,released vs. unique,tombstone with same ip(s)
4803 .line = __location__,
4804 .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL),
4808 .num_ips = ctx->addresses_best_num,
4809 .ips = ctx->addresses_best,
4810 .apply_expected = True
4813 .type = WREPL_TYPE_UNIQUE,
4814 .state = WREPL_STATE_TOMBSTONE,
4815 .node = WREPL_NODE_B,
4817 .num_ips = ctx->addresses_best_num,
4818 .ips = ctx->addresses_best,
4819 .apply_expected = True
4823 * unique,released vs. unique,tombstone with different ip(s)
4826 .line = __location__,
4827 .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL),
4831 .num_ips = ctx->addresses_best_num,
4832 .ips = ctx->addresses_best,
4833 .apply_expected = True
4836 .type = WREPL_TYPE_UNIQUE,
4837 .state = WREPL_STATE_TOMBSTONE,
4838 .node = WREPL_NODE_B,
4840 .num_ips = ARRAY_SIZE(addresses_B_1),
4841 .ips = addresses_B_1,
4842 .apply_expected = True
4846 * unique vs. group section
4849 * unique,released vs. group,active with same ip(s)
4852 .line = __location__,
4853 .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL),
4857 .num_ips = ctx->addresses_best_num,
4858 .ips = ctx->addresses_best,
4859 .apply_expected = True
4862 .type = WREPL_TYPE_GROUP,
4863 .state = WREPL_STATE_ACTIVE,
4864 .node = WREPL_NODE_B,
4866 .num_ips = ctx->addresses_best_num,
4867 .ips = ctx->addresses_best,
4868 .apply_expected = True
4872 * unique,released vs. group,active with different ip(s)
4875 .line = __location__,
4876 .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL),
4880 .num_ips = ctx->addresses_best_num,
4881 .ips = ctx->addresses_best,
4882 .apply_expected = True
4885 .type = WREPL_TYPE_GROUP,
4886 .state = WREPL_STATE_ACTIVE,
4887 .node = WREPL_NODE_B,
4889 .num_ips = ARRAY_SIZE(addresses_B_1),
4890 .ips = addresses_B_1,
4891 .apply_expected = True
4895 * unique,released vs. group,tombstone with same ip(s)
4898 .line = __location__,
4899 .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL),
4903 .num_ips = ctx->addresses_best_num,
4904 .ips = ctx->addresses_best,
4905 .apply_expected = True
4908 .type = WREPL_TYPE_GROUP,
4909 .state = WREPL_STATE_TOMBSTONE,
4910 .node = WREPL_NODE_B,
4912 .num_ips = ctx->addresses_best_num,
4913 .ips = ctx->addresses_best,
4914 .apply_expected = True
4918 * unique,released vs. group,tombstone with different ip(s)
4921 .line = __location__,
4922 .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL),
4926 .num_ips = ctx->addresses_best_num,
4927 .ips = ctx->addresses_best,
4928 .apply_expected = True
4931 .type = WREPL_TYPE_GROUP,
4932 .state = WREPL_STATE_TOMBSTONE,
4933 .node = WREPL_NODE_B,
4935 .num_ips = ARRAY_SIZE(addresses_B_1),
4936 .ips = addresses_B_1,
4937 .apply_expected = True
4941 * unique vs. special group section
4944 * unique,released vs. sgroup,active with same ip(s)
4947 .line = __location__,
4948 .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL),
4952 .num_ips = ctx->addresses_best_num,
4953 .ips = ctx->addresses_best,
4954 .apply_expected = True
4957 .type = WREPL_TYPE_SGROUP,
4958 .state = WREPL_STATE_ACTIVE,
4959 .node = WREPL_NODE_B,
4961 .num_ips = ctx->addresses_best_num,
4962 .ips = ctx->addresses_best,
4963 .apply_expected = True
4967 * unique,released vs. sgroup,active with different ip(s)
4970 .line = __location__,
4971 .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL),
4975 .num_ips = ctx->addresses_best_num,
4976 .ips = ctx->addresses_best,
4977 .apply_expected = True
4980 .type = WREPL_TYPE_SGROUP,
4981 .state = WREPL_STATE_ACTIVE,
4982 .node = WREPL_NODE_B,
4984 .num_ips = ARRAY_SIZE(addresses_B_1),
4985 .ips = addresses_B_1,
4986 .apply_expected = True
4990 * unique,released vs. sgroup,tombstone with same ip(s)
4993 .line = __location__,
4994 .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL),
4998 .num_ips = ctx->addresses_best_num,
4999 .ips = ctx->addresses_best,
5000 .apply_expected = True
5003 .type = WREPL_TYPE_SGROUP,
5004 .state = WREPL_STATE_TOMBSTONE,
5005 .node = WREPL_NODE_B,
5007 .num_ips = ctx->addresses_best_num,
5008 .ips = ctx->addresses_best,
5009 .apply_expected = True
5013 * unique,released vs. sgroup,tombstone with different ip(s)
5016 .line = __location__,
5017 .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL),
5021 .num_ips = ctx->addresses_best_num,
5022 .ips = ctx->addresses_best,
5023 .apply_expected = True
5026 .type = WREPL_TYPE_SGROUP,
5027 .state = WREPL_STATE_TOMBSTONE,
5028 .node = WREPL_NODE_B,
5030 .num_ips = ARRAY_SIZE(addresses_B_1),
5031 .ips = addresses_B_1,
5032 .apply_expected = True
5036 * unique vs. multi homed section
5039 * unique,released vs. mhomed,active with same ip(s)
5042 .line = __location__,
5043 .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL),
5047 .num_ips = ctx->addresses_best_num,
5048 .ips = ctx->addresses_best,
5049 .apply_expected = True
5052 .type = WREPL_TYPE_MHOMED,
5053 .state = WREPL_STATE_ACTIVE,
5054 .node = WREPL_NODE_B,
5056 .num_ips = ctx->addresses_best_num,
5057 .ips = ctx->addresses_best,
5058 .apply_expected = True
5062 * unique,released vs. mhomed,active with different ip(s)
5065 .line = __location__,
5066 .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL),
5070 .num_ips = ctx->addresses_best_num,
5071 .ips = ctx->addresses_best,
5072 .apply_expected = True
5075 .type = WREPL_TYPE_MHOMED,
5076 .state = WREPL_STATE_ACTIVE,
5077 .node = WREPL_NODE_B,
5079 .num_ips = ARRAY_SIZE(addresses_B_1),
5080 .ips = addresses_B_1,
5081 .apply_expected = True
5085 * unique,released vs. mhomed,tombstone with same ip(s)
5088 .line = __location__,
5089 .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL),
5093 .num_ips = ctx->addresses_best_num,
5094 .ips = ctx->addresses_best,
5095 .apply_expected = True
5098 .type = WREPL_TYPE_MHOMED,
5099 .state = WREPL_STATE_TOMBSTONE,
5100 .node = WREPL_NODE_B,
5102 .num_ips = ctx->addresses_best_num,
5103 .ips = ctx->addresses_best,
5104 .apply_expected = True
5108 * unique,released vs. mhomed,tombstone with different ip(s)
5111 .line = __location__,
5112 .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL),
5116 .num_ips = ctx->addresses_best_num,
5117 .ips = ctx->addresses_best,
5118 .apply_expected = True
5121 .type = WREPL_TYPE_MHOMED,
5122 .state = WREPL_STATE_TOMBSTONE,
5123 .node = WREPL_NODE_B,
5125 .num_ips = ARRAY_SIZE(addresses_B_1),
5126 .ips = addresses_B_1,
5127 .apply_expected = True
5131 * group vs. unique section
5134 * group,released vs. unique,active with same ip(s)
5137 .line = __location__,
5138 .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL),
5140 .nb_flags = NBT_NM_GROUP,
5142 .num_ips = ctx->addresses_best_num,
5143 .ips = ctx->addresses_best,
5144 .apply_expected = True
5147 .type = WREPL_TYPE_UNIQUE,
5148 .state = WREPL_STATE_ACTIVE,
5149 .node = WREPL_NODE_B,
5151 .num_ips = ctx->addresses_best_num,
5152 .ips = ctx->addresses_best,
5153 .apply_expected = False
5157 * group,released vs. unique,active with different ip(s)
5160 .line = __location__,
5161 .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL),
5163 .nb_flags = NBT_NM_GROUP,
5165 .num_ips = ctx->addresses_best_num,
5166 .ips = ctx->addresses_best,
5167 .apply_expected = True
5170 .type = WREPL_TYPE_UNIQUE,
5171 .state = WREPL_STATE_ACTIVE,
5172 .node = WREPL_NODE_B,
5174 .num_ips = ARRAY_SIZE(addresses_B_1),
5175 .ips = addresses_B_1,
5176 .apply_expected = False
5180 * group,released vs. unique,tombstone with same ip(s)
5183 .line = __location__,
5184 .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL),
5186 .nb_flags = NBT_NM_GROUP,
5188 .num_ips = ctx->addresses_best_num,
5189 .ips = ctx->addresses_best,
5190 .apply_expected = True
5193 .type = WREPL_TYPE_UNIQUE,
5194 .state = WREPL_STATE_TOMBSTONE,
5195 .node = WREPL_NODE_B,
5197 .num_ips = ctx->addresses_best_num,
5198 .ips = ctx->addresses_best,
5199 .apply_expected = False
5203 * group,released vs. unique,tombstone with different ip(s)
5206 .line = __location__,
5207 .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL),
5209 .nb_flags = NBT_NM_GROUP,
5211 .num_ips = ctx->addresses_best_num,
5212 .ips = ctx->addresses_best,
5213 .apply_expected = True
5216 .type = WREPL_TYPE_UNIQUE,
5217 .state = WREPL_STATE_TOMBSTONE,
5218 .node = WREPL_NODE_B,
5220 .num_ips = ARRAY_SIZE(addresses_B_1),
5221 .ips = addresses_B_1,
5222 .apply_expected = False
5226 * group vs. group section
5229 * group,released vs. group,active with same ip(s)
5232 .line = __location__,
5233 .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL),
5235 .nb_flags = NBT_NM_GROUP,
5237 .num_ips = ctx->addresses_best_num,
5238 .ips = ctx->addresses_best,
5239 .apply_expected = True
5242 .type = WREPL_TYPE_GROUP,
5243 .state = WREPL_STATE_ACTIVE,
5244 .node = WREPL_NODE_B,
5246 .num_ips = ctx->addresses_best_num,
5247 .ips = ctx->addresses_best,
5248 .apply_expected = True
5252 * group,released vs. group,active with different ip(s)
5255 .line = __location__,
5256 .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL),
5258 .nb_flags = NBT_NM_GROUP,
5260 .num_ips = ctx->addresses_best_num,
5261 .ips = ctx->addresses_best,
5262 .apply_expected = True
5265 .type = WREPL_TYPE_GROUP,
5266 .state = WREPL_STATE_ACTIVE,
5267 .node = WREPL_NODE_B,
5269 .num_ips = ARRAY_SIZE(addresses_B_1),
5270 .ips = addresses_B_1,
5271 .apply_expected = True
5275 * group,released vs. group,tombstone with same ip(s)
5278 .line = __location__,
5279 .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL),
5281 .nb_flags = NBT_NM_GROUP,
5283 .num_ips = ctx->addresses_best_num,
5284 .ips = ctx->addresses_best,
5285 .apply_expected = True
5288 .type = WREPL_TYPE_GROUP,
5289 .state = WREPL_STATE_TOMBSTONE,
5290 .node = WREPL_NODE_B,
5292 .num_ips = ctx->addresses_best_num,
5293 .ips = ctx->addresses_best,
5294 .apply_expected = True
5298 * group,released vs. group,tombstone with different ip(s)
5301 .line = __location__,
5302 .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL),
5304 .nb_flags = NBT_NM_GROUP,
5306 .num_ips = ctx->addresses_best_num,
5307 .ips = ctx->addresses_best,
5308 .apply_expected = True
5311 .type = WREPL_TYPE_GROUP,
5312 .state = WREPL_STATE_TOMBSTONE,
5313 .node = WREPL_NODE_B,
5315 .num_ips = ARRAY_SIZE(addresses_B_1),
5316 .ips = addresses_B_1,
5317 .apply_expected = True
5321 * group vs. special group section
5324 * group,released vs. sgroup,active with same ip(s)
5327 .line = __location__,
5328 .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL),
5330 .nb_flags = NBT_NM_GROUP,
5332 .num_ips = ctx->addresses_best_num,
5333 .ips = ctx->addresses_best,
5334 .apply_expected = True
5337 .type = WREPL_TYPE_SGROUP,
5338 .state = WREPL_STATE_ACTIVE,
5339 .node = WREPL_NODE_B,
5341 .num_ips = ctx->addresses_best_num,
5342 .ips = ctx->addresses_best,
5343 .apply_expected = False
5347 * group,released vs. sgroup,active with different ip(s)
5350 .line = __location__,
5351 .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL),
5353 .nb_flags = NBT_NM_GROUP,
5355 .num_ips = ctx->addresses_best_num,
5356 .ips = ctx->addresses_best,
5357 .apply_expected = True
5360 .type = WREPL_TYPE_SGROUP,
5361 .state = WREPL_STATE_ACTIVE,
5362 .node = WREPL_NODE_B,
5364 .num_ips = ARRAY_SIZE(addresses_B_1),
5365 .ips = addresses_B_1,
5366 .apply_expected = False
5370 * group,released vs. sgroup,tombstone with same ip(s)
5373 .line = __location__,
5374 .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL),
5376 .nb_flags = NBT_NM_GROUP,
5378 .num_ips = ctx->addresses_best_num,
5379 .ips = ctx->addresses_best,
5380 .apply_expected = True
5383 .type = WREPL_TYPE_SGROUP,
5384 .state = WREPL_STATE_TOMBSTONE,
5385 .node = WREPL_NODE_B,
5387 .num_ips = ctx->addresses_best_num,
5388 .ips = ctx->addresses_best,
5389 .apply_expected = False
5393 * group,released vs. sgroup,tombstone with different ip(s)
5396 .line = __location__,
5397 .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL),
5399 .nb_flags = NBT_NM_GROUP,
5401 .num_ips = ctx->addresses_best_num,
5402 .ips = ctx->addresses_best,
5403 .apply_expected = True
5406 .type = WREPL_TYPE_SGROUP,
5407 .state = WREPL_STATE_TOMBSTONE,
5408 .node = WREPL_NODE_B,
5410 .num_ips = ARRAY_SIZE(addresses_B_1),
5411 .ips = addresses_B_1,
5412 .apply_expected = False
5416 * group vs. multi homed section
5419 * group,released vs. mhomed,active with same ip(s)
5422 .line = __location__,
5423 .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL),
5425 .nb_flags = NBT_NM_GROUP,
5427 .num_ips = ctx->addresses_best_num,
5428 .ips = ctx->addresses_best,
5429 .apply_expected = True
5432 .type = WREPL_TYPE_MHOMED,
5433 .state = WREPL_STATE_ACTIVE,
5434 .node = WREPL_NODE_B,
5436 .num_ips = ctx->addresses_best_num,
5437 .ips = ctx->addresses_best,
5438 .apply_expected = False
5442 * group,released vs. mhomed,active with different ip(s)
5445 .line = __location__,
5446 .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL),
5448 .nb_flags = NBT_NM_GROUP,
5450 .num_ips = ctx->addresses_best_num,
5451 .ips = ctx->addresses_best,
5452 .apply_expected = True
5455 .type = WREPL_TYPE_MHOMED,
5456 .state = WREPL_STATE_ACTIVE,
5457 .node = WREPL_NODE_B,
5459 .num_ips = ARRAY_SIZE(addresses_B_1),
5460 .ips = addresses_B_1,
5461 .apply_expected = False
5465 * group,released vs. mhomed,tombstone with same ip(s)
5468 .line = __location__,
5469 .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL),
5471 .nb_flags = NBT_NM_GROUP,
5473 .num_ips = ctx->addresses_best_num,
5474 .ips = ctx->addresses_best,
5475 .apply_expected = True
5478 .type = WREPL_TYPE_MHOMED,
5479 .state = WREPL_STATE_TOMBSTONE,
5480 .node = WREPL_NODE_B,
5482 .num_ips = ctx->addresses_best_num,
5483 .ips = ctx->addresses_best,
5484 .apply_expected = False
5488 * group,released vs. mhomed,tombstone with different ip(s)
5491 .line = __location__,
5492 .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL),
5494 .nb_flags = NBT_NM_GROUP,
5496 .num_ips = ctx->addresses_best_num,
5497 .ips = ctx->addresses_best,
5498 .apply_expected = True
5501 .type = WREPL_TYPE_MHOMED,
5502 .state = WREPL_STATE_TOMBSTONE,
5503 .node = WREPL_NODE_B,
5505 .num_ips = ARRAY_SIZE(addresses_B_1),
5506 .ips = addresses_B_1,
5507 .apply_expected = False
5511 * special group vs. unique section
5514 * sgroup,released vs. unique,active with same ip(s)
5517 .line = __location__,
5518 .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL),
5520 .nb_flags = NBT_NM_GROUP,
5522 .num_ips = ctx->addresses_best_num,
5523 .ips = ctx->addresses_best,
5524 .apply_expected = True
5527 .type = WREPL_TYPE_UNIQUE,
5528 .state = WREPL_STATE_ACTIVE,
5529 .node = WREPL_NODE_B,
5531 .num_ips = ctx->addresses_best_num,
5532 .ips = ctx->addresses_best,
5533 .apply_expected = True
5537 * sgroup,released vs. unique,active with different ip(s)
5540 .line = __location__,
5541 .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL),
5543 .nb_flags = NBT_NM_GROUP,
5545 .num_ips = ctx->addresses_best_num,
5546 .ips = ctx->addresses_best,
5547 .apply_expected = True
5550 .type = WREPL_TYPE_UNIQUE,
5551 .state = WREPL_STATE_ACTIVE,
5552 .node = WREPL_NODE_B,
5554 .num_ips = ARRAY_SIZE(addresses_B_1),
5555 .ips = addresses_B_1,
5556 .apply_expected = True
5560 * sgroup,released vs. unique,tombstone with same ip(s)
5563 .line = __location__,
5564 .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL),
5566 .nb_flags = NBT_NM_GROUP,
5568 .num_ips = ctx->addresses_best_num,
5569 .ips = ctx->addresses_best,
5570 .apply_expected = True
5573 .type = WREPL_TYPE_UNIQUE,
5574 .state = WREPL_STATE_TOMBSTONE,
5575 .node = WREPL_NODE_B,
5577 .num_ips = ctx->addresses_best_num,
5578 .ips = ctx->addresses_best,
5579 .apply_expected = True
5583 * sgroup,released vs. unique,tombstone with different ip(s)
5586 .line = __location__,
5587 .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL),
5589 .nb_flags = NBT_NM_GROUP,
5591 .num_ips = ctx->addresses_best_num,
5592 .ips = ctx->addresses_best,
5593 .apply_expected = True
5596 .type = WREPL_TYPE_UNIQUE,
5597 .state = WREPL_STATE_TOMBSTONE,
5598 .node = WREPL_NODE_B,
5600 .num_ips = ARRAY_SIZE(addresses_B_1),
5601 .ips = addresses_B_1,
5602 .apply_expected = True
5606 * special group vs. group section
5609 * sgroup,released vs. group,active with same ip(s)
5612 .line = __location__,
5613 .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL),
5615 .nb_flags = NBT_NM_GROUP,
5617 .num_ips = ctx->addresses_best_num,
5618 .ips = ctx->addresses_best,
5619 .apply_expected = True
5622 .type = WREPL_TYPE_GROUP,
5623 .state = WREPL_STATE_ACTIVE,
5624 .node = WREPL_NODE_B,
5626 .num_ips = ctx->addresses_best_num,
5627 .ips = ctx->addresses_best,
5628 .apply_expected = True
5632 * sgroup,released vs. group,active with different ip(s)
5635 .line = __location__,
5636 .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL),
5638 .nb_flags = NBT_NM_GROUP,
5640 .num_ips = ctx->addresses_best_num,
5641 .ips = ctx->addresses_best,
5642 .apply_expected = True
5645 .type = WREPL_TYPE_GROUP,
5646 .state = WREPL_STATE_ACTIVE,
5647 .node = WREPL_NODE_B,
5649 .num_ips = ARRAY_SIZE(addresses_B_1),
5650 .ips = addresses_B_1,
5651 .apply_expected = True
5655 * sgroup,released vs. group,tombstone with same ip(s)
5658 .line = __location__,
5659 .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL),
5661 .nb_flags = NBT_NM_GROUP,
5663 .num_ips = ctx->addresses_best_num,
5664 .ips = ctx->addresses_best,
5665 .apply_expected = True
5668 .type = WREPL_TYPE_GROUP,
5669 .state = WREPL_STATE_TOMBSTONE,
5670 .node = WREPL_NODE_B,
5672 .num_ips = ctx->addresses_best_num,
5673 .ips = ctx->addresses_best,
5674 .apply_expected = True
5678 * sgroup,released vs. group,tombstone with different ip(s)
5681 .line = __location__,
5682 .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL),
5684 .nb_flags = NBT_NM_GROUP,
5686 .num_ips = ctx->addresses_best_num,
5687 .ips = ctx->addresses_best,
5688 .apply_expected = True
5691 .type = WREPL_TYPE_GROUP,
5692 .state = WREPL_STATE_TOMBSTONE,
5693 .node = WREPL_NODE_B,
5695 .num_ips = ARRAY_SIZE(addresses_B_1),
5696 .ips = addresses_B_1,
5697 .apply_expected = True
5701 * special group vs. special group section
5704 * sgroup,released vs. sgroup,active with same ip(s)
5707 .line = __location__,
5708 .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL),
5710 .nb_flags = NBT_NM_GROUP,
5712 .num_ips = ctx->addresses_best_num,
5713 .ips = ctx->addresses_best,
5714 .apply_expected = True
5717 .type = WREPL_TYPE_SGROUP,
5718 .state = WREPL_STATE_ACTIVE,
5719 .node = WREPL_NODE_B,
5721 .num_ips = ctx->addresses_best_num,
5722 .ips = ctx->addresses_best,
5723 .apply_expected = True
5727 * sgroup,released vs. sgroup,active with different ip(s)
5730 .line = __location__,
5731 .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL),
5733 .nb_flags = NBT_NM_GROUP,
5735 .num_ips = ctx->addresses_best_num,
5736 .ips = ctx->addresses_best,
5737 .apply_expected = True
5740 .type = WREPL_TYPE_SGROUP,
5741 .state = WREPL_STATE_ACTIVE,
5742 .node = WREPL_NODE_B,
5744 .num_ips = ARRAY_SIZE(addresses_B_1),
5745 .ips = addresses_B_1,
5746 .apply_expected = True
5750 * sgroup,released vs. sgroup,tombstone with same ip(s)
5753 .line = __location__,
5754 .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL),
5756 .nb_flags = NBT_NM_GROUP,
5758 .num_ips = ctx->addresses_best_num,
5759 .ips = ctx->addresses_best,
5760 .apply_expected = True
5763 .type = WREPL_TYPE_SGROUP,
5764 .state = WREPL_STATE_TOMBSTONE,
5765 .node = WREPL_NODE_B,
5767 .num_ips = ctx->addresses_best_num,
5768 .ips = ctx->addresses_best,
5769 .apply_expected = True
5773 * sgroup,released vs. sgroup,tombstone with different ip(s)
5776 .line = __location__,
5777 .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL),
5779 .nb_flags = NBT_NM_GROUP,
5781 .num_ips = ctx->addresses_best_num,
5782 .ips = ctx->addresses_best,
5783 .apply_expected = True
5786 .type = WREPL_TYPE_SGROUP,
5787 .state = WREPL_STATE_TOMBSTONE,
5788 .node = WREPL_NODE_B,
5790 .num_ips = ARRAY_SIZE(addresses_B_1),
5791 .ips = addresses_B_1,
5792 .apply_expected = True
5796 * special group vs. multi homed section
5799 * sgroup,released vs. mhomed,active with same ip(s)
5802 .line = __location__,
5803 .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL),
5805 .nb_flags = NBT_NM_GROUP,
5807 .num_ips = ctx->addresses_best_num,
5808 .ips = ctx->addresses_best,
5809 .apply_expected = True
5812 .type = WREPL_TYPE_MHOMED,
5813 .state = WREPL_STATE_ACTIVE,
5814 .node = WREPL_NODE_B,
5816 .num_ips = ctx->addresses_best_num,
5817 .ips = ctx->addresses_best,
5818 .apply_expected = True
5822 * sgroup,released vs. mhomed,active with different ip(s)
5825 .line = __location__,
5826 .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL),
5828 .nb_flags = NBT_NM_GROUP,
5830 .num_ips = ctx->addresses_best_num,
5831 .ips = ctx->addresses_best,
5832 .apply_expected = True
5835 .type = WREPL_TYPE_MHOMED,
5836 .state = WREPL_STATE_ACTIVE,
5837 .node = WREPL_NODE_B,
5839 .num_ips = ARRAY_SIZE(addresses_B_1),
5840 .ips = addresses_B_1,
5841 .apply_expected = True
5845 * sgroup,released vs. mhomed,tombstone with same ip(s)
5848 .line = __location__,
5849 .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL),
5851 .nb_flags = NBT_NM_GROUP,
5853 .num_ips = ctx->addresses_best_num,
5854 .ips = ctx->addresses_best,
5855 .apply_expected = True
5858 .type = WREPL_TYPE_MHOMED,
5859 .state = WREPL_STATE_TOMBSTONE,
5860 .node = WREPL_NODE_B,
5862 .num_ips = ctx->addresses_best_num,
5863 .ips = ctx->addresses_best,
5864 .apply_expected = True
5868 * sgroup,released vs. mhomed,tombstone with different ip(s)
5871 .line = __location__,
5872 .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL),
5874 .nb_flags = NBT_NM_GROUP,
5876 .num_ips = ctx->addresses_best_num,
5877 .ips = ctx->addresses_best,
5878 .apply_expected = True
5881 .type = WREPL_TYPE_MHOMED,
5882 .state = WREPL_STATE_TOMBSTONE,
5883 .node = WREPL_NODE_B,
5885 .num_ips = ARRAY_SIZE(addresses_B_1),
5886 .ips = addresses_B_1,
5887 .apply_expected = True
5891 * multi homed vs. unique section
5894 * mhomed,released vs. unique,active with same ip(s)
5897 .line = __location__,
5898 .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL),
5902 .num_ips = ctx->addresses_best_num,
5903 .ips = ctx->addresses_best,
5904 .apply_expected = True
5907 .type = WREPL_TYPE_UNIQUE,
5908 .state = WREPL_STATE_ACTIVE,
5909 .node = WREPL_NODE_B,
5911 .num_ips = ctx->addresses_best_num,
5912 .ips = ctx->addresses_best,
5913 .apply_expected = True
5917 * mhomed,released vs. unique,active with different ip(s)
5920 .line = __location__,
5921 .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL),
5925 .num_ips = ctx->addresses_best_num,
5926 .ips = ctx->addresses_best,
5927 .apply_expected = True
5930 .type = WREPL_TYPE_UNIQUE,
5931 .state = WREPL_STATE_ACTIVE,
5932 .node = WREPL_NODE_B,
5934 .num_ips = ARRAY_SIZE(addresses_B_1),
5935 .ips = addresses_B_1,
5936 .apply_expected = True
5940 * mhomed,released vs. unique,tombstone with same ip(s)
5943 .line = __location__,
5944 .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL),
5948 .num_ips = ctx->addresses_best_num,
5949 .ips = ctx->addresses_best,
5950 .apply_expected = True
5953 .type = WREPL_TYPE_UNIQUE,
5954 .state = WREPL_STATE_TOMBSTONE,
5955 .node = WREPL_NODE_B,
5957 .num_ips = ctx->addresses_best_num,
5958 .ips = ctx->addresses_best,
5959 .apply_expected = True
5963 * mhomed,released vs. unique,tombstone with different ip(s)
5966 .line = __location__,
5967 .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL),
5971 .num_ips = ctx->addresses_best_num,
5972 .ips = ctx->addresses_best,
5973 .apply_expected = True
5976 .type = WREPL_TYPE_UNIQUE,
5977 .state = WREPL_STATE_TOMBSTONE,
5978 .node = WREPL_NODE_B,
5980 .num_ips = ARRAY_SIZE(addresses_B_1),
5981 .ips = addresses_B_1,
5982 .apply_expected = True
5986 * multi homed vs. group section
5989 * mhomed,released vs. group,active with same ip(s)
5992 .line = __location__,
5993 .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL),
5997 .num_ips = ctx->addresses_best_num,
5998 .ips = ctx->addresses_best,
5999 .apply_expected = True
6002 .type = WREPL_TYPE_GROUP,
6003 .state = WREPL_STATE_ACTIVE,
6004 .node = WREPL_NODE_B,
6006 .num_ips = ctx->addresses_best_num,
6007 .ips = ctx->addresses_best,
6008 .apply_expected = True
6012 * mhomed,released vs. group,active with different ip(s)
6015 .line = __location__,
6016 .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL),
6020 .num_ips = ctx->addresses_best_num,
6021 .ips = ctx->addresses_best,
6022 .apply_expected = True
6025 .type = WREPL_TYPE_GROUP,
6026 .state = WREPL_STATE_ACTIVE,
6027 .node = WREPL_NODE_B,
6029 .num_ips = ARRAY_SIZE(addresses_B_1),
6030 .ips = addresses_B_1,
6031 .apply_expected = True
6035 * mhomed,released vs. group,tombstone with same ip(s)
6038 .line = __location__,
6039 .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL),
6043 .num_ips = ctx->addresses_best_num,
6044 .ips = ctx->addresses_best,
6045 .apply_expected = True
6048 .type = WREPL_TYPE_GROUP,
6049 .state = WREPL_STATE_TOMBSTONE,
6050 .node = WREPL_NODE_B,
6052 .num_ips = ctx->addresses_best_num,
6053 .ips = ctx->addresses_best,
6054 .apply_expected = True
6058 * mhomed,released vs. group,tombstone with different ip(s)
6061 .line = __location__,
6062 .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL),
6066 .num_ips = ctx->addresses_best_num,
6067 .ips = ctx->addresses_best,
6068 .apply_expected = True
6071 .type = WREPL_TYPE_GROUP,
6072 .state = WREPL_STATE_TOMBSTONE,
6073 .node = WREPL_NODE_B,
6075 .num_ips = ARRAY_SIZE(addresses_B_1),
6076 .ips = addresses_B_1,
6077 .apply_expected = True
6081 * multi homed vs. special group section
6084 * mhomed,released vs. sgroup,active with same ip(s)
6087 .line = __location__,
6088 .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL),
6092 .num_ips = ctx->addresses_best_num,
6093 .ips = ctx->addresses_best,
6094 .apply_expected = True
6097 .type = WREPL_TYPE_SGROUP,
6098 .state = WREPL_STATE_ACTIVE,
6099 .node = WREPL_NODE_B,
6101 .num_ips = ctx->addresses_best_num,
6102 .ips = ctx->addresses_best,
6103 .apply_expected = True
6107 * mhomed,released vs. sgroup,active with different ip(s)
6110 .line = __location__,
6111 .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL),
6115 .num_ips = ctx->addresses_best_num,
6116 .ips = ctx->addresses_best,
6117 .apply_expected = True
6120 .type = WREPL_TYPE_SGROUP,
6121 .state = WREPL_STATE_ACTIVE,
6122 .node = WREPL_NODE_B,
6124 .num_ips = ARRAY_SIZE(addresses_B_1),
6125 .ips = addresses_B_1,
6126 .apply_expected = True
6130 * mhomed,released vs. sgroup,tombstone with same ip(s)
6133 .line = __location__,
6134 .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL),
6138 .num_ips = ctx->addresses_best_num,
6139 .ips = ctx->addresses_best,
6140 .apply_expected = True
6143 .type = WREPL_TYPE_SGROUP,
6144 .state = WREPL_STATE_TOMBSTONE,
6145 .node = WREPL_NODE_B,
6147 .num_ips = ctx->addresses_best_num,
6148 .ips = ctx->addresses_best,
6149 .apply_expected = True
6153 * mhomed,released vs. sgroup,tombstone with different ip(s)
6156 .line = __location__,
6157 .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL),
6161 .num_ips = ctx->addresses_best_num,
6162 .ips = ctx->addresses_best,
6163 .apply_expected = True
6166 .type = WREPL_TYPE_SGROUP,
6167 .state = WREPL_STATE_TOMBSTONE,
6168 .node = WREPL_NODE_B,
6170 .num_ips = ARRAY_SIZE(addresses_B_1),
6171 .ips = addresses_B_1,
6172 .apply_expected = True
6176 * multi homed vs. multi homed section
6179 * mhomed,released vs. mhomed,active with same ip(s)
6182 .line = __location__,
6183 .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL),
6187 .num_ips = ctx->addresses_best_num,
6188 .ips = ctx->addresses_best,
6189 .apply_expected = True
6192 .type = WREPL_TYPE_MHOMED,
6193 .state = WREPL_STATE_ACTIVE,
6194 .node = WREPL_NODE_B,
6196 .num_ips = ctx->addresses_best_num,
6197 .ips = ctx->addresses_best,
6198 .apply_expected = True
6202 * mhomed,released vs. mhomed,active with different ip(s)
6205 .line = __location__,
6206 .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL),
6210 .num_ips = ctx->addresses_best_num,
6211 .ips = ctx->addresses_best,
6212 .apply_expected = True
6215 .type = WREPL_TYPE_MHOMED,
6216 .state = WREPL_STATE_ACTIVE,
6217 .node = WREPL_NODE_B,
6219 .num_ips = ARRAY_SIZE(addresses_B_1),
6220 .ips = addresses_B_1,
6221 .apply_expected = True
6225 * mhomed,released vs. mhomed,tombstone with same ip(s)
6228 .line = __location__,
6229 .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL),
6233 .num_ips = ctx->addresses_best_num,
6234 .ips = ctx->addresses_best,
6235 .apply_expected = True
6238 .type = WREPL_TYPE_MHOMED,
6239 .state = WREPL_STATE_TOMBSTONE,
6240 .node = WREPL_NODE_B,
6242 .num_ips = ctx->addresses_best_num,
6243 .ips = ctx->addresses_best,
6244 .apply_expected = True
6248 * mhomed,released vs. mhomed,tombstone with different ip(s)
6251 .line = __location__,
6252 .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL),
6256 .num_ips = ctx->addresses_best_num,
6257 .ips = ctx->addresses_best,
6258 .apply_expected = True
6261 .type = WREPL_TYPE_MHOMED,
6262 .state = WREPL_STATE_TOMBSTONE,
6263 .node = WREPL_NODE_B,
6265 .num_ips = ARRAY_SIZE(addresses_B_1),
6266 .ips = addresses_B_1,
6267 .apply_expected = True
6272 if (!ctx) return False;
6274 printf("Test Replica records vs. owned released records\n");
6276 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
6277 printf("%s => %s\n", nbt_name_string(ctx, &records[i].name),
6278 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
6283 name_register->in.name = records[i].name;
6284 name_register->in.dest_addr = ctx->address;
6285 name_register->in.address = records[i].wins.ips[0].ip;
6286 name_register->in.nb_flags = records[i].wins.nb_flags;
6287 name_register->in.register_demand= False;
6288 name_register->in.broadcast = False;
6289 name_register->in.multi_homed = records[i].wins.mhomed;
6290 name_register->in.ttl = 300000;
6291 name_register->in.timeout = 70;
6292 name_register->in.retries = 0;
6294 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
6295 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6296 printf("No response from %s for name register\n", ctx->address);
6299 if (!NT_STATUS_IS_OK(status)) {
6300 printf("Bad response from %s for name register - %s\n",
6301 ctx->address, nt_errstr(status));
6304 CHECK_VALUE(name_register->out.rcode, 0);
6305 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
6306 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
6307 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
6308 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
6309 CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[0].ip);
6311 /* release the record */
6312 release->in.name = records[i].name;
6313 release->in.dest_addr = ctx->address;
6314 release->in.address = records[i].wins.ips[0].ip;
6315 release->in.nb_flags = records[i].wins.nb_flags;
6316 release->in.broadcast = False;
6317 release->in.timeout = 30;
6318 release->in.retries = 0;
6320 status = nbt_name_release(ctx->nbtsock, ctx, release);
6321 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6322 printf("No response from %s for name release\n", ctx->address);
6325 if (!NT_STATUS_IS_OK(status)) {
6326 printf("Bad response from %s for name query - %s\n",
6327 ctx->address, nt_errstr(status));
6330 CHECK_VALUE(release->out.rcode, 0);
6335 wins_name->name = &records[i].name;
6336 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
6337 records[i].replica.state,
6338 records[i].replica.node,
6339 records[i].replica.is_static);
6340 wins_name->id = ++ctx->b.max_version;
6341 if (wins_name->flags & 2) {
6342 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
6343 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
6345 wins_name->addresses.ip = records[i].replica.ips[0].ip;
6347 wins_name->unknown = "255.255.255.255";
6349 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
6350 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
6351 records[i].replica.apply_expected);
6353 if (records[i].replica.apply_expected) {
6354 wins_name->name = &records[i].name;
6355 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
6356 WREPL_STATE_TOMBSTONE,
6357 WREPL_NODE_B, False);
6358 wins_name->id = ++ctx->b.max_version;
6359 wins_name->addresses.ip = addresses_B_1[0].ip;
6360 wins_name->unknown = "255.255.255.255";
6362 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
6363 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
6365 release->in.name = records[i].name;
6366 release->in.dest_addr = ctx->address;
6367 release->in.address = records[i].wins.ips[0].ip;
6368 release->in.nb_flags = records[i].wins.nb_flags;
6369 release->in.broadcast = False;
6370 release->in.timeout = 30;
6371 release->in.retries = 0;
6373 status = nbt_name_release(ctx->nbtsock, ctx, release);
6374 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6375 printf("No response from %s for name release\n", ctx->address);
6378 if (!NT_STATUS_IS_OK(status)) {
6379 printf("Bad response from %s for name query - %s\n",
6380 ctx->address, nt_errstr(status));
6383 CHECK_VALUE(release->out.rcode, 0);
6387 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
6395 struct test_conflict_owned_active_vs_replica_struct {
6396 const char *line; /* just better debugging */
6397 const char *section; /* just better debugging */
6398 struct nbt_name name;
6404 const struct wrepl_ip *ips;
6405 BOOL apply_expected;
6410 BOOL expect_release;
6413 /* when num_ips == 0, then .wins.ips are used */
6415 const struct wrepl_ip *ips;
6418 enum wrepl_name_type type;
6419 enum wrepl_name_state state;
6420 enum wrepl_name_node node;
6423 const struct wrepl_ip *ips;
6424 BOOL apply_expected;
6430 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
6431 struct nbt_name_packet *req_packet,
6432 const struct nbt_peer_socket *src);
6434 static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_conn *ctx)
6438 struct wrepl_wins_name wins_name_;
6439 struct wrepl_wins_name *wins_name = &wins_name_;
6440 struct nbt_name_register name_register_;
6441 struct nbt_name_register *name_register = &name_register_;
6442 struct nbt_name_release release_;
6443 struct nbt_name_release *release = &release_;
6445 struct test_conflict_owned_active_vs_replica_struct records[] = {
6447 * unique vs. unique section
6450 * unique,active vs. unique,active with same ip(s), unchecked
6453 .line = __location__,
6454 .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL),
6458 .num_ips = ctx->addresses_best_num,
6459 .ips = ctx->addresses_best,
6460 .apply_expected = True
6466 .type = WREPL_TYPE_UNIQUE,
6467 .state = WREPL_STATE_ACTIVE,
6468 .node = WREPL_NODE_B,
6470 .num_ips = ctx->addresses_best_num,
6471 .ips = ctx->addresses_best,
6472 .apply_expected = True
6476 * unique,active vs. unique,active with different ip(s), positive response
6479 .line = __location__,
6480 .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL),
6484 .num_ips = ctx->addresses_best_num,
6485 .ips = ctx->addresses_best,
6486 .apply_expected = True
6493 .type = WREPL_TYPE_UNIQUE,
6494 .state = WREPL_STATE_ACTIVE,
6495 .node = WREPL_NODE_B,
6497 .num_ips = ARRAY_SIZE(addresses_B_1),
6498 .ips = addresses_B_1,
6499 .apply_expected = False
6503 * unique,active vs. unique,active with different ip(s), positive response other ips
6506 .line = __location__,
6507 .name = _NBT_NAME("_UA_UA_DI_O", 0x00, NULL),
6511 .num_ips = ctx->addresses_best_num,
6512 .ips = ctx->addresses_best,
6513 .apply_expected = True
6518 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6519 .ips = addresses_A_3_4,
6522 .type = WREPL_TYPE_UNIQUE,
6523 .state = WREPL_STATE_ACTIVE,
6524 .node = WREPL_NODE_B,
6526 .num_ips = ARRAY_SIZE(addresses_B_1),
6527 .ips = addresses_B_1,
6528 .apply_expected = False
6532 * unique,active vs. unique,active with different ip(s), negative response
6535 .line = __location__,
6536 .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL),
6540 .num_ips = ctx->addresses_best_num,
6541 .ips = ctx->addresses_best,
6542 .apply_expected = True
6549 .type = WREPL_TYPE_UNIQUE,
6550 .state = WREPL_STATE_ACTIVE,
6551 .node = WREPL_NODE_B,
6553 .num_ips = ARRAY_SIZE(addresses_B_1),
6554 .ips = addresses_B_1,
6555 .apply_expected = True
6559 * unique,active vs. unique,tombstone with same ip(s), unchecked
6562 .line = __location__,
6563 .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL),
6567 .num_ips = ctx->addresses_best_num,
6568 .ips = ctx->addresses_best,
6569 .apply_expected = True
6575 .type = WREPL_TYPE_UNIQUE,
6576 .state = WREPL_STATE_TOMBSTONE,
6577 .node = WREPL_NODE_B,
6579 .num_ips = ctx->addresses_best_num,
6580 .ips = ctx->addresses_best,
6581 .apply_expected = False
6585 * unique,active vs. unique,tombstone with different ip(s), unchecked
6588 .line = __location__,
6589 .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL),
6593 .num_ips = ctx->addresses_best_num,
6594 .ips = ctx->addresses_best,
6595 .apply_expected = True
6601 .type = WREPL_TYPE_UNIQUE,
6602 .state = WREPL_STATE_TOMBSTONE,
6603 .node = WREPL_NODE_B,
6605 .num_ips = ARRAY_SIZE(addresses_B_1),
6606 .ips = addresses_B_1,
6607 .apply_expected = False
6611 * unique vs. group section
6614 * unique,active vs. group,active with same ip(s), release expected
6617 .line = __location__,
6618 .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL),
6622 .num_ips = ctx->addresses_best_num,
6623 .ips = ctx->addresses_best,
6624 .apply_expected = True
6628 .expect_release = True,
6631 .type = WREPL_TYPE_GROUP,
6632 .state = WREPL_STATE_ACTIVE,
6633 .node = WREPL_NODE_B,
6635 .num_ips = ctx->addresses_best_num,
6636 .ips = ctx->addresses_best,
6637 .apply_expected = True
6641 * unique,active vs. group,active with different ip(s), release expected
6644 .line = __location__,
6645 .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL),
6649 .num_ips = ctx->addresses_best_num,
6650 .ips = ctx->addresses_best,
6651 .apply_expected = True
6655 .expect_release = True,
6658 .type = WREPL_TYPE_GROUP,
6659 .state = WREPL_STATE_ACTIVE,
6660 .node = WREPL_NODE_B,
6662 .num_ips = ARRAY_SIZE(addresses_B_1),
6663 .ips = addresses_B_1,
6664 .apply_expected = True
6668 * unique,active vs. group,tombstone with same ip(s), unchecked
6671 .line = __location__,
6672 .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL),
6676 .num_ips = ctx->addresses_best_num,
6677 .ips = ctx->addresses_best,
6678 .apply_expected = True
6684 .type = WREPL_TYPE_GROUP,
6685 .state = WREPL_STATE_TOMBSTONE,
6686 .node = WREPL_NODE_B,
6688 .num_ips = ctx->addresses_best_num,
6689 .ips = ctx->addresses_best,
6690 .apply_expected = False
6694 * unique,active vs. group,tombstone with different ip(s), unchecked
6697 .line = __location__,
6698 .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL),
6702 .num_ips = ctx->addresses_best_num,
6703 .ips = ctx->addresses_best,
6704 .apply_expected = True
6710 .type = WREPL_TYPE_GROUP,
6711 .state = WREPL_STATE_TOMBSTONE,
6712 .node = WREPL_NODE_B,
6714 .num_ips = ARRAY_SIZE(addresses_B_1),
6715 .ips = addresses_B_1,
6716 .apply_expected = False
6720 * unique vs. special group section
6723 * unique,active vs. sgroup,active with same ip(s), release expected
6726 .line = __location__,
6727 .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL),
6731 .num_ips = ctx->addresses_best_num,
6732 .ips = ctx->addresses_best,
6733 .apply_expected = True
6737 .expect_release = True,
6740 .type = WREPL_TYPE_SGROUP,
6741 .state = WREPL_STATE_ACTIVE,
6742 .node = WREPL_NODE_B,
6744 .num_ips = ctx->addresses_best_num,
6745 .ips = ctx->addresses_best,
6746 .apply_expected = True
6750 * unique,active vs. group,active with different ip(s), release expected
6753 .line = __location__,
6754 .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL),
6758 .num_ips = ctx->addresses_best_num,
6759 .ips = ctx->addresses_best,
6760 .apply_expected = True
6764 .expect_release = True,
6767 .type = WREPL_TYPE_SGROUP,
6768 .state = WREPL_STATE_ACTIVE,
6769 .node = WREPL_NODE_B,
6771 .num_ips = ARRAY_SIZE(addresses_B_1),
6772 .ips = addresses_B_1,
6773 .apply_expected = True
6777 * unique,active vs. sgroup,tombstone with same ip(s), unchecked
6780 .line = __location__,
6781 .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL),
6785 .num_ips = ctx->addresses_best_num,
6786 .ips = ctx->addresses_best,
6787 .apply_expected = True
6793 .type = WREPL_TYPE_SGROUP,
6794 .state = WREPL_STATE_TOMBSTONE,
6795 .node = WREPL_NODE_B,
6797 .num_ips = ctx->addresses_best_num,
6798 .ips = ctx->addresses_best,
6799 .apply_expected = False
6803 * unique,active vs. sgroup,tombstone with different ip(s), unchecked
6806 .line = __location__,
6807 .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL),
6811 .num_ips = ctx->addresses_best_num,
6812 .ips = ctx->addresses_best,
6813 .apply_expected = True
6819 .type = WREPL_TYPE_SGROUP,
6820 .state = WREPL_STATE_TOMBSTONE,
6821 .node = WREPL_NODE_B,
6823 .num_ips = ARRAY_SIZE(addresses_B_1),
6824 .ips = addresses_B_1,
6825 .apply_expected = False
6829 * unique vs. multi homed section
6832 * unique,active vs. mhomed,active with same ip(s), unchecked
6835 .line = __location__,
6836 .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL),
6840 .num_ips = ctx->addresses_best_num,
6841 .ips = ctx->addresses_best,
6842 .apply_expected = True
6848 .type = WREPL_TYPE_MHOMED,
6849 .state = WREPL_STATE_ACTIVE,
6850 .node = WREPL_NODE_B,
6852 .num_ips = ctx->addresses_best_num,
6853 .ips = ctx->addresses_best,
6854 .apply_expected = True
6858 * unique,active vs. mhomed,active with superset ip(s), unchecked
6861 .line = __location__,
6862 .name = _NBT_NAME("_UA_MA_SP_U", 0x00, NULL),
6866 .num_ips = ctx->addresses_best_num,
6867 .ips = ctx->addresses_best,
6868 .apply_expected = True
6874 .type = WREPL_TYPE_MHOMED,
6875 .state = WREPL_STATE_ACTIVE,
6876 .node = WREPL_NODE_B,
6878 .num_ips = ctx->addresses_all_num,
6879 .ips = ctx->addresses_all,
6880 .apply_expected = True
6884 * unique,active vs. mhomed,active with different ip(s), positive response
6887 .line = __location__,
6888 .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL),
6892 .num_ips = ctx->addresses_best_num,
6893 .ips = ctx->addresses_best,
6894 .apply_expected = True
6901 .type = WREPL_TYPE_MHOMED,
6902 .state = WREPL_STATE_ACTIVE,
6903 .node = WREPL_NODE_B,
6905 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6906 .ips = addresses_B_3_4,
6907 .apply_expected = False
6911 * unique,active vs. mhomed,active with different ip(s), positive response other ips
6914 .line = __location__,
6915 .name = _NBT_NAME("_UA_MA_DI_O", 0x00, NULL),
6919 .num_ips = ctx->addresses_best_num,
6920 .ips = ctx->addresses_best,
6921 .apply_expected = True
6926 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6927 .ips = addresses_A_3_4,
6930 .type = WREPL_TYPE_MHOMED,
6931 .state = WREPL_STATE_ACTIVE,
6932 .node = WREPL_NODE_B,
6934 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6935 .ips = addresses_B_3_4,
6936 .apply_expected = False
6940 * unique,active vs. mhomed,active with different ip(s), negative response
6943 .line = __location__,
6944 .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL),
6948 .num_ips = ctx->addresses_best_num,
6949 .ips = ctx->addresses_best,
6950 .apply_expected = True
6957 .type = WREPL_TYPE_MHOMED,
6958 .state = WREPL_STATE_ACTIVE,
6959 .node = WREPL_NODE_B,
6961 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6962 .ips = addresses_B_3_4,
6963 .apply_expected = True
6967 * unique,active vs. mhomed,tombstone with same ip(s), unchecked
6970 .line = __location__,
6971 .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL),
6975 .num_ips = ctx->addresses_best_num,
6976 .ips = ctx->addresses_best,
6977 .apply_expected = True
6983 .type = WREPL_TYPE_MHOMED,
6984 .state = WREPL_STATE_TOMBSTONE,
6985 .node = WREPL_NODE_B,
6987 .num_ips = ctx->addresses_best_num,
6988 .ips = ctx->addresses_best,
6989 .apply_expected = False
6993 * unique,active vs. mhomed,tombstone with different ip(s), unchecked
6996 .line = __location__,
6997 .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL),
7001 .num_ips = ctx->addresses_best_num,
7002 .ips = ctx->addresses_best,
7003 .apply_expected = True
7009 .type = WREPL_TYPE_MHOMED,
7010 .state = WREPL_STATE_TOMBSTONE,
7011 .node = WREPL_NODE_B,
7013 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7014 .ips = addresses_B_3_4,
7015 .apply_expected = False
7019 * normal group vs. unique section
7022 * group,active vs. unique,active with same ip(s), unchecked
7025 .line = __location__,
7026 .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL),
7028 .nb_flags = NBT_NM_GROUP,
7030 .num_ips = ctx->addresses_best_num,
7031 .ips = ctx->addresses_best,
7032 .apply_expected = True
7038 .type = WREPL_TYPE_UNIQUE,
7039 .state = WREPL_STATE_ACTIVE,
7040 .node = WREPL_NODE_B,
7042 .num_ips = ctx->addresses_best_num,
7043 .ips = ctx->addresses_best,
7044 .apply_expected = False
7048 * group,active vs. unique,active with different ip(s), unchecked
7051 .line = __location__,
7052 .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL),
7054 .nb_flags = NBT_NM_GROUP,
7056 .num_ips = ctx->addresses_best_num,
7057 .ips = ctx->addresses_best,
7058 .apply_expected = True
7064 .type = WREPL_TYPE_UNIQUE,
7065 .state = WREPL_STATE_ACTIVE,
7066 .node = WREPL_NODE_B,
7068 .num_ips = ARRAY_SIZE(addresses_B_1),
7069 .ips = addresses_B_1,
7070 .apply_expected = False
7074 * group,active vs. unique,tombstone with same ip(s), unchecked
7077 .line = __location__,
7078 .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL),
7080 .nb_flags = NBT_NM_GROUP,
7082 .num_ips = ctx->addresses_best_num,
7083 .ips = ctx->addresses_best,
7084 .apply_expected = True
7090 .type = WREPL_TYPE_UNIQUE,
7091 .state = WREPL_STATE_TOMBSTONE,
7092 .node = WREPL_NODE_B,
7094 .num_ips = ctx->addresses_best_num,
7095 .ips = ctx->addresses_best,
7096 .apply_expected = False
7100 * group,active vs. unique,tombstone with different ip(s), unchecked
7103 .line = __location__,
7104 .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL),
7106 .nb_flags = NBT_NM_GROUP,
7108 .num_ips = ctx->addresses_best_num,
7109 .ips = ctx->addresses_best,
7110 .apply_expected = True
7116 .type = WREPL_TYPE_UNIQUE,
7117 .state = WREPL_STATE_TOMBSTONE,
7118 .node = WREPL_NODE_B,
7120 .num_ips = ARRAY_SIZE(addresses_B_1),
7121 .ips = addresses_B_1,
7122 .apply_expected = False
7126 * normal group vs. normal group section
7129 * group,active vs. group,active with same ip(s), unchecked
7132 .line = __location__,
7133 .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL),
7135 .nb_flags = NBT_NM_GROUP,
7137 .num_ips = ctx->addresses_best_num,
7138 .ips = ctx->addresses_best,
7139 .apply_expected = True
7145 .type = WREPL_TYPE_GROUP,
7146 .state = WREPL_STATE_ACTIVE,
7147 .node = WREPL_NODE_B,
7149 .num_ips = ctx->addresses_best_num,
7150 .ips = ctx->addresses_best,
7151 .apply_expected = True
7155 * group,active vs. group,active with different ip(s), unchecked
7158 .line = __location__,
7159 .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL),
7161 .nb_flags = NBT_NM_GROUP,
7163 .num_ips = ctx->addresses_best_num,
7164 .ips = ctx->addresses_best,
7165 .apply_expected = True
7171 .type = WREPL_TYPE_GROUP,
7172 .state = WREPL_STATE_ACTIVE,
7173 .node = WREPL_NODE_B,
7175 .num_ips = ARRAY_SIZE(addresses_B_1),
7176 .ips = addresses_B_1,
7177 .apply_expected = True
7181 * group,active vs. group,tombstone with same ip(s), unchecked
7184 .line = __location__,
7185 .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL),
7187 .nb_flags = NBT_NM_GROUP,
7189 .num_ips = ctx->addresses_best_num,
7190 .ips = ctx->addresses_best,
7191 .apply_expected = True
7197 .type = WREPL_TYPE_GROUP,
7198 .state = WREPL_STATE_TOMBSTONE,
7199 .node = WREPL_NODE_B,
7201 .num_ips = ctx->addresses_best_num,
7202 .ips = ctx->addresses_best,
7203 .apply_expected = False
7207 * group,active vs. group,tombstone with different ip(s), unchecked
7210 .line = __location__,
7211 .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL),
7213 .nb_flags = NBT_NM_GROUP,
7215 .num_ips = ctx->addresses_best_num,
7216 .ips = ctx->addresses_best,
7217 .apply_expected = True
7223 .type = WREPL_TYPE_GROUP,
7224 .state = WREPL_STATE_TOMBSTONE,
7225 .node = WREPL_NODE_B,
7227 .num_ips = ARRAY_SIZE(addresses_B_1),
7228 .ips = addresses_B_1,
7229 .apply_expected = False
7233 * normal group vs. special group section
7236 * group,active vs. sgroup,active with same ip(s), unchecked
7239 .line = __location__,
7240 .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL),
7242 .nb_flags = NBT_NM_GROUP,
7244 .num_ips = ctx->addresses_best_num,
7245 .ips = ctx->addresses_best,
7246 .apply_expected = True
7252 .type = WREPL_TYPE_SGROUP,
7253 .state = WREPL_STATE_ACTIVE,
7254 .node = WREPL_NODE_B,
7256 .num_ips = ctx->addresses_best_num,
7257 .ips = ctx->addresses_best,
7258 .apply_expected = False
7262 * group,active vs. sgroup,active with different ip(s), unchecked
7265 .line = __location__,
7266 .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL),
7268 .nb_flags = NBT_NM_GROUP,
7270 .num_ips = ctx->addresses_best_num,
7271 .ips = ctx->addresses_best,
7272 .apply_expected = True
7278 .type = WREPL_TYPE_SGROUP,
7279 .state = WREPL_STATE_ACTIVE,
7280 .node = WREPL_NODE_B,
7282 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7283 .ips = addresses_B_3_4,
7284 .apply_expected = False
7288 * group,active vs. sgroup,tombstone with same ip(s), unchecked
7291 .line = __location__,
7292 .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL),
7294 .nb_flags = NBT_NM_GROUP,
7296 .num_ips = ctx->addresses_best_num,
7297 .ips = ctx->addresses_best,
7298 .apply_expected = True
7304 .type = WREPL_TYPE_SGROUP,
7305 .state = WREPL_STATE_TOMBSTONE,
7306 .node = WREPL_NODE_B,
7308 .num_ips = ctx->addresses_best_num,
7309 .ips = ctx->addresses_best,
7310 .apply_expected = False
7314 * group,active vs. sgroup,tombstone with different ip(s), unchecked
7317 .line = __location__,
7318 .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL),
7320 .nb_flags = NBT_NM_GROUP,
7322 .num_ips = ctx->addresses_best_num,
7323 .ips = ctx->addresses_best,
7324 .apply_expected = True
7330 .type = WREPL_TYPE_SGROUP,
7331 .state = WREPL_STATE_TOMBSTONE,
7332 .node = WREPL_NODE_B,
7334 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7335 .ips = addresses_B_3_4,
7336 .apply_expected = False
7340 * normal group vs. multi homed section
7343 * group,active vs. mhomed,active with same ip(s), unchecked
7346 .line = __location__,
7347 .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL),
7349 .nb_flags = NBT_NM_GROUP,
7351 .num_ips = ctx->addresses_best_num,
7352 .ips = ctx->addresses_best,
7353 .apply_expected = True
7359 .type = WREPL_TYPE_MHOMED,
7360 .state = WREPL_STATE_ACTIVE,
7361 .node = WREPL_NODE_B,
7363 .num_ips = ctx->addresses_best_num,
7364 .ips = ctx->addresses_best,
7365 .apply_expected = False
7369 * group,active vs. mhomed,active with different ip(s), unchecked
7372 .line = __location__,
7373 .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL),
7375 .nb_flags = NBT_NM_GROUP,
7377 .num_ips = ctx->addresses_best_num,
7378 .ips = ctx->addresses_best,
7379 .apply_expected = True
7385 .type = WREPL_TYPE_MHOMED,
7386 .state = WREPL_STATE_ACTIVE,
7387 .node = WREPL_NODE_B,
7389 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7390 .ips = addresses_B_3_4,
7391 .apply_expected = False
7395 * group,active vs. mhomed,tombstone with same ip(s), unchecked
7398 .line = __location__,
7399 .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL),
7401 .nb_flags = NBT_NM_GROUP,
7403 .num_ips = ctx->addresses_best_num,
7404 .ips = ctx->addresses_best,
7405 .apply_expected = True
7411 .type = WREPL_TYPE_MHOMED,
7412 .state = WREPL_STATE_TOMBSTONE,
7413 .node = WREPL_NODE_B,
7415 .num_ips = ctx->addresses_best_num,
7416 .ips = ctx->addresses_best,
7417 .apply_expected = False
7421 * group,active vs. mhomed,tombstone with different ip(s), unchecked
7424 .line = __location__,
7425 .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL),
7427 .nb_flags = NBT_NM_GROUP,
7429 .num_ips = ctx->addresses_best_num,
7430 .ips = ctx->addresses_best,
7431 .apply_expected = True
7437 .type = WREPL_TYPE_MHOMED,
7438 .state = WREPL_STATE_TOMBSTONE,
7439 .node = WREPL_NODE_B,
7441 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7442 .ips = addresses_B_3_4,
7443 .apply_expected = False
7447 * special group vs. unique section
7450 * sgroup,active vs. unique,active with same ip(s), unchecked
7453 .line = __location__,
7454 .name = _NBT_NAME("_SA_UA_SI_U", 0x1C, NULL),
7456 .nb_flags = NBT_NM_GROUP,
7458 .num_ips = ctx->addresses_best_num,
7459 .ips = ctx->addresses_best,
7460 .apply_expected = True
7466 .type = WREPL_TYPE_UNIQUE,
7467 .state = WREPL_STATE_ACTIVE,
7468 .node = WREPL_NODE_B,
7470 .num_ips = ctx->addresses_best_num,
7471 .ips = ctx->addresses_best,
7472 .apply_expected = False
7476 * sgroup,active vs. unique,active with different ip(s), unchecked
7479 .line = __location__,
7480 .name = _NBT_NAME("_SA_UA_DI_U", 0x1C, NULL),
7482 .nb_flags = NBT_NM_GROUP,
7484 .num_ips = ctx->addresses_best_num,
7485 .ips = ctx->addresses_best,
7486 .apply_expected = True
7492 .type = WREPL_TYPE_UNIQUE,
7493 .state = WREPL_STATE_ACTIVE,
7494 .node = WREPL_NODE_B,
7496 .num_ips = ARRAY_SIZE(addresses_B_1),
7497 .ips = addresses_B_1,
7498 .apply_expected = False
7502 * sgroup,active vs. unique,tombstone with same ip(s), unchecked
7505 .line = __location__,
7506 .name = _NBT_NAME("_SA_UT_SI_U", 0x1C, NULL),
7508 .nb_flags = NBT_NM_GROUP,
7510 .num_ips = ctx->addresses_best_num,
7511 .ips = ctx->addresses_best,
7512 .apply_expected = True
7518 .type = WREPL_TYPE_UNIQUE,
7519 .state = WREPL_STATE_TOMBSTONE,
7520 .node = WREPL_NODE_B,
7522 .num_ips = ctx->addresses_best_num,
7523 .ips = ctx->addresses_best,
7524 .apply_expected = False
7528 * sgroup,active vs. unique,tombstone with different ip(s), unchecked
7531 .line = __location__,
7532 .name = _NBT_NAME("_SA_UT_DI_U", 0x1C, NULL),
7534 .nb_flags = NBT_NM_GROUP,
7536 .num_ips = ctx->addresses_best_num,
7537 .ips = ctx->addresses_best,
7538 .apply_expected = True
7544 .type = WREPL_TYPE_UNIQUE,
7545 .state = WREPL_STATE_TOMBSTONE,
7546 .node = WREPL_NODE_B,
7548 .num_ips = ARRAY_SIZE(addresses_B_1),
7549 .ips = addresses_B_1,
7550 .apply_expected = False
7554 * special group vs. normal group section
7557 * sgroup,active vs. group,active with same ip(s), unchecked
7560 .line = __location__,
7561 .name = _NBT_NAME("_SA_GA_SI_U", 0x1C, NULL),
7563 .nb_flags = NBT_NM_GROUP,
7565 .num_ips = ctx->addresses_best_num,
7566 .ips = ctx->addresses_best,
7567 .apply_expected = True
7573 .type = WREPL_TYPE_GROUP,
7574 .state = WREPL_STATE_ACTIVE,
7575 .node = WREPL_NODE_B,
7577 .num_ips = ctx->addresses_best_num,
7578 .ips = ctx->addresses_best,
7579 .apply_expected = False
7583 * sgroup,active vs. group,active with different ip(s), unchecked
7586 .line = __location__,
7587 .name = _NBT_NAME("_SA_GA_DI_U", 0x1C, NULL),
7589 .nb_flags = NBT_NM_GROUP,
7591 .num_ips = ctx->addresses_best_num,
7592 .ips = ctx->addresses_best,
7593 .apply_expected = True
7599 .type = WREPL_TYPE_GROUP,
7600 .state = WREPL_STATE_ACTIVE,
7601 .node = WREPL_NODE_B,
7603 .num_ips = ARRAY_SIZE(addresses_B_1),
7604 .ips = addresses_B_1,
7605 .apply_expected = False
7609 * sgroup,active vs. group,tombstone with same ip(s), unchecked
7612 .line = __location__,
7613 .name = _NBT_NAME("_SA_GT_SI_U", 0x1C, NULL),
7615 .nb_flags = NBT_NM_GROUP,
7617 .num_ips = ctx->addresses_best_num,
7618 .ips = ctx->addresses_best,
7619 .apply_expected = True
7625 .type = WREPL_TYPE_GROUP,
7626 .state = WREPL_STATE_TOMBSTONE,
7627 .node = WREPL_NODE_B,
7629 .num_ips = ctx->addresses_best_num,
7630 .ips = ctx->addresses_best,
7631 .apply_expected = False
7635 * sgroup,active vs. group,tombstone with different ip(s), unchecked
7638 .line = __location__,
7639 .name = _NBT_NAME("_SA_GT_DI_U", 0x1C, NULL),
7641 .nb_flags = NBT_NM_GROUP,
7643 .num_ips = ctx->addresses_best_num,
7644 .ips = ctx->addresses_best,
7645 .apply_expected = True
7651 .type = WREPL_TYPE_GROUP,
7652 .state = WREPL_STATE_TOMBSTONE,
7653 .node = WREPL_NODE_B,
7655 .num_ips = ARRAY_SIZE(addresses_B_1),
7656 .ips = addresses_B_1,
7657 .apply_expected = False
7661 * special group vs. multi homed section
7664 * sgroup,active vs. mhomed,active with same ip(s), unchecked
7667 .line = __location__,
7668 .name = _NBT_NAME("_SA_MA_SI_U", 0x1C, NULL),
7670 .nb_flags = NBT_NM_GROUP,
7672 .num_ips = ctx->addresses_best_num,
7673 .ips = ctx->addresses_best,
7674 .apply_expected = True
7680 .type = WREPL_TYPE_MHOMED,
7681 .state = WREPL_STATE_ACTIVE,
7682 .node = WREPL_NODE_B,
7684 .num_ips = ctx->addresses_best_num,
7685 .ips = ctx->addresses_best,
7686 .apply_expected = False
7690 * sgroup,active vs. mhomed,active with different ip(s), unchecked
7693 .line = __location__,
7694 .name = _NBT_NAME("_SA_MA_DI_U", 0x1C, NULL),
7696 .nb_flags = NBT_NM_GROUP,
7698 .num_ips = ctx->addresses_best_num,
7699 .ips = ctx->addresses_best,
7700 .apply_expected = True
7706 .type = WREPL_TYPE_MHOMED,
7707 .state = WREPL_STATE_ACTIVE,
7708 .node = WREPL_NODE_B,
7710 .num_ips = ARRAY_SIZE(addresses_B_1),
7711 .ips = addresses_B_1,
7712 .apply_expected = False
7716 * sgroup,active vs. mhomed,tombstone with same ip(s), unchecked
7719 .line = __location__,
7720 .name = _NBT_NAME("_SA_MT_SI_U", 0x1C, NULL),
7722 .nb_flags = NBT_NM_GROUP,
7724 .num_ips = ctx->addresses_best_num,
7725 .ips = ctx->addresses_best,
7726 .apply_expected = True
7732 .type = WREPL_TYPE_MHOMED,
7733 .state = WREPL_STATE_TOMBSTONE,
7734 .node = WREPL_NODE_B,
7736 .num_ips = ctx->addresses_best_num,
7737 .ips = ctx->addresses_best,
7738 .apply_expected = False
7742 * sgroup,active vs. mhomed,tombstone with different ip(s), unchecked
7745 .line = __location__,
7746 .name = _NBT_NAME("_SA_MT_DI_U", 0x1C, NULL),
7748 .nb_flags = NBT_NM_GROUP,
7750 .num_ips = ctx->addresses_best_num,
7751 .ips = ctx->addresses_best,
7752 .apply_expected = True
7758 .type = WREPL_TYPE_MHOMED,
7759 .state = WREPL_STATE_TOMBSTONE,
7760 .node = WREPL_NODE_B,
7762 .num_ips = ARRAY_SIZE(addresses_B_1),
7763 .ips = addresses_B_1,
7764 .apply_expected = False
7768 * multi homed vs. unique section
7771 * mhomed,active vs. unique,active with same ip(s), unchecked
7774 .line = __location__,
7775 .name = _NBT_NAME("_MA_UA_SI_U", 0x00, NULL),
7779 .num_ips = ctx->addresses_best_num,
7780 .ips = ctx->addresses_best,
7781 .apply_expected = True
7787 .type = WREPL_TYPE_UNIQUE,
7788 .state = WREPL_STATE_ACTIVE,
7789 .node = WREPL_NODE_B,
7791 .num_ips = ctx->addresses_best_num,
7792 .ips = ctx->addresses_best,
7793 .apply_expected = True
7797 * mhomed,active vs. unique,active with different ip(s), positive response
7800 .line = __location__,
7801 .name = _NBT_NAME("_MA_UA_DI_P", 0x00, NULL),
7805 .num_ips = ctx->addresses_best_num,
7806 .ips = ctx->addresses_best,
7807 .apply_expected = True
7814 .type = WREPL_TYPE_UNIQUE,
7815 .state = WREPL_STATE_ACTIVE,
7816 .node = WREPL_NODE_B,
7818 .num_ips = ARRAY_SIZE(addresses_B_1),
7819 .ips = addresses_B_1,
7820 .apply_expected = False
7824 * mhomed,active vs. unique,active with different ip(s), positive response other ips
7827 .line = __location__,
7828 .name = _NBT_NAME("_MA_UA_DI_O", 0x00, NULL),
7832 .num_ips = ctx->addresses_best_num,
7833 .ips = ctx->addresses_best,
7834 .apply_expected = True
7839 .num_ips = ARRAY_SIZE(addresses_A_3_4),
7840 .ips = addresses_A_3_4,
7843 .type = WREPL_TYPE_UNIQUE,
7844 .state = WREPL_STATE_ACTIVE,
7845 .node = WREPL_NODE_B,
7847 .num_ips = ARRAY_SIZE(addresses_B_1),
7848 .ips = addresses_B_1,
7849 .apply_expected = False
7853 * mhomed,active vs. unique,active with different ip(s), negative response
7856 .line = __location__,
7857 .name = _NBT_NAME("_MA_UA_DI_N", 0x00, NULL),
7861 .num_ips = ctx->addresses_best_num,
7862 .ips = ctx->addresses_best,
7863 .apply_expected = True
7870 .type = WREPL_TYPE_UNIQUE,
7871 .state = WREPL_STATE_ACTIVE,
7872 .node = WREPL_NODE_B,
7874 .num_ips = ARRAY_SIZE(addresses_B_1),
7875 .ips = addresses_B_1,
7876 .apply_expected = True
7880 * mhomed,active vs. unique,tombstone with same ip(s), unchecked
7883 .line = __location__,
7884 .name = _NBT_NAME("_MA_UT_SI_U", 0x00, NULL),
7888 .num_ips = ctx->addresses_best_num,
7889 .ips = ctx->addresses_best,
7890 .apply_expected = True
7896 .type = WREPL_TYPE_UNIQUE,
7897 .state = WREPL_STATE_TOMBSTONE,
7898 .node = WREPL_NODE_B,
7900 .num_ips = ctx->addresses_best_num,
7901 .ips = ctx->addresses_best,
7902 .apply_expected = False
7906 * mhomed,active vs. unique,tombstone with different ip(s), unchecked
7909 .line = __location__,
7910 .name = _NBT_NAME("_MA_UT_DI_U", 0x00, NULL),
7914 .num_ips = ctx->addresses_best_num,
7915 .ips = ctx->addresses_best,
7916 .apply_expected = True
7922 .type = WREPL_TYPE_UNIQUE,
7923 .state = WREPL_STATE_TOMBSTONE,
7924 .node = WREPL_NODE_B,
7926 .num_ips = ARRAY_SIZE(addresses_B_1),
7927 .ips = addresses_B_1,
7928 .apply_expected = False
7932 * multi homed vs. normal group section
7935 * mhomed,active vs. group,active with same ip(s), release expected
7938 .line = __location__,
7939 .name = _NBT_NAME("_MA_GA_SI_R", 0x00, NULL),
7943 .num_ips = ctx->addresses_best_num,
7944 .ips = ctx->addresses_best,
7945 .apply_expected = True
7949 .expect_release = True,
7952 .type = WREPL_TYPE_GROUP,
7953 .state = WREPL_STATE_ACTIVE,
7954 .node = WREPL_NODE_B,
7956 .num_ips = ctx->addresses_best_num,
7957 .ips = ctx->addresses_best,
7958 .apply_expected = True
7962 * mhomed,active vs. group,active with different ip(s), release expected
7965 .line = __location__,
7966 .name = _NBT_NAME("_MA_GA_DI_R", 0x00, NULL),
7970 .num_ips = ctx->addresses_best_num,
7971 .ips = ctx->addresses_best,
7972 .apply_expected = True
7976 .expect_release = True,
7979 .type = WREPL_TYPE_GROUP,
7980 .state = WREPL_STATE_ACTIVE,
7981 .node = WREPL_NODE_B,
7983 .num_ips = ARRAY_SIZE(addresses_B_1),
7984 .ips = addresses_B_1,
7985 .apply_expected = True
7989 * mhomed,active vs. group,tombstone with same ip(s), unchecked
7992 .line = __location__,
7993 .name = _NBT_NAME("_MA_GT_SI_U", 0x00, NULL),
7997 .num_ips = ctx->addresses_best_num,
7998 .ips = ctx->addresses_best,
7999 .apply_expected = True
8005 .type = WREPL_TYPE_GROUP,
8006 .state = WREPL_STATE_TOMBSTONE,
8007 .node = WREPL_NODE_B,
8009 .num_ips = ctx->addresses_best_num,
8010 .ips = ctx->addresses_best,
8011 .apply_expected = False
8015 * mhomed,active vs. group,tombstone with different ip(s), unchecked
8018 .line = __location__,
8019 .name = _NBT_NAME("_MA_GT_DI_U", 0x00, NULL),
8023 .num_ips = ctx->addresses_best_num,
8024 .ips = ctx->addresses_best,
8025 .apply_expected = True
8031 .type = WREPL_TYPE_GROUP,
8032 .state = WREPL_STATE_TOMBSTONE,
8033 .node = WREPL_NODE_B,
8035 .num_ips = ARRAY_SIZE(addresses_B_1),
8036 .ips = addresses_B_1,
8037 .apply_expected = False
8041 * multi homed vs. special group section
8044 * mhomed,active vs. sgroup,active with same ip(s), release expected
8047 .line = __location__,
8048 .name = _NBT_NAME("_MA_SA_SI_R", 0x00, NULL),
8052 .num_ips = ctx->addresses_best_num,
8053 .ips = ctx->addresses_best,
8054 .apply_expected = True
8058 .expect_release = True,
8061 .type = WREPL_TYPE_SGROUP,
8062 .state = WREPL_STATE_ACTIVE,
8063 .node = WREPL_NODE_B,
8065 .num_ips = ctx->addresses_best_num,
8066 .ips = ctx->addresses_best,
8067 .apply_expected = True
8071 * mhomed,active vs. group,active with different ip(s), release expected
8074 .line = __location__,
8075 .name = _NBT_NAME("_MA_SA_DI_R", 0x00, NULL),
8079 .num_ips = ctx->addresses_best_num,
8080 .ips = ctx->addresses_best,
8081 .apply_expected = True
8085 .expect_release = True,
8088 .type = WREPL_TYPE_SGROUP,
8089 .state = WREPL_STATE_ACTIVE,
8090 .node = WREPL_NODE_B,
8092 .num_ips = ARRAY_SIZE(addresses_B_1),
8093 .ips = addresses_B_1,
8094 .apply_expected = True
8098 * mhomed,active vs. sgroup,tombstone with same ip(s), unchecked
8101 .line = __location__,
8102 .name = _NBT_NAME("_MA_ST_SI_U", 0x00, NULL),
8106 .num_ips = ctx->addresses_best_num,
8107 .ips = ctx->addresses_best,
8108 .apply_expected = True
8114 .type = WREPL_TYPE_SGROUP,
8115 .state = WREPL_STATE_TOMBSTONE,
8116 .node = WREPL_NODE_B,
8118 .num_ips = ctx->addresses_best_num,
8119 .ips = ctx->addresses_best,
8120 .apply_expected = False
8124 * mhomed,active vs. sgroup,tombstone with different ip(s), unchecked
8127 .line = __location__,
8128 .name = _NBT_NAME("_MA_ST_DI_U", 0x00, NULL),
8132 .num_ips = ctx->addresses_best_num,
8133 .ips = ctx->addresses_best,
8134 .apply_expected = True
8140 .type = WREPL_TYPE_SGROUP,
8141 .state = WREPL_STATE_TOMBSTONE,
8142 .node = WREPL_NODE_B,
8144 .num_ips = ARRAY_SIZE(addresses_B_1),
8145 .ips = addresses_B_1,
8146 .apply_expected = False
8150 * multi homed vs. multi homed section
8153 * mhomed,active vs. mhomed,active with same ip(s), unchecked
8156 .line = __location__,
8157 .name = _NBT_NAME("_MA_MA_SI_U", 0x00, NULL),
8161 .num_ips = ctx->addresses_best_num,
8162 .ips = ctx->addresses_best,
8163 .apply_expected = True
8169 .type = WREPL_TYPE_MHOMED,
8170 .state = WREPL_STATE_ACTIVE,
8171 .node = WREPL_NODE_B,
8173 .num_ips = ctx->addresses_best_num,
8174 .ips = ctx->addresses_best,
8175 .apply_expected = True
8179 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8182 .line = __location__,
8183 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8187 .num_ips = ctx->addresses_best_num,
8188 .ips = ctx->addresses_best,
8189 .apply_expected = True
8195 .type = WREPL_TYPE_MHOMED,
8196 .state = WREPL_STATE_ACTIVE,
8197 .node = WREPL_NODE_B,
8199 .num_ips = ctx->addresses_all_num,
8200 .ips = ctx->addresses_all,
8201 .apply_expected = True
8205 * mhomed,active vs. mhomed,active with different ip(s), positive response
8208 .line = __location__,
8209 .name = _NBT_NAME("_MA_MA_DI_P", 0x00, NULL),
8213 .num_ips = ctx->addresses_best_num,
8214 .ips = ctx->addresses_best,
8215 .apply_expected = True
8222 .type = WREPL_TYPE_MHOMED,
8223 .state = WREPL_STATE_ACTIVE,
8224 .node = WREPL_NODE_B,
8226 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8227 .ips = addresses_B_3_4,
8228 .apply_expected = False
8232 * mhomed,active vs. mhomed,active with different ip(s), positive response other ips
8235 .line = __location__,
8236 .name = _NBT_NAME("_MA_MA_DI_O", 0x00, NULL),
8240 .num_ips = ctx->addresses_best_num,
8241 .ips = ctx->addresses_best,
8242 .apply_expected = True
8247 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8248 .ips = addresses_A_3_4,
8251 .type = WREPL_TYPE_MHOMED,
8252 .state = WREPL_STATE_ACTIVE,
8253 .node = WREPL_NODE_B,
8255 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8256 .ips = addresses_B_3_4,
8257 .apply_expected = False
8261 * mhomed,active vs. mhomed,active with different ip(s), negative response
8264 .line = __location__,
8265 .name = _NBT_NAME("_MA_MA_DI_N", 0x00, NULL),
8269 .num_ips = ctx->addresses_best_num,
8270 .ips = ctx->addresses_best,
8271 .apply_expected = True
8278 .type = WREPL_TYPE_MHOMED,
8279 .state = WREPL_STATE_ACTIVE,
8280 .node = WREPL_NODE_B,
8282 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8283 .ips = addresses_B_3_4,
8284 .apply_expected = True
8288 * mhomed,active vs. mhomed,tombstone with same ip(s), unchecked
8291 .line = __location__,
8292 .name = _NBT_NAME("_MA_MT_SI_U", 0x00, NULL),
8296 .num_ips = ctx->addresses_best_num,
8297 .ips = ctx->addresses_best,
8298 .apply_expected = True
8304 .type = WREPL_TYPE_MHOMED,
8305 .state = WREPL_STATE_TOMBSTONE,
8306 .node = WREPL_NODE_B,
8308 .num_ips = ctx->addresses_best_num,
8309 .ips = ctx->addresses_best,
8310 .apply_expected = False
8314 * mhomed,active vs. mhomed,tombstone with different ip(s), unchecked
8317 .line = __location__,
8318 .name = _NBT_NAME("_MA_MT_DI_U", 0x00, NULL),
8322 .num_ips = ctx->addresses_best_num,
8323 .ips = ctx->addresses_best,
8324 .apply_expected = True
8330 .type = WREPL_TYPE_MHOMED,
8331 .state = WREPL_STATE_TOMBSTONE,
8332 .node = WREPL_NODE_B,
8334 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8335 .ips = addresses_B_3_4,
8336 .apply_expected = False
8340 * some more multi homed test, including merging
8343 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8346 .line = __location__,
8347 .section= "Test Replica vs. owned active: some more MHOMED combinations",
8348 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8349 .skip = (ctx->addresses_all_num < 3),
8353 .num_ips = ctx->addresses_mhomed_num,
8354 .ips = ctx->addresses_mhomed,
8355 .apply_expected = True
8361 .type = WREPL_TYPE_MHOMED,
8362 .state = WREPL_STATE_ACTIVE,
8363 .node = WREPL_NODE_B,
8365 .num_ips = ctx->addresses_all_num,
8366 .ips = ctx->addresses_all,
8367 .apply_expected = True
8371 * mhomed,active vs. mhomed,active with same ips, unchecked
8374 .line = __location__,
8375 .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL),
8376 .skip = (ctx->addresses_mhomed_num != 2),
8380 .num_ips = ctx->addresses_mhomed_num,
8381 .ips = ctx->addresses_mhomed,
8382 .apply_expected = True
8388 .type = WREPL_TYPE_MHOMED,
8389 .state = WREPL_STATE_ACTIVE,
8390 .node = WREPL_NODE_B,
8392 .num_ips = ctx->addresses_mhomed_num,
8393 .ips = ctx->addresses_mhomed,
8394 .apply_expected = True
8398 * mhomed,active vs. mhomed,active with subset ip(s), positive response
8401 .line = __location__,
8402 .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL),
8403 .skip = (ctx->addresses_mhomed_num != 2),
8407 .num_ips = ctx->addresses_mhomed_num,
8408 .ips = ctx->addresses_mhomed,
8409 .apply_expected = True
8416 .type = WREPL_TYPE_MHOMED,
8417 .state = WREPL_STATE_ACTIVE,
8418 .node = WREPL_NODE_B,
8420 .num_ips = ctx->addresses_best_num,
8421 .ips = ctx->addresses_best,
8422 .mhomed_merge = True
8426 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with all addresses
8429 .line = __location__,
8430 .name = _NBT_NAME("_MA_MA_SB_A", 0x00, NULL),
8431 .skip = (ctx->addresses_all_num < 3),
8435 .num_ips = ctx->addresses_mhomed_num,
8436 .ips = ctx->addresses_mhomed,
8437 .apply_expected = True
8442 .num_ips = ctx->addresses_all_num,
8443 .ips = ctx->addresses_all,
8446 .type = WREPL_TYPE_MHOMED,
8447 .state = WREPL_STATE_ACTIVE,
8448 .node = WREPL_NODE_B,
8450 .num_ips = ctx->addresses_best_num,
8451 .ips = ctx->addresses_best,
8452 .mhomed_merge = True
8456 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with replicas addresses
8457 * TODO: check why the server sends a name release demand for one address?
8458 * the release demand has no effect to the database record...
8461 .line = __location__,
8462 .name = _NBT_NAME("_MA_MA_SB_PRA", 0x00, NULL),
8463 .skip = (ctx->addresses_all_num < 3),
8467 .num_ips = ctx->addresses_mhomed_num,
8468 .ips = ctx->addresses_mhomed,
8469 .apply_expected = True
8474 .num_ips = ctx->addresses_best_num,
8475 .ips = ctx->addresses_best,
8476 .late_release = True
8479 .type = WREPL_TYPE_MHOMED,
8480 .state = WREPL_STATE_ACTIVE,
8481 .node = WREPL_NODE_B,
8483 .num_ips = ctx->addresses_best_num,
8484 .ips = ctx->addresses_best,
8485 .apply_expected = False
8489 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with other addresses
8492 .line = __location__,
8493 .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL),
8495 .skip = (ctx->addresses_all_num < 3),
8499 .num_ips = ctx->addresses_mhomed_num,
8500 .ips = ctx->addresses_mhomed,
8501 .apply_expected = True
8506 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8507 .ips = addresses_B_3_4,
8510 .type = WREPL_TYPE_MHOMED,
8511 .state = WREPL_STATE_ACTIVE,
8512 .node = WREPL_NODE_B,
8514 .num_ips = ctx->addresses_best_num,
8515 .ips = ctx->addresses_best,
8516 .apply_expected = False
8520 * mhomed,active vs. mhomed,active with subset ip(s), negative response
8523 .line = __location__,
8524 .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL),
8525 .skip = (ctx->addresses_mhomed_num != 2),
8529 .num_ips = ctx->addresses_mhomed_num,
8530 .ips = ctx->addresses_mhomed,
8531 .apply_expected = True
8538 .type = WREPL_TYPE_MHOMED,
8539 .state = WREPL_STATE_ACTIVE,
8540 .node = WREPL_NODE_B,
8542 .num_ips = ctx->addresses_best_num,
8543 .ips = ctx->addresses_best,
8544 .apply_expected = True
8548 * some more multi homed and unique test, including merging
8551 * mhomed,active vs. unique,active with subset ip(s), positive response
8554 .line = __location__,
8555 .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations",
8556 .name = _NBT_NAME("_MA_UA_SB_P", 0x00, NULL),
8557 .skip = (ctx->addresses_all_num < 3),
8561 .num_ips = ctx->addresses_mhomed_num,
8562 .ips = ctx->addresses_mhomed,
8563 .apply_expected = True
8570 .type = WREPL_TYPE_UNIQUE,
8571 .state = WREPL_STATE_ACTIVE,
8572 .node = WREPL_NODE_B,
8574 .num_ips = ctx->addresses_best_num,
8575 .ips = ctx->addresses_best,
8576 .mhomed_merge = True
8580 * unique,active vs. unique,active with different ip(s), positive response, with all addresses
8583 .line = __location__,
8584 .name = _NBT_NAME("_UA_UA_DI_A", 0x00, NULL),
8585 .skip = (ctx->addresses_all_num < 3),
8589 .num_ips = ctx->addresses_best_num,
8590 .ips = ctx->addresses_best,
8591 .apply_expected = True
8596 .num_ips = ctx->addresses_all_num,
8597 .ips = ctx->addresses_all,
8600 .type = WREPL_TYPE_UNIQUE,
8601 .state = WREPL_STATE_ACTIVE,
8602 .node = WREPL_NODE_B,
8604 .num_ips = ctx->addresses_best2_num,
8605 .ips = ctx->addresses_best2,
8606 .mhomed_merge = True,
8610 * unique,active vs. mhomed,active with different ip(s), positive response, with all addresses
8613 .line = __location__,
8614 .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL),
8615 .skip = (ctx->addresses_all_num < 3),
8619 .num_ips = ctx->addresses_best_num,
8620 .ips = ctx->addresses_best,
8621 .apply_expected = True
8626 .num_ips = ctx->addresses_all_num,
8627 .ips = ctx->addresses_all,
8630 .type = WREPL_TYPE_MHOMED,
8631 .state = WREPL_STATE_ACTIVE,
8632 .node = WREPL_NODE_B,
8634 .num_ips = ctx->addresses_best2_num,
8635 .ips = ctx->addresses_best2,
8636 .mhomed_merge = True,
8640 * special group vs. special group merging section
8643 * sgroup,active vs. sgroup,active with different ip(s)
8646 .line = __location__,
8647 .section= "Test Replica vs. owned active: SGROUP vs. SGROUP tests",
8648 .name = _NBT_NAME("_SA_SA_DI_U", 0x1C, NULL),
8649 .skip = (ctx->addresses_all_num < 3),
8651 .nb_flags = NBT_NM_GROUP,
8653 .num_ips = ctx->addresses_mhomed_num,
8654 .ips = ctx->addresses_mhomed,
8655 .apply_expected = True
8661 .type = WREPL_TYPE_SGROUP,
8662 .state = WREPL_STATE_ACTIVE,
8663 .node = WREPL_NODE_B,
8665 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8666 .ips = addresses_B_3_4,
8667 .sgroup_merge = True
8671 * sgroup,active vs. sgroup,active with same ip(s)
8674 .line = __location__,
8675 .name = _NBT_NAME("_SA_SA_SI_U", 0x1C, NULL),
8676 .skip = (ctx->addresses_all_num < 3),
8678 .nb_flags = NBT_NM_GROUP,
8680 .num_ips = ctx->addresses_mhomed_num,
8681 .ips = ctx->addresses_mhomed,
8682 .apply_expected = True
8688 .type = WREPL_TYPE_SGROUP,
8689 .state = WREPL_STATE_ACTIVE,
8690 .node = WREPL_NODE_B,
8692 .num_ips = ctx->addresses_mhomed_num,
8693 .ips = ctx->addresses_mhomed,
8694 .sgroup_merge = True
8698 * sgroup,active vs. sgroup,active with superset ip(s)
8701 .line = __location__,
8702 .name = _NBT_NAME("_SA_SA_SP_U", 0x1C, NULL),
8703 .skip = (ctx->addresses_all_num < 3),
8705 .nb_flags = NBT_NM_GROUP,
8707 .num_ips = ctx->addresses_mhomed_num,
8708 .ips = ctx->addresses_mhomed,
8709 .apply_expected = True
8715 .type = WREPL_TYPE_SGROUP,
8716 .state = WREPL_STATE_ACTIVE,
8717 .node = WREPL_NODE_B,
8719 .num_ips = ctx->addresses_all_num,
8720 .ips = ctx->addresses_all,
8721 .sgroup_merge = True
8725 * sgroup,active vs. sgroup,active with subset ip(s)
8728 .line = __location__,
8729 .name = _NBT_NAME("_SA_SA_SB_U", 0x1C, NULL),
8730 .skip = (ctx->addresses_all_num < 3),
8732 .nb_flags = NBT_NM_GROUP,
8734 .num_ips = ctx->addresses_mhomed_num,
8735 .ips = ctx->addresses_mhomed,
8736 .apply_expected = True
8742 .type = WREPL_TYPE_SGROUP,
8743 .state = WREPL_STATE_ACTIVE,
8744 .node = WREPL_NODE_B,
8746 .num_ips = ctx->addresses_best_num,
8747 .ips = ctx->addresses_best,
8748 .sgroup_merge = True
8752 * sgroup,active vs. sgroup,tombstone with different ip(s)
8755 .line = __location__,
8756 .name = _NBT_NAME("_SA_ST_DI_U", 0x1C, NULL),
8757 .skip = (ctx->addresses_all_num < 3),
8759 .nb_flags = NBT_NM_GROUP,
8761 .num_ips = ctx->addresses_mhomed_num,
8762 .ips = ctx->addresses_mhomed,
8763 .apply_expected = True
8769 .type = WREPL_TYPE_SGROUP,
8770 .state = WREPL_STATE_TOMBSTONE,
8771 .node = WREPL_NODE_B,
8773 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8774 .ips = addresses_B_3_4,
8775 .apply_expected = False
8779 * sgroup,active vs. sgroup,tombstone with same ip(s)
8782 .line = __location__,
8783 .name = _NBT_NAME("_SA_ST_SI_U", 0x1C, NULL),
8784 .skip = (ctx->addresses_all_num < 3),
8786 .nb_flags = NBT_NM_GROUP,
8788 .num_ips = ctx->addresses_mhomed_num,
8789 .ips = ctx->addresses_mhomed,
8790 .apply_expected = True
8796 .type = WREPL_TYPE_SGROUP,
8797 .state = WREPL_STATE_TOMBSTONE,
8798 .node = WREPL_NODE_B,
8800 .num_ips = ctx->addresses_mhomed_num,
8801 .ips = ctx->addresses_mhomed,
8802 .apply_expected = False
8806 * sgroup,active vs. sgroup,tombstone with superset ip(s)
8809 .line = __location__,
8810 .name = _NBT_NAME("_SA_ST_SP_U", 0x1C, NULL),
8811 .skip = (ctx->addresses_all_num < 3),
8813 .nb_flags = NBT_NM_GROUP,
8815 .num_ips = ctx->addresses_mhomed_num,
8816 .ips = ctx->addresses_mhomed,
8817 .apply_expected = True
8823 .type = WREPL_TYPE_SGROUP,
8824 .state = WREPL_STATE_TOMBSTONE,
8825 .node = WREPL_NODE_B,
8827 .num_ips = ctx->addresses_all_num,
8828 .ips = ctx->addresses_all,
8829 .apply_expected = False
8833 * sgroup,active vs. sgroup,tombstone with subset ip(s)
8836 .line = __location__,
8837 .name = _NBT_NAME("_SA_ST_SB_U", 0x1C, NULL),
8838 .skip = (ctx->addresses_all_num < 3),
8840 .nb_flags = NBT_NM_GROUP,
8842 .num_ips = ctx->addresses_mhomed_num,
8843 .ips = ctx->addresses_mhomed,
8844 .apply_expected = True
8850 .type = WREPL_TYPE_SGROUP,
8851 .state = WREPL_STATE_TOMBSTONE,
8852 .node = WREPL_NODE_B,
8854 .num_ips = ctx->addresses_best_num,
8855 .ips = ctx->addresses_best,
8856 .apply_expected = False
8861 if (!ctx) return False;
8863 if (!ctx->nbtsock_srv) {
8864 printf("SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
8869 printf("Test Replica records vs. owned active records\n");
8871 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
8873 struct test_conflict_owned_active_vs_replica_struct record = records[i];
8874 uint32_t j, count = 1;
8877 if (records[i].wins.mhomed || records[i].name.type == 0x1C) {
8878 count = records[i].wins.num_ips;
8881 if (records[i].section) {
8882 printf("%s\n", records[i].section);
8885 if (records[i].skip) {
8886 printf("%s => SKIPPED\n", nbt_name_string(ctx, &records[i].name));
8890 if (records[i].replica.mhomed_merge) {
8891 action = "MHOMED_MERGE";
8892 } else if (records[i].replica.sgroup_merge) {
8893 action = "SGROUP_MERGE";
8894 } else if (records[i].replica.apply_expected) {
8897 action = "NOT REPLACE";
8900 printf("%s => %s\n", nbt_name_string(ctx, &records[i].name), action);
8902 /* Prepare for multi homed registration */
8903 ZERO_STRUCT(records[i].defend);
8904 records[i].defend.timeout = 10;
8905 records[i].defend.positive = True;
8906 nbt_set_incoming_handler(ctx->nbtsock_srv,
8907 test_conflict_owned_active_vs_replica_handler,
8909 if (ctx->nbtsock_srv2) {
8910 nbt_set_incoming_handler(ctx->nbtsock_srv2,
8911 test_conflict_owned_active_vs_replica_handler,
8918 for (j=0; j < count; j++) {
8919 struct nbt_name_request *req;
8921 name_register->in.name = records[i].name;
8922 name_register->in.dest_addr = ctx->address;
8923 name_register->in.address = records[i].wins.ips[j].ip;
8924 name_register->in.nb_flags = records[i].wins.nb_flags;
8925 name_register->in.register_demand= False;
8926 name_register->in.broadcast = False;
8927 name_register->in.multi_homed = records[i].wins.mhomed;
8928 name_register->in.ttl = 300000;
8929 name_register->in.timeout = 70;
8930 name_register->in.retries = 0;
8932 req = nbt_name_register_send(ctx->nbtsock, name_register);
8934 /* push the request on the wire */
8935 event_loop_once(ctx->nbtsock->event_ctx);
8938 * if we register multiple addresses,
8939 * the server will do name queries to see if the old addresses
8942 if (records[i].wins.mhomed && j > 0) {
8943 end = timeval_current_ofs(records[i].defend.timeout,0);
8944 records[i].defend.ret = True;
8945 while (records[i].defend.timeout > 0) {
8946 event_loop_once(ctx->nbtsock_srv->event_ctx);
8947 if (timeval_expired(&end)) break;
8949 ret &= records[i].defend.ret;
8952 status = nbt_name_register_recv(req, ctx, name_register);
8953 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
8954 printf("No response from %s for name register\n", ctx->address);
8957 if (!NT_STATUS_IS_OK(status)) {
8958 printf("Bad response from %s for name register - %s\n",
8959 ctx->address, nt_errstr(status));
8962 CHECK_VALUE(name_register->out.rcode, 0);
8963 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
8964 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
8965 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
8966 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
8967 CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[j].ip);
8970 /* Prepare for the current test */
8971 records[i].defend = record.defend;
8972 nbt_set_incoming_handler(ctx->nbtsock_srv,
8973 test_conflict_owned_active_vs_replica_handler,
8975 if (ctx->nbtsock_srv2) {
8976 nbt_set_incoming_handler(ctx->nbtsock_srv2,
8977 test_conflict_owned_active_vs_replica_handler,
8984 wins_name->name = &records[i].name;
8985 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
8986 records[i].replica.state,
8987 records[i].replica.node,
8988 records[i].replica.is_static);
8989 wins_name->id = ++ctx->b.max_version;
8990 if (wins_name->flags & 2) {
8991 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
8992 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
8994 wins_name->addresses.ip = records[i].replica.ips[0].ip;
8996 wins_name->unknown = "255.255.255.255";
8998 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9001 * wait for the name query, which is handled in
9002 * test_conflict_owned_active_vs_replica_handler()
9004 end = timeval_current_ofs(records[i].defend.timeout,0);
9005 records[i].defend.ret = True;
9006 while (records[i].defend.timeout > 0) {
9007 event_loop_once(ctx->nbtsock_srv->event_ctx);
9008 if (timeval_expired(&end)) break;
9010 ret &= records[i].defend.ret;
9012 if (records[i].defend.late_release) {
9013 records[i].defend = record.defend;
9014 records[i].defend.expect_release = True;
9016 * wait for the name release demand, which is handled in
9017 * test_conflict_owned_active_vs_replica_handler()
9019 end = timeval_current_ofs(records[i].defend.timeout,0);
9020 records[i].defend.ret = True;
9021 while (records[i].defend.timeout > 0) {
9022 event_loop_once(ctx->nbtsock_srv->event_ctx);
9023 if (timeval_expired(&end)) break;
9025 ret &= records[i].defend.ret;
9028 if (records[i].replica.mhomed_merge) {
9029 ret &= test_wrepl_mhomed_merged(ctx, &ctx->c,
9030 records[i].wins.num_ips, records[i].wins.ips,
9032 records[i].replica.num_ips, records[i].replica.ips,
9034 } else if (records[i].replica.sgroup_merge) {
9035 ret &= test_wrepl_sgroup_merged(ctx, NULL,
9037 records[i].wins.num_ips, records[i].wins.ips,
9039 records[i].replica.num_ips, records[i].replica.ips,
9042 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
9043 records[i].replica.apply_expected);
9046 if (records[i].replica.apply_expected ||
9047 records[i].replica.mhomed_merge) {
9048 wins_name->name = &records[i].name;
9049 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9050 WREPL_STATE_TOMBSTONE,
9051 WREPL_NODE_B, False);
9052 wins_name->id = ++ctx->b.max_version;
9053 wins_name->addresses.ip = addresses_B_1[0].ip;
9054 wins_name->unknown = "255.255.255.255";
9056 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9057 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
9059 for (j=0; j < count; j++) {
9060 struct nbt_name_socket *nbtsock = ctx->nbtsock;
9062 if (ctx->myaddr2 && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2) == 0) {
9063 nbtsock = ctx->nbtsock2;
9066 release->in.name = records[i].name;
9067 release->in.dest_addr = ctx->address;
9068 release->in.address = records[i].wins.ips[j].ip;
9069 release->in.nb_flags = records[i].wins.nb_flags;
9070 release->in.broadcast = False;
9071 release->in.timeout = 30;
9072 release->in.retries = 0;
9074 status = nbt_name_release(nbtsock, ctx, release);
9075 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9076 printf("No response from %s for name release\n", ctx->address);
9079 if (!NT_STATUS_IS_OK(status)) {
9080 printf("Bad response from %s for name query - %s\n",
9081 ctx->address, nt_errstr(status));
9084 CHECK_VALUE(release->out.rcode, 0);
9087 if (records[i].replica.sgroup_merge) {
9088 /* clean up the SGROUP record */
9089 wins_name->name = &records[i].name;
9090 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9092 WREPL_NODE_B, False);
9093 wins_name->id = ++ctx->b.max_version;
9094 wins_name->addresses.addresses.num_ips = 0;
9095 wins_name->addresses.addresses.ips = NULL;
9096 wins_name->unknown = "255.255.255.255";
9097 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9099 /* take ownership of the SGROUP record */
9100 wins_name->name = &records[i].name;
9101 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9103 WREPL_NODE_B, False);
9104 wins_name->id = ++ctx->b.max_version;
9105 wins_name->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
9106 wins_name->addresses.addresses.ips = discard_const(addresses_B_1);
9107 wins_name->unknown = "255.255.255.255";
9108 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9109 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
9111 /* overwrite the SGROUP record with unique,tombstone */
9112 wins_name->name = &records[i].name;
9113 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9114 WREPL_STATE_TOMBSTONE,
9115 WREPL_NODE_B, False);
9116 wins_name->id = ++ctx->b.max_version;
9117 wins_name->addresses.ip = addresses_A_1[0].ip;
9118 wins_name->unknown = "255.255.255.255";
9119 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9120 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
9126 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
9134 #define _NBT_ASSERT(v, correct) do { \
9135 if ((v) != (correct)) { \
9136 printf("(%s) Incorrect value %s=%d - should be %s (%d)\n", \
9137 __location__, #v, v, #correct, correct); \
9142 #define _NBT_ASSERT_STRING(v, correct) do { \
9143 if ( ((!v) && (correct)) || \
9144 ((v) && (!correct)) || \
9145 ((v) && (correct) && strcmp(v,correct) != 0)) { \
9146 printf("(%s) Incorrect value %s=%s - should be %s\n", \
9147 __location__, #v, v, correct); \
9152 static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
9153 struct nbt_name_packet *req_packet,
9154 const struct nbt_peer_socket *src)
9156 struct nbt_name *name;
9157 struct nbt_name_packet *rep_packet;
9158 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9160 _NBT_ASSERT(req_packet->qdcount, 1);
9161 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9162 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9164 name = &req_packet->questions[0].name;
9166 _NBT_ASSERT(name->type, rec->name.type);
9167 _NBT_ASSERT_STRING(name->name, rec->name.name);
9168 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9170 _NBT_ASSERT(rec->defend.expect_release, False);
9172 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9173 if (rep_packet == NULL) return;
9175 rep_packet->name_trn_id = req_packet->name_trn_id;
9176 rep_packet->ancount = 1;
9178 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9179 if (rep_packet->answers == NULL) return;
9181 rep_packet->answers[0].name = *name;
9182 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9183 rep_packet->answers[0].ttl = 0;
9185 if (rec->defend.positive) {
9186 uint32_t i, num_ips;
9187 const struct wrepl_ip *ips;
9189 if (rec->defend.num_ips > 0) {
9190 num_ips = rec->defend.num_ips;
9191 ips = rec->defend.ips;
9193 num_ips = rec->wins.num_ips;
9194 ips = rec->wins.ips;
9197 /* send a positive reply */
9198 rep_packet->operation =
9201 NBT_FLAG_AUTHORITIVE |
9202 NBT_FLAG_RECURSION_DESIRED |
9203 NBT_FLAG_RECURSION_AVAIL;
9205 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9207 rep_packet->answers[0].rdata.netbios.length = num_ips*6;
9208 rep_packet->answers[0].rdata.netbios.addresses =
9209 talloc_array(rep_packet->answers, struct nbt_rdata_address, num_ips);
9210 if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return;
9212 for (i=0; i < num_ips; i++) {
9213 struct nbt_rdata_address *addr =
9214 &rep_packet->answers[0].rdata.netbios.addresses[i];
9215 addr->nb_flags = rec->wins.nb_flags;
9216 addr->ipaddr = ips[i].ip;
9218 DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
9219 nbt_name_string(rep_packet, name), src->addr, src->port));
9221 /* send a negative reply */
9222 rep_packet->operation =
9225 NBT_FLAG_AUTHORITIVE |
9228 rep_packet->answers[0].rr_type = NBT_QTYPE_NULL;
9230 ZERO_STRUCT(rep_packet->answers[0].rdata);
9232 DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
9233 nbt_name_string(rep_packet, name), src->addr, src->port));
9236 nbt_name_reply_send(nbtsock, src, rep_packet);
9237 talloc_free(rep_packet);
9239 /* make sure we push the reply to the wire */
9240 event_loop_once(nbtsock->event_ctx);
9242 rec->defend.timeout = 0;
9243 rec->defend.ret = True;
9246 static void test_conflict_owned_active_vs_replica_handler_release(struct nbt_name_socket *nbtsock,
9247 struct nbt_name_packet *req_packet,
9248 const struct nbt_peer_socket *src)
9250 struct nbt_name *name;
9251 struct nbt_name_packet *rep_packet;
9252 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9254 _NBT_ASSERT(req_packet->qdcount, 1);
9255 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9256 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9258 name = &req_packet->questions[0].name;
9260 _NBT_ASSERT(name->type, rec->name.type);
9261 _NBT_ASSERT_STRING(name->name, rec->name.name);
9262 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9264 _NBT_ASSERT(rec->defend.expect_release, True);
9266 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9267 if (rep_packet == NULL) return;
9269 rep_packet->name_trn_id = req_packet->name_trn_id;
9270 rep_packet->ancount = 1;
9271 rep_packet->operation =
9273 NBT_OPCODE_RELEASE |
9274 NBT_FLAG_AUTHORITIVE;
9276 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9277 if (rep_packet->answers == NULL) return;
9279 rep_packet->answers[0].name = *name;
9280 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9281 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9282 rep_packet->answers[0].ttl = req_packet->additional[0].ttl;
9283 rep_packet->answers[0].rdata = req_packet->additional[0].rdata;
9285 DEBUG(2,("Sending name release reply for %s to %s:%d\n",
9286 nbt_name_string(rep_packet, name), src->addr, src->port));
9288 nbt_name_reply_send(nbtsock, src, rep_packet);
9289 talloc_free(rep_packet);
9291 /* make sure we push the reply to the wire */
9292 event_loop_once(nbtsock->event_ctx);
9294 rec->defend.timeout = 0;
9295 rec->defend.ret = True;
9298 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
9299 struct nbt_name_packet *req_packet,
9300 const struct nbt_peer_socket *src)
9302 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9304 rec->defend.ret = False;
9306 switch (req_packet->operation & NBT_OPCODE) {
9307 case NBT_OPCODE_QUERY:
9308 test_conflict_owned_active_vs_replica_handler_query(nbtsock, req_packet, src);
9310 case NBT_OPCODE_RELEASE:
9311 test_conflict_owned_active_vs_replica_handler_release(nbtsock, req_packet, src);
9314 printf("%s: unexpected incoming packet\n", __location__);
9320 test WINS replication operations
9322 BOOL torture_nbt_winsreplication_quick(void)
9324 const char *address;
9325 struct nbt_name name;
9326 TALLOC_CTX *mem_ctx = talloc_new(NULL);
9329 struct test_wrepl_conflict_conn *ctx;
9331 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
9333 /* do an initial name resolution to find its IP */
9334 status = resolve_name(&name, mem_ctx, &address, NULL);
9335 if (!NT_STATUS_IS_OK(status)) {
9336 printf("Failed to resolve %s - %s\n",
9337 name.name, nt_errstr(status));
9338 talloc_free(mem_ctx);
9342 ret &= test_assoc_ctx1(mem_ctx, address);
9343 ret &= test_assoc_ctx2(mem_ctx, address);
9345 ret &= test_wins_replication(mem_ctx, address);
9347 ctx = test_create_conflict_ctx(mem_ctx, address);
9349 ret &= test_conflict_same_owner(ctx);
9351 talloc_free(mem_ctx);
9357 test WINS replication operations
9359 BOOL torture_nbt_winsreplication(void)
9361 const char *address;
9362 struct nbt_name name;
9363 TALLOC_CTX *mem_ctx = talloc_new(NULL);
9366 struct test_wrepl_conflict_conn *ctx;
9368 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
9370 /* do an initial name resolution to find its IP */
9371 status = resolve_name(&name, mem_ctx, &address, NULL);
9372 if (!NT_STATUS_IS_OK(status)) {
9373 printf("Failed to resolve %s - %s\n",
9374 name.name, nt_errstr(status));
9375 talloc_free(mem_ctx);
9379 ret &= test_assoc_ctx1(mem_ctx, address);
9380 ret &= test_assoc_ctx2(mem_ctx, address);
9382 ret &= test_wins_replication(mem_ctx, address);
9384 ctx = test_create_conflict_ctx(mem_ctx, address);
9386 ret &= test_conflict_same_owner(ctx);
9387 ret &= test_conflict_different_owner(ctx);
9388 ret &= test_conflict_owned_released_vs_replica(ctx);
9389 ret &= test_conflict_owned_active_vs_replica(ctx);
9391 talloc_free(mem_ctx);