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"
27 #define CHECK_STATUS(status, correct) do { \
28 if (!NT_STATUS_EQUAL(status, correct)) { \
29 printf("(%s) Incorrect status %s - should be %s\n", \
30 __location__, nt_errstr(status), nt_errstr(correct)); \
35 #define CHECK_VALUE(v, correct) do { \
36 if ((v) != (correct)) { \
37 printf("(%s) Incorrect value %s=%d - should be %d\n", \
38 __location__, #v, v, correct); \
43 #define CHECK_VALUE_UINT64(v, correct) do { \
44 if ((v) != (correct)) { \
45 printf("(%s) Incorrect value %s=%llu - should be %llu\n", \
46 __location__, #v, v, correct); \
51 #define CHECK_VALUE_STRING(v, correct) do { \
52 if ( ((!v) && (correct)) || \
53 ((v) && (!correct)) || \
54 ((v) && (correct) && strcmp(v,correct) != 0)) { \
55 printf("(%s) Incorrect value %s='%s' - should be '%s'\n", \
56 __location__, #v, v, correct); \
61 #define _NBT_NAME(n,t,s) {\
67 static const char *wrepl_name_type_string(enum wrepl_name_type type)
70 case WREPL_TYPE_UNIQUE: return "UNIQUE";
71 case WREPL_TYPE_GROUP: return "GROUP";
72 case WREPL_TYPE_SGROUP: return "SGROUP";
73 case WREPL_TYPE_MHOMED: return "MHOMED";
75 return "UNKNOWN_TYPE";
78 static const char *wrepl_name_state_string(enum wrepl_name_state state)
81 case WREPL_STATE_ACTIVE: return "ACTIVE";
82 case WREPL_STATE_RELEASED: return "RELEASED";
83 case WREPL_STATE_TOMBSTONE: return "TOMBSTONE";
84 case WREPL_STATE_RESERVED: return "RESERVED";
86 return "UNKNOWN_STATE";
90 test how assoc_ctx's are only usable on the connection
93 static BOOL test_assoc_ctx1(TALLOC_CTX *mem_ctx, const char *address)
96 struct wrepl_request *req;
97 struct wrepl_socket *wrepl_socket1;
98 struct wrepl_associate associate1;
99 struct wrepl_socket *wrepl_socket2;
100 struct wrepl_associate associate2;
101 struct wrepl_pull_table pull_table;
102 struct wrepl_packet *rep_packet;
103 struct wrepl_associate_stop assoc_stop;
106 if (!lp_parm_bool(-1, "torture", "dangerous", False)) {
107 printf("winsrepl: cross connection assoc_ctx usage disabled - enable dangerous tests to use\n");
111 printf("Test if assoc_ctx is only valid on the conection it was created on\n");
113 wrepl_socket1 = wrepl_socket_init(mem_ctx, NULL);
114 wrepl_socket2 = wrepl_socket_init(mem_ctx, NULL);
116 printf("Setup 2 wrepl connections\n");
117 status = wrepl_connect(wrepl_socket1, NULL, address);
118 CHECK_STATUS(status, NT_STATUS_OK);
120 status = wrepl_connect(wrepl_socket2, NULL, address);
121 CHECK_STATUS(status, NT_STATUS_OK);
123 printf("Send a start association request (conn1)\n");
124 status = wrepl_associate(wrepl_socket1, &associate1);
125 CHECK_STATUS(status, NT_STATUS_OK);
127 printf("association context (conn1): 0x%x\n", associate1.out.assoc_ctx);
129 printf("Send a start association request (conn2)\n");
130 status = wrepl_associate(wrepl_socket2, &associate2);
131 CHECK_STATUS(status, NT_STATUS_OK);
133 printf("association context (conn2): 0x%x\n", associate2.out.assoc_ctx);
135 printf("Send a replication table query, with assoc 1 (conn2), the anwser should be on conn1\n");
136 pull_table.in.assoc_ctx = associate1.out.assoc_ctx;
137 req = wrepl_pull_table_send(wrepl_socket2, &pull_table);
138 req->send_only = True;
139 status = wrepl_request_recv(req, mem_ctx, &rep_packet);
140 CHECK_STATUS(status, NT_STATUS_OK);
142 printf("Send a association request (conn2), to make sure the last request was ignored\n");
143 status = wrepl_associate(wrepl_socket2, &associate2);
144 CHECK_STATUS(status, NT_STATUS_OK);
146 printf("Send a replication table query, with invalid assoc (conn1), receive answer from conn2\n");
147 pull_table.in.assoc_ctx = 0;
148 req = wrepl_pull_table_send(wrepl_socket1, &pull_table);
149 status = wrepl_request_recv(req, mem_ctx, &rep_packet);
150 CHECK_STATUS(status, NT_STATUS_OK);
152 printf("Send a association request (conn1), to make sure the last request was handled correct\n");
153 status = wrepl_associate(wrepl_socket1, &associate2);
154 CHECK_STATUS(status, NT_STATUS_OK);
156 assoc_stop.in.assoc_ctx = associate1.out.assoc_ctx;
157 assoc_stop.in.reason = 4;
158 printf("Send a association stop request (conn1), reson: %u\n", assoc_stop.in.reason);
159 status = wrepl_associate_stop(wrepl_socket1, &assoc_stop);
160 CHECK_STATUS(status, NT_STATUS_END_OF_FILE);
162 assoc_stop.in.assoc_ctx = associate2.out.assoc_ctx;
163 assoc_stop.in.reason = 0;
164 printf("Send a association stop request (conn2), reson: %u\n", assoc_stop.in.reason);
165 status = wrepl_associate_stop(wrepl_socket2, &assoc_stop);
166 CHECK_STATUS(status, NT_STATUS_OK);
169 printf("Close 2 wrepl connections\n");
170 talloc_free(wrepl_socket1);
171 talloc_free(wrepl_socket2);
176 test if we always get back the same assoc_ctx
178 static BOOL test_assoc_ctx2(TALLOC_CTX *mem_ctx, const char *address)
181 struct wrepl_socket *wrepl_socket;
182 struct wrepl_associate associate;
186 printf("Test if we always get back the same assoc_ctx\n");
188 wrepl_socket = wrepl_socket_init(mem_ctx, NULL);
190 printf("Setup wrepl connections\n");
191 status = wrepl_connect(wrepl_socket, NULL, address);
192 CHECK_STATUS(status, NT_STATUS_OK);
195 printf("Send 1st start association request\n");
196 status = wrepl_associate(wrepl_socket, &associate);
197 CHECK_STATUS(status, NT_STATUS_OK);
198 assoc_ctx1 = associate.out.assoc_ctx;
199 printf("1st association context: 0x%x\n", associate.out.assoc_ctx);
201 printf("Send 2nd start association request\n");
202 status = wrepl_associate(wrepl_socket, &associate);
203 CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1);
204 CHECK_STATUS(status, NT_STATUS_OK);
205 printf("2nd association context: 0x%x\n", associate.out.assoc_ctx);
207 printf("Send 3rd start association request\n");
208 status = wrepl_associate(wrepl_socket, &associate);
209 CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1);
210 CHECK_STATUS(status, NT_STATUS_OK);
211 printf("3rd association context: 0x%x\n", associate.out.assoc_ctx);
214 printf("Close wrepl connections\n");
215 talloc_free(wrepl_socket);
221 display a replication entry
223 static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_name *name)
227 printf("%s\n", nbt_name_string(mem_ctx, &name->name));
228 printf("\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n",
229 name->type, name->state, name->node, name->is_static, name->version_id);
230 printf("\tRAW_FLAGS: 0x%08X OWNER: %-15s\n",
231 name->raw_flags, name->owner);
232 for (i=0;i<name->num_addresses;i++) {
233 printf("\tADDR: %-15s OWNER: %-15s\n",
234 name->addresses[i].address, name->addresses[i].owner);
239 test a full replication dump from a WINS server
241 static BOOL test_wins_replication(TALLOC_CTX *mem_ctx, const char *address)
244 struct wrepl_socket *wrepl_socket;
247 struct wrepl_associate associate;
248 struct wrepl_pull_table pull_table;
249 struct wrepl_pull_names pull_names;
251 printf("Test one pull replication cycle\n");
253 wrepl_socket = wrepl_socket_init(mem_ctx, NULL);
255 printf("Setup wrepl connections\n");
256 status = wrepl_connect(wrepl_socket, NULL, address);
257 CHECK_STATUS(status, NT_STATUS_OK);
259 printf("Send a start association request\n");
261 status = wrepl_associate(wrepl_socket, &associate);
262 CHECK_STATUS(status, NT_STATUS_OK);
264 printf("association context: 0x%x\n", associate.out.assoc_ctx);
266 printf("Send a replication table query\n");
267 pull_table.in.assoc_ctx = associate.out.assoc_ctx;
269 status = wrepl_pull_table(wrepl_socket, mem_ctx, &pull_table);
270 if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) {
271 struct wrepl_packet packet;
272 struct wrepl_request *req;
275 packet.opcode = WREPL_OPCODE_BITS;
276 packet.assoc_ctx = associate.out.assoc_ctx;
277 packet.mess_type = WREPL_STOP_ASSOCIATION;
278 packet.message.stop.reason = 0;
280 req = wrepl_request_send(wrepl_socket, &packet);
283 printf("failed - We are not a valid pull partner for the server\n");
287 CHECK_STATUS(status, NT_STATUS_OK);
289 printf("Found %d replication partners\n", pull_table.out.num_partners);
291 for (i=0;i<pull_table.out.num_partners;i++) {
292 struct wrepl_wins_owner *partner = &pull_table.out.partners[i];
293 printf("%s max_version=%6llu min_version=%6llu type=%d\n",
295 partner->max_version,
296 partner->min_version,
299 pull_names.in.assoc_ctx = associate.out.assoc_ctx;
300 pull_names.in.partner = *partner;
302 status = wrepl_pull_names(wrepl_socket, mem_ctx, &pull_names);
303 CHECK_STATUS(status, NT_STATUS_OK);
305 printf("Received %d names\n", pull_names.out.num_names);
307 for (j=0;j<pull_names.out.num_names;j++) {
308 display_entry(mem_ctx, &pull_names.out.names[j]);
313 printf("Close wrepl connections\n");
314 talloc_free(wrepl_socket);
318 struct test_wrepl_conflict_conn {
320 struct wrepl_socket *pull;
323 #define TEST_OWNER_A_ADDRESS "127.65.65.1"
324 #define TEST_ADDRESS_A_PREFIX "127.0.65"
325 #define TEST_OWNER_B_ADDRESS "127.66.66.1"
326 #define TEST_ADDRESS_B_PREFIX "127.0.66"
328 struct wrepl_wins_owner a, b, c;
331 static const struct wrepl_ip addresses_A_1[] = {
333 .owner = TEST_OWNER_A_ADDRESS,
334 .ip = TEST_ADDRESS_A_PREFIX".1"
337 static const struct wrepl_ip addresses_A_2[] = {
339 .owner = TEST_OWNER_A_ADDRESS,
340 .ip = TEST_ADDRESS_A_PREFIX".2"
343 static const struct wrepl_ip addresses_A_3_4[] = {
345 .owner = TEST_OWNER_A_ADDRESS,
346 .ip = TEST_ADDRESS_A_PREFIX".3"
349 .owner = TEST_OWNER_A_ADDRESS,
350 .ip = TEST_ADDRESS_A_PREFIX".4"
354 static const struct wrepl_ip addresses_B_1[] = {
356 .owner = TEST_OWNER_B_ADDRESS,
357 .ip = TEST_ADDRESS_B_PREFIX".1"
360 static const struct wrepl_ip addresses_B_2[] = {
362 .owner = TEST_OWNER_B_ADDRESS,
363 .ip = TEST_ADDRESS_B_PREFIX".2"
366 static const struct wrepl_ip addresses_B_3_4[] = {
368 .owner = TEST_OWNER_B_ADDRESS,
369 .ip = TEST_ADDRESS_B_PREFIX".3"
372 .owner = TEST_OWNER_B_ADDRESS,
373 .ip = TEST_ADDRESS_B_PREFIX".4"
377 static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem_ctx,
380 struct test_wrepl_conflict_conn *ctx;
381 struct wrepl_associate associate;
382 struct wrepl_pull_table pull_table;
386 ctx = talloc_zero(mem_ctx, struct test_wrepl_conflict_conn);
387 if (!ctx) return NULL;
389 ctx->address = address;
390 ctx->pull = wrepl_socket_init(ctx, NULL);
391 if (!ctx->pull) return NULL;
393 printf("Setup wrepl conflict pull connection\n");
394 status = wrepl_connect(ctx->pull, NULL, ctx->address);
395 if (!NT_STATUS_IS_OK(status)) return NULL;
397 status = wrepl_associate(ctx->pull, &associate);
398 if (!NT_STATUS_IS_OK(status)) return NULL;
400 ctx->pull_assoc = associate.out.assoc_ctx;
402 ctx->a.address = TEST_OWNER_A_ADDRESS;
403 ctx->a.max_version = 0;
404 ctx->a.min_version = 0;
407 ctx->b.address = TEST_OWNER_B_ADDRESS;
408 ctx->b.max_version = 0;
409 ctx->b.min_version = 0;
412 ctx->c.address = address;
413 ctx->c.max_version = 0;
414 ctx->c.min_version = 0;
417 pull_table.in.assoc_ctx = ctx->pull_assoc;
418 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
419 if (!NT_STATUS_IS_OK(status)) return NULL;
421 for (i=0; i < pull_table.out.num_partners; i++) {
422 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
423 ctx->a.max_version = pull_table.out.partners[i].max_version;
424 ctx->a.min_version = pull_table.out.partners[i].min_version;
426 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
427 ctx->b.max_version = pull_table.out.partners[i].max_version;
428 ctx->b.min_version = pull_table.out.partners[i].min_version;
430 if (strcmp(address,pull_table.out.partners[i].address)==0) {
431 ctx->c.max_version = pull_table.out.partners[i].max_version;
432 ctx->c.min_version = pull_table.out.partners[i].min_version;
436 talloc_free(pull_table.out.partners);
441 static BOOL test_wrepl_update_one(struct test_wrepl_conflict_conn *ctx,
442 const struct wrepl_wins_owner *owner,
443 const struct wrepl_wins_name *name)
446 struct wrepl_socket *wrepl_socket;
447 struct wrepl_associate associate;
448 struct wrepl_packet update_packet, repl_send;
449 struct wrepl_table *update;
450 struct wrepl_wins_owner wrepl_wins_owners[1];
451 struct wrepl_packet *repl_recv;
452 struct wrepl_wins_owner *send_request;
453 struct wrepl_send_reply *send_reply;
454 struct wrepl_wins_name wrepl_wins_names[1];
458 wrepl_socket = wrepl_socket_init(ctx, NULL);
460 status = wrepl_connect(wrepl_socket, NULL, ctx->address);
461 CHECK_STATUS(status, NT_STATUS_OK);
463 status = wrepl_associate(wrepl_socket, &associate);
464 CHECK_STATUS(status, NT_STATUS_OK);
465 assoc_ctx = associate.out.assoc_ctx;
467 /* now send a WREPL_REPL_UPDATE message */
468 ZERO_STRUCT(update_packet);
469 update_packet.opcode = WREPL_OPCODE_BITS;
470 update_packet.assoc_ctx = assoc_ctx;
471 update_packet.mess_type = WREPL_REPLICATION;
472 update_packet.message.replication.command = WREPL_REPL_UPDATE;
473 update = &update_packet.message.replication.info.table;
475 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
476 update->partners = wrepl_wins_owners;
477 update->initiator = "0.0.0.0";
479 wrepl_wins_owners[0] = *owner;
481 status = wrepl_request(wrepl_socket, wrepl_socket,
482 &update_packet, &repl_recv);
483 CHECK_STATUS(status, NT_STATUS_OK);
484 CHECK_VALUE(repl_recv->mess_type, WREPL_REPLICATION);
485 CHECK_VALUE(repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
486 send_request = &repl_recv->message.replication.info.owner;
488 ZERO_STRUCT(repl_send);
489 repl_send.opcode = WREPL_OPCODE_BITS;
490 repl_send.assoc_ctx = assoc_ctx;
491 repl_send.mess_type = WREPL_REPLICATION;
492 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
493 send_reply = &repl_send.message.replication.info.reply;
495 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
496 send_reply->names = wrepl_wins_names;
498 wrepl_wins_names[0] = *name;
500 status = wrepl_request(wrepl_socket, wrepl_socket,
501 &repl_send, &repl_recv);
502 CHECK_STATUS(status, NT_STATUS_OK);
503 CHECK_VALUE(repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
504 CHECK_VALUE(repl_recv->message.stop.reason, 0);
507 talloc_free(wrepl_socket);
511 static BOOL test_wrepl_is_applied(struct test_wrepl_conflict_conn *ctx,
512 const struct wrepl_wins_owner *owner,
513 const struct wrepl_wins_name *name,
518 struct wrepl_pull_names pull_names;
519 struct wrepl_name *names;
521 pull_names.in.assoc_ctx = ctx->pull_assoc;
522 pull_names.in.partner = *owner;
523 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
525 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
526 CHECK_STATUS(status, NT_STATUS_OK);
527 CHECK_VALUE(pull_names.out.num_names, (expected?1:0));
529 names = pull_names.out.names;
532 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
536 CHECK_VALUE(names[0].name.type, name->name->type);
537 CHECK_VALUE_STRING(names[0].name.name, name->name->name);
538 CHECK_VALUE_STRING(names[0].name.scope, name->name->scope);
539 CHECK_VALUE(flags, name->flags);
540 CHECK_VALUE_UINT64(names[0].version_id, name->id);
543 CHECK_VALUE(names[0].num_addresses,
544 name->addresses.addresses.num_ips);
546 CHECK_VALUE(names[0].num_addresses, 1);
547 CHECK_VALUE_STRING(names[0].addresses[0].address,
552 talloc_free(pull_names.out.names);
556 static BOOL test_wrepl_is_merged(struct test_wrepl_conflict_conn *ctx,
557 const struct wrepl_wins_name *name1,
558 const struct wrepl_wins_name *name2)
564 struct wrepl_pull_names pull_names;
565 struct wrepl_name *names;
568 pull_names.in.assoc_ctx = ctx->pull_assoc;
569 pull_names.in.partner = ctx->c;
570 pull_names.in.partner.min_version = ctx->c.max_version-1;
572 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
573 CHECK_STATUS(status, NT_STATUS_OK);
574 CHECK_VALUE(pull_names.out.num_names, 1);
576 names = pull_names.out.names;
578 num_ips = name1->addresses.addresses.num_ips + name2->addresses.addresses.num_ips;
580 CHECK_VALUE(names[0].name.type, name1->name->type);
581 CHECK_VALUE_STRING(names[0].name.name, name1->name->name);
582 CHECK_VALUE_STRING(names[0].name.scope, name1->name->scope);
583 CHECK_VALUE(names[0].type, WREPL_TYPE_SGROUP);
584 CHECK_VALUE(names[0].state, (num_ips>0?WREPL_STATE_ACTIVE:WREPL_STATE_RELEASED));
585 CHECK_VALUE_UINT64(names[0].version_id, ctx->c.max_version);
587 CHECK_VALUE(names[0].num_addresses,
588 name1->addresses.addresses.num_ips+
589 name2->addresses.addresses.num_ips);
591 talloc_free(pull_names.out.names);
596 static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx)
599 struct nbt_name name;
600 struct wrepl_wins_name wins_name1;
601 struct wrepl_wins_name wins_name2;
602 struct wrepl_wins_name *wins_name_tmp;
603 struct wrepl_wins_name *wins_name_last;
604 struct wrepl_wins_name *wins_name_cur;
606 uint8_t types[] = { 0x00, 0x1C };
608 enum wrepl_name_type type;
609 enum wrepl_name_state state;
610 enum wrepl_name_node node;
613 const struct wrepl_ip *ips;
616 .type = WREPL_TYPE_GROUP,
617 .state = WREPL_STATE_ACTIVE,
618 .node = WREPL_NODE_B,
620 .num_ips = ARRAY_SIZE(addresses_A_1),
621 .ips = addresses_A_1,
623 .type = WREPL_TYPE_UNIQUE,
624 .state = WREPL_STATE_ACTIVE,
625 .node = WREPL_NODE_B,
627 .num_ips = ARRAY_SIZE(addresses_A_1),
628 .ips = addresses_A_1,
630 .type = WREPL_TYPE_UNIQUE,
631 .state = WREPL_STATE_ACTIVE,
632 .node = WREPL_NODE_B,
634 .num_ips = ARRAY_SIZE(addresses_A_2),
635 .ips = addresses_A_2,
637 .type = WREPL_TYPE_UNIQUE,
638 .state = WREPL_STATE_ACTIVE,
639 .node = WREPL_NODE_B,
641 .num_ips = ARRAY_SIZE(addresses_A_1),
642 .ips = addresses_A_1,
644 .type = WREPL_TYPE_UNIQUE,
645 .state = WREPL_STATE_ACTIVE,
646 .node = WREPL_NODE_B,
648 .num_ips = ARRAY_SIZE(addresses_A_2),
649 .ips = addresses_A_2,
651 .type = WREPL_TYPE_SGROUP,
652 .state = WREPL_STATE_TOMBSTONE,
653 .node = WREPL_NODE_B,
655 .num_ips = ARRAY_SIZE(addresses_A_2),
656 .ips = addresses_A_2,
658 .type = WREPL_TYPE_MHOMED,
659 .state = WREPL_STATE_TOMBSTONE,
660 .node = WREPL_NODE_B,
662 .num_ips = ARRAY_SIZE(addresses_A_1),
663 .ips = addresses_A_1,
665 .type = WREPL_TYPE_MHOMED,
666 .state = WREPL_STATE_RELEASED,
667 .node = WREPL_NODE_B,
669 .num_ips = ARRAY_SIZE(addresses_A_2),
670 .ips = addresses_A_2,
672 .type = WREPL_TYPE_SGROUP,
673 .state = WREPL_STATE_ACTIVE,
674 .node = WREPL_NODE_B,
676 .num_ips = ARRAY_SIZE(addresses_A_1),
677 .ips = addresses_A_1,
679 .type = WREPL_TYPE_SGROUP,
680 .state = WREPL_STATE_ACTIVE,
681 .node = WREPL_NODE_B,
683 .num_ips = ARRAY_SIZE(addresses_A_3_4),
684 .ips = addresses_A_3_4,
686 .type = WREPL_TYPE_SGROUP,
687 .state = WREPL_STATE_TOMBSTONE,
688 .node = WREPL_NODE_B,
690 .num_ips = ARRAY_SIZE(addresses_B_3_4),
691 .ips = addresses_B_3_4,
693 /* the last one should always be a unique,tomstone record! */
694 .type = WREPL_TYPE_UNIQUE,
695 .state = WREPL_STATE_TOMBSTONE,
696 .node = WREPL_NODE_B,
698 .num_ips = ARRAY_SIZE(addresses_A_1),
699 .ips = addresses_A_1,
703 if (!ctx) return False;
705 name.name = "_SAME_OWNER_A";
709 wins_name_tmp = NULL;
710 wins_name_last = &wins_name2;
711 wins_name_cur = &wins_name1;
713 for (j=0; ret && j < ARRAY_SIZE(types); j++) {
714 name.type = types[j];
715 printf("Test Replica Conflicts with same owner[%s] for %s\n",
716 nbt_name_string(ctx, &name), ctx->a.address);
718 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
719 wins_name_tmp = wins_name_last;
720 wins_name_last = wins_name_cur;
721 wins_name_cur = wins_name_tmp;
724 printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
725 wrepl_name_type_string(records[i-1].type),
726 wrepl_name_state_string(records[i-1].state),
727 (records[i-1].is_static?",static":""),
728 wrepl_name_type_string(records[i].type),
729 wrepl_name_state_string(records[i].state),
730 (records[i].is_static?",static":""),
731 (records[i-1].ips==records[i].ips?"same":"different"),
735 wins_name_cur->name = &name;
736 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
739 records[i].is_static);
740 wins_name_cur->id = ++ctx->a.max_version;
741 if (wins_name_cur->flags & 2) {
742 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
743 wins_name_cur->addresses.addresses.ips = discard_const(records[i].ips);
745 wins_name_cur->addresses.ip = records[i].ips[0].ip;
747 wins_name_cur->unknown = "255.255.255.255";
749 ret &= test_wrepl_update_one(ctx, &ctx->a,wins_name_cur);
750 if (records[i].state == WREPL_STATE_RELEASED) {
751 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_last, False);
752 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, False);
754 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, True);
757 /* the first one is a cleanup run */
758 if (!ret && i == 0) ret = True;
761 printf("conflict handled wrong or record[%u]: %s\n", i, __location__);
769 static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx)
772 struct wrepl_wins_name wins_name1;
773 struct wrepl_wins_name wins_name2;
774 struct wrepl_wins_name *wins_name_r1;
775 struct wrepl_wins_name *wins_name_r2;
778 const char *line; /* just better debugging */
779 struct nbt_name name;
780 BOOL extra; /* not the worst case, this is an extra test */
783 struct wrepl_wins_owner *owner;
784 enum wrepl_name_type type;
785 enum wrepl_name_state state;
786 enum wrepl_name_node node;
789 const struct wrepl_ip *ips;
795 * NOTE: the first record and the last applied one
796 * needs to be from the same owner,
797 * to not conflict in the next smbtorture run!!!
800 .line = __location__,
801 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
805 .type = WREPL_TYPE_UNIQUE,
806 .state = WREPL_STATE_TOMBSTONE,
807 .node = WREPL_NODE_B,
809 .num_ips = ARRAY_SIZE(addresses_B_1),
810 .ips = addresses_B_1,
811 .apply_expected = True /* ignored */
815 .type = WREPL_TYPE_UNIQUE,
816 .state = WREPL_STATE_TOMBSTONE,
817 .node = WREPL_NODE_B,
819 .num_ips = ARRAY_SIZE(addresses_A_1),
820 .ips = addresses_A_1,
821 .apply_expected = True /* ignored */
826 * unique vs unique section
829 * unique,active vs. unique,active
830 * => should be replaced
833 .line = __location__,
834 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
837 .type = WREPL_TYPE_UNIQUE,
838 .state = WREPL_STATE_ACTIVE,
839 .node = WREPL_NODE_B,
841 .num_ips = ARRAY_SIZE(addresses_A_1),
842 .ips = addresses_A_1,
843 .apply_expected = True
847 .type = WREPL_TYPE_UNIQUE,
848 .state = WREPL_STATE_ACTIVE,
849 .node = WREPL_NODE_B,
851 .num_ips = ARRAY_SIZE(addresses_B_1),
852 .ips = addresses_B_1,
853 .apply_expected = True
858 * unique,active vs. unique,tombstone
859 * => should NOT be replaced
862 .line = __location__,
863 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
866 .type = WREPL_TYPE_UNIQUE,
867 .state = WREPL_STATE_ACTIVE,
868 .node = WREPL_NODE_B,
870 .num_ips = ARRAY_SIZE(addresses_B_1),
871 .ips = addresses_B_1,
872 .apply_expected = True
876 .type = WREPL_TYPE_UNIQUE,
877 .state = WREPL_STATE_TOMBSTONE,
878 .node = WREPL_NODE_B,
880 .num_ips = ARRAY_SIZE(addresses_B_1),
881 .ips = addresses_B_1,
882 .apply_expected = False
887 * unique,released vs. unique,active
888 * => should be replaced
891 .line = __location__,
892 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
895 .type = WREPL_TYPE_UNIQUE,
896 .state = WREPL_STATE_RELEASED,
897 .node = WREPL_NODE_B,
899 .num_ips = ARRAY_SIZE(addresses_B_1),
900 .ips = addresses_B_1,
901 .apply_expected = False
905 .type = WREPL_TYPE_UNIQUE,
906 .state = WREPL_STATE_ACTIVE,
907 .node = WREPL_NODE_B,
909 .num_ips = ARRAY_SIZE(addresses_A_1),
910 .ips = addresses_A_1,
911 .apply_expected = True
916 * unique,released vs. unique,tombstone
917 * => should be replaced
920 .line = __location__,
921 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
924 .type = WREPL_TYPE_UNIQUE,
925 .state = WREPL_STATE_RELEASED,
926 .node = WREPL_NODE_B,
928 .num_ips = ARRAY_SIZE(addresses_A_1),
929 .ips = addresses_A_1,
930 .apply_expected = False
934 .type = WREPL_TYPE_UNIQUE,
935 .state = WREPL_STATE_TOMBSTONE,
936 .node = WREPL_NODE_B,
938 .num_ips = ARRAY_SIZE(addresses_B_1),
939 .ips = addresses_B_1,
940 .apply_expected = True
945 * unique,tombstone vs. unique,active
946 * => should be replaced
949 .line = __location__,
950 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
953 .type = WREPL_TYPE_UNIQUE,
954 .state = WREPL_STATE_TOMBSTONE,
955 .node = WREPL_NODE_B,
957 .num_ips = ARRAY_SIZE(addresses_B_1),
958 .ips = addresses_B_1,
959 .apply_expected = True
963 .type = WREPL_TYPE_UNIQUE,
964 .state = WREPL_STATE_ACTIVE,
965 .node = WREPL_NODE_B,
967 .num_ips = ARRAY_SIZE(addresses_A_1),
968 .ips = addresses_A_1,
969 .apply_expected = True
974 * unique,tombstone vs. unique,tombstone
975 * => should be replaced
978 .line = __location__,
979 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
982 .type = WREPL_TYPE_UNIQUE,
983 .state = WREPL_STATE_TOMBSTONE,
984 .node = WREPL_NODE_B,
986 .num_ips = ARRAY_SIZE(addresses_A_1),
987 .ips = addresses_A_1,
988 .apply_expected = True
992 .type = WREPL_TYPE_UNIQUE,
993 .state = WREPL_STATE_TOMBSTONE,
994 .node = WREPL_NODE_B,
996 .num_ips = ARRAY_SIZE(addresses_B_1),
997 .ips = addresses_B_1,
998 .apply_expected = True
1004 * unique vs normal groups section,
1007 * unique,active vs. group,active
1008 * => should be replaced
1011 .line = __location__,
1012 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1015 .type = WREPL_TYPE_UNIQUE,
1016 .state = WREPL_STATE_ACTIVE,
1017 .node = WREPL_NODE_B,
1019 .num_ips = ARRAY_SIZE(addresses_B_1),
1020 .ips = addresses_B_1,
1021 .apply_expected = True
1025 .type = WREPL_TYPE_GROUP,
1026 .state = WREPL_STATE_ACTIVE,
1027 .node = WREPL_NODE_B,
1029 .num_ips = ARRAY_SIZE(addresses_A_1),
1030 .ips = addresses_A_1,
1031 .apply_expected = True
1036 * unique,active vs. group,tombstone
1037 * => should NOT be replaced
1040 .line = __location__,
1041 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1044 .type = WREPL_TYPE_UNIQUE,
1045 .state = WREPL_STATE_ACTIVE,
1046 .node = WREPL_NODE_B,
1048 .num_ips = ARRAY_SIZE(addresses_A_1),
1049 .ips = addresses_A_1,
1050 .apply_expected = True
1054 .type = WREPL_TYPE_GROUP,
1055 .state = WREPL_STATE_TOMBSTONE,
1056 .node = WREPL_NODE_B,
1058 .num_ips = ARRAY_SIZE(addresses_A_1),
1059 .ips = addresses_A_1,
1060 .apply_expected = False
1065 * unique,released vs. group,active
1066 * => should be replaced
1069 .line = __location__,
1070 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1073 .type = WREPL_TYPE_UNIQUE,
1074 .state = WREPL_STATE_RELEASED,
1075 .node = WREPL_NODE_B,
1077 .num_ips = ARRAY_SIZE(addresses_A_1),
1078 .ips = addresses_A_1,
1079 .apply_expected = False
1083 .type = WREPL_TYPE_GROUP,
1084 .state = WREPL_STATE_ACTIVE,
1085 .node = WREPL_NODE_B,
1087 .num_ips = ARRAY_SIZE(addresses_B_1),
1088 .ips = addresses_B_1,
1089 .apply_expected = True
1094 * unique,released vs. group,tombstone
1095 * => should be replaced
1098 .line = __location__,
1099 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1102 .type = WREPL_TYPE_UNIQUE,
1103 .state = WREPL_STATE_RELEASED,
1104 .node = WREPL_NODE_B,
1106 .num_ips = ARRAY_SIZE(addresses_B_1),
1107 .ips = addresses_B_1,
1108 .apply_expected = False
1112 .type = WREPL_TYPE_GROUP,
1113 .state = WREPL_STATE_TOMBSTONE,
1114 .node = WREPL_NODE_B,
1116 .num_ips = ARRAY_SIZE(addresses_A_1),
1117 .ips = addresses_A_1,
1118 .apply_expected = True
1123 * unique,tombstone vs. group,active
1124 * => should be replaced
1127 .line = __location__,
1128 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1131 .type = WREPL_TYPE_UNIQUE,
1132 .state = WREPL_STATE_TOMBSTONE,
1133 .node = WREPL_NODE_B,
1135 .num_ips = ARRAY_SIZE(addresses_A_1),
1136 .ips = addresses_A_1,
1137 .apply_expected = True
1141 .type = WREPL_TYPE_GROUP,
1142 .state = WREPL_STATE_ACTIVE,
1143 .node = WREPL_NODE_B,
1145 .num_ips = ARRAY_SIZE(addresses_B_1),
1146 .ips = addresses_B_1,
1147 .apply_expected = True
1152 * unique,tombstone vs. group,tombstone
1153 * => should be replaced
1156 .line = __location__,
1157 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1160 .type = WREPL_TYPE_UNIQUE,
1161 .state = WREPL_STATE_TOMBSTONE,
1162 .node = WREPL_NODE_B,
1164 .num_ips = ARRAY_SIZE(addresses_B_1),
1165 .ips = addresses_B_1,
1166 .apply_expected = True
1170 .type = WREPL_TYPE_GROUP,
1171 .state = WREPL_STATE_TOMBSTONE,
1172 .node = WREPL_NODE_B,
1174 .num_ips = ARRAY_SIZE(addresses_A_1),
1175 .ips = addresses_A_1,
1176 .apply_expected = True
1181 * unique vs special groups section,
1184 * unique,active vs. sgroup,active
1185 * => should NOT be replaced
1188 .line = __location__,
1189 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1192 .type = WREPL_TYPE_UNIQUE,
1193 .state = WREPL_STATE_ACTIVE,
1194 .node = WREPL_NODE_B,
1196 .num_ips = ARRAY_SIZE(addresses_A_1),
1197 .ips = addresses_A_1,
1198 .apply_expected = True
1202 .type = WREPL_TYPE_SGROUP,
1203 .state = WREPL_STATE_ACTIVE,
1204 .node = WREPL_NODE_B,
1206 .num_ips = ARRAY_SIZE(addresses_A_1),
1207 .ips = addresses_A_1,
1208 .apply_expected = False
1213 * unique,active vs. sgroup,tombstone
1214 * => should NOT be replaced
1217 .line = __location__,
1218 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1221 .type = WREPL_TYPE_UNIQUE,
1222 .state = WREPL_STATE_ACTIVE,
1223 .node = WREPL_NODE_B,
1225 .num_ips = ARRAY_SIZE(addresses_A_1),
1226 .ips = addresses_A_1,
1227 .apply_expected = True
1231 .type = WREPL_TYPE_SGROUP,
1232 .state = WREPL_STATE_TOMBSTONE,
1233 .node = WREPL_NODE_B,
1235 .num_ips = ARRAY_SIZE(addresses_A_1),
1236 .ips = addresses_A_1,
1237 .apply_expected = False
1242 * unique,released vs. sgroup,active
1243 * => should be replaced
1246 .line = __location__,
1247 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1250 .type = WREPL_TYPE_UNIQUE,
1251 .state = WREPL_STATE_RELEASED,
1252 .node = WREPL_NODE_B,
1254 .num_ips = ARRAY_SIZE(addresses_A_1),
1255 .ips = addresses_A_1,
1256 .apply_expected = False
1260 .type = WREPL_TYPE_SGROUP,
1261 .state = WREPL_STATE_ACTIVE,
1262 .node = WREPL_NODE_B,
1264 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1265 .ips = addresses_B_3_4,
1266 .apply_expected = True
1271 * unique,released vs. sgroup,tombstone
1272 * => should be replaced
1275 .line = __location__,
1276 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1279 .type = WREPL_TYPE_UNIQUE,
1280 .state = WREPL_STATE_RELEASED,
1281 .node = WREPL_NODE_B,
1283 .num_ips = ARRAY_SIZE(addresses_B_1),
1284 .ips = addresses_B_1,
1285 .apply_expected = False
1289 .type = WREPL_TYPE_SGROUP,
1290 .state = WREPL_STATE_TOMBSTONE,
1291 .node = WREPL_NODE_B,
1293 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1294 .ips = addresses_A_3_4,
1295 .apply_expected = True
1300 * unique,tombstone vs. sgroup,active
1301 * => should be replaced
1304 .line = __location__,
1305 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1308 .type = WREPL_TYPE_UNIQUE,
1309 .state = WREPL_STATE_TOMBSTONE,
1310 .node = WREPL_NODE_B,
1312 .num_ips = ARRAY_SIZE(addresses_A_1),
1313 .ips = addresses_A_1,
1314 .apply_expected = True
1318 .type = WREPL_TYPE_SGROUP,
1319 .state = WREPL_STATE_ACTIVE,
1320 .node = WREPL_NODE_B,
1322 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1323 .ips = addresses_B_3_4,
1324 .apply_expected = True
1329 * unique,tombstone vs. sgroup,tombstone
1330 * => should be replaced
1333 .line = __location__,
1334 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1337 .type = WREPL_TYPE_UNIQUE,
1338 .state = WREPL_STATE_TOMBSTONE,
1339 .node = WREPL_NODE_B,
1341 .num_ips = ARRAY_SIZE(addresses_B_1),
1342 .ips = addresses_B_1,
1343 .apply_expected = True
1347 .type = WREPL_TYPE_SGROUP,
1348 .state = WREPL_STATE_TOMBSTONE,
1349 .node = WREPL_NODE_B,
1351 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1352 .ips = addresses_A_3_4,
1353 .apply_expected = True
1358 * unique vs multi homed section,
1361 * unique,active vs. mhomed,active
1362 * => should be replaced
1365 .line = __location__,
1366 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1369 .type = WREPL_TYPE_UNIQUE,
1370 .state = WREPL_STATE_ACTIVE,
1371 .node = WREPL_NODE_B,
1373 .num_ips = ARRAY_SIZE(addresses_A_1),
1374 .ips = addresses_A_1,
1375 .apply_expected = True
1379 .type = WREPL_TYPE_MHOMED,
1380 .state = WREPL_STATE_ACTIVE,
1381 .node = WREPL_NODE_B,
1383 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1384 .ips = addresses_B_3_4,
1385 .apply_expected = True
1390 * unique,active vs. mhomed,tombstone
1391 * => should NOT be replaced
1394 .line = __location__,
1395 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1398 .type = WREPL_TYPE_UNIQUE,
1399 .state = WREPL_STATE_ACTIVE,
1400 .node = WREPL_NODE_B,
1402 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1403 .ips = addresses_B_3_4,
1404 .apply_expected = True
1408 .type = WREPL_TYPE_MHOMED,
1409 .state = WREPL_STATE_TOMBSTONE,
1410 .node = WREPL_NODE_B,
1412 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1413 .ips = addresses_B_3_4,
1414 .apply_expected = False
1419 * unique,released vs. mhomed,active
1420 * => should be replaced
1423 .line = __location__,
1424 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1427 .type = WREPL_TYPE_UNIQUE,
1428 .state = WREPL_STATE_RELEASED,
1429 .node = WREPL_NODE_B,
1431 .num_ips = ARRAY_SIZE(addresses_B_1),
1432 .ips = addresses_B_1,
1433 .apply_expected = False
1437 .type = WREPL_TYPE_MHOMED,
1438 .state = WREPL_STATE_ACTIVE,
1439 .node = WREPL_NODE_B,
1441 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1442 .ips = addresses_A_3_4,
1443 .apply_expected = True
1448 * unique,released vs. mhomed,tombstone
1449 * => should be replaced
1452 .line = __location__,
1453 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1456 .type = WREPL_TYPE_UNIQUE,
1457 .state = WREPL_STATE_RELEASED,
1458 .node = WREPL_NODE_B,
1460 .num_ips = ARRAY_SIZE(addresses_A_1),
1461 .ips = addresses_A_1,
1462 .apply_expected = False
1466 .type = WREPL_TYPE_MHOMED,
1467 .state = WREPL_STATE_TOMBSTONE,
1468 .node = WREPL_NODE_B,
1470 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1471 .ips = addresses_B_3_4,
1472 .apply_expected = True
1477 * unique,tombstone vs. mhomed,active
1478 * => should be replaced
1481 .line = __location__,
1482 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1485 .type = WREPL_TYPE_UNIQUE,
1486 .state = WREPL_STATE_TOMBSTONE,
1487 .node = WREPL_NODE_B,
1489 .num_ips = ARRAY_SIZE(addresses_B_1),
1490 .ips = addresses_B_1,
1491 .apply_expected = True
1495 .type = WREPL_TYPE_MHOMED,
1496 .state = WREPL_STATE_ACTIVE,
1497 .node = WREPL_NODE_B,
1499 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1500 .ips = addresses_A_3_4,
1501 .apply_expected = True
1506 * unique,tombstone vs. mhomed,tombstone
1507 * => should be replaced
1510 .line = __location__,
1511 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1514 .type = WREPL_TYPE_UNIQUE,
1515 .state = WREPL_STATE_TOMBSTONE,
1516 .node = WREPL_NODE_B,
1518 .num_ips = ARRAY_SIZE(addresses_A_1),
1519 .ips = addresses_A_1,
1520 .apply_expected = True
1524 .type = WREPL_TYPE_MHOMED,
1525 .state = WREPL_STATE_TOMBSTONE,
1526 .node = WREPL_NODE_B,
1528 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1529 .ips = addresses_B_3_4,
1530 .apply_expected = True
1535 * normal groups vs unique section,
1538 * group,active vs. unique,active
1539 * => should NOT be replaced
1542 .line = __location__,
1543 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1546 .type = WREPL_TYPE_GROUP,
1547 .state = WREPL_STATE_ACTIVE,
1548 .node = WREPL_NODE_B,
1550 .num_ips = ARRAY_SIZE(addresses_A_1),
1551 .ips = addresses_A_1,
1552 .apply_expected = True
1556 .type = WREPL_TYPE_UNIQUE,
1557 .state = WREPL_STATE_ACTIVE,
1558 .node = WREPL_NODE_B,
1560 .num_ips = ARRAY_SIZE(addresses_A_1),
1561 .ips = addresses_A_1,
1562 .apply_expected = False
1567 * group,active vs. unique,tombstone
1568 * => should NOT be replaced
1571 .line = __location__,
1572 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1575 .type = WREPL_TYPE_GROUP,
1576 .state = WREPL_STATE_ACTIVE,
1577 .node = WREPL_NODE_B,
1579 .num_ips = ARRAY_SIZE(addresses_A_1),
1580 .ips = addresses_A_1,
1581 .apply_expected = True
1585 .type = WREPL_TYPE_UNIQUE,
1586 .state = WREPL_STATE_TOMBSTONE,
1587 .node = WREPL_NODE_B,
1589 .num_ips = ARRAY_SIZE(addresses_A_1),
1590 .ips = addresses_A_1,
1591 .apply_expected = False
1596 * group,released vs. unique,active
1597 * => should NOT be replaced
1600 .line = __location__,
1601 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1604 .type = WREPL_TYPE_GROUP,
1605 .state = WREPL_STATE_RELEASED,
1606 .node = WREPL_NODE_B,
1608 .num_ips = ARRAY_SIZE(addresses_A_1),
1609 .ips = addresses_A_1,
1610 .apply_expected = False
1614 .type = WREPL_TYPE_UNIQUE,
1615 .state = WREPL_STATE_ACTIVE,
1616 .node = WREPL_NODE_B,
1618 .num_ips = ARRAY_SIZE(addresses_A_1),
1619 .ips = addresses_A_1,
1620 .apply_expected = False
1625 * group,released vs. unique,tombstone
1626 * => should NOT be replaced
1629 .line = __location__,
1630 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1633 .type = WREPL_TYPE_GROUP,
1634 .state = WREPL_STATE_RELEASED,
1635 .node = WREPL_NODE_B,
1637 .num_ips = ARRAY_SIZE(addresses_A_1),
1638 .ips = addresses_A_1,
1639 .apply_expected = False
1643 .type = WREPL_TYPE_UNIQUE,
1644 .state = WREPL_STATE_TOMBSTONE,
1645 .node = WREPL_NODE_B,
1647 .num_ips = ARRAY_SIZE(addresses_A_1),
1648 .ips = addresses_A_1,
1649 .apply_expected = False
1654 * group,tombstone vs. unique,active
1655 * => should NOT be replaced
1658 .line = __location__,
1659 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1662 .type = WREPL_TYPE_GROUP,
1663 .state = WREPL_STATE_TOMBSTONE,
1664 .node = WREPL_NODE_B,
1666 .num_ips = ARRAY_SIZE(addresses_A_1),
1667 .ips = addresses_A_1,
1668 .apply_expected = True
1672 .type = WREPL_TYPE_UNIQUE,
1673 .state = WREPL_STATE_ACTIVE,
1674 .node = WREPL_NODE_B,
1676 .num_ips = ARRAY_SIZE(addresses_A_1),
1677 .ips = addresses_A_1,
1678 .apply_expected = False
1683 * group,tombstone vs. unique,tombstone
1684 * => should NOT be replaced
1687 .line = __location__,
1688 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1691 .type = WREPL_TYPE_GROUP,
1692 .state = WREPL_STATE_TOMBSTONE,
1693 .node = WREPL_NODE_B,
1695 .num_ips = ARRAY_SIZE(addresses_A_1),
1696 .ips = addresses_A_1,
1697 .apply_expected = True
1701 .type = WREPL_TYPE_UNIQUE,
1702 .state = WREPL_STATE_TOMBSTONE,
1703 .node = WREPL_NODE_B,
1705 .num_ips = ARRAY_SIZE(addresses_A_1),
1706 .ips = addresses_A_1,
1707 .apply_expected = False
1712 * normal groups vs normal groups section,
1715 * group,active vs. group,active
1716 * => should NOT be replaced
1719 .line = __location__,
1720 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1723 .type = WREPL_TYPE_GROUP,
1724 .state = WREPL_STATE_ACTIVE,
1725 .node = WREPL_NODE_B,
1727 .num_ips = ARRAY_SIZE(addresses_A_1),
1728 .ips = addresses_A_1,
1729 .apply_expected = True
1733 .type = WREPL_TYPE_GROUP,
1734 .state = WREPL_STATE_ACTIVE,
1735 .node = WREPL_NODE_B,
1737 .num_ips = ARRAY_SIZE(addresses_A_1),
1738 .ips = addresses_A_1,
1739 .apply_expected = False
1744 * group,active vs. group,tombstone
1745 * => should NOT be replaced
1748 .line = __location__,
1749 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1752 .type = WREPL_TYPE_GROUP,
1753 .state = WREPL_STATE_ACTIVE,
1754 .node = WREPL_NODE_B,
1756 .num_ips = ARRAY_SIZE(addresses_A_1),
1757 .ips = addresses_A_1,
1758 .apply_expected = True
1762 .type = WREPL_TYPE_GROUP,
1763 .state = WREPL_STATE_TOMBSTONE,
1764 .node = WREPL_NODE_B,
1766 .num_ips = ARRAY_SIZE(addresses_A_1),
1767 .ips = addresses_A_1,
1768 .apply_expected = False
1773 * group,released vs. group,active
1774 * => should be replaced
1777 .line = __location__,
1778 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1781 .type = WREPL_TYPE_GROUP,
1782 .state = WREPL_STATE_RELEASED,
1783 .node = WREPL_NODE_B,
1785 .num_ips = ARRAY_SIZE(addresses_A_1),
1786 .ips = addresses_A_1,
1787 .apply_expected = False
1791 .type = WREPL_TYPE_GROUP,
1792 .state = WREPL_STATE_ACTIVE,
1793 .node = WREPL_NODE_B,
1795 .num_ips = ARRAY_SIZE(addresses_B_1),
1796 .ips = addresses_B_1,
1797 .apply_expected = True
1802 * group,released vs. group,tombstone
1803 * => should be replaced
1806 .line = __location__,
1807 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1810 .type = WREPL_TYPE_GROUP,
1811 .state = WREPL_STATE_RELEASED,
1812 .node = WREPL_NODE_B,
1814 .num_ips = ARRAY_SIZE(addresses_A_1),
1815 .ips = addresses_A_1,
1816 .apply_expected = False
1820 .type = WREPL_TYPE_GROUP,
1821 .state = WREPL_STATE_TOMBSTONE,
1822 .node = WREPL_NODE_B,
1824 .num_ips = ARRAY_SIZE(addresses_B_1),
1825 .ips = addresses_B_1,
1826 .apply_expected = True
1831 * group,tombstone vs. group,active
1832 * => should be replaced
1835 .line = __location__,
1836 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1839 .type = WREPL_TYPE_GROUP,
1840 .state = WREPL_STATE_TOMBSTONE,
1841 .node = WREPL_NODE_B,
1843 .num_ips = ARRAY_SIZE(addresses_B_1),
1844 .ips = addresses_B_1,
1845 .apply_expected = True
1849 .type = WREPL_TYPE_GROUP,
1850 .state = WREPL_STATE_ACTIVE,
1851 .node = WREPL_NODE_B,
1853 .num_ips = ARRAY_SIZE(addresses_A_1),
1854 .ips = addresses_A_1,
1855 .apply_expected = True
1860 * group,tombstone vs. group,tombstone
1861 * => should be replaced
1864 .line = __location__,
1865 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1868 .type = WREPL_TYPE_GROUP,
1869 .state = WREPL_STATE_TOMBSTONE,
1870 .node = WREPL_NODE_B,
1872 .num_ips = ARRAY_SIZE(addresses_A_1),
1873 .ips = addresses_A_1,
1874 .apply_expected = True
1878 .type = WREPL_TYPE_GROUP,
1879 .state = WREPL_STATE_TOMBSTONE,
1880 .node = WREPL_NODE_B,
1882 .num_ips = ARRAY_SIZE(addresses_B_1),
1883 .ips = addresses_B_1,
1884 .apply_expected = True
1889 * normal groups vs special groups section,
1892 * group,active vs. sgroup,active
1893 * => should NOT be replaced
1896 .line = __location__,
1897 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1900 .type = WREPL_TYPE_GROUP,
1901 .state = WREPL_STATE_ACTIVE,
1902 .node = WREPL_NODE_B,
1904 .num_ips = ARRAY_SIZE(addresses_B_1),
1905 .ips = addresses_B_1,
1906 .apply_expected = True
1910 .type = WREPL_TYPE_SGROUP,
1911 .state = WREPL_STATE_ACTIVE,
1912 .node = WREPL_NODE_B,
1914 .num_ips = ARRAY_SIZE(addresses_B_1),
1915 .ips = addresses_B_1,
1916 .apply_expected = False
1921 * group,active vs. sgroup,tombstone
1922 * => should NOT be replaced
1925 .line = __location__,
1926 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1929 .type = WREPL_TYPE_GROUP,
1930 .state = WREPL_STATE_ACTIVE,
1931 .node = WREPL_NODE_B,
1933 .num_ips = ARRAY_SIZE(addresses_B_1),
1934 .ips = addresses_B_1,
1935 .apply_expected = True
1939 .type = WREPL_TYPE_SGROUP,
1940 .state = WREPL_STATE_TOMBSTONE,
1941 .node = WREPL_NODE_B,
1943 .num_ips = ARRAY_SIZE(addresses_B_1),
1944 .ips = addresses_B_1,
1945 .apply_expected = False
1950 * group,released vs. sgroup,active
1951 * => should be replaced
1954 .line = __location__,
1955 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1958 .type = WREPL_TYPE_GROUP,
1959 .state = WREPL_STATE_RELEASED,
1960 .node = WREPL_NODE_B,
1962 .num_ips = ARRAY_SIZE(addresses_A_1),
1963 .ips = addresses_A_1,
1964 .apply_expected = False
1968 .type = WREPL_TYPE_SGROUP,
1969 .state = WREPL_STATE_ACTIVE,
1970 .node = WREPL_NODE_B,
1972 .num_ips = ARRAY_SIZE(addresses_B_1),
1973 .ips = addresses_B_1,
1974 .apply_expected = True
1979 * group,released vs. sgroup,tombstone
1980 * => should NOT be replaced
1983 .line = __location__,
1984 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1987 .type = WREPL_TYPE_GROUP,
1988 .state = WREPL_STATE_RELEASED,
1989 .node = WREPL_NODE_B,
1991 .num_ips = ARRAY_SIZE(addresses_B_1),
1992 .ips = addresses_B_1,
1993 .apply_expected = False
1997 .type = WREPL_TYPE_SGROUP,
1998 .state = WREPL_STATE_TOMBSTONE,
1999 .node = WREPL_NODE_B,
2001 .num_ips = ARRAY_SIZE(addresses_B_1),
2002 .ips = addresses_B_1,
2003 .apply_expected = False
2008 * group,tombstone vs. sgroup,active
2009 * => should be replaced
2012 .line = __location__,
2013 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2016 .type = WREPL_TYPE_GROUP,
2017 .state = WREPL_STATE_TOMBSTONE,
2018 .node = WREPL_NODE_B,
2020 .num_ips = ARRAY_SIZE(addresses_B_1),
2021 .ips = addresses_B_1,
2022 .apply_expected = True
2026 .type = WREPL_TYPE_SGROUP,
2027 .state = WREPL_STATE_ACTIVE,
2028 .node = WREPL_NODE_B,
2030 .num_ips = ARRAY_SIZE(addresses_A_1),
2031 .ips = addresses_A_1,
2032 .apply_expected = True
2037 * group,tombstone vs. sgroup,tombstone
2038 * => should be replaced
2041 .line = __location__,
2042 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2045 .type = WREPL_TYPE_GROUP,
2046 .state = WREPL_STATE_TOMBSTONE,
2047 .node = WREPL_NODE_B,
2049 .num_ips = ARRAY_SIZE(addresses_A_1),
2050 .ips = addresses_A_1,
2051 .apply_expected = True
2055 .type = WREPL_TYPE_SGROUP,
2056 .state = WREPL_STATE_TOMBSTONE,
2057 .node = WREPL_NODE_B,
2059 .num_ips = ARRAY_SIZE(addresses_B_1),
2060 .ips = addresses_B_1,
2061 .apply_expected = True
2066 * normal groups vs multi homed section,
2069 * group,active vs. mhomed,active
2070 * => should NOT be replaced
2073 .line = __location__,
2074 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2077 .type = WREPL_TYPE_GROUP,
2078 .state = WREPL_STATE_ACTIVE,
2079 .node = WREPL_NODE_B,
2081 .num_ips = ARRAY_SIZE(addresses_B_1),
2082 .ips = addresses_B_1,
2083 .apply_expected = True
2087 .type = WREPL_TYPE_MHOMED,
2088 .state = WREPL_STATE_ACTIVE,
2089 .node = WREPL_NODE_B,
2091 .num_ips = ARRAY_SIZE(addresses_B_1),
2092 .ips = addresses_B_1,
2093 .apply_expected = False
2098 * group,active vs. mhomed,tombstone
2099 * => should NOT be replaced
2102 .line = __location__,
2103 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2106 .type = WREPL_TYPE_GROUP,
2107 .state = WREPL_STATE_ACTIVE,
2108 .node = WREPL_NODE_B,
2110 .num_ips = ARRAY_SIZE(addresses_B_1),
2111 .ips = addresses_B_1,
2112 .apply_expected = True
2116 .type = WREPL_TYPE_MHOMED,
2117 .state = WREPL_STATE_TOMBSTONE,
2118 .node = WREPL_NODE_B,
2120 .num_ips = ARRAY_SIZE(addresses_B_1),
2121 .ips = addresses_B_1,
2122 .apply_expected = False
2127 * group,released vs. mhomed,active
2128 * => should NOT be replaced
2131 .line = __location__,
2132 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2135 .type = WREPL_TYPE_GROUP,
2136 .state = WREPL_STATE_RELEASED,
2137 .node = WREPL_NODE_B,
2139 .num_ips = ARRAY_SIZE(addresses_B_1),
2140 .ips = addresses_B_1,
2141 .apply_expected = False
2145 .type = WREPL_TYPE_MHOMED,
2146 .state = WREPL_STATE_ACTIVE,
2147 .node = WREPL_NODE_B,
2149 .num_ips = ARRAY_SIZE(addresses_B_1),
2150 .ips = addresses_B_1,
2151 .apply_expected = False
2156 * group,released vs. mhomed,tombstone
2157 * => should NOT be replaced
2160 .line = __location__,
2161 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2164 .type = WREPL_TYPE_GROUP,
2165 .state = WREPL_STATE_RELEASED,
2166 .node = WREPL_NODE_B,
2168 .num_ips = ARRAY_SIZE(addresses_B_1),
2169 .ips = addresses_B_1,
2170 .apply_expected = False
2174 .type = WREPL_TYPE_MHOMED,
2175 .state = WREPL_STATE_TOMBSTONE,
2176 .node = WREPL_NODE_B,
2178 .num_ips = ARRAY_SIZE(addresses_B_1),
2179 .ips = addresses_B_1,
2180 .apply_expected = False
2185 * group,tombstone vs. mhomed,active
2186 * => should be replaced
2189 .line = __location__,
2190 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2193 .type = WREPL_TYPE_GROUP,
2194 .state = WREPL_STATE_TOMBSTONE,
2195 .node = WREPL_NODE_B,
2197 .num_ips = ARRAY_SIZE(addresses_B_1),
2198 .ips = addresses_B_1,
2199 .apply_expected = True
2203 .type = WREPL_TYPE_MHOMED,
2204 .state = WREPL_STATE_ACTIVE,
2205 .node = WREPL_NODE_B,
2207 .num_ips = ARRAY_SIZE(addresses_A_1),
2208 .ips = addresses_A_1,
2209 .apply_expected = True
2214 * group,tombstone vs. mhomed,tombstone
2215 * => should be replaced
2218 .line = __location__,
2219 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2222 .type = WREPL_TYPE_GROUP,
2223 .state = WREPL_STATE_TOMBSTONE,
2224 .node = WREPL_NODE_B,
2226 .num_ips = ARRAY_SIZE(addresses_A_1),
2227 .ips = addresses_A_1,
2228 .apply_expected = True
2232 .type = WREPL_TYPE_MHOMED,
2233 .state = WREPL_STATE_TOMBSTONE,
2234 .node = WREPL_NODE_B,
2236 .num_ips = ARRAY_SIZE(addresses_B_1),
2237 .ips = addresses_B_1,
2238 .apply_expected = True
2243 * special groups vs unique section,
2246 * sgroup,active vs. unique,active
2247 * => should NOT be replaced
2250 .line = __location__,
2251 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2254 .type = WREPL_TYPE_SGROUP,
2255 .state = WREPL_STATE_ACTIVE,
2256 .node = WREPL_NODE_B,
2258 .num_ips = ARRAY_SIZE(addresses_B_1),
2259 .ips = addresses_B_1,
2260 .apply_expected = True
2264 .type = WREPL_TYPE_UNIQUE,
2265 .state = WREPL_STATE_ACTIVE,
2266 .node = WREPL_NODE_B,
2268 .num_ips = ARRAY_SIZE(addresses_B_1),
2269 .ips = addresses_B_1,
2270 .apply_expected = False
2275 * sgroup,active vs. unique,tombstone
2276 * => should NOT be replaced
2279 .line = __location__,
2280 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2283 .type = WREPL_TYPE_SGROUP,
2284 .state = WREPL_STATE_ACTIVE,
2285 .node = WREPL_NODE_B,
2287 .num_ips = ARRAY_SIZE(addresses_B_1),
2288 .ips = addresses_B_1,
2289 .apply_expected = True
2293 .type = WREPL_TYPE_UNIQUE,
2294 .state = WREPL_STATE_TOMBSTONE,
2295 .node = WREPL_NODE_B,
2297 .num_ips = ARRAY_SIZE(addresses_B_1),
2298 .ips = addresses_B_1,
2299 .apply_expected = False
2304 * sgroup,released vs. unique,active
2305 * => should be replaced
2308 .line = __location__,
2309 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2312 .type = WREPL_TYPE_SGROUP,
2313 .state = WREPL_STATE_RELEASED,
2314 .node = WREPL_NODE_B,
2316 .num_ips = ARRAY_SIZE(addresses_B_1),
2317 .ips = addresses_B_1,
2318 .apply_expected = False
2322 .type = WREPL_TYPE_UNIQUE,
2323 .state = WREPL_STATE_ACTIVE,
2324 .node = WREPL_NODE_B,
2326 .num_ips = ARRAY_SIZE(addresses_A_1),
2327 .ips = addresses_A_1,
2328 .apply_expected = True
2333 * sgroup,released vs. unique,tombstone
2334 * => should be replaced
2337 .line = __location__,
2338 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2341 .type = WREPL_TYPE_SGROUP,
2342 .state = WREPL_STATE_RELEASED,
2343 .node = WREPL_NODE_B,
2345 .num_ips = ARRAY_SIZE(addresses_A_1),
2346 .ips = addresses_A_1,
2347 .apply_expected = False
2351 .type = WREPL_TYPE_UNIQUE,
2352 .state = WREPL_STATE_TOMBSTONE,
2353 .node = WREPL_NODE_B,
2355 .num_ips = ARRAY_SIZE(addresses_B_1),
2356 .ips = addresses_B_1,
2357 .apply_expected = True
2362 * sgroup,tombstone vs. unique,active
2363 * => should be replaced
2366 .line = __location__,
2367 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2370 .type = WREPL_TYPE_SGROUP,
2371 .state = WREPL_STATE_TOMBSTONE,
2372 .node = WREPL_NODE_B,
2374 .num_ips = ARRAY_SIZE(addresses_A_1),
2375 .ips = addresses_A_1,
2376 .apply_expected = True
2380 .type = WREPL_TYPE_UNIQUE,
2381 .state = WREPL_STATE_ACTIVE,
2382 .node = WREPL_NODE_B,
2384 .num_ips = ARRAY_SIZE(addresses_B_1),
2385 .ips = addresses_B_1,
2386 .apply_expected = True
2391 * sgroup,tombstone vs. unique,tombstone
2392 * => should be replaced
2395 .line = __location__,
2396 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2399 .type = WREPL_TYPE_SGROUP,
2400 .state = WREPL_STATE_TOMBSTONE,
2401 .node = WREPL_NODE_B,
2403 .num_ips = ARRAY_SIZE(addresses_B_1),
2404 .ips = addresses_B_1,
2405 .apply_expected = True
2409 .type = WREPL_TYPE_UNIQUE,
2410 .state = WREPL_STATE_TOMBSTONE,
2411 .node = WREPL_NODE_B,
2413 .num_ips = ARRAY_SIZE(addresses_A_1),
2414 .ips = addresses_A_1,
2415 .apply_expected = True
2420 * special groups vs normal group section,
2423 * sgroup,active vs. group,active
2424 * => should NOT be replaced
2427 .line = __location__,
2428 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2431 .type = WREPL_TYPE_SGROUP,
2432 .state = WREPL_STATE_ACTIVE,
2433 .node = WREPL_NODE_B,
2435 .num_ips = ARRAY_SIZE(addresses_A_1),
2436 .ips = addresses_A_1,
2437 .apply_expected = True
2441 .type = WREPL_TYPE_GROUP,
2442 .state = WREPL_STATE_ACTIVE,
2443 .node = WREPL_NODE_B,
2445 .num_ips = ARRAY_SIZE(addresses_A_1),
2446 .ips = addresses_A_1,
2447 .apply_expected = False
2452 * sgroup,active vs. group,tombstone
2453 * => should NOT be replaced
2456 .line = __location__,
2457 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2460 .type = WREPL_TYPE_SGROUP,
2461 .state = WREPL_STATE_ACTIVE,
2462 .node = WREPL_NODE_B,
2464 .num_ips = ARRAY_SIZE(addresses_A_1),
2465 .ips = addresses_A_1,
2466 .apply_expected = True
2470 .type = WREPL_TYPE_GROUP,
2471 .state = WREPL_STATE_TOMBSTONE,
2472 .node = WREPL_NODE_B,
2474 .num_ips = ARRAY_SIZE(addresses_A_1),
2475 .ips = addresses_A_1,
2476 .apply_expected = False
2481 * sgroup,released vs. group,active
2482 * => should be replaced
2485 .line = __location__,
2486 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2489 .type = WREPL_TYPE_SGROUP,
2490 .state = WREPL_STATE_RELEASED,
2491 .node = WREPL_NODE_B,
2493 .num_ips = ARRAY_SIZE(addresses_A_1),
2494 .ips = addresses_A_1,
2495 .apply_expected = False
2499 .type = WREPL_TYPE_GROUP,
2500 .state = WREPL_STATE_ACTIVE,
2501 .node = WREPL_NODE_B,
2503 .num_ips = ARRAY_SIZE(addresses_B_1),
2504 .ips = addresses_B_1,
2505 .apply_expected = True
2510 * sgroup,released vs. group,tombstone
2511 * => should be replaced
2514 .line = __location__,
2515 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2518 .type = WREPL_TYPE_SGROUP,
2519 .state = WREPL_STATE_RELEASED,
2520 .node = WREPL_NODE_B,
2522 .num_ips = ARRAY_SIZE(addresses_B_1),
2523 .ips = addresses_B_1,
2524 .apply_expected = False
2528 .type = WREPL_TYPE_GROUP,
2529 .state = WREPL_STATE_TOMBSTONE,
2530 .node = WREPL_NODE_B,
2532 .num_ips = ARRAY_SIZE(addresses_A_1),
2533 .ips = addresses_A_1,
2534 .apply_expected = True
2539 * sgroup,tombstone vs. group,active
2540 * => should NOT be replaced
2543 .line = __location__,
2544 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2547 .type = WREPL_TYPE_SGROUP,
2548 .state = WREPL_STATE_TOMBSTONE,
2549 .node = WREPL_NODE_B,
2551 .num_ips = ARRAY_SIZE(addresses_A_1),
2552 .ips = addresses_A_1,
2553 .apply_expected = True
2557 .type = WREPL_TYPE_GROUP,
2558 .state = WREPL_STATE_ACTIVE,
2559 .node = WREPL_NODE_B,
2561 .num_ips = ARRAY_SIZE(addresses_B_1),
2562 .ips = addresses_B_1,
2563 .apply_expected = True
2568 * sgroup,tombstone vs. group,tombstone
2569 * => should NOT be replaced
2572 .line = __location__,
2573 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2576 .type = WREPL_TYPE_SGROUP,
2577 .state = WREPL_STATE_TOMBSTONE,
2578 .node = WREPL_NODE_B,
2580 .num_ips = ARRAY_SIZE(addresses_B_1),
2581 .ips = addresses_B_1,
2582 .apply_expected = True
2586 .type = WREPL_TYPE_GROUP,
2587 .state = WREPL_STATE_TOMBSTONE,
2588 .node = WREPL_NODE_B,
2590 .num_ips = ARRAY_SIZE(addresses_A_1),
2591 .ips = addresses_A_1,
2592 .apply_expected = True
2597 * special groups vs multi homed section,
2600 * sgroup,active vs. mhomed,active
2601 * => should NOT be replaced
2604 .line = __location__,
2605 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2608 .type = WREPL_TYPE_SGROUP,
2609 .state = WREPL_STATE_ACTIVE,
2610 .node = WREPL_NODE_B,
2612 .num_ips = ARRAY_SIZE(addresses_A_1),
2613 .ips = addresses_A_1,
2614 .apply_expected = True
2618 .type = WREPL_TYPE_MHOMED,
2619 .state = WREPL_STATE_ACTIVE,
2620 .node = WREPL_NODE_B,
2622 .num_ips = ARRAY_SIZE(addresses_A_1),
2623 .ips = addresses_A_1,
2624 .apply_expected = False
2629 * sgroup,active vs. mhomed,tombstone
2630 * => should NOT be replaced
2633 .line = __location__,
2634 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2637 .type = WREPL_TYPE_SGROUP,
2638 .state = WREPL_STATE_ACTIVE,
2639 .node = WREPL_NODE_B,
2641 .num_ips = ARRAY_SIZE(addresses_A_1),
2642 .ips = addresses_A_1,
2643 .apply_expected = True
2647 .type = WREPL_TYPE_MHOMED,
2648 .state = WREPL_STATE_TOMBSTONE,
2649 .node = WREPL_NODE_B,
2651 .num_ips = ARRAY_SIZE(addresses_A_1),
2652 .ips = addresses_A_1,
2653 .apply_expected = False
2658 * sgroup,released vs. mhomed,active
2659 * => should be replaced
2662 .line = __location__,
2663 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2666 .type = WREPL_TYPE_SGROUP,
2667 .state = WREPL_STATE_RELEASED,
2668 .node = WREPL_NODE_B,
2670 .num_ips = ARRAY_SIZE(addresses_A_1),
2671 .ips = addresses_A_1,
2672 .apply_expected = False
2676 .type = WREPL_TYPE_MHOMED,
2677 .state = WREPL_STATE_ACTIVE,
2678 .node = WREPL_NODE_B,
2680 .num_ips = ARRAY_SIZE(addresses_B_1),
2681 .ips = addresses_B_1,
2682 .apply_expected = True
2687 * sgroup,released vs. mhomed,tombstone
2688 * => should be replaced
2691 .line = __location__,
2692 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2695 .type = WREPL_TYPE_SGROUP,
2696 .state = WREPL_STATE_RELEASED,
2697 .node = WREPL_NODE_B,
2699 .num_ips = ARRAY_SIZE(addresses_B_1),
2700 .ips = addresses_B_1,
2701 .apply_expected = False
2705 .type = WREPL_TYPE_MHOMED,
2706 .state = WREPL_STATE_TOMBSTONE,
2707 .node = WREPL_NODE_B,
2709 .num_ips = ARRAY_SIZE(addresses_A_1),
2710 .ips = addresses_A_1,
2711 .apply_expected = True
2716 * sgroup,tombstone vs. mhomed,active
2717 * => should be replaced
2720 .line = __location__,
2721 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2724 .type = WREPL_TYPE_SGROUP,
2725 .state = WREPL_STATE_TOMBSTONE,
2726 .node = WREPL_NODE_B,
2728 .num_ips = ARRAY_SIZE(addresses_A_1),
2729 .ips = addresses_A_1,
2730 .apply_expected = True
2734 .type = WREPL_TYPE_MHOMED,
2735 .state = WREPL_STATE_ACTIVE,
2736 .node = WREPL_NODE_B,
2738 .num_ips = ARRAY_SIZE(addresses_B_1),
2739 .ips = addresses_B_1,
2740 .apply_expected = True
2745 * sgroup,tombstone vs. mhomed,tombstone
2746 * => should be replaced
2749 .line = __location__,
2750 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2753 .type = WREPL_TYPE_SGROUP,
2754 .state = WREPL_STATE_TOMBSTONE,
2755 .node = WREPL_NODE_B,
2757 .num_ips = ARRAY_SIZE(addresses_B_1),
2758 .ips = addresses_B_1,
2759 .apply_expected = True
2763 .type = WREPL_TYPE_MHOMED,
2764 .state = WREPL_STATE_TOMBSTONE,
2765 .node = WREPL_NODE_B,
2767 .num_ips = ARRAY_SIZE(addresses_A_1),
2768 .ips = addresses_A_1,
2769 .apply_expected = True
2774 * multi homed vs. unique section,
2777 * mhomed,active vs. unique,active
2778 * => should be replaced
2781 .line = __location__,
2782 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2785 .type = WREPL_TYPE_MHOMED,
2786 .state = WREPL_STATE_ACTIVE,
2787 .node = WREPL_NODE_B,
2789 .num_ips = ARRAY_SIZE(addresses_A_3_4),
2790 .ips = addresses_A_3_4,
2791 .apply_expected = True
2795 .type = WREPL_TYPE_UNIQUE,
2796 .state = WREPL_STATE_ACTIVE,
2797 .node = WREPL_NODE_B,
2799 .num_ips = ARRAY_SIZE(addresses_B_1),
2800 .ips = addresses_B_1,
2801 .apply_expected = True
2806 * mhomed,active vs. unique,tombstone
2807 * => should NOT be replaced
2810 .line = __location__,
2811 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2814 .type = WREPL_TYPE_MHOMED,
2815 .state = WREPL_STATE_ACTIVE,
2816 .node = WREPL_NODE_B,
2818 .num_ips = ARRAY_SIZE(addresses_B_1),
2819 .ips = addresses_B_1,
2820 .apply_expected = True
2824 .type = WREPL_TYPE_UNIQUE,
2825 .state = WREPL_STATE_TOMBSTONE,
2826 .node = WREPL_NODE_B,
2828 .num_ips = ARRAY_SIZE(addresses_B_1),
2829 .ips = addresses_B_1,
2830 .apply_expected = False
2835 * mhomed,released vs. unique,active
2836 * => should be replaced
2839 .line = __location__,
2840 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2843 .type = WREPL_TYPE_MHOMED,
2844 .state = WREPL_STATE_RELEASED,
2845 .node = WREPL_NODE_B,
2847 .num_ips = ARRAY_SIZE(addresses_A_1),
2848 .ips = addresses_A_1,
2849 .apply_expected = False
2853 .type = WREPL_TYPE_UNIQUE,
2854 .state = WREPL_STATE_ACTIVE,
2855 .node = WREPL_NODE_B,
2857 .num_ips = ARRAY_SIZE(addresses_B_1),
2858 .ips = addresses_B_1,
2859 .apply_expected = True
2864 * mhomed,released vs. uinique,tombstone
2865 * => should be replaced
2868 .line = __location__,
2869 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2872 .type = WREPL_TYPE_MHOMED,
2873 .state = WREPL_STATE_RELEASED,
2874 .node = WREPL_NODE_B,
2876 .num_ips = ARRAY_SIZE(addresses_B_1),
2877 .ips = addresses_B_1,
2878 .apply_expected = False
2882 .type = WREPL_TYPE_UNIQUE,
2883 .state = WREPL_STATE_TOMBSTONE,
2884 .node = WREPL_NODE_B,
2886 .num_ips = ARRAY_SIZE(addresses_A_1),
2887 .ips = addresses_A_1,
2888 .apply_expected = True
2893 * mhomed,tombstone vs. unique,active
2894 * => should be replaced
2897 .line = __location__,
2898 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2901 .type = WREPL_TYPE_MHOMED,
2902 .state = WREPL_STATE_TOMBSTONE,
2903 .node = WREPL_NODE_B,
2905 .num_ips = ARRAY_SIZE(addresses_A_1),
2906 .ips = addresses_A_1,
2907 .apply_expected = True
2911 .type = WREPL_TYPE_UNIQUE,
2912 .state = WREPL_STATE_ACTIVE,
2913 .node = WREPL_NODE_B,
2915 .num_ips = ARRAY_SIZE(addresses_B_1),
2916 .ips = addresses_B_1,
2917 .apply_expected = True
2922 * mhomed,tombstone vs. uinique,tombstone
2923 * => should be replaced
2926 .line = __location__,
2927 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2930 .type = WREPL_TYPE_MHOMED,
2931 .state = WREPL_STATE_TOMBSTONE,
2932 .node = WREPL_NODE_B,
2934 .num_ips = ARRAY_SIZE(addresses_B_1),
2935 .ips = addresses_B_1,
2936 .apply_expected = True
2940 .type = WREPL_TYPE_UNIQUE,
2941 .state = WREPL_STATE_TOMBSTONE,
2942 .node = WREPL_NODE_B,
2944 .num_ips = ARRAY_SIZE(addresses_A_1),
2945 .ips = addresses_A_1,
2946 .apply_expected = True
2951 * multi homed vs. normal group section,
2954 * mhomed,active vs. group,active
2955 * => should be replaced
2958 .line = __location__,
2959 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2962 .type = WREPL_TYPE_MHOMED,
2963 .state = WREPL_STATE_ACTIVE,
2964 .node = WREPL_NODE_B,
2966 .num_ips = ARRAY_SIZE(addresses_A_1),
2967 .ips = addresses_A_1,
2968 .apply_expected = True
2972 .type = WREPL_TYPE_GROUP,
2973 .state = WREPL_STATE_ACTIVE,
2974 .node = WREPL_NODE_B,
2976 .num_ips = ARRAY_SIZE(addresses_B_1),
2977 .ips = addresses_B_1,
2978 .apply_expected = True
2983 * mhomed,active vs. group,tombstone
2984 * => should NOT be replaced
2987 .line = __location__,
2988 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2991 .type = WREPL_TYPE_MHOMED,
2992 .state = WREPL_STATE_ACTIVE,
2993 .node = WREPL_NODE_B,
2995 .num_ips = ARRAY_SIZE(addresses_B_1),
2996 .ips = addresses_B_1,
2997 .apply_expected = True
3001 .type = WREPL_TYPE_GROUP,
3002 .state = WREPL_STATE_TOMBSTONE,
3003 .node = WREPL_NODE_B,
3005 .num_ips = ARRAY_SIZE(addresses_B_1),
3006 .ips = addresses_B_1,
3007 .apply_expected = False
3012 * mhomed,released vs. group,active
3013 * => should be replaced
3016 .line = __location__,
3017 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3020 .type = WREPL_TYPE_MHOMED,
3021 .state = WREPL_STATE_RELEASED,
3022 .node = WREPL_NODE_B,
3024 .num_ips = ARRAY_SIZE(addresses_B_1),
3025 .ips = addresses_B_1,
3026 .apply_expected = False
3030 .type = WREPL_TYPE_GROUP,
3031 .state = WREPL_STATE_ACTIVE,
3032 .node = WREPL_NODE_B,
3034 .num_ips = ARRAY_SIZE(addresses_A_1),
3035 .ips = addresses_A_1,
3036 .apply_expected = True
3041 * mhomed,released vs. group,tombstone
3042 * => should be replaced
3045 .line = __location__,
3046 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3049 .type = WREPL_TYPE_MHOMED,
3050 .state = WREPL_STATE_RELEASED,
3051 .node = WREPL_NODE_B,
3053 .num_ips = ARRAY_SIZE(addresses_A_1),
3054 .ips = addresses_A_1,
3055 .apply_expected = False
3059 .type = WREPL_TYPE_GROUP,
3060 .state = WREPL_STATE_TOMBSTONE,
3061 .node = WREPL_NODE_B,
3063 .num_ips = ARRAY_SIZE(addresses_B_1),
3064 .ips = addresses_B_1,
3065 .apply_expected = True
3070 * mhomed,tombstone vs. group,active
3071 * => should be replaced
3074 .line = __location__,
3075 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3078 .type = WREPL_TYPE_MHOMED,
3079 .state = WREPL_STATE_TOMBSTONE,
3080 .node = WREPL_NODE_B,
3082 .num_ips = ARRAY_SIZE(addresses_B_1),
3083 .ips = addresses_B_1,
3084 .apply_expected = True
3088 .type = WREPL_TYPE_GROUP,
3089 .state = WREPL_STATE_ACTIVE,
3090 .node = WREPL_NODE_B,
3092 .num_ips = ARRAY_SIZE(addresses_A_1),
3093 .ips = addresses_A_1,
3094 .apply_expected = True
3099 * mhomed,tombstone vs. group,tombstone
3100 * => should be replaced
3103 .line = __location__,
3104 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3107 .type = WREPL_TYPE_MHOMED,
3108 .state = WREPL_STATE_TOMBSTONE,
3109 .node = WREPL_NODE_B,
3111 .num_ips = ARRAY_SIZE(addresses_A_1),
3112 .ips = addresses_A_1,
3113 .apply_expected = True
3117 .type = WREPL_TYPE_GROUP,
3118 .state = WREPL_STATE_TOMBSTONE,
3119 .node = WREPL_NODE_B,
3121 .num_ips = ARRAY_SIZE(addresses_B_1),
3122 .ips = addresses_B_1,
3123 .apply_expected = True
3128 * multi homed vs. special group section,
3131 * mhomed,active vs. sgroup,active
3132 * => should NOT be replaced
3135 .line = __location__,
3136 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3139 .type = WREPL_TYPE_MHOMED,
3140 .state = WREPL_STATE_ACTIVE,
3141 .node = WREPL_NODE_B,
3143 .num_ips = ARRAY_SIZE(addresses_A_1),
3144 .ips = addresses_A_1,
3145 .apply_expected = True
3149 .type = WREPL_TYPE_SGROUP,
3150 .state = WREPL_STATE_ACTIVE,
3151 .node = WREPL_NODE_B,
3153 .num_ips = ARRAY_SIZE(addresses_A_1),
3154 .ips = addresses_A_1,
3155 .apply_expected = False
3160 * mhomed,active vs. sgroup,tombstone
3161 * => should NOT be replaced
3164 .line = __location__,
3165 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3168 .type = WREPL_TYPE_MHOMED,
3169 .state = WREPL_STATE_ACTIVE,
3170 .node = WREPL_NODE_B,
3172 .num_ips = ARRAY_SIZE(addresses_A_1),
3173 .ips = addresses_A_1,
3174 .apply_expected = True
3178 .type = WREPL_TYPE_SGROUP,
3179 .state = WREPL_STATE_TOMBSTONE,
3180 .node = WREPL_NODE_B,
3182 .num_ips = ARRAY_SIZE(addresses_A_1),
3183 .ips = addresses_A_1,
3184 .apply_expected = False
3189 * mhomed,released vs. sgroup,active
3190 * => should be replaced
3193 .line = __location__,
3194 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3197 .type = WREPL_TYPE_MHOMED,
3198 .state = WREPL_STATE_RELEASED,
3199 .node = WREPL_NODE_B,
3201 .num_ips = ARRAY_SIZE(addresses_A_1),
3202 .ips = addresses_A_1,
3203 .apply_expected = False
3207 .type = WREPL_TYPE_SGROUP,
3208 .state = WREPL_STATE_ACTIVE,
3209 .node = WREPL_NODE_B,
3211 .num_ips = ARRAY_SIZE(addresses_B_1),
3212 .ips = addresses_B_1,
3213 .apply_expected = True
3218 * mhomed,released vs. sgroup,tombstone
3219 * => should be replaced
3222 .line = __location__,
3223 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3226 .type = WREPL_TYPE_MHOMED,
3227 .state = WREPL_STATE_RELEASED,
3228 .node = WREPL_NODE_B,
3230 .num_ips = ARRAY_SIZE(addresses_B_1),
3231 .ips = addresses_B_1,
3232 .apply_expected = False
3236 .type = WREPL_TYPE_SGROUP,
3237 .state = WREPL_STATE_TOMBSTONE,
3238 .node = WREPL_NODE_B,
3240 .num_ips = ARRAY_SIZE(addresses_A_1),
3241 .ips = addresses_A_1,
3242 .apply_expected = True
3247 * mhomed,tombstone vs. sgroup,active
3248 * => should be replaced
3251 .line = __location__,
3252 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3255 .type = WREPL_TYPE_MHOMED,
3256 .state = WREPL_STATE_TOMBSTONE,
3257 .node = WREPL_NODE_B,
3259 .num_ips = ARRAY_SIZE(addresses_A_1),
3260 .ips = addresses_A_1,
3261 .apply_expected = True
3265 .type = WREPL_TYPE_SGROUP,
3266 .state = WREPL_STATE_ACTIVE,
3267 .node = WREPL_NODE_B,
3269 .num_ips = ARRAY_SIZE(addresses_B_1),
3270 .ips = addresses_B_1,
3271 .apply_expected = True
3276 * mhomed,tombstone vs. sgroup,tombstone
3277 * => should be replaced
3280 .line = __location__,
3281 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3284 .type = WREPL_TYPE_MHOMED,
3285 .state = WREPL_STATE_TOMBSTONE,
3286 .node = WREPL_NODE_B,
3288 .num_ips = ARRAY_SIZE(addresses_B_1),
3289 .ips = addresses_B_1,
3290 .apply_expected = True
3294 .type = WREPL_TYPE_SGROUP,
3295 .state = WREPL_STATE_TOMBSTONE,
3296 .node = WREPL_NODE_B,
3298 .num_ips = ARRAY_SIZE(addresses_A_1),
3299 .ips = addresses_A_1,
3300 .apply_expected = True
3305 * multi homed vs. mlti homed section,
3308 * mhomed,active vs. mhomed,active
3309 * => should be replaced
3312 .line = __location__,
3313 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3316 .type = WREPL_TYPE_MHOMED,
3317 .state = WREPL_STATE_ACTIVE,
3318 .node = WREPL_NODE_B,
3320 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3321 .ips = addresses_A_3_4,
3322 .apply_expected = True
3326 .type = WREPL_TYPE_MHOMED,
3327 .state = WREPL_STATE_ACTIVE,
3328 .node = WREPL_NODE_B,
3330 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3331 .ips = addresses_B_3_4,
3332 .apply_expected = True
3337 * mhomed,active vs. mhomed,tombstone
3338 * => should NOT be replaced
3341 .line = __location__,
3342 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3345 .type = WREPL_TYPE_MHOMED,
3346 .state = WREPL_STATE_ACTIVE,
3347 .node = WREPL_NODE_B,
3349 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3350 .ips = addresses_B_3_4,
3351 .apply_expected = True
3355 .type = WREPL_TYPE_MHOMED,
3356 .state = WREPL_STATE_TOMBSTONE,
3357 .node = WREPL_NODE_B,
3359 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3360 .ips = addresses_B_3_4,
3361 .apply_expected = False
3366 * mhomed,released vs. mhomed,active
3367 * => should be replaced
3370 .line = __location__,
3371 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3374 .type = WREPL_TYPE_MHOMED,
3375 .state = WREPL_STATE_RELEASED,
3376 .node = WREPL_NODE_B,
3378 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3379 .ips = addresses_B_3_4,
3380 .apply_expected = False
3384 .type = WREPL_TYPE_MHOMED,
3385 .state = WREPL_STATE_ACTIVE,
3386 .node = WREPL_NODE_B,
3388 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3389 .ips = addresses_A_3_4,
3390 .apply_expected = True
3395 * mhomed,released vs. mhomed,tombstone
3396 * => should be replaced
3399 .line = __location__,
3400 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3403 .type = WREPL_TYPE_MHOMED,
3404 .state = WREPL_STATE_RELEASED,
3405 .node = WREPL_NODE_B,
3407 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3408 .ips = addresses_A_3_4,
3409 .apply_expected = False
3413 .type = WREPL_TYPE_MHOMED,
3414 .state = WREPL_STATE_TOMBSTONE,
3415 .node = WREPL_NODE_B,
3417 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3418 .ips = addresses_B_3_4,
3419 .apply_expected = True
3424 * mhomed,tombstone vs. mhomed,active
3425 * => should be replaced
3428 .line = __location__,
3429 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3432 .type = WREPL_TYPE_MHOMED,
3433 .state = WREPL_STATE_TOMBSTONE,
3434 .node = WREPL_NODE_B,
3436 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3437 .ips = addresses_B_3_4,
3438 .apply_expected = True
3442 .type = WREPL_TYPE_MHOMED,
3443 .state = WREPL_STATE_ACTIVE,
3444 .node = WREPL_NODE_B,
3446 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3447 .ips = addresses_A_3_4,
3448 .apply_expected = True
3453 * mhomed,tombstone vs. mhomed,tombstone
3454 * => should be replaced
3457 .line = __location__,
3458 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3461 .type = WREPL_TYPE_MHOMED,
3462 .state = WREPL_STATE_TOMBSTONE,
3463 .node = WREPL_NODE_B,
3465 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3466 .ips = addresses_A_3_4,
3467 .apply_expected = True
3471 .type = WREPL_TYPE_MHOMED,
3472 .state = WREPL_STATE_TOMBSTONE,
3473 .node = WREPL_NODE_B,
3475 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3476 .ips = addresses_B_3_4,
3477 .apply_expected = True
3483 * special group vs special group section,
3486 * sgroup,active vs. sgroup,active
3487 * => should be merged
3490 .line = __location__,
3491 .name = _NBT_NAME("_DIFF_OWNER_SG", 0x00, NULL),
3495 .type = WREPL_TYPE_SGROUP,
3496 .state = WREPL_STATE_ACTIVE,
3497 .node = WREPL_NODE_B,
3499 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3500 .ips = addresses_A_3_4,
3501 .apply_expected = True,
3505 .type = WREPL_TYPE_SGROUP,
3506 .state = WREPL_STATE_ACTIVE,
3507 .node = WREPL_NODE_B,
3509 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3510 .ips = addresses_B_3_4,
3511 .apply_expected = False,
3512 .merge_expected = True
3516 .line = __location__,
3517 .name = _NBT_NAME("_DIFF_OWNER_SG", 0x00, NULL),
3521 .type = WREPL_TYPE_SGROUP,
3522 .state = WREPL_STATE_ACTIVE,
3523 .node = WREPL_NODE_B,
3527 .apply_expected = False
3531 .type = WREPL_TYPE_SGROUP,
3532 .state = WREPL_STATE_ACTIVE,
3533 .node = WREPL_NODE_B,
3537 .apply_expected = False,
3538 .merge_expected = False
3542 .line = __location__,
3543 .name = _NBT_NAME("_DIFF_OWNER_SG", 0x00, NULL),
3547 .type = WREPL_TYPE_SGROUP,
3548 .state = WREPL_STATE_ACTIVE,
3549 .node = WREPL_NODE_B,
3551 .num_ips = ARRAY_SIZE(addresses_A_1),
3552 .ips = addresses_A_1,
3553 .apply_expected = True
3557 .type = WREPL_TYPE_UNIQUE,
3558 .state = WREPL_STATE_TOMBSTONE,
3559 .node = WREPL_NODE_B,
3561 .num_ips = ARRAY_SIZE(addresses_A_1),
3562 .ips = addresses_A_1,
3563 .apply_expected = True
3568 * This should be the last record in this array,
3569 * we need to make sure the we leave a tombstoned unique entry
3573 .line = __location__,
3574 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3578 .type = WREPL_TYPE_UNIQUE,
3579 .state = WREPL_STATE_TOMBSTONE,
3580 .node = WREPL_NODE_B,
3582 .num_ips = ARRAY_SIZE(addresses_A_1),
3583 .ips = addresses_A_1,
3584 .apply_expected = True
3588 .type = WREPL_TYPE_UNIQUE,
3589 .state = WREPL_STATE_TOMBSTONE,
3590 .node = WREPL_NODE_B,
3592 .num_ips = ARRAY_SIZE(addresses_A_1),
3593 .ips = addresses_A_1,
3594 .apply_expected = True
3596 }}; /* do not add entries here, this should be the last record! */
3598 if (!ctx) return False;
3600 wins_name_r1 = &wins_name1;
3601 wins_name_r2 = &wins_name2;
3603 printf("Test Replica Conflicts with different owners\n");
3605 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
3607 if (!records[i].extra && !records[i].cleanup) {
3608 /* we should test the worst cases */
3609 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
3610 printf("(%s) Programmer error, invalid record[%u]: %s\n",
3611 __location__, i, records[i].line);
3613 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
3614 printf("(%s) Programmer error, invalid record[%u]: %s\n",
3615 __location__, i, records[i].line);
3620 if (!records[i].cleanup) {
3621 const char *expected;
3624 if (records[i].r2.merge_expected) {
3626 } else if (records[i].r2.apply_expected) {
3627 expected = "REPLACE";
3629 expected = "NOT REPLACE";
3632 if (!records[i].r1.ips && !records[i].r2.ips) {
3634 } else if (records[i].r1.ips==records[i].r2.ips) {
3640 printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
3641 wrepl_name_type_string(records[i].r1.type),
3642 wrepl_name_state_string(records[i].r1.state),
3643 (records[i].r1.is_static?",static":""),
3644 wrepl_name_type_string(records[i].r2.type),
3645 wrepl_name_state_string(records[i].r2.state),
3646 (records[i].r2.is_static?",static":""),
3653 wins_name_r1->name = &records[i].name;
3654 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
3655 records[i].r1.state,
3657 records[i].r1.is_static);
3658 wins_name_r1->id = ++records[i].r1.owner->max_version;
3659 if (wins_name_r1->flags & 2) {
3660 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
3661 wins_name_r1->addresses.addresses.ips = discard_const(records[i].r1.ips);
3663 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
3665 wins_name_r1->unknown = "255.255.255.255";
3668 ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1);
3669 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
3670 wins_name_r1, records[i].r1.apply_expected);
3675 wins_name_r2->name = &records[i].name;
3676 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
3677 records[i].r2.state,
3679 records[i].r2.is_static);
3680 wins_name_r2->id = ++records[i].r2.owner->max_version;
3681 if (wins_name_r2->flags & 2) {
3682 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
3683 wins_name_r2->addresses.addresses.ips = discard_const(records[i].r2.ips);
3685 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
3687 wins_name_r2->unknown = "255.255.255.255";
3690 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
3691 if (records[i].r1.state == WREPL_STATE_RELEASED) {
3692 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
3693 wins_name_r1, False);
3694 } else if (records[i].r2.merge_expected) {
3695 ret &= test_wrepl_is_merged(ctx, wins_name_r1, wins_name_r2);
3696 } else if (records[i].r1.owner != records[i].r2.owner) {
3698 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
3699 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
3700 wins_name_r1, _expected);
3702 if (records[i].r2.state == WREPL_STATE_RELEASED) {
3703 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
3704 wins_name_r2, False);
3705 } else if (!records[i].r2.merge_expected) {
3706 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
3707 wins_name_r2, records[i].r2.apply_expected);
3710 /* the first one is a cleanup run */
3711 if (!ret && i == 0) ret = True;
3714 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
3723 test WINS replication operations
3725 BOOL torture_nbt_winsreplication_quick(void)
3727 const char *address;
3728 struct nbt_name name;
3729 TALLOC_CTX *mem_ctx = talloc_new(NULL);
3733 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
3735 /* do an initial name resolution to find its IP */
3736 status = resolve_name(&name, mem_ctx, &address, NULL);
3737 if (!NT_STATUS_IS_OK(status)) {
3738 printf("Failed to resolve %s - %s\n",
3739 name.name, nt_errstr(status));
3740 talloc_free(mem_ctx);
3744 ret &= test_assoc_ctx1(mem_ctx, address);
3745 ret &= test_assoc_ctx2(mem_ctx, address);
3747 talloc_free(mem_ctx);
3753 test WINS replication operations
3755 BOOL torture_nbt_winsreplication(void)
3757 const char *address;
3758 struct nbt_name name;
3759 TALLOC_CTX *mem_ctx = talloc_new(NULL);
3762 struct test_wrepl_conflict_conn *ctx;
3764 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
3766 /* do an initial name resolution to find its IP */
3767 status = resolve_name(&name, mem_ctx, &address, NULL);
3768 if (!NT_STATUS_IS_OK(status)) {
3769 printf("Failed to resolve %s - %s\n",
3770 name.name, nt_errstr(status));
3771 talloc_free(mem_ctx);
3775 ret &= test_assoc_ctx1(mem_ctx, address);
3776 ret &= test_assoc_ctx2(mem_ctx, address);
3778 ret &= test_wins_replication(mem_ctx, address);
3780 ctx = test_create_conflict_ctx(mem_ctx, address);
3782 ret &= test_conflict_same_owner(ctx);
3783 ret &= test_conflict_different_owner(ctx);
3785 talloc_free(mem_ctx);