2 Unix SMB/CIFS implementation.
4 WINS replication testing
6 Copyright (C) Andrew Tridgell 2005
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include "libcli/nbt/libnbt.h"
25 #include "libcli/wrepl/winsrepl.h"
26 #include "lib/events/events.h"
27 #include "lib/socket/socket.h"
28 #include "system/time.h"
30 #define CHECK_STATUS(status, correct) do { \
31 if (!NT_STATUS_EQUAL(status, correct)) { \
32 printf("(%s) Incorrect status %s - should be %s\n", \
33 __location__, nt_errstr(status), nt_errstr(correct)); \
38 #define CHECK_VALUE(v, correct) do { \
39 if ((v) != (correct)) { \
40 printf("(%s) Incorrect value %s=%d - should be %d\n", \
41 __location__, #v, v, correct); \
46 #define CHECK_VALUE_UINT64(v, correct) do { \
47 if ((v) != (correct)) { \
48 printf("(%s) Incorrect value %s=%llu - should be %llu\n", \
49 __location__, #v, v, correct); \
54 #define CHECK_VALUE_STRING(v, correct) do { \
55 if ( ((!v) && (correct)) || \
56 ((v) && (!correct)) || \
57 ((v) && (correct) && strcmp(v,correct) != 0)) { \
58 printf("(%s) Incorrect value %s='%s' - should be '%s'\n", \
59 __location__, #v, v, correct); \
64 #define _NBT_NAME(n,t,s) {\
70 static const char *wrepl_name_type_string(enum wrepl_name_type type)
73 case WREPL_TYPE_UNIQUE: return "UNIQUE";
74 case WREPL_TYPE_GROUP: return "GROUP";
75 case WREPL_TYPE_SGROUP: return "SGROUP";
76 case WREPL_TYPE_MHOMED: return "MHOMED";
78 return "UNKNOWN_TYPE";
81 static const char *wrepl_name_state_string(enum wrepl_name_state state)
84 case WREPL_STATE_ACTIVE: return "ACTIVE";
85 case WREPL_STATE_RELEASED: return "RELEASED";
86 case WREPL_STATE_TOMBSTONE: return "TOMBSTONE";
87 case WREPL_STATE_RESERVED: return "RESERVED";
89 return "UNKNOWN_STATE";
93 test how assoc_ctx's are only usable on the connection
96 static BOOL test_assoc_ctx1(TALLOC_CTX *mem_ctx, const char *address)
99 struct wrepl_request *req;
100 struct wrepl_socket *wrepl_socket1;
101 struct wrepl_associate associate1;
102 struct wrepl_socket *wrepl_socket2;
103 struct wrepl_associate associate2;
104 struct wrepl_pull_table pull_table;
105 struct wrepl_packet *rep_packet;
106 struct wrepl_associate_stop assoc_stop;
109 if (!lp_parm_bool(-1, "torture", "dangerous", False)) {
110 printf("winsrepl: cross connection assoc_ctx usage disabled - enable dangerous tests to use\n");
114 printf("Test if assoc_ctx is only valid on the conection it was created on\n");
116 wrepl_socket1 = wrepl_socket_init(mem_ctx, NULL);
117 wrepl_socket2 = wrepl_socket_init(mem_ctx, NULL);
119 printf("Setup 2 wrepl connections\n");
120 status = wrepl_connect(wrepl_socket1, NULL, address);
121 CHECK_STATUS(status, NT_STATUS_OK);
123 status = wrepl_connect(wrepl_socket2, NULL, address);
124 CHECK_STATUS(status, NT_STATUS_OK);
126 printf("Send a start association request (conn1)\n");
127 status = wrepl_associate(wrepl_socket1, &associate1);
128 CHECK_STATUS(status, NT_STATUS_OK);
130 printf("association context (conn1): 0x%x\n", associate1.out.assoc_ctx);
132 printf("Send a start association request (conn2)\n");
133 status = wrepl_associate(wrepl_socket2, &associate2);
134 CHECK_STATUS(status, NT_STATUS_OK);
136 printf("association context (conn2): 0x%x\n", associate2.out.assoc_ctx);
138 printf("Send a replication table query, with assoc 1 (conn2), the anwser should be on conn1\n");
139 pull_table.in.assoc_ctx = associate1.out.assoc_ctx;
140 req = wrepl_pull_table_send(wrepl_socket2, &pull_table);
141 req->send_only = True;
142 status = wrepl_request_recv(req, mem_ctx, &rep_packet);
143 CHECK_STATUS(status, NT_STATUS_OK);
145 printf("Send a association request (conn2), to make sure the last request was ignored\n");
146 status = wrepl_associate(wrepl_socket2, &associate2);
147 CHECK_STATUS(status, NT_STATUS_OK);
149 printf("Send a replication table query, with invalid assoc (conn1), receive answer from conn2\n");
150 pull_table.in.assoc_ctx = 0;
151 req = wrepl_pull_table_send(wrepl_socket1, &pull_table);
152 status = wrepl_request_recv(req, mem_ctx, &rep_packet);
153 CHECK_STATUS(status, NT_STATUS_OK);
155 printf("Send a association request (conn1), to make sure the last request was handled correct\n");
156 status = wrepl_associate(wrepl_socket1, &associate2);
157 CHECK_STATUS(status, NT_STATUS_OK);
159 assoc_stop.in.assoc_ctx = associate1.out.assoc_ctx;
160 assoc_stop.in.reason = 4;
161 printf("Send a association stop request (conn1), reson: %u\n", assoc_stop.in.reason);
162 status = wrepl_associate_stop(wrepl_socket1, &assoc_stop);
163 CHECK_STATUS(status, NT_STATUS_END_OF_FILE);
165 assoc_stop.in.assoc_ctx = associate2.out.assoc_ctx;
166 assoc_stop.in.reason = 0;
167 printf("Send a association stop request (conn2), reson: %u\n", assoc_stop.in.reason);
168 status = wrepl_associate_stop(wrepl_socket2, &assoc_stop);
169 CHECK_STATUS(status, NT_STATUS_OK);
172 printf("Close 2 wrepl connections\n");
173 talloc_free(wrepl_socket1);
174 talloc_free(wrepl_socket2);
179 test if we always get back the same assoc_ctx
181 static BOOL test_assoc_ctx2(TALLOC_CTX *mem_ctx, const char *address)
184 struct wrepl_socket *wrepl_socket;
185 struct wrepl_associate associate;
189 printf("Test if we always get back the same assoc_ctx\n");
191 wrepl_socket = wrepl_socket_init(mem_ctx, NULL);
193 printf("Setup wrepl connections\n");
194 status = wrepl_connect(wrepl_socket, NULL, address);
195 CHECK_STATUS(status, NT_STATUS_OK);
198 printf("Send 1st start association request\n");
199 status = wrepl_associate(wrepl_socket, &associate);
200 CHECK_STATUS(status, NT_STATUS_OK);
201 assoc_ctx1 = associate.out.assoc_ctx;
202 printf("1st association context: 0x%x\n", associate.out.assoc_ctx);
204 printf("Send 2nd start association request\n");
205 status = wrepl_associate(wrepl_socket, &associate);
206 CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1);
207 CHECK_STATUS(status, NT_STATUS_OK);
208 printf("2nd association context: 0x%x\n", associate.out.assoc_ctx);
210 printf("Send 3rd 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("3rd association context: 0x%x\n", associate.out.assoc_ctx);
217 printf("Close wrepl connections\n");
218 talloc_free(wrepl_socket);
224 display a replication entry
226 static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_name *name)
230 printf("%s\n", nbt_name_string(mem_ctx, &name->name));
231 printf("\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n",
232 name->type, name->state, name->node, name->is_static, name->version_id);
233 printf("\tRAW_FLAGS: 0x%08X OWNER: %-15s\n",
234 name->raw_flags, name->owner);
235 for (i=0;i<name->num_addresses;i++) {
236 printf("\tADDR: %-15s OWNER: %-15s\n",
237 name->addresses[i].address, name->addresses[i].owner);
242 test a full replication dump from a WINS server
244 static BOOL test_wins_replication(TALLOC_CTX *mem_ctx, const char *address)
247 struct wrepl_socket *wrepl_socket;
250 struct wrepl_associate associate;
251 struct wrepl_pull_table pull_table;
252 struct wrepl_pull_names pull_names;
254 printf("Test one pull replication cycle\n");
256 wrepl_socket = wrepl_socket_init(mem_ctx, NULL);
258 printf("Setup wrepl connections\n");
259 status = wrepl_connect(wrepl_socket, NULL, address);
260 CHECK_STATUS(status, NT_STATUS_OK);
262 printf("Send a start association request\n");
264 status = wrepl_associate(wrepl_socket, &associate);
265 CHECK_STATUS(status, NT_STATUS_OK);
267 printf("association context: 0x%x\n", associate.out.assoc_ctx);
269 printf("Send a replication table query\n");
270 pull_table.in.assoc_ctx = associate.out.assoc_ctx;
272 status = wrepl_pull_table(wrepl_socket, mem_ctx, &pull_table);
273 if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) {
274 struct wrepl_packet packet;
275 struct wrepl_request *req;
278 packet.opcode = WREPL_OPCODE_BITS;
279 packet.assoc_ctx = associate.out.assoc_ctx;
280 packet.mess_type = WREPL_STOP_ASSOCIATION;
281 packet.message.stop.reason = 0;
283 req = wrepl_request_send(wrepl_socket, &packet);
286 printf("failed - We are not a valid pull partner for the server\n");
290 CHECK_STATUS(status, NT_STATUS_OK);
292 printf("Found %d replication partners\n", pull_table.out.num_partners);
294 for (i=0;i<pull_table.out.num_partners;i++) {
295 struct wrepl_wins_owner *partner = &pull_table.out.partners[i];
296 printf("%s max_version=%6llu min_version=%6llu type=%d\n",
298 partner->max_version,
299 partner->min_version,
302 pull_names.in.assoc_ctx = associate.out.assoc_ctx;
303 pull_names.in.partner = *partner;
305 status = wrepl_pull_names(wrepl_socket, mem_ctx, &pull_names);
306 CHECK_STATUS(status, NT_STATUS_OK);
308 printf("Received %d names\n", pull_names.out.num_names);
310 for (j=0;j<pull_names.out.num_names;j++) {
311 display_entry(mem_ctx, &pull_names.out.names[j]);
316 printf("Close wrepl connections\n");
317 talloc_free(wrepl_socket);
321 struct test_wrepl_conflict_conn {
323 struct wrepl_socket *pull;
326 #define TEST_OWNER_A_ADDRESS "127.65.65.1"
327 #define TEST_ADDRESS_A_PREFIX "127.0.65"
328 #define TEST_OWNER_B_ADDRESS "127.66.66.1"
329 #define TEST_ADDRESS_B_PREFIX "127.0.66"
331 struct wrepl_wins_owner a, b, c;
334 struct nbt_name_socket *nbtsock;
336 struct nbt_name_socket *nbtsock_srv;
338 uint32_t addresses_1_num;
339 struct wrepl_ip *addresses_1;
342 static const struct wrepl_ip addresses_A_1[] = {
344 .owner = TEST_OWNER_A_ADDRESS,
345 .ip = TEST_ADDRESS_A_PREFIX".1"
348 static const struct wrepl_ip addresses_A_2[] = {
350 .owner = TEST_OWNER_A_ADDRESS,
351 .ip = TEST_ADDRESS_A_PREFIX".2"
354 static const struct wrepl_ip addresses_A_3_4[] = {
356 .owner = TEST_OWNER_A_ADDRESS,
357 .ip = TEST_ADDRESS_A_PREFIX".3"
360 .owner = TEST_OWNER_A_ADDRESS,
361 .ip = TEST_ADDRESS_A_PREFIX".4"
365 static const struct wrepl_ip addresses_B_1[] = {
367 .owner = TEST_OWNER_B_ADDRESS,
368 .ip = TEST_ADDRESS_B_PREFIX".1"
371 static const struct wrepl_ip addresses_B_2[] = {
373 .owner = TEST_OWNER_B_ADDRESS,
374 .ip = TEST_ADDRESS_B_PREFIX".2"
377 static const struct wrepl_ip addresses_B_3_4[] = {
379 .owner = TEST_OWNER_B_ADDRESS,
380 .ip = TEST_ADDRESS_B_PREFIX".3"
383 .owner = TEST_OWNER_B_ADDRESS,
384 .ip = TEST_ADDRESS_B_PREFIX".4"
388 static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem_ctx,
391 struct test_wrepl_conflict_conn *ctx;
392 struct wrepl_associate associate;
393 struct wrepl_pull_table pull_table;
397 ctx = talloc_zero(mem_ctx, struct test_wrepl_conflict_conn);
398 if (!ctx) return NULL;
400 ctx->address = address;
401 ctx->pull = wrepl_socket_init(ctx, NULL);
402 if (!ctx->pull) return NULL;
404 printf("Setup wrepl conflict pull connection\n");
405 status = wrepl_connect(ctx->pull, NULL, ctx->address);
406 if (!NT_STATUS_IS_OK(status)) return NULL;
408 status = wrepl_associate(ctx->pull, &associate);
409 if (!NT_STATUS_IS_OK(status)) return NULL;
411 ctx->pull_assoc = associate.out.assoc_ctx;
413 ctx->a.address = TEST_OWNER_A_ADDRESS;
414 ctx->a.max_version = 0;
415 ctx->a.min_version = 0;
418 ctx->b.address = TEST_OWNER_B_ADDRESS;
419 ctx->b.max_version = 0;
420 ctx->b.min_version = 0;
423 ctx->c.address = address;
424 ctx->c.max_version = 0;
425 ctx->c.min_version = 0;
428 pull_table.in.assoc_ctx = ctx->pull_assoc;
429 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
430 if (!NT_STATUS_IS_OK(status)) return NULL;
432 for (i=0; i < pull_table.out.num_partners; i++) {
433 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
434 ctx->a.max_version = pull_table.out.partners[i].max_version;
435 ctx->a.min_version = pull_table.out.partners[i].min_version;
437 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
438 ctx->b.max_version = pull_table.out.partners[i].max_version;
439 ctx->b.min_version = pull_table.out.partners[i].min_version;
441 if (strcmp(address,pull_table.out.partners[i].address)==0) {
442 ctx->c.max_version = pull_table.out.partners[i].max_version;
443 ctx->c.min_version = pull_table.out.partners[i].min_version;
447 talloc_free(pull_table.out.partners);
449 ctx->myaddr = talloc_strdup(mem_ctx, iface_best_ip(address));
450 if (!ctx->myaddr) return NULL;
452 ctx->nbtsock = nbt_name_socket_init(ctx, NULL);
453 if (!ctx->nbtsock) return NULL;
455 status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0, 0);
456 if (!NT_STATUS_IS_OK(status)) return NULL;
458 ctx->nbtsock_srv = nbt_name_socket_init(ctx, NULL);
459 if (!ctx->nbtsock_srv) return NULL;
461 status = socket_listen(ctx->nbtsock_srv->sock, ctx->myaddr, lp_nbt_port(), 0, 0);
462 if (!NT_STATUS_IS_OK(status)) {
463 talloc_free(ctx->nbtsock_srv);
464 ctx->nbtsock_srv = NULL;
467 ctx->addresses_1_num = 1;
468 ctx->addresses_1 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_1_num);
469 if (!ctx->addresses_1) return NULL;
470 ctx->addresses_1[0].owner = ctx->c.address;
471 ctx->addresses_1[0].ip = ctx->myaddr;
476 static BOOL test_wrepl_update_one(struct test_wrepl_conflict_conn *ctx,
477 const struct wrepl_wins_owner *owner,
478 const struct wrepl_wins_name *name)
481 struct wrepl_socket *wrepl_socket;
482 struct wrepl_associate associate;
483 struct wrepl_packet update_packet, repl_send;
484 struct wrepl_table *update;
485 struct wrepl_wins_owner wrepl_wins_owners[1];
486 struct wrepl_packet *repl_recv;
487 struct wrepl_wins_owner *send_request;
488 struct wrepl_send_reply *send_reply;
489 struct wrepl_wins_name wrepl_wins_names[1];
493 wrepl_socket = wrepl_socket_init(ctx, NULL);
495 status = wrepl_connect(wrepl_socket, NULL, ctx->address);
496 CHECK_STATUS(status, NT_STATUS_OK);
498 status = wrepl_associate(wrepl_socket, &associate);
499 CHECK_STATUS(status, NT_STATUS_OK);
500 assoc_ctx = associate.out.assoc_ctx;
502 /* now send a WREPL_REPL_UPDATE message */
503 ZERO_STRUCT(update_packet);
504 update_packet.opcode = WREPL_OPCODE_BITS;
505 update_packet.assoc_ctx = assoc_ctx;
506 update_packet.mess_type = WREPL_REPLICATION;
507 update_packet.message.replication.command = WREPL_REPL_UPDATE;
508 update = &update_packet.message.replication.info.table;
510 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
511 update->partners = wrepl_wins_owners;
512 update->initiator = "0.0.0.0";
514 wrepl_wins_owners[0] = *owner;
516 status = wrepl_request(wrepl_socket, wrepl_socket,
517 &update_packet, &repl_recv);
518 CHECK_STATUS(status, NT_STATUS_OK);
519 CHECK_VALUE(repl_recv->mess_type, WREPL_REPLICATION);
520 CHECK_VALUE(repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
521 send_request = &repl_recv->message.replication.info.owner;
523 ZERO_STRUCT(repl_send);
524 repl_send.opcode = WREPL_OPCODE_BITS;
525 repl_send.assoc_ctx = assoc_ctx;
526 repl_send.mess_type = WREPL_REPLICATION;
527 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
528 send_reply = &repl_send.message.replication.info.reply;
530 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
531 send_reply->names = wrepl_wins_names;
533 wrepl_wins_names[0] = *name;
535 status = wrepl_request(wrepl_socket, wrepl_socket,
536 &repl_send, &repl_recv);
537 CHECK_STATUS(status, NT_STATUS_OK);
538 CHECK_VALUE(repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
539 CHECK_VALUE(repl_recv->message.stop.reason, 0);
542 talloc_free(wrepl_socket);
547 static BOOL test_wrepl_update_two(struct test_wrepl_conflict_conn *ctx,
548 const struct wrepl_wins_owner *owner,
549 const struct wrepl_wins_name *name1,
550 const struct wrepl_wins_name *name2)
553 struct wrepl_socket *wrepl_socket;
554 struct wrepl_associate associate;
555 struct wrepl_packet update_packet, repl_send;
556 struct wrepl_table *update;
557 struct wrepl_wins_owner wrepl_wins_owners[1];
558 struct wrepl_packet *repl_recv;
559 struct wrepl_wins_owner *send_request;
560 struct wrepl_send_reply *send_reply;
561 struct wrepl_wins_name wrepl_wins_names[2];
565 wrepl_socket = wrepl_socket_init(ctx, NULL);
567 status = wrepl_connect(wrepl_socket, NULL, ctx->address);
568 CHECK_STATUS(status, NT_STATUS_OK);
570 status = wrepl_associate(wrepl_socket, &associate);
571 CHECK_STATUS(status, NT_STATUS_OK);
572 assoc_ctx = associate.out.assoc_ctx;
574 /* now send a WREPL_REPL_UPDATE message */
575 ZERO_STRUCT(update_packet);
576 update_packet.opcode = WREPL_OPCODE_BITS;
577 update_packet.assoc_ctx = assoc_ctx;
578 update_packet.mess_type = WREPL_REPLICATION;
579 update_packet.message.replication.command = WREPL_REPL_UPDATE;
580 update = &update_packet.message.replication.info.table;
582 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
583 update->partners = wrepl_wins_owners;
584 update->initiator = "0.0.0.0";
586 wrepl_wins_owners[0] = *owner;
588 status = wrepl_request(wrepl_socket, wrepl_socket,
589 &update_packet, &repl_recv);
590 CHECK_STATUS(status, NT_STATUS_OK);
591 CHECK_VALUE(repl_recv->mess_type, WREPL_REPLICATION);
592 CHECK_VALUE(repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
593 send_request = &repl_recv->message.replication.info.owner;
595 ZERO_STRUCT(repl_send);
596 repl_send.opcode = WREPL_OPCODE_BITS;
597 repl_send.assoc_ctx = assoc_ctx;
598 repl_send.mess_type = WREPL_REPLICATION;
599 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
600 send_reply = &repl_send.message.replication.info.reply;
602 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
603 send_reply->names = wrepl_wins_names;
605 wrepl_wins_names[0] = *name1;
606 wrepl_wins_names[1] = *name2;
608 status = wrepl_request(wrepl_socket, wrepl_socket,
609 &repl_send, &repl_recv);
610 CHECK_STATUS(status, NT_STATUS_OK);
611 CHECK_VALUE(repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
612 CHECK_VALUE(repl_recv->message.stop.reason, 0);
615 talloc_free(wrepl_socket);
620 static BOOL test_wrepl_is_applied(struct test_wrepl_conflict_conn *ctx,
621 const struct wrepl_wins_owner *owner,
622 const struct wrepl_wins_name *name,
627 struct wrepl_pull_names pull_names;
628 struct wrepl_name *names;
630 pull_names.in.assoc_ctx = ctx->pull_assoc;
631 pull_names.in.partner = *owner;
632 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
634 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
635 CHECK_STATUS(status, NT_STATUS_OK);
636 CHECK_VALUE(pull_names.out.num_names, (expected?1:0));
638 names = pull_names.out.names;
641 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
645 CHECK_VALUE(names[0].name.type, name->name->type);
646 CHECK_VALUE_STRING(names[0].name.name, name->name->name);
647 CHECK_VALUE_STRING(names[0].name.scope, name->name->scope);
648 CHECK_VALUE(flags, name->flags);
649 CHECK_VALUE_UINT64(names[0].version_id, name->id);
652 CHECK_VALUE(names[0].num_addresses,
653 name->addresses.addresses.num_ips);
655 CHECK_VALUE(names[0].num_addresses, 1);
656 CHECK_VALUE_STRING(names[0].addresses[0].address,
661 talloc_free(pull_names.out.names);
665 static BOOL test_wrepl_is_merged(struct test_wrepl_conflict_conn *ctx,
666 const struct wrepl_wins_name *name1,
667 const struct wrepl_wins_name *name2)
673 struct wrepl_pull_names pull_names;
674 struct wrepl_name *names;
677 pull_names.in.assoc_ctx = ctx->pull_assoc;
678 pull_names.in.partner = ctx->c;
679 pull_names.in.partner.min_version = ctx->c.max_version-1;
681 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
682 CHECK_STATUS(status, NT_STATUS_OK);
683 CHECK_VALUE(pull_names.out.num_names, 1);
685 names = pull_names.out.names;
687 num_ips = name1->addresses.addresses.num_ips + name2->addresses.addresses.num_ips;
689 CHECK_VALUE(names[0].name.type, name1->name->type);
690 CHECK_VALUE_STRING(names[0].name.name, name1->name->name);
691 CHECK_VALUE_STRING(names[0].name.scope, name1->name->scope);
692 CHECK_VALUE(names[0].type, WREPL_TYPE_SGROUP);
693 CHECK_VALUE(names[0].state, (num_ips>0?WREPL_STATE_ACTIVE:WREPL_STATE_RELEASED));
694 CHECK_VALUE_UINT64(names[0].version_id, ctx->c.max_version);
696 CHECK_VALUE(names[0].num_addresses,
697 name1->addresses.addresses.num_ips+
698 name2->addresses.addresses.num_ips);
700 talloc_free(pull_names.out.names);
705 static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx)
708 struct nbt_name name;
709 struct wrepl_wins_name wins_name1;
710 struct wrepl_wins_name wins_name2;
711 struct wrepl_wins_name *wins_name_tmp;
712 struct wrepl_wins_name *wins_name_last;
713 struct wrepl_wins_name *wins_name_cur;
715 uint8_t types[] = { 0x00, 0x1C };
717 enum wrepl_name_type type;
718 enum wrepl_name_state state;
719 enum wrepl_name_node node;
722 const struct wrepl_ip *ips;
725 .type = WREPL_TYPE_GROUP,
726 .state = WREPL_STATE_ACTIVE,
727 .node = WREPL_NODE_B,
729 .num_ips = ARRAY_SIZE(addresses_A_1),
730 .ips = addresses_A_1,
732 .type = WREPL_TYPE_UNIQUE,
733 .state = WREPL_STATE_ACTIVE,
734 .node = WREPL_NODE_B,
736 .num_ips = ARRAY_SIZE(addresses_A_1),
737 .ips = addresses_A_1,
739 .type = WREPL_TYPE_UNIQUE,
740 .state = WREPL_STATE_ACTIVE,
741 .node = WREPL_NODE_B,
743 .num_ips = ARRAY_SIZE(addresses_A_2),
744 .ips = addresses_A_2,
746 .type = WREPL_TYPE_UNIQUE,
747 .state = WREPL_STATE_ACTIVE,
748 .node = WREPL_NODE_B,
750 .num_ips = ARRAY_SIZE(addresses_A_1),
751 .ips = addresses_A_1,
753 .type = WREPL_TYPE_UNIQUE,
754 .state = WREPL_STATE_ACTIVE,
755 .node = WREPL_NODE_B,
757 .num_ips = ARRAY_SIZE(addresses_A_2),
758 .ips = addresses_A_2,
760 .type = WREPL_TYPE_SGROUP,
761 .state = WREPL_STATE_TOMBSTONE,
762 .node = WREPL_NODE_B,
764 .num_ips = ARRAY_SIZE(addresses_A_2),
765 .ips = addresses_A_2,
767 .type = WREPL_TYPE_MHOMED,
768 .state = WREPL_STATE_TOMBSTONE,
769 .node = WREPL_NODE_B,
771 .num_ips = ARRAY_SIZE(addresses_A_1),
772 .ips = addresses_A_1,
774 .type = WREPL_TYPE_MHOMED,
775 .state = WREPL_STATE_RELEASED,
776 .node = WREPL_NODE_B,
778 .num_ips = ARRAY_SIZE(addresses_A_2),
779 .ips = addresses_A_2,
781 .type = WREPL_TYPE_SGROUP,
782 .state = WREPL_STATE_ACTIVE,
783 .node = WREPL_NODE_B,
785 .num_ips = ARRAY_SIZE(addresses_A_1),
786 .ips = addresses_A_1,
788 .type = WREPL_TYPE_SGROUP,
789 .state = WREPL_STATE_ACTIVE,
790 .node = WREPL_NODE_B,
792 .num_ips = ARRAY_SIZE(addresses_A_3_4),
793 .ips = addresses_A_3_4,
795 .type = WREPL_TYPE_SGROUP,
796 .state = WREPL_STATE_TOMBSTONE,
797 .node = WREPL_NODE_B,
799 .num_ips = ARRAY_SIZE(addresses_B_3_4),
800 .ips = addresses_B_3_4,
802 /* the last one should always be a unique,tomstone record! */
803 .type = WREPL_TYPE_UNIQUE,
804 .state = WREPL_STATE_TOMBSTONE,
805 .node = WREPL_NODE_B,
807 .num_ips = ARRAY_SIZE(addresses_A_1),
808 .ips = addresses_A_1,
812 if (!ctx) return False;
814 name.name = "_SAME_OWNER_A";
818 wins_name_tmp = NULL;
819 wins_name_last = &wins_name2;
820 wins_name_cur = &wins_name1;
822 for (j=0; ret && j < ARRAY_SIZE(types); j++) {
823 name.type = types[j];
824 printf("Test Replica Conflicts with same owner[%s] for %s\n",
825 nbt_name_string(ctx, &name), ctx->a.address);
827 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
828 wins_name_tmp = wins_name_last;
829 wins_name_last = wins_name_cur;
830 wins_name_cur = wins_name_tmp;
833 printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
834 wrepl_name_type_string(records[i-1].type),
835 wrepl_name_state_string(records[i-1].state),
836 (records[i-1].is_static?",static":""),
837 wrepl_name_type_string(records[i].type),
838 wrepl_name_state_string(records[i].state),
839 (records[i].is_static?",static":""),
840 (records[i-1].ips==records[i].ips?"same":"different"),
844 wins_name_cur->name = &name;
845 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
848 records[i].is_static);
849 wins_name_cur->id = ++ctx->a.max_version;
850 if (wins_name_cur->flags & 2) {
851 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
852 wins_name_cur->addresses.addresses.ips = discard_const(records[i].ips);
854 wins_name_cur->addresses.ip = records[i].ips[0].ip;
856 wins_name_cur->unknown = "255.255.255.255";
858 ret &= test_wrepl_update_one(ctx, &ctx->a,wins_name_cur);
859 if (records[i].state == WREPL_STATE_RELEASED) {
860 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_last, False);
861 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, False);
863 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, True);
866 /* the first one is a cleanup run */
867 if (!ret && i == 0) ret = True;
870 printf("conflict handled wrong or record[%u]: %s\n", i, __location__);
878 static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx)
881 struct wrepl_wins_name wins_name1;
882 struct wrepl_wins_name wins_name2;
883 struct wrepl_wins_name *wins_name_r1;
884 struct wrepl_wins_name *wins_name_r2;
887 const char *line; /* just better debugging */
888 struct nbt_name name;
889 BOOL extra; /* not the worst case, this is an extra test */
892 struct wrepl_wins_owner *owner;
893 enum wrepl_name_type type;
894 enum wrepl_name_state state;
895 enum wrepl_name_node node;
898 const struct wrepl_ip *ips;
904 * NOTE: the first record and the last applied one
905 * needs to be from the same owner,
906 * to not conflict in the next smbtorture run!!!
909 .line = __location__,
910 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
914 .type = WREPL_TYPE_UNIQUE,
915 .state = WREPL_STATE_TOMBSTONE,
916 .node = WREPL_NODE_B,
918 .num_ips = ARRAY_SIZE(addresses_B_1),
919 .ips = addresses_B_1,
920 .apply_expected = True /* ignored */
924 .type = WREPL_TYPE_UNIQUE,
925 .state = WREPL_STATE_TOMBSTONE,
926 .node = WREPL_NODE_B,
928 .num_ips = ARRAY_SIZE(addresses_A_1),
929 .ips = addresses_A_1,
930 .apply_expected = True /* ignored */
935 * unique vs unique section
938 * unique,active vs. unique,active
939 * => should be replaced
942 .line = __location__,
943 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
946 .type = WREPL_TYPE_UNIQUE,
947 .state = WREPL_STATE_ACTIVE,
948 .node = WREPL_NODE_B,
950 .num_ips = ARRAY_SIZE(addresses_A_1),
951 .ips = addresses_A_1,
952 .apply_expected = True
956 .type = WREPL_TYPE_UNIQUE,
957 .state = WREPL_STATE_ACTIVE,
958 .node = WREPL_NODE_B,
960 .num_ips = ARRAY_SIZE(addresses_B_1),
961 .ips = addresses_B_1,
962 .apply_expected = True
967 * unique,active vs. unique,tombstone
968 * => should NOT be replaced
971 .line = __location__,
972 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
975 .type = WREPL_TYPE_UNIQUE,
976 .state = WREPL_STATE_ACTIVE,
977 .node = WREPL_NODE_B,
979 .num_ips = ARRAY_SIZE(addresses_B_1),
980 .ips = addresses_B_1,
981 .apply_expected = True
985 .type = WREPL_TYPE_UNIQUE,
986 .state = WREPL_STATE_TOMBSTONE,
987 .node = WREPL_NODE_B,
989 .num_ips = ARRAY_SIZE(addresses_B_1),
990 .ips = addresses_B_1,
991 .apply_expected = False
996 * unique,released vs. unique,active
997 * => should be replaced
1000 .line = __location__,
1001 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1004 .type = WREPL_TYPE_UNIQUE,
1005 .state = WREPL_STATE_RELEASED,
1006 .node = WREPL_NODE_B,
1008 .num_ips = ARRAY_SIZE(addresses_B_1),
1009 .ips = addresses_B_1,
1010 .apply_expected = False
1014 .type = WREPL_TYPE_UNIQUE,
1015 .state = WREPL_STATE_ACTIVE,
1016 .node = WREPL_NODE_B,
1018 .num_ips = ARRAY_SIZE(addresses_A_1),
1019 .ips = addresses_A_1,
1020 .apply_expected = True
1025 * unique,released vs. unique,tombstone
1026 * => should be replaced
1029 .line = __location__,
1030 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1033 .type = WREPL_TYPE_UNIQUE,
1034 .state = WREPL_STATE_RELEASED,
1035 .node = WREPL_NODE_B,
1037 .num_ips = ARRAY_SIZE(addresses_A_1),
1038 .ips = addresses_A_1,
1039 .apply_expected = False
1043 .type = WREPL_TYPE_UNIQUE,
1044 .state = WREPL_STATE_TOMBSTONE,
1045 .node = WREPL_NODE_B,
1047 .num_ips = ARRAY_SIZE(addresses_B_1),
1048 .ips = addresses_B_1,
1049 .apply_expected = True
1054 * unique,tombstone vs. unique,active
1055 * => should be replaced
1058 .line = __location__,
1059 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1062 .type = WREPL_TYPE_UNIQUE,
1063 .state = WREPL_STATE_TOMBSTONE,
1064 .node = WREPL_NODE_B,
1066 .num_ips = ARRAY_SIZE(addresses_B_1),
1067 .ips = addresses_B_1,
1068 .apply_expected = True
1072 .type = WREPL_TYPE_UNIQUE,
1073 .state = WREPL_STATE_ACTIVE,
1074 .node = WREPL_NODE_B,
1076 .num_ips = ARRAY_SIZE(addresses_A_1),
1077 .ips = addresses_A_1,
1078 .apply_expected = True
1083 * unique,tombstone vs. unique,tombstone
1084 * => should be replaced
1087 .line = __location__,
1088 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1091 .type = WREPL_TYPE_UNIQUE,
1092 .state = WREPL_STATE_TOMBSTONE,
1093 .node = WREPL_NODE_B,
1095 .num_ips = ARRAY_SIZE(addresses_A_1),
1096 .ips = addresses_A_1,
1097 .apply_expected = True
1101 .type = WREPL_TYPE_UNIQUE,
1102 .state = WREPL_STATE_TOMBSTONE,
1103 .node = WREPL_NODE_B,
1105 .num_ips = ARRAY_SIZE(addresses_B_1),
1106 .ips = addresses_B_1,
1107 .apply_expected = True
1113 * unique vs normal groups section,
1116 * unique,active vs. group,active
1117 * => should be replaced
1120 .line = __location__,
1121 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1124 .type = WREPL_TYPE_UNIQUE,
1125 .state = WREPL_STATE_ACTIVE,
1126 .node = WREPL_NODE_B,
1128 .num_ips = ARRAY_SIZE(addresses_B_1),
1129 .ips = addresses_B_1,
1130 .apply_expected = True
1134 .type = WREPL_TYPE_GROUP,
1135 .state = WREPL_STATE_ACTIVE,
1136 .node = WREPL_NODE_B,
1138 .num_ips = ARRAY_SIZE(addresses_A_1),
1139 .ips = addresses_A_1,
1140 .apply_expected = True
1145 * unique,active vs. group,tombstone
1146 * => should NOT be replaced
1149 .line = __location__,
1150 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1153 .type = WREPL_TYPE_UNIQUE,
1154 .state = WREPL_STATE_ACTIVE,
1155 .node = WREPL_NODE_B,
1157 .num_ips = ARRAY_SIZE(addresses_A_1),
1158 .ips = addresses_A_1,
1159 .apply_expected = True
1163 .type = WREPL_TYPE_GROUP,
1164 .state = WREPL_STATE_TOMBSTONE,
1165 .node = WREPL_NODE_B,
1167 .num_ips = ARRAY_SIZE(addresses_A_1),
1168 .ips = addresses_A_1,
1169 .apply_expected = False
1174 * unique,released vs. group,active
1175 * => should be replaced
1178 .line = __location__,
1179 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1182 .type = WREPL_TYPE_UNIQUE,
1183 .state = WREPL_STATE_RELEASED,
1184 .node = WREPL_NODE_B,
1186 .num_ips = ARRAY_SIZE(addresses_A_1),
1187 .ips = addresses_A_1,
1188 .apply_expected = False
1192 .type = WREPL_TYPE_GROUP,
1193 .state = WREPL_STATE_ACTIVE,
1194 .node = WREPL_NODE_B,
1196 .num_ips = ARRAY_SIZE(addresses_B_1),
1197 .ips = addresses_B_1,
1198 .apply_expected = True
1203 * unique,released vs. group,tombstone
1204 * => should be replaced
1207 .line = __location__,
1208 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1211 .type = WREPL_TYPE_UNIQUE,
1212 .state = WREPL_STATE_RELEASED,
1213 .node = WREPL_NODE_B,
1215 .num_ips = ARRAY_SIZE(addresses_B_1),
1216 .ips = addresses_B_1,
1217 .apply_expected = False
1221 .type = WREPL_TYPE_GROUP,
1222 .state = WREPL_STATE_TOMBSTONE,
1223 .node = WREPL_NODE_B,
1225 .num_ips = ARRAY_SIZE(addresses_A_1),
1226 .ips = addresses_A_1,
1227 .apply_expected = True
1232 * unique,tombstone vs. group,active
1233 * => should be replaced
1236 .line = __location__,
1237 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1240 .type = WREPL_TYPE_UNIQUE,
1241 .state = WREPL_STATE_TOMBSTONE,
1242 .node = WREPL_NODE_B,
1244 .num_ips = ARRAY_SIZE(addresses_A_1),
1245 .ips = addresses_A_1,
1246 .apply_expected = True
1250 .type = WREPL_TYPE_GROUP,
1251 .state = WREPL_STATE_ACTIVE,
1252 .node = WREPL_NODE_B,
1254 .num_ips = ARRAY_SIZE(addresses_B_1),
1255 .ips = addresses_B_1,
1256 .apply_expected = True
1261 * unique,tombstone vs. group,tombstone
1262 * => should be replaced
1265 .line = __location__,
1266 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1269 .type = WREPL_TYPE_UNIQUE,
1270 .state = WREPL_STATE_TOMBSTONE,
1271 .node = WREPL_NODE_B,
1273 .num_ips = ARRAY_SIZE(addresses_B_1),
1274 .ips = addresses_B_1,
1275 .apply_expected = True
1279 .type = WREPL_TYPE_GROUP,
1280 .state = WREPL_STATE_TOMBSTONE,
1281 .node = WREPL_NODE_B,
1283 .num_ips = ARRAY_SIZE(addresses_A_1),
1284 .ips = addresses_A_1,
1285 .apply_expected = True
1290 * unique vs special groups section,
1293 * unique,active vs. sgroup,active
1294 * => should NOT be replaced
1297 .line = __location__,
1298 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1301 .type = WREPL_TYPE_UNIQUE,
1302 .state = WREPL_STATE_ACTIVE,
1303 .node = WREPL_NODE_B,
1305 .num_ips = ARRAY_SIZE(addresses_A_1),
1306 .ips = addresses_A_1,
1307 .apply_expected = True
1311 .type = WREPL_TYPE_SGROUP,
1312 .state = WREPL_STATE_ACTIVE,
1313 .node = WREPL_NODE_B,
1315 .num_ips = ARRAY_SIZE(addresses_A_1),
1316 .ips = addresses_A_1,
1317 .apply_expected = False
1322 * unique,active vs. sgroup,tombstone
1323 * => should NOT be replaced
1326 .line = __location__,
1327 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1330 .type = WREPL_TYPE_UNIQUE,
1331 .state = WREPL_STATE_ACTIVE,
1332 .node = WREPL_NODE_B,
1334 .num_ips = ARRAY_SIZE(addresses_A_1),
1335 .ips = addresses_A_1,
1336 .apply_expected = True
1340 .type = WREPL_TYPE_SGROUP,
1341 .state = WREPL_STATE_TOMBSTONE,
1342 .node = WREPL_NODE_B,
1344 .num_ips = ARRAY_SIZE(addresses_A_1),
1345 .ips = addresses_A_1,
1346 .apply_expected = False
1351 * unique,released vs. sgroup,active
1352 * => should be replaced
1355 .line = __location__,
1356 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1359 .type = WREPL_TYPE_UNIQUE,
1360 .state = WREPL_STATE_RELEASED,
1361 .node = WREPL_NODE_B,
1363 .num_ips = ARRAY_SIZE(addresses_A_1),
1364 .ips = addresses_A_1,
1365 .apply_expected = False
1369 .type = WREPL_TYPE_SGROUP,
1370 .state = WREPL_STATE_ACTIVE,
1371 .node = WREPL_NODE_B,
1373 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1374 .ips = addresses_B_3_4,
1375 .apply_expected = True
1380 * unique,released vs. sgroup,tombstone
1381 * => should be replaced
1384 .line = __location__,
1385 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1388 .type = WREPL_TYPE_UNIQUE,
1389 .state = WREPL_STATE_RELEASED,
1390 .node = WREPL_NODE_B,
1392 .num_ips = ARRAY_SIZE(addresses_B_1),
1393 .ips = addresses_B_1,
1394 .apply_expected = False
1398 .type = WREPL_TYPE_SGROUP,
1399 .state = WREPL_STATE_TOMBSTONE,
1400 .node = WREPL_NODE_B,
1402 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1403 .ips = addresses_A_3_4,
1404 .apply_expected = True
1409 * unique,tombstone vs. sgroup,active
1410 * => should be replaced
1413 .line = __location__,
1414 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1417 .type = WREPL_TYPE_UNIQUE,
1418 .state = WREPL_STATE_TOMBSTONE,
1419 .node = WREPL_NODE_B,
1421 .num_ips = ARRAY_SIZE(addresses_A_1),
1422 .ips = addresses_A_1,
1423 .apply_expected = True
1427 .type = WREPL_TYPE_SGROUP,
1428 .state = WREPL_STATE_ACTIVE,
1429 .node = WREPL_NODE_B,
1431 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1432 .ips = addresses_B_3_4,
1433 .apply_expected = True
1438 * unique,tombstone vs. sgroup,tombstone
1439 * => should be replaced
1442 .line = __location__,
1443 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1446 .type = WREPL_TYPE_UNIQUE,
1447 .state = WREPL_STATE_TOMBSTONE,
1448 .node = WREPL_NODE_B,
1450 .num_ips = ARRAY_SIZE(addresses_B_1),
1451 .ips = addresses_B_1,
1452 .apply_expected = True
1456 .type = WREPL_TYPE_SGROUP,
1457 .state = WREPL_STATE_TOMBSTONE,
1458 .node = WREPL_NODE_B,
1460 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1461 .ips = addresses_A_3_4,
1462 .apply_expected = True
1467 * unique vs multi homed section,
1470 * unique,active vs. mhomed,active
1471 * => should be replaced
1474 .line = __location__,
1475 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1478 .type = WREPL_TYPE_UNIQUE,
1479 .state = WREPL_STATE_ACTIVE,
1480 .node = WREPL_NODE_B,
1482 .num_ips = ARRAY_SIZE(addresses_A_1),
1483 .ips = addresses_A_1,
1484 .apply_expected = True
1488 .type = WREPL_TYPE_MHOMED,
1489 .state = WREPL_STATE_ACTIVE,
1490 .node = WREPL_NODE_B,
1492 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1493 .ips = addresses_B_3_4,
1494 .apply_expected = True
1499 * unique,active vs. mhomed,tombstone
1500 * => should NOT be replaced
1503 .line = __location__,
1504 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1507 .type = WREPL_TYPE_UNIQUE,
1508 .state = WREPL_STATE_ACTIVE,
1509 .node = WREPL_NODE_B,
1511 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1512 .ips = addresses_B_3_4,
1513 .apply_expected = True
1517 .type = WREPL_TYPE_MHOMED,
1518 .state = WREPL_STATE_TOMBSTONE,
1519 .node = WREPL_NODE_B,
1521 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1522 .ips = addresses_B_3_4,
1523 .apply_expected = False
1528 * unique,released vs. mhomed,active
1529 * => should be replaced
1532 .line = __location__,
1533 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1536 .type = WREPL_TYPE_UNIQUE,
1537 .state = WREPL_STATE_RELEASED,
1538 .node = WREPL_NODE_B,
1540 .num_ips = ARRAY_SIZE(addresses_B_1),
1541 .ips = addresses_B_1,
1542 .apply_expected = False
1546 .type = WREPL_TYPE_MHOMED,
1547 .state = WREPL_STATE_ACTIVE,
1548 .node = WREPL_NODE_B,
1550 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1551 .ips = addresses_A_3_4,
1552 .apply_expected = True
1557 * unique,released vs. mhomed,tombstone
1558 * => should be replaced
1561 .line = __location__,
1562 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1565 .type = WREPL_TYPE_UNIQUE,
1566 .state = WREPL_STATE_RELEASED,
1567 .node = WREPL_NODE_B,
1569 .num_ips = ARRAY_SIZE(addresses_A_1),
1570 .ips = addresses_A_1,
1571 .apply_expected = False
1575 .type = WREPL_TYPE_MHOMED,
1576 .state = WREPL_STATE_TOMBSTONE,
1577 .node = WREPL_NODE_B,
1579 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1580 .ips = addresses_B_3_4,
1581 .apply_expected = True
1586 * unique,tombstone vs. mhomed,active
1587 * => should be replaced
1590 .line = __location__,
1591 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1594 .type = WREPL_TYPE_UNIQUE,
1595 .state = WREPL_STATE_TOMBSTONE,
1596 .node = WREPL_NODE_B,
1598 .num_ips = ARRAY_SIZE(addresses_B_1),
1599 .ips = addresses_B_1,
1600 .apply_expected = True
1604 .type = WREPL_TYPE_MHOMED,
1605 .state = WREPL_STATE_ACTIVE,
1606 .node = WREPL_NODE_B,
1608 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1609 .ips = addresses_A_3_4,
1610 .apply_expected = True
1615 * unique,tombstone vs. mhomed,tombstone
1616 * => should be replaced
1619 .line = __location__,
1620 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1623 .type = WREPL_TYPE_UNIQUE,
1624 .state = WREPL_STATE_TOMBSTONE,
1625 .node = WREPL_NODE_B,
1627 .num_ips = ARRAY_SIZE(addresses_A_1),
1628 .ips = addresses_A_1,
1629 .apply_expected = True
1633 .type = WREPL_TYPE_MHOMED,
1634 .state = WREPL_STATE_TOMBSTONE,
1635 .node = WREPL_NODE_B,
1637 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1638 .ips = addresses_B_3_4,
1639 .apply_expected = True
1644 * normal groups vs unique section,
1647 * group,active vs. unique,active
1648 * => should NOT be replaced
1651 .line = __location__,
1652 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1655 .type = WREPL_TYPE_GROUP,
1656 .state = WREPL_STATE_ACTIVE,
1657 .node = WREPL_NODE_B,
1659 .num_ips = ARRAY_SIZE(addresses_A_1),
1660 .ips = addresses_A_1,
1661 .apply_expected = True
1665 .type = WREPL_TYPE_UNIQUE,
1666 .state = WREPL_STATE_ACTIVE,
1667 .node = WREPL_NODE_B,
1669 .num_ips = ARRAY_SIZE(addresses_A_1),
1670 .ips = addresses_A_1,
1671 .apply_expected = False
1676 * group,active vs. unique,tombstone
1677 * => should NOT be replaced
1680 .line = __location__,
1681 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1684 .type = WREPL_TYPE_GROUP,
1685 .state = WREPL_STATE_ACTIVE,
1686 .node = WREPL_NODE_B,
1688 .num_ips = ARRAY_SIZE(addresses_A_1),
1689 .ips = addresses_A_1,
1690 .apply_expected = True
1694 .type = WREPL_TYPE_UNIQUE,
1695 .state = WREPL_STATE_TOMBSTONE,
1696 .node = WREPL_NODE_B,
1698 .num_ips = ARRAY_SIZE(addresses_A_1),
1699 .ips = addresses_A_1,
1700 .apply_expected = False
1705 * group,released vs. unique,active
1706 * => should NOT be replaced
1709 .line = __location__,
1710 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1713 .type = WREPL_TYPE_GROUP,
1714 .state = WREPL_STATE_RELEASED,
1715 .node = WREPL_NODE_B,
1717 .num_ips = ARRAY_SIZE(addresses_A_1),
1718 .ips = addresses_A_1,
1719 .apply_expected = False
1723 .type = WREPL_TYPE_UNIQUE,
1724 .state = WREPL_STATE_ACTIVE,
1725 .node = WREPL_NODE_B,
1727 .num_ips = ARRAY_SIZE(addresses_A_1),
1728 .ips = addresses_A_1,
1729 .apply_expected = False
1734 * group,released vs. unique,tombstone
1735 * => should NOT be replaced
1738 .line = __location__,
1739 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1742 .type = WREPL_TYPE_GROUP,
1743 .state = WREPL_STATE_RELEASED,
1744 .node = WREPL_NODE_B,
1746 .num_ips = ARRAY_SIZE(addresses_A_1),
1747 .ips = addresses_A_1,
1748 .apply_expected = False
1752 .type = WREPL_TYPE_UNIQUE,
1753 .state = WREPL_STATE_TOMBSTONE,
1754 .node = WREPL_NODE_B,
1756 .num_ips = ARRAY_SIZE(addresses_A_1),
1757 .ips = addresses_A_1,
1758 .apply_expected = False
1763 * group,tombstone vs. unique,active
1764 * => should NOT be replaced
1767 .line = __location__,
1768 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1771 .type = WREPL_TYPE_GROUP,
1772 .state = WREPL_STATE_TOMBSTONE,
1773 .node = WREPL_NODE_B,
1775 .num_ips = ARRAY_SIZE(addresses_A_1),
1776 .ips = addresses_A_1,
1777 .apply_expected = True
1781 .type = WREPL_TYPE_UNIQUE,
1782 .state = WREPL_STATE_ACTIVE,
1783 .node = WREPL_NODE_B,
1785 .num_ips = ARRAY_SIZE(addresses_A_1),
1786 .ips = addresses_A_1,
1787 .apply_expected = False
1792 * group,tombstone vs. unique,tombstone
1793 * => should NOT be replaced
1796 .line = __location__,
1797 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1800 .type = WREPL_TYPE_GROUP,
1801 .state = WREPL_STATE_TOMBSTONE,
1802 .node = WREPL_NODE_B,
1804 .num_ips = ARRAY_SIZE(addresses_A_1),
1805 .ips = addresses_A_1,
1806 .apply_expected = True
1810 .type = WREPL_TYPE_UNIQUE,
1811 .state = WREPL_STATE_TOMBSTONE,
1812 .node = WREPL_NODE_B,
1814 .num_ips = ARRAY_SIZE(addresses_A_1),
1815 .ips = addresses_A_1,
1816 .apply_expected = False
1821 * normal groups vs normal groups section,
1824 * group,active vs. group,active
1825 * => should NOT be replaced
1828 .line = __location__,
1829 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1832 .type = WREPL_TYPE_GROUP,
1833 .state = WREPL_STATE_ACTIVE,
1834 .node = WREPL_NODE_B,
1836 .num_ips = ARRAY_SIZE(addresses_A_1),
1837 .ips = addresses_A_1,
1838 .apply_expected = True
1842 .type = WREPL_TYPE_GROUP,
1843 .state = WREPL_STATE_ACTIVE,
1844 .node = WREPL_NODE_B,
1846 .num_ips = ARRAY_SIZE(addresses_A_1),
1847 .ips = addresses_A_1,
1848 .apply_expected = False
1853 * group,active vs. group,tombstone
1854 * => should NOT be replaced
1857 .line = __location__,
1858 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1861 .type = WREPL_TYPE_GROUP,
1862 .state = WREPL_STATE_ACTIVE,
1863 .node = WREPL_NODE_B,
1865 .num_ips = ARRAY_SIZE(addresses_A_1),
1866 .ips = addresses_A_1,
1867 .apply_expected = True
1871 .type = WREPL_TYPE_GROUP,
1872 .state = WREPL_STATE_TOMBSTONE,
1873 .node = WREPL_NODE_B,
1875 .num_ips = ARRAY_SIZE(addresses_A_1),
1876 .ips = addresses_A_1,
1877 .apply_expected = False
1882 * group,released vs. group,active
1883 * => should be replaced
1886 .line = __location__,
1887 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1890 .type = WREPL_TYPE_GROUP,
1891 .state = WREPL_STATE_RELEASED,
1892 .node = WREPL_NODE_B,
1894 .num_ips = ARRAY_SIZE(addresses_A_1),
1895 .ips = addresses_A_1,
1896 .apply_expected = False
1900 .type = WREPL_TYPE_GROUP,
1901 .state = WREPL_STATE_ACTIVE,
1902 .node = WREPL_NODE_B,
1904 .num_ips = ARRAY_SIZE(addresses_B_1),
1905 .ips = addresses_B_1,
1906 .apply_expected = True
1911 * group,released vs. group,tombstone
1912 * => should be replaced
1915 .line = __location__,
1916 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1919 .type = WREPL_TYPE_GROUP,
1920 .state = WREPL_STATE_RELEASED,
1921 .node = WREPL_NODE_B,
1923 .num_ips = ARRAY_SIZE(addresses_A_1),
1924 .ips = addresses_A_1,
1925 .apply_expected = False
1929 .type = WREPL_TYPE_GROUP,
1930 .state = WREPL_STATE_TOMBSTONE,
1931 .node = WREPL_NODE_B,
1933 .num_ips = ARRAY_SIZE(addresses_B_1),
1934 .ips = addresses_B_1,
1935 .apply_expected = True
1940 * group,tombstone vs. group,active
1941 * => should be replaced
1944 .line = __location__,
1945 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1948 .type = WREPL_TYPE_GROUP,
1949 .state = WREPL_STATE_TOMBSTONE,
1950 .node = WREPL_NODE_B,
1952 .num_ips = ARRAY_SIZE(addresses_B_1),
1953 .ips = addresses_B_1,
1954 .apply_expected = True
1958 .type = WREPL_TYPE_GROUP,
1959 .state = WREPL_STATE_ACTIVE,
1960 .node = WREPL_NODE_B,
1962 .num_ips = ARRAY_SIZE(addresses_A_1),
1963 .ips = addresses_A_1,
1964 .apply_expected = True
1969 * group,tombstone vs. group,tombstone
1970 * => should be replaced
1973 .line = __location__,
1974 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1977 .type = WREPL_TYPE_GROUP,
1978 .state = WREPL_STATE_TOMBSTONE,
1979 .node = WREPL_NODE_B,
1981 .num_ips = ARRAY_SIZE(addresses_A_1),
1982 .ips = addresses_A_1,
1983 .apply_expected = True
1987 .type = WREPL_TYPE_GROUP,
1988 .state = WREPL_STATE_TOMBSTONE,
1989 .node = WREPL_NODE_B,
1991 .num_ips = ARRAY_SIZE(addresses_B_1),
1992 .ips = addresses_B_1,
1993 .apply_expected = True
1998 * normal groups vs special groups section,
2001 * group,active vs. sgroup,active
2002 * => should NOT be replaced
2005 .line = __location__,
2006 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2009 .type = WREPL_TYPE_GROUP,
2010 .state = WREPL_STATE_ACTIVE,
2011 .node = WREPL_NODE_B,
2013 .num_ips = ARRAY_SIZE(addresses_B_1),
2014 .ips = addresses_B_1,
2015 .apply_expected = True
2019 .type = WREPL_TYPE_SGROUP,
2020 .state = WREPL_STATE_ACTIVE,
2021 .node = WREPL_NODE_B,
2023 .num_ips = ARRAY_SIZE(addresses_B_1),
2024 .ips = addresses_B_1,
2025 .apply_expected = False
2030 * group,active vs. sgroup,tombstone
2031 * => should NOT be replaced
2034 .line = __location__,
2035 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2038 .type = WREPL_TYPE_GROUP,
2039 .state = WREPL_STATE_ACTIVE,
2040 .node = WREPL_NODE_B,
2042 .num_ips = ARRAY_SIZE(addresses_B_1),
2043 .ips = addresses_B_1,
2044 .apply_expected = True
2048 .type = WREPL_TYPE_SGROUP,
2049 .state = WREPL_STATE_TOMBSTONE,
2050 .node = WREPL_NODE_B,
2052 .num_ips = ARRAY_SIZE(addresses_B_1),
2053 .ips = addresses_B_1,
2054 .apply_expected = False
2059 * group,released vs. sgroup,active
2060 * => should be replaced
2063 .line = __location__,
2064 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2067 .type = WREPL_TYPE_GROUP,
2068 .state = WREPL_STATE_RELEASED,
2069 .node = WREPL_NODE_B,
2071 .num_ips = ARRAY_SIZE(addresses_A_1),
2072 .ips = addresses_A_1,
2073 .apply_expected = False
2077 .type = WREPL_TYPE_SGROUP,
2078 .state = WREPL_STATE_ACTIVE,
2079 .node = WREPL_NODE_B,
2081 .num_ips = ARRAY_SIZE(addresses_B_1),
2082 .ips = addresses_B_1,
2083 .apply_expected = True
2088 * group,released vs. sgroup,tombstone
2089 * => should NOT be replaced
2092 .line = __location__,
2093 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2096 .type = WREPL_TYPE_GROUP,
2097 .state = WREPL_STATE_RELEASED,
2098 .node = WREPL_NODE_B,
2100 .num_ips = ARRAY_SIZE(addresses_B_1),
2101 .ips = addresses_B_1,
2102 .apply_expected = False
2106 .type = WREPL_TYPE_SGROUP,
2107 .state = WREPL_STATE_TOMBSTONE,
2108 .node = WREPL_NODE_B,
2110 .num_ips = ARRAY_SIZE(addresses_B_1),
2111 .ips = addresses_B_1,
2112 .apply_expected = False
2117 * group,tombstone vs. sgroup,active
2118 * => should be replaced
2121 .line = __location__,
2122 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2125 .type = WREPL_TYPE_GROUP,
2126 .state = WREPL_STATE_TOMBSTONE,
2127 .node = WREPL_NODE_B,
2129 .num_ips = ARRAY_SIZE(addresses_B_1),
2130 .ips = addresses_B_1,
2131 .apply_expected = True
2135 .type = WREPL_TYPE_SGROUP,
2136 .state = WREPL_STATE_ACTIVE,
2137 .node = WREPL_NODE_B,
2139 .num_ips = ARRAY_SIZE(addresses_A_1),
2140 .ips = addresses_A_1,
2141 .apply_expected = True
2146 * group,tombstone vs. sgroup,tombstone
2147 * => should be replaced
2150 .line = __location__,
2151 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2154 .type = WREPL_TYPE_GROUP,
2155 .state = WREPL_STATE_TOMBSTONE,
2156 .node = WREPL_NODE_B,
2158 .num_ips = ARRAY_SIZE(addresses_A_1),
2159 .ips = addresses_A_1,
2160 .apply_expected = True
2164 .type = WREPL_TYPE_SGROUP,
2165 .state = WREPL_STATE_TOMBSTONE,
2166 .node = WREPL_NODE_B,
2168 .num_ips = ARRAY_SIZE(addresses_B_1),
2169 .ips = addresses_B_1,
2170 .apply_expected = True
2175 * normal groups vs multi homed section,
2178 * group,active vs. mhomed,active
2179 * => should NOT be replaced
2182 .line = __location__,
2183 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2186 .type = WREPL_TYPE_GROUP,
2187 .state = WREPL_STATE_ACTIVE,
2188 .node = WREPL_NODE_B,
2190 .num_ips = ARRAY_SIZE(addresses_B_1),
2191 .ips = addresses_B_1,
2192 .apply_expected = True
2196 .type = WREPL_TYPE_MHOMED,
2197 .state = WREPL_STATE_ACTIVE,
2198 .node = WREPL_NODE_B,
2200 .num_ips = ARRAY_SIZE(addresses_B_1),
2201 .ips = addresses_B_1,
2202 .apply_expected = False
2207 * group,active vs. mhomed,tombstone
2208 * => should NOT be replaced
2211 .line = __location__,
2212 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2215 .type = WREPL_TYPE_GROUP,
2216 .state = WREPL_STATE_ACTIVE,
2217 .node = WREPL_NODE_B,
2219 .num_ips = ARRAY_SIZE(addresses_B_1),
2220 .ips = addresses_B_1,
2221 .apply_expected = True
2225 .type = WREPL_TYPE_MHOMED,
2226 .state = WREPL_STATE_TOMBSTONE,
2227 .node = WREPL_NODE_B,
2229 .num_ips = ARRAY_SIZE(addresses_B_1),
2230 .ips = addresses_B_1,
2231 .apply_expected = False
2236 * group,released vs. mhomed,active
2237 * => should NOT be replaced
2240 .line = __location__,
2241 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2244 .type = WREPL_TYPE_GROUP,
2245 .state = WREPL_STATE_RELEASED,
2246 .node = WREPL_NODE_B,
2248 .num_ips = ARRAY_SIZE(addresses_B_1),
2249 .ips = addresses_B_1,
2250 .apply_expected = False
2254 .type = WREPL_TYPE_MHOMED,
2255 .state = WREPL_STATE_ACTIVE,
2256 .node = WREPL_NODE_B,
2258 .num_ips = ARRAY_SIZE(addresses_B_1),
2259 .ips = addresses_B_1,
2260 .apply_expected = False
2265 * group,released vs. mhomed,tombstone
2266 * => should NOT be replaced
2269 .line = __location__,
2270 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2273 .type = WREPL_TYPE_GROUP,
2274 .state = WREPL_STATE_RELEASED,
2275 .node = WREPL_NODE_B,
2277 .num_ips = ARRAY_SIZE(addresses_B_1),
2278 .ips = addresses_B_1,
2279 .apply_expected = False
2283 .type = WREPL_TYPE_MHOMED,
2284 .state = WREPL_STATE_TOMBSTONE,
2285 .node = WREPL_NODE_B,
2287 .num_ips = ARRAY_SIZE(addresses_B_1),
2288 .ips = addresses_B_1,
2289 .apply_expected = False
2294 * group,tombstone vs. mhomed,active
2295 * => should be replaced
2298 .line = __location__,
2299 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2302 .type = WREPL_TYPE_GROUP,
2303 .state = WREPL_STATE_TOMBSTONE,
2304 .node = WREPL_NODE_B,
2306 .num_ips = ARRAY_SIZE(addresses_B_1),
2307 .ips = addresses_B_1,
2308 .apply_expected = True
2312 .type = WREPL_TYPE_MHOMED,
2313 .state = WREPL_STATE_ACTIVE,
2314 .node = WREPL_NODE_B,
2316 .num_ips = ARRAY_SIZE(addresses_A_1),
2317 .ips = addresses_A_1,
2318 .apply_expected = True
2323 * group,tombstone vs. mhomed,tombstone
2324 * => should be replaced
2327 .line = __location__,
2328 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2331 .type = WREPL_TYPE_GROUP,
2332 .state = WREPL_STATE_TOMBSTONE,
2333 .node = WREPL_NODE_B,
2335 .num_ips = ARRAY_SIZE(addresses_A_1),
2336 .ips = addresses_A_1,
2337 .apply_expected = True
2341 .type = WREPL_TYPE_MHOMED,
2342 .state = WREPL_STATE_TOMBSTONE,
2343 .node = WREPL_NODE_B,
2345 .num_ips = ARRAY_SIZE(addresses_B_1),
2346 .ips = addresses_B_1,
2347 .apply_expected = True
2352 * special groups vs unique section,
2355 * sgroup,active vs. unique,active
2356 * => should NOT be replaced
2359 .line = __location__,
2360 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2363 .type = WREPL_TYPE_SGROUP,
2364 .state = WREPL_STATE_ACTIVE,
2365 .node = WREPL_NODE_B,
2367 .num_ips = ARRAY_SIZE(addresses_B_1),
2368 .ips = addresses_B_1,
2369 .apply_expected = True
2373 .type = WREPL_TYPE_UNIQUE,
2374 .state = WREPL_STATE_ACTIVE,
2375 .node = WREPL_NODE_B,
2377 .num_ips = ARRAY_SIZE(addresses_B_1),
2378 .ips = addresses_B_1,
2379 .apply_expected = False
2384 * sgroup,active vs. unique,tombstone
2385 * => should NOT be replaced
2388 .line = __location__,
2389 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2392 .type = WREPL_TYPE_SGROUP,
2393 .state = WREPL_STATE_ACTIVE,
2394 .node = WREPL_NODE_B,
2396 .num_ips = ARRAY_SIZE(addresses_B_1),
2397 .ips = addresses_B_1,
2398 .apply_expected = True
2402 .type = WREPL_TYPE_UNIQUE,
2403 .state = WREPL_STATE_TOMBSTONE,
2404 .node = WREPL_NODE_B,
2406 .num_ips = ARRAY_SIZE(addresses_B_1),
2407 .ips = addresses_B_1,
2408 .apply_expected = False
2413 * sgroup,released vs. unique,active
2414 * => should be replaced
2417 .line = __location__,
2418 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2421 .type = WREPL_TYPE_SGROUP,
2422 .state = WREPL_STATE_RELEASED,
2423 .node = WREPL_NODE_B,
2425 .num_ips = ARRAY_SIZE(addresses_B_1),
2426 .ips = addresses_B_1,
2427 .apply_expected = False
2431 .type = WREPL_TYPE_UNIQUE,
2432 .state = WREPL_STATE_ACTIVE,
2433 .node = WREPL_NODE_B,
2435 .num_ips = ARRAY_SIZE(addresses_A_1),
2436 .ips = addresses_A_1,
2437 .apply_expected = True
2442 * sgroup,released vs. unique,tombstone
2443 * => should be replaced
2446 .line = __location__,
2447 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2450 .type = WREPL_TYPE_SGROUP,
2451 .state = WREPL_STATE_RELEASED,
2452 .node = WREPL_NODE_B,
2454 .num_ips = ARRAY_SIZE(addresses_A_1),
2455 .ips = addresses_A_1,
2456 .apply_expected = False
2460 .type = WREPL_TYPE_UNIQUE,
2461 .state = WREPL_STATE_TOMBSTONE,
2462 .node = WREPL_NODE_B,
2464 .num_ips = ARRAY_SIZE(addresses_B_1),
2465 .ips = addresses_B_1,
2466 .apply_expected = True
2471 * sgroup,tombstone vs. unique,active
2472 * => should be replaced
2475 .line = __location__,
2476 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2479 .type = WREPL_TYPE_SGROUP,
2480 .state = WREPL_STATE_TOMBSTONE,
2481 .node = WREPL_NODE_B,
2483 .num_ips = ARRAY_SIZE(addresses_A_1),
2484 .ips = addresses_A_1,
2485 .apply_expected = True
2489 .type = WREPL_TYPE_UNIQUE,
2490 .state = WREPL_STATE_ACTIVE,
2491 .node = WREPL_NODE_B,
2493 .num_ips = ARRAY_SIZE(addresses_B_1),
2494 .ips = addresses_B_1,
2495 .apply_expected = True
2500 * sgroup,tombstone vs. unique,tombstone
2501 * => should be replaced
2504 .line = __location__,
2505 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2508 .type = WREPL_TYPE_SGROUP,
2509 .state = WREPL_STATE_TOMBSTONE,
2510 .node = WREPL_NODE_B,
2512 .num_ips = ARRAY_SIZE(addresses_B_1),
2513 .ips = addresses_B_1,
2514 .apply_expected = True
2518 .type = WREPL_TYPE_UNIQUE,
2519 .state = WREPL_STATE_TOMBSTONE,
2520 .node = WREPL_NODE_B,
2522 .num_ips = ARRAY_SIZE(addresses_A_1),
2523 .ips = addresses_A_1,
2524 .apply_expected = True
2529 * special groups vs normal group section,
2532 * sgroup,active vs. group,active
2533 * => should NOT be replaced
2536 .line = __location__,
2537 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2540 .type = WREPL_TYPE_SGROUP,
2541 .state = WREPL_STATE_ACTIVE,
2542 .node = WREPL_NODE_B,
2544 .num_ips = ARRAY_SIZE(addresses_A_1),
2545 .ips = addresses_A_1,
2546 .apply_expected = True
2550 .type = WREPL_TYPE_GROUP,
2551 .state = WREPL_STATE_ACTIVE,
2552 .node = WREPL_NODE_B,
2554 .num_ips = ARRAY_SIZE(addresses_A_1),
2555 .ips = addresses_A_1,
2556 .apply_expected = False
2561 * sgroup,active vs. group,tombstone
2562 * => should NOT be replaced
2565 .line = __location__,
2566 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2569 .type = WREPL_TYPE_SGROUP,
2570 .state = WREPL_STATE_ACTIVE,
2571 .node = WREPL_NODE_B,
2573 .num_ips = ARRAY_SIZE(addresses_A_1),
2574 .ips = addresses_A_1,
2575 .apply_expected = True
2579 .type = WREPL_TYPE_GROUP,
2580 .state = WREPL_STATE_TOMBSTONE,
2581 .node = WREPL_NODE_B,
2583 .num_ips = ARRAY_SIZE(addresses_A_1),
2584 .ips = addresses_A_1,
2585 .apply_expected = False
2590 * sgroup,released vs. group,active
2591 * => should be replaced
2594 .line = __location__,
2595 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2598 .type = WREPL_TYPE_SGROUP,
2599 .state = WREPL_STATE_RELEASED,
2600 .node = WREPL_NODE_B,
2602 .num_ips = ARRAY_SIZE(addresses_A_1),
2603 .ips = addresses_A_1,
2604 .apply_expected = False
2608 .type = WREPL_TYPE_GROUP,
2609 .state = WREPL_STATE_ACTIVE,
2610 .node = WREPL_NODE_B,
2612 .num_ips = ARRAY_SIZE(addresses_B_1),
2613 .ips = addresses_B_1,
2614 .apply_expected = True
2619 * sgroup,released vs. group,tombstone
2620 * => should be replaced
2623 .line = __location__,
2624 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2627 .type = WREPL_TYPE_SGROUP,
2628 .state = WREPL_STATE_RELEASED,
2629 .node = WREPL_NODE_B,
2631 .num_ips = ARRAY_SIZE(addresses_B_1),
2632 .ips = addresses_B_1,
2633 .apply_expected = False
2637 .type = WREPL_TYPE_GROUP,
2638 .state = WREPL_STATE_TOMBSTONE,
2639 .node = WREPL_NODE_B,
2641 .num_ips = ARRAY_SIZE(addresses_A_1),
2642 .ips = addresses_A_1,
2643 .apply_expected = True
2648 * sgroup,tombstone vs. group,active
2649 * => should NOT be replaced
2652 .line = __location__,
2653 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2656 .type = WREPL_TYPE_SGROUP,
2657 .state = WREPL_STATE_TOMBSTONE,
2658 .node = WREPL_NODE_B,
2660 .num_ips = ARRAY_SIZE(addresses_A_1),
2661 .ips = addresses_A_1,
2662 .apply_expected = True
2666 .type = WREPL_TYPE_GROUP,
2667 .state = WREPL_STATE_ACTIVE,
2668 .node = WREPL_NODE_B,
2670 .num_ips = ARRAY_SIZE(addresses_B_1),
2671 .ips = addresses_B_1,
2672 .apply_expected = True
2677 * sgroup,tombstone vs. group,tombstone
2678 * => should NOT be replaced
2681 .line = __location__,
2682 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2685 .type = WREPL_TYPE_SGROUP,
2686 .state = WREPL_STATE_TOMBSTONE,
2687 .node = WREPL_NODE_B,
2689 .num_ips = ARRAY_SIZE(addresses_B_1),
2690 .ips = addresses_B_1,
2691 .apply_expected = True
2695 .type = WREPL_TYPE_GROUP,
2696 .state = WREPL_STATE_TOMBSTONE,
2697 .node = WREPL_NODE_B,
2699 .num_ips = ARRAY_SIZE(addresses_A_1),
2700 .ips = addresses_A_1,
2701 .apply_expected = True
2706 * special groups vs multi homed section,
2709 * sgroup,active vs. mhomed,active
2710 * => should NOT be replaced
2713 .line = __location__,
2714 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2717 .type = WREPL_TYPE_SGROUP,
2718 .state = WREPL_STATE_ACTIVE,
2719 .node = WREPL_NODE_B,
2721 .num_ips = ARRAY_SIZE(addresses_A_1),
2722 .ips = addresses_A_1,
2723 .apply_expected = True
2727 .type = WREPL_TYPE_MHOMED,
2728 .state = WREPL_STATE_ACTIVE,
2729 .node = WREPL_NODE_B,
2731 .num_ips = ARRAY_SIZE(addresses_A_1),
2732 .ips = addresses_A_1,
2733 .apply_expected = False
2738 * sgroup,active vs. mhomed,tombstone
2739 * => should NOT be replaced
2742 .line = __location__,
2743 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2746 .type = WREPL_TYPE_SGROUP,
2747 .state = WREPL_STATE_ACTIVE,
2748 .node = WREPL_NODE_B,
2750 .num_ips = ARRAY_SIZE(addresses_A_1),
2751 .ips = addresses_A_1,
2752 .apply_expected = True
2756 .type = WREPL_TYPE_MHOMED,
2757 .state = WREPL_STATE_TOMBSTONE,
2758 .node = WREPL_NODE_B,
2760 .num_ips = ARRAY_SIZE(addresses_A_1),
2761 .ips = addresses_A_1,
2762 .apply_expected = False
2767 * sgroup,released vs. mhomed,active
2768 * => should be replaced
2771 .line = __location__,
2772 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2775 .type = WREPL_TYPE_SGROUP,
2776 .state = WREPL_STATE_RELEASED,
2777 .node = WREPL_NODE_B,
2779 .num_ips = ARRAY_SIZE(addresses_A_1),
2780 .ips = addresses_A_1,
2781 .apply_expected = False
2785 .type = WREPL_TYPE_MHOMED,
2786 .state = WREPL_STATE_ACTIVE,
2787 .node = WREPL_NODE_B,
2789 .num_ips = ARRAY_SIZE(addresses_B_1),
2790 .ips = addresses_B_1,
2791 .apply_expected = True
2796 * sgroup,released vs. mhomed,tombstone
2797 * => should be replaced
2800 .line = __location__,
2801 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2804 .type = WREPL_TYPE_SGROUP,
2805 .state = WREPL_STATE_RELEASED,
2806 .node = WREPL_NODE_B,
2808 .num_ips = ARRAY_SIZE(addresses_B_1),
2809 .ips = addresses_B_1,
2810 .apply_expected = False
2814 .type = WREPL_TYPE_MHOMED,
2815 .state = WREPL_STATE_TOMBSTONE,
2816 .node = WREPL_NODE_B,
2818 .num_ips = ARRAY_SIZE(addresses_A_1),
2819 .ips = addresses_A_1,
2820 .apply_expected = True
2825 * sgroup,tombstone vs. mhomed,active
2826 * => should be replaced
2829 .line = __location__,
2830 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2833 .type = WREPL_TYPE_SGROUP,
2834 .state = WREPL_STATE_TOMBSTONE,
2835 .node = WREPL_NODE_B,
2837 .num_ips = ARRAY_SIZE(addresses_A_1),
2838 .ips = addresses_A_1,
2839 .apply_expected = True
2843 .type = WREPL_TYPE_MHOMED,
2844 .state = WREPL_STATE_ACTIVE,
2845 .node = WREPL_NODE_B,
2847 .num_ips = ARRAY_SIZE(addresses_B_1),
2848 .ips = addresses_B_1,
2849 .apply_expected = True
2854 * sgroup,tombstone vs. mhomed,tombstone
2855 * => should be replaced
2858 .line = __location__,
2859 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2862 .type = WREPL_TYPE_SGROUP,
2863 .state = WREPL_STATE_TOMBSTONE,
2864 .node = WREPL_NODE_B,
2866 .num_ips = ARRAY_SIZE(addresses_B_1),
2867 .ips = addresses_B_1,
2868 .apply_expected = True
2872 .type = WREPL_TYPE_MHOMED,
2873 .state = WREPL_STATE_TOMBSTONE,
2874 .node = WREPL_NODE_B,
2876 .num_ips = ARRAY_SIZE(addresses_A_1),
2877 .ips = addresses_A_1,
2878 .apply_expected = True
2883 * multi homed vs. unique section,
2886 * mhomed,active vs. unique,active
2887 * => should be replaced
2890 .line = __location__,
2891 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2894 .type = WREPL_TYPE_MHOMED,
2895 .state = WREPL_STATE_ACTIVE,
2896 .node = WREPL_NODE_B,
2898 .num_ips = ARRAY_SIZE(addresses_A_3_4),
2899 .ips = addresses_A_3_4,
2900 .apply_expected = True
2904 .type = WREPL_TYPE_UNIQUE,
2905 .state = WREPL_STATE_ACTIVE,
2906 .node = WREPL_NODE_B,
2908 .num_ips = ARRAY_SIZE(addresses_B_1),
2909 .ips = addresses_B_1,
2910 .apply_expected = True
2915 * mhomed,active vs. unique,tombstone
2916 * => should NOT be replaced
2919 .line = __location__,
2920 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2923 .type = WREPL_TYPE_MHOMED,
2924 .state = WREPL_STATE_ACTIVE,
2925 .node = WREPL_NODE_B,
2927 .num_ips = ARRAY_SIZE(addresses_B_1),
2928 .ips = addresses_B_1,
2929 .apply_expected = True
2933 .type = WREPL_TYPE_UNIQUE,
2934 .state = WREPL_STATE_TOMBSTONE,
2935 .node = WREPL_NODE_B,
2937 .num_ips = ARRAY_SIZE(addresses_B_1),
2938 .ips = addresses_B_1,
2939 .apply_expected = False
2944 * mhomed,released vs. unique,active
2945 * => should be replaced
2948 .line = __location__,
2949 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2952 .type = WREPL_TYPE_MHOMED,
2953 .state = WREPL_STATE_RELEASED,
2954 .node = WREPL_NODE_B,
2956 .num_ips = ARRAY_SIZE(addresses_A_1),
2957 .ips = addresses_A_1,
2958 .apply_expected = False
2962 .type = WREPL_TYPE_UNIQUE,
2963 .state = WREPL_STATE_ACTIVE,
2964 .node = WREPL_NODE_B,
2966 .num_ips = ARRAY_SIZE(addresses_B_1),
2967 .ips = addresses_B_1,
2968 .apply_expected = True
2973 * mhomed,released vs. uinique,tombstone
2974 * => should be replaced
2977 .line = __location__,
2978 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2981 .type = WREPL_TYPE_MHOMED,
2982 .state = WREPL_STATE_RELEASED,
2983 .node = WREPL_NODE_B,
2985 .num_ips = ARRAY_SIZE(addresses_B_1),
2986 .ips = addresses_B_1,
2987 .apply_expected = False
2991 .type = WREPL_TYPE_UNIQUE,
2992 .state = WREPL_STATE_TOMBSTONE,
2993 .node = WREPL_NODE_B,
2995 .num_ips = ARRAY_SIZE(addresses_A_1),
2996 .ips = addresses_A_1,
2997 .apply_expected = True
3002 * mhomed,tombstone vs. unique,active
3003 * => should be replaced
3006 .line = __location__,
3007 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3010 .type = WREPL_TYPE_MHOMED,
3011 .state = WREPL_STATE_TOMBSTONE,
3012 .node = WREPL_NODE_B,
3014 .num_ips = ARRAY_SIZE(addresses_A_1),
3015 .ips = addresses_A_1,
3016 .apply_expected = True
3020 .type = WREPL_TYPE_UNIQUE,
3021 .state = WREPL_STATE_ACTIVE,
3022 .node = WREPL_NODE_B,
3024 .num_ips = ARRAY_SIZE(addresses_B_1),
3025 .ips = addresses_B_1,
3026 .apply_expected = True
3031 * mhomed,tombstone vs. uinique,tombstone
3032 * => should be replaced
3035 .line = __location__,
3036 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3039 .type = WREPL_TYPE_MHOMED,
3040 .state = WREPL_STATE_TOMBSTONE,
3041 .node = WREPL_NODE_B,
3043 .num_ips = ARRAY_SIZE(addresses_B_1),
3044 .ips = addresses_B_1,
3045 .apply_expected = True
3049 .type = WREPL_TYPE_UNIQUE,
3050 .state = WREPL_STATE_TOMBSTONE,
3051 .node = WREPL_NODE_B,
3053 .num_ips = ARRAY_SIZE(addresses_A_1),
3054 .ips = addresses_A_1,
3055 .apply_expected = True
3060 * multi homed vs. normal group section,
3063 * mhomed,active vs. group,active
3064 * => should be replaced
3067 .line = __location__,
3068 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3071 .type = WREPL_TYPE_MHOMED,
3072 .state = WREPL_STATE_ACTIVE,
3073 .node = WREPL_NODE_B,
3075 .num_ips = ARRAY_SIZE(addresses_A_1),
3076 .ips = addresses_A_1,
3077 .apply_expected = True
3081 .type = WREPL_TYPE_GROUP,
3082 .state = WREPL_STATE_ACTIVE,
3083 .node = WREPL_NODE_B,
3085 .num_ips = ARRAY_SIZE(addresses_B_1),
3086 .ips = addresses_B_1,
3087 .apply_expected = True
3092 * mhomed,active vs. group,tombstone
3093 * => should NOT be replaced
3096 .line = __location__,
3097 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3100 .type = WREPL_TYPE_MHOMED,
3101 .state = WREPL_STATE_ACTIVE,
3102 .node = WREPL_NODE_B,
3104 .num_ips = ARRAY_SIZE(addresses_B_1),
3105 .ips = addresses_B_1,
3106 .apply_expected = True
3110 .type = WREPL_TYPE_GROUP,
3111 .state = WREPL_STATE_TOMBSTONE,
3112 .node = WREPL_NODE_B,
3114 .num_ips = ARRAY_SIZE(addresses_B_1),
3115 .ips = addresses_B_1,
3116 .apply_expected = False
3121 * mhomed,released vs. group,active
3122 * => should be replaced
3125 .line = __location__,
3126 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3129 .type = WREPL_TYPE_MHOMED,
3130 .state = WREPL_STATE_RELEASED,
3131 .node = WREPL_NODE_B,
3133 .num_ips = ARRAY_SIZE(addresses_B_1),
3134 .ips = addresses_B_1,
3135 .apply_expected = False
3139 .type = WREPL_TYPE_GROUP,
3140 .state = WREPL_STATE_ACTIVE,
3141 .node = WREPL_NODE_B,
3143 .num_ips = ARRAY_SIZE(addresses_A_1),
3144 .ips = addresses_A_1,
3145 .apply_expected = True
3150 * mhomed,released vs. group,tombstone
3151 * => should be replaced
3154 .line = __location__,
3155 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3158 .type = WREPL_TYPE_MHOMED,
3159 .state = WREPL_STATE_RELEASED,
3160 .node = WREPL_NODE_B,
3162 .num_ips = ARRAY_SIZE(addresses_A_1),
3163 .ips = addresses_A_1,
3164 .apply_expected = False
3168 .type = WREPL_TYPE_GROUP,
3169 .state = WREPL_STATE_TOMBSTONE,
3170 .node = WREPL_NODE_B,
3172 .num_ips = ARRAY_SIZE(addresses_B_1),
3173 .ips = addresses_B_1,
3174 .apply_expected = True
3179 * mhomed,tombstone vs. group,active
3180 * => should be replaced
3183 .line = __location__,
3184 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3187 .type = WREPL_TYPE_MHOMED,
3188 .state = WREPL_STATE_TOMBSTONE,
3189 .node = WREPL_NODE_B,
3191 .num_ips = ARRAY_SIZE(addresses_B_1),
3192 .ips = addresses_B_1,
3193 .apply_expected = True
3197 .type = WREPL_TYPE_GROUP,
3198 .state = WREPL_STATE_ACTIVE,
3199 .node = WREPL_NODE_B,
3201 .num_ips = ARRAY_SIZE(addresses_A_1),
3202 .ips = addresses_A_1,
3203 .apply_expected = True
3208 * mhomed,tombstone vs. group,tombstone
3209 * => should be replaced
3212 .line = __location__,
3213 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3216 .type = WREPL_TYPE_MHOMED,
3217 .state = WREPL_STATE_TOMBSTONE,
3218 .node = WREPL_NODE_B,
3220 .num_ips = ARRAY_SIZE(addresses_A_1),
3221 .ips = addresses_A_1,
3222 .apply_expected = True
3226 .type = WREPL_TYPE_GROUP,
3227 .state = WREPL_STATE_TOMBSTONE,
3228 .node = WREPL_NODE_B,
3230 .num_ips = ARRAY_SIZE(addresses_B_1),
3231 .ips = addresses_B_1,
3232 .apply_expected = True
3237 * multi homed vs. special group section,
3240 * mhomed,active vs. sgroup,active
3241 * => should NOT be replaced
3244 .line = __location__,
3245 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3248 .type = WREPL_TYPE_MHOMED,
3249 .state = WREPL_STATE_ACTIVE,
3250 .node = WREPL_NODE_B,
3252 .num_ips = ARRAY_SIZE(addresses_A_1),
3253 .ips = addresses_A_1,
3254 .apply_expected = True
3258 .type = WREPL_TYPE_SGROUP,
3259 .state = WREPL_STATE_ACTIVE,
3260 .node = WREPL_NODE_B,
3262 .num_ips = ARRAY_SIZE(addresses_A_1),
3263 .ips = addresses_A_1,
3264 .apply_expected = False
3269 * mhomed,active vs. sgroup,tombstone
3270 * => should NOT be replaced
3273 .line = __location__,
3274 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3277 .type = WREPL_TYPE_MHOMED,
3278 .state = WREPL_STATE_ACTIVE,
3279 .node = WREPL_NODE_B,
3281 .num_ips = ARRAY_SIZE(addresses_A_1),
3282 .ips = addresses_A_1,
3283 .apply_expected = True
3287 .type = WREPL_TYPE_SGROUP,
3288 .state = WREPL_STATE_TOMBSTONE,
3289 .node = WREPL_NODE_B,
3291 .num_ips = ARRAY_SIZE(addresses_A_1),
3292 .ips = addresses_A_1,
3293 .apply_expected = False
3298 * mhomed,released vs. sgroup,active
3299 * => should be replaced
3302 .line = __location__,
3303 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3306 .type = WREPL_TYPE_MHOMED,
3307 .state = WREPL_STATE_RELEASED,
3308 .node = WREPL_NODE_B,
3310 .num_ips = ARRAY_SIZE(addresses_A_1),
3311 .ips = addresses_A_1,
3312 .apply_expected = False
3316 .type = WREPL_TYPE_SGROUP,
3317 .state = WREPL_STATE_ACTIVE,
3318 .node = WREPL_NODE_B,
3320 .num_ips = ARRAY_SIZE(addresses_B_1),
3321 .ips = addresses_B_1,
3322 .apply_expected = True
3327 * mhomed,released vs. sgroup,tombstone
3328 * => should be replaced
3331 .line = __location__,
3332 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3335 .type = WREPL_TYPE_MHOMED,
3336 .state = WREPL_STATE_RELEASED,
3337 .node = WREPL_NODE_B,
3339 .num_ips = ARRAY_SIZE(addresses_B_1),
3340 .ips = addresses_B_1,
3341 .apply_expected = False
3345 .type = WREPL_TYPE_SGROUP,
3346 .state = WREPL_STATE_TOMBSTONE,
3347 .node = WREPL_NODE_B,
3349 .num_ips = ARRAY_SIZE(addresses_A_1),
3350 .ips = addresses_A_1,
3351 .apply_expected = True
3356 * mhomed,tombstone vs. sgroup,active
3357 * => should be replaced
3360 .line = __location__,
3361 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3364 .type = WREPL_TYPE_MHOMED,
3365 .state = WREPL_STATE_TOMBSTONE,
3366 .node = WREPL_NODE_B,
3368 .num_ips = ARRAY_SIZE(addresses_A_1),
3369 .ips = addresses_A_1,
3370 .apply_expected = True
3374 .type = WREPL_TYPE_SGROUP,
3375 .state = WREPL_STATE_ACTIVE,
3376 .node = WREPL_NODE_B,
3378 .num_ips = ARRAY_SIZE(addresses_B_1),
3379 .ips = addresses_B_1,
3380 .apply_expected = True
3385 * mhomed,tombstone vs. sgroup,tombstone
3386 * => should be replaced
3389 .line = __location__,
3390 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3393 .type = WREPL_TYPE_MHOMED,
3394 .state = WREPL_STATE_TOMBSTONE,
3395 .node = WREPL_NODE_B,
3397 .num_ips = ARRAY_SIZE(addresses_B_1),
3398 .ips = addresses_B_1,
3399 .apply_expected = True
3403 .type = WREPL_TYPE_SGROUP,
3404 .state = WREPL_STATE_TOMBSTONE,
3405 .node = WREPL_NODE_B,
3407 .num_ips = ARRAY_SIZE(addresses_A_1),
3408 .ips = addresses_A_1,
3409 .apply_expected = True
3414 * multi homed vs. mlti homed section,
3417 * mhomed,active vs. mhomed,active
3418 * => should be replaced
3421 .line = __location__,
3422 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3425 .type = WREPL_TYPE_MHOMED,
3426 .state = WREPL_STATE_ACTIVE,
3427 .node = WREPL_NODE_B,
3429 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3430 .ips = addresses_A_3_4,
3431 .apply_expected = True
3435 .type = WREPL_TYPE_MHOMED,
3436 .state = WREPL_STATE_ACTIVE,
3437 .node = WREPL_NODE_B,
3439 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3440 .ips = addresses_B_3_4,
3441 .apply_expected = True
3446 * mhomed,active vs. mhomed,tombstone
3447 * => should NOT be replaced
3450 .line = __location__,
3451 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3454 .type = WREPL_TYPE_MHOMED,
3455 .state = WREPL_STATE_ACTIVE,
3456 .node = WREPL_NODE_B,
3458 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3459 .ips = addresses_B_3_4,
3460 .apply_expected = True
3464 .type = WREPL_TYPE_MHOMED,
3465 .state = WREPL_STATE_TOMBSTONE,
3466 .node = WREPL_NODE_B,
3468 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3469 .ips = addresses_B_3_4,
3470 .apply_expected = False
3475 * mhomed,released vs. mhomed,active
3476 * => should be replaced
3479 .line = __location__,
3480 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3483 .type = WREPL_TYPE_MHOMED,
3484 .state = WREPL_STATE_RELEASED,
3485 .node = WREPL_NODE_B,
3487 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3488 .ips = addresses_B_3_4,
3489 .apply_expected = False
3493 .type = WREPL_TYPE_MHOMED,
3494 .state = WREPL_STATE_ACTIVE,
3495 .node = WREPL_NODE_B,
3497 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3498 .ips = addresses_A_3_4,
3499 .apply_expected = True
3504 * mhomed,released vs. mhomed,tombstone
3505 * => should be replaced
3508 .line = __location__,
3509 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3512 .type = WREPL_TYPE_MHOMED,
3513 .state = WREPL_STATE_RELEASED,
3514 .node = WREPL_NODE_B,
3516 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3517 .ips = addresses_A_3_4,
3518 .apply_expected = False
3522 .type = WREPL_TYPE_MHOMED,
3523 .state = WREPL_STATE_TOMBSTONE,
3524 .node = WREPL_NODE_B,
3526 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3527 .ips = addresses_B_3_4,
3528 .apply_expected = True
3533 * mhomed,tombstone vs. mhomed,active
3534 * => should be replaced
3537 .line = __location__,
3538 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3541 .type = WREPL_TYPE_MHOMED,
3542 .state = WREPL_STATE_TOMBSTONE,
3543 .node = WREPL_NODE_B,
3545 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3546 .ips = addresses_B_3_4,
3547 .apply_expected = True
3551 .type = WREPL_TYPE_MHOMED,
3552 .state = WREPL_STATE_ACTIVE,
3553 .node = WREPL_NODE_B,
3555 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3556 .ips = addresses_A_3_4,
3557 .apply_expected = True
3562 * mhomed,tombstone vs. mhomed,tombstone
3563 * => should be replaced
3566 .line = __location__,
3567 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3570 .type = WREPL_TYPE_MHOMED,
3571 .state = WREPL_STATE_TOMBSTONE,
3572 .node = WREPL_NODE_B,
3574 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3575 .ips = addresses_A_3_4,
3576 .apply_expected = True
3580 .type = WREPL_TYPE_MHOMED,
3581 .state = WREPL_STATE_TOMBSTONE,
3582 .node = WREPL_NODE_B,
3584 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3585 .ips = addresses_B_3_4,
3586 .apply_expected = True
3592 * special group vs special group section,
3595 * sgroup,active vs. sgroup,active
3596 * => should be merged
3599 .line = __location__,
3600 .name = _NBT_NAME("_DIFF_OWNER_SG", 0x00, NULL),
3604 .type = WREPL_TYPE_SGROUP,
3605 .state = WREPL_STATE_ACTIVE,
3606 .node = WREPL_NODE_B,
3608 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3609 .ips = addresses_A_3_4,
3610 .apply_expected = True,
3614 .type = WREPL_TYPE_SGROUP,
3615 .state = WREPL_STATE_ACTIVE,
3616 .node = WREPL_NODE_B,
3618 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3619 .ips = addresses_B_3_4,
3620 .apply_expected = False,
3621 .merge_expected = True
3625 .line = __location__,
3626 .name = _NBT_NAME("_DIFF_OWNER_SG", 0x00, NULL),
3630 .type = WREPL_TYPE_SGROUP,
3631 .state = WREPL_STATE_ACTIVE,
3632 .node = WREPL_NODE_B,
3636 .apply_expected = False
3640 .type = WREPL_TYPE_SGROUP,
3641 .state = WREPL_STATE_ACTIVE,
3642 .node = WREPL_NODE_B,
3646 .apply_expected = False,
3647 .merge_expected = False
3651 .line = __location__,
3652 .name = _NBT_NAME("_DIFF_OWNER_SG", 0x00, NULL),
3656 .type = WREPL_TYPE_SGROUP,
3657 .state = WREPL_STATE_ACTIVE,
3658 .node = WREPL_NODE_B,
3660 .num_ips = ARRAY_SIZE(addresses_A_1),
3661 .ips = addresses_A_1,
3662 .apply_expected = True
3666 .type = WREPL_TYPE_UNIQUE,
3667 .state = WREPL_STATE_TOMBSTONE,
3668 .node = WREPL_NODE_B,
3670 .num_ips = ARRAY_SIZE(addresses_A_1),
3671 .ips = addresses_A_1,
3672 .apply_expected = True
3677 * This should be the last record in this array,
3678 * we need to make sure the we leave a tombstoned unique entry
3682 .line = __location__,
3683 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3687 .type = WREPL_TYPE_UNIQUE,
3688 .state = WREPL_STATE_TOMBSTONE,
3689 .node = WREPL_NODE_B,
3691 .num_ips = ARRAY_SIZE(addresses_A_1),
3692 .ips = addresses_A_1,
3693 .apply_expected = True
3697 .type = WREPL_TYPE_UNIQUE,
3698 .state = WREPL_STATE_TOMBSTONE,
3699 .node = WREPL_NODE_B,
3701 .num_ips = ARRAY_SIZE(addresses_A_1),
3702 .ips = addresses_A_1,
3703 .apply_expected = True
3705 }}; /* do not add entries here, this should be the last record! */
3707 if (!ctx) return False;
3709 wins_name_r1 = &wins_name1;
3710 wins_name_r2 = &wins_name2;
3712 printf("Test Replica Conflicts with different owners\n");
3714 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
3716 if (!records[i].extra && !records[i].cleanup) {
3717 /* we should test the worst cases */
3718 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
3719 printf("(%s) Programmer error, invalid record[%u]: %s\n",
3720 __location__, i, records[i].line);
3722 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
3723 printf("(%s) Programmer error, invalid record[%u]: %s\n",
3724 __location__, i, records[i].line);
3729 if (!records[i].cleanup) {
3730 const char *expected;
3733 if (records[i].r2.merge_expected) {
3735 } else if (records[i].r2.apply_expected) {
3736 expected = "REPLACE";
3738 expected = "NOT REPLACE";
3741 if (!records[i].r1.ips && !records[i].r2.ips) {
3743 } else if (records[i].r1.ips==records[i].r2.ips) {
3749 printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
3750 wrepl_name_type_string(records[i].r1.type),
3751 wrepl_name_state_string(records[i].r1.state),
3752 (records[i].r1.is_static?",static":""),
3753 wrepl_name_type_string(records[i].r2.type),
3754 wrepl_name_state_string(records[i].r2.state),
3755 (records[i].r2.is_static?",static":""),
3762 wins_name_r1->name = &records[i].name;
3763 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
3764 records[i].r1.state,
3766 records[i].r1.is_static);
3767 wins_name_r1->id = ++records[i].r1.owner->max_version;
3768 if (wins_name_r1->flags & 2) {
3769 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
3770 wins_name_r1->addresses.addresses.ips = discard_const(records[i].r1.ips);
3772 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
3774 wins_name_r1->unknown = "255.255.255.255";
3777 ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1);
3778 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
3779 wins_name_r1, records[i].r1.apply_expected);
3784 wins_name_r2->name = &records[i].name;
3785 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
3786 records[i].r2.state,
3788 records[i].r2.is_static);
3789 wins_name_r2->id = ++records[i].r2.owner->max_version;
3790 if (wins_name_r2->flags & 2) {
3791 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
3792 wins_name_r2->addresses.addresses.ips = discard_const(records[i].r2.ips);
3794 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
3796 wins_name_r2->unknown = "255.255.255.255";
3799 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
3800 if (records[i].r1.state == WREPL_STATE_RELEASED) {
3801 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
3802 wins_name_r1, False);
3803 } else if (records[i].r2.merge_expected) {
3804 ret &= test_wrepl_is_merged(ctx, wins_name_r1, wins_name_r2);
3805 } else if (records[i].r1.owner != records[i].r2.owner) {
3807 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
3808 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
3809 wins_name_r1, _expected);
3811 if (records[i].r2.state == WREPL_STATE_RELEASED) {
3812 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
3813 wins_name_r2, False);
3814 } else if (!records[i].r2.merge_expected) {
3815 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
3816 wins_name_r2, records[i].r2.apply_expected);
3819 /* the first one is a cleanup run */
3820 if (!ret && i == 0) ret = True;
3823 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
3831 static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_conn *ctx)
3835 struct wrepl_wins_name wins_name_;
3836 struct wrepl_wins_name *wins_name = &wins_name_;
3837 struct nbt_name_register name_register_;
3838 struct nbt_name_register *name_register = &name_register_;
3839 struct nbt_name_release release_;
3840 struct nbt_name_release *release = &release_;
3843 const char *line; /* just better debugging */
3844 struct nbt_name name;
3849 const struct wrepl_ip *ips;
3850 BOOL apply_expected;
3853 enum wrepl_name_type type;
3854 enum wrepl_name_state state;
3855 enum wrepl_name_node node;
3858 const struct wrepl_ip *ips;
3859 BOOL apply_expected;
3863 * unique vs. unique section
3866 * unique,released vs. unique,active with same ip(s)
3869 .line = __location__,
3870 .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL),
3874 .num_ips = ctx->addresses_1_num,
3875 .ips = ctx->addresses_1,
3876 .apply_expected = True
3879 .type = WREPL_TYPE_UNIQUE,
3880 .state = WREPL_STATE_ACTIVE,
3881 .node = WREPL_NODE_B,
3883 .num_ips = ctx->addresses_1_num,
3884 .ips = ctx->addresses_1,
3885 .apply_expected = True
3889 * unique,released vs. unique,active with different ip(s)
3892 .line = __location__,
3893 .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL),
3897 .num_ips = ctx->addresses_1_num,
3898 .ips = ctx->addresses_1,
3899 .apply_expected = True
3902 .type = WREPL_TYPE_UNIQUE,
3903 .state = WREPL_STATE_ACTIVE,
3904 .node = WREPL_NODE_B,
3906 .num_ips = ARRAY_SIZE(addresses_B_1),
3907 .ips = addresses_B_1,
3908 .apply_expected = True
3912 * unique,released vs. unique,tombstone with same ip(s)
3915 .line = __location__,
3916 .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL),
3920 .num_ips = ctx->addresses_1_num,
3921 .ips = ctx->addresses_1,
3922 .apply_expected = True
3925 .type = WREPL_TYPE_UNIQUE,
3926 .state = WREPL_STATE_TOMBSTONE,
3927 .node = WREPL_NODE_B,
3929 .num_ips = ctx->addresses_1_num,
3930 .ips = ctx->addresses_1,
3931 .apply_expected = True
3935 * unique,released vs. unique,tombstone with different ip(s)
3938 .line = __location__,
3939 .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL),
3943 .num_ips = ctx->addresses_1_num,
3944 .ips = ctx->addresses_1,
3945 .apply_expected = True
3948 .type = WREPL_TYPE_UNIQUE,
3949 .state = WREPL_STATE_TOMBSTONE,
3950 .node = WREPL_NODE_B,
3952 .num_ips = ARRAY_SIZE(addresses_B_1),
3953 .ips = addresses_B_1,
3954 .apply_expected = True
3958 * unique vs. group section
3961 * unique,released vs. group,active with same ip(s)
3964 .line = __location__,
3965 .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL),
3969 .num_ips = ctx->addresses_1_num,
3970 .ips = ctx->addresses_1,
3971 .apply_expected = True
3974 .type = WREPL_TYPE_GROUP,
3975 .state = WREPL_STATE_ACTIVE,
3976 .node = WREPL_NODE_B,
3978 .num_ips = ctx->addresses_1_num,
3979 .ips = ctx->addresses_1,
3980 .apply_expected = True
3984 * unique,released vs. group,active with different ip(s)
3987 .line = __location__,
3988 .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL),
3992 .num_ips = ctx->addresses_1_num,
3993 .ips = ctx->addresses_1,
3994 .apply_expected = True
3997 .type = WREPL_TYPE_GROUP,
3998 .state = WREPL_STATE_ACTIVE,
3999 .node = WREPL_NODE_B,
4001 .num_ips = ARRAY_SIZE(addresses_B_1),
4002 .ips = addresses_B_1,
4003 .apply_expected = True
4007 * unique,released vs. group,tombstone with same ip(s)
4010 .line = __location__,
4011 .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL),
4015 .num_ips = ctx->addresses_1_num,
4016 .ips = ctx->addresses_1,
4017 .apply_expected = True
4020 .type = WREPL_TYPE_GROUP,
4021 .state = WREPL_STATE_TOMBSTONE,
4022 .node = WREPL_NODE_B,
4024 .num_ips = ctx->addresses_1_num,
4025 .ips = ctx->addresses_1,
4026 .apply_expected = True
4030 * unique,released vs. group,tombstone with different ip(s)
4033 .line = __location__,
4034 .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL),
4038 .num_ips = ctx->addresses_1_num,
4039 .ips = ctx->addresses_1,
4040 .apply_expected = True
4043 .type = WREPL_TYPE_GROUP,
4044 .state = WREPL_STATE_TOMBSTONE,
4045 .node = WREPL_NODE_B,
4047 .num_ips = ARRAY_SIZE(addresses_B_1),
4048 .ips = addresses_B_1,
4049 .apply_expected = True
4053 * unique vs. special group section
4056 * unique,released vs. sgroup,active with same ip(s)
4059 .line = __location__,
4060 .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL),
4064 .num_ips = ctx->addresses_1_num,
4065 .ips = ctx->addresses_1,
4066 .apply_expected = True
4069 .type = WREPL_TYPE_SGROUP,
4070 .state = WREPL_STATE_ACTIVE,
4071 .node = WREPL_NODE_B,
4073 .num_ips = ctx->addresses_1_num,
4074 .ips = ctx->addresses_1,
4075 .apply_expected = True
4079 * unique,released vs. sgroup,active with different ip(s)
4082 .line = __location__,
4083 .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL),
4087 .num_ips = ctx->addresses_1_num,
4088 .ips = ctx->addresses_1,
4089 .apply_expected = True
4092 .type = WREPL_TYPE_SGROUP,
4093 .state = WREPL_STATE_ACTIVE,
4094 .node = WREPL_NODE_B,
4096 .num_ips = ARRAY_SIZE(addresses_B_1),
4097 .ips = addresses_B_1,
4098 .apply_expected = True
4102 * unique,released vs. sgroup,tombstone with same ip(s)
4105 .line = __location__,
4106 .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL),
4110 .num_ips = ctx->addresses_1_num,
4111 .ips = ctx->addresses_1,
4112 .apply_expected = True
4115 .type = WREPL_TYPE_SGROUP,
4116 .state = WREPL_STATE_TOMBSTONE,
4117 .node = WREPL_NODE_B,
4119 .num_ips = ctx->addresses_1_num,
4120 .ips = ctx->addresses_1,
4121 .apply_expected = True
4125 * unique,released vs. sgroup,tombstone with different ip(s)
4128 .line = __location__,
4129 .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL),
4133 .num_ips = ctx->addresses_1_num,
4134 .ips = ctx->addresses_1,
4135 .apply_expected = True
4138 .type = WREPL_TYPE_SGROUP,
4139 .state = WREPL_STATE_TOMBSTONE,
4140 .node = WREPL_NODE_B,
4142 .num_ips = ARRAY_SIZE(addresses_B_1),
4143 .ips = addresses_B_1,
4144 .apply_expected = True
4148 * unique vs. multi homed section
4151 * unique,released vs. mhomed,active with same ip(s)
4154 .line = __location__,
4155 .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL),
4159 .num_ips = ctx->addresses_1_num,
4160 .ips = ctx->addresses_1,
4161 .apply_expected = True
4164 .type = WREPL_TYPE_MHOMED,
4165 .state = WREPL_STATE_ACTIVE,
4166 .node = WREPL_NODE_B,
4168 .num_ips = ctx->addresses_1_num,
4169 .ips = ctx->addresses_1,
4170 .apply_expected = True
4174 * unique,released vs. mhomed,active with different ip(s)
4177 .line = __location__,
4178 .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL),
4182 .num_ips = ctx->addresses_1_num,
4183 .ips = ctx->addresses_1,
4184 .apply_expected = True
4187 .type = WREPL_TYPE_MHOMED,
4188 .state = WREPL_STATE_ACTIVE,
4189 .node = WREPL_NODE_B,
4191 .num_ips = ARRAY_SIZE(addresses_B_1),
4192 .ips = addresses_B_1,
4193 .apply_expected = True
4197 * unique,released vs. mhomed,tombstone with same ip(s)
4200 .line = __location__,
4201 .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL),
4205 .num_ips = ctx->addresses_1_num,
4206 .ips = ctx->addresses_1,
4207 .apply_expected = True
4210 .type = WREPL_TYPE_MHOMED,
4211 .state = WREPL_STATE_TOMBSTONE,
4212 .node = WREPL_NODE_B,
4214 .num_ips = ctx->addresses_1_num,
4215 .ips = ctx->addresses_1,
4216 .apply_expected = True
4220 * unique,released vs. mhomed,tombstone with different ip(s)
4223 .line = __location__,
4224 .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL),
4228 .num_ips = ctx->addresses_1_num,
4229 .ips = ctx->addresses_1,
4230 .apply_expected = True
4233 .type = WREPL_TYPE_MHOMED,
4234 .state = WREPL_STATE_TOMBSTONE,
4235 .node = WREPL_NODE_B,
4237 .num_ips = ARRAY_SIZE(addresses_B_1),
4238 .ips = addresses_B_1,
4239 .apply_expected = True
4243 * group vs. unique section
4246 * group,released vs. unique,active with same ip(s)
4249 .line = __location__,
4250 .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL),
4252 .nb_flags = NBT_NM_GROUP,
4254 .num_ips = ctx->addresses_1_num,
4255 .ips = ctx->addresses_1,
4256 .apply_expected = True
4259 .type = WREPL_TYPE_UNIQUE,
4260 .state = WREPL_STATE_ACTIVE,
4261 .node = WREPL_NODE_B,
4263 .num_ips = ctx->addresses_1_num,
4264 .ips = ctx->addresses_1,
4265 .apply_expected = False
4269 * group,released vs. unique,active with different ip(s)
4272 .line = __location__,
4273 .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL),
4275 .nb_flags = NBT_NM_GROUP,
4277 .num_ips = ctx->addresses_1_num,
4278 .ips = ctx->addresses_1,
4279 .apply_expected = True
4282 .type = WREPL_TYPE_UNIQUE,
4283 .state = WREPL_STATE_ACTIVE,
4284 .node = WREPL_NODE_B,
4286 .num_ips = ARRAY_SIZE(addresses_B_1),
4287 .ips = addresses_B_1,
4288 .apply_expected = False
4292 * group,released vs. unique,tombstone with same ip(s)
4295 .line = __location__,
4296 .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL),
4298 .nb_flags = NBT_NM_GROUP,
4300 .num_ips = ctx->addresses_1_num,
4301 .ips = ctx->addresses_1,
4302 .apply_expected = True
4305 .type = WREPL_TYPE_UNIQUE,
4306 .state = WREPL_STATE_TOMBSTONE,
4307 .node = WREPL_NODE_B,
4309 .num_ips = ctx->addresses_1_num,
4310 .ips = ctx->addresses_1,
4311 .apply_expected = False
4315 * group,released vs. unique,tombstone with different ip(s)
4318 .line = __location__,
4319 .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL),
4321 .nb_flags = NBT_NM_GROUP,
4323 .num_ips = ctx->addresses_1_num,
4324 .ips = ctx->addresses_1,
4325 .apply_expected = True
4328 .type = WREPL_TYPE_UNIQUE,
4329 .state = WREPL_STATE_TOMBSTONE,
4330 .node = WREPL_NODE_B,
4332 .num_ips = ARRAY_SIZE(addresses_B_1),
4333 .ips = addresses_B_1,
4334 .apply_expected = False
4338 * group vs. group section
4341 * group,released vs. group,active with same ip(s)
4344 .line = __location__,
4345 .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL),
4347 .nb_flags = NBT_NM_GROUP,
4349 .num_ips = ctx->addresses_1_num,
4350 .ips = ctx->addresses_1,
4351 .apply_expected = True
4354 .type = WREPL_TYPE_GROUP,
4355 .state = WREPL_STATE_ACTIVE,
4356 .node = WREPL_NODE_B,
4358 .num_ips = ctx->addresses_1_num,
4359 .ips = ctx->addresses_1,
4360 .apply_expected = True
4364 * group,released vs. group,active with different ip(s)
4367 .line = __location__,
4368 .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL),
4370 .nb_flags = NBT_NM_GROUP,
4372 .num_ips = ctx->addresses_1_num,
4373 .ips = ctx->addresses_1,
4374 .apply_expected = True
4377 .type = WREPL_TYPE_GROUP,
4378 .state = WREPL_STATE_ACTIVE,
4379 .node = WREPL_NODE_B,
4381 .num_ips = ARRAY_SIZE(addresses_B_1),
4382 .ips = addresses_B_1,
4383 .apply_expected = True
4387 * group,released vs. group,tombstone with same ip(s)
4390 .line = __location__,
4391 .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL),
4393 .nb_flags = NBT_NM_GROUP,
4395 .num_ips = ctx->addresses_1_num,
4396 .ips = ctx->addresses_1,
4397 .apply_expected = True
4400 .type = WREPL_TYPE_GROUP,
4401 .state = WREPL_STATE_TOMBSTONE,
4402 .node = WREPL_NODE_B,
4404 .num_ips = ctx->addresses_1_num,
4405 .ips = ctx->addresses_1,
4406 .apply_expected = True
4410 * group,released vs. group,tombstone with different ip(s)
4413 .line = __location__,
4414 .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL),
4416 .nb_flags = NBT_NM_GROUP,
4418 .num_ips = ctx->addresses_1_num,
4419 .ips = ctx->addresses_1,
4420 .apply_expected = True
4423 .type = WREPL_TYPE_GROUP,
4424 .state = WREPL_STATE_TOMBSTONE,
4425 .node = WREPL_NODE_B,
4427 .num_ips = ARRAY_SIZE(addresses_B_1),
4428 .ips = addresses_B_1,
4429 .apply_expected = True
4433 * group vs. special group section
4436 * group,released vs. sgroup,active with same ip(s)
4439 .line = __location__,
4440 .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL),
4442 .nb_flags = NBT_NM_GROUP,
4444 .num_ips = ctx->addresses_1_num,
4445 .ips = ctx->addresses_1,
4446 .apply_expected = True
4449 .type = WREPL_TYPE_SGROUP,
4450 .state = WREPL_STATE_ACTIVE,
4451 .node = WREPL_NODE_B,
4453 .num_ips = ctx->addresses_1_num,
4454 .ips = ctx->addresses_1,
4455 .apply_expected = False
4459 * group,released vs. sgroup,active with different ip(s)
4462 .line = __location__,
4463 .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL),
4465 .nb_flags = NBT_NM_GROUP,
4467 .num_ips = ctx->addresses_1_num,
4468 .ips = ctx->addresses_1,
4469 .apply_expected = True
4472 .type = WREPL_TYPE_SGROUP,
4473 .state = WREPL_STATE_ACTIVE,
4474 .node = WREPL_NODE_B,
4476 .num_ips = ARRAY_SIZE(addresses_B_1),
4477 .ips = addresses_B_1,
4478 .apply_expected = False
4482 * group,released vs. sgroup,tombstone with same ip(s)
4485 .line = __location__,
4486 .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL),
4488 .nb_flags = NBT_NM_GROUP,
4490 .num_ips = ctx->addresses_1_num,
4491 .ips = ctx->addresses_1,
4492 .apply_expected = True
4495 .type = WREPL_TYPE_SGROUP,
4496 .state = WREPL_STATE_TOMBSTONE,
4497 .node = WREPL_NODE_B,
4499 .num_ips = ctx->addresses_1_num,
4500 .ips = ctx->addresses_1,
4501 .apply_expected = False
4505 * group,released vs. sgroup,tombstone with different ip(s)
4508 .line = __location__,
4509 .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL),
4511 .nb_flags = NBT_NM_GROUP,
4513 .num_ips = ctx->addresses_1_num,
4514 .ips = ctx->addresses_1,
4515 .apply_expected = True
4518 .type = WREPL_TYPE_SGROUP,
4519 .state = WREPL_STATE_TOMBSTONE,
4520 .node = WREPL_NODE_B,
4522 .num_ips = ARRAY_SIZE(addresses_B_1),
4523 .ips = addresses_B_1,
4524 .apply_expected = False
4528 * group vs. multi homed section
4531 * group,released vs. mhomed,active with same ip(s)
4534 .line = __location__,
4535 .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL),
4537 .nb_flags = NBT_NM_GROUP,
4539 .num_ips = ctx->addresses_1_num,
4540 .ips = ctx->addresses_1,
4541 .apply_expected = True
4544 .type = WREPL_TYPE_MHOMED,
4545 .state = WREPL_STATE_ACTIVE,
4546 .node = WREPL_NODE_B,
4548 .num_ips = ctx->addresses_1_num,
4549 .ips = ctx->addresses_1,
4550 .apply_expected = False
4554 * group,released vs. mhomed,active with different ip(s)
4557 .line = __location__,
4558 .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL),
4560 .nb_flags = NBT_NM_GROUP,
4562 .num_ips = ctx->addresses_1_num,
4563 .ips = ctx->addresses_1,
4564 .apply_expected = True
4567 .type = WREPL_TYPE_MHOMED,
4568 .state = WREPL_STATE_ACTIVE,
4569 .node = WREPL_NODE_B,
4571 .num_ips = ARRAY_SIZE(addresses_B_1),
4572 .ips = addresses_B_1,
4573 .apply_expected = False
4577 * group,released vs. mhomed,tombstone with same ip(s)
4580 .line = __location__,
4581 .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL),
4583 .nb_flags = NBT_NM_GROUP,
4585 .num_ips = ctx->addresses_1_num,
4586 .ips = ctx->addresses_1,
4587 .apply_expected = True
4590 .type = WREPL_TYPE_MHOMED,
4591 .state = WREPL_STATE_TOMBSTONE,
4592 .node = WREPL_NODE_B,
4594 .num_ips = ctx->addresses_1_num,
4595 .ips = ctx->addresses_1,
4596 .apply_expected = False
4600 * group,released vs. mhomed,tombstone with different ip(s)
4603 .line = __location__,
4604 .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL),
4606 .nb_flags = NBT_NM_GROUP,
4608 .num_ips = ctx->addresses_1_num,
4609 .ips = ctx->addresses_1,
4610 .apply_expected = True
4613 .type = WREPL_TYPE_MHOMED,
4614 .state = WREPL_STATE_TOMBSTONE,
4615 .node = WREPL_NODE_B,
4617 .num_ips = ARRAY_SIZE(addresses_B_1),
4618 .ips = addresses_B_1,
4619 .apply_expected = False
4623 * special group vs. unique section
4626 * sgroup,released vs. unique,active with same ip(s)
4629 .line = __location__,
4630 .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL),
4632 .nb_flags = NBT_NM_GROUP,
4634 .num_ips = ctx->addresses_1_num,
4635 .ips = ctx->addresses_1,
4636 .apply_expected = True
4639 .type = WREPL_TYPE_UNIQUE,
4640 .state = WREPL_STATE_ACTIVE,
4641 .node = WREPL_NODE_B,
4643 .num_ips = ctx->addresses_1_num,
4644 .ips = ctx->addresses_1,
4645 .apply_expected = True
4649 * sgroup,released vs. unique,active with different ip(s)
4652 .line = __location__,
4653 .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL),
4655 .nb_flags = NBT_NM_GROUP,
4657 .num_ips = ctx->addresses_1_num,
4658 .ips = ctx->addresses_1,
4659 .apply_expected = True
4662 .type = WREPL_TYPE_UNIQUE,
4663 .state = WREPL_STATE_ACTIVE,
4664 .node = WREPL_NODE_B,
4666 .num_ips = ARRAY_SIZE(addresses_B_1),
4667 .ips = addresses_B_1,
4668 .apply_expected = True
4672 * sgroup,released vs. unique,tombstone with same ip(s)
4675 .line = __location__,
4676 .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL),
4678 .nb_flags = NBT_NM_GROUP,
4680 .num_ips = ctx->addresses_1_num,
4681 .ips = ctx->addresses_1,
4682 .apply_expected = True
4685 .type = WREPL_TYPE_UNIQUE,
4686 .state = WREPL_STATE_TOMBSTONE,
4687 .node = WREPL_NODE_B,
4689 .num_ips = ctx->addresses_1_num,
4690 .ips = ctx->addresses_1,
4691 .apply_expected = True
4695 * sgroup,released vs. unique,tombstone with different ip(s)
4698 .line = __location__,
4699 .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL),
4701 .nb_flags = NBT_NM_GROUP,
4703 .num_ips = ctx->addresses_1_num,
4704 .ips = ctx->addresses_1,
4705 .apply_expected = True
4708 .type = WREPL_TYPE_UNIQUE,
4709 .state = WREPL_STATE_TOMBSTONE,
4710 .node = WREPL_NODE_B,
4712 .num_ips = ARRAY_SIZE(addresses_B_1),
4713 .ips = addresses_B_1,
4714 .apply_expected = True
4718 * special group vs. group section
4721 * sgroup,released vs. group,active with same ip(s)
4724 .line = __location__,
4725 .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL),
4727 .nb_flags = NBT_NM_GROUP,
4729 .num_ips = ctx->addresses_1_num,
4730 .ips = ctx->addresses_1,
4731 .apply_expected = True
4734 .type = WREPL_TYPE_GROUP,
4735 .state = WREPL_STATE_ACTIVE,
4736 .node = WREPL_NODE_B,
4738 .num_ips = ctx->addresses_1_num,
4739 .ips = ctx->addresses_1,
4740 .apply_expected = True
4744 * sgroup,released vs. group,active with different ip(s)
4747 .line = __location__,
4748 .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL),
4750 .nb_flags = NBT_NM_GROUP,
4752 .num_ips = ctx->addresses_1_num,
4753 .ips = ctx->addresses_1,
4754 .apply_expected = True
4757 .type = WREPL_TYPE_GROUP,
4758 .state = WREPL_STATE_ACTIVE,
4759 .node = WREPL_NODE_B,
4761 .num_ips = ARRAY_SIZE(addresses_B_1),
4762 .ips = addresses_B_1,
4763 .apply_expected = True
4767 * sgroup,released vs. group,tombstone with same ip(s)
4770 .line = __location__,
4771 .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL),
4773 .nb_flags = NBT_NM_GROUP,
4775 .num_ips = ctx->addresses_1_num,
4776 .ips = ctx->addresses_1,
4777 .apply_expected = True
4780 .type = WREPL_TYPE_GROUP,
4781 .state = WREPL_STATE_TOMBSTONE,
4782 .node = WREPL_NODE_B,
4784 .num_ips = ctx->addresses_1_num,
4785 .ips = ctx->addresses_1,
4786 .apply_expected = True
4790 * sgroup,released vs. group,tombstone with different ip(s)
4793 .line = __location__,
4794 .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL),
4796 .nb_flags = NBT_NM_GROUP,
4798 .num_ips = ctx->addresses_1_num,
4799 .ips = ctx->addresses_1,
4800 .apply_expected = True
4803 .type = WREPL_TYPE_GROUP,
4804 .state = WREPL_STATE_TOMBSTONE,
4805 .node = WREPL_NODE_B,
4807 .num_ips = ARRAY_SIZE(addresses_B_1),
4808 .ips = addresses_B_1,
4809 .apply_expected = True
4813 * special group vs. special group section
4816 * sgroup,released vs. sgroup,active with same ip(s)
4819 .line = __location__,
4820 .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL),
4822 .nb_flags = NBT_NM_GROUP,
4824 .num_ips = ctx->addresses_1_num,
4825 .ips = ctx->addresses_1,
4826 .apply_expected = True
4829 .type = WREPL_TYPE_SGROUP,
4830 .state = WREPL_STATE_ACTIVE,
4831 .node = WREPL_NODE_B,
4833 .num_ips = ctx->addresses_1_num,
4834 .ips = ctx->addresses_1,
4835 .apply_expected = True
4839 * sgroup,released vs. sgroup,active with different ip(s)
4842 .line = __location__,
4843 .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL),
4845 .nb_flags = NBT_NM_GROUP,
4847 .num_ips = ctx->addresses_1_num,
4848 .ips = ctx->addresses_1,
4849 .apply_expected = True
4852 .type = WREPL_TYPE_SGROUP,
4853 .state = WREPL_STATE_ACTIVE,
4854 .node = WREPL_NODE_B,
4856 .num_ips = ARRAY_SIZE(addresses_B_1),
4857 .ips = addresses_B_1,
4858 .apply_expected = True
4862 * sgroup,released vs. sgroup,tombstone with same ip(s)
4865 .line = __location__,
4866 .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL),
4868 .nb_flags = NBT_NM_GROUP,
4870 .num_ips = ctx->addresses_1_num,
4871 .ips = ctx->addresses_1,
4872 .apply_expected = True
4875 .type = WREPL_TYPE_SGROUP,
4876 .state = WREPL_STATE_TOMBSTONE,
4877 .node = WREPL_NODE_B,
4879 .num_ips = ctx->addresses_1_num,
4880 .ips = ctx->addresses_1,
4881 .apply_expected = True
4885 * sgroup,released vs. sgroup,tombstone with different ip(s)
4888 .line = __location__,
4889 .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL),
4891 .nb_flags = NBT_NM_GROUP,
4893 .num_ips = ctx->addresses_1_num,
4894 .ips = ctx->addresses_1,
4895 .apply_expected = True
4898 .type = WREPL_TYPE_SGROUP,
4899 .state = WREPL_STATE_TOMBSTONE,
4900 .node = WREPL_NODE_B,
4902 .num_ips = ARRAY_SIZE(addresses_B_1),
4903 .ips = addresses_B_1,
4904 .apply_expected = True
4908 * special group vs. multi homed section
4911 * sgroup,released vs. mhomed,active with same ip(s)
4914 .line = __location__,
4915 .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL),
4917 .nb_flags = NBT_NM_GROUP,
4919 .num_ips = ctx->addresses_1_num,
4920 .ips = ctx->addresses_1,
4921 .apply_expected = True
4924 .type = WREPL_TYPE_MHOMED,
4925 .state = WREPL_STATE_ACTIVE,
4926 .node = WREPL_NODE_B,
4928 .num_ips = ctx->addresses_1_num,
4929 .ips = ctx->addresses_1,
4930 .apply_expected = True
4934 * sgroup,released vs. mhomed,active with different ip(s)
4937 .line = __location__,
4938 .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL),
4940 .nb_flags = NBT_NM_GROUP,
4942 .num_ips = ctx->addresses_1_num,
4943 .ips = ctx->addresses_1,
4944 .apply_expected = True
4947 .type = WREPL_TYPE_MHOMED,
4948 .state = WREPL_STATE_ACTIVE,
4949 .node = WREPL_NODE_B,
4951 .num_ips = ARRAY_SIZE(addresses_B_1),
4952 .ips = addresses_B_1,
4953 .apply_expected = True
4957 * sgroup,released vs. mhomed,tombstone with same ip(s)
4960 .line = __location__,
4961 .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL),
4963 .nb_flags = NBT_NM_GROUP,
4965 .num_ips = ctx->addresses_1_num,
4966 .ips = ctx->addresses_1,
4967 .apply_expected = True
4970 .type = WREPL_TYPE_MHOMED,
4971 .state = WREPL_STATE_TOMBSTONE,
4972 .node = WREPL_NODE_B,
4974 .num_ips = ctx->addresses_1_num,
4975 .ips = ctx->addresses_1,
4976 .apply_expected = True
4980 * sgroup,released vs. mhomed,tombstone with different ip(s)
4983 .line = __location__,
4984 .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL),
4986 .nb_flags = NBT_NM_GROUP,
4988 .num_ips = ctx->addresses_1_num,
4989 .ips = ctx->addresses_1,
4990 .apply_expected = True
4993 .type = WREPL_TYPE_MHOMED,
4994 .state = WREPL_STATE_TOMBSTONE,
4995 .node = WREPL_NODE_B,
4997 .num_ips = ARRAY_SIZE(addresses_B_1),
4998 .ips = addresses_B_1,
4999 .apply_expected = True
5003 * multi homed vs. unique section
5006 * mhomed,released vs. unique,active with same ip(s)
5009 .line = __location__,
5010 .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL),
5014 .num_ips = ctx->addresses_1_num,
5015 .ips = ctx->addresses_1,
5016 .apply_expected = True
5019 .type = WREPL_TYPE_UNIQUE,
5020 .state = WREPL_STATE_ACTIVE,
5021 .node = WREPL_NODE_B,
5023 .num_ips = ctx->addresses_1_num,
5024 .ips = ctx->addresses_1,
5025 .apply_expected = True
5029 * mhomed,released vs. unique,active with different ip(s)
5032 .line = __location__,
5033 .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL),
5037 .num_ips = ctx->addresses_1_num,
5038 .ips = ctx->addresses_1,
5039 .apply_expected = True
5042 .type = WREPL_TYPE_UNIQUE,
5043 .state = WREPL_STATE_ACTIVE,
5044 .node = WREPL_NODE_B,
5046 .num_ips = ARRAY_SIZE(addresses_B_1),
5047 .ips = addresses_B_1,
5048 .apply_expected = True
5052 * mhomed,released vs. unique,tombstone with same ip(s)
5055 .line = __location__,
5056 .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL),
5060 .num_ips = ctx->addresses_1_num,
5061 .ips = ctx->addresses_1,
5062 .apply_expected = True
5065 .type = WREPL_TYPE_UNIQUE,
5066 .state = WREPL_STATE_TOMBSTONE,
5067 .node = WREPL_NODE_B,
5069 .num_ips = ctx->addresses_1_num,
5070 .ips = ctx->addresses_1,
5071 .apply_expected = True
5075 * mhomed,released vs. unique,tombstone with different ip(s)
5078 .line = __location__,
5079 .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL),
5083 .num_ips = ctx->addresses_1_num,
5084 .ips = ctx->addresses_1,
5085 .apply_expected = True
5088 .type = WREPL_TYPE_UNIQUE,
5089 .state = WREPL_STATE_TOMBSTONE,
5090 .node = WREPL_NODE_B,
5092 .num_ips = ARRAY_SIZE(addresses_B_1),
5093 .ips = addresses_B_1,
5094 .apply_expected = True
5098 * multi homed vs. group section
5101 * mhomed,released vs. group,active with same ip(s)
5104 .line = __location__,
5105 .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL),
5109 .num_ips = ctx->addresses_1_num,
5110 .ips = ctx->addresses_1,
5111 .apply_expected = True
5114 .type = WREPL_TYPE_GROUP,
5115 .state = WREPL_STATE_ACTIVE,
5116 .node = WREPL_NODE_B,
5118 .num_ips = ctx->addresses_1_num,
5119 .ips = ctx->addresses_1,
5120 .apply_expected = True
5124 * mhomed,released vs. group,active with different ip(s)
5127 .line = __location__,
5128 .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL),
5132 .num_ips = ctx->addresses_1_num,
5133 .ips = ctx->addresses_1,
5134 .apply_expected = True
5137 .type = WREPL_TYPE_GROUP,
5138 .state = WREPL_STATE_ACTIVE,
5139 .node = WREPL_NODE_B,
5141 .num_ips = ARRAY_SIZE(addresses_B_1),
5142 .ips = addresses_B_1,
5143 .apply_expected = True
5147 * mhomed,released vs. group,tombstone with same ip(s)
5150 .line = __location__,
5151 .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL),
5155 .num_ips = ctx->addresses_1_num,
5156 .ips = ctx->addresses_1,
5157 .apply_expected = True
5160 .type = WREPL_TYPE_GROUP,
5161 .state = WREPL_STATE_TOMBSTONE,
5162 .node = WREPL_NODE_B,
5164 .num_ips = ctx->addresses_1_num,
5165 .ips = ctx->addresses_1,
5166 .apply_expected = True
5170 * mhomed,released vs. group,tombstone with different ip(s)
5173 .line = __location__,
5174 .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL),
5178 .num_ips = ctx->addresses_1_num,
5179 .ips = ctx->addresses_1,
5180 .apply_expected = True
5183 .type = WREPL_TYPE_GROUP,
5184 .state = WREPL_STATE_TOMBSTONE,
5185 .node = WREPL_NODE_B,
5187 .num_ips = ARRAY_SIZE(addresses_B_1),
5188 .ips = addresses_B_1,
5189 .apply_expected = True
5193 * multi homed vs. special group section
5196 * mhomed,released vs. sgroup,active with same ip(s)
5199 .line = __location__,
5200 .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL),
5204 .num_ips = ctx->addresses_1_num,
5205 .ips = ctx->addresses_1,
5206 .apply_expected = True
5209 .type = WREPL_TYPE_SGROUP,
5210 .state = WREPL_STATE_ACTIVE,
5211 .node = WREPL_NODE_B,
5213 .num_ips = ctx->addresses_1_num,
5214 .ips = ctx->addresses_1,
5215 .apply_expected = True
5219 * mhomed,released vs. sgroup,active with different ip(s)
5222 .line = __location__,
5223 .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL),
5227 .num_ips = ctx->addresses_1_num,
5228 .ips = ctx->addresses_1,
5229 .apply_expected = True
5232 .type = WREPL_TYPE_SGROUP,
5233 .state = WREPL_STATE_ACTIVE,
5234 .node = WREPL_NODE_B,
5236 .num_ips = ARRAY_SIZE(addresses_B_1),
5237 .ips = addresses_B_1,
5238 .apply_expected = True
5242 * mhomed,released vs. sgroup,tombstone with same ip(s)
5245 .line = __location__,
5246 .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL),
5250 .num_ips = ctx->addresses_1_num,
5251 .ips = ctx->addresses_1,
5252 .apply_expected = True
5255 .type = WREPL_TYPE_SGROUP,
5256 .state = WREPL_STATE_TOMBSTONE,
5257 .node = WREPL_NODE_B,
5259 .num_ips = ctx->addresses_1_num,
5260 .ips = ctx->addresses_1,
5261 .apply_expected = True
5265 * mhomed,released vs. sgroup,tombstone with different ip(s)
5268 .line = __location__,
5269 .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL),
5273 .num_ips = ctx->addresses_1_num,
5274 .ips = ctx->addresses_1,
5275 .apply_expected = True
5278 .type = WREPL_TYPE_SGROUP,
5279 .state = WREPL_STATE_TOMBSTONE,
5280 .node = WREPL_NODE_B,
5282 .num_ips = ARRAY_SIZE(addresses_B_1),
5283 .ips = addresses_B_1,
5284 .apply_expected = True
5288 * multi homed vs. multi homed section
5291 * mhomed,released vs. mhomed,active with same ip(s)
5294 .line = __location__,
5295 .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL),
5299 .num_ips = ctx->addresses_1_num,
5300 .ips = ctx->addresses_1,
5301 .apply_expected = True
5304 .type = WREPL_TYPE_MHOMED,
5305 .state = WREPL_STATE_ACTIVE,
5306 .node = WREPL_NODE_B,
5308 .num_ips = ctx->addresses_1_num,
5309 .ips = ctx->addresses_1,
5310 .apply_expected = True
5314 * mhomed,released vs. mhomed,active with different ip(s)
5317 .line = __location__,
5318 .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL),
5322 .num_ips = ctx->addresses_1_num,
5323 .ips = ctx->addresses_1,
5324 .apply_expected = True
5327 .type = WREPL_TYPE_MHOMED,
5328 .state = WREPL_STATE_ACTIVE,
5329 .node = WREPL_NODE_B,
5331 .num_ips = ARRAY_SIZE(addresses_B_1),
5332 .ips = addresses_B_1,
5333 .apply_expected = True
5337 * mhomed,released vs. mhomed,tombstone with same ip(s)
5340 .line = __location__,
5341 .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL),
5345 .num_ips = ctx->addresses_1_num,
5346 .ips = ctx->addresses_1,
5347 .apply_expected = True
5350 .type = WREPL_TYPE_MHOMED,
5351 .state = WREPL_STATE_TOMBSTONE,
5352 .node = WREPL_NODE_B,
5354 .num_ips = ctx->addresses_1_num,
5355 .ips = ctx->addresses_1,
5356 .apply_expected = True
5360 * mhomed,released vs. mhomed,tombstone with different ip(s)
5363 .line = __location__,
5364 .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL),
5368 .num_ips = ctx->addresses_1_num,
5369 .ips = ctx->addresses_1,
5370 .apply_expected = True
5373 .type = WREPL_TYPE_MHOMED,
5374 .state = WREPL_STATE_TOMBSTONE,
5375 .node = WREPL_NODE_B,
5377 .num_ips = ARRAY_SIZE(addresses_B_1),
5378 .ips = addresses_B_1,
5379 .apply_expected = True
5384 if (!ctx) return False;
5386 printf("Test Replica records vs. owned released records\n");
5388 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
5389 printf("%s => %s\n", nbt_name_string(ctx, &records[i].name),
5390 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
5395 name_register->in.name = records[i].name;
5396 name_register->in.dest_addr = ctx->address;
5397 name_register->in.address = records[i].wins.ips[0].ip;
5398 name_register->in.nb_flags = records[i].wins.nb_flags;
5399 name_register->in.register_demand= False;
5400 name_register->in.broadcast = False;
5401 name_register->in.multi_homed = records[i].wins.mhomed;
5402 name_register->in.ttl = 300000;
5403 name_register->in.timeout = 70;
5404 name_register->in.retries = 0;
5406 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
5407 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
5408 printf("No response from %s for name register\n", ctx->address);
5411 if (!NT_STATUS_IS_OK(status)) {
5412 printf("Bad response from %s for name register - %s\n",
5413 ctx->address, nt_errstr(status));
5416 CHECK_VALUE(name_register->out.rcode, 0);
5417 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
5418 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
5419 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
5420 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
5421 CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[0].ip);
5423 /* release the record */
5424 release->in.name = records[i].name;
5425 release->in.dest_addr = ctx->address;
5426 release->in.address = records[i].wins.ips[0].ip;
5427 release->in.nb_flags = records[i].wins.nb_flags;
5428 release->in.broadcast = False;
5429 release->in.timeout = 30;
5430 release->in.retries = 0;
5432 status = nbt_name_release(ctx->nbtsock, ctx, release);
5433 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
5434 printf("No response from %s for name release\n", ctx->address);
5437 if (!NT_STATUS_IS_OK(status)) {
5438 printf("Bad response from %s for name query - %s\n",
5439 ctx->address, nt_errstr(status));
5442 CHECK_VALUE(release->out.rcode, 0);
5447 wins_name->name = &records[i].name;
5448 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
5449 records[i].replica.state,
5450 records[i].replica.node,
5451 records[i].replica.is_static);
5452 wins_name->id = ++ctx->b.max_version;
5453 if (wins_name->flags & 2) {
5454 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
5455 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
5457 wins_name->addresses.ip = records[i].replica.ips[0].ip;
5459 wins_name->unknown = "255.255.255.255";
5461 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
5462 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
5463 records[i].replica.apply_expected);
5465 if (records[i].replica.apply_expected) {
5466 wins_name->name = &records[i].name;
5467 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
5468 WREPL_STATE_TOMBSTONE,
5469 WREPL_NODE_B, False);
5470 wins_name->id = ++ctx->b.max_version;
5471 wins_name->addresses.ip = addresses_B_1[0].ip;
5472 wins_name->unknown = "255.255.255.255";
5474 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
5475 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
5477 release->in.name = records[i].name;
5478 release->in.dest_addr = ctx->address;
5479 release->in.address = records[i].wins.ips[0].ip;
5480 release->in.nb_flags = records[i].wins.nb_flags;
5481 release->in.broadcast = False;
5482 release->in.timeout = 30;
5483 release->in.retries = 0;
5485 status = nbt_name_release(ctx->nbtsock, ctx, release);
5486 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
5487 printf("No response from %s for name release\n", ctx->address);
5490 if (!NT_STATUS_IS_OK(status)) {
5491 printf("Bad response from %s for name query - %s\n",
5492 ctx->address, nt_errstr(status));
5495 CHECK_VALUE(release->out.rcode, 0);
5499 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
5507 struct test_conflict_owned_active_vs_replica_struct {
5508 const char *line; /* just better debugging */
5509 struct nbt_name name;
5514 const struct wrepl_ip *ips;
5515 BOOL apply_expected;
5520 BOOL expect_release;
5524 enum wrepl_name_type type;
5525 enum wrepl_name_state state;
5526 enum wrepl_name_node node;
5529 const struct wrepl_ip *ips;
5530 BOOL apply_expected;
5534 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
5535 struct nbt_name_packet *req_packet,
5536 const struct nbt_peer_socket *src);
5538 static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_conn *ctx)
5542 struct wrepl_wins_name wins_name_;
5543 struct wrepl_wins_name *wins_name = &wins_name_;
5544 struct nbt_name_register name_register_;
5545 struct nbt_name_register *name_register = &name_register_;
5546 struct nbt_name_release release_;
5547 struct nbt_name_release *release = &release_;
5549 struct test_conflict_owned_active_vs_replica_struct records[] = {
5551 * unique vs. unique section
5554 * unique,active vs. unique,active with same ip(s), unchecked
5557 .line = __location__,
5558 .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL),
5562 .num_ips = ctx->addresses_1_num,
5563 .ips = ctx->addresses_1,
5564 .apply_expected = True
5570 .type = WREPL_TYPE_UNIQUE,
5571 .state = WREPL_STATE_ACTIVE,
5572 .node = WREPL_NODE_B,
5574 .num_ips = ctx->addresses_1_num,
5575 .ips = ctx->addresses_1,
5576 .apply_expected = True
5580 * unique,active vs. unique,active with different ip(s), positive response
5583 .line = __location__,
5584 .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL),
5588 .num_ips = ctx->addresses_1_num,
5589 .ips = ctx->addresses_1,
5590 .apply_expected = True
5597 .type = WREPL_TYPE_UNIQUE,
5598 .state = WREPL_STATE_ACTIVE,
5599 .node = WREPL_NODE_B,
5601 .num_ips = ARRAY_SIZE(addresses_B_1),
5602 .ips = addresses_B_1,
5603 .apply_expected = False
5607 * unique,active vs. unique,active with different ip(s), negative response
5610 .line = __location__,
5611 .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL),
5615 .num_ips = ctx->addresses_1_num,
5616 .ips = ctx->addresses_1,
5617 .apply_expected = True
5624 .type = WREPL_TYPE_UNIQUE,
5625 .state = WREPL_STATE_ACTIVE,
5626 .node = WREPL_NODE_B,
5628 .num_ips = ARRAY_SIZE(addresses_B_1),
5629 .ips = addresses_B_1,
5630 .apply_expected = True
5634 * unique,active vs. unique,tombstone with same ip(s), unchecked
5637 .line = __location__,
5638 .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL),
5642 .num_ips = ctx->addresses_1_num,
5643 .ips = ctx->addresses_1,
5644 .apply_expected = True
5650 .type = WREPL_TYPE_UNIQUE,
5651 .state = WREPL_STATE_TOMBSTONE,
5652 .node = WREPL_NODE_B,
5654 .num_ips = ctx->addresses_1_num,
5655 .ips = ctx->addresses_1,
5656 .apply_expected = False
5660 * unique,active vs. unique,tombstone with different ip(s), unchecked
5663 .line = __location__,
5664 .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL),
5668 .num_ips = ctx->addresses_1_num,
5669 .ips = ctx->addresses_1,
5670 .apply_expected = True
5676 .type = WREPL_TYPE_UNIQUE,
5677 .state = WREPL_STATE_TOMBSTONE,
5678 .node = WREPL_NODE_B,
5680 .num_ips = ARRAY_SIZE(addresses_B_1),
5681 .ips = addresses_B_1,
5682 .apply_expected = False
5686 * unique vs. group section
5689 * unique,active vs. group,active with same ip(s), release expected
5692 .line = __location__,
5693 .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL),
5697 .num_ips = ctx->addresses_1_num,
5698 .ips = ctx->addresses_1,
5699 .apply_expected = True
5703 .expect_release = True,
5706 .type = WREPL_TYPE_GROUP,
5707 .state = WREPL_STATE_ACTIVE,
5708 .node = WREPL_NODE_B,
5710 .num_ips = ctx->addresses_1_num,
5711 .ips = ctx->addresses_1,
5712 .apply_expected = True
5716 * unique,active vs. group,active with different ip(s), release expected
5719 .line = __location__,
5720 .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL),
5724 .num_ips = ctx->addresses_1_num,
5725 .ips = ctx->addresses_1,
5726 .apply_expected = True
5730 .expect_release = True,
5733 .type = WREPL_TYPE_GROUP,
5734 .state = WREPL_STATE_ACTIVE,
5735 .node = WREPL_NODE_B,
5737 .num_ips = ARRAY_SIZE(addresses_B_1),
5738 .ips = addresses_B_1,
5739 .apply_expected = True
5743 * unique,active vs. group,tombstone with same ip(s), unchecked
5746 .line = __location__,
5747 .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL),
5751 .num_ips = ctx->addresses_1_num,
5752 .ips = ctx->addresses_1,
5753 .apply_expected = True
5759 .type = WREPL_TYPE_GROUP,
5760 .state = WREPL_STATE_TOMBSTONE,
5761 .node = WREPL_NODE_B,
5763 .num_ips = ctx->addresses_1_num,
5764 .ips = ctx->addresses_1,
5765 .apply_expected = False
5769 * unique,active vs. group,tombstone with different ip(s), unchecked
5772 .line = __location__,
5773 .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL),
5777 .num_ips = ctx->addresses_1_num,
5778 .ips = ctx->addresses_1,
5779 .apply_expected = True
5785 .type = WREPL_TYPE_GROUP,
5786 .state = WREPL_STATE_TOMBSTONE,
5787 .node = WREPL_NODE_B,
5789 .num_ips = ARRAY_SIZE(addresses_B_1),
5790 .ips = addresses_B_1,
5791 .apply_expected = False
5795 * unique vs. special group section
5798 * unique,active vs. sgroup,active with same ip(s), release expected
5801 .line = __location__,
5802 .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL),
5806 .num_ips = ctx->addresses_1_num,
5807 .ips = ctx->addresses_1,
5808 .apply_expected = True
5812 .expect_release = True,
5815 .type = WREPL_TYPE_SGROUP,
5816 .state = WREPL_STATE_ACTIVE,
5817 .node = WREPL_NODE_B,
5819 .num_ips = ctx->addresses_1_num,
5820 .ips = ctx->addresses_1,
5821 .apply_expected = True
5825 * unique,active vs. group,active with different ip(s), release expected
5828 .line = __location__,
5829 .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL),
5833 .num_ips = ctx->addresses_1_num,
5834 .ips = ctx->addresses_1,
5835 .apply_expected = True
5839 .expect_release = True,
5842 .type = WREPL_TYPE_SGROUP,
5843 .state = WREPL_STATE_ACTIVE,
5844 .node = WREPL_NODE_B,
5846 .num_ips = ARRAY_SIZE(addresses_B_1),
5847 .ips = addresses_B_1,
5848 .apply_expected = True
5852 * unique,active vs. sgroup,tombstone with same ip(s), unchecked
5855 .line = __location__,
5856 .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL),
5860 .num_ips = ctx->addresses_1_num,
5861 .ips = ctx->addresses_1,
5862 .apply_expected = True
5868 .type = WREPL_TYPE_SGROUP,
5869 .state = WREPL_STATE_TOMBSTONE,
5870 .node = WREPL_NODE_B,
5872 .num_ips = ctx->addresses_1_num,
5873 .ips = ctx->addresses_1,
5874 .apply_expected = False
5878 * unique,active vs. sgroup,tombstone with different ip(s), unchecked
5881 .line = __location__,
5882 .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL),
5886 .num_ips = ctx->addresses_1_num,
5887 .ips = ctx->addresses_1,
5888 .apply_expected = True
5894 .type = WREPL_TYPE_SGROUP,
5895 .state = WREPL_STATE_TOMBSTONE,
5896 .node = WREPL_NODE_B,
5898 .num_ips = ARRAY_SIZE(addresses_B_1),
5899 .ips = addresses_B_1,
5900 .apply_expected = False
5904 * unique vs. multi homed section
5907 * unique,active vs. mhomed,active with same ip(s), unchecked
5910 .line = __location__,
5911 .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL),
5915 .num_ips = ctx->addresses_1_num,
5916 .ips = ctx->addresses_1,
5917 .apply_expected = True
5923 .type = WREPL_TYPE_MHOMED,
5924 .state = WREPL_STATE_ACTIVE,
5925 .node = WREPL_NODE_B,
5927 .num_ips = ctx->addresses_1_num,
5928 .ips = ctx->addresses_1,
5929 .apply_expected = True
5933 * unique,active vs. mhomed,active with different ip(s), positive response
5936 .line = __location__,
5937 .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL),
5941 .num_ips = ctx->addresses_1_num,
5942 .ips = ctx->addresses_1,
5943 .apply_expected = True
5950 .type = WREPL_TYPE_MHOMED,
5951 .state = WREPL_STATE_ACTIVE,
5952 .node = WREPL_NODE_B,
5954 .num_ips = ARRAY_SIZE(addresses_B_1),
5955 .ips = addresses_B_1,
5956 .apply_expected = False
5960 * unique,active vs. mhomed,active with different ip(s), negative response
5963 .line = __location__,
5964 .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL),
5968 .num_ips = ctx->addresses_1_num,
5969 .ips = ctx->addresses_1,
5970 .apply_expected = True
5977 .type = WREPL_TYPE_MHOMED,
5978 .state = WREPL_STATE_ACTIVE,
5979 .node = WREPL_NODE_B,
5981 .num_ips = ARRAY_SIZE(addresses_B_1),
5982 .ips = addresses_B_1,
5983 .apply_expected = True
5987 * unique,active vs. mhomed,tombstone with same ip(s), unchecked
5990 .line = __location__,
5991 .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL),
5995 .num_ips = ctx->addresses_1_num,
5996 .ips = ctx->addresses_1,
5997 .apply_expected = True
6003 .type = WREPL_TYPE_MHOMED,
6004 .state = WREPL_STATE_TOMBSTONE,
6005 .node = WREPL_NODE_B,
6007 .num_ips = ctx->addresses_1_num,
6008 .ips = ctx->addresses_1,
6009 .apply_expected = False
6013 * unique,active vs. mhomed,tombstone with different ip(s), unchecked
6016 .line = __location__,
6017 .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL),
6021 .num_ips = ctx->addresses_1_num,
6022 .ips = ctx->addresses_1,
6023 .apply_expected = True
6029 .type = WREPL_TYPE_MHOMED,
6030 .state = WREPL_STATE_TOMBSTONE,
6031 .node = WREPL_NODE_B,
6033 .num_ips = ARRAY_SIZE(addresses_B_1),
6034 .ips = addresses_B_1,
6035 .apply_expected = False
6039 * normal group vs. unique section
6042 * group,active vs. unique,active with same ip(s), unchecked
6045 .line = __location__,
6046 .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL),
6048 .nb_flags = NBT_NM_GROUP,
6050 .num_ips = ctx->addresses_1_num,
6051 .ips = ctx->addresses_1,
6052 .apply_expected = True
6058 .type = WREPL_TYPE_UNIQUE,
6059 .state = WREPL_STATE_ACTIVE,
6060 .node = WREPL_NODE_B,
6062 .num_ips = ctx->addresses_1_num,
6063 .ips = ctx->addresses_1,
6064 .apply_expected = False
6068 * group,active vs. unique,active with different ip(s), unchecked
6071 .line = __location__,
6072 .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL),
6074 .nb_flags = NBT_NM_GROUP,
6076 .num_ips = ctx->addresses_1_num,
6077 .ips = ctx->addresses_1,
6078 .apply_expected = True
6084 .type = WREPL_TYPE_UNIQUE,
6085 .state = WREPL_STATE_ACTIVE,
6086 .node = WREPL_NODE_B,
6088 .num_ips = ARRAY_SIZE(addresses_B_1),
6089 .ips = addresses_B_1,
6090 .apply_expected = False
6094 * group,active vs. unique,tombstone with same ip(s), unchecked
6097 .line = __location__,
6098 .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL),
6100 .nb_flags = NBT_NM_GROUP,
6102 .num_ips = ctx->addresses_1_num,
6103 .ips = ctx->addresses_1,
6104 .apply_expected = True
6110 .type = WREPL_TYPE_UNIQUE,
6111 .state = WREPL_STATE_TOMBSTONE,
6112 .node = WREPL_NODE_B,
6114 .num_ips = ctx->addresses_1_num,
6115 .ips = ctx->addresses_1,
6116 .apply_expected = False
6120 * group,active vs. unique,tombstone with different ip(s), unchecked
6123 .line = __location__,
6124 .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL),
6126 .nb_flags = NBT_NM_GROUP,
6128 .num_ips = ctx->addresses_1_num,
6129 .ips = ctx->addresses_1,
6130 .apply_expected = True
6136 .type = WREPL_TYPE_UNIQUE,
6137 .state = WREPL_STATE_TOMBSTONE,
6138 .node = WREPL_NODE_B,
6140 .num_ips = ARRAY_SIZE(addresses_B_1),
6141 .ips = addresses_B_1,
6142 .apply_expected = False
6146 * normal group vs. normal group section
6149 * group,active vs. group,active with same ip(s), unchecked
6152 .line = __location__,
6153 .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL),
6155 .nb_flags = NBT_NM_GROUP,
6157 .num_ips = ctx->addresses_1_num,
6158 .ips = ctx->addresses_1,
6159 .apply_expected = True
6165 .type = WREPL_TYPE_GROUP,
6166 .state = WREPL_STATE_ACTIVE,
6167 .node = WREPL_NODE_B,
6169 .num_ips = ctx->addresses_1_num,
6170 .ips = ctx->addresses_1,
6171 .apply_expected = True
6175 * group,active vs. group,active with different ip(s), unchecked
6178 .line = __location__,
6179 .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL),
6181 .nb_flags = NBT_NM_GROUP,
6183 .num_ips = ctx->addresses_1_num,
6184 .ips = ctx->addresses_1,
6185 .apply_expected = True
6191 .type = WREPL_TYPE_GROUP,
6192 .state = WREPL_STATE_ACTIVE,
6193 .node = WREPL_NODE_B,
6195 .num_ips = ARRAY_SIZE(addresses_B_1),
6196 .ips = addresses_B_1,
6197 .apply_expected = True
6201 * group,active vs. group,tombstone with same ip(s), unchecked
6204 .line = __location__,
6205 .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL),
6207 .nb_flags = NBT_NM_GROUP,
6209 .num_ips = ctx->addresses_1_num,
6210 .ips = ctx->addresses_1,
6211 .apply_expected = True
6217 .type = WREPL_TYPE_GROUP,
6218 .state = WREPL_STATE_TOMBSTONE,
6219 .node = WREPL_NODE_B,
6221 .num_ips = ctx->addresses_1_num,
6222 .ips = ctx->addresses_1,
6223 .apply_expected = False
6227 * group,active vs. group,tombstone with different ip(s), unchecked
6230 .line = __location__,
6231 .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL),
6233 .nb_flags = NBT_NM_GROUP,
6235 .num_ips = ctx->addresses_1_num,
6236 .ips = ctx->addresses_1,
6237 .apply_expected = True
6243 .type = WREPL_TYPE_GROUP,
6244 .state = WREPL_STATE_TOMBSTONE,
6245 .node = WREPL_NODE_B,
6247 .num_ips = ARRAY_SIZE(addresses_B_1),
6248 .ips = addresses_B_1,
6249 .apply_expected = False
6253 * normal group vs. special group section
6256 * group,active vs. sgroup,active with same ip(s), unchecked
6259 .line = __location__,
6260 .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL),
6262 .nb_flags = NBT_NM_GROUP,
6264 .num_ips = ctx->addresses_1_num,
6265 .ips = ctx->addresses_1,
6266 .apply_expected = True
6272 .type = WREPL_TYPE_SGROUP,
6273 .state = WREPL_STATE_ACTIVE,
6274 .node = WREPL_NODE_B,
6276 .num_ips = ctx->addresses_1_num,
6277 .ips = ctx->addresses_1,
6278 .apply_expected = False
6282 * group,active vs. sgroup,active with different ip(s), unchecked
6285 .line = __location__,
6286 .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL),
6288 .nb_flags = NBT_NM_GROUP,
6290 .num_ips = ctx->addresses_1_num,
6291 .ips = ctx->addresses_1,
6292 .apply_expected = True
6298 .type = WREPL_TYPE_SGROUP,
6299 .state = WREPL_STATE_ACTIVE,
6300 .node = WREPL_NODE_B,
6302 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6303 .ips = addresses_B_3_4,
6304 .apply_expected = False
6308 * group,active vs. sgroup,tombstone with same ip(s), unchecked
6311 .line = __location__,
6312 .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL),
6314 .nb_flags = NBT_NM_GROUP,
6316 .num_ips = ctx->addresses_1_num,
6317 .ips = ctx->addresses_1,
6318 .apply_expected = True
6324 .type = WREPL_TYPE_SGROUP,
6325 .state = WREPL_STATE_TOMBSTONE,
6326 .node = WREPL_NODE_B,
6328 .num_ips = ctx->addresses_1_num,
6329 .ips = ctx->addresses_1,
6330 .apply_expected = False
6334 * group,active vs. sgroup,tombstone with different ip(s), unchecked
6337 .line = __location__,
6338 .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL),
6340 .nb_flags = NBT_NM_GROUP,
6342 .num_ips = ctx->addresses_1_num,
6343 .ips = ctx->addresses_1,
6344 .apply_expected = True
6350 .type = WREPL_TYPE_SGROUP,
6351 .state = WREPL_STATE_TOMBSTONE,
6352 .node = WREPL_NODE_B,
6354 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6355 .ips = addresses_B_3_4,
6356 .apply_expected = False
6360 * normal group vs. multi homed section
6363 * group,active vs. mhomed,active with same ip(s), unchecked
6366 .line = __location__,
6367 .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL),
6369 .nb_flags = NBT_NM_GROUP,
6371 .num_ips = ctx->addresses_1_num,
6372 .ips = ctx->addresses_1,
6373 .apply_expected = True
6379 .type = WREPL_TYPE_MHOMED,
6380 .state = WREPL_STATE_ACTIVE,
6381 .node = WREPL_NODE_B,
6383 .num_ips = ctx->addresses_1_num,
6384 .ips = ctx->addresses_1,
6385 .apply_expected = False
6389 * group,active vs. mhomed,active with different ip(s), unchecked
6392 .line = __location__,
6393 .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL),
6395 .nb_flags = NBT_NM_GROUP,
6397 .num_ips = ctx->addresses_1_num,
6398 .ips = ctx->addresses_1,
6399 .apply_expected = True
6405 .type = WREPL_TYPE_MHOMED,
6406 .state = WREPL_STATE_ACTIVE,
6407 .node = WREPL_NODE_B,
6409 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6410 .ips = addresses_B_3_4,
6411 .apply_expected = False
6415 * group,active vs. mhomed,tombstone with same ip(s), unchecked
6418 .line = __location__,
6419 .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL),
6421 .nb_flags = NBT_NM_GROUP,
6423 .num_ips = ctx->addresses_1_num,
6424 .ips = ctx->addresses_1,
6425 .apply_expected = True
6431 .type = WREPL_TYPE_MHOMED,
6432 .state = WREPL_STATE_TOMBSTONE,
6433 .node = WREPL_NODE_B,
6435 .num_ips = ctx->addresses_1_num,
6436 .ips = ctx->addresses_1,
6437 .apply_expected = False
6441 * group,active vs. mhomed,tombstone with different ip(s), unchecked
6444 .line = __location__,
6445 .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL),
6447 .nb_flags = NBT_NM_GROUP,
6449 .num_ips = ctx->addresses_1_num,
6450 .ips = ctx->addresses_1,
6451 .apply_expected = True
6457 .type = WREPL_TYPE_MHOMED,
6458 .state = WREPL_STATE_TOMBSTONE,
6459 .node = WREPL_NODE_B,
6461 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6462 .ips = addresses_B_3_4,
6463 .apply_expected = False
6468 if (!ctx) return False;
6470 if (!ctx->nbtsock_srv) {
6471 printf("SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
6476 printf("Test Replica records vs. owned active records\n");
6478 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
6481 printf("%s => %s\n", nbt_name_string(ctx, &records[i].name),
6482 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
6484 /* Prepare for the current test */
6485 nbt_set_incoming_handler(ctx->nbtsock_srv,
6486 test_conflict_owned_active_vs_replica_handler,
6492 name_register->in.name = records[i].name;
6493 name_register->in.dest_addr = ctx->address;
6494 name_register->in.address = records[i].wins.ips[0].ip;
6495 name_register->in.nb_flags = records[i].wins.nb_flags;
6496 name_register->in.register_demand= False;
6497 name_register->in.broadcast = False;
6498 name_register->in.multi_homed = records[i].wins.mhomed;
6499 name_register->in.ttl = 300000;
6500 name_register->in.timeout = 70;
6501 name_register->in.retries = 0;
6503 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
6504 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6505 printf("No response from %s for name register\n", ctx->address);
6508 if (!NT_STATUS_IS_OK(status)) {
6509 printf("Bad response from %s for name register - %s\n",
6510 ctx->address, nt_errstr(status));
6513 CHECK_VALUE(name_register->out.rcode, 0);
6514 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
6515 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
6516 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
6517 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
6518 CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[0].ip);
6523 wins_name->name = &records[i].name;
6524 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
6525 records[i].replica.state,
6526 records[i].replica.node,
6527 records[i].replica.is_static);
6528 wins_name->id = ++ctx->b.max_version;
6529 if (wins_name->flags & 2) {
6530 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
6531 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
6533 wins_name->addresses.ip = records[i].replica.ips[0].ip;
6535 wins_name->unknown = "255.255.255.255";
6537 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
6540 * wait for the name query, which is handled in
6541 * test_conflict_owned_active_vs_replica_handler()
6543 end = timeval_current_ofs(records[i].defend.timeout,0);
6544 records[i].defend.ret = True;
6545 while (records[i].defend.timeout > 0) {
6546 event_loop_once(ctx->nbtsock_srv->event_ctx);
6547 if (timeval_expired(&end)) break;
6549 ret &= records[i].defend.ret;
6551 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
6552 records[i].replica.apply_expected);
6554 if (records[i].replica.apply_expected) {
6555 wins_name->name = &records[i].name;
6556 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
6557 WREPL_STATE_TOMBSTONE,
6558 WREPL_NODE_B, False);
6559 wins_name->id = ++ctx->b.max_version;
6560 wins_name->addresses.ip = addresses_B_1[0].ip;
6561 wins_name->unknown = "255.255.255.255";
6563 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
6564 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
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 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
6597 #define _NBT_ASSERT(v, correct) do { \
6598 if ((v) != (correct)) { \
6599 printf("(%s) Incorrect value %s=%d - should be %s (%d)\n", \
6600 __location__, #v, v, #correct, correct); \
6605 #define _NBT_ASSERT_STRING(v, correct) do { \
6606 if ( ((!v) && (correct)) || \
6607 ((v) && (!correct)) || \
6608 ((v) && (correct) && strcmp(v,correct) != 0)) { \
6609 printf("(%s) Incorrect value %s=%s - should be %s\n", \
6610 __location__, #v, v, correct); \
6615 static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
6616 struct nbt_name_packet *req_packet,
6617 const struct nbt_peer_socket *src)
6619 struct nbt_name *name;
6620 struct nbt_name_packet *rep_packet;
6621 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
6623 _NBT_ASSERT(req_packet->qdcount, 1);
6624 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
6625 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
6627 name = &req_packet->questions[0].name;
6629 _NBT_ASSERT(name->type, rec->name.type);
6630 _NBT_ASSERT_STRING(name->name, rec->name.name);
6631 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
6633 _NBT_ASSERT(rec->defend.expect_release, False);
6635 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
6636 if (rep_packet == NULL) return;
6638 rep_packet->name_trn_id = req_packet->name_trn_id;
6639 rep_packet->ancount = 1;
6641 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
6642 if (rep_packet->answers == NULL) return;
6644 rep_packet->answers[0].name = *name;
6645 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
6646 rep_packet->answers[0].ttl = 0;
6648 if (rec->defend.positive) {
6651 /* send a positive reply */
6652 rep_packet->operation =
6655 NBT_FLAG_AUTHORITIVE |
6656 NBT_FLAG_RECURSION_DESIRED |
6657 NBT_FLAG_RECURSION_AVAIL;
6659 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
6661 rep_packet->answers[0].rdata.netbios.length = rec->wins.num_ips*6;
6662 rep_packet->answers[0].rdata.netbios.addresses =
6663 talloc_array(rep_packet->answers, struct nbt_rdata_address, rec->wins.num_ips);
6664 if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return;
6666 for (i=0; i < rec->wins.num_ips; i++) {
6667 struct nbt_rdata_address *addr =
6668 &rep_packet->answers[0].rdata.netbios.addresses[i];
6669 addr->nb_flags = rec->wins.nb_flags;
6670 addr->ipaddr = rec->wins.ips[i].ip;
6672 DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
6673 nbt_name_string(rep_packet, name), src->addr, src->port));
6675 /* send a negative reply */
6676 rep_packet->operation =
6679 NBT_FLAG_AUTHORITIVE |
6682 rep_packet->answers[0].rr_type = NBT_QTYPE_NULL;
6684 ZERO_STRUCT(rep_packet->answers[0].rdata);
6686 DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
6687 nbt_name_string(rep_packet, name), src->addr, src->port));
6690 nbt_name_reply_send(nbtsock, src, rep_packet);
6691 talloc_free(rep_packet);
6693 /* make sure we push the reply to the wire */
6694 event_loop_once(nbtsock->event_ctx);
6696 rec->defend.timeout = 0;
6697 rec->defend.ret = True;
6700 static void test_conflict_owned_active_vs_replica_handler_release(struct nbt_name_socket *nbtsock,
6701 struct nbt_name_packet *req_packet,
6702 const struct nbt_peer_socket *src)
6704 struct nbt_name *name;
6705 struct nbt_name_packet *rep_packet;
6706 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
6708 _NBT_ASSERT(req_packet->qdcount, 1);
6709 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
6710 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
6712 name = &req_packet->questions[0].name;
6714 _NBT_ASSERT(name->type, rec->name.type);
6715 _NBT_ASSERT_STRING(name->name, rec->name.name);
6716 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
6718 _NBT_ASSERT(rec->defend.expect_release, True);
6720 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
6721 if (rep_packet == NULL) return;
6723 rep_packet->name_trn_id = req_packet->name_trn_id;
6724 rep_packet->ancount = 1;
6725 rep_packet->operation =
6727 NBT_OPCODE_RELEASE |
6728 NBT_FLAG_AUTHORITIVE;
6730 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
6731 if (rep_packet->answers == NULL) return;
6733 rep_packet->answers[0].name = *name;
6734 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
6735 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
6736 rep_packet->answers[0].ttl = req_packet->additional[0].ttl;
6737 rep_packet->answers[0].rdata = req_packet->additional[0].rdata;
6739 DEBUG(2,("Sending name release reply for %s to %s:%d\n",
6740 nbt_name_string(rep_packet, name), src->addr, src->port));
6742 nbt_name_reply_send(nbtsock, src, rep_packet);
6743 talloc_free(rep_packet);
6745 /* make sure we push the reply to the wire */
6746 event_loop_once(nbtsock->event_ctx);
6748 rec->defend.timeout = 0;
6749 rec->defend.ret = True;
6752 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
6753 struct nbt_name_packet *req_packet,
6754 const struct nbt_peer_socket *src)
6756 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
6758 rec->defend.ret = False;
6760 switch (req_packet->operation & NBT_OPCODE) {
6761 case NBT_OPCODE_QUERY:
6762 test_conflict_owned_active_vs_replica_handler_query(nbtsock, req_packet, src);
6764 case NBT_OPCODE_RELEASE:
6765 test_conflict_owned_active_vs_replica_handler_release(nbtsock, req_packet, src);
6768 printf("%s: unexpected incoming packet\n", __location__);
6774 test WINS replication operations
6776 BOOL torture_nbt_winsreplication_quick(void)
6778 const char *address;
6779 struct nbt_name name;
6780 TALLOC_CTX *mem_ctx = talloc_new(NULL);
6784 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
6786 /* do an initial name resolution to find its IP */
6787 status = resolve_name(&name, mem_ctx, &address, NULL);
6788 if (!NT_STATUS_IS_OK(status)) {
6789 printf("Failed to resolve %s - %s\n",
6790 name.name, nt_errstr(status));
6791 talloc_free(mem_ctx);
6795 ret &= test_assoc_ctx1(mem_ctx, address);
6796 ret &= test_assoc_ctx2(mem_ctx, address);
6798 talloc_free(mem_ctx);
6804 test WINS replication operations
6806 BOOL torture_nbt_winsreplication(void)
6808 const char *address;
6809 struct nbt_name name;
6810 TALLOC_CTX *mem_ctx = talloc_new(NULL);
6813 struct test_wrepl_conflict_conn *ctx;
6815 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
6817 /* do an initial name resolution to find its IP */
6818 status = resolve_name(&name, mem_ctx, &address, NULL);
6819 if (!NT_STATUS_IS_OK(status)) {
6820 printf("Failed to resolve %s - %s\n",
6821 name.name, nt_errstr(status));
6822 talloc_free(mem_ctx);
6826 ret &= test_assoc_ctx1(mem_ctx, address);
6827 ret &= test_assoc_ctx2(mem_ctx, address);
6829 ret &= test_wins_replication(mem_ctx, address);
6831 ctx = test_create_conflict_ctx(mem_ctx, address);
6833 ret &= test_conflict_same_owner(ctx);
6834 ret &= test_conflict_different_owner(ctx);
6835 ret &= test_conflict_owned_released_vs_replica(ctx);
6836 ret &= test_conflict_owned_active_vs_replica(ctx);
6838 talloc_free(mem_ctx);