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/socket/socket.h"
28 #define CHECK_STATUS(status, correct) do { \
29 if (!NT_STATUS_EQUAL(status, correct)) { \
30 printf("(%s) Incorrect status %s - should be %s\n", \
31 __location__, nt_errstr(status), nt_errstr(correct)); \
36 #define CHECK_VALUE(v, correct) do { \
37 if ((v) != (correct)) { \
38 printf("(%s) Incorrect value %s=%d - should be %d\n", \
39 __location__, #v, v, correct); \
44 #define CHECK_VALUE_UINT64(v, correct) do { \
45 if ((v) != (correct)) { \
46 printf("(%s) Incorrect value %s=%llu - should be %llu\n", \
47 __location__, #v, v, correct); \
52 #define CHECK_VALUE_STRING(v, correct) do { \
53 if ( ((!v) && (correct)) || \
54 ((v) && (!correct)) || \
55 ((v) && (correct) && strcmp(v,correct) != 0)) { \
56 printf("(%s) Incorrect value %s='%s' - should be '%s'\n", \
57 __location__, #v, v, correct); \
62 #define _NBT_NAME(n,t,s) {\
68 static const char *wrepl_name_type_string(enum wrepl_name_type type)
71 case WREPL_TYPE_UNIQUE: return "UNIQUE";
72 case WREPL_TYPE_GROUP: return "GROUP";
73 case WREPL_TYPE_SGROUP: return "SGROUP";
74 case WREPL_TYPE_MHOMED: return "MHOMED";
76 return "UNKNOWN_TYPE";
79 static const char *wrepl_name_state_string(enum wrepl_name_state state)
82 case WREPL_STATE_ACTIVE: return "ACTIVE";
83 case WREPL_STATE_RELEASED: return "RELEASED";
84 case WREPL_STATE_TOMBSTONE: return "TOMBSTONE";
85 case WREPL_STATE_RESERVED: return "RESERVED";
87 return "UNKNOWN_STATE";
91 test how assoc_ctx's are only usable on the connection
94 static BOOL test_assoc_ctx1(TALLOC_CTX *mem_ctx, const char *address)
97 struct wrepl_request *req;
98 struct wrepl_socket *wrepl_socket1;
99 struct wrepl_associate associate1;
100 struct wrepl_socket *wrepl_socket2;
101 struct wrepl_associate associate2;
102 struct wrepl_pull_table pull_table;
103 struct wrepl_packet *rep_packet;
104 struct wrepl_associate_stop assoc_stop;
107 if (!lp_parm_bool(-1, "torture", "dangerous", False)) {
108 printf("winsrepl: cross connection assoc_ctx usage disabled - enable dangerous tests to use\n");
112 printf("Test if assoc_ctx is only valid on the conection it was created on\n");
114 wrepl_socket1 = wrepl_socket_init(mem_ctx, NULL);
115 wrepl_socket2 = wrepl_socket_init(mem_ctx, NULL);
117 printf("Setup 2 wrepl connections\n");
118 status = wrepl_connect(wrepl_socket1, NULL, address);
119 CHECK_STATUS(status, NT_STATUS_OK);
121 status = wrepl_connect(wrepl_socket2, NULL, address);
122 CHECK_STATUS(status, NT_STATUS_OK);
124 printf("Send a start association request (conn1)\n");
125 status = wrepl_associate(wrepl_socket1, &associate1);
126 CHECK_STATUS(status, NT_STATUS_OK);
128 printf("association context (conn1): 0x%x\n", associate1.out.assoc_ctx);
130 printf("Send a start association request (conn2)\n");
131 status = wrepl_associate(wrepl_socket2, &associate2);
132 CHECK_STATUS(status, NT_STATUS_OK);
134 printf("association context (conn2): 0x%x\n", associate2.out.assoc_ctx);
136 printf("Send a replication table query, with assoc 1 (conn2), the anwser should be on conn1\n");
137 pull_table.in.assoc_ctx = associate1.out.assoc_ctx;
138 req = wrepl_pull_table_send(wrepl_socket2, &pull_table);
139 req->send_only = True;
140 status = wrepl_request_recv(req, mem_ctx, &rep_packet);
141 CHECK_STATUS(status, NT_STATUS_OK);
143 printf("Send a association request (conn2), to make sure the last request was ignored\n");
144 status = wrepl_associate(wrepl_socket2, &associate2);
145 CHECK_STATUS(status, NT_STATUS_OK);
147 printf("Send a replication table query, with invalid assoc (conn1), receive answer from conn2\n");
148 pull_table.in.assoc_ctx = 0;
149 req = wrepl_pull_table_send(wrepl_socket1, &pull_table);
150 status = wrepl_request_recv(req, mem_ctx, &rep_packet);
151 CHECK_STATUS(status, NT_STATUS_OK);
153 printf("Send a association request (conn1), to make sure the last request was handled correct\n");
154 status = wrepl_associate(wrepl_socket1, &associate2);
155 CHECK_STATUS(status, NT_STATUS_OK);
157 assoc_stop.in.assoc_ctx = associate1.out.assoc_ctx;
158 assoc_stop.in.reason = 4;
159 printf("Send a association stop request (conn1), reson: %u\n", assoc_stop.in.reason);
160 status = wrepl_associate_stop(wrepl_socket1, &assoc_stop);
161 CHECK_STATUS(status, NT_STATUS_END_OF_FILE);
163 assoc_stop.in.assoc_ctx = associate2.out.assoc_ctx;
164 assoc_stop.in.reason = 0;
165 printf("Send a association stop request (conn2), reson: %u\n", assoc_stop.in.reason);
166 status = wrepl_associate_stop(wrepl_socket2, &assoc_stop);
167 CHECK_STATUS(status, NT_STATUS_OK);
170 printf("Close 2 wrepl connections\n");
171 talloc_free(wrepl_socket1);
172 talloc_free(wrepl_socket2);
177 test if we always get back the same assoc_ctx
179 static BOOL test_assoc_ctx2(TALLOC_CTX *mem_ctx, const char *address)
182 struct wrepl_socket *wrepl_socket;
183 struct wrepl_associate associate;
187 printf("Test if we always get back the same assoc_ctx\n");
189 wrepl_socket = wrepl_socket_init(mem_ctx, NULL);
191 printf("Setup wrepl connections\n");
192 status = wrepl_connect(wrepl_socket, NULL, address);
193 CHECK_STATUS(status, NT_STATUS_OK);
196 printf("Send 1st start association request\n");
197 status = wrepl_associate(wrepl_socket, &associate);
198 CHECK_STATUS(status, NT_STATUS_OK);
199 assoc_ctx1 = associate.out.assoc_ctx;
200 printf("1st association context: 0x%x\n", associate.out.assoc_ctx);
202 printf("Send 2nd start association request\n");
203 status = wrepl_associate(wrepl_socket, &associate);
204 CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1);
205 CHECK_STATUS(status, NT_STATUS_OK);
206 printf("2nd association context: 0x%x\n", associate.out.assoc_ctx);
208 printf("Send 3rd start association request\n");
209 status = wrepl_associate(wrepl_socket, &associate);
210 CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1);
211 CHECK_STATUS(status, NT_STATUS_OK);
212 printf("3rd association context: 0x%x\n", associate.out.assoc_ctx);
215 printf("Close wrepl connections\n");
216 talloc_free(wrepl_socket);
222 display a replication entry
224 static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_name *name)
228 printf("%s\n", nbt_name_string(mem_ctx, &name->name));
229 printf("\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n",
230 name->type, name->state, name->node, name->is_static, name->version_id);
231 printf("\tRAW_FLAGS: 0x%08X OWNER: %-15s\n",
232 name->raw_flags, name->owner);
233 for (i=0;i<name->num_addresses;i++) {
234 printf("\tADDR: %-15s OWNER: %-15s\n",
235 name->addresses[i].address, name->addresses[i].owner);
240 test a full replication dump from a WINS server
242 static BOOL test_wins_replication(TALLOC_CTX *mem_ctx, const char *address)
245 struct wrepl_socket *wrepl_socket;
248 struct wrepl_associate associate;
249 struct wrepl_pull_table pull_table;
250 struct wrepl_pull_names pull_names;
252 printf("Test one pull replication cycle\n");
254 wrepl_socket = wrepl_socket_init(mem_ctx, NULL);
256 printf("Setup wrepl connections\n");
257 status = wrepl_connect(wrepl_socket, NULL, address);
258 CHECK_STATUS(status, NT_STATUS_OK);
260 printf("Send a start association request\n");
262 status = wrepl_associate(wrepl_socket, &associate);
263 CHECK_STATUS(status, NT_STATUS_OK);
265 printf("association context: 0x%x\n", associate.out.assoc_ctx);
267 printf("Send a replication table query\n");
268 pull_table.in.assoc_ctx = associate.out.assoc_ctx;
270 status = wrepl_pull_table(wrepl_socket, mem_ctx, &pull_table);
271 if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) {
272 struct wrepl_packet packet;
273 struct wrepl_request *req;
276 packet.opcode = WREPL_OPCODE_BITS;
277 packet.assoc_ctx = associate.out.assoc_ctx;
278 packet.mess_type = WREPL_STOP_ASSOCIATION;
279 packet.message.stop.reason = 0;
281 req = wrepl_request_send(wrepl_socket, &packet);
284 printf("failed - We are not a valid pull partner for the server\n");
288 CHECK_STATUS(status, NT_STATUS_OK);
290 printf("Found %d replication partners\n", pull_table.out.num_partners);
292 for (i=0;i<pull_table.out.num_partners;i++) {
293 struct wrepl_wins_owner *partner = &pull_table.out.partners[i];
294 printf("%s max_version=%6llu min_version=%6llu type=%d\n",
296 partner->max_version,
297 partner->min_version,
300 pull_names.in.assoc_ctx = associate.out.assoc_ctx;
301 pull_names.in.partner = *partner;
303 status = wrepl_pull_names(wrepl_socket, mem_ctx, &pull_names);
304 CHECK_STATUS(status, NT_STATUS_OK);
306 printf("Received %d names\n", pull_names.out.num_names);
308 for (j=0;j<pull_names.out.num_names;j++) {
309 display_entry(mem_ctx, &pull_names.out.names[j]);
314 printf("Close wrepl connections\n");
315 talloc_free(wrepl_socket);
319 struct test_wrepl_conflict_conn {
321 struct wrepl_socket *pull;
324 #define TEST_OWNER_A_ADDRESS "127.65.65.1"
325 #define TEST_ADDRESS_A_PREFIX "127.0.65"
326 #define TEST_OWNER_B_ADDRESS "127.66.66.1"
327 #define TEST_ADDRESS_B_PREFIX "127.0.66"
329 struct wrepl_wins_owner a, b, c;
332 struct nbt_name_socket *nbtsock;
335 uint32_t addresses_1_num;
336 struct wrepl_ip *addresses_1;
339 static const struct wrepl_ip addresses_A_1[] = {
341 .owner = TEST_OWNER_A_ADDRESS,
342 .ip = TEST_ADDRESS_A_PREFIX".1"
345 static const struct wrepl_ip addresses_A_2[] = {
347 .owner = TEST_OWNER_A_ADDRESS,
348 .ip = TEST_ADDRESS_A_PREFIX".2"
351 static const struct wrepl_ip addresses_A_3_4[] = {
353 .owner = TEST_OWNER_A_ADDRESS,
354 .ip = TEST_ADDRESS_A_PREFIX".3"
357 .owner = TEST_OWNER_A_ADDRESS,
358 .ip = TEST_ADDRESS_A_PREFIX".4"
362 static const struct wrepl_ip addresses_B_1[] = {
364 .owner = TEST_OWNER_B_ADDRESS,
365 .ip = TEST_ADDRESS_B_PREFIX".1"
368 static const struct wrepl_ip addresses_B_2[] = {
370 .owner = TEST_OWNER_B_ADDRESS,
371 .ip = TEST_ADDRESS_B_PREFIX".2"
374 static const struct wrepl_ip addresses_B_3_4[] = {
376 .owner = TEST_OWNER_B_ADDRESS,
377 .ip = TEST_ADDRESS_B_PREFIX".3"
380 .owner = TEST_OWNER_B_ADDRESS,
381 .ip = TEST_ADDRESS_B_PREFIX".4"
385 static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem_ctx,
388 struct test_wrepl_conflict_conn *ctx;
389 struct wrepl_associate associate;
390 struct wrepl_pull_table pull_table;
394 ctx = talloc_zero(mem_ctx, struct test_wrepl_conflict_conn);
395 if (!ctx) return NULL;
397 ctx->address = address;
398 ctx->pull = wrepl_socket_init(ctx, NULL);
399 if (!ctx->pull) return NULL;
401 printf("Setup wrepl conflict pull connection\n");
402 status = wrepl_connect(ctx->pull, NULL, ctx->address);
403 if (!NT_STATUS_IS_OK(status)) return NULL;
405 status = wrepl_associate(ctx->pull, &associate);
406 if (!NT_STATUS_IS_OK(status)) return NULL;
408 ctx->pull_assoc = associate.out.assoc_ctx;
410 ctx->a.address = TEST_OWNER_A_ADDRESS;
411 ctx->a.max_version = 0;
412 ctx->a.min_version = 0;
415 ctx->b.address = TEST_OWNER_B_ADDRESS;
416 ctx->b.max_version = 0;
417 ctx->b.min_version = 0;
420 ctx->c.address = address;
421 ctx->c.max_version = 0;
422 ctx->c.min_version = 0;
425 pull_table.in.assoc_ctx = ctx->pull_assoc;
426 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
427 if (!NT_STATUS_IS_OK(status)) return NULL;
429 for (i=0; i < pull_table.out.num_partners; i++) {
430 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
431 ctx->a.max_version = pull_table.out.partners[i].max_version;
432 ctx->a.min_version = pull_table.out.partners[i].min_version;
434 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
435 ctx->b.max_version = pull_table.out.partners[i].max_version;
436 ctx->b.min_version = pull_table.out.partners[i].min_version;
438 if (strcmp(address,pull_table.out.partners[i].address)==0) {
439 ctx->c.max_version = pull_table.out.partners[i].max_version;
440 ctx->c.min_version = pull_table.out.partners[i].min_version;
444 talloc_free(pull_table.out.partners);
446 ctx->nbtsock = nbt_name_socket_init(ctx, NULL);
447 if (!ctx->nbtsock) return NULL;
449 ctx->myaddr = talloc_strdup(mem_ctx, iface_best_ip(address));
450 if (!ctx->myaddr) return NULL;
452 status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, lp_nbt_port(), 0, 0);
453 if (!NT_STATUS_IS_OK(status)) {
454 status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0, 0);
455 if (!NT_STATUS_IS_OK(status)) return NULL;
457 ctx->nbt_root_port = True;
460 ctx->addresses_1_num = 1;
461 ctx->addresses_1 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_1_num);
462 if (!ctx->addresses_1) return NULL;
463 ctx->addresses_1[0].owner = ctx->c.address;
464 ctx->addresses_1[0].ip = ctx->myaddr;
469 static BOOL test_wrepl_update_one(struct test_wrepl_conflict_conn *ctx,
470 const struct wrepl_wins_owner *owner,
471 const struct wrepl_wins_name *name)
474 struct wrepl_socket *wrepl_socket;
475 struct wrepl_associate associate;
476 struct wrepl_packet update_packet, repl_send;
477 struct wrepl_table *update;
478 struct wrepl_wins_owner wrepl_wins_owners[1];
479 struct wrepl_packet *repl_recv;
480 struct wrepl_wins_owner *send_request;
481 struct wrepl_send_reply *send_reply;
482 struct wrepl_wins_name wrepl_wins_names[1];
486 wrepl_socket = wrepl_socket_init(ctx, NULL);
488 status = wrepl_connect(wrepl_socket, NULL, ctx->address);
489 CHECK_STATUS(status, NT_STATUS_OK);
491 status = wrepl_associate(wrepl_socket, &associate);
492 CHECK_STATUS(status, NT_STATUS_OK);
493 assoc_ctx = associate.out.assoc_ctx;
495 /* now send a WREPL_REPL_UPDATE message */
496 ZERO_STRUCT(update_packet);
497 update_packet.opcode = WREPL_OPCODE_BITS;
498 update_packet.assoc_ctx = assoc_ctx;
499 update_packet.mess_type = WREPL_REPLICATION;
500 update_packet.message.replication.command = WREPL_REPL_UPDATE;
501 update = &update_packet.message.replication.info.table;
503 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
504 update->partners = wrepl_wins_owners;
505 update->initiator = "0.0.0.0";
507 wrepl_wins_owners[0] = *owner;
509 status = wrepl_request(wrepl_socket, wrepl_socket,
510 &update_packet, &repl_recv);
511 CHECK_STATUS(status, NT_STATUS_OK);
512 CHECK_VALUE(repl_recv->mess_type, WREPL_REPLICATION);
513 CHECK_VALUE(repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
514 send_request = &repl_recv->message.replication.info.owner;
516 ZERO_STRUCT(repl_send);
517 repl_send.opcode = WREPL_OPCODE_BITS;
518 repl_send.assoc_ctx = assoc_ctx;
519 repl_send.mess_type = WREPL_REPLICATION;
520 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
521 send_reply = &repl_send.message.replication.info.reply;
523 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
524 send_reply->names = wrepl_wins_names;
526 wrepl_wins_names[0] = *name;
528 status = wrepl_request(wrepl_socket, wrepl_socket,
529 &repl_send, &repl_recv);
530 CHECK_STATUS(status, NT_STATUS_OK);
531 CHECK_VALUE(repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
532 CHECK_VALUE(repl_recv->message.stop.reason, 0);
535 talloc_free(wrepl_socket);
540 static BOOL test_wrepl_update_two(struct test_wrepl_conflict_conn *ctx,
541 const struct wrepl_wins_owner *owner,
542 const struct wrepl_wins_name *name1,
543 const struct wrepl_wins_name *name2)
546 struct wrepl_socket *wrepl_socket;
547 struct wrepl_associate associate;
548 struct wrepl_packet update_packet, repl_send;
549 struct wrepl_table *update;
550 struct wrepl_wins_owner wrepl_wins_owners[1];
551 struct wrepl_packet *repl_recv;
552 struct wrepl_wins_owner *send_request;
553 struct wrepl_send_reply *send_reply;
554 struct wrepl_wins_name wrepl_wins_names[2];
558 wrepl_socket = wrepl_socket_init(ctx, NULL);
560 status = wrepl_connect(wrepl_socket, NULL, ctx->address);
561 CHECK_STATUS(status, NT_STATUS_OK);
563 status = wrepl_associate(wrepl_socket, &associate);
564 CHECK_STATUS(status, NT_STATUS_OK);
565 assoc_ctx = associate.out.assoc_ctx;
567 /* now send a WREPL_REPL_UPDATE message */
568 ZERO_STRUCT(update_packet);
569 update_packet.opcode = WREPL_OPCODE_BITS;
570 update_packet.assoc_ctx = assoc_ctx;
571 update_packet.mess_type = WREPL_REPLICATION;
572 update_packet.message.replication.command = WREPL_REPL_UPDATE;
573 update = &update_packet.message.replication.info.table;
575 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
576 update->partners = wrepl_wins_owners;
577 update->initiator = "0.0.0.0";
579 wrepl_wins_owners[0] = *owner;
581 status = wrepl_request(wrepl_socket, wrepl_socket,
582 &update_packet, &repl_recv);
583 CHECK_STATUS(status, NT_STATUS_OK);
584 CHECK_VALUE(repl_recv->mess_type, WREPL_REPLICATION);
585 CHECK_VALUE(repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
586 send_request = &repl_recv->message.replication.info.owner;
588 ZERO_STRUCT(repl_send);
589 repl_send.opcode = WREPL_OPCODE_BITS;
590 repl_send.assoc_ctx = assoc_ctx;
591 repl_send.mess_type = WREPL_REPLICATION;
592 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
593 send_reply = &repl_send.message.replication.info.reply;
595 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
596 send_reply->names = wrepl_wins_names;
598 wrepl_wins_names[0] = *name1;
599 wrepl_wins_names[1] = *name2;
601 status = wrepl_request(wrepl_socket, wrepl_socket,
602 &repl_send, &repl_recv);
603 CHECK_STATUS(status, NT_STATUS_OK);
604 CHECK_VALUE(repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
605 CHECK_VALUE(repl_recv->message.stop.reason, 0);
608 talloc_free(wrepl_socket);
613 static BOOL test_wrepl_is_applied(struct test_wrepl_conflict_conn *ctx,
614 const struct wrepl_wins_owner *owner,
615 const struct wrepl_wins_name *name,
620 struct wrepl_pull_names pull_names;
621 struct wrepl_name *names;
623 pull_names.in.assoc_ctx = ctx->pull_assoc;
624 pull_names.in.partner = *owner;
625 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
627 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
628 CHECK_STATUS(status, NT_STATUS_OK);
629 CHECK_VALUE(pull_names.out.num_names, (expected?1:0));
631 names = pull_names.out.names;
634 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
638 CHECK_VALUE(names[0].name.type, name->name->type);
639 CHECK_VALUE_STRING(names[0].name.name, name->name->name);
640 CHECK_VALUE_STRING(names[0].name.scope, name->name->scope);
641 CHECK_VALUE(flags, name->flags);
642 CHECK_VALUE_UINT64(names[0].version_id, name->id);
645 CHECK_VALUE(names[0].num_addresses,
646 name->addresses.addresses.num_ips);
648 CHECK_VALUE(names[0].num_addresses, 1);
649 CHECK_VALUE_STRING(names[0].addresses[0].address,
654 talloc_free(pull_names.out.names);
658 static BOOL test_wrepl_is_merged(struct test_wrepl_conflict_conn *ctx,
659 const struct wrepl_wins_name *name1,
660 const struct wrepl_wins_name *name2)
666 struct wrepl_pull_names pull_names;
667 struct wrepl_name *names;
670 pull_names.in.assoc_ctx = ctx->pull_assoc;
671 pull_names.in.partner = ctx->c;
672 pull_names.in.partner.min_version = ctx->c.max_version-1;
674 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
675 CHECK_STATUS(status, NT_STATUS_OK);
676 CHECK_VALUE(pull_names.out.num_names, 1);
678 names = pull_names.out.names;
680 num_ips = name1->addresses.addresses.num_ips + name2->addresses.addresses.num_ips;
682 CHECK_VALUE(names[0].name.type, name1->name->type);
683 CHECK_VALUE_STRING(names[0].name.name, name1->name->name);
684 CHECK_VALUE_STRING(names[0].name.scope, name1->name->scope);
685 CHECK_VALUE(names[0].type, WREPL_TYPE_SGROUP);
686 CHECK_VALUE(names[0].state, (num_ips>0?WREPL_STATE_ACTIVE:WREPL_STATE_RELEASED));
687 CHECK_VALUE_UINT64(names[0].version_id, ctx->c.max_version);
689 CHECK_VALUE(names[0].num_addresses,
690 name1->addresses.addresses.num_ips+
691 name2->addresses.addresses.num_ips);
693 talloc_free(pull_names.out.names);
698 static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx)
701 struct nbt_name name;
702 struct wrepl_wins_name wins_name1;
703 struct wrepl_wins_name wins_name2;
704 struct wrepl_wins_name *wins_name_tmp;
705 struct wrepl_wins_name *wins_name_last;
706 struct wrepl_wins_name *wins_name_cur;
708 uint8_t types[] = { 0x00, 0x1C };
710 enum wrepl_name_type type;
711 enum wrepl_name_state state;
712 enum wrepl_name_node node;
715 const struct wrepl_ip *ips;
718 .type = WREPL_TYPE_GROUP,
719 .state = WREPL_STATE_ACTIVE,
720 .node = WREPL_NODE_B,
722 .num_ips = ARRAY_SIZE(addresses_A_1),
723 .ips = addresses_A_1,
725 .type = WREPL_TYPE_UNIQUE,
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_2),
737 .ips = addresses_A_2,
739 .type = WREPL_TYPE_UNIQUE,
740 .state = WREPL_STATE_ACTIVE,
741 .node = WREPL_NODE_B,
743 .num_ips = ARRAY_SIZE(addresses_A_1),
744 .ips = addresses_A_1,
746 .type = WREPL_TYPE_UNIQUE,
747 .state = WREPL_STATE_ACTIVE,
748 .node = WREPL_NODE_B,
750 .num_ips = ARRAY_SIZE(addresses_A_2),
751 .ips = addresses_A_2,
753 .type = WREPL_TYPE_SGROUP,
754 .state = WREPL_STATE_TOMBSTONE,
755 .node = WREPL_NODE_B,
757 .num_ips = ARRAY_SIZE(addresses_A_2),
758 .ips = addresses_A_2,
760 .type = WREPL_TYPE_MHOMED,
761 .state = WREPL_STATE_TOMBSTONE,
762 .node = WREPL_NODE_B,
764 .num_ips = ARRAY_SIZE(addresses_A_1),
765 .ips = addresses_A_1,
767 .type = WREPL_TYPE_MHOMED,
768 .state = WREPL_STATE_RELEASED,
769 .node = WREPL_NODE_B,
771 .num_ips = ARRAY_SIZE(addresses_A_2),
772 .ips = addresses_A_2,
774 .type = WREPL_TYPE_SGROUP,
775 .state = WREPL_STATE_ACTIVE,
776 .node = WREPL_NODE_B,
778 .num_ips = ARRAY_SIZE(addresses_A_1),
779 .ips = addresses_A_1,
781 .type = WREPL_TYPE_SGROUP,
782 .state = WREPL_STATE_ACTIVE,
783 .node = WREPL_NODE_B,
785 .num_ips = ARRAY_SIZE(addresses_A_3_4),
786 .ips = addresses_A_3_4,
788 .type = WREPL_TYPE_SGROUP,
789 .state = WREPL_STATE_TOMBSTONE,
790 .node = WREPL_NODE_B,
792 .num_ips = ARRAY_SIZE(addresses_B_3_4),
793 .ips = addresses_B_3_4,
795 /* the last one should always be a unique,tomstone record! */
796 .type = WREPL_TYPE_UNIQUE,
797 .state = WREPL_STATE_TOMBSTONE,
798 .node = WREPL_NODE_B,
800 .num_ips = ARRAY_SIZE(addresses_A_1),
801 .ips = addresses_A_1,
805 if (!ctx) return False;
807 name.name = "_SAME_OWNER_A";
811 wins_name_tmp = NULL;
812 wins_name_last = &wins_name2;
813 wins_name_cur = &wins_name1;
815 for (j=0; ret && j < ARRAY_SIZE(types); j++) {
816 name.type = types[j];
817 printf("Test Replica Conflicts with same owner[%s] for %s\n",
818 nbt_name_string(ctx, &name), ctx->a.address);
820 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
821 wins_name_tmp = wins_name_last;
822 wins_name_last = wins_name_cur;
823 wins_name_cur = wins_name_tmp;
826 printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
827 wrepl_name_type_string(records[i-1].type),
828 wrepl_name_state_string(records[i-1].state),
829 (records[i-1].is_static?",static":""),
830 wrepl_name_type_string(records[i].type),
831 wrepl_name_state_string(records[i].state),
832 (records[i].is_static?",static":""),
833 (records[i-1].ips==records[i].ips?"same":"different"),
837 wins_name_cur->name = &name;
838 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
841 records[i].is_static);
842 wins_name_cur->id = ++ctx->a.max_version;
843 if (wins_name_cur->flags & 2) {
844 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
845 wins_name_cur->addresses.addresses.ips = discard_const(records[i].ips);
847 wins_name_cur->addresses.ip = records[i].ips[0].ip;
849 wins_name_cur->unknown = "255.255.255.255";
851 ret &= test_wrepl_update_one(ctx, &ctx->a,wins_name_cur);
852 if (records[i].state == WREPL_STATE_RELEASED) {
853 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_last, False);
854 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, False);
856 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, True);
859 /* the first one is a cleanup run */
860 if (!ret && i == 0) ret = True;
863 printf("conflict handled wrong or record[%u]: %s\n", i, __location__);
871 static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx)
874 struct wrepl_wins_name wins_name1;
875 struct wrepl_wins_name wins_name2;
876 struct wrepl_wins_name *wins_name_r1;
877 struct wrepl_wins_name *wins_name_r2;
880 const char *line; /* just better debugging */
881 struct nbt_name name;
882 BOOL extra; /* not the worst case, this is an extra test */
885 struct wrepl_wins_owner *owner;
886 enum wrepl_name_type type;
887 enum wrepl_name_state state;
888 enum wrepl_name_node node;
891 const struct wrepl_ip *ips;
897 * NOTE: the first record and the last applied one
898 * needs to be from the same owner,
899 * to not conflict in the next smbtorture run!!!
902 .line = __location__,
903 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
907 .type = WREPL_TYPE_UNIQUE,
908 .state = WREPL_STATE_TOMBSTONE,
909 .node = WREPL_NODE_B,
911 .num_ips = ARRAY_SIZE(addresses_B_1),
912 .ips = addresses_B_1,
913 .apply_expected = True /* ignored */
917 .type = WREPL_TYPE_UNIQUE,
918 .state = WREPL_STATE_TOMBSTONE,
919 .node = WREPL_NODE_B,
921 .num_ips = ARRAY_SIZE(addresses_A_1),
922 .ips = addresses_A_1,
923 .apply_expected = True /* ignored */
928 * unique vs unique section
931 * unique,active vs. unique,active
932 * => should be replaced
935 .line = __location__,
936 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
939 .type = WREPL_TYPE_UNIQUE,
940 .state = WREPL_STATE_ACTIVE,
941 .node = WREPL_NODE_B,
943 .num_ips = ARRAY_SIZE(addresses_A_1),
944 .ips = addresses_A_1,
945 .apply_expected = True
949 .type = WREPL_TYPE_UNIQUE,
950 .state = WREPL_STATE_ACTIVE,
951 .node = WREPL_NODE_B,
953 .num_ips = ARRAY_SIZE(addresses_B_1),
954 .ips = addresses_B_1,
955 .apply_expected = True
960 * unique,active vs. unique,tombstone
961 * => should NOT be replaced
964 .line = __location__,
965 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
968 .type = WREPL_TYPE_UNIQUE,
969 .state = WREPL_STATE_ACTIVE,
970 .node = WREPL_NODE_B,
972 .num_ips = ARRAY_SIZE(addresses_B_1),
973 .ips = addresses_B_1,
974 .apply_expected = True
978 .type = WREPL_TYPE_UNIQUE,
979 .state = WREPL_STATE_TOMBSTONE,
980 .node = WREPL_NODE_B,
982 .num_ips = ARRAY_SIZE(addresses_B_1),
983 .ips = addresses_B_1,
984 .apply_expected = False
989 * unique,released vs. unique,active
990 * => should be replaced
993 .line = __location__,
994 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
997 .type = WREPL_TYPE_UNIQUE,
998 .state = WREPL_STATE_RELEASED,
999 .node = WREPL_NODE_B,
1001 .num_ips = ARRAY_SIZE(addresses_B_1),
1002 .ips = addresses_B_1,
1003 .apply_expected = False
1007 .type = WREPL_TYPE_UNIQUE,
1008 .state = WREPL_STATE_ACTIVE,
1009 .node = WREPL_NODE_B,
1011 .num_ips = ARRAY_SIZE(addresses_A_1),
1012 .ips = addresses_A_1,
1013 .apply_expected = True
1018 * unique,released vs. unique,tombstone
1019 * => should be replaced
1022 .line = __location__,
1023 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1026 .type = WREPL_TYPE_UNIQUE,
1027 .state = WREPL_STATE_RELEASED,
1028 .node = WREPL_NODE_B,
1030 .num_ips = ARRAY_SIZE(addresses_A_1),
1031 .ips = addresses_A_1,
1032 .apply_expected = False
1036 .type = WREPL_TYPE_UNIQUE,
1037 .state = WREPL_STATE_TOMBSTONE,
1038 .node = WREPL_NODE_B,
1040 .num_ips = ARRAY_SIZE(addresses_B_1),
1041 .ips = addresses_B_1,
1042 .apply_expected = True
1047 * unique,tombstone vs. unique,active
1048 * => should be replaced
1051 .line = __location__,
1052 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1055 .type = WREPL_TYPE_UNIQUE,
1056 .state = WREPL_STATE_TOMBSTONE,
1057 .node = WREPL_NODE_B,
1059 .num_ips = ARRAY_SIZE(addresses_B_1),
1060 .ips = addresses_B_1,
1061 .apply_expected = True
1065 .type = WREPL_TYPE_UNIQUE,
1066 .state = WREPL_STATE_ACTIVE,
1067 .node = WREPL_NODE_B,
1069 .num_ips = ARRAY_SIZE(addresses_A_1),
1070 .ips = addresses_A_1,
1071 .apply_expected = True
1076 * unique,tombstone vs. unique,tombstone
1077 * => should be replaced
1080 .line = __location__,
1081 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1084 .type = WREPL_TYPE_UNIQUE,
1085 .state = WREPL_STATE_TOMBSTONE,
1086 .node = WREPL_NODE_B,
1088 .num_ips = ARRAY_SIZE(addresses_A_1),
1089 .ips = addresses_A_1,
1090 .apply_expected = True
1094 .type = WREPL_TYPE_UNIQUE,
1095 .state = WREPL_STATE_TOMBSTONE,
1096 .node = WREPL_NODE_B,
1098 .num_ips = ARRAY_SIZE(addresses_B_1),
1099 .ips = addresses_B_1,
1100 .apply_expected = True
1106 * unique vs normal groups section,
1109 * unique,active vs. group,active
1110 * => should be replaced
1113 .line = __location__,
1114 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1117 .type = WREPL_TYPE_UNIQUE,
1118 .state = WREPL_STATE_ACTIVE,
1119 .node = WREPL_NODE_B,
1121 .num_ips = ARRAY_SIZE(addresses_B_1),
1122 .ips = addresses_B_1,
1123 .apply_expected = True
1127 .type = WREPL_TYPE_GROUP,
1128 .state = WREPL_STATE_ACTIVE,
1129 .node = WREPL_NODE_B,
1131 .num_ips = ARRAY_SIZE(addresses_A_1),
1132 .ips = addresses_A_1,
1133 .apply_expected = True
1138 * unique,active vs. group,tombstone
1139 * => should NOT be replaced
1142 .line = __location__,
1143 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1146 .type = WREPL_TYPE_UNIQUE,
1147 .state = WREPL_STATE_ACTIVE,
1148 .node = WREPL_NODE_B,
1150 .num_ips = ARRAY_SIZE(addresses_A_1),
1151 .ips = addresses_A_1,
1152 .apply_expected = True
1156 .type = WREPL_TYPE_GROUP,
1157 .state = WREPL_STATE_TOMBSTONE,
1158 .node = WREPL_NODE_B,
1160 .num_ips = ARRAY_SIZE(addresses_A_1),
1161 .ips = addresses_A_1,
1162 .apply_expected = False
1167 * unique,released vs. group,active
1168 * => should be replaced
1171 .line = __location__,
1172 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1175 .type = WREPL_TYPE_UNIQUE,
1176 .state = WREPL_STATE_RELEASED,
1177 .node = WREPL_NODE_B,
1179 .num_ips = ARRAY_SIZE(addresses_A_1),
1180 .ips = addresses_A_1,
1181 .apply_expected = False
1185 .type = WREPL_TYPE_GROUP,
1186 .state = WREPL_STATE_ACTIVE,
1187 .node = WREPL_NODE_B,
1189 .num_ips = ARRAY_SIZE(addresses_B_1),
1190 .ips = addresses_B_1,
1191 .apply_expected = True
1196 * unique,released vs. group,tombstone
1197 * => should be replaced
1200 .line = __location__,
1201 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1204 .type = WREPL_TYPE_UNIQUE,
1205 .state = WREPL_STATE_RELEASED,
1206 .node = WREPL_NODE_B,
1208 .num_ips = ARRAY_SIZE(addresses_B_1),
1209 .ips = addresses_B_1,
1210 .apply_expected = False
1214 .type = WREPL_TYPE_GROUP,
1215 .state = WREPL_STATE_TOMBSTONE,
1216 .node = WREPL_NODE_B,
1218 .num_ips = ARRAY_SIZE(addresses_A_1),
1219 .ips = addresses_A_1,
1220 .apply_expected = True
1225 * unique,tombstone vs. group,active
1226 * => should be replaced
1229 .line = __location__,
1230 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1233 .type = WREPL_TYPE_UNIQUE,
1234 .state = WREPL_STATE_TOMBSTONE,
1235 .node = WREPL_NODE_B,
1237 .num_ips = ARRAY_SIZE(addresses_A_1),
1238 .ips = addresses_A_1,
1239 .apply_expected = True
1243 .type = WREPL_TYPE_GROUP,
1244 .state = WREPL_STATE_ACTIVE,
1245 .node = WREPL_NODE_B,
1247 .num_ips = ARRAY_SIZE(addresses_B_1),
1248 .ips = addresses_B_1,
1249 .apply_expected = True
1254 * unique,tombstone vs. group,tombstone
1255 * => should be replaced
1258 .line = __location__,
1259 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1262 .type = WREPL_TYPE_UNIQUE,
1263 .state = WREPL_STATE_TOMBSTONE,
1264 .node = WREPL_NODE_B,
1266 .num_ips = ARRAY_SIZE(addresses_B_1),
1267 .ips = addresses_B_1,
1268 .apply_expected = True
1272 .type = WREPL_TYPE_GROUP,
1273 .state = WREPL_STATE_TOMBSTONE,
1274 .node = WREPL_NODE_B,
1276 .num_ips = ARRAY_SIZE(addresses_A_1),
1277 .ips = addresses_A_1,
1278 .apply_expected = True
1283 * unique vs special groups section,
1286 * unique,active vs. sgroup,active
1287 * => should NOT be replaced
1290 .line = __location__,
1291 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1294 .type = WREPL_TYPE_UNIQUE,
1295 .state = WREPL_STATE_ACTIVE,
1296 .node = WREPL_NODE_B,
1298 .num_ips = ARRAY_SIZE(addresses_A_1),
1299 .ips = addresses_A_1,
1300 .apply_expected = True
1304 .type = WREPL_TYPE_SGROUP,
1305 .state = WREPL_STATE_ACTIVE,
1306 .node = WREPL_NODE_B,
1308 .num_ips = ARRAY_SIZE(addresses_A_1),
1309 .ips = addresses_A_1,
1310 .apply_expected = False
1315 * unique,active vs. sgroup,tombstone
1316 * => should NOT be replaced
1319 .line = __location__,
1320 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1323 .type = WREPL_TYPE_UNIQUE,
1324 .state = WREPL_STATE_ACTIVE,
1325 .node = WREPL_NODE_B,
1327 .num_ips = ARRAY_SIZE(addresses_A_1),
1328 .ips = addresses_A_1,
1329 .apply_expected = True
1333 .type = WREPL_TYPE_SGROUP,
1334 .state = WREPL_STATE_TOMBSTONE,
1335 .node = WREPL_NODE_B,
1337 .num_ips = ARRAY_SIZE(addresses_A_1),
1338 .ips = addresses_A_1,
1339 .apply_expected = False
1344 * unique,released vs. sgroup,active
1345 * => should be replaced
1348 .line = __location__,
1349 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1352 .type = WREPL_TYPE_UNIQUE,
1353 .state = WREPL_STATE_RELEASED,
1354 .node = WREPL_NODE_B,
1356 .num_ips = ARRAY_SIZE(addresses_A_1),
1357 .ips = addresses_A_1,
1358 .apply_expected = False
1362 .type = WREPL_TYPE_SGROUP,
1363 .state = WREPL_STATE_ACTIVE,
1364 .node = WREPL_NODE_B,
1366 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1367 .ips = addresses_B_3_4,
1368 .apply_expected = True
1373 * unique,released vs. sgroup,tombstone
1374 * => should be replaced
1377 .line = __location__,
1378 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1381 .type = WREPL_TYPE_UNIQUE,
1382 .state = WREPL_STATE_RELEASED,
1383 .node = WREPL_NODE_B,
1385 .num_ips = ARRAY_SIZE(addresses_B_1),
1386 .ips = addresses_B_1,
1387 .apply_expected = False
1391 .type = WREPL_TYPE_SGROUP,
1392 .state = WREPL_STATE_TOMBSTONE,
1393 .node = WREPL_NODE_B,
1395 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1396 .ips = addresses_A_3_4,
1397 .apply_expected = True
1402 * unique,tombstone vs. sgroup,active
1403 * => should be replaced
1406 .line = __location__,
1407 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1410 .type = WREPL_TYPE_UNIQUE,
1411 .state = WREPL_STATE_TOMBSTONE,
1412 .node = WREPL_NODE_B,
1414 .num_ips = ARRAY_SIZE(addresses_A_1),
1415 .ips = addresses_A_1,
1416 .apply_expected = True
1420 .type = WREPL_TYPE_SGROUP,
1421 .state = WREPL_STATE_ACTIVE,
1422 .node = WREPL_NODE_B,
1424 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1425 .ips = addresses_B_3_4,
1426 .apply_expected = True
1431 * unique,tombstone vs. sgroup,tombstone
1432 * => should be replaced
1435 .line = __location__,
1436 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1439 .type = WREPL_TYPE_UNIQUE,
1440 .state = WREPL_STATE_TOMBSTONE,
1441 .node = WREPL_NODE_B,
1443 .num_ips = ARRAY_SIZE(addresses_B_1),
1444 .ips = addresses_B_1,
1445 .apply_expected = True
1449 .type = WREPL_TYPE_SGROUP,
1450 .state = WREPL_STATE_TOMBSTONE,
1451 .node = WREPL_NODE_B,
1453 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1454 .ips = addresses_A_3_4,
1455 .apply_expected = True
1460 * unique vs multi homed section,
1463 * unique,active vs. mhomed,active
1464 * => should be replaced
1467 .line = __location__,
1468 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1471 .type = WREPL_TYPE_UNIQUE,
1472 .state = WREPL_STATE_ACTIVE,
1473 .node = WREPL_NODE_B,
1475 .num_ips = ARRAY_SIZE(addresses_A_1),
1476 .ips = addresses_A_1,
1477 .apply_expected = True
1481 .type = WREPL_TYPE_MHOMED,
1482 .state = WREPL_STATE_ACTIVE,
1483 .node = WREPL_NODE_B,
1485 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1486 .ips = addresses_B_3_4,
1487 .apply_expected = True
1492 * unique,active vs. mhomed,tombstone
1493 * => should NOT be replaced
1496 .line = __location__,
1497 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1500 .type = WREPL_TYPE_UNIQUE,
1501 .state = WREPL_STATE_ACTIVE,
1502 .node = WREPL_NODE_B,
1504 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1505 .ips = addresses_B_3_4,
1506 .apply_expected = True
1510 .type = WREPL_TYPE_MHOMED,
1511 .state = WREPL_STATE_TOMBSTONE,
1512 .node = WREPL_NODE_B,
1514 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1515 .ips = addresses_B_3_4,
1516 .apply_expected = False
1521 * unique,released vs. mhomed,active
1522 * => should be replaced
1525 .line = __location__,
1526 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1529 .type = WREPL_TYPE_UNIQUE,
1530 .state = WREPL_STATE_RELEASED,
1531 .node = WREPL_NODE_B,
1533 .num_ips = ARRAY_SIZE(addresses_B_1),
1534 .ips = addresses_B_1,
1535 .apply_expected = False
1539 .type = WREPL_TYPE_MHOMED,
1540 .state = WREPL_STATE_ACTIVE,
1541 .node = WREPL_NODE_B,
1543 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1544 .ips = addresses_A_3_4,
1545 .apply_expected = True
1550 * unique,released vs. mhomed,tombstone
1551 * => should be replaced
1554 .line = __location__,
1555 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1558 .type = WREPL_TYPE_UNIQUE,
1559 .state = WREPL_STATE_RELEASED,
1560 .node = WREPL_NODE_B,
1562 .num_ips = ARRAY_SIZE(addresses_A_1),
1563 .ips = addresses_A_1,
1564 .apply_expected = False
1568 .type = WREPL_TYPE_MHOMED,
1569 .state = WREPL_STATE_TOMBSTONE,
1570 .node = WREPL_NODE_B,
1572 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1573 .ips = addresses_B_3_4,
1574 .apply_expected = True
1579 * unique,tombstone vs. mhomed,active
1580 * => should be replaced
1583 .line = __location__,
1584 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1587 .type = WREPL_TYPE_UNIQUE,
1588 .state = WREPL_STATE_TOMBSTONE,
1589 .node = WREPL_NODE_B,
1591 .num_ips = ARRAY_SIZE(addresses_B_1),
1592 .ips = addresses_B_1,
1593 .apply_expected = True
1597 .type = WREPL_TYPE_MHOMED,
1598 .state = WREPL_STATE_ACTIVE,
1599 .node = WREPL_NODE_B,
1601 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1602 .ips = addresses_A_3_4,
1603 .apply_expected = True
1608 * unique,tombstone vs. mhomed,tombstone
1609 * => should be replaced
1612 .line = __location__,
1613 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1616 .type = WREPL_TYPE_UNIQUE,
1617 .state = WREPL_STATE_TOMBSTONE,
1618 .node = WREPL_NODE_B,
1620 .num_ips = ARRAY_SIZE(addresses_A_1),
1621 .ips = addresses_A_1,
1622 .apply_expected = True
1626 .type = WREPL_TYPE_MHOMED,
1627 .state = WREPL_STATE_TOMBSTONE,
1628 .node = WREPL_NODE_B,
1630 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1631 .ips = addresses_B_3_4,
1632 .apply_expected = True
1637 * normal groups vs unique section,
1640 * group,active vs. unique,active
1641 * => should NOT be replaced
1644 .line = __location__,
1645 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1648 .type = WREPL_TYPE_GROUP,
1649 .state = WREPL_STATE_ACTIVE,
1650 .node = WREPL_NODE_B,
1652 .num_ips = ARRAY_SIZE(addresses_A_1),
1653 .ips = addresses_A_1,
1654 .apply_expected = True
1658 .type = WREPL_TYPE_UNIQUE,
1659 .state = WREPL_STATE_ACTIVE,
1660 .node = WREPL_NODE_B,
1662 .num_ips = ARRAY_SIZE(addresses_A_1),
1663 .ips = addresses_A_1,
1664 .apply_expected = False
1669 * group,active vs. unique,tombstone
1670 * => should NOT be replaced
1673 .line = __location__,
1674 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1677 .type = WREPL_TYPE_GROUP,
1678 .state = WREPL_STATE_ACTIVE,
1679 .node = WREPL_NODE_B,
1681 .num_ips = ARRAY_SIZE(addresses_A_1),
1682 .ips = addresses_A_1,
1683 .apply_expected = True
1687 .type = WREPL_TYPE_UNIQUE,
1688 .state = WREPL_STATE_TOMBSTONE,
1689 .node = WREPL_NODE_B,
1691 .num_ips = ARRAY_SIZE(addresses_A_1),
1692 .ips = addresses_A_1,
1693 .apply_expected = False
1698 * group,released vs. unique,active
1699 * => should NOT be replaced
1702 .line = __location__,
1703 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1706 .type = WREPL_TYPE_GROUP,
1707 .state = WREPL_STATE_RELEASED,
1708 .node = WREPL_NODE_B,
1710 .num_ips = ARRAY_SIZE(addresses_A_1),
1711 .ips = addresses_A_1,
1712 .apply_expected = False
1716 .type = WREPL_TYPE_UNIQUE,
1717 .state = WREPL_STATE_ACTIVE,
1718 .node = WREPL_NODE_B,
1720 .num_ips = ARRAY_SIZE(addresses_A_1),
1721 .ips = addresses_A_1,
1722 .apply_expected = False
1727 * group,released vs. unique,tombstone
1728 * => should NOT be replaced
1731 .line = __location__,
1732 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1735 .type = WREPL_TYPE_GROUP,
1736 .state = WREPL_STATE_RELEASED,
1737 .node = WREPL_NODE_B,
1739 .num_ips = ARRAY_SIZE(addresses_A_1),
1740 .ips = addresses_A_1,
1741 .apply_expected = False
1745 .type = WREPL_TYPE_UNIQUE,
1746 .state = WREPL_STATE_TOMBSTONE,
1747 .node = WREPL_NODE_B,
1749 .num_ips = ARRAY_SIZE(addresses_A_1),
1750 .ips = addresses_A_1,
1751 .apply_expected = False
1756 * group,tombstone vs. unique,active
1757 * => should NOT be replaced
1760 .line = __location__,
1761 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1764 .type = WREPL_TYPE_GROUP,
1765 .state = WREPL_STATE_TOMBSTONE,
1766 .node = WREPL_NODE_B,
1768 .num_ips = ARRAY_SIZE(addresses_A_1),
1769 .ips = addresses_A_1,
1770 .apply_expected = True
1774 .type = WREPL_TYPE_UNIQUE,
1775 .state = WREPL_STATE_ACTIVE,
1776 .node = WREPL_NODE_B,
1778 .num_ips = ARRAY_SIZE(addresses_A_1),
1779 .ips = addresses_A_1,
1780 .apply_expected = False
1785 * group,tombstone vs. unique,tombstone
1786 * => should NOT be replaced
1789 .line = __location__,
1790 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1793 .type = WREPL_TYPE_GROUP,
1794 .state = WREPL_STATE_TOMBSTONE,
1795 .node = WREPL_NODE_B,
1797 .num_ips = ARRAY_SIZE(addresses_A_1),
1798 .ips = addresses_A_1,
1799 .apply_expected = True
1803 .type = WREPL_TYPE_UNIQUE,
1804 .state = WREPL_STATE_TOMBSTONE,
1805 .node = WREPL_NODE_B,
1807 .num_ips = ARRAY_SIZE(addresses_A_1),
1808 .ips = addresses_A_1,
1809 .apply_expected = False
1814 * normal groups vs normal groups section,
1817 * group,active vs. group,active
1818 * => should NOT be replaced
1821 .line = __location__,
1822 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1825 .type = WREPL_TYPE_GROUP,
1826 .state = WREPL_STATE_ACTIVE,
1827 .node = WREPL_NODE_B,
1829 .num_ips = ARRAY_SIZE(addresses_A_1),
1830 .ips = addresses_A_1,
1831 .apply_expected = True
1835 .type = WREPL_TYPE_GROUP,
1836 .state = WREPL_STATE_ACTIVE,
1837 .node = WREPL_NODE_B,
1839 .num_ips = ARRAY_SIZE(addresses_A_1),
1840 .ips = addresses_A_1,
1841 .apply_expected = False
1846 * group,active vs. group,tombstone
1847 * => should NOT be replaced
1850 .line = __location__,
1851 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1854 .type = WREPL_TYPE_GROUP,
1855 .state = WREPL_STATE_ACTIVE,
1856 .node = WREPL_NODE_B,
1858 .num_ips = ARRAY_SIZE(addresses_A_1),
1859 .ips = addresses_A_1,
1860 .apply_expected = True
1864 .type = WREPL_TYPE_GROUP,
1865 .state = WREPL_STATE_TOMBSTONE,
1866 .node = WREPL_NODE_B,
1868 .num_ips = ARRAY_SIZE(addresses_A_1),
1869 .ips = addresses_A_1,
1870 .apply_expected = False
1875 * group,released vs. group,active
1876 * => should be replaced
1879 .line = __location__,
1880 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1883 .type = WREPL_TYPE_GROUP,
1884 .state = WREPL_STATE_RELEASED,
1885 .node = WREPL_NODE_B,
1887 .num_ips = ARRAY_SIZE(addresses_A_1),
1888 .ips = addresses_A_1,
1889 .apply_expected = False
1893 .type = WREPL_TYPE_GROUP,
1894 .state = WREPL_STATE_ACTIVE,
1895 .node = WREPL_NODE_B,
1897 .num_ips = ARRAY_SIZE(addresses_B_1),
1898 .ips = addresses_B_1,
1899 .apply_expected = True
1904 * group,released vs. group,tombstone
1905 * => should be replaced
1908 .line = __location__,
1909 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1912 .type = WREPL_TYPE_GROUP,
1913 .state = WREPL_STATE_RELEASED,
1914 .node = WREPL_NODE_B,
1916 .num_ips = ARRAY_SIZE(addresses_A_1),
1917 .ips = addresses_A_1,
1918 .apply_expected = False
1922 .type = WREPL_TYPE_GROUP,
1923 .state = WREPL_STATE_TOMBSTONE,
1924 .node = WREPL_NODE_B,
1926 .num_ips = ARRAY_SIZE(addresses_B_1),
1927 .ips = addresses_B_1,
1928 .apply_expected = True
1933 * group,tombstone vs. group,active
1934 * => should be replaced
1937 .line = __location__,
1938 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1941 .type = WREPL_TYPE_GROUP,
1942 .state = WREPL_STATE_TOMBSTONE,
1943 .node = WREPL_NODE_B,
1945 .num_ips = ARRAY_SIZE(addresses_B_1),
1946 .ips = addresses_B_1,
1947 .apply_expected = True
1951 .type = WREPL_TYPE_GROUP,
1952 .state = WREPL_STATE_ACTIVE,
1953 .node = WREPL_NODE_B,
1955 .num_ips = ARRAY_SIZE(addresses_A_1),
1956 .ips = addresses_A_1,
1957 .apply_expected = True
1962 * group,tombstone vs. group,tombstone
1963 * => should be replaced
1966 .line = __location__,
1967 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1970 .type = WREPL_TYPE_GROUP,
1971 .state = WREPL_STATE_TOMBSTONE,
1972 .node = WREPL_NODE_B,
1974 .num_ips = ARRAY_SIZE(addresses_A_1),
1975 .ips = addresses_A_1,
1976 .apply_expected = True
1980 .type = WREPL_TYPE_GROUP,
1981 .state = WREPL_STATE_TOMBSTONE,
1982 .node = WREPL_NODE_B,
1984 .num_ips = ARRAY_SIZE(addresses_B_1),
1985 .ips = addresses_B_1,
1986 .apply_expected = True
1991 * normal groups vs special groups section,
1994 * group,active vs. sgroup,active
1995 * => should NOT be replaced
1998 .line = __location__,
1999 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2002 .type = WREPL_TYPE_GROUP,
2003 .state = WREPL_STATE_ACTIVE,
2004 .node = WREPL_NODE_B,
2006 .num_ips = ARRAY_SIZE(addresses_B_1),
2007 .ips = addresses_B_1,
2008 .apply_expected = True
2012 .type = WREPL_TYPE_SGROUP,
2013 .state = WREPL_STATE_ACTIVE,
2014 .node = WREPL_NODE_B,
2016 .num_ips = ARRAY_SIZE(addresses_B_1),
2017 .ips = addresses_B_1,
2018 .apply_expected = False
2023 * group,active vs. sgroup,tombstone
2024 * => should NOT be replaced
2027 .line = __location__,
2028 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2031 .type = WREPL_TYPE_GROUP,
2032 .state = WREPL_STATE_ACTIVE,
2033 .node = WREPL_NODE_B,
2035 .num_ips = ARRAY_SIZE(addresses_B_1),
2036 .ips = addresses_B_1,
2037 .apply_expected = True
2041 .type = WREPL_TYPE_SGROUP,
2042 .state = WREPL_STATE_TOMBSTONE,
2043 .node = WREPL_NODE_B,
2045 .num_ips = ARRAY_SIZE(addresses_B_1),
2046 .ips = addresses_B_1,
2047 .apply_expected = False
2052 * group,released vs. sgroup,active
2053 * => should be replaced
2056 .line = __location__,
2057 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2060 .type = WREPL_TYPE_GROUP,
2061 .state = WREPL_STATE_RELEASED,
2062 .node = WREPL_NODE_B,
2064 .num_ips = ARRAY_SIZE(addresses_A_1),
2065 .ips = addresses_A_1,
2066 .apply_expected = False
2070 .type = WREPL_TYPE_SGROUP,
2071 .state = WREPL_STATE_ACTIVE,
2072 .node = WREPL_NODE_B,
2074 .num_ips = ARRAY_SIZE(addresses_B_1),
2075 .ips = addresses_B_1,
2076 .apply_expected = True
2081 * group,released vs. sgroup,tombstone
2082 * => should NOT be replaced
2085 .line = __location__,
2086 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2089 .type = WREPL_TYPE_GROUP,
2090 .state = WREPL_STATE_RELEASED,
2091 .node = WREPL_NODE_B,
2093 .num_ips = ARRAY_SIZE(addresses_B_1),
2094 .ips = addresses_B_1,
2095 .apply_expected = False
2099 .type = WREPL_TYPE_SGROUP,
2100 .state = WREPL_STATE_TOMBSTONE,
2101 .node = WREPL_NODE_B,
2103 .num_ips = ARRAY_SIZE(addresses_B_1),
2104 .ips = addresses_B_1,
2105 .apply_expected = False
2110 * group,tombstone vs. sgroup,active
2111 * => should be replaced
2114 .line = __location__,
2115 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2118 .type = WREPL_TYPE_GROUP,
2119 .state = WREPL_STATE_TOMBSTONE,
2120 .node = WREPL_NODE_B,
2122 .num_ips = ARRAY_SIZE(addresses_B_1),
2123 .ips = addresses_B_1,
2124 .apply_expected = True
2128 .type = WREPL_TYPE_SGROUP,
2129 .state = WREPL_STATE_ACTIVE,
2130 .node = WREPL_NODE_B,
2132 .num_ips = ARRAY_SIZE(addresses_A_1),
2133 .ips = addresses_A_1,
2134 .apply_expected = True
2139 * group,tombstone vs. sgroup,tombstone
2140 * => should be replaced
2143 .line = __location__,
2144 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2147 .type = WREPL_TYPE_GROUP,
2148 .state = WREPL_STATE_TOMBSTONE,
2149 .node = WREPL_NODE_B,
2151 .num_ips = ARRAY_SIZE(addresses_A_1),
2152 .ips = addresses_A_1,
2153 .apply_expected = True
2157 .type = WREPL_TYPE_SGROUP,
2158 .state = WREPL_STATE_TOMBSTONE,
2159 .node = WREPL_NODE_B,
2161 .num_ips = ARRAY_SIZE(addresses_B_1),
2162 .ips = addresses_B_1,
2163 .apply_expected = True
2168 * normal groups vs multi homed section,
2171 * group,active vs. mhomed,active
2172 * => should NOT be replaced
2175 .line = __location__,
2176 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2179 .type = WREPL_TYPE_GROUP,
2180 .state = WREPL_STATE_ACTIVE,
2181 .node = WREPL_NODE_B,
2183 .num_ips = ARRAY_SIZE(addresses_B_1),
2184 .ips = addresses_B_1,
2185 .apply_expected = True
2189 .type = WREPL_TYPE_MHOMED,
2190 .state = WREPL_STATE_ACTIVE,
2191 .node = WREPL_NODE_B,
2193 .num_ips = ARRAY_SIZE(addresses_B_1),
2194 .ips = addresses_B_1,
2195 .apply_expected = False
2200 * group,active vs. mhomed,tombstone
2201 * => should NOT be replaced
2204 .line = __location__,
2205 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2208 .type = WREPL_TYPE_GROUP,
2209 .state = WREPL_STATE_ACTIVE,
2210 .node = WREPL_NODE_B,
2212 .num_ips = ARRAY_SIZE(addresses_B_1),
2213 .ips = addresses_B_1,
2214 .apply_expected = True
2218 .type = WREPL_TYPE_MHOMED,
2219 .state = WREPL_STATE_TOMBSTONE,
2220 .node = WREPL_NODE_B,
2222 .num_ips = ARRAY_SIZE(addresses_B_1),
2223 .ips = addresses_B_1,
2224 .apply_expected = False
2229 * group,released vs. mhomed,active
2230 * => should NOT be replaced
2233 .line = __location__,
2234 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2237 .type = WREPL_TYPE_GROUP,
2238 .state = WREPL_STATE_RELEASED,
2239 .node = WREPL_NODE_B,
2241 .num_ips = ARRAY_SIZE(addresses_B_1),
2242 .ips = addresses_B_1,
2243 .apply_expected = False
2247 .type = WREPL_TYPE_MHOMED,
2248 .state = WREPL_STATE_ACTIVE,
2249 .node = WREPL_NODE_B,
2251 .num_ips = ARRAY_SIZE(addresses_B_1),
2252 .ips = addresses_B_1,
2253 .apply_expected = False
2258 * group,released vs. mhomed,tombstone
2259 * => should NOT be replaced
2262 .line = __location__,
2263 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2266 .type = WREPL_TYPE_GROUP,
2267 .state = WREPL_STATE_RELEASED,
2268 .node = WREPL_NODE_B,
2270 .num_ips = ARRAY_SIZE(addresses_B_1),
2271 .ips = addresses_B_1,
2272 .apply_expected = False
2276 .type = WREPL_TYPE_MHOMED,
2277 .state = WREPL_STATE_TOMBSTONE,
2278 .node = WREPL_NODE_B,
2280 .num_ips = ARRAY_SIZE(addresses_B_1),
2281 .ips = addresses_B_1,
2282 .apply_expected = False
2287 * group,tombstone vs. mhomed,active
2288 * => should be replaced
2291 .line = __location__,
2292 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2295 .type = WREPL_TYPE_GROUP,
2296 .state = WREPL_STATE_TOMBSTONE,
2297 .node = WREPL_NODE_B,
2299 .num_ips = ARRAY_SIZE(addresses_B_1),
2300 .ips = addresses_B_1,
2301 .apply_expected = True
2305 .type = WREPL_TYPE_MHOMED,
2306 .state = WREPL_STATE_ACTIVE,
2307 .node = WREPL_NODE_B,
2309 .num_ips = ARRAY_SIZE(addresses_A_1),
2310 .ips = addresses_A_1,
2311 .apply_expected = True
2316 * group,tombstone vs. mhomed,tombstone
2317 * => should be replaced
2320 .line = __location__,
2321 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2324 .type = WREPL_TYPE_GROUP,
2325 .state = WREPL_STATE_TOMBSTONE,
2326 .node = WREPL_NODE_B,
2328 .num_ips = ARRAY_SIZE(addresses_A_1),
2329 .ips = addresses_A_1,
2330 .apply_expected = True
2334 .type = WREPL_TYPE_MHOMED,
2335 .state = WREPL_STATE_TOMBSTONE,
2336 .node = WREPL_NODE_B,
2338 .num_ips = ARRAY_SIZE(addresses_B_1),
2339 .ips = addresses_B_1,
2340 .apply_expected = True
2345 * special groups vs unique section,
2348 * sgroup,active vs. unique,active
2349 * => should NOT be replaced
2352 .line = __location__,
2353 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2356 .type = WREPL_TYPE_SGROUP,
2357 .state = WREPL_STATE_ACTIVE,
2358 .node = WREPL_NODE_B,
2360 .num_ips = ARRAY_SIZE(addresses_B_1),
2361 .ips = addresses_B_1,
2362 .apply_expected = True
2366 .type = WREPL_TYPE_UNIQUE,
2367 .state = WREPL_STATE_ACTIVE,
2368 .node = WREPL_NODE_B,
2370 .num_ips = ARRAY_SIZE(addresses_B_1),
2371 .ips = addresses_B_1,
2372 .apply_expected = False
2377 * sgroup,active vs. unique,tombstone
2378 * => should NOT be replaced
2381 .line = __location__,
2382 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2385 .type = WREPL_TYPE_SGROUP,
2386 .state = WREPL_STATE_ACTIVE,
2387 .node = WREPL_NODE_B,
2389 .num_ips = ARRAY_SIZE(addresses_B_1),
2390 .ips = addresses_B_1,
2391 .apply_expected = True
2395 .type = WREPL_TYPE_UNIQUE,
2396 .state = WREPL_STATE_TOMBSTONE,
2397 .node = WREPL_NODE_B,
2399 .num_ips = ARRAY_SIZE(addresses_B_1),
2400 .ips = addresses_B_1,
2401 .apply_expected = False
2406 * sgroup,released vs. unique,active
2407 * => should be replaced
2410 .line = __location__,
2411 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2414 .type = WREPL_TYPE_SGROUP,
2415 .state = WREPL_STATE_RELEASED,
2416 .node = WREPL_NODE_B,
2418 .num_ips = ARRAY_SIZE(addresses_B_1),
2419 .ips = addresses_B_1,
2420 .apply_expected = False
2424 .type = WREPL_TYPE_UNIQUE,
2425 .state = WREPL_STATE_ACTIVE,
2426 .node = WREPL_NODE_B,
2428 .num_ips = ARRAY_SIZE(addresses_A_1),
2429 .ips = addresses_A_1,
2430 .apply_expected = True
2435 * sgroup,released vs. unique,tombstone
2436 * => should be replaced
2439 .line = __location__,
2440 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2443 .type = WREPL_TYPE_SGROUP,
2444 .state = WREPL_STATE_RELEASED,
2445 .node = WREPL_NODE_B,
2447 .num_ips = ARRAY_SIZE(addresses_A_1),
2448 .ips = addresses_A_1,
2449 .apply_expected = False
2453 .type = WREPL_TYPE_UNIQUE,
2454 .state = WREPL_STATE_TOMBSTONE,
2455 .node = WREPL_NODE_B,
2457 .num_ips = ARRAY_SIZE(addresses_B_1),
2458 .ips = addresses_B_1,
2459 .apply_expected = True
2464 * sgroup,tombstone vs. unique,active
2465 * => should be replaced
2468 .line = __location__,
2469 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2472 .type = WREPL_TYPE_SGROUP,
2473 .state = WREPL_STATE_TOMBSTONE,
2474 .node = WREPL_NODE_B,
2476 .num_ips = ARRAY_SIZE(addresses_A_1),
2477 .ips = addresses_A_1,
2478 .apply_expected = True
2482 .type = WREPL_TYPE_UNIQUE,
2483 .state = WREPL_STATE_ACTIVE,
2484 .node = WREPL_NODE_B,
2486 .num_ips = ARRAY_SIZE(addresses_B_1),
2487 .ips = addresses_B_1,
2488 .apply_expected = True
2493 * sgroup,tombstone vs. unique,tombstone
2494 * => should be replaced
2497 .line = __location__,
2498 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2501 .type = WREPL_TYPE_SGROUP,
2502 .state = WREPL_STATE_TOMBSTONE,
2503 .node = WREPL_NODE_B,
2505 .num_ips = ARRAY_SIZE(addresses_B_1),
2506 .ips = addresses_B_1,
2507 .apply_expected = True
2511 .type = WREPL_TYPE_UNIQUE,
2512 .state = WREPL_STATE_TOMBSTONE,
2513 .node = WREPL_NODE_B,
2515 .num_ips = ARRAY_SIZE(addresses_A_1),
2516 .ips = addresses_A_1,
2517 .apply_expected = True
2522 * special groups vs normal group section,
2525 * sgroup,active vs. group,active
2526 * => should NOT be replaced
2529 .line = __location__,
2530 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2533 .type = WREPL_TYPE_SGROUP,
2534 .state = WREPL_STATE_ACTIVE,
2535 .node = WREPL_NODE_B,
2537 .num_ips = ARRAY_SIZE(addresses_A_1),
2538 .ips = addresses_A_1,
2539 .apply_expected = True
2543 .type = WREPL_TYPE_GROUP,
2544 .state = WREPL_STATE_ACTIVE,
2545 .node = WREPL_NODE_B,
2547 .num_ips = ARRAY_SIZE(addresses_A_1),
2548 .ips = addresses_A_1,
2549 .apply_expected = False
2554 * sgroup,active vs. group,tombstone
2555 * => should NOT be replaced
2558 .line = __location__,
2559 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2562 .type = WREPL_TYPE_SGROUP,
2563 .state = WREPL_STATE_ACTIVE,
2564 .node = WREPL_NODE_B,
2566 .num_ips = ARRAY_SIZE(addresses_A_1),
2567 .ips = addresses_A_1,
2568 .apply_expected = True
2572 .type = WREPL_TYPE_GROUP,
2573 .state = WREPL_STATE_TOMBSTONE,
2574 .node = WREPL_NODE_B,
2576 .num_ips = ARRAY_SIZE(addresses_A_1),
2577 .ips = addresses_A_1,
2578 .apply_expected = False
2583 * sgroup,released vs. group,active
2584 * => should be replaced
2587 .line = __location__,
2588 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2591 .type = WREPL_TYPE_SGROUP,
2592 .state = WREPL_STATE_RELEASED,
2593 .node = WREPL_NODE_B,
2595 .num_ips = ARRAY_SIZE(addresses_A_1),
2596 .ips = addresses_A_1,
2597 .apply_expected = False
2601 .type = WREPL_TYPE_GROUP,
2602 .state = WREPL_STATE_ACTIVE,
2603 .node = WREPL_NODE_B,
2605 .num_ips = ARRAY_SIZE(addresses_B_1),
2606 .ips = addresses_B_1,
2607 .apply_expected = True
2612 * sgroup,released vs. group,tombstone
2613 * => should be replaced
2616 .line = __location__,
2617 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2620 .type = WREPL_TYPE_SGROUP,
2621 .state = WREPL_STATE_RELEASED,
2622 .node = WREPL_NODE_B,
2624 .num_ips = ARRAY_SIZE(addresses_B_1),
2625 .ips = addresses_B_1,
2626 .apply_expected = False
2630 .type = WREPL_TYPE_GROUP,
2631 .state = WREPL_STATE_TOMBSTONE,
2632 .node = WREPL_NODE_B,
2634 .num_ips = ARRAY_SIZE(addresses_A_1),
2635 .ips = addresses_A_1,
2636 .apply_expected = True
2641 * sgroup,tombstone vs. group,active
2642 * => should NOT be replaced
2645 .line = __location__,
2646 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2649 .type = WREPL_TYPE_SGROUP,
2650 .state = WREPL_STATE_TOMBSTONE,
2651 .node = WREPL_NODE_B,
2653 .num_ips = ARRAY_SIZE(addresses_A_1),
2654 .ips = addresses_A_1,
2655 .apply_expected = True
2659 .type = WREPL_TYPE_GROUP,
2660 .state = WREPL_STATE_ACTIVE,
2661 .node = WREPL_NODE_B,
2663 .num_ips = ARRAY_SIZE(addresses_B_1),
2664 .ips = addresses_B_1,
2665 .apply_expected = True
2670 * sgroup,tombstone vs. group,tombstone
2671 * => should NOT be replaced
2674 .line = __location__,
2675 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2678 .type = WREPL_TYPE_SGROUP,
2679 .state = WREPL_STATE_TOMBSTONE,
2680 .node = WREPL_NODE_B,
2682 .num_ips = ARRAY_SIZE(addresses_B_1),
2683 .ips = addresses_B_1,
2684 .apply_expected = True
2688 .type = WREPL_TYPE_GROUP,
2689 .state = WREPL_STATE_TOMBSTONE,
2690 .node = WREPL_NODE_B,
2692 .num_ips = ARRAY_SIZE(addresses_A_1),
2693 .ips = addresses_A_1,
2694 .apply_expected = True
2699 * special groups vs multi homed section,
2702 * sgroup,active vs. mhomed,active
2703 * => should NOT be replaced
2706 .line = __location__,
2707 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2710 .type = WREPL_TYPE_SGROUP,
2711 .state = WREPL_STATE_ACTIVE,
2712 .node = WREPL_NODE_B,
2714 .num_ips = ARRAY_SIZE(addresses_A_1),
2715 .ips = addresses_A_1,
2716 .apply_expected = True
2720 .type = WREPL_TYPE_MHOMED,
2721 .state = WREPL_STATE_ACTIVE,
2722 .node = WREPL_NODE_B,
2724 .num_ips = ARRAY_SIZE(addresses_A_1),
2725 .ips = addresses_A_1,
2726 .apply_expected = False
2731 * sgroup,active vs. mhomed,tombstone
2732 * => should NOT be replaced
2735 .line = __location__,
2736 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2739 .type = WREPL_TYPE_SGROUP,
2740 .state = WREPL_STATE_ACTIVE,
2741 .node = WREPL_NODE_B,
2743 .num_ips = ARRAY_SIZE(addresses_A_1),
2744 .ips = addresses_A_1,
2745 .apply_expected = True
2749 .type = WREPL_TYPE_MHOMED,
2750 .state = WREPL_STATE_TOMBSTONE,
2751 .node = WREPL_NODE_B,
2753 .num_ips = ARRAY_SIZE(addresses_A_1),
2754 .ips = addresses_A_1,
2755 .apply_expected = False
2760 * sgroup,released vs. mhomed,active
2761 * => should be replaced
2764 .line = __location__,
2765 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2768 .type = WREPL_TYPE_SGROUP,
2769 .state = WREPL_STATE_RELEASED,
2770 .node = WREPL_NODE_B,
2772 .num_ips = ARRAY_SIZE(addresses_A_1),
2773 .ips = addresses_A_1,
2774 .apply_expected = False
2778 .type = WREPL_TYPE_MHOMED,
2779 .state = WREPL_STATE_ACTIVE,
2780 .node = WREPL_NODE_B,
2782 .num_ips = ARRAY_SIZE(addresses_B_1),
2783 .ips = addresses_B_1,
2784 .apply_expected = True
2789 * sgroup,released vs. mhomed,tombstone
2790 * => should be replaced
2793 .line = __location__,
2794 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2797 .type = WREPL_TYPE_SGROUP,
2798 .state = WREPL_STATE_RELEASED,
2799 .node = WREPL_NODE_B,
2801 .num_ips = ARRAY_SIZE(addresses_B_1),
2802 .ips = addresses_B_1,
2803 .apply_expected = False
2807 .type = WREPL_TYPE_MHOMED,
2808 .state = WREPL_STATE_TOMBSTONE,
2809 .node = WREPL_NODE_B,
2811 .num_ips = ARRAY_SIZE(addresses_A_1),
2812 .ips = addresses_A_1,
2813 .apply_expected = True
2818 * sgroup,tombstone vs. mhomed,active
2819 * => should be replaced
2822 .line = __location__,
2823 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2826 .type = WREPL_TYPE_SGROUP,
2827 .state = WREPL_STATE_TOMBSTONE,
2828 .node = WREPL_NODE_B,
2830 .num_ips = ARRAY_SIZE(addresses_A_1),
2831 .ips = addresses_A_1,
2832 .apply_expected = True
2836 .type = WREPL_TYPE_MHOMED,
2837 .state = WREPL_STATE_ACTIVE,
2838 .node = WREPL_NODE_B,
2840 .num_ips = ARRAY_SIZE(addresses_B_1),
2841 .ips = addresses_B_1,
2842 .apply_expected = True
2847 * sgroup,tombstone vs. mhomed,tombstone
2848 * => should be replaced
2851 .line = __location__,
2852 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2855 .type = WREPL_TYPE_SGROUP,
2856 .state = WREPL_STATE_TOMBSTONE,
2857 .node = WREPL_NODE_B,
2859 .num_ips = ARRAY_SIZE(addresses_B_1),
2860 .ips = addresses_B_1,
2861 .apply_expected = True
2865 .type = WREPL_TYPE_MHOMED,
2866 .state = WREPL_STATE_TOMBSTONE,
2867 .node = WREPL_NODE_B,
2869 .num_ips = ARRAY_SIZE(addresses_A_1),
2870 .ips = addresses_A_1,
2871 .apply_expected = True
2876 * multi homed vs. unique section,
2879 * mhomed,active vs. unique,active
2880 * => should be replaced
2883 .line = __location__,
2884 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2887 .type = WREPL_TYPE_MHOMED,
2888 .state = WREPL_STATE_ACTIVE,
2889 .node = WREPL_NODE_B,
2891 .num_ips = ARRAY_SIZE(addresses_A_3_4),
2892 .ips = addresses_A_3_4,
2893 .apply_expected = True
2897 .type = WREPL_TYPE_UNIQUE,
2898 .state = WREPL_STATE_ACTIVE,
2899 .node = WREPL_NODE_B,
2901 .num_ips = ARRAY_SIZE(addresses_B_1),
2902 .ips = addresses_B_1,
2903 .apply_expected = True
2908 * mhomed,active vs. unique,tombstone
2909 * => should NOT be replaced
2912 .line = __location__,
2913 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2916 .type = WREPL_TYPE_MHOMED,
2917 .state = WREPL_STATE_ACTIVE,
2918 .node = WREPL_NODE_B,
2920 .num_ips = ARRAY_SIZE(addresses_B_1),
2921 .ips = addresses_B_1,
2922 .apply_expected = True
2926 .type = WREPL_TYPE_UNIQUE,
2927 .state = WREPL_STATE_TOMBSTONE,
2928 .node = WREPL_NODE_B,
2930 .num_ips = ARRAY_SIZE(addresses_B_1),
2931 .ips = addresses_B_1,
2932 .apply_expected = False
2937 * mhomed,released vs. unique,active
2938 * => should be replaced
2941 .line = __location__,
2942 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2945 .type = WREPL_TYPE_MHOMED,
2946 .state = WREPL_STATE_RELEASED,
2947 .node = WREPL_NODE_B,
2949 .num_ips = ARRAY_SIZE(addresses_A_1),
2950 .ips = addresses_A_1,
2951 .apply_expected = False
2955 .type = WREPL_TYPE_UNIQUE,
2956 .state = WREPL_STATE_ACTIVE,
2957 .node = WREPL_NODE_B,
2959 .num_ips = ARRAY_SIZE(addresses_B_1),
2960 .ips = addresses_B_1,
2961 .apply_expected = True
2966 * mhomed,released vs. uinique,tombstone
2967 * => should be replaced
2970 .line = __location__,
2971 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2974 .type = WREPL_TYPE_MHOMED,
2975 .state = WREPL_STATE_RELEASED,
2976 .node = WREPL_NODE_B,
2978 .num_ips = ARRAY_SIZE(addresses_B_1),
2979 .ips = addresses_B_1,
2980 .apply_expected = False
2984 .type = WREPL_TYPE_UNIQUE,
2985 .state = WREPL_STATE_TOMBSTONE,
2986 .node = WREPL_NODE_B,
2988 .num_ips = ARRAY_SIZE(addresses_A_1),
2989 .ips = addresses_A_1,
2990 .apply_expected = True
2995 * mhomed,tombstone vs. unique,active
2996 * => should be replaced
2999 .line = __location__,
3000 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3003 .type = WREPL_TYPE_MHOMED,
3004 .state = WREPL_STATE_TOMBSTONE,
3005 .node = WREPL_NODE_B,
3007 .num_ips = ARRAY_SIZE(addresses_A_1),
3008 .ips = addresses_A_1,
3009 .apply_expected = True
3013 .type = WREPL_TYPE_UNIQUE,
3014 .state = WREPL_STATE_ACTIVE,
3015 .node = WREPL_NODE_B,
3017 .num_ips = ARRAY_SIZE(addresses_B_1),
3018 .ips = addresses_B_1,
3019 .apply_expected = True
3024 * mhomed,tombstone vs. uinique,tombstone
3025 * => should be replaced
3028 .line = __location__,
3029 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3032 .type = WREPL_TYPE_MHOMED,
3033 .state = WREPL_STATE_TOMBSTONE,
3034 .node = WREPL_NODE_B,
3036 .num_ips = ARRAY_SIZE(addresses_B_1),
3037 .ips = addresses_B_1,
3038 .apply_expected = True
3042 .type = WREPL_TYPE_UNIQUE,
3043 .state = WREPL_STATE_TOMBSTONE,
3044 .node = WREPL_NODE_B,
3046 .num_ips = ARRAY_SIZE(addresses_A_1),
3047 .ips = addresses_A_1,
3048 .apply_expected = True
3053 * multi homed vs. normal group section,
3056 * mhomed,active vs. group,active
3057 * => should be replaced
3060 .line = __location__,
3061 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3064 .type = WREPL_TYPE_MHOMED,
3065 .state = WREPL_STATE_ACTIVE,
3066 .node = WREPL_NODE_B,
3068 .num_ips = ARRAY_SIZE(addresses_A_1),
3069 .ips = addresses_A_1,
3070 .apply_expected = True
3074 .type = WREPL_TYPE_GROUP,
3075 .state = WREPL_STATE_ACTIVE,
3076 .node = WREPL_NODE_B,
3078 .num_ips = ARRAY_SIZE(addresses_B_1),
3079 .ips = addresses_B_1,
3080 .apply_expected = True
3085 * mhomed,active vs. group,tombstone
3086 * => should NOT be replaced
3089 .line = __location__,
3090 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3093 .type = WREPL_TYPE_MHOMED,
3094 .state = WREPL_STATE_ACTIVE,
3095 .node = WREPL_NODE_B,
3097 .num_ips = ARRAY_SIZE(addresses_B_1),
3098 .ips = addresses_B_1,
3099 .apply_expected = True
3103 .type = WREPL_TYPE_GROUP,
3104 .state = WREPL_STATE_TOMBSTONE,
3105 .node = WREPL_NODE_B,
3107 .num_ips = ARRAY_SIZE(addresses_B_1),
3108 .ips = addresses_B_1,
3109 .apply_expected = False
3114 * mhomed,released vs. group,active
3115 * => should be replaced
3118 .line = __location__,
3119 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3122 .type = WREPL_TYPE_MHOMED,
3123 .state = WREPL_STATE_RELEASED,
3124 .node = WREPL_NODE_B,
3126 .num_ips = ARRAY_SIZE(addresses_B_1),
3127 .ips = addresses_B_1,
3128 .apply_expected = False
3132 .type = WREPL_TYPE_GROUP,
3133 .state = WREPL_STATE_ACTIVE,
3134 .node = WREPL_NODE_B,
3136 .num_ips = ARRAY_SIZE(addresses_A_1),
3137 .ips = addresses_A_1,
3138 .apply_expected = True
3143 * mhomed,released vs. group,tombstone
3144 * => should be replaced
3147 .line = __location__,
3148 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3151 .type = WREPL_TYPE_MHOMED,
3152 .state = WREPL_STATE_RELEASED,
3153 .node = WREPL_NODE_B,
3155 .num_ips = ARRAY_SIZE(addresses_A_1),
3156 .ips = addresses_A_1,
3157 .apply_expected = False
3161 .type = WREPL_TYPE_GROUP,
3162 .state = WREPL_STATE_TOMBSTONE,
3163 .node = WREPL_NODE_B,
3165 .num_ips = ARRAY_SIZE(addresses_B_1),
3166 .ips = addresses_B_1,
3167 .apply_expected = True
3172 * mhomed,tombstone vs. group,active
3173 * => should be replaced
3176 .line = __location__,
3177 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3180 .type = WREPL_TYPE_MHOMED,
3181 .state = WREPL_STATE_TOMBSTONE,
3182 .node = WREPL_NODE_B,
3184 .num_ips = ARRAY_SIZE(addresses_B_1),
3185 .ips = addresses_B_1,
3186 .apply_expected = True
3190 .type = WREPL_TYPE_GROUP,
3191 .state = WREPL_STATE_ACTIVE,
3192 .node = WREPL_NODE_B,
3194 .num_ips = ARRAY_SIZE(addresses_A_1),
3195 .ips = addresses_A_1,
3196 .apply_expected = True
3201 * mhomed,tombstone vs. group,tombstone
3202 * => should be replaced
3205 .line = __location__,
3206 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3209 .type = WREPL_TYPE_MHOMED,
3210 .state = WREPL_STATE_TOMBSTONE,
3211 .node = WREPL_NODE_B,
3213 .num_ips = ARRAY_SIZE(addresses_A_1),
3214 .ips = addresses_A_1,
3215 .apply_expected = True
3219 .type = WREPL_TYPE_GROUP,
3220 .state = WREPL_STATE_TOMBSTONE,
3221 .node = WREPL_NODE_B,
3223 .num_ips = ARRAY_SIZE(addresses_B_1),
3224 .ips = addresses_B_1,
3225 .apply_expected = True
3230 * multi homed vs. special group section,
3233 * mhomed,active vs. sgroup,active
3234 * => should NOT be replaced
3237 .line = __location__,
3238 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3241 .type = WREPL_TYPE_MHOMED,
3242 .state = WREPL_STATE_ACTIVE,
3243 .node = WREPL_NODE_B,
3245 .num_ips = ARRAY_SIZE(addresses_A_1),
3246 .ips = addresses_A_1,
3247 .apply_expected = True
3251 .type = WREPL_TYPE_SGROUP,
3252 .state = WREPL_STATE_ACTIVE,
3253 .node = WREPL_NODE_B,
3255 .num_ips = ARRAY_SIZE(addresses_A_1),
3256 .ips = addresses_A_1,
3257 .apply_expected = False
3262 * mhomed,active vs. sgroup,tombstone
3263 * => should NOT be replaced
3266 .line = __location__,
3267 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3270 .type = WREPL_TYPE_MHOMED,
3271 .state = WREPL_STATE_ACTIVE,
3272 .node = WREPL_NODE_B,
3274 .num_ips = ARRAY_SIZE(addresses_A_1),
3275 .ips = addresses_A_1,
3276 .apply_expected = True
3280 .type = WREPL_TYPE_SGROUP,
3281 .state = WREPL_STATE_TOMBSTONE,
3282 .node = WREPL_NODE_B,
3284 .num_ips = ARRAY_SIZE(addresses_A_1),
3285 .ips = addresses_A_1,
3286 .apply_expected = False
3291 * mhomed,released vs. sgroup,active
3292 * => should be replaced
3295 .line = __location__,
3296 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3299 .type = WREPL_TYPE_MHOMED,
3300 .state = WREPL_STATE_RELEASED,
3301 .node = WREPL_NODE_B,
3303 .num_ips = ARRAY_SIZE(addresses_A_1),
3304 .ips = addresses_A_1,
3305 .apply_expected = False
3309 .type = WREPL_TYPE_SGROUP,
3310 .state = WREPL_STATE_ACTIVE,
3311 .node = WREPL_NODE_B,
3313 .num_ips = ARRAY_SIZE(addresses_B_1),
3314 .ips = addresses_B_1,
3315 .apply_expected = True
3320 * mhomed,released vs. sgroup,tombstone
3321 * => should be replaced
3324 .line = __location__,
3325 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3328 .type = WREPL_TYPE_MHOMED,
3329 .state = WREPL_STATE_RELEASED,
3330 .node = WREPL_NODE_B,
3332 .num_ips = ARRAY_SIZE(addresses_B_1),
3333 .ips = addresses_B_1,
3334 .apply_expected = False
3338 .type = WREPL_TYPE_SGROUP,
3339 .state = WREPL_STATE_TOMBSTONE,
3340 .node = WREPL_NODE_B,
3342 .num_ips = ARRAY_SIZE(addresses_A_1),
3343 .ips = addresses_A_1,
3344 .apply_expected = True
3349 * mhomed,tombstone vs. sgroup,active
3350 * => should be replaced
3353 .line = __location__,
3354 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3357 .type = WREPL_TYPE_MHOMED,
3358 .state = WREPL_STATE_TOMBSTONE,
3359 .node = WREPL_NODE_B,
3361 .num_ips = ARRAY_SIZE(addresses_A_1),
3362 .ips = addresses_A_1,
3363 .apply_expected = True
3367 .type = WREPL_TYPE_SGROUP,
3368 .state = WREPL_STATE_ACTIVE,
3369 .node = WREPL_NODE_B,
3371 .num_ips = ARRAY_SIZE(addresses_B_1),
3372 .ips = addresses_B_1,
3373 .apply_expected = True
3378 * mhomed,tombstone vs. sgroup,tombstone
3379 * => should be replaced
3382 .line = __location__,
3383 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3386 .type = WREPL_TYPE_MHOMED,
3387 .state = WREPL_STATE_TOMBSTONE,
3388 .node = WREPL_NODE_B,
3390 .num_ips = ARRAY_SIZE(addresses_B_1),
3391 .ips = addresses_B_1,
3392 .apply_expected = True
3396 .type = WREPL_TYPE_SGROUP,
3397 .state = WREPL_STATE_TOMBSTONE,
3398 .node = WREPL_NODE_B,
3400 .num_ips = ARRAY_SIZE(addresses_A_1),
3401 .ips = addresses_A_1,
3402 .apply_expected = True
3407 * multi homed vs. mlti homed section,
3410 * mhomed,active vs. mhomed,active
3411 * => should be replaced
3414 .line = __location__,
3415 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3418 .type = WREPL_TYPE_MHOMED,
3419 .state = WREPL_STATE_ACTIVE,
3420 .node = WREPL_NODE_B,
3422 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3423 .ips = addresses_A_3_4,
3424 .apply_expected = True
3428 .type = WREPL_TYPE_MHOMED,
3429 .state = WREPL_STATE_ACTIVE,
3430 .node = WREPL_NODE_B,
3432 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3433 .ips = addresses_B_3_4,
3434 .apply_expected = True
3439 * mhomed,active vs. mhomed,tombstone
3440 * => should NOT be replaced
3443 .line = __location__,
3444 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3447 .type = WREPL_TYPE_MHOMED,
3448 .state = WREPL_STATE_ACTIVE,
3449 .node = WREPL_NODE_B,
3451 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3452 .ips = addresses_B_3_4,
3453 .apply_expected = True
3457 .type = WREPL_TYPE_MHOMED,
3458 .state = WREPL_STATE_TOMBSTONE,
3459 .node = WREPL_NODE_B,
3461 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3462 .ips = addresses_B_3_4,
3463 .apply_expected = False
3468 * mhomed,released vs. mhomed,active
3469 * => should be replaced
3472 .line = __location__,
3473 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3476 .type = WREPL_TYPE_MHOMED,
3477 .state = WREPL_STATE_RELEASED,
3478 .node = WREPL_NODE_B,
3480 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3481 .ips = addresses_B_3_4,
3482 .apply_expected = False
3486 .type = WREPL_TYPE_MHOMED,
3487 .state = WREPL_STATE_ACTIVE,
3488 .node = WREPL_NODE_B,
3490 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3491 .ips = addresses_A_3_4,
3492 .apply_expected = True
3497 * mhomed,released vs. mhomed,tombstone
3498 * => should be replaced
3501 .line = __location__,
3502 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3505 .type = WREPL_TYPE_MHOMED,
3506 .state = WREPL_STATE_RELEASED,
3507 .node = WREPL_NODE_B,
3509 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3510 .ips = addresses_A_3_4,
3511 .apply_expected = False
3515 .type = WREPL_TYPE_MHOMED,
3516 .state = WREPL_STATE_TOMBSTONE,
3517 .node = WREPL_NODE_B,
3519 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3520 .ips = addresses_B_3_4,
3521 .apply_expected = True
3526 * mhomed,tombstone vs. mhomed,active
3527 * => should be replaced
3530 .line = __location__,
3531 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3534 .type = WREPL_TYPE_MHOMED,
3535 .state = WREPL_STATE_TOMBSTONE,
3536 .node = WREPL_NODE_B,
3538 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3539 .ips = addresses_B_3_4,
3540 .apply_expected = True
3544 .type = WREPL_TYPE_MHOMED,
3545 .state = WREPL_STATE_ACTIVE,
3546 .node = WREPL_NODE_B,
3548 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3549 .ips = addresses_A_3_4,
3550 .apply_expected = True
3555 * mhomed,tombstone vs. mhomed,tombstone
3556 * => should be replaced
3559 .line = __location__,
3560 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3563 .type = WREPL_TYPE_MHOMED,
3564 .state = WREPL_STATE_TOMBSTONE,
3565 .node = WREPL_NODE_B,
3567 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3568 .ips = addresses_A_3_4,
3569 .apply_expected = True
3573 .type = WREPL_TYPE_MHOMED,
3574 .state = WREPL_STATE_TOMBSTONE,
3575 .node = WREPL_NODE_B,
3577 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3578 .ips = addresses_B_3_4,
3579 .apply_expected = True
3585 * special group vs special group section,
3588 * sgroup,active vs. sgroup,active
3589 * => should be merged
3592 .line = __location__,
3593 .name = _NBT_NAME("_DIFF_OWNER_SG", 0x00, NULL),
3597 .type = WREPL_TYPE_SGROUP,
3598 .state = WREPL_STATE_ACTIVE,
3599 .node = WREPL_NODE_B,
3601 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3602 .ips = addresses_A_3_4,
3603 .apply_expected = True,
3607 .type = WREPL_TYPE_SGROUP,
3608 .state = WREPL_STATE_ACTIVE,
3609 .node = WREPL_NODE_B,
3611 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3612 .ips = addresses_B_3_4,
3613 .apply_expected = False,
3614 .merge_expected = True
3618 .line = __location__,
3619 .name = _NBT_NAME("_DIFF_OWNER_SG", 0x00, NULL),
3623 .type = WREPL_TYPE_SGROUP,
3624 .state = WREPL_STATE_ACTIVE,
3625 .node = WREPL_NODE_B,
3629 .apply_expected = False
3633 .type = WREPL_TYPE_SGROUP,
3634 .state = WREPL_STATE_ACTIVE,
3635 .node = WREPL_NODE_B,
3639 .apply_expected = False,
3640 .merge_expected = False
3644 .line = __location__,
3645 .name = _NBT_NAME("_DIFF_OWNER_SG", 0x00, NULL),
3649 .type = WREPL_TYPE_SGROUP,
3650 .state = WREPL_STATE_ACTIVE,
3651 .node = WREPL_NODE_B,
3653 .num_ips = ARRAY_SIZE(addresses_A_1),
3654 .ips = addresses_A_1,
3655 .apply_expected = True
3659 .type = WREPL_TYPE_UNIQUE,
3660 .state = WREPL_STATE_TOMBSTONE,
3661 .node = WREPL_NODE_B,
3663 .num_ips = ARRAY_SIZE(addresses_A_1),
3664 .ips = addresses_A_1,
3665 .apply_expected = True
3670 * This should be the last record in this array,
3671 * we need to make sure the we leave a tombstoned unique entry
3675 .line = __location__,
3676 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3680 .type = WREPL_TYPE_UNIQUE,
3681 .state = WREPL_STATE_TOMBSTONE,
3682 .node = WREPL_NODE_B,
3684 .num_ips = ARRAY_SIZE(addresses_A_1),
3685 .ips = addresses_A_1,
3686 .apply_expected = True
3690 .type = WREPL_TYPE_UNIQUE,
3691 .state = WREPL_STATE_TOMBSTONE,
3692 .node = WREPL_NODE_B,
3694 .num_ips = ARRAY_SIZE(addresses_A_1),
3695 .ips = addresses_A_1,
3696 .apply_expected = True
3698 }}; /* do not add entries here, this should be the last record! */
3700 if (!ctx) return False;
3702 wins_name_r1 = &wins_name1;
3703 wins_name_r2 = &wins_name2;
3705 printf("Test Replica Conflicts with different owners\n");
3707 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
3709 if (!records[i].extra && !records[i].cleanup) {
3710 /* we should test the worst cases */
3711 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
3712 printf("(%s) Programmer error, invalid record[%u]: %s\n",
3713 __location__, i, records[i].line);
3715 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
3716 printf("(%s) Programmer error, invalid record[%u]: %s\n",
3717 __location__, i, records[i].line);
3722 if (!records[i].cleanup) {
3723 const char *expected;
3726 if (records[i].r2.merge_expected) {
3728 } else if (records[i].r2.apply_expected) {
3729 expected = "REPLACE";
3731 expected = "NOT REPLACE";
3734 if (!records[i].r1.ips && !records[i].r2.ips) {
3736 } else if (records[i].r1.ips==records[i].r2.ips) {
3742 printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
3743 wrepl_name_type_string(records[i].r1.type),
3744 wrepl_name_state_string(records[i].r1.state),
3745 (records[i].r1.is_static?",static":""),
3746 wrepl_name_type_string(records[i].r2.type),
3747 wrepl_name_state_string(records[i].r2.state),
3748 (records[i].r2.is_static?",static":""),
3755 wins_name_r1->name = &records[i].name;
3756 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
3757 records[i].r1.state,
3759 records[i].r1.is_static);
3760 wins_name_r1->id = ++records[i].r1.owner->max_version;
3761 if (wins_name_r1->flags & 2) {
3762 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
3763 wins_name_r1->addresses.addresses.ips = discard_const(records[i].r1.ips);
3765 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
3767 wins_name_r1->unknown = "255.255.255.255";
3770 ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1);
3771 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
3772 wins_name_r1, records[i].r1.apply_expected);
3777 wins_name_r2->name = &records[i].name;
3778 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
3779 records[i].r2.state,
3781 records[i].r2.is_static);
3782 wins_name_r2->id = ++records[i].r2.owner->max_version;
3783 if (wins_name_r2->flags & 2) {
3784 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
3785 wins_name_r2->addresses.addresses.ips = discard_const(records[i].r2.ips);
3787 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
3789 wins_name_r2->unknown = "255.255.255.255";
3792 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
3793 if (records[i].r1.state == WREPL_STATE_RELEASED) {
3794 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
3795 wins_name_r1, False);
3796 } else if (records[i].r2.merge_expected) {
3797 ret &= test_wrepl_is_merged(ctx, wins_name_r1, wins_name_r2);
3798 } else if (records[i].r1.owner != records[i].r2.owner) {
3800 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
3801 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
3802 wins_name_r1, _expected);
3804 if (records[i].r2.state == WREPL_STATE_RELEASED) {
3805 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
3806 wins_name_r2, False);
3807 } else if (!records[i].r2.merge_expected) {
3808 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
3809 wins_name_r2, records[i].r2.apply_expected);
3812 /* the first one is a cleanup run */
3813 if (!ret && i == 0) ret = True;
3816 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
3824 static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_conn *ctx)
3828 struct wrepl_wins_name wins_name_;
3829 struct wrepl_wins_name *wins_name = &wins_name_;
3830 struct nbt_name_register name_register_;
3831 struct nbt_name_register *name_register = &name_register_;
3832 struct nbt_name_release release_;
3833 struct nbt_name_release *release = &release_;
3836 const char *line; /* just better debugging */
3837 struct nbt_name name;
3842 const struct wrepl_ip *ips;
3844 BOOL apply_expected;
3847 enum wrepl_name_type type;
3848 enum wrepl_name_state state;
3849 enum wrepl_name_node node;
3852 const struct wrepl_ip *ips;
3853 BOOL apply_expected;
3857 * unique,released vs. unique,active with same ip(s)
3860 .line = __location__,
3861 .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL),
3865 .num_ips = ctx->addresses_1_num,
3866 .ips = ctx->addresses_1,
3868 .apply_expected = True
3871 .type = WREPL_TYPE_UNIQUE,
3872 .state = WREPL_STATE_ACTIVE,
3873 .node = WREPL_NODE_B,
3875 .num_ips = ctx->addresses_1_num,
3876 .ips = ctx->addresses_1,
3877 .apply_expected = True
3881 * unique,released vs. unique,active with different ip(s)
3884 .line = __location__,
3885 .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL),
3889 .num_ips = ctx->addresses_1_num,
3890 .ips = ctx->addresses_1,
3892 .apply_expected = True
3895 .type = WREPL_TYPE_UNIQUE,
3896 .state = WREPL_STATE_ACTIVE,
3897 .node = WREPL_NODE_B,
3899 .num_ips = ARRAY_SIZE(addresses_B_1),
3900 .ips = addresses_B_1,
3901 .apply_expected = True
3905 * unique,released vs. unique,tombstone with same ip(s)
3908 .line = __location__,
3909 .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL),
3913 .num_ips = ctx->addresses_1_num,
3914 .ips = ctx->addresses_1,
3916 .apply_expected = True
3919 .type = WREPL_TYPE_UNIQUE,
3920 .state = WREPL_STATE_TOMBSTONE,
3921 .node = WREPL_NODE_B,
3923 .num_ips = ctx->addresses_1_num,
3924 .ips = ctx->addresses_1,
3925 .apply_expected = True
3929 * unique,released vs. unique,tombstone with different ip(s)
3932 .line = __location__,
3933 .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL),
3937 .num_ips = ctx->addresses_1_num,
3938 .ips = ctx->addresses_1,
3940 .apply_expected = True
3943 .type = WREPL_TYPE_UNIQUE,
3944 .state = WREPL_STATE_TOMBSTONE,
3945 .node = WREPL_NODE_B,
3947 .num_ips = ARRAY_SIZE(addresses_B_1),
3948 .ips = addresses_B_1,
3949 .apply_expected = True
3953 * unique,released vs. group,active with same ip(s)
3956 .line = __location__,
3957 .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL),
3961 .num_ips = ctx->addresses_1_num,
3962 .ips = ctx->addresses_1,
3964 .apply_expected = True
3967 .type = WREPL_TYPE_GROUP,
3968 .state = WREPL_STATE_ACTIVE,
3969 .node = WREPL_NODE_B,
3971 .num_ips = ctx->addresses_1_num,
3972 .ips = ctx->addresses_1,
3973 .apply_expected = True
3977 * unique,released vs. group,active with different ip(s)
3980 .line = __location__,
3981 .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL),
3985 .num_ips = ctx->addresses_1_num,
3986 .ips = ctx->addresses_1,
3988 .apply_expected = True
3991 .type = WREPL_TYPE_GROUP,
3992 .state = WREPL_STATE_ACTIVE,
3993 .node = WREPL_NODE_B,
3995 .num_ips = ARRAY_SIZE(addresses_B_1),
3996 .ips = addresses_B_1,
3997 .apply_expected = True
4001 * unique,released vs. group,tombstone with same ip(s)
4004 .line = __location__,
4005 .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL),
4009 .num_ips = ctx->addresses_1_num,
4010 .ips = ctx->addresses_1,
4012 .apply_expected = True
4015 .type = WREPL_TYPE_GROUP,
4016 .state = WREPL_STATE_TOMBSTONE,
4017 .node = WREPL_NODE_B,
4019 .num_ips = ctx->addresses_1_num,
4020 .ips = ctx->addresses_1,
4021 .apply_expected = True
4025 * unique,released vs. group,tombstone with different ip(s)
4028 .line = __location__,
4029 .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL),
4033 .num_ips = ctx->addresses_1_num,
4034 .ips = ctx->addresses_1,
4036 .apply_expected = True
4039 .type = WREPL_TYPE_GROUP,
4040 .state = WREPL_STATE_TOMBSTONE,
4041 .node = WREPL_NODE_B,
4043 .num_ips = ARRAY_SIZE(addresses_B_1),
4044 .ips = addresses_B_1,
4045 .apply_expected = True
4049 * unique,released vs. sgroup,active with same ip(s)
4052 .line = __location__,
4053 .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL),
4057 .num_ips = ctx->addresses_1_num,
4058 .ips = ctx->addresses_1,
4060 .apply_expected = True
4063 .type = WREPL_TYPE_SGROUP,
4064 .state = WREPL_STATE_ACTIVE,
4065 .node = WREPL_NODE_B,
4067 .num_ips = ctx->addresses_1_num,
4068 .ips = ctx->addresses_1,
4069 .apply_expected = True
4073 * unique,released vs. sgroup,active with different ip(s)
4076 .line = __location__,
4077 .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL),
4081 .num_ips = ctx->addresses_1_num,
4082 .ips = ctx->addresses_1,
4084 .apply_expected = True
4087 .type = WREPL_TYPE_SGROUP,
4088 .state = WREPL_STATE_ACTIVE,
4089 .node = WREPL_NODE_B,
4091 .num_ips = ARRAY_SIZE(addresses_B_1),
4092 .ips = addresses_B_1,
4093 .apply_expected = True
4097 * unique,released vs. sgroup,tombstone with same ip(s)
4100 .line = __location__,
4101 .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL),
4105 .num_ips = ctx->addresses_1_num,
4106 .ips = ctx->addresses_1,
4108 .apply_expected = True
4111 .type = WREPL_TYPE_SGROUP,
4112 .state = WREPL_STATE_TOMBSTONE,
4113 .node = WREPL_NODE_B,
4115 .num_ips = ctx->addresses_1_num,
4116 .ips = ctx->addresses_1,
4117 .apply_expected = True
4121 * unique,released vs. sgroup,tombstone with different ip(s)
4124 .line = __location__,
4125 .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL),
4129 .num_ips = ctx->addresses_1_num,
4130 .ips = ctx->addresses_1,
4132 .apply_expected = True
4135 .type = WREPL_TYPE_SGROUP,
4136 .state = WREPL_STATE_TOMBSTONE,
4137 .node = WREPL_NODE_B,
4139 .num_ips = ARRAY_SIZE(addresses_B_1),
4140 .ips = addresses_B_1,
4141 .apply_expected = True
4145 * unique,released vs. mhomed,active with same ip(s)
4148 .line = __location__,
4149 .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL),
4153 .num_ips = ctx->addresses_1_num,
4154 .ips = ctx->addresses_1,
4156 .apply_expected = True
4159 .type = WREPL_TYPE_MHOMED,
4160 .state = WREPL_STATE_ACTIVE,
4161 .node = WREPL_NODE_B,
4163 .num_ips = ctx->addresses_1_num,
4164 .ips = ctx->addresses_1,
4165 .apply_expected = True
4169 * unique,released vs. mhomed,active with different ip(s)
4172 .line = __location__,
4173 .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL),
4177 .num_ips = ctx->addresses_1_num,
4178 .ips = ctx->addresses_1,
4180 .apply_expected = True
4183 .type = WREPL_TYPE_MHOMED,
4184 .state = WREPL_STATE_ACTIVE,
4185 .node = WREPL_NODE_B,
4187 .num_ips = ARRAY_SIZE(addresses_B_1),
4188 .ips = addresses_B_1,
4189 .apply_expected = True
4193 * unique,released vs. mhomed,tombstone with same ip(s)
4196 .line = __location__,
4197 .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL),
4201 .num_ips = ctx->addresses_1_num,
4202 .ips = ctx->addresses_1,
4204 .apply_expected = True
4207 .type = WREPL_TYPE_MHOMED,
4208 .state = WREPL_STATE_TOMBSTONE,
4209 .node = WREPL_NODE_B,
4211 .num_ips = ctx->addresses_1_num,
4212 .ips = ctx->addresses_1,
4213 .apply_expected = True
4217 * unique,released vs. mhomed,tombstone with different ip(s)
4220 .line = __location__,
4221 .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL),
4225 .num_ips = ctx->addresses_1_num,
4226 .ips = ctx->addresses_1,
4228 .apply_expected = True
4231 .type = WREPL_TYPE_MHOMED,
4232 .state = WREPL_STATE_TOMBSTONE,
4233 .node = WREPL_NODE_B,
4235 .num_ips = ARRAY_SIZE(addresses_B_1),
4236 .ips = addresses_B_1,
4237 .apply_expected = True
4241 * group,released vs. unique,active with same ip(s)
4244 .line = __location__,
4245 .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL),
4247 .nb_flags = NBT_NM_GROUP,
4249 .num_ips = ctx->addresses_1_num,
4250 .ips = ctx->addresses_1,
4252 .apply_expected = True
4255 .type = WREPL_TYPE_UNIQUE,
4256 .state = WREPL_STATE_ACTIVE,
4257 .node = WREPL_NODE_B,
4259 .num_ips = ctx->addresses_1_num,
4260 .ips = ctx->addresses_1,
4261 .apply_expected = False
4265 * group,released vs. unique,active with different ip(s)
4268 .line = __location__,
4269 .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL),
4271 .nb_flags = NBT_NM_GROUP,
4273 .num_ips = ctx->addresses_1_num,
4274 .ips = ctx->addresses_1,
4276 .apply_expected = True
4279 .type = WREPL_TYPE_UNIQUE,
4280 .state = WREPL_STATE_ACTIVE,
4281 .node = WREPL_NODE_B,
4283 .num_ips = ARRAY_SIZE(addresses_B_1),
4284 .ips = addresses_B_1,
4285 .apply_expected = False
4289 * group,released vs. unique,tombstone with same ip(s)
4292 .line = __location__,
4293 .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL),
4295 .nb_flags = NBT_NM_GROUP,
4297 .num_ips = ctx->addresses_1_num,
4298 .ips = ctx->addresses_1,
4300 .apply_expected = True
4303 .type = WREPL_TYPE_UNIQUE,
4304 .state = WREPL_STATE_TOMBSTONE,
4305 .node = WREPL_NODE_B,
4307 .num_ips = ctx->addresses_1_num,
4308 .ips = ctx->addresses_1,
4309 .apply_expected = False
4313 * group,released vs. unique,tombstone with different ip(s)
4316 .line = __location__,
4317 .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL),
4319 .nb_flags = NBT_NM_GROUP,
4321 .num_ips = ctx->addresses_1_num,
4322 .ips = ctx->addresses_1,
4324 .apply_expected = True
4327 .type = WREPL_TYPE_UNIQUE,
4328 .state = WREPL_STATE_TOMBSTONE,
4329 .node = WREPL_NODE_B,
4331 .num_ips = ARRAY_SIZE(addresses_B_1),
4332 .ips = addresses_B_1,
4333 .apply_expected = False
4337 * group,released vs. group,active with same ip(s)
4340 .line = __location__,
4341 .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL),
4343 .nb_flags = NBT_NM_GROUP,
4345 .num_ips = ctx->addresses_1_num,
4346 .ips = ctx->addresses_1,
4348 .apply_expected = True
4351 .type = WREPL_TYPE_GROUP,
4352 .state = WREPL_STATE_ACTIVE,
4353 .node = WREPL_NODE_B,
4355 .num_ips = ctx->addresses_1_num,
4356 .ips = ctx->addresses_1,
4357 .apply_expected = True
4361 * group,released vs. group,active with different ip(s)
4364 .line = __location__,
4365 .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL),
4367 .nb_flags = NBT_NM_GROUP,
4369 .num_ips = ctx->addresses_1_num,
4370 .ips = ctx->addresses_1,
4372 .apply_expected = True
4375 .type = WREPL_TYPE_GROUP,
4376 .state = WREPL_STATE_ACTIVE,
4377 .node = WREPL_NODE_B,
4379 .num_ips = ARRAY_SIZE(addresses_B_1),
4380 .ips = addresses_B_1,
4381 .apply_expected = True
4385 * group,released vs. group,tombstone with same ip(s)
4388 .line = __location__,
4389 .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL),
4391 .nb_flags = NBT_NM_GROUP,
4393 .num_ips = ctx->addresses_1_num,
4394 .ips = ctx->addresses_1,
4396 .apply_expected = True
4399 .type = WREPL_TYPE_GROUP,
4400 .state = WREPL_STATE_TOMBSTONE,
4401 .node = WREPL_NODE_B,
4403 .num_ips = ctx->addresses_1_num,
4404 .ips = ctx->addresses_1,
4405 .apply_expected = True
4409 * group,released vs. group,tombstone with different ip(s)
4412 .line = __location__,
4413 .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL),
4415 .nb_flags = NBT_NM_GROUP,
4417 .num_ips = ctx->addresses_1_num,
4418 .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,released vs. sgroup,active with same ip(s)
4436 .line = __location__,
4437 .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL),
4439 .nb_flags = NBT_NM_GROUP,
4441 .num_ips = ctx->addresses_1_num,
4442 .ips = ctx->addresses_1,
4444 .apply_expected = True
4447 .type = WREPL_TYPE_SGROUP,
4448 .state = WREPL_STATE_ACTIVE,
4449 .node = WREPL_NODE_B,
4451 .num_ips = ctx->addresses_1_num,
4452 .ips = ctx->addresses_1,
4453 .apply_expected = False
4457 * group,released vs. sgroup,active with different ip(s)
4460 .line = __location__,
4461 .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL),
4463 .nb_flags = NBT_NM_GROUP,
4465 .num_ips = ctx->addresses_1_num,
4466 .ips = ctx->addresses_1,
4468 .apply_expected = True
4471 .type = WREPL_TYPE_SGROUP,
4472 .state = WREPL_STATE_ACTIVE,
4473 .node = WREPL_NODE_B,
4475 .num_ips = ARRAY_SIZE(addresses_B_1),
4476 .ips = addresses_B_1,
4477 .apply_expected = False
4481 * group,released vs. sgroup,tombstone with same ip(s)
4484 .line = __location__,
4485 .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL),
4487 .nb_flags = NBT_NM_GROUP,
4489 .num_ips = ctx->addresses_1_num,
4490 .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,
4516 .apply_expected = True
4519 .type = WREPL_TYPE_SGROUP,
4520 .state = WREPL_STATE_TOMBSTONE,
4521 .node = WREPL_NODE_B,
4523 .num_ips = ARRAY_SIZE(addresses_B_1),
4524 .ips = addresses_B_1,
4525 .apply_expected = False
4529 * group,released vs. mhomed,active with same ip(s)
4532 .line = __location__,
4533 .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL),
4535 .nb_flags = NBT_NM_GROUP,
4537 .num_ips = ctx->addresses_1_num,
4538 .ips = ctx->addresses_1,
4540 .apply_expected = True
4543 .type = WREPL_TYPE_MHOMED,
4544 .state = WREPL_STATE_ACTIVE,
4545 .node = WREPL_NODE_B,
4547 .num_ips = ctx->addresses_1_num,
4548 .ips = ctx->addresses_1,
4549 .apply_expected = False
4553 * group,released vs. mhomed,active with different ip(s)
4556 .line = __location__,
4557 .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL),
4559 .nb_flags = NBT_NM_GROUP,
4561 .num_ips = ctx->addresses_1_num,
4562 .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,
4588 .apply_expected = True
4591 .type = WREPL_TYPE_MHOMED,
4592 .state = WREPL_STATE_TOMBSTONE,
4593 .node = WREPL_NODE_B,
4595 .num_ips = ctx->addresses_1_num,
4596 .ips = ctx->addresses_1,
4597 .apply_expected = False
4601 * group,released vs. mhomed,tombstone with different ip(s)
4604 .line = __location__,
4605 .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL),
4607 .nb_flags = NBT_NM_GROUP,
4609 .num_ips = ctx->addresses_1_num,
4610 .ips = ctx->addresses_1,
4612 .apply_expected = True
4615 .type = WREPL_TYPE_MHOMED,
4616 .state = WREPL_STATE_TOMBSTONE,
4617 .node = WREPL_NODE_B,
4619 .num_ips = ARRAY_SIZE(addresses_B_1),
4620 .ips = addresses_B_1,
4621 .apply_expected = False
4625 * sgroup,released vs. unique,active with same ip(s)
4628 .line = __location__,
4629 .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL),
4631 .nb_flags = NBT_NM_GROUP,
4633 .num_ips = ctx->addresses_1_num,
4634 .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,
4660 .apply_expected = True
4663 .type = WREPL_TYPE_UNIQUE,
4664 .state = WREPL_STATE_ACTIVE,
4665 .node = WREPL_NODE_B,
4667 .num_ips = ARRAY_SIZE(addresses_B_1),
4668 .ips = addresses_B_1,
4669 .apply_expected = True
4673 * sgroup,released vs. unique,tombstone with same ip(s)
4676 .line = __location__,
4677 .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL),
4679 .nb_flags = NBT_NM_GROUP,
4681 .num_ips = ctx->addresses_1_num,
4682 .ips = ctx->addresses_1,
4684 .apply_expected = True
4687 .type = WREPL_TYPE_UNIQUE,
4688 .state = WREPL_STATE_TOMBSTONE,
4689 .node = WREPL_NODE_B,
4691 .num_ips = ctx->addresses_1_num,
4692 .ips = ctx->addresses_1,
4693 .apply_expected = True
4697 * sgroup,released vs. unique,tombstone with different ip(s)
4700 .line = __location__,
4701 .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL),
4703 .nb_flags = NBT_NM_GROUP,
4705 .num_ips = ctx->addresses_1_num,
4706 .ips = ctx->addresses_1,
4708 .apply_expected = True
4711 .type = WREPL_TYPE_UNIQUE,
4712 .state = WREPL_STATE_TOMBSTONE,
4713 .node = WREPL_NODE_B,
4715 .num_ips = ARRAY_SIZE(addresses_B_1),
4716 .ips = addresses_B_1,
4717 .apply_expected = True
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,
4732 .apply_expected = True
4735 .type = WREPL_TYPE_GROUP,
4736 .state = WREPL_STATE_ACTIVE,
4737 .node = WREPL_NODE_B,
4739 .num_ips = ctx->addresses_1_num,
4740 .ips = ctx->addresses_1,
4741 .apply_expected = True
4745 * sgroup,released vs. group,active with different ip(s)
4748 .line = __location__,
4749 .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL),
4751 .nb_flags = NBT_NM_GROUP,
4753 .num_ips = ctx->addresses_1_num,
4754 .ips = ctx->addresses_1,
4756 .apply_expected = True
4759 .type = WREPL_TYPE_GROUP,
4760 .state = WREPL_STATE_ACTIVE,
4761 .node = WREPL_NODE_B,
4763 .num_ips = ARRAY_SIZE(addresses_B_1),
4764 .ips = addresses_B_1,
4765 .apply_expected = True
4769 * sgroup,released vs. group,tombstone with same ip(s)
4772 .line = __location__,
4773 .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL),
4775 .nb_flags = NBT_NM_GROUP,
4777 .num_ips = ctx->addresses_1_num,
4778 .ips = ctx->addresses_1,
4780 .apply_expected = True
4783 .type = WREPL_TYPE_GROUP,
4784 .state = WREPL_STATE_TOMBSTONE,
4785 .node = WREPL_NODE_B,
4787 .num_ips = ctx->addresses_1_num,
4788 .ips = ctx->addresses_1,
4789 .apply_expected = True
4793 * sgroup,released vs. group,tombstone with different ip(s)
4796 .line = __location__,
4797 .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL),
4799 .nb_flags = NBT_NM_GROUP,
4801 .num_ips = ctx->addresses_1_num,
4802 .ips = ctx->addresses_1,
4804 .apply_expected = True
4807 .type = WREPL_TYPE_GROUP,
4808 .state = WREPL_STATE_TOMBSTONE,
4809 .node = WREPL_NODE_B,
4811 .num_ips = ARRAY_SIZE(addresses_B_1),
4812 .ips = addresses_B_1,
4813 .apply_expected = True
4817 * sgroup,released vs. sgroup,active with same ip(s)
4820 .line = __location__,
4821 .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL),
4823 .nb_flags = NBT_NM_GROUP,
4825 .num_ips = ctx->addresses_1_num,
4826 .ips = ctx->addresses_1,
4828 .apply_expected = True
4831 .type = WREPL_TYPE_SGROUP,
4832 .state = WREPL_STATE_ACTIVE,
4833 .node = WREPL_NODE_B,
4835 .num_ips = ctx->addresses_1_num,
4836 .ips = ctx->addresses_1,
4837 .apply_expected = True
4841 * sgroup,released vs. sgroup,active with different ip(s)
4844 .line = __location__,
4845 .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL),
4847 .nb_flags = NBT_NM_GROUP,
4849 .num_ips = ctx->addresses_1_num,
4850 .ips = ctx->addresses_1,
4852 .apply_expected = True
4855 .type = WREPL_TYPE_SGROUP,
4856 .state = WREPL_STATE_ACTIVE,
4857 .node = WREPL_NODE_B,
4859 .num_ips = ARRAY_SIZE(addresses_B_1),
4860 .ips = addresses_B_1,
4861 .apply_expected = True
4865 * sgroup,released vs. sgroup,tombstone with same ip(s)
4868 .line = __location__,
4869 .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL),
4871 .nb_flags = NBT_NM_GROUP,
4873 .num_ips = ctx->addresses_1_num,
4874 .ips = ctx->addresses_1,
4876 .apply_expected = True
4879 .type = WREPL_TYPE_SGROUP,
4880 .state = WREPL_STATE_TOMBSTONE,
4881 .node = WREPL_NODE_B,
4883 .num_ips = ctx->addresses_1_num,
4884 .ips = ctx->addresses_1,
4885 .apply_expected = True
4889 * sgroup,released vs. sgroup,tombstone with different ip(s)
4892 .line = __location__,
4893 .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL),
4895 .nb_flags = NBT_NM_GROUP,
4897 .num_ips = ctx->addresses_1_num,
4898 .ips = ctx->addresses_1,
4900 .apply_expected = True
4903 .type = WREPL_TYPE_SGROUP,
4904 .state = WREPL_STATE_TOMBSTONE,
4905 .node = WREPL_NODE_B,
4907 .num_ips = ARRAY_SIZE(addresses_B_1),
4908 .ips = addresses_B_1,
4909 .apply_expected = True
4913 * sgroup,released vs. mhomed,active with same ip(s)
4916 .line = __location__,
4917 .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL),
4919 .nb_flags = NBT_NM_GROUP,
4921 .num_ips = ctx->addresses_1_num,
4922 .ips = ctx->addresses_1,
4924 .apply_expected = True
4927 .type = WREPL_TYPE_MHOMED,
4928 .state = WREPL_STATE_ACTIVE,
4929 .node = WREPL_NODE_B,
4931 .num_ips = ctx->addresses_1_num,
4932 .ips = ctx->addresses_1,
4933 .apply_expected = True
4937 * sgroup,released vs. mhomed,active with different ip(s)
4940 .line = __location__,
4941 .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL),
4943 .nb_flags = NBT_NM_GROUP,
4945 .num_ips = ctx->addresses_1_num,
4946 .ips = ctx->addresses_1,
4948 .apply_expected = True
4951 .type = WREPL_TYPE_MHOMED,
4952 .state = WREPL_STATE_ACTIVE,
4953 .node = WREPL_NODE_B,
4955 .num_ips = ARRAY_SIZE(addresses_B_1),
4956 .ips = addresses_B_1,
4957 .apply_expected = True
4961 * sgroup,released vs. mhomed,tombstone with same ip(s)
4964 .line = __location__,
4965 .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL),
4967 .nb_flags = NBT_NM_GROUP,
4969 .num_ips = ctx->addresses_1_num,
4970 .ips = ctx->addresses_1,
4972 .apply_expected = True
4975 .type = WREPL_TYPE_MHOMED,
4976 .state = WREPL_STATE_TOMBSTONE,
4977 .node = WREPL_NODE_B,
4979 .num_ips = ctx->addresses_1_num,
4980 .ips = ctx->addresses_1,
4981 .apply_expected = True
4985 * sgroup,released vs. mhomed,tombstone with different ip(s)
4988 .line = __location__,
4989 .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL),
4991 .nb_flags = NBT_NM_GROUP,
4993 .num_ips = ctx->addresses_1_num,
4994 .ips = ctx->addresses_1,
4996 .apply_expected = True
4999 .type = WREPL_TYPE_MHOMED,
5000 .state = WREPL_STATE_TOMBSTONE,
5001 .node = WREPL_NODE_B,
5003 .num_ips = ARRAY_SIZE(addresses_B_1),
5004 .ips = addresses_B_1,
5005 .apply_expected = True
5009 * mhomed,released vs. unique,active with same ip(s)
5012 .line = __location__,
5013 .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL),
5017 .num_ips = ctx->addresses_1_num,
5018 .ips = ctx->addresses_1,
5020 .apply_expected = True
5023 .type = WREPL_TYPE_UNIQUE,
5024 .state = WREPL_STATE_ACTIVE,
5025 .node = WREPL_NODE_B,
5027 .num_ips = ctx->addresses_1_num,
5028 .ips = ctx->addresses_1,
5029 .apply_expected = True
5033 * mhomed,released vs. unique,active with different ip(s)
5036 .line = __location__,
5037 .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL),
5041 .num_ips = ctx->addresses_1_num,
5042 .ips = ctx->addresses_1,
5044 .apply_expected = True
5047 .type = WREPL_TYPE_UNIQUE,
5048 .state = WREPL_STATE_ACTIVE,
5049 .node = WREPL_NODE_B,
5051 .num_ips = ARRAY_SIZE(addresses_B_1),
5052 .ips = addresses_B_1,
5053 .apply_expected = True
5057 * mhomed,released vs. unique,tombstone with same ip(s)
5060 .line = __location__,
5061 .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL),
5065 .num_ips = ctx->addresses_1_num,
5066 .ips = ctx->addresses_1,
5068 .apply_expected = True
5071 .type = WREPL_TYPE_UNIQUE,
5072 .state = WREPL_STATE_TOMBSTONE,
5073 .node = WREPL_NODE_B,
5075 .num_ips = ctx->addresses_1_num,
5076 .ips = ctx->addresses_1,
5077 .apply_expected = True
5081 * mhomed,released vs. unique,tombstone with different ip(s)
5084 .line = __location__,
5085 .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL),
5089 .num_ips = ctx->addresses_1_num,
5090 .ips = ctx->addresses_1,
5092 .apply_expected = True
5095 .type = WREPL_TYPE_UNIQUE,
5096 .state = WREPL_STATE_TOMBSTONE,
5097 .node = WREPL_NODE_B,
5099 .num_ips = ARRAY_SIZE(addresses_B_1),
5100 .ips = addresses_B_1,
5101 .apply_expected = True
5105 * mhomed,released vs. group,active with same ip(s)
5108 .line = __location__,
5109 .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL),
5113 .num_ips = ctx->addresses_1_num,
5114 .ips = ctx->addresses_1,
5116 .apply_expected = True
5119 .type = WREPL_TYPE_GROUP,
5120 .state = WREPL_STATE_ACTIVE,
5121 .node = WREPL_NODE_B,
5123 .num_ips = ctx->addresses_1_num,
5124 .ips = ctx->addresses_1,
5125 .apply_expected = True
5129 * mhomed,released vs. group,active with different ip(s)
5132 .line = __location__,
5133 .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL),
5137 .num_ips = ctx->addresses_1_num,
5138 .ips = ctx->addresses_1,
5140 .apply_expected = True
5143 .type = WREPL_TYPE_GROUP,
5144 .state = WREPL_STATE_ACTIVE,
5145 .node = WREPL_NODE_B,
5147 .num_ips = ARRAY_SIZE(addresses_B_1),
5148 .ips = addresses_B_1,
5149 .apply_expected = True
5153 * mhomed,released vs. group,tombstone with same ip(s)
5156 .line = __location__,
5157 .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL),
5161 .num_ips = ctx->addresses_1_num,
5162 .ips = ctx->addresses_1,
5164 .apply_expected = True
5167 .type = WREPL_TYPE_GROUP,
5168 .state = WREPL_STATE_TOMBSTONE,
5169 .node = WREPL_NODE_B,
5171 .num_ips = ctx->addresses_1_num,
5172 .ips = ctx->addresses_1,
5173 .apply_expected = True
5177 * mhomed,released vs. group,tombstone with different ip(s)
5180 .line = __location__,
5181 .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL),
5185 .num_ips = ctx->addresses_1_num,
5186 .ips = ctx->addresses_1,
5188 .apply_expected = True
5191 .type = WREPL_TYPE_GROUP,
5192 .state = WREPL_STATE_TOMBSTONE,
5193 .node = WREPL_NODE_B,
5195 .num_ips = ARRAY_SIZE(addresses_B_1),
5196 .ips = addresses_B_1,
5197 .apply_expected = True
5201 * mhomed,released vs. sgroup,active with same ip(s)
5204 .line = __location__,
5205 .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL),
5209 .num_ips = ctx->addresses_1_num,
5210 .ips = ctx->addresses_1,
5212 .apply_expected = True
5215 .type = WREPL_TYPE_SGROUP,
5216 .state = WREPL_STATE_ACTIVE,
5217 .node = WREPL_NODE_B,
5219 .num_ips = ctx->addresses_1_num,
5220 .ips = ctx->addresses_1,
5221 .apply_expected = True
5225 * mhomed,released vs. sgroup,active with different ip(s)
5228 .line = __location__,
5229 .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL),
5233 .num_ips = ctx->addresses_1_num,
5234 .ips = ctx->addresses_1,
5236 .apply_expected = True
5239 .type = WREPL_TYPE_SGROUP,
5240 .state = WREPL_STATE_ACTIVE,
5241 .node = WREPL_NODE_B,
5243 .num_ips = ARRAY_SIZE(addresses_B_1),
5244 .ips = addresses_B_1,
5245 .apply_expected = True
5249 * mhomed,released vs. sgroup,tombstone with same ip(s)
5252 .line = __location__,
5253 .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL),
5257 .num_ips = ctx->addresses_1_num,
5258 .ips = ctx->addresses_1,
5260 .apply_expected = True
5263 .type = WREPL_TYPE_SGROUP,
5264 .state = WREPL_STATE_TOMBSTONE,
5265 .node = WREPL_NODE_B,
5267 .num_ips = ctx->addresses_1_num,
5268 .ips = ctx->addresses_1,
5269 .apply_expected = True
5273 * mhomed,released vs. sgroup,tombstone with different ip(s)
5276 .line = __location__,
5277 .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL),
5281 .num_ips = ctx->addresses_1_num,
5282 .ips = ctx->addresses_1,
5284 .apply_expected = True
5287 .type = WREPL_TYPE_SGROUP,
5288 .state = WREPL_STATE_TOMBSTONE,
5289 .node = WREPL_NODE_B,
5291 .num_ips = ARRAY_SIZE(addresses_B_1),
5292 .ips = addresses_B_1,
5293 .apply_expected = True
5297 * mhomed,released vs. mhomed,active with same ip(s)
5300 .line = __location__,
5301 .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL),
5305 .num_ips = ctx->addresses_1_num,
5306 .ips = ctx->addresses_1,
5308 .apply_expected = True
5311 .type = WREPL_TYPE_MHOMED,
5312 .state = WREPL_STATE_ACTIVE,
5313 .node = WREPL_NODE_B,
5315 .num_ips = ctx->addresses_1_num,
5316 .ips = ctx->addresses_1,
5317 .apply_expected = True
5321 * mhomed,released vs. mhomed,active with different ip(s)
5324 .line = __location__,
5325 .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL),
5329 .num_ips = ctx->addresses_1_num,
5330 .ips = ctx->addresses_1,
5332 .apply_expected = True
5335 .type = WREPL_TYPE_MHOMED,
5336 .state = WREPL_STATE_ACTIVE,
5337 .node = WREPL_NODE_B,
5339 .num_ips = ARRAY_SIZE(addresses_B_1),
5340 .ips = addresses_B_1,
5341 .apply_expected = True
5345 * mhomed,released vs. mhomed,tombstone with same ip(s)
5348 .line = __location__,
5349 .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL),
5353 .num_ips = ctx->addresses_1_num,
5354 .ips = ctx->addresses_1,
5356 .apply_expected = True
5359 .type = WREPL_TYPE_MHOMED,
5360 .state = WREPL_STATE_TOMBSTONE,
5361 .node = WREPL_NODE_B,
5363 .num_ips = ctx->addresses_1_num,
5364 .ips = ctx->addresses_1,
5365 .apply_expected = True
5369 * mhomed,released vs. mhomed,tombstone with different ip(s)
5372 .line = __location__,
5373 .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL),
5377 .num_ips = ctx->addresses_1_num,
5378 .ips = ctx->addresses_1,
5380 .apply_expected = True
5383 .type = WREPL_TYPE_MHOMED,
5384 .state = WREPL_STATE_TOMBSTONE,
5385 .node = WREPL_NODE_B,
5387 .num_ips = ARRAY_SIZE(addresses_B_1),
5388 .ips = addresses_B_1,
5389 .apply_expected = True
5394 if (!ctx) return False;
5396 printf("Test Replica records vs. owned released records\n");
5398 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
5399 printf("%s => %s\n", nbt_name_string(ctx, &records[i].name),
5400 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
5405 name_register->in.name = records[i].name;
5406 name_register->in.dest_addr = ctx->address;
5407 name_register->in.address = records[i].wins.ips[0].ip;
5408 name_register->in.nb_flags = records[i].wins.nb_flags;
5409 name_register->in.register_demand= False;
5410 name_register->in.broadcast = False;
5411 name_register->in.multi_homed = records[i].wins.mhomed;
5412 name_register->in.ttl = 300000;
5413 name_register->in.timeout = 70;
5414 name_register->in.retries = 0;
5416 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
5417 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
5418 printf("No response from %s for name register\n", ctx->address);
5421 if (!NT_STATUS_IS_OK(status)) {
5422 printf("Bad response from %s for name register - %s\n",
5423 ctx->address, nt_errstr(status));
5426 CHECK_VALUE(name_register->out.rcode, 0);
5427 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
5428 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
5429 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
5430 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
5431 CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[0].ip);
5433 if (records[i].wins.release) {
5434 release->in.name = records[i].name;
5435 release->in.dest_addr = ctx->address;
5436 release->in.address = records[i].wins.ips[0].ip;
5437 release->in.nb_flags = records[i].wins.nb_flags;
5438 release->in.broadcast = False;
5439 release->in.timeout = 30;
5440 release->in.retries = 0;
5442 status = nbt_name_release(ctx->nbtsock, ctx, release);
5443 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
5444 printf("No response from %s for name release\n", ctx->address);
5447 if (!NT_STATUS_IS_OK(status)) {
5448 printf("Bad response from %s for name query - %s\n",
5449 ctx->address, nt_errstr(status));
5452 CHECK_VALUE(release->out.rcode, 0);
5458 wins_name->name = &records[i].name;
5459 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
5460 records[i].replica.state,
5461 records[i].replica.node,
5462 records[i].replica.is_static);
5463 wins_name->id = ++ctx->b.max_version;
5464 if (wins_name->flags & 2) {
5465 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
5466 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
5468 wins_name->addresses.ip = records[i].replica.ips[0].ip;
5470 wins_name->unknown = "255.255.255.255";
5472 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
5473 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
5474 records[i].replica.apply_expected);
5476 if (records[i].replica.apply_expected) {
5477 wins_name->name = &records[i].name;
5478 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
5479 WREPL_STATE_TOMBSTONE,
5480 WREPL_NODE_B, False);
5481 wins_name->id = ++ctx->b.max_version;
5482 wins_name->addresses.ip = addresses_B_1[0].ip;
5483 wins_name->unknown = "255.255.255.255";
5485 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
5486 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
5488 release->in.name = records[i].name;
5489 release->in.dest_addr = ctx->address;
5490 release->in.address = records[i].wins.ips[0].ip;
5491 release->in.nb_flags = records[i].wins.nb_flags;
5492 release->in.broadcast = False;
5493 release->in.timeout = 30;
5494 release->in.retries = 0;
5496 status = nbt_name_release(ctx->nbtsock, ctx, release);
5497 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
5498 printf("No response from %s for name release\n", ctx->address);
5501 if (!NT_STATUS_IS_OK(status)) {
5502 printf("Bad response from %s for name query - %s\n",
5503 ctx->address, nt_errstr(status));
5506 CHECK_VALUE(release->out.rcode, 0);
5510 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
5518 static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_conn *ctx)
5522 struct wrepl_wins_name wins_name_;
5523 struct wrepl_wins_name *wins_name = &wins_name_;
5524 struct nbt_name_register name_register_;
5525 struct nbt_name_register *name_register = &name_register_;
5526 struct nbt_name_release release_;
5527 struct nbt_name_release *release = &release_;
5530 const char *line; /* just better debugging */
5531 struct nbt_name name;
5536 const struct wrepl_ip *ips;
5538 BOOL apply_expected;
5541 enum wrepl_name_type type;
5542 enum wrepl_name_state state;
5543 enum wrepl_name_node node;
5546 const struct wrepl_ip *ips;
5547 BOOL apply_expected;
5552 * unique,active vs. unique,active with same ip(s)
5555 .line = __location__,
5556 .name = _NBT_NAME("_UA_UA_SI", 0x00, NULL),
5560 .num_ips = ctx->addresses_1_num,
5561 .ips = ctx->addresses_1,
5563 .apply_expected = True
5566 .type = WREPL_TYPE_UNIQUE,
5567 .state = WREPL_STATE_ACTIVE,
5568 .node = WREPL_NODE_B,
5570 .num_ips = ctx->addresses_1_num,
5571 .ips = ctx->addresses_1,
5572 .apply_expected = True
5576 * unique,active vs. unique,active with different ip(s)
5579 .line = __location__,
5580 .name = _NBT_NAME("_UA_UA_DI", 0x00, NULL),
5584 .num_ips = ctx->addresses_1_num,
5585 .ips = ctx->addresses_1,
5587 .apply_expected = True
5590 .type = WREPL_TYPE_UNIQUE,
5591 .state = WREPL_STATE_ACTIVE,
5592 .node = WREPL_NODE_B,
5594 .num_ips = ARRAY_SIZE(addresses_B_1),
5595 .ips = addresses_B_1,
5596 .apply_expected = True
5600 * unique,active vs. unique,tombstone with same ip(s)
5603 .line = __location__,
5604 .name = _NBT_NAME("_UA_UT_SI", 0x00, NULL),
5608 .num_ips = ctx->addresses_1_num,
5609 .ips = ctx->addresses_1,
5611 .apply_expected = True
5614 .type = WREPL_TYPE_UNIQUE,
5615 .state = WREPL_STATE_TOMBSTONE,
5616 .node = WREPL_NODE_B,
5618 .num_ips = ctx->addresses_1_num,
5619 .ips = ctx->addresses_1,
5620 .apply_expected = False
5624 * unique,active vs. unique,tombstone with different ip(s)
5627 .line = __location__,
5628 .name = _NBT_NAME("_UA_UT_DI", 0x00, NULL),
5632 .num_ips = ctx->addresses_1_num,
5633 .ips = ctx->addresses_1,
5635 .apply_expected = True
5638 .type = WREPL_TYPE_UNIQUE,
5639 .state = WREPL_STATE_TOMBSTONE,
5640 .node = WREPL_NODE_B,
5642 .num_ips = ARRAY_SIZE(addresses_B_1),
5643 .ips = addresses_B_1,
5644 .apply_expected = True
5650 if (!ctx) return False;
5652 if (!ctx->nbt_root_port) {
5653 printf("SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
5658 printf("Test Replica records vs. owned active records\n");
5660 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
5661 printf("%s => %s\n", nbt_name_string(ctx, &records[i].name),
5662 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
5667 name_register->in.name = records[i].name;
5668 name_register->in.dest_addr = ctx->address;
5669 name_register->in.address = records[i].wins.ips[0].ip;
5670 name_register->in.nb_flags = records[i].wins.nb_flags;
5671 name_register->in.register_demand= False;
5672 name_register->in.broadcast = False;
5673 name_register->in.multi_homed = records[i].wins.mhomed;
5674 name_register->in.ttl = 300000;
5675 name_register->in.timeout = 70;
5676 name_register->in.retries = 0;
5678 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
5679 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
5680 printf("No response from %s for name register\n", ctx->address);
5683 if (!NT_STATUS_IS_OK(status)) {
5684 printf("Bad response from %s for name register - %s\n",
5685 ctx->address, nt_errstr(status));
5688 CHECK_VALUE(name_register->out.rcode, 0);
5689 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
5690 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
5691 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
5692 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
5693 CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[0].ip);
5695 if (records[i].wins.release) {
5696 release->in.name = records[i].name;
5697 release->in.dest_addr = ctx->address;
5698 release->in.address = records[i].wins.ips[0].ip;
5699 release->in.nb_flags = records[i].wins.nb_flags;
5700 release->in.broadcast = False;
5701 release->in.timeout = 30;
5702 release->in.retries = 0;
5704 status = nbt_name_release(ctx->nbtsock, ctx, release);
5705 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
5706 printf("No response from %s for name release\n", ctx->address);
5709 if (!NT_STATUS_IS_OK(status)) {
5710 printf("Bad response from %s for name query - %s\n",
5711 ctx->address, nt_errstr(status));
5714 CHECK_VALUE(release->out.rcode, 0);
5720 wins_name->name = &records[i].name;
5721 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
5722 records[i].replica.state,
5723 records[i].replica.node,
5724 records[i].replica.is_static);
5725 wins_name->id = ++ctx->b.max_version;
5726 if (wins_name->flags & 2) {
5727 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
5728 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
5730 wins_name->addresses.ip = records[i].replica.ips[0].ip;
5732 wins_name->unknown = "255.255.255.255";
5734 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
5735 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
5736 records[i].replica.apply_expected);
5738 if (records[i].replica.apply_expected) {
5739 wins_name->name = &records[i].name;
5740 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
5741 WREPL_STATE_TOMBSTONE,
5742 WREPL_NODE_B, False);
5743 wins_name->id = ++ctx->b.max_version;
5744 wins_name->addresses.ip = addresses_B_1[0].ip;
5745 wins_name->unknown = "255.255.255.255";
5747 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
5748 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
5750 release->in.name = records[i].name;
5751 release->in.dest_addr = ctx->address;
5752 release->in.address = records[i].wins.ips[0].ip;
5753 release->in.nb_flags = records[i].wins.nb_flags;
5754 release->in.broadcast = False;
5755 release->in.timeout = 30;
5756 release->in.retries = 0;
5758 status = nbt_name_release(ctx->nbtsock, ctx, release);
5759 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
5760 printf("No response from %s for name release\n", ctx->address);
5763 if (!NT_STATUS_IS_OK(status)) {
5764 printf("Bad response from %s for name query - %s\n",
5765 ctx->address, nt_errstr(status));
5768 CHECK_VALUE(release->out.rcode, 0);
5772 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
5782 test WINS replication operations
5784 BOOL torture_nbt_winsreplication_quick(void)
5786 const char *address;
5787 struct nbt_name name;
5788 TALLOC_CTX *mem_ctx = talloc_new(NULL);
5792 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
5794 /* do an initial name resolution to find its IP */
5795 status = resolve_name(&name, mem_ctx, &address, NULL);
5796 if (!NT_STATUS_IS_OK(status)) {
5797 printf("Failed to resolve %s - %s\n",
5798 name.name, nt_errstr(status));
5799 talloc_free(mem_ctx);
5803 ret &= test_assoc_ctx1(mem_ctx, address);
5804 ret &= test_assoc_ctx2(mem_ctx, address);
5806 talloc_free(mem_ctx);
5812 test WINS replication operations
5814 BOOL torture_nbt_winsreplication(void)
5816 const char *address;
5817 struct nbt_name name;
5818 TALLOC_CTX *mem_ctx = talloc_new(NULL);
5821 struct test_wrepl_conflict_conn *ctx;
5823 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
5825 /* do an initial name resolution to find its IP */
5826 status = resolve_name(&name, mem_ctx, &address, NULL);
5827 if (!NT_STATUS_IS_OK(status)) {
5828 printf("Failed to resolve %s - %s\n",
5829 name.name, nt_errstr(status));
5830 talloc_free(mem_ctx);
5834 ret &= test_assoc_ctx1(mem_ctx, address);
5835 ret &= test_assoc_ctx2(mem_ctx, address);
5837 ret &= test_wins_replication(mem_ctx, address);
5839 ctx = test_create_conflict_ctx(mem_ctx, address);
5841 ret &= test_conflict_same_owner(ctx);
5842 ret &= test_conflict_different_owner(ctx);
5843 ret &= test_conflict_owned_released_vs_replica(ctx);
5844 ret &= test_conflict_owned_active_vs_replica(ctx);
5846 talloc_free(mem_ctx);