2 Unix SMB/CIFS implementation.
4 WINS replication testing
6 Copyright (C) Andrew Tridgell 2005
7 Copyright (C) Stefan Metzmacher 2005
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include "libcli/wrepl/winsrepl.h"
26 #include "lib/events/events.h"
27 #include "lib/socket/socket.h"
28 #include "libcli/resolve/resolve.h"
29 #include "system/network.h"
30 #include "netif/netif.h"
31 #include "librpc/gen_ndr/ndr_nbt.h"
33 #define CHECK_STATUS(status, correct) do { \
34 if (!NT_STATUS_EQUAL(status, correct)) { \
35 printf("(%s) Incorrect status %s - should be %s\n", \
36 __location__, nt_errstr(status), nt_errstr(correct)); \
41 #define CHECK_VALUE(v, correct) do { \
42 if ((v) != (correct)) { \
43 printf("(%s) Incorrect value %s=%d - should be %d\n", \
44 __location__, #v, v, correct); \
49 #define CHECK_VALUE_UINT64(v, correct) do { \
50 if ((v) != (correct)) { \
51 printf("(%s) Incorrect value %s=%llu - should be %llu\n", \
52 __location__, #v, (long long)v, (long long)correct); \
57 #define CHECK_VALUE_STRING(v, correct) do { \
58 if ( ((!v) && (correct)) || \
59 ((v) && (!correct)) || \
60 ((v) && (correct) && strcmp(v,correct) != 0)) { \
61 printf("(%s) Incorrect value %s='%s' - should be '%s'\n", \
62 __location__, #v, v, correct); \
67 #define _NBT_NAME(n,t,s) {\
73 static const char *wrepl_name_type_string(enum wrepl_name_type type)
76 case WREPL_TYPE_UNIQUE: return "UNIQUE";
77 case WREPL_TYPE_GROUP: return "GROUP";
78 case WREPL_TYPE_SGROUP: return "SGROUP";
79 case WREPL_TYPE_MHOMED: return "MHOMED";
81 return "UNKNOWN_TYPE";
84 static const char *wrepl_name_state_string(enum wrepl_name_state state)
87 case WREPL_STATE_ACTIVE: return "ACTIVE";
88 case WREPL_STATE_RELEASED: return "RELEASED";
89 case WREPL_STATE_TOMBSTONE: return "TOMBSTONE";
90 case WREPL_STATE_RESERVED: return "RESERVED";
92 return "UNKNOWN_STATE";
96 test how assoc_ctx's are only usable on the connection
99 static BOOL test_assoc_ctx1(TALLOC_CTX *mem_ctx, const char *address)
102 struct wrepl_request *req;
103 struct wrepl_socket *wrepl_socket1;
104 struct wrepl_associate associate1;
105 struct wrepl_socket *wrepl_socket2;
106 struct wrepl_associate associate2;
107 struct wrepl_pull_table pull_table;
108 struct wrepl_packet packet;
109 struct wrepl_send_ctrl ctrl;
110 struct wrepl_packet *rep_packet;
111 struct wrepl_associate_stop assoc_stop;
114 if (!lp_parm_bool(-1, "torture", "dangerous", False)) {
115 printf("winsrepl: cross connection assoc_ctx usage disabled - enable dangerous tests to use\n");
119 printf("Test if assoc_ctx is only valid on the conection it was created on\n");
121 wrepl_socket1 = wrepl_socket_init(mem_ctx, NULL);
122 wrepl_socket2 = wrepl_socket_init(mem_ctx, NULL);
124 printf("Setup 2 wrepl connections\n");
125 status = wrepl_connect(wrepl_socket1, NULL, address);
126 CHECK_STATUS(status, NT_STATUS_OK);
128 status = wrepl_connect(wrepl_socket2, NULL, address);
129 CHECK_STATUS(status, NT_STATUS_OK);
131 printf("Send a start association request (conn1)\n");
132 status = wrepl_associate(wrepl_socket1, &associate1);
133 CHECK_STATUS(status, NT_STATUS_OK);
135 printf("association context (conn1): 0x%x\n", associate1.out.assoc_ctx);
137 printf("Send a start association request (conn2)\n");
138 status = wrepl_associate(wrepl_socket2, &associate2);
139 CHECK_STATUS(status, NT_STATUS_OK);
141 printf("association context (conn2): 0x%x\n", associate2.out.assoc_ctx);
143 printf("Send a replication table query, with assoc 1 (conn2), the anwser should be on conn1\n");
145 packet.opcode = WREPL_OPCODE_BITS;
146 packet.assoc_ctx = associate1.out.assoc_ctx;
147 packet.mess_type = WREPL_REPLICATION;
148 packet.message.replication.command = WREPL_REPL_TABLE_QUERY;
150 ctrl.send_only = True;
151 req = wrepl_request_send(wrepl_socket2, &packet, &ctrl);
152 status = wrepl_request_recv(req, mem_ctx, &rep_packet);
153 CHECK_STATUS(status, NT_STATUS_OK);
155 printf("Send a association request (conn2), to make sure the last request was ignored\n");
156 status = wrepl_associate(wrepl_socket2, &associate2);
157 CHECK_STATUS(status, NT_STATUS_OK);
159 printf("Send a replication table query, with invalid assoc (conn1), receive answer from conn2\n");
160 pull_table.in.assoc_ctx = 0;
161 req = wrepl_pull_table_send(wrepl_socket1, &pull_table);
162 status = wrepl_request_recv(req, mem_ctx, &rep_packet);
163 CHECK_STATUS(status, NT_STATUS_OK);
165 printf("Send a association request (conn1), to make sure the last request was handled correct\n");
166 status = wrepl_associate(wrepl_socket1, &associate2);
167 CHECK_STATUS(status, NT_STATUS_OK);
169 assoc_stop.in.assoc_ctx = associate1.out.assoc_ctx;
170 assoc_stop.in.reason = 4;
171 printf("Send a association stop request (conn1), reson: %u\n", assoc_stop.in.reason);
172 status = wrepl_associate_stop(wrepl_socket1, &assoc_stop);
173 CHECK_STATUS(status, NT_STATUS_END_OF_FILE);
175 assoc_stop.in.assoc_ctx = associate2.out.assoc_ctx;
176 assoc_stop.in.reason = 0;
177 printf("Send a association stop request (conn2), reson: %u\n", assoc_stop.in.reason);
178 status = wrepl_associate_stop(wrepl_socket2, &assoc_stop);
179 CHECK_STATUS(status, NT_STATUS_OK);
182 printf("Close 2 wrepl connections\n");
183 talloc_free(wrepl_socket1);
184 talloc_free(wrepl_socket2);
189 test if we always get back the same assoc_ctx
191 static BOOL test_assoc_ctx2(TALLOC_CTX *mem_ctx, const char *address)
194 struct wrepl_socket *wrepl_socket;
195 struct wrepl_associate associate;
199 printf("Test if we always get back the same assoc_ctx\n");
201 wrepl_socket = wrepl_socket_init(mem_ctx, NULL);
203 printf("Setup wrepl connections\n");
204 status = wrepl_connect(wrepl_socket, NULL, address);
205 CHECK_STATUS(status, NT_STATUS_OK);
208 printf("Send 1st start association request\n");
209 status = wrepl_associate(wrepl_socket, &associate);
210 CHECK_STATUS(status, NT_STATUS_OK);
211 assoc_ctx1 = associate.out.assoc_ctx;
212 printf("1st association context: 0x%x\n", associate.out.assoc_ctx);
214 printf("Send 2nd start association request\n");
215 status = wrepl_associate(wrepl_socket, &associate);
216 CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1);
217 CHECK_STATUS(status, NT_STATUS_OK);
218 printf("2nd association context: 0x%x\n", associate.out.assoc_ctx);
220 printf("Send 3rd start association request\n");
221 status = wrepl_associate(wrepl_socket, &associate);
222 CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1);
223 CHECK_STATUS(status, NT_STATUS_OK);
224 printf("3rd association context: 0x%x\n", associate.out.assoc_ctx);
227 printf("Close wrepl connections\n");
228 talloc_free(wrepl_socket);
234 display a replication entry
236 static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_name *name)
240 printf("%s\n", nbt_name_string(mem_ctx, &name->name));
241 printf("\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n",
242 name->type, name->state, name->node, name->is_static, (long long)name->version_id);
243 printf("\tRAW_FLAGS: 0x%08X OWNER: %-15s\n",
244 name->raw_flags, name->owner);
245 for (i=0;i<name->num_addresses;i++) {
246 printf("\tADDR: %-15s OWNER: %-15s\n",
247 name->addresses[i].address, name->addresses[i].owner);
252 test a full replication dump from a WINS server
254 static BOOL test_wins_replication(TALLOC_CTX *mem_ctx, const char *address)
257 struct wrepl_socket *wrepl_socket;
260 struct wrepl_associate associate;
261 struct wrepl_pull_table pull_table;
262 struct wrepl_pull_names pull_names;
264 printf("Test one pull replication cycle\n");
266 wrepl_socket = wrepl_socket_init(mem_ctx, NULL);
268 printf("Setup wrepl connections\n");
269 status = wrepl_connect(wrepl_socket, NULL, address);
270 CHECK_STATUS(status, NT_STATUS_OK);
272 printf("Send a start association request\n");
274 status = wrepl_associate(wrepl_socket, &associate);
275 CHECK_STATUS(status, NT_STATUS_OK);
277 printf("association context: 0x%x\n", associate.out.assoc_ctx);
279 printf("Send a replication table query\n");
280 pull_table.in.assoc_ctx = associate.out.assoc_ctx;
282 status = wrepl_pull_table(wrepl_socket, mem_ctx, &pull_table);
283 if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) {
284 struct wrepl_packet packet;
285 struct wrepl_request *req;
288 packet.opcode = WREPL_OPCODE_BITS;
289 packet.assoc_ctx = associate.out.assoc_ctx;
290 packet.mess_type = WREPL_STOP_ASSOCIATION;
291 packet.message.stop.reason = 0;
293 req = wrepl_request_send(wrepl_socket, &packet, NULL);
296 printf("failed - We are not a valid pull partner for the server\n");
300 CHECK_STATUS(status, NT_STATUS_OK);
302 printf("Found %d replication partners\n", pull_table.out.num_partners);
304 for (i=0;i<pull_table.out.num_partners;i++) {
305 struct wrepl_wins_owner *partner = &pull_table.out.partners[i];
306 printf("%s max_version=%6llu min_version=%6llu type=%d\n",
308 (long long)partner->max_version,
309 (long long)partner->min_version,
312 pull_names.in.assoc_ctx = associate.out.assoc_ctx;
313 pull_names.in.partner = *partner;
315 status = wrepl_pull_names(wrepl_socket, mem_ctx, &pull_names);
316 CHECK_STATUS(status, NT_STATUS_OK);
318 printf("Received %d names\n", pull_names.out.num_names);
320 for (j=0;j<pull_names.out.num_names;j++) {
321 display_entry(mem_ctx, &pull_names.out.names[j]);
326 printf("Close wrepl connections\n");
327 talloc_free(wrepl_socket);
331 struct test_wrepl_conflict_conn {
333 struct wrepl_socket *pull;
336 #define TEST_OWNER_A_ADDRESS "127.65.65.1"
337 #define TEST_ADDRESS_A_PREFIX "127.0.65"
338 #define TEST_OWNER_B_ADDRESS "127.66.66.1"
339 #define TEST_ADDRESS_B_PREFIX "127.0.66"
340 #define TEST_OWNER_X_ADDRESS "127.88.88.1"
341 #define TEST_ADDRESS_X_PREFIX "127.0.88"
343 struct wrepl_wins_owner a, b, c, x;
345 struct socket_address *myaddr;
346 struct socket_address *myaddr2;
347 struct nbt_name_socket *nbtsock;
348 struct nbt_name_socket *nbtsock2;
350 struct nbt_name_socket *nbtsock_srv;
351 struct nbt_name_socket *nbtsock_srv2;
353 uint32_t addresses_best_num;
354 struct wrepl_ip *addresses_best;
356 uint32_t addresses_best2_num;
357 struct wrepl_ip *addresses_best2;
359 uint32_t addresses_all_num;
360 struct wrepl_ip *addresses_all;
362 uint32_t addresses_mhomed_num;
363 struct wrepl_ip *addresses_mhomed;
366 static const struct wrepl_ip addresses_A_1[] = {
368 .owner = TEST_OWNER_A_ADDRESS,
369 .ip = TEST_ADDRESS_A_PREFIX".1"
372 static const struct wrepl_ip addresses_A_2[] = {
374 .owner = TEST_OWNER_A_ADDRESS,
375 .ip = TEST_ADDRESS_A_PREFIX".2"
378 static const struct wrepl_ip addresses_A_3_4[] = {
380 .owner = TEST_OWNER_A_ADDRESS,
381 .ip = TEST_ADDRESS_A_PREFIX".3"
384 .owner = TEST_OWNER_A_ADDRESS,
385 .ip = TEST_ADDRESS_A_PREFIX".4"
388 static const struct wrepl_ip addresses_A_3_4_X_3_4[] = {
390 .owner = TEST_OWNER_A_ADDRESS,
391 .ip = TEST_ADDRESS_A_PREFIX".3"
394 .owner = TEST_OWNER_A_ADDRESS,
395 .ip = TEST_ADDRESS_A_PREFIX".4"
398 .owner = TEST_OWNER_X_ADDRESS,
399 .ip = TEST_ADDRESS_X_PREFIX".3"
402 .owner = TEST_OWNER_X_ADDRESS,
403 .ip = TEST_ADDRESS_X_PREFIX".4"
406 static const struct wrepl_ip addresses_A_3_4_B_3_4[] = {
408 .owner = TEST_OWNER_A_ADDRESS,
409 .ip = TEST_ADDRESS_A_PREFIX".3"
412 .owner = TEST_OWNER_A_ADDRESS,
413 .ip = TEST_ADDRESS_A_PREFIX".4"
416 .owner = TEST_OWNER_B_ADDRESS,
417 .ip = TEST_ADDRESS_B_PREFIX".3"
420 .owner = TEST_OWNER_B_ADDRESS,
421 .ip = TEST_ADDRESS_B_PREFIX".4"
424 static const struct wrepl_ip addresses_A_3_4_OWNER_B[] = {
426 .owner = TEST_OWNER_B_ADDRESS,
427 .ip = TEST_ADDRESS_A_PREFIX".3"
430 .owner = TEST_OWNER_B_ADDRESS,
431 .ip = TEST_ADDRESS_A_PREFIX".4"
434 static const struct wrepl_ip addresses_A_3_4_X_3_4_OWNER_B[] = {
436 .owner = TEST_OWNER_B_ADDRESS,
437 .ip = TEST_ADDRESS_A_PREFIX".3"
440 .owner = TEST_OWNER_B_ADDRESS,
441 .ip = TEST_ADDRESS_A_PREFIX".4"
444 .owner = TEST_OWNER_B_ADDRESS,
445 .ip = TEST_ADDRESS_X_PREFIX".3"
448 .owner = TEST_OWNER_B_ADDRESS,
449 .ip = TEST_ADDRESS_X_PREFIX".4"
453 static const struct wrepl_ip addresses_A_3_4_X_1_2[] = {
455 .owner = TEST_OWNER_A_ADDRESS,
456 .ip = TEST_ADDRESS_A_PREFIX".3"
459 .owner = TEST_OWNER_A_ADDRESS,
460 .ip = TEST_ADDRESS_A_PREFIX".4"
463 .owner = TEST_OWNER_X_ADDRESS,
464 .ip = TEST_ADDRESS_X_PREFIX".1"
467 .owner = TEST_OWNER_X_ADDRESS,
468 .ip = TEST_ADDRESS_X_PREFIX".2"
472 static const struct wrepl_ip addresses_B_1[] = {
474 .owner = TEST_OWNER_B_ADDRESS,
475 .ip = TEST_ADDRESS_B_PREFIX".1"
478 static const struct wrepl_ip addresses_B_2[] = {
480 .owner = TEST_OWNER_B_ADDRESS,
481 .ip = TEST_ADDRESS_B_PREFIX".2"
484 static const struct wrepl_ip addresses_B_3_4[] = {
486 .owner = TEST_OWNER_B_ADDRESS,
487 .ip = TEST_ADDRESS_B_PREFIX".3"
490 .owner = TEST_OWNER_B_ADDRESS,
491 .ip = TEST_ADDRESS_B_PREFIX".4"
494 static const struct wrepl_ip addresses_B_3_4_X_3_4[] = {
496 .owner = TEST_OWNER_B_ADDRESS,
497 .ip = TEST_ADDRESS_B_PREFIX".3"
500 .owner = TEST_OWNER_B_ADDRESS,
501 .ip = TEST_ADDRESS_B_PREFIX".4"
504 .owner = TEST_OWNER_X_ADDRESS,
505 .ip = TEST_ADDRESS_X_PREFIX".3"
508 .owner = TEST_OWNER_X_ADDRESS,
509 .ip = TEST_ADDRESS_X_PREFIX".4"
512 static const struct wrepl_ip addresses_B_3_4_X_1_2[] = {
514 .owner = TEST_OWNER_B_ADDRESS,
515 .ip = TEST_ADDRESS_B_PREFIX".3"
518 .owner = TEST_OWNER_B_ADDRESS,
519 .ip = TEST_ADDRESS_B_PREFIX".4"
522 .owner = TEST_OWNER_X_ADDRESS,
523 .ip = TEST_ADDRESS_X_PREFIX".1"
526 .owner = TEST_OWNER_X_ADDRESS,
527 .ip = TEST_ADDRESS_X_PREFIX".2"
531 static const struct wrepl_ip addresses_X_1_2[] = {
533 .owner = TEST_OWNER_X_ADDRESS,
534 .ip = TEST_ADDRESS_X_PREFIX".1"
537 .owner = TEST_OWNER_X_ADDRESS,
538 .ip = TEST_ADDRESS_X_PREFIX".2"
541 static const struct wrepl_ip addresses_X_3_4[] = {
543 .owner = TEST_OWNER_X_ADDRESS,
544 .ip = TEST_ADDRESS_X_PREFIX".3"
547 .owner = TEST_OWNER_X_ADDRESS,
548 .ip = TEST_ADDRESS_X_PREFIX".4"
552 static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem_ctx,
555 struct test_wrepl_conflict_conn *ctx;
556 struct wrepl_associate associate;
557 struct wrepl_pull_table pull_table;
558 struct socket_address *nbt_srv_addr;
562 ctx = talloc_zero(mem_ctx, struct test_wrepl_conflict_conn);
563 if (!ctx) return NULL;
565 ctx->address = address;
566 ctx->pull = wrepl_socket_init(ctx, NULL);
567 if (!ctx->pull) return NULL;
569 printf("Setup wrepl conflict pull connection\n");
570 status = wrepl_connect(ctx->pull, NULL, ctx->address);
571 if (!NT_STATUS_IS_OK(status)) return NULL;
573 status = wrepl_associate(ctx->pull, &associate);
574 if (!NT_STATUS_IS_OK(status)) return NULL;
576 ctx->pull_assoc = associate.out.assoc_ctx;
578 ctx->a.address = TEST_OWNER_A_ADDRESS;
579 ctx->a.max_version = 0;
580 ctx->a.min_version = 0;
583 ctx->b.address = TEST_OWNER_B_ADDRESS;
584 ctx->b.max_version = 0;
585 ctx->b.min_version = 0;
588 ctx->x.address = TEST_OWNER_X_ADDRESS;
589 ctx->x.max_version = 0;
590 ctx->x.min_version = 0;
593 ctx->c.address = address;
594 ctx->c.max_version = 0;
595 ctx->c.min_version = 0;
598 pull_table.in.assoc_ctx = ctx->pull_assoc;
599 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
600 if (!NT_STATUS_IS_OK(status)) return NULL;
602 for (i=0; i < pull_table.out.num_partners; i++) {
603 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
604 ctx->a.max_version = pull_table.out.partners[i].max_version;
605 ctx->a.min_version = pull_table.out.partners[i].min_version;
607 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
608 ctx->b.max_version = pull_table.out.partners[i].max_version;
609 ctx->b.min_version = pull_table.out.partners[i].min_version;
611 if (strcmp(TEST_OWNER_X_ADDRESS,pull_table.out.partners[i].address)==0) {
612 ctx->x.max_version = pull_table.out.partners[i].max_version;
613 ctx->x.min_version = pull_table.out.partners[i].min_version;
615 if (strcmp(address,pull_table.out.partners[i].address)==0) {
616 ctx->c.max_version = pull_table.out.partners[i].max_version;
617 ctx->c.min_version = pull_table.out.partners[i].min_version;
621 talloc_free(pull_table.out.partners);
623 ctx->nbtsock = nbt_name_socket_init(ctx, NULL);
624 if (!ctx->nbtsock) return NULL;
626 ctx->myaddr = socket_address_from_strings(mem_ctx, ctx->nbtsock->sock->backend_name, iface_best_ip(address), 0);
627 if (!ctx->myaddr) return NULL;
629 for (i = 0; i < iface_count(); i++) {
630 if (strcmp(ctx->myaddr->addr, iface_n_ip(i)) == 0) continue;
631 ctx->myaddr2 = socket_address_from_strings(mem_ctx, ctx->nbtsock->sock->backend_name, iface_n_ip(i), 0);
632 if (!ctx->myaddr2) return NULL;
636 status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0);
637 if (!NT_STATUS_IS_OK(status)) return NULL;
639 ctx->nbtsock_srv = nbt_name_socket_init(ctx, NULL);
640 if (!ctx->nbtsock_srv) return NULL;
642 /* Make a port 137 version of ctx->myaddr */
643 nbt_srv_addr = socket_address_from_strings(mem_ctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lp_nbt_port());
644 if (!nbt_srv_addr) return NULL;
646 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
647 status = socket_listen(ctx->nbtsock_srv->sock, nbt_srv_addr, 0, 0);
648 talloc_free(nbt_srv_addr);
649 if (!NT_STATUS_IS_OK(status)) {
650 /* this isn't fatal */
651 talloc_free(ctx->nbtsock_srv);
652 ctx->nbtsock_srv = NULL;
655 if (ctx->myaddr2 && ctx->nbtsock_srv) {
656 ctx->nbtsock2 = nbt_name_socket_init(ctx, NULL);
657 if (!ctx->nbtsock2) return NULL;
659 status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0);
660 if (!NT_STATUS_IS_OK(status)) return NULL;
662 ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx);
663 if (!ctx->nbtsock_srv2) return NULL;
665 /* Make a port 137 version of ctx->myaddr2 */
666 nbt_srv_addr = socket_address_from_strings(mem_ctx,
667 ctx->nbtsock_srv->sock->backend_name,
668 ctx->myaddr2->addr, lp_nbt_port());
669 if (!nbt_srv_addr) return NULL;
671 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
672 status = socket_listen(ctx->nbtsock_srv2->sock, ctx->myaddr2, 0, 0);
673 talloc_free(nbt_srv_addr);
674 if (!NT_STATUS_IS_OK(status)) {
675 /* this isn't fatal */
676 talloc_free(ctx->nbtsock_srv2);
677 ctx->nbtsock_srv2 = NULL;
681 ctx->addresses_best_num = 1;
682 ctx->addresses_best = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best_num);
683 if (!ctx->addresses_best) return NULL;
684 ctx->addresses_best[0].owner = ctx->b.address;
685 ctx->addresses_best[0].ip = ctx->myaddr->addr;
687 ctx->addresses_all_num = iface_count();
688 ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num);
689 if (!ctx->addresses_all) return NULL;
690 for (i=0; i < ctx->addresses_all_num; i++) {
691 ctx->addresses_all[i].owner = ctx->b.address;
692 ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(i));
693 if (!ctx->addresses_all[i].ip) return NULL;
696 if (ctx->nbtsock_srv2) {
697 ctx->addresses_best2_num = 1;
698 ctx->addresses_best2 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best2_num);
699 if (!ctx->addresses_best2) return NULL;
700 ctx->addresses_best2[0].owner = ctx->b.address;
701 ctx->addresses_best2[0].ip = ctx->myaddr2->addr;
703 ctx->addresses_mhomed_num = 2;
704 ctx->addresses_mhomed = talloc_array(ctx, struct wrepl_ip, ctx->addresses_mhomed_num);
705 if (!ctx->addresses_mhomed) return NULL;
706 ctx->addresses_mhomed[0].owner = ctx->b.address;
707 ctx->addresses_mhomed[0].ip = ctx->myaddr->addr;
708 ctx->addresses_mhomed[1].owner = ctx->b.address;
709 ctx->addresses_mhomed[1].ip = ctx->myaddr2->addr;
715 static BOOL test_wrepl_update_one(struct test_wrepl_conflict_conn *ctx,
716 const struct wrepl_wins_owner *owner,
717 const struct wrepl_wins_name *name)
720 struct wrepl_socket *wrepl_socket;
721 struct wrepl_associate associate;
722 struct wrepl_packet update_packet, repl_send;
723 struct wrepl_table *update;
724 struct wrepl_wins_owner wrepl_wins_owners[1];
725 struct wrepl_packet *repl_recv;
726 struct wrepl_wins_owner *send_request;
727 struct wrepl_send_reply *send_reply;
728 struct wrepl_wins_name wrepl_wins_names[1];
732 wrepl_socket = wrepl_socket_init(ctx, NULL);
734 status = wrepl_connect(wrepl_socket, NULL, ctx->address);
735 CHECK_STATUS(status, NT_STATUS_OK);
737 status = wrepl_associate(wrepl_socket, &associate);
738 CHECK_STATUS(status, NT_STATUS_OK);
739 assoc_ctx = associate.out.assoc_ctx;
741 /* now send a WREPL_REPL_UPDATE message */
742 ZERO_STRUCT(update_packet);
743 update_packet.opcode = WREPL_OPCODE_BITS;
744 update_packet.assoc_ctx = assoc_ctx;
745 update_packet.mess_type = WREPL_REPLICATION;
746 update_packet.message.replication.command = WREPL_REPL_UPDATE;
747 update = &update_packet.message.replication.info.table;
749 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
750 update->partners = wrepl_wins_owners;
751 update->initiator = "0.0.0.0";
753 wrepl_wins_owners[0] = *owner;
755 status = wrepl_request(wrepl_socket, wrepl_socket,
756 &update_packet, &repl_recv);
757 CHECK_STATUS(status, NT_STATUS_OK);
758 CHECK_VALUE(repl_recv->mess_type, WREPL_REPLICATION);
759 CHECK_VALUE(repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
760 send_request = &repl_recv->message.replication.info.owner;
762 ZERO_STRUCT(repl_send);
763 repl_send.opcode = WREPL_OPCODE_BITS;
764 repl_send.assoc_ctx = assoc_ctx;
765 repl_send.mess_type = WREPL_REPLICATION;
766 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
767 send_reply = &repl_send.message.replication.info.reply;
769 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
770 send_reply->names = wrepl_wins_names;
772 wrepl_wins_names[0] = *name;
774 status = wrepl_request(wrepl_socket, wrepl_socket,
775 &repl_send, &repl_recv);
776 CHECK_STATUS(status, NT_STATUS_OK);
777 CHECK_VALUE(repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
778 CHECK_VALUE(repl_recv->message.stop.reason, 0);
781 talloc_free(wrepl_socket);
785 static BOOL test_wrepl_is_applied(struct test_wrepl_conflict_conn *ctx,
786 const struct wrepl_wins_owner *owner,
787 const struct wrepl_wins_name *name,
792 struct wrepl_pull_names pull_names;
793 struct wrepl_name *names;
795 pull_names.in.assoc_ctx = ctx->pull_assoc;
796 pull_names.in.partner = *owner;
797 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
799 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
800 CHECK_STATUS(status, NT_STATUS_OK);
801 CHECK_VALUE(pull_names.out.num_names, (expected?1:0));
803 names = pull_names.out.names;
806 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
810 CHECK_VALUE(names[0].name.type, name->name->type);
811 CHECK_VALUE_STRING(names[0].name.name, name->name->name);
812 CHECK_VALUE_STRING(names[0].name.scope, name->name->scope);
813 CHECK_VALUE(flags, name->flags);
814 CHECK_VALUE_UINT64(names[0].version_id, name->id);
817 CHECK_VALUE(names[0].num_addresses,
818 name->addresses.addresses.num_ips);
820 CHECK_VALUE(names[0].num_addresses, 1);
821 CHECK_VALUE_STRING(names[0].addresses[0].address,
826 talloc_free(pull_names.out.names);
830 static BOOL test_wrepl_mhomed_merged(struct test_wrepl_conflict_conn *ctx,
831 const struct wrepl_wins_owner *owner1,
832 uint32_t num_ips1, const struct wrepl_ip *ips1,
833 const struct wrepl_wins_owner *owner2,
834 uint32_t num_ips2, const struct wrepl_ip *ips2,
835 const struct wrepl_wins_name *name2)
839 struct wrepl_pull_names pull_names;
840 struct wrepl_name *names;
843 uint32_t num_ips = num_ips1 + num_ips2;
845 for (i = 0; i < num_ips2; i++) {
846 for (j = 0; j < num_ips1; j++) {
847 if (strcmp(ips2[i].ip,ips1[j].ip) == 0) {
854 pull_names.in.assoc_ctx = ctx->pull_assoc;
855 pull_names.in.partner = *owner2;
856 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
858 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
859 CHECK_STATUS(status, NT_STATUS_OK);
860 CHECK_VALUE(pull_names.out.num_names, 1);
862 names = pull_names.out.names;
864 flags = WREPL_NAME_FLAGS(names[0].type,
868 CHECK_VALUE(names[0].name.type, name2->name->type);
869 CHECK_VALUE_STRING(names[0].name.name, name2->name->name);
870 CHECK_VALUE_STRING(names[0].name.scope, name2->name->scope);
871 CHECK_VALUE(flags, name2->flags | WREPL_TYPE_MHOMED);
872 CHECK_VALUE_UINT64(names[0].version_id, name2->id);
874 CHECK_VALUE(names[0].num_addresses, num_ips);
876 for (i = 0; i < names[0].num_addresses; i++) {
877 const char *addr = names[0].addresses[i].address;
878 const char *owner = names[0].addresses[i].owner;
881 for (j = 0; j < num_ips2; j++) {
882 if (strcmp(addr, ips2[j].ip) == 0) {
884 CHECK_VALUE_STRING(owner, owner2->address);
891 for (j = 0; j < num_ips1; j++) {
892 if (strcmp(addr, ips1[j].ip) == 0) {
894 CHECK_VALUE_STRING(owner, owner1->address);
901 CHECK_VALUE_STRING(addr, "not found in address list");
904 talloc_free(pull_names.out.names);
908 static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx,
909 struct wrepl_wins_owner *merge_owner,
910 struct wrepl_wins_owner *owner1,
911 uint32_t num_ips1, const struct wrepl_ip *ips1,
912 struct wrepl_wins_owner *owner2,
913 uint32_t num_ips2, const struct wrepl_ip *ips2,
914 const struct wrepl_wins_name *name2)
918 struct wrepl_pull_names pull_names;
919 struct wrepl_name *names;
920 struct wrepl_name *name = NULL;
923 uint32_t num_ips = num_ips1 + num_ips2;
926 merge_owner = &ctx->c;
929 for (i = 0; i < num_ips1; i++) {
930 if (owner1 != &ctx->c && strcmp(ips1[i].owner,owner2->address) == 0) {
934 for (j = 0; j < num_ips2; j++) {
935 if (strcmp(ips1[i].ip,ips2[j].ip) == 0) {
943 pull_names.in.assoc_ctx = ctx->pull_assoc;
944 pull_names.in.partner = *merge_owner;
945 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
946 pull_names.in.partner.max_version = 0;
948 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
949 CHECK_STATUS(status, NT_STATUS_OK);
951 names = pull_names.out.names;
953 for (i = 0; i < pull_names.out.num_names; i++) {
954 if (names[i].name.type != name2->name->type) continue;
955 if (!names[i].name.name) continue;
956 if (strcmp(names[i].name.name, name2->name->name) != 0) continue;
957 if (names[i].name.scope) continue;
962 if (pull_names.out.num_names > 0) {
963 merge_owner->max_version = names[pull_names.out.num_names-1].version_id;
967 printf("%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name));
971 flags = WREPL_NAME_FLAGS(name->type,
975 CHECK_VALUE(name->name.type, name2->name->type);
976 CHECK_VALUE_STRING(name->name.name, name2->name->name);
977 CHECK_VALUE_STRING(name->name.scope, name2->name->scope);
978 CHECK_VALUE(flags, name2->flags);
980 CHECK_VALUE(name->num_addresses, num_ips);
982 for (i = 0; i < name->num_addresses; i++) {
983 const char *addr = name->addresses[i].address;
984 const char *owner = name->addresses[i].owner;
987 for (j = 0; j < num_ips2; j++) {
988 if (strcmp(addr, ips2[j].ip) == 0) {
990 CHECK_VALUE_STRING(owner, ips2[j].owner);
997 for (j = 0; j < num_ips1; j++) {
998 if (strcmp(addr, ips1[j].ip) == 0) {
1000 if (owner1 == &ctx->c) {
1001 CHECK_VALUE_STRING(owner, owner1->address);
1003 CHECK_VALUE_STRING(owner, ips1[j].owner);
1009 if (found) continue;
1011 CHECK_VALUE_STRING(addr, "not found in address list");
1014 talloc_free(pull_names.out.names);
1018 static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx)
1021 struct nbt_name name;
1022 struct wrepl_wins_name wins_name1;
1023 struct wrepl_wins_name wins_name2;
1024 struct wrepl_wins_name *wins_name_tmp;
1025 struct wrepl_wins_name *wins_name_last;
1026 struct wrepl_wins_name *wins_name_cur;
1028 uint8_t types[] = { 0x00, 0x1C };
1030 enum wrepl_name_type type;
1031 enum wrepl_name_state state;
1032 enum wrepl_name_node node;
1035 const struct wrepl_ip *ips;
1038 .type = WREPL_TYPE_GROUP,
1039 .state = WREPL_STATE_ACTIVE,
1040 .node = WREPL_NODE_B,
1042 .num_ips = ARRAY_SIZE(addresses_A_1),
1043 .ips = addresses_A_1,
1045 .type = WREPL_TYPE_UNIQUE,
1046 .state = WREPL_STATE_ACTIVE,
1047 .node = WREPL_NODE_B,
1049 .num_ips = ARRAY_SIZE(addresses_A_1),
1050 .ips = addresses_A_1,
1052 .type = WREPL_TYPE_UNIQUE,
1053 .state = WREPL_STATE_ACTIVE,
1054 .node = WREPL_NODE_B,
1056 .num_ips = ARRAY_SIZE(addresses_A_2),
1057 .ips = addresses_A_2,
1059 .type = WREPL_TYPE_UNIQUE,
1060 .state = WREPL_STATE_ACTIVE,
1061 .node = WREPL_NODE_B,
1063 .num_ips = ARRAY_SIZE(addresses_A_1),
1064 .ips = addresses_A_1,
1066 .type = WREPL_TYPE_UNIQUE,
1067 .state = WREPL_STATE_ACTIVE,
1068 .node = WREPL_NODE_B,
1070 .num_ips = ARRAY_SIZE(addresses_A_2),
1071 .ips = addresses_A_2,
1073 .type = WREPL_TYPE_SGROUP,
1074 .state = WREPL_STATE_TOMBSTONE,
1075 .node = WREPL_NODE_B,
1077 .num_ips = ARRAY_SIZE(addresses_A_2),
1078 .ips = addresses_A_2,
1080 .type = WREPL_TYPE_MHOMED,
1081 .state = WREPL_STATE_TOMBSTONE,
1082 .node = WREPL_NODE_B,
1084 .num_ips = ARRAY_SIZE(addresses_A_1),
1085 .ips = addresses_A_1,
1087 .type = WREPL_TYPE_MHOMED,
1088 .state = WREPL_STATE_RELEASED,
1089 .node = WREPL_NODE_B,
1091 .num_ips = ARRAY_SIZE(addresses_A_2),
1092 .ips = addresses_A_2,
1094 .type = WREPL_TYPE_SGROUP,
1095 .state = WREPL_STATE_ACTIVE,
1096 .node = WREPL_NODE_B,
1098 .num_ips = ARRAY_SIZE(addresses_A_1),
1099 .ips = addresses_A_1,
1101 .type = WREPL_TYPE_SGROUP,
1102 .state = WREPL_STATE_ACTIVE,
1103 .node = WREPL_NODE_B,
1105 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1106 .ips = addresses_A_3_4,
1108 .type = WREPL_TYPE_SGROUP,
1109 .state = WREPL_STATE_TOMBSTONE,
1110 .node = WREPL_NODE_B,
1112 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1113 .ips = addresses_B_3_4,
1115 /* the last one should always be a unique,tomstone record! */
1116 .type = WREPL_TYPE_UNIQUE,
1117 .state = WREPL_STATE_TOMBSTONE,
1118 .node = WREPL_NODE_B,
1120 .num_ips = ARRAY_SIZE(addresses_A_1),
1121 .ips = addresses_A_1,
1125 name.name = "_SAME_OWNER_A";
1129 wins_name_tmp = NULL;
1130 wins_name_last = &wins_name2;
1131 wins_name_cur = &wins_name1;
1133 for (j=0; ret && j < ARRAY_SIZE(types); j++) {
1134 name.type = types[j];
1135 printf("Test Replica Conflicts with same owner[%s] for %s\n",
1136 nbt_name_string(ctx, &name), ctx->a.address);
1138 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
1139 wins_name_tmp = wins_name_last;
1140 wins_name_last = wins_name_cur;
1141 wins_name_cur = wins_name_tmp;
1144 printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
1145 wrepl_name_type_string(records[i-1].type),
1146 wrepl_name_state_string(records[i-1].state),
1147 (records[i-1].is_static?",static":""),
1148 wrepl_name_type_string(records[i].type),
1149 wrepl_name_state_string(records[i].state),
1150 (records[i].is_static?",static":""),
1151 (records[i-1].ips==records[i].ips?"same":"different"),
1155 wins_name_cur->name = &name;
1156 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
1159 records[i].is_static);
1160 wins_name_cur->id = ++ctx->a.max_version;
1161 if (wins_name_cur->flags & 2) {
1162 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
1163 wins_name_cur->addresses.addresses.ips = discard_const(records[i].ips);
1165 wins_name_cur->addresses.ip = records[i].ips[0].ip;
1167 wins_name_cur->unknown = "255.255.255.255";
1169 ret &= test_wrepl_update_one(ctx, &ctx->a,wins_name_cur);
1170 if (records[i].state == WREPL_STATE_RELEASED) {
1171 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_last, False);
1172 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, False);
1174 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, True);
1177 /* the first one is a cleanup run */
1178 if (!ret && i == 0) ret = True;
1181 printf("conflict handled wrong or record[%u]: %s\n", i, __location__);
1189 static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx)
1192 struct wrepl_wins_name wins_name1;
1193 struct wrepl_wins_name wins_name2;
1194 struct wrepl_wins_name *wins_name_r1;
1195 struct wrepl_wins_name *wins_name_r2;
1198 const char *line; /* just better debugging */
1199 struct nbt_name name;
1200 const char *comment;
1201 BOOL extra; /* not the worst case, this is an extra test */
1204 struct wrepl_wins_owner *owner;
1205 enum wrepl_name_type type;
1206 enum wrepl_name_state state;
1207 enum wrepl_name_node node;
1210 const struct wrepl_ip *ips;
1211 BOOL apply_expected;
1213 struct wrepl_wins_owner *merge_owner;
1214 BOOL sgroup_cleanup;
1218 * NOTE: the first record and the last applied one
1219 * needs to be from the same owner,
1220 * to not conflict in the next smbtorture run!!!
1223 .line = __location__,
1224 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1228 .type = WREPL_TYPE_UNIQUE,
1229 .state = WREPL_STATE_TOMBSTONE,
1230 .node = WREPL_NODE_B,
1232 .num_ips = ARRAY_SIZE(addresses_B_1),
1233 .ips = addresses_B_1,
1234 .apply_expected = True /* ignored */
1238 .type = WREPL_TYPE_UNIQUE,
1239 .state = WREPL_STATE_TOMBSTONE,
1240 .node = WREPL_NODE_B,
1242 .num_ips = ARRAY_SIZE(addresses_A_1),
1243 .ips = addresses_A_1,
1244 .apply_expected = True /* ignored */
1249 * unique vs unique section
1252 * unique,active vs. unique,active
1253 * => should be replaced
1256 .line = __location__,
1257 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1260 .type = WREPL_TYPE_UNIQUE,
1261 .state = WREPL_STATE_ACTIVE,
1262 .node = WREPL_NODE_B,
1264 .num_ips = ARRAY_SIZE(addresses_A_1),
1265 .ips = addresses_A_1,
1266 .apply_expected = True
1270 .type = WREPL_TYPE_UNIQUE,
1271 .state = WREPL_STATE_ACTIVE,
1272 .node = WREPL_NODE_B,
1274 .num_ips = ARRAY_SIZE(addresses_B_1),
1275 .ips = addresses_B_1,
1276 .apply_expected = True
1281 * unique,active vs. unique,tombstone
1282 * => should NOT be replaced
1285 .line = __location__,
1286 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1289 .type = WREPL_TYPE_UNIQUE,
1290 .state = WREPL_STATE_ACTIVE,
1291 .node = WREPL_NODE_B,
1293 .num_ips = ARRAY_SIZE(addresses_B_1),
1294 .ips = addresses_B_1,
1295 .apply_expected = True
1299 .type = WREPL_TYPE_UNIQUE,
1300 .state = WREPL_STATE_TOMBSTONE,
1301 .node = WREPL_NODE_B,
1303 .num_ips = ARRAY_SIZE(addresses_B_1),
1304 .ips = addresses_B_1,
1305 .apply_expected = False
1310 * unique,released vs. unique,active
1311 * => should be replaced
1314 .line = __location__,
1315 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1318 .type = WREPL_TYPE_UNIQUE,
1319 .state = WREPL_STATE_RELEASED,
1320 .node = WREPL_NODE_B,
1322 .num_ips = ARRAY_SIZE(addresses_B_1),
1323 .ips = addresses_B_1,
1324 .apply_expected = False
1328 .type = WREPL_TYPE_UNIQUE,
1329 .state = WREPL_STATE_ACTIVE,
1330 .node = WREPL_NODE_B,
1332 .num_ips = ARRAY_SIZE(addresses_A_1),
1333 .ips = addresses_A_1,
1334 .apply_expected = True
1339 * unique,released vs. unique,tombstone
1340 * => should be replaced
1343 .line = __location__,
1344 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1347 .type = WREPL_TYPE_UNIQUE,
1348 .state = WREPL_STATE_RELEASED,
1349 .node = WREPL_NODE_B,
1351 .num_ips = ARRAY_SIZE(addresses_A_1),
1352 .ips = addresses_A_1,
1353 .apply_expected = False
1357 .type = WREPL_TYPE_UNIQUE,
1358 .state = WREPL_STATE_TOMBSTONE,
1359 .node = WREPL_NODE_B,
1361 .num_ips = ARRAY_SIZE(addresses_B_1),
1362 .ips = addresses_B_1,
1363 .apply_expected = True
1368 * unique,tombstone vs. unique,active
1369 * => should be replaced
1372 .line = __location__,
1373 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1376 .type = WREPL_TYPE_UNIQUE,
1377 .state = WREPL_STATE_TOMBSTONE,
1378 .node = WREPL_NODE_B,
1380 .num_ips = ARRAY_SIZE(addresses_B_1),
1381 .ips = addresses_B_1,
1382 .apply_expected = True
1386 .type = WREPL_TYPE_UNIQUE,
1387 .state = WREPL_STATE_ACTIVE,
1388 .node = WREPL_NODE_B,
1390 .num_ips = ARRAY_SIZE(addresses_A_1),
1391 .ips = addresses_A_1,
1392 .apply_expected = True
1397 * unique,tombstone vs. unique,tombstone
1398 * => should be replaced
1401 .line = __location__,
1402 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1405 .type = WREPL_TYPE_UNIQUE,
1406 .state = WREPL_STATE_TOMBSTONE,
1407 .node = WREPL_NODE_B,
1409 .num_ips = ARRAY_SIZE(addresses_A_1),
1410 .ips = addresses_A_1,
1411 .apply_expected = True
1415 .type = WREPL_TYPE_UNIQUE,
1416 .state = WREPL_STATE_TOMBSTONE,
1417 .node = WREPL_NODE_B,
1419 .num_ips = ARRAY_SIZE(addresses_B_1),
1420 .ips = addresses_B_1,
1421 .apply_expected = True
1427 * unique vs normal groups section,
1430 * unique,active vs. group,active
1431 * => should be replaced
1434 .line = __location__,
1435 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1438 .type = WREPL_TYPE_UNIQUE,
1439 .state = WREPL_STATE_ACTIVE,
1440 .node = WREPL_NODE_B,
1442 .num_ips = ARRAY_SIZE(addresses_B_1),
1443 .ips = addresses_B_1,
1444 .apply_expected = True
1448 .type = WREPL_TYPE_GROUP,
1449 .state = WREPL_STATE_ACTIVE,
1450 .node = WREPL_NODE_B,
1452 .num_ips = ARRAY_SIZE(addresses_A_1),
1453 .ips = addresses_A_1,
1454 .apply_expected = True
1459 * unique,active vs. group,tombstone
1460 * => should NOT be replaced
1463 .line = __location__,
1464 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1467 .type = WREPL_TYPE_UNIQUE,
1468 .state = WREPL_STATE_ACTIVE,
1469 .node = WREPL_NODE_B,
1471 .num_ips = ARRAY_SIZE(addresses_A_1),
1472 .ips = addresses_A_1,
1473 .apply_expected = True
1477 .type = WREPL_TYPE_GROUP,
1478 .state = WREPL_STATE_TOMBSTONE,
1479 .node = WREPL_NODE_B,
1481 .num_ips = ARRAY_SIZE(addresses_A_1),
1482 .ips = addresses_A_1,
1483 .apply_expected = False
1488 * unique,released vs. group,active
1489 * => should be replaced
1492 .line = __location__,
1493 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1496 .type = WREPL_TYPE_UNIQUE,
1497 .state = WREPL_STATE_RELEASED,
1498 .node = WREPL_NODE_B,
1500 .num_ips = ARRAY_SIZE(addresses_A_1),
1501 .ips = addresses_A_1,
1502 .apply_expected = False
1506 .type = WREPL_TYPE_GROUP,
1507 .state = WREPL_STATE_ACTIVE,
1508 .node = WREPL_NODE_B,
1510 .num_ips = ARRAY_SIZE(addresses_B_1),
1511 .ips = addresses_B_1,
1512 .apply_expected = True
1517 * unique,released vs. group,tombstone
1518 * => should be replaced
1521 .line = __location__,
1522 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1525 .type = WREPL_TYPE_UNIQUE,
1526 .state = WREPL_STATE_RELEASED,
1527 .node = WREPL_NODE_B,
1529 .num_ips = ARRAY_SIZE(addresses_B_1),
1530 .ips = addresses_B_1,
1531 .apply_expected = False
1535 .type = WREPL_TYPE_GROUP,
1536 .state = WREPL_STATE_TOMBSTONE,
1537 .node = WREPL_NODE_B,
1539 .num_ips = ARRAY_SIZE(addresses_A_1),
1540 .ips = addresses_A_1,
1541 .apply_expected = True
1546 * unique,tombstone vs. group,active
1547 * => should be replaced
1550 .line = __location__,
1551 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1554 .type = WREPL_TYPE_UNIQUE,
1555 .state = WREPL_STATE_TOMBSTONE,
1556 .node = WREPL_NODE_B,
1558 .num_ips = ARRAY_SIZE(addresses_A_1),
1559 .ips = addresses_A_1,
1560 .apply_expected = True
1564 .type = WREPL_TYPE_GROUP,
1565 .state = WREPL_STATE_ACTIVE,
1566 .node = WREPL_NODE_B,
1568 .num_ips = ARRAY_SIZE(addresses_B_1),
1569 .ips = addresses_B_1,
1570 .apply_expected = True
1575 * unique,tombstone vs. group,tombstone
1576 * => should be replaced
1579 .line = __location__,
1580 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1583 .type = WREPL_TYPE_UNIQUE,
1584 .state = WREPL_STATE_TOMBSTONE,
1585 .node = WREPL_NODE_B,
1587 .num_ips = ARRAY_SIZE(addresses_B_1),
1588 .ips = addresses_B_1,
1589 .apply_expected = True
1593 .type = WREPL_TYPE_GROUP,
1594 .state = WREPL_STATE_TOMBSTONE,
1595 .node = WREPL_NODE_B,
1597 .num_ips = ARRAY_SIZE(addresses_A_1),
1598 .ips = addresses_A_1,
1599 .apply_expected = True
1604 * unique vs special groups section,
1607 * unique,active vs. sgroup,active
1608 * => should NOT be replaced
1611 .line = __location__,
1612 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1615 .type = WREPL_TYPE_UNIQUE,
1616 .state = WREPL_STATE_ACTIVE,
1617 .node = WREPL_NODE_B,
1619 .num_ips = ARRAY_SIZE(addresses_A_1),
1620 .ips = addresses_A_1,
1621 .apply_expected = True
1625 .type = WREPL_TYPE_SGROUP,
1626 .state = WREPL_STATE_ACTIVE,
1627 .node = WREPL_NODE_B,
1629 .num_ips = ARRAY_SIZE(addresses_A_1),
1630 .ips = addresses_A_1,
1631 .apply_expected = False
1636 * unique,active vs. sgroup,tombstone
1637 * => should NOT be replaced
1640 .line = __location__,
1641 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1644 .type = WREPL_TYPE_UNIQUE,
1645 .state = WREPL_STATE_ACTIVE,
1646 .node = WREPL_NODE_B,
1648 .num_ips = ARRAY_SIZE(addresses_A_1),
1649 .ips = addresses_A_1,
1650 .apply_expected = True
1654 .type = WREPL_TYPE_SGROUP,
1655 .state = WREPL_STATE_TOMBSTONE,
1656 .node = WREPL_NODE_B,
1658 .num_ips = ARRAY_SIZE(addresses_A_1),
1659 .ips = addresses_A_1,
1660 .apply_expected = False
1665 * unique,released vs. sgroup,active
1666 * => should be replaced
1669 .line = __location__,
1670 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1673 .type = WREPL_TYPE_UNIQUE,
1674 .state = WREPL_STATE_RELEASED,
1675 .node = WREPL_NODE_B,
1677 .num_ips = ARRAY_SIZE(addresses_A_1),
1678 .ips = addresses_A_1,
1679 .apply_expected = False
1683 .type = WREPL_TYPE_SGROUP,
1684 .state = WREPL_STATE_ACTIVE,
1685 .node = WREPL_NODE_B,
1687 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1688 .ips = addresses_B_3_4,
1689 .apply_expected = True
1694 * unique,released vs. sgroup,tombstone
1695 * => should be replaced
1698 .line = __location__,
1699 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1702 .type = WREPL_TYPE_UNIQUE,
1703 .state = WREPL_STATE_RELEASED,
1704 .node = WREPL_NODE_B,
1706 .num_ips = ARRAY_SIZE(addresses_B_1),
1707 .ips = addresses_B_1,
1708 .apply_expected = False
1712 .type = WREPL_TYPE_SGROUP,
1713 .state = WREPL_STATE_TOMBSTONE,
1714 .node = WREPL_NODE_B,
1716 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1717 .ips = addresses_A_3_4,
1718 .apply_expected = True
1723 * unique,tombstone vs. sgroup,active
1724 * => should be replaced
1727 .line = __location__,
1728 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1731 .type = WREPL_TYPE_UNIQUE,
1732 .state = WREPL_STATE_TOMBSTONE,
1733 .node = WREPL_NODE_B,
1735 .num_ips = ARRAY_SIZE(addresses_A_1),
1736 .ips = addresses_A_1,
1737 .apply_expected = True
1741 .type = WREPL_TYPE_SGROUP,
1742 .state = WREPL_STATE_ACTIVE,
1743 .node = WREPL_NODE_B,
1745 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1746 .ips = addresses_B_3_4,
1747 .apply_expected = True
1752 * unique,tombstone vs. sgroup,tombstone
1753 * => should be replaced
1756 .line = __location__,
1757 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1760 .type = WREPL_TYPE_UNIQUE,
1761 .state = WREPL_STATE_TOMBSTONE,
1762 .node = WREPL_NODE_B,
1764 .num_ips = ARRAY_SIZE(addresses_B_1),
1765 .ips = addresses_B_1,
1766 .apply_expected = True
1770 .type = WREPL_TYPE_SGROUP,
1771 .state = WREPL_STATE_TOMBSTONE,
1772 .node = WREPL_NODE_B,
1774 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1775 .ips = addresses_A_3_4,
1776 .apply_expected = True
1781 * unique vs multi homed section,
1784 * unique,active vs. mhomed,active
1785 * => should be replaced
1788 .line = __location__,
1789 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1792 .type = WREPL_TYPE_UNIQUE,
1793 .state = WREPL_STATE_ACTIVE,
1794 .node = WREPL_NODE_B,
1796 .num_ips = ARRAY_SIZE(addresses_A_1),
1797 .ips = addresses_A_1,
1798 .apply_expected = True
1802 .type = WREPL_TYPE_MHOMED,
1803 .state = WREPL_STATE_ACTIVE,
1804 .node = WREPL_NODE_B,
1806 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1807 .ips = addresses_B_3_4,
1808 .apply_expected = True
1813 * unique,active vs. mhomed,tombstone
1814 * => should NOT be replaced
1817 .line = __location__,
1818 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1821 .type = WREPL_TYPE_UNIQUE,
1822 .state = WREPL_STATE_ACTIVE,
1823 .node = WREPL_NODE_B,
1825 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1826 .ips = addresses_B_3_4,
1827 .apply_expected = True
1831 .type = WREPL_TYPE_MHOMED,
1832 .state = WREPL_STATE_TOMBSTONE,
1833 .node = WREPL_NODE_B,
1835 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1836 .ips = addresses_B_3_4,
1837 .apply_expected = False
1842 * unique,released vs. mhomed,active
1843 * => should be replaced
1846 .line = __location__,
1847 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1850 .type = WREPL_TYPE_UNIQUE,
1851 .state = WREPL_STATE_RELEASED,
1852 .node = WREPL_NODE_B,
1854 .num_ips = ARRAY_SIZE(addresses_B_1),
1855 .ips = addresses_B_1,
1856 .apply_expected = False
1860 .type = WREPL_TYPE_MHOMED,
1861 .state = WREPL_STATE_ACTIVE,
1862 .node = WREPL_NODE_B,
1864 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1865 .ips = addresses_A_3_4,
1866 .apply_expected = True
1871 * unique,released vs. mhomed,tombstone
1872 * => should be replaced
1875 .line = __location__,
1876 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1879 .type = WREPL_TYPE_UNIQUE,
1880 .state = WREPL_STATE_RELEASED,
1881 .node = WREPL_NODE_B,
1883 .num_ips = ARRAY_SIZE(addresses_A_1),
1884 .ips = addresses_A_1,
1885 .apply_expected = False
1889 .type = WREPL_TYPE_MHOMED,
1890 .state = WREPL_STATE_TOMBSTONE,
1891 .node = WREPL_NODE_B,
1893 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1894 .ips = addresses_B_3_4,
1895 .apply_expected = True
1900 * unique,tombstone vs. mhomed,active
1901 * => should be replaced
1904 .line = __location__,
1905 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1908 .type = WREPL_TYPE_UNIQUE,
1909 .state = WREPL_STATE_TOMBSTONE,
1910 .node = WREPL_NODE_B,
1912 .num_ips = ARRAY_SIZE(addresses_B_1),
1913 .ips = addresses_B_1,
1914 .apply_expected = True
1918 .type = WREPL_TYPE_MHOMED,
1919 .state = WREPL_STATE_ACTIVE,
1920 .node = WREPL_NODE_B,
1922 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1923 .ips = addresses_A_3_4,
1924 .apply_expected = True
1929 * unique,tombstone vs. mhomed,tombstone
1930 * => should be replaced
1933 .line = __location__,
1934 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1937 .type = WREPL_TYPE_UNIQUE,
1938 .state = WREPL_STATE_TOMBSTONE,
1939 .node = WREPL_NODE_B,
1941 .num_ips = ARRAY_SIZE(addresses_A_1),
1942 .ips = addresses_A_1,
1943 .apply_expected = True
1947 .type = WREPL_TYPE_MHOMED,
1948 .state = WREPL_STATE_TOMBSTONE,
1949 .node = WREPL_NODE_B,
1951 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1952 .ips = addresses_B_3_4,
1953 .apply_expected = True
1958 * normal groups vs unique section,
1961 * group,active vs. unique,active
1962 * => should NOT be replaced
1965 .line = __location__,
1966 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1969 .type = WREPL_TYPE_GROUP,
1970 .state = WREPL_STATE_ACTIVE,
1971 .node = WREPL_NODE_B,
1973 .num_ips = ARRAY_SIZE(addresses_A_1),
1974 .ips = addresses_A_1,
1975 .apply_expected = True
1979 .type = WREPL_TYPE_UNIQUE,
1980 .state = WREPL_STATE_ACTIVE,
1981 .node = WREPL_NODE_B,
1983 .num_ips = ARRAY_SIZE(addresses_A_1),
1984 .ips = addresses_A_1,
1985 .apply_expected = False
1990 * group,active vs. unique,tombstone
1991 * => should NOT be replaced
1994 .line = __location__,
1995 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1998 .type = WREPL_TYPE_GROUP,
1999 .state = WREPL_STATE_ACTIVE,
2000 .node = WREPL_NODE_B,
2002 .num_ips = ARRAY_SIZE(addresses_A_1),
2003 .ips = addresses_A_1,
2004 .apply_expected = True
2008 .type = WREPL_TYPE_UNIQUE,
2009 .state = WREPL_STATE_TOMBSTONE,
2010 .node = WREPL_NODE_B,
2012 .num_ips = ARRAY_SIZE(addresses_A_1),
2013 .ips = addresses_A_1,
2014 .apply_expected = False
2019 * group,released vs. unique,active
2020 * => should NOT be replaced
2023 .line = __location__,
2024 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2027 .type = WREPL_TYPE_GROUP,
2028 .state = WREPL_STATE_RELEASED,
2029 .node = WREPL_NODE_B,
2031 .num_ips = ARRAY_SIZE(addresses_A_1),
2032 .ips = addresses_A_1,
2033 .apply_expected = False
2037 .type = WREPL_TYPE_UNIQUE,
2038 .state = WREPL_STATE_ACTIVE,
2039 .node = WREPL_NODE_B,
2041 .num_ips = ARRAY_SIZE(addresses_A_1),
2042 .ips = addresses_A_1,
2043 .apply_expected = False
2048 * group,released vs. unique,tombstone
2049 * => should NOT be replaced
2052 .line = __location__,
2053 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2056 .type = WREPL_TYPE_GROUP,
2057 .state = WREPL_STATE_RELEASED,
2058 .node = WREPL_NODE_B,
2060 .num_ips = ARRAY_SIZE(addresses_A_1),
2061 .ips = addresses_A_1,
2062 .apply_expected = False
2066 .type = WREPL_TYPE_UNIQUE,
2067 .state = WREPL_STATE_TOMBSTONE,
2068 .node = WREPL_NODE_B,
2070 .num_ips = ARRAY_SIZE(addresses_A_1),
2071 .ips = addresses_A_1,
2072 .apply_expected = False
2077 * group,tombstone vs. unique,active
2078 * => should NOT be replaced
2081 .line = __location__,
2082 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2085 .type = WREPL_TYPE_GROUP,
2086 .state = WREPL_STATE_TOMBSTONE,
2087 .node = WREPL_NODE_B,
2089 .num_ips = ARRAY_SIZE(addresses_A_1),
2090 .ips = addresses_A_1,
2091 .apply_expected = True
2095 .type = WREPL_TYPE_UNIQUE,
2096 .state = WREPL_STATE_ACTIVE,
2097 .node = WREPL_NODE_B,
2099 .num_ips = ARRAY_SIZE(addresses_A_1),
2100 .ips = addresses_A_1,
2101 .apply_expected = False
2106 * group,tombstone vs. unique,tombstone
2107 * => should NOT be replaced
2110 .line = __location__,
2111 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2114 .type = WREPL_TYPE_GROUP,
2115 .state = WREPL_STATE_TOMBSTONE,
2116 .node = WREPL_NODE_B,
2118 .num_ips = ARRAY_SIZE(addresses_A_1),
2119 .ips = addresses_A_1,
2120 .apply_expected = True
2124 .type = WREPL_TYPE_UNIQUE,
2125 .state = WREPL_STATE_TOMBSTONE,
2126 .node = WREPL_NODE_B,
2128 .num_ips = ARRAY_SIZE(addresses_A_1),
2129 .ips = addresses_A_1,
2130 .apply_expected = False
2135 * normal groups vs normal groups section,
2138 * group,active vs. group,active
2139 * => should NOT be replaced
2142 .line = __location__,
2143 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2146 .type = WREPL_TYPE_GROUP,
2147 .state = WREPL_STATE_ACTIVE,
2148 .node = WREPL_NODE_B,
2150 .num_ips = ARRAY_SIZE(addresses_A_1),
2151 .ips = addresses_A_1,
2152 .apply_expected = True
2156 .type = WREPL_TYPE_GROUP,
2157 .state = WREPL_STATE_ACTIVE,
2158 .node = WREPL_NODE_B,
2160 .num_ips = ARRAY_SIZE(addresses_A_1),
2161 .ips = addresses_A_1,
2162 .apply_expected = False
2167 * group,active vs. group,tombstone
2168 * => should NOT be replaced
2171 .line = __location__,
2172 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2175 .type = WREPL_TYPE_GROUP,
2176 .state = WREPL_STATE_ACTIVE,
2177 .node = WREPL_NODE_B,
2179 .num_ips = ARRAY_SIZE(addresses_A_1),
2180 .ips = addresses_A_1,
2181 .apply_expected = True
2185 .type = WREPL_TYPE_GROUP,
2186 .state = WREPL_STATE_TOMBSTONE,
2187 .node = WREPL_NODE_B,
2189 .num_ips = ARRAY_SIZE(addresses_A_1),
2190 .ips = addresses_A_1,
2191 .apply_expected = False
2196 * group,released vs. group,active
2197 * => should be replaced
2200 .line = __location__,
2201 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2204 .type = WREPL_TYPE_GROUP,
2205 .state = WREPL_STATE_RELEASED,
2206 .node = WREPL_NODE_B,
2208 .num_ips = ARRAY_SIZE(addresses_A_1),
2209 .ips = addresses_A_1,
2210 .apply_expected = False
2214 .type = WREPL_TYPE_GROUP,
2215 .state = WREPL_STATE_ACTIVE,
2216 .node = WREPL_NODE_B,
2218 .num_ips = ARRAY_SIZE(addresses_B_1),
2219 .ips = addresses_B_1,
2220 .apply_expected = True
2225 * group,released vs. group,tombstone
2226 * => should be replaced
2229 .line = __location__,
2230 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2233 .type = WREPL_TYPE_GROUP,
2234 .state = WREPL_STATE_RELEASED,
2235 .node = WREPL_NODE_B,
2237 .num_ips = ARRAY_SIZE(addresses_A_1),
2238 .ips = addresses_A_1,
2239 .apply_expected = False
2243 .type = WREPL_TYPE_GROUP,
2244 .state = WREPL_STATE_TOMBSTONE,
2245 .node = WREPL_NODE_B,
2247 .num_ips = ARRAY_SIZE(addresses_B_1),
2248 .ips = addresses_B_1,
2249 .apply_expected = True
2254 * group,tombstone vs. group,active
2255 * => should be replaced
2258 .line = __location__,
2259 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2262 .type = WREPL_TYPE_GROUP,
2263 .state = WREPL_STATE_TOMBSTONE,
2264 .node = WREPL_NODE_B,
2266 .num_ips = ARRAY_SIZE(addresses_B_1),
2267 .ips = addresses_B_1,
2268 .apply_expected = True
2272 .type = WREPL_TYPE_GROUP,
2273 .state = WREPL_STATE_ACTIVE,
2274 .node = WREPL_NODE_B,
2276 .num_ips = ARRAY_SIZE(addresses_A_1),
2277 .ips = addresses_A_1,
2278 .apply_expected = True
2283 * group,tombstone vs. group,tombstone
2284 * => should be replaced
2287 .line = __location__,
2288 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2291 .type = WREPL_TYPE_GROUP,
2292 .state = WREPL_STATE_TOMBSTONE,
2293 .node = WREPL_NODE_B,
2295 .num_ips = ARRAY_SIZE(addresses_A_1),
2296 .ips = addresses_A_1,
2297 .apply_expected = True
2301 .type = WREPL_TYPE_GROUP,
2302 .state = WREPL_STATE_TOMBSTONE,
2303 .node = WREPL_NODE_B,
2305 .num_ips = ARRAY_SIZE(addresses_B_1),
2306 .ips = addresses_B_1,
2307 .apply_expected = True
2312 * normal groups vs special groups section,
2315 * group,active vs. sgroup,active
2316 * => should NOT be replaced
2319 .line = __location__,
2320 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2323 .type = WREPL_TYPE_GROUP,
2324 .state = WREPL_STATE_ACTIVE,
2325 .node = WREPL_NODE_B,
2327 .num_ips = ARRAY_SIZE(addresses_B_1),
2328 .ips = addresses_B_1,
2329 .apply_expected = True
2333 .type = WREPL_TYPE_SGROUP,
2334 .state = WREPL_STATE_ACTIVE,
2335 .node = WREPL_NODE_B,
2337 .num_ips = ARRAY_SIZE(addresses_B_1),
2338 .ips = addresses_B_1,
2339 .apply_expected = False
2344 * group,active vs. sgroup,tombstone
2345 * => should NOT be replaced
2348 .line = __location__,
2349 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2352 .type = WREPL_TYPE_GROUP,
2353 .state = WREPL_STATE_ACTIVE,
2354 .node = WREPL_NODE_B,
2356 .num_ips = ARRAY_SIZE(addresses_B_1),
2357 .ips = addresses_B_1,
2358 .apply_expected = True
2362 .type = WREPL_TYPE_SGROUP,
2363 .state = WREPL_STATE_TOMBSTONE,
2364 .node = WREPL_NODE_B,
2366 .num_ips = ARRAY_SIZE(addresses_B_1),
2367 .ips = addresses_B_1,
2368 .apply_expected = False
2373 * group,released vs. sgroup,active
2374 * => should be replaced
2377 .line = __location__,
2378 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2381 .type = WREPL_TYPE_GROUP,
2382 .state = WREPL_STATE_RELEASED,
2383 .node = WREPL_NODE_B,
2385 .num_ips = ARRAY_SIZE(addresses_A_1),
2386 .ips = addresses_A_1,
2387 .apply_expected = False
2391 .type = WREPL_TYPE_SGROUP,
2392 .state = WREPL_STATE_ACTIVE,
2393 .node = WREPL_NODE_B,
2395 .num_ips = ARRAY_SIZE(addresses_B_1),
2396 .ips = addresses_B_1,
2397 .apply_expected = True
2402 * group,released vs. sgroup,tombstone
2403 * => should NOT be replaced
2406 .line = __location__,
2407 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2410 .type = WREPL_TYPE_GROUP,
2411 .state = WREPL_STATE_RELEASED,
2412 .node = WREPL_NODE_B,
2414 .num_ips = ARRAY_SIZE(addresses_B_1),
2415 .ips = addresses_B_1,
2416 .apply_expected = False
2420 .type = WREPL_TYPE_SGROUP,
2421 .state = WREPL_STATE_TOMBSTONE,
2422 .node = WREPL_NODE_B,
2424 .num_ips = ARRAY_SIZE(addresses_B_1),
2425 .ips = addresses_B_1,
2426 .apply_expected = False
2431 * group,tombstone vs. sgroup,active
2432 * => should be replaced
2435 .line = __location__,
2436 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2439 .type = WREPL_TYPE_GROUP,
2440 .state = WREPL_STATE_TOMBSTONE,
2441 .node = WREPL_NODE_B,
2443 .num_ips = ARRAY_SIZE(addresses_B_1),
2444 .ips = addresses_B_1,
2445 .apply_expected = True
2449 .type = WREPL_TYPE_SGROUP,
2450 .state = WREPL_STATE_ACTIVE,
2451 .node = WREPL_NODE_B,
2453 .num_ips = ARRAY_SIZE(addresses_A_1),
2454 .ips = addresses_A_1,
2455 .apply_expected = True
2460 * group,tombstone vs. sgroup,tombstone
2461 * => should be replaced
2464 .line = __location__,
2465 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2468 .type = WREPL_TYPE_GROUP,
2469 .state = WREPL_STATE_TOMBSTONE,
2470 .node = WREPL_NODE_B,
2472 .num_ips = ARRAY_SIZE(addresses_A_1),
2473 .ips = addresses_A_1,
2474 .apply_expected = True
2478 .type = WREPL_TYPE_SGROUP,
2479 .state = WREPL_STATE_TOMBSTONE,
2480 .node = WREPL_NODE_B,
2482 .num_ips = ARRAY_SIZE(addresses_B_1),
2483 .ips = addresses_B_1,
2484 .apply_expected = True
2489 * normal groups vs multi homed section,
2492 * group,active vs. mhomed,active
2493 * => should NOT be replaced
2496 .line = __location__,
2497 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2500 .type = WREPL_TYPE_GROUP,
2501 .state = WREPL_STATE_ACTIVE,
2502 .node = WREPL_NODE_B,
2504 .num_ips = ARRAY_SIZE(addresses_B_1),
2505 .ips = addresses_B_1,
2506 .apply_expected = True
2510 .type = WREPL_TYPE_MHOMED,
2511 .state = WREPL_STATE_ACTIVE,
2512 .node = WREPL_NODE_B,
2514 .num_ips = ARRAY_SIZE(addresses_B_1),
2515 .ips = addresses_B_1,
2516 .apply_expected = False
2521 * group,active vs. mhomed,tombstone
2522 * => should NOT be replaced
2525 .line = __location__,
2526 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2529 .type = WREPL_TYPE_GROUP,
2530 .state = WREPL_STATE_ACTIVE,
2531 .node = WREPL_NODE_B,
2533 .num_ips = ARRAY_SIZE(addresses_B_1),
2534 .ips = addresses_B_1,
2535 .apply_expected = True
2539 .type = WREPL_TYPE_MHOMED,
2540 .state = WREPL_STATE_TOMBSTONE,
2541 .node = WREPL_NODE_B,
2543 .num_ips = ARRAY_SIZE(addresses_B_1),
2544 .ips = addresses_B_1,
2545 .apply_expected = False
2550 * group,released vs. mhomed,active
2551 * => should NOT be replaced
2554 .line = __location__,
2555 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2558 .type = WREPL_TYPE_GROUP,
2559 .state = WREPL_STATE_RELEASED,
2560 .node = WREPL_NODE_B,
2562 .num_ips = ARRAY_SIZE(addresses_B_1),
2563 .ips = addresses_B_1,
2564 .apply_expected = False
2568 .type = WREPL_TYPE_MHOMED,
2569 .state = WREPL_STATE_ACTIVE,
2570 .node = WREPL_NODE_B,
2572 .num_ips = ARRAY_SIZE(addresses_B_1),
2573 .ips = addresses_B_1,
2574 .apply_expected = False
2579 * group,released vs. mhomed,tombstone
2580 * => should NOT be replaced
2583 .line = __location__,
2584 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2587 .type = WREPL_TYPE_GROUP,
2588 .state = WREPL_STATE_RELEASED,
2589 .node = WREPL_NODE_B,
2591 .num_ips = ARRAY_SIZE(addresses_B_1),
2592 .ips = addresses_B_1,
2593 .apply_expected = False
2597 .type = WREPL_TYPE_MHOMED,
2598 .state = WREPL_STATE_TOMBSTONE,
2599 .node = WREPL_NODE_B,
2601 .num_ips = ARRAY_SIZE(addresses_B_1),
2602 .ips = addresses_B_1,
2603 .apply_expected = False
2608 * group,tombstone vs. mhomed,active
2609 * => should be replaced
2612 .line = __location__,
2613 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2616 .type = WREPL_TYPE_GROUP,
2617 .state = WREPL_STATE_TOMBSTONE,
2618 .node = WREPL_NODE_B,
2620 .num_ips = ARRAY_SIZE(addresses_B_1),
2621 .ips = addresses_B_1,
2622 .apply_expected = True
2626 .type = WREPL_TYPE_MHOMED,
2627 .state = WREPL_STATE_ACTIVE,
2628 .node = WREPL_NODE_B,
2630 .num_ips = ARRAY_SIZE(addresses_A_1),
2631 .ips = addresses_A_1,
2632 .apply_expected = True
2637 * group,tombstone vs. mhomed,tombstone
2638 * => should be replaced
2641 .line = __location__,
2642 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2645 .type = WREPL_TYPE_GROUP,
2646 .state = WREPL_STATE_TOMBSTONE,
2647 .node = WREPL_NODE_B,
2649 .num_ips = ARRAY_SIZE(addresses_A_1),
2650 .ips = addresses_A_1,
2651 .apply_expected = True
2655 .type = WREPL_TYPE_MHOMED,
2656 .state = WREPL_STATE_TOMBSTONE,
2657 .node = WREPL_NODE_B,
2659 .num_ips = ARRAY_SIZE(addresses_B_1),
2660 .ips = addresses_B_1,
2661 .apply_expected = True
2666 * special groups vs unique section,
2669 * sgroup,active vs. unique,active
2670 * => should NOT be replaced
2673 .line = __location__,
2674 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2677 .type = WREPL_TYPE_SGROUP,
2678 .state = WREPL_STATE_ACTIVE,
2679 .node = WREPL_NODE_B,
2681 .num_ips = ARRAY_SIZE(addresses_B_1),
2682 .ips = addresses_B_1,
2683 .apply_expected = True
2687 .type = WREPL_TYPE_UNIQUE,
2688 .state = WREPL_STATE_ACTIVE,
2689 .node = WREPL_NODE_B,
2691 .num_ips = ARRAY_SIZE(addresses_B_1),
2692 .ips = addresses_B_1,
2693 .apply_expected = False
2698 * sgroup,active vs. unique,tombstone
2699 * => should NOT be replaced
2702 .line = __location__,
2703 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2706 .type = WREPL_TYPE_SGROUP,
2707 .state = WREPL_STATE_ACTIVE,
2708 .node = WREPL_NODE_B,
2710 .num_ips = ARRAY_SIZE(addresses_B_1),
2711 .ips = addresses_B_1,
2712 .apply_expected = True
2716 .type = WREPL_TYPE_UNIQUE,
2717 .state = WREPL_STATE_TOMBSTONE,
2718 .node = WREPL_NODE_B,
2720 .num_ips = ARRAY_SIZE(addresses_B_1),
2721 .ips = addresses_B_1,
2722 .apply_expected = False
2727 * sgroup,released vs. unique,active
2728 * => should be replaced
2731 .line = __location__,
2732 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2735 .type = WREPL_TYPE_SGROUP,
2736 .state = WREPL_STATE_RELEASED,
2737 .node = WREPL_NODE_B,
2739 .num_ips = ARRAY_SIZE(addresses_B_1),
2740 .ips = addresses_B_1,
2741 .apply_expected = False
2745 .type = WREPL_TYPE_UNIQUE,
2746 .state = WREPL_STATE_ACTIVE,
2747 .node = WREPL_NODE_B,
2749 .num_ips = ARRAY_SIZE(addresses_A_1),
2750 .ips = addresses_A_1,
2751 .apply_expected = True
2756 * sgroup,released vs. unique,tombstone
2757 * => should be replaced
2760 .line = __location__,
2761 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2764 .type = WREPL_TYPE_SGROUP,
2765 .state = WREPL_STATE_RELEASED,
2766 .node = WREPL_NODE_B,
2768 .num_ips = ARRAY_SIZE(addresses_A_1),
2769 .ips = addresses_A_1,
2770 .apply_expected = False
2774 .type = WREPL_TYPE_UNIQUE,
2775 .state = WREPL_STATE_TOMBSTONE,
2776 .node = WREPL_NODE_B,
2778 .num_ips = ARRAY_SIZE(addresses_B_1),
2779 .ips = addresses_B_1,
2780 .apply_expected = True
2785 * sgroup,tombstone vs. unique,active
2786 * => should be replaced
2789 .line = __location__,
2790 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2793 .type = WREPL_TYPE_SGROUP,
2794 .state = WREPL_STATE_TOMBSTONE,
2795 .node = WREPL_NODE_B,
2797 .num_ips = ARRAY_SIZE(addresses_A_1),
2798 .ips = addresses_A_1,
2799 .apply_expected = True
2803 .type = WREPL_TYPE_UNIQUE,
2804 .state = WREPL_STATE_ACTIVE,
2805 .node = WREPL_NODE_B,
2807 .num_ips = ARRAY_SIZE(addresses_B_1),
2808 .ips = addresses_B_1,
2809 .apply_expected = True
2814 * sgroup,tombstone vs. unique,tombstone
2815 * => should be replaced
2818 .line = __location__,
2819 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2822 .type = WREPL_TYPE_SGROUP,
2823 .state = WREPL_STATE_TOMBSTONE,
2824 .node = WREPL_NODE_B,
2826 .num_ips = ARRAY_SIZE(addresses_B_1),
2827 .ips = addresses_B_1,
2828 .apply_expected = True
2832 .type = WREPL_TYPE_UNIQUE,
2833 .state = WREPL_STATE_TOMBSTONE,
2834 .node = WREPL_NODE_B,
2836 .num_ips = ARRAY_SIZE(addresses_A_1),
2837 .ips = addresses_A_1,
2838 .apply_expected = True
2843 * special groups vs normal group section,
2846 * sgroup,active vs. group,active
2847 * => should NOT be replaced
2850 .line = __location__,
2851 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2854 .type = WREPL_TYPE_SGROUP,
2855 .state = WREPL_STATE_ACTIVE,
2856 .node = WREPL_NODE_B,
2858 .num_ips = ARRAY_SIZE(addresses_A_1),
2859 .ips = addresses_A_1,
2860 .apply_expected = True
2864 .type = WREPL_TYPE_GROUP,
2865 .state = WREPL_STATE_ACTIVE,
2866 .node = WREPL_NODE_B,
2868 .num_ips = ARRAY_SIZE(addresses_A_1),
2869 .ips = addresses_A_1,
2870 .apply_expected = False
2875 * sgroup,active vs. group,tombstone
2876 * => should NOT be replaced
2879 .line = __location__,
2880 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2883 .type = WREPL_TYPE_SGROUP,
2884 .state = WREPL_STATE_ACTIVE,
2885 .node = WREPL_NODE_B,
2887 .num_ips = ARRAY_SIZE(addresses_A_1),
2888 .ips = addresses_A_1,
2889 .apply_expected = True
2893 .type = WREPL_TYPE_GROUP,
2894 .state = WREPL_STATE_TOMBSTONE,
2895 .node = WREPL_NODE_B,
2897 .num_ips = ARRAY_SIZE(addresses_A_1),
2898 .ips = addresses_A_1,
2899 .apply_expected = False
2904 * sgroup,released vs. group,active
2905 * => should be replaced
2908 .line = __location__,
2909 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2912 .type = WREPL_TYPE_SGROUP,
2913 .state = WREPL_STATE_RELEASED,
2914 .node = WREPL_NODE_B,
2916 .num_ips = ARRAY_SIZE(addresses_A_1),
2917 .ips = addresses_A_1,
2918 .apply_expected = False
2922 .type = WREPL_TYPE_GROUP,
2923 .state = WREPL_STATE_ACTIVE,
2924 .node = WREPL_NODE_B,
2926 .num_ips = ARRAY_SIZE(addresses_B_1),
2927 .ips = addresses_B_1,
2928 .apply_expected = True
2933 * sgroup,released vs. group,tombstone
2934 * => should be replaced
2937 .line = __location__,
2938 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2941 .type = WREPL_TYPE_SGROUP,
2942 .state = WREPL_STATE_RELEASED,
2943 .node = WREPL_NODE_B,
2945 .num_ips = ARRAY_SIZE(addresses_B_1),
2946 .ips = addresses_B_1,
2947 .apply_expected = False
2951 .type = WREPL_TYPE_GROUP,
2952 .state = WREPL_STATE_TOMBSTONE,
2953 .node = WREPL_NODE_B,
2955 .num_ips = ARRAY_SIZE(addresses_A_1),
2956 .ips = addresses_A_1,
2957 .apply_expected = True
2962 * sgroup,tombstone vs. group,active
2963 * => should NOT be replaced
2966 .line = __location__,
2967 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2970 .type = WREPL_TYPE_SGROUP,
2971 .state = WREPL_STATE_TOMBSTONE,
2972 .node = WREPL_NODE_B,
2974 .num_ips = ARRAY_SIZE(addresses_A_1),
2975 .ips = addresses_A_1,
2976 .apply_expected = True
2980 .type = WREPL_TYPE_GROUP,
2981 .state = WREPL_STATE_ACTIVE,
2982 .node = WREPL_NODE_B,
2984 .num_ips = ARRAY_SIZE(addresses_B_1),
2985 .ips = addresses_B_1,
2986 .apply_expected = True
2991 * sgroup,tombstone vs. group,tombstone
2992 * => should NOT be replaced
2995 .line = __location__,
2996 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2999 .type = WREPL_TYPE_SGROUP,
3000 .state = WREPL_STATE_TOMBSTONE,
3001 .node = WREPL_NODE_B,
3003 .num_ips = ARRAY_SIZE(addresses_B_1),
3004 .ips = addresses_B_1,
3005 .apply_expected = True
3009 .type = WREPL_TYPE_GROUP,
3010 .state = WREPL_STATE_TOMBSTONE,
3011 .node = WREPL_NODE_B,
3013 .num_ips = ARRAY_SIZE(addresses_A_1),
3014 .ips = addresses_A_1,
3015 .apply_expected = True
3020 * special groups (not active) vs special group section,
3023 * sgroup,released vs. sgroup,active
3024 * => should be replaced
3027 .line = __location__,
3028 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3031 .type = WREPL_TYPE_SGROUP,
3032 .state = WREPL_STATE_RELEASED,
3033 .node = WREPL_NODE_B,
3035 .num_ips = ARRAY_SIZE(addresses_A_1),
3036 .ips = addresses_A_1,
3037 .apply_expected = False
3041 .type = WREPL_TYPE_SGROUP,
3042 .state = WREPL_STATE_ACTIVE,
3043 .node = WREPL_NODE_B,
3045 .num_ips = ARRAY_SIZE(addresses_B_1),
3046 .ips = addresses_B_1,
3047 .apply_expected = True
3052 * sgroup,released vs. sgroup,tombstone
3053 * => should be replaced
3056 .line = __location__,
3057 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3060 .type = WREPL_TYPE_SGROUP,
3061 .state = WREPL_STATE_RELEASED,
3062 .node = WREPL_NODE_B,
3064 .num_ips = ARRAY_SIZE(addresses_B_1),
3065 .ips = addresses_B_1,
3066 .apply_expected = False
3070 .type = WREPL_TYPE_SGROUP,
3071 .state = WREPL_STATE_TOMBSTONE,
3072 .node = WREPL_NODE_B,
3074 .num_ips = ARRAY_SIZE(addresses_A_1),
3075 .ips = addresses_A_1,
3076 .apply_expected = True
3081 * sgroup,tombstone vs. sgroup,active
3082 * => should NOT be replaced
3085 .line = __location__,
3086 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3089 .type = WREPL_TYPE_SGROUP,
3090 .state = WREPL_STATE_TOMBSTONE,
3091 .node = WREPL_NODE_B,
3093 .num_ips = ARRAY_SIZE(addresses_A_1),
3094 .ips = addresses_A_1,
3095 .apply_expected = True
3099 .type = WREPL_TYPE_SGROUP,
3100 .state = WREPL_STATE_ACTIVE,
3101 .node = WREPL_NODE_B,
3103 .num_ips = ARRAY_SIZE(addresses_B_1),
3104 .ips = addresses_B_1,
3105 .apply_expected = True
3110 * sgroup,tombstone vs. sgroup,tombstone
3111 * => should NOT be replaced
3114 .line = __location__,
3115 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3118 .type = WREPL_TYPE_SGROUP,
3119 .state = WREPL_STATE_TOMBSTONE,
3120 .node = WREPL_NODE_B,
3122 .num_ips = ARRAY_SIZE(addresses_B_1),
3123 .ips = addresses_B_1,
3124 .apply_expected = True
3128 .type = WREPL_TYPE_SGROUP,
3129 .state = WREPL_STATE_TOMBSTONE,
3130 .node = WREPL_NODE_B,
3132 .num_ips = ARRAY_SIZE(addresses_A_1),
3133 .ips = addresses_A_1,
3134 .apply_expected = True
3139 * special groups vs multi homed section,
3142 * sgroup,active vs. mhomed,active
3143 * => should NOT be replaced
3146 .line = __location__,
3147 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3150 .type = WREPL_TYPE_SGROUP,
3151 .state = WREPL_STATE_ACTIVE,
3152 .node = WREPL_NODE_B,
3154 .num_ips = ARRAY_SIZE(addresses_A_1),
3155 .ips = addresses_A_1,
3156 .apply_expected = True
3160 .type = WREPL_TYPE_MHOMED,
3161 .state = WREPL_STATE_ACTIVE,
3162 .node = WREPL_NODE_B,
3164 .num_ips = ARRAY_SIZE(addresses_A_1),
3165 .ips = addresses_A_1,
3166 .apply_expected = False
3171 * sgroup,active vs. mhomed,tombstone
3172 * => should NOT be replaced
3175 .line = __location__,
3176 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3179 .type = WREPL_TYPE_SGROUP,
3180 .state = WREPL_STATE_ACTIVE,
3181 .node = WREPL_NODE_B,
3183 .num_ips = ARRAY_SIZE(addresses_A_1),
3184 .ips = addresses_A_1,
3185 .apply_expected = True
3189 .type = WREPL_TYPE_MHOMED,
3190 .state = WREPL_STATE_TOMBSTONE,
3191 .node = WREPL_NODE_B,
3193 .num_ips = ARRAY_SIZE(addresses_A_1),
3194 .ips = addresses_A_1,
3195 .apply_expected = False
3200 * sgroup,released vs. mhomed,active
3201 * => should be replaced
3204 .line = __location__,
3205 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3208 .type = WREPL_TYPE_SGROUP,
3209 .state = WREPL_STATE_RELEASED,
3210 .node = WREPL_NODE_B,
3212 .num_ips = ARRAY_SIZE(addresses_A_1),
3213 .ips = addresses_A_1,
3214 .apply_expected = False
3218 .type = WREPL_TYPE_MHOMED,
3219 .state = WREPL_STATE_ACTIVE,
3220 .node = WREPL_NODE_B,
3222 .num_ips = ARRAY_SIZE(addresses_B_1),
3223 .ips = addresses_B_1,
3224 .apply_expected = True
3229 * sgroup,released vs. mhomed,tombstone
3230 * => should be replaced
3233 .line = __location__,
3234 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3237 .type = WREPL_TYPE_SGROUP,
3238 .state = WREPL_STATE_RELEASED,
3239 .node = WREPL_NODE_B,
3241 .num_ips = ARRAY_SIZE(addresses_B_1),
3242 .ips = addresses_B_1,
3243 .apply_expected = False
3247 .type = WREPL_TYPE_MHOMED,
3248 .state = WREPL_STATE_TOMBSTONE,
3249 .node = WREPL_NODE_B,
3251 .num_ips = ARRAY_SIZE(addresses_A_1),
3252 .ips = addresses_A_1,
3253 .apply_expected = True
3258 * sgroup,tombstone vs. mhomed,active
3259 * => should be replaced
3262 .line = __location__,
3263 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3266 .type = WREPL_TYPE_SGROUP,
3267 .state = WREPL_STATE_TOMBSTONE,
3268 .node = WREPL_NODE_B,
3270 .num_ips = ARRAY_SIZE(addresses_A_1),
3271 .ips = addresses_A_1,
3272 .apply_expected = True
3276 .type = WREPL_TYPE_MHOMED,
3277 .state = WREPL_STATE_ACTIVE,
3278 .node = WREPL_NODE_B,
3280 .num_ips = ARRAY_SIZE(addresses_B_1),
3281 .ips = addresses_B_1,
3282 .apply_expected = True
3287 * sgroup,tombstone vs. mhomed,tombstone
3288 * => should be replaced
3291 .line = __location__,
3292 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3295 .type = WREPL_TYPE_SGROUP,
3296 .state = WREPL_STATE_TOMBSTONE,
3297 .node = WREPL_NODE_B,
3299 .num_ips = ARRAY_SIZE(addresses_B_1),
3300 .ips = addresses_B_1,
3301 .apply_expected = True
3305 .type = WREPL_TYPE_MHOMED,
3306 .state = WREPL_STATE_TOMBSTONE,
3307 .node = WREPL_NODE_B,
3309 .num_ips = ARRAY_SIZE(addresses_A_1),
3310 .ips = addresses_A_1,
3311 .apply_expected = True
3316 * multi homed vs. unique section,
3319 * mhomed,active vs. unique,active
3320 * => should be replaced
3323 .line = __location__,
3324 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3327 .type = WREPL_TYPE_MHOMED,
3328 .state = WREPL_STATE_ACTIVE,
3329 .node = WREPL_NODE_B,
3331 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3332 .ips = addresses_A_3_4,
3333 .apply_expected = True
3337 .type = WREPL_TYPE_UNIQUE,
3338 .state = WREPL_STATE_ACTIVE,
3339 .node = WREPL_NODE_B,
3341 .num_ips = ARRAY_SIZE(addresses_B_1),
3342 .ips = addresses_B_1,
3343 .apply_expected = True
3348 * mhomed,active vs. unique,tombstone
3349 * => should NOT be replaced
3352 .line = __location__,
3353 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3356 .type = WREPL_TYPE_MHOMED,
3357 .state = WREPL_STATE_ACTIVE,
3358 .node = WREPL_NODE_B,
3360 .num_ips = ARRAY_SIZE(addresses_B_1),
3361 .ips = addresses_B_1,
3362 .apply_expected = True
3366 .type = WREPL_TYPE_UNIQUE,
3367 .state = WREPL_STATE_TOMBSTONE,
3368 .node = WREPL_NODE_B,
3370 .num_ips = ARRAY_SIZE(addresses_B_1),
3371 .ips = addresses_B_1,
3372 .apply_expected = False
3377 * mhomed,released vs. unique,active
3378 * => should be replaced
3381 .line = __location__,
3382 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3385 .type = WREPL_TYPE_MHOMED,
3386 .state = WREPL_STATE_RELEASED,
3387 .node = WREPL_NODE_B,
3389 .num_ips = ARRAY_SIZE(addresses_A_1),
3390 .ips = addresses_A_1,
3391 .apply_expected = False
3395 .type = WREPL_TYPE_UNIQUE,
3396 .state = WREPL_STATE_ACTIVE,
3397 .node = WREPL_NODE_B,
3399 .num_ips = ARRAY_SIZE(addresses_B_1),
3400 .ips = addresses_B_1,
3401 .apply_expected = True
3406 * mhomed,released vs. uinique,tombstone
3407 * => should be replaced
3410 .line = __location__,
3411 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3414 .type = WREPL_TYPE_MHOMED,
3415 .state = WREPL_STATE_RELEASED,
3416 .node = WREPL_NODE_B,
3418 .num_ips = ARRAY_SIZE(addresses_B_1),
3419 .ips = addresses_B_1,
3420 .apply_expected = False
3424 .type = WREPL_TYPE_UNIQUE,
3425 .state = WREPL_STATE_TOMBSTONE,
3426 .node = WREPL_NODE_B,
3428 .num_ips = ARRAY_SIZE(addresses_A_1),
3429 .ips = addresses_A_1,
3430 .apply_expected = True
3435 * mhomed,tombstone vs. unique,active
3436 * => should be replaced
3439 .line = __location__,
3440 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3443 .type = WREPL_TYPE_MHOMED,
3444 .state = WREPL_STATE_TOMBSTONE,
3445 .node = WREPL_NODE_B,
3447 .num_ips = ARRAY_SIZE(addresses_A_1),
3448 .ips = addresses_A_1,
3449 .apply_expected = True
3453 .type = WREPL_TYPE_UNIQUE,
3454 .state = WREPL_STATE_ACTIVE,
3455 .node = WREPL_NODE_B,
3457 .num_ips = ARRAY_SIZE(addresses_B_1),
3458 .ips = addresses_B_1,
3459 .apply_expected = True
3464 * mhomed,tombstone vs. uinique,tombstone
3465 * => should be replaced
3468 .line = __location__,
3469 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3472 .type = WREPL_TYPE_MHOMED,
3473 .state = WREPL_STATE_TOMBSTONE,
3474 .node = WREPL_NODE_B,
3476 .num_ips = ARRAY_SIZE(addresses_B_1),
3477 .ips = addresses_B_1,
3478 .apply_expected = True
3482 .type = WREPL_TYPE_UNIQUE,
3483 .state = WREPL_STATE_TOMBSTONE,
3484 .node = WREPL_NODE_B,
3486 .num_ips = ARRAY_SIZE(addresses_A_1),
3487 .ips = addresses_A_1,
3488 .apply_expected = True
3493 * multi homed vs. normal group section,
3496 * mhomed,active vs. group,active
3497 * => should be replaced
3500 .line = __location__,
3501 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3504 .type = WREPL_TYPE_MHOMED,
3505 .state = WREPL_STATE_ACTIVE,
3506 .node = WREPL_NODE_B,
3508 .num_ips = ARRAY_SIZE(addresses_A_1),
3509 .ips = addresses_A_1,
3510 .apply_expected = True
3514 .type = WREPL_TYPE_GROUP,
3515 .state = WREPL_STATE_ACTIVE,
3516 .node = WREPL_NODE_B,
3518 .num_ips = ARRAY_SIZE(addresses_B_1),
3519 .ips = addresses_B_1,
3520 .apply_expected = True
3525 * mhomed,active vs. group,tombstone
3526 * => should NOT be replaced
3529 .line = __location__,
3530 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3533 .type = WREPL_TYPE_MHOMED,
3534 .state = WREPL_STATE_ACTIVE,
3535 .node = WREPL_NODE_B,
3537 .num_ips = ARRAY_SIZE(addresses_B_1),
3538 .ips = addresses_B_1,
3539 .apply_expected = True
3543 .type = WREPL_TYPE_GROUP,
3544 .state = WREPL_STATE_TOMBSTONE,
3545 .node = WREPL_NODE_B,
3547 .num_ips = ARRAY_SIZE(addresses_B_1),
3548 .ips = addresses_B_1,
3549 .apply_expected = False
3554 * mhomed,released vs. group,active
3555 * => should be replaced
3558 .line = __location__,
3559 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3562 .type = WREPL_TYPE_MHOMED,
3563 .state = WREPL_STATE_RELEASED,
3564 .node = WREPL_NODE_B,
3566 .num_ips = ARRAY_SIZE(addresses_B_1),
3567 .ips = addresses_B_1,
3568 .apply_expected = False
3572 .type = WREPL_TYPE_GROUP,
3573 .state = WREPL_STATE_ACTIVE,
3574 .node = WREPL_NODE_B,
3576 .num_ips = ARRAY_SIZE(addresses_A_1),
3577 .ips = addresses_A_1,
3578 .apply_expected = True
3583 * mhomed,released vs. group,tombstone
3584 * => should be replaced
3587 .line = __location__,
3588 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3591 .type = WREPL_TYPE_MHOMED,
3592 .state = WREPL_STATE_RELEASED,
3593 .node = WREPL_NODE_B,
3595 .num_ips = ARRAY_SIZE(addresses_A_1),
3596 .ips = addresses_A_1,
3597 .apply_expected = False
3601 .type = WREPL_TYPE_GROUP,
3602 .state = WREPL_STATE_TOMBSTONE,
3603 .node = WREPL_NODE_B,
3605 .num_ips = ARRAY_SIZE(addresses_B_1),
3606 .ips = addresses_B_1,
3607 .apply_expected = True
3612 * mhomed,tombstone vs. group,active
3613 * => should be replaced
3616 .line = __location__,
3617 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3620 .type = WREPL_TYPE_MHOMED,
3621 .state = WREPL_STATE_TOMBSTONE,
3622 .node = WREPL_NODE_B,
3624 .num_ips = ARRAY_SIZE(addresses_B_1),
3625 .ips = addresses_B_1,
3626 .apply_expected = True
3630 .type = WREPL_TYPE_GROUP,
3631 .state = WREPL_STATE_ACTIVE,
3632 .node = WREPL_NODE_B,
3634 .num_ips = ARRAY_SIZE(addresses_A_1),
3635 .ips = addresses_A_1,
3636 .apply_expected = True
3641 * mhomed,tombstone vs. group,tombstone
3642 * => should be replaced
3645 .line = __location__,
3646 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3649 .type = WREPL_TYPE_MHOMED,
3650 .state = WREPL_STATE_TOMBSTONE,
3651 .node = WREPL_NODE_B,
3653 .num_ips = ARRAY_SIZE(addresses_A_1),
3654 .ips = addresses_A_1,
3655 .apply_expected = True
3659 .type = WREPL_TYPE_GROUP,
3660 .state = WREPL_STATE_TOMBSTONE,
3661 .node = WREPL_NODE_B,
3663 .num_ips = ARRAY_SIZE(addresses_B_1),
3664 .ips = addresses_B_1,
3665 .apply_expected = True
3670 * multi homed vs. special group section,
3673 * mhomed,active vs. sgroup,active
3674 * => should NOT be replaced
3677 .line = __location__,
3678 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3681 .type = WREPL_TYPE_MHOMED,
3682 .state = WREPL_STATE_ACTIVE,
3683 .node = WREPL_NODE_B,
3685 .num_ips = ARRAY_SIZE(addresses_A_1),
3686 .ips = addresses_A_1,
3687 .apply_expected = True
3691 .type = WREPL_TYPE_SGROUP,
3692 .state = WREPL_STATE_ACTIVE,
3693 .node = WREPL_NODE_B,
3695 .num_ips = ARRAY_SIZE(addresses_A_1),
3696 .ips = addresses_A_1,
3697 .apply_expected = False
3702 * mhomed,active vs. sgroup,tombstone
3703 * => should NOT be replaced
3706 .line = __location__,
3707 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3710 .type = WREPL_TYPE_MHOMED,
3711 .state = WREPL_STATE_ACTIVE,
3712 .node = WREPL_NODE_B,
3714 .num_ips = ARRAY_SIZE(addresses_A_1),
3715 .ips = addresses_A_1,
3716 .apply_expected = True
3720 .type = WREPL_TYPE_SGROUP,
3721 .state = WREPL_STATE_TOMBSTONE,
3722 .node = WREPL_NODE_B,
3724 .num_ips = ARRAY_SIZE(addresses_A_1),
3725 .ips = addresses_A_1,
3726 .apply_expected = False
3731 * mhomed,released vs. sgroup,active
3732 * => should be replaced
3735 .line = __location__,
3736 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3739 .type = WREPL_TYPE_MHOMED,
3740 .state = WREPL_STATE_RELEASED,
3741 .node = WREPL_NODE_B,
3743 .num_ips = ARRAY_SIZE(addresses_A_1),
3744 .ips = addresses_A_1,
3745 .apply_expected = False
3749 .type = WREPL_TYPE_SGROUP,
3750 .state = WREPL_STATE_ACTIVE,
3751 .node = WREPL_NODE_B,
3753 .num_ips = ARRAY_SIZE(addresses_B_1),
3754 .ips = addresses_B_1,
3755 .apply_expected = True
3760 * mhomed,released vs. sgroup,tombstone
3761 * => should be replaced
3764 .line = __location__,
3765 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3768 .type = WREPL_TYPE_MHOMED,
3769 .state = WREPL_STATE_RELEASED,
3770 .node = WREPL_NODE_B,
3772 .num_ips = ARRAY_SIZE(addresses_B_1),
3773 .ips = addresses_B_1,
3774 .apply_expected = False
3778 .type = WREPL_TYPE_SGROUP,
3779 .state = WREPL_STATE_TOMBSTONE,
3780 .node = WREPL_NODE_B,
3782 .num_ips = ARRAY_SIZE(addresses_A_1),
3783 .ips = addresses_A_1,
3784 .apply_expected = True
3789 * mhomed,tombstone vs. sgroup,active
3790 * => should be replaced
3793 .line = __location__,
3794 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3797 .type = WREPL_TYPE_MHOMED,
3798 .state = WREPL_STATE_TOMBSTONE,
3799 .node = WREPL_NODE_B,
3801 .num_ips = ARRAY_SIZE(addresses_A_1),
3802 .ips = addresses_A_1,
3803 .apply_expected = True
3807 .type = WREPL_TYPE_SGROUP,
3808 .state = WREPL_STATE_ACTIVE,
3809 .node = WREPL_NODE_B,
3811 .num_ips = ARRAY_SIZE(addresses_B_1),
3812 .ips = addresses_B_1,
3813 .apply_expected = True
3818 * mhomed,tombstone vs. sgroup,tombstone
3819 * => should be replaced
3822 .line = __location__,
3823 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3826 .type = WREPL_TYPE_MHOMED,
3827 .state = WREPL_STATE_TOMBSTONE,
3828 .node = WREPL_NODE_B,
3830 .num_ips = ARRAY_SIZE(addresses_B_1),
3831 .ips = addresses_B_1,
3832 .apply_expected = True
3836 .type = WREPL_TYPE_SGROUP,
3837 .state = WREPL_STATE_TOMBSTONE,
3838 .node = WREPL_NODE_B,
3840 .num_ips = ARRAY_SIZE(addresses_A_1),
3841 .ips = addresses_A_1,
3842 .apply_expected = True
3847 * multi homed vs. mlti homed section,
3850 * mhomed,active vs. mhomed,active
3851 * => should be replaced
3854 .line = __location__,
3855 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3858 .type = WREPL_TYPE_MHOMED,
3859 .state = WREPL_STATE_ACTIVE,
3860 .node = WREPL_NODE_B,
3862 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3863 .ips = addresses_A_3_4,
3864 .apply_expected = True
3868 .type = WREPL_TYPE_MHOMED,
3869 .state = WREPL_STATE_ACTIVE,
3870 .node = WREPL_NODE_B,
3872 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3873 .ips = addresses_B_3_4,
3874 .apply_expected = True
3879 * mhomed,active vs. mhomed,tombstone
3880 * => should NOT be replaced
3883 .line = __location__,
3884 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3887 .type = WREPL_TYPE_MHOMED,
3888 .state = WREPL_STATE_ACTIVE,
3889 .node = WREPL_NODE_B,
3891 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3892 .ips = addresses_B_3_4,
3893 .apply_expected = True
3897 .type = WREPL_TYPE_MHOMED,
3898 .state = WREPL_STATE_TOMBSTONE,
3899 .node = WREPL_NODE_B,
3901 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3902 .ips = addresses_B_3_4,
3903 .apply_expected = False
3908 * mhomed,released vs. mhomed,active
3909 * => should be replaced
3912 .line = __location__,
3913 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3916 .type = WREPL_TYPE_MHOMED,
3917 .state = WREPL_STATE_RELEASED,
3918 .node = WREPL_NODE_B,
3920 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3921 .ips = addresses_B_3_4,
3922 .apply_expected = False
3926 .type = WREPL_TYPE_MHOMED,
3927 .state = WREPL_STATE_ACTIVE,
3928 .node = WREPL_NODE_B,
3930 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3931 .ips = addresses_A_3_4,
3932 .apply_expected = True
3937 * mhomed,released vs. mhomed,tombstone
3938 * => should be replaced
3941 .line = __location__,
3942 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3945 .type = WREPL_TYPE_MHOMED,
3946 .state = WREPL_STATE_RELEASED,
3947 .node = WREPL_NODE_B,
3949 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3950 .ips = addresses_A_3_4,
3951 .apply_expected = False
3955 .type = WREPL_TYPE_MHOMED,
3956 .state = WREPL_STATE_TOMBSTONE,
3957 .node = WREPL_NODE_B,
3959 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3960 .ips = addresses_B_3_4,
3961 .apply_expected = True
3966 * mhomed,tombstone vs. mhomed,active
3967 * => should be replaced
3970 .line = __location__,
3971 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3974 .type = WREPL_TYPE_MHOMED,
3975 .state = WREPL_STATE_TOMBSTONE,
3976 .node = WREPL_NODE_B,
3978 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3979 .ips = addresses_B_3_4,
3980 .apply_expected = True
3984 .type = WREPL_TYPE_MHOMED,
3985 .state = WREPL_STATE_ACTIVE,
3986 .node = WREPL_NODE_B,
3988 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3989 .ips = addresses_A_3_4,
3990 .apply_expected = True
3995 * mhomed,tombstone vs. mhomed,tombstone
3996 * => should be replaced
3999 .line = __location__,
4000 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4003 .type = WREPL_TYPE_MHOMED,
4004 .state = WREPL_STATE_TOMBSTONE,
4005 .node = WREPL_NODE_B,
4007 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4008 .ips = addresses_A_3_4,
4009 .apply_expected = True
4013 .type = WREPL_TYPE_MHOMED,
4014 .state = WREPL_STATE_TOMBSTONE,
4015 .node = WREPL_NODE_B,
4017 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4018 .ips = addresses_B_3_4,
4019 .apply_expected = True
4023 .line = __location__,
4024 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4028 .type = WREPL_TYPE_UNIQUE,
4029 .state = WREPL_STATE_TOMBSTONE,
4030 .node = WREPL_NODE_B,
4032 .num_ips = ARRAY_SIZE(addresses_B_1),
4033 .ips = addresses_B_1,
4034 .apply_expected = True,
4038 .type = WREPL_TYPE_UNIQUE,
4039 .state = WREPL_STATE_TOMBSTONE,
4040 .node = WREPL_NODE_B,
4042 .num_ips = ARRAY_SIZE(addresses_A_1),
4043 .ips = addresses_A_1,
4044 .apply_expected = True,
4048 * special group vs special group section,
4051 * sgroup,active vs. sgroup,active same addresses
4052 * => should be NOT replaced
4055 .line = __location__,
4056 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4057 .comment= "A:A_3_4 vs. B:A_3_4",
4061 .type = WREPL_TYPE_SGROUP,
4062 .state = WREPL_STATE_ACTIVE,
4063 .node = WREPL_NODE_B,
4065 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4066 .ips = addresses_A_3_4,
4067 .apply_expected = True
4071 .type = WREPL_TYPE_SGROUP,
4072 .state = WREPL_STATE_ACTIVE,
4073 .node = WREPL_NODE_B,
4075 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4076 .ips = addresses_A_3_4,
4077 .apply_expected = False,
4078 .sgroup_cleanup = True
4082 * sgroup,active vs. sgroup,active same addresses
4083 * => should be NOT replaced
4086 .line = __location__,
4087 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4088 .comment= "A:A_3_4 vs. B:NULL",
4092 .type = WREPL_TYPE_SGROUP,
4093 .state = WREPL_STATE_ACTIVE,
4094 .node = WREPL_NODE_B,
4096 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4097 .ips = addresses_A_3_4,
4098 .apply_expected = True
4102 .type = WREPL_TYPE_SGROUP,
4103 .state = WREPL_STATE_ACTIVE,
4104 .node = WREPL_NODE_B,
4108 .apply_expected = False,
4109 .sgroup_cleanup = True
4113 * sgroup,active vs. sgroup,active subset addresses, special case...
4114 * => should NOT be replaced
4117 .line = __location__,
4118 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4119 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4",
4123 .type = WREPL_TYPE_SGROUP,
4124 .state = WREPL_STATE_ACTIVE,
4125 .node = WREPL_NODE_B,
4127 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4128 .ips = addresses_A_3_4_X_3_4,
4129 .apply_expected = True,
4133 .type = WREPL_TYPE_SGROUP,
4134 .state = WREPL_STATE_ACTIVE,
4135 .node = WREPL_NODE_B,
4137 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4138 .ips = addresses_A_3_4,
4139 .apply_expected = False,
4143 .line = __location__,
4144 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4148 .type = WREPL_TYPE_SGROUP,
4149 .state = WREPL_STATE_ACTIVE,
4150 .node = WREPL_NODE_B,
4154 .apply_expected = False,
4158 .type = WREPL_TYPE_SGROUP,
4159 .state = WREPL_STATE_ACTIVE,
4160 .node = WREPL_NODE_B,
4164 .apply_expected = False,
4168 * sgroup,active vs. sgroup,active different addresses, but owner changed
4169 * => should be replaced
4172 .line = __location__,
4173 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4174 .comment= "A:B_3_4 vs. B:A_3_4",
4178 .type = WREPL_TYPE_SGROUP,
4179 .state = WREPL_STATE_ACTIVE,
4180 .node = WREPL_NODE_B,
4182 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4183 .ips = addresses_B_3_4,
4184 .apply_expected = True,
4188 .type = WREPL_TYPE_SGROUP,
4189 .state = WREPL_STATE_ACTIVE,
4190 .node = WREPL_NODE_B,
4192 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4193 .ips = addresses_A_3_4,
4194 .apply_expected = True,
4195 .sgroup_cleanup = True
4199 * sgroup,active vs. sgroup,active different addresses, but owner changed
4200 * => should be replaced
4203 .line = __location__,
4204 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4205 .comment= "A:A_3_4 vs. B:A_3_4_OWNER_B",
4209 .type = WREPL_TYPE_SGROUP,
4210 .state = WREPL_STATE_ACTIVE,
4211 .node = WREPL_NODE_B,
4213 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4214 .ips = addresses_A_3_4,
4215 .apply_expected = True,
4219 .type = WREPL_TYPE_SGROUP,
4220 .state = WREPL_STATE_ACTIVE,
4221 .node = WREPL_NODE_B,
4223 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4224 .ips = addresses_A_3_4_OWNER_B,
4225 .apply_expected = True,
4226 .sgroup_cleanup = True
4230 * sgroup,active vs. sgroup,active different addresses, but owner changed
4231 * => should be replaced
4234 .line = __location__,
4235 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4236 .comment= "A:A_3_4_OWNER_B vs. B:A_3_4",
4240 .type = WREPL_TYPE_SGROUP,
4241 .state = WREPL_STATE_ACTIVE,
4242 .node = WREPL_NODE_B,
4244 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4245 .ips = addresses_A_3_4_OWNER_B,
4246 .apply_expected = True,
4250 .type = WREPL_TYPE_SGROUP,
4251 .state = WREPL_STATE_ACTIVE,
4252 .node = WREPL_NODE_B,
4254 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4255 .ips = addresses_A_3_4,
4256 .apply_expected = True,
4257 .sgroup_cleanup = True
4261 * sgroup,active vs. sgroup,active different addresses
4262 * => should be merged
4265 .line = __location__,
4266 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4267 .comment= "A:A_3_4 vs. B:B_3_4 => C:A_3_4_B_3_4",
4271 .type = WREPL_TYPE_SGROUP,
4272 .state = WREPL_STATE_ACTIVE,
4273 .node = WREPL_NODE_B,
4275 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4276 .ips = addresses_A_3_4,
4277 .apply_expected = True,
4281 .type = WREPL_TYPE_SGROUP,
4282 .state = WREPL_STATE_ACTIVE,
4283 .node = WREPL_NODE_B,
4285 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4286 .ips = addresses_B_3_4,
4287 .sgroup_merge = True,
4288 .sgroup_cleanup = True,
4292 * sgroup,active vs. sgroup,active different addresses, special case...
4293 * => should be merged
4296 .line = __location__,
4297 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4298 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4_X_3_4",
4302 .type = WREPL_TYPE_SGROUP,
4303 .state = WREPL_STATE_ACTIVE,
4304 .node = WREPL_NODE_B,
4306 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4307 .ips = addresses_B_3_4_X_3_4,
4308 .apply_expected = True,
4312 .type = WREPL_TYPE_SGROUP,
4313 .state = WREPL_STATE_ACTIVE,
4314 .node = WREPL_NODE_B,
4316 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4317 .ips = addresses_A_3_4,
4318 .sgroup_merge = True,
4319 .merge_owner = &ctx->b,
4320 .sgroup_cleanup = False
4324 .line = __location__,
4325 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4329 .type = WREPL_TYPE_SGROUP,
4330 .state = WREPL_STATE_ACTIVE,
4331 .node = WREPL_NODE_B,
4333 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4_OWNER_B),
4334 .ips = addresses_A_3_4_X_3_4_OWNER_B,
4335 .apply_expected = True,
4339 .type = WREPL_TYPE_SGROUP,
4340 .state = WREPL_STATE_ACTIVE,
4341 .node = WREPL_NODE_B,
4345 .apply_expected = False,
4349 * sgroup,active vs. sgroup,active different addresses, special case...
4350 * => should be merged
4353 .line = __location__,
4354 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4355 .comment= "A:X_3_4 vs. B:A_3_4 => C:A_3_4_X_3_4",
4359 .type = WREPL_TYPE_SGROUP,
4360 .state = WREPL_STATE_ACTIVE,
4361 .node = WREPL_NODE_B,
4363 .num_ips = ARRAY_SIZE(addresses_X_3_4),
4364 .ips = addresses_X_3_4,
4365 .apply_expected = True,
4369 .type = WREPL_TYPE_SGROUP,
4370 .state = WREPL_STATE_ACTIVE,
4371 .node = WREPL_NODE_B,
4373 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4374 .ips = addresses_A_3_4,
4375 .sgroup_merge = True,
4376 .sgroup_cleanup = False
4380 .line = __location__,
4381 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4385 .type = WREPL_TYPE_SGROUP,
4386 .state = WREPL_STATE_ACTIVE,
4387 .node = WREPL_NODE_B,
4391 .apply_expected = False,
4395 .type = WREPL_TYPE_SGROUP,
4396 .state = WREPL_STATE_ACTIVE,
4397 .node = WREPL_NODE_B,
4401 .apply_expected = False,
4405 * sgroup,active vs. sgroup,active different addresses, special case...
4406 * => should be merged
4409 .line = __location__,
4410 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4411 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4_OWNER_B => B:A_3_4_OWNER_B_X_3_4",
4415 .type = WREPL_TYPE_SGROUP,
4416 .state = WREPL_STATE_ACTIVE,
4417 .node = WREPL_NODE_B,
4419 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4420 .ips = addresses_A_3_4_X_3_4,
4421 .apply_expected = True,
4425 .type = WREPL_TYPE_SGROUP,
4426 .state = WREPL_STATE_ACTIVE,
4427 .node = WREPL_NODE_B,
4429 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4430 .ips = addresses_A_3_4_OWNER_B,
4431 .sgroup_merge = True,
4432 .merge_owner = &ctx->b,
4436 .line = __location__,
4437 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4441 .type = WREPL_TYPE_SGROUP,
4442 .state = WREPL_STATE_ACTIVE,
4443 .node = WREPL_NODE_B,
4447 .apply_expected = False,
4451 .type = WREPL_TYPE_SGROUP,
4452 .state = WREPL_STATE_ACTIVE,
4453 .node = WREPL_NODE_B,
4457 .apply_expected = False,
4461 * sgroup,active vs. sgroup,active partly different addresses, special case...
4462 * => should be merged
4465 .line = __location__,
4466 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4467 .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",
4471 .type = WREPL_TYPE_SGROUP,
4472 .state = WREPL_STATE_ACTIVE,
4473 .node = WREPL_NODE_B,
4475 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4476 .ips = addresses_B_3_4_X_3_4,
4477 .apply_expected = True,
4481 .type = WREPL_TYPE_SGROUP,
4482 .state = WREPL_STATE_ACTIVE,
4483 .node = WREPL_NODE_B,
4485 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_1_2),
4486 .ips = addresses_B_3_4_X_1_2,
4487 .sgroup_merge = True,
4488 .sgroup_cleanup = False
4492 .line = __location__,
4493 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4497 .type = WREPL_TYPE_SGROUP,
4498 .state = WREPL_STATE_ACTIVE,
4499 .node = WREPL_NODE_B,
4503 .apply_expected = False,
4507 .type = WREPL_TYPE_SGROUP,
4508 .state = WREPL_STATE_ACTIVE,
4509 .node = WREPL_NODE_B,
4513 .apply_expected = False,
4517 * sgroup,active vs. sgroup,active different addresses, special case...
4518 * => should be merged
4521 .line = __location__,
4522 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4523 .comment= "A:A_3_4_B_3_4 vs. B:NULL => B:A_3_4",
4527 .type = WREPL_TYPE_SGROUP,
4528 .state = WREPL_STATE_ACTIVE,
4529 .node = WREPL_NODE_B,
4531 .num_ips = ARRAY_SIZE(addresses_A_3_4_B_3_4),
4532 .ips = addresses_A_3_4_B_3_4,
4533 .apply_expected = True,
4537 .type = WREPL_TYPE_SGROUP,
4538 .state = WREPL_STATE_ACTIVE,
4539 .node = WREPL_NODE_B,
4543 .sgroup_merge = True,
4544 .merge_owner = &ctx->b,
4545 .sgroup_cleanup = True
4549 .line = __location__,
4550 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4554 .type = WREPL_TYPE_SGROUP,
4555 .state = WREPL_STATE_ACTIVE,
4556 .node = WREPL_NODE_B,
4560 .apply_expected = False,
4564 .type = WREPL_TYPE_UNIQUE,
4565 .state = WREPL_STATE_TOMBSTONE,
4566 .node = WREPL_NODE_B,
4568 .num_ips = ARRAY_SIZE(addresses_A_1),
4569 .ips = addresses_A_1,
4570 .apply_expected = True,
4574 * sgroup,active vs. sgroup,active different addresses, special case...
4575 * => should be merged
4578 .line = __location__,
4579 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4580 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:X_3_4",
4584 .type = WREPL_TYPE_SGROUP,
4585 .state = WREPL_STATE_ACTIVE,
4586 .node = WREPL_NODE_B,
4588 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4589 .ips = addresses_B_3_4_X_3_4,
4590 .apply_expected = True,
4594 .type = WREPL_TYPE_SGROUP,
4595 .state = WREPL_STATE_ACTIVE,
4596 .node = WREPL_NODE_B,
4600 .sgroup_merge = True,
4601 .merge_owner = &ctx->b,
4602 .sgroup_cleanup = True
4606 .line = __location__,
4607 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4611 .type = WREPL_TYPE_SGROUP,
4612 .state = WREPL_STATE_ACTIVE,
4613 .node = WREPL_NODE_B,
4617 .apply_expected = False,
4621 .type = WREPL_TYPE_UNIQUE,
4622 .state = WREPL_STATE_TOMBSTONE,
4623 .node = WREPL_NODE_B,
4625 .num_ips = ARRAY_SIZE(addresses_A_1),
4626 .ips = addresses_A_1,
4627 .apply_expected = True,
4632 * sgroup,active vs. sgroup,tombstone different no addresses, special
4633 * => should be replaced
4636 .line = __location__,
4637 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4638 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:NULL",
4642 .type = WREPL_TYPE_SGROUP,
4643 .state = WREPL_STATE_ACTIVE,
4644 .node = WREPL_NODE_B,
4646 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4647 .ips = addresses_B_3_4_X_3_4,
4648 .apply_expected = True,
4652 .type = WREPL_TYPE_SGROUP,
4653 .state = WREPL_STATE_TOMBSTONE,
4654 .node = WREPL_NODE_B,
4658 .apply_expected = True,
4662 * sgroup,active vs. sgroup,tombstone different addresses
4663 * => should be replaced
4666 .line = __location__,
4667 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4668 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4",
4672 .type = WREPL_TYPE_SGROUP,
4673 .state = WREPL_STATE_ACTIVE,
4674 .node = WREPL_NODE_B,
4676 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4677 .ips = addresses_B_3_4_X_3_4,
4678 .apply_expected = True,
4682 .type = WREPL_TYPE_SGROUP,
4683 .state = WREPL_STATE_TOMBSTONE,
4684 .node = WREPL_NODE_B,
4686 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4687 .ips = addresses_A_3_4,
4688 .apply_expected = True,
4692 * sgroup,active vs. sgroup,tombstone subset addresses
4693 * => should be replaced
4696 .line = __location__,
4697 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4698 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4 => B:B_3_4",
4702 .type = WREPL_TYPE_SGROUP,
4703 .state = WREPL_STATE_ACTIVE,
4704 .node = WREPL_NODE_B,
4706 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4707 .ips = addresses_B_3_4_X_3_4,
4708 .apply_expected = True,
4712 .type = WREPL_TYPE_SGROUP,
4713 .state = WREPL_STATE_TOMBSTONE,
4714 .node = WREPL_NODE_B,
4716 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4717 .ips = addresses_B_3_4,
4718 .apply_expected = True,
4722 * sgroup,active vs. sgroup,active same addresses
4723 * => should be replaced
4726 .line = __location__,
4727 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4728 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4_X_3_4 => B:B_3_4_X_3_4",
4732 .type = WREPL_TYPE_SGROUP,
4733 .state = WREPL_STATE_ACTIVE,
4734 .node = WREPL_NODE_B,
4736 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4737 .ips = addresses_B_3_4_X_3_4,
4738 .apply_expected = True,
4742 .type = WREPL_TYPE_SGROUP,
4743 .state = WREPL_STATE_TOMBSTONE,
4744 .node = WREPL_NODE_B,
4746 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4747 .ips = addresses_B_3_4_X_3_4,
4748 .apply_expected = True,
4753 * This should be the last record in this array,
4754 * we need to make sure the we leave a tombstoned unique entry
4758 .line = __location__,
4759 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4763 .type = WREPL_TYPE_UNIQUE,
4764 .state = WREPL_STATE_TOMBSTONE,
4765 .node = WREPL_NODE_B,
4767 .num_ips = ARRAY_SIZE(addresses_A_1),
4768 .ips = addresses_A_1,
4769 .apply_expected = True
4773 .type = WREPL_TYPE_UNIQUE,
4774 .state = WREPL_STATE_TOMBSTONE,
4775 .node = WREPL_NODE_B,
4777 .num_ips = ARRAY_SIZE(addresses_A_1),
4778 .ips = addresses_A_1,
4779 .apply_expected = True
4781 }}; /* do not add entries here, this should be the last record! */
4783 wins_name_r1 = &wins_name1;
4784 wins_name_r2 = &wins_name2;
4786 printf("Test Replica Conflicts with different owners\n");
4788 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
4790 if (!records[i].extra && !records[i].cleanup) {
4791 /* we should test the worst cases */
4792 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
4793 printf("(%s) Programmer error, invalid record[%u]: %s\n",
4794 __location__, i, records[i].line);
4796 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
4797 printf("(%s) Programmer error, invalid record[%u]: %s\n",
4798 __location__, i, records[i].line);
4803 if (!records[i].cleanup) {
4804 const char *expected;
4807 if (records[i].r2.sgroup_merge) {
4808 expected = "SGROUP_MERGE";
4809 } else if (records[i].r2.apply_expected) {
4810 expected = "REPLACE";
4812 expected = "NOT REPLACE";
4815 if (!records[i].r1.ips && !records[i].r2.ips) {
4816 ips = "with no ip(s)";
4817 } else if (records[i].r1.ips==records[i].r2.ips) {
4818 ips = "with same ip(s)";
4820 ips = "with different ip(s)";
4823 printf("%s,%s%s vs. %s,%s%s %s => %s\n",
4824 wrepl_name_type_string(records[i].r1.type),
4825 wrepl_name_state_string(records[i].r1.state),
4826 (records[i].r1.is_static?",static":""),
4827 wrepl_name_type_string(records[i].r2.type),
4828 wrepl_name_state_string(records[i].r2.state),
4829 (records[i].r2.is_static?",static":""),
4830 (records[i].comment?records[i].comment:ips),
4837 wins_name_r1->name = &records[i].name;
4838 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
4839 records[i].r1.state,
4841 records[i].r1.is_static);
4842 wins_name_r1->id = ++records[i].r1.owner->max_version;
4843 if (wins_name_r1->flags & 2) {
4844 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
4845 wins_name_r1->addresses.addresses.ips = discard_const(records[i].r1.ips);
4847 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
4849 wins_name_r1->unknown = "255.255.255.255";
4852 ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1);
4853 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4854 wins_name_r1, records[i].r1.apply_expected);
4859 wins_name_r2->name = &records[i].name;
4860 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
4861 records[i].r2.state,
4863 records[i].r2.is_static);
4864 wins_name_r2->id = ++records[i].r2.owner->max_version;
4865 if (wins_name_r2->flags & 2) {
4866 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
4867 wins_name_r2->addresses.addresses.ips = discard_const(records[i].r2.ips);
4869 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
4871 wins_name_r2->unknown = "255.255.255.255";
4874 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4875 if (records[i].r1.state == WREPL_STATE_RELEASED) {
4876 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4877 wins_name_r1, False);
4878 } else if (records[i].r2.sgroup_merge) {
4879 ret &= test_wrepl_sgroup_merged(ctx, records[i].r2.merge_owner,
4880 records[i].r1.owner,
4881 records[i].r1.num_ips, records[i].r1.ips,
4882 records[i].r2.owner,
4883 records[i].r2.num_ips, records[i].r2.ips,
4885 } else if (records[i].r1.owner != records[i].r2.owner) {
4887 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
4888 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4889 wins_name_r1, _expected);
4891 if (records[i].r2.state == WREPL_STATE_RELEASED) {
4892 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
4893 wins_name_r2, False);
4894 } else if (!records[i].r2.sgroup_merge) {
4895 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
4896 wins_name_r2, records[i].r2.apply_expected);
4899 if (records[i].r2.sgroup_cleanup) {
4901 printf("failed before sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4905 /* clean up the SGROUP record */
4906 wins_name_r1->name = &records[i].name;
4907 wins_name_r1->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4909 WREPL_NODE_B, False);
4910 wins_name_r1->id = ++records[i].r1.owner->max_version;
4911 wins_name_r1->addresses.addresses.num_ips = 0;
4912 wins_name_r1->addresses.addresses.ips = NULL;
4913 wins_name_r1->unknown = "255.255.255.255";
4914 ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1);
4916 /* here we test how names from an owner are deleted */
4917 if (records[i].r2.sgroup_merge && records[i].r2.num_ips) {
4918 ret &= test_wrepl_sgroup_merged(ctx, NULL,
4919 records[i].r2.owner,
4920 records[i].r2.num_ips, records[i].r2.ips,
4921 records[i].r1.owner,
4926 /* clean up the SGROUP record */
4927 wins_name_r2->name = &records[i].name;
4928 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4930 WREPL_NODE_B, False);
4931 wins_name_r2->id = ++records[i].r2.owner->max_version;
4932 wins_name_r2->addresses.addresses.num_ips = 0;
4933 wins_name_r2->addresses.addresses.ips = NULL;
4934 wins_name_r2->unknown = "255.255.255.255";
4935 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4937 /* take ownership of the SGROUP record */
4938 wins_name_r2->name = &records[i].name;
4939 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4941 WREPL_NODE_B, False);
4942 wins_name_r2->id = ++records[i].r2.owner->max_version;
4943 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4944 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4945 wins_name_r2->unknown = "255.255.255.255";
4946 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4947 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, True);
4949 /* overwrite the SGROUP record with unique,tombstone */
4950 wins_name_r2->name = &records[i].name;
4951 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4952 WREPL_STATE_TOMBSTONE,
4953 WREPL_NODE_B, False);
4954 wins_name_r2->id = ++records[i].r2.owner->max_version;
4955 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4956 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4957 wins_name_r2->unknown = "255.255.255.255";
4958 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4959 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, True);
4962 printf("failed in sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4967 /* the first one is a cleanup run */
4968 if (!ret && i == 0) ret = True;
4971 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
4979 static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_conn *ctx)
4983 struct wrepl_wins_name wins_name_;
4984 struct wrepl_wins_name *wins_name = &wins_name_;
4985 struct nbt_name_register name_register_;
4986 struct nbt_name_register *name_register = &name_register_;
4987 struct nbt_name_release release_;
4988 struct nbt_name_release *release = &release_;
4991 const char *line; /* just better debugging */
4992 struct nbt_name name;
4997 const struct wrepl_ip *ips;
4998 BOOL apply_expected;
5001 enum wrepl_name_type type;
5002 enum wrepl_name_state state;
5003 enum wrepl_name_node node;
5006 const struct wrepl_ip *ips;
5007 BOOL apply_expected;
5011 * unique vs. unique section
5014 * unique,released vs. unique,active with same ip(s)
5017 .line = __location__,
5018 .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL),
5022 .num_ips = ctx->addresses_best_num,
5023 .ips = ctx->addresses_best,
5024 .apply_expected = True
5027 .type = WREPL_TYPE_UNIQUE,
5028 .state = WREPL_STATE_ACTIVE,
5029 .node = WREPL_NODE_B,
5031 .num_ips = ctx->addresses_best_num,
5032 .ips = ctx->addresses_best,
5033 .apply_expected = True
5037 * unique,released vs. unique,active with different ip(s)
5040 .line = __location__,
5041 .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL),
5045 .num_ips = ctx->addresses_best_num,
5046 .ips = ctx->addresses_best,
5047 .apply_expected = True
5050 .type = WREPL_TYPE_UNIQUE,
5051 .state = WREPL_STATE_ACTIVE,
5052 .node = WREPL_NODE_B,
5054 .num_ips = ARRAY_SIZE(addresses_B_1),
5055 .ips = addresses_B_1,
5056 .apply_expected = True
5060 * unique,released vs. unique,tombstone with same ip(s)
5063 .line = __location__,
5064 .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL),
5068 .num_ips = ctx->addresses_best_num,
5069 .ips = ctx->addresses_best,
5070 .apply_expected = True
5073 .type = WREPL_TYPE_UNIQUE,
5074 .state = WREPL_STATE_TOMBSTONE,
5075 .node = WREPL_NODE_B,
5077 .num_ips = ctx->addresses_best_num,
5078 .ips = ctx->addresses_best,
5079 .apply_expected = True
5083 * unique,released vs. unique,tombstone with different ip(s)
5086 .line = __location__,
5087 .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL),
5091 .num_ips = ctx->addresses_best_num,
5092 .ips = ctx->addresses_best,
5093 .apply_expected = True
5096 .type = WREPL_TYPE_UNIQUE,
5097 .state = WREPL_STATE_TOMBSTONE,
5098 .node = WREPL_NODE_B,
5100 .num_ips = ARRAY_SIZE(addresses_B_1),
5101 .ips = addresses_B_1,
5102 .apply_expected = True
5106 * unique vs. group section
5109 * unique,released vs. group,active with same ip(s)
5112 .line = __location__,
5113 .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL),
5117 .num_ips = ctx->addresses_best_num,
5118 .ips = ctx->addresses_best,
5119 .apply_expected = True
5122 .type = WREPL_TYPE_GROUP,
5123 .state = WREPL_STATE_ACTIVE,
5124 .node = WREPL_NODE_B,
5126 .num_ips = ctx->addresses_best_num,
5127 .ips = ctx->addresses_best,
5128 .apply_expected = True
5132 * unique,released vs. group,active with different ip(s)
5135 .line = __location__,
5136 .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL),
5140 .num_ips = ctx->addresses_best_num,
5141 .ips = ctx->addresses_best,
5142 .apply_expected = True
5145 .type = WREPL_TYPE_GROUP,
5146 .state = WREPL_STATE_ACTIVE,
5147 .node = WREPL_NODE_B,
5149 .num_ips = ARRAY_SIZE(addresses_B_1),
5150 .ips = addresses_B_1,
5151 .apply_expected = True
5155 * unique,released vs. group,tombstone with same ip(s)
5158 .line = __location__,
5159 .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL),
5163 .num_ips = ctx->addresses_best_num,
5164 .ips = ctx->addresses_best,
5165 .apply_expected = True
5168 .type = WREPL_TYPE_GROUP,
5169 .state = WREPL_STATE_TOMBSTONE,
5170 .node = WREPL_NODE_B,
5172 .num_ips = ctx->addresses_best_num,
5173 .ips = ctx->addresses_best,
5174 .apply_expected = True
5178 * unique,released vs. group,tombstone with different ip(s)
5181 .line = __location__,
5182 .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL),
5186 .num_ips = ctx->addresses_best_num,
5187 .ips = ctx->addresses_best,
5188 .apply_expected = True
5191 .type = WREPL_TYPE_GROUP,
5192 .state = WREPL_STATE_TOMBSTONE,
5193 .node = WREPL_NODE_B,
5195 .num_ips = ARRAY_SIZE(addresses_B_1),
5196 .ips = addresses_B_1,
5197 .apply_expected = True
5201 * unique vs. special group section
5204 * unique,released vs. sgroup,active with same ip(s)
5207 .line = __location__,
5208 .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL),
5212 .num_ips = ctx->addresses_best_num,
5213 .ips = ctx->addresses_best,
5214 .apply_expected = True
5217 .type = WREPL_TYPE_SGROUP,
5218 .state = WREPL_STATE_ACTIVE,
5219 .node = WREPL_NODE_B,
5221 .num_ips = ctx->addresses_best_num,
5222 .ips = ctx->addresses_best,
5223 .apply_expected = True
5227 * unique,released vs. sgroup,active with different ip(s)
5230 .line = __location__,
5231 .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL),
5235 .num_ips = ctx->addresses_best_num,
5236 .ips = ctx->addresses_best,
5237 .apply_expected = True
5240 .type = WREPL_TYPE_SGROUP,
5241 .state = WREPL_STATE_ACTIVE,
5242 .node = WREPL_NODE_B,
5244 .num_ips = ARRAY_SIZE(addresses_B_1),
5245 .ips = addresses_B_1,
5246 .apply_expected = True
5250 * unique,released vs. sgroup,tombstone with same ip(s)
5253 .line = __location__,
5254 .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL),
5258 .num_ips = ctx->addresses_best_num,
5259 .ips = ctx->addresses_best,
5260 .apply_expected = True
5263 .type = WREPL_TYPE_SGROUP,
5264 .state = WREPL_STATE_TOMBSTONE,
5265 .node = WREPL_NODE_B,
5267 .num_ips = ctx->addresses_best_num,
5268 .ips = ctx->addresses_best,
5269 .apply_expected = True
5273 * unique,released vs. sgroup,tombstone with different ip(s)
5276 .line = __location__,
5277 .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL),
5281 .num_ips = ctx->addresses_best_num,
5282 .ips = ctx->addresses_best,
5283 .apply_expected = True
5286 .type = WREPL_TYPE_SGROUP,
5287 .state = WREPL_STATE_TOMBSTONE,
5288 .node = WREPL_NODE_B,
5290 .num_ips = ARRAY_SIZE(addresses_B_1),
5291 .ips = addresses_B_1,
5292 .apply_expected = True
5296 * unique vs. multi homed section
5299 * unique,released vs. mhomed,active with same ip(s)
5302 .line = __location__,
5303 .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL),
5307 .num_ips = ctx->addresses_best_num,
5308 .ips = ctx->addresses_best,
5309 .apply_expected = True
5312 .type = WREPL_TYPE_MHOMED,
5313 .state = WREPL_STATE_ACTIVE,
5314 .node = WREPL_NODE_B,
5316 .num_ips = ctx->addresses_best_num,
5317 .ips = ctx->addresses_best,
5318 .apply_expected = True
5322 * unique,released vs. mhomed,active with different ip(s)
5325 .line = __location__,
5326 .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL),
5330 .num_ips = ctx->addresses_best_num,
5331 .ips = ctx->addresses_best,
5332 .apply_expected = True
5335 .type = WREPL_TYPE_MHOMED,
5336 .state = WREPL_STATE_ACTIVE,
5337 .node = WREPL_NODE_B,
5339 .num_ips = ARRAY_SIZE(addresses_B_1),
5340 .ips = addresses_B_1,
5341 .apply_expected = True
5345 * unique,released vs. mhomed,tombstone with same ip(s)
5348 .line = __location__,
5349 .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL),
5353 .num_ips = ctx->addresses_best_num,
5354 .ips = ctx->addresses_best,
5355 .apply_expected = True
5358 .type = WREPL_TYPE_MHOMED,
5359 .state = WREPL_STATE_TOMBSTONE,
5360 .node = WREPL_NODE_B,
5362 .num_ips = ctx->addresses_best_num,
5363 .ips = ctx->addresses_best,
5364 .apply_expected = True
5368 * unique,released vs. mhomed,tombstone with different ip(s)
5371 .line = __location__,
5372 .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL),
5376 .num_ips = ctx->addresses_best_num,
5377 .ips = ctx->addresses_best,
5378 .apply_expected = True
5381 .type = WREPL_TYPE_MHOMED,
5382 .state = WREPL_STATE_TOMBSTONE,
5383 .node = WREPL_NODE_B,
5385 .num_ips = ARRAY_SIZE(addresses_B_1),
5386 .ips = addresses_B_1,
5387 .apply_expected = True
5391 * group vs. unique section
5394 * group,released vs. unique,active with same ip(s)
5397 .line = __location__,
5398 .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL),
5400 .nb_flags = NBT_NM_GROUP,
5402 .num_ips = ctx->addresses_best_num,
5403 .ips = ctx->addresses_best,
5404 .apply_expected = True
5407 .type = WREPL_TYPE_UNIQUE,
5408 .state = WREPL_STATE_ACTIVE,
5409 .node = WREPL_NODE_B,
5411 .num_ips = ctx->addresses_best_num,
5412 .ips = ctx->addresses_best,
5413 .apply_expected = False
5417 * group,released vs. unique,active with different ip(s)
5420 .line = __location__,
5421 .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL),
5423 .nb_flags = NBT_NM_GROUP,
5425 .num_ips = ctx->addresses_best_num,
5426 .ips = ctx->addresses_best,
5427 .apply_expected = True
5430 .type = WREPL_TYPE_UNIQUE,
5431 .state = WREPL_STATE_ACTIVE,
5432 .node = WREPL_NODE_B,
5434 .num_ips = ARRAY_SIZE(addresses_B_1),
5435 .ips = addresses_B_1,
5436 .apply_expected = False
5440 * group,released vs. unique,tombstone with same ip(s)
5443 .line = __location__,
5444 .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL),
5446 .nb_flags = NBT_NM_GROUP,
5448 .num_ips = ctx->addresses_best_num,
5449 .ips = ctx->addresses_best,
5450 .apply_expected = True
5453 .type = WREPL_TYPE_UNIQUE,
5454 .state = WREPL_STATE_TOMBSTONE,
5455 .node = WREPL_NODE_B,
5457 .num_ips = ctx->addresses_best_num,
5458 .ips = ctx->addresses_best,
5459 .apply_expected = False
5463 * group,released vs. unique,tombstone with different ip(s)
5466 .line = __location__,
5467 .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL),
5469 .nb_flags = NBT_NM_GROUP,
5471 .num_ips = ctx->addresses_best_num,
5472 .ips = ctx->addresses_best,
5473 .apply_expected = True
5476 .type = WREPL_TYPE_UNIQUE,
5477 .state = WREPL_STATE_TOMBSTONE,
5478 .node = WREPL_NODE_B,
5480 .num_ips = ARRAY_SIZE(addresses_B_1),
5481 .ips = addresses_B_1,
5482 .apply_expected = False
5486 * group vs. group section
5489 * group,released vs. group,active with same ip(s)
5492 .line = __location__,
5493 .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL),
5495 .nb_flags = NBT_NM_GROUP,
5497 .num_ips = ctx->addresses_best_num,
5498 .ips = ctx->addresses_best,
5499 .apply_expected = True
5502 .type = WREPL_TYPE_GROUP,
5503 .state = WREPL_STATE_ACTIVE,
5504 .node = WREPL_NODE_B,
5506 .num_ips = ctx->addresses_best_num,
5507 .ips = ctx->addresses_best,
5508 .apply_expected = True
5512 * group,released vs. group,active with different ip(s)
5515 .line = __location__,
5516 .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL),
5518 .nb_flags = NBT_NM_GROUP,
5520 .num_ips = ctx->addresses_best_num,
5521 .ips = ctx->addresses_best,
5522 .apply_expected = True
5525 .type = WREPL_TYPE_GROUP,
5526 .state = WREPL_STATE_ACTIVE,
5527 .node = WREPL_NODE_B,
5529 .num_ips = ARRAY_SIZE(addresses_B_1),
5530 .ips = addresses_B_1,
5531 .apply_expected = True
5535 * group,released vs. group,tombstone with same ip(s)
5538 .line = __location__,
5539 .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL),
5541 .nb_flags = NBT_NM_GROUP,
5543 .num_ips = ctx->addresses_best_num,
5544 .ips = ctx->addresses_best,
5545 .apply_expected = True
5548 .type = WREPL_TYPE_GROUP,
5549 .state = WREPL_STATE_TOMBSTONE,
5550 .node = WREPL_NODE_B,
5552 .num_ips = ctx->addresses_best_num,
5553 .ips = ctx->addresses_best,
5554 .apply_expected = True
5558 * group,released vs. group,tombstone with different ip(s)
5561 .line = __location__,
5562 .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL),
5564 .nb_flags = NBT_NM_GROUP,
5566 .num_ips = ctx->addresses_best_num,
5567 .ips = ctx->addresses_best,
5568 .apply_expected = True
5571 .type = WREPL_TYPE_GROUP,
5572 .state = WREPL_STATE_TOMBSTONE,
5573 .node = WREPL_NODE_B,
5575 .num_ips = ARRAY_SIZE(addresses_B_1),
5576 .ips = addresses_B_1,
5577 .apply_expected = True
5581 * group vs. special group section
5584 * group,released vs. sgroup,active with same ip(s)
5587 .line = __location__,
5588 .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL),
5590 .nb_flags = NBT_NM_GROUP,
5592 .num_ips = ctx->addresses_best_num,
5593 .ips = ctx->addresses_best,
5594 .apply_expected = True
5597 .type = WREPL_TYPE_SGROUP,
5598 .state = WREPL_STATE_ACTIVE,
5599 .node = WREPL_NODE_B,
5601 .num_ips = ctx->addresses_best_num,
5602 .ips = ctx->addresses_best,
5603 .apply_expected = False
5607 * group,released vs. sgroup,active with different ip(s)
5610 .line = __location__,
5611 .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL),
5613 .nb_flags = NBT_NM_GROUP,
5615 .num_ips = ctx->addresses_best_num,
5616 .ips = ctx->addresses_best,
5617 .apply_expected = True
5620 .type = WREPL_TYPE_SGROUP,
5621 .state = WREPL_STATE_ACTIVE,
5622 .node = WREPL_NODE_B,
5624 .num_ips = ARRAY_SIZE(addresses_B_1),
5625 .ips = addresses_B_1,
5626 .apply_expected = False
5630 * group,released vs. sgroup,tombstone with same ip(s)
5633 .line = __location__,
5634 .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL),
5636 .nb_flags = NBT_NM_GROUP,
5638 .num_ips = ctx->addresses_best_num,
5639 .ips = ctx->addresses_best,
5640 .apply_expected = True
5643 .type = WREPL_TYPE_SGROUP,
5644 .state = WREPL_STATE_TOMBSTONE,
5645 .node = WREPL_NODE_B,
5647 .num_ips = ctx->addresses_best_num,
5648 .ips = ctx->addresses_best,
5649 .apply_expected = False
5653 * group,released vs. sgroup,tombstone with different ip(s)
5656 .line = __location__,
5657 .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL),
5659 .nb_flags = NBT_NM_GROUP,
5661 .num_ips = ctx->addresses_best_num,
5662 .ips = ctx->addresses_best,
5663 .apply_expected = True
5666 .type = WREPL_TYPE_SGROUP,
5667 .state = WREPL_STATE_TOMBSTONE,
5668 .node = WREPL_NODE_B,
5670 .num_ips = ARRAY_SIZE(addresses_B_1),
5671 .ips = addresses_B_1,
5672 .apply_expected = False
5676 * group vs. multi homed section
5679 * group,released vs. mhomed,active with same ip(s)
5682 .line = __location__,
5683 .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL),
5685 .nb_flags = NBT_NM_GROUP,
5687 .num_ips = ctx->addresses_best_num,
5688 .ips = ctx->addresses_best,
5689 .apply_expected = True
5692 .type = WREPL_TYPE_MHOMED,
5693 .state = WREPL_STATE_ACTIVE,
5694 .node = WREPL_NODE_B,
5696 .num_ips = ctx->addresses_best_num,
5697 .ips = ctx->addresses_best,
5698 .apply_expected = False
5702 * group,released vs. mhomed,active with different ip(s)
5705 .line = __location__,
5706 .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL),
5708 .nb_flags = NBT_NM_GROUP,
5710 .num_ips = ctx->addresses_best_num,
5711 .ips = ctx->addresses_best,
5712 .apply_expected = True
5715 .type = WREPL_TYPE_MHOMED,
5716 .state = WREPL_STATE_ACTIVE,
5717 .node = WREPL_NODE_B,
5719 .num_ips = ARRAY_SIZE(addresses_B_1),
5720 .ips = addresses_B_1,
5721 .apply_expected = False
5725 * group,released vs. mhomed,tombstone with same ip(s)
5728 .line = __location__,
5729 .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL),
5731 .nb_flags = NBT_NM_GROUP,
5733 .num_ips = ctx->addresses_best_num,
5734 .ips = ctx->addresses_best,
5735 .apply_expected = True
5738 .type = WREPL_TYPE_MHOMED,
5739 .state = WREPL_STATE_TOMBSTONE,
5740 .node = WREPL_NODE_B,
5742 .num_ips = ctx->addresses_best_num,
5743 .ips = ctx->addresses_best,
5744 .apply_expected = False
5748 * group,released vs. mhomed,tombstone with different ip(s)
5751 .line = __location__,
5752 .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL),
5754 .nb_flags = NBT_NM_GROUP,
5756 .num_ips = ctx->addresses_best_num,
5757 .ips = ctx->addresses_best,
5758 .apply_expected = True
5761 .type = WREPL_TYPE_MHOMED,
5762 .state = WREPL_STATE_TOMBSTONE,
5763 .node = WREPL_NODE_B,
5765 .num_ips = ARRAY_SIZE(addresses_B_1),
5766 .ips = addresses_B_1,
5767 .apply_expected = False
5771 * special group vs. unique section
5774 * sgroup,released vs. unique,active with same ip(s)
5777 .line = __location__,
5778 .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL),
5780 .nb_flags = NBT_NM_GROUP,
5782 .num_ips = ctx->addresses_best_num,
5783 .ips = ctx->addresses_best,
5784 .apply_expected = True
5787 .type = WREPL_TYPE_UNIQUE,
5788 .state = WREPL_STATE_ACTIVE,
5789 .node = WREPL_NODE_B,
5791 .num_ips = ctx->addresses_best_num,
5792 .ips = ctx->addresses_best,
5793 .apply_expected = True
5797 * sgroup,released vs. unique,active with different ip(s)
5800 .line = __location__,
5801 .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL),
5803 .nb_flags = NBT_NM_GROUP,
5805 .num_ips = ctx->addresses_best_num,
5806 .ips = ctx->addresses_best,
5807 .apply_expected = True
5810 .type = WREPL_TYPE_UNIQUE,
5811 .state = WREPL_STATE_ACTIVE,
5812 .node = WREPL_NODE_B,
5814 .num_ips = ARRAY_SIZE(addresses_B_1),
5815 .ips = addresses_B_1,
5816 .apply_expected = True
5820 * sgroup,released vs. unique,tombstone with same ip(s)
5823 .line = __location__,
5824 .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL),
5826 .nb_flags = NBT_NM_GROUP,
5828 .num_ips = ctx->addresses_best_num,
5829 .ips = ctx->addresses_best,
5830 .apply_expected = True
5833 .type = WREPL_TYPE_UNIQUE,
5834 .state = WREPL_STATE_TOMBSTONE,
5835 .node = WREPL_NODE_B,
5837 .num_ips = ctx->addresses_best_num,
5838 .ips = ctx->addresses_best,
5839 .apply_expected = True
5843 * sgroup,released vs. unique,tombstone with different ip(s)
5846 .line = __location__,
5847 .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL),
5849 .nb_flags = NBT_NM_GROUP,
5851 .num_ips = ctx->addresses_best_num,
5852 .ips = ctx->addresses_best,
5853 .apply_expected = True
5856 .type = WREPL_TYPE_UNIQUE,
5857 .state = WREPL_STATE_TOMBSTONE,
5858 .node = WREPL_NODE_B,
5860 .num_ips = ARRAY_SIZE(addresses_B_1),
5861 .ips = addresses_B_1,
5862 .apply_expected = True
5866 * special group vs. group section
5869 * sgroup,released vs. group,active with same ip(s)
5872 .line = __location__,
5873 .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL),
5875 .nb_flags = NBT_NM_GROUP,
5877 .num_ips = ctx->addresses_best_num,
5878 .ips = ctx->addresses_best,
5879 .apply_expected = True
5882 .type = WREPL_TYPE_GROUP,
5883 .state = WREPL_STATE_ACTIVE,
5884 .node = WREPL_NODE_B,
5886 .num_ips = ctx->addresses_best_num,
5887 .ips = ctx->addresses_best,
5888 .apply_expected = True
5892 * sgroup,released vs. group,active with different ip(s)
5895 .line = __location__,
5896 .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL),
5898 .nb_flags = NBT_NM_GROUP,
5900 .num_ips = ctx->addresses_best_num,
5901 .ips = ctx->addresses_best,
5902 .apply_expected = True
5905 .type = WREPL_TYPE_GROUP,
5906 .state = WREPL_STATE_ACTIVE,
5907 .node = WREPL_NODE_B,
5909 .num_ips = ARRAY_SIZE(addresses_B_1),
5910 .ips = addresses_B_1,
5911 .apply_expected = True
5915 * sgroup,released vs. group,tombstone with same ip(s)
5918 .line = __location__,
5919 .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL),
5921 .nb_flags = NBT_NM_GROUP,
5923 .num_ips = ctx->addresses_best_num,
5924 .ips = ctx->addresses_best,
5925 .apply_expected = True
5928 .type = WREPL_TYPE_GROUP,
5929 .state = WREPL_STATE_TOMBSTONE,
5930 .node = WREPL_NODE_B,
5932 .num_ips = ctx->addresses_best_num,
5933 .ips = ctx->addresses_best,
5934 .apply_expected = True
5938 * sgroup,released vs. group,tombstone with different ip(s)
5941 .line = __location__,
5942 .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL),
5944 .nb_flags = NBT_NM_GROUP,
5946 .num_ips = ctx->addresses_best_num,
5947 .ips = ctx->addresses_best,
5948 .apply_expected = True
5951 .type = WREPL_TYPE_GROUP,
5952 .state = WREPL_STATE_TOMBSTONE,
5953 .node = WREPL_NODE_B,
5955 .num_ips = ARRAY_SIZE(addresses_B_1),
5956 .ips = addresses_B_1,
5957 .apply_expected = True
5961 * special group vs. special group section
5964 * sgroup,released vs. sgroup,active with same ip(s)
5967 .line = __location__,
5968 .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL),
5970 .nb_flags = NBT_NM_GROUP,
5972 .num_ips = ctx->addresses_best_num,
5973 .ips = ctx->addresses_best,
5974 .apply_expected = True
5977 .type = WREPL_TYPE_SGROUP,
5978 .state = WREPL_STATE_ACTIVE,
5979 .node = WREPL_NODE_B,
5981 .num_ips = ctx->addresses_best_num,
5982 .ips = ctx->addresses_best,
5983 .apply_expected = True
5987 * sgroup,released vs. sgroup,active with different ip(s)
5990 .line = __location__,
5991 .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL),
5993 .nb_flags = NBT_NM_GROUP,
5995 .num_ips = ctx->addresses_best_num,
5996 .ips = ctx->addresses_best,
5997 .apply_expected = True
6000 .type = WREPL_TYPE_SGROUP,
6001 .state = WREPL_STATE_ACTIVE,
6002 .node = WREPL_NODE_B,
6004 .num_ips = ARRAY_SIZE(addresses_B_1),
6005 .ips = addresses_B_1,
6006 .apply_expected = True
6010 * sgroup,released vs. sgroup,tombstone with same ip(s)
6013 .line = __location__,
6014 .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL),
6016 .nb_flags = NBT_NM_GROUP,
6018 .num_ips = ctx->addresses_best_num,
6019 .ips = ctx->addresses_best,
6020 .apply_expected = True
6023 .type = WREPL_TYPE_SGROUP,
6024 .state = WREPL_STATE_TOMBSTONE,
6025 .node = WREPL_NODE_B,
6027 .num_ips = ctx->addresses_best_num,
6028 .ips = ctx->addresses_best,
6029 .apply_expected = True
6033 * sgroup,released vs. sgroup,tombstone with different ip(s)
6036 .line = __location__,
6037 .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL),
6039 .nb_flags = NBT_NM_GROUP,
6041 .num_ips = ctx->addresses_best_num,
6042 .ips = ctx->addresses_best,
6043 .apply_expected = True
6046 .type = WREPL_TYPE_SGROUP,
6047 .state = WREPL_STATE_TOMBSTONE,
6048 .node = WREPL_NODE_B,
6050 .num_ips = ARRAY_SIZE(addresses_B_1),
6051 .ips = addresses_B_1,
6052 .apply_expected = True
6056 * special group vs. multi homed section
6059 * sgroup,released vs. mhomed,active with same ip(s)
6062 .line = __location__,
6063 .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL),
6065 .nb_flags = NBT_NM_GROUP,
6067 .num_ips = ctx->addresses_best_num,
6068 .ips = ctx->addresses_best,
6069 .apply_expected = True
6072 .type = WREPL_TYPE_MHOMED,
6073 .state = WREPL_STATE_ACTIVE,
6074 .node = WREPL_NODE_B,
6076 .num_ips = ctx->addresses_best_num,
6077 .ips = ctx->addresses_best,
6078 .apply_expected = True
6082 * sgroup,released vs. mhomed,active with different ip(s)
6085 .line = __location__,
6086 .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL),
6088 .nb_flags = NBT_NM_GROUP,
6090 .num_ips = ctx->addresses_best_num,
6091 .ips = ctx->addresses_best,
6092 .apply_expected = True
6095 .type = WREPL_TYPE_MHOMED,
6096 .state = WREPL_STATE_ACTIVE,
6097 .node = WREPL_NODE_B,
6099 .num_ips = ARRAY_SIZE(addresses_B_1),
6100 .ips = addresses_B_1,
6101 .apply_expected = True
6105 * sgroup,released vs. mhomed,tombstone with same ip(s)
6108 .line = __location__,
6109 .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL),
6111 .nb_flags = NBT_NM_GROUP,
6113 .num_ips = ctx->addresses_best_num,
6114 .ips = ctx->addresses_best,
6115 .apply_expected = True
6118 .type = WREPL_TYPE_MHOMED,
6119 .state = WREPL_STATE_TOMBSTONE,
6120 .node = WREPL_NODE_B,
6122 .num_ips = ctx->addresses_best_num,
6123 .ips = ctx->addresses_best,
6124 .apply_expected = True
6128 * sgroup,released vs. mhomed,tombstone with different ip(s)
6131 .line = __location__,
6132 .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL),
6134 .nb_flags = NBT_NM_GROUP,
6136 .num_ips = ctx->addresses_best_num,
6137 .ips = ctx->addresses_best,
6138 .apply_expected = True
6141 .type = WREPL_TYPE_MHOMED,
6142 .state = WREPL_STATE_TOMBSTONE,
6143 .node = WREPL_NODE_B,
6145 .num_ips = ARRAY_SIZE(addresses_B_1),
6146 .ips = addresses_B_1,
6147 .apply_expected = True
6151 * multi homed vs. unique section
6154 * mhomed,released vs. unique,active with same ip(s)
6157 .line = __location__,
6158 .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL),
6162 .num_ips = ctx->addresses_best_num,
6163 .ips = ctx->addresses_best,
6164 .apply_expected = True
6167 .type = WREPL_TYPE_UNIQUE,
6168 .state = WREPL_STATE_ACTIVE,
6169 .node = WREPL_NODE_B,
6171 .num_ips = ctx->addresses_best_num,
6172 .ips = ctx->addresses_best,
6173 .apply_expected = True
6177 * mhomed,released vs. unique,active with different ip(s)
6180 .line = __location__,
6181 .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL),
6185 .num_ips = ctx->addresses_best_num,
6186 .ips = ctx->addresses_best,
6187 .apply_expected = True
6190 .type = WREPL_TYPE_UNIQUE,
6191 .state = WREPL_STATE_ACTIVE,
6192 .node = WREPL_NODE_B,
6194 .num_ips = ARRAY_SIZE(addresses_B_1),
6195 .ips = addresses_B_1,
6196 .apply_expected = True
6200 * mhomed,released vs. unique,tombstone with same ip(s)
6203 .line = __location__,
6204 .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL),
6208 .num_ips = ctx->addresses_best_num,
6209 .ips = ctx->addresses_best,
6210 .apply_expected = True
6213 .type = WREPL_TYPE_UNIQUE,
6214 .state = WREPL_STATE_TOMBSTONE,
6215 .node = WREPL_NODE_B,
6217 .num_ips = ctx->addresses_best_num,
6218 .ips = ctx->addresses_best,
6219 .apply_expected = True
6223 * mhomed,released vs. unique,tombstone with different ip(s)
6226 .line = __location__,
6227 .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL),
6231 .num_ips = ctx->addresses_best_num,
6232 .ips = ctx->addresses_best,
6233 .apply_expected = True
6236 .type = WREPL_TYPE_UNIQUE,
6237 .state = WREPL_STATE_TOMBSTONE,
6238 .node = WREPL_NODE_B,
6240 .num_ips = ARRAY_SIZE(addresses_B_1),
6241 .ips = addresses_B_1,
6242 .apply_expected = True
6246 * multi homed vs. group section
6249 * mhomed,released vs. group,active with same ip(s)
6252 .line = __location__,
6253 .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL),
6257 .num_ips = ctx->addresses_best_num,
6258 .ips = ctx->addresses_best,
6259 .apply_expected = True
6262 .type = WREPL_TYPE_GROUP,
6263 .state = WREPL_STATE_ACTIVE,
6264 .node = WREPL_NODE_B,
6266 .num_ips = ctx->addresses_best_num,
6267 .ips = ctx->addresses_best,
6268 .apply_expected = True
6272 * mhomed,released vs. group,active with different ip(s)
6275 .line = __location__,
6276 .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL),
6280 .num_ips = ctx->addresses_best_num,
6281 .ips = ctx->addresses_best,
6282 .apply_expected = True
6285 .type = WREPL_TYPE_GROUP,
6286 .state = WREPL_STATE_ACTIVE,
6287 .node = WREPL_NODE_B,
6289 .num_ips = ARRAY_SIZE(addresses_B_1),
6290 .ips = addresses_B_1,
6291 .apply_expected = True
6295 * mhomed,released vs. group,tombstone with same ip(s)
6298 .line = __location__,
6299 .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL),
6303 .num_ips = ctx->addresses_best_num,
6304 .ips = ctx->addresses_best,
6305 .apply_expected = True
6308 .type = WREPL_TYPE_GROUP,
6309 .state = WREPL_STATE_TOMBSTONE,
6310 .node = WREPL_NODE_B,
6312 .num_ips = ctx->addresses_best_num,
6313 .ips = ctx->addresses_best,
6314 .apply_expected = True
6318 * mhomed,released vs. group,tombstone with different ip(s)
6321 .line = __location__,
6322 .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL),
6326 .num_ips = ctx->addresses_best_num,
6327 .ips = ctx->addresses_best,
6328 .apply_expected = True
6331 .type = WREPL_TYPE_GROUP,
6332 .state = WREPL_STATE_TOMBSTONE,
6333 .node = WREPL_NODE_B,
6335 .num_ips = ARRAY_SIZE(addresses_B_1),
6336 .ips = addresses_B_1,
6337 .apply_expected = True
6341 * multi homed vs. special group section
6344 * mhomed,released vs. sgroup,active with same ip(s)
6347 .line = __location__,
6348 .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL),
6352 .num_ips = ctx->addresses_best_num,
6353 .ips = ctx->addresses_best,
6354 .apply_expected = True
6357 .type = WREPL_TYPE_SGROUP,
6358 .state = WREPL_STATE_ACTIVE,
6359 .node = WREPL_NODE_B,
6361 .num_ips = ctx->addresses_best_num,
6362 .ips = ctx->addresses_best,
6363 .apply_expected = True
6367 * mhomed,released vs. sgroup,active with different ip(s)
6370 .line = __location__,
6371 .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL),
6375 .num_ips = ctx->addresses_best_num,
6376 .ips = ctx->addresses_best,
6377 .apply_expected = True
6380 .type = WREPL_TYPE_SGROUP,
6381 .state = WREPL_STATE_ACTIVE,
6382 .node = WREPL_NODE_B,
6384 .num_ips = ARRAY_SIZE(addresses_B_1),
6385 .ips = addresses_B_1,
6386 .apply_expected = True
6390 * mhomed,released vs. sgroup,tombstone with same ip(s)
6393 .line = __location__,
6394 .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL),
6398 .num_ips = ctx->addresses_best_num,
6399 .ips = ctx->addresses_best,
6400 .apply_expected = True
6403 .type = WREPL_TYPE_SGROUP,
6404 .state = WREPL_STATE_TOMBSTONE,
6405 .node = WREPL_NODE_B,
6407 .num_ips = ctx->addresses_best_num,
6408 .ips = ctx->addresses_best,
6409 .apply_expected = True
6413 * mhomed,released vs. sgroup,tombstone with different ip(s)
6416 .line = __location__,
6417 .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL),
6421 .num_ips = ctx->addresses_best_num,
6422 .ips = ctx->addresses_best,
6423 .apply_expected = True
6426 .type = WREPL_TYPE_SGROUP,
6427 .state = WREPL_STATE_TOMBSTONE,
6428 .node = WREPL_NODE_B,
6430 .num_ips = ARRAY_SIZE(addresses_B_1),
6431 .ips = addresses_B_1,
6432 .apply_expected = True
6436 * multi homed vs. multi homed section
6439 * mhomed,released vs. mhomed,active with same ip(s)
6442 .line = __location__,
6443 .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL),
6447 .num_ips = ctx->addresses_best_num,
6448 .ips = ctx->addresses_best,
6449 .apply_expected = True
6452 .type = WREPL_TYPE_MHOMED,
6453 .state = WREPL_STATE_ACTIVE,
6454 .node = WREPL_NODE_B,
6456 .num_ips = ctx->addresses_best_num,
6457 .ips = ctx->addresses_best,
6458 .apply_expected = True
6462 * mhomed,released vs. mhomed,active with different ip(s)
6465 .line = __location__,
6466 .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL),
6470 .num_ips = ctx->addresses_best_num,
6471 .ips = ctx->addresses_best,
6472 .apply_expected = True
6475 .type = WREPL_TYPE_MHOMED,
6476 .state = WREPL_STATE_ACTIVE,
6477 .node = WREPL_NODE_B,
6479 .num_ips = ARRAY_SIZE(addresses_B_1),
6480 .ips = addresses_B_1,
6481 .apply_expected = True
6485 * mhomed,released vs. mhomed,tombstone with same ip(s)
6488 .line = __location__,
6489 .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL),
6493 .num_ips = ctx->addresses_best_num,
6494 .ips = ctx->addresses_best,
6495 .apply_expected = True
6498 .type = WREPL_TYPE_MHOMED,
6499 .state = WREPL_STATE_TOMBSTONE,
6500 .node = WREPL_NODE_B,
6502 .num_ips = ctx->addresses_best_num,
6503 .ips = ctx->addresses_best,
6504 .apply_expected = True
6508 * mhomed,released vs. mhomed,tombstone with different ip(s)
6511 .line = __location__,
6512 .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL),
6516 .num_ips = ctx->addresses_best_num,
6517 .ips = ctx->addresses_best,
6518 .apply_expected = True
6521 .type = WREPL_TYPE_MHOMED,
6522 .state = WREPL_STATE_TOMBSTONE,
6523 .node = WREPL_NODE_B,
6525 .num_ips = ARRAY_SIZE(addresses_B_1),
6526 .ips = addresses_B_1,
6527 .apply_expected = True
6532 printf("Test Replica records vs. owned released records\n");
6534 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
6535 printf("%s => %s\n", nbt_name_string(ctx, &records[i].name),
6536 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
6541 name_register->in.name = records[i].name;
6542 name_register->in.dest_addr = ctx->address;
6543 name_register->in.address = records[i].wins.ips[0].ip;
6544 name_register->in.nb_flags = records[i].wins.nb_flags;
6545 name_register->in.register_demand= False;
6546 name_register->in.broadcast = False;
6547 name_register->in.multi_homed = records[i].wins.mhomed;
6548 name_register->in.ttl = 300000;
6549 name_register->in.timeout = 70;
6550 name_register->in.retries = 0;
6552 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
6553 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6554 printf("No response from %s for name register\n", ctx->address);
6557 if (!NT_STATUS_IS_OK(status)) {
6558 printf("Bad response from %s for name register - %s\n",
6559 ctx->address, nt_errstr(status));
6562 CHECK_VALUE(name_register->out.rcode, 0);
6563 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
6564 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
6565 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
6566 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
6567 CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[0].ip);
6569 /* release the record */
6570 release->in.name = records[i].name;
6571 release->in.dest_addr = ctx->address;
6572 release->in.address = records[i].wins.ips[0].ip;
6573 release->in.nb_flags = records[i].wins.nb_flags;
6574 release->in.broadcast = False;
6575 release->in.timeout = 30;
6576 release->in.retries = 0;
6578 status = nbt_name_release(ctx->nbtsock, ctx, release);
6579 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6580 printf("No response from %s for name release\n", ctx->address);
6583 if (!NT_STATUS_IS_OK(status)) {
6584 printf("Bad response from %s for name query - %s\n",
6585 ctx->address, nt_errstr(status));
6588 CHECK_VALUE(release->out.rcode, 0);
6593 wins_name->name = &records[i].name;
6594 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
6595 records[i].replica.state,
6596 records[i].replica.node,
6597 records[i].replica.is_static);
6598 wins_name->id = ++ctx->b.max_version;
6599 if (wins_name->flags & 2) {
6600 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
6601 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
6603 wins_name->addresses.ip = records[i].replica.ips[0].ip;
6605 wins_name->unknown = "255.255.255.255";
6607 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
6608 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
6609 records[i].replica.apply_expected);
6611 if (records[i].replica.apply_expected) {
6612 wins_name->name = &records[i].name;
6613 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
6614 WREPL_STATE_TOMBSTONE,
6615 WREPL_NODE_B, False);
6616 wins_name->id = ++ctx->b.max_version;
6617 wins_name->addresses.ip = addresses_B_1[0].ip;
6618 wins_name->unknown = "255.255.255.255";
6620 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
6621 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
6623 release->in.name = records[i].name;
6624 release->in.dest_addr = ctx->address;
6625 release->in.address = records[i].wins.ips[0].ip;
6626 release->in.nb_flags = records[i].wins.nb_flags;
6627 release->in.broadcast = False;
6628 release->in.timeout = 30;
6629 release->in.retries = 0;
6631 status = nbt_name_release(ctx->nbtsock, ctx, release);
6632 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6633 printf("No response from %s for name release\n", ctx->address);
6636 if (!NT_STATUS_IS_OK(status)) {
6637 printf("Bad response from %s for name query - %s\n",
6638 ctx->address, nt_errstr(status));
6641 CHECK_VALUE(release->out.rcode, 0);
6645 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
6653 struct test_conflict_owned_active_vs_replica_struct {
6654 const char *line; /* just better debugging */
6655 const char *section; /* just better debugging */
6656 struct nbt_name name;
6657 const char *comment;
6663 const struct wrepl_ip *ips;
6664 BOOL apply_expected;
6669 BOOL expect_release;
6672 /* when num_ips == 0, then .wins.ips are used */
6674 const struct wrepl_ip *ips;
6677 enum wrepl_name_type type;
6678 enum wrepl_name_state state;
6679 enum wrepl_name_node node;
6682 const struct wrepl_ip *ips;
6683 BOOL apply_expected;
6689 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
6690 struct nbt_name_packet *req_packet,
6691 struct socket_address *src);
6693 static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_conn *ctx)
6697 struct wrepl_wins_name wins_name_;
6698 struct wrepl_wins_name *wins_name = &wins_name_;
6699 struct nbt_name_register name_register_;
6700 struct nbt_name_register *name_register = &name_register_;
6701 struct nbt_name_release release_;
6702 struct nbt_name_release *release = &release_;
6704 struct test_conflict_owned_active_vs_replica_struct records[] = {
6706 * unique vs. unique section
6709 * unique,active vs. unique,active with same ip(s), unchecked
6712 .line = __location__,
6713 .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL),
6717 .num_ips = ctx->addresses_best_num,
6718 .ips = ctx->addresses_best,
6719 .apply_expected = True
6725 .type = WREPL_TYPE_UNIQUE,
6726 .state = WREPL_STATE_ACTIVE,
6727 .node = WREPL_NODE_B,
6729 .num_ips = ctx->addresses_best_num,
6730 .ips = ctx->addresses_best,
6731 .apply_expected = True
6735 * unique,active vs. unique,active with different ip(s), positive response
6738 .line = __location__,
6739 .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL),
6743 .num_ips = ctx->addresses_best_num,
6744 .ips = ctx->addresses_best,
6745 .apply_expected = True
6752 .type = WREPL_TYPE_UNIQUE,
6753 .state = WREPL_STATE_ACTIVE,
6754 .node = WREPL_NODE_B,
6756 .num_ips = ARRAY_SIZE(addresses_B_1),
6757 .ips = addresses_B_1,
6758 .apply_expected = False
6762 * unique,active vs. unique,active with different ip(s), positive response other ips
6765 .line = __location__,
6766 .name = _NBT_NAME("_UA_UA_DI_O", 0x00, NULL),
6770 .num_ips = ctx->addresses_best_num,
6771 .ips = ctx->addresses_best,
6772 .apply_expected = True
6777 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6778 .ips = addresses_A_3_4,
6781 .type = WREPL_TYPE_UNIQUE,
6782 .state = WREPL_STATE_ACTIVE,
6783 .node = WREPL_NODE_B,
6785 .num_ips = ARRAY_SIZE(addresses_B_1),
6786 .ips = addresses_B_1,
6787 .apply_expected = False
6791 * unique,active vs. unique,active with different ip(s), negative response
6794 .line = __location__,
6795 .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL),
6799 .num_ips = ctx->addresses_best_num,
6800 .ips = ctx->addresses_best,
6801 .apply_expected = True
6808 .type = WREPL_TYPE_UNIQUE,
6809 .state = WREPL_STATE_ACTIVE,
6810 .node = WREPL_NODE_B,
6812 .num_ips = ARRAY_SIZE(addresses_B_1),
6813 .ips = addresses_B_1,
6814 .apply_expected = True
6818 * unique,active vs. unique,tombstone with same ip(s), unchecked
6821 .line = __location__,
6822 .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL),
6826 .num_ips = ctx->addresses_best_num,
6827 .ips = ctx->addresses_best,
6828 .apply_expected = True
6834 .type = WREPL_TYPE_UNIQUE,
6835 .state = WREPL_STATE_TOMBSTONE,
6836 .node = WREPL_NODE_B,
6838 .num_ips = ctx->addresses_best_num,
6839 .ips = ctx->addresses_best,
6840 .apply_expected = False
6844 * unique,active vs. unique,tombstone with different ip(s), unchecked
6847 .line = __location__,
6848 .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL),
6852 .num_ips = ctx->addresses_best_num,
6853 .ips = ctx->addresses_best,
6854 .apply_expected = True
6860 .type = WREPL_TYPE_UNIQUE,
6861 .state = WREPL_STATE_TOMBSTONE,
6862 .node = WREPL_NODE_B,
6864 .num_ips = ARRAY_SIZE(addresses_B_1),
6865 .ips = addresses_B_1,
6866 .apply_expected = False
6870 * unique vs. group section
6873 * unique,active vs. group,active with same ip(s), release expected
6876 .line = __location__,
6877 .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL),
6881 .num_ips = ctx->addresses_best_num,
6882 .ips = ctx->addresses_best,
6883 .apply_expected = True
6887 .expect_release = True,
6890 .type = WREPL_TYPE_GROUP,
6891 .state = WREPL_STATE_ACTIVE,
6892 .node = WREPL_NODE_B,
6894 .num_ips = ctx->addresses_best_num,
6895 .ips = ctx->addresses_best,
6896 .apply_expected = True
6900 * unique,active vs. group,active with different ip(s), release expected
6903 .line = __location__,
6904 .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL),
6908 .num_ips = ctx->addresses_best_num,
6909 .ips = ctx->addresses_best,
6910 .apply_expected = True
6914 .expect_release = True,
6917 .type = WREPL_TYPE_GROUP,
6918 .state = WREPL_STATE_ACTIVE,
6919 .node = WREPL_NODE_B,
6921 .num_ips = ARRAY_SIZE(addresses_B_1),
6922 .ips = addresses_B_1,
6923 .apply_expected = True
6927 * unique,active vs. group,tombstone with same ip(s), unchecked
6930 .line = __location__,
6931 .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL),
6935 .num_ips = ctx->addresses_best_num,
6936 .ips = ctx->addresses_best,
6937 .apply_expected = True
6943 .type = WREPL_TYPE_GROUP,
6944 .state = WREPL_STATE_TOMBSTONE,
6945 .node = WREPL_NODE_B,
6947 .num_ips = ctx->addresses_best_num,
6948 .ips = ctx->addresses_best,
6949 .apply_expected = False
6953 * unique,active vs. group,tombstone with different ip(s), unchecked
6956 .line = __location__,
6957 .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL),
6961 .num_ips = ctx->addresses_best_num,
6962 .ips = ctx->addresses_best,
6963 .apply_expected = True
6969 .type = WREPL_TYPE_GROUP,
6970 .state = WREPL_STATE_TOMBSTONE,
6971 .node = WREPL_NODE_B,
6973 .num_ips = ARRAY_SIZE(addresses_B_1),
6974 .ips = addresses_B_1,
6975 .apply_expected = False
6979 * unique vs. special group section
6982 * unique,active vs. sgroup,active with same ip(s), release expected
6985 .line = __location__,
6986 .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL),
6990 .num_ips = ctx->addresses_best_num,
6991 .ips = ctx->addresses_best,
6992 .apply_expected = True
6996 .expect_release = True,
6999 .type = WREPL_TYPE_SGROUP,
7000 .state = WREPL_STATE_ACTIVE,
7001 .node = WREPL_NODE_B,
7003 .num_ips = ctx->addresses_best_num,
7004 .ips = ctx->addresses_best,
7005 .apply_expected = True
7009 * unique,active vs. group,active with different ip(s), release expected
7012 .line = __location__,
7013 .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL),
7017 .num_ips = ctx->addresses_best_num,
7018 .ips = ctx->addresses_best,
7019 .apply_expected = True
7023 .expect_release = True,
7026 .type = WREPL_TYPE_SGROUP,
7027 .state = WREPL_STATE_ACTIVE,
7028 .node = WREPL_NODE_B,
7030 .num_ips = ARRAY_SIZE(addresses_B_1),
7031 .ips = addresses_B_1,
7032 .apply_expected = True
7036 * unique,active vs. sgroup,tombstone with same ip(s), unchecked
7039 .line = __location__,
7040 .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL),
7044 .num_ips = ctx->addresses_best_num,
7045 .ips = ctx->addresses_best,
7046 .apply_expected = True
7052 .type = WREPL_TYPE_SGROUP,
7053 .state = WREPL_STATE_TOMBSTONE,
7054 .node = WREPL_NODE_B,
7056 .num_ips = ctx->addresses_best_num,
7057 .ips = ctx->addresses_best,
7058 .apply_expected = False
7062 * unique,active vs. sgroup,tombstone with different ip(s), unchecked
7065 .line = __location__,
7066 .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL),
7070 .num_ips = ctx->addresses_best_num,
7071 .ips = ctx->addresses_best,
7072 .apply_expected = True
7078 .type = WREPL_TYPE_SGROUP,
7079 .state = WREPL_STATE_TOMBSTONE,
7080 .node = WREPL_NODE_B,
7082 .num_ips = ARRAY_SIZE(addresses_B_1),
7083 .ips = addresses_B_1,
7084 .apply_expected = False
7088 * unique vs. multi homed section
7091 * unique,active vs. mhomed,active with same ip(s), unchecked
7094 .line = __location__,
7095 .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL),
7099 .num_ips = ctx->addresses_best_num,
7100 .ips = ctx->addresses_best,
7101 .apply_expected = True
7107 .type = WREPL_TYPE_MHOMED,
7108 .state = WREPL_STATE_ACTIVE,
7109 .node = WREPL_NODE_B,
7111 .num_ips = ctx->addresses_best_num,
7112 .ips = ctx->addresses_best,
7113 .apply_expected = True
7117 * unique,active vs. mhomed,active with superset ip(s), unchecked
7120 .line = __location__,
7121 .name = _NBT_NAME("_UA_MA_SP_U", 0x00, NULL),
7125 .num_ips = ctx->addresses_best_num,
7126 .ips = ctx->addresses_best,
7127 .apply_expected = True
7133 .type = WREPL_TYPE_MHOMED,
7134 .state = WREPL_STATE_ACTIVE,
7135 .node = WREPL_NODE_B,
7137 .num_ips = ctx->addresses_all_num,
7138 .ips = ctx->addresses_all,
7139 .apply_expected = True
7143 * unique,active vs. mhomed,active with different ip(s), positive response
7146 .line = __location__,
7147 .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL),
7151 .num_ips = ctx->addresses_best_num,
7152 .ips = ctx->addresses_best,
7153 .apply_expected = True
7160 .type = WREPL_TYPE_MHOMED,
7161 .state = WREPL_STATE_ACTIVE,
7162 .node = WREPL_NODE_B,
7164 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7165 .ips = addresses_B_3_4,
7166 .apply_expected = False
7170 * unique,active vs. mhomed,active with different ip(s), positive response other ips
7173 .line = __location__,
7174 .name = _NBT_NAME("_UA_MA_DI_O", 0x00, NULL),
7178 .num_ips = ctx->addresses_best_num,
7179 .ips = ctx->addresses_best,
7180 .apply_expected = True
7185 .num_ips = ARRAY_SIZE(addresses_A_3_4),
7186 .ips = addresses_A_3_4,
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 * unique,active vs. mhomed,active with different ip(s), negative response
7202 .line = __location__,
7203 .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL),
7207 .num_ips = ctx->addresses_best_num,
7208 .ips = ctx->addresses_best,
7209 .apply_expected = True
7216 .type = WREPL_TYPE_MHOMED,
7217 .state = WREPL_STATE_ACTIVE,
7218 .node = WREPL_NODE_B,
7220 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7221 .ips = addresses_B_3_4,
7222 .apply_expected = True
7226 * unique,active vs. mhomed,tombstone with same ip(s), unchecked
7229 .line = __location__,
7230 .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL),
7234 .num_ips = ctx->addresses_best_num,
7235 .ips = ctx->addresses_best,
7236 .apply_expected = True
7242 .type = WREPL_TYPE_MHOMED,
7243 .state = WREPL_STATE_TOMBSTONE,
7244 .node = WREPL_NODE_B,
7246 .num_ips = ctx->addresses_best_num,
7247 .ips = ctx->addresses_best,
7248 .apply_expected = False
7252 * unique,active vs. mhomed,tombstone with different ip(s), unchecked
7255 .line = __location__,
7256 .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL),
7260 .num_ips = ctx->addresses_best_num,
7261 .ips = ctx->addresses_best,
7262 .apply_expected = True
7268 .type = WREPL_TYPE_MHOMED,
7269 .state = WREPL_STATE_TOMBSTONE,
7270 .node = WREPL_NODE_B,
7272 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7273 .ips = addresses_B_3_4,
7274 .apply_expected = False
7278 * normal group vs. unique section
7281 * group,active vs. unique,active with same ip(s), unchecked
7284 .line = __location__,
7285 .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL),
7287 .nb_flags = NBT_NM_GROUP,
7289 .num_ips = ctx->addresses_best_num,
7290 .ips = ctx->addresses_best,
7291 .apply_expected = True
7297 .type = WREPL_TYPE_UNIQUE,
7298 .state = WREPL_STATE_ACTIVE,
7299 .node = WREPL_NODE_B,
7301 .num_ips = ctx->addresses_best_num,
7302 .ips = ctx->addresses_best,
7303 .apply_expected = False
7307 * group,active vs. unique,active with different ip(s), unchecked
7310 .line = __location__,
7311 .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL),
7313 .nb_flags = NBT_NM_GROUP,
7315 .num_ips = ctx->addresses_best_num,
7316 .ips = ctx->addresses_best,
7317 .apply_expected = True
7323 .type = WREPL_TYPE_UNIQUE,
7324 .state = WREPL_STATE_ACTIVE,
7325 .node = WREPL_NODE_B,
7327 .num_ips = ARRAY_SIZE(addresses_B_1),
7328 .ips = addresses_B_1,
7329 .apply_expected = False
7333 * group,active vs. unique,tombstone with same ip(s), unchecked
7336 .line = __location__,
7337 .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL),
7339 .nb_flags = NBT_NM_GROUP,
7341 .num_ips = ctx->addresses_best_num,
7342 .ips = ctx->addresses_best,
7343 .apply_expected = True
7349 .type = WREPL_TYPE_UNIQUE,
7350 .state = WREPL_STATE_TOMBSTONE,
7351 .node = WREPL_NODE_B,
7353 .num_ips = ctx->addresses_best_num,
7354 .ips = ctx->addresses_best,
7355 .apply_expected = False
7359 * group,active vs. unique,tombstone with different ip(s), unchecked
7362 .line = __location__,
7363 .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL),
7365 .nb_flags = NBT_NM_GROUP,
7367 .num_ips = ctx->addresses_best_num,
7368 .ips = ctx->addresses_best,
7369 .apply_expected = True
7375 .type = WREPL_TYPE_UNIQUE,
7376 .state = WREPL_STATE_TOMBSTONE,
7377 .node = WREPL_NODE_B,
7379 .num_ips = ARRAY_SIZE(addresses_B_1),
7380 .ips = addresses_B_1,
7381 .apply_expected = False
7385 * normal group vs. normal group section
7388 * group,active vs. group,active with same ip(s), unchecked
7391 .line = __location__,
7392 .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL),
7394 .nb_flags = NBT_NM_GROUP,
7396 .num_ips = ctx->addresses_best_num,
7397 .ips = ctx->addresses_best,
7398 .apply_expected = True
7404 .type = WREPL_TYPE_GROUP,
7405 .state = WREPL_STATE_ACTIVE,
7406 .node = WREPL_NODE_B,
7408 .num_ips = ctx->addresses_best_num,
7409 .ips = ctx->addresses_best,
7410 .apply_expected = True
7414 * group,active vs. group,active with different ip(s), unchecked
7417 .line = __location__,
7418 .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL),
7420 .nb_flags = NBT_NM_GROUP,
7422 .num_ips = ctx->addresses_best_num,
7423 .ips = ctx->addresses_best,
7424 .apply_expected = True
7430 .type = WREPL_TYPE_GROUP,
7431 .state = WREPL_STATE_ACTIVE,
7432 .node = WREPL_NODE_B,
7434 .num_ips = ARRAY_SIZE(addresses_B_1),
7435 .ips = addresses_B_1,
7436 .apply_expected = True
7440 * group,active vs. group,tombstone with same ip(s), unchecked
7443 .line = __location__,
7444 .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL),
7446 .nb_flags = NBT_NM_GROUP,
7448 .num_ips = ctx->addresses_best_num,
7449 .ips = ctx->addresses_best,
7450 .apply_expected = True
7456 .type = WREPL_TYPE_GROUP,
7457 .state = WREPL_STATE_TOMBSTONE,
7458 .node = WREPL_NODE_B,
7460 .num_ips = ctx->addresses_best_num,
7461 .ips = ctx->addresses_best,
7462 .apply_expected = False
7466 * group,active vs. group,tombstone with different ip(s), unchecked
7469 .line = __location__,
7470 .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL),
7472 .nb_flags = NBT_NM_GROUP,
7474 .num_ips = ctx->addresses_best_num,
7475 .ips = ctx->addresses_best,
7476 .apply_expected = True
7482 .type = WREPL_TYPE_GROUP,
7483 .state = WREPL_STATE_TOMBSTONE,
7484 .node = WREPL_NODE_B,
7486 .num_ips = ARRAY_SIZE(addresses_B_1),
7487 .ips = addresses_B_1,
7488 .apply_expected = False
7492 * normal group vs. special group section
7495 * group,active vs. sgroup,active with same ip(s), unchecked
7498 .line = __location__,
7499 .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL),
7501 .nb_flags = NBT_NM_GROUP,
7503 .num_ips = ctx->addresses_best_num,
7504 .ips = ctx->addresses_best,
7505 .apply_expected = True
7511 .type = WREPL_TYPE_SGROUP,
7512 .state = WREPL_STATE_ACTIVE,
7513 .node = WREPL_NODE_B,
7515 .num_ips = ctx->addresses_best_num,
7516 .ips = ctx->addresses_best,
7517 .apply_expected = False
7521 * group,active vs. sgroup,active with different ip(s), unchecked
7524 .line = __location__,
7525 .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL),
7527 .nb_flags = NBT_NM_GROUP,
7529 .num_ips = ctx->addresses_best_num,
7530 .ips = ctx->addresses_best,
7531 .apply_expected = True
7537 .type = WREPL_TYPE_SGROUP,
7538 .state = WREPL_STATE_ACTIVE,
7539 .node = WREPL_NODE_B,
7541 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7542 .ips = addresses_B_3_4,
7543 .apply_expected = False
7547 * group,active vs. sgroup,tombstone with same ip(s), unchecked
7550 .line = __location__,
7551 .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL),
7553 .nb_flags = NBT_NM_GROUP,
7555 .num_ips = ctx->addresses_best_num,
7556 .ips = ctx->addresses_best,
7557 .apply_expected = True
7563 .type = WREPL_TYPE_SGROUP,
7564 .state = WREPL_STATE_TOMBSTONE,
7565 .node = WREPL_NODE_B,
7567 .num_ips = ctx->addresses_best_num,
7568 .ips = ctx->addresses_best,
7569 .apply_expected = False
7573 * group,active vs. sgroup,tombstone with different ip(s), unchecked
7576 .line = __location__,
7577 .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL),
7579 .nb_flags = NBT_NM_GROUP,
7581 .num_ips = ctx->addresses_best_num,
7582 .ips = ctx->addresses_best,
7583 .apply_expected = True
7589 .type = WREPL_TYPE_SGROUP,
7590 .state = WREPL_STATE_TOMBSTONE,
7591 .node = WREPL_NODE_B,
7593 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7594 .ips = addresses_B_3_4,
7595 .apply_expected = False
7599 * normal group vs. multi homed section
7602 * group,active vs. mhomed,active with same ip(s), unchecked
7605 .line = __location__,
7606 .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL),
7608 .nb_flags = NBT_NM_GROUP,
7610 .num_ips = ctx->addresses_best_num,
7611 .ips = ctx->addresses_best,
7612 .apply_expected = True
7618 .type = WREPL_TYPE_MHOMED,
7619 .state = WREPL_STATE_ACTIVE,
7620 .node = WREPL_NODE_B,
7622 .num_ips = ctx->addresses_best_num,
7623 .ips = ctx->addresses_best,
7624 .apply_expected = False
7628 * group,active vs. mhomed,active with different ip(s), unchecked
7631 .line = __location__,
7632 .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL),
7634 .nb_flags = NBT_NM_GROUP,
7636 .num_ips = ctx->addresses_best_num,
7637 .ips = ctx->addresses_best,
7638 .apply_expected = True
7644 .type = WREPL_TYPE_MHOMED,
7645 .state = WREPL_STATE_ACTIVE,
7646 .node = WREPL_NODE_B,
7648 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7649 .ips = addresses_B_3_4,
7650 .apply_expected = False
7654 * group,active vs. mhomed,tombstone with same ip(s), unchecked
7657 .line = __location__,
7658 .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL),
7660 .nb_flags = NBT_NM_GROUP,
7662 .num_ips = ctx->addresses_best_num,
7663 .ips = ctx->addresses_best,
7664 .apply_expected = True
7670 .type = WREPL_TYPE_MHOMED,
7671 .state = WREPL_STATE_TOMBSTONE,
7672 .node = WREPL_NODE_B,
7674 .num_ips = ctx->addresses_best_num,
7675 .ips = ctx->addresses_best,
7676 .apply_expected = False
7680 * group,active vs. mhomed,tombstone with different ip(s), unchecked
7683 .line = __location__,
7684 .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL),
7686 .nb_flags = NBT_NM_GROUP,
7688 .num_ips = ctx->addresses_best_num,
7689 .ips = ctx->addresses_best,
7690 .apply_expected = True
7696 .type = WREPL_TYPE_MHOMED,
7697 .state = WREPL_STATE_TOMBSTONE,
7698 .node = WREPL_NODE_B,
7700 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7701 .ips = addresses_B_3_4,
7702 .apply_expected = False
7706 * special group vs. unique section
7709 * sgroup,active vs. unique,active with same ip(s), unchecked
7712 .line = __location__,
7713 .name = _NBT_NAME("_SA_UA_SI_U", 0x1C, NULL),
7715 .nb_flags = NBT_NM_GROUP,
7717 .num_ips = ctx->addresses_best_num,
7718 .ips = ctx->addresses_best,
7719 .apply_expected = True
7725 .type = WREPL_TYPE_UNIQUE,
7726 .state = WREPL_STATE_ACTIVE,
7727 .node = WREPL_NODE_B,
7729 .num_ips = ctx->addresses_best_num,
7730 .ips = ctx->addresses_best,
7731 .apply_expected = False
7735 * sgroup,active vs. unique,active with different ip(s), unchecked
7738 .line = __location__,
7739 .name = _NBT_NAME("_SA_UA_DI_U", 0x1C, NULL),
7741 .nb_flags = NBT_NM_GROUP,
7743 .num_ips = ctx->addresses_best_num,
7744 .ips = ctx->addresses_best,
7745 .apply_expected = True
7751 .type = WREPL_TYPE_UNIQUE,
7752 .state = WREPL_STATE_ACTIVE,
7753 .node = WREPL_NODE_B,
7755 .num_ips = ARRAY_SIZE(addresses_B_1),
7756 .ips = addresses_B_1,
7757 .apply_expected = False
7761 * sgroup,active vs. unique,tombstone with same ip(s), unchecked
7764 .line = __location__,
7765 .name = _NBT_NAME("_SA_UT_SI_U", 0x1C, NULL),
7767 .nb_flags = NBT_NM_GROUP,
7769 .num_ips = ctx->addresses_best_num,
7770 .ips = ctx->addresses_best,
7771 .apply_expected = True
7777 .type = WREPL_TYPE_UNIQUE,
7778 .state = WREPL_STATE_TOMBSTONE,
7779 .node = WREPL_NODE_B,
7781 .num_ips = ctx->addresses_best_num,
7782 .ips = ctx->addresses_best,
7783 .apply_expected = False
7787 * sgroup,active vs. unique,tombstone with different ip(s), unchecked
7790 .line = __location__,
7791 .name = _NBT_NAME("_SA_UT_DI_U", 0x1C, NULL),
7793 .nb_flags = NBT_NM_GROUP,
7795 .num_ips = ctx->addresses_best_num,
7796 .ips = ctx->addresses_best,
7797 .apply_expected = True
7803 .type = WREPL_TYPE_UNIQUE,
7804 .state = WREPL_STATE_TOMBSTONE,
7805 .node = WREPL_NODE_B,
7807 .num_ips = ARRAY_SIZE(addresses_B_1),
7808 .ips = addresses_B_1,
7809 .apply_expected = False
7813 * special group vs. normal group section
7816 * sgroup,active vs. group,active with same ip(s), unchecked
7819 .line = __location__,
7820 .name = _NBT_NAME("_SA_GA_SI_U", 0x1C, NULL),
7822 .nb_flags = NBT_NM_GROUP,
7824 .num_ips = ctx->addresses_best_num,
7825 .ips = ctx->addresses_best,
7826 .apply_expected = True
7832 .type = WREPL_TYPE_GROUP,
7833 .state = WREPL_STATE_ACTIVE,
7834 .node = WREPL_NODE_B,
7836 .num_ips = ctx->addresses_best_num,
7837 .ips = ctx->addresses_best,
7838 .apply_expected = False
7842 * sgroup,active vs. group,active with different ip(s), unchecked
7845 .line = __location__,
7846 .name = _NBT_NAME("_SA_GA_DI_U", 0x1C, NULL),
7848 .nb_flags = NBT_NM_GROUP,
7850 .num_ips = ctx->addresses_best_num,
7851 .ips = ctx->addresses_best,
7852 .apply_expected = True
7858 .type = WREPL_TYPE_GROUP,
7859 .state = WREPL_STATE_ACTIVE,
7860 .node = WREPL_NODE_B,
7862 .num_ips = ARRAY_SIZE(addresses_B_1),
7863 .ips = addresses_B_1,
7864 .apply_expected = False
7868 * sgroup,active vs. group,tombstone with same ip(s), unchecked
7871 .line = __location__,
7872 .name = _NBT_NAME("_SA_GT_SI_U", 0x1C, NULL),
7874 .nb_flags = NBT_NM_GROUP,
7876 .num_ips = ctx->addresses_best_num,
7877 .ips = ctx->addresses_best,
7878 .apply_expected = True
7884 .type = WREPL_TYPE_GROUP,
7885 .state = WREPL_STATE_TOMBSTONE,
7886 .node = WREPL_NODE_B,
7888 .num_ips = ctx->addresses_best_num,
7889 .ips = ctx->addresses_best,
7890 .apply_expected = False
7894 * sgroup,active vs. group,tombstone with different ip(s), unchecked
7897 .line = __location__,
7898 .name = _NBT_NAME("_SA_GT_DI_U", 0x1C, NULL),
7900 .nb_flags = NBT_NM_GROUP,
7902 .num_ips = ctx->addresses_best_num,
7903 .ips = ctx->addresses_best,
7904 .apply_expected = True
7910 .type = WREPL_TYPE_GROUP,
7911 .state = WREPL_STATE_TOMBSTONE,
7912 .node = WREPL_NODE_B,
7914 .num_ips = ARRAY_SIZE(addresses_B_1),
7915 .ips = addresses_B_1,
7916 .apply_expected = False
7920 * special group vs. multi homed section
7923 * sgroup,active vs. mhomed,active with same ip(s), unchecked
7926 .line = __location__,
7927 .name = _NBT_NAME("_SA_MA_SI_U", 0x1C, NULL),
7929 .nb_flags = NBT_NM_GROUP,
7931 .num_ips = ctx->addresses_best_num,
7932 .ips = ctx->addresses_best,
7933 .apply_expected = True
7939 .type = WREPL_TYPE_MHOMED,
7940 .state = WREPL_STATE_ACTIVE,
7941 .node = WREPL_NODE_B,
7943 .num_ips = ctx->addresses_best_num,
7944 .ips = ctx->addresses_best,
7945 .apply_expected = False
7949 * sgroup,active vs. mhomed,active with different ip(s), unchecked
7952 .line = __location__,
7953 .name = _NBT_NAME("_SA_MA_DI_U", 0x1C, NULL),
7955 .nb_flags = NBT_NM_GROUP,
7957 .num_ips = ctx->addresses_best_num,
7958 .ips = ctx->addresses_best,
7959 .apply_expected = True
7965 .type = WREPL_TYPE_MHOMED,
7966 .state = WREPL_STATE_ACTIVE,
7967 .node = WREPL_NODE_B,
7969 .num_ips = ARRAY_SIZE(addresses_B_1),
7970 .ips = addresses_B_1,
7971 .apply_expected = False
7975 * sgroup,active vs. mhomed,tombstone with same ip(s), unchecked
7978 .line = __location__,
7979 .name = _NBT_NAME("_SA_MT_SI_U", 0x1C, NULL),
7981 .nb_flags = NBT_NM_GROUP,
7983 .num_ips = ctx->addresses_best_num,
7984 .ips = ctx->addresses_best,
7985 .apply_expected = True
7991 .type = WREPL_TYPE_MHOMED,
7992 .state = WREPL_STATE_TOMBSTONE,
7993 .node = WREPL_NODE_B,
7995 .num_ips = ctx->addresses_best_num,
7996 .ips = ctx->addresses_best,
7997 .apply_expected = False
8001 * sgroup,active vs. mhomed,tombstone with different ip(s), unchecked
8004 .line = __location__,
8005 .name = _NBT_NAME("_SA_MT_DI_U", 0x1C, NULL),
8007 .nb_flags = NBT_NM_GROUP,
8009 .num_ips = ctx->addresses_best_num,
8010 .ips = ctx->addresses_best,
8011 .apply_expected = True
8017 .type = WREPL_TYPE_MHOMED,
8018 .state = WREPL_STATE_TOMBSTONE,
8019 .node = WREPL_NODE_B,
8021 .num_ips = ARRAY_SIZE(addresses_B_1),
8022 .ips = addresses_B_1,
8023 .apply_expected = False
8027 * multi homed vs. unique section
8030 * mhomed,active vs. unique,active with same ip(s), unchecked
8033 .line = __location__,
8034 .name = _NBT_NAME("_MA_UA_SI_U", 0x00, NULL),
8038 .num_ips = ctx->addresses_best_num,
8039 .ips = ctx->addresses_best,
8040 .apply_expected = True
8046 .type = WREPL_TYPE_UNIQUE,
8047 .state = WREPL_STATE_ACTIVE,
8048 .node = WREPL_NODE_B,
8050 .num_ips = ctx->addresses_best_num,
8051 .ips = ctx->addresses_best,
8052 .apply_expected = True
8056 * mhomed,active vs. unique,active with different ip(s), positive response
8059 .line = __location__,
8060 .name = _NBT_NAME("_MA_UA_DI_P", 0x00, NULL),
8064 .num_ips = ctx->addresses_best_num,
8065 .ips = ctx->addresses_best,
8066 .apply_expected = True
8073 .type = WREPL_TYPE_UNIQUE,
8074 .state = WREPL_STATE_ACTIVE,
8075 .node = WREPL_NODE_B,
8077 .num_ips = ARRAY_SIZE(addresses_B_1),
8078 .ips = addresses_B_1,
8079 .apply_expected = False
8083 * mhomed,active vs. unique,active with different ip(s), positive response other ips
8086 .line = __location__,
8087 .name = _NBT_NAME("_MA_UA_DI_O", 0x00, NULL),
8091 .num_ips = ctx->addresses_best_num,
8092 .ips = ctx->addresses_best,
8093 .apply_expected = True
8098 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8099 .ips = addresses_A_3_4,
8102 .type = WREPL_TYPE_UNIQUE,
8103 .state = WREPL_STATE_ACTIVE,
8104 .node = WREPL_NODE_B,
8106 .num_ips = ARRAY_SIZE(addresses_B_1),
8107 .ips = addresses_B_1,
8108 .apply_expected = False
8112 * mhomed,active vs. unique,active with different ip(s), negative response
8115 .line = __location__,
8116 .name = _NBT_NAME("_MA_UA_DI_N", 0x00, NULL),
8120 .num_ips = ctx->addresses_best_num,
8121 .ips = ctx->addresses_best,
8122 .apply_expected = True
8129 .type = WREPL_TYPE_UNIQUE,
8130 .state = WREPL_STATE_ACTIVE,
8131 .node = WREPL_NODE_B,
8133 .num_ips = ARRAY_SIZE(addresses_B_1),
8134 .ips = addresses_B_1,
8135 .apply_expected = True
8139 * mhomed,active vs. unique,tombstone with same ip(s), unchecked
8142 .line = __location__,
8143 .name = _NBT_NAME("_MA_UT_SI_U", 0x00, NULL),
8147 .num_ips = ctx->addresses_best_num,
8148 .ips = ctx->addresses_best,
8149 .apply_expected = True
8155 .type = WREPL_TYPE_UNIQUE,
8156 .state = WREPL_STATE_TOMBSTONE,
8157 .node = WREPL_NODE_B,
8159 .num_ips = ctx->addresses_best_num,
8160 .ips = ctx->addresses_best,
8161 .apply_expected = False
8165 * mhomed,active vs. unique,tombstone with different ip(s), unchecked
8168 .line = __location__,
8169 .name = _NBT_NAME("_MA_UT_DI_U", 0x00, NULL),
8173 .num_ips = ctx->addresses_best_num,
8174 .ips = ctx->addresses_best,
8175 .apply_expected = True
8181 .type = WREPL_TYPE_UNIQUE,
8182 .state = WREPL_STATE_TOMBSTONE,
8183 .node = WREPL_NODE_B,
8185 .num_ips = ARRAY_SIZE(addresses_B_1),
8186 .ips = addresses_B_1,
8187 .apply_expected = False
8191 * multi homed vs. normal group section
8194 * mhomed,active vs. group,active with same ip(s), release expected
8197 .line = __location__,
8198 .name = _NBT_NAME("_MA_GA_SI_R", 0x00, NULL),
8202 .num_ips = ctx->addresses_best_num,
8203 .ips = ctx->addresses_best,
8204 .apply_expected = True
8208 .expect_release = True,
8211 .type = WREPL_TYPE_GROUP,
8212 .state = WREPL_STATE_ACTIVE,
8213 .node = WREPL_NODE_B,
8215 .num_ips = ctx->addresses_best_num,
8216 .ips = ctx->addresses_best,
8217 .apply_expected = True
8221 * mhomed,active vs. group,active with different ip(s), release expected
8224 .line = __location__,
8225 .name = _NBT_NAME("_MA_GA_DI_R", 0x00, NULL),
8229 .num_ips = ctx->addresses_best_num,
8230 .ips = ctx->addresses_best,
8231 .apply_expected = True
8235 .expect_release = True,
8238 .type = WREPL_TYPE_GROUP,
8239 .state = WREPL_STATE_ACTIVE,
8240 .node = WREPL_NODE_B,
8242 .num_ips = ARRAY_SIZE(addresses_B_1),
8243 .ips = addresses_B_1,
8244 .apply_expected = True
8248 * mhomed,active vs. group,tombstone with same ip(s), unchecked
8251 .line = __location__,
8252 .name = _NBT_NAME("_MA_GT_SI_U", 0x00, NULL),
8256 .num_ips = ctx->addresses_best_num,
8257 .ips = ctx->addresses_best,
8258 .apply_expected = True
8264 .type = WREPL_TYPE_GROUP,
8265 .state = WREPL_STATE_TOMBSTONE,
8266 .node = WREPL_NODE_B,
8268 .num_ips = ctx->addresses_best_num,
8269 .ips = ctx->addresses_best,
8270 .apply_expected = False
8274 * mhomed,active vs. group,tombstone with different ip(s), unchecked
8277 .line = __location__,
8278 .name = _NBT_NAME("_MA_GT_DI_U", 0x00, NULL),
8282 .num_ips = ctx->addresses_best_num,
8283 .ips = ctx->addresses_best,
8284 .apply_expected = True
8290 .type = WREPL_TYPE_GROUP,
8291 .state = WREPL_STATE_TOMBSTONE,
8292 .node = WREPL_NODE_B,
8294 .num_ips = ARRAY_SIZE(addresses_B_1),
8295 .ips = addresses_B_1,
8296 .apply_expected = False
8300 * multi homed vs. special group section
8303 * mhomed,active vs. sgroup,active with same ip(s), release expected
8306 .line = __location__,
8307 .name = _NBT_NAME("_MA_SA_SI_R", 0x00, NULL),
8311 .num_ips = ctx->addresses_best_num,
8312 .ips = ctx->addresses_best,
8313 .apply_expected = True
8317 .expect_release = True,
8320 .type = WREPL_TYPE_SGROUP,
8321 .state = WREPL_STATE_ACTIVE,
8322 .node = WREPL_NODE_B,
8324 .num_ips = ctx->addresses_best_num,
8325 .ips = ctx->addresses_best,
8326 .apply_expected = True
8330 * mhomed,active vs. group,active with different ip(s), release expected
8333 .line = __location__,
8334 .name = _NBT_NAME("_MA_SA_DI_R", 0x00, NULL),
8338 .num_ips = ctx->addresses_best_num,
8339 .ips = ctx->addresses_best,
8340 .apply_expected = True
8344 .expect_release = True,
8347 .type = WREPL_TYPE_SGROUP,
8348 .state = WREPL_STATE_ACTIVE,
8349 .node = WREPL_NODE_B,
8351 .num_ips = ARRAY_SIZE(addresses_B_1),
8352 .ips = addresses_B_1,
8353 .apply_expected = True
8357 * mhomed,active vs. sgroup,tombstone with same ip(s), unchecked
8360 .line = __location__,
8361 .name = _NBT_NAME("_MA_ST_SI_U", 0x00, NULL),
8365 .num_ips = ctx->addresses_best_num,
8366 .ips = ctx->addresses_best,
8367 .apply_expected = True
8373 .type = WREPL_TYPE_SGROUP,
8374 .state = WREPL_STATE_TOMBSTONE,
8375 .node = WREPL_NODE_B,
8377 .num_ips = ctx->addresses_best_num,
8378 .ips = ctx->addresses_best,
8379 .apply_expected = False
8383 * mhomed,active vs. sgroup,tombstone with different ip(s), unchecked
8386 .line = __location__,
8387 .name = _NBT_NAME("_MA_ST_DI_U", 0x00, NULL),
8391 .num_ips = ctx->addresses_best_num,
8392 .ips = ctx->addresses_best,
8393 .apply_expected = True
8399 .type = WREPL_TYPE_SGROUP,
8400 .state = WREPL_STATE_TOMBSTONE,
8401 .node = WREPL_NODE_B,
8403 .num_ips = ARRAY_SIZE(addresses_B_1),
8404 .ips = addresses_B_1,
8405 .apply_expected = False
8409 * multi homed vs. multi homed section
8412 * mhomed,active vs. mhomed,active with same ip(s), unchecked
8415 .line = __location__,
8416 .name = _NBT_NAME("_MA_MA_SI_U", 0x00, NULL),
8420 .num_ips = ctx->addresses_best_num,
8421 .ips = ctx->addresses_best,
8422 .apply_expected = True
8428 .type = WREPL_TYPE_MHOMED,
8429 .state = WREPL_STATE_ACTIVE,
8430 .node = WREPL_NODE_B,
8432 .num_ips = ctx->addresses_best_num,
8433 .ips = ctx->addresses_best,
8434 .apply_expected = True
8438 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8441 .line = __location__,
8442 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8446 .num_ips = ctx->addresses_best_num,
8447 .ips = ctx->addresses_best,
8448 .apply_expected = True
8454 .type = WREPL_TYPE_MHOMED,
8455 .state = WREPL_STATE_ACTIVE,
8456 .node = WREPL_NODE_B,
8458 .num_ips = ctx->addresses_all_num,
8459 .ips = ctx->addresses_all,
8460 .apply_expected = True
8464 * mhomed,active vs. mhomed,active with different ip(s), positive response
8467 .line = __location__,
8468 .name = _NBT_NAME("_MA_MA_DI_P", 0x00, NULL),
8472 .num_ips = ctx->addresses_best_num,
8473 .ips = ctx->addresses_best,
8474 .apply_expected = True
8481 .type = WREPL_TYPE_MHOMED,
8482 .state = WREPL_STATE_ACTIVE,
8483 .node = WREPL_NODE_B,
8485 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8486 .ips = addresses_B_3_4,
8487 .apply_expected = False
8491 * mhomed,active vs. mhomed,active with different ip(s), positive response other ips
8494 .line = __location__,
8495 .name = _NBT_NAME("_MA_MA_DI_O", 0x00, NULL),
8499 .num_ips = ctx->addresses_best_num,
8500 .ips = ctx->addresses_best,
8501 .apply_expected = True
8506 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8507 .ips = addresses_A_3_4,
8510 .type = WREPL_TYPE_MHOMED,
8511 .state = WREPL_STATE_ACTIVE,
8512 .node = WREPL_NODE_B,
8514 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8515 .ips = addresses_B_3_4,
8516 .apply_expected = False
8520 * mhomed,active vs. mhomed,active with different ip(s), negative response
8523 .line = __location__,
8524 .name = _NBT_NAME("_MA_MA_DI_N", 0x00, NULL),
8528 .num_ips = ctx->addresses_best_num,
8529 .ips = ctx->addresses_best,
8530 .apply_expected = True
8537 .type = WREPL_TYPE_MHOMED,
8538 .state = WREPL_STATE_ACTIVE,
8539 .node = WREPL_NODE_B,
8541 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8542 .ips = addresses_B_3_4,
8543 .apply_expected = True
8547 * mhomed,active vs. mhomed,tombstone with same ip(s), unchecked
8550 .line = __location__,
8551 .name = _NBT_NAME("_MA_MT_SI_U", 0x00, NULL),
8555 .num_ips = ctx->addresses_best_num,
8556 .ips = ctx->addresses_best,
8557 .apply_expected = True
8563 .type = WREPL_TYPE_MHOMED,
8564 .state = WREPL_STATE_TOMBSTONE,
8565 .node = WREPL_NODE_B,
8567 .num_ips = ctx->addresses_best_num,
8568 .ips = ctx->addresses_best,
8569 .apply_expected = False
8573 * mhomed,active vs. mhomed,tombstone with different ip(s), unchecked
8576 .line = __location__,
8577 .name = _NBT_NAME("_MA_MT_DI_U", 0x00, NULL),
8581 .num_ips = ctx->addresses_best_num,
8582 .ips = ctx->addresses_best,
8583 .apply_expected = True
8589 .type = WREPL_TYPE_MHOMED,
8590 .state = WREPL_STATE_TOMBSTONE,
8591 .node = WREPL_NODE_B,
8593 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8594 .ips = addresses_B_3_4,
8595 .apply_expected = False
8599 * some more multi homed test, including merging
8602 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8605 .line = __location__,
8606 .section= "Test Replica vs. owned active: some more MHOMED combinations",
8607 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8608 .comment= "C:MHOMED vs. B:ALL => B:ALL",
8609 .skip = (ctx->addresses_all_num < 3),
8613 .num_ips = ctx->addresses_mhomed_num,
8614 .ips = ctx->addresses_mhomed,
8615 .apply_expected = True
8621 .type = WREPL_TYPE_MHOMED,
8622 .state = WREPL_STATE_ACTIVE,
8623 .node = WREPL_NODE_B,
8625 .num_ips = ctx->addresses_all_num,
8626 .ips = ctx->addresses_all,
8627 .apply_expected = True
8631 * mhomed,active vs. mhomed,active with same ips, unchecked
8634 .line = __location__,
8635 .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL),
8636 .comment= "C:MHOMED vs. B:MHOMED => B:MHOMED",
8637 .skip = (ctx->addresses_mhomed_num < 2),
8641 .num_ips = ctx->addresses_mhomed_num,
8642 .ips = ctx->addresses_mhomed,
8643 .apply_expected = True
8649 .type = WREPL_TYPE_MHOMED,
8650 .state = WREPL_STATE_ACTIVE,
8651 .node = WREPL_NODE_B,
8653 .num_ips = ctx->addresses_mhomed_num,
8654 .ips = ctx->addresses_mhomed,
8655 .apply_expected = True
8659 * mhomed,active vs. mhomed,active with subset ip(s), positive response
8662 .line = __location__,
8663 .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL),
8664 .comment= "C:MHOMED vs. B:BEST (C:MHOMED) => B:MHOMED",
8665 .skip = (ctx->addresses_mhomed_num < 2),
8669 .num_ips = ctx->addresses_mhomed_num,
8670 .ips = ctx->addresses_mhomed,
8671 .apply_expected = True
8678 .type = WREPL_TYPE_MHOMED,
8679 .state = WREPL_STATE_ACTIVE,
8680 .node = WREPL_NODE_B,
8682 .num_ips = ctx->addresses_best_num,
8683 .ips = ctx->addresses_best,
8684 .mhomed_merge = True
8688 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with all addresses
8691 .line = __location__,
8692 .name = _NBT_NAME("_MA_MA_SB_A", 0x00, NULL),
8693 .comment= "C:MHOMED vs. B:BEST (C:ALL) => B:MHOMED",
8694 .skip = (ctx->addresses_all_num < 3),
8698 .num_ips = ctx->addresses_mhomed_num,
8699 .ips = ctx->addresses_mhomed,
8700 .apply_expected = True
8705 .num_ips = ctx->addresses_all_num,
8706 .ips = ctx->addresses_all,
8709 .type = WREPL_TYPE_MHOMED,
8710 .state = WREPL_STATE_ACTIVE,
8711 .node = WREPL_NODE_B,
8713 .num_ips = ctx->addresses_best_num,
8714 .ips = ctx->addresses_best,
8715 .mhomed_merge = True
8719 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with replicas addresses
8720 * TODO: check why the server sends a name release demand for one address?
8721 * the release demand has no effect to the database record...
8724 .line = __location__,
8725 .name = _NBT_NAME("_MA_MA_SB_PRA", 0x00, NULL),
8726 .comment= "C:MHOMED vs. B:BEST (C:BEST) => C:MHOMED",
8727 .skip = (ctx->addresses_all_num < 2),
8731 .num_ips = ctx->addresses_mhomed_num,
8732 .ips = ctx->addresses_mhomed,
8733 .apply_expected = True
8738 .num_ips = ctx->addresses_best_num,
8739 .ips = ctx->addresses_best,
8740 .late_release = True
8743 .type = WREPL_TYPE_MHOMED,
8744 .state = WREPL_STATE_ACTIVE,
8745 .node = WREPL_NODE_B,
8747 .num_ips = ctx->addresses_best_num,
8748 .ips = ctx->addresses_best,
8749 .apply_expected = False
8753 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with other addresses
8756 .line = __location__,
8757 .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL),
8758 .comment= "C:MHOMED vs. B:BEST (B:B_3_4) =>C:MHOMED",
8759 .skip = (ctx->addresses_all_num < 2),
8763 .num_ips = ctx->addresses_mhomed_num,
8764 .ips = ctx->addresses_mhomed,
8765 .apply_expected = True
8770 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8771 .ips = addresses_B_3_4,
8774 .type = WREPL_TYPE_MHOMED,
8775 .state = WREPL_STATE_ACTIVE,
8776 .node = WREPL_NODE_B,
8778 .num_ips = ctx->addresses_best_num,
8779 .ips = ctx->addresses_best,
8780 .apply_expected = False
8784 * mhomed,active vs. mhomed,active with subset ip(s), negative response
8787 .line = __location__,
8788 .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL),
8789 .comment= "C:MHOMED vs. B:BEST (NEGATIVE) => B:BEST",
8790 .skip = (ctx->addresses_mhomed_num < 2),
8794 .num_ips = ctx->addresses_mhomed_num,
8795 .ips = ctx->addresses_mhomed,
8796 .apply_expected = True
8803 .type = WREPL_TYPE_MHOMED,
8804 .state = WREPL_STATE_ACTIVE,
8805 .node = WREPL_NODE_B,
8807 .num_ips = ctx->addresses_best_num,
8808 .ips = ctx->addresses_best,
8809 .apply_expected = True
8813 * some more multi homed and unique test, including merging
8816 * mhomed,active vs. unique,active with subset ip(s), positive response
8819 .line = __location__,
8820 .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations",
8821 .name = _NBT_NAME("_MA_UA_SB_P", 0x00, NULL),
8822 .comment= "C:MHOMED vs. B:UNIQUE,BEST (C:MHOMED) => B:MHOMED",
8823 .skip = (ctx->addresses_all_num < 2),
8827 .num_ips = ctx->addresses_mhomed_num,
8828 .ips = ctx->addresses_mhomed,
8829 .apply_expected = True
8836 .type = WREPL_TYPE_UNIQUE,
8837 .state = WREPL_STATE_ACTIVE,
8838 .node = WREPL_NODE_B,
8840 .num_ips = ctx->addresses_best_num,
8841 .ips = ctx->addresses_best,
8842 .mhomed_merge = True
8846 * unique,active vs. unique,active with different ip(s), positive response, with replicas address
8847 * TODO: check why the server sends a name release demand for one address?
8848 * the release demand has no effect to the database record...
8851 .line = __location__,
8852 .name = _NBT_NAME("_UA_UA_DI_PRA", 0x00, NULL),
8853 .comment= "C:BEST vs. B:BEST2 (C:BEST2,LR:BEST2) => C:BEST",
8854 .skip = (ctx->addresses_all_num < 2),
8858 .num_ips = ctx->addresses_best_num,
8859 .ips = ctx->addresses_best,
8860 .apply_expected = True
8865 .num_ips = ctx->addresses_best2_num,
8866 .ips = ctx->addresses_best2,
8867 .late_release = True
8870 .type = WREPL_TYPE_UNIQUE,
8871 .state = WREPL_STATE_ACTIVE,
8872 .node = WREPL_NODE_B,
8874 .num_ips = ctx->addresses_best2_num,
8875 .ips = ctx->addresses_best2,
8876 .apply_expected = False,
8880 * unique,active vs. unique,active with different ip(s), positive response, with all addresses
8883 .line = __location__,
8884 .name = _NBT_NAME("_UA_UA_DI_A", 0x00, NULL),
8885 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
8886 .skip = (ctx->addresses_all_num < 3),
8890 .num_ips = ctx->addresses_best_num,
8891 .ips = ctx->addresses_best,
8892 .apply_expected = True
8897 .num_ips = ctx->addresses_all_num,
8898 .ips = ctx->addresses_all,
8901 .type = WREPL_TYPE_UNIQUE,
8902 .state = WREPL_STATE_ACTIVE,
8903 .node = WREPL_NODE_B,
8905 .num_ips = ctx->addresses_best2_num,
8906 .ips = ctx->addresses_best2,
8907 .mhomed_merge = True,
8911 * unique,active vs. mhomed,active with different ip(s), positive response, with all addresses
8914 .line = __location__,
8915 .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL),
8916 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
8917 .skip = (ctx->addresses_all_num < 3),
8921 .num_ips = ctx->addresses_best_num,
8922 .ips = ctx->addresses_best,
8923 .apply_expected = True
8928 .num_ips = ctx->addresses_all_num,
8929 .ips = ctx->addresses_all,
8932 .type = WREPL_TYPE_MHOMED,
8933 .state = WREPL_STATE_ACTIVE,
8934 .node = WREPL_NODE_B,
8936 .num_ips = ctx->addresses_best2_num,
8937 .ips = ctx->addresses_best2,
8938 .mhomed_merge = True,
8942 * special group vs. special group merging section
8945 * sgroup,active vs. sgroup,active with different ip(s)
8948 .line = __location__,
8949 .section= "Test Replica vs. owned active: SGROUP vs. SGROUP tests",
8950 .name = _NBT_NAME("_SA_SA_DI_U", 0x1C, NULL),
8951 .skip = (ctx->addresses_all_num < 3),
8953 .nb_flags = NBT_NM_GROUP,
8955 .num_ips = ctx->addresses_mhomed_num,
8956 .ips = ctx->addresses_mhomed,
8957 .apply_expected = True
8963 .type = WREPL_TYPE_SGROUP,
8964 .state = WREPL_STATE_ACTIVE,
8965 .node = WREPL_NODE_B,
8967 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8968 .ips = addresses_B_3_4,
8969 .sgroup_merge = True
8973 * sgroup,active vs. sgroup,active with same ip(s)
8976 .line = __location__,
8977 .name = _NBT_NAME("_SA_SA_SI_U", 0x1C, NULL),
8978 .skip = (ctx->addresses_all_num < 3),
8980 .nb_flags = NBT_NM_GROUP,
8982 .num_ips = ctx->addresses_mhomed_num,
8983 .ips = ctx->addresses_mhomed,
8984 .apply_expected = True
8990 .type = WREPL_TYPE_SGROUP,
8991 .state = WREPL_STATE_ACTIVE,
8992 .node = WREPL_NODE_B,
8994 .num_ips = ctx->addresses_mhomed_num,
8995 .ips = ctx->addresses_mhomed,
8996 .sgroup_merge = True
9000 * sgroup,active vs. sgroup,active with superset ip(s)
9003 .line = __location__,
9004 .name = _NBT_NAME("_SA_SA_SP_U", 0x1C, NULL),
9005 .skip = (ctx->addresses_all_num < 3),
9007 .nb_flags = NBT_NM_GROUP,
9009 .num_ips = ctx->addresses_mhomed_num,
9010 .ips = ctx->addresses_mhomed,
9011 .apply_expected = True
9017 .type = WREPL_TYPE_SGROUP,
9018 .state = WREPL_STATE_ACTIVE,
9019 .node = WREPL_NODE_B,
9021 .num_ips = ctx->addresses_all_num,
9022 .ips = ctx->addresses_all,
9023 .sgroup_merge = True
9027 * sgroup,active vs. sgroup,active with subset ip(s)
9030 .line = __location__,
9031 .name = _NBT_NAME("_SA_SA_SB_U", 0x1C, NULL),
9032 .skip = (ctx->addresses_all_num < 3),
9034 .nb_flags = NBT_NM_GROUP,
9036 .num_ips = ctx->addresses_mhomed_num,
9037 .ips = ctx->addresses_mhomed,
9038 .apply_expected = True
9044 .type = WREPL_TYPE_SGROUP,
9045 .state = WREPL_STATE_ACTIVE,
9046 .node = WREPL_NODE_B,
9048 .num_ips = ctx->addresses_best_num,
9049 .ips = ctx->addresses_best,
9050 .sgroup_merge = True
9054 * sgroup,active vs. sgroup,tombstone with different ip(s)
9057 .line = __location__,
9058 .name = _NBT_NAME("_SA_ST_DI_U", 0x1C, NULL),
9059 .skip = (ctx->addresses_all_num < 3),
9061 .nb_flags = NBT_NM_GROUP,
9063 .num_ips = ctx->addresses_mhomed_num,
9064 .ips = ctx->addresses_mhomed,
9065 .apply_expected = True
9071 .type = WREPL_TYPE_SGROUP,
9072 .state = WREPL_STATE_TOMBSTONE,
9073 .node = WREPL_NODE_B,
9075 .num_ips = ARRAY_SIZE(addresses_B_3_4),
9076 .ips = addresses_B_3_4,
9077 .apply_expected = False
9081 * sgroup,active vs. sgroup,tombstone with same ip(s)
9084 .line = __location__,
9085 .name = _NBT_NAME("_SA_ST_SI_U", 0x1C, NULL),
9086 .skip = (ctx->addresses_all_num < 3),
9088 .nb_flags = NBT_NM_GROUP,
9090 .num_ips = ctx->addresses_mhomed_num,
9091 .ips = ctx->addresses_mhomed,
9092 .apply_expected = True
9098 .type = WREPL_TYPE_SGROUP,
9099 .state = WREPL_STATE_TOMBSTONE,
9100 .node = WREPL_NODE_B,
9102 .num_ips = ctx->addresses_mhomed_num,
9103 .ips = ctx->addresses_mhomed,
9104 .apply_expected = False
9108 * sgroup,active vs. sgroup,tombstone with superset ip(s)
9111 .line = __location__,
9112 .name = _NBT_NAME("_SA_ST_SP_U", 0x1C, NULL),
9113 .skip = (ctx->addresses_all_num < 3),
9115 .nb_flags = NBT_NM_GROUP,
9117 .num_ips = ctx->addresses_mhomed_num,
9118 .ips = ctx->addresses_mhomed,
9119 .apply_expected = True
9125 .type = WREPL_TYPE_SGROUP,
9126 .state = WREPL_STATE_TOMBSTONE,
9127 .node = WREPL_NODE_B,
9129 .num_ips = ctx->addresses_all_num,
9130 .ips = ctx->addresses_all,
9131 .apply_expected = False
9135 * sgroup,active vs. sgroup,tombstone with subset ip(s)
9138 .line = __location__,
9139 .name = _NBT_NAME("_SA_ST_SB_U", 0x1C, NULL),
9140 .skip = (ctx->addresses_all_num < 3),
9142 .nb_flags = NBT_NM_GROUP,
9144 .num_ips = ctx->addresses_mhomed_num,
9145 .ips = ctx->addresses_mhomed,
9146 .apply_expected = True
9152 .type = WREPL_TYPE_SGROUP,
9153 .state = WREPL_STATE_TOMBSTONE,
9154 .node = WREPL_NODE_B,
9156 .num_ips = ctx->addresses_best_num,
9157 .ips = ctx->addresses_best,
9158 .apply_expected = False
9163 if (!ctx->nbtsock_srv) {
9164 printf("SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
9169 printf("Test Replica records vs. owned active records\n");
9171 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
9173 struct test_conflict_owned_active_vs_replica_struct record = records[i];
9174 uint32_t j, count = 1;
9177 if (records[i].wins.mhomed || records[i].name.type == 0x1C) {
9178 count = records[i].wins.num_ips;
9181 if (records[i].section) {
9182 printf("%s\n", records[i].section);
9185 if (records[i].skip) {
9186 printf("%s => SKIPPED\n", nbt_name_string(ctx, &records[i].name));
9190 if (records[i].replica.mhomed_merge) {
9191 action = "MHOMED_MERGE";
9192 } else if (records[i].replica.sgroup_merge) {
9193 action = "SGROUP_MERGE";
9194 } else if (records[i].replica.apply_expected) {
9197 action = "NOT REPLACE";
9200 printf("%s%s%s => %s\n",
9201 nbt_name_string(ctx, &records[i].name),
9202 (records[i].comment?": ":""),
9203 (records[i].comment?records[i].comment:""),
9206 /* Prepare for multi homed registration */
9207 ZERO_STRUCT(records[i].defend);
9208 records[i].defend.timeout = 10;
9209 records[i].defend.positive = True;
9210 nbt_set_incoming_handler(ctx->nbtsock_srv,
9211 test_conflict_owned_active_vs_replica_handler,
9213 if (ctx->nbtsock_srv2) {
9214 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9215 test_conflict_owned_active_vs_replica_handler,
9222 for (j=0; j < count; j++) {
9223 struct nbt_name_request *req;
9225 name_register->in.name = records[i].name;
9226 name_register->in.dest_addr = ctx->address;
9227 name_register->in.address = records[i].wins.ips[j].ip;
9228 name_register->in.nb_flags = records[i].wins.nb_flags;
9229 name_register->in.register_demand= False;
9230 name_register->in.broadcast = False;
9231 name_register->in.multi_homed = records[i].wins.mhomed;
9232 name_register->in.ttl = 300000;
9233 name_register->in.timeout = 70;
9234 name_register->in.retries = 0;
9236 req = nbt_name_register_send(ctx->nbtsock, name_register);
9238 /* push the request on the wire */
9239 event_loop_once(ctx->nbtsock->event_ctx);
9242 * if we register multiple addresses,
9243 * the server will do name queries to see if the old addresses
9246 if (records[i].wins.mhomed && j > 0) {
9247 end = timeval_current_ofs(records[i].defend.timeout,0);
9248 records[i].defend.ret = True;
9249 while (records[i].defend.timeout > 0) {
9250 event_loop_once(ctx->nbtsock_srv->event_ctx);
9251 if (timeval_expired(&end)) break;
9253 ret &= records[i].defend.ret;
9256 status = nbt_name_register_recv(req, ctx, name_register);
9257 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9258 printf("No response from %s for name register\n", ctx->address);
9261 if (!NT_STATUS_IS_OK(status)) {
9262 printf("Bad response from %s for name register - %s\n",
9263 ctx->address, nt_errstr(status));
9266 CHECK_VALUE(name_register->out.rcode, 0);
9267 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
9268 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
9269 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
9270 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
9271 CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[j].ip);
9274 /* Prepare for the current test */
9275 records[i].defend = record.defend;
9276 nbt_set_incoming_handler(ctx->nbtsock_srv,
9277 test_conflict_owned_active_vs_replica_handler,
9279 if (ctx->nbtsock_srv2) {
9280 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9281 test_conflict_owned_active_vs_replica_handler,
9288 wins_name->name = &records[i].name;
9289 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
9290 records[i].replica.state,
9291 records[i].replica.node,
9292 records[i].replica.is_static);
9293 wins_name->id = ++ctx->b.max_version;
9294 if (wins_name->flags & 2) {
9295 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
9296 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
9298 wins_name->addresses.ip = records[i].replica.ips[0].ip;
9300 wins_name->unknown = "255.255.255.255";
9302 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9305 * wait for the name query, which is handled in
9306 * test_conflict_owned_active_vs_replica_handler()
9308 end = timeval_current_ofs(records[i].defend.timeout,0);
9309 records[i].defend.ret = True;
9310 while (records[i].defend.timeout > 0) {
9311 event_loop_once(ctx->nbtsock_srv->event_ctx);
9312 if (timeval_expired(&end)) break;
9314 ret &= records[i].defend.ret;
9316 if (records[i].defend.late_release) {
9317 records[i].defend = record.defend;
9318 records[i].defend.expect_release = True;
9320 * wait for the name release demand, which is handled in
9321 * test_conflict_owned_active_vs_replica_handler()
9323 end = timeval_current_ofs(records[i].defend.timeout,0);
9324 records[i].defend.ret = True;
9325 while (records[i].defend.timeout > 0) {
9326 event_loop_once(ctx->nbtsock_srv->event_ctx);
9327 if (timeval_expired(&end)) break;
9329 ret &= records[i].defend.ret;
9332 if (records[i].replica.mhomed_merge) {
9333 ret &= test_wrepl_mhomed_merged(ctx, &ctx->c,
9334 records[i].wins.num_ips, records[i].wins.ips,
9336 records[i].replica.num_ips, records[i].replica.ips,
9338 } else if (records[i].replica.sgroup_merge) {
9339 ret &= test_wrepl_sgroup_merged(ctx, NULL,
9341 records[i].wins.num_ips, records[i].wins.ips,
9343 records[i].replica.num_ips, records[i].replica.ips,
9346 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
9347 records[i].replica.apply_expected);
9350 if (records[i].replica.apply_expected ||
9351 records[i].replica.mhomed_merge) {
9352 wins_name->name = &records[i].name;
9353 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9354 WREPL_STATE_TOMBSTONE,
9355 WREPL_NODE_B, False);
9356 wins_name->id = ++ctx->b.max_version;
9357 wins_name->addresses.ip = addresses_B_1[0].ip;
9358 wins_name->unknown = "255.255.255.255";
9360 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9361 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
9363 for (j=0; j < count; j++) {
9364 struct nbt_name_socket *nbtsock = ctx->nbtsock;
9366 if (ctx->myaddr2 && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2->addr) == 0) {
9367 nbtsock = ctx->nbtsock2;
9370 release->in.name = records[i].name;
9371 release->in.dest_addr = ctx->address;
9372 release->in.address = records[i].wins.ips[j].ip;
9373 release->in.nb_flags = records[i].wins.nb_flags;
9374 release->in.broadcast = False;
9375 release->in.timeout = 30;
9376 release->in.retries = 0;
9378 status = nbt_name_release(nbtsock, ctx, release);
9379 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9380 printf("No response from %s for name release\n", ctx->address);
9383 if (!NT_STATUS_IS_OK(status)) {
9384 printf("Bad response from %s for name query - %s\n",
9385 ctx->address, nt_errstr(status));
9388 CHECK_VALUE(release->out.rcode, 0);
9391 if (records[i].replica.sgroup_merge) {
9392 /* clean up the SGROUP record */
9393 wins_name->name = &records[i].name;
9394 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9396 WREPL_NODE_B, False);
9397 wins_name->id = ++ctx->b.max_version;
9398 wins_name->addresses.addresses.num_ips = 0;
9399 wins_name->addresses.addresses.ips = NULL;
9400 wins_name->unknown = "255.255.255.255";
9401 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9403 /* take ownership of the SGROUP record */
9404 wins_name->name = &records[i].name;
9405 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9407 WREPL_NODE_B, False);
9408 wins_name->id = ++ctx->b.max_version;
9409 wins_name->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
9410 wins_name->addresses.addresses.ips = discard_const(addresses_B_1);
9411 wins_name->unknown = "255.255.255.255";
9412 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9413 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
9415 /* overwrite the SGROUP record with unique,tombstone */
9416 wins_name->name = &records[i].name;
9417 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9418 WREPL_STATE_TOMBSTONE,
9419 WREPL_NODE_B, False);
9420 wins_name->id = ++ctx->b.max_version;
9421 wins_name->addresses.ip = addresses_A_1[0].ip;
9422 wins_name->unknown = "255.255.255.255";
9423 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9424 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
9430 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
9438 #define _NBT_ASSERT(v, correct) do { \
9439 if ((v) != (correct)) { \
9440 printf("(%s) Incorrect value %s=%d - should be %s (%d)\n", \
9441 __location__, #v, v, #correct, correct); \
9446 #define _NBT_ASSERT_STRING(v, correct) do { \
9447 if ( ((!v) && (correct)) || \
9448 ((v) && (!correct)) || \
9449 ((v) && (correct) && strcmp(v,correct) != 0)) { \
9450 printf("(%s) Incorrect value %s=%s - should be %s\n", \
9451 __location__, #v, v, correct); \
9456 static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
9457 struct nbt_name_packet *req_packet,
9458 struct socket_address *src)
9460 struct nbt_name *name;
9461 struct nbt_name_packet *rep_packet;
9462 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9464 _NBT_ASSERT(req_packet->qdcount, 1);
9465 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9466 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9468 name = &req_packet->questions[0].name;
9470 _NBT_ASSERT(name->type, rec->name.type);
9471 _NBT_ASSERT_STRING(name->name, rec->name.name);
9472 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9474 _NBT_ASSERT(rec->defend.expect_release, False);
9476 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9477 if (rep_packet == NULL) return;
9479 rep_packet->name_trn_id = req_packet->name_trn_id;
9480 rep_packet->ancount = 1;
9482 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9483 if (rep_packet->answers == NULL) return;
9485 rep_packet->answers[0].name = *name;
9486 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9487 rep_packet->answers[0].ttl = 0;
9489 if (rec->defend.positive) {
9490 uint32_t i, num_ips;
9491 const struct wrepl_ip *ips;
9493 if (rec->defend.num_ips > 0) {
9494 num_ips = rec->defend.num_ips;
9495 ips = rec->defend.ips;
9497 num_ips = rec->wins.num_ips;
9498 ips = rec->wins.ips;
9501 /* send a positive reply */
9502 rep_packet->operation =
9505 NBT_FLAG_AUTHORITIVE |
9506 NBT_FLAG_RECURSION_DESIRED |
9507 NBT_FLAG_RECURSION_AVAIL;
9509 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9511 rep_packet->answers[0].rdata.netbios.length = num_ips*6;
9512 rep_packet->answers[0].rdata.netbios.addresses =
9513 talloc_array(rep_packet->answers, struct nbt_rdata_address, num_ips);
9514 if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return;
9516 for (i=0; i < num_ips; i++) {
9517 struct nbt_rdata_address *addr =
9518 &rep_packet->answers[0].rdata.netbios.addresses[i];
9519 addr->nb_flags = rec->wins.nb_flags;
9520 addr->ipaddr = ips[i].ip;
9522 DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
9523 nbt_name_string(rep_packet, name), src->addr, src->port));
9525 /* send a negative reply */
9526 rep_packet->operation =
9529 NBT_FLAG_AUTHORITIVE |
9532 rep_packet->answers[0].rr_type = NBT_QTYPE_NULL;
9534 ZERO_STRUCT(rep_packet->answers[0].rdata);
9536 DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
9537 nbt_name_string(rep_packet, name), src->addr, src->port));
9540 nbt_name_reply_send(nbtsock, src, rep_packet);
9541 talloc_free(rep_packet);
9543 /* make sure we push the reply to the wire */
9544 event_loop_once(nbtsock->event_ctx);
9547 rec->defend.timeout = 0;
9548 rec->defend.ret = True;
9551 static void test_conflict_owned_active_vs_replica_handler_release(struct nbt_name_socket *nbtsock,
9552 struct nbt_name_packet *req_packet,
9553 struct socket_address *src)
9555 struct nbt_name *name;
9556 struct nbt_name_packet *rep_packet;
9557 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9559 _NBT_ASSERT(req_packet->qdcount, 1);
9560 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9561 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9563 name = &req_packet->questions[0].name;
9565 _NBT_ASSERT(name->type, rec->name.type);
9566 _NBT_ASSERT_STRING(name->name, rec->name.name);
9567 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9569 _NBT_ASSERT(rec->defend.expect_release, True);
9571 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9572 if (rep_packet == NULL) return;
9574 rep_packet->name_trn_id = req_packet->name_trn_id;
9575 rep_packet->ancount = 1;
9576 rep_packet->operation =
9578 NBT_OPCODE_RELEASE |
9579 NBT_FLAG_AUTHORITIVE;
9581 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9582 if (rep_packet->answers == NULL) return;
9584 rep_packet->answers[0].name = *name;
9585 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9586 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9587 rep_packet->answers[0].ttl = req_packet->additional[0].ttl;
9588 rep_packet->answers[0].rdata = req_packet->additional[0].rdata;
9590 DEBUG(2,("Sending name release reply for %s to %s:%d\n",
9591 nbt_name_string(rep_packet, name), src->addr, src->port));
9593 nbt_name_reply_send(nbtsock, src, rep_packet);
9594 talloc_free(rep_packet);
9596 /* make sure we push the reply to the wire */
9597 event_loop_once(nbtsock->event_ctx);
9600 rec->defend.timeout = 0;
9601 rec->defend.ret = True;
9604 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
9605 struct nbt_name_packet *req_packet,
9606 struct socket_address *src)
9608 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9610 rec->defend.ret = False;
9612 switch (req_packet->operation & NBT_OPCODE) {
9613 case NBT_OPCODE_QUERY:
9614 test_conflict_owned_active_vs_replica_handler_query(nbtsock, req_packet, src);
9616 case NBT_OPCODE_RELEASE:
9617 test_conflict_owned_active_vs_replica_handler_release(nbtsock, req_packet, src);
9620 printf("%s: unexpected incoming packet\n", __location__);
9626 test simple WINS replication operations
9628 BOOL torture_nbt_winsreplication_simple(void)
9630 const char *address;
9631 struct nbt_name name;
9632 TALLOC_CTX *mem_ctx = talloc_new(NULL);
9636 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
9638 /* do an initial name resolution to find its IP */
9639 status = resolve_name(&name, mem_ctx, &address, NULL);
9640 if (!NT_STATUS_IS_OK(status)) {
9641 printf("Failed to resolve %s - %s\n",
9642 name.name, nt_errstr(status));
9643 talloc_free(mem_ctx);
9647 ret &= test_assoc_ctx1(mem_ctx, address);
9648 ret &= test_assoc_ctx2(mem_ctx, address);
9650 ret &= test_wins_replication(mem_ctx, address);
9652 talloc_free(mem_ctx);
9658 test WINS replication replica conflicts operations
9660 BOOL torture_nbt_winsreplication_replica(void)
9662 const char *address;
9663 struct nbt_name name;
9664 TALLOC_CTX *mem_ctx = talloc_new(NULL);
9667 struct test_wrepl_conflict_conn *ctx;
9669 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
9671 /* do an initial name resolution to find its IP */
9672 status = resolve_name(&name, mem_ctx, &address, NULL);
9673 if (!NT_STATUS_IS_OK(status)) {
9674 printf("Failed to resolve %s - %s\n",
9675 name.name, nt_errstr(status));
9676 talloc_free(mem_ctx);
9680 ctx = test_create_conflict_ctx(mem_ctx, address);
9681 if (!ctx) return False;
9683 ret &= test_conflict_same_owner(ctx);
9684 ret &= test_conflict_different_owner(ctx);
9686 talloc_free(mem_ctx);
9692 test WINS replication owned conflicts operations
9694 BOOL torture_nbt_winsreplication_owned(void)
9696 const char *address;
9697 struct nbt_name name;
9698 TALLOC_CTX *mem_ctx = talloc_new(NULL);
9701 struct test_wrepl_conflict_conn *ctx;
9703 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
9705 /* do an initial name resolution to find its IP */
9706 status = resolve_name(&name, mem_ctx, &address, NULL);
9707 if (!NT_STATUS_IS_OK(status)) {
9708 printf("Failed to resolve %s - %s\n",
9709 name.name, nt_errstr(status));
9710 talloc_free(mem_ctx);
9714 ctx = test_create_conflict_ctx(mem_ctx, address);
9715 if (!ctx) return False;
9717 ret &= test_conflict_owned_released_vs_replica(ctx);
9718 ret &= test_conflict_owned_active_vs_replica(ctx);
9720 talloc_free(mem_ctx);