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;
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 pull_table.in.assoc_ctx = ctx->pull_assoc;
413 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
414 if (!NT_STATUS_IS_OK(status)) return NULL;
416 for (i=0; i < pull_table.out.num_partners; i++) {
417 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
418 ctx->a.max_version = pull_table.out.partners[i].max_version;
419 ctx->a.min_version = pull_table.out.partners[i].min_version;
421 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
422 ctx->b.max_version = pull_table.out.partners[i].max_version;
423 ctx->b.min_version = pull_table.out.partners[i].min_version;
427 talloc_free(pull_table.out.partners);
432 static BOOL test_wrepl_update_one(struct test_wrepl_conflict_conn *ctx,
433 const struct wrepl_wins_owner *owner,
434 const struct wrepl_wins_name *name)
437 struct wrepl_socket *wrepl_socket;
438 struct wrepl_associate associate;
439 struct wrepl_packet update_packet, repl_send;
440 struct wrepl_table *update;
441 struct wrepl_wins_owner wrepl_wins_owners[1];
442 struct wrepl_packet *repl_recv;
443 struct wrepl_wins_owner *send_request;
444 struct wrepl_send_reply *send_reply;
445 struct wrepl_wins_name wrepl_wins_names[1];
449 wrepl_socket = wrepl_socket_init(ctx, NULL);
451 status = wrepl_connect(wrepl_socket, NULL, ctx->address);
452 CHECK_STATUS(status, NT_STATUS_OK);
454 status = wrepl_associate(wrepl_socket, &associate);
455 CHECK_STATUS(status, NT_STATUS_OK);
456 assoc_ctx = associate.out.assoc_ctx;
458 /* now send a WREPL_REPL_UPDATE message */
459 ZERO_STRUCT(update_packet);
460 update_packet.opcode = WREPL_OPCODE_BITS;
461 update_packet.assoc_ctx = assoc_ctx;
462 update_packet.mess_type = WREPL_REPLICATION;
463 update_packet.message.replication.command = WREPL_REPL_UPDATE;
464 update = &update_packet.message.replication.info.table;
466 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
467 update->partners = wrepl_wins_owners;
468 update->initiator = "0.0.0.0";
470 wrepl_wins_owners[0] = *owner;
472 status = wrepl_request(wrepl_socket, wrepl_socket,
473 &update_packet, &repl_recv);
474 CHECK_STATUS(status, NT_STATUS_OK);
475 CHECK_VALUE(repl_recv->mess_type, WREPL_REPLICATION);
476 CHECK_VALUE(repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
477 send_request = &repl_recv->message.replication.info.owner;
479 ZERO_STRUCT(repl_send);
480 repl_send.opcode = WREPL_OPCODE_BITS;
481 repl_send.assoc_ctx = assoc_ctx;
482 repl_send.mess_type = WREPL_REPLICATION;
483 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
484 send_reply = &repl_send.message.replication.info.reply;
486 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
487 send_reply->names = wrepl_wins_names;
489 wrepl_wins_names[0] = *name;
491 status = wrepl_request(wrepl_socket, wrepl_socket,
492 &repl_send, &repl_recv);
493 CHECK_STATUS(status, NT_STATUS_OK);
494 CHECK_VALUE(repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
495 CHECK_VALUE(repl_recv->message.stop.reason, 0);
498 talloc_free(wrepl_socket);
502 static BOOL test_wrepl_is_applied(struct test_wrepl_conflict_conn *ctx,
503 const struct wrepl_wins_owner *owner,
504 const struct wrepl_wins_name *name,
509 struct wrepl_pull_names pull_names;
510 struct wrepl_name *names;
512 pull_names.in.assoc_ctx = ctx->pull_assoc;
513 pull_names.in.partner = *owner;
514 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
516 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
517 CHECK_STATUS(status, NT_STATUS_OK);
518 CHECK_VALUE(pull_names.out.num_names, (expected?1:0));
520 names = pull_names.out.names;
523 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
527 CHECK_VALUE(names[0].name.type, name->name->type);
528 CHECK_VALUE_STRING(names[0].name.name, name->name->name);
529 CHECK_VALUE_STRING(names[0].name.scope, name->name->scope);
530 CHECK_VALUE(flags, name->flags);
531 CHECK_VALUE_UINT64(names[0].version_id, name->id);
534 talloc_free(pull_names.out.names);
538 static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx)
541 struct nbt_name name;
542 struct wrepl_wins_name wins_name1;
543 struct wrepl_wins_name wins_name2;
544 struct wrepl_wins_name *wins_name_tmp;
545 struct wrepl_wins_name *wins_name_last;
546 struct wrepl_wins_name *wins_name_cur;
548 uint8_t types[] = { 0x00, 0x1C };
550 enum wrepl_name_type type;
551 enum wrepl_name_state state;
552 enum wrepl_name_node node;
555 const struct wrepl_ip *ips;
558 .type = WREPL_TYPE_GROUP,
559 .state = WREPL_STATE_ACTIVE,
560 .node = WREPL_NODE_B,
562 .num_ips = ARRAY_SIZE(addresses_A_1),
563 .ips = addresses_A_1,
565 .type = WREPL_TYPE_UNIQUE,
566 .state = WREPL_STATE_ACTIVE,
567 .node = WREPL_NODE_B,
569 .num_ips = ARRAY_SIZE(addresses_A_1),
570 .ips = addresses_A_1,
572 .type = WREPL_TYPE_UNIQUE,
573 .state = WREPL_STATE_ACTIVE,
574 .node = WREPL_NODE_B,
576 .num_ips = ARRAY_SIZE(addresses_A_2),
577 .ips = addresses_A_2,
579 .type = WREPL_TYPE_UNIQUE,
580 .state = WREPL_STATE_ACTIVE,
581 .node = WREPL_NODE_B,
583 .num_ips = ARRAY_SIZE(addresses_A_1),
584 .ips = addresses_A_1,
586 .type = WREPL_TYPE_UNIQUE,
587 .state = WREPL_STATE_ACTIVE,
588 .node = WREPL_NODE_B,
590 .num_ips = ARRAY_SIZE(addresses_A_2),
591 .ips = addresses_A_2,
593 .type = WREPL_TYPE_SGROUP,
594 .state = WREPL_STATE_TOMBSTONE,
595 .node = WREPL_NODE_B,
597 .num_ips = ARRAY_SIZE(addresses_A_2),
598 .ips = addresses_A_2,
600 .type = WREPL_TYPE_MHOMED,
601 .state = WREPL_STATE_TOMBSTONE,
602 .node = WREPL_NODE_B,
604 .num_ips = ARRAY_SIZE(addresses_A_1),
605 .ips = addresses_A_1,
607 .type = WREPL_TYPE_MHOMED,
608 .state = WREPL_STATE_RELEASED,
609 .node = WREPL_NODE_B,
611 .num_ips = ARRAY_SIZE(addresses_A_2),
612 .ips = addresses_A_2,
614 .type = WREPL_TYPE_SGROUP,
615 .state = WREPL_STATE_ACTIVE,
616 .node = WREPL_NODE_B,
618 .num_ips = ARRAY_SIZE(addresses_A_1),
619 .ips = addresses_A_1,
621 /* the last one should always be a unique,tomstone record! */
622 .type = WREPL_TYPE_UNIQUE,
623 .state = WREPL_STATE_TOMBSTONE,
624 .node = WREPL_NODE_B,
626 .num_ips = ARRAY_SIZE(addresses_A_1),
627 .ips = addresses_A_1,
631 if (!ctx) return False;
633 name.name = "_SAME_OWNER_A";
637 wins_name_tmp = NULL;
638 wins_name_last = &wins_name2;
639 wins_name_cur = &wins_name1;
641 for (j=0; ret && j < ARRAY_SIZE(types); j++) {
642 name.type = types[j];
643 printf("Test Replica Conflicts with same owner[%s] for %s\n",
644 nbt_name_string(ctx, &name), ctx->a.address);
646 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
647 wins_name_tmp = wins_name_last;
648 wins_name_last = wins_name_cur;
649 wins_name_cur = wins_name_tmp;
652 printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
653 wrepl_name_type_string(records[i-1].type),
654 wrepl_name_state_string(records[i-1].state),
655 (records[i-1].is_static?",static":""),
656 wrepl_name_type_string(records[i].type),
657 wrepl_name_state_string(records[i].state),
658 (records[i].is_static?",static":""),
659 (records[i-1].ips==records[i].ips?"same":"different"),
663 wins_name_cur->name = &name;
664 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
667 records[i].is_static);
668 wins_name_cur->id = ++ctx->a.max_version;
669 if (wins_name_cur->flags & 2) {
670 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
671 wins_name_cur->addresses.addresses.ips = discard_const(records[i].ips);
673 wins_name_cur->addresses.ip = records[i].ips[0].ip;
675 wins_name_cur->unknown = "255.255.255.255";
677 ret &= test_wrepl_update_one(ctx, &ctx->a,wins_name_cur);
678 if (records[i].state == WREPL_STATE_RELEASED) {
679 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_last, False);
680 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, False);
682 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, True);
685 /* the first one is a cleanup run */
686 if (!ret && i == 0) ret = True;
689 printf("conflict handled wrong or record[%u]: %s\n", i, __location__);
697 static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx)
700 struct wrepl_wins_name wins_name1;
701 struct wrepl_wins_name wins_name2;
702 struct wrepl_wins_name *wins_name_r1;
703 struct wrepl_wins_name *wins_name_r2;
706 const char *line; /* just better debugging */
707 struct nbt_name name;
708 BOOL extra; /* not the worst case, this is an extra test */
711 struct wrepl_wins_owner *owner;
712 enum wrepl_name_type type;
713 enum wrepl_name_state state;
714 enum wrepl_name_node node;
717 const struct wrepl_ip *ips;
722 * NOTE: the first record and the last applied one
723 * needs to be from the same owner,
724 * to not conflict in the next smbtorture run!!!
727 .line = __location__,
728 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
732 .type = WREPL_TYPE_UNIQUE,
733 .state = WREPL_STATE_TOMBSTONE,
734 .node = WREPL_NODE_B,
736 .num_ips = ARRAY_SIZE(addresses_B_1),
737 .ips = addresses_B_1,
738 .apply_expected = True /* ignored */
742 .type = WREPL_TYPE_UNIQUE,
743 .state = WREPL_STATE_TOMBSTONE,
744 .node = WREPL_NODE_B,
746 .num_ips = ARRAY_SIZE(addresses_A_1),
747 .ips = addresses_A_1,
748 .apply_expected = True /* ignored */
753 * unique vs unique section
756 * unique,active vs. unique,active the same ip
757 * => should be replaced
760 .line = __location__,
761 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
765 .type = WREPL_TYPE_UNIQUE,
766 .state = WREPL_STATE_ACTIVE,
767 .node = WREPL_NODE_B,
769 .num_ips = ARRAY_SIZE(addresses_A_1),
770 .ips = addresses_A_1,
771 .apply_expected = True
775 .type = WREPL_TYPE_UNIQUE,
776 .state = WREPL_STATE_ACTIVE,
777 .node = WREPL_NODE_B,
779 .num_ips = ARRAY_SIZE(addresses_A_1),
780 .ips = addresses_A_1,
781 .apply_expected = True
786 * unique,active vs. unique,tombstone the same ips
787 * => should NOT be replaced
790 .line = __location__,
791 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
795 .type = WREPL_TYPE_UNIQUE,
796 .state = WREPL_STATE_ACTIVE,
797 .node = WREPL_NODE_B,
799 .num_ips = ARRAY_SIZE(addresses_B_1),
800 .ips = addresses_B_1,
801 .apply_expected = True
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 = False
816 * unique,tombstone vs. unique,active the same ips
817 * => should NOT be replaced
820 .line = __location__,
821 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
825 .type = WREPL_TYPE_UNIQUE,
826 .state = WREPL_STATE_TOMBSTONE,
827 .node = WREPL_NODE_B,
829 .num_ips = ARRAY_SIZE(addresses_B_1),
830 .ips = addresses_B_1,
831 .apply_expected = True
835 .type = WREPL_TYPE_UNIQUE,
836 .state = WREPL_STATE_ACTIVE,
837 .node = WREPL_NODE_B,
839 .num_ips = ARRAY_SIZE(addresses_B_1),
840 .ips = addresses_B_1,
841 .apply_expected = True
846 * unique,tombstone vs. unique,tombstone the same ips
847 * => should be replaced
850 .line = __location__,
851 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
855 .type = WREPL_TYPE_UNIQUE,
856 .state = WREPL_STATE_TOMBSTONE,
857 .node = WREPL_NODE_B,
859 .num_ips = ARRAY_SIZE(addresses_A_1),
860 .ips = addresses_A_1,
861 .apply_expected = True
865 .type = WREPL_TYPE_UNIQUE,
866 .state = WREPL_STATE_TOMBSTONE,
867 .node = WREPL_NODE_B,
869 .num_ips = ARRAY_SIZE(addresses_A_1),
870 .ips = addresses_A_1,
871 .apply_expected = True
876 * unique,active vs. unique,active the different ips
877 * => should be replaced
880 .line = __location__,
881 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
884 .type = WREPL_TYPE_UNIQUE,
885 .state = WREPL_STATE_ACTIVE,
886 .node = WREPL_NODE_B,
888 .num_ips = ARRAY_SIZE(addresses_A_1),
889 .ips = addresses_A_1,
890 .apply_expected = True
894 .type = WREPL_TYPE_UNIQUE,
895 .state = WREPL_STATE_ACTIVE,
896 .node = WREPL_NODE_B,
898 .num_ips = ARRAY_SIZE(addresses_B_1),
899 .ips = addresses_B_1,
900 .apply_expected = True
905 * unique,active vs. unique,tombstone the different ips
906 * => should NOT be replaced
909 .line = __location__,
910 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
914 .type = WREPL_TYPE_UNIQUE,
915 .state = WREPL_STATE_ACTIVE,
916 .node = WREPL_NODE_B,
918 .num_ips = ARRAY_SIZE(addresses_B_1),
919 .ips = addresses_B_1,
920 .apply_expected = True
924 .type = WREPL_TYPE_UNIQUE,
925 .state = WREPL_STATE_TOMBSTONE,
926 .node = WREPL_NODE_B,
928 .num_ips = ARRAY_SIZE(addresses_A_1),
929 .ips = addresses_A_1,
930 .apply_expected = False
935 * unique,tombstone vs. unique,active the different ips
936 * => should be replaced
939 .line = __location__,
940 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
943 .type = WREPL_TYPE_UNIQUE,
944 .state = WREPL_STATE_TOMBSTONE,
945 .node = WREPL_NODE_B,
947 .num_ips = ARRAY_SIZE(addresses_B_1),
948 .ips = addresses_B_1,
949 .apply_expected = True
953 .type = WREPL_TYPE_UNIQUE,
954 .state = WREPL_STATE_ACTIVE,
955 .node = WREPL_NODE_B,
957 .num_ips = ARRAY_SIZE(addresses_A_1),
958 .ips = addresses_A_1,
959 .apply_expected = True
964 * unique,tombstone vs. unique,tombstone the different ips
965 * => should be replaced
968 .line = __location__,
969 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
972 .type = WREPL_TYPE_UNIQUE,
973 .state = WREPL_STATE_TOMBSTONE,
974 .node = WREPL_NODE_B,
976 .num_ips = ARRAY_SIZE(addresses_A_1),
977 .ips = addresses_A_1,
978 .apply_expected = True
982 .type = WREPL_TYPE_UNIQUE,
983 .state = WREPL_STATE_TOMBSTONE,
984 .node = WREPL_NODE_B,
986 .num_ips = ARRAY_SIZE(addresses_B_1),
987 .ips = addresses_B_1,
988 .apply_expected = True
993 * unique vs normal groups section,
996 * unique,active vs. group,active
997 * => should be replaced
1000 .line = __location__,
1001 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1004 .type = WREPL_TYPE_UNIQUE,
1005 .state = WREPL_STATE_ACTIVE,
1006 .node = WREPL_NODE_B,
1008 .num_ips = ARRAY_SIZE(addresses_B_1),
1009 .ips = addresses_B_1,
1010 .apply_expected = True
1014 .type = WREPL_TYPE_GROUP,
1015 .state = WREPL_STATE_ACTIVE,
1016 .node = WREPL_NODE_B,
1018 .num_ips = ARRAY_SIZE(addresses_A_1),
1019 .ips = addresses_A_1,
1020 .apply_expected = True
1025 * unique,active vs. group,tombstone same ip
1026 * => should NOT be replaced
1029 .line = __location__,
1030 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1033 .type = WREPL_TYPE_UNIQUE,
1034 .state = WREPL_STATE_ACTIVE,
1035 .node = WREPL_NODE_B,
1037 .num_ips = ARRAY_SIZE(addresses_A_1),
1038 .ips = addresses_A_1,
1039 .apply_expected = True
1043 .type = WREPL_TYPE_GROUP,
1044 .state = WREPL_STATE_TOMBSTONE,
1045 .node = WREPL_NODE_B,
1047 .num_ips = ARRAY_SIZE(addresses_A_1),
1048 .ips = addresses_A_1,
1049 .apply_expected = False
1054 * unique,active vs. group,tombstone different ip
1055 * => should NOT be replaced
1058 .line = __location__,
1059 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1063 .type = WREPL_TYPE_UNIQUE,
1064 .state = WREPL_STATE_ACTIVE,
1065 .node = WREPL_NODE_B,
1067 .num_ips = ARRAY_SIZE(addresses_A_1),
1068 .ips = addresses_A_1,
1069 .apply_expected = True
1073 .type = WREPL_TYPE_GROUP,
1074 .state = WREPL_STATE_TOMBSTONE,
1075 .node = WREPL_NODE_B,
1077 .num_ips = ARRAY_SIZE(addresses_B_1),
1078 .ips = addresses_B_1,
1079 .apply_expected = False
1084 * unique,active vs. group,released
1085 * => should NOT be replaced
1088 .line = __location__,
1089 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1092 .type = WREPL_TYPE_UNIQUE,
1093 .state = WREPL_STATE_ACTIVE,
1094 .node = WREPL_NODE_B,
1096 .num_ips = ARRAY_SIZE(addresses_A_1),
1097 .ips = addresses_A_1,
1098 .apply_expected = True
1102 .type = WREPL_TYPE_GROUP,
1103 .state = WREPL_STATE_RELEASED,
1104 .node = WREPL_NODE_B,
1106 .num_ips = ARRAY_SIZE(addresses_A_1),
1107 .ips = addresses_A_1,
1108 .apply_expected = False
1113 * unique,tombstone vs. group,active
1114 * => should be replaced
1117 .line = __location__,
1118 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1121 .type = WREPL_TYPE_UNIQUE,
1122 .state = WREPL_STATE_TOMBSTONE,
1123 .node = WREPL_NODE_B,
1125 .num_ips = ARRAY_SIZE(addresses_A_1),
1126 .ips = addresses_A_1,
1127 .apply_expected = True
1131 .type = WREPL_TYPE_GROUP,
1132 .state = WREPL_STATE_ACTIVE,
1133 .node = WREPL_NODE_B,
1135 .num_ips = ARRAY_SIZE(addresses_B_1),
1136 .ips = addresses_B_1,
1137 .apply_expected = True
1142 * unique,tombstone vs. group,tombstone
1143 * => should be replaced
1146 .line = __location__,
1147 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1150 .type = WREPL_TYPE_UNIQUE,
1151 .state = WREPL_STATE_TOMBSTONE,
1152 .node = WREPL_NODE_B,
1154 .num_ips = ARRAY_SIZE(addresses_B_1),
1155 .ips = addresses_B_1,
1156 .apply_expected = True
1160 .type = WREPL_TYPE_GROUP,
1161 .state = WREPL_STATE_TOMBSTONE,
1162 .node = WREPL_NODE_B,
1164 .num_ips = ARRAY_SIZE(addresses_A_1),
1165 .ips = addresses_A_1,
1166 .apply_expected = True
1171 * unique,tombstone vs. group,released
1172 * => should be replaced
1175 .line = __location__,
1176 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1179 .type = WREPL_TYPE_UNIQUE,
1180 .state = WREPL_STATE_TOMBSTONE,
1181 .node = WREPL_NODE_B,
1183 .num_ips = ARRAY_SIZE(addresses_A_1),
1184 .ips = addresses_A_1,
1185 .apply_expected = True
1189 .type = WREPL_TYPE_GROUP,
1190 .state = WREPL_STATE_RELEASED,
1191 .node = WREPL_NODE_B,
1193 .num_ips = ARRAY_SIZE(addresses_B_1),
1194 .ips = addresses_B_1,
1195 .apply_expected = True
1200 * unique,released vs. group,released
1201 * => should be replaced
1203 * here we need a 2nd round to make sure
1204 * released vs. released is handled correct
1207 .line = __location__,
1208 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1211 .type = WREPL_TYPE_UNIQUE,
1212 .state = WREPL_STATE_RELEASED,
1213 .node = WREPL_NODE_B,
1215 .num_ips = ARRAY_SIZE(addresses_B_1),
1216 .ips = addresses_B_1,
1217 .apply_expected = False
1221 .type = WREPL_TYPE_GROUP,
1222 .state = WREPL_STATE_RELEASED,
1223 .node = WREPL_NODE_B,
1225 .num_ips = ARRAY_SIZE(addresses_A_1),
1226 .ips = addresses_A_1,
1227 .apply_expected = True
1231 .line = __location__,
1232 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1236 .type = WREPL_TYPE_UNIQUE,
1237 .state = WREPL_STATE_TOMBSTONE,
1238 .node = WREPL_NODE_B,
1240 .num_ips = ARRAY_SIZE(addresses_A_1),
1241 .ips = addresses_A_1,
1242 .apply_expected = False /* this should conflict with the group.released above */
1246 .type = WREPL_TYPE_GROUP,
1247 .state = WREPL_STATE_TOMBSTONE,
1248 .node = WREPL_NODE_B,
1250 .num_ips = ARRAY_SIZE(addresses_A_1),
1251 .ips = addresses_A_1,
1252 .apply_expected = True
1257 * unique vs special groups section,
1260 * unique,active vs. sgroup,active
1261 * => should NOT be replaced
1264 .line = __location__,
1265 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1268 .type = WREPL_TYPE_UNIQUE,
1269 .state = WREPL_STATE_ACTIVE,
1270 .node = WREPL_NODE_B,
1272 .num_ips = ARRAY_SIZE(addresses_A_1),
1273 .ips = addresses_A_1,
1274 .apply_expected = True
1278 .type = WREPL_TYPE_SGROUP,
1279 .state = WREPL_STATE_ACTIVE,
1280 .node = WREPL_NODE_B,
1282 .num_ips = ARRAY_SIZE(addresses_A_1),
1283 .ips = addresses_A_1,
1284 .apply_expected = False
1289 * unique,active vs. sgroup,tombstone
1290 * => should NOT be replaced
1293 .line = __location__,
1294 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1297 .type = WREPL_TYPE_UNIQUE,
1298 .state = WREPL_STATE_ACTIVE,
1299 .node = WREPL_NODE_B,
1301 .num_ips = ARRAY_SIZE(addresses_A_1),
1302 .ips = addresses_A_1,
1303 .apply_expected = True
1307 .type = WREPL_TYPE_SGROUP,
1308 .state = WREPL_STATE_TOMBSTONE,
1309 .node = WREPL_NODE_B,
1311 .num_ips = ARRAY_SIZE(addresses_A_1),
1312 .ips = addresses_A_1,
1313 .apply_expected = False
1318 * unique,tombstone vs. sgroup,active
1319 * => should be replaced
1322 .line = __location__,
1323 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1326 .type = WREPL_TYPE_UNIQUE,
1327 .state = WREPL_STATE_TOMBSTONE,
1328 .node = WREPL_NODE_B,
1330 .num_ips = ARRAY_SIZE(addresses_A_1),
1331 .ips = addresses_A_1,
1332 .apply_expected = True
1336 .type = WREPL_TYPE_SGROUP,
1337 .state = WREPL_STATE_ACTIVE,
1338 .node = WREPL_NODE_B,
1340 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1341 .ips = addresses_B_3_4,
1342 .apply_expected = True
1347 * unique,tombstone vs. sgroup,tombstone
1348 * => should be replaced
1351 .line = __location__,
1352 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1355 .type = WREPL_TYPE_UNIQUE,
1356 .state = WREPL_STATE_TOMBSTONE,
1357 .node = WREPL_NODE_B,
1359 .num_ips = ARRAY_SIZE(addresses_B_1),
1360 .ips = addresses_B_1,
1361 .apply_expected = True
1365 .type = WREPL_TYPE_SGROUP,
1366 .state = WREPL_STATE_TOMBSTONE,
1367 .node = WREPL_NODE_B,
1369 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1370 .ips = addresses_A_3_4,
1371 .apply_expected = True
1377 * unique vs multi homed section,
1380 * unique,active vs. mhomed,active with different ips
1381 * => should be replaced
1384 .line = __location__,
1385 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1388 .type = WREPL_TYPE_UNIQUE,
1389 .state = WREPL_STATE_ACTIVE,
1390 .node = WREPL_NODE_B,
1392 .num_ips = ARRAY_SIZE(addresses_A_1),
1393 .ips = addresses_A_1,
1394 .apply_expected = True
1398 .type = WREPL_TYPE_MHOMED,
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
1409 * unique,active vs. mhomed,tombstone with different ips
1410 * => should NOT be replaced
1413 .line = __location__,
1414 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1418 .type = WREPL_TYPE_UNIQUE,
1419 .state = WREPL_STATE_ACTIVE,
1420 .node = WREPL_NODE_B,
1422 .num_ips = ARRAY_SIZE(addresses_B_1),
1423 .ips = addresses_B_1,
1424 .apply_expected = True
1428 .type = WREPL_TYPE_MHOMED,
1429 .state = WREPL_STATE_TOMBSTONE,
1430 .node = WREPL_NODE_B,
1432 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1433 .ips = addresses_A_3_4,
1434 .apply_expected = False
1439 * unique,active vs. mhomed,tombstone with same ips
1440 * => should NOT be replaced
1443 .line = __location__,
1444 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1447 .type = WREPL_TYPE_UNIQUE,
1448 .state = WREPL_STATE_ACTIVE,
1449 .node = WREPL_NODE_B,
1451 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1452 .ips = addresses_B_3_4,
1453 .apply_expected = True
1457 .type = WREPL_TYPE_MHOMED,
1458 .state = WREPL_STATE_TOMBSTONE,
1459 .node = WREPL_NODE_B,
1461 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1462 .ips = addresses_B_3_4,
1463 .apply_expected = False
1468 * unique,tombstone vs. mhomed,active with different ips
1469 * => should be replaced
1472 .line = __location__,
1473 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1476 .type = WREPL_TYPE_UNIQUE,
1477 .state = WREPL_STATE_TOMBSTONE,
1478 .node = WREPL_NODE_B,
1480 .num_ips = ARRAY_SIZE(addresses_B_1),
1481 .ips = addresses_B_1,
1482 .apply_expected = True
1486 .type = WREPL_TYPE_MHOMED,
1487 .state = WREPL_STATE_ACTIVE,
1488 .node = WREPL_NODE_B,
1490 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1491 .ips = addresses_A_3_4,
1492 .apply_expected = True
1497 * unique,tombstone vs. mhomed,tombstone with different ips
1498 * => should be replaced
1501 .line = __location__,
1502 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1505 .type = WREPL_TYPE_UNIQUE,
1506 .state = WREPL_STATE_TOMBSTONE,
1507 .node = WREPL_NODE_B,
1509 .num_ips = ARRAY_SIZE(addresses_A_1),
1510 .ips = addresses_A_1,
1511 .apply_expected = True
1515 .type = WREPL_TYPE_MHOMED,
1516 .state = WREPL_STATE_TOMBSTONE,
1517 .node = WREPL_NODE_B,
1519 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1520 .ips = addresses_B_3_4,
1521 .apply_expected = True
1526 * normal groups vs unique section,
1529 * group,active vs. unique,active
1530 * => should NOT be replaced
1533 .line = __location__,
1534 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1537 .type = WREPL_TYPE_GROUP,
1538 .state = WREPL_STATE_ACTIVE,
1539 .node = WREPL_NODE_B,
1541 .num_ips = ARRAY_SIZE(addresses_A_1),
1542 .ips = addresses_A_1,
1543 .apply_expected = True
1547 .type = WREPL_TYPE_UNIQUE,
1548 .state = WREPL_STATE_ACTIVE,
1549 .node = WREPL_NODE_B,
1551 .num_ips = ARRAY_SIZE(addresses_A_1),
1552 .ips = addresses_A_1,
1553 .apply_expected = False
1558 * group,active vs. unique,tombstone
1559 * => should NOT be replaced
1562 .line = __location__,
1563 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1566 .type = WREPL_TYPE_GROUP,
1567 .state = WREPL_STATE_ACTIVE,
1568 .node = WREPL_NODE_B,
1570 .num_ips = ARRAY_SIZE(addresses_A_1),
1571 .ips = addresses_A_1,
1572 .apply_expected = True
1576 .type = WREPL_TYPE_UNIQUE,
1577 .state = WREPL_STATE_TOMBSTONE,
1578 .node = WREPL_NODE_B,
1580 .num_ips = ARRAY_SIZE(addresses_A_1),
1581 .ips = addresses_A_1,
1582 .apply_expected = False
1587 * group,released vs. unique,active
1588 * => should NOT be replaced
1591 .line = __location__,
1592 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1595 .type = WREPL_TYPE_GROUP,
1596 .state = WREPL_STATE_RELEASED,
1597 .node = WREPL_NODE_B,
1599 .num_ips = ARRAY_SIZE(addresses_A_1),
1600 .ips = addresses_A_1,
1601 .apply_expected = False
1605 .type = WREPL_TYPE_UNIQUE,
1606 .state = WREPL_STATE_ACTIVE,
1607 .node = WREPL_NODE_B,
1609 .num_ips = ARRAY_SIZE(addresses_A_1),
1610 .ips = addresses_A_1,
1611 .apply_expected = False
1616 * group,released vs. unique,tombstone
1617 * => should NOT be replaced
1620 .line = __location__,
1621 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1624 .type = WREPL_TYPE_GROUP,
1625 .state = WREPL_STATE_RELEASED,
1626 .node = WREPL_NODE_B,
1628 .num_ips = ARRAY_SIZE(addresses_A_1),
1629 .ips = addresses_A_1,
1630 .apply_expected = False
1634 .type = WREPL_TYPE_UNIQUE,
1635 .state = WREPL_STATE_TOMBSTONE,
1636 .node = WREPL_NODE_B,
1638 .num_ips = ARRAY_SIZE(addresses_A_1),
1639 .ips = addresses_A_1,
1640 .apply_expected = False
1645 * group,tombstone vs. unique,active
1646 * => should NOT be replaced
1649 .line = __location__,
1650 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1653 .type = WREPL_TYPE_GROUP,
1654 .state = WREPL_STATE_TOMBSTONE,
1655 .node = WREPL_NODE_B,
1657 .num_ips = ARRAY_SIZE(addresses_A_1),
1658 .ips = addresses_A_1,
1659 .apply_expected = True
1663 .type = WREPL_TYPE_UNIQUE,
1664 .state = WREPL_STATE_ACTIVE,
1665 .node = WREPL_NODE_B,
1667 .num_ips = ARRAY_SIZE(addresses_A_1),
1668 .ips = addresses_A_1,
1669 .apply_expected = False
1674 * group,tombstone vs. unique,tombstone
1675 * => should NOT be replaced
1678 .line = __location__,
1679 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1682 .type = WREPL_TYPE_GROUP,
1683 .state = WREPL_STATE_TOMBSTONE,
1684 .node = WREPL_NODE_B,
1686 .num_ips = ARRAY_SIZE(addresses_A_1),
1687 .ips = addresses_A_1,
1688 .apply_expected = True
1692 .type = WREPL_TYPE_UNIQUE,
1693 .state = WREPL_STATE_TOMBSTONE,
1694 .node = WREPL_NODE_B,
1696 .num_ips = ARRAY_SIZE(addresses_A_1),
1697 .ips = addresses_A_1,
1698 .apply_expected = False
1703 * normal groups vs normal groups section,
1706 * group,active vs. group,active
1707 * => should NOT be replaced
1710 .line = __location__,
1711 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1714 .type = WREPL_TYPE_GROUP,
1715 .state = WREPL_STATE_ACTIVE,
1716 .node = WREPL_NODE_B,
1718 .num_ips = ARRAY_SIZE(addresses_A_1),
1719 .ips = addresses_A_1,
1720 .apply_expected = True
1724 .type = WREPL_TYPE_GROUP,
1725 .state = WREPL_STATE_ACTIVE,
1726 .node = WREPL_NODE_B,
1728 .num_ips = ARRAY_SIZE(addresses_A_1),
1729 .ips = addresses_A_1,
1730 .apply_expected = False
1735 * group,active vs. group,tombstone
1736 * => should NOT be replaced
1739 .line = __location__,
1740 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1743 .type = WREPL_TYPE_GROUP,
1744 .state = WREPL_STATE_ACTIVE,
1745 .node = WREPL_NODE_B,
1747 .num_ips = ARRAY_SIZE(addresses_A_1),
1748 .ips = addresses_A_1,
1749 .apply_expected = True
1753 .type = WREPL_TYPE_GROUP,
1754 .state = WREPL_STATE_TOMBSTONE,
1755 .node = WREPL_NODE_B,
1757 .num_ips = ARRAY_SIZE(addresses_A_1),
1758 .ips = addresses_A_1,
1759 .apply_expected = False
1764 * group,released vs. group,active
1765 * => should be replaced
1768 .line = __location__,
1769 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1772 .type = WREPL_TYPE_GROUP,
1773 .state = WREPL_STATE_RELEASED,
1774 .node = WREPL_NODE_B,
1776 .num_ips = ARRAY_SIZE(addresses_A_1),
1777 .ips = addresses_A_1,
1778 .apply_expected = False
1782 .type = WREPL_TYPE_GROUP,
1783 .state = WREPL_STATE_ACTIVE,
1784 .node = WREPL_NODE_B,
1786 .num_ips = ARRAY_SIZE(addresses_B_1),
1787 .ips = addresses_B_1,
1788 .apply_expected = True
1793 * group,released vs. group,released
1794 * => should be replaced
1797 .line = __location__,
1798 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1801 .type = WREPL_TYPE_GROUP,
1802 .state = WREPL_STATE_RELEASED,
1803 .node = WREPL_NODE_B,
1805 .num_ips = ARRAY_SIZE(addresses_B_1),
1806 .ips = addresses_B_1,
1807 .apply_expected = False
1811 .type = WREPL_TYPE_GROUP,
1812 .state = WREPL_STATE_RELEASED,
1813 .node = WREPL_NODE_B,
1815 .num_ips = ARRAY_SIZE(addresses_A_1),
1816 .ips = addresses_A_1,
1817 .apply_expected = True
1821 .line = __location__,
1822 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1826 .type = WREPL_TYPE_UNIQUE,
1827 .state = WREPL_STATE_TOMBSTONE,
1828 .node = WREPL_NODE_B,
1830 .num_ips = ARRAY_SIZE(addresses_B_1),
1831 .ips = addresses_B_1,
1832 .apply_expected = False
1836 .type = WREPL_TYPE_UNIQUE,
1837 .state = WREPL_STATE_TOMBSTONE,
1838 .node = WREPL_NODE_B,
1840 .num_ips = ARRAY_SIZE(addresses_A_1),
1841 .ips = addresses_A_1,
1842 .apply_expected = True
1847 * group,released vs. group,tombstone
1848 * => should be replaced
1851 .line = __location__,
1852 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1855 .type = WREPL_TYPE_GROUP,
1856 .state = WREPL_STATE_RELEASED,
1857 .node = WREPL_NODE_B,
1859 .num_ips = ARRAY_SIZE(addresses_A_1),
1860 .ips = addresses_A_1,
1861 .apply_expected = False
1865 .type = WREPL_TYPE_GROUP,
1866 .state = WREPL_STATE_TOMBSTONE,
1867 .node = WREPL_NODE_B,
1869 .num_ips = ARRAY_SIZE(addresses_B_1),
1870 .ips = addresses_B_1,
1871 .apply_expected = True
1876 * group,tombstone vs. group,active
1877 * => should be replaced
1880 .line = __location__,
1881 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1884 .type = WREPL_TYPE_GROUP,
1885 .state = WREPL_STATE_TOMBSTONE,
1886 .node = WREPL_NODE_B,
1888 .num_ips = ARRAY_SIZE(addresses_B_1),
1889 .ips = addresses_B_1,
1890 .apply_expected = True
1894 .type = WREPL_TYPE_GROUP,
1895 .state = WREPL_STATE_ACTIVE,
1896 .node = WREPL_NODE_B,
1898 .num_ips = ARRAY_SIZE(addresses_A_1),
1899 .ips = addresses_A_1,
1900 .apply_expected = True
1905 * group,tombstone vs. group,tombstone
1906 * => should be replaced
1909 .line = __location__,
1910 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1913 .type = WREPL_TYPE_GROUP,
1914 .state = WREPL_STATE_TOMBSTONE,
1915 .node = WREPL_NODE_B,
1917 .num_ips = ARRAY_SIZE(addresses_A_1),
1918 .ips = addresses_A_1,
1919 .apply_expected = True
1923 .type = WREPL_TYPE_GROUP,
1924 .state = WREPL_STATE_TOMBSTONE,
1925 .node = WREPL_NODE_B,
1927 .num_ips = ARRAY_SIZE(addresses_B_1),
1928 .ips = addresses_B_1,
1929 .apply_expected = True
1934 * normal groups vs special groups section,
1937 * group,active vs. sgroup,active
1938 * => should NOT be replaced
1941 .line = __location__,
1942 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1945 .type = WREPL_TYPE_GROUP,
1946 .state = WREPL_STATE_ACTIVE,
1947 .node = WREPL_NODE_B,
1949 .num_ips = ARRAY_SIZE(addresses_B_1),
1950 .ips = addresses_B_1,
1951 .apply_expected = True
1955 .type = WREPL_TYPE_SGROUP,
1956 .state = WREPL_STATE_ACTIVE,
1957 .node = WREPL_NODE_B,
1959 .num_ips = ARRAY_SIZE(addresses_B_1),
1960 .ips = addresses_B_1,
1961 .apply_expected = False
1966 * group,active vs. sgroup,tombstone
1967 * => should NOT be replaced
1970 .line = __location__,
1971 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1974 .type = WREPL_TYPE_GROUP,
1975 .state = WREPL_STATE_ACTIVE,
1976 .node = WREPL_NODE_B,
1978 .num_ips = ARRAY_SIZE(addresses_B_1),
1979 .ips = addresses_B_1,
1980 .apply_expected = True
1984 .type = WREPL_TYPE_SGROUP,
1985 .state = WREPL_STATE_TOMBSTONE,
1986 .node = WREPL_NODE_B,
1988 .num_ips = ARRAY_SIZE(addresses_B_1),
1989 .ips = addresses_B_1,
1990 .apply_expected = False
1995 * group,released vs. sgroup,active
1996 * => should be replaced
1999 .line = __location__,
2000 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2003 .type = WREPL_TYPE_GROUP,
2004 .state = WREPL_STATE_RELEASED,
2005 .node = WREPL_NODE_B,
2007 .num_ips = ARRAY_SIZE(addresses_A_1),
2008 .ips = addresses_A_1,
2009 .apply_expected = False
2013 .type = WREPL_TYPE_SGROUP,
2014 .state = WREPL_STATE_ACTIVE,
2015 .node = WREPL_NODE_B,
2017 .num_ips = ARRAY_SIZE(addresses_B_1),
2018 .ips = addresses_B_1,
2019 .apply_expected = True
2024 * group,released vs. sgroup,released
2025 * => should NOT be replaced
2028 .line = __location__,
2029 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2032 .type = WREPL_TYPE_GROUP,
2033 .state = WREPL_STATE_RELEASED,
2034 .node = WREPL_NODE_B,
2036 .num_ips = ARRAY_SIZE(addresses_B_1),
2037 .ips = addresses_B_1,
2038 .apply_expected = False
2042 .type = WREPL_TYPE_SGROUP,
2043 .state = WREPL_STATE_RELEASED,
2044 .node = WREPL_NODE_B,
2046 .num_ips = ARRAY_SIZE(addresses_B_1),
2047 .ips = addresses_B_1,
2048 .apply_expected = False
2052 .line = __location__,
2053 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2057 .type = WREPL_TYPE_UNIQUE,
2058 .state = WREPL_STATE_TOMBSTONE,
2059 .node = WREPL_NODE_B,
2061 .num_ips = ARRAY_SIZE(addresses_A_1),
2062 .ips = addresses_A_1,
2063 .apply_expected = False
2067 .type = WREPL_TYPE_UNIQUE,
2068 .state = WREPL_STATE_TOMBSTONE,
2069 .node = WREPL_NODE_B,
2071 .num_ips = ARRAY_SIZE(addresses_B_1),
2072 .ips = addresses_B_1,
2073 .apply_expected = True
2078 * group,released vs. sgroup,tombstone
2079 * => should NOT be replaced
2082 .line = __location__,
2083 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2086 .type = WREPL_TYPE_GROUP,
2087 .state = WREPL_STATE_RELEASED,
2088 .node = WREPL_NODE_B,
2090 .num_ips = ARRAY_SIZE(addresses_B_1),
2091 .ips = addresses_B_1,
2092 .apply_expected = False
2096 .type = WREPL_TYPE_SGROUP,
2097 .state = WREPL_STATE_TOMBSTONE,
2098 .node = WREPL_NODE_B,
2100 .num_ips = ARRAY_SIZE(addresses_B_1),
2101 .ips = addresses_B_1,
2102 .apply_expected = False
2107 * group,tombstone vs. sgroup,active
2108 * => should be replaced
2111 .line = __location__,
2112 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2115 .type = WREPL_TYPE_GROUP,
2116 .state = WREPL_STATE_TOMBSTONE,
2117 .node = WREPL_NODE_B,
2119 .num_ips = ARRAY_SIZE(addresses_B_1),
2120 .ips = addresses_B_1,
2121 .apply_expected = True
2125 .type = WREPL_TYPE_SGROUP,
2126 .state = WREPL_STATE_ACTIVE,
2127 .node = WREPL_NODE_B,
2129 .num_ips = ARRAY_SIZE(addresses_A_1),
2130 .ips = addresses_A_1,
2131 .apply_expected = True
2136 * group,tombstone vs. sgroup,tombstone
2137 * => should be replaced
2140 .line = __location__,
2141 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2144 .type = WREPL_TYPE_GROUP,
2145 .state = WREPL_STATE_TOMBSTONE,
2146 .node = WREPL_NODE_B,
2148 .num_ips = ARRAY_SIZE(addresses_A_1),
2149 .ips = addresses_A_1,
2150 .apply_expected = True
2154 .type = WREPL_TYPE_SGROUP,
2155 .state = WREPL_STATE_TOMBSTONE,
2156 .node = WREPL_NODE_B,
2158 .num_ips = ARRAY_SIZE(addresses_B_1),
2159 .ips = addresses_B_1,
2160 .apply_expected = True
2165 * normal groups vs multi homed section,
2168 * group,active vs. mhomed,active
2169 * => should NOT be replaced
2172 .line = __location__,
2173 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2176 .type = WREPL_TYPE_GROUP,
2177 .state = WREPL_STATE_ACTIVE,
2178 .node = WREPL_NODE_B,
2180 .num_ips = ARRAY_SIZE(addresses_B_1),
2181 .ips = addresses_B_1,
2182 .apply_expected = True
2186 .type = WREPL_TYPE_MHOMED,
2187 .state = WREPL_STATE_ACTIVE,
2188 .node = WREPL_NODE_B,
2190 .num_ips = ARRAY_SIZE(addresses_B_1),
2191 .ips = addresses_B_1,
2192 .apply_expected = False
2197 * group,active vs. mhomed,tombstone
2198 * => should NOT be replaced
2201 .line = __location__,
2202 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2205 .type = WREPL_TYPE_GROUP,
2206 .state = WREPL_STATE_ACTIVE,
2207 .node = WREPL_NODE_B,
2209 .num_ips = ARRAY_SIZE(addresses_B_1),
2210 .ips = addresses_B_1,
2211 .apply_expected = True
2215 .type = WREPL_TYPE_MHOMED,
2216 .state = WREPL_STATE_TOMBSTONE,
2217 .node = WREPL_NODE_B,
2219 .num_ips = ARRAY_SIZE(addresses_B_1),
2220 .ips = addresses_B_1,
2221 .apply_expected = False
2226 * group,released vs. mhomed,active
2227 * => should NOT be replaced
2230 .line = __location__,
2231 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2234 .type = WREPL_TYPE_GROUP,
2235 .state = WREPL_STATE_RELEASED,
2236 .node = WREPL_NODE_B,
2238 .num_ips = ARRAY_SIZE(addresses_B_1),
2239 .ips = addresses_B_1,
2240 .apply_expected = False
2244 .type = WREPL_TYPE_MHOMED,
2245 .state = WREPL_STATE_ACTIVE,
2246 .node = WREPL_NODE_B,
2248 .num_ips = ARRAY_SIZE(addresses_B_1),
2249 .ips = addresses_B_1,
2250 .apply_expected = False
2255 * group,released vs. mhomed,released
2256 * => should NOT be replaced
2259 .line = __location__,
2260 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2263 .type = WREPL_TYPE_GROUP,
2264 .state = WREPL_STATE_RELEASED,
2265 .node = WREPL_NODE_B,
2267 .num_ips = ARRAY_SIZE(addresses_B_1),
2268 .ips = addresses_B_1,
2269 .apply_expected = False
2273 .type = WREPL_TYPE_MHOMED,
2274 .state = WREPL_STATE_RELEASED,
2275 .node = WREPL_NODE_B,
2277 .num_ips = ARRAY_SIZE(addresses_B_1),
2278 .ips = addresses_B_1,
2279 .apply_expected = False
2283 .line = __location__,
2284 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2288 .type = WREPL_TYPE_UNIQUE,
2289 .state = WREPL_STATE_TOMBSTONE,
2290 .node = WREPL_NODE_B,
2292 .num_ips = ARRAY_SIZE(addresses_A_1),
2293 .ips = addresses_A_1,
2294 .apply_expected = False
2298 .type = WREPL_TYPE_UNIQUE,
2299 .state = WREPL_STATE_TOMBSTONE,
2300 .node = WREPL_NODE_B,
2302 .num_ips = ARRAY_SIZE(addresses_B_1),
2303 .ips = addresses_B_1,
2304 .apply_expected = True
2309 * group,released vs. mhomed,tombstone
2310 * => should NOT be replaced
2313 .line = __location__,
2314 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2317 .type = WREPL_TYPE_GROUP,
2318 .state = WREPL_STATE_RELEASED,
2319 .node = WREPL_NODE_B,
2321 .num_ips = ARRAY_SIZE(addresses_B_1),
2322 .ips = addresses_B_1,
2323 .apply_expected = False
2327 .type = WREPL_TYPE_MHOMED,
2328 .state = WREPL_STATE_TOMBSTONE,
2329 .node = WREPL_NODE_B,
2331 .num_ips = ARRAY_SIZE(addresses_B_1),
2332 .ips = addresses_B_1,
2333 .apply_expected = False
2338 * group,tombstone vs. mhomed,active
2339 * => should be replaced
2342 .line = __location__,
2343 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2346 .type = WREPL_TYPE_GROUP,
2347 .state = WREPL_STATE_TOMBSTONE,
2348 .node = WREPL_NODE_B,
2350 .num_ips = ARRAY_SIZE(addresses_B_1),
2351 .ips = addresses_B_1,
2352 .apply_expected = True
2356 .type = WREPL_TYPE_MHOMED,
2357 .state = WREPL_STATE_ACTIVE,
2358 .node = WREPL_NODE_B,
2360 .num_ips = ARRAY_SIZE(addresses_A_1),
2361 .ips = addresses_A_1,
2362 .apply_expected = True
2367 * group,tombstone vs. mhomed,tombstone
2368 * => should be replaced
2371 .line = __location__,
2372 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2375 .type = WREPL_TYPE_GROUP,
2376 .state = WREPL_STATE_TOMBSTONE,
2377 .node = WREPL_NODE_B,
2379 .num_ips = ARRAY_SIZE(addresses_A_1),
2380 .ips = addresses_A_1,
2381 .apply_expected = True
2385 .type = WREPL_TYPE_MHOMED,
2386 .state = WREPL_STATE_TOMBSTONE,
2387 .node = WREPL_NODE_B,
2389 .num_ips = ARRAY_SIZE(addresses_B_1),
2390 .ips = addresses_B_1,
2391 .apply_expected = True
2396 * special groups vs unique section,
2399 * sgroup,active vs. unique,active
2400 * => should NOT be replaced
2403 .line = __location__,
2404 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2407 .type = WREPL_TYPE_SGROUP,
2408 .state = WREPL_STATE_ACTIVE,
2409 .node = WREPL_NODE_B,
2411 .num_ips = ARRAY_SIZE(addresses_B_1),
2412 .ips = addresses_B_1,
2413 .apply_expected = True
2417 .type = WREPL_TYPE_UNIQUE,
2418 .state = WREPL_STATE_ACTIVE,
2419 .node = WREPL_NODE_B,
2421 .num_ips = ARRAY_SIZE(addresses_B_1),
2422 .ips = addresses_B_1,
2423 .apply_expected = False
2428 * sgroup,active vs. unique,tombstone
2429 * => should NOT be replaced
2432 .line = __location__,
2433 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2436 .type = WREPL_TYPE_SGROUP,
2437 .state = WREPL_STATE_ACTIVE,
2438 .node = WREPL_NODE_B,
2440 .num_ips = ARRAY_SIZE(addresses_B_1),
2441 .ips = addresses_B_1,
2442 .apply_expected = True
2446 .type = WREPL_TYPE_UNIQUE,
2447 .state = WREPL_STATE_TOMBSTONE,
2448 .node = WREPL_NODE_B,
2450 .num_ips = ARRAY_SIZE(addresses_B_1),
2451 .ips = addresses_B_1,
2452 .apply_expected = False
2457 * sgroup,released vs. unique,active
2458 * => should be replaced
2461 .line = __location__,
2462 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2465 .type = WREPL_TYPE_SGROUP,
2466 .state = WREPL_STATE_RELEASED,
2467 .node = WREPL_NODE_B,
2469 .num_ips = ARRAY_SIZE(addresses_B_1),
2470 .ips = addresses_B_1,
2471 .apply_expected = False
2475 .type = WREPL_TYPE_UNIQUE,
2476 .state = WREPL_STATE_ACTIVE,
2477 .node = WREPL_NODE_B,
2479 .num_ips = ARRAY_SIZE(addresses_A_1),
2480 .ips = addresses_A_1,
2481 .apply_expected = True
2486 * sgroup,released vs. unique,tombstone
2487 * => should be replaced
2490 .line = __location__,
2491 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2494 .type = WREPL_TYPE_SGROUP,
2495 .state = WREPL_STATE_RELEASED,
2496 .node = WREPL_NODE_B,
2498 .num_ips = ARRAY_SIZE(addresses_A_1),
2499 .ips = addresses_A_1,
2500 .apply_expected = False
2504 .type = WREPL_TYPE_UNIQUE,
2505 .state = WREPL_STATE_TOMBSTONE,
2506 .node = WREPL_NODE_B,
2508 .num_ips = ARRAY_SIZE(addresses_B_1),
2509 .ips = addresses_B_1,
2510 .apply_expected = True
2515 * sgroup,tombstone vs. unique,active
2516 * => should be replaced
2519 .line = __location__,
2520 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2523 .type = WREPL_TYPE_SGROUP,
2524 .state = WREPL_STATE_TOMBSTONE,
2525 .node = WREPL_NODE_B,
2527 .num_ips = ARRAY_SIZE(addresses_A_1),
2528 .ips = addresses_A_1,
2529 .apply_expected = True
2533 .type = WREPL_TYPE_UNIQUE,
2534 .state = WREPL_STATE_ACTIVE,
2535 .node = WREPL_NODE_B,
2537 .num_ips = ARRAY_SIZE(addresses_B_1),
2538 .ips = addresses_B_1,
2539 .apply_expected = True
2544 * sgroup,tombstone vs. unique,tombstone
2545 * => should be replaced
2548 .line = __location__,
2549 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2552 .type = WREPL_TYPE_SGROUP,
2553 .state = WREPL_STATE_TOMBSTONE,
2554 .node = WREPL_NODE_B,
2556 .num_ips = ARRAY_SIZE(addresses_B_1),
2557 .ips = addresses_B_1,
2558 .apply_expected = True
2562 .type = WREPL_TYPE_UNIQUE,
2563 .state = WREPL_STATE_TOMBSTONE,
2564 .node = WREPL_NODE_B,
2566 .num_ips = ARRAY_SIZE(addresses_A_1),
2567 .ips = addresses_A_1,
2568 .apply_expected = True
2573 * special groups vs normal group section,
2576 * sgroup,active vs. group,active
2577 * => should NOT be replaced
2580 .line = __location__,
2581 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2584 .type = WREPL_TYPE_SGROUP,
2585 .state = WREPL_STATE_ACTIVE,
2586 .node = WREPL_NODE_B,
2588 .num_ips = ARRAY_SIZE(addresses_A_1),
2589 .ips = addresses_A_1,
2590 .apply_expected = True
2594 .type = WREPL_TYPE_GROUP,
2595 .state = WREPL_STATE_ACTIVE,
2596 .node = WREPL_NODE_B,
2598 .num_ips = ARRAY_SIZE(addresses_A_1),
2599 .ips = addresses_A_1,
2600 .apply_expected = False
2605 * sgroup,active vs. group,tombstone
2606 * => should NOT be replaced
2609 .line = __location__,
2610 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2613 .type = WREPL_TYPE_SGROUP,
2614 .state = WREPL_STATE_ACTIVE,
2615 .node = WREPL_NODE_B,
2617 .num_ips = ARRAY_SIZE(addresses_A_1),
2618 .ips = addresses_A_1,
2619 .apply_expected = True
2623 .type = WREPL_TYPE_GROUP,
2624 .state = WREPL_STATE_TOMBSTONE,
2625 .node = WREPL_NODE_B,
2627 .num_ips = ARRAY_SIZE(addresses_A_1),
2628 .ips = addresses_A_1,
2629 .apply_expected = False
2634 * sgroup,released vs. group,active
2635 * => should be replaced
2638 .line = __location__,
2639 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2642 .type = WREPL_TYPE_SGROUP,
2643 .state = WREPL_STATE_RELEASED,
2644 .node = WREPL_NODE_B,
2646 .num_ips = ARRAY_SIZE(addresses_A_1),
2647 .ips = addresses_A_1,
2648 .apply_expected = False
2652 .type = WREPL_TYPE_GROUP,
2653 .state = WREPL_STATE_ACTIVE,
2654 .node = WREPL_NODE_B,
2656 .num_ips = ARRAY_SIZE(addresses_B_1),
2657 .ips = addresses_B_1,
2658 .apply_expected = True
2663 * sgroup,released vs. group,tombstone
2664 * => should be replaced
2667 .line = __location__,
2668 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2671 .type = WREPL_TYPE_SGROUP,
2672 .state = WREPL_STATE_RELEASED,
2673 .node = WREPL_NODE_B,
2675 .num_ips = ARRAY_SIZE(addresses_B_1),
2676 .ips = addresses_B_1,
2677 .apply_expected = False
2681 .type = WREPL_TYPE_GROUP,
2682 .state = WREPL_STATE_TOMBSTONE,
2683 .node = WREPL_NODE_B,
2685 .num_ips = ARRAY_SIZE(addresses_A_1),
2686 .ips = addresses_A_1,
2687 .apply_expected = True
2692 * sgroup,tombstone vs. group,active
2693 * => should NOT be replaced
2696 .line = __location__,
2697 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2700 .type = WREPL_TYPE_SGROUP,
2701 .state = WREPL_STATE_TOMBSTONE,
2702 .node = WREPL_NODE_B,
2704 .num_ips = ARRAY_SIZE(addresses_A_1),
2705 .ips = addresses_A_1,
2706 .apply_expected = True
2710 .type = WREPL_TYPE_GROUP,
2711 .state = WREPL_STATE_ACTIVE,
2712 .node = WREPL_NODE_B,
2714 .num_ips = ARRAY_SIZE(addresses_B_1),
2715 .ips = addresses_B_1,
2716 .apply_expected = True
2721 * sgroup,tombstone vs. group,tombstone
2722 * => should NOT be replaced
2725 .line = __location__,
2726 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2729 .type = WREPL_TYPE_SGROUP,
2730 .state = WREPL_STATE_TOMBSTONE,
2731 .node = WREPL_NODE_B,
2733 .num_ips = ARRAY_SIZE(addresses_B_1),
2734 .ips = addresses_B_1,
2735 .apply_expected = True
2739 .type = WREPL_TYPE_GROUP,
2740 .state = WREPL_STATE_TOMBSTONE,
2741 .node = WREPL_NODE_B,
2743 .num_ips = ARRAY_SIZE(addresses_A_1),
2744 .ips = addresses_A_1,
2745 .apply_expected = True
2750 * This should be the last record in this array,
2751 * we need to make sure the we leave a tombstoned unique entry
2755 .line = __location__,
2756 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2760 .type = WREPL_TYPE_UNIQUE,
2761 .state = WREPL_STATE_TOMBSTONE,
2762 .node = WREPL_NODE_B,
2764 .num_ips = ARRAY_SIZE(addresses_A_1),
2765 .ips = addresses_A_1,
2766 .apply_expected = True
2770 .type = WREPL_TYPE_UNIQUE,
2771 .state = WREPL_STATE_TOMBSTONE,
2772 .node = WREPL_NODE_B,
2774 .num_ips = ARRAY_SIZE(addresses_A_1),
2775 .ips = addresses_A_1,
2776 .apply_expected = True
2778 }}; /* do not add entries here, this should be the last record! */
2780 if (!ctx) return False;
2782 wins_name_r1 = &wins_name1;
2783 wins_name_r2 = &wins_name2;
2785 printf("Test Replica Conflicts with different owners\n");
2787 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
2789 if (!records[i].extra && !records[i].cleanup) {
2790 /* we should test the worst cases */
2791 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
2792 printf("(%s) Programmer error, invalid record[%u]: %s\n",
2793 __location__, i, records[i].line);
2795 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
2796 printf("(%s) Programmer error, invalid record[%u]: %s\n",
2797 __location__, i, records[i].line);
2802 if (!records[i].cleanup) {
2803 printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
2804 wrepl_name_type_string(records[i].r1.type),
2805 wrepl_name_state_string(records[i].r1.state),
2806 (records[i].r1.is_static?",static":""),
2807 wrepl_name_type_string(records[i].r2.type),
2808 wrepl_name_state_string(records[i].r2.state),
2809 (records[i].r2.is_static?",static":""),
2810 (records[i].r1.ips==records[i].r2.ips?"same":"different"),
2811 (records[i].r2.apply_expected?"REPLACE":"NOT REPLACE"));
2817 wins_name_r1->name = &records[i].name;
2818 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
2819 records[i].r1.state,
2821 records[i].r1.is_static);
2822 wins_name_r1->id = ++records[i].r1.owner->max_version;
2823 if (wins_name_r1->flags & 2) {
2824 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
2825 wins_name_r1->addresses.addresses.ips = discard_const(records[i].r1.ips);
2827 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
2829 wins_name_r1->unknown = "255.255.255.255";
2832 ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1);
2833 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
2834 wins_name_r1, records[i].r1.apply_expected);
2839 wins_name_r2->name = &records[i].name;
2840 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
2841 records[i].r2.state,
2843 records[i].r2.is_static);
2844 wins_name_r2->id = ++records[i].r2.owner->max_version;
2845 if (wins_name_r2->flags & 2) {
2846 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
2847 wins_name_r2->addresses.addresses.ips = discard_const(records[i].r2.ips);
2849 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
2851 wins_name_r2->unknown = "255.255.255.255";
2854 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
2855 if (records[i].r1.state == WREPL_STATE_RELEASED) {
2856 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
2857 wins_name_r1, False);
2858 } else if (records[i].r1.owner != records[i].r2.owner) {
2859 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
2860 wins_name_r1, !records[i].r2.apply_expected);
2862 if (records[i].r2.state == WREPL_STATE_RELEASED) {
2863 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
2864 wins_name_r2, False);
2866 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
2867 wins_name_r2, records[i].r2.apply_expected);
2870 /* the first one is a cleanup run */
2871 if (!ret && i == 0) ret = True;
2874 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
2883 test WINS replication operations
2885 BOOL torture_nbt_winsreplication_quick(void)
2887 const char *address;
2888 struct nbt_name name;
2889 TALLOC_CTX *mem_ctx = talloc_new(NULL);
2893 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
2895 /* do an initial name resolution to find its IP */
2896 status = resolve_name(&name, mem_ctx, &address, NULL);
2897 if (!NT_STATUS_IS_OK(status)) {
2898 printf("Failed to resolve %s - %s\n",
2899 name.name, nt_errstr(status));
2900 talloc_free(mem_ctx);
2904 ret &= test_assoc_ctx1(mem_ctx, address);
2905 ret &= test_assoc_ctx2(mem_ctx, address);
2907 talloc_free(mem_ctx);
2913 test WINS replication operations
2915 BOOL torture_nbt_winsreplication(void)
2917 const char *address;
2918 struct nbt_name name;
2919 TALLOC_CTX *mem_ctx = talloc_new(NULL);
2922 struct test_wrepl_conflict_conn *ctx;
2924 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
2926 /* do an initial name resolution to find its IP */
2927 status = resolve_name(&name, mem_ctx, &address, NULL);
2928 if (!NT_STATUS_IS_OK(status)) {
2929 printf("Failed to resolve %s - %s\n",
2930 name.name, nt_errstr(status));
2931 talloc_free(mem_ctx);
2935 ret &= test_assoc_ctx1(mem_ctx, address);
2936 ret &= test_assoc_ctx2(mem_ctx, address);
2938 ret &= test_wins_replication(mem_ctx, address);
2940 ctx = test_create_conflict_ctx(mem_ctx, address);
2942 ret &= test_conflict_same_owner(ctx);
2943 ret &= test_conflict_different_owner(ctx);
2945 talloc_free(mem_ctx);