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"
29 #define CHECK_STATUS(status, correct) do { \
30 if (!NT_STATUS_EQUAL(status, correct)) { \
31 printf("(%s) Incorrect status %s - should be %s\n", \
32 __location__, nt_errstr(status), nt_errstr(correct)); \
37 #define CHECK_VALUE(v, correct) do { \
38 if ((v) != (correct)) { \
39 printf("(%s) Incorrect value %s=%d - should be %d\n", \
40 __location__, #v, v, correct); \
45 #define CHECK_VALUE_UINT64(v, correct) do { \
46 if ((v) != (correct)) { \
47 printf("(%s) Incorrect value %s=%llu - should be %llu\n", \
48 __location__, #v, (long long)v, (long long)correct); \
53 #define CHECK_VALUE_STRING(v, correct) do { \
54 if ( ((!v) && (correct)) || \
55 ((v) && (!correct)) || \
56 ((v) && (correct) && strcmp(v,correct) != 0)) { \
57 printf("(%s) Incorrect value %s='%s' - should be '%s'\n", \
58 __location__, #v, v, correct); \
63 #define _NBT_NAME(n,t,s) {\
69 static const char *wrepl_name_type_string(enum wrepl_name_type type)
72 case WREPL_TYPE_UNIQUE: return "UNIQUE";
73 case WREPL_TYPE_GROUP: return "GROUP";
74 case WREPL_TYPE_SGROUP: return "SGROUP";
75 case WREPL_TYPE_MHOMED: return "MHOMED";
77 return "UNKNOWN_TYPE";
80 static const char *wrepl_name_state_string(enum wrepl_name_state state)
83 case WREPL_STATE_ACTIVE: return "ACTIVE";
84 case WREPL_STATE_RELEASED: return "RELEASED";
85 case WREPL_STATE_TOMBSTONE: return "TOMBSTONE";
86 case WREPL_STATE_RESERVED: return "RESERVED";
88 return "UNKNOWN_STATE";
92 test how assoc_ctx's are only usable on the connection
95 static BOOL test_assoc_ctx1(TALLOC_CTX *mem_ctx, const char *address)
98 struct wrepl_request *req;
99 struct wrepl_socket *wrepl_socket1;
100 struct wrepl_associate associate1;
101 struct wrepl_socket *wrepl_socket2;
102 struct wrepl_associate associate2;
103 struct wrepl_pull_table pull_table;
104 struct wrepl_packet packet;
105 struct wrepl_send_ctrl ctrl;
106 struct wrepl_packet *rep_packet;
107 struct wrepl_associate_stop assoc_stop;
110 if (!lp_parm_bool(-1, "torture", "dangerous", False)) {
111 printf("winsrepl: cross connection assoc_ctx usage disabled - enable dangerous tests to use\n");
115 printf("Test if assoc_ctx is only valid on the conection it was created on\n");
117 wrepl_socket1 = wrepl_socket_init(mem_ctx, NULL);
118 wrepl_socket2 = wrepl_socket_init(mem_ctx, NULL);
120 printf("Setup 2 wrepl connections\n");
121 status = wrepl_connect(wrepl_socket1, NULL, address);
122 CHECK_STATUS(status, NT_STATUS_OK);
124 status = wrepl_connect(wrepl_socket2, NULL, address);
125 CHECK_STATUS(status, NT_STATUS_OK);
127 printf("Send a start association request (conn1)\n");
128 status = wrepl_associate(wrepl_socket1, &associate1);
129 CHECK_STATUS(status, NT_STATUS_OK);
131 printf("association context (conn1): 0x%x\n", associate1.out.assoc_ctx);
133 printf("Send a start association request (conn2)\n");
134 status = wrepl_associate(wrepl_socket2, &associate2);
135 CHECK_STATUS(status, NT_STATUS_OK);
137 printf("association context (conn2): 0x%x\n", associate2.out.assoc_ctx);
139 printf("Send a replication table query, with assoc 1 (conn2), the anwser should be on conn1\n");
141 packet.opcode = WREPL_OPCODE_BITS;
142 packet.assoc_ctx = associate1.out.assoc_ctx;
143 packet.mess_type = WREPL_REPLICATION;
144 packet.message.replication.command = WREPL_REPL_TABLE_QUERY;
146 ctrl.send_only = True;
147 req = wrepl_request_send(wrepl_socket2, &packet, &ctrl);
148 status = wrepl_request_recv(req, mem_ctx, &rep_packet);
149 CHECK_STATUS(status, NT_STATUS_OK);
151 printf("Send a association request (conn2), to make sure the last request was ignored\n");
152 status = wrepl_associate(wrepl_socket2, &associate2);
153 CHECK_STATUS(status, NT_STATUS_OK);
155 printf("Send a replication table query, with invalid assoc (conn1), receive answer from conn2\n");
156 pull_table.in.assoc_ctx = 0;
157 req = wrepl_pull_table_send(wrepl_socket1, &pull_table);
158 status = wrepl_request_recv(req, mem_ctx, &rep_packet);
159 CHECK_STATUS(status, NT_STATUS_OK);
161 printf("Send a association request (conn1), to make sure the last request was handled correct\n");
162 status = wrepl_associate(wrepl_socket1, &associate2);
163 CHECK_STATUS(status, NT_STATUS_OK);
165 assoc_stop.in.assoc_ctx = associate1.out.assoc_ctx;
166 assoc_stop.in.reason = 4;
167 printf("Send a association stop request (conn1), reson: %u\n", assoc_stop.in.reason);
168 status = wrepl_associate_stop(wrepl_socket1, &assoc_stop);
169 CHECK_STATUS(status, NT_STATUS_END_OF_FILE);
171 assoc_stop.in.assoc_ctx = associate2.out.assoc_ctx;
172 assoc_stop.in.reason = 0;
173 printf("Send a association stop request (conn2), reson: %u\n", assoc_stop.in.reason);
174 status = wrepl_associate_stop(wrepl_socket2, &assoc_stop);
175 CHECK_STATUS(status, NT_STATUS_OK);
178 printf("Close 2 wrepl connections\n");
179 talloc_free(wrepl_socket1);
180 talloc_free(wrepl_socket2);
185 test if we always get back the same assoc_ctx
187 static BOOL test_assoc_ctx2(TALLOC_CTX *mem_ctx, const char *address)
190 struct wrepl_socket *wrepl_socket;
191 struct wrepl_associate associate;
195 printf("Test if we always get back the same assoc_ctx\n");
197 wrepl_socket = wrepl_socket_init(mem_ctx, NULL);
199 printf("Setup wrepl connections\n");
200 status = wrepl_connect(wrepl_socket, NULL, address);
201 CHECK_STATUS(status, NT_STATUS_OK);
204 printf("Send 1st start association request\n");
205 status = wrepl_associate(wrepl_socket, &associate);
206 CHECK_STATUS(status, NT_STATUS_OK);
207 assoc_ctx1 = associate.out.assoc_ctx;
208 printf("1st association context: 0x%x\n", associate.out.assoc_ctx);
210 printf("Send 2nd start association request\n");
211 status = wrepl_associate(wrepl_socket, &associate);
212 CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1);
213 CHECK_STATUS(status, NT_STATUS_OK);
214 printf("2nd association context: 0x%x\n", associate.out.assoc_ctx);
216 printf("Send 3rd start association request\n");
217 status = wrepl_associate(wrepl_socket, &associate);
218 CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1);
219 CHECK_STATUS(status, NT_STATUS_OK);
220 printf("3rd association context: 0x%x\n", associate.out.assoc_ctx);
223 printf("Close wrepl connections\n");
224 talloc_free(wrepl_socket);
230 display a replication entry
232 static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_name *name)
236 printf("%s\n", nbt_name_string(mem_ctx, &name->name));
237 printf("\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n",
238 name->type, name->state, name->node, name->is_static, (long long)name->version_id);
239 printf("\tRAW_FLAGS: 0x%08X OWNER: %-15s\n",
240 name->raw_flags, name->owner);
241 for (i=0;i<name->num_addresses;i++) {
242 printf("\tADDR: %-15s OWNER: %-15s\n",
243 name->addresses[i].address, name->addresses[i].owner);
248 test a full replication dump from a WINS server
250 static BOOL test_wins_replication(TALLOC_CTX *mem_ctx, const char *address)
253 struct wrepl_socket *wrepl_socket;
256 struct wrepl_associate associate;
257 struct wrepl_pull_table pull_table;
258 struct wrepl_pull_names pull_names;
260 printf("Test one pull replication cycle\n");
262 wrepl_socket = wrepl_socket_init(mem_ctx, NULL);
264 printf("Setup wrepl connections\n");
265 status = wrepl_connect(wrepl_socket, NULL, address);
266 CHECK_STATUS(status, NT_STATUS_OK);
268 printf("Send a start association request\n");
270 status = wrepl_associate(wrepl_socket, &associate);
271 CHECK_STATUS(status, NT_STATUS_OK);
273 printf("association context: 0x%x\n", associate.out.assoc_ctx);
275 printf("Send a replication table query\n");
276 pull_table.in.assoc_ctx = associate.out.assoc_ctx;
278 status = wrepl_pull_table(wrepl_socket, mem_ctx, &pull_table);
279 if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) {
280 struct wrepl_packet packet;
281 struct wrepl_request *req;
284 packet.opcode = WREPL_OPCODE_BITS;
285 packet.assoc_ctx = associate.out.assoc_ctx;
286 packet.mess_type = WREPL_STOP_ASSOCIATION;
287 packet.message.stop.reason = 0;
289 req = wrepl_request_send(wrepl_socket, &packet, NULL);
292 printf("failed - We are not a valid pull partner for the server\n");
296 CHECK_STATUS(status, NT_STATUS_OK);
298 printf("Found %d replication partners\n", pull_table.out.num_partners);
300 for (i=0;i<pull_table.out.num_partners;i++) {
301 struct wrepl_wins_owner *partner = &pull_table.out.partners[i];
302 printf("%s max_version=%6llu min_version=%6llu type=%d\n",
304 (long long)partner->max_version,
305 (long long)partner->min_version,
308 pull_names.in.assoc_ctx = associate.out.assoc_ctx;
309 pull_names.in.partner = *partner;
311 status = wrepl_pull_names(wrepl_socket, mem_ctx, &pull_names);
312 CHECK_STATUS(status, NT_STATUS_OK);
314 printf("Received %d names\n", pull_names.out.num_names);
316 for (j=0;j<pull_names.out.num_names;j++) {
317 display_entry(mem_ctx, &pull_names.out.names[j]);
322 printf("Close wrepl connections\n");
323 talloc_free(wrepl_socket);
327 struct test_wrepl_conflict_conn {
329 struct wrepl_socket *pull;
332 #define TEST_OWNER_A_ADDRESS "127.65.65.1"
333 #define TEST_ADDRESS_A_PREFIX "127.0.65"
334 #define TEST_OWNER_B_ADDRESS "127.66.66.1"
335 #define TEST_ADDRESS_B_PREFIX "127.0.66"
336 #define TEST_OWNER_X_ADDRESS "127.88.88.1"
337 #define TEST_ADDRESS_X_PREFIX "127.0.88"
339 struct wrepl_wins_owner a, b, c, x;
341 struct socket_address *myaddr;
342 struct socket_address *myaddr2;
343 struct nbt_name_socket *nbtsock;
344 struct nbt_name_socket *nbtsock2;
346 struct nbt_name_socket *nbtsock_srv;
347 struct nbt_name_socket *nbtsock_srv2;
349 uint32_t addresses_best_num;
350 struct wrepl_ip *addresses_best;
352 uint32_t addresses_best2_num;
353 struct wrepl_ip *addresses_best2;
355 uint32_t addresses_all_num;
356 struct wrepl_ip *addresses_all;
358 uint32_t addresses_mhomed_num;
359 struct wrepl_ip *addresses_mhomed;
362 static const struct wrepl_ip addresses_A_1[] = {
364 .owner = TEST_OWNER_A_ADDRESS,
365 .ip = TEST_ADDRESS_A_PREFIX".1"
368 static const struct wrepl_ip addresses_A_2[] = {
370 .owner = TEST_OWNER_A_ADDRESS,
371 .ip = TEST_ADDRESS_A_PREFIX".2"
374 static const struct wrepl_ip addresses_A_3_4[] = {
376 .owner = TEST_OWNER_A_ADDRESS,
377 .ip = TEST_ADDRESS_A_PREFIX".3"
380 .owner = TEST_OWNER_A_ADDRESS,
381 .ip = TEST_ADDRESS_A_PREFIX".4"
384 static const struct wrepl_ip addresses_A_3_4_X_3_4[] = {
386 .owner = TEST_OWNER_A_ADDRESS,
387 .ip = TEST_ADDRESS_A_PREFIX".3"
390 .owner = TEST_OWNER_A_ADDRESS,
391 .ip = TEST_ADDRESS_A_PREFIX".4"
394 .owner = TEST_OWNER_X_ADDRESS,
395 .ip = TEST_ADDRESS_X_PREFIX".3"
398 .owner = TEST_OWNER_X_ADDRESS,
399 .ip = TEST_ADDRESS_X_PREFIX".4"
402 static const struct wrepl_ip addresses_A_3_4_B_3_4[] = {
404 .owner = TEST_OWNER_A_ADDRESS,
405 .ip = TEST_ADDRESS_A_PREFIX".3"
408 .owner = TEST_OWNER_A_ADDRESS,
409 .ip = TEST_ADDRESS_A_PREFIX".4"
412 .owner = TEST_OWNER_B_ADDRESS,
413 .ip = TEST_ADDRESS_B_PREFIX".3"
416 .owner = TEST_OWNER_B_ADDRESS,
417 .ip = TEST_ADDRESS_B_PREFIX".4"
420 static const struct wrepl_ip addresses_A_3_4_OWNER_B[] = {
422 .owner = TEST_OWNER_B_ADDRESS,
423 .ip = TEST_ADDRESS_A_PREFIX".3"
426 .owner = TEST_OWNER_B_ADDRESS,
427 .ip = TEST_ADDRESS_A_PREFIX".4"
430 static const struct wrepl_ip addresses_A_3_4_X_3_4_OWNER_B[] = {
432 .owner = TEST_OWNER_B_ADDRESS,
433 .ip = TEST_ADDRESS_A_PREFIX".3"
436 .owner = TEST_OWNER_B_ADDRESS,
437 .ip = TEST_ADDRESS_A_PREFIX".4"
440 .owner = TEST_OWNER_B_ADDRESS,
441 .ip = TEST_ADDRESS_X_PREFIX".3"
444 .owner = TEST_OWNER_B_ADDRESS,
445 .ip = TEST_ADDRESS_X_PREFIX".4"
449 static const struct wrepl_ip addresses_A_3_4_X_1_2[] = {
451 .owner = TEST_OWNER_A_ADDRESS,
452 .ip = TEST_ADDRESS_A_PREFIX".3"
455 .owner = TEST_OWNER_A_ADDRESS,
456 .ip = TEST_ADDRESS_A_PREFIX".4"
459 .owner = TEST_OWNER_X_ADDRESS,
460 .ip = TEST_ADDRESS_X_PREFIX".1"
463 .owner = TEST_OWNER_X_ADDRESS,
464 .ip = TEST_ADDRESS_X_PREFIX".2"
468 static const struct wrepl_ip addresses_B_1[] = {
470 .owner = TEST_OWNER_B_ADDRESS,
471 .ip = TEST_ADDRESS_B_PREFIX".1"
474 static const struct wrepl_ip addresses_B_2[] = {
476 .owner = TEST_OWNER_B_ADDRESS,
477 .ip = TEST_ADDRESS_B_PREFIX".2"
480 static const struct wrepl_ip addresses_B_3_4[] = {
482 .owner = TEST_OWNER_B_ADDRESS,
483 .ip = TEST_ADDRESS_B_PREFIX".3"
486 .owner = TEST_OWNER_B_ADDRESS,
487 .ip = TEST_ADDRESS_B_PREFIX".4"
490 static const struct wrepl_ip addresses_B_3_4_X_3_4[] = {
492 .owner = TEST_OWNER_B_ADDRESS,
493 .ip = TEST_ADDRESS_B_PREFIX".3"
496 .owner = TEST_OWNER_B_ADDRESS,
497 .ip = TEST_ADDRESS_B_PREFIX".4"
500 .owner = TEST_OWNER_X_ADDRESS,
501 .ip = TEST_ADDRESS_X_PREFIX".3"
504 .owner = TEST_OWNER_X_ADDRESS,
505 .ip = TEST_ADDRESS_X_PREFIX".4"
508 static const struct wrepl_ip addresses_B_3_4_X_1_2[] = {
510 .owner = TEST_OWNER_B_ADDRESS,
511 .ip = TEST_ADDRESS_B_PREFIX".3"
514 .owner = TEST_OWNER_B_ADDRESS,
515 .ip = TEST_ADDRESS_B_PREFIX".4"
518 .owner = TEST_OWNER_X_ADDRESS,
519 .ip = TEST_ADDRESS_X_PREFIX".1"
522 .owner = TEST_OWNER_X_ADDRESS,
523 .ip = TEST_ADDRESS_X_PREFIX".2"
527 static const struct wrepl_ip addresses_X_1_2[] = {
529 .owner = TEST_OWNER_X_ADDRESS,
530 .ip = TEST_ADDRESS_X_PREFIX".1"
533 .owner = TEST_OWNER_X_ADDRESS,
534 .ip = TEST_ADDRESS_X_PREFIX".2"
537 static const struct wrepl_ip addresses_X_3_4[] = {
539 .owner = TEST_OWNER_X_ADDRESS,
540 .ip = TEST_ADDRESS_X_PREFIX".3"
543 .owner = TEST_OWNER_X_ADDRESS,
544 .ip = TEST_ADDRESS_X_PREFIX".4"
548 static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem_ctx,
551 struct test_wrepl_conflict_conn *ctx;
552 struct wrepl_associate associate;
553 struct wrepl_pull_table pull_table;
554 struct socket_address *nbt_srv_addr;
558 ctx = talloc_zero(mem_ctx, struct test_wrepl_conflict_conn);
559 if (!ctx) return NULL;
561 ctx->address = address;
562 ctx->pull = wrepl_socket_init(ctx, NULL);
563 if (!ctx->pull) return NULL;
565 printf("Setup wrepl conflict pull connection\n");
566 status = wrepl_connect(ctx->pull, NULL, ctx->address);
567 if (!NT_STATUS_IS_OK(status)) return NULL;
569 status = wrepl_associate(ctx->pull, &associate);
570 if (!NT_STATUS_IS_OK(status)) return NULL;
572 ctx->pull_assoc = associate.out.assoc_ctx;
574 ctx->a.address = TEST_OWNER_A_ADDRESS;
575 ctx->a.max_version = 0;
576 ctx->a.min_version = 0;
579 ctx->b.address = TEST_OWNER_B_ADDRESS;
580 ctx->b.max_version = 0;
581 ctx->b.min_version = 0;
584 ctx->x.address = TEST_OWNER_X_ADDRESS;
585 ctx->x.max_version = 0;
586 ctx->x.min_version = 0;
589 ctx->c.address = address;
590 ctx->c.max_version = 0;
591 ctx->c.min_version = 0;
594 pull_table.in.assoc_ctx = ctx->pull_assoc;
595 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
596 if (!NT_STATUS_IS_OK(status)) return NULL;
598 for (i=0; i < pull_table.out.num_partners; i++) {
599 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
600 ctx->a.max_version = pull_table.out.partners[i].max_version;
601 ctx->a.min_version = pull_table.out.partners[i].min_version;
603 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
604 ctx->b.max_version = pull_table.out.partners[i].max_version;
605 ctx->b.min_version = pull_table.out.partners[i].min_version;
607 if (strcmp(TEST_OWNER_X_ADDRESS,pull_table.out.partners[i].address)==0) {
608 ctx->x.max_version = pull_table.out.partners[i].max_version;
609 ctx->x.min_version = pull_table.out.partners[i].min_version;
611 if (strcmp(address,pull_table.out.partners[i].address)==0) {
612 ctx->c.max_version = pull_table.out.partners[i].max_version;
613 ctx->c.min_version = pull_table.out.partners[i].min_version;
617 talloc_free(pull_table.out.partners);
619 ctx->nbtsock = nbt_name_socket_init(ctx, NULL);
620 if (!ctx->nbtsock) return NULL;
622 ctx->myaddr = socket_address_from_strings(mem_ctx, ctx->nbtsock->sock->backend_name, iface_best_ip(address), 0);
623 if (!ctx->myaddr) return NULL;
625 for (i = 0; i < iface_count(); i++) {
626 if (strcmp(ctx->myaddr->addr, iface_n_ip(i)) == 0) continue;
627 ctx->myaddr2 = socket_address_from_strings(mem_ctx, ctx->nbtsock->sock->backend_name, iface_n_ip(i), 0);
628 if (!ctx->myaddr2) return NULL;
632 status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0);
633 if (!NT_STATUS_IS_OK(status)) return NULL;
635 ctx->nbtsock_srv = nbt_name_socket_init(ctx, NULL);
636 if (!ctx->nbtsock_srv) return NULL;
638 /* Make a port 137 version of ctx->myaddr */
639 nbt_srv_addr = socket_address_from_strings(mem_ctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lp_nbt_port());
640 if (!nbt_srv_addr) return NULL;
642 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
643 status = socket_listen(ctx->nbtsock_srv->sock, nbt_srv_addr, 0, 0);
644 talloc_free(nbt_srv_addr);
645 if (!NT_STATUS_IS_OK(status)) {
646 /* this isn't fatal */
647 talloc_free(ctx->nbtsock_srv);
648 ctx->nbtsock_srv = NULL;
651 if (ctx->myaddr2 && ctx->nbtsock_srv) {
652 ctx->nbtsock2 = nbt_name_socket_init(ctx, NULL);
653 if (!ctx->nbtsock2) return NULL;
655 status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0);
656 if (!NT_STATUS_IS_OK(status)) return NULL;
658 ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx);
659 if (!ctx->nbtsock_srv2) return NULL;
661 /* Make a port 137 version of ctx->myaddr2 */
662 nbt_srv_addr = socket_address_from_strings(mem_ctx,
663 ctx->nbtsock_srv->sock->backend_name,
664 ctx->myaddr2->addr, lp_nbt_port());
665 if (!nbt_srv_addr) return NULL;
667 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
668 status = socket_listen(ctx->nbtsock_srv2->sock, ctx->myaddr2, 0, 0);
669 talloc_free(nbt_srv_addr);
670 if (!NT_STATUS_IS_OK(status)) {
671 /* this isn't fatal */
672 talloc_free(ctx->nbtsock_srv2);
673 ctx->nbtsock_srv2 = NULL;
677 ctx->addresses_best_num = 1;
678 ctx->addresses_best = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best_num);
679 if (!ctx->addresses_best) return NULL;
680 ctx->addresses_best[0].owner = ctx->b.address;
681 ctx->addresses_best[0].ip = ctx->myaddr->addr;
683 ctx->addresses_all_num = iface_count();
684 ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num);
685 if (!ctx->addresses_all) return NULL;
686 for (i=0; i < ctx->addresses_all_num; i++) {
687 ctx->addresses_all[i].owner = ctx->b.address;
688 ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(i));
689 if (!ctx->addresses_all[i].ip) return NULL;
692 if (ctx->nbtsock_srv2) {
693 ctx->addresses_best2_num = 1;
694 ctx->addresses_best2 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best2_num);
695 if (!ctx->addresses_best2) return NULL;
696 ctx->addresses_best2[0].owner = ctx->b.address;
697 ctx->addresses_best2[0].ip = ctx->myaddr2->addr;
699 ctx->addresses_mhomed_num = 2;
700 ctx->addresses_mhomed = talloc_array(ctx, struct wrepl_ip, ctx->addresses_mhomed_num);
701 if (!ctx->addresses_mhomed) return NULL;
702 ctx->addresses_mhomed[0].owner = ctx->b.address;
703 ctx->addresses_mhomed[0].ip = ctx->myaddr->addr;
704 ctx->addresses_mhomed[1].owner = ctx->b.address;
705 ctx->addresses_mhomed[1].ip = ctx->myaddr2->addr;
711 static BOOL test_wrepl_update_one(struct test_wrepl_conflict_conn *ctx,
712 const struct wrepl_wins_owner *owner,
713 const struct wrepl_wins_name *name)
716 struct wrepl_socket *wrepl_socket;
717 struct wrepl_associate associate;
718 struct wrepl_packet update_packet, repl_send;
719 struct wrepl_table *update;
720 struct wrepl_wins_owner wrepl_wins_owners[1];
721 struct wrepl_packet *repl_recv;
722 struct wrepl_wins_owner *send_request;
723 struct wrepl_send_reply *send_reply;
724 struct wrepl_wins_name wrepl_wins_names[1];
728 wrepl_socket = wrepl_socket_init(ctx, NULL);
730 status = wrepl_connect(wrepl_socket, NULL, ctx->address);
731 CHECK_STATUS(status, NT_STATUS_OK);
733 status = wrepl_associate(wrepl_socket, &associate);
734 CHECK_STATUS(status, NT_STATUS_OK);
735 assoc_ctx = associate.out.assoc_ctx;
737 /* now send a WREPL_REPL_UPDATE message */
738 ZERO_STRUCT(update_packet);
739 update_packet.opcode = WREPL_OPCODE_BITS;
740 update_packet.assoc_ctx = assoc_ctx;
741 update_packet.mess_type = WREPL_REPLICATION;
742 update_packet.message.replication.command = WREPL_REPL_UPDATE;
743 update = &update_packet.message.replication.info.table;
745 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
746 update->partners = wrepl_wins_owners;
747 update->initiator = "0.0.0.0";
749 wrepl_wins_owners[0] = *owner;
751 status = wrepl_request(wrepl_socket, wrepl_socket,
752 &update_packet, &repl_recv);
753 CHECK_STATUS(status, NT_STATUS_OK);
754 CHECK_VALUE(repl_recv->mess_type, WREPL_REPLICATION);
755 CHECK_VALUE(repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
756 send_request = &repl_recv->message.replication.info.owner;
758 ZERO_STRUCT(repl_send);
759 repl_send.opcode = WREPL_OPCODE_BITS;
760 repl_send.assoc_ctx = assoc_ctx;
761 repl_send.mess_type = WREPL_REPLICATION;
762 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
763 send_reply = &repl_send.message.replication.info.reply;
765 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
766 send_reply->names = wrepl_wins_names;
768 wrepl_wins_names[0] = *name;
770 status = wrepl_request(wrepl_socket, wrepl_socket,
771 &repl_send, &repl_recv);
772 CHECK_STATUS(status, NT_STATUS_OK);
773 CHECK_VALUE(repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
774 CHECK_VALUE(repl_recv->message.stop.reason, 0);
777 talloc_free(wrepl_socket);
781 static BOOL test_wrepl_is_applied(struct test_wrepl_conflict_conn *ctx,
782 const struct wrepl_wins_owner *owner,
783 const struct wrepl_wins_name *name,
788 struct wrepl_pull_names pull_names;
789 struct wrepl_name *names;
791 pull_names.in.assoc_ctx = ctx->pull_assoc;
792 pull_names.in.partner = *owner;
793 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
795 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
796 CHECK_STATUS(status, NT_STATUS_OK);
797 CHECK_VALUE(pull_names.out.num_names, (expected?1:0));
799 names = pull_names.out.names;
802 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
806 CHECK_VALUE(names[0].name.type, name->name->type);
807 CHECK_VALUE_STRING(names[0].name.name, name->name->name);
808 CHECK_VALUE_STRING(names[0].name.scope, name->name->scope);
809 CHECK_VALUE(flags, name->flags);
810 CHECK_VALUE_UINT64(names[0].version_id, name->id);
813 CHECK_VALUE(names[0].num_addresses,
814 name->addresses.addresses.num_ips);
816 CHECK_VALUE(names[0].num_addresses, 1);
817 CHECK_VALUE_STRING(names[0].addresses[0].address,
822 talloc_free(pull_names.out.names);
826 static BOOL test_wrepl_mhomed_merged(struct test_wrepl_conflict_conn *ctx,
827 const struct wrepl_wins_owner *owner1,
828 uint32_t num_ips1, const struct wrepl_ip *ips1,
829 const struct wrepl_wins_owner *owner2,
830 uint32_t num_ips2, const struct wrepl_ip *ips2,
831 const struct wrepl_wins_name *name2)
835 struct wrepl_pull_names pull_names;
836 struct wrepl_name *names;
839 uint32_t num_ips = num_ips1 + num_ips2;
841 for (i = 0; i < num_ips2; i++) {
842 for (j = 0; j < num_ips1; j++) {
843 if (strcmp(ips2[i].ip,ips1[j].ip) == 0) {
850 pull_names.in.assoc_ctx = ctx->pull_assoc;
851 pull_names.in.partner = *owner2;
852 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
854 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
855 CHECK_STATUS(status, NT_STATUS_OK);
856 CHECK_VALUE(pull_names.out.num_names, 1);
858 names = pull_names.out.names;
860 flags = WREPL_NAME_FLAGS(names[0].type,
864 CHECK_VALUE(names[0].name.type, name2->name->type);
865 CHECK_VALUE_STRING(names[0].name.name, name2->name->name);
866 CHECK_VALUE_STRING(names[0].name.scope, name2->name->scope);
867 CHECK_VALUE(flags, name2->flags | WREPL_TYPE_MHOMED);
868 CHECK_VALUE_UINT64(names[0].version_id, name2->id);
870 CHECK_VALUE(names[0].num_addresses, num_ips);
872 for (i = 0; i < names[0].num_addresses; i++) {
873 const char *addr = names[0].addresses[i].address;
874 const char *owner = names[0].addresses[i].owner;
877 for (j = 0; j < num_ips2; j++) {
878 if (strcmp(addr, ips2[j].ip) == 0) {
880 CHECK_VALUE_STRING(owner, owner2->address);
887 for (j = 0; j < num_ips1; j++) {
888 if (strcmp(addr, ips1[j].ip) == 0) {
890 CHECK_VALUE_STRING(owner, owner1->address);
897 CHECK_VALUE_STRING(addr, "not found in address list");
900 talloc_free(pull_names.out.names);
904 static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx,
905 struct wrepl_wins_owner *merge_owner,
906 struct wrepl_wins_owner *owner1,
907 uint32_t num_ips1, const struct wrepl_ip *ips1,
908 struct wrepl_wins_owner *owner2,
909 uint32_t num_ips2, const struct wrepl_ip *ips2,
910 const struct wrepl_wins_name *name2)
914 struct wrepl_pull_names pull_names;
915 struct wrepl_name *names;
916 struct wrepl_name *name = NULL;
919 uint32_t num_ips = num_ips1 + num_ips2;
922 merge_owner = &ctx->c;
925 for (i = 0; i < num_ips1; i++) {
926 if (owner1 != &ctx->c && strcmp(ips1[i].owner,owner2->address) == 0) {
930 for (j = 0; j < num_ips2; j++) {
931 if (strcmp(ips1[i].ip,ips2[j].ip) == 0) {
939 pull_names.in.assoc_ctx = ctx->pull_assoc;
940 pull_names.in.partner = *merge_owner;
941 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
942 pull_names.in.partner.max_version = 0;
944 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
945 CHECK_STATUS(status, NT_STATUS_OK);
947 names = pull_names.out.names;
949 for (i = 0; i < pull_names.out.num_names; i++) {
950 if (names[i].name.type != name2->name->type) continue;
951 if (!names[i].name.name) continue;
952 if (strcmp(names[i].name.name, name2->name->name) != 0) continue;
953 if (names[i].name.scope) continue;
958 if (pull_names.out.num_names > 0) {
959 merge_owner->max_version = names[pull_names.out.num_names-1].version_id;
963 printf("%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name));
967 flags = WREPL_NAME_FLAGS(name->type,
971 CHECK_VALUE(name->name.type, name2->name->type);
972 CHECK_VALUE_STRING(name->name.name, name2->name->name);
973 CHECK_VALUE_STRING(name->name.scope, name2->name->scope);
974 CHECK_VALUE(flags, name2->flags);
976 CHECK_VALUE(name->num_addresses, num_ips);
978 for (i = 0; i < name->num_addresses; i++) {
979 const char *addr = name->addresses[i].address;
980 const char *owner = name->addresses[i].owner;
983 for (j = 0; j < num_ips2; j++) {
984 if (strcmp(addr, ips2[j].ip) == 0) {
986 CHECK_VALUE_STRING(owner, ips2[j].owner);
993 for (j = 0; j < num_ips1; j++) {
994 if (strcmp(addr, ips1[j].ip) == 0) {
996 if (owner1 == &ctx->c) {
997 CHECK_VALUE_STRING(owner, owner1->address);
999 CHECK_VALUE_STRING(owner, ips1[j].owner);
1005 if (found) continue;
1007 CHECK_VALUE_STRING(addr, "not found in address list");
1010 talloc_free(pull_names.out.names);
1014 static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx)
1017 struct nbt_name name;
1018 struct wrepl_wins_name wins_name1;
1019 struct wrepl_wins_name wins_name2;
1020 struct wrepl_wins_name *wins_name_tmp;
1021 struct wrepl_wins_name *wins_name_last;
1022 struct wrepl_wins_name *wins_name_cur;
1024 uint8_t types[] = { 0x00, 0x1C };
1026 enum wrepl_name_type type;
1027 enum wrepl_name_state state;
1028 enum wrepl_name_node node;
1031 const struct wrepl_ip *ips;
1034 .type = WREPL_TYPE_GROUP,
1035 .state = WREPL_STATE_ACTIVE,
1036 .node = WREPL_NODE_B,
1038 .num_ips = ARRAY_SIZE(addresses_A_1),
1039 .ips = addresses_A_1,
1041 .type = WREPL_TYPE_UNIQUE,
1042 .state = WREPL_STATE_ACTIVE,
1043 .node = WREPL_NODE_B,
1045 .num_ips = ARRAY_SIZE(addresses_A_1),
1046 .ips = addresses_A_1,
1048 .type = WREPL_TYPE_UNIQUE,
1049 .state = WREPL_STATE_ACTIVE,
1050 .node = WREPL_NODE_B,
1052 .num_ips = ARRAY_SIZE(addresses_A_2),
1053 .ips = addresses_A_2,
1055 .type = WREPL_TYPE_UNIQUE,
1056 .state = WREPL_STATE_ACTIVE,
1057 .node = WREPL_NODE_B,
1059 .num_ips = ARRAY_SIZE(addresses_A_1),
1060 .ips = addresses_A_1,
1062 .type = WREPL_TYPE_UNIQUE,
1063 .state = WREPL_STATE_ACTIVE,
1064 .node = WREPL_NODE_B,
1066 .num_ips = ARRAY_SIZE(addresses_A_2),
1067 .ips = addresses_A_2,
1069 .type = WREPL_TYPE_SGROUP,
1070 .state = WREPL_STATE_TOMBSTONE,
1071 .node = WREPL_NODE_B,
1073 .num_ips = ARRAY_SIZE(addresses_A_2),
1074 .ips = addresses_A_2,
1076 .type = WREPL_TYPE_MHOMED,
1077 .state = WREPL_STATE_TOMBSTONE,
1078 .node = WREPL_NODE_B,
1080 .num_ips = ARRAY_SIZE(addresses_A_1),
1081 .ips = addresses_A_1,
1083 .type = WREPL_TYPE_MHOMED,
1084 .state = WREPL_STATE_RELEASED,
1085 .node = WREPL_NODE_B,
1087 .num_ips = ARRAY_SIZE(addresses_A_2),
1088 .ips = addresses_A_2,
1090 .type = WREPL_TYPE_SGROUP,
1091 .state = WREPL_STATE_ACTIVE,
1092 .node = WREPL_NODE_B,
1094 .num_ips = ARRAY_SIZE(addresses_A_1),
1095 .ips = addresses_A_1,
1097 .type = WREPL_TYPE_SGROUP,
1098 .state = WREPL_STATE_ACTIVE,
1099 .node = WREPL_NODE_B,
1101 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1102 .ips = addresses_A_3_4,
1104 .type = WREPL_TYPE_SGROUP,
1105 .state = WREPL_STATE_TOMBSTONE,
1106 .node = WREPL_NODE_B,
1108 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1109 .ips = addresses_B_3_4,
1111 /* the last one should always be a unique,tomstone record! */
1112 .type = WREPL_TYPE_UNIQUE,
1113 .state = WREPL_STATE_TOMBSTONE,
1114 .node = WREPL_NODE_B,
1116 .num_ips = ARRAY_SIZE(addresses_A_1),
1117 .ips = addresses_A_1,
1121 name.name = "_SAME_OWNER_A";
1125 wins_name_tmp = NULL;
1126 wins_name_last = &wins_name2;
1127 wins_name_cur = &wins_name1;
1129 for (j=0; ret && j < ARRAY_SIZE(types); j++) {
1130 name.type = types[j];
1131 printf("Test Replica Conflicts with same owner[%s] for %s\n",
1132 nbt_name_string(ctx, &name), ctx->a.address);
1134 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
1135 wins_name_tmp = wins_name_last;
1136 wins_name_last = wins_name_cur;
1137 wins_name_cur = wins_name_tmp;
1140 printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
1141 wrepl_name_type_string(records[i-1].type),
1142 wrepl_name_state_string(records[i-1].state),
1143 (records[i-1].is_static?",static":""),
1144 wrepl_name_type_string(records[i].type),
1145 wrepl_name_state_string(records[i].state),
1146 (records[i].is_static?",static":""),
1147 (records[i-1].ips==records[i].ips?"same":"different"),
1151 wins_name_cur->name = &name;
1152 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
1155 records[i].is_static);
1156 wins_name_cur->id = ++ctx->a.max_version;
1157 if (wins_name_cur->flags & 2) {
1158 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
1159 wins_name_cur->addresses.addresses.ips = discard_const(records[i].ips);
1161 wins_name_cur->addresses.ip = records[i].ips[0].ip;
1163 wins_name_cur->unknown = "255.255.255.255";
1165 ret &= test_wrepl_update_one(ctx, &ctx->a,wins_name_cur);
1166 if (records[i].state == WREPL_STATE_RELEASED) {
1167 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_last, False);
1168 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, False);
1170 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, True);
1173 /* the first one is a cleanup run */
1174 if (!ret && i == 0) ret = True;
1177 printf("conflict handled wrong or record[%u]: %s\n", i, __location__);
1185 static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx)
1188 struct wrepl_wins_name wins_name1;
1189 struct wrepl_wins_name wins_name2;
1190 struct wrepl_wins_name *wins_name_r1;
1191 struct wrepl_wins_name *wins_name_r2;
1194 const char *line; /* just better debugging */
1195 struct nbt_name name;
1196 const char *comment;
1197 BOOL extra; /* not the worst case, this is an extra test */
1200 struct wrepl_wins_owner *owner;
1201 enum wrepl_name_type type;
1202 enum wrepl_name_state state;
1203 enum wrepl_name_node node;
1206 const struct wrepl_ip *ips;
1207 BOOL apply_expected;
1209 struct wrepl_wins_owner *merge_owner;
1210 BOOL sgroup_cleanup;
1214 * NOTE: the first record and the last applied one
1215 * needs to be from the same owner,
1216 * to not conflict in the next smbtorture run!!!
1219 .line = __location__,
1220 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1224 .type = WREPL_TYPE_UNIQUE,
1225 .state = WREPL_STATE_TOMBSTONE,
1226 .node = WREPL_NODE_B,
1228 .num_ips = ARRAY_SIZE(addresses_B_1),
1229 .ips = addresses_B_1,
1230 .apply_expected = True /* ignored */
1234 .type = WREPL_TYPE_UNIQUE,
1235 .state = WREPL_STATE_TOMBSTONE,
1236 .node = WREPL_NODE_B,
1238 .num_ips = ARRAY_SIZE(addresses_A_1),
1239 .ips = addresses_A_1,
1240 .apply_expected = True /* ignored */
1245 * unique vs unique section
1248 * unique,active vs. unique,active
1249 * => should be replaced
1252 .line = __location__,
1253 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1256 .type = WREPL_TYPE_UNIQUE,
1257 .state = WREPL_STATE_ACTIVE,
1258 .node = WREPL_NODE_B,
1260 .num_ips = ARRAY_SIZE(addresses_A_1),
1261 .ips = addresses_A_1,
1262 .apply_expected = True
1266 .type = WREPL_TYPE_UNIQUE,
1267 .state = WREPL_STATE_ACTIVE,
1268 .node = WREPL_NODE_B,
1270 .num_ips = ARRAY_SIZE(addresses_B_1),
1271 .ips = addresses_B_1,
1272 .apply_expected = True
1277 * unique,active vs. unique,tombstone
1278 * => should NOT be replaced
1281 .line = __location__,
1282 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1285 .type = WREPL_TYPE_UNIQUE,
1286 .state = WREPL_STATE_ACTIVE,
1287 .node = WREPL_NODE_B,
1289 .num_ips = ARRAY_SIZE(addresses_B_1),
1290 .ips = addresses_B_1,
1291 .apply_expected = True
1295 .type = WREPL_TYPE_UNIQUE,
1296 .state = WREPL_STATE_TOMBSTONE,
1297 .node = WREPL_NODE_B,
1299 .num_ips = ARRAY_SIZE(addresses_B_1),
1300 .ips = addresses_B_1,
1301 .apply_expected = False
1306 * unique,released vs. unique,active
1307 * => should be replaced
1310 .line = __location__,
1311 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1314 .type = WREPL_TYPE_UNIQUE,
1315 .state = WREPL_STATE_RELEASED,
1316 .node = WREPL_NODE_B,
1318 .num_ips = ARRAY_SIZE(addresses_B_1),
1319 .ips = addresses_B_1,
1320 .apply_expected = False
1324 .type = WREPL_TYPE_UNIQUE,
1325 .state = WREPL_STATE_ACTIVE,
1326 .node = WREPL_NODE_B,
1328 .num_ips = ARRAY_SIZE(addresses_A_1),
1329 .ips = addresses_A_1,
1330 .apply_expected = True
1335 * unique,released vs. unique,tombstone
1336 * => should be replaced
1339 .line = __location__,
1340 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1343 .type = WREPL_TYPE_UNIQUE,
1344 .state = WREPL_STATE_RELEASED,
1345 .node = WREPL_NODE_B,
1347 .num_ips = ARRAY_SIZE(addresses_A_1),
1348 .ips = addresses_A_1,
1349 .apply_expected = False
1353 .type = WREPL_TYPE_UNIQUE,
1354 .state = WREPL_STATE_TOMBSTONE,
1355 .node = WREPL_NODE_B,
1357 .num_ips = ARRAY_SIZE(addresses_B_1),
1358 .ips = addresses_B_1,
1359 .apply_expected = True
1364 * unique,tombstone vs. unique,active
1365 * => should be replaced
1368 .line = __location__,
1369 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1372 .type = WREPL_TYPE_UNIQUE,
1373 .state = WREPL_STATE_TOMBSTONE,
1374 .node = WREPL_NODE_B,
1376 .num_ips = ARRAY_SIZE(addresses_B_1),
1377 .ips = addresses_B_1,
1378 .apply_expected = True
1382 .type = WREPL_TYPE_UNIQUE,
1383 .state = WREPL_STATE_ACTIVE,
1384 .node = WREPL_NODE_B,
1386 .num_ips = ARRAY_SIZE(addresses_A_1),
1387 .ips = addresses_A_1,
1388 .apply_expected = True
1393 * unique,tombstone vs. unique,tombstone
1394 * => should be replaced
1397 .line = __location__,
1398 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1401 .type = WREPL_TYPE_UNIQUE,
1402 .state = WREPL_STATE_TOMBSTONE,
1403 .node = WREPL_NODE_B,
1405 .num_ips = ARRAY_SIZE(addresses_A_1),
1406 .ips = addresses_A_1,
1407 .apply_expected = True
1411 .type = WREPL_TYPE_UNIQUE,
1412 .state = WREPL_STATE_TOMBSTONE,
1413 .node = WREPL_NODE_B,
1415 .num_ips = ARRAY_SIZE(addresses_B_1),
1416 .ips = addresses_B_1,
1417 .apply_expected = True
1423 * unique vs normal groups section,
1426 * unique,active vs. group,active
1427 * => should be replaced
1430 .line = __location__,
1431 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1434 .type = WREPL_TYPE_UNIQUE,
1435 .state = WREPL_STATE_ACTIVE,
1436 .node = WREPL_NODE_B,
1438 .num_ips = ARRAY_SIZE(addresses_B_1),
1439 .ips = addresses_B_1,
1440 .apply_expected = True
1444 .type = WREPL_TYPE_GROUP,
1445 .state = WREPL_STATE_ACTIVE,
1446 .node = WREPL_NODE_B,
1448 .num_ips = ARRAY_SIZE(addresses_A_1),
1449 .ips = addresses_A_1,
1450 .apply_expected = True
1455 * unique,active vs. group,tombstone
1456 * => should NOT be replaced
1459 .line = __location__,
1460 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1463 .type = WREPL_TYPE_UNIQUE,
1464 .state = WREPL_STATE_ACTIVE,
1465 .node = WREPL_NODE_B,
1467 .num_ips = ARRAY_SIZE(addresses_A_1),
1468 .ips = addresses_A_1,
1469 .apply_expected = True
1473 .type = WREPL_TYPE_GROUP,
1474 .state = WREPL_STATE_TOMBSTONE,
1475 .node = WREPL_NODE_B,
1477 .num_ips = ARRAY_SIZE(addresses_A_1),
1478 .ips = addresses_A_1,
1479 .apply_expected = False
1484 * unique,released vs. group,active
1485 * => should be replaced
1488 .line = __location__,
1489 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1492 .type = WREPL_TYPE_UNIQUE,
1493 .state = WREPL_STATE_RELEASED,
1494 .node = WREPL_NODE_B,
1496 .num_ips = ARRAY_SIZE(addresses_A_1),
1497 .ips = addresses_A_1,
1498 .apply_expected = False
1502 .type = WREPL_TYPE_GROUP,
1503 .state = WREPL_STATE_ACTIVE,
1504 .node = WREPL_NODE_B,
1506 .num_ips = ARRAY_SIZE(addresses_B_1),
1507 .ips = addresses_B_1,
1508 .apply_expected = True
1513 * unique,released vs. group,tombstone
1514 * => should be replaced
1517 .line = __location__,
1518 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1521 .type = WREPL_TYPE_UNIQUE,
1522 .state = WREPL_STATE_RELEASED,
1523 .node = WREPL_NODE_B,
1525 .num_ips = ARRAY_SIZE(addresses_B_1),
1526 .ips = addresses_B_1,
1527 .apply_expected = False
1531 .type = WREPL_TYPE_GROUP,
1532 .state = WREPL_STATE_TOMBSTONE,
1533 .node = WREPL_NODE_B,
1535 .num_ips = ARRAY_SIZE(addresses_A_1),
1536 .ips = addresses_A_1,
1537 .apply_expected = True
1542 * unique,tombstone vs. group,active
1543 * => should be replaced
1546 .line = __location__,
1547 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1550 .type = WREPL_TYPE_UNIQUE,
1551 .state = WREPL_STATE_TOMBSTONE,
1552 .node = WREPL_NODE_B,
1554 .num_ips = ARRAY_SIZE(addresses_A_1),
1555 .ips = addresses_A_1,
1556 .apply_expected = True
1560 .type = WREPL_TYPE_GROUP,
1561 .state = WREPL_STATE_ACTIVE,
1562 .node = WREPL_NODE_B,
1564 .num_ips = ARRAY_SIZE(addresses_B_1),
1565 .ips = addresses_B_1,
1566 .apply_expected = True
1571 * unique,tombstone vs. group,tombstone
1572 * => should be replaced
1575 .line = __location__,
1576 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1579 .type = WREPL_TYPE_UNIQUE,
1580 .state = WREPL_STATE_TOMBSTONE,
1581 .node = WREPL_NODE_B,
1583 .num_ips = ARRAY_SIZE(addresses_B_1),
1584 .ips = addresses_B_1,
1585 .apply_expected = True
1589 .type = WREPL_TYPE_GROUP,
1590 .state = WREPL_STATE_TOMBSTONE,
1591 .node = WREPL_NODE_B,
1593 .num_ips = ARRAY_SIZE(addresses_A_1),
1594 .ips = addresses_A_1,
1595 .apply_expected = True
1600 * unique vs special groups section,
1603 * unique,active vs. sgroup,active
1604 * => should NOT be replaced
1607 .line = __location__,
1608 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1611 .type = WREPL_TYPE_UNIQUE,
1612 .state = WREPL_STATE_ACTIVE,
1613 .node = WREPL_NODE_B,
1615 .num_ips = ARRAY_SIZE(addresses_A_1),
1616 .ips = addresses_A_1,
1617 .apply_expected = True
1621 .type = WREPL_TYPE_SGROUP,
1622 .state = WREPL_STATE_ACTIVE,
1623 .node = WREPL_NODE_B,
1625 .num_ips = ARRAY_SIZE(addresses_A_1),
1626 .ips = addresses_A_1,
1627 .apply_expected = False
1632 * unique,active vs. sgroup,tombstone
1633 * => should NOT be replaced
1636 .line = __location__,
1637 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1640 .type = WREPL_TYPE_UNIQUE,
1641 .state = WREPL_STATE_ACTIVE,
1642 .node = WREPL_NODE_B,
1644 .num_ips = ARRAY_SIZE(addresses_A_1),
1645 .ips = addresses_A_1,
1646 .apply_expected = True
1650 .type = WREPL_TYPE_SGROUP,
1651 .state = WREPL_STATE_TOMBSTONE,
1652 .node = WREPL_NODE_B,
1654 .num_ips = ARRAY_SIZE(addresses_A_1),
1655 .ips = addresses_A_1,
1656 .apply_expected = False
1661 * unique,released vs. sgroup,active
1662 * => should be replaced
1665 .line = __location__,
1666 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1669 .type = WREPL_TYPE_UNIQUE,
1670 .state = WREPL_STATE_RELEASED,
1671 .node = WREPL_NODE_B,
1673 .num_ips = ARRAY_SIZE(addresses_A_1),
1674 .ips = addresses_A_1,
1675 .apply_expected = False
1679 .type = WREPL_TYPE_SGROUP,
1680 .state = WREPL_STATE_ACTIVE,
1681 .node = WREPL_NODE_B,
1683 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1684 .ips = addresses_B_3_4,
1685 .apply_expected = True
1690 * unique,released vs. sgroup,tombstone
1691 * => should be replaced
1694 .line = __location__,
1695 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1698 .type = WREPL_TYPE_UNIQUE,
1699 .state = WREPL_STATE_RELEASED,
1700 .node = WREPL_NODE_B,
1702 .num_ips = ARRAY_SIZE(addresses_B_1),
1703 .ips = addresses_B_1,
1704 .apply_expected = False
1708 .type = WREPL_TYPE_SGROUP,
1709 .state = WREPL_STATE_TOMBSTONE,
1710 .node = WREPL_NODE_B,
1712 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1713 .ips = addresses_A_3_4,
1714 .apply_expected = True
1719 * unique,tombstone vs. sgroup,active
1720 * => should be replaced
1723 .line = __location__,
1724 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1727 .type = WREPL_TYPE_UNIQUE,
1728 .state = WREPL_STATE_TOMBSTONE,
1729 .node = WREPL_NODE_B,
1731 .num_ips = ARRAY_SIZE(addresses_A_1),
1732 .ips = addresses_A_1,
1733 .apply_expected = True
1737 .type = WREPL_TYPE_SGROUP,
1738 .state = WREPL_STATE_ACTIVE,
1739 .node = WREPL_NODE_B,
1741 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1742 .ips = addresses_B_3_4,
1743 .apply_expected = True
1748 * unique,tombstone vs. sgroup,tombstone
1749 * => should be replaced
1752 .line = __location__,
1753 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1756 .type = WREPL_TYPE_UNIQUE,
1757 .state = WREPL_STATE_TOMBSTONE,
1758 .node = WREPL_NODE_B,
1760 .num_ips = ARRAY_SIZE(addresses_B_1),
1761 .ips = addresses_B_1,
1762 .apply_expected = True
1766 .type = WREPL_TYPE_SGROUP,
1767 .state = WREPL_STATE_TOMBSTONE,
1768 .node = WREPL_NODE_B,
1770 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1771 .ips = addresses_A_3_4,
1772 .apply_expected = True
1777 * unique vs multi homed section,
1780 * unique,active vs. mhomed,active
1781 * => should be replaced
1784 .line = __location__,
1785 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1788 .type = WREPL_TYPE_UNIQUE,
1789 .state = WREPL_STATE_ACTIVE,
1790 .node = WREPL_NODE_B,
1792 .num_ips = ARRAY_SIZE(addresses_A_1),
1793 .ips = addresses_A_1,
1794 .apply_expected = True
1798 .type = WREPL_TYPE_MHOMED,
1799 .state = WREPL_STATE_ACTIVE,
1800 .node = WREPL_NODE_B,
1802 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1803 .ips = addresses_B_3_4,
1804 .apply_expected = True
1809 * unique,active vs. mhomed,tombstone
1810 * => should NOT be replaced
1813 .line = __location__,
1814 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1817 .type = WREPL_TYPE_UNIQUE,
1818 .state = WREPL_STATE_ACTIVE,
1819 .node = WREPL_NODE_B,
1821 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1822 .ips = addresses_B_3_4,
1823 .apply_expected = True
1827 .type = WREPL_TYPE_MHOMED,
1828 .state = WREPL_STATE_TOMBSTONE,
1829 .node = WREPL_NODE_B,
1831 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1832 .ips = addresses_B_3_4,
1833 .apply_expected = False
1838 * unique,released vs. mhomed,active
1839 * => should be replaced
1842 .line = __location__,
1843 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1846 .type = WREPL_TYPE_UNIQUE,
1847 .state = WREPL_STATE_RELEASED,
1848 .node = WREPL_NODE_B,
1850 .num_ips = ARRAY_SIZE(addresses_B_1),
1851 .ips = addresses_B_1,
1852 .apply_expected = False
1856 .type = WREPL_TYPE_MHOMED,
1857 .state = WREPL_STATE_ACTIVE,
1858 .node = WREPL_NODE_B,
1860 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1861 .ips = addresses_A_3_4,
1862 .apply_expected = True
1867 * unique,released vs. mhomed,tombstone
1868 * => should be replaced
1871 .line = __location__,
1872 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1875 .type = WREPL_TYPE_UNIQUE,
1876 .state = WREPL_STATE_RELEASED,
1877 .node = WREPL_NODE_B,
1879 .num_ips = ARRAY_SIZE(addresses_A_1),
1880 .ips = addresses_A_1,
1881 .apply_expected = False
1885 .type = WREPL_TYPE_MHOMED,
1886 .state = WREPL_STATE_TOMBSTONE,
1887 .node = WREPL_NODE_B,
1889 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1890 .ips = addresses_B_3_4,
1891 .apply_expected = True
1896 * unique,tombstone vs. mhomed,active
1897 * => should be replaced
1900 .line = __location__,
1901 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1904 .type = WREPL_TYPE_UNIQUE,
1905 .state = WREPL_STATE_TOMBSTONE,
1906 .node = WREPL_NODE_B,
1908 .num_ips = ARRAY_SIZE(addresses_B_1),
1909 .ips = addresses_B_1,
1910 .apply_expected = True
1914 .type = WREPL_TYPE_MHOMED,
1915 .state = WREPL_STATE_ACTIVE,
1916 .node = WREPL_NODE_B,
1918 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1919 .ips = addresses_A_3_4,
1920 .apply_expected = True
1925 * unique,tombstone vs. mhomed,tombstone
1926 * => should be replaced
1929 .line = __location__,
1930 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1933 .type = WREPL_TYPE_UNIQUE,
1934 .state = WREPL_STATE_TOMBSTONE,
1935 .node = WREPL_NODE_B,
1937 .num_ips = ARRAY_SIZE(addresses_A_1),
1938 .ips = addresses_A_1,
1939 .apply_expected = True
1943 .type = WREPL_TYPE_MHOMED,
1944 .state = WREPL_STATE_TOMBSTONE,
1945 .node = WREPL_NODE_B,
1947 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1948 .ips = addresses_B_3_4,
1949 .apply_expected = True
1954 * normal groups vs unique section,
1957 * group,active vs. unique,active
1958 * => should NOT be replaced
1961 .line = __location__,
1962 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1965 .type = WREPL_TYPE_GROUP,
1966 .state = WREPL_STATE_ACTIVE,
1967 .node = WREPL_NODE_B,
1969 .num_ips = ARRAY_SIZE(addresses_A_1),
1970 .ips = addresses_A_1,
1971 .apply_expected = True
1975 .type = WREPL_TYPE_UNIQUE,
1976 .state = WREPL_STATE_ACTIVE,
1977 .node = WREPL_NODE_B,
1979 .num_ips = ARRAY_SIZE(addresses_A_1),
1980 .ips = addresses_A_1,
1981 .apply_expected = False
1986 * group,active vs. unique,tombstone
1987 * => should NOT be replaced
1990 .line = __location__,
1991 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1994 .type = WREPL_TYPE_GROUP,
1995 .state = WREPL_STATE_ACTIVE,
1996 .node = WREPL_NODE_B,
1998 .num_ips = ARRAY_SIZE(addresses_A_1),
1999 .ips = addresses_A_1,
2000 .apply_expected = True
2004 .type = WREPL_TYPE_UNIQUE,
2005 .state = WREPL_STATE_TOMBSTONE,
2006 .node = WREPL_NODE_B,
2008 .num_ips = ARRAY_SIZE(addresses_A_1),
2009 .ips = addresses_A_1,
2010 .apply_expected = False
2015 * group,released vs. unique,active
2016 * => should NOT be replaced
2019 .line = __location__,
2020 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2023 .type = WREPL_TYPE_GROUP,
2024 .state = WREPL_STATE_RELEASED,
2025 .node = WREPL_NODE_B,
2027 .num_ips = ARRAY_SIZE(addresses_A_1),
2028 .ips = addresses_A_1,
2029 .apply_expected = False
2033 .type = WREPL_TYPE_UNIQUE,
2034 .state = WREPL_STATE_ACTIVE,
2035 .node = WREPL_NODE_B,
2037 .num_ips = ARRAY_SIZE(addresses_A_1),
2038 .ips = addresses_A_1,
2039 .apply_expected = False
2044 * group,released vs. unique,tombstone
2045 * => should NOT be replaced
2048 .line = __location__,
2049 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2052 .type = WREPL_TYPE_GROUP,
2053 .state = WREPL_STATE_RELEASED,
2054 .node = WREPL_NODE_B,
2056 .num_ips = ARRAY_SIZE(addresses_A_1),
2057 .ips = addresses_A_1,
2058 .apply_expected = False
2062 .type = WREPL_TYPE_UNIQUE,
2063 .state = WREPL_STATE_TOMBSTONE,
2064 .node = WREPL_NODE_B,
2066 .num_ips = ARRAY_SIZE(addresses_A_1),
2067 .ips = addresses_A_1,
2068 .apply_expected = False
2073 * group,tombstone vs. unique,active
2074 * => should NOT be replaced
2077 .line = __location__,
2078 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2081 .type = WREPL_TYPE_GROUP,
2082 .state = WREPL_STATE_TOMBSTONE,
2083 .node = WREPL_NODE_B,
2085 .num_ips = ARRAY_SIZE(addresses_A_1),
2086 .ips = addresses_A_1,
2087 .apply_expected = True
2091 .type = WREPL_TYPE_UNIQUE,
2092 .state = WREPL_STATE_ACTIVE,
2093 .node = WREPL_NODE_B,
2095 .num_ips = ARRAY_SIZE(addresses_A_1),
2096 .ips = addresses_A_1,
2097 .apply_expected = False
2102 * group,tombstone vs. unique,tombstone
2103 * => should NOT be replaced
2106 .line = __location__,
2107 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2110 .type = WREPL_TYPE_GROUP,
2111 .state = WREPL_STATE_TOMBSTONE,
2112 .node = WREPL_NODE_B,
2114 .num_ips = ARRAY_SIZE(addresses_A_1),
2115 .ips = addresses_A_1,
2116 .apply_expected = True
2120 .type = WREPL_TYPE_UNIQUE,
2121 .state = WREPL_STATE_TOMBSTONE,
2122 .node = WREPL_NODE_B,
2124 .num_ips = ARRAY_SIZE(addresses_A_1),
2125 .ips = addresses_A_1,
2126 .apply_expected = False
2131 * normal groups vs normal groups section,
2134 * group,active vs. group,active
2135 * => should NOT be replaced
2138 .line = __location__,
2139 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2142 .type = WREPL_TYPE_GROUP,
2143 .state = WREPL_STATE_ACTIVE,
2144 .node = WREPL_NODE_B,
2146 .num_ips = ARRAY_SIZE(addresses_A_1),
2147 .ips = addresses_A_1,
2148 .apply_expected = True
2152 .type = WREPL_TYPE_GROUP,
2153 .state = WREPL_STATE_ACTIVE,
2154 .node = WREPL_NODE_B,
2156 .num_ips = ARRAY_SIZE(addresses_A_1),
2157 .ips = addresses_A_1,
2158 .apply_expected = False
2163 * group,active vs. group,tombstone
2164 * => should NOT be replaced
2167 .line = __location__,
2168 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2171 .type = WREPL_TYPE_GROUP,
2172 .state = WREPL_STATE_ACTIVE,
2173 .node = WREPL_NODE_B,
2175 .num_ips = ARRAY_SIZE(addresses_A_1),
2176 .ips = addresses_A_1,
2177 .apply_expected = True
2181 .type = WREPL_TYPE_GROUP,
2182 .state = WREPL_STATE_TOMBSTONE,
2183 .node = WREPL_NODE_B,
2185 .num_ips = ARRAY_SIZE(addresses_A_1),
2186 .ips = addresses_A_1,
2187 .apply_expected = False
2192 * group,released vs. group,active
2193 * => should be replaced
2196 .line = __location__,
2197 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2200 .type = WREPL_TYPE_GROUP,
2201 .state = WREPL_STATE_RELEASED,
2202 .node = WREPL_NODE_B,
2204 .num_ips = ARRAY_SIZE(addresses_A_1),
2205 .ips = addresses_A_1,
2206 .apply_expected = False
2210 .type = WREPL_TYPE_GROUP,
2211 .state = WREPL_STATE_ACTIVE,
2212 .node = WREPL_NODE_B,
2214 .num_ips = ARRAY_SIZE(addresses_B_1),
2215 .ips = addresses_B_1,
2216 .apply_expected = True
2221 * group,released vs. group,tombstone
2222 * => should be replaced
2225 .line = __location__,
2226 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2229 .type = WREPL_TYPE_GROUP,
2230 .state = WREPL_STATE_RELEASED,
2231 .node = WREPL_NODE_B,
2233 .num_ips = ARRAY_SIZE(addresses_A_1),
2234 .ips = addresses_A_1,
2235 .apply_expected = False
2239 .type = WREPL_TYPE_GROUP,
2240 .state = WREPL_STATE_TOMBSTONE,
2241 .node = WREPL_NODE_B,
2243 .num_ips = ARRAY_SIZE(addresses_B_1),
2244 .ips = addresses_B_1,
2245 .apply_expected = True
2250 * group,tombstone vs. group,active
2251 * => should be replaced
2254 .line = __location__,
2255 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2258 .type = WREPL_TYPE_GROUP,
2259 .state = WREPL_STATE_TOMBSTONE,
2260 .node = WREPL_NODE_B,
2262 .num_ips = ARRAY_SIZE(addresses_B_1),
2263 .ips = addresses_B_1,
2264 .apply_expected = True
2268 .type = WREPL_TYPE_GROUP,
2269 .state = WREPL_STATE_ACTIVE,
2270 .node = WREPL_NODE_B,
2272 .num_ips = ARRAY_SIZE(addresses_A_1),
2273 .ips = addresses_A_1,
2274 .apply_expected = True
2279 * group,tombstone vs. group,tombstone
2280 * => should be replaced
2283 .line = __location__,
2284 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2287 .type = WREPL_TYPE_GROUP,
2288 .state = WREPL_STATE_TOMBSTONE,
2289 .node = WREPL_NODE_B,
2291 .num_ips = ARRAY_SIZE(addresses_A_1),
2292 .ips = addresses_A_1,
2293 .apply_expected = True
2297 .type = WREPL_TYPE_GROUP,
2298 .state = WREPL_STATE_TOMBSTONE,
2299 .node = WREPL_NODE_B,
2301 .num_ips = ARRAY_SIZE(addresses_B_1),
2302 .ips = addresses_B_1,
2303 .apply_expected = True
2308 * normal groups vs special groups section,
2311 * group,active vs. sgroup,active
2312 * => should NOT be replaced
2315 .line = __location__,
2316 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2319 .type = WREPL_TYPE_GROUP,
2320 .state = WREPL_STATE_ACTIVE,
2321 .node = WREPL_NODE_B,
2323 .num_ips = ARRAY_SIZE(addresses_B_1),
2324 .ips = addresses_B_1,
2325 .apply_expected = True
2329 .type = WREPL_TYPE_SGROUP,
2330 .state = WREPL_STATE_ACTIVE,
2331 .node = WREPL_NODE_B,
2333 .num_ips = ARRAY_SIZE(addresses_B_1),
2334 .ips = addresses_B_1,
2335 .apply_expected = False
2340 * group,active vs. sgroup,tombstone
2341 * => should NOT be replaced
2344 .line = __location__,
2345 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2348 .type = WREPL_TYPE_GROUP,
2349 .state = WREPL_STATE_ACTIVE,
2350 .node = WREPL_NODE_B,
2352 .num_ips = ARRAY_SIZE(addresses_B_1),
2353 .ips = addresses_B_1,
2354 .apply_expected = True
2358 .type = WREPL_TYPE_SGROUP,
2359 .state = WREPL_STATE_TOMBSTONE,
2360 .node = WREPL_NODE_B,
2362 .num_ips = ARRAY_SIZE(addresses_B_1),
2363 .ips = addresses_B_1,
2364 .apply_expected = False
2369 * group,released vs. sgroup,active
2370 * => should be replaced
2373 .line = __location__,
2374 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2377 .type = WREPL_TYPE_GROUP,
2378 .state = WREPL_STATE_RELEASED,
2379 .node = WREPL_NODE_B,
2381 .num_ips = ARRAY_SIZE(addresses_A_1),
2382 .ips = addresses_A_1,
2383 .apply_expected = False
2387 .type = WREPL_TYPE_SGROUP,
2388 .state = WREPL_STATE_ACTIVE,
2389 .node = WREPL_NODE_B,
2391 .num_ips = ARRAY_SIZE(addresses_B_1),
2392 .ips = addresses_B_1,
2393 .apply_expected = True
2398 * group,released vs. sgroup,tombstone
2399 * => should NOT be replaced
2402 .line = __location__,
2403 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2406 .type = WREPL_TYPE_GROUP,
2407 .state = WREPL_STATE_RELEASED,
2408 .node = WREPL_NODE_B,
2410 .num_ips = ARRAY_SIZE(addresses_B_1),
2411 .ips = addresses_B_1,
2412 .apply_expected = False
2416 .type = WREPL_TYPE_SGROUP,
2417 .state = WREPL_STATE_TOMBSTONE,
2418 .node = WREPL_NODE_B,
2420 .num_ips = ARRAY_SIZE(addresses_B_1),
2421 .ips = addresses_B_1,
2422 .apply_expected = False
2427 * group,tombstone vs. sgroup,active
2428 * => should be replaced
2431 .line = __location__,
2432 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2435 .type = WREPL_TYPE_GROUP,
2436 .state = WREPL_STATE_TOMBSTONE,
2437 .node = WREPL_NODE_B,
2439 .num_ips = ARRAY_SIZE(addresses_B_1),
2440 .ips = addresses_B_1,
2441 .apply_expected = True
2445 .type = WREPL_TYPE_SGROUP,
2446 .state = WREPL_STATE_ACTIVE,
2447 .node = WREPL_NODE_B,
2449 .num_ips = ARRAY_SIZE(addresses_A_1),
2450 .ips = addresses_A_1,
2451 .apply_expected = True
2456 * group,tombstone vs. sgroup,tombstone
2457 * => should be replaced
2460 .line = __location__,
2461 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2464 .type = WREPL_TYPE_GROUP,
2465 .state = WREPL_STATE_TOMBSTONE,
2466 .node = WREPL_NODE_B,
2468 .num_ips = ARRAY_SIZE(addresses_A_1),
2469 .ips = addresses_A_1,
2470 .apply_expected = True
2474 .type = WREPL_TYPE_SGROUP,
2475 .state = WREPL_STATE_TOMBSTONE,
2476 .node = WREPL_NODE_B,
2478 .num_ips = ARRAY_SIZE(addresses_B_1),
2479 .ips = addresses_B_1,
2480 .apply_expected = True
2485 * normal groups vs multi homed section,
2488 * group,active vs. mhomed,active
2489 * => should NOT be replaced
2492 .line = __location__,
2493 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2496 .type = WREPL_TYPE_GROUP,
2497 .state = WREPL_STATE_ACTIVE,
2498 .node = WREPL_NODE_B,
2500 .num_ips = ARRAY_SIZE(addresses_B_1),
2501 .ips = addresses_B_1,
2502 .apply_expected = True
2506 .type = WREPL_TYPE_MHOMED,
2507 .state = WREPL_STATE_ACTIVE,
2508 .node = WREPL_NODE_B,
2510 .num_ips = ARRAY_SIZE(addresses_B_1),
2511 .ips = addresses_B_1,
2512 .apply_expected = False
2517 * group,active vs. mhomed,tombstone
2518 * => should NOT be replaced
2521 .line = __location__,
2522 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2525 .type = WREPL_TYPE_GROUP,
2526 .state = WREPL_STATE_ACTIVE,
2527 .node = WREPL_NODE_B,
2529 .num_ips = ARRAY_SIZE(addresses_B_1),
2530 .ips = addresses_B_1,
2531 .apply_expected = True
2535 .type = WREPL_TYPE_MHOMED,
2536 .state = WREPL_STATE_TOMBSTONE,
2537 .node = WREPL_NODE_B,
2539 .num_ips = ARRAY_SIZE(addresses_B_1),
2540 .ips = addresses_B_1,
2541 .apply_expected = False
2546 * group,released vs. mhomed,active
2547 * => should NOT be replaced
2550 .line = __location__,
2551 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2554 .type = WREPL_TYPE_GROUP,
2555 .state = WREPL_STATE_RELEASED,
2556 .node = WREPL_NODE_B,
2558 .num_ips = ARRAY_SIZE(addresses_B_1),
2559 .ips = addresses_B_1,
2560 .apply_expected = False
2564 .type = WREPL_TYPE_MHOMED,
2565 .state = WREPL_STATE_ACTIVE,
2566 .node = WREPL_NODE_B,
2568 .num_ips = ARRAY_SIZE(addresses_B_1),
2569 .ips = addresses_B_1,
2570 .apply_expected = False
2575 * group,released vs. mhomed,tombstone
2576 * => should NOT be replaced
2579 .line = __location__,
2580 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2583 .type = WREPL_TYPE_GROUP,
2584 .state = WREPL_STATE_RELEASED,
2585 .node = WREPL_NODE_B,
2587 .num_ips = ARRAY_SIZE(addresses_B_1),
2588 .ips = addresses_B_1,
2589 .apply_expected = False
2593 .type = WREPL_TYPE_MHOMED,
2594 .state = WREPL_STATE_TOMBSTONE,
2595 .node = WREPL_NODE_B,
2597 .num_ips = ARRAY_SIZE(addresses_B_1),
2598 .ips = addresses_B_1,
2599 .apply_expected = False
2604 * group,tombstone vs. mhomed,active
2605 * => should be replaced
2608 .line = __location__,
2609 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2612 .type = WREPL_TYPE_GROUP,
2613 .state = WREPL_STATE_TOMBSTONE,
2614 .node = WREPL_NODE_B,
2616 .num_ips = ARRAY_SIZE(addresses_B_1),
2617 .ips = addresses_B_1,
2618 .apply_expected = True
2622 .type = WREPL_TYPE_MHOMED,
2623 .state = WREPL_STATE_ACTIVE,
2624 .node = WREPL_NODE_B,
2626 .num_ips = ARRAY_SIZE(addresses_A_1),
2627 .ips = addresses_A_1,
2628 .apply_expected = True
2633 * group,tombstone vs. mhomed,tombstone
2634 * => should be replaced
2637 .line = __location__,
2638 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2641 .type = WREPL_TYPE_GROUP,
2642 .state = WREPL_STATE_TOMBSTONE,
2643 .node = WREPL_NODE_B,
2645 .num_ips = ARRAY_SIZE(addresses_A_1),
2646 .ips = addresses_A_1,
2647 .apply_expected = True
2651 .type = WREPL_TYPE_MHOMED,
2652 .state = WREPL_STATE_TOMBSTONE,
2653 .node = WREPL_NODE_B,
2655 .num_ips = ARRAY_SIZE(addresses_B_1),
2656 .ips = addresses_B_1,
2657 .apply_expected = True
2662 * special groups vs unique section,
2665 * sgroup,active vs. unique,active
2666 * => should NOT be replaced
2669 .line = __location__,
2670 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2673 .type = WREPL_TYPE_SGROUP,
2674 .state = WREPL_STATE_ACTIVE,
2675 .node = WREPL_NODE_B,
2677 .num_ips = ARRAY_SIZE(addresses_B_1),
2678 .ips = addresses_B_1,
2679 .apply_expected = True
2683 .type = WREPL_TYPE_UNIQUE,
2684 .state = WREPL_STATE_ACTIVE,
2685 .node = WREPL_NODE_B,
2687 .num_ips = ARRAY_SIZE(addresses_B_1),
2688 .ips = addresses_B_1,
2689 .apply_expected = False
2694 * sgroup,active vs. unique,tombstone
2695 * => should NOT be replaced
2698 .line = __location__,
2699 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2702 .type = WREPL_TYPE_SGROUP,
2703 .state = WREPL_STATE_ACTIVE,
2704 .node = WREPL_NODE_B,
2706 .num_ips = ARRAY_SIZE(addresses_B_1),
2707 .ips = addresses_B_1,
2708 .apply_expected = True
2712 .type = WREPL_TYPE_UNIQUE,
2713 .state = WREPL_STATE_TOMBSTONE,
2714 .node = WREPL_NODE_B,
2716 .num_ips = ARRAY_SIZE(addresses_B_1),
2717 .ips = addresses_B_1,
2718 .apply_expected = False
2723 * sgroup,released vs. unique,active
2724 * => should be replaced
2727 .line = __location__,
2728 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2731 .type = WREPL_TYPE_SGROUP,
2732 .state = WREPL_STATE_RELEASED,
2733 .node = WREPL_NODE_B,
2735 .num_ips = ARRAY_SIZE(addresses_B_1),
2736 .ips = addresses_B_1,
2737 .apply_expected = False
2741 .type = WREPL_TYPE_UNIQUE,
2742 .state = WREPL_STATE_ACTIVE,
2743 .node = WREPL_NODE_B,
2745 .num_ips = ARRAY_SIZE(addresses_A_1),
2746 .ips = addresses_A_1,
2747 .apply_expected = True
2752 * sgroup,released vs. unique,tombstone
2753 * => should be replaced
2756 .line = __location__,
2757 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2760 .type = WREPL_TYPE_SGROUP,
2761 .state = WREPL_STATE_RELEASED,
2762 .node = WREPL_NODE_B,
2764 .num_ips = ARRAY_SIZE(addresses_A_1),
2765 .ips = addresses_A_1,
2766 .apply_expected = False
2770 .type = WREPL_TYPE_UNIQUE,
2771 .state = WREPL_STATE_TOMBSTONE,
2772 .node = WREPL_NODE_B,
2774 .num_ips = ARRAY_SIZE(addresses_B_1),
2775 .ips = addresses_B_1,
2776 .apply_expected = True
2781 * sgroup,tombstone vs. unique,active
2782 * => should be replaced
2785 .line = __location__,
2786 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2789 .type = WREPL_TYPE_SGROUP,
2790 .state = WREPL_STATE_TOMBSTONE,
2791 .node = WREPL_NODE_B,
2793 .num_ips = ARRAY_SIZE(addresses_A_1),
2794 .ips = addresses_A_1,
2795 .apply_expected = True
2799 .type = WREPL_TYPE_UNIQUE,
2800 .state = WREPL_STATE_ACTIVE,
2801 .node = WREPL_NODE_B,
2803 .num_ips = ARRAY_SIZE(addresses_B_1),
2804 .ips = addresses_B_1,
2805 .apply_expected = True
2810 * sgroup,tombstone vs. unique,tombstone
2811 * => should be replaced
2814 .line = __location__,
2815 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2818 .type = WREPL_TYPE_SGROUP,
2819 .state = WREPL_STATE_TOMBSTONE,
2820 .node = WREPL_NODE_B,
2822 .num_ips = ARRAY_SIZE(addresses_B_1),
2823 .ips = addresses_B_1,
2824 .apply_expected = True
2828 .type = WREPL_TYPE_UNIQUE,
2829 .state = WREPL_STATE_TOMBSTONE,
2830 .node = WREPL_NODE_B,
2832 .num_ips = ARRAY_SIZE(addresses_A_1),
2833 .ips = addresses_A_1,
2834 .apply_expected = True
2839 * special groups vs normal group section,
2842 * sgroup,active vs. group,active
2843 * => should NOT be replaced
2846 .line = __location__,
2847 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2850 .type = WREPL_TYPE_SGROUP,
2851 .state = WREPL_STATE_ACTIVE,
2852 .node = WREPL_NODE_B,
2854 .num_ips = ARRAY_SIZE(addresses_A_1),
2855 .ips = addresses_A_1,
2856 .apply_expected = True
2860 .type = WREPL_TYPE_GROUP,
2861 .state = WREPL_STATE_ACTIVE,
2862 .node = WREPL_NODE_B,
2864 .num_ips = ARRAY_SIZE(addresses_A_1),
2865 .ips = addresses_A_1,
2866 .apply_expected = False
2871 * sgroup,active vs. group,tombstone
2872 * => should NOT be replaced
2875 .line = __location__,
2876 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2879 .type = WREPL_TYPE_SGROUP,
2880 .state = WREPL_STATE_ACTIVE,
2881 .node = WREPL_NODE_B,
2883 .num_ips = ARRAY_SIZE(addresses_A_1),
2884 .ips = addresses_A_1,
2885 .apply_expected = True
2889 .type = WREPL_TYPE_GROUP,
2890 .state = WREPL_STATE_TOMBSTONE,
2891 .node = WREPL_NODE_B,
2893 .num_ips = ARRAY_SIZE(addresses_A_1),
2894 .ips = addresses_A_1,
2895 .apply_expected = False
2900 * sgroup,released vs. group,active
2901 * => should be replaced
2904 .line = __location__,
2905 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2908 .type = WREPL_TYPE_SGROUP,
2909 .state = WREPL_STATE_RELEASED,
2910 .node = WREPL_NODE_B,
2912 .num_ips = ARRAY_SIZE(addresses_A_1),
2913 .ips = addresses_A_1,
2914 .apply_expected = False
2918 .type = WREPL_TYPE_GROUP,
2919 .state = WREPL_STATE_ACTIVE,
2920 .node = WREPL_NODE_B,
2922 .num_ips = ARRAY_SIZE(addresses_B_1),
2923 .ips = addresses_B_1,
2924 .apply_expected = True
2929 * sgroup,released vs. group,tombstone
2930 * => should be replaced
2933 .line = __location__,
2934 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2937 .type = WREPL_TYPE_SGROUP,
2938 .state = WREPL_STATE_RELEASED,
2939 .node = WREPL_NODE_B,
2941 .num_ips = ARRAY_SIZE(addresses_B_1),
2942 .ips = addresses_B_1,
2943 .apply_expected = False
2947 .type = WREPL_TYPE_GROUP,
2948 .state = WREPL_STATE_TOMBSTONE,
2949 .node = WREPL_NODE_B,
2951 .num_ips = ARRAY_SIZE(addresses_A_1),
2952 .ips = addresses_A_1,
2953 .apply_expected = True
2958 * sgroup,tombstone vs. group,active
2959 * => should NOT be replaced
2962 .line = __location__,
2963 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2966 .type = WREPL_TYPE_SGROUP,
2967 .state = WREPL_STATE_TOMBSTONE,
2968 .node = WREPL_NODE_B,
2970 .num_ips = ARRAY_SIZE(addresses_A_1),
2971 .ips = addresses_A_1,
2972 .apply_expected = True
2976 .type = WREPL_TYPE_GROUP,
2977 .state = WREPL_STATE_ACTIVE,
2978 .node = WREPL_NODE_B,
2980 .num_ips = ARRAY_SIZE(addresses_B_1),
2981 .ips = addresses_B_1,
2982 .apply_expected = True
2987 * sgroup,tombstone vs. group,tombstone
2988 * => should NOT be replaced
2991 .line = __location__,
2992 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2995 .type = WREPL_TYPE_SGROUP,
2996 .state = WREPL_STATE_TOMBSTONE,
2997 .node = WREPL_NODE_B,
2999 .num_ips = ARRAY_SIZE(addresses_B_1),
3000 .ips = addresses_B_1,
3001 .apply_expected = True
3005 .type = WREPL_TYPE_GROUP,
3006 .state = WREPL_STATE_TOMBSTONE,
3007 .node = WREPL_NODE_B,
3009 .num_ips = ARRAY_SIZE(addresses_A_1),
3010 .ips = addresses_A_1,
3011 .apply_expected = True
3016 * special groups (not active) vs special group section,
3019 * sgroup,released vs. sgroup,active
3020 * => should be replaced
3023 .line = __location__,
3024 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3027 .type = WREPL_TYPE_SGROUP,
3028 .state = WREPL_STATE_RELEASED,
3029 .node = WREPL_NODE_B,
3031 .num_ips = ARRAY_SIZE(addresses_A_1),
3032 .ips = addresses_A_1,
3033 .apply_expected = False
3037 .type = WREPL_TYPE_SGROUP,
3038 .state = WREPL_STATE_ACTIVE,
3039 .node = WREPL_NODE_B,
3041 .num_ips = ARRAY_SIZE(addresses_B_1),
3042 .ips = addresses_B_1,
3043 .apply_expected = True
3048 * sgroup,released vs. sgroup,tombstone
3049 * => should be replaced
3052 .line = __location__,
3053 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3056 .type = WREPL_TYPE_SGROUP,
3057 .state = WREPL_STATE_RELEASED,
3058 .node = WREPL_NODE_B,
3060 .num_ips = ARRAY_SIZE(addresses_B_1),
3061 .ips = addresses_B_1,
3062 .apply_expected = False
3066 .type = WREPL_TYPE_SGROUP,
3067 .state = WREPL_STATE_TOMBSTONE,
3068 .node = WREPL_NODE_B,
3070 .num_ips = ARRAY_SIZE(addresses_A_1),
3071 .ips = addresses_A_1,
3072 .apply_expected = True
3077 * sgroup,tombstone vs. sgroup,active
3078 * => should NOT be replaced
3081 .line = __location__,
3082 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3085 .type = WREPL_TYPE_SGROUP,
3086 .state = WREPL_STATE_TOMBSTONE,
3087 .node = WREPL_NODE_B,
3089 .num_ips = ARRAY_SIZE(addresses_A_1),
3090 .ips = addresses_A_1,
3091 .apply_expected = True
3095 .type = WREPL_TYPE_SGROUP,
3096 .state = WREPL_STATE_ACTIVE,
3097 .node = WREPL_NODE_B,
3099 .num_ips = ARRAY_SIZE(addresses_B_1),
3100 .ips = addresses_B_1,
3101 .apply_expected = True
3106 * sgroup,tombstone vs. sgroup,tombstone
3107 * => should NOT be replaced
3110 .line = __location__,
3111 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3114 .type = WREPL_TYPE_SGROUP,
3115 .state = WREPL_STATE_TOMBSTONE,
3116 .node = WREPL_NODE_B,
3118 .num_ips = ARRAY_SIZE(addresses_B_1),
3119 .ips = addresses_B_1,
3120 .apply_expected = True
3124 .type = WREPL_TYPE_SGROUP,
3125 .state = WREPL_STATE_TOMBSTONE,
3126 .node = WREPL_NODE_B,
3128 .num_ips = ARRAY_SIZE(addresses_A_1),
3129 .ips = addresses_A_1,
3130 .apply_expected = True
3135 * special groups vs multi homed section,
3138 * sgroup,active vs. mhomed,active
3139 * => should NOT be replaced
3142 .line = __location__,
3143 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3146 .type = WREPL_TYPE_SGROUP,
3147 .state = WREPL_STATE_ACTIVE,
3148 .node = WREPL_NODE_B,
3150 .num_ips = ARRAY_SIZE(addresses_A_1),
3151 .ips = addresses_A_1,
3152 .apply_expected = True
3156 .type = WREPL_TYPE_MHOMED,
3157 .state = WREPL_STATE_ACTIVE,
3158 .node = WREPL_NODE_B,
3160 .num_ips = ARRAY_SIZE(addresses_A_1),
3161 .ips = addresses_A_1,
3162 .apply_expected = False
3167 * sgroup,active vs. mhomed,tombstone
3168 * => should NOT be replaced
3171 .line = __location__,
3172 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3175 .type = WREPL_TYPE_SGROUP,
3176 .state = WREPL_STATE_ACTIVE,
3177 .node = WREPL_NODE_B,
3179 .num_ips = ARRAY_SIZE(addresses_A_1),
3180 .ips = addresses_A_1,
3181 .apply_expected = True
3185 .type = WREPL_TYPE_MHOMED,
3186 .state = WREPL_STATE_TOMBSTONE,
3187 .node = WREPL_NODE_B,
3189 .num_ips = ARRAY_SIZE(addresses_A_1),
3190 .ips = addresses_A_1,
3191 .apply_expected = False
3196 * sgroup,released vs. mhomed,active
3197 * => should be replaced
3200 .line = __location__,
3201 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3204 .type = WREPL_TYPE_SGROUP,
3205 .state = WREPL_STATE_RELEASED,
3206 .node = WREPL_NODE_B,
3208 .num_ips = ARRAY_SIZE(addresses_A_1),
3209 .ips = addresses_A_1,
3210 .apply_expected = False
3214 .type = WREPL_TYPE_MHOMED,
3215 .state = WREPL_STATE_ACTIVE,
3216 .node = WREPL_NODE_B,
3218 .num_ips = ARRAY_SIZE(addresses_B_1),
3219 .ips = addresses_B_1,
3220 .apply_expected = True
3225 * sgroup,released vs. mhomed,tombstone
3226 * => should be replaced
3229 .line = __location__,
3230 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3233 .type = WREPL_TYPE_SGROUP,
3234 .state = WREPL_STATE_RELEASED,
3235 .node = WREPL_NODE_B,
3237 .num_ips = ARRAY_SIZE(addresses_B_1),
3238 .ips = addresses_B_1,
3239 .apply_expected = False
3243 .type = WREPL_TYPE_MHOMED,
3244 .state = WREPL_STATE_TOMBSTONE,
3245 .node = WREPL_NODE_B,
3247 .num_ips = ARRAY_SIZE(addresses_A_1),
3248 .ips = addresses_A_1,
3249 .apply_expected = True
3254 * sgroup,tombstone vs. mhomed,active
3255 * => should be replaced
3258 .line = __location__,
3259 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3262 .type = WREPL_TYPE_SGROUP,
3263 .state = WREPL_STATE_TOMBSTONE,
3264 .node = WREPL_NODE_B,
3266 .num_ips = ARRAY_SIZE(addresses_A_1),
3267 .ips = addresses_A_1,
3268 .apply_expected = True
3272 .type = WREPL_TYPE_MHOMED,
3273 .state = WREPL_STATE_ACTIVE,
3274 .node = WREPL_NODE_B,
3276 .num_ips = ARRAY_SIZE(addresses_B_1),
3277 .ips = addresses_B_1,
3278 .apply_expected = True
3283 * sgroup,tombstone vs. mhomed,tombstone
3284 * => should be replaced
3287 .line = __location__,
3288 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3291 .type = WREPL_TYPE_SGROUP,
3292 .state = WREPL_STATE_TOMBSTONE,
3293 .node = WREPL_NODE_B,
3295 .num_ips = ARRAY_SIZE(addresses_B_1),
3296 .ips = addresses_B_1,
3297 .apply_expected = True
3301 .type = WREPL_TYPE_MHOMED,
3302 .state = WREPL_STATE_TOMBSTONE,
3303 .node = WREPL_NODE_B,
3305 .num_ips = ARRAY_SIZE(addresses_A_1),
3306 .ips = addresses_A_1,
3307 .apply_expected = True
3312 * multi homed vs. unique section,
3315 * mhomed,active vs. unique,active
3316 * => should be replaced
3319 .line = __location__,
3320 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3323 .type = WREPL_TYPE_MHOMED,
3324 .state = WREPL_STATE_ACTIVE,
3325 .node = WREPL_NODE_B,
3327 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3328 .ips = addresses_A_3_4,
3329 .apply_expected = True
3333 .type = WREPL_TYPE_UNIQUE,
3334 .state = WREPL_STATE_ACTIVE,
3335 .node = WREPL_NODE_B,
3337 .num_ips = ARRAY_SIZE(addresses_B_1),
3338 .ips = addresses_B_1,
3339 .apply_expected = True
3344 * mhomed,active vs. unique,tombstone
3345 * => should NOT be replaced
3348 .line = __location__,
3349 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3352 .type = WREPL_TYPE_MHOMED,
3353 .state = WREPL_STATE_ACTIVE,
3354 .node = WREPL_NODE_B,
3356 .num_ips = ARRAY_SIZE(addresses_B_1),
3357 .ips = addresses_B_1,
3358 .apply_expected = True
3362 .type = WREPL_TYPE_UNIQUE,
3363 .state = WREPL_STATE_TOMBSTONE,
3364 .node = WREPL_NODE_B,
3366 .num_ips = ARRAY_SIZE(addresses_B_1),
3367 .ips = addresses_B_1,
3368 .apply_expected = False
3373 * mhomed,released vs. unique,active
3374 * => should be replaced
3377 .line = __location__,
3378 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3381 .type = WREPL_TYPE_MHOMED,
3382 .state = WREPL_STATE_RELEASED,
3383 .node = WREPL_NODE_B,
3385 .num_ips = ARRAY_SIZE(addresses_A_1),
3386 .ips = addresses_A_1,
3387 .apply_expected = False
3391 .type = WREPL_TYPE_UNIQUE,
3392 .state = WREPL_STATE_ACTIVE,
3393 .node = WREPL_NODE_B,
3395 .num_ips = ARRAY_SIZE(addresses_B_1),
3396 .ips = addresses_B_1,
3397 .apply_expected = True
3402 * mhomed,released vs. uinique,tombstone
3403 * => should be replaced
3406 .line = __location__,
3407 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3410 .type = WREPL_TYPE_MHOMED,
3411 .state = WREPL_STATE_RELEASED,
3412 .node = WREPL_NODE_B,
3414 .num_ips = ARRAY_SIZE(addresses_B_1),
3415 .ips = addresses_B_1,
3416 .apply_expected = False
3420 .type = WREPL_TYPE_UNIQUE,
3421 .state = WREPL_STATE_TOMBSTONE,
3422 .node = WREPL_NODE_B,
3424 .num_ips = ARRAY_SIZE(addresses_A_1),
3425 .ips = addresses_A_1,
3426 .apply_expected = True
3431 * mhomed,tombstone vs. unique,active
3432 * => should be replaced
3435 .line = __location__,
3436 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3439 .type = WREPL_TYPE_MHOMED,
3440 .state = WREPL_STATE_TOMBSTONE,
3441 .node = WREPL_NODE_B,
3443 .num_ips = ARRAY_SIZE(addresses_A_1),
3444 .ips = addresses_A_1,
3445 .apply_expected = True
3449 .type = WREPL_TYPE_UNIQUE,
3450 .state = WREPL_STATE_ACTIVE,
3451 .node = WREPL_NODE_B,
3453 .num_ips = ARRAY_SIZE(addresses_B_1),
3454 .ips = addresses_B_1,
3455 .apply_expected = True
3460 * mhomed,tombstone vs. uinique,tombstone
3461 * => should be replaced
3464 .line = __location__,
3465 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3468 .type = WREPL_TYPE_MHOMED,
3469 .state = WREPL_STATE_TOMBSTONE,
3470 .node = WREPL_NODE_B,
3472 .num_ips = ARRAY_SIZE(addresses_B_1),
3473 .ips = addresses_B_1,
3474 .apply_expected = True
3478 .type = WREPL_TYPE_UNIQUE,
3479 .state = WREPL_STATE_TOMBSTONE,
3480 .node = WREPL_NODE_B,
3482 .num_ips = ARRAY_SIZE(addresses_A_1),
3483 .ips = addresses_A_1,
3484 .apply_expected = True
3489 * multi homed vs. normal group section,
3492 * mhomed,active vs. group,active
3493 * => should be replaced
3496 .line = __location__,
3497 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3500 .type = WREPL_TYPE_MHOMED,
3501 .state = WREPL_STATE_ACTIVE,
3502 .node = WREPL_NODE_B,
3504 .num_ips = ARRAY_SIZE(addresses_A_1),
3505 .ips = addresses_A_1,
3506 .apply_expected = True
3510 .type = WREPL_TYPE_GROUP,
3511 .state = WREPL_STATE_ACTIVE,
3512 .node = WREPL_NODE_B,
3514 .num_ips = ARRAY_SIZE(addresses_B_1),
3515 .ips = addresses_B_1,
3516 .apply_expected = True
3521 * mhomed,active vs. group,tombstone
3522 * => should NOT be replaced
3525 .line = __location__,
3526 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3529 .type = WREPL_TYPE_MHOMED,
3530 .state = WREPL_STATE_ACTIVE,
3531 .node = WREPL_NODE_B,
3533 .num_ips = ARRAY_SIZE(addresses_B_1),
3534 .ips = addresses_B_1,
3535 .apply_expected = True
3539 .type = WREPL_TYPE_GROUP,
3540 .state = WREPL_STATE_TOMBSTONE,
3541 .node = WREPL_NODE_B,
3543 .num_ips = ARRAY_SIZE(addresses_B_1),
3544 .ips = addresses_B_1,
3545 .apply_expected = False
3550 * mhomed,released vs. group,active
3551 * => should be replaced
3554 .line = __location__,
3555 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3558 .type = WREPL_TYPE_MHOMED,
3559 .state = WREPL_STATE_RELEASED,
3560 .node = WREPL_NODE_B,
3562 .num_ips = ARRAY_SIZE(addresses_B_1),
3563 .ips = addresses_B_1,
3564 .apply_expected = False
3568 .type = WREPL_TYPE_GROUP,
3569 .state = WREPL_STATE_ACTIVE,
3570 .node = WREPL_NODE_B,
3572 .num_ips = ARRAY_SIZE(addresses_A_1),
3573 .ips = addresses_A_1,
3574 .apply_expected = True
3579 * mhomed,released vs. group,tombstone
3580 * => should be replaced
3583 .line = __location__,
3584 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3587 .type = WREPL_TYPE_MHOMED,
3588 .state = WREPL_STATE_RELEASED,
3589 .node = WREPL_NODE_B,
3591 .num_ips = ARRAY_SIZE(addresses_A_1),
3592 .ips = addresses_A_1,
3593 .apply_expected = False
3597 .type = WREPL_TYPE_GROUP,
3598 .state = WREPL_STATE_TOMBSTONE,
3599 .node = WREPL_NODE_B,
3601 .num_ips = ARRAY_SIZE(addresses_B_1),
3602 .ips = addresses_B_1,
3603 .apply_expected = True
3608 * mhomed,tombstone vs. group,active
3609 * => should be replaced
3612 .line = __location__,
3613 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3616 .type = WREPL_TYPE_MHOMED,
3617 .state = WREPL_STATE_TOMBSTONE,
3618 .node = WREPL_NODE_B,
3620 .num_ips = ARRAY_SIZE(addresses_B_1),
3621 .ips = addresses_B_1,
3622 .apply_expected = True
3626 .type = WREPL_TYPE_GROUP,
3627 .state = WREPL_STATE_ACTIVE,
3628 .node = WREPL_NODE_B,
3630 .num_ips = ARRAY_SIZE(addresses_A_1),
3631 .ips = addresses_A_1,
3632 .apply_expected = True
3637 * mhomed,tombstone vs. group,tombstone
3638 * => should be replaced
3641 .line = __location__,
3642 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3645 .type = WREPL_TYPE_MHOMED,
3646 .state = WREPL_STATE_TOMBSTONE,
3647 .node = WREPL_NODE_B,
3649 .num_ips = ARRAY_SIZE(addresses_A_1),
3650 .ips = addresses_A_1,
3651 .apply_expected = True
3655 .type = WREPL_TYPE_GROUP,
3656 .state = WREPL_STATE_TOMBSTONE,
3657 .node = WREPL_NODE_B,
3659 .num_ips = ARRAY_SIZE(addresses_B_1),
3660 .ips = addresses_B_1,
3661 .apply_expected = True
3666 * multi homed vs. special group section,
3669 * mhomed,active vs. sgroup,active
3670 * => should NOT be replaced
3673 .line = __location__,
3674 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3677 .type = WREPL_TYPE_MHOMED,
3678 .state = WREPL_STATE_ACTIVE,
3679 .node = WREPL_NODE_B,
3681 .num_ips = ARRAY_SIZE(addresses_A_1),
3682 .ips = addresses_A_1,
3683 .apply_expected = True
3687 .type = WREPL_TYPE_SGROUP,
3688 .state = WREPL_STATE_ACTIVE,
3689 .node = WREPL_NODE_B,
3691 .num_ips = ARRAY_SIZE(addresses_A_1),
3692 .ips = addresses_A_1,
3693 .apply_expected = False
3698 * mhomed,active vs. sgroup,tombstone
3699 * => should NOT be replaced
3702 .line = __location__,
3703 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3706 .type = WREPL_TYPE_MHOMED,
3707 .state = WREPL_STATE_ACTIVE,
3708 .node = WREPL_NODE_B,
3710 .num_ips = ARRAY_SIZE(addresses_A_1),
3711 .ips = addresses_A_1,
3712 .apply_expected = True
3716 .type = WREPL_TYPE_SGROUP,
3717 .state = WREPL_STATE_TOMBSTONE,
3718 .node = WREPL_NODE_B,
3720 .num_ips = ARRAY_SIZE(addresses_A_1),
3721 .ips = addresses_A_1,
3722 .apply_expected = False
3727 * mhomed,released vs. sgroup,active
3728 * => should be replaced
3731 .line = __location__,
3732 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3735 .type = WREPL_TYPE_MHOMED,
3736 .state = WREPL_STATE_RELEASED,
3737 .node = WREPL_NODE_B,
3739 .num_ips = ARRAY_SIZE(addresses_A_1),
3740 .ips = addresses_A_1,
3741 .apply_expected = False
3745 .type = WREPL_TYPE_SGROUP,
3746 .state = WREPL_STATE_ACTIVE,
3747 .node = WREPL_NODE_B,
3749 .num_ips = ARRAY_SIZE(addresses_B_1),
3750 .ips = addresses_B_1,
3751 .apply_expected = True
3756 * mhomed,released vs. sgroup,tombstone
3757 * => should be replaced
3760 .line = __location__,
3761 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3764 .type = WREPL_TYPE_MHOMED,
3765 .state = WREPL_STATE_RELEASED,
3766 .node = WREPL_NODE_B,
3768 .num_ips = ARRAY_SIZE(addresses_B_1),
3769 .ips = addresses_B_1,
3770 .apply_expected = False
3774 .type = WREPL_TYPE_SGROUP,
3775 .state = WREPL_STATE_TOMBSTONE,
3776 .node = WREPL_NODE_B,
3778 .num_ips = ARRAY_SIZE(addresses_A_1),
3779 .ips = addresses_A_1,
3780 .apply_expected = True
3785 * mhomed,tombstone vs. sgroup,active
3786 * => should be replaced
3789 .line = __location__,
3790 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3793 .type = WREPL_TYPE_MHOMED,
3794 .state = WREPL_STATE_TOMBSTONE,
3795 .node = WREPL_NODE_B,
3797 .num_ips = ARRAY_SIZE(addresses_A_1),
3798 .ips = addresses_A_1,
3799 .apply_expected = True
3803 .type = WREPL_TYPE_SGROUP,
3804 .state = WREPL_STATE_ACTIVE,
3805 .node = WREPL_NODE_B,
3807 .num_ips = ARRAY_SIZE(addresses_B_1),
3808 .ips = addresses_B_1,
3809 .apply_expected = True
3814 * mhomed,tombstone vs. sgroup,tombstone
3815 * => should be replaced
3818 .line = __location__,
3819 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3822 .type = WREPL_TYPE_MHOMED,
3823 .state = WREPL_STATE_TOMBSTONE,
3824 .node = WREPL_NODE_B,
3826 .num_ips = ARRAY_SIZE(addresses_B_1),
3827 .ips = addresses_B_1,
3828 .apply_expected = True
3832 .type = WREPL_TYPE_SGROUP,
3833 .state = WREPL_STATE_TOMBSTONE,
3834 .node = WREPL_NODE_B,
3836 .num_ips = ARRAY_SIZE(addresses_A_1),
3837 .ips = addresses_A_1,
3838 .apply_expected = True
3843 * multi homed vs. mlti homed section,
3846 * mhomed,active vs. mhomed,active
3847 * => should be replaced
3850 .line = __location__,
3851 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3854 .type = WREPL_TYPE_MHOMED,
3855 .state = WREPL_STATE_ACTIVE,
3856 .node = WREPL_NODE_B,
3858 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3859 .ips = addresses_A_3_4,
3860 .apply_expected = True
3864 .type = WREPL_TYPE_MHOMED,
3865 .state = WREPL_STATE_ACTIVE,
3866 .node = WREPL_NODE_B,
3868 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3869 .ips = addresses_B_3_4,
3870 .apply_expected = True
3875 * mhomed,active vs. mhomed,tombstone
3876 * => should NOT be replaced
3879 .line = __location__,
3880 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3883 .type = WREPL_TYPE_MHOMED,
3884 .state = WREPL_STATE_ACTIVE,
3885 .node = WREPL_NODE_B,
3887 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3888 .ips = addresses_B_3_4,
3889 .apply_expected = True
3893 .type = WREPL_TYPE_MHOMED,
3894 .state = WREPL_STATE_TOMBSTONE,
3895 .node = WREPL_NODE_B,
3897 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3898 .ips = addresses_B_3_4,
3899 .apply_expected = False
3904 * mhomed,released vs. mhomed,active
3905 * => should be replaced
3908 .line = __location__,
3909 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3912 .type = WREPL_TYPE_MHOMED,
3913 .state = WREPL_STATE_RELEASED,
3914 .node = WREPL_NODE_B,
3916 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3917 .ips = addresses_B_3_4,
3918 .apply_expected = False
3922 .type = WREPL_TYPE_MHOMED,
3923 .state = WREPL_STATE_ACTIVE,
3924 .node = WREPL_NODE_B,
3926 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3927 .ips = addresses_A_3_4,
3928 .apply_expected = True
3933 * mhomed,released vs. mhomed,tombstone
3934 * => should be replaced
3937 .line = __location__,
3938 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3941 .type = WREPL_TYPE_MHOMED,
3942 .state = WREPL_STATE_RELEASED,
3943 .node = WREPL_NODE_B,
3945 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3946 .ips = addresses_A_3_4,
3947 .apply_expected = False
3951 .type = WREPL_TYPE_MHOMED,
3952 .state = WREPL_STATE_TOMBSTONE,
3953 .node = WREPL_NODE_B,
3955 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3956 .ips = addresses_B_3_4,
3957 .apply_expected = True
3962 * mhomed,tombstone vs. mhomed,active
3963 * => should be replaced
3966 .line = __location__,
3967 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3970 .type = WREPL_TYPE_MHOMED,
3971 .state = WREPL_STATE_TOMBSTONE,
3972 .node = WREPL_NODE_B,
3974 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3975 .ips = addresses_B_3_4,
3976 .apply_expected = True
3980 .type = WREPL_TYPE_MHOMED,
3981 .state = WREPL_STATE_ACTIVE,
3982 .node = WREPL_NODE_B,
3984 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3985 .ips = addresses_A_3_4,
3986 .apply_expected = True
3991 * mhomed,tombstone vs. mhomed,tombstone
3992 * => should be replaced
3995 .line = __location__,
3996 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3999 .type = WREPL_TYPE_MHOMED,
4000 .state = WREPL_STATE_TOMBSTONE,
4001 .node = WREPL_NODE_B,
4003 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4004 .ips = addresses_A_3_4,
4005 .apply_expected = True
4009 .type = WREPL_TYPE_MHOMED,
4010 .state = WREPL_STATE_TOMBSTONE,
4011 .node = WREPL_NODE_B,
4013 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4014 .ips = addresses_B_3_4,
4015 .apply_expected = True
4019 .line = __location__,
4020 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4024 .type = WREPL_TYPE_UNIQUE,
4025 .state = WREPL_STATE_TOMBSTONE,
4026 .node = WREPL_NODE_B,
4028 .num_ips = ARRAY_SIZE(addresses_B_1),
4029 .ips = addresses_B_1,
4030 .apply_expected = True,
4034 .type = WREPL_TYPE_UNIQUE,
4035 .state = WREPL_STATE_TOMBSTONE,
4036 .node = WREPL_NODE_B,
4038 .num_ips = ARRAY_SIZE(addresses_A_1),
4039 .ips = addresses_A_1,
4040 .apply_expected = True,
4044 * special group vs special group section,
4047 * sgroup,active vs. sgroup,active same addresses
4048 * => should be NOT replaced
4051 .line = __location__,
4052 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4053 .comment= "A:A_3_4 vs. B:A_3_4",
4057 .type = WREPL_TYPE_SGROUP,
4058 .state = WREPL_STATE_ACTIVE,
4059 .node = WREPL_NODE_B,
4061 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4062 .ips = addresses_A_3_4,
4063 .apply_expected = True
4067 .type = WREPL_TYPE_SGROUP,
4068 .state = WREPL_STATE_ACTIVE,
4069 .node = WREPL_NODE_B,
4071 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4072 .ips = addresses_A_3_4,
4073 .apply_expected = False,
4074 .sgroup_cleanup = True
4078 * sgroup,active vs. sgroup,active same addresses
4079 * => should be NOT replaced
4082 .line = __location__,
4083 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4084 .comment= "A:A_3_4 vs. B:NULL",
4088 .type = WREPL_TYPE_SGROUP,
4089 .state = WREPL_STATE_ACTIVE,
4090 .node = WREPL_NODE_B,
4092 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4093 .ips = addresses_A_3_4,
4094 .apply_expected = True
4098 .type = WREPL_TYPE_SGROUP,
4099 .state = WREPL_STATE_ACTIVE,
4100 .node = WREPL_NODE_B,
4104 .apply_expected = False,
4105 .sgroup_cleanup = True
4109 * sgroup,active vs. sgroup,active subset addresses, special case...
4110 * => should NOT be replaced
4113 .line = __location__,
4114 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4115 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4",
4119 .type = WREPL_TYPE_SGROUP,
4120 .state = WREPL_STATE_ACTIVE,
4121 .node = WREPL_NODE_B,
4123 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4124 .ips = addresses_A_3_4_X_3_4,
4125 .apply_expected = True,
4129 .type = WREPL_TYPE_SGROUP,
4130 .state = WREPL_STATE_ACTIVE,
4131 .node = WREPL_NODE_B,
4133 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4134 .ips = addresses_A_3_4,
4135 .apply_expected = False,
4139 .line = __location__,
4140 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4144 .type = WREPL_TYPE_SGROUP,
4145 .state = WREPL_STATE_ACTIVE,
4146 .node = WREPL_NODE_B,
4150 .apply_expected = False,
4154 .type = WREPL_TYPE_SGROUP,
4155 .state = WREPL_STATE_ACTIVE,
4156 .node = WREPL_NODE_B,
4160 .apply_expected = False,
4164 * sgroup,active vs. sgroup,active different addresses, but owner changed
4165 * => should be replaced
4168 .line = __location__,
4169 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4170 .comment= "A:B_3_4 vs. B:A_3_4",
4174 .type = WREPL_TYPE_SGROUP,
4175 .state = WREPL_STATE_ACTIVE,
4176 .node = WREPL_NODE_B,
4178 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4179 .ips = addresses_B_3_4,
4180 .apply_expected = True,
4184 .type = WREPL_TYPE_SGROUP,
4185 .state = WREPL_STATE_ACTIVE,
4186 .node = WREPL_NODE_B,
4188 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4189 .ips = addresses_A_3_4,
4190 .apply_expected = True,
4191 .sgroup_cleanup = True
4195 * sgroup,active vs. sgroup,active different addresses, but owner changed
4196 * => should be replaced
4199 .line = __location__,
4200 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4201 .comment= "A:A_3_4 vs. B:A_3_4_OWNER_B",
4205 .type = WREPL_TYPE_SGROUP,
4206 .state = WREPL_STATE_ACTIVE,
4207 .node = WREPL_NODE_B,
4209 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4210 .ips = addresses_A_3_4,
4211 .apply_expected = True,
4215 .type = WREPL_TYPE_SGROUP,
4216 .state = WREPL_STATE_ACTIVE,
4217 .node = WREPL_NODE_B,
4219 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4220 .ips = addresses_A_3_4_OWNER_B,
4221 .apply_expected = True,
4222 .sgroup_cleanup = True
4226 * sgroup,active vs. sgroup,active different addresses, but owner changed
4227 * => should be replaced
4230 .line = __location__,
4231 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4232 .comment= "A:A_3_4_OWNER_B vs. B:A_3_4",
4236 .type = WREPL_TYPE_SGROUP,
4237 .state = WREPL_STATE_ACTIVE,
4238 .node = WREPL_NODE_B,
4240 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4241 .ips = addresses_A_3_4_OWNER_B,
4242 .apply_expected = True,
4246 .type = WREPL_TYPE_SGROUP,
4247 .state = WREPL_STATE_ACTIVE,
4248 .node = WREPL_NODE_B,
4250 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4251 .ips = addresses_A_3_4,
4252 .apply_expected = True,
4253 .sgroup_cleanup = True
4257 * sgroup,active vs. sgroup,active different addresses
4258 * => should be merged
4261 .line = __location__,
4262 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4263 .comment= "A:A_3_4 vs. B:B_3_4 => C:A_3_4_B_3_4",
4267 .type = WREPL_TYPE_SGROUP,
4268 .state = WREPL_STATE_ACTIVE,
4269 .node = WREPL_NODE_B,
4271 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4272 .ips = addresses_A_3_4,
4273 .apply_expected = True,
4277 .type = WREPL_TYPE_SGROUP,
4278 .state = WREPL_STATE_ACTIVE,
4279 .node = WREPL_NODE_B,
4281 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4282 .ips = addresses_B_3_4,
4283 .sgroup_merge = True,
4284 .sgroup_cleanup = True,
4288 * sgroup,active vs. sgroup,active different addresses, special case...
4289 * => should be merged
4292 .line = __location__,
4293 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4294 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4_X_3_4",
4298 .type = WREPL_TYPE_SGROUP,
4299 .state = WREPL_STATE_ACTIVE,
4300 .node = WREPL_NODE_B,
4302 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4303 .ips = addresses_B_3_4_X_3_4,
4304 .apply_expected = True,
4308 .type = WREPL_TYPE_SGROUP,
4309 .state = WREPL_STATE_ACTIVE,
4310 .node = WREPL_NODE_B,
4312 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4313 .ips = addresses_A_3_4,
4314 .sgroup_merge = True,
4315 .merge_owner = &ctx->b,
4316 .sgroup_cleanup = False
4320 .line = __location__,
4321 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4325 .type = WREPL_TYPE_SGROUP,
4326 .state = WREPL_STATE_ACTIVE,
4327 .node = WREPL_NODE_B,
4329 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4_OWNER_B),
4330 .ips = addresses_A_3_4_X_3_4_OWNER_B,
4331 .apply_expected = True,
4335 .type = WREPL_TYPE_SGROUP,
4336 .state = WREPL_STATE_ACTIVE,
4337 .node = WREPL_NODE_B,
4341 .apply_expected = False,
4345 * sgroup,active vs. sgroup,active different addresses, special case...
4346 * => should be merged
4349 .line = __location__,
4350 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4351 .comment= "A:X_3_4 vs. B:A_3_4 => C:A_3_4_X_3_4",
4355 .type = WREPL_TYPE_SGROUP,
4356 .state = WREPL_STATE_ACTIVE,
4357 .node = WREPL_NODE_B,
4359 .num_ips = ARRAY_SIZE(addresses_X_3_4),
4360 .ips = addresses_X_3_4,
4361 .apply_expected = True,
4365 .type = WREPL_TYPE_SGROUP,
4366 .state = WREPL_STATE_ACTIVE,
4367 .node = WREPL_NODE_B,
4369 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4370 .ips = addresses_A_3_4,
4371 .sgroup_merge = True,
4372 .sgroup_cleanup = False
4376 .line = __location__,
4377 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4381 .type = WREPL_TYPE_SGROUP,
4382 .state = WREPL_STATE_ACTIVE,
4383 .node = WREPL_NODE_B,
4387 .apply_expected = False,
4391 .type = WREPL_TYPE_SGROUP,
4392 .state = WREPL_STATE_ACTIVE,
4393 .node = WREPL_NODE_B,
4397 .apply_expected = False,
4401 * sgroup,active vs. sgroup,active different addresses, special case...
4402 * => should be merged
4405 .line = __location__,
4406 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4407 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4_OWNER_B => B:A_3_4_OWNER_B_X_3_4",
4411 .type = WREPL_TYPE_SGROUP,
4412 .state = WREPL_STATE_ACTIVE,
4413 .node = WREPL_NODE_B,
4415 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4416 .ips = addresses_A_3_4_X_3_4,
4417 .apply_expected = True,
4421 .type = WREPL_TYPE_SGROUP,
4422 .state = WREPL_STATE_ACTIVE,
4423 .node = WREPL_NODE_B,
4425 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4426 .ips = addresses_A_3_4_OWNER_B,
4427 .sgroup_merge = True,
4428 .merge_owner = &ctx->b,
4432 .line = __location__,
4433 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4437 .type = WREPL_TYPE_SGROUP,
4438 .state = WREPL_STATE_ACTIVE,
4439 .node = WREPL_NODE_B,
4443 .apply_expected = False,
4447 .type = WREPL_TYPE_SGROUP,
4448 .state = WREPL_STATE_ACTIVE,
4449 .node = WREPL_NODE_B,
4453 .apply_expected = False,
4457 * sgroup,active vs. sgroup,active partly different addresses, special case...
4458 * => should be merged
4461 .line = __location__,
4462 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4463 .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",
4467 .type = WREPL_TYPE_SGROUP,
4468 .state = WREPL_STATE_ACTIVE,
4469 .node = WREPL_NODE_B,
4471 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4472 .ips = addresses_B_3_4_X_3_4,
4473 .apply_expected = True,
4477 .type = WREPL_TYPE_SGROUP,
4478 .state = WREPL_STATE_ACTIVE,
4479 .node = WREPL_NODE_B,
4481 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_1_2),
4482 .ips = addresses_B_3_4_X_1_2,
4483 .sgroup_merge = True,
4484 .sgroup_cleanup = False
4488 .line = __location__,
4489 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4493 .type = WREPL_TYPE_SGROUP,
4494 .state = WREPL_STATE_ACTIVE,
4495 .node = WREPL_NODE_B,
4499 .apply_expected = False,
4503 .type = WREPL_TYPE_SGROUP,
4504 .state = WREPL_STATE_ACTIVE,
4505 .node = WREPL_NODE_B,
4509 .apply_expected = False,
4513 * sgroup,active vs. sgroup,active different addresses, special case...
4514 * => should be merged
4517 .line = __location__,
4518 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4519 .comment= "A:A_3_4_B_3_4 vs. B:NULL => B:A_3_4",
4523 .type = WREPL_TYPE_SGROUP,
4524 .state = WREPL_STATE_ACTIVE,
4525 .node = WREPL_NODE_B,
4527 .num_ips = ARRAY_SIZE(addresses_A_3_4_B_3_4),
4528 .ips = addresses_A_3_4_B_3_4,
4529 .apply_expected = True,
4533 .type = WREPL_TYPE_SGROUP,
4534 .state = WREPL_STATE_ACTIVE,
4535 .node = WREPL_NODE_B,
4539 .sgroup_merge = True,
4540 .merge_owner = &ctx->b,
4541 .sgroup_cleanup = True
4545 .line = __location__,
4546 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4550 .type = WREPL_TYPE_SGROUP,
4551 .state = WREPL_STATE_ACTIVE,
4552 .node = WREPL_NODE_B,
4556 .apply_expected = False,
4560 .type = WREPL_TYPE_UNIQUE,
4561 .state = WREPL_STATE_TOMBSTONE,
4562 .node = WREPL_NODE_B,
4564 .num_ips = ARRAY_SIZE(addresses_A_1),
4565 .ips = addresses_A_1,
4566 .apply_expected = True,
4570 * sgroup,active vs. sgroup,active different addresses, special case...
4571 * => should be merged
4574 .line = __location__,
4575 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4576 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:X_3_4",
4580 .type = WREPL_TYPE_SGROUP,
4581 .state = WREPL_STATE_ACTIVE,
4582 .node = WREPL_NODE_B,
4584 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4585 .ips = addresses_B_3_4_X_3_4,
4586 .apply_expected = True,
4590 .type = WREPL_TYPE_SGROUP,
4591 .state = WREPL_STATE_ACTIVE,
4592 .node = WREPL_NODE_B,
4596 .sgroup_merge = True,
4597 .merge_owner = &ctx->b,
4598 .sgroup_cleanup = True
4602 .line = __location__,
4603 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4607 .type = WREPL_TYPE_SGROUP,
4608 .state = WREPL_STATE_ACTIVE,
4609 .node = WREPL_NODE_B,
4613 .apply_expected = False,
4617 .type = WREPL_TYPE_UNIQUE,
4618 .state = WREPL_STATE_TOMBSTONE,
4619 .node = WREPL_NODE_B,
4621 .num_ips = ARRAY_SIZE(addresses_A_1),
4622 .ips = addresses_A_1,
4623 .apply_expected = True,
4628 * sgroup,active vs. sgroup,tombstone different no addresses, special
4629 * => should be replaced
4632 .line = __location__,
4633 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4634 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:NULL",
4638 .type = WREPL_TYPE_SGROUP,
4639 .state = WREPL_STATE_ACTIVE,
4640 .node = WREPL_NODE_B,
4642 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4643 .ips = addresses_B_3_4_X_3_4,
4644 .apply_expected = True,
4648 .type = WREPL_TYPE_SGROUP,
4649 .state = WREPL_STATE_TOMBSTONE,
4650 .node = WREPL_NODE_B,
4654 .apply_expected = True,
4658 * sgroup,active vs. sgroup,tombstone different addresses
4659 * => should be replaced
4662 .line = __location__,
4663 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4664 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4",
4668 .type = WREPL_TYPE_SGROUP,
4669 .state = WREPL_STATE_ACTIVE,
4670 .node = WREPL_NODE_B,
4672 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4673 .ips = addresses_B_3_4_X_3_4,
4674 .apply_expected = True,
4678 .type = WREPL_TYPE_SGROUP,
4679 .state = WREPL_STATE_TOMBSTONE,
4680 .node = WREPL_NODE_B,
4682 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4683 .ips = addresses_A_3_4,
4684 .apply_expected = True,
4688 * sgroup,active vs. sgroup,tombstone subset addresses
4689 * => should be replaced
4692 .line = __location__,
4693 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4694 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4 => B:B_3_4",
4698 .type = WREPL_TYPE_SGROUP,
4699 .state = WREPL_STATE_ACTIVE,
4700 .node = WREPL_NODE_B,
4702 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4703 .ips = addresses_B_3_4_X_3_4,
4704 .apply_expected = True,
4708 .type = WREPL_TYPE_SGROUP,
4709 .state = WREPL_STATE_TOMBSTONE,
4710 .node = WREPL_NODE_B,
4712 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4713 .ips = addresses_B_3_4,
4714 .apply_expected = True,
4718 * sgroup,active vs. sgroup,active same addresses
4719 * => should be replaced
4722 .line = __location__,
4723 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4724 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4_X_3_4 => B:B_3_4_X_3_4",
4728 .type = WREPL_TYPE_SGROUP,
4729 .state = WREPL_STATE_ACTIVE,
4730 .node = WREPL_NODE_B,
4732 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4733 .ips = addresses_B_3_4_X_3_4,
4734 .apply_expected = True,
4738 .type = WREPL_TYPE_SGROUP,
4739 .state = WREPL_STATE_TOMBSTONE,
4740 .node = WREPL_NODE_B,
4742 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4743 .ips = addresses_B_3_4_X_3_4,
4744 .apply_expected = True,
4749 * This should be the last record in this array,
4750 * we need to make sure the we leave a tombstoned unique entry
4754 .line = __location__,
4755 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4759 .type = WREPL_TYPE_UNIQUE,
4760 .state = WREPL_STATE_TOMBSTONE,
4761 .node = WREPL_NODE_B,
4763 .num_ips = ARRAY_SIZE(addresses_A_1),
4764 .ips = addresses_A_1,
4765 .apply_expected = True
4769 .type = WREPL_TYPE_UNIQUE,
4770 .state = WREPL_STATE_TOMBSTONE,
4771 .node = WREPL_NODE_B,
4773 .num_ips = ARRAY_SIZE(addresses_A_1),
4774 .ips = addresses_A_1,
4775 .apply_expected = True
4777 }}; /* do not add entries here, this should be the last record! */
4779 wins_name_r1 = &wins_name1;
4780 wins_name_r2 = &wins_name2;
4782 printf("Test Replica Conflicts with different owners\n");
4784 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
4786 if (!records[i].extra && !records[i].cleanup) {
4787 /* we should test the worst cases */
4788 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
4789 printf("(%s) Programmer error, invalid record[%u]: %s\n",
4790 __location__, i, records[i].line);
4792 } else 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);
4799 if (!records[i].cleanup) {
4800 const char *expected;
4803 if (records[i].r2.sgroup_merge) {
4804 expected = "SGROUP_MERGE";
4805 } else if (records[i].r2.apply_expected) {
4806 expected = "REPLACE";
4808 expected = "NOT REPLACE";
4811 if (!records[i].r1.ips && !records[i].r2.ips) {
4812 ips = "with no ip(s)";
4813 } else if (records[i].r1.ips==records[i].r2.ips) {
4814 ips = "with same ip(s)";
4816 ips = "with different ip(s)";
4819 printf("%s,%s%s vs. %s,%s%s %s => %s\n",
4820 wrepl_name_type_string(records[i].r1.type),
4821 wrepl_name_state_string(records[i].r1.state),
4822 (records[i].r1.is_static?",static":""),
4823 wrepl_name_type_string(records[i].r2.type),
4824 wrepl_name_state_string(records[i].r2.state),
4825 (records[i].r2.is_static?",static":""),
4826 (records[i].comment?records[i].comment:ips),
4833 wins_name_r1->name = &records[i].name;
4834 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
4835 records[i].r1.state,
4837 records[i].r1.is_static);
4838 wins_name_r1->id = ++records[i].r1.owner->max_version;
4839 if (wins_name_r1->flags & 2) {
4840 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
4841 wins_name_r1->addresses.addresses.ips = discard_const(records[i].r1.ips);
4843 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
4845 wins_name_r1->unknown = "255.255.255.255";
4848 ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1);
4849 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4850 wins_name_r1, records[i].r1.apply_expected);
4855 wins_name_r2->name = &records[i].name;
4856 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
4857 records[i].r2.state,
4859 records[i].r2.is_static);
4860 wins_name_r2->id = ++records[i].r2.owner->max_version;
4861 if (wins_name_r2->flags & 2) {
4862 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
4863 wins_name_r2->addresses.addresses.ips = discard_const(records[i].r2.ips);
4865 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
4867 wins_name_r2->unknown = "255.255.255.255";
4870 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4871 if (records[i].r1.state == WREPL_STATE_RELEASED) {
4872 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4873 wins_name_r1, False);
4874 } else if (records[i].r2.sgroup_merge) {
4875 ret &= test_wrepl_sgroup_merged(ctx, records[i].r2.merge_owner,
4876 records[i].r1.owner,
4877 records[i].r1.num_ips, records[i].r1.ips,
4878 records[i].r2.owner,
4879 records[i].r2.num_ips, records[i].r2.ips,
4881 } else if (records[i].r1.owner != records[i].r2.owner) {
4883 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
4884 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4885 wins_name_r1, _expected);
4887 if (records[i].r2.state == WREPL_STATE_RELEASED) {
4888 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
4889 wins_name_r2, False);
4890 } else if (!records[i].r2.sgroup_merge) {
4891 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
4892 wins_name_r2, records[i].r2.apply_expected);
4895 if (records[i].r2.sgroup_cleanup) {
4897 printf("failed before sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4901 /* clean up the SGROUP record */
4902 wins_name_r1->name = &records[i].name;
4903 wins_name_r1->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4905 WREPL_NODE_B, False);
4906 wins_name_r1->id = ++records[i].r1.owner->max_version;
4907 wins_name_r1->addresses.addresses.num_ips = 0;
4908 wins_name_r1->addresses.addresses.ips = NULL;
4909 wins_name_r1->unknown = "255.255.255.255";
4910 ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1);
4912 /* here we test how names from an owner are deleted */
4913 if (records[i].r2.sgroup_merge && records[i].r2.num_ips) {
4914 ret &= test_wrepl_sgroup_merged(ctx, NULL,
4915 records[i].r2.owner,
4916 records[i].r2.num_ips, records[i].r2.ips,
4917 records[i].r1.owner,
4922 /* clean up the SGROUP record */
4923 wins_name_r2->name = &records[i].name;
4924 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4926 WREPL_NODE_B, False);
4927 wins_name_r2->id = ++records[i].r2.owner->max_version;
4928 wins_name_r2->addresses.addresses.num_ips = 0;
4929 wins_name_r2->addresses.addresses.ips = NULL;
4930 wins_name_r2->unknown = "255.255.255.255";
4931 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4933 /* take ownership of the SGROUP record */
4934 wins_name_r2->name = &records[i].name;
4935 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4937 WREPL_NODE_B, False);
4938 wins_name_r2->id = ++records[i].r2.owner->max_version;
4939 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4940 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4941 wins_name_r2->unknown = "255.255.255.255";
4942 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4943 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, True);
4945 /* overwrite the SGROUP record with unique,tombstone */
4946 wins_name_r2->name = &records[i].name;
4947 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4948 WREPL_STATE_TOMBSTONE,
4949 WREPL_NODE_B, False);
4950 wins_name_r2->id = ++records[i].r2.owner->max_version;
4951 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4952 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4953 wins_name_r2->unknown = "255.255.255.255";
4954 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4955 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, True);
4958 printf("failed in sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4963 /* the first one is a cleanup run */
4964 if (!ret && i == 0) ret = True;
4967 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
4975 static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_conn *ctx)
4979 struct wrepl_wins_name wins_name_;
4980 struct wrepl_wins_name *wins_name = &wins_name_;
4981 struct nbt_name_register name_register_;
4982 struct nbt_name_register *name_register = &name_register_;
4983 struct nbt_name_release release_;
4984 struct nbt_name_release *release = &release_;
4987 const char *line; /* just better debugging */
4988 struct nbt_name name;
4993 const struct wrepl_ip *ips;
4994 BOOL apply_expected;
4997 enum wrepl_name_type type;
4998 enum wrepl_name_state state;
4999 enum wrepl_name_node node;
5002 const struct wrepl_ip *ips;
5003 BOOL apply_expected;
5007 * unique vs. unique section
5010 * unique,released vs. unique,active with same ip(s)
5013 .line = __location__,
5014 .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL),
5018 .num_ips = ctx->addresses_best_num,
5019 .ips = ctx->addresses_best,
5020 .apply_expected = True
5023 .type = WREPL_TYPE_UNIQUE,
5024 .state = WREPL_STATE_ACTIVE,
5025 .node = WREPL_NODE_B,
5027 .num_ips = ctx->addresses_best_num,
5028 .ips = ctx->addresses_best,
5029 .apply_expected = True
5033 * unique,released vs. unique,active with different ip(s)
5036 .line = __location__,
5037 .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL),
5041 .num_ips = ctx->addresses_best_num,
5042 .ips = ctx->addresses_best,
5043 .apply_expected = True
5046 .type = WREPL_TYPE_UNIQUE,
5047 .state = WREPL_STATE_ACTIVE,
5048 .node = WREPL_NODE_B,
5050 .num_ips = ARRAY_SIZE(addresses_B_1),
5051 .ips = addresses_B_1,
5052 .apply_expected = True
5056 * unique,released vs. unique,tombstone with same ip(s)
5059 .line = __location__,
5060 .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL),
5064 .num_ips = ctx->addresses_best_num,
5065 .ips = ctx->addresses_best,
5066 .apply_expected = True
5069 .type = WREPL_TYPE_UNIQUE,
5070 .state = WREPL_STATE_TOMBSTONE,
5071 .node = WREPL_NODE_B,
5073 .num_ips = ctx->addresses_best_num,
5074 .ips = ctx->addresses_best,
5075 .apply_expected = True
5079 * unique,released vs. unique,tombstone with different ip(s)
5082 .line = __location__,
5083 .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL),
5087 .num_ips = ctx->addresses_best_num,
5088 .ips = ctx->addresses_best,
5089 .apply_expected = True
5092 .type = WREPL_TYPE_UNIQUE,
5093 .state = WREPL_STATE_TOMBSTONE,
5094 .node = WREPL_NODE_B,
5096 .num_ips = ARRAY_SIZE(addresses_B_1),
5097 .ips = addresses_B_1,
5098 .apply_expected = True
5102 * unique vs. group section
5105 * unique,released vs. group,active with same ip(s)
5108 .line = __location__,
5109 .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL),
5113 .num_ips = ctx->addresses_best_num,
5114 .ips = ctx->addresses_best,
5115 .apply_expected = True
5118 .type = WREPL_TYPE_GROUP,
5119 .state = WREPL_STATE_ACTIVE,
5120 .node = WREPL_NODE_B,
5122 .num_ips = ctx->addresses_best_num,
5123 .ips = ctx->addresses_best,
5124 .apply_expected = True
5128 * unique,released vs. group,active with different ip(s)
5131 .line = __location__,
5132 .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL),
5136 .num_ips = ctx->addresses_best_num,
5137 .ips = ctx->addresses_best,
5138 .apply_expected = True
5141 .type = WREPL_TYPE_GROUP,
5142 .state = WREPL_STATE_ACTIVE,
5143 .node = WREPL_NODE_B,
5145 .num_ips = ARRAY_SIZE(addresses_B_1),
5146 .ips = addresses_B_1,
5147 .apply_expected = True
5151 * unique,released vs. group,tombstone with same ip(s)
5154 .line = __location__,
5155 .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL),
5159 .num_ips = ctx->addresses_best_num,
5160 .ips = ctx->addresses_best,
5161 .apply_expected = True
5164 .type = WREPL_TYPE_GROUP,
5165 .state = WREPL_STATE_TOMBSTONE,
5166 .node = WREPL_NODE_B,
5168 .num_ips = ctx->addresses_best_num,
5169 .ips = ctx->addresses_best,
5170 .apply_expected = True
5174 * unique,released vs. group,tombstone with different ip(s)
5177 .line = __location__,
5178 .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL),
5182 .num_ips = ctx->addresses_best_num,
5183 .ips = ctx->addresses_best,
5184 .apply_expected = True
5187 .type = WREPL_TYPE_GROUP,
5188 .state = WREPL_STATE_TOMBSTONE,
5189 .node = WREPL_NODE_B,
5191 .num_ips = ARRAY_SIZE(addresses_B_1),
5192 .ips = addresses_B_1,
5193 .apply_expected = True
5197 * unique vs. special group section
5200 * unique,released vs. sgroup,active with same ip(s)
5203 .line = __location__,
5204 .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL),
5208 .num_ips = ctx->addresses_best_num,
5209 .ips = ctx->addresses_best,
5210 .apply_expected = True
5213 .type = WREPL_TYPE_SGROUP,
5214 .state = WREPL_STATE_ACTIVE,
5215 .node = WREPL_NODE_B,
5217 .num_ips = ctx->addresses_best_num,
5218 .ips = ctx->addresses_best,
5219 .apply_expected = True
5223 * unique,released vs. sgroup,active with different ip(s)
5226 .line = __location__,
5227 .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL),
5231 .num_ips = ctx->addresses_best_num,
5232 .ips = ctx->addresses_best,
5233 .apply_expected = True
5236 .type = WREPL_TYPE_SGROUP,
5237 .state = WREPL_STATE_ACTIVE,
5238 .node = WREPL_NODE_B,
5240 .num_ips = ARRAY_SIZE(addresses_B_1),
5241 .ips = addresses_B_1,
5242 .apply_expected = True
5246 * unique,released vs. sgroup,tombstone with same ip(s)
5249 .line = __location__,
5250 .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL),
5254 .num_ips = ctx->addresses_best_num,
5255 .ips = ctx->addresses_best,
5256 .apply_expected = True
5259 .type = WREPL_TYPE_SGROUP,
5260 .state = WREPL_STATE_TOMBSTONE,
5261 .node = WREPL_NODE_B,
5263 .num_ips = ctx->addresses_best_num,
5264 .ips = ctx->addresses_best,
5265 .apply_expected = True
5269 * unique,released vs. sgroup,tombstone with different ip(s)
5272 .line = __location__,
5273 .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL),
5277 .num_ips = ctx->addresses_best_num,
5278 .ips = ctx->addresses_best,
5279 .apply_expected = True
5282 .type = WREPL_TYPE_SGROUP,
5283 .state = WREPL_STATE_TOMBSTONE,
5284 .node = WREPL_NODE_B,
5286 .num_ips = ARRAY_SIZE(addresses_B_1),
5287 .ips = addresses_B_1,
5288 .apply_expected = True
5292 * unique vs. multi homed section
5295 * unique,released vs. mhomed,active with same ip(s)
5298 .line = __location__,
5299 .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL),
5303 .num_ips = ctx->addresses_best_num,
5304 .ips = ctx->addresses_best,
5305 .apply_expected = True
5308 .type = WREPL_TYPE_MHOMED,
5309 .state = WREPL_STATE_ACTIVE,
5310 .node = WREPL_NODE_B,
5312 .num_ips = ctx->addresses_best_num,
5313 .ips = ctx->addresses_best,
5314 .apply_expected = True
5318 * unique,released vs. mhomed,active with different ip(s)
5321 .line = __location__,
5322 .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL),
5326 .num_ips = ctx->addresses_best_num,
5327 .ips = ctx->addresses_best,
5328 .apply_expected = True
5331 .type = WREPL_TYPE_MHOMED,
5332 .state = WREPL_STATE_ACTIVE,
5333 .node = WREPL_NODE_B,
5335 .num_ips = ARRAY_SIZE(addresses_B_1),
5336 .ips = addresses_B_1,
5337 .apply_expected = True
5341 * unique,released vs. mhomed,tombstone with same ip(s)
5344 .line = __location__,
5345 .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL),
5349 .num_ips = ctx->addresses_best_num,
5350 .ips = ctx->addresses_best,
5351 .apply_expected = True
5354 .type = WREPL_TYPE_MHOMED,
5355 .state = WREPL_STATE_TOMBSTONE,
5356 .node = WREPL_NODE_B,
5358 .num_ips = ctx->addresses_best_num,
5359 .ips = ctx->addresses_best,
5360 .apply_expected = True
5364 * unique,released vs. mhomed,tombstone with different ip(s)
5367 .line = __location__,
5368 .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL),
5372 .num_ips = ctx->addresses_best_num,
5373 .ips = ctx->addresses_best,
5374 .apply_expected = True
5377 .type = WREPL_TYPE_MHOMED,
5378 .state = WREPL_STATE_TOMBSTONE,
5379 .node = WREPL_NODE_B,
5381 .num_ips = ARRAY_SIZE(addresses_B_1),
5382 .ips = addresses_B_1,
5383 .apply_expected = True
5387 * group vs. unique section
5390 * group,released vs. unique,active with same ip(s)
5393 .line = __location__,
5394 .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL),
5396 .nb_flags = NBT_NM_GROUP,
5398 .num_ips = ctx->addresses_best_num,
5399 .ips = ctx->addresses_best,
5400 .apply_expected = True
5403 .type = WREPL_TYPE_UNIQUE,
5404 .state = WREPL_STATE_ACTIVE,
5405 .node = WREPL_NODE_B,
5407 .num_ips = ctx->addresses_best_num,
5408 .ips = ctx->addresses_best,
5409 .apply_expected = False
5413 * group,released vs. unique,active with different ip(s)
5416 .line = __location__,
5417 .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL),
5419 .nb_flags = NBT_NM_GROUP,
5421 .num_ips = ctx->addresses_best_num,
5422 .ips = ctx->addresses_best,
5423 .apply_expected = True
5426 .type = WREPL_TYPE_UNIQUE,
5427 .state = WREPL_STATE_ACTIVE,
5428 .node = WREPL_NODE_B,
5430 .num_ips = ARRAY_SIZE(addresses_B_1),
5431 .ips = addresses_B_1,
5432 .apply_expected = False
5436 * group,released vs. unique,tombstone with same ip(s)
5439 .line = __location__,
5440 .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL),
5442 .nb_flags = NBT_NM_GROUP,
5444 .num_ips = ctx->addresses_best_num,
5445 .ips = ctx->addresses_best,
5446 .apply_expected = True
5449 .type = WREPL_TYPE_UNIQUE,
5450 .state = WREPL_STATE_TOMBSTONE,
5451 .node = WREPL_NODE_B,
5453 .num_ips = ctx->addresses_best_num,
5454 .ips = ctx->addresses_best,
5455 .apply_expected = False
5459 * group,released vs. unique,tombstone with different ip(s)
5462 .line = __location__,
5463 .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL),
5465 .nb_flags = NBT_NM_GROUP,
5467 .num_ips = ctx->addresses_best_num,
5468 .ips = ctx->addresses_best,
5469 .apply_expected = True
5472 .type = WREPL_TYPE_UNIQUE,
5473 .state = WREPL_STATE_TOMBSTONE,
5474 .node = WREPL_NODE_B,
5476 .num_ips = ARRAY_SIZE(addresses_B_1),
5477 .ips = addresses_B_1,
5478 .apply_expected = False
5482 * group vs. group section
5485 * group,released vs. group,active with same ip(s)
5488 .line = __location__,
5489 .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL),
5491 .nb_flags = NBT_NM_GROUP,
5493 .num_ips = ctx->addresses_best_num,
5494 .ips = ctx->addresses_best,
5495 .apply_expected = True
5498 .type = WREPL_TYPE_GROUP,
5499 .state = WREPL_STATE_ACTIVE,
5500 .node = WREPL_NODE_B,
5502 .num_ips = ctx->addresses_best_num,
5503 .ips = ctx->addresses_best,
5504 .apply_expected = True
5508 * group,released vs. group,active with different ip(s)
5511 .line = __location__,
5512 .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL),
5514 .nb_flags = NBT_NM_GROUP,
5516 .num_ips = ctx->addresses_best_num,
5517 .ips = ctx->addresses_best,
5518 .apply_expected = True
5521 .type = WREPL_TYPE_GROUP,
5522 .state = WREPL_STATE_ACTIVE,
5523 .node = WREPL_NODE_B,
5525 .num_ips = ARRAY_SIZE(addresses_B_1),
5526 .ips = addresses_B_1,
5527 .apply_expected = True
5531 * group,released vs. group,tombstone with same ip(s)
5534 .line = __location__,
5535 .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL),
5537 .nb_flags = NBT_NM_GROUP,
5539 .num_ips = ctx->addresses_best_num,
5540 .ips = ctx->addresses_best,
5541 .apply_expected = True
5544 .type = WREPL_TYPE_GROUP,
5545 .state = WREPL_STATE_TOMBSTONE,
5546 .node = WREPL_NODE_B,
5548 .num_ips = ctx->addresses_best_num,
5549 .ips = ctx->addresses_best,
5550 .apply_expected = True
5554 * group,released vs. group,tombstone with different ip(s)
5557 .line = __location__,
5558 .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL),
5560 .nb_flags = NBT_NM_GROUP,
5562 .num_ips = ctx->addresses_best_num,
5563 .ips = ctx->addresses_best,
5564 .apply_expected = True
5567 .type = WREPL_TYPE_GROUP,
5568 .state = WREPL_STATE_TOMBSTONE,
5569 .node = WREPL_NODE_B,
5571 .num_ips = ARRAY_SIZE(addresses_B_1),
5572 .ips = addresses_B_1,
5573 .apply_expected = True
5577 * group vs. special group section
5580 * group,released vs. sgroup,active with same ip(s)
5583 .line = __location__,
5584 .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL),
5586 .nb_flags = NBT_NM_GROUP,
5588 .num_ips = ctx->addresses_best_num,
5589 .ips = ctx->addresses_best,
5590 .apply_expected = True
5593 .type = WREPL_TYPE_SGROUP,
5594 .state = WREPL_STATE_ACTIVE,
5595 .node = WREPL_NODE_B,
5597 .num_ips = ctx->addresses_best_num,
5598 .ips = ctx->addresses_best,
5599 .apply_expected = False
5603 * group,released vs. sgroup,active with different ip(s)
5606 .line = __location__,
5607 .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL),
5609 .nb_flags = NBT_NM_GROUP,
5611 .num_ips = ctx->addresses_best_num,
5612 .ips = ctx->addresses_best,
5613 .apply_expected = True
5616 .type = WREPL_TYPE_SGROUP,
5617 .state = WREPL_STATE_ACTIVE,
5618 .node = WREPL_NODE_B,
5620 .num_ips = ARRAY_SIZE(addresses_B_1),
5621 .ips = addresses_B_1,
5622 .apply_expected = False
5626 * group,released vs. sgroup,tombstone with same ip(s)
5629 .line = __location__,
5630 .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL),
5632 .nb_flags = NBT_NM_GROUP,
5634 .num_ips = ctx->addresses_best_num,
5635 .ips = ctx->addresses_best,
5636 .apply_expected = True
5639 .type = WREPL_TYPE_SGROUP,
5640 .state = WREPL_STATE_TOMBSTONE,
5641 .node = WREPL_NODE_B,
5643 .num_ips = ctx->addresses_best_num,
5644 .ips = ctx->addresses_best,
5645 .apply_expected = False
5649 * group,released vs. sgroup,tombstone with different ip(s)
5652 .line = __location__,
5653 .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL),
5655 .nb_flags = NBT_NM_GROUP,
5657 .num_ips = ctx->addresses_best_num,
5658 .ips = ctx->addresses_best,
5659 .apply_expected = True
5662 .type = WREPL_TYPE_SGROUP,
5663 .state = WREPL_STATE_TOMBSTONE,
5664 .node = WREPL_NODE_B,
5666 .num_ips = ARRAY_SIZE(addresses_B_1),
5667 .ips = addresses_B_1,
5668 .apply_expected = False
5672 * group vs. multi homed section
5675 * group,released vs. mhomed,active with same ip(s)
5678 .line = __location__,
5679 .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL),
5681 .nb_flags = NBT_NM_GROUP,
5683 .num_ips = ctx->addresses_best_num,
5684 .ips = ctx->addresses_best,
5685 .apply_expected = True
5688 .type = WREPL_TYPE_MHOMED,
5689 .state = WREPL_STATE_ACTIVE,
5690 .node = WREPL_NODE_B,
5692 .num_ips = ctx->addresses_best_num,
5693 .ips = ctx->addresses_best,
5694 .apply_expected = False
5698 * group,released vs. mhomed,active with different ip(s)
5701 .line = __location__,
5702 .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL),
5704 .nb_flags = NBT_NM_GROUP,
5706 .num_ips = ctx->addresses_best_num,
5707 .ips = ctx->addresses_best,
5708 .apply_expected = True
5711 .type = WREPL_TYPE_MHOMED,
5712 .state = WREPL_STATE_ACTIVE,
5713 .node = WREPL_NODE_B,
5715 .num_ips = ARRAY_SIZE(addresses_B_1),
5716 .ips = addresses_B_1,
5717 .apply_expected = False
5721 * group,released vs. mhomed,tombstone with same ip(s)
5724 .line = __location__,
5725 .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL),
5727 .nb_flags = NBT_NM_GROUP,
5729 .num_ips = ctx->addresses_best_num,
5730 .ips = ctx->addresses_best,
5731 .apply_expected = True
5734 .type = WREPL_TYPE_MHOMED,
5735 .state = WREPL_STATE_TOMBSTONE,
5736 .node = WREPL_NODE_B,
5738 .num_ips = ctx->addresses_best_num,
5739 .ips = ctx->addresses_best,
5740 .apply_expected = False
5744 * group,released vs. mhomed,tombstone with different ip(s)
5747 .line = __location__,
5748 .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL),
5750 .nb_flags = NBT_NM_GROUP,
5752 .num_ips = ctx->addresses_best_num,
5753 .ips = ctx->addresses_best,
5754 .apply_expected = True
5757 .type = WREPL_TYPE_MHOMED,
5758 .state = WREPL_STATE_TOMBSTONE,
5759 .node = WREPL_NODE_B,
5761 .num_ips = ARRAY_SIZE(addresses_B_1),
5762 .ips = addresses_B_1,
5763 .apply_expected = False
5767 * special group vs. unique section
5770 * sgroup,released vs. unique,active with same ip(s)
5773 .line = __location__,
5774 .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL),
5776 .nb_flags = NBT_NM_GROUP,
5778 .num_ips = ctx->addresses_best_num,
5779 .ips = ctx->addresses_best,
5780 .apply_expected = True
5783 .type = WREPL_TYPE_UNIQUE,
5784 .state = WREPL_STATE_ACTIVE,
5785 .node = WREPL_NODE_B,
5787 .num_ips = ctx->addresses_best_num,
5788 .ips = ctx->addresses_best,
5789 .apply_expected = True
5793 * sgroup,released vs. unique,active with different ip(s)
5796 .line = __location__,
5797 .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL),
5799 .nb_flags = NBT_NM_GROUP,
5801 .num_ips = ctx->addresses_best_num,
5802 .ips = ctx->addresses_best,
5803 .apply_expected = True
5806 .type = WREPL_TYPE_UNIQUE,
5807 .state = WREPL_STATE_ACTIVE,
5808 .node = WREPL_NODE_B,
5810 .num_ips = ARRAY_SIZE(addresses_B_1),
5811 .ips = addresses_B_1,
5812 .apply_expected = True
5816 * sgroup,released vs. unique,tombstone with same ip(s)
5819 .line = __location__,
5820 .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL),
5822 .nb_flags = NBT_NM_GROUP,
5824 .num_ips = ctx->addresses_best_num,
5825 .ips = ctx->addresses_best,
5826 .apply_expected = True
5829 .type = WREPL_TYPE_UNIQUE,
5830 .state = WREPL_STATE_TOMBSTONE,
5831 .node = WREPL_NODE_B,
5833 .num_ips = ctx->addresses_best_num,
5834 .ips = ctx->addresses_best,
5835 .apply_expected = True
5839 * sgroup,released vs. unique,tombstone with different ip(s)
5842 .line = __location__,
5843 .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL),
5845 .nb_flags = NBT_NM_GROUP,
5847 .num_ips = ctx->addresses_best_num,
5848 .ips = ctx->addresses_best,
5849 .apply_expected = True
5852 .type = WREPL_TYPE_UNIQUE,
5853 .state = WREPL_STATE_TOMBSTONE,
5854 .node = WREPL_NODE_B,
5856 .num_ips = ARRAY_SIZE(addresses_B_1),
5857 .ips = addresses_B_1,
5858 .apply_expected = True
5862 * special group vs. group section
5865 * sgroup,released vs. group,active with same ip(s)
5868 .line = __location__,
5869 .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL),
5871 .nb_flags = NBT_NM_GROUP,
5873 .num_ips = ctx->addresses_best_num,
5874 .ips = ctx->addresses_best,
5875 .apply_expected = True
5878 .type = WREPL_TYPE_GROUP,
5879 .state = WREPL_STATE_ACTIVE,
5880 .node = WREPL_NODE_B,
5882 .num_ips = ctx->addresses_best_num,
5883 .ips = ctx->addresses_best,
5884 .apply_expected = True
5888 * sgroup,released vs. group,active with different ip(s)
5891 .line = __location__,
5892 .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL),
5894 .nb_flags = NBT_NM_GROUP,
5896 .num_ips = ctx->addresses_best_num,
5897 .ips = ctx->addresses_best,
5898 .apply_expected = True
5901 .type = WREPL_TYPE_GROUP,
5902 .state = WREPL_STATE_ACTIVE,
5903 .node = WREPL_NODE_B,
5905 .num_ips = ARRAY_SIZE(addresses_B_1),
5906 .ips = addresses_B_1,
5907 .apply_expected = True
5911 * sgroup,released vs. group,tombstone with same ip(s)
5914 .line = __location__,
5915 .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL),
5917 .nb_flags = NBT_NM_GROUP,
5919 .num_ips = ctx->addresses_best_num,
5920 .ips = ctx->addresses_best,
5921 .apply_expected = True
5924 .type = WREPL_TYPE_GROUP,
5925 .state = WREPL_STATE_TOMBSTONE,
5926 .node = WREPL_NODE_B,
5928 .num_ips = ctx->addresses_best_num,
5929 .ips = ctx->addresses_best,
5930 .apply_expected = True
5934 * sgroup,released vs. group,tombstone with different ip(s)
5937 .line = __location__,
5938 .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL),
5940 .nb_flags = NBT_NM_GROUP,
5942 .num_ips = ctx->addresses_best_num,
5943 .ips = ctx->addresses_best,
5944 .apply_expected = True
5947 .type = WREPL_TYPE_GROUP,
5948 .state = WREPL_STATE_TOMBSTONE,
5949 .node = WREPL_NODE_B,
5951 .num_ips = ARRAY_SIZE(addresses_B_1),
5952 .ips = addresses_B_1,
5953 .apply_expected = True
5957 * special group vs. special group section
5960 * sgroup,released vs. sgroup,active with same ip(s)
5963 .line = __location__,
5964 .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL),
5966 .nb_flags = NBT_NM_GROUP,
5968 .num_ips = ctx->addresses_best_num,
5969 .ips = ctx->addresses_best,
5970 .apply_expected = True
5973 .type = WREPL_TYPE_SGROUP,
5974 .state = WREPL_STATE_ACTIVE,
5975 .node = WREPL_NODE_B,
5977 .num_ips = ctx->addresses_best_num,
5978 .ips = ctx->addresses_best,
5979 .apply_expected = True
5983 * sgroup,released vs. sgroup,active with different ip(s)
5986 .line = __location__,
5987 .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL),
5989 .nb_flags = NBT_NM_GROUP,
5991 .num_ips = ctx->addresses_best_num,
5992 .ips = ctx->addresses_best,
5993 .apply_expected = True
5996 .type = WREPL_TYPE_SGROUP,
5997 .state = WREPL_STATE_ACTIVE,
5998 .node = WREPL_NODE_B,
6000 .num_ips = ARRAY_SIZE(addresses_B_1),
6001 .ips = addresses_B_1,
6002 .apply_expected = True
6006 * sgroup,released vs. sgroup,tombstone with same ip(s)
6009 .line = __location__,
6010 .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL),
6012 .nb_flags = NBT_NM_GROUP,
6014 .num_ips = ctx->addresses_best_num,
6015 .ips = ctx->addresses_best,
6016 .apply_expected = True
6019 .type = WREPL_TYPE_SGROUP,
6020 .state = WREPL_STATE_TOMBSTONE,
6021 .node = WREPL_NODE_B,
6023 .num_ips = ctx->addresses_best_num,
6024 .ips = ctx->addresses_best,
6025 .apply_expected = True
6029 * sgroup,released vs. sgroup,tombstone with different ip(s)
6032 .line = __location__,
6033 .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL),
6035 .nb_flags = NBT_NM_GROUP,
6037 .num_ips = ctx->addresses_best_num,
6038 .ips = ctx->addresses_best,
6039 .apply_expected = True
6042 .type = WREPL_TYPE_SGROUP,
6043 .state = WREPL_STATE_TOMBSTONE,
6044 .node = WREPL_NODE_B,
6046 .num_ips = ARRAY_SIZE(addresses_B_1),
6047 .ips = addresses_B_1,
6048 .apply_expected = True
6052 * special group vs. multi homed section
6055 * sgroup,released vs. mhomed,active with same ip(s)
6058 .line = __location__,
6059 .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL),
6061 .nb_flags = NBT_NM_GROUP,
6063 .num_ips = ctx->addresses_best_num,
6064 .ips = ctx->addresses_best,
6065 .apply_expected = True
6068 .type = WREPL_TYPE_MHOMED,
6069 .state = WREPL_STATE_ACTIVE,
6070 .node = WREPL_NODE_B,
6072 .num_ips = ctx->addresses_best_num,
6073 .ips = ctx->addresses_best,
6074 .apply_expected = True
6078 * sgroup,released vs. mhomed,active with different ip(s)
6081 .line = __location__,
6082 .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL),
6084 .nb_flags = NBT_NM_GROUP,
6086 .num_ips = ctx->addresses_best_num,
6087 .ips = ctx->addresses_best,
6088 .apply_expected = True
6091 .type = WREPL_TYPE_MHOMED,
6092 .state = WREPL_STATE_ACTIVE,
6093 .node = WREPL_NODE_B,
6095 .num_ips = ARRAY_SIZE(addresses_B_1),
6096 .ips = addresses_B_1,
6097 .apply_expected = True
6101 * sgroup,released vs. mhomed,tombstone with same ip(s)
6104 .line = __location__,
6105 .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL),
6107 .nb_flags = NBT_NM_GROUP,
6109 .num_ips = ctx->addresses_best_num,
6110 .ips = ctx->addresses_best,
6111 .apply_expected = True
6114 .type = WREPL_TYPE_MHOMED,
6115 .state = WREPL_STATE_TOMBSTONE,
6116 .node = WREPL_NODE_B,
6118 .num_ips = ctx->addresses_best_num,
6119 .ips = ctx->addresses_best,
6120 .apply_expected = True
6124 * sgroup,released vs. mhomed,tombstone with different ip(s)
6127 .line = __location__,
6128 .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL),
6130 .nb_flags = NBT_NM_GROUP,
6132 .num_ips = ctx->addresses_best_num,
6133 .ips = ctx->addresses_best,
6134 .apply_expected = True
6137 .type = WREPL_TYPE_MHOMED,
6138 .state = WREPL_STATE_TOMBSTONE,
6139 .node = WREPL_NODE_B,
6141 .num_ips = ARRAY_SIZE(addresses_B_1),
6142 .ips = addresses_B_1,
6143 .apply_expected = True
6147 * multi homed vs. unique section
6150 * mhomed,released vs. unique,active with same ip(s)
6153 .line = __location__,
6154 .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL),
6158 .num_ips = ctx->addresses_best_num,
6159 .ips = ctx->addresses_best,
6160 .apply_expected = True
6163 .type = WREPL_TYPE_UNIQUE,
6164 .state = WREPL_STATE_ACTIVE,
6165 .node = WREPL_NODE_B,
6167 .num_ips = ctx->addresses_best_num,
6168 .ips = ctx->addresses_best,
6169 .apply_expected = True
6173 * mhomed,released vs. unique,active with different ip(s)
6176 .line = __location__,
6177 .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL),
6181 .num_ips = ctx->addresses_best_num,
6182 .ips = ctx->addresses_best,
6183 .apply_expected = True
6186 .type = WREPL_TYPE_UNIQUE,
6187 .state = WREPL_STATE_ACTIVE,
6188 .node = WREPL_NODE_B,
6190 .num_ips = ARRAY_SIZE(addresses_B_1),
6191 .ips = addresses_B_1,
6192 .apply_expected = True
6196 * mhomed,released vs. unique,tombstone with same ip(s)
6199 .line = __location__,
6200 .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL),
6204 .num_ips = ctx->addresses_best_num,
6205 .ips = ctx->addresses_best,
6206 .apply_expected = True
6209 .type = WREPL_TYPE_UNIQUE,
6210 .state = WREPL_STATE_TOMBSTONE,
6211 .node = WREPL_NODE_B,
6213 .num_ips = ctx->addresses_best_num,
6214 .ips = ctx->addresses_best,
6215 .apply_expected = True
6219 * mhomed,released vs. unique,tombstone with different ip(s)
6222 .line = __location__,
6223 .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL),
6227 .num_ips = ctx->addresses_best_num,
6228 .ips = ctx->addresses_best,
6229 .apply_expected = True
6232 .type = WREPL_TYPE_UNIQUE,
6233 .state = WREPL_STATE_TOMBSTONE,
6234 .node = WREPL_NODE_B,
6236 .num_ips = ARRAY_SIZE(addresses_B_1),
6237 .ips = addresses_B_1,
6238 .apply_expected = True
6242 * multi homed vs. group section
6245 * mhomed,released vs. group,active with same ip(s)
6248 .line = __location__,
6249 .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL),
6253 .num_ips = ctx->addresses_best_num,
6254 .ips = ctx->addresses_best,
6255 .apply_expected = True
6258 .type = WREPL_TYPE_GROUP,
6259 .state = WREPL_STATE_ACTIVE,
6260 .node = WREPL_NODE_B,
6262 .num_ips = ctx->addresses_best_num,
6263 .ips = ctx->addresses_best,
6264 .apply_expected = True
6268 * mhomed,released vs. group,active with different ip(s)
6271 .line = __location__,
6272 .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL),
6276 .num_ips = ctx->addresses_best_num,
6277 .ips = ctx->addresses_best,
6278 .apply_expected = True
6281 .type = WREPL_TYPE_GROUP,
6282 .state = WREPL_STATE_ACTIVE,
6283 .node = WREPL_NODE_B,
6285 .num_ips = ARRAY_SIZE(addresses_B_1),
6286 .ips = addresses_B_1,
6287 .apply_expected = True
6291 * mhomed,released vs. group,tombstone with same ip(s)
6294 .line = __location__,
6295 .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL),
6299 .num_ips = ctx->addresses_best_num,
6300 .ips = ctx->addresses_best,
6301 .apply_expected = True
6304 .type = WREPL_TYPE_GROUP,
6305 .state = WREPL_STATE_TOMBSTONE,
6306 .node = WREPL_NODE_B,
6308 .num_ips = ctx->addresses_best_num,
6309 .ips = ctx->addresses_best,
6310 .apply_expected = True
6314 * mhomed,released vs. group,tombstone with different ip(s)
6317 .line = __location__,
6318 .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL),
6322 .num_ips = ctx->addresses_best_num,
6323 .ips = ctx->addresses_best,
6324 .apply_expected = True
6327 .type = WREPL_TYPE_GROUP,
6328 .state = WREPL_STATE_TOMBSTONE,
6329 .node = WREPL_NODE_B,
6331 .num_ips = ARRAY_SIZE(addresses_B_1),
6332 .ips = addresses_B_1,
6333 .apply_expected = True
6337 * multi homed vs. special group section
6340 * mhomed,released vs. sgroup,active with same ip(s)
6343 .line = __location__,
6344 .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL),
6348 .num_ips = ctx->addresses_best_num,
6349 .ips = ctx->addresses_best,
6350 .apply_expected = True
6353 .type = WREPL_TYPE_SGROUP,
6354 .state = WREPL_STATE_ACTIVE,
6355 .node = WREPL_NODE_B,
6357 .num_ips = ctx->addresses_best_num,
6358 .ips = ctx->addresses_best,
6359 .apply_expected = True
6363 * mhomed,released vs. sgroup,active with different ip(s)
6366 .line = __location__,
6367 .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL),
6371 .num_ips = ctx->addresses_best_num,
6372 .ips = ctx->addresses_best,
6373 .apply_expected = True
6376 .type = WREPL_TYPE_SGROUP,
6377 .state = WREPL_STATE_ACTIVE,
6378 .node = WREPL_NODE_B,
6380 .num_ips = ARRAY_SIZE(addresses_B_1),
6381 .ips = addresses_B_1,
6382 .apply_expected = True
6386 * mhomed,released vs. sgroup,tombstone with same ip(s)
6389 .line = __location__,
6390 .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL),
6394 .num_ips = ctx->addresses_best_num,
6395 .ips = ctx->addresses_best,
6396 .apply_expected = True
6399 .type = WREPL_TYPE_SGROUP,
6400 .state = WREPL_STATE_TOMBSTONE,
6401 .node = WREPL_NODE_B,
6403 .num_ips = ctx->addresses_best_num,
6404 .ips = ctx->addresses_best,
6405 .apply_expected = True
6409 * mhomed,released vs. sgroup,tombstone with different ip(s)
6412 .line = __location__,
6413 .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL),
6417 .num_ips = ctx->addresses_best_num,
6418 .ips = ctx->addresses_best,
6419 .apply_expected = True
6422 .type = WREPL_TYPE_SGROUP,
6423 .state = WREPL_STATE_TOMBSTONE,
6424 .node = WREPL_NODE_B,
6426 .num_ips = ARRAY_SIZE(addresses_B_1),
6427 .ips = addresses_B_1,
6428 .apply_expected = True
6432 * multi homed vs. multi homed section
6435 * mhomed,released vs. mhomed,active with same ip(s)
6438 .line = __location__,
6439 .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL),
6443 .num_ips = ctx->addresses_best_num,
6444 .ips = ctx->addresses_best,
6445 .apply_expected = True
6448 .type = WREPL_TYPE_MHOMED,
6449 .state = WREPL_STATE_ACTIVE,
6450 .node = WREPL_NODE_B,
6452 .num_ips = ctx->addresses_best_num,
6453 .ips = ctx->addresses_best,
6454 .apply_expected = True
6458 * mhomed,released vs. mhomed,active with different ip(s)
6461 .line = __location__,
6462 .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL),
6466 .num_ips = ctx->addresses_best_num,
6467 .ips = ctx->addresses_best,
6468 .apply_expected = True
6471 .type = WREPL_TYPE_MHOMED,
6472 .state = WREPL_STATE_ACTIVE,
6473 .node = WREPL_NODE_B,
6475 .num_ips = ARRAY_SIZE(addresses_B_1),
6476 .ips = addresses_B_1,
6477 .apply_expected = True
6481 * mhomed,released vs. mhomed,tombstone with same ip(s)
6484 .line = __location__,
6485 .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL),
6489 .num_ips = ctx->addresses_best_num,
6490 .ips = ctx->addresses_best,
6491 .apply_expected = True
6494 .type = WREPL_TYPE_MHOMED,
6495 .state = WREPL_STATE_TOMBSTONE,
6496 .node = WREPL_NODE_B,
6498 .num_ips = ctx->addresses_best_num,
6499 .ips = ctx->addresses_best,
6500 .apply_expected = True
6504 * mhomed,released vs. mhomed,tombstone with different ip(s)
6507 .line = __location__,
6508 .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL),
6512 .num_ips = ctx->addresses_best_num,
6513 .ips = ctx->addresses_best,
6514 .apply_expected = True
6517 .type = WREPL_TYPE_MHOMED,
6518 .state = WREPL_STATE_TOMBSTONE,
6519 .node = WREPL_NODE_B,
6521 .num_ips = ARRAY_SIZE(addresses_B_1),
6522 .ips = addresses_B_1,
6523 .apply_expected = True
6528 printf("Test Replica records vs. owned released records\n");
6530 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
6531 printf("%s => %s\n", nbt_name_string(ctx, &records[i].name),
6532 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
6537 name_register->in.name = records[i].name;
6538 name_register->in.dest_addr = ctx->address;
6539 name_register->in.address = records[i].wins.ips[0].ip;
6540 name_register->in.nb_flags = records[i].wins.nb_flags;
6541 name_register->in.register_demand= False;
6542 name_register->in.broadcast = False;
6543 name_register->in.multi_homed = records[i].wins.mhomed;
6544 name_register->in.ttl = 300000;
6545 name_register->in.timeout = 70;
6546 name_register->in.retries = 0;
6548 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
6549 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6550 printf("No response from %s for name register\n", ctx->address);
6553 if (!NT_STATUS_IS_OK(status)) {
6554 printf("Bad response from %s for name register - %s\n",
6555 ctx->address, nt_errstr(status));
6558 CHECK_VALUE(name_register->out.rcode, 0);
6559 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
6560 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
6561 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
6562 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
6563 CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[0].ip);
6565 /* release the record */
6566 release->in.name = records[i].name;
6567 release->in.dest_addr = ctx->address;
6568 release->in.address = records[i].wins.ips[0].ip;
6569 release->in.nb_flags = records[i].wins.nb_flags;
6570 release->in.broadcast = False;
6571 release->in.timeout = 30;
6572 release->in.retries = 0;
6574 status = nbt_name_release(ctx->nbtsock, ctx, release);
6575 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6576 printf("No response from %s for name release\n", ctx->address);
6579 if (!NT_STATUS_IS_OK(status)) {
6580 printf("Bad response from %s for name query - %s\n",
6581 ctx->address, nt_errstr(status));
6584 CHECK_VALUE(release->out.rcode, 0);
6589 wins_name->name = &records[i].name;
6590 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
6591 records[i].replica.state,
6592 records[i].replica.node,
6593 records[i].replica.is_static);
6594 wins_name->id = ++ctx->b.max_version;
6595 if (wins_name->flags & 2) {
6596 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
6597 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
6599 wins_name->addresses.ip = records[i].replica.ips[0].ip;
6601 wins_name->unknown = "255.255.255.255";
6603 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
6604 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
6605 records[i].replica.apply_expected);
6607 if (records[i].replica.apply_expected) {
6608 wins_name->name = &records[i].name;
6609 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
6610 WREPL_STATE_TOMBSTONE,
6611 WREPL_NODE_B, False);
6612 wins_name->id = ++ctx->b.max_version;
6613 wins_name->addresses.ip = addresses_B_1[0].ip;
6614 wins_name->unknown = "255.255.255.255";
6616 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
6617 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
6619 release->in.name = records[i].name;
6620 release->in.dest_addr = ctx->address;
6621 release->in.address = records[i].wins.ips[0].ip;
6622 release->in.nb_flags = records[i].wins.nb_flags;
6623 release->in.broadcast = False;
6624 release->in.timeout = 30;
6625 release->in.retries = 0;
6627 status = nbt_name_release(ctx->nbtsock, ctx, release);
6628 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6629 printf("No response from %s for name release\n", ctx->address);
6632 if (!NT_STATUS_IS_OK(status)) {
6633 printf("Bad response from %s for name query - %s\n",
6634 ctx->address, nt_errstr(status));
6637 CHECK_VALUE(release->out.rcode, 0);
6641 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
6649 struct test_conflict_owned_active_vs_replica_struct {
6650 const char *line; /* just better debugging */
6651 const char *section; /* just better debugging */
6652 struct nbt_name name;
6653 const char *comment;
6659 const struct wrepl_ip *ips;
6660 BOOL apply_expected;
6665 BOOL expect_release;
6668 /* when num_ips == 0, then .wins.ips are used */
6670 const struct wrepl_ip *ips;
6673 enum wrepl_name_type type;
6674 enum wrepl_name_state state;
6675 enum wrepl_name_node node;
6678 const struct wrepl_ip *ips;
6679 BOOL apply_expected;
6685 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
6686 struct nbt_name_packet *req_packet,
6687 struct socket_address *src);
6689 static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_conn *ctx)
6693 struct wrepl_wins_name wins_name_;
6694 struct wrepl_wins_name *wins_name = &wins_name_;
6695 struct nbt_name_register name_register_;
6696 struct nbt_name_register *name_register = &name_register_;
6697 struct nbt_name_release release_;
6698 struct nbt_name_release *release = &release_;
6700 struct test_conflict_owned_active_vs_replica_struct records[] = {
6702 * unique vs. unique section
6705 * unique,active vs. unique,active with same ip(s), unchecked
6708 .line = __location__,
6709 .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL),
6713 .num_ips = ctx->addresses_best_num,
6714 .ips = ctx->addresses_best,
6715 .apply_expected = True
6721 .type = WREPL_TYPE_UNIQUE,
6722 .state = WREPL_STATE_ACTIVE,
6723 .node = WREPL_NODE_B,
6725 .num_ips = ctx->addresses_best_num,
6726 .ips = ctx->addresses_best,
6727 .apply_expected = True
6731 * unique,active vs. unique,active with different ip(s), positive response
6734 .line = __location__,
6735 .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL),
6739 .num_ips = ctx->addresses_best_num,
6740 .ips = ctx->addresses_best,
6741 .apply_expected = True
6748 .type = WREPL_TYPE_UNIQUE,
6749 .state = WREPL_STATE_ACTIVE,
6750 .node = WREPL_NODE_B,
6752 .num_ips = ARRAY_SIZE(addresses_B_1),
6753 .ips = addresses_B_1,
6754 .apply_expected = False
6758 * unique,active vs. unique,active with different ip(s), positive response other ips
6761 .line = __location__,
6762 .name = _NBT_NAME("_UA_UA_DI_O", 0x00, NULL),
6766 .num_ips = ctx->addresses_best_num,
6767 .ips = ctx->addresses_best,
6768 .apply_expected = True
6773 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6774 .ips = addresses_A_3_4,
6777 .type = WREPL_TYPE_UNIQUE,
6778 .state = WREPL_STATE_ACTIVE,
6779 .node = WREPL_NODE_B,
6781 .num_ips = ARRAY_SIZE(addresses_B_1),
6782 .ips = addresses_B_1,
6783 .apply_expected = False
6787 * unique,active vs. unique,active with different ip(s), negative response
6790 .line = __location__,
6791 .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL),
6795 .num_ips = ctx->addresses_best_num,
6796 .ips = ctx->addresses_best,
6797 .apply_expected = True
6804 .type = WREPL_TYPE_UNIQUE,
6805 .state = WREPL_STATE_ACTIVE,
6806 .node = WREPL_NODE_B,
6808 .num_ips = ARRAY_SIZE(addresses_B_1),
6809 .ips = addresses_B_1,
6810 .apply_expected = True
6814 * unique,active vs. unique,tombstone with same ip(s), unchecked
6817 .line = __location__,
6818 .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL),
6822 .num_ips = ctx->addresses_best_num,
6823 .ips = ctx->addresses_best,
6824 .apply_expected = True
6830 .type = WREPL_TYPE_UNIQUE,
6831 .state = WREPL_STATE_TOMBSTONE,
6832 .node = WREPL_NODE_B,
6834 .num_ips = ctx->addresses_best_num,
6835 .ips = ctx->addresses_best,
6836 .apply_expected = False
6840 * unique,active vs. unique,tombstone with different ip(s), unchecked
6843 .line = __location__,
6844 .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL),
6848 .num_ips = ctx->addresses_best_num,
6849 .ips = ctx->addresses_best,
6850 .apply_expected = True
6856 .type = WREPL_TYPE_UNIQUE,
6857 .state = WREPL_STATE_TOMBSTONE,
6858 .node = WREPL_NODE_B,
6860 .num_ips = ARRAY_SIZE(addresses_B_1),
6861 .ips = addresses_B_1,
6862 .apply_expected = False
6866 * unique vs. group section
6869 * unique,active vs. group,active with same ip(s), release expected
6872 .line = __location__,
6873 .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL),
6877 .num_ips = ctx->addresses_best_num,
6878 .ips = ctx->addresses_best,
6879 .apply_expected = True
6883 .expect_release = True,
6886 .type = WREPL_TYPE_GROUP,
6887 .state = WREPL_STATE_ACTIVE,
6888 .node = WREPL_NODE_B,
6890 .num_ips = ctx->addresses_best_num,
6891 .ips = ctx->addresses_best,
6892 .apply_expected = True
6896 * unique,active vs. group,active with different ip(s), release expected
6899 .line = __location__,
6900 .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL),
6904 .num_ips = ctx->addresses_best_num,
6905 .ips = ctx->addresses_best,
6906 .apply_expected = True
6910 .expect_release = True,
6913 .type = WREPL_TYPE_GROUP,
6914 .state = WREPL_STATE_ACTIVE,
6915 .node = WREPL_NODE_B,
6917 .num_ips = ARRAY_SIZE(addresses_B_1),
6918 .ips = addresses_B_1,
6919 .apply_expected = True
6923 * unique,active vs. group,tombstone with same ip(s), unchecked
6926 .line = __location__,
6927 .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL),
6931 .num_ips = ctx->addresses_best_num,
6932 .ips = ctx->addresses_best,
6933 .apply_expected = True
6939 .type = WREPL_TYPE_GROUP,
6940 .state = WREPL_STATE_TOMBSTONE,
6941 .node = WREPL_NODE_B,
6943 .num_ips = ctx->addresses_best_num,
6944 .ips = ctx->addresses_best,
6945 .apply_expected = False
6949 * unique,active vs. group,tombstone with different ip(s), unchecked
6952 .line = __location__,
6953 .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL),
6957 .num_ips = ctx->addresses_best_num,
6958 .ips = ctx->addresses_best,
6959 .apply_expected = True
6965 .type = WREPL_TYPE_GROUP,
6966 .state = WREPL_STATE_TOMBSTONE,
6967 .node = WREPL_NODE_B,
6969 .num_ips = ARRAY_SIZE(addresses_B_1),
6970 .ips = addresses_B_1,
6971 .apply_expected = False
6975 * unique vs. special group section
6978 * unique,active vs. sgroup,active with same ip(s), release expected
6981 .line = __location__,
6982 .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL),
6986 .num_ips = ctx->addresses_best_num,
6987 .ips = ctx->addresses_best,
6988 .apply_expected = True
6992 .expect_release = True,
6995 .type = WREPL_TYPE_SGROUP,
6996 .state = WREPL_STATE_ACTIVE,
6997 .node = WREPL_NODE_B,
6999 .num_ips = ctx->addresses_best_num,
7000 .ips = ctx->addresses_best,
7001 .apply_expected = True
7005 * unique,active vs. group,active with different ip(s), release expected
7008 .line = __location__,
7009 .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL),
7013 .num_ips = ctx->addresses_best_num,
7014 .ips = ctx->addresses_best,
7015 .apply_expected = True
7019 .expect_release = True,
7022 .type = WREPL_TYPE_SGROUP,
7023 .state = WREPL_STATE_ACTIVE,
7024 .node = WREPL_NODE_B,
7026 .num_ips = ARRAY_SIZE(addresses_B_1),
7027 .ips = addresses_B_1,
7028 .apply_expected = True
7032 * unique,active vs. sgroup,tombstone with same ip(s), unchecked
7035 .line = __location__,
7036 .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL),
7040 .num_ips = ctx->addresses_best_num,
7041 .ips = ctx->addresses_best,
7042 .apply_expected = True
7048 .type = WREPL_TYPE_SGROUP,
7049 .state = WREPL_STATE_TOMBSTONE,
7050 .node = WREPL_NODE_B,
7052 .num_ips = ctx->addresses_best_num,
7053 .ips = ctx->addresses_best,
7054 .apply_expected = False
7058 * unique,active vs. sgroup,tombstone with different ip(s), unchecked
7061 .line = __location__,
7062 .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL),
7066 .num_ips = ctx->addresses_best_num,
7067 .ips = ctx->addresses_best,
7068 .apply_expected = True
7074 .type = WREPL_TYPE_SGROUP,
7075 .state = WREPL_STATE_TOMBSTONE,
7076 .node = WREPL_NODE_B,
7078 .num_ips = ARRAY_SIZE(addresses_B_1),
7079 .ips = addresses_B_1,
7080 .apply_expected = False
7084 * unique vs. multi homed section
7087 * unique,active vs. mhomed,active with same ip(s), unchecked
7090 .line = __location__,
7091 .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL),
7095 .num_ips = ctx->addresses_best_num,
7096 .ips = ctx->addresses_best,
7097 .apply_expected = True
7103 .type = WREPL_TYPE_MHOMED,
7104 .state = WREPL_STATE_ACTIVE,
7105 .node = WREPL_NODE_B,
7107 .num_ips = ctx->addresses_best_num,
7108 .ips = ctx->addresses_best,
7109 .apply_expected = True
7113 * unique,active vs. mhomed,active with superset ip(s), unchecked
7116 .line = __location__,
7117 .name = _NBT_NAME("_UA_MA_SP_U", 0x00, NULL),
7121 .num_ips = ctx->addresses_best_num,
7122 .ips = ctx->addresses_best,
7123 .apply_expected = True
7129 .type = WREPL_TYPE_MHOMED,
7130 .state = WREPL_STATE_ACTIVE,
7131 .node = WREPL_NODE_B,
7133 .num_ips = ctx->addresses_all_num,
7134 .ips = ctx->addresses_all,
7135 .apply_expected = True
7139 * unique,active vs. mhomed,active with different ip(s), positive response
7142 .line = __location__,
7143 .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL),
7147 .num_ips = ctx->addresses_best_num,
7148 .ips = ctx->addresses_best,
7149 .apply_expected = True
7156 .type = WREPL_TYPE_MHOMED,
7157 .state = WREPL_STATE_ACTIVE,
7158 .node = WREPL_NODE_B,
7160 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7161 .ips = addresses_B_3_4,
7162 .apply_expected = False
7166 * unique,active vs. mhomed,active with different ip(s), positive response other ips
7169 .line = __location__,
7170 .name = _NBT_NAME("_UA_MA_DI_O", 0x00, NULL),
7174 .num_ips = ctx->addresses_best_num,
7175 .ips = ctx->addresses_best,
7176 .apply_expected = True
7181 .num_ips = ARRAY_SIZE(addresses_A_3_4),
7182 .ips = addresses_A_3_4,
7185 .type = WREPL_TYPE_MHOMED,
7186 .state = WREPL_STATE_ACTIVE,
7187 .node = WREPL_NODE_B,
7189 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7190 .ips = addresses_B_3_4,
7191 .apply_expected = False
7195 * unique,active vs. mhomed,active with different ip(s), negative response
7198 .line = __location__,
7199 .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL),
7203 .num_ips = ctx->addresses_best_num,
7204 .ips = ctx->addresses_best,
7205 .apply_expected = True
7212 .type = WREPL_TYPE_MHOMED,
7213 .state = WREPL_STATE_ACTIVE,
7214 .node = WREPL_NODE_B,
7216 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7217 .ips = addresses_B_3_4,
7218 .apply_expected = True
7222 * unique,active vs. mhomed,tombstone with same ip(s), unchecked
7225 .line = __location__,
7226 .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL),
7230 .num_ips = ctx->addresses_best_num,
7231 .ips = ctx->addresses_best,
7232 .apply_expected = True
7238 .type = WREPL_TYPE_MHOMED,
7239 .state = WREPL_STATE_TOMBSTONE,
7240 .node = WREPL_NODE_B,
7242 .num_ips = ctx->addresses_best_num,
7243 .ips = ctx->addresses_best,
7244 .apply_expected = False
7248 * unique,active vs. mhomed,tombstone with different ip(s), unchecked
7251 .line = __location__,
7252 .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL),
7256 .num_ips = ctx->addresses_best_num,
7257 .ips = ctx->addresses_best,
7258 .apply_expected = True
7264 .type = WREPL_TYPE_MHOMED,
7265 .state = WREPL_STATE_TOMBSTONE,
7266 .node = WREPL_NODE_B,
7268 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7269 .ips = addresses_B_3_4,
7270 .apply_expected = False
7274 * normal group vs. unique section
7277 * group,active vs. unique,active with same ip(s), unchecked
7280 .line = __location__,
7281 .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL),
7283 .nb_flags = NBT_NM_GROUP,
7285 .num_ips = ctx->addresses_best_num,
7286 .ips = ctx->addresses_best,
7287 .apply_expected = True
7293 .type = WREPL_TYPE_UNIQUE,
7294 .state = WREPL_STATE_ACTIVE,
7295 .node = WREPL_NODE_B,
7297 .num_ips = ctx->addresses_best_num,
7298 .ips = ctx->addresses_best,
7299 .apply_expected = False
7303 * group,active vs. unique,active with different ip(s), unchecked
7306 .line = __location__,
7307 .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL),
7309 .nb_flags = NBT_NM_GROUP,
7311 .num_ips = ctx->addresses_best_num,
7312 .ips = ctx->addresses_best,
7313 .apply_expected = True
7319 .type = WREPL_TYPE_UNIQUE,
7320 .state = WREPL_STATE_ACTIVE,
7321 .node = WREPL_NODE_B,
7323 .num_ips = ARRAY_SIZE(addresses_B_1),
7324 .ips = addresses_B_1,
7325 .apply_expected = False
7329 * group,active vs. unique,tombstone with same ip(s), unchecked
7332 .line = __location__,
7333 .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL),
7335 .nb_flags = NBT_NM_GROUP,
7337 .num_ips = ctx->addresses_best_num,
7338 .ips = ctx->addresses_best,
7339 .apply_expected = True
7345 .type = WREPL_TYPE_UNIQUE,
7346 .state = WREPL_STATE_TOMBSTONE,
7347 .node = WREPL_NODE_B,
7349 .num_ips = ctx->addresses_best_num,
7350 .ips = ctx->addresses_best,
7351 .apply_expected = False
7355 * group,active vs. unique,tombstone with different ip(s), unchecked
7358 .line = __location__,
7359 .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL),
7361 .nb_flags = NBT_NM_GROUP,
7363 .num_ips = ctx->addresses_best_num,
7364 .ips = ctx->addresses_best,
7365 .apply_expected = True
7371 .type = WREPL_TYPE_UNIQUE,
7372 .state = WREPL_STATE_TOMBSTONE,
7373 .node = WREPL_NODE_B,
7375 .num_ips = ARRAY_SIZE(addresses_B_1),
7376 .ips = addresses_B_1,
7377 .apply_expected = False
7381 * normal group vs. normal group section
7384 * group,active vs. group,active with same ip(s), unchecked
7387 .line = __location__,
7388 .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL),
7390 .nb_flags = NBT_NM_GROUP,
7392 .num_ips = ctx->addresses_best_num,
7393 .ips = ctx->addresses_best,
7394 .apply_expected = True
7400 .type = WREPL_TYPE_GROUP,
7401 .state = WREPL_STATE_ACTIVE,
7402 .node = WREPL_NODE_B,
7404 .num_ips = ctx->addresses_best_num,
7405 .ips = ctx->addresses_best,
7406 .apply_expected = True
7410 * group,active vs. group,active with different ip(s), unchecked
7413 .line = __location__,
7414 .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL),
7416 .nb_flags = NBT_NM_GROUP,
7418 .num_ips = ctx->addresses_best_num,
7419 .ips = ctx->addresses_best,
7420 .apply_expected = True
7426 .type = WREPL_TYPE_GROUP,
7427 .state = WREPL_STATE_ACTIVE,
7428 .node = WREPL_NODE_B,
7430 .num_ips = ARRAY_SIZE(addresses_B_1),
7431 .ips = addresses_B_1,
7432 .apply_expected = True
7436 * group,active vs. group,tombstone with same ip(s), unchecked
7439 .line = __location__,
7440 .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL),
7442 .nb_flags = NBT_NM_GROUP,
7444 .num_ips = ctx->addresses_best_num,
7445 .ips = ctx->addresses_best,
7446 .apply_expected = True
7452 .type = WREPL_TYPE_GROUP,
7453 .state = WREPL_STATE_TOMBSTONE,
7454 .node = WREPL_NODE_B,
7456 .num_ips = ctx->addresses_best_num,
7457 .ips = ctx->addresses_best,
7458 .apply_expected = False
7462 * group,active vs. group,tombstone with different ip(s), unchecked
7465 .line = __location__,
7466 .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL),
7468 .nb_flags = NBT_NM_GROUP,
7470 .num_ips = ctx->addresses_best_num,
7471 .ips = ctx->addresses_best,
7472 .apply_expected = True
7478 .type = WREPL_TYPE_GROUP,
7479 .state = WREPL_STATE_TOMBSTONE,
7480 .node = WREPL_NODE_B,
7482 .num_ips = ARRAY_SIZE(addresses_B_1),
7483 .ips = addresses_B_1,
7484 .apply_expected = False
7488 * normal group vs. special group section
7491 * group,active vs. sgroup,active with same ip(s), unchecked
7494 .line = __location__,
7495 .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL),
7497 .nb_flags = NBT_NM_GROUP,
7499 .num_ips = ctx->addresses_best_num,
7500 .ips = ctx->addresses_best,
7501 .apply_expected = True
7507 .type = WREPL_TYPE_SGROUP,
7508 .state = WREPL_STATE_ACTIVE,
7509 .node = WREPL_NODE_B,
7511 .num_ips = ctx->addresses_best_num,
7512 .ips = ctx->addresses_best,
7513 .apply_expected = False
7517 * group,active vs. sgroup,active with different ip(s), unchecked
7520 .line = __location__,
7521 .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL),
7523 .nb_flags = NBT_NM_GROUP,
7525 .num_ips = ctx->addresses_best_num,
7526 .ips = ctx->addresses_best,
7527 .apply_expected = True
7533 .type = WREPL_TYPE_SGROUP,
7534 .state = WREPL_STATE_ACTIVE,
7535 .node = WREPL_NODE_B,
7537 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7538 .ips = addresses_B_3_4,
7539 .apply_expected = False
7543 * group,active vs. sgroup,tombstone with same ip(s), unchecked
7546 .line = __location__,
7547 .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL),
7549 .nb_flags = NBT_NM_GROUP,
7551 .num_ips = ctx->addresses_best_num,
7552 .ips = ctx->addresses_best,
7553 .apply_expected = True
7559 .type = WREPL_TYPE_SGROUP,
7560 .state = WREPL_STATE_TOMBSTONE,
7561 .node = WREPL_NODE_B,
7563 .num_ips = ctx->addresses_best_num,
7564 .ips = ctx->addresses_best,
7565 .apply_expected = False
7569 * group,active vs. sgroup,tombstone with different ip(s), unchecked
7572 .line = __location__,
7573 .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL),
7575 .nb_flags = NBT_NM_GROUP,
7577 .num_ips = ctx->addresses_best_num,
7578 .ips = ctx->addresses_best,
7579 .apply_expected = True
7585 .type = WREPL_TYPE_SGROUP,
7586 .state = WREPL_STATE_TOMBSTONE,
7587 .node = WREPL_NODE_B,
7589 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7590 .ips = addresses_B_3_4,
7591 .apply_expected = False
7595 * normal group vs. multi homed section
7598 * group,active vs. mhomed,active with same ip(s), unchecked
7601 .line = __location__,
7602 .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL),
7604 .nb_flags = NBT_NM_GROUP,
7606 .num_ips = ctx->addresses_best_num,
7607 .ips = ctx->addresses_best,
7608 .apply_expected = True
7614 .type = WREPL_TYPE_MHOMED,
7615 .state = WREPL_STATE_ACTIVE,
7616 .node = WREPL_NODE_B,
7618 .num_ips = ctx->addresses_best_num,
7619 .ips = ctx->addresses_best,
7620 .apply_expected = False
7624 * group,active vs. mhomed,active with different ip(s), unchecked
7627 .line = __location__,
7628 .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL),
7630 .nb_flags = NBT_NM_GROUP,
7632 .num_ips = ctx->addresses_best_num,
7633 .ips = ctx->addresses_best,
7634 .apply_expected = True
7640 .type = WREPL_TYPE_MHOMED,
7641 .state = WREPL_STATE_ACTIVE,
7642 .node = WREPL_NODE_B,
7644 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7645 .ips = addresses_B_3_4,
7646 .apply_expected = False
7650 * group,active vs. mhomed,tombstone with same ip(s), unchecked
7653 .line = __location__,
7654 .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL),
7656 .nb_flags = NBT_NM_GROUP,
7658 .num_ips = ctx->addresses_best_num,
7659 .ips = ctx->addresses_best,
7660 .apply_expected = True
7666 .type = WREPL_TYPE_MHOMED,
7667 .state = WREPL_STATE_TOMBSTONE,
7668 .node = WREPL_NODE_B,
7670 .num_ips = ctx->addresses_best_num,
7671 .ips = ctx->addresses_best,
7672 .apply_expected = False
7676 * group,active vs. mhomed,tombstone with different ip(s), unchecked
7679 .line = __location__,
7680 .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL),
7682 .nb_flags = NBT_NM_GROUP,
7684 .num_ips = ctx->addresses_best_num,
7685 .ips = ctx->addresses_best,
7686 .apply_expected = True
7692 .type = WREPL_TYPE_MHOMED,
7693 .state = WREPL_STATE_TOMBSTONE,
7694 .node = WREPL_NODE_B,
7696 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7697 .ips = addresses_B_3_4,
7698 .apply_expected = False
7702 * special group vs. unique section
7705 * sgroup,active vs. unique,active with same ip(s), unchecked
7708 .line = __location__,
7709 .name = _NBT_NAME("_SA_UA_SI_U", 0x1C, NULL),
7711 .nb_flags = NBT_NM_GROUP,
7713 .num_ips = ctx->addresses_best_num,
7714 .ips = ctx->addresses_best,
7715 .apply_expected = True
7721 .type = WREPL_TYPE_UNIQUE,
7722 .state = WREPL_STATE_ACTIVE,
7723 .node = WREPL_NODE_B,
7725 .num_ips = ctx->addresses_best_num,
7726 .ips = ctx->addresses_best,
7727 .apply_expected = False
7731 * sgroup,active vs. unique,active with different ip(s), unchecked
7734 .line = __location__,
7735 .name = _NBT_NAME("_SA_UA_DI_U", 0x1C, NULL),
7737 .nb_flags = NBT_NM_GROUP,
7739 .num_ips = ctx->addresses_best_num,
7740 .ips = ctx->addresses_best,
7741 .apply_expected = True
7747 .type = WREPL_TYPE_UNIQUE,
7748 .state = WREPL_STATE_ACTIVE,
7749 .node = WREPL_NODE_B,
7751 .num_ips = ARRAY_SIZE(addresses_B_1),
7752 .ips = addresses_B_1,
7753 .apply_expected = False
7757 * sgroup,active vs. unique,tombstone with same ip(s), unchecked
7760 .line = __location__,
7761 .name = _NBT_NAME("_SA_UT_SI_U", 0x1C, NULL),
7763 .nb_flags = NBT_NM_GROUP,
7765 .num_ips = ctx->addresses_best_num,
7766 .ips = ctx->addresses_best,
7767 .apply_expected = True
7773 .type = WREPL_TYPE_UNIQUE,
7774 .state = WREPL_STATE_TOMBSTONE,
7775 .node = WREPL_NODE_B,
7777 .num_ips = ctx->addresses_best_num,
7778 .ips = ctx->addresses_best,
7779 .apply_expected = False
7783 * sgroup,active vs. unique,tombstone with different ip(s), unchecked
7786 .line = __location__,
7787 .name = _NBT_NAME("_SA_UT_DI_U", 0x1C, NULL),
7789 .nb_flags = NBT_NM_GROUP,
7791 .num_ips = ctx->addresses_best_num,
7792 .ips = ctx->addresses_best,
7793 .apply_expected = True
7799 .type = WREPL_TYPE_UNIQUE,
7800 .state = WREPL_STATE_TOMBSTONE,
7801 .node = WREPL_NODE_B,
7803 .num_ips = ARRAY_SIZE(addresses_B_1),
7804 .ips = addresses_B_1,
7805 .apply_expected = False
7809 * special group vs. normal group section
7812 * sgroup,active vs. group,active with same ip(s), unchecked
7815 .line = __location__,
7816 .name = _NBT_NAME("_SA_GA_SI_U", 0x1C, NULL),
7818 .nb_flags = NBT_NM_GROUP,
7820 .num_ips = ctx->addresses_best_num,
7821 .ips = ctx->addresses_best,
7822 .apply_expected = True
7828 .type = WREPL_TYPE_GROUP,
7829 .state = WREPL_STATE_ACTIVE,
7830 .node = WREPL_NODE_B,
7832 .num_ips = ctx->addresses_best_num,
7833 .ips = ctx->addresses_best,
7834 .apply_expected = False
7838 * sgroup,active vs. group,active with different ip(s), unchecked
7841 .line = __location__,
7842 .name = _NBT_NAME("_SA_GA_DI_U", 0x1C, NULL),
7844 .nb_flags = NBT_NM_GROUP,
7846 .num_ips = ctx->addresses_best_num,
7847 .ips = ctx->addresses_best,
7848 .apply_expected = True
7854 .type = WREPL_TYPE_GROUP,
7855 .state = WREPL_STATE_ACTIVE,
7856 .node = WREPL_NODE_B,
7858 .num_ips = ARRAY_SIZE(addresses_B_1),
7859 .ips = addresses_B_1,
7860 .apply_expected = False
7864 * sgroup,active vs. group,tombstone with same ip(s), unchecked
7867 .line = __location__,
7868 .name = _NBT_NAME("_SA_GT_SI_U", 0x1C, NULL),
7870 .nb_flags = NBT_NM_GROUP,
7872 .num_ips = ctx->addresses_best_num,
7873 .ips = ctx->addresses_best,
7874 .apply_expected = True
7880 .type = WREPL_TYPE_GROUP,
7881 .state = WREPL_STATE_TOMBSTONE,
7882 .node = WREPL_NODE_B,
7884 .num_ips = ctx->addresses_best_num,
7885 .ips = ctx->addresses_best,
7886 .apply_expected = False
7890 * sgroup,active vs. group,tombstone with different ip(s), unchecked
7893 .line = __location__,
7894 .name = _NBT_NAME("_SA_GT_DI_U", 0x1C, NULL),
7896 .nb_flags = NBT_NM_GROUP,
7898 .num_ips = ctx->addresses_best_num,
7899 .ips = ctx->addresses_best,
7900 .apply_expected = True
7906 .type = WREPL_TYPE_GROUP,
7907 .state = WREPL_STATE_TOMBSTONE,
7908 .node = WREPL_NODE_B,
7910 .num_ips = ARRAY_SIZE(addresses_B_1),
7911 .ips = addresses_B_1,
7912 .apply_expected = False
7916 * special group vs. multi homed section
7919 * sgroup,active vs. mhomed,active with same ip(s), unchecked
7922 .line = __location__,
7923 .name = _NBT_NAME("_SA_MA_SI_U", 0x1C, NULL),
7925 .nb_flags = NBT_NM_GROUP,
7927 .num_ips = ctx->addresses_best_num,
7928 .ips = ctx->addresses_best,
7929 .apply_expected = True
7935 .type = WREPL_TYPE_MHOMED,
7936 .state = WREPL_STATE_ACTIVE,
7937 .node = WREPL_NODE_B,
7939 .num_ips = ctx->addresses_best_num,
7940 .ips = ctx->addresses_best,
7941 .apply_expected = False
7945 * sgroup,active vs. mhomed,active with different ip(s), unchecked
7948 .line = __location__,
7949 .name = _NBT_NAME("_SA_MA_DI_U", 0x1C, NULL),
7951 .nb_flags = NBT_NM_GROUP,
7953 .num_ips = ctx->addresses_best_num,
7954 .ips = ctx->addresses_best,
7955 .apply_expected = True
7961 .type = WREPL_TYPE_MHOMED,
7962 .state = WREPL_STATE_ACTIVE,
7963 .node = WREPL_NODE_B,
7965 .num_ips = ARRAY_SIZE(addresses_B_1),
7966 .ips = addresses_B_1,
7967 .apply_expected = False
7971 * sgroup,active vs. mhomed,tombstone with same ip(s), unchecked
7974 .line = __location__,
7975 .name = _NBT_NAME("_SA_MT_SI_U", 0x1C, NULL),
7977 .nb_flags = NBT_NM_GROUP,
7979 .num_ips = ctx->addresses_best_num,
7980 .ips = ctx->addresses_best,
7981 .apply_expected = True
7987 .type = WREPL_TYPE_MHOMED,
7988 .state = WREPL_STATE_TOMBSTONE,
7989 .node = WREPL_NODE_B,
7991 .num_ips = ctx->addresses_best_num,
7992 .ips = ctx->addresses_best,
7993 .apply_expected = False
7997 * sgroup,active vs. mhomed,tombstone with different ip(s), unchecked
8000 .line = __location__,
8001 .name = _NBT_NAME("_SA_MT_DI_U", 0x1C, NULL),
8003 .nb_flags = NBT_NM_GROUP,
8005 .num_ips = ctx->addresses_best_num,
8006 .ips = ctx->addresses_best,
8007 .apply_expected = True
8013 .type = WREPL_TYPE_MHOMED,
8014 .state = WREPL_STATE_TOMBSTONE,
8015 .node = WREPL_NODE_B,
8017 .num_ips = ARRAY_SIZE(addresses_B_1),
8018 .ips = addresses_B_1,
8019 .apply_expected = False
8023 * multi homed vs. unique section
8026 * mhomed,active vs. unique,active with same ip(s), unchecked
8029 .line = __location__,
8030 .name = _NBT_NAME("_MA_UA_SI_U", 0x00, NULL),
8034 .num_ips = ctx->addresses_best_num,
8035 .ips = ctx->addresses_best,
8036 .apply_expected = True
8042 .type = WREPL_TYPE_UNIQUE,
8043 .state = WREPL_STATE_ACTIVE,
8044 .node = WREPL_NODE_B,
8046 .num_ips = ctx->addresses_best_num,
8047 .ips = ctx->addresses_best,
8048 .apply_expected = True
8052 * mhomed,active vs. unique,active with different ip(s), positive response
8055 .line = __location__,
8056 .name = _NBT_NAME("_MA_UA_DI_P", 0x00, NULL),
8060 .num_ips = ctx->addresses_best_num,
8061 .ips = ctx->addresses_best,
8062 .apply_expected = True
8069 .type = WREPL_TYPE_UNIQUE,
8070 .state = WREPL_STATE_ACTIVE,
8071 .node = WREPL_NODE_B,
8073 .num_ips = ARRAY_SIZE(addresses_B_1),
8074 .ips = addresses_B_1,
8075 .apply_expected = False
8079 * mhomed,active vs. unique,active with different ip(s), positive response other ips
8082 .line = __location__,
8083 .name = _NBT_NAME("_MA_UA_DI_O", 0x00, NULL),
8087 .num_ips = ctx->addresses_best_num,
8088 .ips = ctx->addresses_best,
8089 .apply_expected = True
8094 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8095 .ips = addresses_A_3_4,
8098 .type = WREPL_TYPE_UNIQUE,
8099 .state = WREPL_STATE_ACTIVE,
8100 .node = WREPL_NODE_B,
8102 .num_ips = ARRAY_SIZE(addresses_B_1),
8103 .ips = addresses_B_1,
8104 .apply_expected = False
8108 * mhomed,active vs. unique,active with different ip(s), negative response
8111 .line = __location__,
8112 .name = _NBT_NAME("_MA_UA_DI_N", 0x00, NULL),
8116 .num_ips = ctx->addresses_best_num,
8117 .ips = ctx->addresses_best,
8118 .apply_expected = True
8125 .type = WREPL_TYPE_UNIQUE,
8126 .state = WREPL_STATE_ACTIVE,
8127 .node = WREPL_NODE_B,
8129 .num_ips = ARRAY_SIZE(addresses_B_1),
8130 .ips = addresses_B_1,
8131 .apply_expected = True
8135 * mhomed,active vs. unique,tombstone with same ip(s), unchecked
8138 .line = __location__,
8139 .name = _NBT_NAME("_MA_UT_SI_U", 0x00, NULL),
8143 .num_ips = ctx->addresses_best_num,
8144 .ips = ctx->addresses_best,
8145 .apply_expected = True
8151 .type = WREPL_TYPE_UNIQUE,
8152 .state = WREPL_STATE_TOMBSTONE,
8153 .node = WREPL_NODE_B,
8155 .num_ips = ctx->addresses_best_num,
8156 .ips = ctx->addresses_best,
8157 .apply_expected = False
8161 * mhomed,active vs. unique,tombstone with different ip(s), unchecked
8164 .line = __location__,
8165 .name = _NBT_NAME("_MA_UT_DI_U", 0x00, NULL),
8169 .num_ips = ctx->addresses_best_num,
8170 .ips = ctx->addresses_best,
8171 .apply_expected = True
8177 .type = WREPL_TYPE_UNIQUE,
8178 .state = WREPL_STATE_TOMBSTONE,
8179 .node = WREPL_NODE_B,
8181 .num_ips = ARRAY_SIZE(addresses_B_1),
8182 .ips = addresses_B_1,
8183 .apply_expected = False
8187 * multi homed vs. normal group section
8190 * mhomed,active vs. group,active with same ip(s), release expected
8193 .line = __location__,
8194 .name = _NBT_NAME("_MA_GA_SI_R", 0x00, NULL),
8198 .num_ips = ctx->addresses_best_num,
8199 .ips = ctx->addresses_best,
8200 .apply_expected = True
8204 .expect_release = True,
8207 .type = WREPL_TYPE_GROUP,
8208 .state = WREPL_STATE_ACTIVE,
8209 .node = WREPL_NODE_B,
8211 .num_ips = ctx->addresses_best_num,
8212 .ips = ctx->addresses_best,
8213 .apply_expected = True
8217 * mhomed,active vs. group,active with different ip(s), release expected
8220 .line = __location__,
8221 .name = _NBT_NAME("_MA_GA_DI_R", 0x00, NULL),
8225 .num_ips = ctx->addresses_best_num,
8226 .ips = ctx->addresses_best,
8227 .apply_expected = True
8231 .expect_release = True,
8234 .type = WREPL_TYPE_GROUP,
8235 .state = WREPL_STATE_ACTIVE,
8236 .node = WREPL_NODE_B,
8238 .num_ips = ARRAY_SIZE(addresses_B_1),
8239 .ips = addresses_B_1,
8240 .apply_expected = True
8244 * mhomed,active vs. group,tombstone with same ip(s), unchecked
8247 .line = __location__,
8248 .name = _NBT_NAME("_MA_GT_SI_U", 0x00, NULL),
8252 .num_ips = ctx->addresses_best_num,
8253 .ips = ctx->addresses_best,
8254 .apply_expected = True
8260 .type = WREPL_TYPE_GROUP,
8261 .state = WREPL_STATE_TOMBSTONE,
8262 .node = WREPL_NODE_B,
8264 .num_ips = ctx->addresses_best_num,
8265 .ips = ctx->addresses_best,
8266 .apply_expected = False
8270 * mhomed,active vs. group,tombstone with different ip(s), unchecked
8273 .line = __location__,
8274 .name = _NBT_NAME("_MA_GT_DI_U", 0x00, NULL),
8278 .num_ips = ctx->addresses_best_num,
8279 .ips = ctx->addresses_best,
8280 .apply_expected = True
8286 .type = WREPL_TYPE_GROUP,
8287 .state = WREPL_STATE_TOMBSTONE,
8288 .node = WREPL_NODE_B,
8290 .num_ips = ARRAY_SIZE(addresses_B_1),
8291 .ips = addresses_B_1,
8292 .apply_expected = False
8296 * multi homed vs. special group section
8299 * mhomed,active vs. sgroup,active with same ip(s), release expected
8302 .line = __location__,
8303 .name = _NBT_NAME("_MA_SA_SI_R", 0x00, NULL),
8307 .num_ips = ctx->addresses_best_num,
8308 .ips = ctx->addresses_best,
8309 .apply_expected = True
8313 .expect_release = True,
8316 .type = WREPL_TYPE_SGROUP,
8317 .state = WREPL_STATE_ACTIVE,
8318 .node = WREPL_NODE_B,
8320 .num_ips = ctx->addresses_best_num,
8321 .ips = ctx->addresses_best,
8322 .apply_expected = True
8326 * mhomed,active vs. group,active with different ip(s), release expected
8329 .line = __location__,
8330 .name = _NBT_NAME("_MA_SA_DI_R", 0x00, NULL),
8334 .num_ips = ctx->addresses_best_num,
8335 .ips = ctx->addresses_best,
8336 .apply_expected = True
8340 .expect_release = True,
8343 .type = WREPL_TYPE_SGROUP,
8344 .state = WREPL_STATE_ACTIVE,
8345 .node = WREPL_NODE_B,
8347 .num_ips = ARRAY_SIZE(addresses_B_1),
8348 .ips = addresses_B_1,
8349 .apply_expected = True
8353 * mhomed,active vs. sgroup,tombstone with same ip(s), unchecked
8356 .line = __location__,
8357 .name = _NBT_NAME("_MA_ST_SI_U", 0x00, NULL),
8361 .num_ips = ctx->addresses_best_num,
8362 .ips = ctx->addresses_best,
8363 .apply_expected = True
8369 .type = WREPL_TYPE_SGROUP,
8370 .state = WREPL_STATE_TOMBSTONE,
8371 .node = WREPL_NODE_B,
8373 .num_ips = ctx->addresses_best_num,
8374 .ips = ctx->addresses_best,
8375 .apply_expected = False
8379 * mhomed,active vs. sgroup,tombstone with different ip(s), unchecked
8382 .line = __location__,
8383 .name = _NBT_NAME("_MA_ST_DI_U", 0x00, NULL),
8387 .num_ips = ctx->addresses_best_num,
8388 .ips = ctx->addresses_best,
8389 .apply_expected = True
8395 .type = WREPL_TYPE_SGROUP,
8396 .state = WREPL_STATE_TOMBSTONE,
8397 .node = WREPL_NODE_B,
8399 .num_ips = ARRAY_SIZE(addresses_B_1),
8400 .ips = addresses_B_1,
8401 .apply_expected = False
8405 * multi homed vs. multi homed section
8408 * mhomed,active vs. mhomed,active with same ip(s), unchecked
8411 .line = __location__,
8412 .name = _NBT_NAME("_MA_MA_SI_U", 0x00, NULL),
8416 .num_ips = ctx->addresses_best_num,
8417 .ips = ctx->addresses_best,
8418 .apply_expected = True
8424 .type = WREPL_TYPE_MHOMED,
8425 .state = WREPL_STATE_ACTIVE,
8426 .node = WREPL_NODE_B,
8428 .num_ips = ctx->addresses_best_num,
8429 .ips = ctx->addresses_best,
8430 .apply_expected = True
8434 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8437 .line = __location__,
8438 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8442 .num_ips = ctx->addresses_best_num,
8443 .ips = ctx->addresses_best,
8444 .apply_expected = True
8450 .type = WREPL_TYPE_MHOMED,
8451 .state = WREPL_STATE_ACTIVE,
8452 .node = WREPL_NODE_B,
8454 .num_ips = ctx->addresses_all_num,
8455 .ips = ctx->addresses_all,
8456 .apply_expected = True
8460 * mhomed,active vs. mhomed,active with different ip(s), positive response
8463 .line = __location__,
8464 .name = _NBT_NAME("_MA_MA_DI_P", 0x00, NULL),
8468 .num_ips = ctx->addresses_best_num,
8469 .ips = ctx->addresses_best,
8470 .apply_expected = True
8477 .type = WREPL_TYPE_MHOMED,
8478 .state = WREPL_STATE_ACTIVE,
8479 .node = WREPL_NODE_B,
8481 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8482 .ips = addresses_B_3_4,
8483 .apply_expected = False
8487 * mhomed,active vs. mhomed,active with different ip(s), positive response other ips
8490 .line = __location__,
8491 .name = _NBT_NAME("_MA_MA_DI_O", 0x00, NULL),
8495 .num_ips = ctx->addresses_best_num,
8496 .ips = ctx->addresses_best,
8497 .apply_expected = True
8502 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8503 .ips = addresses_A_3_4,
8506 .type = WREPL_TYPE_MHOMED,
8507 .state = WREPL_STATE_ACTIVE,
8508 .node = WREPL_NODE_B,
8510 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8511 .ips = addresses_B_3_4,
8512 .apply_expected = False
8516 * mhomed,active vs. mhomed,active with different ip(s), negative response
8519 .line = __location__,
8520 .name = _NBT_NAME("_MA_MA_DI_N", 0x00, NULL),
8524 .num_ips = ctx->addresses_best_num,
8525 .ips = ctx->addresses_best,
8526 .apply_expected = True
8533 .type = WREPL_TYPE_MHOMED,
8534 .state = WREPL_STATE_ACTIVE,
8535 .node = WREPL_NODE_B,
8537 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8538 .ips = addresses_B_3_4,
8539 .apply_expected = True
8543 * mhomed,active vs. mhomed,tombstone with same ip(s), unchecked
8546 .line = __location__,
8547 .name = _NBT_NAME("_MA_MT_SI_U", 0x00, NULL),
8551 .num_ips = ctx->addresses_best_num,
8552 .ips = ctx->addresses_best,
8553 .apply_expected = True
8559 .type = WREPL_TYPE_MHOMED,
8560 .state = WREPL_STATE_TOMBSTONE,
8561 .node = WREPL_NODE_B,
8563 .num_ips = ctx->addresses_best_num,
8564 .ips = ctx->addresses_best,
8565 .apply_expected = False
8569 * mhomed,active vs. mhomed,tombstone with different ip(s), unchecked
8572 .line = __location__,
8573 .name = _NBT_NAME("_MA_MT_DI_U", 0x00, NULL),
8577 .num_ips = ctx->addresses_best_num,
8578 .ips = ctx->addresses_best,
8579 .apply_expected = True
8585 .type = WREPL_TYPE_MHOMED,
8586 .state = WREPL_STATE_TOMBSTONE,
8587 .node = WREPL_NODE_B,
8589 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8590 .ips = addresses_B_3_4,
8591 .apply_expected = False
8595 * some more multi homed test, including merging
8598 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8601 .line = __location__,
8602 .section= "Test Replica vs. owned active: some more MHOMED combinations",
8603 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8604 .comment= "C:MHOMED vs. B:ALL => B:ALL",
8605 .skip = (ctx->addresses_all_num < 3),
8609 .num_ips = ctx->addresses_mhomed_num,
8610 .ips = ctx->addresses_mhomed,
8611 .apply_expected = True
8617 .type = WREPL_TYPE_MHOMED,
8618 .state = WREPL_STATE_ACTIVE,
8619 .node = WREPL_NODE_B,
8621 .num_ips = ctx->addresses_all_num,
8622 .ips = ctx->addresses_all,
8623 .apply_expected = True
8627 * mhomed,active vs. mhomed,active with same ips, unchecked
8630 .line = __location__,
8631 .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL),
8632 .comment= "C:MHOMED vs. B:MHOMED => B:MHOMED",
8633 .skip = (ctx->addresses_mhomed_num < 2),
8637 .num_ips = ctx->addresses_mhomed_num,
8638 .ips = ctx->addresses_mhomed,
8639 .apply_expected = True
8645 .type = WREPL_TYPE_MHOMED,
8646 .state = WREPL_STATE_ACTIVE,
8647 .node = WREPL_NODE_B,
8649 .num_ips = ctx->addresses_mhomed_num,
8650 .ips = ctx->addresses_mhomed,
8651 .apply_expected = True
8655 * mhomed,active vs. mhomed,active with subset ip(s), positive response
8658 .line = __location__,
8659 .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL),
8660 .comment= "C:MHOMED vs. B:BEST (C:MHOMED) => B:MHOMED",
8661 .skip = (ctx->addresses_mhomed_num < 2),
8665 .num_ips = ctx->addresses_mhomed_num,
8666 .ips = ctx->addresses_mhomed,
8667 .apply_expected = True
8674 .type = WREPL_TYPE_MHOMED,
8675 .state = WREPL_STATE_ACTIVE,
8676 .node = WREPL_NODE_B,
8678 .num_ips = ctx->addresses_best_num,
8679 .ips = ctx->addresses_best,
8680 .mhomed_merge = True
8684 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with all addresses
8687 .line = __location__,
8688 .name = _NBT_NAME("_MA_MA_SB_A", 0x00, NULL),
8689 .comment= "C:MHOMED vs. B:BEST (C:ALL) => B:MHOMED",
8690 .skip = (ctx->addresses_all_num < 3),
8694 .num_ips = ctx->addresses_mhomed_num,
8695 .ips = ctx->addresses_mhomed,
8696 .apply_expected = True
8701 .num_ips = ctx->addresses_all_num,
8702 .ips = ctx->addresses_all,
8705 .type = WREPL_TYPE_MHOMED,
8706 .state = WREPL_STATE_ACTIVE,
8707 .node = WREPL_NODE_B,
8709 .num_ips = ctx->addresses_best_num,
8710 .ips = ctx->addresses_best,
8711 .mhomed_merge = True
8715 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with replicas addresses
8716 * TODO: check why the server sends a name release demand for one address?
8717 * the release demand has no effect to the database record...
8720 .line = __location__,
8721 .name = _NBT_NAME("_MA_MA_SB_PRA", 0x00, NULL),
8722 .comment= "C:MHOMED vs. B:BEST (C:BEST) => C:MHOMED",
8723 .skip = (ctx->addresses_all_num < 2),
8727 .num_ips = ctx->addresses_mhomed_num,
8728 .ips = ctx->addresses_mhomed,
8729 .apply_expected = True
8734 .num_ips = ctx->addresses_best_num,
8735 .ips = ctx->addresses_best,
8736 .late_release = True
8739 .type = WREPL_TYPE_MHOMED,
8740 .state = WREPL_STATE_ACTIVE,
8741 .node = WREPL_NODE_B,
8743 .num_ips = ctx->addresses_best_num,
8744 .ips = ctx->addresses_best,
8745 .apply_expected = False
8749 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with other addresses
8752 .line = __location__,
8753 .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL),
8754 .comment= "C:MHOMED vs. B:BEST (B:B_3_4) =>C:MHOMED",
8755 .skip = (ctx->addresses_all_num < 2),
8759 .num_ips = ctx->addresses_mhomed_num,
8760 .ips = ctx->addresses_mhomed,
8761 .apply_expected = True
8766 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8767 .ips = addresses_B_3_4,
8770 .type = WREPL_TYPE_MHOMED,
8771 .state = WREPL_STATE_ACTIVE,
8772 .node = WREPL_NODE_B,
8774 .num_ips = ctx->addresses_best_num,
8775 .ips = ctx->addresses_best,
8776 .apply_expected = False
8780 * mhomed,active vs. mhomed,active with subset ip(s), negative response
8783 .line = __location__,
8784 .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL),
8785 .comment= "C:MHOMED vs. B:BEST (NEGATIVE) => B:BEST",
8786 .skip = (ctx->addresses_mhomed_num < 2),
8790 .num_ips = ctx->addresses_mhomed_num,
8791 .ips = ctx->addresses_mhomed,
8792 .apply_expected = True
8799 .type = WREPL_TYPE_MHOMED,
8800 .state = WREPL_STATE_ACTIVE,
8801 .node = WREPL_NODE_B,
8803 .num_ips = ctx->addresses_best_num,
8804 .ips = ctx->addresses_best,
8805 .apply_expected = True
8809 * some more multi homed and unique test, including merging
8812 * mhomed,active vs. unique,active with subset ip(s), positive response
8815 .line = __location__,
8816 .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations",
8817 .name = _NBT_NAME("_MA_UA_SB_P", 0x00, NULL),
8818 .comment= "C:MHOMED vs. B:UNIQUE,BEST (C:MHOMED) => B:MHOMED",
8819 .skip = (ctx->addresses_all_num < 2),
8823 .num_ips = ctx->addresses_mhomed_num,
8824 .ips = ctx->addresses_mhomed,
8825 .apply_expected = True
8832 .type = WREPL_TYPE_UNIQUE,
8833 .state = WREPL_STATE_ACTIVE,
8834 .node = WREPL_NODE_B,
8836 .num_ips = ctx->addresses_best_num,
8837 .ips = ctx->addresses_best,
8838 .mhomed_merge = True
8842 * unique,active vs. unique,active with different ip(s), positive response, with replicas address
8843 * TODO: check why the server sends a name release demand for one address?
8844 * the release demand has no effect to the database record...
8847 .line = __location__,
8848 .name = _NBT_NAME("_UA_UA_DI_PRA", 0x00, NULL),
8849 .comment= "C:BEST vs. B:BEST2 (C:BEST2,LR:BEST2) => C:BEST",
8850 .skip = (ctx->addresses_all_num < 2),
8854 .num_ips = ctx->addresses_best_num,
8855 .ips = ctx->addresses_best,
8856 .apply_expected = True
8861 .num_ips = ctx->addresses_best2_num,
8862 .ips = ctx->addresses_best2,
8863 .late_release = True
8866 .type = WREPL_TYPE_UNIQUE,
8867 .state = WREPL_STATE_ACTIVE,
8868 .node = WREPL_NODE_B,
8870 .num_ips = ctx->addresses_best2_num,
8871 .ips = ctx->addresses_best2,
8872 .apply_expected = False,
8876 * unique,active vs. unique,active with different ip(s), positive response, with all addresses
8879 .line = __location__,
8880 .name = _NBT_NAME("_UA_UA_DI_A", 0x00, NULL),
8881 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
8882 .skip = (ctx->addresses_all_num < 3),
8886 .num_ips = ctx->addresses_best_num,
8887 .ips = ctx->addresses_best,
8888 .apply_expected = True
8893 .num_ips = ctx->addresses_all_num,
8894 .ips = ctx->addresses_all,
8897 .type = WREPL_TYPE_UNIQUE,
8898 .state = WREPL_STATE_ACTIVE,
8899 .node = WREPL_NODE_B,
8901 .num_ips = ctx->addresses_best2_num,
8902 .ips = ctx->addresses_best2,
8903 .mhomed_merge = True,
8907 * unique,active vs. mhomed,active with different ip(s), positive response, with all addresses
8910 .line = __location__,
8911 .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL),
8912 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
8913 .skip = (ctx->addresses_all_num < 3),
8917 .num_ips = ctx->addresses_best_num,
8918 .ips = ctx->addresses_best,
8919 .apply_expected = True
8924 .num_ips = ctx->addresses_all_num,
8925 .ips = ctx->addresses_all,
8928 .type = WREPL_TYPE_MHOMED,
8929 .state = WREPL_STATE_ACTIVE,
8930 .node = WREPL_NODE_B,
8932 .num_ips = ctx->addresses_best2_num,
8933 .ips = ctx->addresses_best2,
8934 .mhomed_merge = True,
8938 * special group vs. special group merging section
8941 * sgroup,active vs. sgroup,active with different ip(s)
8944 .line = __location__,
8945 .section= "Test Replica vs. owned active: SGROUP vs. SGROUP tests",
8946 .name = _NBT_NAME("_SA_SA_DI_U", 0x1C, NULL),
8947 .skip = (ctx->addresses_all_num < 3),
8949 .nb_flags = NBT_NM_GROUP,
8951 .num_ips = ctx->addresses_mhomed_num,
8952 .ips = ctx->addresses_mhomed,
8953 .apply_expected = True
8959 .type = WREPL_TYPE_SGROUP,
8960 .state = WREPL_STATE_ACTIVE,
8961 .node = WREPL_NODE_B,
8963 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8964 .ips = addresses_B_3_4,
8965 .sgroup_merge = True
8969 * sgroup,active vs. sgroup,active with same ip(s)
8972 .line = __location__,
8973 .name = _NBT_NAME("_SA_SA_SI_U", 0x1C, NULL),
8974 .skip = (ctx->addresses_all_num < 3),
8976 .nb_flags = NBT_NM_GROUP,
8978 .num_ips = ctx->addresses_mhomed_num,
8979 .ips = ctx->addresses_mhomed,
8980 .apply_expected = True
8986 .type = WREPL_TYPE_SGROUP,
8987 .state = WREPL_STATE_ACTIVE,
8988 .node = WREPL_NODE_B,
8990 .num_ips = ctx->addresses_mhomed_num,
8991 .ips = ctx->addresses_mhomed,
8992 .sgroup_merge = True
8996 * sgroup,active vs. sgroup,active with superset ip(s)
8999 .line = __location__,
9000 .name = _NBT_NAME("_SA_SA_SP_U", 0x1C, NULL),
9001 .skip = (ctx->addresses_all_num < 3),
9003 .nb_flags = NBT_NM_GROUP,
9005 .num_ips = ctx->addresses_mhomed_num,
9006 .ips = ctx->addresses_mhomed,
9007 .apply_expected = True
9013 .type = WREPL_TYPE_SGROUP,
9014 .state = WREPL_STATE_ACTIVE,
9015 .node = WREPL_NODE_B,
9017 .num_ips = ctx->addresses_all_num,
9018 .ips = ctx->addresses_all,
9019 .sgroup_merge = True
9023 * sgroup,active vs. sgroup,active with subset ip(s)
9026 .line = __location__,
9027 .name = _NBT_NAME("_SA_SA_SB_U", 0x1C, NULL),
9028 .skip = (ctx->addresses_all_num < 3),
9030 .nb_flags = NBT_NM_GROUP,
9032 .num_ips = ctx->addresses_mhomed_num,
9033 .ips = ctx->addresses_mhomed,
9034 .apply_expected = True
9040 .type = WREPL_TYPE_SGROUP,
9041 .state = WREPL_STATE_ACTIVE,
9042 .node = WREPL_NODE_B,
9044 .num_ips = ctx->addresses_best_num,
9045 .ips = ctx->addresses_best,
9046 .sgroup_merge = True
9050 * sgroup,active vs. sgroup,tombstone with different ip(s)
9053 .line = __location__,
9054 .name = _NBT_NAME("_SA_ST_DI_U", 0x1C, NULL),
9055 .skip = (ctx->addresses_all_num < 3),
9057 .nb_flags = NBT_NM_GROUP,
9059 .num_ips = ctx->addresses_mhomed_num,
9060 .ips = ctx->addresses_mhomed,
9061 .apply_expected = True
9067 .type = WREPL_TYPE_SGROUP,
9068 .state = WREPL_STATE_TOMBSTONE,
9069 .node = WREPL_NODE_B,
9071 .num_ips = ARRAY_SIZE(addresses_B_3_4),
9072 .ips = addresses_B_3_4,
9073 .apply_expected = False
9077 * sgroup,active vs. sgroup,tombstone with same ip(s)
9080 .line = __location__,
9081 .name = _NBT_NAME("_SA_ST_SI_U", 0x1C, NULL),
9082 .skip = (ctx->addresses_all_num < 3),
9084 .nb_flags = NBT_NM_GROUP,
9086 .num_ips = ctx->addresses_mhomed_num,
9087 .ips = ctx->addresses_mhomed,
9088 .apply_expected = True
9094 .type = WREPL_TYPE_SGROUP,
9095 .state = WREPL_STATE_TOMBSTONE,
9096 .node = WREPL_NODE_B,
9098 .num_ips = ctx->addresses_mhomed_num,
9099 .ips = ctx->addresses_mhomed,
9100 .apply_expected = False
9104 * sgroup,active vs. sgroup,tombstone with superset ip(s)
9107 .line = __location__,
9108 .name = _NBT_NAME("_SA_ST_SP_U", 0x1C, NULL),
9109 .skip = (ctx->addresses_all_num < 3),
9111 .nb_flags = NBT_NM_GROUP,
9113 .num_ips = ctx->addresses_mhomed_num,
9114 .ips = ctx->addresses_mhomed,
9115 .apply_expected = True
9121 .type = WREPL_TYPE_SGROUP,
9122 .state = WREPL_STATE_TOMBSTONE,
9123 .node = WREPL_NODE_B,
9125 .num_ips = ctx->addresses_all_num,
9126 .ips = ctx->addresses_all,
9127 .apply_expected = False
9131 * sgroup,active vs. sgroup,tombstone with subset ip(s)
9134 .line = __location__,
9135 .name = _NBT_NAME("_SA_ST_SB_U", 0x1C, NULL),
9136 .skip = (ctx->addresses_all_num < 3),
9138 .nb_flags = NBT_NM_GROUP,
9140 .num_ips = ctx->addresses_mhomed_num,
9141 .ips = ctx->addresses_mhomed,
9142 .apply_expected = True
9148 .type = WREPL_TYPE_SGROUP,
9149 .state = WREPL_STATE_TOMBSTONE,
9150 .node = WREPL_NODE_B,
9152 .num_ips = ctx->addresses_best_num,
9153 .ips = ctx->addresses_best,
9154 .apply_expected = False
9159 if (!ctx->nbtsock_srv) {
9160 printf("SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
9165 printf("Test Replica records vs. owned active records\n");
9167 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
9169 struct test_conflict_owned_active_vs_replica_struct record = records[i];
9170 uint32_t j, count = 1;
9173 if (records[i].wins.mhomed || records[i].name.type == 0x1C) {
9174 count = records[i].wins.num_ips;
9177 if (records[i].section) {
9178 printf("%s\n", records[i].section);
9181 if (records[i].skip) {
9182 printf("%s => SKIPPED\n", nbt_name_string(ctx, &records[i].name));
9186 if (records[i].replica.mhomed_merge) {
9187 action = "MHOMED_MERGE";
9188 } else if (records[i].replica.sgroup_merge) {
9189 action = "SGROUP_MERGE";
9190 } else if (records[i].replica.apply_expected) {
9193 action = "NOT REPLACE";
9196 printf("%s%s%s => %s\n",
9197 nbt_name_string(ctx, &records[i].name),
9198 (records[i].comment?": ":""),
9199 (records[i].comment?records[i].comment:""),
9202 /* Prepare for multi homed registration */
9203 ZERO_STRUCT(records[i].defend);
9204 records[i].defend.timeout = 10;
9205 records[i].defend.positive = True;
9206 nbt_set_incoming_handler(ctx->nbtsock_srv,
9207 test_conflict_owned_active_vs_replica_handler,
9209 if (ctx->nbtsock_srv2) {
9210 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9211 test_conflict_owned_active_vs_replica_handler,
9218 for (j=0; j < count; j++) {
9219 struct nbt_name_request *req;
9221 name_register->in.name = records[i].name;
9222 name_register->in.dest_addr = ctx->address;
9223 name_register->in.address = records[i].wins.ips[j].ip;
9224 name_register->in.nb_flags = records[i].wins.nb_flags;
9225 name_register->in.register_demand= False;
9226 name_register->in.broadcast = False;
9227 name_register->in.multi_homed = records[i].wins.mhomed;
9228 name_register->in.ttl = 300000;
9229 name_register->in.timeout = 70;
9230 name_register->in.retries = 0;
9232 req = nbt_name_register_send(ctx->nbtsock, name_register);
9234 /* push the request on the wire */
9235 event_loop_once(ctx->nbtsock->event_ctx);
9238 * if we register multiple addresses,
9239 * the server will do name queries to see if the old addresses
9242 if (records[i].wins.mhomed && j > 0) {
9243 end = timeval_current_ofs(records[i].defend.timeout,0);
9244 records[i].defend.ret = True;
9245 while (records[i].defend.timeout > 0) {
9246 event_loop_once(ctx->nbtsock_srv->event_ctx);
9247 if (timeval_expired(&end)) break;
9249 ret &= records[i].defend.ret;
9252 status = nbt_name_register_recv(req, ctx, name_register);
9253 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9254 printf("No response from %s for name register\n", ctx->address);
9257 if (!NT_STATUS_IS_OK(status)) {
9258 printf("Bad response from %s for name register - %s\n",
9259 ctx->address, nt_errstr(status));
9262 CHECK_VALUE(name_register->out.rcode, 0);
9263 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
9264 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
9265 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
9266 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
9267 CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[j].ip);
9270 /* Prepare for the current test */
9271 records[i].defend = record.defend;
9272 nbt_set_incoming_handler(ctx->nbtsock_srv,
9273 test_conflict_owned_active_vs_replica_handler,
9275 if (ctx->nbtsock_srv2) {
9276 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9277 test_conflict_owned_active_vs_replica_handler,
9284 wins_name->name = &records[i].name;
9285 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
9286 records[i].replica.state,
9287 records[i].replica.node,
9288 records[i].replica.is_static);
9289 wins_name->id = ++ctx->b.max_version;
9290 if (wins_name->flags & 2) {
9291 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
9292 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
9294 wins_name->addresses.ip = records[i].replica.ips[0].ip;
9296 wins_name->unknown = "255.255.255.255";
9298 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9301 * wait for the name query, which is handled in
9302 * test_conflict_owned_active_vs_replica_handler()
9304 end = timeval_current_ofs(records[i].defend.timeout,0);
9305 records[i].defend.ret = True;
9306 while (records[i].defend.timeout > 0) {
9307 event_loop_once(ctx->nbtsock_srv->event_ctx);
9308 if (timeval_expired(&end)) break;
9310 ret &= records[i].defend.ret;
9312 if (records[i].defend.late_release) {
9313 records[i].defend = record.defend;
9314 records[i].defend.expect_release = True;
9316 * wait for the name release demand, which is handled in
9317 * test_conflict_owned_active_vs_replica_handler()
9319 end = timeval_current_ofs(records[i].defend.timeout,0);
9320 records[i].defend.ret = True;
9321 while (records[i].defend.timeout > 0) {
9322 event_loop_once(ctx->nbtsock_srv->event_ctx);
9323 if (timeval_expired(&end)) break;
9325 ret &= records[i].defend.ret;
9328 if (records[i].replica.mhomed_merge) {
9329 ret &= test_wrepl_mhomed_merged(ctx, &ctx->c,
9330 records[i].wins.num_ips, records[i].wins.ips,
9332 records[i].replica.num_ips, records[i].replica.ips,
9334 } else if (records[i].replica.sgroup_merge) {
9335 ret &= test_wrepl_sgroup_merged(ctx, NULL,
9337 records[i].wins.num_ips, records[i].wins.ips,
9339 records[i].replica.num_ips, records[i].replica.ips,
9342 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
9343 records[i].replica.apply_expected);
9346 if (records[i].replica.apply_expected ||
9347 records[i].replica.mhomed_merge) {
9348 wins_name->name = &records[i].name;
9349 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9350 WREPL_STATE_TOMBSTONE,
9351 WREPL_NODE_B, False);
9352 wins_name->id = ++ctx->b.max_version;
9353 wins_name->addresses.ip = addresses_B_1[0].ip;
9354 wins_name->unknown = "255.255.255.255";
9356 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9357 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
9359 for (j=0; j < count; j++) {
9360 struct nbt_name_socket *nbtsock = ctx->nbtsock;
9362 if (ctx->myaddr2 && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2->addr) == 0) {
9363 nbtsock = ctx->nbtsock2;
9366 release->in.name = records[i].name;
9367 release->in.dest_addr = ctx->address;
9368 release->in.address = records[i].wins.ips[j].ip;
9369 release->in.nb_flags = records[i].wins.nb_flags;
9370 release->in.broadcast = False;
9371 release->in.timeout = 30;
9372 release->in.retries = 0;
9374 status = nbt_name_release(nbtsock, ctx, release);
9375 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9376 printf("No response from %s for name release\n", ctx->address);
9379 if (!NT_STATUS_IS_OK(status)) {
9380 printf("Bad response from %s for name query - %s\n",
9381 ctx->address, nt_errstr(status));
9384 CHECK_VALUE(release->out.rcode, 0);
9387 if (records[i].replica.sgroup_merge) {
9388 /* clean up the SGROUP record */
9389 wins_name->name = &records[i].name;
9390 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9392 WREPL_NODE_B, False);
9393 wins_name->id = ++ctx->b.max_version;
9394 wins_name->addresses.addresses.num_ips = 0;
9395 wins_name->addresses.addresses.ips = NULL;
9396 wins_name->unknown = "255.255.255.255";
9397 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9399 /* take ownership of the SGROUP record */
9400 wins_name->name = &records[i].name;
9401 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9403 WREPL_NODE_B, False);
9404 wins_name->id = ++ctx->b.max_version;
9405 wins_name->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
9406 wins_name->addresses.addresses.ips = discard_const(addresses_B_1);
9407 wins_name->unknown = "255.255.255.255";
9408 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9409 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
9411 /* overwrite the SGROUP record with unique,tombstone */
9412 wins_name->name = &records[i].name;
9413 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9414 WREPL_STATE_TOMBSTONE,
9415 WREPL_NODE_B, False);
9416 wins_name->id = ++ctx->b.max_version;
9417 wins_name->addresses.ip = addresses_A_1[0].ip;
9418 wins_name->unknown = "255.255.255.255";
9419 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
9420 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
9426 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
9434 #define _NBT_ASSERT(v, correct) do { \
9435 if ((v) != (correct)) { \
9436 printf("(%s) Incorrect value %s=%d - should be %s (%d)\n", \
9437 __location__, #v, v, #correct, correct); \
9442 #define _NBT_ASSERT_STRING(v, correct) do { \
9443 if ( ((!v) && (correct)) || \
9444 ((v) && (!correct)) || \
9445 ((v) && (correct) && strcmp(v,correct) != 0)) { \
9446 printf("(%s) Incorrect value %s=%s - should be %s\n", \
9447 __location__, #v, v, correct); \
9452 static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
9453 struct nbt_name_packet *req_packet,
9454 struct socket_address *src)
9456 struct nbt_name *name;
9457 struct nbt_name_packet *rep_packet;
9458 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9460 _NBT_ASSERT(req_packet->qdcount, 1);
9461 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9462 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9464 name = &req_packet->questions[0].name;
9466 _NBT_ASSERT(name->type, rec->name.type);
9467 _NBT_ASSERT_STRING(name->name, rec->name.name);
9468 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9470 _NBT_ASSERT(rec->defend.expect_release, False);
9472 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9473 if (rep_packet == NULL) return;
9475 rep_packet->name_trn_id = req_packet->name_trn_id;
9476 rep_packet->ancount = 1;
9478 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9479 if (rep_packet->answers == NULL) return;
9481 rep_packet->answers[0].name = *name;
9482 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9483 rep_packet->answers[0].ttl = 0;
9485 if (rec->defend.positive) {
9486 uint32_t i, num_ips;
9487 const struct wrepl_ip *ips;
9489 if (rec->defend.num_ips > 0) {
9490 num_ips = rec->defend.num_ips;
9491 ips = rec->defend.ips;
9493 num_ips = rec->wins.num_ips;
9494 ips = rec->wins.ips;
9497 /* send a positive reply */
9498 rep_packet->operation =
9501 NBT_FLAG_AUTHORITIVE |
9502 NBT_FLAG_RECURSION_DESIRED |
9503 NBT_FLAG_RECURSION_AVAIL;
9505 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9507 rep_packet->answers[0].rdata.netbios.length = num_ips*6;
9508 rep_packet->answers[0].rdata.netbios.addresses =
9509 talloc_array(rep_packet->answers, struct nbt_rdata_address, num_ips);
9510 if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return;
9512 for (i=0; i < num_ips; i++) {
9513 struct nbt_rdata_address *addr =
9514 &rep_packet->answers[0].rdata.netbios.addresses[i];
9515 addr->nb_flags = rec->wins.nb_flags;
9516 addr->ipaddr = ips[i].ip;
9518 DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
9519 nbt_name_string(rep_packet, name), src->addr, src->port));
9521 /* send a negative reply */
9522 rep_packet->operation =
9525 NBT_FLAG_AUTHORITIVE |
9528 rep_packet->answers[0].rr_type = NBT_QTYPE_NULL;
9530 ZERO_STRUCT(rep_packet->answers[0].rdata);
9532 DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
9533 nbt_name_string(rep_packet, name), src->addr, src->port));
9536 nbt_name_reply_send(nbtsock, src, rep_packet);
9537 talloc_free(rep_packet);
9539 /* make sure we push the reply to the wire */
9540 event_loop_once(nbtsock->event_ctx);
9543 rec->defend.timeout = 0;
9544 rec->defend.ret = True;
9547 static void test_conflict_owned_active_vs_replica_handler_release(struct nbt_name_socket *nbtsock,
9548 struct nbt_name_packet *req_packet,
9549 struct socket_address *src)
9551 struct nbt_name *name;
9552 struct nbt_name_packet *rep_packet;
9553 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9555 _NBT_ASSERT(req_packet->qdcount, 1);
9556 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9557 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9559 name = &req_packet->questions[0].name;
9561 _NBT_ASSERT(name->type, rec->name.type);
9562 _NBT_ASSERT_STRING(name->name, rec->name.name);
9563 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9565 _NBT_ASSERT(rec->defend.expect_release, True);
9567 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9568 if (rep_packet == NULL) return;
9570 rep_packet->name_trn_id = req_packet->name_trn_id;
9571 rep_packet->ancount = 1;
9572 rep_packet->operation =
9574 NBT_OPCODE_RELEASE |
9575 NBT_FLAG_AUTHORITIVE;
9577 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9578 if (rep_packet->answers == NULL) return;
9580 rep_packet->answers[0].name = *name;
9581 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9582 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9583 rep_packet->answers[0].ttl = req_packet->additional[0].ttl;
9584 rep_packet->answers[0].rdata = req_packet->additional[0].rdata;
9586 DEBUG(2,("Sending name release reply for %s to %s:%d\n",
9587 nbt_name_string(rep_packet, name), src->addr, src->port));
9589 nbt_name_reply_send(nbtsock, src, rep_packet);
9590 talloc_free(rep_packet);
9592 /* make sure we push the reply to the wire */
9593 event_loop_once(nbtsock->event_ctx);
9596 rec->defend.timeout = 0;
9597 rec->defend.ret = True;
9600 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
9601 struct nbt_name_packet *req_packet,
9602 struct socket_address *src)
9604 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9606 rec->defend.ret = False;
9608 switch (req_packet->operation & NBT_OPCODE) {
9609 case NBT_OPCODE_QUERY:
9610 test_conflict_owned_active_vs_replica_handler_query(nbtsock, req_packet, src);
9612 case NBT_OPCODE_RELEASE:
9613 test_conflict_owned_active_vs_replica_handler_release(nbtsock, req_packet, src);
9616 printf("%s: unexpected incoming packet\n", __location__);
9622 test WINS replication operations
9624 BOOL torture_nbt_winsreplication(void)
9626 const char *address;
9627 struct nbt_name name;
9628 TALLOC_CTX *mem_ctx = talloc_new(NULL);
9631 struct test_wrepl_conflict_conn *ctx;
9633 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
9635 /* do an initial name resolution to find its IP */
9636 status = resolve_name(&name, mem_ctx, &address, NULL);
9637 if (!NT_STATUS_IS_OK(status)) {
9638 printf("Failed to resolve %s - %s\n",
9639 name.name, nt_errstr(status));
9640 talloc_free(mem_ctx);
9644 ret &= test_assoc_ctx1(mem_ctx, address);
9645 ret &= test_assoc_ctx2(mem_ctx, address);
9647 ret &= test_wins_replication(mem_ctx, address);
9649 if (lp_parm_bool(-1, "torture", "quick", False)) goto done;
9651 ctx = test_create_conflict_ctx(mem_ctx, address);
9652 if (!ctx) return False;
9654 ret &= test_conflict_same_owner(ctx);
9655 ret &= test_conflict_different_owner(ctx);
9656 ret &= test_conflict_owned_released_vs_replica(ctx);
9657 ret &= test_conflict_owned_active_vs_replica(ctx);
9660 talloc_free(mem_ctx);