2 Unix SMB/CIFS implementation.
4 WINS replication testing
6 Copyright (C) Andrew Tridgell 2005
7 Copyright (C) Stefan Metzmacher 2005
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include "libcli/nbt/libnbt.h"
26 #include "libcli/wrepl/winsrepl.h"
27 #include "lib/events/events.h"
28 #include "lib/socket/socket.h"
29 #include "system/time.h"
31 #define CHECK_STATUS(status, correct) do { \
32 if (!NT_STATUS_EQUAL(status, correct)) { \
33 printf("(%s) Incorrect status %s - should be %s\n", \
34 __location__, nt_errstr(status), nt_errstr(correct)); \
39 #define CHECK_VALUE(v, correct) do { \
40 if ((v) != (correct)) { \
41 printf("(%s) Incorrect value %s=%d - should be %d\n", \
42 __location__, #v, v, correct); \
47 #define CHECK_VALUE_UINT64(v, correct) do { \
48 if ((v) != (correct)) { \
49 printf("(%s) Incorrect value %s=%llu - should be %llu\n", \
50 __location__, #v, v, correct); \
55 #define CHECK_VALUE_STRING(v, correct) do { \
56 if ( ((!v) && (correct)) || \
57 ((v) && (!correct)) || \
58 ((v) && (correct) && strcmp(v,correct) != 0)) { \
59 printf("(%s) Incorrect value %s='%s' - should be '%s'\n", \
60 __location__, #v, v, correct); \
65 #define _NBT_NAME(n,t,s) {\
71 static const char *wrepl_name_type_string(enum wrepl_name_type type)
74 case WREPL_TYPE_UNIQUE: return "UNIQUE";
75 case WREPL_TYPE_GROUP: return "GROUP";
76 case WREPL_TYPE_SGROUP: return "SGROUP";
77 case WREPL_TYPE_MHOMED: return "MHOMED";
79 return "UNKNOWN_TYPE";
82 static const char *wrepl_name_state_string(enum wrepl_name_state state)
85 case WREPL_STATE_ACTIVE: return "ACTIVE";
86 case WREPL_STATE_RELEASED: return "RELEASED";
87 case WREPL_STATE_TOMBSTONE: return "TOMBSTONE";
88 case WREPL_STATE_RESERVED: return "RESERVED";
90 return "UNKNOWN_STATE";
94 test how assoc_ctx's are only usable on the connection
97 static BOOL test_assoc_ctx1(TALLOC_CTX *mem_ctx, const char *address)
100 struct wrepl_request *req;
101 struct wrepl_socket *wrepl_socket1;
102 struct wrepl_associate associate1;
103 struct wrepl_socket *wrepl_socket2;
104 struct wrepl_associate associate2;
105 struct wrepl_pull_table pull_table;
106 struct wrepl_packet *rep_packet;
107 struct wrepl_associate_stop assoc_stop;
110 if (!lp_parm_bool(-1, "torture", "dangerous", False)) {
111 printf("winsrepl: cross connection assoc_ctx usage disabled - enable dangerous tests to use\n");
115 printf("Test if assoc_ctx is only valid on the conection it was created on\n");
117 wrepl_socket1 = wrepl_socket_init(mem_ctx, NULL);
118 wrepl_socket2 = wrepl_socket_init(mem_ctx, NULL);
120 printf("Setup 2 wrepl connections\n");
121 status = wrepl_connect(wrepl_socket1, NULL, address);
122 CHECK_STATUS(status, NT_STATUS_OK);
124 status = wrepl_connect(wrepl_socket2, NULL, address);
125 CHECK_STATUS(status, NT_STATUS_OK);
127 printf("Send a start association request (conn1)\n");
128 status = wrepl_associate(wrepl_socket1, &associate1);
129 CHECK_STATUS(status, NT_STATUS_OK);
131 printf("association context (conn1): 0x%x\n", associate1.out.assoc_ctx);
133 printf("Send a start association request (conn2)\n");
134 status = wrepl_associate(wrepl_socket2, &associate2);
135 CHECK_STATUS(status, NT_STATUS_OK);
137 printf("association context (conn2): 0x%x\n", associate2.out.assoc_ctx);
139 printf("Send a replication table query, with assoc 1 (conn2), the anwser should be on conn1\n");
140 pull_table.in.assoc_ctx = associate1.out.assoc_ctx;
141 req = wrepl_pull_table_send(wrepl_socket2, &pull_table);
142 req->send_only = True;
143 status = wrepl_request_recv(req, mem_ctx, &rep_packet);
144 CHECK_STATUS(status, NT_STATUS_OK);
146 printf("Send a association request (conn2), to make sure the last request was ignored\n");
147 status = wrepl_associate(wrepl_socket2, &associate2);
148 CHECK_STATUS(status, NT_STATUS_OK);
150 printf("Send a replication table query, with invalid assoc (conn1), receive answer from conn2\n");
151 pull_table.in.assoc_ctx = 0;
152 req = wrepl_pull_table_send(wrepl_socket1, &pull_table);
153 status = wrepl_request_recv(req, mem_ctx, &rep_packet);
154 CHECK_STATUS(status, NT_STATUS_OK);
156 printf("Send a association request (conn1), to make sure the last request was handled correct\n");
157 status = wrepl_associate(wrepl_socket1, &associate2);
158 CHECK_STATUS(status, NT_STATUS_OK);
160 assoc_stop.in.assoc_ctx = associate1.out.assoc_ctx;
161 assoc_stop.in.reason = 4;
162 printf("Send a association stop request (conn1), reson: %u\n", assoc_stop.in.reason);
163 status = wrepl_associate_stop(wrepl_socket1, &assoc_stop);
164 CHECK_STATUS(status, NT_STATUS_END_OF_FILE);
166 assoc_stop.in.assoc_ctx = associate2.out.assoc_ctx;
167 assoc_stop.in.reason = 0;
168 printf("Send a association stop request (conn2), reson: %u\n", assoc_stop.in.reason);
169 status = wrepl_associate_stop(wrepl_socket2, &assoc_stop);
170 CHECK_STATUS(status, NT_STATUS_OK);
173 printf("Close 2 wrepl connections\n");
174 talloc_free(wrepl_socket1);
175 talloc_free(wrepl_socket2);
180 test if we always get back the same assoc_ctx
182 static BOOL test_assoc_ctx2(TALLOC_CTX *mem_ctx, const char *address)
185 struct wrepl_socket *wrepl_socket;
186 struct wrepl_associate associate;
190 printf("Test if we always get back the same assoc_ctx\n");
192 wrepl_socket = wrepl_socket_init(mem_ctx, NULL);
194 printf("Setup wrepl connections\n");
195 status = wrepl_connect(wrepl_socket, NULL, address);
196 CHECK_STATUS(status, NT_STATUS_OK);
199 printf("Send 1st start association request\n");
200 status = wrepl_associate(wrepl_socket, &associate);
201 CHECK_STATUS(status, NT_STATUS_OK);
202 assoc_ctx1 = associate.out.assoc_ctx;
203 printf("1st association context: 0x%x\n", associate.out.assoc_ctx);
205 printf("Send 2nd start association request\n");
206 status = wrepl_associate(wrepl_socket, &associate);
207 CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1);
208 CHECK_STATUS(status, NT_STATUS_OK);
209 printf("2nd association context: 0x%x\n", associate.out.assoc_ctx);
211 printf("Send 3rd start association request\n");
212 status = wrepl_associate(wrepl_socket, &associate);
213 CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1);
214 CHECK_STATUS(status, NT_STATUS_OK);
215 printf("3rd association context: 0x%x\n", associate.out.assoc_ctx);
218 printf("Close wrepl connections\n");
219 talloc_free(wrepl_socket);
225 display a replication entry
227 static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_name *name)
231 printf("%s\n", nbt_name_string(mem_ctx, &name->name));
232 printf("\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n",
233 name->type, name->state, name->node, name->is_static, name->version_id);
234 printf("\tRAW_FLAGS: 0x%08X OWNER: %-15s\n",
235 name->raw_flags, name->owner);
236 for (i=0;i<name->num_addresses;i++) {
237 printf("\tADDR: %-15s OWNER: %-15s\n",
238 name->addresses[i].address, name->addresses[i].owner);
243 test a full replication dump from a WINS server
245 static BOOL test_wins_replication(TALLOC_CTX *mem_ctx, const char *address)
248 struct wrepl_socket *wrepl_socket;
251 struct wrepl_associate associate;
252 struct wrepl_pull_table pull_table;
253 struct wrepl_pull_names pull_names;
255 printf("Test one pull replication cycle\n");
257 wrepl_socket = wrepl_socket_init(mem_ctx, NULL);
259 printf("Setup wrepl connections\n");
260 status = wrepl_connect(wrepl_socket, NULL, address);
261 CHECK_STATUS(status, NT_STATUS_OK);
263 printf("Send a start association request\n");
265 status = wrepl_associate(wrepl_socket, &associate);
266 CHECK_STATUS(status, NT_STATUS_OK);
268 printf("association context: 0x%x\n", associate.out.assoc_ctx);
270 printf("Send a replication table query\n");
271 pull_table.in.assoc_ctx = associate.out.assoc_ctx;
273 status = wrepl_pull_table(wrepl_socket, mem_ctx, &pull_table);
274 if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) {
275 struct wrepl_packet packet;
276 struct wrepl_request *req;
279 packet.opcode = WREPL_OPCODE_BITS;
280 packet.assoc_ctx = associate.out.assoc_ctx;
281 packet.mess_type = WREPL_STOP_ASSOCIATION;
282 packet.message.stop.reason = 0;
284 req = wrepl_request_send(wrepl_socket, &packet);
287 printf("failed - We are not a valid pull partner for the server\n");
291 CHECK_STATUS(status, NT_STATUS_OK);
293 printf("Found %d replication partners\n", pull_table.out.num_partners);
295 for (i=0;i<pull_table.out.num_partners;i++) {
296 struct wrepl_wins_owner *partner = &pull_table.out.partners[i];
297 printf("%s max_version=%6llu min_version=%6llu type=%d\n",
299 partner->max_version,
300 partner->min_version,
303 pull_names.in.assoc_ctx = associate.out.assoc_ctx;
304 pull_names.in.partner = *partner;
306 status = wrepl_pull_names(wrepl_socket, mem_ctx, &pull_names);
307 CHECK_STATUS(status, NT_STATUS_OK);
309 printf("Received %d names\n", pull_names.out.num_names);
311 for (j=0;j<pull_names.out.num_names;j++) {
312 display_entry(mem_ctx, &pull_names.out.names[j]);
317 printf("Close wrepl connections\n");
318 talloc_free(wrepl_socket);
322 struct test_wrepl_conflict_conn {
324 struct wrepl_socket *pull;
327 #define TEST_OWNER_A_ADDRESS "127.65.65.1"
328 #define TEST_ADDRESS_A_PREFIX "127.0.65"
329 #define TEST_OWNER_B_ADDRESS "127.66.66.1"
330 #define TEST_ADDRESS_B_PREFIX "127.0.66"
331 #define TEST_OWNER_X_ADDRESS "127.88.88.1"
332 #define TEST_ADDRESS_X_PREFIX "127.0.88"
334 struct wrepl_wins_owner a, b, c, x;
338 struct nbt_name_socket *nbtsock;
339 struct nbt_name_socket *nbtsock2;
341 struct nbt_name_socket *nbtsock_srv;
342 struct nbt_name_socket *nbtsock_srv2;
344 uint32_t addresses_best_num;
345 struct wrepl_ip *addresses_best;
347 uint32_t addresses_best2_num;
348 struct wrepl_ip *addresses_best2;
350 uint32_t addresses_all_num;
351 struct wrepl_ip *addresses_all;
353 uint32_t addresses_mhomed_num;
354 struct wrepl_ip *addresses_mhomed;
357 static const struct wrepl_ip addresses_A_1[] = {
359 .owner = TEST_OWNER_A_ADDRESS,
360 .ip = TEST_ADDRESS_A_PREFIX".1"
363 static const struct wrepl_ip addresses_A_2[] = {
365 .owner = TEST_OWNER_A_ADDRESS,
366 .ip = TEST_ADDRESS_A_PREFIX".2"
369 static const struct wrepl_ip addresses_A_3_4[] = {
371 .owner = TEST_OWNER_A_ADDRESS,
372 .ip = TEST_ADDRESS_A_PREFIX".3"
375 .owner = TEST_OWNER_A_ADDRESS,
376 .ip = TEST_ADDRESS_A_PREFIX".4"
379 static const struct wrepl_ip addresses_A_3_4_X_3_4[] = {
381 .owner = TEST_OWNER_A_ADDRESS,
382 .ip = TEST_ADDRESS_A_PREFIX".3"
385 .owner = TEST_OWNER_A_ADDRESS,
386 .ip = TEST_ADDRESS_A_PREFIX".4"
389 .owner = TEST_OWNER_X_ADDRESS,
390 .ip = TEST_ADDRESS_X_PREFIX".3"
393 .owner = TEST_OWNER_X_ADDRESS,
394 .ip = TEST_ADDRESS_X_PREFIX".4"
397 static const struct wrepl_ip addresses_A_3_4_OWNER_B[] = {
399 .owner = TEST_OWNER_B_ADDRESS,
400 .ip = TEST_ADDRESS_A_PREFIX".3"
403 .owner = TEST_OWNER_B_ADDRESS,
404 .ip = TEST_ADDRESS_A_PREFIX".4"
407 static const struct wrepl_ip addresses_A_3_4_X_3_4_OWNER_B[] = {
409 .owner = TEST_OWNER_B_ADDRESS,
410 .ip = TEST_ADDRESS_A_PREFIX".3"
413 .owner = TEST_OWNER_B_ADDRESS,
414 .ip = TEST_ADDRESS_A_PREFIX".4"
417 .owner = TEST_OWNER_B_ADDRESS,
418 .ip = TEST_ADDRESS_X_PREFIX".3"
421 .owner = TEST_OWNER_B_ADDRESS,
422 .ip = TEST_ADDRESS_X_PREFIX".4"
426 static const struct wrepl_ip addresses_A_3_4_X_1_2[] = {
428 .owner = TEST_OWNER_A_ADDRESS,
429 .ip = TEST_ADDRESS_A_PREFIX".3"
432 .owner = TEST_OWNER_A_ADDRESS,
433 .ip = TEST_ADDRESS_A_PREFIX".4"
436 .owner = TEST_OWNER_X_ADDRESS,
437 .ip = TEST_ADDRESS_X_PREFIX".1"
440 .owner = TEST_OWNER_X_ADDRESS,
441 .ip = TEST_ADDRESS_X_PREFIX".2"
445 static const struct wrepl_ip addresses_B_1[] = {
447 .owner = TEST_OWNER_B_ADDRESS,
448 .ip = TEST_ADDRESS_B_PREFIX".1"
451 static const struct wrepl_ip addresses_B_2[] = {
453 .owner = TEST_OWNER_B_ADDRESS,
454 .ip = TEST_ADDRESS_B_PREFIX".2"
457 static const struct wrepl_ip addresses_B_3_4[] = {
459 .owner = TEST_OWNER_B_ADDRESS,
460 .ip = TEST_ADDRESS_B_PREFIX".3"
463 .owner = TEST_OWNER_B_ADDRESS,
464 .ip = TEST_ADDRESS_B_PREFIX".4"
467 static const struct wrepl_ip addresses_B_3_4_X_3_4[] = {
469 .owner = TEST_OWNER_B_ADDRESS,
470 .ip = TEST_ADDRESS_B_PREFIX".3"
473 .owner = TEST_OWNER_B_ADDRESS,
474 .ip = TEST_ADDRESS_B_PREFIX".4"
477 .owner = TEST_OWNER_X_ADDRESS,
478 .ip = TEST_ADDRESS_X_PREFIX".3"
481 .owner = TEST_OWNER_X_ADDRESS,
482 .ip = TEST_ADDRESS_X_PREFIX".4"
485 static const struct wrepl_ip addresses_B_3_4_X_1_2[] = {
487 .owner = TEST_OWNER_B_ADDRESS,
488 .ip = TEST_ADDRESS_B_PREFIX".3"
491 .owner = TEST_OWNER_B_ADDRESS,
492 .ip = TEST_ADDRESS_B_PREFIX".4"
495 .owner = TEST_OWNER_X_ADDRESS,
496 .ip = TEST_ADDRESS_X_PREFIX".1"
499 .owner = TEST_OWNER_X_ADDRESS,
500 .ip = TEST_ADDRESS_X_PREFIX".2"
504 static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem_ctx,
507 struct test_wrepl_conflict_conn *ctx;
508 struct wrepl_associate associate;
509 struct wrepl_pull_table pull_table;
513 ctx = talloc_zero(mem_ctx, struct test_wrepl_conflict_conn);
514 if (!ctx) return NULL;
516 ctx->address = address;
517 ctx->pull = wrepl_socket_init(ctx, NULL);
518 if (!ctx->pull) return NULL;
520 printf("Setup wrepl conflict pull connection\n");
521 status = wrepl_connect(ctx->pull, NULL, ctx->address);
522 if (!NT_STATUS_IS_OK(status)) return NULL;
524 status = wrepl_associate(ctx->pull, &associate);
525 if (!NT_STATUS_IS_OK(status)) return NULL;
527 ctx->pull_assoc = associate.out.assoc_ctx;
529 ctx->a.address = TEST_OWNER_A_ADDRESS;
530 ctx->a.max_version = 0;
531 ctx->a.min_version = 0;
534 ctx->b.address = TEST_OWNER_B_ADDRESS;
535 ctx->b.max_version = 0;
536 ctx->b.min_version = 0;
539 ctx->x.address = TEST_OWNER_X_ADDRESS;
540 ctx->x.max_version = 0;
541 ctx->x.min_version = 0;
544 ctx->c.address = address;
545 ctx->c.max_version = 0;
546 ctx->c.min_version = 0;
549 pull_table.in.assoc_ctx = ctx->pull_assoc;
550 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
551 if (!NT_STATUS_IS_OK(status)) return NULL;
553 for (i=0; i < pull_table.out.num_partners; i++) {
554 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
555 ctx->a.max_version = pull_table.out.partners[i].max_version;
556 ctx->a.min_version = pull_table.out.partners[i].min_version;
558 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
559 ctx->b.max_version = pull_table.out.partners[i].max_version;
560 ctx->b.min_version = pull_table.out.partners[i].min_version;
562 if (strcmp(TEST_OWNER_X_ADDRESS,pull_table.out.partners[i].address)==0) {
563 ctx->x.max_version = pull_table.out.partners[i].max_version;
564 ctx->x.min_version = pull_table.out.partners[i].min_version;
566 if (strcmp(address,pull_table.out.partners[i].address)==0) {
567 ctx->c.max_version = pull_table.out.partners[i].max_version;
568 ctx->c.min_version = pull_table.out.partners[i].min_version;
572 talloc_free(pull_table.out.partners);
574 ctx->myaddr = talloc_strdup(mem_ctx, iface_best_ip(address));
575 if (!ctx->myaddr) return NULL;
577 for (i = 0; i < iface_count(); i++) {
578 if (strcmp(ctx->myaddr, iface_n_ip(i)) == 0) continue;
579 ctx->myaddr2 = talloc_strdup(mem_ctx, iface_n_ip(i));
580 if (!ctx->myaddr2) return NULL;
584 ctx->nbtsock = nbt_name_socket_init(ctx, NULL);
585 if (!ctx->nbtsock) return NULL;
587 status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0, 0);
588 if (!NT_STATUS_IS_OK(status)) return NULL;
590 ctx->nbtsock_srv = nbt_name_socket_init(ctx, NULL);
591 if (!ctx->nbtsock_srv) return NULL;
593 status = socket_listen(ctx->nbtsock_srv->sock, ctx->myaddr, lp_nbt_port(), 0, 0);
594 if (!NT_STATUS_IS_OK(status)) {
595 talloc_free(ctx->nbtsock_srv);
596 ctx->nbtsock_srv = NULL;
599 if (ctx->myaddr2 && ctx->nbtsock_srv) {
600 ctx->nbtsock2 = nbt_name_socket_init(ctx, NULL);
601 if (!ctx->nbtsock2) return NULL;
603 status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0, 0);
604 if (!NT_STATUS_IS_OK(status)) return NULL;
606 ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx);
607 if (!ctx->nbtsock_srv2) return NULL;
609 status = socket_listen(ctx->nbtsock_srv2->sock, ctx->myaddr2, lp_nbt_port(), 0, 0);
610 if (!NT_STATUS_IS_OK(status)) {
611 talloc_free(ctx->nbtsock_srv2);
612 ctx->nbtsock_srv2 = NULL;
616 ctx->addresses_best_num = 1;
617 ctx->addresses_best = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best_num);
618 if (!ctx->addresses_best) return NULL;
619 ctx->addresses_best[0].owner = ctx->b.address;
620 ctx->addresses_best[0].ip = ctx->myaddr;
622 ctx->addresses_all_num = iface_count();
623 ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num);
624 if (!ctx->addresses_all) return NULL;
625 for (i=0; i < ctx->addresses_all_num; i++) {
626 ctx->addresses_all[i].owner = ctx->b.address;
627 ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(i));
628 if (!ctx->addresses_all[i].ip) return NULL;
631 if (ctx->nbtsock_srv2) {
632 ctx->addresses_best2_num = 1;
633 ctx->addresses_best2 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best2_num);
634 if (!ctx->addresses_best2) return NULL;
635 ctx->addresses_best2[0].owner = ctx->b.address;
636 ctx->addresses_best2[0].ip = ctx->myaddr2;
638 ctx->addresses_mhomed_num = 2;
639 ctx->addresses_mhomed = talloc_array(ctx, struct wrepl_ip, ctx->addresses_mhomed_num);
640 if (!ctx->addresses_mhomed) return NULL;
641 ctx->addresses_mhomed[0].owner = ctx->b.address;
642 ctx->addresses_mhomed[0].ip = ctx->myaddr;
643 ctx->addresses_mhomed[1].owner = ctx->b.address;
644 ctx->addresses_mhomed[1].ip = ctx->myaddr2;
650 static BOOL test_wrepl_update_one(struct test_wrepl_conflict_conn *ctx,
651 const struct wrepl_wins_owner *owner,
652 const struct wrepl_wins_name *name)
655 struct wrepl_socket *wrepl_socket;
656 struct wrepl_associate associate;
657 struct wrepl_packet update_packet, repl_send;
658 struct wrepl_table *update;
659 struct wrepl_wins_owner wrepl_wins_owners[1];
660 struct wrepl_packet *repl_recv;
661 struct wrepl_wins_owner *send_request;
662 struct wrepl_send_reply *send_reply;
663 struct wrepl_wins_name wrepl_wins_names[1];
667 wrepl_socket = wrepl_socket_init(ctx, NULL);
669 status = wrepl_connect(wrepl_socket, NULL, ctx->address);
670 CHECK_STATUS(status, NT_STATUS_OK);
672 status = wrepl_associate(wrepl_socket, &associate);
673 CHECK_STATUS(status, NT_STATUS_OK);
674 assoc_ctx = associate.out.assoc_ctx;
676 /* now send a WREPL_REPL_UPDATE message */
677 ZERO_STRUCT(update_packet);
678 update_packet.opcode = WREPL_OPCODE_BITS;
679 update_packet.assoc_ctx = assoc_ctx;
680 update_packet.mess_type = WREPL_REPLICATION;
681 update_packet.message.replication.command = WREPL_REPL_UPDATE;
682 update = &update_packet.message.replication.info.table;
684 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
685 update->partners = wrepl_wins_owners;
686 update->initiator = "0.0.0.0";
688 wrepl_wins_owners[0] = *owner;
690 status = wrepl_request(wrepl_socket, wrepl_socket,
691 &update_packet, &repl_recv);
692 CHECK_STATUS(status, NT_STATUS_OK);
693 CHECK_VALUE(repl_recv->mess_type, WREPL_REPLICATION);
694 CHECK_VALUE(repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
695 send_request = &repl_recv->message.replication.info.owner;
697 ZERO_STRUCT(repl_send);
698 repl_send.opcode = WREPL_OPCODE_BITS;
699 repl_send.assoc_ctx = assoc_ctx;
700 repl_send.mess_type = WREPL_REPLICATION;
701 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
702 send_reply = &repl_send.message.replication.info.reply;
704 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
705 send_reply->names = wrepl_wins_names;
707 wrepl_wins_names[0] = *name;
709 status = wrepl_request(wrepl_socket, wrepl_socket,
710 &repl_send, &repl_recv);
711 CHECK_STATUS(status, NT_STATUS_OK);
712 CHECK_VALUE(repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
713 CHECK_VALUE(repl_recv->message.stop.reason, 0);
716 talloc_free(wrepl_socket);
720 static BOOL test_wrepl_is_applied(struct test_wrepl_conflict_conn *ctx,
721 const struct wrepl_wins_owner *owner,
722 const struct wrepl_wins_name *name,
727 struct wrepl_pull_names pull_names;
728 struct wrepl_name *names;
730 pull_names.in.assoc_ctx = ctx->pull_assoc;
731 pull_names.in.partner = *owner;
732 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
734 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
735 CHECK_STATUS(status, NT_STATUS_OK);
736 CHECK_VALUE(pull_names.out.num_names, (expected?1:0));
738 names = pull_names.out.names;
741 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
745 CHECK_VALUE(names[0].name.type, name->name->type);
746 CHECK_VALUE_STRING(names[0].name.name, name->name->name);
747 CHECK_VALUE_STRING(names[0].name.scope, name->name->scope);
748 CHECK_VALUE(flags, name->flags);
749 CHECK_VALUE_UINT64(names[0].version_id, name->id);
752 CHECK_VALUE(names[0].num_addresses,
753 name->addresses.addresses.num_ips);
755 CHECK_VALUE(names[0].num_addresses, 1);
756 CHECK_VALUE_STRING(names[0].addresses[0].address,
761 talloc_free(pull_names.out.names);
765 static BOOL test_wrepl_mhomed_merged(struct test_wrepl_conflict_conn *ctx,
766 const struct wrepl_wins_owner *owner1,
767 uint32_t num_ips1, const struct wrepl_ip *ips1,
768 const struct wrepl_wins_owner *owner2,
769 uint32_t num_ips2, const struct wrepl_ip *ips2,
770 const struct wrepl_wins_name *name2)
774 struct wrepl_pull_names pull_names;
775 struct wrepl_name *names;
778 uint32_t num_ips = num_ips1 + num_ips2;
780 for (i = 0; i < num_ips2; i++) {
781 for (j = 0; j < num_ips1; j++) {
782 if (strcmp(ips2[i].ip,ips1[j].ip) == 0) {
789 pull_names.in.assoc_ctx = ctx->pull_assoc;
790 pull_names.in.partner = *owner2;
791 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
793 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
794 CHECK_STATUS(status, NT_STATUS_OK);
795 CHECK_VALUE(pull_names.out.num_names, 1);
797 names = pull_names.out.names;
799 flags = WREPL_NAME_FLAGS(names[0].type,
803 CHECK_VALUE(names[0].name.type, name2->name->type);
804 CHECK_VALUE_STRING(names[0].name.name, name2->name->name);
805 CHECK_VALUE_STRING(names[0].name.scope, name2->name->scope);
806 CHECK_VALUE(flags, name2->flags | WREPL_TYPE_MHOMED);
807 CHECK_VALUE_UINT64(names[0].version_id, name2->id);
809 CHECK_VALUE(names[0].num_addresses, num_ips);
811 for (i = 0; i < names[0].num_addresses; i++) {
812 const char *addr = names[0].addresses[i].address;
813 const char *owner = names[0].addresses[i].owner;
816 for (j = 0; j < num_ips2; j++) {
817 if (strcmp(addr, ips2[j].ip) == 0) {
819 CHECK_VALUE_STRING(owner, owner2->address);
826 for (j = 0; j < num_ips1; j++) {
827 if (strcmp(addr, ips1[j].ip) == 0) {
829 CHECK_VALUE_STRING(owner, owner1->address);
836 CHECK_VALUE_STRING(addr, "not found in address list");
839 talloc_free(pull_names.out.names);
843 static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx,
844 struct wrepl_wins_owner *merge_owner,
845 struct wrepl_wins_owner *owner1,
846 uint32_t num_ips1, const struct wrepl_ip *ips1,
847 struct wrepl_wins_owner *owner2,
848 uint32_t num_ips2, const struct wrepl_ip *ips2,
849 const struct wrepl_wins_name *name2)
853 struct wrepl_pull_names pull_names;
854 struct wrepl_name *names;
855 struct wrepl_name *name = NULL;
858 uint32_t num_ips = num_ips1 + num_ips2;
861 merge_owner = &ctx->c;
864 for (i = 0; i < num_ips1; i++) {
865 if (owner1 != &ctx->c && strcmp(ips1[i].owner,owner2->address) == 0) {
869 for (j = 0; j < num_ips2; j++) {
870 if (strcmp(ips1[i].ip,ips2[j].ip) == 0) {
878 pull_names.in.assoc_ctx = ctx->pull_assoc;
879 pull_names.in.partner = *merge_owner;
880 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
881 pull_names.in.partner.max_version = 0;
883 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
884 CHECK_STATUS(status, NT_STATUS_OK);
886 names = pull_names.out.names;
888 for (i = 0; i < pull_names.out.num_names; i++) {
889 if (names[i].name.type != name2->name->type) continue;
890 if (!names[i].name.name) continue;
891 if (strcmp(names[i].name.name, name2->name->name) != 0) continue;
892 if (names[i].name.scope) continue;
897 if (pull_names.out.num_names > 0) {
898 merge_owner->max_version = names[pull_names.out.num_names-1].version_id;
902 printf("%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name));
906 flags = WREPL_NAME_FLAGS(name->type,
910 CHECK_VALUE(name->name.type, name2->name->type);
911 CHECK_VALUE_STRING(name->name.name, name2->name->name);
912 CHECK_VALUE_STRING(name->name.scope, name2->name->scope);
913 CHECK_VALUE(flags, name2->flags);
915 CHECK_VALUE(name->num_addresses, num_ips);
917 for (i = 0; i < name->num_addresses; i++) {
918 const char *addr = name->addresses[i].address;
919 const char *owner = name->addresses[i].owner;
922 for (j = 0; j < num_ips2; j++) {
923 if (strcmp(addr, ips2[j].ip) == 0) {
925 CHECK_VALUE_STRING(owner, ips2[j].owner);
932 for (j = 0; j < num_ips1; j++) {
933 if (strcmp(addr, ips1[j].ip) == 0) {
935 if (owner1 == &ctx->c) {
936 CHECK_VALUE_STRING(owner, owner1->address);
938 CHECK_VALUE_STRING(owner, ips1[j].owner);
946 CHECK_VALUE_STRING(addr, "not found in address list");
949 talloc_free(pull_names.out.names);
953 static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx)
956 struct nbt_name name;
957 struct wrepl_wins_name wins_name1;
958 struct wrepl_wins_name wins_name2;
959 struct wrepl_wins_name *wins_name_tmp;
960 struct wrepl_wins_name *wins_name_last;
961 struct wrepl_wins_name *wins_name_cur;
963 uint8_t types[] = { 0x00, 0x1C };
965 enum wrepl_name_type type;
966 enum wrepl_name_state state;
967 enum wrepl_name_node node;
970 const struct wrepl_ip *ips;
973 .type = WREPL_TYPE_GROUP,
974 .state = WREPL_STATE_ACTIVE,
975 .node = WREPL_NODE_B,
977 .num_ips = ARRAY_SIZE(addresses_A_1),
978 .ips = addresses_A_1,
980 .type = WREPL_TYPE_UNIQUE,
981 .state = WREPL_STATE_ACTIVE,
982 .node = WREPL_NODE_B,
984 .num_ips = ARRAY_SIZE(addresses_A_1),
985 .ips = addresses_A_1,
987 .type = WREPL_TYPE_UNIQUE,
988 .state = WREPL_STATE_ACTIVE,
989 .node = WREPL_NODE_B,
991 .num_ips = ARRAY_SIZE(addresses_A_2),
992 .ips = addresses_A_2,
994 .type = WREPL_TYPE_UNIQUE,
995 .state = WREPL_STATE_ACTIVE,
996 .node = WREPL_NODE_B,
998 .num_ips = ARRAY_SIZE(addresses_A_1),
999 .ips = addresses_A_1,
1001 .type = WREPL_TYPE_UNIQUE,
1002 .state = WREPL_STATE_ACTIVE,
1003 .node = WREPL_NODE_B,
1005 .num_ips = ARRAY_SIZE(addresses_A_2),
1006 .ips = addresses_A_2,
1008 .type = WREPL_TYPE_SGROUP,
1009 .state = WREPL_STATE_TOMBSTONE,
1010 .node = WREPL_NODE_B,
1012 .num_ips = ARRAY_SIZE(addresses_A_2),
1013 .ips = addresses_A_2,
1015 .type = WREPL_TYPE_MHOMED,
1016 .state = WREPL_STATE_TOMBSTONE,
1017 .node = WREPL_NODE_B,
1019 .num_ips = ARRAY_SIZE(addresses_A_1),
1020 .ips = addresses_A_1,
1022 .type = WREPL_TYPE_MHOMED,
1023 .state = WREPL_STATE_RELEASED,
1024 .node = WREPL_NODE_B,
1026 .num_ips = ARRAY_SIZE(addresses_A_2),
1027 .ips = addresses_A_2,
1029 .type = WREPL_TYPE_SGROUP,
1030 .state = WREPL_STATE_ACTIVE,
1031 .node = WREPL_NODE_B,
1033 .num_ips = ARRAY_SIZE(addresses_A_1),
1034 .ips = addresses_A_1,
1036 .type = WREPL_TYPE_SGROUP,
1037 .state = WREPL_STATE_ACTIVE,
1038 .node = WREPL_NODE_B,
1040 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1041 .ips = addresses_A_3_4,
1043 .type = WREPL_TYPE_SGROUP,
1044 .state = WREPL_STATE_TOMBSTONE,
1045 .node = WREPL_NODE_B,
1047 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1048 .ips = addresses_B_3_4,
1050 /* the last one should always be a unique,tomstone record! */
1051 .type = WREPL_TYPE_UNIQUE,
1052 .state = WREPL_STATE_TOMBSTONE,
1053 .node = WREPL_NODE_B,
1055 .num_ips = ARRAY_SIZE(addresses_A_1),
1056 .ips = addresses_A_1,
1060 if (!ctx) return False;
1062 name.name = "_SAME_OWNER_A";
1066 wins_name_tmp = NULL;
1067 wins_name_last = &wins_name2;
1068 wins_name_cur = &wins_name1;
1070 for (j=0; ret && j < ARRAY_SIZE(types); j++) {
1071 name.type = types[j];
1072 printf("Test Replica Conflicts with same owner[%s] for %s\n",
1073 nbt_name_string(ctx, &name), ctx->a.address);
1075 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
1076 wins_name_tmp = wins_name_last;
1077 wins_name_last = wins_name_cur;
1078 wins_name_cur = wins_name_tmp;
1081 printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
1082 wrepl_name_type_string(records[i-1].type),
1083 wrepl_name_state_string(records[i-1].state),
1084 (records[i-1].is_static?",static":""),
1085 wrepl_name_type_string(records[i].type),
1086 wrepl_name_state_string(records[i].state),
1087 (records[i].is_static?",static":""),
1088 (records[i-1].ips==records[i].ips?"same":"different"),
1092 wins_name_cur->name = &name;
1093 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
1096 records[i].is_static);
1097 wins_name_cur->id = ++ctx->a.max_version;
1098 if (wins_name_cur->flags & 2) {
1099 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
1100 wins_name_cur->addresses.addresses.ips = discard_const(records[i].ips);
1102 wins_name_cur->addresses.ip = records[i].ips[0].ip;
1104 wins_name_cur->unknown = "255.255.255.255";
1106 ret &= test_wrepl_update_one(ctx, &ctx->a,wins_name_cur);
1107 if (records[i].state == WREPL_STATE_RELEASED) {
1108 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_last, False);
1109 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, False);
1111 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, True);
1114 /* the first one is a cleanup run */
1115 if (!ret && i == 0) ret = True;
1118 printf("conflict handled wrong or record[%u]: %s\n", i, __location__);
1126 static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx)
1129 struct wrepl_wins_name wins_name1;
1130 struct wrepl_wins_name wins_name2;
1131 struct wrepl_wins_name *wins_name_r1;
1132 struct wrepl_wins_name *wins_name_r2;
1135 const char *line; /* just better debugging */
1136 struct nbt_name name;
1137 const char *comment;
1138 BOOL extra; /* not the worst case, this is an extra test */
1141 struct wrepl_wins_owner *owner;
1142 enum wrepl_name_type type;
1143 enum wrepl_name_state state;
1144 enum wrepl_name_node node;
1147 const struct wrepl_ip *ips;
1148 BOOL apply_expected;
1150 struct wrepl_wins_owner *merge_owner;
1151 BOOL sgroup_cleanup;
1155 * NOTE: the first record and the last applied one
1156 * needs to be from the same owner,
1157 * to not conflict in the next smbtorture run!!!
1160 .line = __location__,
1161 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1165 .type = WREPL_TYPE_UNIQUE,
1166 .state = WREPL_STATE_TOMBSTONE,
1167 .node = WREPL_NODE_B,
1169 .num_ips = ARRAY_SIZE(addresses_B_1),
1170 .ips = addresses_B_1,
1171 .apply_expected = True /* ignored */
1175 .type = WREPL_TYPE_UNIQUE,
1176 .state = WREPL_STATE_TOMBSTONE,
1177 .node = WREPL_NODE_B,
1179 .num_ips = ARRAY_SIZE(addresses_A_1),
1180 .ips = addresses_A_1,
1181 .apply_expected = True /* ignored */
1186 * unique vs unique section
1189 * unique,active vs. unique,active
1190 * => should be replaced
1193 .line = __location__,
1194 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1197 .type = WREPL_TYPE_UNIQUE,
1198 .state = WREPL_STATE_ACTIVE,
1199 .node = WREPL_NODE_B,
1201 .num_ips = ARRAY_SIZE(addresses_A_1),
1202 .ips = addresses_A_1,
1203 .apply_expected = True
1207 .type = WREPL_TYPE_UNIQUE,
1208 .state = WREPL_STATE_ACTIVE,
1209 .node = WREPL_NODE_B,
1211 .num_ips = ARRAY_SIZE(addresses_B_1),
1212 .ips = addresses_B_1,
1213 .apply_expected = True
1218 * unique,active vs. unique,tombstone
1219 * => should NOT be replaced
1222 .line = __location__,
1223 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1226 .type = WREPL_TYPE_UNIQUE,
1227 .state = WREPL_STATE_ACTIVE,
1228 .node = WREPL_NODE_B,
1230 .num_ips = ARRAY_SIZE(addresses_B_1),
1231 .ips = addresses_B_1,
1232 .apply_expected = True
1236 .type = WREPL_TYPE_UNIQUE,
1237 .state = WREPL_STATE_TOMBSTONE,
1238 .node = WREPL_NODE_B,
1240 .num_ips = ARRAY_SIZE(addresses_B_1),
1241 .ips = addresses_B_1,
1242 .apply_expected = False
1247 * unique,released vs. unique,active
1248 * => should be replaced
1251 .line = __location__,
1252 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1255 .type = WREPL_TYPE_UNIQUE,
1256 .state = WREPL_STATE_RELEASED,
1257 .node = WREPL_NODE_B,
1259 .num_ips = ARRAY_SIZE(addresses_B_1),
1260 .ips = addresses_B_1,
1261 .apply_expected = False
1265 .type = WREPL_TYPE_UNIQUE,
1266 .state = WREPL_STATE_ACTIVE,
1267 .node = WREPL_NODE_B,
1269 .num_ips = ARRAY_SIZE(addresses_A_1),
1270 .ips = addresses_A_1,
1271 .apply_expected = True
1276 * unique,released vs. unique,tombstone
1277 * => should be replaced
1280 .line = __location__,
1281 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1284 .type = WREPL_TYPE_UNIQUE,
1285 .state = WREPL_STATE_RELEASED,
1286 .node = WREPL_NODE_B,
1288 .num_ips = ARRAY_SIZE(addresses_A_1),
1289 .ips = addresses_A_1,
1290 .apply_expected = False
1294 .type = WREPL_TYPE_UNIQUE,
1295 .state = WREPL_STATE_TOMBSTONE,
1296 .node = WREPL_NODE_B,
1298 .num_ips = ARRAY_SIZE(addresses_B_1),
1299 .ips = addresses_B_1,
1300 .apply_expected = True
1305 * unique,tombstone vs. unique,active
1306 * => should be replaced
1309 .line = __location__,
1310 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1313 .type = WREPL_TYPE_UNIQUE,
1314 .state = WREPL_STATE_TOMBSTONE,
1315 .node = WREPL_NODE_B,
1317 .num_ips = ARRAY_SIZE(addresses_B_1),
1318 .ips = addresses_B_1,
1319 .apply_expected = True
1323 .type = WREPL_TYPE_UNIQUE,
1324 .state = WREPL_STATE_ACTIVE,
1325 .node = WREPL_NODE_B,
1327 .num_ips = ARRAY_SIZE(addresses_A_1),
1328 .ips = addresses_A_1,
1329 .apply_expected = True
1334 * unique,tombstone vs. unique,tombstone
1335 * => should be replaced
1338 .line = __location__,
1339 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1342 .type = WREPL_TYPE_UNIQUE,
1343 .state = WREPL_STATE_TOMBSTONE,
1344 .node = WREPL_NODE_B,
1346 .num_ips = ARRAY_SIZE(addresses_A_1),
1347 .ips = addresses_A_1,
1348 .apply_expected = True
1352 .type = WREPL_TYPE_UNIQUE,
1353 .state = WREPL_STATE_TOMBSTONE,
1354 .node = WREPL_NODE_B,
1356 .num_ips = ARRAY_SIZE(addresses_B_1),
1357 .ips = addresses_B_1,
1358 .apply_expected = True
1364 * unique vs normal groups section,
1367 * unique,active vs. group,active
1368 * => should be replaced
1371 .line = __location__,
1372 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1375 .type = WREPL_TYPE_UNIQUE,
1376 .state = WREPL_STATE_ACTIVE,
1377 .node = WREPL_NODE_B,
1379 .num_ips = ARRAY_SIZE(addresses_B_1),
1380 .ips = addresses_B_1,
1381 .apply_expected = True
1385 .type = WREPL_TYPE_GROUP,
1386 .state = WREPL_STATE_ACTIVE,
1387 .node = WREPL_NODE_B,
1389 .num_ips = ARRAY_SIZE(addresses_A_1),
1390 .ips = addresses_A_1,
1391 .apply_expected = True
1396 * unique,active vs. group,tombstone
1397 * => should NOT be replaced
1400 .line = __location__,
1401 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1404 .type = WREPL_TYPE_UNIQUE,
1405 .state = WREPL_STATE_ACTIVE,
1406 .node = WREPL_NODE_B,
1408 .num_ips = ARRAY_SIZE(addresses_A_1),
1409 .ips = addresses_A_1,
1410 .apply_expected = True
1414 .type = WREPL_TYPE_GROUP,
1415 .state = WREPL_STATE_TOMBSTONE,
1416 .node = WREPL_NODE_B,
1418 .num_ips = ARRAY_SIZE(addresses_A_1),
1419 .ips = addresses_A_1,
1420 .apply_expected = False
1425 * unique,released vs. group,active
1426 * => should be replaced
1429 .line = __location__,
1430 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1433 .type = WREPL_TYPE_UNIQUE,
1434 .state = WREPL_STATE_RELEASED,
1435 .node = WREPL_NODE_B,
1437 .num_ips = ARRAY_SIZE(addresses_A_1),
1438 .ips = addresses_A_1,
1439 .apply_expected = False
1443 .type = WREPL_TYPE_GROUP,
1444 .state = WREPL_STATE_ACTIVE,
1445 .node = WREPL_NODE_B,
1447 .num_ips = ARRAY_SIZE(addresses_B_1),
1448 .ips = addresses_B_1,
1449 .apply_expected = True
1454 * unique,released vs. group,tombstone
1455 * => should be replaced
1458 .line = __location__,
1459 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1462 .type = WREPL_TYPE_UNIQUE,
1463 .state = WREPL_STATE_RELEASED,
1464 .node = WREPL_NODE_B,
1466 .num_ips = ARRAY_SIZE(addresses_B_1),
1467 .ips = addresses_B_1,
1468 .apply_expected = False
1472 .type = WREPL_TYPE_GROUP,
1473 .state = WREPL_STATE_TOMBSTONE,
1474 .node = WREPL_NODE_B,
1476 .num_ips = ARRAY_SIZE(addresses_A_1),
1477 .ips = addresses_A_1,
1478 .apply_expected = True
1483 * unique,tombstone vs. group,active
1484 * => should be replaced
1487 .line = __location__,
1488 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1491 .type = WREPL_TYPE_UNIQUE,
1492 .state = WREPL_STATE_TOMBSTONE,
1493 .node = WREPL_NODE_B,
1495 .num_ips = ARRAY_SIZE(addresses_A_1),
1496 .ips = addresses_A_1,
1497 .apply_expected = True
1501 .type = WREPL_TYPE_GROUP,
1502 .state = WREPL_STATE_ACTIVE,
1503 .node = WREPL_NODE_B,
1505 .num_ips = ARRAY_SIZE(addresses_B_1),
1506 .ips = addresses_B_1,
1507 .apply_expected = True
1512 * unique,tombstone vs. group,tombstone
1513 * => should be replaced
1516 .line = __location__,
1517 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1520 .type = WREPL_TYPE_UNIQUE,
1521 .state = WREPL_STATE_TOMBSTONE,
1522 .node = WREPL_NODE_B,
1524 .num_ips = ARRAY_SIZE(addresses_B_1),
1525 .ips = addresses_B_1,
1526 .apply_expected = True
1530 .type = WREPL_TYPE_GROUP,
1531 .state = WREPL_STATE_TOMBSTONE,
1532 .node = WREPL_NODE_B,
1534 .num_ips = ARRAY_SIZE(addresses_A_1),
1535 .ips = addresses_A_1,
1536 .apply_expected = True
1541 * unique vs special groups section,
1544 * unique,active vs. sgroup,active
1545 * => should NOT be replaced
1548 .line = __location__,
1549 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1552 .type = WREPL_TYPE_UNIQUE,
1553 .state = WREPL_STATE_ACTIVE,
1554 .node = WREPL_NODE_B,
1556 .num_ips = ARRAY_SIZE(addresses_A_1),
1557 .ips = addresses_A_1,
1558 .apply_expected = True
1562 .type = WREPL_TYPE_SGROUP,
1563 .state = WREPL_STATE_ACTIVE,
1564 .node = WREPL_NODE_B,
1566 .num_ips = ARRAY_SIZE(addresses_A_1),
1567 .ips = addresses_A_1,
1568 .apply_expected = False
1573 * unique,active vs. sgroup,tombstone
1574 * => should NOT be replaced
1577 .line = __location__,
1578 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1581 .type = WREPL_TYPE_UNIQUE,
1582 .state = WREPL_STATE_ACTIVE,
1583 .node = WREPL_NODE_B,
1585 .num_ips = ARRAY_SIZE(addresses_A_1),
1586 .ips = addresses_A_1,
1587 .apply_expected = True
1591 .type = WREPL_TYPE_SGROUP,
1592 .state = WREPL_STATE_TOMBSTONE,
1593 .node = WREPL_NODE_B,
1595 .num_ips = ARRAY_SIZE(addresses_A_1),
1596 .ips = addresses_A_1,
1597 .apply_expected = False
1602 * unique,released vs. sgroup,active
1603 * => should be replaced
1606 .line = __location__,
1607 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1610 .type = WREPL_TYPE_UNIQUE,
1611 .state = WREPL_STATE_RELEASED,
1612 .node = WREPL_NODE_B,
1614 .num_ips = ARRAY_SIZE(addresses_A_1),
1615 .ips = addresses_A_1,
1616 .apply_expected = False
1620 .type = WREPL_TYPE_SGROUP,
1621 .state = WREPL_STATE_ACTIVE,
1622 .node = WREPL_NODE_B,
1624 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1625 .ips = addresses_B_3_4,
1626 .apply_expected = True
1631 * unique,released vs. sgroup,tombstone
1632 * => should be replaced
1635 .line = __location__,
1636 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1639 .type = WREPL_TYPE_UNIQUE,
1640 .state = WREPL_STATE_RELEASED,
1641 .node = WREPL_NODE_B,
1643 .num_ips = ARRAY_SIZE(addresses_B_1),
1644 .ips = addresses_B_1,
1645 .apply_expected = False
1649 .type = WREPL_TYPE_SGROUP,
1650 .state = WREPL_STATE_TOMBSTONE,
1651 .node = WREPL_NODE_B,
1653 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1654 .ips = addresses_A_3_4,
1655 .apply_expected = True
1660 * unique,tombstone vs. sgroup,active
1661 * => should be replaced
1664 .line = __location__,
1665 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1668 .type = WREPL_TYPE_UNIQUE,
1669 .state = WREPL_STATE_TOMBSTONE,
1670 .node = WREPL_NODE_B,
1672 .num_ips = ARRAY_SIZE(addresses_A_1),
1673 .ips = addresses_A_1,
1674 .apply_expected = True
1678 .type = WREPL_TYPE_SGROUP,
1679 .state = WREPL_STATE_ACTIVE,
1680 .node = WREPL_NODE_B,
1682 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1683 .ips = addresses_B_3_4,
1684 .apply_expected = True
1689 * unique,tombstone vs. sgroup,tombstone
1690 * => should be replaced
1693 .line = __location__,
1694 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1697 .type = WREPL_TYPE_UNIQUE,
1698 .state = WREPL_STATE_TOMBSTONE,
1699 .node = WREPL_NODE_B,
1701 .num_ips = ARRAY_SIZE(addresses_B_1),
1702 .ips = addresses_B_1,
1703 .apply_expected = True
1707 .type = WREPL_TYPE_SGROUP,
1708 .state = WREPL_STATE_TOMBSTONE,
1709 .node = WREPL_NODE_B,
1711 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1712 .ips = addresses_A_3_4,
1713 .apply_expected = True
1718 * unique vs multi homed section,
1721 * unique,active vs. mhomed,active
1722 * => should be replaced
1725 .line = __location__,
1726 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1729 .type = WREPL_TYPE_UNIQUE,
1730 .state = WREPL_STATE_ACTIVE,
1731 .node = WREPL_NODE_B,
1733 .num_ips = ARRAY_SIZE(addresses_A_1),
1734 .ips = addresses_A_1,
1735 .apply_expected = True
1739 .type = WREPL_TYPE_MHOMED,
1740 .state = WREPL_STATE_ACTIVE,
1741 .node = WREPL_NODE_B,
1743 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1744 .ips = addresses_B_3_4,
1745 .apply_expected = True
1750 * unique,active vs. mhomed,tombstone
1751 * => should NOT be replaced
1754 .line = __location__,
1755 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1758 .type = WREPL_TYPE_UNIQUE,
1759 .state = WREPL_STATE_ACTIVE,
1760 .node = WREPL_NODE_B,
1762 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1763 .ips = addresses_B_3_4,
1764 .apply_expected = True
1768 .type = WREPL_TYPE_MHOMED,
1769 .state = WREPL_STATE_TOMBSTONE,
1770 .node = WREPL_NODE_B,
1772 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1773 .ips = addresses_B_3_4,
1774 .apply_expected = False
1779 * unique,released vs. mhomed,active
1780 * => should be replaced
1783 .line = __location__,
1784 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1787 .type = WREPL_TYPE_UNIQUE,
1788 .state = WREPL_STATE_RELEASED,
1789 .node = WREPL_NODE_B,
1791 .num_ips = ARRAY_SIZE(addresses_B_1),
1792 .ips = addresses_B_1,
1793 .apply_expected = False
1797 .type = WREPL_TYPE_MHOMED,
1798 .state = WREPL_STATE_ACTIVE,
1799 .node = WREPL_NODE_B,
1801 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1802 .ips = addresses_A_3_4,
1803 .apply_expected = True
1808 * unique,released vs. mhomed,tombstone
1809 * => should be replaced
1812 .line = __location__,
1813 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1816 .type = WREPL_TYPE_UNIQUE,
1817 .state = WREPL_STATE_RELEASED,
1818 .node = WREPL_NODE_B,
1820 .num_ips = ARRAY_SIZE(addresses_A_1),
1821 .ips = addresses_A_1,
1822 .apply_expected = False
1826 .type = WREPL_TYPE_MHOMED,
1827 .state = WREPL_STATE_TOMBSTONE,
1828 .node = WREPL_NODE_B,
1830 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1831 .ips = addresses_B_3_4,
1832 .apply_expected = True
1837 * unique,tombstone vs. mhomed,active
1838 * => should be replaced
1841 .line = __location__,
1842 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1845 .type = WREPL_TYPE_UNIQUE,
1846 .state = WREPL_STATE_TOMBSTONE,
1847 .node = WREPL_NODE_B,
1849 .num_ips = ARRAY_SIZE(addresses_B_1),
1850 .ips = addresses_B_1,
1851 .apply_expected = True
1855 .type = WREPL_TYPE_MHOMED,
1856 .state = WREPL_STATE_ACTIVE,
1857 .node = WREPL_NODE_B,
1859 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1860 .ips = addresses_A_3_4,
1861 .apply_expected = True
1866 * unique,tombstone vs. mhomed,tombstone
1867 * => should be replaced
1870 .line = __location__,
1871 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1874 .type = WREPL_TYPE_UNIQUE,
1875 .state = WREPL_STATE_TOMBSTONE,
1876 .node = WREPL_NODE_B,
1878 .num_ips = ARRAY_SIZE(addresses_A_1),
1879 .ips = addresses_A_1,
1880 .apply_expected = True
1884 .type = WREPL_TYPE_MHOMED,
1885 .state = WREPL_STATE_TOMBSTONE,
1886 .node = WREPL_NODE_B,
1888 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1889 .ips = addresses_B_3_4,
1890 .apply_expected = True
1895 * normal groups vs unique section,
1898 * group,active vs. unique,active
1899 * => should NOT be replaced
1902 .line = __location__,
1903 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1906 .type = WREPL_TYPE_GROUP,
1907 .state = WREPL_STATE_ACTIVE,
1908 .node = WREPL_NODE_B,
1910 .num_ips = ARRAY_SIZE(addresses_A_1),
1911 .ips = addresses_A_1,
1912 .apply_expected = True
1916 .type = WREPL_TYPE_UNIQUE,
1917 .state = WREPL_STATE_ACTIVE,
1918 .node = WREPL_NODE_B,
1920 .num_ips = ARRAY_SIZE(addresses_A_1),
1921 .ips = addresses_A_1,
1922 .apply_expected = False
1927 * group,active vs. unique,tombstone
1928 * => should NOT be replaced
1931 .line = __location__,
1932 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1935 .type = WREPL_TYPE_GROUP,
1936 .state = WREPL_STATE_ACTIVE,
1937 .node = WREPL_NODE_B,
1939 .num_ips = ARRAY_SIZE(addresses_A_1),
1940 .ips = addresses_A_1,
1941 .apply_expected = True
1945 .type = WREPL_TYPE_UNIQUE,
1946 .state = WREPL_STATE_TOMBSTONE,
1947 .node = WREPL_NODE_B,
1949 .num_ips = ARRAY_SIZE(addresses_A_1),
1950 .ips = addresses_A_1,
1951 .apply_expected = False
1956 * group,released vs. unique,active
1957 * => should NOT be replaced
1960 .line = __location__,
1961 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1964 .type = WREPL_TYPE_GROUP,
1965 .state = WREPL_STATE_RELEASED,
1966 .node = WREPL_NODE_B,
1968 .num_ips = ARRAY_SIZE(addresses_A_1),
1969 .ips = addresses_A_1,
1970 .apply_expected = False
1974 .type = WREPL_TYPE_UNIQUE,
1975 .state = WREPL_STATE_ACTIVE,
1976 .node = WREPL_NODE_B,
1978 .num_ips = ARRAY_SIZE(addresses_A_1),
1979 .ips = addresses_A_1,
1980 .apply_expected = False
1985 * group,released vs. unique,tombstone
1986 * => should NOT be replaced
1989 .line = __location__,
1990 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1993 .type = WREPL_TYPE_GROUP,
1994 .state = WREPL_STATE_RELEASED,
1995 .node = WREPL_NODE_B,
1997 .num_ips = ARRAY_SIZE(addresses_A_1),
1998 .ips = addresses_A_1,
1999 .apply_expected = False
2003 .type = WREPL_TYPE_UNIQUE,
2004 .state = WREPL_STATE_TOMBSTONE,
2005 .node = WREPL_NODE_B,
2007 .num_ips = ARRAY_SIZE(addresses_A_1),
2008 .ips = addresses_A_1,
2009 .apply_expected = False
2014 * group,tombstone vs. unique,active
2015 * => should NOT be replaced
2018 .line = __location__,
2019 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2022 .type = WREPL_TYPE_GROUP,
2023 .state = WREPL_STATE_TOMBSTONE,
2024 .node = WREPL_NODE_B,
2026 .num_ips = ARRAY_SIZE(addresses_A_1),
2027 .ips = addresses_A_1,
2028 .apply_expected = True
2032 .type = WREPL_TYPE_UNIQUE,
2033 .state = WREPL_STATE_ACTIVE,
2034 .node = WREPL_NODE_B,
2036 .num_ips = ARRAY_SIZE(addresses_A_1),
2037 .ips = addresses_A_1,
2038 .apply_expected = False
2043 * group,tombstone vs. unique,tombstone
2044 * => should NOT be replaced
2047 .line = __location__,
2048 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2051 .type = WREPL_TYPE_GROUP,
2052 .state = WREPL_STATE_TOMBSTONE,
2053 .node = WREPL_NODE_B,
2055 .num_ips = ARRAY_SIZE(addresses_A_1),
2056 .ips = addresses_A_1,
2057 .apply_expected = True
2061 .type = WREPL_TYPE_UNIQUE,
2062 .state = WREPL_STATE_TOMBSTONE,
2063 .node = WREPL_NODE_B,
2065 .num_ips = ARRAY_SIZE(addresses_A_1),
2066 .ips = addresses_A_1,
2067 .apply_expected = False
2072 * normal groups vs normal groups section,
2075 * group,active vs. group,active
2076 * => should NOT be replaced
2079 .line = __location__,
2080 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2083 .type = WREPL_TYPE_GROUP,
2084 .state = WREPL_STATE_ACTIVE,
2085 .node = WREPL_NODE_B,
2087 .num_ips = ARRAY_SIZE(addresses_A_1),
2088 .ips = addresses_A_1,
2089 .apply_expected = True
2093 .type = WREPL_TYPE_GROUP,
2094 .state = WREPL_STATE_ACTIVE,
2095 .node = WREPL_NODE_B,
2097 .num_ips = ARRAY_SIZE(addresses_A_1),
2098 .ips = addresses_A_1,
2099 .apply_expected = False
2104 * group,active vs. group,tombstone
2105 * => should NOT be replaced
2108 .line = __location__,
2109 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2112 .type = WREPL_TYPE_GROUP,
2113 .state = WREPL_STATE_ACTIVE,
2114 .node = WREPL_NODE_B,
2116 .num_ips = ARRAY_SIZE(addresses_A_1),
2117 .ips = addresses_A_1,
2118 .apply_expected = True
2122 .type = WREPL_TYPE_GROUP,
2123 .state = WREPL_STATE_TOMBSTONE,
2124 .node = WREPL_NODE_B,
2126 .num_ips = ARRAY_SIZE(addresses_A_1),
2127 .ips = addresses_A_1,
2128 .apply_expected = False
2133 * group,released vs. group,active
2134 * => should be replaced
2137 .line = __location__,
2138 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2141 .type = WREPL_TYPE_GROUP,
2142 .state = WREPL_STATE_RELEASED,
2143 .node = WREPL_NODE_B,
2145 .num_ips = ARRAY_SIZE(addresses_A_1),
2146 .ips = addresses_A_1,
2147 .apply_expected = False
2151 .type = WREPL_TYPE_GROUP,
2152 .state = WREPL_STATE_ACTIVE,
2153 .node = WREPL_NODE_B,
2155 .num_ips = ARRAY_SIZE(addresses_B_1),
2156 .ips = addresses_B_1,
2157 .apply_expected = True
2162 * group,released vs. group,tombstone
2163 * => should be replaced
2166 .line = __location__,
2167 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2170 .type = WREPL_TYPE_GROUP,
2171 .state = WREPL_STATE_RELEASED,
2172 .node = WREPL_NODE_B,
2174 .num_ips = ARRAY_SIZE(addresses_A_1),
2175 .ips = addresses_A_1,
2176 .apply_expected = False
2180 .type = WREPL_TYPE_GROUP,
2181 .state = WREPL_STATE_TOMBSTONE,
2182 .node = WREPL_NODE_B,
2184 .num_ips = ARRAY_SIZE(addresses_B_1),
2185 .ips = addresses_B_1,
2186 .apply_expected = True
2191 * group,tombstone vs. group,active
2192 * => should be replaced
2195 .line = __location__,
2196 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2199 .type = WREPL_TYPE_GROUP,
2200 .state = WREPL_STATE_TOMBSTONE,
2201 .node = WREPL_NODE_B,
2203 .num_ips = ARRAY_SIZE(addresses_B_1),
2204 .ips = addresses_B_1,
2205 .apply_expected = True
2209 .type = WREPL_TYPE_GROUP,
2210 .state = WREPL_STATE_ACTIVE,
2211 .node = WREPL_NODE_B,
2213 .num_ips = ARRAY_SIZE(addresses_A_1),
2214 .ips = addresses_A_1,
2215 .apply_expected = True
2220 * group,tombstone vs. group,tombstone
2221 * => should be replaced
2224 .line = __location__,
2225 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2228 .type = WREPL_TYPE_GROUP,
2229 .state = WREPL_STATE_TOMBSTONE,
2230 .node = WREPL_NODE_B,
2232 .num_ips = ARRAY_SIZE(addresses_A_1),
2233 .ips = addresses_A_1,
2234 .apply_expected = True
2238 .type = WREPL_TYPE_GROUP,
2239 .state = WREPL_STATE_TOMBSTONE,
2240 .node = WREPL_NODE_B,
2242 .num_ips = ARRAY_SIZE(addresses_B_1),
2243 .ips = addresses_B_1,
2244 .apply_expected = True
2249 * normal groups vs special groups section,
2252 * group,active vs. sgroup,active
2253 * => should NOT be replaced
2256 .line = __location__,
2257 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2260 .type = WREPL_TYPE_GROUP,
2261 .state = WREPL_STATE_ACTIVE,
2262 .node = WREPL_NODE_B,
2264 .num_ips = ARRAY_SIZE(addresses_B_1),
2265 .ips = addresses_B_1,
2266 .apply_expected = True
2270 .type = WREPL_TYPE_SGROUP,
2271 .state = WREPL_STATE_ACTIVE,
2272 .node = WREPL_NODE_B,
2274 .num_ips = ARRAY_SIZE(addresses_B_1),
2275 .ips = addresses_B_1,
2276 .apply_expected = False
2281 * group,active vs. sgroup,tombstone
2282 * => should NOT be replaced
2285 .line = __location__,
2286 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2289 .type = WREPL_TYPE_GROUP,
2290 .state = WREPL_STATE_ACTIVE,
2291 .node = WREPL_NODE_B,
2293 .num_ips = ARRAY_SIZE(addresses_B_1),
2294 .ips = addresses_B_1,
2295 .apply_expected = True
2299 .type = WREPL_TYPE_SGROUP,
2300 .state = WREPL_STATE_TOMBSTONE,
2301 .node = WREPL_NODE_B,
2303 .num_ips = ARRAY_SIZE(addresses_B_1),
2304 .ips = addresses_B_1,
2305 .apply_expected = False
2310 * group,released vs. sgroup,active
2311 * => should be replaced
2314 .line = __location__,
2315 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2318 .type = WREPL_TYPE_GROUP,
2319 .state = WREPL_STATE_RELEASED,
2320 .node = WREPL_NODE_B,
2322 .num_ips = ARRAY_SIZE(addresses_A_1),
2323 .ips = addresses_A_1,
2324 .apply_expected = False
2328 .type = WREPL_TYPE_SGROUP,
2329 .state = WREPL_STATE_ACTIVE,
2330 .node = WREPL_NODE_B,
2332 .num_ips = ARRAY_SIZE(addresses_B_1),
2333 .ips = addresses_B_1,
2334 .apply_expected = True
2339 * group,released vs. sgroup,tombstone
2340 * => should NOT be replaced
2343 .line = __location__,
2344 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2347 .type = WREPL_TYPE_GROUP,
2348 .state = WREPL_STATE_RELEASED,
2349 .node = WREPL_NODE_B,
2351 .num_ips = ARRAY_SIZE(addresses_B_1),
2352 .ips = addresses_B_1,
2353 .apply_expected = False
2357 .type = WREPL_TYPE_SGROUP,
2358 .state = WREPL_STATE_TOMBSTONE,
2359 .node = WREPL_NODE_B,
2361 .num_ips = ARRAY_SIZE(addresses_B_1),
2362 .ips = addresses_B_1,
2363 .apply_expected = False
2368 * group,tombstone vs. sgroup,active
2369 * => should be replaced
2372 .line = __location__,
2373 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2376 .type = WREPL_TYPE_GROUP,
2377 .state = WREPL_STATE_TOMBSTONE,
2378 .node = WREPL_NODE_B,
2380 .num_ips = ARRAY_SIZE(addresses_B_1),
2381 .ips = addresses_B_1,
2382 .apply_expected = True
2386 .type = WREPL_TYPE_SGROUP,
2387 .state = WREPL_STATE_ACTIVE,
2388 .node = WREPL_NODE_B,
2390 .num_ips = ARRAY_SIZE(addresses_A_1),
2391 .ips = addresses_A_1,
2392 .apply_expected = True
2397 * group,tombstone vs. sgroup,tombstone
2398 * => should be replaced
2401 .line = __location__,
2402 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2405 .type = WREPL_TYPE_GROUP,
2406 .state = WREPL_STATE_TOMBSTONE,
2407 .node = WREPL_NODE_B,
2409 .num_ips = ARRAY_SIZE(addresses_A_1),
2410 .ips = addresses_A_1,
2411 .apply_expected = True
2415 .type = WREPL_TYPE_SGROUP,
2416 .state = WREPL_STATE_TOMBSTONE,
2417 .node = WREPL_NODE_B,
2419 .num_ips = ARRAY_SIZE(addresses_B_1),
2420 .ips = addresses_B_1,
2421 .apply_expected = True
2426 * normal groups vs multi homed section,
2429 * group,active vs. mhomed,active
2430 * => should NOT be replaced
2433 .line = __location__,
2434 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2437 .type = WREPL_TYPE_GROUP,
2438 .state = WREPL_STATE_ACTIVE,
2439 .node = WREPL_NODE_B,
2441 .num_ips = ARRAY_SIZE(addresses_B_1),
2442 .ips = addresses_B_1,
2443 .apply_expected = True
2447 .type = WREPL_TYPE_MHOMED,
2448 .state = WREPL_STATE_ACTIVE,
2449 .node = WREPL_NODE_B,
2451 .num_ips = ARRAY_SIZE(addresses_B_1),
2452 .ips = addresses_B_1,
2453 .apply_expected = False
2458 * group,active vs. mhomed,tombstone
2459 * => should NOT be replaced
2462 .line = __location__,
2463 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2466 .type = WREPL_TYPE_GROUP,
2467 .state = WREPL_STATE_ACTIVE,
2468 .node = WREPL_NODE_B,
2470 .num_ips = ARRAY_SIZE(addresses_B_1),
2471 .ips = addresses_B_1,
2472 .apply_expected = True
2476 .type = WREPL_TYPE_MHOMED,
2477 .state = WREPL_STATE_TOMBSTONE,
2478 .node = WREPL_NODE_B,
2480 .num_ips = ARRAY_SIZE(addresses_B_1),
2481 .ips = addresses_B_1,
2482 .apply_expected = False
2487 * group,released vs. mhomed,active
2488 * => should NOT be replaced
2491 .line = __location__,
2492 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2495 .type = WREPL_TYPE_GROUP,
2496 .state = WREPL_STATE_RELEASED,
2497 .node = WREPL_NODE_B,
2499 .num_ips = ARRAY_SIZE(addresses_B_1),
2500 .ips = addresses_B_1,
2501 .apply_expected = False
2505 .type = WREPL_TYPE_MHOMED,
2506 .state = WREPL_STATE_ACTIVE,
2507 .node = WREPL_NODE_B,
2509 .num_ips = ARRAY_SIZE(addresses_B_1),
2510 .ips = addresses_B_1,
2511 .apply_expected = False
2516 * group,released vs. mhomed,tombstone
2517 * => should NOT be replaced
2520 .line = __location__,
2521 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2524 .type = WREPL_TYPE_GROUP,
2525 .state = WREPL_STATE_RELEASED,
2526 .node = WREPL_NODE_B,
2528 .num_ips = ARRAY_SIZE(addresses_B_1),
2529 .ips = addresses_B_1,
2530 .apply_expected = False
2534 .type = WREPL_TYPE_MHOMED,
2535 .state = WREPL_STATE_TOMBSTONE,
2536 .node = WREPL_NODE_B,
2538 .num_ips = ARRAY_SIZE(addresses_B_1),
2539 .ips = addresses_B_1,
2540 .apply_expected = False
2545 * group,tombstone vs. mhomed,active
2546 * => should be replaced
2549 .line = __location__,
2550 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2553 .type = WREPL_TYPE_GROUP,
2554 .state = WREPL_STATE_TOMBSTONE,
2555 .node = WREPL_NODE_B,
2557 .num_ips = ARRAY_SIZE(addresses_B_1),
2558 .ips = addresses_B_1,
2559 .apply_expected = True
2563 .type = WREPL_TYPE_MHOMED,
2564 .state = WREPL_STATE_ACTIVE,
2565 .node = WREPL_NODE_B,
2567 .num_ips = ARRAY_SIZE(addresses_A_1),
2568 .ips = addresses_A_1,
2569 .apply_expected = True
2574 * group,tombstone vs. mhomed,tombstone
2575 * => should be replaced
2578 .line = __location__,
2579 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2582 .type = WREPL_TYPE_GROUP,
2583 .state = WREPL_STATE_TOMBSTONE,
2584 .node = WREPL_NODE_B,
2586 .num_ips = ARRAY_SIZE(addresses_A_1),
2587 .ips = addresses_A_1,
2588 .apply_expected = True
2592 .type = WREPL_TYPE_MHOMED,
2593 .state = WREPL_STATE_TOMBSTONE,
2594 .node = WREPL_NODE_B,
2596 .num_ips = ARRAY_SIZE(addresses_B_1),
2597 .ips = addresses_B_1,
2598 .apply_expected = True
2603 * special groups vs unique section,
2606 * sgroup,active vs. unique,active
2607 * => should NOT be replaced
2610 .line = __location__,
2611 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2614 .type = WREPL_TYPE_SGROUP,
2615 .state = WREPL_STATE_ACTIVE,
2616 .node = WREPL_NODE_B,
2618 .num_ips = ARRAY_SIZE(addresses_B_1),
2619 .ips = addresses_B_1,
2620 .apply_expected = True
2624 .type = WREPL_TYPE_UNIQUE,
2625 .state = WREPL_STATE_ACTIVE,
2626 .node = WREPL_NODE_B,
2628 .num_ips = ARRAY_SIZE(addresses_B_1),
2629 .ips = addresses_B_1,
2630 .apply_expected = False
2635 * sgroup,active vs. unique,tombstone
2636 * => should NOT be replaced
2639 .line = __location__,
2640 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2643 .type = WREPL_TYPE_SGROUP,
2644 .state = WREPL_STATE_ACTIVE,
2645 .node = WREPL_NODE_B,
2647 .num_ips = ARRAY_SIZE(addresses_B_1),
2648 .ips = addresses_B_1,
2649 .apply_expected = True
2653 .type = WREPL_TYPE_UNIQUE,
2654 .state = WREPL_STATE_TOMBSTONE,
2655 .node = WREPL_NODE_B,
2657 .num_ips = ARRAY_SIZE(addresses_B_1),
2658 .ips = addresses_B_1,
2659 .apply_expected = False
2664 * sgroup,released vs. unique,active
2665 * => should be replaced
2668 .line = __location__,
2669 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2672 .type = WREPL_TYPE_SGROUP,
2673 .state = WREPL_STATE_RELEASED,
2674 .node = WREPL_NODE_B,
2676 .num_ips = ARRAY_SIZE(addresses_B_1),
2677 .ips = addresses_B_1,
2678 .apply_expected = False
2682 .type = WREPL_TYPE_UNIQUE,
2683 .state = WREPL_STATE_ACTIVE,
2684 .node = WREPL_NODE_B,
2686 .num_ips = ARRAY_SIZE(addresses_A_1),
2687 .ips = addresses_A_1,
2688 .apply_expected = True
2693 * sgroup,released vs. unique,tombstone
2694 * => should be replaced
2697 .line = __location__,
2698 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2701 .type = WREPL_TYPE_SGROUP,
2702 .state = WREPL_STATE_RELEASED,
2703 .node = WREPL_NODE_B,
2705 .num_ips = ARRAY_SIZE(addresses_A_1),
2706 .ips = addresses_A_1,
2707 .apply_expected = False
2711 .type = WREPL_TYPE_UNIQUE,
2712 .state = WREPL_STATE_TOMBSTONE,
2713 .node = WREPL_NODE_B,
2715 .num_ips = ARRAY_SIZE(addresses_B_1),
2716 .ips = addresses_B_1,
2717 .apply_expected = True
2722 * sgroup,tombstone vs. unique,active
2723 * => should be replaced
2726 .line = __location__,
2727 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2730 .type = WREPL_TYPE_SGROUP,
2731 .state = WREPL_STATE_TOMBSTONE,
2732 .node = WREPL_NODE_B,
2734 .num_ips = ARRAY_SIZE(addresses_A_1),
2735 .ips = addresses_A_1,
2736 .apply_expected = True
2740 .type = WREPL_TYPE_UNIQUE,
2741 .state = WREPL_STATE_ACTIVE,
2742 .node = WREPL_NODE_B,
2744 .num_ips = ARRAY_SIZE(addresses_B_1),
2745 .ips = addresses_B_1,
2746 .apply_expected = True
2751 * sgroup,tombstone vs. unique,tombstone
2752 * => should be replaced
2755 .line = __location__,
2756 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2759 .type = WREPL_TYPE_SGROUP,
2760 .state = WREPL_STATE_TOMBSTONE,
2761 .node = WREPL_NODE_B,
2763 .num_ips = ARRAY_SIZE(addresses_B_1),
2764 .ips = addresses_B_1,
2765 .apply_expected = True
2769 .type = WREPL_TYPE_UNIQUE,
2770 .state = WREPL_STATE_TOMBSTONE,
2771 .node = WREPL_NODE_B,
2773 .num_ips = ARRAY_SIZE(addresses_A_1),
2774 .ips = addresses_A_1,
2775 .apply_expected = True
2780 * special groups vs normal group section,
2783 * sgroup,active vs. group,active
2784 * => should NOT be replaced
2787 .line = __location__,
2788 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2791 .type = WREPL_TYPE_SGROUP,
2792 .state = WREPL_STATE_ACTIVE,
2793 .node = WREPL_NODE_B,
2795 .num_ips = ARRAY_SIZE(addresses_A_1),
2796 .ips = addresses_A_1,
2797 .apply_expected = True
2801 .type = WREPL_TYPE_GROUP,
2802 .state = WREPL_STATE_ACTIVE,
2803 .node = WREPL_NODE_B,
2805 .num_ips = ARRAY_SIZE(addresses_A_1),
2806 .ips = addresses_A_1,
2807 .apply_expected = False
2812 * sgroup,active vs. group,tombstone
2813 * => should NOT be replaced
2816 .line = __location__,
2817 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2820 .type = WREPL_TYPE_SGROUP,
2821 .state = WREPL_STATE_ACTIVE,
2822 .node = WREPL_NODE_B,
2824 .num_ips = ARRAY_SIZE(addresses_A_1),
2825 .ips = addresses_A_1,
2826 .apply_expected = True
2830 .type = WREPL_TYPE_GROUP,
2831 .state = WREPL_STATE_TOMBSTONE,
2832 .node = WREPL_NODE_B,
2834 .num_ips = ARRAY_SIZE(addresses_A_1),
2835 .ips = addresses_A_1,
2836 .apply_expected = False
2841 * sgroup,released vs. group,active
2842 * => should be replaced
2845 .line = __location__,
2846 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2849 .type = WREPL_TYPE_SGROUP,
2850 .state = WREPL_STATE_RELEASED,
2851 .node = WREPL_NODE_B,
2853 .num_ips = ARRAY_SIZE(addresses_A_1),
2854 .ips = addresses_A_1,
2855 .apply_expected = False
2859 .type = WREPL_TYPE_GROUP,
2860 .state = WREPL_STATE_ACTIVE,
2861 .node = WREPL_NODE_B,
2863 .num_ips = ARRAY_SIZE(addresses_B_1),
2864 .ips = addresses_B_1,
2865 .apply_expected = True
2870 * sgroup,released vs. group,tombstone
2871 * => should be replaced
2874 .line = __location__,
2875 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2878 .type = WREPL_TYPE_SGROUP,
2879 .state = WREPL_STATE_RELEASED,
2880 .node = WREPL_NODE_B,
2882 .num_ips = ARRAY_SIZE(addresses_B_1),
2883 .ips = addresses_B_1,
2884 .apply_expected = False
2888 .type = WREPL_TYPE_GROUP,
2889 .state = WREPL_STATE_TOMBSTONE,
2890 .node = WREPL_NODE_B,
2892 .num_ips = ARRAY_SIZE(addresses_A_1),
2893 .ips = addresses_A_1,
2894 .apply_expected = True
2899 * sgroup,tombstone vs. group,active
2900 * => should NOT be replaced
2903 .line = __location__,
2904 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2907 .type = WREPL_TYPE_SGROUP,
2908 .state = WREPL_STATE_TOMBSTONE,
2909 .node = WREPL_NODE_B,
2911 .num_ips = ARRAY_SIZE(addresses_A_1),
2912 .ips = addresses_A_1,
2913 .apply_expected = True
2917 .type = WREPL_TYPE_GROUP,
2918 .state = WREPL_STATE_ACTIVE,
2919 .node = WREPL_NODE_B,
2921 .num_ips = ARRAY_SIZE(addresses_B_1),
2922 .ips = addresses_B_1,
2923 .apply_expected = True
2928 * sgroup,tombstone vs. group,tombstone
2929 * => should NOT be replaced
2932 .line = __location__,
2933 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2936 .type = WREPL_TYPE_SGROUP,
2937 .state = WREPL_STATE_TOMBSTONE,
2938 .node = WREPL_NODE_B,
2940 .num_ips = ARRAY_SIZE(addresses_B_1),
2941 .ips = addresses_B_1,
2942 .apply_expected = True
2946 .type = WREPL_TYPE_GROUP,
2947 .state = WREPL_STATE_TOMBSTONE,
2948 .node = WREPL_NODE_B,
2950 .num_ips = ARRAY_SIZE(addresses_A_1),
2951 .ips = addresses_A_1,
2952 .apply_expected = True
2957 * special groups vs multi homed section,
2960 * sgroup,active vs. mhomed,active
2961 * => should NOT be replaced
2964 .line = __location__,
2965 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2968 .type = WREPL_TYPE_SGROUP,
2969 .state = WREPL_STATE_ACTIVE,
2970 .node = WREPL_NODE_B,
2972 .num_ips = ARRAY_SIZE(addresses_A_1),
2973 .ips = addresses_A_1,
2974 .apply_expected = True
2978 .type = WREPL_TYPE_MHOMED,
2979 .state = WREPL_STATE_ACTIVE,
2980 .node = WREPL_NODE_B,
2982 .num_ips = ARRAY_SIZE(addresses_A_1),
2983 .ips = addresses_A_1,
2984 .apply_expected = False
2989 * sgroup,active vs. mhomed,tombstone
2990 * => should NOT be replaced
2993 .line = __location__,
2994 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2997 .type = WREPL_TYPE_SGROUP,
2998 .state = WREPL_STATE_ACTIVE,
2999 .node = WREPL_NODE_B,
3001 .num_ips = ARRAY_SIZE(addresses_A_1),
3002 .ips = addresses_A_1,
3003 .apply_expected = True
3007 .type = WREPL_TYPE_MHOMED,
3008 .state = WREPL_STATE_TOMBSTONE,
3009 .node = WREPL_NODE_B,
3011 .num_ips = ARRAY_SIZE(addresses_A_1),
3012 .ips = addresses_A_1,
3013 .apply_expected = False
3018 * sgroup,released vs. mhomed,active
3019 * => should be replaced
3022 .line = __location__,
3023 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3026 .type = WREPL_TYPE_SGROUP,
3027 .state = WREPL_STATE_RELEASED,
3028 .node = WREPL_NODE_B,
3030 .num_ips = ARRAY_SIZE(addresses_A_1),
3031 .ips = addresses_A_1,
3032 .apply_expected = False
3036 .type = WREPL_TYPE_MHOMED,
3037 .state = WREPL_STATE_ACTIVE,
3038 .node = WREPL_NODE_B,
3040 .num_ips = ARRAY_SIZE(addresses_B_1),
3041 .ips = addresses_B_1,
3042 .apply_expected = True
3047 * sgroup,released vs. mhomed,tombstone
3048 * => should be replaced
3051 .line = __location__,
3052 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3055 .type = WREPL_TYPE_SGROUP,
3056 .state = WREPL_STATE_RELEASED,
3057 .node = WREPL_NODE_B,
3059 .num_ips = ARRAY_SIZE(addresses_B_1),
3060 .ips = addresses_B_1,
3061 .apply_expected = False
3065 .type = WREPL_TYPE_MHOMED,
3066 .state = WREPL_STATE_TOMBSTONE,
3067 .node = WREPL_NODE_B,
3069 .num_ips = ARRAY_SIZE(addresses_A_1),
3070 .ips = addresses_A_1,
3071 .apply_expected = True
3076 * sgroup,tombstone vs. mhomed,active
3077 * => should be replaced
3080 .line = __location__,
3081 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3084 .type = WREPL_TYPE_SGROUP,
3085 .state = WREPL_STATE_TOMBSTONE,
3086 .node = WREPL_NODE_B,
3088 .num_ips = ARRAY_SIZE(addresses_A_1),
3089 .ips = addresses_A_1,
3090 .apply_expected = True
3094 .type = WREPL_TYPE_MHOMED,
3095 .state = WREPL_STATE_ACTIVE,
3096 .node = WREPL_NODE_B,
3098 .num_ips = ARRAY_SIZE(addresses_B_1),
3099 .ips = addresses_B_1,
3100 .apply_expected = True
3105 * sgroup,tombstone vs. mhomed,tombstone
3106 * => should be replaced
3109 .line = __location__,
3110 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3113 .type = WREPL_TYPE_SGROUP,
3114 .state = WREPL_STATE_TOMBSTONE,
3115 .node = WREPL_NODE_B,
3117 .num_ips = ARRAY_SIZE(addresses_B_1),
3118 .ips = addresses_B_1,
3119 .apply_expected = True
3123 .type = WREPL_TYPE_MHOMED,
3124 .state = WREPL_STATE_TOMBSTONE,
3125 .node = WREPL_NODE_B,
3127 .num_ips = ARRAY_SIZE(addresses_A_1),
3128 .ips = addresses_A_1,
3129 .apply_expected = True
3134 * multi homed vs. unique section,
3137 * mhomed,active vs. unique,active
3138 * => should be replaced
3141 .line = __location__,
3142 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3145 .type = WREPL_TYPE_MHOMED,
3146 .state = WREPL_STATE_ACTIVE,
3147 .node = WREPL_NODE_B,
3149 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3150 .ips = addresses_A_3_4,
3151 .apply_expected = True
3155 .type = WREPL_TYPE_UNIQUE,
3156 .state = WREPL_STATE_ACTIVE,
3157 .node = WREPL_NODE_B,
3159 .num_ips = ARRAY_SIZE(addresses_B_1),
3160 .ips = addresses_B_1,
3161 .apply_expected = True
3166 * mhomed,active vs. unique,tombstone
3167 * => should NOT be replaced
3170 .line = __location__,
3171 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3174 .type = WREPL_TYPE_MHOMED,
3175 .state = WREPL_STATE_ACTIVE,
3176 .node = WREPL_NODE_B,
3178 .num_ips = ARRAY_SIZE(addresses_B_1),
3179 .ips = addresses_B_1,
3180 .apply_expected = True
3184 .type = WREPL_TYPE_UNIQUE,
3185 .state = WREPL_STATE_TOMBSTONE,
3186 .node = WREPL_NODE_B,
3188 .num_ips = ARRAY_SIZE(addresses_B_1),
3189 .ips = addresses_B_1,
3190 .apply_expected = False
3195 * mhomed,released vs. unique,active
3196 * => should be replaced
3199 .line = __location__,
3200 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3203 .type = WREPL_TYPE_MHOMED,
3204 .state = WREPL_STATE_RELEASED,
3205 .node = WREPL_NODE_B,
3207 .num_ips = ARRAY_SIZE(addresses_A_1),
3208 .ips = addresses_A_1,
3209 .apply_expected = False
3213 .type = WREPL_TYPE_UNIQUE,
3214 .state = WREPL_STATE_ACTIVE,
3215 .node = WREPL_NODE_B,
3217 .num_ips = ARRAY_SIZE(addresses_B_1),
3218 .ips = addresses_B_1,
3219 .apply_expected = True
3224 * mhomed,released vs. uinique,tombstone
3225 * => should be replaced
3228 .line = __location__,
3229 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3232 .type = WREPL_TYPE_MHOMED,
3233 .state = WREPL_STATE_RELEASED,
3234 .node = WREPL_NODE_B,
3236 .num_ips = ARRAY_SIZE(addresses_B_1),
3237 .ips = addresses_B_1,
3238 .apply_expected = False
3242 .type = WREPL_TYPE_UNIQUE,
3243 .state = WREPL_STATE_TOMBSTONE,
3244 .node = WREPL_NODE_B,
3246 .num_ips = ARRAY_SIZE(addresses_A_1),
3247 .ips = addresses_A_1,
3248 .apply_expected = True
3253 * mhomed,tombstone vs. unique,active
3254 * => should be replaced
3257 .line = __location__,
3258 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3261 .type = WREPL_TYPE_MHOMED,
3262 .state = WREPL_STATE_TOMBSTONE,
3263 .node = WREPL_NODE_B,
3265 .num_ips = ARRAY_SIZE(addresses_A_1),
3266 .ips = addresses_A_1,
3267 .apply_expected = True
3271 .type = WREPL_TYPE_UNIQUE,
3272 .state = WREPL_STATE_ACTIVE,
3273 .node = WREPL_NODE_B,
3275 .num_ips = ARRAY_SIZE(addresses_B_1),
3276 .ips = addresses_B_1,
3277 .apply_expected = True
3282 * mhomed,tombstone vs. uinique,tombstone
3283 * => should be replaced
3286 .line = __location__,
3287 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3290 .type = WREPL_TYPE_MHOMED,
3291 .state = WREPL_STATE_TOMBSTONE,
3292 .node = WREPL_NODE_B,
3294 .num_ips = ARRAY_SIZE(addresses_B_1),
3295 .ips = addresses_B_1,
3296 .apply_expected = True
3300 .type = WREPL_TYPE_UNIQUE,
3301 .state = WREPL_STATE_TOMBSTONE,
3302 .node = WREPL_NODE_B,
3304 .num_ips = ARRAY_SIZE(addresses_A_1),
3305 .ips = addresses_A_1,
3306 .apply_expected = True
3311 * multi homed vs. normal group section,
3314 * mhomed,active vs. group,active
3315 * => should be replaced
3318 .line = __location__,
3319 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3322 .type = WREPL_TYPE_MHOMED,
3323 .state = WREPL_STATE_ACTIVE,
3324 .node = WREPL_NODE_B,
3326 .num_ips = ARRAY_SIZE(addresses_A_1),
3327 .ips = addresses_A_1,
3328 .apply_expected = True
3332 .type = WREPL_TYPE_GROUP,
3333 .state = WREPL_STATE_ACTIVE,
3334 .node = WREPL_NODE_B,
3336 .num_ips = ARRAY_SIZE(addresses_B_1),
3337 .ips = addresses_B_1,
3338 .apply_expected = True
3343 * mhomed,active vs. group,tombstone
3344 * => should NOT be replaced
3347 .line = __location__,
3348 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3351 .type = WREPL_TYPE_MHOMED,
3352 .state = WREPL_STATE_ACTIVE,
3353 .node = WREPL_NODE_B,
3355 .num_ips = ARRAY_SIZE(addresses_B_1),
3356 .ips = addresses_B_1,
3357 .apply_expected = True
3361 .type = WREPL_TYPE_GROUP,
3362 .state = WREPL_STATE_TOMBSTONE,
3363 .node = WREPL_NODE_B,
3365 .num_ips = ARRAY_SIZE(addresses_B_1),
3366 .ips = addresses_B_1,
3367 .apply_expected = False
3372 * mhomed,released vs. group,active
3373 * => should be replaced
3376 .line = __location__,
3377 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3380 .type = WREPL_TYPE_MHOMED,
3381 .state = WREPL_STATE_RELEASED,
3382 .node = WREPL_NODE_B,
3384 .num_ips = ARRAY_SIZE(addresses_B_1),
3385 .ips = addresses_B_1,
3386 .apply_expected = False
3390 .type = WREPL_TYPE_GROUP,
3391 .state = WREPL_STATE_ACTIVE,
3392 .node = WREPL_NODE_B,
3394 .num_ips = ARRAY_SIZE(addresses_A_1),
3395 .ips = addresses_A_1,
3396 .apply_expected = True
3401 * mhomed,released vs. group,tombstone
3402 * => should be replaced
3405 .line = __location__,
3406 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3409 .type = WREPL_TYPE_MHOMED,
3410 .state = WREPL_STATE_RELEASED,
3411 .node = WREPL_NODE_B,
3413 .num_ips = ARRAY_SIZE(addresses_A_1),
3414 .ips = addresses_A_1,
3415 .apply_expected = False
3419 .type = WREPL_TYPE_GROUP,
3420 .state = WREPL_STATE_TOMBSTONE,
3421 .node = WREPL_NODE_B,
3423 .num_ips = ARRAY_SIZE(addresses_B_1),
3424 .ips = addresses_B_1,
3425 .apply_expected = True
3430 * mhomed,tombstone vs. group,active
3431 * => should be replaced
3434 .line = __location__,
3435 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3438 .type = WREPL_TYPE_MHOMED,
3439 .state = WREPL_STATE_TOMBSTONE,
3440 .node = WREPL_NODE_B,
3442 .num_ips = ARRAY_SIZE(addresses_B_1),
3443 .ips = addresses_B_1,
3444 .apply_expected = True
3448 .type = WREPL_TYPE_GROUP,
3449 .state = WREPL_STATE_ACTIVE,
3450 .node = WREPL_NODE_B,
3452 .num_ips = ARRAY_SIZE(addresses_A_1),
3453 .ips = addresses_A_1,
3454 .apply_expected = True
3459 * mhomed,tombstone vs. group,tombstone
3460 * => should be replaced
3463 .line = __location__,
3464 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3467 .type = WREPL_TYPE_MHOMED,
3468 .state = WREPL_STATE_TOMBSTONE,
3469 .node = WREPL_NODE_B,
3471 .num_ips = ARRAY_SIZE(addresses_A_1),
3472 .ips = addresses_A_1,
3473 .apply_expected = True
3477 .type = WREPL_TYPE_GROUP,
3478 .state = WREPL_STATE_TOMBSTONE,
3479 .node = WREPL_NODE_B,
3481 .num_ips = ARRAY_SIZE(addresses_B_1),
3482 .ips = addresses_B_1,
3483 .apply_expected = True
3488 * multi homed vs. special group section,
3491 * mhomed,active vs. sgroup,active
3492 * => should NOT be replaced
3495 .line = __location__,
3496 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3499 .type = WREPL_TYPE_MHOMED,
3500 .state = WREPL_STATE_ACTIVE,
3501 .node = WREPL_NODE_B,
3503 .num_ips = ARRAY_SIZE(addresses_A_1),
3504 .ips = addresses_A_1,
3505 .apply_expected = True
3509 .type = WREPL_TYPE_SGROUP,
3510 .state = WREPL_STATE_ACTIVE,
3511 .node = WREPL_NODE_B,
3513 .num_ips = ARRAY_SIZE(addresses_A_1),
3514 .ips = addresses_A_1,
3515 .apply_expected = False
3520 * mhomed,active vs. sgroup,tombstone
3521 * => should NOT be replaced
3524 .line = __location__,
3525 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3528 .type = WREPL_TYPE_MHOMED,
3529 .state = WREPL_STATE_ACTIVE,
3530 .node = WREPL_NODE_B,
3532 .num_ips = ARRAY_SIZE(addresses_A_1),
3533 .ips = addresses_A_1,
3534 .apply_expected = True
3538 .type = WREPL_TYPE_SGROUP,
3539 .state = WREPL_STATE_TOMBSTONE,
3540 .node = WREPL_NODE_B,
3542 .num_ips = ARRAY_SIZE(addresses_A_1),
3543 .ips = addresses_A_1,
3544 .apply_expected = False
3549 * mhomed,released vs. sgroup,active
3550 * => should be replaced
3553 .line = __location__,
3554 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3557 .type = WREPL_TYPE_MHOMED,
3558 .state = WREPL_STATE_RELEASED,
3559 .node = WREPL_NODE_B,
3561 .num_ips = ARRAY_SIZE(addresses_A_1),
3562 .ips = addresses_A_1,
3563 .apply_expected = False
3567 .type = WREPL_TYPE_SGROUP,
3568 .state = WREPL_STATE_ACTIVE,
3569 .node = WREPL_NODE_B,
3571 .num_ips = ARRAY_SIZE(addresses_B_1),
3572 .ips = addresses_B_1,
3573 .apply_expected = True
3578 * mhomed,released vs. sgroup,tombstone
3579 * => should be replaced
3582 .line = __location__,
3583 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3586 .type = WREPL_TYPE_MHOMED,
3587 .state = WREPL_STATE_RELEASED,
3588 .node = WREPL_NODE_B,
3590 .num_ips = ARRAY_SIZE(addresses_B_1),
3591 .ips = addresses_B_1,
3592 .apply_expected = False
3596 .type = WREPL_TYPE_SGROUP,
3597 .state = WREPL_STATE_TOMBSTONE,
3598 .node = WREPL_NODE_B,
3600 .num_ips = ARRAY_SIZE(addresses_A_1),
3601 .ips = addresses_A_1,
3602 .apply_expected = True
3607 * mhomed,tombstone vs. sgroup,active
3608 * => should be replaced
3611 .line = __location__,
3612 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3615 .type = WREPL_TYPE_MHOMED,
3616 .state = WREPL_STATE_TOMBSTONE,
3617 .node = WREPL_NODE_B,
3619 .num_ips = ARRAY_SIZE(addresses_A_1),
3620 .ips = addresses_A_1,
3621 .apply_expected = True
3625 .type = WREPL_TYPE_SGROUP,
3626 .state = WREPL_STATE_ACTIVE,
3627 .node = WREPL_NODE_B,
3629 .num_ips = ARRAY_SIZE(addresses_B_1),
3630 .ips = addresses_B_1,
3631 .apply_expected = True
3636 * mhomed,tombstone vs. sgroup,tombstone
3637 * => should be replaced
3640 .line = __location__,
3641 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3644 .type = WREPL_TYPE_MHOMED,
3645 .state = WREPL_STATE_TOMBSTONE,
3646 .node = WREPL_NODE_B,
3648 .num_ips = ARRAY_SIZE(addresses_B_1),
3649 .ips = addresses_B_1,
3650 .apply_expected = True
3654 .type = WREPL_TYPE_SGROUP,
3655 .state = WREPL_STATE_TOMBSTONE,
3656 .node = WREPL_NODE_B,
3658 .num_ips = ARRAY_SIZE(addresses_A_1),
3659 .ips = addresses_A_1,
3660 .apply_expected = True
3665 * multi homed vs. mlti homed section,
3668 * mhomed,active vs. mhomed,active
3669 * => should be replaced
3672 .line = __location__,
3673 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3676 .type = WREPL_TYPE_MHOMED,
3677 .state = WREPL_STATE_ACTIVE,
3678 .node = WREPL_NODE_B,
3680 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3681 .ips = addresses_A_3_4,
3682 .apply_expected = True
3686 .type = WREPL_TYPE_MHOMED,
3687 .state = WREPL_STATE_ACTIVE,
3688 .node = WREPL_NODE_B,
3690 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3691 .ips = addresses_B_3_4,
3692 .apply_expected = True
3697 * mhomed,active vs. mhomed,tombstone
3698 * => should NOT be replaced
3701 .line = __location__,
3702 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3705 .type = WREPL_TYPE_MHOMED,
3706 .state = WREPL_STATE_ACTIVE,
3707 .node = WREPL_NODE_B,
3709 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3710 .ips = addresses_B_3_4,
3711 .apply_expected = True
3715 .type = WREPL_TYPE_MHOMED,
3716 .state = WREPL_STATE_TOMBSTONE,
3717 .node = WREPL_NODE_B,
3719 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3720 .ips = addresses_B_3_4,
3721 .apply_expected = False
3726 * mhomed,released vs. mhomed,active
3727 * => should be replaced
3730 .line = __location__,
3731 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3734 .type = WREPL_TYPE_MHOMED,
3735 .state = WREPL_STATE_RELEASED,
3736 .node = WREPL_NODE_B,
3738 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3739 .ips = addresses_B_3_4,
3740 .apply_expected = False
3744 .type = WREPL_TYPE_MHOMED,
3745 .state = WREPL_STATE_ACTIVE,
3746 .node = WREPL_NODE_B,
3748 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3749 .ips = addresses_A_3_4,
3750 .apply_expected = True
3755 * mhomed,released vs. mhomed,tombstone
3756 * => should be replaced
3759 .line = __location__,
3760 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3763 .type = WREPL_TYPE_MHOMED,
3764 .state = WREPL_STATE_RELEASED,
3765 .node = WREPL_NODE_B,
3767 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3768 .ips = addresses_A_3_4,
3769 .apply_expected = False
3773 .type = WREPL_TYPE_MHOMED,
3774 .state = WREPL_STATE_TOMBSTONE,
3775 .node = WREPL_NODE_B,
3777 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3778 .ips = addresses_B_3_4,
3779 .apply_expected = True
3784 * mhomed,tombstone vs. mhomed,active
3785 * => should be replaced
3788 .line = __location__,
3789 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3792 .type = WREPL_TYPE_MHOMED,
3793 .state = WREPL_STATE_TOMBSTONE,
3794 .node = WREPL_NODE_B,
3796 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3797 .ips = addresses_B_3_4,
3798 .apply_expected = True
3802 .type = WREPL_TYPE_MHOMED,
3803 .state = WREPL_STATE_ACTIVE,
3804 .node = WREPL_NODE_B,
3806 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3807 .ips = addresses_A_3_4,
3808 .apply_expected = True
3813 * mhomed,tombstone vs. mhomed,tombstone
3814 * => should be replaced
3817 .line = __location__,
3818 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3821 .type = WREPL_TYPE_MHOMED,
3822 .state = WREPL_STATE_TOMBSTONE,
3823 .node = WREPL_NODE_B,
3825 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3826 .ips = addresses_A_3_4,
3827 .apply_expected = True
3831 .type = WREPL_TYPE_MHOMED,
3832 .state = WREPL_STATE_TOMBSTONE,
3833 .node = WREPL_NODE_B,
3835 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3836 .ips = addresses_B_3_4,
3837 .apply_expected = True
3841 .line = __location__,
3842 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3846 .type = WREPL_TYPE_UNIQUE,
3847 .state = WREPL_STATE_TOMBSTONE,
3848 .node = WREPL_NODE_B,
3850 .num_ips = ARRAY_SIZE(addresses_B_1),
3851 .ips = addresses_B_1,
3852 .apply_expected = True,
3856 .type = WREPL_TYPE_UNIQUE,
3857 .state = WREPL_STATE_TOMBSTONE,
3858 .node = WREPL_NODE_B,
3860 .num_ips = ARRAY_SIZE(addresses_A_1),
3861 .ips = addresses_A_1,
3862 .apply_expected = True,
3866 * special group vs special group section,
3869 * sgroup,active vs. sgroup,active different addresses
3870 * => should be merged
3873 .line = __location__,
3874 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3875 .comment= "A:A_3_4 vs. B:B_3_4 => C:A_3_4_B_3_4",
3879 .type = WREPL_TYPE_SGROUP,
3880 .state = WREPL_STATE_ACTIVE,
3881 .node = WREPL_NODE_B,
3883 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3884 .ips = addresses_A_3_4,
3885 .apply_expected = True,
3889 .type = WREPL_TYPE_SGROUP,
3890 .state = WREPL_STATE_ACTIVE,
3891 .node = WREPL_NODE_B,
3893 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3894 .ips = addresses_B_3_4,
3895 .sgroup_merge = True,
3896 .sgroup_cleanup = True,
3900 * sgroup,active vs. sgroup,active same addresses
3901 * => should be NOT replaced
3904 .line = __location__,
3905 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3906 .comment= "A:A_3_4 vs. B:A_3_4",
3910 .type = WREPL_TYPE_SGROUP,
3911 .state = WREPL_STATE_ACTIVE,
3912 .node = WREPL_NODE_B,
3914 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3915 .ips = addresses_A_3_4,
3916 .apply_expected = True
3920 .type = WREPL_TYPE_SGROUP,
3921 .state = WREPL_STATE_ACTIVE,
3922 .node = WREPL_NODE_B,
3924 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3925 .ips = addresses_A_3_4,
3926 .apply_expected = False,
3927 .sgroup_cleanup = True
3931 * sgroup,active vs. sgroup,active different addresses, but owner changed
3932 * => should be replaced
3935 .line = __location__,
3936 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3937 .comment= "A:B_3_4 vs. B:A_3_4",
3941 .type = WREPL_TYPE_SGROUP,
3942 .state = WREPL_STATE_ACTIVE,
3943 .node = WREPL_NODE_B,
3945 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3946 .ips = addresses_B_3_4,
3947 .apply_expected = True,
3951 .type = WREPL_TYPE_SGROUP,
3952 .state = WREPL_STATE_ACTIVE,
3953 .node = WREPL_NODE_B,
3955 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3956 .ips = addresses_A_3_4,
3957 .apply_expected = True,
3958 .sgroup_cleanup = True
3962 * sgroup,active vs. sgroup,active different addresses, but owner changed
3963 * => should be replaced
3966 .line = __location__,
3967 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3968 .comment= "A:A_3_4 vs. B:A_3_4_OWNER_B",
3972 .type = WREPL_TYPE_SGROUP,
3973 .state = WREPL_STATE_ACTIVE,
3974 .node = WREPL_NODE_B,
3976 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3977 .ips = addresses_A_3_4,
3978 .apply_expected = True,
3982 .type = WREPL_TYPE_SGROUP,
3983 .state = WREPL_STATE_ACTIVE,
3984 .node = WREPL_NODE_B,
3986 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
3987 .ips = addresses_A_3_4_OWNER_B,
3988 .apply_expected = True,
3989 .sgroup_cleanup = True
3993 * sgroup,active vs. sgroup,active different addresses, but owner changed
3994 * => should be replaced
3997 .line = __location__,
3998 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3999 .comment= "A:A_3_4_OWNER_B vs. B:A_3_4",
4003 .type = WREPL_TYPE_SGROUP,
4004 .state = WREPL_STATE_ACTIVE,
4005 .node = WREPL_NODE_B,
4007 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4008 .ips = addresses_A_3_4_OWNER_B,
4009 .apply_expected = True,
4013 .type = WREPL_TYPE_SGROUP,
4014 .state = WREPL_STATE_ACTIVE,
4015 .node = WREPL_NODE_B,
4017 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4018 .ips = addresses_A_3_4,
4019 .apply_expected = True,
4020 .sgroup_cleanup = True
4024 * sgroup,active vs. sgroup,active different addresses, special case...
4025 * => should be merged
4028 .line = __location__,
4029 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4030 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:X_3_4",
4034 .type = WREPL_TYPE_SGROUP,
4035 .state = WREPL_STATE_ACTIVE,
4036 .node = WREPL_NODE_B,
4038 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4039 .ips = addresses_B_3_4_X_3_4,
4040 .apply_expected = True,
4044 .type = WREPL_TYPE_SGROUP,
4045 .state = WREPL_STATE_ACTIVE,
4046 .node = WREPL_NODE_B,
4048 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4049 .ips = addresses_A_3_4,
4050 .sgroup_merge = True,
4051 .merge_owner = &ctx->b,
4052 .sgroup_cleanup = False
4056 .line = __location__,
4057 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4061 .type = WREPL_TYPE_SGROUP,
4062 .state = WREPL_STATE_ACTIVE,
4063 .node = WREPL_NODE_B,
4065 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4_OWNER_B),
4066 .ips = addresses_A_3_4_X_3_4_OWNER_B,
4067 .apply_expected = True,
4071 .type = WREPL_TYPE_SGROUP,
4072 .state = WREPL_STATE_ACTIVE,
4073 .node = WREPL_NODE_B,
4077 .apply_expected = False,
4081 * sgroup,active vs. sgroup,active subset addresses, special case...
4082 * => should NOT be replaced
4085 .line = __location__,
4086 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4087 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4",
4091 .type = WREPL_TYPE_SGROUP,
4092 .state = WREPL_STATE_ACTIVE,
4093 .node = WREPL_NODE_B,
4095 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4096 .ips = addresses_A_3_4_X_3_4,
4097 .apply_expected = True,
4101 .type = WREPL_TYPE_SGROUP,
4102 .state = WREPL_STATE_ACTIVE,
4103 .node = WREPL_NODE_B,
4105 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4106 .ips = addresses_A_3_4,
4107 .apply_expected = False,
4111 .line = __location__,
4112 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4116 .type = WREPL_TYPE_SGROUP,
4117 .state = WREPL_STATE_ACTIVE,
4118 .node = WREPL_NODE_B,
4122 .apply_expected = False,
4126 .type = WREPL_TYPE_SGROUP,
4127 .state = WREPL_STATE_ACTIVE,
4128 .node = WREPL_NODE_B,
4132 .apply_expected = False,
4136 * sgroup,active vs. sgroup,active different addresses, special case...
4137 * => should be merged
4140 .line = __location__,
4141 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4142 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4_OWNER_B => B:A_3_4_OWNER_B_X_3_4",
4146 .type = WREPL_TYPE_SGROUP,
4147 .state = WREPL_STATE_ACTIVE,
4148 .node = WREPL_NODE_B,
4150 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4151 .ips = addresses_A_3_4_X_3_4,
4152 .apply_expected = True,
4156 .type = WREPL_TYPE_SGROUP,
4157 .state = WREPL_STATE_ACTIVE,
4158 .node = WREPL_NODE_B,
4160 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4161 .ips = addresses_A_3_4_OWNER_B,
4162 .sgroup_merge = True,
4163 .merge_owner = &ctx->b,
4167 .line = __location__,
4168 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4172 .type = WREPL_TYPE_SGROUP,
4173 .state = WREPL_STATE_ACTIVE,
4174 .node = WREPL_NODE_B,
4178 .apply_expected = False,
4182 .type = WREPL_TYPE_SGROUP,
4183 .state = WREPL_STATE_ACTIVE,
4184 .node = WREPL_NODE_B,
4188 .apply_expected = False,
4192 * sgroup,active vs. sgroup,active partly different addresses, special case...
4193 * => should be merged
4196 .line = __location__,
4197 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4198 .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",
4202 .type = WREPL_TYPE_SGROUP,
4203 .state = WREPL_STATE_ACTIVE,
4204 .node = WREPL_NODE_B,
4206 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4207 .ips = addresses_B_3_4_X_3_4,
4208 .apply_expected = True,
4212 .type = WREPL_TYPE_SGROUP,
4213 .state = WREPL_STATE_ACTIVE,
4214 .node = WREPL_NODE_B,
4216 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_1_2),
4217 .ips = addresses_B_3_4_X_1_2,
4218 .sgroup_merge = True,
4219 .sgroup_cleanup = False
4223 .line = __location__,
4224 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4228 .type = WREPL_TYPE_SGROUP,
4229 .state = WREPL_STATE_ACTIVE,
4230 .node = WREPL_NODE_B,
4234 .apply_expected = False,
4238 .type = WREPL_TYPE_SGROUP,
4239 .state = WREPL_STATE_ACTIVE,
4240 .node = WREPL_NODE_B,
4244 .apply_expected = False,
4248 * sgroup,active vs. sgroup,active different addresses, special case...
4249 * => should be merged
4252 .line = __location__,
4253 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4254 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:X_3_4",
4258 .type = WREPL_TYPE_SGROUP,
4259 .state = WREPL_STATE_ACTIVE,
4260 .node = WREPL_NODE_B,
4262 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4263 .ips = addresses_B_3_4_X_3_4,
4264 .apply_expected = True,
4268 .type = WREPL_TYPE_SGROUP,
4269 .state = WREPL_STATE_ACTIVE,
4270 .node = WREPL_NODE_B,
4274 .sgroup_merge = True,
4275 .merge_owner = &ctx->b,
4276 .sgroup_cleanup = True
4280 .line = __location__,
4281 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4285 .type = WREPL_TYPE_SGROUP,
4286 .state = WREPL_STATE_ACTIVE,
4287 .node = WREPL_NODE_B,
4291 .apply_expected = False,
4295 .type = WREPL_TYPE_UNIQUE,
4296 .state = WREPL_STATE_TOMBSTONE,
4297 .node = WREPL_NODE_B,
4299 .num_ips = ARRAY_SIZE(addresses_A_1),
4300 .ips = addresses_A_1,
4301 .apply_expected = True,
4305 * This should be the last record in this array,
4306 * we need to make sure the we leave a tombstoned unique entry
4310 .line = __location__,
4311 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4315 .type = WREPL_TYPE_UNIQUE,
4316 .state = WREPL_STATE_TOMBSTONE,
4317 .node = WREPL_NODE_B,
4319 .num_ips = ARRAY_SIZE(addresses_A_1),
4320 .ips = addresses_A_1,
4321 .apply_expected = True
4325 .type = WREPL_TYPE_UNIQUE,
4326 .state = WREPL_STATE_TOMBSTONE,
4327 .node = WREPL_NODE_B,
4329 .num_ips = ARRAY_SIZE(addresses_A_1),
4330 .ips = addresses_A_1,
4331 .apply_expected = True
4333 }}; /* do not add entries here, this should be the last record! */
4335 if (!ctx) return False;
4337 wins_name_r1 = &wins_name1;
4338 wins_name_r2 = &wins_name2;
4340 printf("Test Replica Conflicts with different owners\n");
4342 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
4344 if (!records[i].extra && !records[i].cleanup) {
4345 /* we should test the worst cases */
4346 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
4347 printf("(%s) Programmer error, invalid record[%u]: %s\n",
4348 __location__, i, records[i].line);
4350 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
4351 printf("(%s) Programmer error, invalid record[%u]: %s\n",
4352 __location__, i, records[i].line);
4357 if (!records[i].cleanup) {
4358 const char *expected;
4361 if (records[i].r2.sgroup_merge) {
4362 expected = "SGROUP_MERGE";
4363 } else if (records[i].r2.apply_expected) {
4364 expected = "REPLACE";
4366 expected = "NOT REPLACE";
4369 if (!records[i].r1.ips && !records[i].r2.ips) {
4370 ips = "with no ip(s)";
4371 } else if (records[i].r1.ips==records[i].r2.ips) {
4372 ips = "with same ip(s)";
4374 ips = "with different ip(s)";
4377 printf("%s,%s%s vs. %s,%s%s %s => %s\n",
4378 wrepl_name_type_string(records[i].r1.type),
4379 wrepl_name_state_string(records[i].r1.state),
4380 (records[i].r1.is_static?",static":""),
4381 wrepl_name_type_string(records[i].r2.type),
4382 wrepl_name_state_string(records[i].r2.state),
4383 (records[i].r2.is_static?",static":""),
4384 (records[i].comment?records[i].comment:ips),
4391 wins_name_r1->name = &records[i].name;
4392 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
4393 records[i].r1.state,
4395 records[i].r1.is_static);
4396 wins_name_r1->id = ++records[i].r1.owner->max_version;
4397 if (wins_name_r1->flags & 2) {
4398 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
4399 wins_name_r1->addresses.addresses.ips = discard_const(records[i].r1.ips);
4401 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
4403 wins_name_r1->unknown = "255.255.255.255";
4406 ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1);
4407 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4408 wins_name_r1, records[i].r1.apply_expected);
4413 wins_name_r2->name = &records[i].name;
4414 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
4415 records[i].r2.state,
4417 records[i].r2.is_static);
4418 wins_name_r2->id = ++records[i].r2.owner->max_version;
4419 if (wins_name_r2->flags & 2) {
4420 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
4421 wins_name_r2->addresses.addresses.ips = discard_const(records[i].r2.ips);
4423 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
4425 wins_name_r2->unknown = "255.255.255.255";
4428 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4429 if (records[i].r1.state == WREPL_STATE_RELEASED) {
4430 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4431 wins_name_r1, False);
4432 } else if (records[i].r2.sgroup_merge) {
4433 ret &= test_wrepl_sgroup_merged(ctx, records[i].r2.merge_owner,
4434 records[i].r1.owner,
4435 records[i].r1.num_ips, records[i].r1.ips,
4436 records[i].r2.owner,
4437 records[i].r2.num_ips, records[i].r2.ips,
4439 } else if (records[i].r1.owner != records[i].r2.owner) {
4441 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
4442 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4443 wins_name_r1, _expected);
4445 if (records[i].r2.state == WREPL_STATE_RELEASED) {
4446 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
4447 wins_name_r2, False);
4448 } else if (!records[i].r2.sgroup_merge) {
4449 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
4450 wins_name_r2, records[i].r2.apply_expected);
4453 if (records[i].r2.sgroup_cleanup) {
4454 /* clean up the SGROUP record */
4455 wins_name_r1->name = &records[i].name;
4456 wins_name_r1->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4458 WREPL_NODE_B, False);
4459 wins_name_r1->id = ++records[i].r1.owner->max_version;
4460 wins_name_r1->addresses.addresses.num_ips = 0;
4461 wins_name_r1->addresses.addresses.ips = NULL;
4462 wins_name_r1->unknown = "255.255.255.255";
4463 ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1);
4465 /* here we test how names from an owner are deleted */
4466 if (records[i].r2.sgroup_merge && records[i].r2.num_ips) {
4467 ret &= test_wrepl_sgroup_merged(ctx, NULL,
4468 records[i].r2.owner,
4469 records[i].r2.num_ips, records[i].r2.ips,
4470 records[i].r1.owner,
4475 /* clean up the SGROUP record */
4476 wins_name_r2->name = &records[i].name;
4477 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4479 WREPL_NODE_B, False);
4480 wins_name_r2->id = ++records[i].r2.owner->max_version;
4481 wins_name_r2->addresses.addresses.num_ips = 0;
4482 wins_name_r2->addresses.addresses.ips = NULL;
4483 wins_name_r2->unknown = "255.255.255.255";
4484 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4486 /* take ownership of the SGROUP record */
4487 wins_name_r2->name = &records[i].name;
4488 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4490 WREPL_NODE_B, False);
4491 wins_name_r2->id = ++records[i].r2.owner->max_version;
4492 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4493 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4494 wins_name_r2->unknown = "255.255.255.255";
4495 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4496 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, True);
4498 /* overwrite the SGROUP record with unique,tombstone */
4499 wins_name_r2->name = &records[i].name;
4500 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4501 WREPL_STATE_TOMBSTONE,
4502 WREPL_NODE_B, False);
4503 wins_name_r2->id = ++records[i].r2.owner->max_version;
4504 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4505 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4506 wins_name_r2->unknown = "255.255.255.255";
4507 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4508 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, True);
4511 /* the first one is a cleanup run */
4512 if (!ret && i == 0) ret = True;
4515 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
4523 static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_conn *ctx)
4527 struct wrepl_wins_name wins_name_;
4528 struct wrepl_wins_name *wins_name = &wins_name_;
4529 struct nbt_name_register name_register_;
4530 struct nbt_name_register *name_register = &name_register_;
4531 struct nbt_name_release release_;
4532 struct nbt_name_release *release = &release_;
4535 const char *line; /* just better debugging */
4536 struct nbt_name name;
4541 const struct wrepl_ip *ips;
4542 BOOL apply_expected;
4545 enum wrepl_name_type type;
4546 enum wrepl_name_state state;
4547 enum wrepl_name_node node;
4550 const struct wrepl_ip *ips;
4551 BOOL apply_expected;
4555 * unique vs. unique section
4558 * unique,released vs. unique,active with same ip(s)
4561 .line = __location__,
4562 .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL),
4566 .num_ips = ctx->addresses_best_num,
4567 .ips = ctx->addresses_best,
4568 .apply_expected = True
4571 .type = WREPL_TYPE_UNIQUE,
4572 .state = WREPL_STATE_ACTIVE,
4573 .node = WREPL_NODE_B,
4575 .num_ips = ctx->addresses_best_num,
4576 .ips = ctx->addresses_best,
4577 .apply_expected = True
4581 * unique,released vs. unique,active with different ip(s)
4584 .line = __location__,
4585 .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL),
4589 .num_ips = ctx->addresses_best_num,
4590 .ips = ctx->addresses_best,
4591 .apply_expected = True
4594 .type = WREPL_TYPE_UNIQUE,
4595 .state = WREPL_STATE_ACTIVE,
4596 .node = WREPL_NODE_B,
4598 .num_ips = ARRAY_SIZE(addresses_B_1),
4599 .ips = addresses_B_1,
4600 .apply_expected = True
4604 * unique,released vs. unique,tombstone with same ip(s)
4607 .line = __location__,
4608 .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL),
4612 .num_ips = ctx->addresses_best_num,
4613 .ips = ctx->addresses_best,
4614 .apply_expected = True
4617 .type = WREPL_TYPE_UNIQUE,
4618 .state = WREPL_STATE_TOMBSTONE,
4619 .node = WREPL_NODE_B,
4621 .num_ips = ctx->addresses_best_num,
4622 .ips = ctx->addresses_best,
4623 .apply_expected = True
4627 * unique,released vs. unique,tombstone with different ip(s)
4630 .line = __location__,
4631 .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL),
4635 .num_ips = ctx->addresses_best_num,
4636 .ips = ctx->addresses_best,
4637 .apply_expected = True
4640 .type = WREPL_TYPE_UNIQUE,
4641 .state = WREPL_STATE_TOMBSTONE,
4642 .node = WREPL_NODE_B,
4644 .num_ips = ARRAY_SIZE(addresses_B_1),
4645 .ips = addresses_B_1,
4646 .apply_expected = True
4650 * unique vs. group section
4653 * unique,released vs. group,active with same ip(s)
4656 .line = __location__,
4657 .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL),
4661 .num_ips = ctx->addresses_best_num,
4662 .ips = ctx->addresses_best,
4663 .apply_expected = True
4666 .type = WREPL_TYPE_GROUP,
4667 .state = WREPL_STATE_ACTIVE,
4668 .node = WREPL_NODE_B,
4670 .num_ips = ctx->addresses_best_num,
4671 .ips = ctx->addresses_best,
4672 .apply_expected = True
4676 * unique,released vs. group,active with different ip(s)
4679 .line = __location__,
4680 .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL),
4684 .num_ips = ctx->addresses_best_num,
4685 .ips = ctx->addresses_best,
4686 .apply_expected = True
4689 .type = WREPL_TYPE_GROUP,
4690 .state = WREPL_STATE_ACTIVE,
4691 .node = WREPL_NODE_B,
4693 .num_ips = ARRAY_SIZE(addresses_B_1),
4694 .ips = addresses_B_1,
4695 .apply_expected = True
4699 * unique,released vs. group,tombstone with same ip(s)
4702 .line = __location__,
4703 .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL),
4707 .num_ips = ctx->addresses_best_num,
4708 .ips = ctx->addresses_best,
4709 .apply_expected = True
4712 .type = WREPL_TYPE_GROUP,
4713 .state = WREPL_STATE_TOMBSTONE,
4714 .node = WREPL_NODE_B,
4716 .num_ips = ctx->addresses_best_num,
4717 .ips = ctx->addresses_best,
4718 .apply_expected = True
4722 * unique,released vs. group,tombstone with different ip(s)
4725 .line = __location__,
4726 .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL),
4730 .num_ips = ctx->addresses_best_num,
4731 .ips = ctx->addresses_best,
4732 .apply_expected = True
4735 .type = WREPL_TYPE_GROUP,
4736 .state = WREPL_STATE_TOMBSTONE,
4737 .node = WREPL_NODE_B,
4739 .num_ips = ARRAY_SIZE(addresses_B_1),
4740 .ips = addresses_B_1,
4741 .apply_expected = True
4745 * unique vs. special group section
4748 * unique,released vs. sgroup,active with same ip(s)
4751 .line = __location__,
4752 .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL),
4756 .num_ips = ctx->addresses_best_num,
4757 .ips = ctx->addresses_best,
4758 .apply_expected = True
4761 .type = WREPL_TYPE_SGROUP,
4762 .state = WREPL_STATE_ACTIVE,
4763 .node = WREPL_NODE_B,
4765 .num_ips = ctx->addresses_best_num,
4766 .ips = ctx->addresses_best,
4767 .apply_expected = True
4771 * unique,released vs. sgroup,active with different ip(s)
4774 .line = __location__,
4775 .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL),
4779 .num_ips = ctx->addresses_best_num,
4780 .ips = ctx->addresses_best,
4781 .apply_expected = True
4784 .type = WREPL_TYPE_SGROUP,
4785 .state = WREPL_STATE_ACTIVE,
4786 .node = WREPL_NODE_B,
4788 .num_ips = ARRAY_SIZE(addresses_B_1),
4789 .ips = addresses_B_1,
4790 .apply_expected = True
4794 * unique,released vs. sgroup,tombstone with same ip(s)
4797 .line = __location__,
4798 .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL),
4802 .num_ips = ctx->addresses_best_num,
4803 .ips = ctx->addresses_best,
4804 .apply_expected = True
4807 .type = WREPL_TYPE_SGROUP,
4808 .state = WREPL_STATE_TOMBSTONE,
4809 .node = WREPL_NODE_B,
4811 .num_ips = ctx->addresses_best_num,
4812 .ips = ctx->addresses_best,
4813 .apply_expected = True
4817 * unique,released vs. sgroup,tombstone with different ip(s)
4820 .line = __location__,
4821 .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL),
4825 .num_ips = ctx->addresses_best_num,
4826 .ips = ctx->addresses_best,
4827 .apply_expected = True
4830 .type = WREPL_TYPE_SGROUP,
4831 .state = WREPL_STATE_TOMBSTONE,
4832 .node = WREPL_NODE_B,
4834 .num_ips = ARRAY_SIZE(addresses_B_1),
4835 .ips = addresses_B_1,
4836 .apply_expected = True
4840 * unique vs. multi homed section
4843 * unique,released vs. mhomed,active with same ip(s)
4846 .line = __location__,
4847 .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL),
4851 .num_ips = ctx->addresses_best_num,
4852 .ips = ctx->addresses_best,
4853 .apply_expected = True
4856 .type = WREPL_TYPE_MHOMED,
4857 .state = WREPL_STATE_ACTIVE,
4858 .node = WREPL_NODE_B,
4860 .num_ips = ctx->addresses_best_num,
4861 .ips = ctx->addresses_best,
4862 .apply_expected = True
4866 * unique,released vs. mhomed,active with different ip(s)
4869 .line = __location__,
4870 .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL),
4874 .num_ips = ctx->addresses_best_num,
4875 .ips = ctx->addresses_best,
4876 .apply_expected = True
4879 .type = WREPL_TYPE_MHOMED,
4880 .state = WREPL_STATE_ACTIVE,
4881 .node = WREPL_NODE_B,
4883 .num_ips = ARRAY_SIZE(addresses_B_1),
4884 .ips = addresses_B_1,
4885 .apply_expected = True
4889 * unique,released vs. mhomed,tombstone with same ip(s)
4892 .line = __location__,
4893 .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL),
4897 .num_ips = ctx->addresses_best_num,
4898 .ips = ctx->addresses_best,
4899 .apply_expected = True
4902 .type = WREPL_TYPE_MHOMED,
4903 .state = WREPL_STATE_TOMBSTONE,
4904 .node = WREPL_NODE_B,
4906 .num_ips = ctx->addresses_best_num,
4907 .ips = ctx->addresses_best,
4908 .apply_expected = True
4912 * unique,released vs. mhomed,tombstone with different ip(s)
4915 .line = __location__,
4916 .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL),
4920 .num_ips = ctx->addresses_best_num,
4921 .ips = ctx->addresses_best,
4922 .apply_expected = True
4925 .type = WREPL_TYPE_MHOMED,
4926 .state = WREPL_STATE_TOMBSTONE,
4927 .node = WREPL_NODE_B,
4929 .num_ips = ARRAY_SIZE(addresses_B_1),
4930 .ips = addresses_B_1,
4931 .apply_expected = True
4935 * group vs. unique section
4938 * group,released vs. unique,active with same ip(s)
4941 .line = __location__,
4942 .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL),
4944 .nb_flags = NBT_NM_GROUP,
4946 .num_ips = ctx->addresses_best_num,
4947 .ips = ctx->addresses_best,
4948 .apply_expected = True
4951 .type = WREPL_TYPE_UNIQUE,
4952 .state = WREPL_STATE_ACTIVE,
4953 .node = WREPL_NODE_B,
4955 .num_ips = ctx->addresses_best_num,
4956 .ips = ctx->addresses_best,
4957 .apply_expected = False
4961 * group,released vs. unique,active with different ip(s)
4964 .line = __location__,
4965 .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL),
4967 .nb_flags = NBT_NM_GROUP,
4969 .num_ips = ctx->addresses_best_num,
4970 .ips = ctx->addresses_best,
4971 .apply_expected = True
4974 .type = WREPL_TYPE_UNIQUE,
4975 .state = WREPL_STATE_ACTIVE,
4976 .node = WREPL_NODE_B,
4978 .num_ips = ARRAY_SIZE(addresses_B_1),
4979 .ips = addresses_B_1,
4980 .apply_expected = False
4984 * group,released vs. unique,tombstone with same ip(s)
4987 .line = __location__,
4988 .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL),
4990 .nb_flags = NBT_NM_GROUP,
4992 .num_ips = ctx->addresses_best_num,
4993 .ips = ctx->addresses_best,
4994 .apply_expected = True
4997 .type = WREPL_TYPE_UNIQUE,
4998 .state = WREPL_STATE_TOMBSTONE,
4999 .node = WREPL_NODE_B,
5001 .num_ips = ctx->addresses_best_num,
5002 .ips = ctx->addresses_best,
5003 .apply_expected = False
5007 * group,released vs. unique,tombstone with different ip(s)
5010 .line = __location__,
5011 .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL),
5013 .nb_flags = NBT_NM_GROUP,
5015 .num_ips = ctx->addresses_best_num,
5016 .ips = ctx->addresses_best,
5017 .apply_expected = True
5020 .type = WREPL_TYPE_UNIQUE,
5021 .state = WREPL_STATE_TOMBSTONE,
5022 .node = WREPL_NODE_B,
5024 .num_ips = ARRAY_SIZE(addresses_B_1),
5025 .ips = addresses_B_1,
5026 .apply_expected = False
5030 * group vs. group section
5033 * group,released vs. group,active with same ip(s)
5036 .line = __location__,
5037 .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL),
5039 .nb_flags = NBT_NM_GROUP,
5041 .num_ips = ctx->addresses_best_num,
5042 .ips = ctx->addresses_best,
5043 .apply_expected = True
5046 .type = WREPL_TYPE_GROUP,
5047 .state = WREPL_STATE_ACTIVE,
5048 .node = WREPL_NODE_B,
5050 .num_ips = ctx->addresses_best_num,
5051 .ips = ctx->addresses_best,
5052 .apply_expected = True
5056 * group,released vs. group,active with different ip(s)
5059 .line = __location__,
5060 .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL),
5062 .nb_flags = NBT_NM_GROUP,
5064 .num_ips = ctx->addresses_best_num,
5065 .ips = ctx->addresses_best,
5066 .apply_expected = True
5069 .type = WREPL_TYPE_GROUP,
5070 .state = WREPL_STATE_ACTIVE,
5071 .node = WREPL_NODE_B,
5073 .num_ips = ARRAY_SIZE(addresses_B_1),
5074 .ips = addresses_B_1,
5075 .apply_expected = True
5079 * group,released vs. group,tombstone with same ip(s)
5082 .line = __location__,
5083 .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL),
5085 .nb_flags = NBT_NM_GROUP,
5087 .num_ips = ctx->addresses_best_num,
5088 .ips = ctx->addresses_best,
5089 .apply_expected = True
5092 .type = WREPL_TYPE_GROUP,
5093 .state = WREPL_STATE_TOMBSTONE,
5094 .node = WREPL_NODE_B,
5096 .num_ips = ctx->addresses_best_num,
5097 .ips = ctx->addresses_best,
5098 .apply_expected = True
5102 * group,released vs. group,tombstone with different ip(s)
5105 .line = __location__,
5106 .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL),
5108 .nb_flags = NBT_NM_GROUP,
5110 .num_ips = ctx->addresses_best_num,
5111 .ips = ctx->addresses_best,
5112 .apply_expected = True
5115 .type = WREPL_TYPE_GROUP,
5116 .state = WREPL_STATE_TOMBSTONE,
5117 .node = WREPL_NODE_B,
5119 .num_ips = ARRAY_SIZE(addresses_B_1),
5120 .ips = addresses_B_1,
5121 .apply_expected = True
5125 * group vs. special group section
5128 * group,released vs. sgroup,active with same ip(s)
5131 .line = __location__,
5132 .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL),
5134 .nb_flags = NBT_NM_GROUP,
5136 .num_ips = ctx->addresses_best_num,
5137 .ips = ctx->addresses_best,
5138 .apply_expected = True
5141 .type = WREPL_TYPE_SGROUP,
5142 .state = WREPL_STATE_ACTIVE,
5143 .node = WREPL_NODE_B,
5145 .num_ips = ctx->addresses_best_num,
5146 .ips = ctx->addresses_best,
5147 .apply_expected = False
5151 * group,released vs. sgroup,active with different ip(s)
5154 .line = __location__,
5155 .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL),
5157 .nb_flags = NBT_NM_GROUP,
5159 .num_ips = ctx->addresses_best_num,
5160 .ips = ctx->addresses_best,
5161 .apply_expected = True
5164 .type = WREPL_TYPE_SGROUP,
5165 .state = WREPL_STATE_ACTIVE,
5166 .node = WREPL_NODE_B,
5168 .num_ips = ARRAY_SIZE(addresses_B_1),
5169 .ips = addresses_B_1,
5170 .apply_expected = False
5174 * group,released vs. sgroup,tombstone with same ip(s)
5177 .line = __location__,
5178 .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL),
5180 .nb_flags = NBT_NM_GROUP,
5182 .num_ips = ctx->addresses_best_num,
5183 .ips = ctx->addresses_best,
5184 .apply_expected = True
5187 .type = WREPL_TYPE_SGROUP,
5188 .state = WREPL_STATE_TOMBSTONE,
5189 .node = WREPL_NODE_B,
5191 .num_ips = ctx->addresses_best_num,
5192 .ips = ctx->addresses_best,
5193 .apply_expected = False
5197 * group,released vs. sgroup,tombstone with different ip(s)
5200 .line = __location__,
5201 .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL),
5203 .nb_flags = NBT_NM_GROUP,
5205 .num_ips = ctx->addresses_best_num,
5206 .ips = ctx->addresses_best,
5207 .apply_expected = True
5210 .type = WREPL_TYPE_SGROUP,
5211 .state = WREPL_STATE_TOMBSTONE,
5212 .node = WREPL_NODE_B,
5214 .num_ips = ARRAY_SIZE(addresses_B_1),
5215 .ips = addresses_B_1,
5216 .apply_expected = False
5220 * group vs. multi homed section
5223 * group,released vs. mhomed,active with same ip(s)
5226 .line = __location__,
5227 .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL),
5229 .nb_flags = NBT_NM_GROUP,
5231 .num_ips = ctx->addresses_best_num,
5232 .ips = ctx->addresses_best,
5233 .apply_expected = True
5236 .type = WREPL_TYPE_MHOMED,
5237 .state = WREPL_STATE_ACTIVE,
5238 .node = WREPL_NODE_B,
5240 .num_ips = ctx->addresses_best_num,
5241 .ips = ctx->addresses_best,
5242 .apply_expected = False
5246 * group,released vs. mhomed,active with different ip(s)
5249 .line = __location__,
5250 .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL),
5252 .nb_flags = NBT_NM_GROUP,
5254 .num_ips = ctx->addresses_best_num,
5255 .ips = ctx->addresses_best,
5256 .apply_expected = True
5259 .type = WREPL_TYPE_MHOMED,
5260 .state = WREPL_STATE_ACTIVE,
5261 .node = WREPL_NODE_B,
5263 .num_ips = ARRAY_SIZE(addresses_B_1),
5264 .ips = addresses_B_1,
5265 .apply_expected = False
5269 * group,released vs. mhomed,tombstone with same ip(s)
5272 .line = __location__,
5273 .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL),
5275 .nb_flags = NBT_NM_GROUP,
5277 .num_ips = ctx->addresses_best_num,
5278 .ips = ctx->addresses_best,
5279 .apply_expected = True
5282 .type = WREPL_TYPE_MHOMED,
5283 .state = WREPL_STATE_TOMBSTONE,
5284 .node = WREPL_NODE_B,
5286 .num_ips = ctx->addresses_best_num,
5287 .ips = ctx->addresses_best,
5288 .apply_expected = False
5292 * group,released vs. mhomed,tombstone with different ip(s)
5295 .line = __location__,
5296 .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL),
5298 .nb_flags = NBT_NM_GROUP,
5300 .num_ips = ctx->addresses_best_num,
5301 .ips = ctx->addresses_best,
5302 .apply_expected = True
5305 .type = WREPL_TYPE_MHOMED,
5306 .state = WREPL_STATE_TOMBSTONE,
5307 .node = WREPL_NODE_B,
5309 .num_ips = ARRAY_SIZE(addresses_B_1),
5310 .ips = addresses_B_1,
5311 .apply_expected = False
5315 * special group vs. unique section
5318 * sgroup,released vs. unique,active with same ip(s)
5321 .line = __location__,
5322 .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL),
5324 .nb_flags = NBT_NM_GROUP,
5326 .num_ips = ctx->addresses_best_num,
5327 .ips = ctx->addresses_best,
5328 .apply_expected = True
5331 .type = WREPL_TYPE_UNIQUE,
5332 .state = WREPL_STATE_ACTIVE,
5333 .node = WREPL_NODE_B,
5335 .num_ips = ctx->addresses_best_num,
5336 .ips = ctx->addresses_best,
5337 .apply_expected = True
5341 * sgroup,released vs. unique,active with different ip(s)
5344 .line = __location__,
5345 .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL),
5347 .nb_flags = NBT_NM_GROUP,
5349 .num_ips = ctx->addresses_best_num,
5350 .ips = ctx->addresses_best,
5351 .apply_expected = True
5354 .type = WREPL_TYPE_UNIQUE,
5355 .state = WREPL_STATE_ACTIVE,
5356 .node = WREPL_NODE_B,
5358 .num_ips = ARRAY_SIZE(addresses_B_1),
5359 .ips = addresses_B_1,
5360 .apply_expected = True
5364 * sgroup,released vs. unique,tombstone with same ip(s)
5367 .line = __location__,
5368 .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL),
5370 .nb_flags = NBT_NM_GROUP,
5372 .num_ips = ctx->addresses_best_num,
5373 .ips = ctx->addresses_best,
5374 .apply_expected = True
5377 .type = WREPL_TYPE_UNIQUE,
5378 .state = WREPL_STATE_TOMBSTONE,
5379 .node = WREPL_NODE_B,
5381 .num_ips = ctx->addresses_best_num,
5382 .ips = ctx->addresses_best,
5383 .apply_expected = True
5387 * sgroup,released vs. unique,tombstone with different ip(s)
5390 .line = __location__,
5391 .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL),
5393 .nb_flags = NBT_NM_GROUP,
5395 .num_ips = ctx->addresses_best_num,
5396 .ips = ctx->addresses_best,
5397 .apply_expected = True
5400 .type = WREPL_TYPE_UNIQUE,
5401 .state = WREPL_STATE_TOMBSTONE,
5402 .node = WREPL_NODE_B,
5404 .num_ips = ARRAY_SIZE(addresses_B_1),
5405 .ips = addresses_B_1,
5406 .apply_expected = True
5410 * special group vs. group section
5413 * sgroup,released vs. group,active with same ip(s)
5416 .line = __location__,
5417 .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL),
5419 .nb_flags = NBT_NM_GROUP,
5421 .num_ips = ctx->addresses_best_num,
5422 .ips = ctx->addresses_best,
5423 .apply_expected = True
5426 .type = WREPL_TYPE_GROUP,
5427 .state = WREPL_STATE_ACTIVE,
5428 .node = WREPL_NODE_B,
5430 .num_ips = ctx->addresses_best_num,
5431 .ips = ctx->addresses_best,
5432 .apply_expected = True
5436 * sgroup,released vs. group,active with different ip(s)
5439 .line = __location__,
5440 .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL),
5442 .nb_flags = NBT_NM_GROUP,
5444 .num_ips = ctx->addresses_best_num,
5445 .ips = ctx->addresses_best,
5446 .apply_expected = True
5449 .type = WREPL_TYPE_GROUP,
5450 .state = WREPL_STATE_ACTIVE,
5451 .node = WREPL_NODE_B,
5453 .num_ips = ARRAY_SIZE(addresses_B_1),
5454 .ips = addresses_B_1,
5455 .apply_expected = True
5459 * sgroup,released vs. group,tombstone with same ip(s)
5462 .line = __location__,
5463 .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL),
5465 .nb_flags = NBT_NM_GROUP,
5467 .num_ips = ctx->addresses_best_num,
5468 .ips = ctx->addresses_best,
5469 .apply_expected = True
5472 .type = WREPL_TYPE_GROUP,
5473 .state = WREPL_STATE_TOMBSTONE,
5474 .node = WREPL_NODE_B,
5476 .num_ips = ctx->addresses_best_num,
5477 .ips = ctx->addresses_best,
5478 .apply_expected = True
5482 * sgroup,released vs. group,tombstone with different ip(s)
5485 .line = __location__,
5486 .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL),
5488 .nb_flags = NBT_NM_GROUP,
5490 .num_ips = ctx->addresses_best_num,
5491 .ips = ctx->addresses_best,
5492 .apply_expected = True
5495 .type = WREPL_TYPE_GROUP,
5496 .state = WREPL_STATE_TOMBSTONE,
5497 .node = WREPL_NODE_B,
5499 .num_ips = ARRAY_SIZE(addresses_B_1),
5500 .ips = addresses_B_1,
5501 .apply_expected = True
5505 * special group vs. special group section
5508 * sgroup,released vs. sgroup,active with same ip(s)
5511 .line = __location__,
5512 .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL),
5514 .nb_flags = NBT_NM_GROUP,
5516 .num_ips = ctx->addresses_best_num,
5517 .ips = ctx->addresses_best,
5518 .apply_expected = True
5521 .type = WREPL_TYPE_SGROUP,
5522 .state = WREPL_STATE_ACTIVE,
5523 .node = WREPL_NODE_B,
5525 .num_ips = ctx->addresses_best_num,
5526 .ips = ctx->addresses_best,
5527 .apply_expected = True
5531 * sgroup,released vs. sgroup,active with different ip(s)
5534 .line = __location__,
5535 .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL),
5537 .nb_flags = NBT_NM_GROUP,
5539 .num_ips = ctx->addresses_best_num,
5540 .ips = ctx->addresses_best,
5541 .apply_expected = True
5544 .type = WREPL_TYPE_SGROUP,
5545 .state = WREPL_STATE_ACTIVE,
5546 .node = WREPL_NODE_B,
5548 .num_ips = ARRAY_SIZE(addresses_B_1),
5549 .ips = addresses_B_1,
5550 .apply_expected = True
5554 * sgroup,released vs. sgroup,tombstone with same ip(s)
5557 .line = __location__,
5558 .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL),
5560 .nb_flags = NBT_NM_GROUP,
5562 .num_ips = ctx->addresses_best_num,
5563 .ips = ctx->addresses_best,
5564 .apply_expected = True
5567 .type = WREPL_TYPE_SGROUP,
5568 .state = WREPL_STATE_TOMBSTONE,
5569 .node = WREPL_NODE_B,
5571 .num_ips = ctx->addresses_best_num,
5572 .ips = ctx->addresses_best,
5573 .apply_expected = True
5577 * sgroup,released vs. sgroup,tombstone with different ip(s)
5580 .line = __location__,
5581 .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL),
5583 .nb_flags = NBT_NM_GROUP,
5585 .num_ips = ctx->addresses_best_num,
5586 .ips = ctx->addresses_best,
5587 .apply_expected = True
5590 .type = WREPL_TYPE_SGROUP,
5591 .state = WREPL_STATE_TOMBSTONE,
5592 .node = WREPL_NODE_B,
5594 .num_ips = ARRAY_SIZE(addresses_B_1),
5595 .ips = addresses_B_1,
5596 .apply_expected = True
5600 * special group vs. multi homed section
5603 * sgroup,released vs. mhomed,active with same ip(s)
5606 .line = __location__,
5607 .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL),
5609 .nb_flags = NBT_NM_GROUP,
5611 .num_ips = ctx->addresses_best_num,
5612 .ips = ctx->addresses_best,
5613 .apply_expected = True
5616 .type = WREPL_TYPE_MHOMED,
5617 .state = WREPL_STATE_ACTIVE,
5618 .node = WREPL_NODE_B,
5620 .num_ips = ctx->addresses_best_num,
5621 .ips = ctx->addresses_best,
5622 .apply_expected = True
5626 * sgroup,released vs. mhomed,active with different ip(s)
5629 .line = __location__,
5630 .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL),
5632 .nb_flags = NBT_NM_GROUP,
5634 .num_ips = ctx->addresses_best_num,
5635 .ips = ctx->addresses_best,
5636 .apply_expected = True
5639 .type = WREPL_TYPE_MHOMED,
5640 .state = WREPL_STATE_ACTIVE,
5641 .node = WREPL_NODE_B,
5643 .num_ips = ARRAY_SIZE(addresses_B_1),
5644 .ips = addresses_B_1,
5645 .apply_expected = True
5649 * sgroup,released vs. mhomed,tombstone with same ip(s)
5652 .line = __location__,
5653 .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL),
5655 .nb_flags = NBT_NM_GROUP,
5657 .num_ips = ctx->addresses_best_num,
5658 .ips = ctx->addresses_best,
5659 .apply_expected = True
5662 .type = WREPL_TYPE_MHOMED,
5663 .state = WREPL_STATE_TOMBSTONE,
5664 .node = WREPL_NODE_B,
5666 .num_ips = ctx->addresses_best_num,
5667 .ips = ctx->addresses_best,
5668 .apply_expected = True
5672 * sgroup,released vs. mhomed,tombstone with different ip(s)
5675 .line = __location__,
5676 .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL),
5678 .nb_flags = NBT_NM_GROUP,
5680 .num_ips = ctx->addresses_best_num,
5681 .ips = ctx->addresses_best,
5682 .apply_expected = True
5685 .type = WREPL_TYPE_MHOMED,
5686 .state = WREPL_STATE_TOMBSTONE,
5687 .node = WREPL_NODE_B,
5689 .num_ips = ARRAY_SIZE(addresses_B_1),
5690 .ips = addresses_B_1,
5691 .apply_expected = True
5695 * multi homed vs. unique section
5698 * mhomed,released vs. unique,active with same ip(s)
5701 .line = __location__,
5702 .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL),
5706 .num_ips = ctx->addresses_best_num,
5707 .ips = ctx->addresses_best,
5708 .apply_expected = True
5711 .type = WREPL_TYPE_UNIQUE,
5712 .state = WREPL_STATE_ACTIVE,
5713 .node = WREPL_NODE_B,
5715 .num_ips = ctx->addresses_best_num,
5716 .ips = ctx->addresses_best,
5717 .apply_expected = True
5721 * mhomed,released vs. unique,active with different ip(s)
5724 .line = __location__,
5725 .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL),
5729 .num_ips = ctx->addresses_best_num,
5730 .ips = ctx->addresses_best,
5731 .apply_expected = True
5734 .type = WREPL_TYPE_UNIQUE,
5735 .state = WREPL_STATE_ACTIVE,
5736 .node = WREPL_NODE_B,
5738 .num_ips = ARRAY_SIZE(addresses_B_1),
5739 .ips = addresses_B_1,
5740 .apply_expected = True
5744 * mhomed,released vs. unique,tombstone with same ip(s)
5747 .line = __location__,
5748 .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL),
5752 .num_ips = ctx->addresses_best_num,
5753 .ips = ctx->addresses_best,
5754 .apply_expected = True
5757 .type = WREPL_TYPE_UNIQUE,
5758 .state = WREPL_STATE_TOMBSTONE,
5759 .node = WREPL_NODE_B,
5761 .num_ips = ctx->addresses_best_num,
5762 .ips = ctx->addresses_best,
5763 .apply_expected = True
5767 * mhomed,released vs. unique,tombstone with different ip(s)
5770 .line = __location__,
5771 .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL),
5775 .num_ips = ctx->addresses_best_num,
5776 .ips = ctx->addresses_best,
5777 .apply_expected = True
5780 .type = WREPL_TYPE_UNIQUE,
5781 .state = WREPL_STATE_TOMBSTONE,
5782 .node = WREPL_NODE_B,
5784 .num_ips = ARRAY_SIZE(addresses_B_1),
5785 .ips = addresses_B_1,
5786 .apply_expected = True
5790 * multi homed vs. group section
5793 * mhomed,released vs. group,active with same ip(s)
5796 .line = __location__,
5797 .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL),
5801 .num_ips = ctx->addresses_best_num,
5802 .ips = ctx->addresses_best,
5803 .apply_expected = True
5806 .type = WREPL_TYPE_GROUP,
5807 .state = WREPL_STATE_ACTIVE,
5808 .node = WREPL_NODE_B,
5810 .num_ips = ctx->addresses_best_num,
5811 .ips = ctx->addresses_best,
5812 .apply_expected = True
5816 * mhomed,released vs. group,active with different ip(s)
5819 .line = __location__,
5820 .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL),
5824 .num_ips = ctx->addresses_best_num,
5825 .ips = ctx->addresses_best,
5826 .apply_expected = True
5829 .type = WREPL_TYPE_GROUP,
5830 .state = WREPL_STATE_ACTIVE,
5831 .node = WREPL_NODE_B,
5833 .num_ips = ARRAY_SIZE(addresses_B_1),
5834 .ips = addresses_B_1,
5835 .apply_expected = True
5839 * mhomed,released vs. group,tombstone with same ip(s)
5842 .line = __location__,
5843 .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL),
5847 .num_ips = ctx->addresses_best_num,
5848 .ips = ctx->addresses_best,
5849 .apply_expected = True
5852 .type = WREPL_TYPE_GROUP,
5853 .state = WREPL_STATE_TOMBSTONE,
5854 .node = WREPL_NODE_B,
5856 .num_ips = ctx->addresses_best_num,
5857 .ips = ctx->addresses_best,
5858 .apply_expected = True
5862 * mhomed,released vs. group,tombstone with different ip(s)
5865 .line = __location__,
5866 .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL),
5870 .num_ips = ctx->addresses_best_num,
5871 .ips = ctx->addresses_best,
5872 .apply_expected = True
5875 .type = WREPL_TYPE_GROUP,
5876 .state = WREPL_STATE_TOMBSTONE,
5877 .node = WREPL_NODE_B,
5879 .num_ips = ARRAY_SIZE(addresses_B_1),
5880 .ips = addresses_B_1,
5881 .apply_expected = True
5885 * multi homed vs. special group section
5888 * mhomed,released vs. sgroup,active with same ip(s)
5891 .line = __location__,
5892 .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL),
5896 .num_ips = ctx->addresses_best_num,
5897 .ips = ctx->addresses_best,
5898 .apply_expected = True
5901 .type = WREPL_TYPE_SGROUP,
5902 .state = WREPL_STATE_ACTIVE,
5903 .node = WREPL_NODE_B,
5905 .num_ips = ctx->addresses_best_num,
5906 .ips = ctx->addresses_best,
5907 .apply_expected = True
5911 * mhomed,released vs. sgroup,active with different ip(s)
5914 .line = __location__,
5915 .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL),
5919 .num_ips = ctx->addresses_best_num,
5920 .ips = ctx->addresses_best,
5921 .apply_expected = True
5924 .type = WREPL_TYPE_SGROUP,
5925 .state = WREPL_STATE_ACTIVE,
5926 .node = WREPL_NODE_B,
5928 .num_ips = ARRAY_SIZE(addresses_B_1),
5929 .ips = addresses_B_1,
5930 .apply_expected = True
5934 * mhomed,released vs. sgroup,tombstone with same ip(s)
5937 .line = __location__,
5938 .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL),
5942 .num_ips = ctx->addresses_best_num,
5943 .ips = ctx->addresses_best,
5944 .apply_expected = True
5947 .type = WREPL_TYPE_SGROUP,
5948 .state = WREPL_STATE_TOMBSTONE,
5949 .node = WREPL_NODE_B,
5951 .num_ips = ctx->addresses_best_num,
5952 .ips = ctx->addresses_best,
5953 .apply_expected = True
5957 * mhomed,released vs. sgroup,tombstone with different ip(s)
5960 .line = __location__,
5961 .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL),
5965 .num_ips = ctx->addresses_best_num,
5966 .ips = ctx->addresses_best,
5967 .apply_expected = True
5970 .type = WREPL_TYPE_SGROUP,
5971 .state = WREPL_STATE_TOMBSTONE,
5972 .node = WREPL_NODE_B,
5974 .num_ips = ARRAY_SIZE(addresses_B_1),
5975 .ips = addresses_B_1,
5976 .apply_expected = True
5980 * multi homed vs. multi homed section
5983 * mhomed,released vs. mhomed,active with same ip(s)
5986 .line = __location__,
5987 .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL),
5991 .num_ips = ctx->addresses_best_num,
5992 .ips = ctx->addresses_best,
5993 .apply_expected = True
5996 .type = WREPL_TYPE_MHOMED,
5997 .state = WREPL_STATE_ACTIVE,
5998 .node = WREPL_NODE_B,
6000 .num_ips = ctx->addresses_best_num,
6001 .ips = ctx->addresses_best,
6002 .apply_expected = True
6006 * mhomed,released vs. mhomed,active with different ip(s)
6009 .line = __location__,
6010 .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL),
6014 .num_ips = ctx->addresses_best_num,
6015 .ips = ctx->addresses_best,
6016 .apply_expected = True
6019 .type = WREPL_TYPE_MHOMED,
6020 .state = WREPL_STATE_ACTIVE,
6021 .node = WREPL_NODE_B,
6023 .num_ips = ARRAY_SIZE(addresses_B_1),
6024 .ips = addresses_B_1,
6025 .apply_expected = True
6029 * mhomed,released vs. mhomed,tombstone with same ip(s)
6032 .line = __location__,
6033 .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL),
6037 .num_ips = ctx->addresses_best_num,
6038 .ips = ctx->addresses_best,
6039 .apply_expected = True
6042 .type = WREPL_TYPE_MHOMED,
6043 .state = WREPL_STATE_TOMBSTONE,
6044 .node = WREPL_NODE_B,
6046 .num_ips = ctx->addresses_best_num,
6047 .ips = ctx->addresses_best,
6048 .apply_expected = True
6052 * mhomed,released vs. mhomed,tombstone with different ip(s)
6055 .line = __location__,
6056 .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL),
6060 .num_ips = ctx->addresses_best_num,
6061 .ips = ctx->addresses_best,
6062 .apply_expected = True
6065 .type = WREPL_TYPE_MHOMED,
6066 .state = WREPL_STATE_TOMBSTONE,
6067 .node = WREPL_NODE_B,
6069 .num_ips = ARRAY_SIZE(addresses_B_1),
6070 .ips = addresses_B_1,
6071 .apply_expected = True
6076 if (!ctx) return False;
6078 printf("Test Replica records vs. owned released records\n");
6080 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
6081 printf("%s => %s\n", nbt_name_string(ctx, &records[i].name),
6082 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
6087 name_register->in.name = records[i].name;
6088 name_register->in.dest_addr = ctx->address;
6089 name_register->in.address = records[i].wins.ips[0].ip;
6090 name_register->in.nb_flags = records[i].wins.nb_flags;
6091 name_register->in.register_demand= False;
6092 name_register->in.broadcast = False;
6093 name_register->in.multi_homed = records[i].wins.mhomed;
6094 name_register->in.ttl = 300000;
6095 name_register->in.timeout = 70;
6096 name_register->in.retries = 0;
6098 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
6099 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6100 printf("No response from %s for name register\n", ctx->address);
6103 if (!NT_STATUS_IS_OK(status)) {
6104 printf("Bad response from %s for name register - %s\n",
6105 ctx->address, nt_errstr(status));
6108 CHECK_VALUE(name_register->out.rcode, 0);
6109 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
6110 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
6111 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
6112 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
6113 CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[0].ip);
6115 /* release the record */
6116 release->in.name = records[i].name;
6117 release->in.dest_addr = ctx->address;
6118 release->in.address = records[i].wins.ips[0].ip;
6119 release->in.nb_flags = records[i].wins.nb_flags;
6120 release->in.broadcast = False;
6121 release->in.timeout = 30;
6122 release->in.retries = 0;
6124 status = nbt_name_release(ctx->nbtsock, ctx, release);
6125 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6126 printf("No response from %s for name release\n", ctx->address);
6129 if (!NT_STATUS_IS_OK(status)) {
6130 printf("Bad response from %s for name query - %s\n",
6131 ctx->address, nt_errstr(status));
6134 CHECK_VALUE(release->out.rcode, 0);
6139 wins_name->name = &records[i].name;
6140 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
6141 records[i].replica.state,
6142 records[i].replica.node,
6143 records[i].replica.is_static);
6144 wins_name->id = ++ctx->b.max_version;
6145 if (wins_name->flags & 2) {
6146 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
6147 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
6149 wins_name->addresses.ip = records[i].replica.ips[0].ip;
6151 wins_name->unknown = "255.255.255.255";
6153 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
6154 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
6155 records[i].replica.apply_expected);
6157 if (records[i].replica.apply_expected) {
6158 wins_name->name = &records[i].name;
6159 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
6160 WREPL_STATE_TOMBSTONE,
6161 WREPL_NODE_B, False);
6162 wins_name->id = ++ctx->b.max_version;
6163 wins_name->addresses.ip = addresses_B_1[0].ip;
6164 wins_name->unknown = "255.255.255.255";
6166 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
6167 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
6169 release->in.name = records[i].name;
6170 release->in.dest_addr = ctx->address;
6171 release->in.address = records[i].wins.ips[0].ip;
6172 release->in.nb_flags = records[i].wins.nb_flags;
6173 release->in.broadcast = False;
6174 release->in.timeout = 30;
6175 release->in.retries = 0;
6177 status = nbt_name_release(ctx->nbtsock, ctx, release);
6178 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6179 printf("No response from %s for name release\n", ctx->address);
6182 if (!NT_STATUS_IS_OK(status)) {
6183 printf("Bad response from %s for name query - %s\n",
6184 ctx->address, nt_errstr(status));
6187 CHECK_VALUE(release->out.rcode, 0);
6191 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
6199 struct test_conflict_owned_active_vs_replica_struct {
6200 const char *line; /* just better debugging */
6201 const char *section; /* just better debugging */
6202 struct nbt_name name;
6208 const struct wrepl_ip *ips;
6209 BOOL apply_expected;
6214 BOOL expect_release;
6217 /* when num_ips == 0, then .wins.ips are used */
6219 const struct wrepl_ip *ips;
6222 enum wrepl_name_type type;
6223 enum wrepl_name_state state;
6224 enum wrepl_name_node node;
6227 const struct wrepl_ip *ips;
6228 BOOL apply_expected;
6234 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
6235 struct nbt_name_packet *req_packet,
6236 const struct nbt_peer_socket *src);
6238 static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_conn *ctx)
6242 struct wrepl_wins_name wins_name_;
6243 struct wrepl_wins_name *wins_name = &wins_name_;
6244 struct nbt_name_register name_register_;
6245 struct nbt_name_register *name_register = &name_register_;
6246 struct nbt_name_release release_;
6247 struct nbt_name_release *release = &release_;
6249 struct test_conflict_owned_active_vs_replica_struct records[] = {
6251 * unique vs. unique section
6254 * unique,active vs. unique,active with same ip(s), unchecked
6257 .line = __location__,
6258 .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL),
6262 .num_ips = ctx->addresses_best_num,
6263 .ips = ctx->addresses_best,
6264 .apply_expected = True
6270 .type = WREPL_TYPE_UNIQUE,
6271 .state = WREPL_STATE_ACTIVE,
6272 .node = WREPL_NODE_B,
6274 .num_ips = ctx->addresses_best_num,
6275 .ips = ctx->addresses_best,
6276 .apply_expected = True
6280 * unique,active vs. unique,active with different ip(s), positive response
6283 .line = __location__,
6284 .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL),
6288 .num_ips = ctx->addresses_best_num,
6289 .ips = ctx->addresses_best,
6290 .apply_expected = True
6297 .type = WREPL_TYPE_UNIQUE,
6298 .state = WREPL_STATE_ACTIVE,
6299 .node = WREPL_NODE_B,
6301 .num_ips = ARRAY_SIZE(addresses_B_1),
6302 .ips = addresses_B_1,
6303 .apply_expected = False
6307 * unique,active vs. unique,active with different ip(s), positive response other ips
6310 .line = __location__,
6311 .name = _NBT_NAME("_UA_UA_DI_O", 0x00, NULL),
6315 .num_ips = ctx->addresses_best_num,
6316 .ips = ctx->addresses_best,
6317 .apply_expected = True
6322 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6323 .ips = addresses_A_3_4,
6326 .type = WREPL_TYPE_UNIQUE,
6327 .state = WREPL_STATE_ACTIVE,
6328 .node = WREPL_NODE_B,
6330 .num_ips = ARRAY_SIZE(addresses_B_1),
6331 .ips = addresses_B_1,
6332 .apply_expected = False
6336 * unique,active vs. unique,active with different ip(s), negative response
6339 .line = __location__,
6340 .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL),
6344 .num_ips = ctx->addresses_best_num,
6345 .ips = ctx->addresses_best,
6346 .apply_expected = True
6353 .type = WREPL_TYPE_UNIQUE,
6354 .state = WREPL_STATE_ACTIVE,
6355 .node = WREPL_NODE_B,
6357 .num_ips = ARRAY_SIZE(addresses_B_1),
6358 .ips = addresses_B_1,
6359 .apply_expected = True
6363 * unique,active vs. unique,tombstone with same ip(s), unchecked
6366 .line = __location__,
6367 .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL),
6371 .num_ips = ctx->addresses_best_num,
6372 .ips = ctx->addresses_best,
6373 .apply_expected = True
6379 .type = WREPL_TYPE_UNIQUE,
6380 .state = WREPL_STATE_TOMBSTONE,
6381 .node = WREPL_NODE_B,
6383 .num_ips = ctx->addresses_best_num,
6384 .ips = ctx->addresses_best,
6385 .apply_expected = False
6389 * unique,active vs. unique,tombstone with different ip(s), unchecked
6392 .line = __location__,
6393 .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL),
6397 .num_ips = ctx->addresses_best_num,
6398 .ips = ctx->addresses_best,
6399 .apply_expected = True
6405 .type = WREPL_TYPE_UNIQUE,
6406 .state = WREPL_STATE_TOMBSTONE,
6407 .node = WREPL_NODE_B,
6409 .num_ips = ARRAY_SIZE(addresses_B_1),
6410 .ips = addresses_B_1,
6411 .apply_expected = False
6415 * unique vs. group section
6418 * unique,active vs. group,active with same ip(s), release expected
6421 .line = __location__,
6422 .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL),
6426 .num_ips = ctx->addresses_best_num,
6427 .ips = ctx->addresses_best,
6428 .apply_expected = True
6432 .expect_release = True,
6435 .type = WREPL_TYPE_GROUP,
6436 .state = WREPL_STATE_ACTIVE,
6437 .node = WREPL_NODE_B,
6439 .num_ips = ctx->addresses_best_num,
6440 .ips = ctx->addresses_best,
6441 .apply_expected = True
6445 * unique,active vs. group,active with different ip(s), release expected
6448 .line = __location__,
6449 .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL),
6453 .num_ips = ctx->addresses_best_num,
6454 .ips = ctx->addresses_best,
6455 .apply_expected = True
6459 .expect_release = True,
6462 .type = WREPL_TYPE_GROUP,
6463 .state = WREPL_STATE_ACTIVE,
6464 .node = WREPL_NODE_B,
6466 .num_ips = ARRAY_SIZE(addresses_B_1),
6467 .ips = addresses_B_1,
6468 .apply_expected = True
6472 * unique,active vs. group,tombstone with same ip(s), unchecked
6475 .line = __location__,
6476 .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL),
6480 .num_ips = ctx->addresses_best_num,
6481 .ips = ctx->addresses_best,
6482 .apply_expected = True
6488 .type = WREPL_TYPE_GROUP,
6489 .state = WREPL_STATE_TOMBSTONE,
6490 .node = WREPL_NODE_B,
6492 .num_ips = ctx->addresses_best_num,
6493 .ips = ctx->addresses_best,
6494 .apply_expected = False
6498 * unique,active vs. group,tombstone with different ip(s), unchecked
6501 .line = __location__,
6502 .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL),
6506 .num_ips = ctx->addresses_best_num,
6507 .ips = ctx->addresses_best,
6508 .apply_expected = True
6514 .type = WREPL_TYPE_GROUP,
6515 .state = WREPL_STATE_TOMBSTONE,
6516 .node = WREPL_NODE_B,
6518 .num_ips = ARRAY_SIZE(addresses_B_1),
6519 .ips = addresses_B_1,
6520 .apply_expected = False
6524 * unique vs. special group section
6527 * unique,active vs. sgroup,active with same ip(s), release expected
6530 .line = __location__,
6531 .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL),
6535 .num_ips = ctx->addresses_best_num,
6536 .ips = ctx->addresses_best,
6537 .apply_expected = True
6541 .expect_release = True,
6544 .type = WREPL_TYPE_SGROUP,
6545 .state = WREPL_STATE_ACTIVE,
6546 .node = WREPL_NODE_B,
6548 .num_ips = ctx->addresses_best_num,
6549 .ips = ctx->addresses_best,
6550 .apply_expected = True
6554 * unique,active vs. group,active with different ip(s), release expected
6557 .line = __location__,
6558 .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL),
6562 .num_ips = ctx->addresses_best_num,
6563 .ips = ctx->addresses_best,
6564 .apply_expected = True
6568 .expect_release = True,
6571 .type = WREPL_TYPE_SGROUP,
6572 .state = WREPL_STATE_ACTIVE,
6573 .node = WREPL_NODE_B,
6575 .num_ips = ARRAY_SIZE(addresses_B_1),
6576 .ips = addresses_B_1,
6577 .apply_expected = True
6581 * unique,active vs. sgroup,tombstone with same ip(s), unchecked
6584 .line = __location__,
6585 .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL),
6589 .num_ips = ctx->addresses_best_num,
6590 .ips = ctx->addresses_best,
6591 .apply_expected = True
6597 .type = WREPL_TYPE_SGROUP,
6598 .state = WREPL_STATE_TOMBSTONE,
6599 .node = WREPL_NODE_B,
6601 .num_ips = ctx->addresses_best_num,
6602 .ips = ctx->addresses_best,
6603 .apply_expected = False
6607 * unique,active vs. sgroup,tombstone with different ip(s), unchecked
6610 .line = __location__,
6611 .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL),
6615 .num_ips = ctx->addresses_best_num,
6616 .ips = ctx->addresses_best,
6617 .apply_expected = True
6623 .type = WREPL_TYPE_SGROUP,
6624 .state = WREPL_STATE_TOMBSTONE,
6625 .node = WREPL_NODE_B,
6627 .num_ips = ARRAY_SIZE(addresses_B_1),
6628 .ips = addresses_B_1,
6629 .apply_expected = False
6633 * unique vs. multi homed section
6636 * unique,active vs. mhomed,active with same ip(s), unchecked
6639 .line = __location__,
6640 .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL),
6644 .num_ips = ctx->addresses_best_num,
6645 .ips = ctx->addresses_best,
6646 .apply_expected = True
6652 .type = WREPL_TYPE_MHOMED,
6653 .state = WREPL_STATE_ACTIVE,
6654 .node = WREPL_NODE_B,
6656 .num_ips = ctx->addresses_best_num,
6657 .ips = ctx->addresses_best,
6658 .apply_expected = True
6662 * unique,active vs. mhomed,active with superset ip(s), unchecked
6665 .line = __location__,
6666 .name = _NBT_NAME("_UA_MA_SP_U", 0x00, NULL),
6670 .num_ips = ctx->addresses_best_num,
6671 .ips = ctx->addresses_best,
6672 .apply_expected = True
6678 .type = WREPL_TYPE_MHOMED,
6679 .state = WREPL_STATE_ACTIVE,
6680 .node = WREPL_NODE_B,
6682 .num_ips = ctx->addresses_all_num,
6683 .ips = ctx->addresses_all,
6684 .apply_expected = True
6688 * unique,active vs. mhomed,active with different ip(s), positive response
6691 .line = __location__,
6692 .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL),
6696 .num_ips = ctx->addresses_best_num,
6697 .ips = ctx->addresses_best,
6698 .apply_expected = True
6705 .type = WREPL_TYPE_MHOMED,
6706 .state = WREPL_STATE_ACTIVE,
6707 .node = WREPL_NODE_B,
6709 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6710 .ips = addresses_B_3_4,
6711 .apply_expected = False
6715 * unique,active vs. mhomed,active with different ip(s), positive response other ips
6718 .line = __location__,
6719 .name = _NBT_NAME("_UA_MA_DI_O", 0x00, NULL),
6723 .num_ips = ctx->addresses_best_num,
6724 .ips = ctx->addresses_best,
6725 .apply_expected = True
6730 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6731 .ips = addresses_A_3_4,
6734 .type = WREPL_TYPE_MHOMED,
6735 .state = WREPL_STATE_ACTIVE,
6736 .node = WREPL_NODE_B,
6738 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6739 .ips = addresses_B_3_4,
6740 .apply_expected = False
6744 * unique,active vs. mhomed,active with different ip(s), negative response
6747 .line = __location__,
6748 .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL),
6752 .num_ips = ctx->addresses_best_num,
6753 .ips = ctx->addresses_best,
6754 .apply_expected = True
6761 .type = WREPL_TYPE_MHOMED,
6762 .state = WREPL_STATE_ACTIVE,
6763 .node = WREPL_NODE_B,
6765 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6766 .ips = addresses_B_3_4,
6767 .apply_expected = True
6771 * unique,active vs. mhomed,tombstone with same ip(s), unchecked
6774 .line = __location__,
6775 .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL),
6779 .num_ips = ctx->addresses_best_num,
6780 .ips = ctx->addresses_best,
6781 .apply_expected = True
6787 .type = WREPL_TYPE_MHOMED,
6788 .state = WREPL_STATE_TOMBSTONE,
6789 .node = WREPL_NODE_B,
6791 .num_ips = ctx->addresses_best_num,
6792 .ips = ctx->addresses_best,
6793 .apply_expected = False
6797 * unique,active vs. mhomed,tombstone with different ip(s), unchecked
6800 .line = __location__,
6801 .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL),
6805 .num_ips = ctx->addresses_best_num,
6806 .ips = ctx->addresses_best,
6807 .apply_expected = True
6813 .type = WREPL_TYPE_MHOMED,
6814 .state = WREPL_STATE_TOMBSTONE,
6815 .node = WREPL_NODE_B,
6817 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6818 .ips = addresses_B_3_4,
6819 .apply_expected = False
6823 * normal group vs. unique section
6826 * group,active vs. unique,active with same ip(s), unchecked
6829 .line = __location__,
6830 .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL),
6832 .nb_flags = NBT_NM_GROUP,
6834 .num_ips = ctx->addresses_best_num,
6835 .ips = ctx->addresses_best,
6836 .apply_expected = True
6842 .type = WREPL_TYPE_UNIQUE,
6843 .state = WREPL_STATE_ACTIVE,
6844 .node = WREPL_NODE_B,
6846 .num_ips = ctx->addresses_best_num,
6847 .ips = ctx->addresses_best,
6848 .apply_expected = False
6852 * group,active vs. unique,active with different ip(s), unchecked
6855 .line = __location__,
6856 .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL),
6858 .nb_flags = NBT_NM_GROUP,
6860 .num_ips = ctx->addresses_best_num,
6861 .ips = ctx->addresses_best,
6862 .apply_expected = True
6868 .type = WREPL_TYPE_UNIQUE,
6869 .state = WREPL_STATE_ACTIVE,
6870 .node = WREPL_NODE_B,
6872 .num_ips = ARRAY_SIZE(addresses_B_1),
6873 .ips = addresses_B_1,
6874 .apply_expected = False
6878 * group,active vs. unique,tombstone with same ip(s), unchecked
6881 .line = __location__,
6882 .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL),
6884 .nb_flags = NBT_NM_GROUP,
6886 .num_ips = ctx->addresses_best_num,
6887 .ips = ctx->addresses_best,
6888 .apply_expected = True
6894 .type = WREPL_TYPE_UNIQUE,
6895 .state = WREPL_STATE_TOMBSTONE,
6896 .node = WREPL_NODE_B,
6898 .num_ips = ctx->addresses_best_num,
6899 .ips = ctx->addresses_best,
6900 .apply_expected = False
6904 * group,active vs. unique,tombstone with different ip(s), unchecked
6907 .line = __location__,
6908 .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL),
6910 .nb_flags = NBT_NM_GROUP,
6912 .num_ips = ctx->addresses_best_num,
6913 .ips = ctx->addresses_best,
6914 .apply_expected = True
6920 .type = WREPL_TYPE_UNIQUE,
6921 .state = WREPL_STATE_TOMBSTONE,
6922 .node = WREPL_NODE_B,
6924 .num_ips = ARRAY_SIZE(addresses_B_1),
6925 .ips = addresses_B_1,
6926 .apply_expected = False
6930 * normal group vs. normal group section
6933 * group,active vs. group,active with same ip(s), unchecked
6936 .line = __location__,
6937 .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL),
6939 .nb_flags = NBT_NM_GROUP,
6941 .num_ips = ctx->addresses_best_num,
6942 .ips = ctx->addresses_best,
6943 .apply_expected = True
6949 .type = WREPL_TYPE_GROUP,
6950 .state = WREPL_STATE_ACTIVE,
6951 .node = WREPL_NODE_B,
6953 .num_ips = ctx->addresses_best_num,
6954 .ips = ctx->addresses_best,
6955 .apply_expected = True
6959 * group,active vs. group,active with different ip(s), unchecked
6962 .line = __location__,
6963 .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL),
6965 .nb_flags = NBT_NM_GROUP,
6967 .num_ips = ctx->addresses_best_num,
6968 .ips = ctx->addresses_best,
6969 .apply_expected = True
6975 .type = WREPL_TYPE_GROUP,
6976 .state = WREPL_STATE_ACTIVE,
6977 .node = WREPL_NODE_B,
6979 .num_ips = ARRAY_SIZE(addresses_B_1),
6980 .ips = addresses_B_1,
6981 .apply_expected = True
6985 * group,active vs. group,tombstone with same ip(s), unchecked
6988 .line = __location__,
6989 .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL),
6991 .nb_flags = NBT_NM_GROUP,
6993 .num_ips = ctx->addresses_best_num,
6994 .ips = ctx->addresses_best,
6995 .apply_expected = True
7001 .type = WREPL_TYPE_GROUP,
7002 .state = WREPL_STATE_TOMBSTONE,
7003 .node = WREPL_NODE_B,
7005 .num_ips = ctx->addresses_best_num,
7006 .ips = ctx->addresses_best,
7007 .apply_expected = False
7011 * group,active vs. group,tombstone with different ip(s), unchecked
7014 .line = __location__,
7015 .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL),
7017 .nb_flags = NBT_NM_GROUP,
7019 .num_ips = ctx->addresses_best_num,
7020 .ips = ctx->addresses_best,
7021 .apply_expected = True
7027 .type = WREPL_TYPE_GROUP,
7028 .state = WREPL_STATE_TOMBSTONE,
7029 .node = WREPL_NODE_B,
7031 .num_ips = ARRAY_SIZE(addresses_B_1),
7032 .ips = addresses_B_1,
7033 .apply_expected = False
7037 * normal group vs. special group section
7040 * group,active vs. sgroup,active with same ip(s), unchecked
7043 .line = __location__,
7044 .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL),
7046 .nb_flags = NBT_NM_GROUP,
7048 .num_ips = ctx->addresses_best_num,
7049 .ips = ctx->addresses_best,
7050 .apply_expected = True
7056 .type = WREPL_TYPE_SGROUP,
7057 .state = WREPL_STATE_ACTIVE,
7058 .node = WREPL_NODE_B,
7060 .num_ips = ctx->addresses_best_num,
7061 .ips = ctx->addresses_best,
7062 .apply_expected = False
7066 * group,active vs. sgroup,active with different ip(s), unchecked
7069 .line = __location__,
7070 .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL),
7072 .nb_flags = NBT_NM_GROUP,
7074 .num_ips = ctx->addresses_best_num,
7075 .ips = ctx->addresses_best,
7076 .apply_expected = True
7082 .type = WREPL_TYPE_SGROUP,
7083 .state = WREPL_STATE_ACTIVE,
7084 .node = WREPL_NODE_B,
7086 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7087 .ips = addresses_B_3_4,
7088 .apply_expected = False
7092 * group,active vs. sgroup,tombstone with same ip(s), unchecked
7095 .line = __location__,
7096 .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL),
7098 .nb_flags = NBT_NM_GROUP,
7100 .num_ips = ctx->addresses_best_num,
7101 .ips = ctx->addresses_best,
7102 .apply_expected = True
7108 .type = WREPL_TYPE_SGROUP,
7109 .state = WREPL_STATE_TOMBSTONE,
7110 .node = WREPL_NODE_B,
7112 .num_ips = ctx->addresses_best_num,
7113 .ips = ctx->addresses_best,
7114 .apply_expected = False
7118 * group,active vs. sgroup,tombstone with different ip(s), unchecked
7121 .line = __location__,
7122 .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL),
7124 .nb_flags = NBT_NM_GROUP,
7126 .num_ips = ctx->addresses_best_num,
7127 .ips = ctx->addresses_best,
7128 .apply_expected = True
7134 .type = WREPL_TYPE_SGROUP,
7135 .state = WREPL_STATE_TOMBSTONE,
7136 .node = WREPL_NODE_B,
7138 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7139 .ips = addresses_B_3_4,
7140 .apply_expected = False
7144 * normal group vs. multi homed section
7147 * group,active vs. mhomed,active with same ip(s), unchecked
7150 .line = __location__,
7151 .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL),
7153 .nb_flags = NBT_NM_GROUP,
7155 .num_ips = ctx->addresses_best_num,
7156 .ips = ctx->addresses_best,
7157 .apply_expected = True
7163 .type = WREPL_TYPE_MHOMED,
7164 .state = WREPL_STATE_ACTIVE,
7165 .node = WREPL_NODE_B,
7167 .num_ips = ctx->addresses_best_num,
7168 .ips = ctx->addresses_best,
7169 .apply_expected = False
7173 * group,active vs. mhomed,active with different ip(s), unchecked
7176 .line = __location__,
7177 .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL),
7179 .nb_flags = NBT_NM_GROUP,
7181 .num_ips = ctx->addresses_best_num,
7182 .ips = ctx->addresses_best,
7183 .apply_expected = True
7189 .type = WREPL_TYPE_MHOMED,
7190 .state = WREPL_STATE_ACTIVE,
7191 .node = WREPL_NODE_B,
7193 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7194 .ips = addresses_B_3_4,
7195 .apply_expected = False
7199 * group,active vs. mhomed,tombstone with same ip(s), unchecked
7202 .line = __location__,
7203 .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL),
7205 .nb_flags = NBT_NM_GROUP,
7207 .num_ips = ctx->addresses_best_num,
7208 .ips = ctx->addresses_best,
7209 .apply_expected = True
7215 .type = WREPL_TYPE_MHOMED,
7216 .state = WREPL_STATE_TOMBSTONE,
7217 .node = WREPL_NODE_B,
7219 .num_ips = ctx->addresses_best_num,
7220 .ips = ctx->addresses_best,
7221 .apply_expected = False
7225 * group,active vs. mhomed,tombstone with different ip(s), unchecked
7228 .line = __location__,
7229 .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL),
7231 .nb_flags = NBT_NM_GROUP,
7233 .num_ips = ctx->addresses_best_num,
7234 .ips = ctx->addresses_best,
7235 .apply_expected = True
7241 .type = WREPL_TYPE_MHOMED,
7242 .state = WREPL_STATE_TOMBSTONE,
7243 .node = WREPL_NODE_B,
7245 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7246 .ips = addresses_B_3_4,
7247 .apply_expected = False
7251 * special group vs. unique section
7254 * sgroup,active vs. unique,active with same ip(s), unchecked
7257 .line = __location__,
7258 .name = _NBT_NAME("_SA_UA_SI_U", 0x1C, NULL),
7260 .nb_flags = NBT_NM_GROUP,
7262 .num_ips = ctx->addresses_best_num,
7263 .ips = ctx->addresses_best,
7264 .apply_expected = True
7270 .type = WREPL_TYPE_UNIQUE,
7271 .state = WREPL_STATE_ACTIVE,
7272 .node = WREPL_NODE_B,
7274 .num_ips = ctx->addresses_best_num,
7275 .ips = ctx->addresses_best,
7276 .apply_expected = False
7280 * sgroup,active vs. unique,active with different ip(s), unchecked
7283 .line = __location__,
7284 .name = _NBT_NAME("_SA_UA_DI_U", 0x1C, NULL),
7286 .nb_flags = NBT_NM_GROUP,
7288 .num_ips = ctx->addresses_best_num,
7289 .ips = ctx->addresses_best,
7290 .apply_expected = True
7296 .type = WREPL_TYPE_UNIQUE,
7297 .state = WREPL_STATE_ACTIVE,
7298 .node = WREPL_NODE_B,
7300 .num_ips = ARRAY_SIZE(addresses_B_1),
7301 .ips = addresses_B_1,
7302 .apply_expected = False
7306 * sgroup,active vs. unique,tombstone with same ip(s), unchecked
7309 .line = __location__,
7310 .name = _NBT_NAME("_SA_UT_SI_U", 0x1C, NULL),
7312 .nb_flags = NBT_NM_GROUP,
7314 .num_ips = ctx->addresses_best_num,
7315 .ips = ctx->addresses_best,
7316 .apply_expected = True
7322 .type = WREPL_TYPE_UNIQUE,
7323 .state = WREPL_STATE_TOMBSTONE,
7324 .node = WREPL_NODE_B,
7326 .num_ips = ctx->addresses_best_num,
7327 .ips = ctx->addresses_best,
7328 .apply_expected = False
7332 * sgroup,active vs. unique,tombstone with different ip(s), unchecked
7335 .line = __location__,
7336 .name = _NBT_NAME("_SA_UT_DI_U", 0x1C, NULL),
7338 .nb_flags = NBT_NM_GROUP,
7340 .num_ips = ctx->addresses_best_num,
7341 .ips = ctx->addresses_best,
7342 .apply_expected = True
7348 .type = WREPL_TYPE_UNIQUE,
7349 .state = WREPL_STATE_TOMBSTONE,
7350 .node = WREPL_NODE_B,
7352 .num_ips = ARRAY_SIZE(addresses_B_1),
7353 .ips = addresses_B_1,
7354 .apply_expected = False
7358 * special group vs. normal group section
7361 * sgroup,active vs. group,active with same ip(s), unchecked
7364 .line = __location__,
7365 .name = _NBT_NAME("_SA_GA_SI_U", 0x1C, NULL),
7367 .nb_flags = NBT_NM_GROUP,
7369 .num_ips = ctx->addresses_best_num,
7370 .ips = ctx->addresses_best,
7371 .apply_expected = True
7377 .type = WREPL_TYPE_GROUP,
7378 .state = WREPL_STATE_ACTIVE,
7379 .node = WREPL_NODE_B,
7381 .num_ips = ctx->addresses_best_num,
7382 .ips = ctx->addresses_best,
7383 .apply_expected = False
7387 * sgroup,active vs. group,active with different ip(s), unchecked
7390 .line = __location__,
7391 .name = _NBT_NAME("_SA_GA_DI_U", 0x1C, NULL),
7393 .nb_flags = NBT_NM_GROUP,
7395 .num_ips = ctx->addresses_best_num,
7396 .ips = ctx->addresses_best,
7397 .apply_expected = True
7403 .type = WREPL_TYPE_GROUP,
7404 .state = WREPL_STATE_ACTIVE,
7405 .node = WREPL_NODE_B,
7407 .num_ips = ARRAY_SIZE(addresses_B_1),
7408 .ips = addresses_B_1,
7409 .apply_expected = False
7413 * sgroup,active vs. group,tombstone with same ip(s), unchecked
7416 .line = __location__,
7417 .name = _NBT_NAME("_SA_GT_SI_U", 0x1C, NULL),
7419 .nb_flags = NBT_NM_GROUP,
7421 .num_ips = ctx->addresses_best_num,
7422 .ips = ctx->addresses_best,
7423 .apply_expected = True
7429 .type = WREPL_TYPE_GROUP,
7430 .state = WREPL_STATE_TOMBSTONE,
7431 .node = WREPL_NODE_B,
7433 .num_ips = ctx->addresses_best_num,
7434 .ips = ctx->addresses_best,
7435 .apply_expected = False
7439 * sgroup,active vs. group,tombstone with different ip(s), unchecked
7442 .line = __location__,
7443 .name = _NBT_NAME("_SA_GT_DI_U", 0x1C, NULL),
7445 .nb_flags = NBT_NM_GROUP,
7447 .num_ips = ctx->addresses_best_num,
7448 .ips = ctx->addresses_best,
7449 .apply_expected = True
7455 .type = WREPL_TYPE_GROUP,
7456 .state = WREPL_STATE_TOMBSTONE,
7457 .node = WREPL_NODE_B,
7459 .num_ips = ARRAY_SIZE(addresses_B_1),
7460 .ips = addresses_B_1,
7461 .apply_expected = False
7465 * special group vs. multi homed section
7468 * sgroup,active vs. mhomed,active with same ip(s), unchecked
7471 .line = __location__,
7472 .name = _NBT_NAME("_SA_MA_SI_U", 0x1C, NULL),
7474 .nb_flags = NBT_NM_GROUP,
7476 .num_ips = ctx->addresses_best_num,
7477 .ips = ctx->addresses_best,
7478 .apply_expected = True
7484 .type = WREPL_TYPE_MHOMED,
7485 .state = WREPL_STATE_ACTIVE,
7486 .node = WREPL_NODE_B,
7488 .num_ips = ctx->addresses_best_num,
7489 .ips = ctx->addresses_best,
7490 .apply_expected = False
7494 * sgroup,active vs. mhomed,active with different ip(s), unchecked
7497 .line = __location__,
7498 .name = _NBT_NAME("_SA_MA_DI_U", 0x1C, NULL),
7500 .nb_flags = NBT_NM_GROUP,
7502 .num_ips = ctx->addresses_best_num,
7503 .ips = ctx->addresses_best,
7504 .apply_expected = True
7510 .type = WREPL_TYPE_MHOMED,
7511 .state = WREPL_STATE_ACTIVE,
7512 .node = WREPL_NODE_B,
7514 .num_ips = ARRAY_SIZE(addresses_B_1),
7515 .ips = addresses_B_1,
7516 .apply_expected = False
7520 * sgroup,active vs. mhomed,tombstone with same ip(s), unchecked
7523 .line = __location__,
7524 .name = _NBT_NAME("_SA_MT_SI_U", 0x1C, NULL),
7526 .nb_flags = NBT_NM_GROUP,
7528 .num_ips = ctx->addresses_best_num,
7529 .ips = ctx->addresses_best,
7530 .apply_expected = True
7536 .type = WREPL_TYPE_MHOMED,
7537 .state = WREPL_STATE_TOMBSTONE,
7538 .node = WREPL_NODE_B,
7540 .num_ips = ctx->addresses_best_num,
7541 .ips = ctx->addresses_best,
7542 .apply_expected = False
7546 * sgroup,active vs. mhomed,tombstone with different ip(s), unchecked
7549 .line = __location__,
7550 .name = _NBT_NAME("_SA_MT_DI_U", 0x1C, NULL),
7552 .nb_flags = NBT_NM_GROUP,
7554 .num_ips = ctx->addresses_best_num,
7555 .ips = ctx->addresses_best,
7556 .apply_expected = True
7562 .type = WREPL_TYPE_MHOMED,
7563 .state = WREPL_STATE_TOMBSTONE,
7564 .node = WREPL_NODE_B,
7566 .num_ips = ARRAY_SIZE(addresses_B_1),
7567 .ips = addresses_B_1,
7568 .apply_expected = False
7572 * multi homed vs. unique section
7575 * mhomed,active vs. unique,active with same ip(s), unchecked
7578 .line = __location__,
7579 .name = _NBT_NAME("_MA_UA_SI_U", 0x00, NULL),
7583 .num_ips = ctx->addresses_best_num,
7584 .ips = ctx->addresses_best,
7585 .apply_expected = True
7591 .type = WREPL_TYPE_UNIQUE,
7592 .state = WREPL_STATE_ACTIVE,
7593 .node = WREPL_NODE_B,
7595 .num_ips = ctx->addresses_best_num,
7596 .ips = ctx->addresses_best,
7597 .apply_expected = True
7601 * mhomed,active vs. unique,active with different ip(s), positive response
7604 .line = __location__,
7605 .name = _NBT_NAME("_MA_UA_DI_P", 0x00, NULL),
7609 .num_ips = ctx->addresses_best_num,
7610 .ips = ctx->addresses_best,
7611 .apply_expected = True
7618 .type = WREPL_TYPE_UNIQUE,
7619 .state = WREPL_STATE_ACTIVE,
7620 .node = WREPL_NODE_B,
7622 .num_ips = ARRAY_SIZE(addresses_B_1),
7623 .ips = addresses_B_1,
7624 .apply_expected = False
7628 * mhomed,active vs. unique,active with different ip(s), positive response other ips
7631 .line = __location__,
7632 .name = _NBT_NAME("_MA_UA_DI_O", 0x00, NULL),
7636 .num_ips = ctx->addresses_best_num,
7637 .ips = ctx->addresses_best,
7638 .apply_expected = True
7643 .num_ips = ARRAY_SIZE(addresses_A_3_4),
7644 .ips = addresses_A_3_4,
7647 .type = WREPL_TYPE_UNIQUE,
7648 .state = WREPL_STATE_ACTIVE,
7649 .node = WREPL_NODE_B,
7651 .num_ips = ARRAY_SIZE(addresses_B_1),
7652 .ips = addresses_B_1,
7653 .apply_expected = False
7657 * mhomed,active vs. unique,active with different ip(s), negative response
7660 .line = __location__,
7661 .name = _NBT_NAME("_MA_UA_DI_N", 0x00, NULL),
7665 .num_ips = ctx->addresses_best_num,
7666 .ips = ctx->addresses_best,
7667 .apply_expected = True
7674 .type = WREPL_TYPE_UNIQUE,
7675 .state = WREPL_STATE_ACTIVE,
7676 .node = WREPL_NODE_B,
7678 .num_ips = ARRAY_SIZE(addresses_B_1),
7679 .ips = addresses_B_1,
7680 .apply_expected = True
7684 * mhomed,active vs. unique,tombstone with same ip(s), unchecked
7687 .line = __location__,
7688 .name = _NBT_NAME("_MA_UT_SI_U", 0x00, NULL),
7692 .num_ips = ctx->addresses_best_num,
7693 .ips = ctx->addresses_best,
7694 .apply_expected = True
7700 .type = WREPL_TYPE_UNIQUE,
7701 .state = WREPL_STATE_TOMBSTONE,
7702 .node = WREPL_NODE_B,
7704 .num_ips = ctx->addresses_best_num,
7705 .ips = ctx->addresses_best,
7706 .apply_expected = False
7710 * mhomed,active vs. unique,tombstone with different ip(s), unchecked
7713 .line = __location__,
7714 .name = _NBT_NAME("_MA_UT_DI_U", 0x00, NULL),
7718 .num_ips = ctx->addresses_best_num,
7719 .ips = ctx->addresses_best,
7720 .apply_expected = True
7726 .type = WREPL_TYPE_UNIQUE,
7727 .state = WREPL_STATE_TOMBSTONE,
7728 .node = WREPL_NODE_B,
7730 .num_ips = ARRAY_SIZE(addresses_B_1),
7731 .ips = addresses_B_1,
7732 .apply_expected = False
7736 * multi homed vs. normal group section
7739 * mhomed,active vs. group,active with same ip(s), release expected
7742 .line = __location__,
7743 .name = _NBT_NAME("_MA_GA_SI_R", 0x00, NULL),
7747 .num_ips = ctx->addresses_best_num,
7748 .ips = ctx->addresses_best,
7749 .apply_expected = True
7753 .expect_release = True,
7756 .type = WREPL_TYPE_GROUP,
7757 .state = WREPL_STATE_ACTIVE,
7758 .node = WREPL_NODE_B,
7760 .num_ips = ctx->addresses_best_num,
7761 .ips = ctx->addresses_best,
7762 .apply_expected = True
7766 * mhomed,active vs. group,active with different ip(s), release expected
7769 .line = __location__,
7770 .name = _NBT_NAME("_MA_GA_DI_R", 0x00, NULL),
7774 .num_ips = ctx->addresses_best_num,
7775 .ips = ctx->addresses_best,
7776 .apply_expected = True
7780 .expect_release = True,
7783 .type = WREPL_TYPE_GROUP,
7784 .state = WREPL_STATE_ACTIVE,
7785 .node = WREPL_NODE_B,
7787 .num_ips = ARRAY_SIZE(addresses_B_1),
7788 .ips = addresses_B_1,
7789 .apply_expected = True
7793 * mhomed,active vs. group,tombstone with same ip(s), unchecked
7796 .line = __location__,
7797 .name = _NBT_NAME("_MA_GT_SI_U", 0x00, NULL),
7801 .num_ips = ctx->addresses_best_num,
7802 .ips = ctx->addresses_best,
7803 .apply_expected = True
7809 .type = WREPL_TYPE_GROUP,
7810 .state = WREPL_STATE_TOMBSTONE,
7811 .node = WREPL_NODE_B,
7813 .num_ips = ctx->addresses_best_num,
7814 .ips = ctx->addresses_best,
7815 .apply_expected = False
7819 * mhomed,active vs. group,tombstone with different ip(s), unchecked
7822 .line = __location__,
7823 .name = _NBT_NAME("_MA_GT_DI_U", 0x00, NULL),
7827 .num_ips = ctx->addresses_best_num,
7828 .ips = ctx->addresses_best,
7829 .apply_expected = True
7835 .type = WREPL_TYPE_GROUP,
7836 .state = WREPL_STATE_TOMBSTONE,
7837 .node = WREPL_NODE_B,
7839 .num_ips = ARRAY_SIZE(addresses_B_1),
7840 .ips = addresses_B_1,
7841 .apply_expected = False
7845 * multi homed vs. special group section
7848 * mhomed,active vs. sgroup,active with same ip(s), release expected
7851 .line = __location__,
7852 .name = _NBT_NAME("_MA_SA_SI_R", 0x00, NULL),
7856 .num_ips = ctx->addresses_best_num,
7857 .ips = ctx->addresses_best,
7858 .apply_expected = True
7862 .expect_release = True,
7865 .type = WREPL_TYPE_SGROUP,
7866 .state = WREPL_STATE_ACTIVE,
7867 .node = WREPL_NODE_B,
7869 .num_ips = ctx->addresses_best_num,
7870 .ips = ctx->addresses_best,
7871 .apply_expected = True
7875 * mhomed,active vs. group,active with different ip(s), release expected
7878 .line = __location__,
7879 .name = _NBT_NAME("_MA_SA_DI_R", 0x00, NULL),
7883 .num_ips = ctx->addresses_best_num,
7884 .ips = ctx->addresses_best,
7885 .apply_expected = True
7889 .expect_release = True,
7892 .type = WREPL_TYPE_SGROUP,
7893 .state = WREPL_STATE_ACTIVE,
7894 .node = WREPL_NODE_B,
7896 .num_ips = ARRAY_SIZE(addresses_B_1),
7897 .ips = addresses_B_1,
7898 .apply_expected = True
7902 * mhomed,active vs. sgroup,tombstone with same ip(s), unchecked
7905 .line = __location__,
7906 .name = _NBT_NAME("_MA_ST_SI_U", 0x00, NULL),
7910 .num_ips = ctx->addresses_best_num,
7911 .ips = ctx->addresses_best,
7912 .apply_expected = True
7918 .type = WREPL_TYPE_SGROUP,
7919 .state = WREPL_STATE_TOMBSTONE,
7920 .node = WREPL_NODE_B,
7922 .num_ips = ctx->addresses_best_num,
7923 .ips = ctx->addresses_best,
7924 .apply_expected = False
7928 * mhomed,active vs. sgroup,tombstone with different ip(s), unchecked
7931 .line = __location__,
7932 .name = _NBT_NAME("_MA_ST_DI_U", 0x00, NULL),
7936 .num_ips = ctx->addresses_best_num,
7937 .ips = ctx->addresses_best,
7938 .apply_expected = True
7944 .type = WREPL_TYPE_SGROUP,
7945 .state = WREPL_STATE_TOMBSTONE,
7946 .node = WREPL_NODE_B,
7948 .num_ips = ARRAY_SIZE(addresses_B_1),
7949 .ips = addresses_B_1,
7950 .apply_expected = False
7954 * multi homed vs. multi homed section
7957 * mhomed,active vs. mhomed,active with same ip(s), unchecked
7960 .line = __location__,
7961 .name = _NBT_NAME("_MA_MA_SI_U", 0x00, NULL),
7965 .num_ips = ctx->addresses_best_num,
7966 .ips = ctx->addresses_best,
7967 .apply_expected = True
7973 .type = WREPL_TYPE_MHOMED,
7974 .state = WREPL_STATE_ACTIVE,
7975 .node = WREPL_NODE_B,
7977 .num_ips = ctx->addresses_best_num,
7978 .ips = ctx->addresses_best,
7979 .apply_expected = True
7983 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
7986 .line = __location__,
7987 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
7991 .num_ips = ctx->addresses_best_num,
7992 .ips = ctx->addresses_best,
7993 .apply_expected = True
7999 .type = WREPL_TYPE_MHOMED,
8000 .state = WREPL_STATE_ACTIVE,
8001 .node = WREPL_NODE_B,
8003 .num_ips = ctx->addresses_all_num,
8004 .ips = ctx->addresses_all,
8005 .apply_expected = True
8009 * mhomed,active vs. mhomed,active with different ip(s), positive response
8012 .line = __location__,
8013 .name = _NBT_NAME("_MA_MA_DI_P", 0x00, NULL),
8017 .num_ips = ctx->addresses_best_num,
8018 .ips = ctx->addresses_best,
8019 .apply_expected = True
8026 .type = WREPL_TYPE_MHOMED,
8027 .state = WREPL_STATE_ACTIVE,
8028 .node = WREPL_NODE_B,
8030 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8031 .ips = addresses_B_3_4,
8032 .apply_expected = False
8036 * mhomed,active vs. mhomed,active with different ip(s), positive response other ips
8039 .line = __location__,
8040 .name = _NBT_NAME("_MA_MA_DI_O", 0x00, NULL),
8044 .num_ips = ctx->addresses_best_num,
8045 .ips = ctx->addresses_best,
8046 .apply_expected = True
8051 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8052 .ips = addresses_A_3_4,
8055 .type = WREPL_TYPE_MHOMED,
8056 .state = WREPL_STATE_ACTIVE,
8057 .node = WREPL_NODE_B,
8059 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8060 .ips = addresses_B_3_4,
8061 .apply_expected = False
8065 * mhomed,active vs. mhomed,active with different ip(s), negative response
8068 .line = __location__,
8069 .name = _NBT_NAME("_MA_MA_DI_N", 0x00, NULL),
8073 .num_ips = ctx->addresses_best_num,
8074 .ips = ctx->addresses_best,
8075 .apply_expected = True
8082 .type = WREPL_TYPE_MHOMED,
8083 .state = WREPL_STATE_ACTIVE,
8084 .node = WREPL_NODE_B,
8086 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8087 .ips = addresses_B_3_4,
8088 .apply_expected = True
8092 * mhomed,active vs. mhomed,tombstone with same ip(s), unchecked
8095 .line = __location__,
8096 .name = _NBT_NAME("_MA_MT_SI_U", 0x00, NULL),
8100 .num_ips = ctx->addresses_best_num,
8101 .ips = ctx->addresses_best,
8102 .apply_expected = True
8108 .type = WREPL_TYPE_MHOMED,
8109 .state = WREPL_STATE_TOMBSTONE,
8110 .node = WREPL_NODE_B,
8112 .num_ips = ctx->addresses_best_num,
8113 .ips = ctx->addresses_best,
8114 .apply_expected = False
8118 * mhomed,active vs. mhomed,tombstone with different ip(s), unchecked
8121 .line = __location__,
8122 .name = _NBT_NAME("_MA_MT_DI_U", 0x00, NULL),
8126 .num_ips = ctx->addresses_best_num,
8127 .ips = ctx->addresses_best,
8128 .apply_expected = True
8134 .type = WREPL_TYPE_MHOMED,
8135 .state = WREPL_STATE_TOMBSTONE,
8136 .node = WREPL_NODE_B,
8138 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8139 .ips = addresses_B_3_4,
8140 .apply_expected = False
8144 * some more multi homed test, including merging
8147 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8150 .line = __location__,
8151 .section= "Test Replica vs. owned active: some more MHOMED combinations",
8152 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8153 .skip = (ctx->addresses_all_num < 3),
8157 .num_ips = ctx->addresses_mhomed_num,
8158 .ips = ctx->addresses_mhomed,
8159 .apply_expected = True
8165 .type = WREPL_TYPE_MHOMED,
8166 .state = WREPL_STATE_ACTIVE,
8167 .node = WREPL_NODE_B,
8169 .num_ips = ctx->addresses_all_num,
8170 .ips = ctx->addresses_all,
8171 .apply_expected = True
8175 * mhomed,active vs. mhomed,active with same ips, unchecked
8178 .line = __location__,
8179 .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL),
8180 .skip = (ctx->addresses_mhomed_num != 2),
8184 .num_ips = ctx->addresses_mhomed_num,
8185 .ips = ctx->addresses_mhomed,
8186 .apply_expected = True
8192 .type = WREPL_TYPE_MHOMED,
8193 .state = WREPL_STATE_ACTIVE,
8194 .node = WREPL_NODE_B,
8196 .num_ips = ctx->addresses_mhomed_num,
8197 .ips = ctx->addresses_mhomed,
8198 .apply_expected = True
8202 * mhomed,active vs. mhomed,active with subset ip(s), positive response
8205 .line = __location__,
8206 .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL),
8207 .skip = (ctx->addresses_mhomed_num != 2),
8211 .num_ips = ctx->addresses_mhomed_num,
8212 .ips = ctx->addresses_mhomed,
8213 .apply_expected = True
8220 .type = WREPL_TYPE_MHOMED,
8221 .state = WREPL_STATE_ACTIVE,
8222 .node = WREPL_NODE_B,
8224 .num_ips = ctx->addresses_best_num,
8225 .ips = ctx->addresses_best,
8226 .mhomed_merge = True
8230 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with all addresses
8233 .line = __location__,
8234 .name = _NBT_NAME("_MA_MA_SB_A", 0x00, NULL),
8235 .skip = (ctx->addresses_all_num < 3),
8239 .num_ips = ctx->addresses_mhomed_num,
8240 .ips = ctx->addresses_mhomed,
8241 .apply_expected = True
8246 .num_ips = ctx->addresses_all_num,
8247 .ips = ctx->addresses_all,
8250 .type = WREPL_TYPE_MHOMED,
8251 .state = WREPL_STATE_ACTIVE,
8252 .node = WREPL_NODE_B,
8254 .num_ips = ctx->addresses_best_num,
8255 .ips = ctx->addresses_best,
8256 .mhomed_merge = True
8260 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with replicas addresses
8261 * TODO: check why the server sends a name release demand for one address?
8262 * the release demand has no effect to the database record...
8265 .line = __location__,
8266 .name = _NBT_NAME("_MA_MA_SB_C", 0x00, NULL),
8267 .skip = (ctx->addresses_all_num < 3),
8271 .num_ips = ctx->addresses_mhomed_num,
8272 .ips = ctx->addresses_mhomed,
8273 .apply_expected = True
8278 .num_ips = ctx->addresses_best_num,
8279 .ips = ctx->addresses_best,
8280 .late_release = True
8283 .type = WREPL_TYPE_MHOMED,
8284 .state = WREPL_STATE_ACTIVE,
8285 .node = WREPL_NODE_B,
8287 .num_ips = ctx->addresses_best_num,
8288 .ips = ctx->addresses_best,
8289 .apply_expected = False
8293 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with other addresses
8296 .line = __location__,
8297 .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL),
8299 .skip = (ctx->addresses_all_num < 3),
8303 .num_ips = ctx->addresses_mhomed_num,
8304 .ips = ctx->addresses_mhomed,
8305 .apply_expected = True
8310 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8311 .ips = addresses_B_3_4,
8314 .type = WREPL_TYPE_MHOMED,
8315 .state = WREPL_STATE_ACTIVE,
8316 .node = WREPL_NODE_B,
8318 .num_ips = ctx->addresses_best_num,
8319 .ips = ctx->addresses_best,
8320 .apply_expected = False
8324 * mhomed,active vs. mhomed,active with subset ip(s), negative response
8327 .line = __location__,
8328 .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL),
8329 .skip = (ctx->addresses_mhomed_num != 2),
8333 .num_ips = ctx->addresses_mhomed_num,
8334 .ips = ctx->addresses_mhomed,
8335 .apply_expected = True
8342 .type = WREPL_TYPE_MHOMED,
8343 .state = WREPL_STATE_ACTIVE,
8344 .node = WREPL_NODE_B,
8346 .num_ips = ctx->addresses_best_num,
8347 .ips = ctx->addresses_best,
8348 .apply_expected = True
8352 * some more multi homed and unique test, including merging
8355 * mhomed,active vs. unique,active with subset ip(s), positive response
8358 .line = __location__,
8359 .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations",
8360 .name = _NBT_NAME("_MA_UA_SB_A", 0x00, NULL),
8361 .skip = (ctx->addresses_all_num < 3),
8365 .num_ips = ctx->addresses_mhomed_num,
8366 .ips = ctx->addresses_mhomed,
8367 .apply_expected = True
8374 .type = WREPL_TYPE_UNIQUE,
8375 .state = WREPL_STATE_ACTIVE,
8376 .node = WREPL_NODE_B,
8378 .num_ips = ctx->addresses_best_num,
8379 .ips = ctx->addresses_best,
8380 .mhomed_merge = True
8384 * unique,active vs. unique,active with different ip(s), positive response, with all addresses
8387 .line = __location__,
8388 .name = _NBT_NAME("_UA_UA_DI_A", 0x00, NULL),
8389 .skip = (ctx->addresses_all_num < 3),
8393 .num_ips = ctx->addresses_best_num,
8394 .ips = ctx->addresses_best,
8395 .apply_expected = True
8400 .num_ips = ctx->addresses_all_num,
8401 .ips = ctx->addresses_all,
8404 .type = WREPL_TYPE_UNIQUE,
8405 .state = WREPL_STATE_ACTIVE,
8406 .node = WREPL_NODE_B,
8408 .num_ips = ctx->addresses_best2_num,
8409 .ips = ctx->addresses_best2,
8410 .mhomed_merge = True,
8414 * unique,active vs. mhomed,active with different ip(s), positive response, with all addresses
8417 .line = __location__,
8418 .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL),
8419 .skip = (ctx->addresses_all_num < 3),
8423 .num_ips = ctx->addresses_best_num,
8424 .ips = ctx->addresses_best,
8425 .apply_expected = True
8430 .num_ips = ctx->addresses_all_num,
8431 .ips = ctx->addresses_all,
8434 .type = WREPL_TYPE_MHOMED,
8435 .state = WREPL_STATE_ACTIVE,
8436 .node = WREPL_NODE_B,
8438 .num_ips = ctx->addresses_best2_num,
8439 .ips = ctx->addresses_best2,
8440 .mhomed_merge = True,
8444 * special group vs. special group merging section
8447 * sgroup,active vs. sgroup,active with different ip(s)
8450 .line = __location__,
8451 .section= "Test Replica vs. owned active: SGROUP vs. SGROUP tests",
8452 .name = _NBT_NAME("_SA_SA_DI_U", 0x1C, NULL),
8453 .skip = (ctx->addresses_all_num < 3),
8455 .nb_flags = NBT_NM_GROUP,
8457 .num_ips = ctx->addresses_mhomed_num,
8458 .ips = ctx->addresses_mhomed,
8459 .apply_expected = True
8465 .type = WREPL_TYPE_SGROUP,
8466 .state = WREPL_STATE_ACTIVE,
8467 .node = WREPL_NODE_B,
8469 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8470 .ips = addresses_B_3_4,
8471 .sgroup_merge = True
8475 * sgroup,active vs. sgroup,active with same ip(s)
8478 .line = __location__,
8479 .name = _NBT_NAME("_SA_SA_SI_U", 0x1C, NULL),
8480 .skip = (ctx->addresses_all_num < 3),
8482 .nb_flags = NBT_NM_GROUP,
8484 .num_ips = ctx->addresses_mhomed_num,
8485 .ips = ctx->addresses_mhomed,
8486 .apply_expected = True
8492 .type = WREPL_TYPE_SGROUP,
8493 .state = WREPL_STATE_ACTIVE,
8494 .node = WREPL_NODE_B,
8496 .num_ips = ctx->addresses_mhomed_num,
8497 .ips = ctx->addresses_mhomed,
8498 .sgroup_merge = True
8502 * sgroup,active vs. sgroup,active with superset ip(s)
8505 .line = __location__,
8506 .name = _NBT_NAME("_SA_SA_SP_U", 0x1C, NULL),
8507 .skip = (ctx->addresses_all_num < 3),
8509 .nb_flags = NBT_NM_GROUP,
8511 .num_ips = ctx->addresses_mhomed_num,
8512 .ips = ctx->addresses_mhomed,
8513 .apply_expected = True
8519 .type = WREPL_TYPE_SGROUP,
8520 .state = WREPL_STATE_ACTIVE,
8521 .node = WREPL_NODE_B,
8523 .num_ips = ctx->addresses_all_num,
8524 .ips = ctx->addresses_all,
8525 .sgroup_merge = True
8529 * sgroup,active vs. sgroup,active with subset ip(s)
8532 .line = __location__,
8533 .name = _NBT_NAME("_SA_SA_SB_U", 0x1C, NULL),
8534 .skip = (ctx->addresses_all_num < 3),
8536 .nb_flags = NBT_NM_GROUP,
8538 .num_ips = ctx->addresses_mhomed_num,
8539 .ips = ctx->addresses_mhomed,
8540 .apply_expected = True
8546 .type = WREPL_TYPE_SGROUP,
8547 .state = WREPL_STATE_ACTIVE,
8548 .node = WREPL_NODE_B,
8550 .num_ips = ctx->addresses_best_num,
8551 .ips = ctx->addresses_best,
8552 .sgroup_merge = True
8556 * sgroup,active vs. sgroup,tombstone with different ip(s)
8559 .line = __location__,
8560 .name = _NBT_NAME("_SA_ST_DI_U", 0x1C, NULL),
8561 .skip = (ctx->addresses_all_num < 3),
8563 .nb_flags = NBT_NM_GROUP,
8565 .num_ips = ctx->addresses_mhomed_num,
8566 .ips = ctx->addresses_mhomed,
8567 .apply_expected = True
8573 .type = WREPL_TYPE_SGROUP,
8574 .state = WREPL_STATE_TOMBSTONE,
8575 .node = WREPL_NODE_B,
8577 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8578 .ips = addresses_B_3_4,
8579 .apply_expected = False
8583 * sgroup,active vs. sgroup,tombstone with same ip(s)
8586 .line = __location__,
8587 .name = _NBT_NAME("_SA_ST_SI_U", 0x1C, NULL),
8588 .skip = (ctx->addresses_all_num < 3),
8590 .nb_flags = NBT_NM_GROUP,
8592 .num_ips = ctx->addresses_mhomed_num,
8593 .ips = ctx->addresses_mhomed,
8594 .apply_expected = True
8600 .type = WREPL_TYPE_SGROUP,
8601 .state = WREPL_STATE_TOMBSTONE,
8602 .node = WREPL_NODE_B,
8604 .num_ips = ctx->addresses_mhomed_num,
8605 .ips = ctx->addresses_mhomed,
8606 .apply_expected = False
8610 * sgroup,active vs. sgroup,tombstone with superset ip(s)
8613 .line = __location__,
8614 .name = _NBT_NAME("_SA_ST_SP_U", 0x1C, NULL),
8615 .skip = (ctx->addresses_all_num < 3),
8617 .nb_flags = NBT_NM_GROUP,
8619 .num_ips = ctx->addresses_mhomed_num,
8620 .ips = ctx->addresses_mhomed,
8621 .apply_expected = True
8627 .type = WREPL_TYPE_SGROUP,
8628 .state = WREPL_STATE_TOMBSTONE,
8629 .node = WREPL_NODE_B,
8631 .num_ips = ctx->addresses_all_num,
8632 .ips = ctx->addresses_all,
8633 .apply_expected = False
8637 * sgroup,active vs. sgroup,tombstone with subset ip(s)
8640 .line = __location__,
8641 .name = _NBT_NAME("_SA_ST_SB_U", 0x1C, NULL),
8642 .skip = (ctx->addresses_all_num < 3),
8644 .nb_flags = NBT_NM_GROUP,
8646 .num_ips = ctx->addresses_mhomed_num,
8647 .ips = ctx->addresses_mhomed,
8648 .apply_expected = True
8654 .type = WREPL_TYPE_SGROUP,
8655 .state = WREPL_STATE_TOMBSTONE,
8656 .node = WREPL_NODE_B,
8658 .num_ips = ctx->addresses_best_num,
8659 .ips = ctx->addresses_best,
8660 .apply_expected = False
8665 if (!ctx) return False;
8667 if (!ctx->nbtsock_srv) {
8668 printf("SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
8673 printf("Test Replica records vs. owned active records\n");
8675 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
8677 struct test_conflict_owned_active_vs_replica_struct record = records[i];
8678 uint32_t j, count = 1;
8681 if (records[i].wins.mhomed || records[i].name.type == 0x1C) {
8682 count = records[i].wins.num_ips;
8685 if (records[i].section) {
8686 printf("%s\n", records[i].section);
8689 if (records[i].skip) {
8690 printf("%s => SKIPPED\n", nbt_name_string(ctx, &records[i].name));
8694 if (records[i].replica.mhomed_merge) {
8695 action = "MHOMED_MERGE";
8696 } else if (records[i].replica.sgroup_merge) {
8697 action = "SGROUP_MERGE";
8698 } else if (records[i].replica.apply_expected) {
8701 action = "NOT REPLACE";
8704 printf("%s => %s\n", nbt_name_string(ctx, &records[i].name), action);
8706 /* Prepare for multi homed registration */
8707 ZERO_STRUCT(records[i].defend);
8708 records[i].defend.timeout = 10;
8709 records[i].defend.positive = True;
8710 nbt_set_incoming_handler(ctx->nbtsock_srv,
8711 test_conflict_owned_active_vs_replica_handler,
8713 if (ctx->nbtsock_srv2) {
8714 nbt_set_incoming_handler(ctx->nbtsock_srv2,
8715 test_conflict_owned_active_vs_replica_handler,
8722 for (j=0; j < count; j++) {
8723 struct nbt_name_request *req;
8725 name_register->in.name = records[i].name;
8726 name_register->in.dest_addr = ctx->address;
8727 name_register->in.address = records[i].wins.ips[j].ip;
8728 name_register->in.nb_flags = records[i].wins.nb_flags;
8729 name_register->in.register_demand= False;
8730 name_register->in.broadcast = False;
8731 name_register->in.multi_homed = records[i].wins.mhomed;
8732 name_register->in.ttl = 300000;
8733 name_register->in.timeout = 70;
8734 name_register->in.retries = 0;
8736 req = nbt_name_register_send(ctx->nbtsock, name_register);
8738 /* push the request on the wire */
8739 event_loop_once(ctx->nbtsock->event_ctx);
8742 * if we register multiple addresses,
8743 * the server will do name queries to see if the old addresses
8746 if (records[i].wins.mhomed && j > 0) {
8747 end = timeval_current_ofs(records[i].defend.timeout,0);
8748 records[i].defend.ret = True;
8749 while (records[i].defend.timeout > 0) {
8750 event_loop_once(ctx->nbtsock_srv->event_ctx);
8751 if (timeval_expired(&end)) break;
8753 ret &= records[i].defend.ret;
8756 status = nbt_name_register_recv(req, ctx, name_register);
8757 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
8758 printf("No response from %s for name register\n", ctx->address);
8761 if (!NT_STATUS_IS_OK(status)) {
8762 printf("Bad response from %s for name register - %s\n",
8763 ctx->address, nt_errstr(status));
8766 CHECK_VALUE(name_register->out.rcode, 0);
8767 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
8768 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
8769 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
8770 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
8771 CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[j].ip);
8774 /* Prepare for the current test */
8775 records[i].defend = record.defend;
8776 nbt_set_incoming_handler(ctx->nbtsock_srv,
8777 test_conflict_owned_active_vs_replica_handler,
8779 if (ctx->nbtsock_srv2) {
8780 nbt_set_incoming_handler(ctx->nbtsock_srv2,
8781 test_conflict_owned_active_vs_replica_handler,
8788 wins_name->name = &records[i].name;
8789 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
8790 records[i].replica.state,
8791 records[i].replica.node,
8792 records[i].replica.is_static);
8793 wins_name->id = ++ctx->b.max_version;
8794 if (wins_name->flags & 2) {
8795 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
8796 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
8798 wins_name->addresses.ip = records[i].replica.ips[0].ip;
8800 wins_name->unknown = "255.255.255.255";
8802 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
8805 * wait for the name query, which is handled in
8806 * test_conflict_owned_active_vs_replica_handler()
8808 end = timeval_current_ofs(records[i].defend.timeout,0);
8809 records[i].defend.ret = True;
8810 while (records[i].defend.timeout > 0) {
8811 event_loop_once(ctx->nbtsock_srv->event_ctx);
8812 if (timeval_expired(&end)) break;
8814 ret &= records[i].defend.ret;
8816 if (records[i].defend.late_release) {
8817 records[i].defend = record.defend;
8818 records[i].defend.expect_release = True;
8820 * wait for the name release demand, which is handled in
8821 * test_conflict_owned_active_vs_replica_handler()
8823 end = timeval_current_ofs(records[i].defend.timeout,0);
8824 records[i].defend.ret = True;
8825 while (records[i].defend.timeout > 0) {
8826 event_loop_once(ctx->nbtsock_srv->event_ctx);
8827 if (timeval_expired(&end)) break;
8829 ret &= records[i].defend.ret;
8832 if (records[i].replica.mhomed_merge) {
8833 ret &= test_wrepl_mhomed_merged(ctx, &ctx->c,
8834 records[i].wins.num_ips, records[i].wins.ips,
8836 records[i].replica.num_ips, records[i].replica.ips,
8838 } else if (records[i].replica.sgroup_merge) {
8839 ret &= test_wrepl_sgroup_merged(ctx, NULL,
8841 records[i].wins.num_ips, records[i].wins.ips,
8843 records[i].replica.num_ips, records[i].replica.ips,
8846 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
8847 records[i].replica.apply_expected);
8850 if (records[i].replica.apply_expected ||
8851 records[i].replica.mhomed_merge) {
8852 wins_name->name = &records[i].name;
8853 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
8854 WREPL_STATE_TOMBSTONE,
8855 WREPL_NODE_B, False);
8856 wins_name->id = ++ctx->b.max_version;
8857 wins_name->addresses.ip = addresses_B_1[0].ip;
8858 wins_name->unknown = "255.255.255.255";
8860 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
8861 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
8863 for (j=0; j < count; j++) {
8864 struct nbt_name_socket *nbtsock = ctx->nbtsock;
8866 if (ctx->myaddr2 && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2) == 0) {
8867 nbtsock = ctx->nbtsock2;
8870 release->in.name = records[i].name;
8871 release->in.dest_addr = ctx->address;
8872 release->in.address = records[i].wins.ips[j].ip;
8873 release->in.nb_flags = records[i].wins.nb_flags;
8874 release->in.broadcast = False;
8875 release->in.timeout = 30;
8876 release->in.retries = 0;
8878 status = nbt_name_release(nbtsock, ctx, release);
8879 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
8880 printf("No response from %s for name release\n", ctx->address);
8883 if (!NT_STATUS_IS_OK(status)) {
8884 printf("Bad response from %s for name query - %s\n",
8885 ctx->address, nt_errstr(status));
8888 CHECK_VALUE(release->out.rcode, 0);
8891 if (records[i].replica.sgroup_merge) {
8892 /* clean up the SGROUP record */
8893 wins_name->name = &records[i].name;
8894 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
8896 WREPL_NODE_B, False);
8897 wins_name->id = ++ctx->b.max_version;
8898 wins_name->addresses.addresses.num_ips = 0;
8899 wins_name->addresses.addresses.ips = NULL;
8900 wins_name->unknown = "255.255.255.255";
8901 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
8903 /* take ownership of the SGROUP record */
8904 wins_name->name = &records[i].name;
8905 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
8907 WREPL_NODE_B, False);
8908 wins_name->id = ++ctx->b.max_version;
8909 wins_name->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
8910 wins_name->addresses.addresses.ips = discard_const(addresses_B_1);
8911 wins_name->unknown = "255.255.255.255";
8912 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
8913 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
8915 /* overwrite the SGROUP record with unique,tombstone */
8916 wins_name->name = &records[i].name;
8917 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
8918 WREPL_STATE_TOMBSTONE,
8919 WREPL_NODE_B, False);
8920 wins_name->id = ++ctx->b.max_version;
8921 wins_name->addresses.ip = addresses_A_1[0].ip;
8922 wins_name->unknown = "255.255.255.255";
8923 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
8924 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
8930 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
8938 #define _NBT_ASSERT(v, correct) do { \
8939 if ((v) != (correct)) { \
8940 printf("(%s) Incorrect value %s=%d - should be %s (%d)\n", \
8941 __location__, #v, v, #correct, correct); \
8946 #define _NBT_ASSERT_STRING(v, correct) do { \
8947 if ( ((!v) && (correct)) || \
8948 ((v) && (!correct)) || \
8949 ((v) && (correct) && strcmp(v,correct) != 0)) { \
8950 printf("(%s) Incorrect value %s=%s - should be %s\n", \
8951 __location__, #v, v, correct); \
8956 static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
8957 struct nbt_name_packet *req_packet,
8958 const struct nbt_peer_socket *src)
8960 struct nbt_name *name;
8961 struct nbt_name_packet *rep_packet;
8962 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
8964 _NBT_ASSERT(req_packet->qdcount, 1);
8965 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
8966 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
8968 name = &req_packet->questions[0].name;
8970 _NBT_ASSERT(name->type, rec->name.type);
8971 _NBT_ASSERT_STRING(name->name, rec->name.name);
8972 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
8974 _NBT_ASSERT(rec->defend.expect_release, False);
8976 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
8977 if (rep_packet == NULL) return;
8979 rep_packet->name_trn_id = req_packet->name_trn_id;
8980 rep_packet->ancount = 1;
8982 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
8983 if (rep_packet->answers == NULL) return;
8985 rep_packet->answers[0].name = *name;
8986 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
8987 rep_packet->answers[0].ttl = 0;
8989 if (rec->defend.positive) {
8990 uint32_t i, num_ips;
8991 const struct wrepl_ip *ips;
8993 if (rec->defend.num_ips > 0) {
8994 num_ips = rec->defend.num_ips;
8995 ips = rec->defend.ips;
8997 num_ips = rec->wins.num_ips;
8998 ips = rec->wins.ips;
9001 /* send a positive reply */
9002 rep_packet->operation =
9005 NBT_FLAG_AUTHORITIVE |
9006 NBT_FLAG_RECURSION_DESIRED |
9007 NBT_FLAG_RECURSION_AVAIL;
9009 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9011 rep_packet->answers[0].rdata.netbios.length = num_ips*6;
9012 rep_packet->answers[0].rdata.netbios.addresses =
9013 talloc_array(rep_packet->answers, struct nbt_rdata_address, num_ips);
9014 if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return;
9016 for (i=0; i < num_ips; i++) {
9017 struct nbt_rdata_address *addr =
9018 &rep_packet->answers[0].rdata.netbios.addresses[i];
9019 addr->nb_flags = rec->wins.nb_flags;
9020 addr->ipaddr = ips[i].ip;
9022 DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
9023 nbt_name_string(rep_packet, name), src->addr, src->port));
9025 /* send a negative reply */
9026 rep_packet->operation =
9029 NBT_FLAG_AUTHORITIVE |
9032 rep_packet->answers[0].rr_type = NBT_QTYPE_NULL;
9034 ZERO_STRUCT(rep_packet->answers[0].rdata);
9036 DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
9037 nbt_name_string(rep_packet, name), src->addr, src->port));
9040 nbt_name_reply_send(nbtsock, src, rep_packet);
9041 talloc_free(rep_packet);
9043 /* make sure we push the reply to the wire */
9044 event_loop_once(nbtsock->event_ctx);
9046 rec->defend.timeout = 0;
9047 rec->defend.ret = True;
9050 static void test_conflict_owned_active_vs_replica_handler_release(struct nbt_name_socket *nbtsock,
9051 struct nbt_name_packet *req_packet,
9052 const struct nbt_peer_socket *src)
9054 struct nbt_name *name;
9055 struct nbt_name_packet *rep_packet;
9056 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9058 _NBT_ASSERT(req_packet->qdcount, 1);
9059 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9060 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9062 name = &req_packet->questions[0].name;
9064 _NBT_ASSERT(name->type, rec->name.type);
9065 _NBT_ASSERT_STRING(name->name, rec->name.name);
9066 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9068 _NBT_ASSERT(rec->defend.expect_release, True);
9070 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9071 if (rep_packet == NULL) return;
9073 rep_packet->name_trn_id = req_packet->name_trn_id;
9074 rep_packet->ancount = 1;
9075 rep_packet->operation =
9077 NBT_OPCODE_RELEASE |
9078 NBT_FLAG_AUTHORITIVE;
9080 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9081 if (rep_packet->answers == NULL) return;
9083 rep_packet->answers[0].name = *name;
9084 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9085 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9086 rep_packet->answers[0].ttl = req_packet->additional[0].ttl;
9087 rep_packet->answers[0].rdata = req_packet->additional[0].rdata;
9089 DEBUG(2,("Sending name release reply for %s to %s:%d\n",
9090 nbt_name_string(rep_packet, name), src->addr, src->port));
9092 nbt_name_reply_send(nbtsock, src, rep_packet);
9093 talloc_free(rep_packet);
9095 /* make sure we push the reply to the wire */
9096 event_loop_once(nbtsock->event_ctx);
9098 rec->defend.timeout = 0;
9099 rec->defend.ret = True;
9102 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
9103 struct nbt_name_packet *req_packet,
9104 const struct nbt_peer_socket *src)
9106 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9108 rec->defend.ret = False;
9110 switch (req_packet->operation & NBT_OPCODE) {
9111 case NBT_OPCODE_QUERY:
9112 test_conflict_owned_active_vs_replica_handler_query(nbtsock, req_packet, src);
9114 case NBT_OPCODE_RELEASE:
9115 test_conflict_owned_active_vs_replica_handler_release(nbtsock, req_packet, src);
9118 printf("%s: unexpected incoming packet\n", __location__);
9124 test WINS replication operations
9126 BOOL torture_nbt_winsreplication_quick(void)
9128 const char *address;
9129 struct nbt_name name;
9130 TALLOC_CTX *mem_ctx = talloc_new(NULL);
9134 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
9136 /* do an initial name resolution to find its IP */
9137 status = resolve_name(&name, mem_ctx, &address, NULL);
9138 if (!NT_STATUS_IS_OK(status)) {
9139 printf("Failed to resolve %s - %s\n",
9140 name.name, nt_errstr(status));
9141 talloc_free(mem_ctx);
9145 ret &= test_assoc_ctx1(mem_ctx, address);
9146 ret &= test_assoc_ctx2(mem_ctx, address);
9148 ret &= test_wins_replication(mem_ctx, address);
9150 talloc_free(mem_ctx);
9156 test WINS replication operations
9158 BOOL torture_nbt_winsreplication(void)
9160 const char *address;
9161 struct nbt_name name;
9162 TALLOC_CTX *mem_ctx = talloc_new(NULL);
9165 struct test_wrepl_conflict_conn *ctx;
9167 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
9169 /* do an initial name resolution to find its IP */
9170 status = resolve_name(&name, mem_ctx, &address, NULL);
9171 if (!NT_STATUS_IS_OK(status)) {
9172 printf("Failed to resolve %s - %s\n",
9173 name.name, nt_errstr(status));
9174 talloc_free(mem_ctx);
9178 ret &= test_assoc_ctx1(mem_ctx, address);
9179 ret &= test_assoc_ctx2(mem_ctx, address);
9181 ret &= test_wins_replication(mem_ctx, address);
9183 ctx = test_create_conflict_ctx(mem_ctx, address);
9185 ret &= test_conflict_same_owner(ctx);
9186 ret &= test_conflict_different_owner(ctx);
9187 ret &= test_conflict_owned_released_vs_replica(ctx);
9188 ret &= test_conflict_owned_active_vs_replica(ctx);
9190 talloc_free(mem_ctx);