2 Unix SMB/CIFS implementation.
4 WINS replication testing
6 Copyright (C) Andrew Tridgell 2005
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include "libcli/nbt/libnbt.h"
25 #include "libcli/wrepl/winsrepl.h"
26 #include "lib/events/events.h"
27 #include "lib/socket/socket.h"
28 #include "system/time.h"
30 #define CHECK_STATUS(status, correct) do { \
31 if (!NT_STATUS_EQUAL(status, correct)) { \
32 printf("(%s) Incorrect status %s - should be %s\n", \
33 __location__, nt_errstr(status), nt_errstr(correct)); \
38 #define CHECK_VALUE(v, correct) do { \
39 if ((v) != (correct)) { \
40 printf("(%s) Incorrect value %s=%d - should be %d\n", \
41 __location__, #v, v, correct); \
46 #define CHECK_VALUE_UINT64(v, correct) do { \
47 if ((v) != (correct)) { \
48 printf("(%s) Incorrect value %s=%llu - should be %llu\n", \
49 __location__, #v, v, correct); \
54 #define CHECK_VALUE_STRING(v, correct) do { \
55 if ( ((!v) && (correct)) || \
56 ((v) && (!correct)) || \
57 ((v) && (correct) && strcmp(v,correct) != 0)) { \
58 printf("(%s) Incorrect value %s='%s' - should be '%s'\n", \
59 __location__, #v, v, correct); \
64 #define _NBT_NAME(n,t,s) {\
70 static const char *wrepl_name_type_string(enum wrepl_name_type type)
73 case WREPL_TYPE_UNIQUE: return "UNIQUE";
74 case WREPL_TYPE_GROUP: return "GROUP";
75 case WREPL_TYPE_SGROUP: return "SGROUP";
76 case WREPL_TYPE_MHOMED: return "MHOMED";
78 return "UNKNOWN_TYPE";
81 static const char *wrepl_name_state_string(enum wrepl_name_state state)
84 case WREPL_STATE_ACTIVE: return "ACTIVE";
85 case WREPL_STATE_RELEASED: return "RELEASED";
86 case WREPL_STATE_TOMBSTONE: return "TOMBSTONE";
87 case WREPL_STATE_RESERVED: return "RESERVED";
89 return "UNKNOWN_STATE";
93 test how assoc_ctx's are only usable on the connection
96 static BOOL test_assoc_ctx1(TALLOC_CTX *mem_ctx, const char *address)
99 struct wrepl_request *req;
100 struct wrepl_socket *wrepl_socket1;
101 struct wrepl_associate associate1;
102 struct wrepl_socket *wrepl_socket2;
103 struct wrepl_associate associate2;
104 struct wrepl_pull_table pull_table;
105 struct wrepl_packet *rep_packet;
106 struct wrepl_associate_stop assoc_stop;
109 if (!lp_parm_bool(-1, "torture", "dangerous", False)) {
110 printf("winsrepl: cross connection assoc_ctx usage disabled - enable dangerous tests to use\n");
114 printf("Test if assoc_ctx is only valid on the conection it was created on\n");
116 wrepl_socket1 = wrepl_socket_init(mem_ctx, NULL);
117 wrepl_socket2 = wrepl_socket_init(mem_ctx, NULL);
119 printf("Setup 2 wrepl connections\n");
120 status = wrepl_connect(wrepl_socket1, NULL, address);
121 CHECK_STATUS(status, NT_STATUS_OK);
123 status = wrepl_connect(wrepl_socket2, NULL, address);
124 CHECK_STATUS(status, NT_STATUS_OK);
126 printf("Send a start association request (conn1)\n");
127 status = wrepl_associate(wrepl_socket1, &associate1);
128 CHECK_STATUS(status, NT_STATUS_OK);
130 printf("association context (conn1): 0x%x\n", associate1.out.assoc_ctx);
132 printf("Send a start association request (conn2)\n");
133 status = wrepl_associate(wrepl_socket2, &associate2);
134 CHECK_STATUS(status, NT_STATUS_OK);
136 printf("association context (conn2): 0x%x\n", associate2.out.assoc_ctx);
138 printf("Send a replication table query, with assoc 1 (conn2), the anwser should be on conn1\n");
139 pull_table.in.assoc_ctx = associate1.out.assoc_ctx;
140 req = wrepl_pull_table_send(wrepl_socket2, &pull_table);
141 req->send_only = True;
142 status = wrepl_request_recv(req, mem_ctx, &rep_packet);
143 CHECK_STATUS(status, NT_STATUS_OK);
145 printf("Send a association request (conn2), to make sure the last request was ignored\n");
146 status = wrepl_associate(wrepl_socket2, &associate2);
147 CHECK_STATUS(status, NT_STATUS_OK);
149 printf("Send a replication table query, with invalid assoc (conn1), receive answer from conn2\n");
150 pull_table.in.assoc_ctx = 0;
151 req = wrepl_pull_table_send(wrepl_socket1, &pull_table);
152 status = wrepl_request_recv(req, mem_ctx, &rep_packet);
153 CHECK_STATUS(status, NT_STATUS_OK);
155 printf("Send a association request (conn1), to make sure the last request was handled correct\n");
156 status = wrepl_associate(wrepl_socket1, &associate2);
157 CHECK_STATUS(status, NT_STATUS_OK);
159 assoc_stop.in.assoc_ctx = associate1.out.assoc_ctx;
160 assoc_stop.in.reason = 4;
161 printf("Send a association stop request (conn1), reson: %u\n", assoc_stop.in.reason);
162 status = wrepl_associate_stop(wrepl_socket1, &assoc_stop);
163 CHECK_STATUS(status, NT_STATUS_END_OF_FILE);
165 assoc_stop.in.assoc_ctx = associate2.out.assoc_ctx;
166 assoc_stop.in.reason = 0;
167 printf("Send a association stop request (conn2), reson: %u\n", assoc_stop.in.reason);
168 status = wrepl_associate_stop(wrepl_socket2, &assoc_stop);
169 CHECK_STATUS(status, NT_STATUS_OK);
172 printf("Close 2 wrepl connections\n");
173 talloc_free(wrepl_socket1);
174 talloc_free(wrepl_socket2);
179 test if we always get back the same assoc_ctx
181 static BOOL test_assoc_ctx2(TALLOC_CTX *mem_ctx, const char *address)
184 struct wrepl_socket *wrepl_socket;
185 struct wrepl_associate associate;
189 printf("Test if we always get back the same assoc_ctx\n");
191 wrepl_socket = wrepl_socket_init(mem_ctx, NULL);
193 printf("Setup wrepl connections\n");
194 status = wrepl_connect(wrepl_socket, NULL, address);
195 CHECK_STATUS(status, NT_STATUS_OK);
198 printf("Send 1st start association request\n");
199 status = wrepl_associate(wrepl_socket, &associate);
200 CHECK_STATUS(status, NT_STATUS_OK);
201 assoc_ctx1 = associate.out.assoc_ctx;
202 printf("1st association context: 0x%x\n", associate.out.assoc_ctx);
204 printf("Send 2nd start association request\n");
205 status = wrepl_associate(wrepl_socket, &associate);
206 CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1);
207 CHECK_STATUS(status, NT_STATUS_OK);
208 printf("2nd association context: 0x%x\n", associate.out.assoc_ctx);
210 printf("Send 3rd start association request\n");
211 status = wrepl_associate(wrepl_socket, &associate);
212 CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1);
213 CHECK_STATUS(status, NT_STATUS_OK);
214 printf("3rd association context: 0x%x\n", associate.out.assoc_ctx);
217 printf("Close wrepl connections\n");
218 talloc_free(wrepl_socket);
224 display a replication entry
226 static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_name *name)
230 printf("%s\n", nbt_name_string(mem_ctx, &name->name));
231 printf("\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n",
232 name->type, name->state, name->node, name->is_static, name->version_id);
233 printf("\tRAW_FLAGS: 0x%08X OWNER: %-15s\n",
234 name->raw_flags, name->owner);
235 for (i=0;i<name->num_addresses;i++) {
236 printf("\tADDR: %-15s OWNER: %-15s\n",
237 name->addresses[i].address, name->addresses[i].owner);
242 test a full replication dump from a WINS server
244 static BOOL test_wins_replication(TALLOC_CTX *mem_ctx, const char *address)
247 struct wrepl_socket *wrepl_socket;
250 struct wrepl_associate associate;
251 struct wrepl_pull_table pull_table;
252 struct wrepl_pull_names pull_names;
254 printf("Test one pull replication cycle\n");
256 wrepl_socket = wrepl_socket_init(mem_ctx, NULL);
258 printf("Setup wrepl connections\n");
259 status = wrepl_connect(wrepl_socket, NULL, address);
260 CHECK_STATUS(status, NT_STATUS_OK);
262 printf("Send a start association request\n");
264 status = wrepl_associate(wrepl_socket, &associate);
265 CHECK_STATUS(status, NT_STATUS_OK);
267 printf("association context: 0x%x\n", associate.out.assoc_ctx);
269 printf("Send a replication table query\n");
270 pull_table.in.assoc_ctx = associate.out.assoc_ctx;
272 status = wrepl_pull_table(wrepl_socket, mem_ctx, &pull_table);
273 if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) {
274 struct wrepl_packet packet;
275 struct wrepl_request *req;
278 packet.opcode = WREPL_OPCODE_BITS;
279 packet.assoc_ctx = associate.out.assoc_ctx;
280 packet.mess_type = WREPL_STOP_ASSOCIATION;
281 packet.message.stop.reason = 0;
283 req = wrepl_request_send(wrepl_socket, &packet);
286 printf("failed - We are not a valid pull partner for the server\n");
290 CHECK_STATUS(status, NT_STATUS_OK);
292 printf("Found %d replication partners\n", pull_table.out.num_partners);
294 for (i=0;i<pull_table.out.num_partners;i++) {
295 struct wrepl_wins_owner *partner = &pull_table.out.partners[i];
296 printf("%s max_version=%6llu min_version=%6llu type=%d\n",
298 partner->max_version,
299 partner->min_version,
302 pull_names.in.assoc_ctx = associate.out.assoc_ctx;
303 pull_names.in.partner = *partner;
305 status = wrepl_pull_names(wrepl_socket, mem_ctx, &pull_names);
306 CHECK_STATUS(status, NT_STATUS_OK);
308 printf("Received %d names\n", pull_names.out.num_names);
310 for (j=0;j<pull_names.out.num_names;j++) {
311 display_entry(mem_ctx, &pull_names.out.names[j]);
316 printf("Close wrepl connections\n");
317 talloc_free(wrepl_socket);
321 struct test_wrepl_conflict_conn {
323 struct wrepl_socket *pull;
326 #define TEST_OWNER_A_ADDRESS "127.65.65.1"
327 #define TEST_ADDRESS_A_PREFIX "127.0.65"
328 #define TEST_OWNER_B_ADDRESS "127.66.66.1"
329 #define TEST_ADDRESS_B_PREFIX "127.0.66"
331 struct wrepl_wins_owner a, b, c;
335 struct nbt_name_socket *nbtsock;
336 struct nbt_name_socket *nbtsock2;
338 struct nbt_name_socket *nbtsock_srv;
339 struct nbt_name_socket *nbtsock_srv2;
341 uint32_t addresses_best_num;
342 struct wrepl_ip *addresses_best;
344 uint32_t addresses_best2_num;
345 struct wrepl_ip *addresses_best2;
347 uint32_t addresses_all_num;
348 struct wrepl_ip *addresses_all;
350 uint32_t addresses_mhomed_num;
351 struct wrepl_ip *addresses_mhomed;
354 static const struct wrepl_ip addresses_A_1[] = {
356 .owner = TEST_OWNER_A_ADDRESS,
357 .ip = TEST_ADDRESS_A_PREFIX".1"
360 static const struct wrepl_ip addresses_A_2[] = {
362 .owner = TEST_OWNER_A_ADDRESS,
363 .ip = TEST_ADDRESS_A_PREFIX".2"
366 static const struct wrepl_ip addresses_A_3_4[] = {
368 .owner = TEST_OWNER_A_ADDRESS,
369 .ip = TEST_ADDRESS_A_PREFIX".3"
372 .owner = TEST_OWNER_A_ADDRESS,
373 .ip = TEST_ADDRESS_A_PREFIX".4"
377 static const struct wrepl_ip addresses_B_1[] = {
379 .owner = TEST_OWNER_B_ADDRESS,
380 .ip = TEST_ADDRESS_B_PREFIX".1"
383 static const struct wrepl_ip addresses_B_2[] = {
385 .owner = TEST_OWNER_B_ADDRESS,
386 .ip = TEST_ADDRESS_B_PREFIX".2"
389 static const struct wrepl_ip addresses_B_3_4[] = {
391 .owner = TEST_OWNER_B_ADDRESS,
392 .ip = TEST_ADDRESS_B_PREFIX".3"
395 .owner = TEST_OWNER_B_ADDRESS,
396 .ip = TEST_ADDRESS_B_PREFIX".4"
400 static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem_ctx,
403 struct test_wrepl_conflict_conn *ctx;
404 struct wrepl_associate associate;
405 struct wrepl_pull_table pull_table;
409 ctx = talloc_zero(mem_ctx, struct test_wrepl_conflict_conn);
410 if (!ctx) return NULL;
412 ctx->address = address;
413 ctx->pull = wrepl_socket_init(ctx, NULL);
414 if (!ctx->pull) return NULL;
416 printf("Setup wrepl conflict pull connection\n");
417 status = wrepl_connect(ctx->pull, NULL, ctx->address);
418 if (!NT_STATUS_IS_OK(status)) return NULL;
420 status = wrepl_associate(ctx->pull, &associate);
421 if (!NT_STATUS_IS_OK(status)) return NULL;
423 ctx->pull_assoc = associate.out.assoc_ctx;
425 ctx->a.address = TEST_OWNER_A_ADDRESS;
426 ctx->a.max_version = 0;
427 ctx->a.min_version = 0;
430 ctx->b.address = TEST_OWNER_B_ADDRESS;
431 ctx->b.max_version = 0;
432 ctx->b.min_version = 0;
435 ctx->c.address = address;
436 ctx->c.max_version = 0;
437 ctx->c.min_version = 0;
440 pull_table.in.assoc_ctx = ctx->pull_assoc;
441 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
442 if (!NT_STATUS_IS_OK(status)) return NULL;
444 for (i=0; i < pull_table.out.num_partners; i++) {
445 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
446 ctx->a.max_version = pull_table.out.partners[i].max_version;
447 ctx->a.min_version = pull_table.out.partners[i].min_version;
449 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
450 ctx->b.max_version = pull_table.out.partners[i].max_version;
451 ctx->b.min_version = pull_table.out.partners[i].min_version;
453 if (strcmp(address,pull_table.out.partners[i].address)==0) {
454 ctx->c.max_version = pull_table.out.partners[i].max_version;
455 ctx->c.min_version = pull_table.out.partners[i].min_version;
459 talloc_free(pull_table.out.partners);
461 ctx->myaddr = talloc_strdup(mem_ctx, iface_best_ip(address));
462 if (!ctx->myaddr) return NULL;
464 for (i = 0; i < iface_count(); i++) {
465 if (strcmp(ctx->myaddr, iface_n_ip(i)) == 0) continue;
466 ctx->myaddr2 = talloc_strdup(mem_ctx, iface_n_ip(i));
467 if (!ctx->myaddr2) return NULL;
471 ctx->nbtsock = nbt_name_socket_init(ctx, NULL);
472 if (!ctx->nbtsock) return NULL;
474 status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0, 0);
475 if (!NT_STATUS_IS_OK(status)) return NULL;
477 ctx->nbtsock_srv = nbt_name_socket_init(ctx, NULL);
478 if (!ctx->nbtsock_srv) return NULL;
480 status = socket_listen(ctx->nbtsock_srv->sock, ctx->myaddr, lp_nbt_port(), 0, 0);
481 if (!NT_STATUS_IS_OK(status)) {
482 talloc_free(ctx->nbtsock_srv);
483 ctx->nbtsock_srv = NULL;
487 ctx->nbtsock2 = nbt_name_socket_init(ctx, NULL);
488 if (!ctx->nbtsock2) return NULL;
490 status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0, 0);
491 if (!NT_STATUS_IS_OK(status)) return NULL;
493 ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx);
494 if (!ctx->nbtsock_srv2) return NULL;
496 status = socket_listen(ctx->nbtsock_srv2->sock, ctx->myaddr2, lp_nbt_port(), 0, 0);
497 if (!NT_STATUS_IS_OK(status)) {
498 talloc_free(ctx->nbtsock_srv2);
499 ctx->nbtsock_srv2 = NULL;
503 ctx->addresses_best_num = 1;
504 ctx->addresses_best = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best_num);
505 if (!ctx->addresses_best) return NULL;
506 ctx->addresses_best[0].owner = ctx->b.address;
507 ctx->addresses_best[0].ip = ctx->myaddr;
509 ctx->addresses_all_num = iface_count();
510 ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num);
511 if (!ctx->addresses_all) return NULL;
512 for (i=0; i < ctx->addresses_all_num; i++) {
513 ctx->addresses_all[i].owner = ctx->b.address;
514 ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(i));
515 if (!ctx->addresses_all[i].ip) return NULL;
518 if (ctx->nbtsock_srv2) {
519 ctx->addresses_best2_num = 1;
520 ctx->addresses_best2 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best2_num);
521 if (!ctx->addresses_best2) return NULL;
522 ctx->addresses_best2[0].owner = ctx->b.address;
523 ctx->addresses_best2[0].ip = ctx->myaddr2;
525 ctx->addresses_mhomed_num = 2;
526 ctx->addresses_mhomed = talloc_array(ctx, struct wrepl_ip, ctx->addresses_mhomed_num);
527 if (!ctx->addresses_mhomed) return NULL;
528 ctx->addresses_mhomed[0].owner = ctx->b.address;
529 ctx->addresses_mhomed[0].ip = ctx->myaddr;
530 ctx->addresses_mhomed[1].owner = ctx->b.address;
531 ctx->addresses_mhomed[1].ip = ctx->myaddr2;
537 static BOOL test_wrepl_update_one(struct test_wrepl_conflict_conn *ctx,
538 const struct wrepl_wins_owner *owner,
539 const struct wrepl_wins_name *name)
542 struct wrepl_socket *wrepl_socket;
543 struct wrepl_associate associate;
544 struct wrepl_packet update_packet, repl_send;
545 struct wrepl_table *update;
546 struct wrepl_wins_owner wrepl_wins_owners[1];
547 struct wrepl_packet *repl_recv;
548 struct wrepl_wins_owner *send_request;
549 struct wrepl_send_reply *send_reply;
550 struct wrepl_wins_name wrepl_wins_names[1];
554 wrepl_socket = wrepl_socket_init(ctx, NULL);
556 status = wrepl_connect(wrepl_socket, NULL, ctx->address);
557 CHECK_STATUS(status, NT_STATUS_OK);
559 status = wrepl_associate(wrepl_socket, &associate);
560 CHECK_STATUS(status, NT_STATUS_OK);
561 assoc_ctx = associate.out.assoc_ctx;
563 /* now send a WREPL_REPL_UPDATE message */
564 ZERO_STRUCT(update_packet);
565 update_packet.opcode = WREPL_OPCODE_BITS;
566 update_packet.assoc_ctx = assoc_ctx;
567 update_packet.mess_type = WREPL_REPLICATION;
568 update_packet.message.replication.command = WREPL_REPL_UPDATE;
569 update = &update_packet.message.replication.info.table;
571 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
572 update->partners = wrepl_wins_owners;
573 update->initiator = "0.0.0.0";
575 wrepl_wins_owners[0] = *owner;
577 status = wrepl_request(wrepl_socket, wrepl_socket,
578 &update_packet, &repl_recv);
579 CHECK_STATUS(status, NT_STATUS_OK);
580 CHECK_VALUE(repl_recv->mess_type, WREPL_REPLICATION);
581 CHECK_VALUE(repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
582 send_request = &repl_recv->message.replication.info.owner;
584 ZERO_STRUCT(repl_send);
585 repl_send.opcode = WREPL_OPCODE_BITS;
586 repl_send.assoc_ctx = assoc_ctx;
587 repl_send.mess_type = WREPL_REPLICATION;
588 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
589 send_reply = &repl_send.message.replication.info.reply;
591 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
592 send_reply->names = wrepl_wins_names;
594 wrepl_wins_names[0] = *name;
596 status = wrepl_request(wrepl_socket, wrepl_socket,
597 &repl_send, &repl_recv);
598 CHECK_STATUS(status, NT_STATUS_OK);
599 CHECK_VALUE(repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
600 CHECK_VALUE(repl_recv->message.stop.reason, 0);
603 talloc_free(wrepl_socket);
608 static BOOL test_wrepl_update_two(struct test_wrepl_conflict_conn *ctx,
609 const struct wrepl_wins_owner *owner,
610 const struct wrepl_wins_name *name1,
611 const struct wrepl_wins_name *name2)
614 struct wrepl_socket *wrepl_socket;
615 struct wrepl_associate associate;
616 struct wrepl_packet update_packet, repl_send;
617 struct wrepl_table *update;
618 struct wrepl_wins_owner wrepl_wins_owners[1];
619 struct wrepl_packet *repl_recv;
620 struct wrepl_wins_owner *send_request;
621 struct wrepl_send_reply *send_reply;
622 struct wrepl_wins_name wrepl_wins_names[2];
626 wrepl_socket = wrepl_socket_init(ctx, NULL);
628 status = wrepl_connect(wrepl_socket, NULL, ctx->address);
629 CHECK_STATUS(status, NT_STATUS_OK);
631 status = wrepl_associate(wrepl_socket, &associate);
632 CHECK_STATUS(status, NT_STATUS_OK);
633 assoc_ctx = associate.out.assoc_ctx;
635 /* now send a WREPL_REPL_UPDATE message */
636 ZERO_STRUCT(update_packet);
637 update_packet.opcode = WREPL_OPCODE_BITS;
638 update_packet.assoc_ctx = assoc_ctx;
639 update_packet.mess_type = WREPL_REPLICATION;
640 update_packet.message.replication.command = WREPL_REPL_UPDATE;
641 update = &update_packet.message.replication.info.table;
643 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
644 update->partners = wrepl_wins_owners;
645 update->initiator = "0.0.0.0";
647 wrepl_wins_owners[0] = *owner;
649 status = wrepl_request(wrepl_socket, wrepl_socket,
650 &update_packet, &repl_recv);
651 CHECK_STATUS(status, NT_STATUS_OK);
652 CHECK_VALUE(repl_recv->mess_type, WREPL_REPLICATION);
653 CHECK_VALUE(repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
654 send_request = &repl_recv->message.replication.info.owner;
656 ZERO_STRUCT(repl_send);
657 repl_send.opcode = WREPL_OPCODE_BITS;
658 repl_send.assoc_ctx = assoc_ctx;
659 repl_send.mess_type = WREPL_REPLICATION;
660 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
661 send_reply = &repl_send.message.replication.info.reply;
663 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
664 send_reply->names = wrepl_wins_names;
666 wrepl_wins_names[0] = *name1;
667 wrepl_wins_names[1] = *name2;
669 status = wrepl_request(wrepl_socket, wrepl_socket,
670 &repl_send, &repl_recv);
671 CHECK_STATUS(status, NT_STATUS_OK);
672 CHECK_VALUE(repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
673 CHECK_VALUE(repl_recv->message.stop.reason, 0);
676 talloc_free(wrepl_socket);
681 static BOOL test_wrepl_is_applied(struct test_wrepl_conflict_conn *ctx,
682 const struct wrepl_wins_owner *owner,
683 const struct wrepl_wins_name *name,
688 struct wrepl_pull_names pull_names;
689 struct wrepl_name *names;
691 pull_names.in.assoc_ctx = ctx->pull_assoc;
692 pull_names.in.partner = *owner;
693 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
695 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
696 CHECK_STATUS(status, NT_STATUS_OK);
697 CHECK_VALUE(pull_names.out.num_names, (expected?1:0));
699 names = pull_names.out.names;
702 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
706 CHECK_VALUE(names[0].name.type, name->name->type);
707 CHECK_VALUE_STRING(names[0].name.name, name->name->name);
708 CHECK_VALUE_STRING(names[0].name.scope, name->name->scope);
709 CHECK_VALUE(flags, name->flags);
710 CHECK_VALUE_UINT64(names[0].version_id, name->id);
713 CHECK_VALUE(names[0].num_addresses,
714 name->addresses.addresses.num_ips);
716 CHECK_VALUE(names[0].num_addresses, 1);
717 CHECK_VALUE_STRING(names[0].addresses[0].address,
722 talloc_free(pull_names.out.names);
726 static BOOL test_wrepl_mhomed_merged(struct test_wrepl_conflict_conn *ctx,
727 const struct wrepl_wins_owner *owner1,
728 uint32_t num_ips1, const struct wrepl_ip *ips1,
729 const struct wrepl_wins_owner *owner2,
730 uint32_t num_ips2, const struct wrepl_ip *ips2,
731 const struct wrepl_wins_name *name2)
735 struct wrepl_pull_names pull_names;
736 struct wrepl_name *names;
739 uint32_t num_ips = num_ips1 + num_ips2;
741 for (i = 0; i < num_ips2; i++) {
742 for (j = 0; j < num_ips1; j++) {
743 if (strcmp(ips2[i].ip,ips1[j].ip) == 0) {
750 pull_names.in.assoc_ctx = ctx->pull_assoc;
751 pull_names.in.partner = *owner2;
752 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
754 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
755 CHECK_STATUS(status, NT_STATUS_OK);
756 CHECK_VALUE(pull_names.out.num_names, 1);
758 names = pull_names.out.names;
760 flags = WREPL_NAME_FLAGS(names[0].type,
764 CHECK_VALUE(names[0].name.type, name2->name->type);
765 CHECK_VALUE_STRING(names[0].name.name, name2->name->name);
766 CHECK_VALUE_STRING(names[0].name.scope, name2->name->scope);
767 CHECK_VALUE(flags, name2->flags | WREPL_TYPE_MHOMED);
768 CHECK_VALUE_UINT64(names[0].version_id, name2->id);
770 CHECK_VALUE(names[0].num_addresses, num_ips);
772 for (i = 0; i < names[0].num_addresses; i++) {
773 const char *addr = names[0].addresses[i].address;
774 const char *owner = names[0].addresses[i].owner;
777 for (j = 0; j < num_ips2; j++) {
778 if (strcmp(addr, ips2[j].ip) == 0) {
780 CHECK_VALUE_STRING(owner, owner2->address);
787 for (j = 0; j < num_ips1; j++) {
788 if (strcmp(addr, ips1[j].ip) == 0) {
790 CHECK_VALUE_STRING(owner, owner1->address);
797 CHECK_VALUE_STRING(addr, "not found in address list");
800 talloc_free(pull_names.out.names);
804 static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx,
805 const struct wrepl_wins_owner *owner1,
806 uint32_t num_ips1, const struct wrepl_ip *ips1,
807 const struct wrepl_wins_owner *owner2,
808 uint32_t num_ips2, const struct wrepl_ip *ips2,
809 const struct wrepl_wins_name *name2)
813 struct wrepl_pull_names pull_names;
814 struct wrepl_name *names;
815 struct wrepl_name *name = NULL;
818 uint32_t num_ips = num_ips1 + num_ips2;
820 for (i = 0; i < num_ips2; i++) {
821 for (j = 0; j < num_ips1; j++) {
822 if (strcmp(ips2[i].ip,ips1[j].ip) == 0) {
829 pull_names.in.assoc_ctx = ctx->pull_assoc;
830 pull_names.in.partner = *owner1;
831 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
832 pull_names.in.partner.max_version = 0;
834 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
835 CHECK_STATUS(status, NT_STATUS_OK);
837 names = pull_names.out.names;
839 for (i = 0; i < pull_names.out.num_names; i++) {
840 if (names[i].name.type != name2->name->type) continue;
841 if (!names[i].name.name) continue;
842 if (strcmp(names[i].name.name, name2->name->name) != 0) continue;
843 if (names[i].name.scope) continue;
849 printf("%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name));
853 flags = WREPL_NAME_FLAGS(name->type,
857 CHECK_VALUE(name->name.type, name2->name->type);
858 CHECK_VALUE_STRING(name->name.name, name2->name->name);
859 CHECK_VALUE_STRING(name->name.scope, name2->name->scope);
860 CHECK_VALUE(flags, name2->flags);
862 CHECK_VALUE(name->num_addresses, num_ips);
864 for (i = 0; i < name->num_addresses; i++) {
865 const char *addr = name->addresses[i].address;
866 const char *owner = name->addresses[i].owner;
869 for (j = 0; j < num_ips2; j++) {
870 if (strcmp(addr, ips2[j].ip) == 0) {
872 CHECK_VALUE_STRING(owner, owner2->address);
879 for (j = 0; j < num_ips1; j++) {
880 if (strcmp(addr, ips1[j].ip) == 0) {
882 CHECK_VALUE_STRING(owner, owner1->address);
889 CHECK_VALUE_STRING(addr, "not found in address list");
892 talloc_free(pull_names.out.names);
896 static BOOL test_wrepl_is_merged(struct test_wrepl_conflict_conn *ctx,
897 const struct wrepl_wins_name *name1,
898 const struct wrepl_wins_name *name2)
904 struct wrepl_pull_names pull_names;
905 struct wrepl_name *names;
908 pull_names.in.assoc_ctx = ctx->pull_assoc;
909 pull_names.in.partner = ctx->c;
910 pull_names.in.partner.min_version = ctx->c.max_version-1;
912 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
913 CHECK_STATUS(status, NT_STATUS_OK);
914 CHECK_VALUE(pull_names.out.num_names, 1);
916 names = pull_names.out.names;
918 num_ips = name1->addresses.addresses.num_ips + name2->addresses.addresses.num_ips;
920 CHECK_VALUE(names[0].name.type, name1->name->type);
921 CHECK_VALUE_STRING(names[0].name.name, name1->name->name);
922 CHECK_VALUE_STRING(names[0].name.scope, name1->name->scope);
923 CHECK_VALUE(names[0].type, WREPL_TYPE_SGROUP);
924 CHECK_VALUE(names[0].state, (num_ips>0?WREPL_STATE_ACTIVE:WREPL_STATE_RELEASED));
925 CHECK_VALUE_UINT64(names[0].version_id, ctx->c.max_version);
927 CHECK_VALUE(names[0].num_addresses,
928 name1->addresses.addresses.num_ips+
929 name2->addresses.addresses.num_ips);
931 talloc_free(pull_names.out.names);
936 static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx)
939 struct nbt_name name;
940 struct wrepl_wins_name wins_name1;
941 struct wrepl_wins_name wins_name2;
942 struct wrepl_wins_name *wins_name_tmp;
943 struct wrepl_wins_name *wins_name_last;
944 struct wrepl_wins_name *wins_name_cur;
946 uint8_t types[] = { 0x00, 0x1C };
948 enum wrepl_name_type type;
949 enum wrepl_name_state state;
950 enum wrepl_name_node node;
953 const struct wrepl_ip *ips;
956 .type = WREPL_TYPE_GROUP,
957 .state = WREPL_STATE_ACTIVE,
958 .node = WREPL_NODE_B,
960 .num_ips = ARRAY_SIZE(addresses_A_1),
961 .ips = addresses_A_1,
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,
970 .type = WREPL_TYPE_UNIQUE,
971 .state = WREPL_STATE_ACTIVE,
972 .node = WREPL_NODE_B,
974 .num_ips = ARRAY_SIZE(addresses_A_2),
975 .ips = addresses_A_2,
977 .type = WREPL_TYPE_UNIQUE,
978 .state = WREPL_STATE_ACTIVE,
979 .node = WREPL_NODE_B,
981 .num_ips = ARRAY_SIZE(addresses_A_1),
982 .ips = addresses_A_1,
984 .type = WREPL_TYPE_UNIQUE,
985 .state = WREPL_STATE_ACTIVE,
986 .node = WREPL_NODE_B,
988 .num_ips = ARRAY_SIZE(addresses_A_2),
989 .ips = addresses_A_2,
991 .type = WREPL_TYPE_SGROUP,
992 .state = WREPL_STATE_TOMBSTONE,
993 .node = WREPL_NODE_B,
995 .num_ips = ARRAY_SIZE(addresses_A_2),
996 .ips = addresses_A_2,
998 .type = WREPL_TYPE_MHOMED,
999 .state = WREPL_STATE_TOMBSTONE,
1000 .node = WREPL_NODE_B,
1002 .num_ips = ARRAY_SIZE(addresses_A_1),
1003 .ips = addresses_A_1,
1005 .type = WREPL_TYPE_MHOMED,
1006 .state = WREPL_STATE_RELEASED,
1007 .node = WREPL_NODE_B,
1009 .num_ips = ARRAY_SIZE(addresses_A_2),
1010 .ips = addresses_A_2,
1012 .type = WREPL_TYPE_SGROUP,
1013 .state = WREPL_STATE_ACTIVE,
1014 .node = WREPL_NODE_B,
1016 .num_ips = ARRAY_SIZE(addresses_A_1),
1017 .ips = addresses_A_1,
1019 .type = WREPL_TYPE_SGROUP,
1020 .state = WREPL_STATE_ACTIVE,
1021 .node = WREPL_NODE_B,
1023 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1024 .ips = addresses_A_3_4,
1026 .type = WREPL_TYPE_SGROUP,
1027 .state = WREPL_STATE_TOMBSTONE,
1028 .node = WREPL_NODE_B,
1030 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1031 .ips = addresses_B_3_4,
1033 /* the last one should always be a unique,tomstone record! */
1034 .type = WREPL_TYPE_UNIQUE,
1035 .state = WREPL_STATE_TOMBSTONE,
1036 .node = WREPL_NODE_B,
1038 .num_ips = ARRAY_SIZE(addresses_A_1),
1039 .ips = addresses_A_1,
1043 if (!ctx) return False;
1045 name.name = "_SAME_OWNER_A";
1049 wins_name_tmp = NULL;
1050 wins_name_last = &wins_name2;
1051 wins_name_cur = &wins_name1;
1053 for (j=0; ret && j < ARRAY_SIZE(types); j++) {
1054 name.type = types[j];
1055 printf("Test Replica Conflicts with same owner[%s] for %s\n",
1056 nbt_name_string(ctx, &name), ctx->a.address);
1058 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
1059 wins_name_tmp = wins_name_last;
1060 wins_name_last = wins_name_cur;
1061 wins_name_cur = wins_name_tmp;
1064 printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
1065 wrepl_name_type_string(records[i-1].type),
1066 wrepl_name_state_string(records[i-1].state),
1067 (records[i-1].is_static?",static":""),
1068 wrepl_name_type_string(records[i].type),
1069 wrepl_name_state_string(records[i].state),
1070 (records[i].is_static?",static":""),
1071 (records[i-1].ips==records[i].ips?"same":"different"),
1075 wins_name_cur->name = &name;
1076 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
1079 records[i].is_static);
1080 wins_name_cur->id = ++ctx->a.max_version;
1081 if (wins_name_cur->flags & 2) {
1082 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
1083 wins_name_cur->addresses.addresses.ips = discard_const(records[i].ips);
1085 wins_name_cur->addresses.ip = records[i].ips[0].ip;
1087 wins_name_cur->unknown = "255.255.255.255";
1089 ret &= test_wrepl_update_one(ctx, &ctx->a,wins_name_cur);
1090 if (records[i].state == WREPL_STATE_RELEASED) {
1091 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_last, False);
1092 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, False);
1094 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, True);
1097 /* the first one is a cleanup run */
1098 if (!ret && i == 0) ret = True;
1101 printf("conflict handled wrong or record[%u]: %s\n", i, __location__);
1109 static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx)
1112 struct wrepl_wins_name wins_name1;
1113 struct wrepl_wins_name wins_name2;
1114 struct wrepl_wins_name *wins_name_r1;
1115 struct wrepl_wins_name *wins_name_r2;
1118 const char *line; /* just better debugging */
1119 struct nbt_name name;
1120 BOOL extra; /* not the worst case, this is an extra test */
1123 struct wrepl_wins_owner *owner;
1124 enum wrepl_name_type type;
1125 enum wrepl_name_state state;
1126 enum wrepl_name_node node;
1129 const struct wrepl_ip *ips;
1130 BOOL apply_expected;
1131 BOOL merge_expected;
1135 * NOTE: the first record and the last applied one
1136 * needs to be from the same owner,
1137 * to not conflict in the next smbtorture run!!!
1140 .line = __location__,
1141 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1145 .type = WREPL_TYPE_UNIQUE,
1146 .state = WREPL_STATE_TOMBSTONE,
1147 .node = WREPL_NODE_B,
1149 .num_ips = ARRAY_SIZE(addresses_B_1),
1150 .ips = addresses_B_1,
1151 .apply_expected = True /* ignored */
1155 .type = WREPL_TYPE_UNIQUE,
1156 .state = WREPL_STATE_TOMBSTONE,
1157 .node = WREPL_NODE_B,
1159 .num_ips = ARRAY_SIZE(addresses_A_1),
1160 .ips = addresses_A_1,
1161 .apply_expected = True /* ignored */
1166 * unique vs unique section
1169 * unique,active vs. unique,active
1170 * => should be replaced
1173 .line = __location__,
1174 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1177 .type = WREPL_TYPE_UNIQUE,
1178 .state = WREPL_STATE_ACTIVE,
1179 .node = WREPL_NODE_B,
1181 .num_ips = ARRAY_SIZE(addresses_A_1),
1182 .ips = addresses_A_1,
1183 .apply_expected = True
1187 .type = WREPL_TYPE_UNIQUE,
1188 .state = WREPL_STATE_ACTIVE,
1189 .node = WREPL_NODE_B,
1191 .num_ips = ARRAY_SIZE(addresses_B_1),
1192 .ips = addresses_B_1,
1193 .apply_expected = True
1198 * unique,active vs. unique,tombstone
1199 * => should NOT be replaced
1202 .line = __location__,
1203 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1206 .type = WREPL_TYPE_UNIQUE,
1207 .state = WREPL_STATE_ACTIVE,
1208 .node = WREPL_NODE_B,
1210 .num_ips = ARRAY_SIZE(addresses_B_1),
1211 .ips = addresses_B_1,
1212 .apply_expected = True
1216 .type = WREPL_TYPE_UNIQUE,
1217 .state = WREPL_STATE_TOMBSTONE,
1218 .node = WREPL_NODE_B,
1220 .num_ips = ARRAY_SIZE(addresses_B_1),
1221 .ips = addresses_B_1,
1222 .apply_expected = False
1227 * unique,released vs. unique,active
1228 * => should be replaced
1231 .line = __location__,
1232 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1235 .type = WREPL_TYPE_UNIQUE,
1236 .state = WREPL_STATE_RELEASED,
1237 .node = WREPL_NODE_B,
1239 .num_ips = ARRAY_SIZE(addresses_B_1),
1240 .ips = addresses_B_1,
1241 .apply_expected = False
1245 .type = WREPL_TYPE_UNIQUE,
1246 .state = WREPL_STATE_ACTIVE,
1247 .node = WREPL_NODE_B,
1249 .num_ips = ARRAY_SIZE(addresses_A_1),
1250 .ips = addresses_A_1,
1251 .apply_expected = True
1256 * unique,released vs. unique,tombstone
1257 * => should be replaced
1260 .line = __location__,
1261 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1264 .type = WREPL_TYPE_UNIQUE,
1265 .state = WREPL_STATE_RELEASED,
1266 .node = WREPL_NODE_B,
1268 .num_ips = ARRAY_SIZE(addresses_A_1),
1269 .ips = addresses_A_1,
1270 .apply_expected = False
1274 .type = WREPL_TYPE_UNIQUE,
1275 .state = WREPL_STATE_TOMBSTONE,
1276 .node = WREPL_NODE_B,
1278 .num_ips = ARRAY_SIZE(addresses_B_1),
1279 .ips = addresses_B_1,
1280 .apply_expected = True
1285 * unique,tombstone vs. unique,active
1286 * => should be replaced
1289 .line = __location__,
1290 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1293 .type = WREPL_TYPE_UNIQUE,
1294 .state = WREPL_STATE_TOMBSTONE,
1295 .node = WREPL_NODE_B,
1297 .num_ips = ARRAY_SIZE(addresses_B_1),
1298 .ips = addresses_B_1,
1299 .apply_expected = True
1303 .type = WREPL_TYPE_UNIQUE,
1304 .state = WREPL_STATE_ACTIVE,
1305 .node = WREPL_NODE_B,
1307 .num_ips = ARRAY_SIZE(addresses_A_1),
1308 .ips = addresses_A_1,
1309 .apply_expected = True
1314 * unique,tombstone vs. unique,tombstone
1315 * => should be replaced
1318 .line = __location__,
1319 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1322 .type = WREPL_TYPE_UNIQUE,
1323 .state = WREPL_STATE_TOMBSTONE,
1324 .node = WREPL_NODE_B,
1326 .num_ips = ARRAY_SIZE(addresses_A_1),
1327 .ips = addresses_A_1,
1328 .apply_expected = True
1332 .type = WREPL_TYPE_UNIQUE,
1333 .state = WREPL_STATE_TOMBSTONE,
1334 .node = WREPL_NODE_B,
1336 .num_ips = ARRAY_SIZE(addresses_B_1),
1337 .ips = addresses_B_1,
1338 .apply_expected = True
1344 * unique vs normal groups section,
1347 * unique,active vs. group,active
1348 * => should be replaced
1351 .line = __location__,
1352 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1355 .type = WREPL_TYPE_UNIQUE,
1356 .state = WREPL_STATE_ACTIVE,
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_GROUP,
1366 .state = WREPL_STATE_ACTIVE,
1367 .node = WREPL_NODE_B,
1369 .num_ips = ARRAY_SIZE(addresses_A_1),
1370 .ips = addresses_A_1,
1371 .apply_expected = True
1376 * unique,active vs. group,tombstone
1377 * => should NOT be replaced
1380 .line = __location__,
1381 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1384 .type = WREPL_TYPE_UNIQUE,
1385 .state = WREPL_STATE_ACTIVE,
1386 .node = WREPL_NODE_B,
1388 .num_ips = ARRAY_SIZE(addresses_A_1),
1389 .ips = addresses_A_1,
1390 .apply_expected = True
1394 .type = WREPL_TYPE_GROUP,
1395 .state = WREPL_STATE_TOMBSTONE,
1396 .node = WREPL_NODE_B,
1398 .num_ips = ARRAY_SIZE(addresses_A_1),
1399 .ips = addresses_A_1,
1400 .apply_expected = False
1405 * unique,released vs. group,active
1406 * => should be replaced
1409 .line = __location__,
1410 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1413 .type = WREPL_TYPE_UNIQUE,
1414 .state = WREPL_STATE_RELEASED,
1415 .node = WREPL_NODE_B,
1417 .num_ips = ARRAY_SIZE(addresses_A_1),
1418 .ips = addresses_A_1,
1419 .apply_expected = False
1423 .type = WREPL_TYPE_GROUP,
1424 .state = WREPL_STATE_ACTIVE,
1425 .node = WREPL_NODE_B,
1427 .num_ips = ARRAY_SIZE(addresses_B_1),
1428 .ips = addresses_B_1,
1429 .apply_expected = True
1434 * unique,released vs. group,tombstone
1435 * => should be replaced
1438 .line = __location__,
1439 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1442 .type = WREPL_TYPE_UNIQUE,
1443 .state = WREPL_STATE_RELEASED,
1444 .node = WREPL_NODE_B,
1446 .num_ips = ARRAY_SIZE(addresses_B_1),
1447 .ips = addresses_B_1,
1448 .apply_expected = False
1452 .type = WREPL_TYPE_GROUP,
1453 .state = WREPL_STATE_TOMBSTONE,
1454 .node = WREPL_NODE_B,
1456 .num_ips = ARRAY_SIZE(addresses_A_1),
1457 .ips = addresses_A_1,
1458 .apply_expected = True
1463 * unique,tombstone vs. group,active
1464 * => should be replaced
1467 .line = __location__,
1468 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1471 .type = WREPL_TYPE_UNIQUE,
1472 .state = WREPL_STATE_TOMBSTONE,
1473 .node = WREPL_NODE_B,
1475 .num_ips = ARRAY_SIZE(addresses_A_1),
1476 .ips = addresses_A_1,
1477 .apply_expected = True
1481 .type = WREPL_TYPE_GROUP,
1482 .state = WREPL_STATE_ACTIVE,
1483 .node = WREPL_NODE_B,
1485 .num_ips = ARRAY_SIZE(addresses_B_1),
1486 .ips = addresses_B_1,
1487 .apply_expected = True
1492 * unique,tombstone vs. group,tombstone
1493 * => should be replaced
1496 .line = __location__,
1497 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1500 .type = WREPL_TYPE_UNIQUE,
1501 .state = WREPL_STATE_TOMBSTONE,
1502 .node = WREPL_NODE_B,
1504 .num_ips = ARRAY_SIZE(addresses_B_1),
1505 .ips = addresses_B_1,
1506 .apply_expected = True
1510 .type = WREPL_TYPE_GROUP,
1511 .state = WREPL_STATE_TOMBSTONE,
1512 .node = WREPL_NODE_B,
1514 .num_ips = ARRAY_SIZE(addresses_A_1),
1515 .ips = addresses_A_1,
1516 .apply_expected = True
1521 * unique vs special groups section,
1524 * unique,active vs. sgroup,active
1525 * => should NOT be replaced
1528 .line = __location__,
1529 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1532 .type = WREPL_TYPE_UNIQUE,
1533 .state = WREPL_STATE_ACTIVE,
1534 .node = WREPL_NODE_B,
1536 .num_ips = ARRAY_SIZE(addresses_A_1),
1537 .ips = addresses_A_1,
1538 .apply_expected = True
1542 .type = WREPL_TYPE_SGROUP,
1543 .state = WREPL_STATE_ACTIVE,
1544 .node = WREPL_NODE_B,
1546 .num_ips = ARRAY_SIZE(addresses_A_1),
1547 .ips = addresses_A_1,
1548 .apply_expected = False
1553 * unique,active vs. sgroup,tombstone
1554 * => should NOT be replaced
1557 .line = __location__,
1558 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1561 .type = WREPL_TYPE_UNIQUE,
1562 .state = WREPL_STATE_ACTIVE,
1563 .node = WREPL_NODE_B,
1565 .num_ips = ARRAY_SIZE(addresses_A_1),
1566 .ips = addresses_A_1,
1567 .apply_expected = True
1571 .type = WREPL_TYPE_SGROUP,
1572 .state = WREPL_STATE_TOMBSTONE,
1573 .node = WREPL_NODE_B,
1575 .num_ips = ARRAY_SIZE(addresses_A_1),
1576 .ips = addresses_A_1,
1577 .apply_expected = False
1582 * unique,released vs. sgroup,active
1583 * => should be replaced
1586 .line = __location__,
1587 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1590 .type = WREPL_TYPE_UNIQUE,
1591 .state = WREPL_STATE_RELEASED,
1592 .node = WREPL_NODE_B,
1594 .num_ips = ARRAY_SIZE(addresses_A_1),
1595 .ips = addresses_A_1,
1596 .apply_expected = False
1600 .type = WREPL_TYPE_SGROUP,
1601 .state = WREPL_STATE_ACTIVE,
1602 .node = WREPL_NODE_B,
1604 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1605 .ips = addresses_B_3_4,
1606 .apply_expected = True
1611 * unique,released vs. sgroup,tombstone
1612 * => should be replaced
1615 .line = __location__,
1616 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1619 .type = WREPL_TYPE_UNIQUE,
1620 .state = WREPL_STATE_RELEASED,
1621 .node = WREPL_NODE_B,
1623 .num_ips = ARRAY_SIZE(addresses_B_1),
1624 .ips = addresses_B_1,
1625 .apply_expected = False
1629 .type = WREPL_TYPE_SGROUP,
1630 .state = WREPL_STATE_TOMBSTONE,
1631 .node = WREPL_NODE_B,
1633 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1634 .ips = addresses_A_3_4,
1635 .apply_expected = True
1640 * unique,tombstone vs. sgroup,active
1641 * => should be replaced
1644 .line = __location__,
1645 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1648 .type = WREPL_TYPE_UNIQUE,
1649 .state = WREPL_STATE_TOMBSTONE,
1650 .node = WREPL_NODE_B,
1652 .num_ips = ARRAY_SIZE(addresses_A_1),
1653 .ips = addresses_A_1,
1654 .apply_expected = True
1658 .type = WREPL_TYPE_SGROUP,
1659 .state = WREPL_STATE_ACTIVE,
1660 .node = WREPL_NODE_B,
1662 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1663 .ips = addresses_B_3_4,
1664 .apply_expected = True
1669 * unique,tombstone vs. sgroup,tombstone
1670 * => should be replaced
1673 .line = __location__,
1674 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1677 .type = WREPL_TYPE_UNIQUE,
1678 .state = WREPL_STATE_TOMBSTONE,
1679 .node = WREPL_NODE_B,
1681 .num_ips = ARRAY_SIZE(addresses_B_1),
1682 .ips = addresses_B_1,
1683 .apply_expected = True
1687 .type = WREPL_TYPE_SGROUP,
1688 .state = WREPL_STATE_TOMBSTONE,
1689 .node = WREPL_NODE_B,
1691 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1692 .ips = addresses_A_3_4,
1693 .apply_expected = True
1698 * unique vs multi homed section,
1701 * unique,active vs. mhomed,active
1702 * => should be replaced
1705 .line = __location__,
1706 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1709 .type = WREPL_TYPE_UNIQUE,
1710 .state = WREPL_STATE_ACTIVE,
1711 .node = WREPL_NODE_B,
1713 .num_ips = ARRAY_SIZE(addresses_A_1),
1714 .ips = addresses_A_1,
1715 .apply_expected = True
1719 .type = WREPL_TYPE_MHOMED,
1720 .state = WREPL_STATE_ACTIVE,
1721 .node = WREPL_NODE_B,
1723 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1724 .ips = addresses_B_3_4,
1725 .apply_expected = True
1730 * unique,active vs. mhomed,tombstone
1731 * => should NOT be replaced
1734 .line = __location__,
1735 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1738 .type = WREPL_TYPE_UNIQUE,
1739 .state = WREPL_STATE_ACTIVE,
1740 .node = WREPL_NODE_B,
1742 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1743 .ips = addresses_B_3_4,
1744 .apply_expected = True
1748 .type = WREPL_TYPE_MHOMED,
1749 .state = WREPL_STATE_TOMBSTONE,
1750 .node = WREPL_NODE_B,
1752 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1753 .ips = addresses_B_3_4,
1754 .apply_expected = False
1759 * unique,released vs. mhomed,active
1760 * => should be replaced
1763 .line = __location__,
1764 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1767 .type = WREPL_TYPE_UNIQUE,
1768 .state = WREPL_STATE_RELEASED,
1769 .node = WREPL_NODE_B,
1771 .num_ips = ARRAY_SIZE(addresses_B_1),
1772 .ips = addresses_B_1,
1773 .apply_expected = False
1777 .type = WREPL_TYPE_MHOMED,
1778 .state = WREPL_STATE_ACTIVE,
1779 .node = WREPL_NODE_B,
1781 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1782 .ips = addresses_A_3_4,
1783 .apply_expected = True
1788 * unique,released vs. mhomed,tombstone
1789 * => should be replaced
1792 .line = __location__,
1793 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1796 .type = WREPL_TYPE_UNIQUE,
1797 .state = WREPL_STATE_RELEASED,
1798 .node = WREPL_NODE_B,
1800 .num_ips = ARRAY_SIZE(addresses_A_1),
1801 .ips = addresses_A_1,
1802 .apply_expected = False
1806 .type = WREPL_TYPE_MHOMED,
1807 .state = WREPL_STATE_TOMBSTONE,
1808 .node = WREPL_NODE_B,
1810 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1811 .ips = addresses_B_3_4,
1812 .apply_expected = True
1817 * unique,tombstone vs. mhomed,active
1818 * => should be replaced
1821 .line = __location__,
1822 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1825 .type = WREPL_TYPE_UNIQUE,
1826 .state = WREPL_STATE_TOMBSTONE,
1827 .node = WREPL_NODE_B,
1829 .num_ips = ARRAY_SIZE(addresses_B_1),
1830 .ips = addresses_B_1,
1831 .apply_expected = True
1835 .type = WREPL_TYPE_MHOMED,
1836 .state = WREPL_STATE_ACTIVE,
1837 .node = WREPL_NODE_B,
1839 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1840 .ips = addresses_A_3_4,
1841 .apply_expected = True
1846 * unique,tombstone vs. mhomed,tombstone
1847 * => should be replaced
1850 .line = __location__,
1851 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1854 .type = WREPL_TYPE_UNIQUE,
1855 .state = WREPL_STATE_TOMBSTONE,
1856 .node = WREPL_NODE_B,
1858 .num_ips = ARRAY_SIZE(addresses_A_1),
1859 .ips = addresses_A_1,
1860 .apply_expected = True
1864 .type = WREPL_TYPE_MHOMED,
1865 .state = WREPL_STATE_TOMBSTONE,
1866 .node = WREPL_NODE_B,
1868 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1869 .ips = addresses_B_3_4,
1870 .apply_expected = True
1875 * normal groups vs unique section,
1878 * group,active vs. unique,active
1879 * => should NOT be replaced
1882 .line = __location__,
1883 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1886 .type = WREPL_TYPE_GROUP,
1887 .state = WREPL_STATE_ACTIVE,
1888 .node = WREPL_NODE_B,
1890 .num_ips = ARRAY_SIZE(addresses_A_1),
1891 .ips = addresses_A_1,
1892 .apply_expected = True
1896 .type = WREPL_TYPE_UNIQUE,
1897 .state = WREPL_STATE_ACTIVE,
1898 .node = WREPL_NODE_B,
1900 .num_ips = ARRAY_SIZE(addresses_A_1),
1901 .ips = addresses_A_1,
1902 .apply_expected = False
1907 * group,active vs. unique,tombstone
1908 * => should NOT be replaced
1911 .line = __location__,
1912 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1915 .type = WREPL_TYPE_GROUP,
1916 .state = WREPL_STATE_ACTIVE,
1917 .node = WREPL_NODE_B,
1919 .num_ips = ARRAY_SIZE(addresses_A_1),
1920 .ips = addresses_A_1,
1921 .apply_expected = True
1925 .type = WREPL_TYPE_UNIQUE,
1926 .state = WREPL_STATE_TOMBSTONE,
1927 .node = WREPL_NODE_B,
1929 .num_ips = ARRAY_SIZE(addresses_A_1),
1930 .ips = addresses_A_1,
1931 .apply_expected = False
1936 * group,released vs. unique,active
1937 * => should NOT be replaced
1940 .line = __location__,
1941 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1944 .type = WREPL_TYPE_GROUP,
1945 .state = WREPL_STATE_RELEASED,
1946 .node = WREPL_NODE_B,
1948 .num_ips = ARRAY_SIZE(addresses_A_1),
1949 .ips = addresses_A_1,
1950 .apply_expected = False
1954 .type = WREPL_TYPE_UNIQUE,
1955 .state = WREPL_STATE_ACTIVE,
1956 .node = WREPL_NODE_B,
1958 .num_ips = ARRAY_SIZE(addresses_A_1),
1959 .ips = addresses_A_1,
1960 .apply_expected = False
1965 * group,released vs. unique,tombstone
1966 * => should NOT be replaced
1969 .line = __location__,
1970 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1973 .type = WREPL_TYPE_GROUP,
1974 .state = WREPL_STATE_RELEASED,
1975 .node = WREPL_NODE_B,
1977 .num_ips = ARRAY_SIZE(addresses_A_1),
1978 .ips = addresses_A_1,
1979 .apply_expected = False
1983 .type = WREPL_TYPE_UNIQUE,
1984 .state = WREPL_STATE_TOMBSTONE,
1985 .node = WREPL_NODE_B,
1987 .num_ips = ARRAY_SIZE(addresses_A_1),
1988 .ips = addresses_A_1,
1989 .apply_expected = False
1994 * group,tombstone vs. unique,active
1995 * => should NOT be replaced
1998 .line = __location__,
1999 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2002 .type = WREPL_TYPE_GROUP,
2003 .state = WREPL_STATE_TOMBSTONE,
2004 .node = WREPL_NODE_B,
2006 .num_ips = ARRAY_SIZE(addresses_A_1),
2007 .ips = addresses_A_1,
2008 .apply_expected = True
2012 .type = WREPL_TYPE_UNIQUE,
2013 .state = WREPL_STATE_ACTIVE,
2014 .node = WREPL_NODE_B,
2016 .num_ips = ARRAY_SIZE(addresses_A_1),
2017 .ips = addresses_A_1,
2018 .apply_expected = False
2023 * group,tombstone vs. unique,tombstone
2024 * => should NOT be replaced
2027 .line = __location__,
2028 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2031 .type = WREPL_TYPE_GROUP,
2032 .state = WREPL_STATE_TOMBSTONE,
2033 .node = WREPL_NODE_B,
2035 .num_ips = ARRAY_SIZE(addresses_A_1),
2036 .ips = addresses_A_1,
2037 .apply_expected = True
2041 .type = WREPL_TYPE_UNIQUE,
2042 .state = WREPL_STATE_TOMBSTONE,
2043 .node = WREPL_NODE_B,
2045 .num_ips = ARRAY_SIZE(addresses_A_1),
2046 .ips = addresses_A_1,
2047 .apply_expected = False
2052 * normal groups vs normal groups section,
2055 * group,active vs. group,active
2056 * => should NOT be replaced
2059 .line = __location__,
2060 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2063 .type = WREPL_TYPE_GROUP,
2064 .state = WREPL_STATE_ACTIVE,
2065 .node = WREPL_NODE_B,
2067 .num_ips = ARRAY_SIZE(addresses_A_1),
2068 .ips = addresses_A_1,
2069 .apply_expected = True
2073 .type = WREPL_TYPE_GROUP,
2074 .state = WREPL_STATE_ACTIVE,
2075 .node = WREPL_NODE_B,
2077 .num_ips = ARRAY_SIZE(addresses_A_1),
2078 .ips = addresses_A_1,
2079 .apply_expected = False
2084 * group,active vs. group,tombstone
2085 * => should NOT be replaced
2088 .line = __location__,
2089 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2092 .type = WREPL_TYPE_GROUP,
2093 .state = WREPL_STATE_ACTIVE,
2094 .node = WREPL_NODE_B,
2096 .num_ips = ARRAY_SIZE(addresses_A_1),
2097 .ips = addresses_A_1,
2098 .apply_expected = True
2102 .type = WREPL_TYPE_GROUP,
2103 .state = WREPL_STATE_TOMBSTONE,
2104 .node = WREPL_NODE_B,
2106 .num_ips = ARRAY_SIZE(addresses_A_1),
2107 .ips = addresses_A_1,
2108 .apply_expected = False
2113 * group,released vs. group,active
2114 * => should be replaced
2117 .line = __location__,
2118 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2121 .type = WREPL_TYPE_GROUP,
2122 .state = WREPL_STATE_RELEASED,
2123 .node = WREPL_NODE_B,
2125 .num_ips = ARRAY_SIZE(addresses_A_1),
2126 .ips = addresses_A_1,
2127 .apply_expected = False
2131 .type = WREPL_TYPE_GROUP,
2132 .state = WREPL_STATE_ACTIVE,
2133 .node = WREPL_NODE_B,
2135 .num_ips = ARRAY_SIZE(addresses_B_1),
2136 .ips = addresses_B_1,
2137 .apply_expected = True
2142 * group,released vs. group,tombstone
2143 * => should be replaced
2146 .line = __location__,
2147 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2150 .type = WREPL_TYPE_GROUP,
2151 .state = WREPL_STATE_RELEASED,
2152 .node = WREPL_NODE_B,
2154 .num_ips = ARRAY_SIZE(addresses_A_1),
2155 .ips = addresses_A_1,
2156 .apply_expected = False
2160 .type = WREPL_TYPE_GROUP,
2161 .state = WREPL_STATE_TOMBSTONE,
2162 .node = WREPL_NODE_B,
2164 .num_ips = ARRAY_SIZE(addresses_B_1),
2165 .ips = addresses_B_1,
2166 .apply_expected = True
2171 * group,tombstone vs. group,active
2172 * => should be replaced
2175 .line = __location__,
2176 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2179 .type = WREPL_TYPE_GROUP,
2180 .state = WREPL_STATE_TOMBSTONE,
2181 .node = WREPL_NODE_B,
2183 .num_ips = ARRAY_SIZE(addresses_B_1),
2184 .ips = addresses_B_1,
2185 .apply_expected = True
2189 .type = WREPL_TYPE_GROUP,
2190 .state = WREPL_STATE_ACTIVE,
2191 .node = WREPL_NODE_B,
2193 .num_ips = ARRAY_SIZE(addresses_A_1),
2194 .ips = addresses_A_1,
2195 .apply_expected = True
2200 * group,tombstone vs. group,tombstone
2201 * => should be replaced
2204 .line = __location__,
2205 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2208 .type = WREPL_TYPE_GROUP,
2209 .state = WREPL_STATE_TOMBSTONE,
2210 .node = WREPL_NODE_B,
2212 .num_ips = ARRAY_SIZE(addresses_A_1),
2213 .ips = addresses_A_1,
2214 .apply_expected = True
2218 .type = WREPL_TYPE_GROUP,
2219 .state = WREPL_STATE_TOMBSTONE,
2220 .node = WREPL_NODE_B,
2222 .num_ips = ARRAY_SIZE(addresses_B_1),
2223 .ips = addresses_B_1,
2224 .apply_expected = True
2229 * normal groups vs special groups section,
2232 * group,active vs. sgroup,active
2233 * => should NOT be replaced
2236 .line = __location__,
2237 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2240 .type = WREPL_TYPE_GROUP,
2241 .state = WREPL_STATE_ACTIVE,
2242 .node = WREPL_NODE_B,
2244 .num_ips = ARRAY_SIZE(addresses_B_1),
2245 .ips = addresses_B_1,
2246 .apply_expected = True
2250 .type = WREPL_TYPE_SGROUP,
2251 .state = WREPL_STATE_ACTIVE,
2252 .node = WREPL_NODE_B,
2254 .num_ips = ARRAY_SIZE(addresses_B_1),
2255 .ips = addresses_B_1,
2256 .apply_expected = False
2261 * group,active vs. sgroup,tombstone
2262 * => should NOT be replaced
2265 .line = __location__,
2266 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2269 .type = WREPL_TYPE_GROUP,
2270 .state = WREPL_STATE_ACTIVE,
2271 .node = WREPL_NODE_B,
2273 .num_ips = ARRAY_SIZE(addresses_B_1),
2274 .ips = addresses_B_1,
2275 .apply_expected = True
2279 .type = WREPL_TYPE_SGROUP,
2280 .state = WREPL_STATE_TOMBSTONE,
2281 .node = WREPL_NODE_B,
2283 .num_ips = ARRAY_SIZE(addresses_B_1),
2284 .ips = addresses_B_1,
2285 .apply_expected = False
2290 * group,released vs. sgroup,active
2291 * => should be replaced
2294 .line = __location__,
2295 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2298 .type = WREPL_TYPE_GROUP,
2299 .state = WREPL_STATE_RELEASED,
2300 .node = WREPL_NODE_B,
2302 .num_ips = ARRAY_SIZE(addresses_A_1),
2303 .ips = addresses_A_1,
2304 .apply_expected = False
2308 .type = WREPL_TYPE_SGROUP,
2309 .state = WREPL_STATE_ACTIVE,
2310 .node = WREPL_NODE_B,
2312 .num_ips = ARRAY_SIZE(addresses_B_1),
2313 .ips = addresses_B_1,
2314 .apply_expected = True
2319 * group,released vs. sgroup,tombstone
2320 * => should NOT be replaced
2323 .line = __location__,
2324 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2327 .type = WREPL_TYPE_GROUP,
2328 .state = WREPL_STATE_RELEASED,
2329 .node = WREPL_NODE_B,
2331 .num_ips = ARRAY_SIZE(addresses_B_1),
2332 .ips = addresses_B_1,
2333 .apply_expected = False
2337 .type = WREPL_TYPE_SGROUP,
2338 .state = WREPL_STATE_TOMBSTONE,
2339 .node = WREPL_NODE_B,
2341 .num_ips = ARRAY_SIZE(addresses_B_1),
2342 .ips = addresses_B_1,
2343 .apply_expected = False
2348 * group,tombstone vs. sgroup,active
2349 * => should be replaced
2352 .line = __location__,
2353 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2356 .type = WREPL_TYPE_GROUP,
2357 .state = WREPL_STATE_TOMBSTONE,
2358 .node = WREPL_NODE_B,
2360 .num_ips = ARRAY_SIZE(addresses_B_1),
2361 .ips = addresses_B_1,
2362 .apply_expected = True
2366 .type = WREPL_TYPE_SGROUP,
2367 .state = WREPL_STATE_ACTIVE,
2368 .node = WREPL_NODE_B,
2370 .num_ips = ARRAY_SIZE(addresses_A_1),
2371 .ips = addresses_A_1,
2372 .apply_expected = True
2377 * group,tombstone vs. sgroup,tombstone
2378 * => should be replaced
2381 .line = __location__,
2382 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2385 .type = WREPL_TYPE_GROUP,
2386 .state = WREPL_STATE_TOMBSTONE,
2387 .node = WREPL_NODE_B,
2389 .num_ips = ARRAY_SIZE(addresses_A_1),
2390 .ips = addresses_A_1,
2391 .apply_expected = True
2395 .type = WREPL_TYPE_SGROUP,
2396 .state = WREPL_STATE_TOMBSTONE,
2397 .node = WREPL_NODE_B,
2399 .num_ips = ARRAY_SIZE(addresses_B_1),
2400 .ips = addresses_B_1,
2401 .apply_expected = True
2406 * normal groups vs multi homed section,
2409 * group,active vs. mhomed,active
2410 * => should NOT be replaced
2413 .line = __location__,
2414 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2417 .type = WREPL_TYPE_GROUP,
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 = True
2427 .type = WREPL_TYPE_MHOMED,
2428 .state = WREPL_STATE_ACTIVE,
2429 .node = WREPL_NODE_B,
2431 .num_ips = ARRAY_SIZE(addresses_B_1),
2432 .ips = addresses_B_1,
2433 .apply_expected = False
2438 * group,active vs. mhomed,tombstone
2439 * => should NOT be replaced
2442 .line = __location__,
2443 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2446 .type = WREPL_TYPE_GROUP,
2447 .state = WREPL_STATE_ACTIVE,
2448 .node = WREPL_NODE_B,
2450 .num_ips = ARRAY_SIZE(addresses_B_1),
2451 .ips = addresses_B_1,
2452 .apply_expected = True
2456 .type = WREPL_TYPE_MHOMED,
2457 .state = WREPL_STATE_TOMBSTONE,
2458 .node = WREPL_NODE_B,
2460 .num_ips = ARRAY_SIZE(addresses_B_1),
2461 .ips = addresses_B_1,
2462 .apply_expected = False
2467 * group,released vs. mhomed,active
2468 * => should NOT be replaced
2471 .line = __location__,
2472 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2475 .type = WREPL_TYPE_GROUP,
2476 .state = WREPL_STATE_RELEASED,
2477 .node = WREPL_NODE_B,
2479 .num_ips = ARRAY_SIZE(addresses_B_1),
2480 .ips = addresses_B_1,
2481 .apply_expected = False
2485 .type = WREPL_TYPE_MHOMED,
2486 .state = WREPL_STATE_ACTIVE,
2487 .node = WREPL_NODE_B,
2489 .num_ips = ARRAY_SIZE(addresses_B_1),
2490 .ips = addresses_B_1,
2491 .apply_expected = False
2496 * group,released vs. mhomed,tombstone
2497 * => should NOT be replaced
2500 .line = __location__,
2501 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2504 .type = WREPL_TYPE_GROUP,
2505 .state = WREPL_STATE_RELEASED,
2506 .node = WREPL_NODE_B,
2508 .num_ips = ARRAY_SIZE(addresses_B_1),
2509 .ips = addresses_B_1,
2510 .apply_expected = False
2514 .type = WREPL_TYPE_MHOMED,
2515 .state = WREPL_STATE_TOMBSTONE,
2516 .node = WREPL_NODE_B,
2518 .num_ips = ARRAY_SIZE(addresses_B_1),
2519 .ips = addresses_B_1,
2520 .apply_expected = False
2525 * group,tombstone vs. mhomed,active
2526 * => should be replaced
2529 .line = __location__,
2530 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2533 .type = WREPL_TYPE_GROUP,
2534 .state = WREPL_STATE_TOMBSTONE,
2535 .node = WREPL_NODE_B,
2537 .num_ips = ARRAY_SIZE(addresses_B_1),
2538 .ips = addresses_B_1,
2539 .apply_expected = True
2543 .type = WREPL_TYPE_MHOMED,
2544 .state = WREPL_STATE_ACTIVE,
2545 .node = WREPL_NODE_B,
2547 .num_ips = ARRAY_SIZE(addresses_A_1),
2548 .ips = addresses_A_1,
2549 .apply_expected = True
2554 * group,tombstone vs. mhomed,tombstone
2555 * => should be replaced
2558 .line = __location__,
2559 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2562 .type = WREPL_TYPE_GROUP,
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
2572 .type = WREPL_TYPE_MHOMED,
2573 .state = WREPL_STATE_TOMBSTONE,
2574 .node = WREPL_NODE_B,
2576 .num_ips = ARRAY_SIZE(addresses_B_1),
2577 .ips = addresses_B_1,
2578 .apply_expected = True
2583 * special groups vs unique section,
2586 * sgroup,active vs. unique,active
2587 * => should NOT be replaced
2590 .line = __location__,
2591 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2594 .type = WREPL_TYPE_SGROUP,
2595 .state = WREPL_STATE_ACTIVE,
2596 .node = WREPL_NODE_B,
2598 .num_ips = ARRAY_SIZE(addresses_B_1),
2599 .ips = addresses_B_1,
2600 .apply_expected = True
2604 .type = WREPL_TYPE_UNIQUE,
2605 .state = WREPL_STATE_ACTIVE,
2606 .node = WREPL_NODE_B,
2608 .num_ips = ARRAY_SIZE(addresses_B_1),
2609 .ips = addresses_B_1,
2610 .apply_expected = False
2615 * sgroup,active vs. unique,tombstone
2616 * => should NOT be replaced
2619 .line = __location__,
2620 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2623 .type = WREPL_TYPE_SGROUP,
2624 .state = WREPL_STATE_ACTIVE,
2625 .node = WREPL_NODE_B,
2627 .num_ips = ARRAY_SIZE(addresses_B_1),
2628 .ips = addresses_B_1,
2629 .apply_expected = True
2633 .type = WREPL_TYPE_UNIQUE,
2634 .state = WREPL_STATE_TOMBSTONE,
2635 .node = WREPL_NODE_B,
2637 .num_ips = ARRAY_SIZE(addresses_B_1),
2638 .ips = addresses_B_1,
2639 .apply_expected = False
2644 * sgroup,released vs. unique,active
2645 * => should be replaced
2648 .line = __location__,
2649 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2652 .type = WREPL_TYPE_SGROUP,
2653 .state = WREPL_STATE_RELEASED,
2654 .node = WREPL_NODE_B,
2656 .num_ips = ARRAY_SIZE(addresses_B_1),
2657 .ips = addresses_B_1,
2658 .apply_expected = False
2662 .type = WREPL_TYPE_UNIQUE,
2663 .state = WREPL_STATE_ACTIVE,
2664 .node = WREPL_NODE_B,
2666 .num_ips = ARRAY_SIZE(addresses_A_1),
2667 .ips = addresses_A_1,
2668 .apply_expected = True
2673 * sgroup,released vs. unique,tombstone
2674 * => should be replaced
2677 .line = __location__,
2678 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2681 .type = WREPL_TYPE_SGROUP,
2682 .state = WREPL_STATE_RELEASED,
2683 .node = WREPL_NODE_B,
2685 .num_ips = ARRAY_SIZE(addresses_A_1),
2686 .ips = addresses_A_1,
2687 .apply_expected = False
2691 .type = WREPL_TYPE_UNIQUE,
2692 .state = WREPL_STATE_TOMBSTONE,
2693 .node = WREPL_NODE_B,
2695 .num_ips = ARRAY_SIZE(addresses_B_1),
2696 .ips = addresses_B_1,
2697 .apply_expected = True
2702 * sgroup,tombstone vs. unique,active
2703 * => should be replaced
2706 .line = __location__,
2707 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2710 .type = WREPL_TYPE_SGROUP,
2711 .state = WREPL_STATE_TOMBSTONE,
2712 .node = WREPL_NODE_B,
2714 .num_ips = ARRAY_SIZE(addresses_A_1),
2715 .ips = addresses_A_1,
2716 .apply_expected = True
2720 .type = WREPL_TYPE_UNIQUE,
2721 .state = WREPL_STATE_ACTIVE,
2722 .node = WREPL_NODE_B,
2724 .num_ips = ARRAY_SIZE(addresses_B_1),
2725 .ips = addresses_B_1,
2726 .apply_expected = True
2731 * sgroup,tombstone vs. unique,tombstone
2732 * => should be replaced
2735 .line = __location__,
2736 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2739 .type = WREPL_TYPE_SGROUP,
2740 .state = WREPL_STATE_TOMBSTONE,
2741 .node = WREPL_NODE_B,
2743 .num_ips = ARRAY_SIZE(addresses_B_1),
2744 .ips = addresses_B_1,
2745 .apply_expected = True
2749 .type = WREPL_TYPE_UNIQUE,
2750 .state = WREPL_STATE_TOMBSTONE,
2751 .node = WREPL_NODE_B,
2753 .num_ips = ARRAY_SIZE(addresses_A_1),
2754 .ips = addresses_A_1,
2755 .apply_expected = True
2760 * special groups vs normal group section,
2763 * sgroup,active vs. group,active
2764 * => should NOT be replaced
2767 .line = __location__,
2768 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2771 .type = WREPL_TYPE_SGROUP,
2772 .state = WREPL_STATE_ACTIVE,
2773 .node = WREPL_NODE_B,
2775 .num_ips = ARRAY_SIZE(addresses_A_1),
2776 .ips = addresses_A_1,
2777 .apply_expected = True
2781 .type = WREPL_TYPE_GROUP,
2782 .state = WREPL_STATE_ACTIVE,
2783 .node = WREPL_NODE_B,
2785 .num_ips = ARRAY_SIZE(addresses_A_1),
2786 .ips = addresses_A_1,
2787 .apply_expected = False
2792 * sgroup,active vs. group,tombstone
2793 * => should NOT be replaced
2796 .line = __location__,
2797 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2800 .type = WREPL_TYPE_SGROUP,
2801 .state = WREPL_STATE_ACTIVE,
2802 .node = WREPL_NODE_B,
2804 .num_ips = ARRAY_SIZE(addresses_A_1),
2805 .ips = addresses_A_1,
2806 .apply_expected = True
2810 .type = WREPL_TYPE_GROUP,
2811 .state = WREPL_STATE_TOMBSTONE,
2812 .node = WREPL_NODE_B,
2814 .num_ips = ARRAY_SIZE(addresses_A_1),
2815 .ips = addresses_A_1,
2816 .apply_expected = False
2821 * sgroup,released vs. group,active
2822 * => should be replaced
2825 .line = __location__,
2826 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2829 .type = WREPL_TYPE_SGROUP,
2830 .state = WREPL_STATE_RELEASED,
2831 .node = WREPL_NODE_B,
2833 .num_ips = ARRAY_SIZE(addresses_A_1),
2834 .ips = addresses_A_1,
2835 .apply_expected = False
2839 .type = WREPL_TYPE_GROUP,
2840 .state = WREPL_STATE_ACTIVE,
2841 .node = WREPL_NODE_B,
2843 .num_ips = ARRAY_SIZE(addresses_B_1),
2844 .ips = addresses_B_1,
2845 .apply_expected = True
2850 * sgroup,released vs. group,tombstone
2851 * => should be replaced
2854 .line = __location__,
2855 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2858 .type = WREPL_TYPE_SGROUP,
2859 .state = WREPL_STATE_RELEASED,
2860 .node = WREPL_NODE_B,
2862 .num_ips = ARRAY_SIZE(addresses_B_1),
2863 .ips = addresses_B_1,
2864 .apply_expected = False
2868 .type = WREPL_TYPE_GROUP,
2869 .state = WREPL_STATE_TOMBSTONE,
2870 .node = WREPL_NODE_B,
2872 .num_ips = ARRAY_SIZE(addresses_A_1),
2873 .ips = addresses_A_1,
2874 .apply_expected = True
2879 * sgroup,tombstone vs. group,active
2880 * => should NOT be replaced
2883 .line = __location__,
2884 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2887 .type = WREPL_TYPE_SGROUP,
2888 .state = WREPL_STATE_TOMBSTONE,
2889 .node = WREPL_NODE_B,
2891 .num_ips = ARRAY_SIZE(addresses_A_1),
2892 .ips = addresses_A_1,
2893 .apply_expected = True
2897 .type = WREPL_TYPE_GROUP,
2898 .state = WREPL_STATE_ACTIVE,
2899 .node = WREPL_NODE_B,
2901 .num_ips = ARRAY_SIZE(addresses_B_1),
2902 .ips = addresses_B_1,
2903 .apply_expected = True
2908 * sgroup,tombstone vs. group,tombstone
2909 * => should NOT be replaced
2912 .line = __location__,
2913 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2916 .type = WREPL_TYPE_SGROUP,
2917 .state = WREPL_STATE_TOMBSTONE,
2918 .node = WREPL_NODE_B,
2920 .num_ips = ARRAY_SIZE(addresses_B_1),
2921 .ips = addresses_B_1,
2922 .apply_expected = True
2926 .type = WREPL_TYPE_GROUP,
2927 .state = WREPL_STATE_TOMBSTONE,
2928 .node = WREPL_NODE_B,
2930 .num_ips = ARRAY_SIZE(addresses_A_1),
2931 .ips = addresses_A_1,
2932 .apply_expected = True
2937 * special groups vs multi homed section,
2940 * sgroup,active vs. mhomed,active
2941 * => should NOT be replaced
2944 .line = __location__,
2945 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2948 .type = WREPL_TYPE_SGROUP,
2949 .state = WREPL_STATE_ACTIVE,
2950 .node = WREPL_NODE_B,
2952 .num_ips = ARRAY_SIZE(addresses_A_1),
2953 .ips = addresses_A_1,
2954 .apply_expected = True
2958 .type = WREPL_TYPE_MHOMED,
2959 .state = WREPL_STATE_ACTIVE,
2960 .node = WREPL_NODE_B,
2962 .num_ips = ARRAY_SIZE(addresses_A_1),
2963 .ips = addresses_A_1,
2964 .apply_expected = False
2969 * sgroup,active vs. mhomed,tombstone
2970 * => should NOT be replaced
2973 .line = __location__,
2974 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2977 .type = WREPL_TYPE_SGROUP,
2978 .state = WREPL_STATE_ACTIVE,
2979 .node = WREPL_NODE_B,
2981 .num_ips = ARRAY_SIZE(addresses_A_1),
2982 .ips = addresses_A_1,
2983 .apply_expected = True
2987 .type = WREPL_TYPE_MHOMED,
2988 .state = WREPL_STATE_TOMBSTONE,
2989 .node = WREPL_NODE_B,
2991 .num_ips = ARRAY_SIZE(addresses_A_1),
2992 .ips = addresses_A_1,
2993 .apply_expected = False
2998 * sgroup,released vs. mhomed,active
2999 * => should be replaced
3002 .line = __location__,
3003 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3006 .type = WREPL_TYPE_SGROUP,
3007 .state = WREPL_STATE_RELEASED,
3008 .node = WREPL_NODE_B,
3010 .num_ips = ARRAY_SIZE(addresses_A_1),
3011 .ips = addresses_A_1,
3012 .apply_expected = False
3016 .type = WREPL_TYPE_MHOMED,
3017 .state = WREPL_STATE_ACTIVE,
3018 .node = WREPL_NODE_B,
3020 .num_ips = ARRAY_SIZE(addresses_B_1),
3021 .ips = addresses_B_1,
3022 .apply_expected = True
3027 * sgroup,released vs. mhomed,tombstone
3028 * => should be replaced
3031 .line = __location__,
3032 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3035 .type = WREPL_TYPE_SGROUP,
3036 .state = WREPL_STATE_RELEASED,
3037 .node = WREPL_NODE_B,
3039 .num_ips = ARRAY_SIZE(addresses_B_1),
3040 .ips = addresses_B_1,
3041 .apply_expected = False
3045 .type = WREPL_TYPE_MHOMED,
3046 .state = WREPL_STATE_TOMBSTONE,
3047 .node = WREPL_NODE_B,
3049 .num_ips = ARRAY_SIZE(addresses_A_1),
3050 .ips = addresses_A_1,
3051 .apply_expected = True
3056 * sgroup,tombstone vs. mhomed,active
3057 * => should be replaced
3060 .line = __location__,
3061 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3064 .type = WREPL_TYPE_SGROUP,
3065 .state = WREPL_STATE_TOMBSTONE,
3066 .node = WREPL_NODE_B,
3068 .num_ips = ARRAY_SIZE(addresses_A_1),
3069 .ips = addresses_A_1,
3070 .apply_expected = True
3074 .type = WREPL_TYPE_MHOMED,
3075 .state = WREPL_STATE_ACTIVE,
3076 .node = WREPL_NODE_B,
3078 .num_ips = ARRAY_SIZE(addresses_B_1),
3079 .ips = addresses_B_1,
3080 .apply_expected = True
3085 * sgroup,tombstone vs. mhomed,tombstone
3086 * => should be replaced
3089 .line = __location__,
3090 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3093 .type = WREPL_TYPE_SGROUP,
3094 .state = WREPL_STATE_TOMBSTONE,
3095 .node = WREPL_NODE_B,
3097 .num_ips = ARRAY_SIZE(addresses_B_1),
3098 .ips = addresses_B_1,
3099 .apply_expected = True
3103 .type = WREPL_TYPE_MHOMED,
3104 .state = WREPL_STATE_TOMBSTONE,
3105 .node = WREPL_NODE_B,
3107 .num_ips = ARRAY_SIZE(addresses_A_1),
3108 .ips = addresses_A_1,
3109 .apply_expected = True
3114 * multi homed vs. unique section,
3117 * mhomed,active vs. unique,active
3118 * => should be replaced
3121 .line = __location__,
3122 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3125 .type = WREPL_TYPE_MHOMED,
3126 .state = WREPL_STATE_ACTIVE,
3127 .node = WREPL_NODE_B,
3129 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3130 .ips = addresses_A_3_4,
3131 .apply_expected = True
3135 .type = WREPL_TYPE_UNIQUE,
3136 .state = WREPL_STATE_ACTIVE,
3137 .node = WREPL_NODE_B,
3139 .num_ips = ARRAY_SIZE(addresses_B_1),
3140 .ips = addresses_B_1,
3141 .apply_expected = True
3146 * mhomed,active vs. unique,tombstone
3147 * => should NOT be replaced
3150 .line = __location__,
3151 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3154 .type = WREPL_TYPE_MHOMED,
3155 .state = WREPL_STATE_ACTIVE,
3156 .node = WREPL_NODE_B,
3158 .num_ips = ARRAY_SIZE(addresses_B_1),
3159 .ips = addresses_B_1,
3160 .apply_expected = True
3164 .type = WREPL_TYPE_UNIQUE,
3165 .state = WREPL_STATE_TOMBSTONE,
3166 .node = WREPL_NODE_B,
3168 .num_ips = ARRAY_SIZE(addresses_B_1),
3169 .ips = addresses_B_1,
3170 .apply_expected = False
3175 * mhomed,released vs. unique,active
3176 * => should be replaced
3179 .line = __location__,
3180 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3183 .type = WREPL_TYPE_MHOMED,
3184 .state = WREPL_STATE_RELEASED,
3185 .node = WREPL_NODE_B,
3187 .num_ips = ARRAY_SIZE(addresses_A_1),
3188 .ips = addresses_A_1,
3189 .apply_expected = False
3193 .type = WREPL_TYPE_UNIQUE,
3194 .state = WREPL_STATE_ACTIVE,
3195 .node = WREPL_NODE_B,
3197 .num_ips = ARRAY_SIZE(addresses_B_1),
3198 .ips = addresses_B_1,
3199 .apply_expected = True
3204 * mhomed,released vs. uinique,tombstone
3205 * => should be replaced
3208 .line = __location__,
3209 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3212 .type = WREPL_TYPE_MHOMED,
3213 .state = WREPL_STATE_RELEASED,
3214 .node = WREPL_NODE_B,
3216 .num_ips = ARRAY_SIZE(addresses_B_1),
3217 .ips = addresses_B_1,
3218 .apply_expected = False
3222 .type = WREPL_TYPE_UNIQUE,
3223 .state = WREPL_STATE_TOMBSTONE,
3224 .node = WREPL_NODE_B,
3226 .num_ips = ARRAY_SIZE(addresses_A_1),
3227 .ips = addresses_A_1,
3228 .apply_expected = True
3233 * mhomed,tombstone vs. unique,active
3234 * => should be replaced
3237 .line = __location__,
3238 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3241 .type = WREPL_TYPE_MHOMED,
3242 .state = WREPL_STATE_TOMBSTONE,
3243 .node = WREPL_NODE_B,
3245 .num_ips = ARRAY_SIZE(addresses_A_1),
3246 .ips = addresses_A_1,
3247 .apply_expected = True
3251 .type = WREPL_TYPE_UNIQUE,
3252 .state = WREPL_STATE_ACTIVE,
3253 .node = WREPL_NODE_B,
3255 .num_ips = ARRAY_SIZE(addresses_B_1),
3256 .ips = addresses_B_1,
3257 .apply_expected = True
3262 * mhomed,tombstone vs. uinique,tombstone
3263 * => should be replaced
3266 .line = __location__,
3267 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3270 .type = WREPL_TYPE_MHOMED,
3271 .state = WREPL_STATE_TOMBSTONE,
3272 .node = WREPL_NODE_B,
3274 .num_ips = ARRAY_SIZE(addresses_B_1),
3275 .ips = addresses_B_1,
3276 .apply_expected = True
3280 .type = WREPL_TYPE_UNIQUE,
3281 .state = WREPL_STATE_TOMBSTONE,
3282 .node = WREPL_NODE_B,
3284 .num_ips = ARRAY_SIZE(addresses_A_1),
3285 .ips = addresses_A_1,
3286 .apply_expected = True
3291 * multi homed vs. normal group section,
3294 * mhomed,active vs. group,active
3295 * => should be replaced
3298 .line = __location__,
3299 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3302 .type = WREPL_TYPE_MHOMED,
3303 .state = WREPL_STATE_ACTIVE,
3304 .node = WREPL_NODE_B,
3306 .num_ips = ARRAY_SIZE(addresses_A_1),
3307 .ips = addresses_A_1,
3308 .apply_expected = True
3312 .type = WREPL_TYPE_GROUP,
3313 .state = WREPL_STATE_ACTIVE,
3314 .node = WREPL_NODE_B,
3316 .num_ips = ARRAY_SIZE(addresses_B_1),
3317 .ips = addresses_B_1,
3318 .apply_expected = True
3323 * mhomed,active vs. group,tombstone
3324 * => should NOT be replaced
3327 .line = __location__,
3328 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3331 .type = WREPL_TYPE_MHOMED,
3332 .state = WREPL_STATE_ACTIVE,
3333 .node = WREPL_NODE_B,
3335 .num_ips = ARRAY_SIZE(addresses_B_1),
3336 .ips = addresses_B_1,
3337 .apply_expected = True
3341 .type = WREPL_TYPE_GROUP,
3342 .state = WREPL_STATE_TOMBSTONE,
3343 .node = WREPL_NODE_B,
3345 .num_ips = ARRAY_SIZE(addresses_B_1),
3346 .ips = addresses_B_1,
3347 .apply_expected = False
3352 * mhomed,released vs. group,active
3353 * => should be replaced
3356 .line = __location__,
3357 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3360 .type = WREPL_TYPE_MHOMED,
3361 .state = WREPL_STATE_RELEASED,
3362 .node = WREPL_NODE_B,
3364 .num_ips = ARRAY_SIZE(addresses_B_1),
3365 .ips = addresses_B_1,
3366 .apply_expected = False
3370 .type = WREPL_TYPE_GROUP,
3371 .state = WREPL_STATE_ACTIVE,
3372 .node = WREPL_NODE_B,
3374 .num_ips = ARRAY_SIZE(addresses_A_1),
3375 .ips = addresses_A_1,
3376 .apply_expected = True
3381 * mhomed,released vs. group,tombstone
3382 * => should be replaced
3385 .line = __location__,
3386 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3389 .type = WREPL_TYPE_MHOMED,
3390 .state = WREPL_STATE_RELEASED,
3391 .node = WREPL_NODE_B,
3393 .num_ips = ARRAY_SIZE(addresses_A_1),
3394 .ips = addresses_A_1,
3395 .apply_expected = False
3399 .type = WREPL_TYPE_GROUP,
3400 .state = WREPL_STATE_TOMBSTONE,
3401 .node = WREPL_NODE_B,
3403 .num_ips = ARRAY_SIZE(addresses_B_1),
3404 .ips = addresses_B_1,
3405 .apply_expected = True
3410 * mhomed,tombstone vs. group,active
3411 * => should be replaced
3414 .line = __location__,
3415 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3418 .type = WREPL_TYPE_MHOMED,
3419 .state = WREPL_STATE_TOMBSTONE,
3420 .node = WREPL_NODE_B,
3422 .num_ips = ARRAY_SIZE(addresses_B_1),
3423 .ips = addresses_B_1,
3424 .apply_expected = True
3428 .type = WREPL_TYPE_GROUP,
3429 .state = WREPL_STATE_ACTIVE,
3430 .node = WREPL_NODE_B,
3432 .num_ips = ARRAY_SIZE(addresses_A_1),
3433 .ips = addresses_A_1,
3434 .apply_expected = True
3439 * mhomed,tombstone vs. group,tombstone
3440 * => should be replaced
3443 .line = __location__,
3444 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3447 .type = WREPL_TYPE_MHOMED,
3448 .state = WREPL_STATE_TOMBSTONE,
3449 .node = WREPL_NODE_B,
3451 .num_ips = ARRAY_SIZE(addresses_A_1),
3452 .ips = addresses_A_1,
3453 .apply_expected = True
3457 .type = WREPL_TYPE_GROUP,
3458 .state = WREPL_STATE_TOMBSTONE,
3459 .node = WREPL_NODE_B,
3461 .num_ips = ARRAY_SIZE(addresses_B_1),
3462 .ips = addresses_B_1,
3463 .apply_expected = True
3468 * multi homed vs. special group section,
3471 * mhomed,active vs. sgroup,active
3472 * => should NOT be replaced
3475 .line = __location__,
3476 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3479 .type = WREPL_TYPE_MHOMED,
3480 .state = WREPL_STATE_ACTIVE,
3481 .node = WREPL_NODE_B,
3483 .num_ips = ARRAY_SIZE(addresses_A_1),
3484 .ips = addresses_A_1,
3485 .apply_expected = True
3489 .type = WREPL_TYPE_SGROUP,
3490 .state = WREPL_STATE_ACTIVE,
3491 .node = WREPL_NODE_B,
3493 .num_ips = ARRAY_SIZE(addresses_A_1),
3494 .ips = addresses_A_1,
3495 .apply_expected = False
3500 * mhomed,active vs. sgroup,tombstone
3501 * => should NOT be replaced
3504 .line = __location__,
3505 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3508 .type = WREPL_TYPE_MHOMED,
3509 .state = WREPL_STATE_ACTIVE,
3510 .node = WREPL_NODE_B,
3512 .num_ips = ARRAY_SIZE(addresses_A_1),
3513 .ips = addresses_A_1,
3514 .apply_expected = True
3518 .type = WREPL_TYPE_SGROUP,
3519 .state = WREPL_STATE_TOMBSTONE,
3520 .node = WREPL_NODE_B,
3522 .num_ips = ARRAY_SIZE(addresses_A_1),
3523 .ips = addresses_A_1,
3524 .apply_expected = False
3529 * mhomed,released vs. sgroup,active
3530 * => should be replaced
3533 .line = __location__,
3534 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3537 .type = WREPL_TYPE_MHOMED,
3538 .state = WREPL_STATE_RELEASED,
3539 .node = WREPL_NODE_B,
3541 .num_ips = ARRAY_SIZE(addresses_A_1),
3542 .ips = addresses_A_1,
3543 .apply_expected = False
3547 .type = WREPL_TYPE_SGROUP,
3548 .state = WREPL_STATE_ACTIVE,
3549 .node = WREPL_NODE_B,
3551 .num_ips = ARRAY_SIZE(addresses_B_1),
3552 .ips = addresses_B_1,
3553 .apply_expected = True
3558 * mhomed,released vs. sgroup,tombstone
3559 * => should be replaced
3562 .line = __location__,
3563 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3566 .type = WREPL_TYPE_MHOMED,
3567 .state = WREPL_STATE_RELEASED,
3568 .node = WREPL_NODE_B,
3570 .num_ips = ARRAY_SIZE(addresses_B_1),
3571 .ips = addresses_B_1,
3572 .apply_expected = False
3576 .type = WREPL_TYPE_SGROUP,
3577 .state = WREPL_STATE_TOMBSTONE,
3578 .node = WREPL_NODE_B,
3580 .num_ips = ARRAY_SIZE(addresses_A_1),
3581 .ips = addresses_A_1,
3582 .apply_expected = True
3587 * mhomed,tombstone vs. sgroup,active
3588 * => should be replaced
3591 .line = __location__,
3592 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3595 .type = WREPL_TYPE_MHOMED,
3596 .state = WREPL_STATE_TOMBSTONE,
3597 .node = WREPL_NODE_B,
3599 .num_ips = ARRAY_SIZE(addresses_A_1),
3600 .ips = addresses_A_1,
3601 .apply_expected = True
3605 .type = WREPL_TYPE_SGROUP,
3606 .state = WREPL_STATE_ACTIVE,
3607 .node = WREPL_NODE_B,
3609 .num_ips = ARRAY_SIZE(addresses_B_1),
3610 .ips = addresses_B_1,
3611 .apply_expected = True
3616 * mhomed,tombstone vs. sgroup,tombstone
3617 * => should be replaced
3620 .line = __location__,
3621 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3624 .type = WREPL_TYPE_MHOMED,
3625 .state = WREPL_STATE_TOMBSTONE,
3626 .node = WREPL_NODE_B,
3628 .num_ips = ARRAY_SIZE(addresses_B_1),
3629 .ips = addresses_B_1,
3630 .apply_expected = True
3634 .type = WREPL_TYPE_SGROUP,
3635 .state = WREPL_STATE_TOMBSTONE,
3636 .node = WREPL_NODE_B,
3638 .num_ips = ARRAY_SIZE(addresses_A_1),
3639 .ips = addresses_A_1,
3640 .apply_expected = True
3645 * multi homed vs. mlti homed section,
3648 * mhomed,active vs. mhomed,active
3649 * => should be replaced
3652 .line = __location__,
3653 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3656 .type = WREPL_TYPE_MHOMED,
3657 .state = WREPL_STATE_ACTIVE,
3658 .node = WREPL_NODE_B,
3660 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3661 .ips = addresses_A_3_4,
3662 .apply_expected = True
3666 .type = WREPL_TYPE_MHOMED,
3667 .state = WREPL_STATE_ACTIVE,
3668 .node = WREPL_NODE_B,
3670 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3671 .ips = addresses_B_3_4,
3672 .apply_expected = True
3677 * mhomed,active vs. mhomed,tombstone
3678 * => should NOT be replaced
3681 .line = __location__,
3682 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3685 .type = WREPL_TYPE_MHOMED,
3686 .state = WREPL_STATE_ACTIVE,
3687 .node = WREPL_NODE_B,
3689 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3690 .ips = addresses_B_3_4,
3691 .apply_expected = True
3695 .type = WREPL_TYPE_MHOMED,
3696 .state = WREPL_STATE_TOMBSTONE,
3697 .node = WREPL_NODE_B,
3699 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3700 .ips = addresses_B_3_4,
3701 .apply_expected = False
3706 * mhomed,released vs. mhomed,active
3707 * => should be replaced
3710 .line = __location__,
3711 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3714 .type = WREPL_TYPE_MHOMED,
3715 .state = WREPL_STATE_RELEASED,
3716 .node = WREPL_NODE_B,
3718 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3719 .ips = addresses_B_3_4,
3720 .apply_expected = False
3724 .type = WREPL_TYPE_MHOMED,
3725 .state = WREPL_STATE_ACTIVE,
3726 .node = WREPL_NODE_B,
3728 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3729 .ips = addresses_A_3_4,
3730 .apply_expected = True
3735 * mhomed,released vs. mhomed,tombstone
3736 * => should be replaced
3739 .line = __location__,
3740 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3743 .type = WREPL_TYPE_MHOMED,
3744 .state = WREPL_STATE_RELEASED,
3745 .node = WREPL_NODE_B,
3747 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3748 .ips = addresses_A_3_4,
3749 .apply_expected = False
3753 .type = WREPL_TYPE_MHOMED,
3754 .state = WREPL_STATE_TOMBSTONE,
3755 .node = WREPL_NODE_B,
3757 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3758 .ips = addresses_B_3_4,
3759 .apply_expected = True
3764 * mhomed,tombstone vs. mhomed,active
3765 * => should be replaced
3768 .line = __location__,
3769 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3772 .type = WREPL_TYPE_MHOMED,
3773 .state = WREPL_STATE_TOMBSTONE,
3774 .node = WREPL_NODE_B,
3776 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3777 .ips = addresses_B_3_4,
3778 .apply_expected = True
3782 .type = WREPL_TYPE_MHOMED,
3783 .state = WREPL_STATE_ACTIVE,
3784 .node = WREPL_NODE_B,
3786 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3787 .ips = addresses_A_3_4,
3788 .apply_expected = True
3793 * mhomed,tombstone vs. mhomed,tombstone
3794 * => should be replaced
3797 .line = __location__,
3798 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3801 .type = WREPL_TYPE_MHOMED,
3802 .state = WREPL_STATE_TOMBSTONE,
3803 .node = WREPL_NODE_B,
3805 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3806 .ips = addresses_A_3_4,
3807 .apply_expected = True
3811 .type = WREPL_TYPE_MHOMED,
3812 .state = WREPL_STATE_TOMBSTONE,
3813 .node = WREPL_NODE_B,
3815 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3816 .ips = addresses_B_3_4,
3817 .apply_expected = True
3823 * special group vs special group section,
3826 * sgroup,active vs. sgroup,active
3827 * => should be merged
3830 .line = __location__,
3831 .name = _NBT_NAME("_DIFF_OWNER_SG", 0x00, NULL),
3835 .type = WREPL_TYPE_SGROUP,
3836 .state = WREPL_STATE_ACTIVE,
3837 .node = WREPL_NODE_B,
3839 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3840 .ips = addresses_A_3_4,
3841 .apply_expected = True,
3845 .type = WREPL_TYPE_SGROUP,
3846 .state = WREPL_STATE_ACTIVE,
3847 .node = WREPL_NODE_B,
3849 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3850 .ips = addresses_B_3_4,
3851 .apply_expected = False,
3852 .merge_expected = True
3856 .line = __location__,
3857 .name = _NBT_NAME("_DIFF_OWNER_SG", 0x00, NULL),
3861 .type = WREPL_TYPE_SGROUP,
3862 .state = WREPL_STATE_ACTIVE,
3863 .node = WREPL_NODE_B,
3867 .apply_expected = False
3871 .type = WREPL_TYPE_SGROUP,
3872 .state = WREPL_STATE_ACTIVE,
3873 .node = WREPL_NODE_B,
3877 .apply_expected = False,
3878 .merge_expected = False
3882 .line = __location__,
3883 .name = _NBT_NAME("_DIFF_OWNER_SG", 0x00, NULL),
3887 .type = WREPL_TYPE_SGROUP,
3888 .state = WREPL_STATE_ACTIVE,
3889 .node = WREPL_NODE_B,
3891 .num_ips = ARRAY_SIZE(addresses_A_1),
3892 .ips = addresses_A_1,
3893 .apply_expected = True
3897 .type = WREPL_TYPE_UNIQUE,
3898 .state = WREPL_STATE_TOMBSTONE,
3899 .node = WREPL_NODE_B,
3901 .num_ips = ARRAY_SIZE(addresses_A_1),
3902 .ips = addresses_A_1,
3903 .apply_expected = True
3908 * This should be the last record in this array,
3909 * we need to make sure the we leave a tombstoned unique entry
3913 .line = __location__,
3914 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3918 .type = WREPL_TYPE_UNIQUE,
3919 .state = WREPL_STATE_TOMBSTONE,
3920 .node = WREPL_NODE_B,
3922 .num_ips = ARRAY_SIZE(addresses_A_1),
3923 .ips = addresses_A_1,
3924 .apply_expected = True
3928 .type = WREPL_TYPE_UNIQUE,
3929 .state = WREPL_STATE_TOMBSTONE,
3930 .node = WREPL_NODE_B,
3932 .num_ips = ARRAY_SIZE(addresses_A_1),
3933 .ips = addresses_A_1,
3934 .apply_expected = True
3936 }}; /* do not add entries here, this should be the last record! */
3938 if (!ctx) return False;
3940 wins_name_r1 = &wins_name1;
3941 wins_name_r2 = &wins_name2;
3943 printf("Test Replica Conflicts with different owners\n");
3945 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
3947 if (!records[i].extra && !records[i].cleanup) {
3948 /* we should test the worst cases */
3949 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
3950 printf("(%s) Programmer error, invalid record[%u]: %s\n",
3951 __location__, i, records[i].line);
3953 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
3954 printf("(%s) Programmer error, invalid record[%u]: %s\n",
3955 __location__, i, records[i].line);
3960 if (!records[i].cleanup) {
3961 const char *expected;
3964 if (records[i].r2.merge_expected) {
3966 } else if (records[i].r2.apply_expected) {
3967 expected = "REPLACE";
3969 expected = "NOT REPLACE";
3972 if (!records[i].r1.ips && !records[i].r2.ips) {
3974 } else if (records[i].r1.ips==records[i].r2.ips) {
3980 printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
3981 wrepl_name_type_string(records[i].r1.type),
3982 wrepl_name_state_string(records[i].r1.state),
3983 (records[i].r1.is_static?",static":""),
3984 wrepl_name_type_string(records[i].r2.type),
3985 wrepl_name_state_string(records[i].r2.state),
3986 (records[i].r2.is_static?",static":""),
3993 wins_name_r1->name = &records[i].name;
3994 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
3995 records[i].r1.state,
3997 records[i].r1.is_static);
3998 wins_name_r1->id = ++records[i].r1.owner->max_version;
3999 if (wins_name_r1->flags & 2) {
4000 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
4001 wins_name_r1->addresses.addresses.ips = discard_const(records[i].r1.ips);
4003 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
4005 wins_name_r1->unknown = "255.255.255.255";
4008 ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1);
4009 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4010 wins_name_r1, records[i].r1.apply_expected);
4015 wins_name_r2->name = &records[i].name;
4016 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
4017 records[i].r2.state,
4019 records[i].r2.is_static);
4020 wins_name_r2->id = ++records[i].r2.owner->max_version;
4021 if (wins_name_r2->flags & 2) {
4022 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
4023 wins_name_r2->addresses.addresses.ips = discard_const(records[i].r2.ips);
4025 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
4027 wins_name_r2->unknown = "255.255.255.255";
4030 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
4031 if (records[i].r1.state == WREPL_STATE_RELEASED) {
4032 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4033 wins_name_r1, False);
4034 } else if (records[i].r2.merge_expected) {
4035 ret &= test_wrepl_is_merged(ctx, wins_name_r1, wins_name_r2);
4036 } else if (records[i].r1.owner != records[i].r2.owner) {
4038 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
4039 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
4040 wins_name_r1, _expected);
4042 if (records[i].r2.state == WREPL_STATE_RELEASED) {
4043 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
4044 wins_name_r2, False);
4045 } else if (!records[i].r2.merge_expected) {
4046 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
4047 wins_name_r2, records[i].r2.apply_expected);
4050 /* the first one is a cleanup run */
4051 if (!ret && i == 0) ret = True;
4054 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
4062 static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_conn *ctx)
4066 struct wrepl_wins_name wins_name_;
4067 struct wrepl_wins_name *wins_name = &wins_name_;
4068 struct nbt_name_register name_register_;
4069 struct nbt_name_register *name_register = &name_register_;
4070 struct nbt_name_release release_;
4071 struct nbt_name_release *release = &release_;
4074 const char *line; /* just better debugging */
4075 struct nbt_name name;
4080 const struct wrepl_ip *ips;
4081 BOOL apply_expected;
4084 enum wrepl_name_type type;
4085 enum wrepl_name_state state;
4086 enum wrepl_name_node node;
4089 const struct wrepl_ip *ips;
4090 BOOL apply_expected;
4094 * unique vs. unique section
4097 * unique,released vs. unique,active with same ip(s)
4100 .line = __location__,
4101 .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL),
4105 .num_ips = ctx->addresses_best_num,
4106 .ips = ctx->addresses_best,
4107 .apply_expected = True
4110 .type = WREPL_TYPE_UNIQUE,
4111 .state = WREPL_STATE_ACTIVE,
4112 .node = WREPL_NODE_B,
4114 .num_ips = ctx->addresses_best_num,
4115 .ips = ctx->addresses_best,
4116 .apply_expected = True
4120 * unique,released vs. unique,active with different ip(s)
4123 .line = __location__,
4124 .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL),
4128 .num_ips = ctx->addresses_best_num,
4129 .ips = ctx->addresses_best,
4130 .apply_expected = True
4133 .type = WREPL_TYPE_UNIQUE,
4134 .state = WREPL_STATE_ACTIVE,
4135 .node = WREPL_NODE_B,
4137 .num_ips = ARRAY_SIZE(addresses_B_1),
4138 .ips = addresses_B_1,
4139 .apply_expected = True
4143 * unique,released vs. unique,tombstone with same ip(s)
4146 .line = __location__,
4147 .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL),
4151 .num_ips = ctx->addresses_best_num,
4152 .ips = ctx->addresses_best,
4153 .apply_expected = True
4156 .type = WREPL_TYPE_UNIQUE,
4157 .state = WREPL_STATE_TOMBSTONE,
4158 .node = WREPL_NODE_B,
4160 .num_ips = ctx->addresses_best_num,
4161 .ips = ctx->addresses_best,
4162 .apply_expected = True
4166 * unique,released vs. unique,tombstone with different ip(s)
4169 .line = __location__,
4170 .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL),
4174 .num_ips = ctx->addresses_best_num,
4175 .ips = ctx->addresses_best,
4176 .apply_expected = True
4179 .type = WREPL_TYPE_UNIQUE,
4180 .state = WREPL_STATE_TOMBSTONE,
4181 .node = WREPL_NODE_B,
4183 .num_ips = ARRAY_SIZE(addresses_B_1),
4184 .ips = addresses_B_1,
4185 .apply_expected = True
4189 * unique vs. group section
4192 * unique,released vs. group,active with same ip(s)
4195 .line = __location__,
4196 .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL),
4200 .num_ips = ctx->addresses_best_num,
4201 .ips = ctx->addresses_best,
4202 .apply_expected = True
4205 .type = WREPL_TYPE_GROUP,
4206 .state = WREPL_STATE_ACTIVE,
4207 .node = WREPL_NODE_B,
4209 .num_ips = ctx->addresses_best_num,
4210 .ips = ctx->addresses_best,
4211 .apply_expected = True
4215 * unique,released vs. group,active with different ip(s)
4218 .line = __location__,
4219 .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL),
4223 .num_ips = ctx->addresses_best_num,
4224 .ips = ctx->addresses_best,
4225 .apply_expected = True
4228 .type = WREPL_TYPE_GROUP,
4229 .state = WREPL_STATE_ACTIVE,
4230 .node = WREPL_NODE_B,
4232 .num_ips = ARRAY_SIZE(addresses_B_1),
4233 .ips = addresses_B_1,
4234 .apply_expected = True
4238 * unique,released vs. group,tombstone with same ip(s)
4241 .line = __location__,
4242 .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL),
4246 .num_ips = ctx->addresses_best_num,
4247 .ips = ctx->addresses_best,
4248 .apply_expected = True
4251 .type = WREPL_TYPE_GROUP,
4252 .state = WREPL_STATE_TOMBSTONE,
4253 .node = WREPL_NODE_B,
4255 .num_ips = ctx->addresses_best_num,
4256 .ips = ctx->addresses_best,
4257 .apply_expected = True
4261 * unique,released vs. group,tombstone with different ip(s)
4264 .line = __location__,
4265 .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL),
4269 .num_ips = ctx->addresses_best_num,
4270 .ips = ctx->addresses_best,
4271 .apply_expected = True
4274 .type = WREPL_TYPE_GROUP,
4275 .state = WREPL_STATE_TOMBSTONE,
4276 .node = WREPL_NODE_B,
4278 .num_ips = ARRAY_SIZE(addresses_B_1),
4279 .ips = addresses_B_1,
4280 .apply_expected = True
4284 * unique vs. special group section
4287 * unique,released vs. sgroup,active with same ip(s)
4290 .line = __location__,
4291 .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL),
4295 .num_ips = ctx->addresses_best_num,
4296 .ips = ctx->addresses_best,
4297 .apply_expected = True
4300 .type = WREPL_TYPE_SGROUP,
4301 .state = WREPL_STATE_ACTIVE,
4302 .node = WREPL_NODE_B,
4304 .num_ips = ctx->addresses_best_num,
4305 .ips = ctx->addresses_best,
4306 .apply_expected = True
4310 * unique,released vs. sgroup,active with different ip(s)
4313 .line = __location__,
4314 .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL),
4318 .num_ips = ctx->addresses_best_num,
4319 .ips = ctx->addresses_best,
4320 .apply_expected = True
4323 .type = WREPL_TYPE_SGROUP,
4324 .state = WREPL_STATE_ACTIVE,
4325 .node = WREPL_NODE_B,
4327 .num_ips = ARRAY_SIZE(addresses_B_1),
4328 .ips = addresses_B_1,
4329 .apply_expected = True
4333 * unique,released vs. sgroup,tombstone with same ip(s)
4336 .line = __location__,
4337 .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL),
4341 .num_ips = ctx->addresses_best_num,
4342 .ips = ctx->addresses_best,
4343 .apply_expected = True
4346 .type = WREPL_TYPE_SGROUP,
4347 .state = WREPL_STATE_TOMBSTONE,
4348 .node = WREPL_NODE_B,
4350 .num_ips = ctx->addresses_best_num,
4351 .ips = ctx->addresses_best,
4352 .apply_expected = True
4356 * unique,released vs. sgroup,tombstone with different ip(s)
4359 .line = __location__,
4360 .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL),
4364 .num_ips = ctx->addresses_best_num,
4365 .ips = ctx->addresses_best,
4366 .apply_expected = True
4369 .type = WREPL_TYPE_SGROUP,
4370 .state = WREPL_STATE_TOMBSTONE,
4371 .node = WREPL_NODE_B,
4373 .num_ips = ARRAY_SIZE(addresses_B_1),
4374 .ips = addresses_B_1,
4375 .apply_expected = True
4379 * unique vs. multi homed section
4382 * unique,released vs. mhomed,active with same ip(s)
4385 .line = __location__,
4386 .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL),
4390 .num_ips = ctx->addresses_best_num,
4391 .ips = ctx->addresses_best,
4392 .apply_expected = True
4395 .type = WREPL_TYPE_MHOMED,
4396 .state = WREPL_STATE_ACTIVE,
4397 .node = WREPL_NODE_B,
4399 .num_ips = ctx->addresses_best_num,
4400 .ips = ctx->addresses_best,
4401 .apply_expected = True
4405 * unique,released vs. mhomed,active with different ip(s)
4408 .line = __location__,
4409 .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL),
4413 .num_ips = ctx->addresses_best_num,
4414 .ips = ctx->addresses_best,
4415 .apply_expected = True
4418 .type = WREPL_TYPE_MHOMED,
4419 .state = WREPL_STATE_ACTIVE,
4420 .node = WREPL_NODE_B,
4422 .num_ips = ARRAY_SIZE(addresses_B_1),
4423 .ips = addresses_B_1,
4424 .apply_expected = True
4428 * unique,released vs. mhomed,tombstone with same ip(s)
4431 .line = __location__,
4432 .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL),
4436 .num_ips = ctx->addresses_best_num,
4437 .ips = ctx->addresses_best,
4438 .apply_expected = True
4441 .type = WREPL_TYPE_MHOMED,
4442 .state = WREPL_STATE_TOMBSTONE,
4443 .node = WREPL_NODE_B,
4445 .num_ips = ctx->addresses_best_num,
4446 .ips = ctx->addresses_best,
4447 .apply_expected = True
4451 * unique,released vs. mhomed,tombstone with different ip(s)
4454 .line = __location__,
4455 .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL),
4459 .num_ips = ctx->addresses_best_num,
4460 .ips = ctx->addresses_best,
4461 .apply_expected = True
4464 .type = WREPL_TYPE_MHOMED,
4465 .state = WREPL_STATE_TOMBSTONE,
4466 .node = WREPL_NODE_B,
4468 .num_ips = ARRAY_SIZE(addresses_B_1),
4469 .ips = addresses_B_1,
4470 .apply_expected = True
4474 * group vs. unique section
4477 * group,released vs. unique,active with same ip(s)
4480 .line = __location__,
4481 .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL),
4483 .nb_flags = NBT_NM_GROUP,
4485 .num_ips = ctx->addresses_best_num,
4486 .ips = ctx->addresses_best,
4487 .apply_expected = True
4490 .type = WREPL_TYPE_UNIQUE,
4491 .state = WREPL_STATE_ACTIVE,
4492 .node = WREPL_NODE_B,
4494 .num_ips = ctx->addresses_best_num,
4495 .ips = ctx->addresses_best,
4496 .apply_expected = False
4500 * group,released vs. unique,active with different ip(s)
4503 .line = __location__,
4504 .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL),
4506 .nb_flags = NBT_NM_GROUP,
4508 .num_ips = ctx->addresses_best_num,
4509 .ips = ctx->addresses_best,
4510 .apply_expected = True
4513 .type = WREPL_TYPE_UNIQUE,
4514 .state = WREPL_STATE_ACTIVE,
4515 .node = WREPL_NODE_B,
4517 .num_ips = ARRAY_SIZE(addresses_B_1),
4518 .ips = addresses_B_1,
4519 .apply_expected = False
4523 * group,released vs. unique,tombstone with same ip(s)
4526 .line = __location__,
4527 .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL),
4529 .nb_flags = NBT_NM_GROUP,
4531 .num_ips = ctx->addresses_best_num,
4532 .ips = ctx->addresses_best,
4533 .apply_expected = True
4536 .type = WREPL_TYPE_UNIQUE,
4537 .state = WREPL_STATE_TOMBSTONE,
4538 .node = WREPL_NODE_B,
4540 .num_ips = ctx->addresses_best_num,
4541 .ips = ctx->addresses_best,
4542 .apply_expected = False
4546 * group,released vs. unique,tombstone with different ip(s)
4549 .line = __location__,
4550 .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL),
4552 .nb_flags = NBT_NM_GROUP,
4554 .num_ips = ctx->addresses_best_num,
4555 .ips = ctx->addresses_best,
4556 .apply_expected = True
4559 .type = WREPL_TYPE_UNIQUE,
4560 .state = WREPL_STATE_TOMBSTONE,
4561 .node = WREPL_NODE_B,
4563 .num_ips = ARRAY_SIZE(addresses_B_1),
4564 .ips = addresses_B_1,
4565 .apply_expected = False
4569 * group vs. group section
4572 * group,released vs. group,active with same ip(s)
4575 .line = __location__,
4576 .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL),
4578 .nb_flags = NBT_NM_GROUP,
4580 .num_ips = ctx->addresses_best_num,
4581 .ips = ctx->addresses_best,
4582 .apply_expected = True
4585 .type = WREPL_TYPE_GROUP,
4586 .state = WREPL_STATE_ACTIVE,
4587 .node = WREPL_NODE_B,
4589 .num_ips = ctx->addresses_best_num,
4590 .ips = ctx->addresses_best,
4591 .apply_expected = True
4595 * group,released vs. group,active with different ip(s)
4598 .line = __location__,
4599 .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL),
4601 .nb_flags = NBT_NM_GROUP,
4603 .num_ips = ctx->addresses_best_num,
4604 .ips = ctx->addresses_best,
4605 .apply_expected = True
4608 .type = WREPL_TYPE_GROUP,
4609 .state = WREPL_STATE_ACTIVE,
4610 .node = WREPL_NODE_B,
4612 .num_ips = ARRAY_SIZE(addresses_B_1),
4613 .ips = addresses_B_1,
4614 .apply_expected = True
4618 * group,released vs. group,tombstone with same ip(s)
4621 .line = __location__,
4622 .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL),
4624 .nb_flags = NBT_NM_GROUP,
4626 .num_ips = ctx->addresses_best_num,
4627 .ips = ctx->addresses_best,
4628 .apply_expected = True
4631 .type = WREPL_TYPE_GROUP,
4632 .state = WREPL_STATE_TOMBSTONE,
4633 .node = WREPL_NODE_B,
4635 .num_ips = ctx->addresses_best_num,
4636 .ips = ctx->addresses_best,
4637 .apply_expected = True
4641 * group,released vs. group,tombstone with different ip(s)
4644 .line = __location__,
4645 .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL),
4647 .nb_flags = NBT_NM_GROUP,
4649 .num_ips = ctx->addresses_best_num,
4650 .ips = ctx->addresses_best,
4651 .apply_expected = True
4654 .type = WREPL_TYPE_GROUP,
4655 .state = WREPL_STATE_TOMBSTONE,
4656 .node = WREPL_NODE_B,
4658 .num_ips = ARRAY_SIZE(addresses_B_1),
4659 .ips = addresses_B_1,
4660 .apply_expected = True
4664 * group vs. special group section
4667 * group,released vs. sgroup,active with same ip(s)
4670 .line = __location__,
4671 .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL),
4673 .nb_flags = NBT_NM_GROUP,
4675 .num_ips = ctx->addresses_best_num,
4676 .ips = ctx->addresses_best,
4677 .apply_expected = True
4680 .type = WREPL_TYPE_SGROUP,
4681 .state = WREPL_STATE_ACTIVE,
4682 .node = WREPL_NODE_B,
4684 .num_ips = ctx->addresses_best_num,
4685 .ips = ctx->addresses_best,
4686 .apply_expected = False
4690 * group,released vs. sgroup,active with different ip(s)
4693 .line = __location__,
4694 .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL),
4696 .nb_flags = NBT_NM_GROUP,
4698 .num_ips = ctx->addresses_best_num,
4699 .ips = ctx->addresses_best,
4700 .apply_expected = True
4703 .type = WREPL_TYPE_SGROUP,
4704 .state = WREPL_STATE_ACTIVE,
4705 .node = WREPL_NODE_B,
4707 .num_ips = ARRAY_SIZE(addresses_B_1),
4708 .ips = addresses_B_1,
4709 .apply_expected = False
4713 * group,released vs. sgroup,tombstone with same ip(s)
4716 .line = __location__,
4717 .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL),
4719 .nb_flags = NBT_NM_GROUP,
4721 .num_ips = ctx->addresses_best_num,
4722 .ips = ctx->addresses_best,
4723 .apply_expected = True
4726 .type = WREPL_TYPE_SGROUP,
4727 .state = WREPL_STATE_TOMBSTONE,
4728 .node = WREPL_NODE_B,
4730 .num_ips = ctx->addresses_best_num,
4731 .ips = ctx->addresses_best,
4732 .apply_expected = False
4736 * group,released vs. sgroup,tombstone with different ip(s)
4739 .line = __location__,
4740 .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL),
4742 .nb_flags = NBT_NM_GROUP,
4744 .num_ips = ctx->addresses_best_num,
4745 .ips = ctx->addresses_best,
4746 .apply_expected = True
4749 .type = WREPL_TYPE_SGROUP,
4750 .state = WREPL_STATE_TOMBSTONE,
4751 .node = WREPL_NODE_B,
4753 .num_ips = ARRAY_SIZE(addresses_B_1),
4754 .ips = addresses_B_1,
4755 .apply_expected = False
4759 * group vs. multi homed section
4762 * group,released vs. mhomed,active with same ip(s)
4765 .line = __location__,
4766 .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL),
4768 .nb_flags = NBT_NM_GROUP,
4770 .num_ips = ctx->addresses_best_num,
4771 .ips = ctx->addresses_best,
4772 .apply_expected = True
4775 .type = WREPL_TYPE_MHOMED,
4776 .state = WREPL_STATE_ACTIVE,
4777 .node = WREPL_NODE_B,
4779 .num_ips = ctx->addresses_best_num,
4780 .ips = ctx->addresses_best,
4781 .apply_expected = False
4785 * group,released vs. mhomed,active with different ip(s)
4788 .line = __location__,
4789 .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL),
4791 .nb_flags = NBT_NM_GROUP,
4793 .num_ips = ctx->addresses_best_num,
4794 .ips = ctx->addresses_best,
4795 .apply_expected = True
4798 .type = WREPL_TYPE_MHOMED,
4799 .state = WREPL_STATE_ACTIVE,
4800 .node = WREPL_NODE_B,
4802 .num_ips = ARRAY_SIZE(addresses_B_1),
4803 .ips = addresses_B_1,
4804 .apply_expected = False
4808 * group,released vs. mhomed,tombstone with same ip(s)
4811 .line = __location__,
4812 .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL),
4814 .nb_flags = NBT_NM_GROUP,
4816 .num_ips = ctx->addresses_best_num,
4817 .ips = ctx->addresses_best,
4818 .apply_expected = True
4821 .type = WREPL_TYPE_MHOMED,
4822 .state = WREPL_STATE_TOMBSTONE,
4823 .node = WREPL_NODE_B,
4825 .num_ips = ctx->addresses_best_num,
4826 .ips = ctx->addresses_best,
4827 .apply_expected = False
4831 * group,released vs. mhomed,tombstone with different ip(s)
4834 .line = __location__,
4835 .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL),
4837 .nb_flags = NBT_NM_GROUP,
4839 .num_ips = ctx->addresses_best_num,
4840 .ips = ctx->addresses_best,
4841 .apply_expected = True
4844 .type = WREPL_TYPE_MHOMED,
4845 .state = WREPL_STATE_TOMBSTONE,
4846 .node = WREPL_NODE_B,
4848 .num_ips = ARRAY_SIZE(addresses_B_1),
4849 .ips = addresses_B_1,
4850 .apply_expected = False
4854 * special group vs. unique section
4857 * sgroup,released vs. unique,active with same ip(s)
4860 .line = __location__,
4861 .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL),
4863 .nb_flags = NBT_NM_GROUP,
4865 .num_ips = ctx->addresses_best_num,
4866 .ips = ctx->addresses_best,
4867 .apply_expected = True
4870 .type = WREPL_TYPE_UNIQUE,
4871 .state = WREPL_STATE_ACTIVE,
4872 .node = WREPL_NODE_B,
4874 .num_ips = ctx->addresses_best_num,
4875 .ips = ctx->addresses_best,
4876 .apply_expected = True
4880 * sgroup,released vs. unique,active with different ip(s)
4883 .line = __location__,
4884 .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL),
4886 .nb_flags = NBT_NM_GROUP,
4888 .num_ips = ctx->addresses_best_num,
4889 .ips = ctx->addresses_best,
4890 .apply_expected = True
4893 .type = WREPL_TYPE_UNIQUE,
4894 .state = WREPL_STATE_ACTIVE,
4895 .node = WREPL_NODE_B,
4897 .num_ips = ARRAY_SIZE(addresses_B_1),
4898 .ips = addresses_B_1,
4899 .apply_expected = True
4903 * sgroup,released vs. unique,tombstone with same ip(s)
4906 .line = __location__,
4907 .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL),
4909 .nb_flags = NBT_NM_GROUP,
4911 .num_ips = ctx->addresses_best_num,
4912 .ips = ctx->addresses_best,
4913 .apply_expected = True
4916 .type = WREPL_TYPE_UNIQUE,
4917 .state = WREPL_STATE_TOMBSTONE,
4918 .node = WREPL_NODE_B,
4920 .num_ips = ctx->addresses_best_num,
4921 .ips = ctx->addresses_best,
4922 .apply_expected = True
4926 * sgroup,released vs. unique,tombstone with different ip(s)
4929 .line = __location__,
4930 .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL),
4932 .nb_flags = NBT_NM_GROUP,
4934 .num_ips = ctx->addresses_best_num,
4935 .ips = ctx->addresses_best,
4936 .apply_expected = True
4939 .type = WREPL_TYPE_UNIQUE,
4940 .state = WREPL_STATE_TOMBSTONE,
4941 .node = WREPL_NODE_B,
4943 .num_ips = ARRAY_SIZE(addresses_B_1),
4944 .ips = addresses_B_1,
4945 .apply_expected = True
4949 * special group vs. group section
4952 * sgroup,released vs. group,active with same ip(s)
4955 .line = __location__,
4956 .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL),
4958 .nb_flags = NBT_NM_GROUP,
4960 .num_ips = ctx->addresses_best_num,
4961 .ips = ctx->addresses_best,
4962 .apply_expected = True
4965 .type = WREPL_TYPE_GROUP,
4966 .state = WREPL_STATE_ACTIVE,
4967 .node = WREPL_NODE_B,
4969 .num_ips = ctx->addresses_best_num,
4970 .ips = ctx->addresses_best,
4971 .apply_expected = True
4975 * sgroup,released vs. group,active with different ip(s)
4978 .line = __location__,
4979 .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL),
4981 .nb_flags = NBT_NM_GROUP,
4983 .num_ips = ctx->addresses_best_num,
4984 .ips = ctx->addresses_best,
4985 .apply_expected = True
4988 .type = WREPL_TYPE_GROUP,
4989 .state = WREPL_STATE_ACTIVE,
4990 .node = WREPL_NODE_B,
4992 .num_ips = ARRAY_SIZE(addresses_B_1),
4993 .ips = addresses_B_1,
4994 .apply_expected = True
4998 * sgroup,released vs. group,tombstone with same ip(s)
5001 .line = __location__,
5002 .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL),
5004 .nb_flags = NBT_NM_GROUP,
5006 .num_ips = ctx->addresses_best_num,
5007 .ips = ctx->addresses_best,
5008 .apply_expected = True
5011 .type = WREPL_TYPE_GROUP,
5012 .state = WREPL_STATE_TOMBSTONE,
5013 .node = WREPL_NODE_B,
5015 .num_ips = ctx->addresses_best_num,
5016 .ips = ctx->addresses_best,
5017 .apply_expected = True
5021 * sgroup,released vs. group,tombstone with different ip(s)
5024 .line = __location__,
5025 .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL),
5027 .nb_flags = NBT_NM_GROUP,
5029 .num_ips = ctx->addresses_best_num,
5030 .ips = ctx->addresses_best,
5031 .apply_expected = True
5034 .type = WREPL_TYPE_GROUP,
5035 .state = WREPL_STATE_TOMBSTONE,
5036 .node = WREPL_NODE_B,
5038 .num_ips = ARRAY_SIZE(addresses_B_1),
5039 .ips = addresses_B_1,
5040 .apply_expected = True
5044 * special group vs. special group section
5047 * sgroup,released vs. sgroup,active with same ip(s)
5050 .line = __location__,
5051 .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL),
5053 .nb_flags = NBT_NM_GROUP,
5055 .num_ips = ctx->addresses_best_num,
5056 .ips = ctx->addresses_best,
5057 .apply_expected = True
5060 .type = WREPL_TYPE_SGROUP,
5061 .state = WREPL_STATE_ACTIVE,
5062 .node = WREPL_NODE_B,
5064 .num_ips = ctx->addresses_best_num,
5065 .ips = ctx->addresses_best,
5066 .apply_expected = True
5070 * sgroup,released vs. sgroup,active with different ip(s)
5073 .line = __location__,
5074 .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL),
5076 .nb_flags = NBT_NM_GROUP,
5078 .num_ips = ctx->addresses_best_num,
5079 .ips = ctx->addresses_best,
5080 .apply_expected = True
5083 .type = WREPL_TYPE_SGROUP,
5084 .state = WREPL_STATE_ACTIVE,
5085 .node = WREPL_NODE_B,
5087 .num_ips = ARRAY_SIZE(addresses_B_1),
5088 .ips = addresses_B_1,
5089 .apply_expected = True
5093 * sgroup,released vs. sgroup,tombstone with same ip(s)
5096 .line = __location__,
5097 .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL),
5099 .nb_flags = NBT_NM_GROUP,
5101 .num_ips = ctx->addresses_best_num,
5102 .ips = ctx->addresses_best,
5103 .apply_expected = True
5106 .type = WREPL_TYPE_SGROUP,
5107 .state = WREPL_STATE_TOMBSTONE,
5108 .node = WREPL_NODE_B,
5110 .num_ips = ctx->addresses_best_num,
5111 .ips = ctx->addresses_best,
5112 .apply_expected = True
5116 * sgroup,released vs. sgroup,tombstone with different ip(s)
5119 .line = __location__,
5120 .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL),
5122 .nb_flags = NBT_NM_GROUP,
5124 .num_ips = ctx->addresses_best_num,
5125 .ips = ctx->addresses_best,
5126 .apply_expected = True
5129 .type = WREPL_TYPE_SGROUP,
5130 .state = WREPL_STATE_TOMBSTONE,
5131 .node = WREPL_NODE_B,
5133 .num_ips = ARRAY_SIZE(addresses_B_1),
5134 .ips = addresses_B_1,
5135 .apply_expected = True
5139 * special group vs. multi homed section
5142 * sgroup,released vs. mhomed,active with same ip(s)
5145 .line = __location__,
5146 .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL),
5148 .nb_flags = NBT_NM_GROUP,
5150 .num_ips = ctx->addresses_best_num,
5151 .ips = ctx->addresses_best,
5152 .apply_expected = True
5155 .type = WREPL_TYPE_MHOMED,
5156 .state = WREPL_STATE_ACTIVE,
5157 .node = WREPL_NODE_B,
5159 .num_ips = ctx->addresses_best_num,
5160 .ips = ctx->addresses_best,
5161 .apply_expected = True
5165 * sgroup,released vs. mhomed,active with different ip(s)
5168 .line = __location__,
5169 .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL),
5171 .nb_flags = NBT_NM_GROUP,
5173 .num_ips = ctx->addresses_best_num,
5174 .ips = ctx->addresses_best,
5175 .apply_expected = True
5178 .type = WREPL_TYPE_MHOMED,
5179 .state = WREPL_STATE_ACTIVE,
5180 .node = WREPL_NODE_B,
5182 .num_ips = ARRAY_SIZE(addresses_B_1),
5183 .ips = addresses_B_1,
5184 .apply_expected = True
5188 * sgroup,released vs. mhomed,tombstone with same ip(s)
5191 .line = __location__,
5192 .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL),
5194 .nb_flags = NBT_NM_GROUP,
5196 .num_ips = ctx->addresses_best_num,
5197 .ips = ctx->addresses_best,
5198 .apply_expected = True
5201 .type = WREPL_TYPE_MHOMED,
5202 .state = WREPL_STATE_TOMBSTONE,
5203 .node = WREPL_NODE_B,
5205 .num_ips = ctx->addresses_best_num,
5206 .ips = ctx->addresses_best,
5207 .apply_expected = True
5211 * sgroup,released vs. mhomed,tombstone with different ip(s)
5214 .line = __location__,
5215 .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL),
5217 .nb_flags = NBT_NM_GROUP,
5219 .num_ips = ctx->addresses_best_num,
5220 .ips = ctx->addresses_best,
5221 .apply_expected = True
5224 .type = WREPL_TYPE_MHOMED,
5225 .state = WREPL_STATE_TOMBSTONE,
5226 .node = WREPL_NODE_B,
5228 .num_ips = ARRAY_SIZE(addresses_B_1),
5229 .ips = addresses_B_1,
5230 .apply_expected = True
5234 * multi homed vs. unique section
5237 * mhomed,released vs. unique,active with same ip(s)
5240 .line = __location__,
5241 .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL),
5245 .num_ips = ctx->addresses_best_num,
5246 .ips = ctx->addresses_best,
5247 .apply_expected = True
5250 .type = WREPL_TYPE_UNIQUE,
5251 .state = WREPL_STATE_ACTIVE,
5252 .node = WREPL_NODE_B,
5254 .num_ips = ctx->addresses_best_num,
5255 .ips = ctx->addresses_best,
5256 .apply_expected = True
5260 * mhomed,released vs. unique,active with different ip(s)
5263 .line = __location__,
5264 .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL),
5268 .num_ips = ctx->addresses_best_num,
5269 .ips = ctx->addresses_best,
5270 .apply_expected = True
5273 .type = WREPL_TYPE_UNIQUE,
5274 .state = WREPL_STATE_ACTIVE,
5275 .node = WREPL_NODE_B,
5277 .num_ips = ARRAY_SIZE(addresses_B_1),
5278 .ips = addresses_B_1,
5279 .apply_expected = True
5283 * mhomed,released vs. unique,tombstone with same ip(s)
5286 .line = __location__,
5287 .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL),
5291 .num_ips = ctx->addresses_best_num,
5292 .ips = ctx->addresses_best,
5293 .apply_expected = True
5296 .type = WREPL_TYPE_UNIQUE,
5297 .state = WREPL_STATE_TOMBSTONE,
5298 .node = WREPL_NODE_B,
5300 .num_ips = ctx->addresses_best_num,
5301 .ips = ctx->addresses_best,
5302 .apply_expected = True
5306 * mhomed,released vs. unique,tombstone with different ip(s)
5309 .line = __location__,
5310 .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL),
5314 .num_ips = ctx->addresses_best_num,
5315 .ips = ctx->addresses_best,
5316 .apply_expected = True
5319 .type = WREPL_TYPE_UNIQUE,
5320 .state = WREPL_STATE_TOMBSTONE,
5321 .node = WREPL_NODE_B,
5323 .num_ips = ARRAY_SIZE(addresses_B_1),
5324 .ips = addresses_B_1,
5325 .apply_expected = True
5329 * multi homed vs. group section
5332 * mhomed,released vs. group,active with same ip(s)
5335 .line = __location__,
5336 .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL),
5340 .num_ips = ctx->addresses_best_num,
5341 .ips = ctx->addresses_best,
5342 .apply_expected = True
5345 .type = WREPL_TYPE_GROUP,
5346 .state = WREPL_STATE_ACTIVE,
5347 .node = WREPL_NODE_B,
5349 .num_ips = ctx->addresses_best_num,
5350 .ips = ctx->addresses_best,
5351 .apply_expected = True
5355 * mhomed,released vs. group,active with different ip(s)
5358 .line = __location__,
5359 .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL),
5363 .num_ips = ctx->addresses_best_num,
5364 .ips = ctx->addresses_best,
5365 .apply_expected = True
5368 .type = WREPL_TYPE_GROUP,
5369 .state = WREPL_STATE_ACTIVE,
5370 .node = WREPL_NODE_B,
5372 .num_ips = ARRAY_SIZE(addresses_B_1),
5373 .ips = addresses_B_1,
5374 .apply_expected = True
5378 * mhomed,released vs. group,tombstone with same ip(s)
5381 .line = __location__,
5382 .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL),
5386 .num_ips = ctx->addresses_best_num,
5387 .ips = ctx->addresses_best,
5388 .apply_expected = True
5391 .type = WREPL_TYPE_GROUP,
5392 .state = WREPL_STATE_TOMBSTONE,
5393 .node = WREPL_NODE_B,
5395 .num_ips = ctx->addresses_best_num,
5396 .ips = ctx->addresses_best,
5397 .apply_expected = True
5401 * mhomed,released vs. group,tombstone with different ip(s)
5404 .line = __location__,
5405 .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL),
5409 .num_ips = ctx->addresses_best_num,
5410 .ips = ctx->addresses_best,
5411 .apply_expected = True
5414 .type = WREPL_TYPE_GROUP,
5415 .state = WREPL_STATE_TOMBSTONE,
5416 .node = WREPL_NODE_B,
5418 .num_ips = ARRAY_SIZE(addresses_B_1),
5419 .ips = addresses_B_1,
5420 .apply_expected = True
5424 * multi homed vs. special group section
5427 * mhomed,released vs. sgroup,active with same ip(s)
5430 .line = __location__,
5431 .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL),
5435 .num_ips = ctx->addresses_best_num,
5436 .ips = ctx->addresses_best,
5437 .apply_expected = True
5440 .type = WREPL_TYPE_SGROUP,
5441 .state = WREPL_STATE_ACTIVE,
5442 .node = WREPL_NODE_B,
5444 .num_ips = ctx->addresses_best_num,
5445 .ips = ctx->addresses_best,
5446 .apply_expected = True
5450 * mhomed,released vs. sgroup,active with different ip(s)
5453 .line = __location__,
5454 .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL),
5458 .num_ips = ctx->addresses_best_num,
5459 .ips = ctx->addresses_best,
5460 .apply_expected = True
5463 .type = WREPL_TYPE_SGROUP,
5464 .state = WREPL_STATE_ACTIVE,
5465 .node = WREPL_NODE_B,
5467 .num_ips = ARRAY_SIZE(addresses_B_1),
5468 .ips = addresses_B_1,
5469 .apply_expected = True
5473 * mhomed,released vs. sgroup,tombstone with same ip(s)
5476 .line = __location__,
5477 .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL),
5481 .num_ips = ctx->addresses_best_num,
5482 .ips = ctx->addresses_best,
5483 .apply_expected = True
5486 .type = WREPL_TYPE_SGROUP,
5487 .state = WREPL_STATE_TOMBSTONE,
5488 .node = WREPL_NODE_B,
5490 .num_ips = ctx->addresses_best_num,
5491 .ips = ctx->addresses_best,
5492 .apply_expected = True
5496 * mhomed,released vs. sgroup,tombstone with different ip(s)
5499 .line = __location__,
5500 .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL),
5504 .num_ips = ctx->addresses_best_num,
5505 .ips = ctx->addresses_best,
5506 .apply_expected = True
5509 .type = WREPL_TYPE_SGROUP,
5510 .state = WREPL_STATE_TOMBSTONE,
5511 .node = WREPL_NODE_B,
5513 .num_ips = ARRAY_SIZE(addresses_B_1),
5514 .ips = addresses_B_1,
5515 .apply_expected = True
5519 * multi homed vs. multi homed section
5522 * mhomed,released vs. mhomed,active with same ip(s)
5525 .line = __location__,
5526 .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL),
5530 .num_ips = ctx->addresses_best_num,
5531 .ips = ctx->addresses_best,
5532 .apply_expected = True
5535 .type = WREPL_TYPE_MHOMED,
5536 .state = WREPL_STATE_ACTIVE,
5537 .node = WREPL_NODE_B,
5539 .num_ips = ctx->addresses_best_num,
5540 .ips = ctx->addresses_best,
5541 .apply_expected = True
5545 * mhomed,released vs. mhomed,active with different ip(s)
5548 .line = __location__,
5549 .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL),
5553 .num_ips = ctx->addresses_best_num,
5554 .ips = ctx->addresses_best,
5555 .apply_expected = True
5558 .type = WREPL_TYPE_MHOMED,
5559 .state = WREPL_STATE_ACTIVE,
5560 .node = WREPL_NODE_B,
5562 .num_ips = ARRAY_SIZE(addresses_B_1),
5563 .ips = addresses_B_1,
5564 .apply_expected = True
5568 * mhomed,released vs. mhomed,tombstone with same ip(s)
5571 .line = __location__,
5572 .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL),
5576 .num_ips = ctx->addresses_best_num,
5577 .ips = ctx->addresses_best,
5578 .apply_expected = True
5581 .type = WREPL_TYPE_MHOMED,
5582 .state = WREPL_STATE_TOMBSTONE,
5583 .node = WREPL_NODE_B,
5585 .num_ips = ctx->addresses_best_num,
5586 .ips = ctx->addresses_best,
5587 .apply_expected = True
5591 * mhomed,released vs. mhomed,tombstone with different ip(s)
5594 .line = __location__,
5595 .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL),
5599 .num_ips = ctx->addresses_best_num,
5600 .ips = ctx->addresses_best,
5601 .apply_expected = True
5604 .type = WREPL_TYPE_MHOMED,
5605 .state = WREPL_STATE_TOMBSTONE,
5606 .node = WREPL_NODE_B,
5608 .num_ips = ARRAY_SIZE(addresses_B_1),
5609 .ips = addresses_B_1,
5610 .apply_expected = True
5615 if (!ctx) return False;
5617 printf("Test Replica records vs. owned released records\n");
5619 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
5620 printf("%s => %s\n", nbt_name_string(ctx, &records[i].name),
5621 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
5626 name_register->in.name = records[i].name;
5627 name_register->in.dest_addr = ctx->address;
5628 name_register->in.address = records[i].wins.ips[0].ip;
5629 name_register->in.nb_flags = records[i].wins.nb_flags;
5630 name_register->in.register_demand= False;
5631 name_register->in.broadcast = False;
5632 name_register->in.multi_homed = records[i].wins.mhomed;
5633 name_register->in.ttl = 300000;
5634 name_register->in.timeout = 70;
5635 name_register->in.retries = 0;
5637 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
5638 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
5639 printf("No response from %s for name register\n", ctx->address);
5642 if (!NT_STATUS_IS_OK(status)) {
5643 printf("Bad response from %s for name register - %s\n",
5644 ctx->address, nt_errstr(status));
5647 CHECK_VALUE(name_register->out.rcode, 0);
5648 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
5649 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
5650 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
5651 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
5652 CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[0].ip);
5654 /* release the record */
5655 release->in.name = records[i].name;
5656 release->in.dest_addr = ctx->address;
5657 release->in.address = records[i].wins.ips[0].ip;
5658 release->in.nb_flags = records[i].wins.nb_flags;
5659 release->in.broadcast = False;
5660 release->in.timeout = 30;
5661 release->in.retries = 0;
5663 status = nbt_name_release(ctx->nbtsock, ctx, release);
5664 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
5665 printf("No response from %s for name release\n", ctx->address);
5668 if (!NT_STATUS_IS_OK(status)) {
5669 printf("Bad response from %s for name query - %s\n",
5670 ctx->address, nt_errstr(status));
5673 CHECK_VALUE(release->out.rcode, 0);
5678 wins_name->name = &records[i].name;
5679 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
5680 records[i].replica.state,
5681 records[i].replica.node,
5682 records[i].replica.is_static);
5683 wins_name->id = ++ctx->b.max_version;
5684 if (wins_name->flags & 2) {
5685 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
5686 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
5688 wins_name->addresses.ip = records[i].replica.ips[0].ip;
5690 wins_name->unknown = "255.255.255.255";
5692 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
5693 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
5694 records[i].replica.apply_expected);
5696 if (records[i].replica.apply_expected) {
5697 wins_name->name = &records[i].name;
5698 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
5699 WREPL_STATE_TOMBSTONE,
5700 WREPL_NODE_B, False);
5701 wins_name->id = ++ctx->b.max_version;
5702 wins_name->addresses.ip = addresses_B_1[0].ip;
5703 wins_name->unknown = "255.255.255.255";
5705 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
5706 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
5708 release->in.name = records[i].name;
5709 release->in.dest_addr = ctx->address;
5710 release->in.address = records[i].wins.ips[0].ip;
5711 release->in.nb_flags = records[i].wins.nb_flags;
5712 release->in.broadcast = False;
5713 release->in.timeout = 30;
5714 release->in.retries = 0;
5716 status = nbt_name_release(ctx->nbtsock, ctx, release);
5717 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
5718 printf("No response from %s for name release\n", ctx->address);
5721 if (!NT_STATUS_IS_OK(status)) {
5722 printf("Bad response from %s for name query - %s\n",
5723 ctx->address, nt_errstr(status));
5726 CHECK_VALUE(release->out.rcode, 0);
5730 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
5738 struct test_conflict_owned_active_vs_replica_struct {
5739 const char *line; /* just better debugging */
5740 const char *section; /* just better debugging */
5741 struct nbt_name name;
5747 const struct wrepl_ip *ips;
5748 BOOL apply_expected;
5753 BOOL expect_release;
5756 /* when num_ips == 0, then .wins.ips are used */
5758 const struct wrepl_ip *ips;
5761 enum wrepl_name_type type;
5762 enum wrepl_name_state state;
5763 enum wrepl_name_node node;
5766 const struct wrepl_ip *ips;
5767 BOOL apply_expected;
5773 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
5774 struct nbt_name_packet *req_packet,
5775 const struct nbt_peer_socket *src);
5777 static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_conn *ctx)
5781 struct wrepl_wins_name wins_name_;
5782 struct wrepl_wins_name *wins_name = &wins_name_;
5783 struct nbt_name_register name_register_;
5784 struct nbt_name_register *name_register = &name_register_;
5785 struct nbt_name_release release_;
5786 struct nbt_name_release *release = &release_;
5788 struct test_conflict_owned_active_vs_replica_struct records[] = {
5790 * unique vs. unique section
5793 * unique,active vs. unique,active with same ip(s), unchecked
5796 .line = __location__,
5797 .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL),
5801 .num_ips = ctx->addresses_best_num,
5802 .ips = ctx->addresses_best,
5803 .apply_expected = True
5809 .type = WREPL_TYPE_UNIQUE,
5810 .state = WREPL_STATE_ACTIVE,
5811 .node = WREPL_NODE_B,
5813 .num_ips = ctx->addresses_best_num,
5814 .ips = ctx->addresses_best,
5815 .apply_expected = True
5819 * unique,active vs. unique,active with different ip(s), positive response
5822 .line = __location__,
5823 .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL),
5827 .num_ips = ctx->addresses_best_num,
5828 .ips = ctx->addresses_best,
5829 .apply_expected = True
5836 .type = WREPL_TYPE_UNIQUE,
5837 .state = WREPL_STATE_ACTIVE,
5838 .node = WREPL_NODE_B,
5840 .num_ips = ARRAY_SIZE(addresses_B_1),
5841 .ips = addresses_B_1,
5842 .apply_expected = False
5846 * unique,active vs. unique,active with different ip(s), positive response other ips
5849 .line = __location__,
5850 .name = _NBT_NAME("_UA_UA_DI_O", 0x00, NULL),
5854 .num_ips = ctx->addresses_best_num,
5855 .ips = ctx->addresses_best,
5856 .apply_expected = True
5861 .num_ips = ARRAY_SIZE(addresses_A_3_4),
5862 .ips = addresses_A_3_4,
5865 .type = WREPL_TYPE_UNIQUE,
5866 .state = WREPL_STATE_ACTIVE,
5867 .node = WREPL_NODE_B,
5869 .num_ips = ARRAY_SIZE(addresses_B_1),
5870 .ips = addresses_B_1,
5871 .apply_expected = False
5875 * unique,active vs. unique,active with different ip(s), negative response
5878 .line = __location__,
5879 .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL),
5883 .num_ips = ctx->addresses_best_num,
5884 .ips = ctx->addresses_best,
5885 .apply_expected = True
5892 .type = WREPL_TYPE_UNIQUE,
5893 .state = WREPL_STATE_ACTIVE,
5894 .node = WREPL_NODE_B,
5896 .num_ips = ARRAY_SIZE(addresses_B_1),
5897 .ips = addresses_B_1,
5898 .apply_expected = True
5902 * unique,active vs. unique,tombstone with same ip(s), unchecked
5905 .line = __location__,
5906 .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL),
5910 .num_ips = ctx->addresses_best_num,
5911 .ips = ctx->addresses_best,
5912 .apply_expected = True
5918 .type = WREPL_TYPE_UNIQUE,
5919 .state = WREPL_STATE_TOMBSTONE,
5920 .node = WREPL_NODE_B,
5922 .num_ips = ctx->addresses_best_num,
5923 .ips = ctx->addresses_best,
5924 .apply_expected = False
5928 * unique,active vs. unique,tombstone with different ip(s), unchecked
5931 .line = __location__,
5932 .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL),
5936 .num_ips = ctx->addresses_best_num,
5937 .ips = ctx->addresses_best,
5938 .apply_expected = True
5944 .type = WREPL_TYPE_UNIQUE,
5945 .state = WREPL_STATE_TOMBSTONE,
5946 .node = WREPL_NODE_B,
5948 .num_ips = ARRAY_SIZE(addresses_B_1),
5949 .ips = addresses_B_1,
5950 .apply_expected = False
5954 * unique vs. group section
5957 * unique,active vs. group,active with same ip(s), release expected
5960 .line = __location__,
5961 .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL),
5965 .num_ips = ctx->addresses_best_num,
5966 .ips = ctx->addresses_best,
5967 .apply_expected = True
5971 .expect_release = True,
5974 .type = WREPL_TYPE_GROUP,
5975 .state = WREPL_STATE_ACTIVE,
5976 .node = WREPL_NODE_B,
5978 .num_ips = ctx->addresses_best_num,
5979 .ips = ctx->addresses_best,
5980 .apply_expected = True
5984 * unique,active vs. group,active with different ip(s), release expected
5987 .line = __location__,
5988 .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL),
5992 .num_ips = ctx->addresses_best_num,
5993 .ips = ctx->addresses_best,
5994 .apply_expected = True
5998 .expect_release = True,
6001 .type = WREPL_TYPE_GROUP,
6002 .state = WREPL_STATE_ACTIVE,
6003 .node = WREPL_NODE_B,
6005 .num_ips = ARRAY_SIZE(addresses_B_1),
6006 .ips = addresses_B_1,
6007 .apply_expected = True
6011 * unique,active vs. group,tombstone with same ip(s), unchecked
6014 .line = __location__,
6015 .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL),
6019 .num_ips = ctx->addresses_best_num,
6020 .ips = ctx->addresses_best,
6021 .apply_expected = True
6027 .type = WREPL_TYPE_GROUP,
6028 .state = WREPL_STATE_TOMBSTONE,
6029 .node = WREPL_NODE_B,
6031 .num_ips = ctx->addresses_best_num,
6032 .ips = ctx->addresses_best,
6033 .apply_expected = False
6037 * unique,active vs. group,tombstone with different ip(s), unchecked
6040 .line = __location__,
6041 .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL),
6045 .num_ips = ctx->addresses_best_num,
6046 .ips = ctx->addresses_best,
6047 .apply_expected = True
6053 .type = WREPL_TYPE_GROUP,
6054 .state = WREPL_STATE_TOMBSTONE,
6055 .node = WREPL_NODE_B,
6057 .num_ips = ARRAY_SIZE(addresses_B_1),
6058 .ips = addresses_B_1,
6059 .apply_expected = False
6063 * unique vs. special group section
6066 * unique,active vs. sgroup,active with same ip(s), release expected
6069 .line = __location__,
6070 .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL),
6074 .num_ips = ctx->addresses_best_num,
6075 .ips = ctx->addresses_best,
6076 .apply_expected = True
6080 .expect_release = True,
6083 .type = WREPL_TYPE_SGROUP,
6084 .state = WREPL_STATE_ACTIVE,
6085 .node = WREPL_NODE_B,
6087 .num_ips = ctx->addresses_best_num,
6088 .ips = ctx->addresses_best,
6089 .apply_expected = True
6093 * unique,active vs. group,active with different ip(s), release expected
6096 .line = __location__,
6097 .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL),
6101 .num_ips = ctx->addresses_best_num,
6102 .ips = ctx->addresses_best,
6103 .apply_expected = True
6107 .expect_release = True,
6110 .type = WREPL_TYPE_SGROUP,
6111 .state = WREPL_STATE_ACTIVE,
6112 .node = WREPL_NODE_B,
6114 .num_ips = ARRAY_SIZE(addresses_B_1),
6115 .ips = addresses_B_1,
6116 .apply_expected = True
6120 * unique,active vs. sgroup,tombstone with same ip(s), unchecked
6123 .line = __location__,
6124 .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL),
6128 .num_ips = ctx->addresses_best_num,
6129 .ips = ctx->addresses_best,
6130 .apply_expected = True
6136 .type = WREPL_TYPE_SGROUP,
6137 .state = WREPL_STATE_TOMBSTONE,
6138 .node = WREPL_NODE_B,
6140 .num_ips = ctx->addresses_best_num,
6141 .ips = ctx->addresses_best,
6142 .apply_expected = False
6146 * unique,active vs. sgroup,tombstone with different ip(s), unchecked
6149 .line = __location__,
6150 .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL),
6154 .num_ips = ctx->addresses_best_num,
6155 .ips = ctx->addresses_best,
6156 .apply_expected = True
6162 .type = WREPL_TYPE_SGROUP,
6163 .state = WREPL_STATE_TOMBSTONE,
6164 .node = WREPL_NODE_B,
6166 .num_ips = ARRAY_SIZE(addresses_B_1),
6167 .ips = addresses_B_1,
6168 .apply_expected = False
6172 * unique vs. multi homed section
6175 * unique,active vs. mhomed,active with same ip(s), unchecked
6178 .line = __location__,
6179 .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL),
6183 .num_ips = ctx->addresses_best_num,
6184 .ips = ctx->addresses_best,
6185 .apply_expected = True
6191 .type = WREPL_TYPE_MHOMED,
6192 .state = WREPL_STATE_ACTIVE,
6193 .node = WREPL_NODE_B,
6195 .num_ips = ctx->addresses_best_num,
6196 .ips = ctx->addresses_best,
6197 .apply_expected = True
6201 * unique,active vs. mhomed,active with superset ip(s), unchecked
6204 .line = __location__,
6205 .name = _NBT_NAME("_UA_MA_SP_U", 0x00, NULL),
6209 .num_ips = ctx->addresses_best_num,
6210 .ips = ctx->addresses_best,
6211 .apply_expected = True
6217 .type = WREPL_TYPE_MHOMED,
6218 .state = WREPL_STATE_ACTIVE,
6219 .node = WREPL_NODE_B,
6221 .num_ips = ctx->addresses_all_num,
6222 .ips = ctx->addresses_all,
6223 .apply_expected = True
6227 * unique,active vs. mhomed,active with different ip(s), positive response
6230 .line = __location__,
6231 .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL),
6235 .num_ips = ctx->addresses_best_num,
6236 .ips = ctx->addresses_best,
6237 .apply_expected = True
6244 .type = WREPL_TYPE_MHOMED,
6245 .state = WREPL_STATE_ACTIVE,
6246 .node = WREPL_NODE_B,
6248 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6249 .ips = addresses_B_3_4,
6250 .apply_expected = False
6254 * unique,active vs. mhomed,active with different ip(s), positive response other ips
6257 .line = __location__,
6258 .name = _NBT_NAME("_UA_MA_DI_O", 0x00, NULL),
6262 .num_ips = ctx->addresses_best_num,
6263 .ips = ctx->addresses_best,
6264 .apply_expected = True
6269 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6270 .ips = addresses_A_3_4,
6273 .type = WREPL_TYPE_MHOMED,
6274 .state = WREPL_STATE_ACTIVE,
6275 .node = WREPL_NODE_B,
6277 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6278 .ips = addresses_B_3_4,
6279 .apply_expected = False
6283 * unique,active vs. mhomed,active with different ip(s), negative response
6286 .line = __location__,
6287 .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL),
6291 .num_ips = ctx->addresses_best_num,
6292 .ips = ctx->addresses_best,
6293 .apply_expected = True
6300 .type = WREPL_TYPE_MHOMED,
6301 .state = WREPL_STATE_ACTIVE,
6302 .node = WREPL_NODE_B,
6304 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6305 .ips = addresses_B_3_4,
6306 .apply_expected = True
6310 * unique,active vs. mhomed,tombstone with same ip(s), unchecked
6313 .line = __location__,
6314 .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL),
6318 .num_ips = ctx->addresses_best_num,
6319 .ips = ctx->addresses_best,
6320 .apply_expected = True
6326 .type = WREPL_TYPE_MHOMED,
6327 .state = WREPL_STATE_TOMBSTONE,
6328 .node = WREPL_NODE_B,
6330 .num_ips = ctx->addresses_best_num,
6331 .ips = ctx->addresses_best,
6332 .apply_expected = False
6336 * unique,active vs. mhomed,tombstone with different ip(s), unchecked
6339 .line = __location__,
6340 .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL),
6344 .num_ips = ctx->addresses_best_num,
6345 .ips = ctx->addresses_best,
6346 .apply_expected = True
6352 .type = WREPL_TYPE_MHOMED,
6353 .state = WREPL_STATE_TOMBSTONE,
6354 .node = WREPL_NODE_B,
6356 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6357 .ips = addresses_B_3_4,
6358 .apply_expected = False
6362 * normal group vs. unique section
6365 * group,active vs. unique,active with same ip(s), unchecked
6368 .line = __location__,
6369 .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL),
6371 .nb_flags = NBT_NM_GROUP,
6373 .num_ips = ctx->addresses_best_num,
6374 .ips = ctx->addresses_best,
6375 .apply_expected = True
6381 .type = WREPL_TYPE_UNIQUE,
6382 .state = WREPL_STATE_ACTIVE,
6383 .node = WREPL_NODE_B,
6385 .num_ips = ctx->addresses_best_num,
6386 .ips = ctx->addresses_best,
6387 .apply_expected = False
6391 * group,active vs. unique,active with different ip(s), unchecked
6394 .line = __location__,
6395 .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL),
6397 .nb_flags = NBT_NM_GROUP,
6399 .num_ips = ctx->addresses_best_num,
6400 .ips = ctx->addresses_best,
6401 .apply_expected = True
6407 .type = WREPL_TYPE_UNIQUE,
6408 .state = WREPL_STATE_ACTIVE,
6409 .node = WREPL_NODE_B,
6411 .num_ips = ARRAY_SIZE(addresses_B_1),
6412 .ips = addresses_B_1,
6413 .apply_expected = False
6417 * group,active vs. unique,tombstone with same ip(s), unchecked
6420 .line = __location__,
6421 .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL),
6423 .nb_flags = NBT_NM_GROUP,
6425 .num_ips = ctx->addresses_best_num,
6426 .ips = ctx->addresses_best,
6427 .apply_expected = True
6433 .type = WREPL_TYPE_UNIQUE,
6434 .state = WREPL_STATE_TOMBSTONE,
6435 .node = WREPL_NODE_B,
6437 .num_ips = ctx->addresses_best_num,
6438 .ips = ctx->addresses_best,
6439 .apply_expected = False
6443 * group,active vs. unique,tombstone with different ip(s), unchecked
6446 .line = __location__,
6447 .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL),
6449 .nb_flags = NBT_NM_GROUP,
6451 .num_ips = ctx->addresses_best_num,
6452 .ips = ctx->addresses_best,
6453 .apply_expected = True
6459 .type = WREPL_TYPE_UNIQUE,
6460 .state = WREPL_STATE_TOMBSTONE,
6461 .node = WREPL_NODE_B,
6463 .num_ips = ARRAY_SIZE(addresses_B_1),
6464 .ips = addresses_B_1,
6465 .apply_expected = False
6469 * normal group vs. normal group section
6472 * group,active vs. group,active with same ip(s), unchecked
6475 .line = __location__,
6476 .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL),
6478 .nb_flags = NBT_NM_GROUP,
6480 .num_ips = ctx->addresses_best_num,
6481 .ips = ctx->addresses_best,
6482 .apply_expected = True
6488 .type = WREPL_TYPE_GROUP,
6489 .state = WREPL_STATE_ACTIVE,
6490 .node = WREPL_NODE_B,
6492 .num_ips = ctx->addresses_best_num,
6493 .ips = ctx->addresses_best,
6494 .apply_expected = True
6498 * group,active vs. group,active with different ip(s), unchecked
6501 .line = __location__,
6502 .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL),
6504 .nb_flags = NBT_NM_GROUP,
6506 .num_ips = ctx->addresses_best_num,
6507 .ips = ctx->addresses_best,
6508 .apply_expected = True
6514 .type = WREPL_TYPE_GROUP,
6515 .state = WREPL_STATE_ACTIVE,
6516 .node = WREPL_NODE_B,
6518 .num_ips = ARRAY_SIZE(addresses_B_1),
6519 .ips = addresses_B_1,
6520 .apply_expected = True
6524 * group,active vs. group,tombstone with same ip(s), unchecked
6527 .line = __location__,
6528 .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL),
6530 .nb_flags = NBT_NM_GROUP,
6532 .num_ips = ctx->addresses_best_num,
6533 .ips = ctx->addresses_best,
6534 .apply_expected = True
6540 .type = WREPL_TYPE_GROUP,
6541 .state = WREPL_STATE_TOMBSTONE,
6542 .node = WREPL_NODE_B,
6544 .num_ips = ctx->addresses_best_num,
6545 .ips = ctx->addresses_best,
6546 .apply_expected = False
6550 * group,active vs. group,tombstone with different ip(s), unchecked
6553 .line = __location__,
6554 .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL),
6556 .nb_flags = NBT_NM_GROUP,
6558 .num_ips = ctx->addresses_best_num,
6559 .ips = ctx->addresses_best,
6560 .apply_expected = True
6566 .type = WREPL_TYPE_GROUP,
6567 .state = WREPL_STATE_TOMBSTONE,
6568 .node = WREPL_NODE_B,
6570 .num_ips = ARRAY_SIZE(addresses_B_1),
6571 .ips = addresses_B_1,
6572 .apply_expected = False
6576 * normal group vs. special group section
6579 * group,active vs. sgroup,active with same ip(s), unchecked
6582 .line = __location__,
6583 .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL),
6585 .nb_flags = NBT_NM_GROUP,
6587 .num_ips = ctx->addresses_best_num,
6588 .ips = ctx->addresses_best,
6589 .apply_expected = True
6595 .type = WREPL_TYPE_SGROUP,
6596 .state = WREPL_STATE_ACTIVE,
6597 .node = WREPL_NODE_B,
6599 .num_ips = ctx->addresses_best_num,
6600 .ips = ctx->addresses_best,
6601 .apply_expected = False
6605 * group,active vs. sgroup,active with different ip(s), unchecked
6608 .line = __location__,
6609 .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL),
6611 .nb_flags = NBT_NM_GROUP,
6613 .num_ips = ctx->addresses_best_num,
6614 .ips = ctx->addresses_best,
6615 .apply_expected = True
6621 .type = WREPL_TYPE_SGROUP,
6622 .state = WREPL_STATE_ACTIVE,
6623 .node = WREPL_NODE_B,
6625 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6626 .ips = addresses_B_3_4,
6627 .apply_expected = False
6631 * group,active vs. sgroup,tombstone with same ip(s), unchecked
6634 .line = __location__,
6635 .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL),
6637 .nb_flags = NBT_NM_GROUP,
6639 .num_ips = ctx->addresses_best_num,
6640 .ips = ctx->addresses_best,
6641 .apply_expected = True
6647 .type = WREPL_TYPE_SGROUP,
6648 .state = WREPL_STATE_TOMBSTONE,
6649 .node = WREPL_NODE_B,
6651 .num_ips = ctx->addresses_best_num,
6652 .ips = ctx->addresses_best,
6653 .apply_expected = False
6657 * group,active vs. sgroup,tombstone with different ip(s), unchecked
6660 .line = __location__,
6661 .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL),
6663 .nb_flags = NBT_NM_GROUP,
6665 .num_ips = ctx->addresses_best_num,
6666 .ips = ctx->addresses_best,
6667 .apply_expected = True
6673 .type = WREPL_TYPE_SGROUP,
6674 .state = WREPL_STATE_TOMBSTONE,
6675 .node = WREPL_NODE_B,
6677 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6678 .ips = addresses_B_3_4,
6679 .apply_expected = False
6683 * normal group vs. multi homed section
6686 * group,active vs. mhomed,active with same ip(s), unchecked
6689 .line = __location__,
6690 .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL),
6692 .nb_flags = NBT_NM_GROUP,
6694 .num_ips = ctx->addresses_best_num,
6695 .ips = ctx->addresses_best,
6696 .apply_expected = True
6702 .type = WREPL_TYPE_MHOMED,
6703 .state = WREPL_STATE_ACTIVE,
6704 .node = WREPL_NODE_B,
6706 .num_ips = ctx->addresses_best_num,
6707 .ips = ctx->addresses_best,
6708 .apply_expected = False
6712 * group,active vs. mhomed,active with different ip(s), unchecked
6715 .line = __location__,
6716 .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL),
6718 .nb_flags = NBT_NM_GROUP,
6720 .num_ips = ctx->addresses_best_num,
6721 .ips = ctx->addresses_best,
6722 .apply_expected = True
6728 .type = WREPL_TYPE_MHOMED,
6729 .state = WREPL_STATE_ACTIVE,
6730 .node = WREPL_NODE_B,
6732 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6733 .ips = addresses_B_3_4,
6734 .apply_expected = False
6738 * group,active vs. mhomed,tombstone with same ip(s), unchecked
6741 .line = __location__,
6742 .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL),
6744 .nb_flags = NBT_NM_GROUP,
6746 .num_ips = ctx->addresses_best_num,
6747 .ips = ctx->addresses_best,
6748 .apply_expected = True
6754 .type = WREPL_TYPE_MHOMED,
6755 .state = WREPL_STATE_TOMBSTONE,
6756 .node = WREPL_NODE_B,
6758 .num_ips = ctx->addresses_best_num,
6759 .ips = ctx->addresses_best,
6760 .apply_expected = False
6764 * group,active vs. mhomed,tombstone with different ip(s), unchecked
6767 .line = __location__,
6768 .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL),
6770 .nb_flags = NBT_NM_GROUP,
6772 .num_ips = ctx->addresses_best_num,
6773 .ips = ctx->addresses_best,
6774 .apply_expected = True
6780 .type = WREPL_TYPE_MHOMED,
6781 .state = WREPL_STATE_TOMBSTONE,
6782 .node = WREPL_NODE_B,
6784 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6785 .ips = addresses_B_3_4,
6786 .apply_expected = False
6790 * special group vs. unique section
6793 * sgroup,active vs. unique,active with same ip(s), unchecked
6796 .line = __location__,
6797 .name = _NBT_NAME("_SA_UA_SI_U", 0x1C, NULL),
6799 .nb_flags = NBT_NM_GROUP,
6801 .num_ips = ctx->addresses_best_num,
6802 .ips = ctx->addresses_best,
6803 .apply_expected = True
6809 .type = WREPL_TYPE_UNIQUE,
6810 .state = WREPL_STATE_ACTIVE,
6811 .node = WREPL_NODE_B,
6813 .num_ips = ctx->addresses_best_num,
6814 .ips = ctx->addresses_best,
6815 .apply_expected = False
6819 * sgroup,active vs. unique,active with different ip(s), unchecked
6822 .line = __location__,
6823 .name = _NBT_NAME("_SA_UA_DI_U", 0x1C, NULL),
6825 .nb_flags = NBT_NM_GROUP,
6827 .num_ips = ctx->addresses_best_num,
6828 .ips = ctx->addresses_best,
6829 .apply_expected = True
6835 .type = WREPL_TYPE_UNIQUE,
6836 .state = WREPL_STATE_ACTIVE,
6837 .node = WREPL_NODE_B,
6839 .num_ips = ARRAY_SIZE(addresses_B_1),
6840 .ips = addresses_B_1,
6841 .apply_expected = False
6845 * sgroup,active vs. unique,tombstone with same ip(s), unchecked
6848 .line = __location__,
6849 .name = _NBT_NAME("_SA_UT_SI_U", 0x1C, NULL),
6851 .nb_flags = NBT_NM_GROUP,
6853 .num_ips = ctx->addresses_best_num,
6854 .ips = ctx->addresses_best,
6855 .apply_expected = True
6861 .type = WREPL_TYPE_UNIQUE,
6862 .state = WREPL_STATE_TOMBSTONE,
6863 .node = WREPL_NODE_B,
6865 .num_ips = ctx->addresses_best_num,
6866 .ips = ctx->addresses_best,
6867 .apply_expected = False
6871 * sgroup,active vs. unique,tombstone with different ip(s), unchecked
6874 .line = __location__,
6875 .name = _NBT_NAME("_SA_UT_DI_U", 0x1C, NULL),
6877 .nb_flags = NBT_NM_GROUP,
6879 .num_ips = ctx->addresses_best_num,
6880 .ips = ctx->addresses_best,
6881 .apply_expected = True
6887 .type = WREPL_TYPE_UNIQUE,
6888 .state = WREPL_STATE_TOMBSTONE,
6889 .node = WREPL_NODE_B,
6891 .num_ips = ARRAY_SIZE(addresses_B_1),
6892 .ips = addresses_B_1,
6893 .apply_expected = False
6897 * special group vs. normal group section
6900 * sgroup,active vs. group,active with same ip(s), unchecked
6903 .line = __location__,
6904 .name = _NBT_NAME("_SA_GA_SI_U", 0x1C, NULL),
6906 .nb_flags = NBT_NM_GROUP,
6908 .num_ips = ctx->addresses_best_num,
6909 .ips = ctx->addresses_best,
6910 .apply_expected = True
6916 .type = WREPL_TYPE_GROUP,
6917 .state = WREPL_STATE_ACTIVE,
6918 .node = WREPL_NODE_B,
6920 .num_ips = ctx->addresses_best_num,
6921 .ips = ctx->addresses_best,
6922 .apply_expected = False
6926 * sgroup,active vs. group,active with different ip(s), unchecked
6929 .line = __location__,
6930 .name = _NBT_NAME("_SA_GA_DI_U", 0x1C, NULL),
6932 .nb_flags = NBT_NM_GROUP,
6934 .num_ips = ctx->addresses_best_num,
6935 .ips = ctx->addresses_best,
6936 .apply_expected = True
6942 .type = WREPL_TYPE_GROUP,
6943 .state = WREPL_STATE_ACTIVE,
6944 .node = WREPL_NODE_B,
6946 .num_ips = ARRAY_SIZE(addresses_B_1),
6947 .ips = addresses_B_1,
6948 .apply_expected = False
6952 * sgroup,active vs. group,tombstone with same ip(s), unchecked
6955 .line = __location__,
6956 .name = _NBT_NAME("_SA_GT_SI_U", 0x1C, NULL),
6958 .nb_flags = NBT_NM_GROUP,
6960 .num_ips = ctx->addresses_best_num,
6961 .ips = ctx->addresses_best,
6962 .apply_expected = True
6968 .type = WREPL_TYPE_GROUP,
6969 .state = WREPL_STATE_TOMBSTONE,
6970 .node = WREPL_NODE_B,
6972 .num_ips = ctx->addresses_best_num,
6973 .ips = ctx->addresses_best,
6974 .apply_expected = False
6978 * sgroup,active vs. group,tombstone with different ip(s), unchecked
6981 .line = __location__,
6982 .name = _NBT_NAME("_SA_GT_DI_U", 0x1C, NULL),
6984 .nb_flags = NBT_NM_GROUP,
6986 .num_ips = ctx->addresses_best_num,
6987 .ips = ctx->addresses_best,
6988 .apply_expected = True
6994 .type = WREPL_TYPE_GROUP,
6995 .state = WREPL_STATE_TOMBSTONE,
6996 .node = WREPL_NODE_B,
6998 .num_ips = ARRAY_SIZE(addresses_B_1),
6999 .ips = addresses_B_1,
7000 .apply_expected = False
7004 * special group vs. multi homed section
7007 * sgroup,active vs. mhomed,active with same ip(s), unchecked
7010 .line = __location__,
7011 .name = _NBT_NAME("_SA_MA_SI_U", 0x1C, NULL),
7013 .nb_flags = NBT_NM_GROUP,
7015 .num_ips = ctx->addresses_best_num,
7016 .ips = ctx->addresses_best,
7017 .apply_expected = True
7023 .type = WREPL_TYPE_MHOMED,
7024 .state = WREPL_STATE_ACTIVE,
7025 .node = WREPL_NODE_B,
7027 .num_ips = ctx->addresses_best_num,
7028 .ips = ctx->addresses_best,
7029 .apply_expected = False
7033 * sgroup,active vs. mhomed,active with different ip(s), unchecked
7036 .line = __location__,
7037 .name = _NBT_NAME("_SA_MA_DI_U", 0x1C, NULL),
7039 .nb_flags = NBT_NM_GROUP,
7041 .num_ips = ctx->addresses_best_num,
7042 .ips = ctx->addresses_best,
7043 .apply_expected = True
7049 .type = WREPL_TYPE_MHOMED,
7050 .state = WREPL_STATE_ACTIVE,
7051 .node = WREPL_NODE_B,
7053 .num_ips = ARRAY_SIZE(addresses_B_1),
7054 .ips = addresses_B_1,
7055 .apply_expected = False
7059 * sgroup,active vs. mhomed,tombstone with same ip(s), unchecked
7062 .line = __location__,
7063 .name = _NBT_NAME("_SA_MT_SI_U", 0x1C, NULL),
7065 .nb_flags = NBT_NM_GROUP,
7067 .num_ips = ctx->addresses_best_num,
7068 .ips = ctx->addresses_best,
7069 .apply_expected = True
7075 .type = WREPL_TYPE_MHOMED,
7076 .state = WREPL_STATE_TOMBSTONE,
7077 .node = WREPL_NODE_B,
7079 .num_ips = ctx->addresses_best_num,
7080 .ips = ctx->addresses_best,
7081 .apply_expected = False
7085 * sgroup,active vs. mhomed,tombstone with different ip(s), unchecked
7088 .line = __location__,
7089 .name = _NBT_NAME("_SA_MT_DI_U", 0x1C, NULL),
7091 .nb_flags = NBT_NM_GROUP,
7093 .num_ips = ctx->addresses_best_num,
7094 .ips = ctx->addresses_best,
7095 .apply_expected = True
7101 .type = WREPL_TYPE_MHOMED,
7102 .state = WREPL_STATE_TOMBSTONE,
7103 .node = WREPL_NODE_B,
7105 .num_ips = ARRAY_SIZE(addresses_B_1),
7106 .ips = addresses_B_1,
7107 .apply_expected = False
7111 * multi homed vs. unique section
7114 * mhomed,active vs. unique,active with same ip(s), unchecked
7117 .line = __location__,
7118 .name = _NBT_NAME("_MA_UA_SI_U", 0x00, NULL),
7122 .num_ips = ctx->addresses_best_num,
7123 .ips = ctx->addresses_best,
7124 .apply_expected = True
7130 .type = WREPL_TYPE_UNIQUE,
7131 .state = WREPL_STATE_ACTIVE,
7132 .node = WREPL_NODE_B,
7134 .num_ips = ctx->addresses_best_num,
7135 .ips = ctx->addresses_best,
7136 .apply_expected = True
7140 * mhomed,active vs. unique,active with different ip(s), positive response
7143 .line = __location__,
7144 .name = _NBT_NAME("_MA_UA_DI_P", 0x00, NULL),
7148 .num_ips = ctx->addresses_best_num,
7149 .ips = ctx->addresses_best,
7150 .apply_expected = True
7157 .type = WREPL_TYPE_UNIQUE,
7158 .state = WREPL_STATE_ACTIVE,
7159 .node = WREPL_NODE_B,
7161 .num_ips = ARRAY_SIZE(addresses_B_1),
7162 .ips = addresses_B_1,
7163 .apply_expected = False
7167 * mhomed,active vs. unique,active with different ip(s), positive response other ips
7170 .line = __location__,
7171 .name = _NBT_NAME("_MA_UA_DI_O", 0x00, NULL),
7175 .num_ips = ctx->addresses_best_num,
7176 .ips = ctx->addresses_best,
7177 .apply_expected = True
7182 .num_ips = ARRAY_SIZE(addresses_A_3_4),
7183 .ips = addresses_A_3_4,
7186 .type = WREPL_TYPE_UNIQUE,
7187 .state = WREPL_STATE_ACTIVE,
7188 .node = WREPL_NODE_B,
7190 .num_ips = ARRAY_SIZE(addresses_B_1),
7191 .ips = addresses_B_1,
7192 .apply_expected = False
7196 * mhomed,active vs. unique,active with different ip(s), negative response
7199 .line = __location__,
7200 .name = _NBT_NAME("_MA_UA_DI_N", 0x00, NULL),
7204 .num_ips = ctx->addresses_best_num,
7205 .ips = ctx->addresses_best,
7206 .apply_expected = True
7213 .type = WREPL_TYPE_UNIQUE,
7214 .state = WREPL_STATE_ACTIVE,
7215 .node = WREPL_NODE_B,
7217 .num_ips = ARRAY_SIZE(addresses_B_1),
7218 .ips = addresses_B_1,
7219 .apply_expected = True
7223 * mhomed,active vs. unique,tombstone with same ip(s), unchecked
7226 .line = __location__,
7227 .name = _NBT_NAME("_MA_UT_SI_U", 0x00, NULL),
7231 .num_ips = ctx->addresses_best_num,
7232 .ips = ctx->addresses_best,
7233 .apply_expected = True
7239 .type = WREPL_TYPE_UNIQUE,
7240 .state = WREPL_STATE_TOMBSTONE,
7241 .node = WREPL_NODE_B,
7243 .num_ips = ctx->addresses_best_num,
7244 .ips = ctx->addresses_best,
7245 .apply_expected = False
7249 * mhomed,active vs. unique,tombstone with different ip(s), unchecked
7252 .line = __location__,
7253 .name = _NBT_NAME("_MA_UT_DI_U", 0x00, NULL),
7257 .num_ips = ctx->addresses_best_num,
7258 .ips = ctx->addresses_best,
7259 .apply_expected = True
7265 .type = WREPL_TYPE_UNIQUE,
7266 .state = WREPL_STATE_TOMBSTONE,
7267 .node = WREPL_NODE_B,
7269 .num_ips = ARRAY_SIZE(addresses_B_1),
7270 .ips = addresses_B_1,
7271 .apply_expected = False
7275 * multi homed vs. normal group section
7278 * mhomed,active vs. group,active with same ip(s), release expected
7281 .line = __location__,
7282 .name = _NBT_NAME("_MA_GA_SI_R", 0x00, NULL),
7286 .num_ips = ctx->addresses_best_num,
7287 .ips = ctx->addresses_best,
7288 .apply_expected = True
7292 .expect_release = True,
7295 .type = WREPL_TYPE_GROUP,
7296 .state = WREPL_STATE_ACTIVE,
7297 .node = WREPL_NODE_B,
7299 .num_ips = ctx->addresses_best_num,
7300 .ips = ctx->addresses_best,
7301 .apply_expected = True
7305 * mhomed,active vs. group,active with different ip(s), release expected
7308 .line = __location__,
7309 .name = _NBT_NAME("_MA_GA_DI_R", 0x00, NULL),
7313 .num_ips = ctx->addresses_best_num,
7314 .ips = ctx->addresses_best,
7315 .apply_expected = True
7319 .expect_release = True,
7322 .type = WREPL_TYPE_GROUP,
7323 .state = WREPL_STATE_ACTIVE,
7324 .node = WREPL_NODE_B,
7326 .num_ips = ARRAY_SIZE(addresses_B_1),
7327 .ips = addresses_B_1,
7328 .apply_expected = True
7332 * mhomed,active vs. group,tombstone with same ip(s), unchecked
7335 .line = __location__,
7336 .name = _NBT_NAME("_MA_GT_SI_U", 0x00, NULL),
7340 .num_ips = ctx->addresses_best_num,
7341 .ips = ctx->addresses_best,
7342 .apply_expected = True
7348 .type = WREPL_TYPE_GROUP,
7349 .state = WREPL_STATE_TOMBSTONE,
7350 .node = WREPL_NODE_B,
7352 .num_ips = ctx->addresses_best_num,
7353 .ips = ctx->addresses_best,
7354 .apply_expected = False
7358 * mhomed,active vs. group,tombstone with different ip(s), unchecked
7361 .line = __location__,
7362 .name = _NBT_NAME("_MA_GT_DI_U", 0x00, NULL),
7366 .num_ips = ctx->addresses_best_num,
7367 .ips = ctx->addresses_best,
7368 .apply_expected = True
7374 .type = WREPL_TYPE_GROUP,
7375 .state = WREPL_STATE_TOMBSTONE,
7376 .node = WREPL_NODE_B,
7378 .num_ips = ARRAY_SIZE(addresses_B_1),
7379 .ips = addresses_B_1,
7380 .apply_expected = False
7384 * multi homed vs. special group section
7387 * mhomed,active vs. sgroup,active with same ip(s), release expected
7390 .line = __location__,
7391 .name = _NBT_NAME("_MA_SA_SI_R", 0x00, NULL),
7395 .num_ips = ctx->addresses_best_num,
7396 .ips = ctx->addresses_best,
7397 .apply_expected = True
7401 .expect_release = True,
7404 .type = WREPL_TYPE_SGROUP,
7405 .state = WREPL_STATE_ACTIVE,
7406 .node = WREPL_NODE_B,
7408 .num_ips = ctx->addresses_best_num,
7409 .ips = ctx->addresses_best,
7410 .apply_expected = True
7414 * mhomed,active vs. group,active with different ip(s), release expected
7417 .line = __location__,
7418 .name = _NBT_NAME("_MA_SA_DI_R", 0x00, NULL),
7422 .num_ips = ctx->addresses_best_num,
7423 .ips = ctx->addresses_best,
7424 .apply_expected = True
7428 .expect_release = True,
7431 .type = WREPL_TYPE_SGROUP,
7432 .state = WREPL_STATE_ACTIVE,
7433 .node = WREPL_NODE_B,
7435 .num_ips = ARRAY_SIZE(addresses_B_1),
7436 .ips = addresses_B_1,
7437 .apply_expected = True
7441 * mhomed,active vs. sgroup,tombstone with same ip(s), unchecked
7444 .line = __location__,
7445 .name = _NBT_NAME("_MA_ST_SI_U", 0x00, NULL),
7449 .num_ips = ctx->addresses_best_num,
7450 .ips = ctx->addresses_best,
7451 .apply_expected = True
7457 .type = WREPL_TYPE_SGROUP,
7458 .state = WREPL_STATE_TOMBSTONE,
7459 .node = WREPL_NODE_B,
7461 .num_ips = ctx->addresses_best_num,
7462 .ips = ctx->addresses_best,
7463 .apply_expected = False
7467 * mhomed,active vs. sgroup,tombstone with different ip(s), unchecked
7470 .line = __location__,
7471 .name = _NBT_NAME("_MA_ST_DI_U", 0x00, NULL),
7475 .num_ips = ctx->addresses_best_num,
7476 .ips = ctx->addresses_best,
7477 .apply_expected = True
7483 .type = WREPL_TYPE_SGROUP,
7484 .state = WREPL_STATE_TOMBSTONE,
7485 .node = WREPL_NODE_B,
7487 .num_ips = ARRAY_SIZE(addresses_B_1),
7488 .ips = addresses_B_1,
7489 .apply_expected = False
7493 * multi homed vs. multi homed section
7496 * mhomed,active vs. mhomed,active with same ip(s), unchecked
7499 .line = __location__,
7500 .name = _NBT_NAME("_MA_MA_SI_U", 0x00, NULL),
7504 .num_ips = ctx->addresses_best_num,
7505 .ips = ctx->addresses_best,
7506 .apply_expected = True
7512 .type = WREPL_TYPE_MHOMED,
7513 .state = WREPL_STATE_ACTIVE,
7514 .node = WREPL_NODE_B,
7516 .num_ips = ctx->addresses_best_num,
7517 .ips = ctx->addresses_best,
7518 .apply_expected = True
7522 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
7525 .line = __location__,
7526 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
7530 .num_ips = ctx->addresses_best_num,
7531 .ips = ctx->addresses_best,
7532 .apply_expected = True
7538 .type = WREPL_TYPE_MHOMED,
7539 .state = WREPL_STATE_ACTIVE,
7540 .node = WREPL_NODE_B,
7542 .num_ips = ctx->addresses_all_num,
7543 .ips = ctx->addresses_all,
7544 .apply_expected = True
7548 * mhomed,active vs. mhomed,active with different ip(s), positive response
7551 .line = __location__,
7552 .name = _NBT_NAME("_MA_MA_DI_P", 0x00, NULL),
7556 .num_ips = ctx->addresses_best_num,
7557 .ips = ctx->addresses_best,
7558 .apply_expected = True
7565 .type = WREPL_TYPE_MHOMED,
7566 .state = WREPL_STATE_ACTIVE,
7567 .node = WREPL_NODE_B,
7569 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7570 .ips = addresses_B_3_4,
7571 .apply_expected = False
7575 * mhomed,active vs. mhomed,active with different ip(s), positive response other ips
7578 .line = __location__,
7579 .name = _NBT_NAME("_MA_MA_DI_O", 0x00, NULL),
7583 .num_ips = ctx->addresses_best_num,
7584 .ips = ctx->addresses_best,
7585 .apply_expected = True
7590 .num_ips = ARRAY_SIZE(addresses_A_3_4),
7591 .ips = addresses_A_3_4,
7594 .type = WREPL_TYPE_MHOMED,
7595 .state = WREPL_STATE_ACTIVE,
7596 .node = WREPL_NODE_B,
7598 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7599 .ips = addresses_B_3_4,
7600 .apply_expected = False
7604 * mhomed,active vs. mhomed,active with different ip(s), negative response
7607 .line = __location__,
7608 .name = _NBT_NAME("_MA_MA_DI_N", 0x00, NULL),
7612 .num_ips = ctx->addresses_best_num,
7613 .ips = ctx->addresses_best,
7614 .apply_expected = True
7621 .type = WREPL_TYPE_MHOMED,
7622 .state = WREPL_STATE_ACTIVE,
7623 .node = WREPL_NODE_B,
7625 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7626 .ips = addresses_B_3_4,
7627 .apply_expected = True
7631 * mhomed,active vs. mhomed,tombstone with same ip(s), unchecked
7634 .line = __location__,
7635 .name = _NBT_NAME("_MA_MT_SI_U", 0x00, NULL),
7639 .num_ips = ctx->addresses_best_num,
7640 .ips = ctx->addresses_best,
7641 .apply_expected = True
7647 .type = WREPL_TYPE_MHOMED,
7648 .state = WREPL_STATE_TOMBSTONE,
7649 .node = WREPL_NODE_B,
7651 .num_ips = ctx->addresses_best_num,
7652 .ips = ctx->addresses_best,
7653 .apply_expected = False
7657 * mhomed,active vs. mhomed,tombstone with different ip(s), unchecked
7660 .line = __location__,
7661 .name = _NBT_NAME("_MA_MT_DI_U", 0x00, NULL),
7665 .num_ips = ctx->addresses_best_num,
7666 .ips = ctx->addresses_best,
7667 .apply_expected = True
7673 .type = WREPL_TYPE_MHOMED,
7674 .state = WREPL_STATE_TOMBSTONE,
7675 .node = WREPL_NODE_B,
7677 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7678 .ips = addresses_B_3_4,
7679 .apply_expected = False
7683 * some more multi homed test, including merging
7686 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
7689 .line = __location__,
7690 .section= "Test Replica vs. owned active: some more MHOMED combinations",
7691 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
7692 .skip = (ctx->addresses_all_num < 3),
7696 .num_ips = ctx->addresses_mhomed_num,
7697 .ips = ctx->addresses_mhomed,
7698 .apply_expected = True
7704 .type = WREPL_TYPE_MHOMED,
7705 .state = WREPL_STATE_ACTIVE,
7706 .node = WREPL_NODE_B,
7708 .num_ips = ctx->addresses_all_num,
7709 .ips = ctx->addresses_all,
7710 .apply_expected = True
7714 * mhomed,active vs. mhomed,active with same ips, unchecked
7717 .line = __location__,
7718 .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL),
7719 .skip = (ctx->addresses_mhomed_num != 2),
7723 .num_ips = ctx->addresses_mhomed_num,
7724 .ips = ctx->addresses_mhomed,
7725 .apply_expected = True
7731 .type = WREPL_TYPE_MHOMED,
7732 .state = WREPL_STATE_ACTIVE,
7733 .node = WREPL_NODE_B,
7735 .num_ips = ctx->addresses_mhomed_num,
7736 .ips = ctx->addresses_mhomed,
7737 .apply_expected = True
7741 * mhomed,active vs. mhomed,active with subset ip(s), positive response
7744 .line = __location__,
7745 .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL),
7746 .skip = (ctx->addresses_mhomed_num != 2),
7750 .num_ips = ctx->addresses_mhomed_num,
7751 .ips = ctx->addresses_mhomed,
7752 .apply_expected = True
7759 .type = WREPL_TYPE_MHOMED,
7760 .state = WREPL_STATE_ACTIVE,
7761 .node = WREPL_NODE_B,
7763 .num_ips = ctx->addresses_best_num,
7764 .ips = ctx->addresses_best,
7765 .mhomed_merge = True
7769 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with all addresses
7772 .line = __location__,
7773 .name = _NBT_NAME("_MA_MA_SB_A", 0x00, NULL),
7774 .skip = (ctx->addresses_all_num < 3),
7778 .num_ips = ctx->addresses_mhomed_num,
7779 .ips = ctx->addresses_mhomed,
7780 .apply_expected = True
7785 .num_ips = ctx->addresses_all_num,
7786 .ips = ctx->addresses_all,
7789 .type = WREPL_TYPE_MHOMED,
7790 .state = WREPL_STATE_ACTIVE,
7791 .node = WREPL_NODE_B,
7793 .num_ips = ctx->addresses_best_num,
7794 .ips = ctx->addresses_best,
7795 .mhomed_merge = True
7799 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with replicas addresses
7800 * TODO: check why the server sends a name release demand for one address?
7801 * the release demand has no effect to the database record...
7804 .line = __location__,
7805 .name = _NBT_NAME("_MA_MA_SB_C", 0x00, NULL),
7806 .skip = (ctx->addresses_all_num < 3),
7810 .num_ips = ctx->addresses_mhomed_num,
7811 .ips = ctx->addresses_mhomed,
7812 .apply_expected = True
7817 .num_ips = ctx->addresses_best_num,
7818 .ips = ctx->addresses_best,
7819 .late_release = True
7822 .type = WREPL_TYPE_MHOMED,
7823 .state = WREPL_STATE_ACTIVE,
7824 .node = WREPL_NODE_B,
7826 .num_ips = ctx->addresses_best_num,
7827 .ips = ctx->addresses_best,
7828 .apply_expected = False
7832 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with other addresses
7835 .line = __location__,
7836 .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL),
7838 .skip = (ctx->addresses_all_num < 3),
7842 .num_ips = ctx->addresses_mhomed_num,
7843 .ips = ctx->addresses_mhomed,
7844 .apply_expected = True
7849 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7850 .ips = addresses_B_3_4,
7853 .type = WREPL_TYPE_MHOMED,
7854 .state = WREPL_STATE_ACTIVE,
7855 .node = WREPL_NODE_B,
7857 .num_ips = ctx->addresses_best_num,
7858 .ips = ctx->addresses_best,
7859 .apply_expected = False
7863 * mhomed,active vs. mhomed,active with subset ip(s), negative response
7866 .line = __location__,
7867 .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL),
7868 .skip = (ctx->addresses_mhomed_num != 2),
7872 .num_ips = ctx->addresses_mhomed_num,
7873 .ips = ctx->addresses_mhomed,
7874 .apply_expected = True
7881 .type = WREPL_TYPE_MHOMED,
7882 .state = WREPL_STATE_ACTIVE,
7883 .node = WREPL_NODE_B,
7885 .num_ips = ctx->addresses_best_num,
7886 .ips = ctx->addresses_best,
7887 .apply_expected = True
7891 * some more multi homed and unique test, including merging
7894 * mhomed,active vs. unique,active with subset ip(s), positive response
7897 .line = __location__,
7898 .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations",
7899 .name = _NBT_NAME("_MA_UA_SB_A", 0x00, NULL),
7900 .skip = (ctx->addresses_all_num < 3),
7904 .num_ips = ctx->addresses_mhomed_num,
7905 .ips = ctx->addresses_mhomed,
7906 .apply_expected = True
7913 .type = WREPL_TYPE_UNIQUE,
7914 .state = WREPL_STATE_ACTIVE,
7915 .node = WREPL_NODE_B,
7917 .num_ips = ctx->addresses_best_num,
7918 .ips = ctx->addresses_best,
7919 .mhomed_merge = True
7923 * unique,active vs. unique,active with different ip(s), positive response, with all addresses
7926 .line = __location__,
7927 .name = _NBT_NAME("_UA_UA_DI_A", 0x00, NULL),
7928 .skip = (ctx->addresses_all_num < 3),
7932 .num_ips = ctx->addresses_best_num,
7933 .ips = ctx->addresses_best,
7934 .apply_expected = True
7939 .num_ips = ctx->addresses_all_num,
7940 .ips = ctx->addresses_all,
7943 .type = WREPL_TYPE_UNIQUE,
7944 .state = WREPL_STATE_ACTIVE,
7945 .node = WREPL_NODE_B,
7947 .num_ips = ctx->addresses_best2_num,
7948 .ips = ctx->addresses_best2,
7949 .mhomed_merge = True,
7953 * unique,active vs. mhomed,active with different ip(s), positive response, with all addresses
7956 .line = __location__,
7957 .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL),
7958 .skip = (ctx->addresses_all_num < 3),
7962 .num_ips = ctx->addresses_best_num,
7963 .ips = ctx->addresses_best,
7964 .apply_expected = True
7969 .num_ips = ctx->addresses_all_num,
7970 .ips = ctx->addresses_all,
7973 .type = WREPL_TYPE_MHOMED,
7974 .state = WREPL_STATE_ACTIVE,
7975 .node = WREPL_NODE_B,
7977 .num_ips = ctx->addresses_best2_num,
7978 .ips = ctx->addresses_best2,
7979 .mhomed_merge = True,
7983 * special group vs. special group merging section
7986 * sgroup,active vs. sgroup,active with same ip(s)
7989 .line = __location__,
7990 .section= "Test Replica vs. owned active: SGROUP vs. SGROUP tests",
7991 .name = _NBT_NAME("_SA_SA_DI_U", 0x1C, NULL),
7992 .skip = (ctx->addresses_all_num < 3),
7994 .nb_flags = NBT_NM_GROUP,
7996 .num_ips = ctx->addresses_mhomed_num,
7997 .ips = ctx->addresses_mhomed,
7998 .apply_expected = True
8004 .type = WREPL_TYPE_SGROUP,
8005 .state = WREPL_STATE_ACTIVE,
8006 .node = WREPL_NODE_B,
8008 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8009 .ips = addresses_B_3_4,
8010 .sgroup_merge = True
8015 if (!ctx) return False;
8017 if (!ctx->nbtsock_srv) {
8018 printf("SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
8023 printf("Test Replica records vs. owned active records\n");
8025 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
8027 struct test_conflict_owned_active_vs_replica_struct record = records[i];
8028 uint32_t j, count = 1;
8031 if (records[i].wins.mhomed || records[i].name.type == 0x1C) {
8032 count = records[i].wins.num_ips;
8035 if (records[i].section) {
8036 printf("%s\n", records[i].section);
8039 if (records[i].skip) {
8040 printf("%s => SKIPPED\n", nbt_name_string(ctx, &records[i].name));
8044 if (records[i].replica.mhomed_merge) {
8045 action = "MHOMED_MERGE";
8046 } else if (records[i].replica.sgroup_merge) {
8047 action = "SGROUP_MERGE";
8048 } else if (records[i].replica.apply_expected) {
8051 action = "NOT REPLACE";
8054 printf("%s => %s\n", nbt_name_string(ctx, &records[i].name), action);
8056 /* Prepare for multi homed registration */
8057 ZERO_STRUCT(records[i].defend);
8058 records[i].defend.timeout = 10;
8059 records[i].defend.positive = True;
8060 nbt_set_incoming_handler(ctx->nbtsock_srv,
8061 test_conflict_owned_active_vs_replica_handler,
8063 if (ctx->nbtsock_srv2) {
8064 nbt_set_incoming_handler(ctx->nbtsock_srv2,
8065 test_conflict_owned_active_vs_replica_handler,
8072 for (j=0; j < count; j++) {
8073 struct nbt_name_request *req;
8075 name_register->in.name = records[i].name;
8076 name_register->in.dest_addr = ctx->address;
8077 name_register->in.address = records[i].wins.ips[j].ip;
8078 name_register->in.nb_flags = records[i].wins.nb_flags;
8079 name_register->in.register_demand= False;
8080 name_register->in.broadcast = False;
8081 name_register->in.multi_homed = records[i].wins.mhomed;
8082 name_register->in.ttl = 300000;
8083 name_register->in.timeout = 70;
8084 name_register->in.retries = 0;
8086 req = nbt_name_register_send(ctx->nbtsock, name_register);
8088 /* push the request on the wire */
8089 event_loop_once(ctx->nbtsock->event_ctx);
8092 * if we register multiple addresses,
8093 * the server will do name queries to see if the old addresses
8096 if (records[i].wins.mhomed && j > 0) {
8097 end = timeval_current_ofs(records[i].defend.timeout,0);
8098 records[i].defend.ret = True;
8099 while (records[i].defend.timeout > 0) {
8100 event_loop_once(ctx->nbtsock_srv->event_ctx);
8101 if (timeval_expired(&end)) break;
8103 ret &= records[i].defend.ret;
8106 status = nbt_name_register_recv(req, ctx, name_register);
8107 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
8108 printf("No response from %s for name register\n", ctx->address);
8111 if (!NT_STATUS_IS_OK(status)) {
8112 printf("Bad response from %s for name register - %s\n",
8113 ctx->address, nt_errstr(status));
8116 CHECK_VALUE(name_register->out.rcode, 0);
8117 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
8118 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
8119 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
8120 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
8121 CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[j].ip);
8124 /* Prepare for the current test */
8125 records[i].defend = record.defend;
8126 nbt_set_incoming_handler(ctx->nbtsock_srv,
8127 test_conflict_owned_active_vs_replica_handler,
8129 if (ctx->nbtsock_srv2) {
8130 nbt_set_incoming_handler(ctx->nbtsock_srv2,
8131 test_conflict_owned_active_vs_replica_handler,
8138 wins_name->name = &records[i].name;
8139 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
8140 records[i].replica.state,
8141 records[i].replica.node,
8142 records[i].replica.is_static);
8143 wins_name->id = ++ctx->b.max_version;
8144 if (wins_name->flags & 2) {
8145 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
8146 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
8148 wins_name->addresses.ip = records[i].replica.ips[0].ip;
8150 wins_name->unknown = "255.255.255.255";
8152 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
8155 * wait for the name query, which is handled in
8156 * test_conflict_owned_active_vs_replica_handler()
8158 end = timeval_current_ofs(records[i].defend.timeout,0);
8159 records[i].defend.ret = True;
8160 while (records[i].defend.timeout > 0) {
8161 event_loop_once(ctx->nbtsock_srv->event_ctx);
8162 if (timeval_expired(&end)) break;
8164 ret &= records[i].defend.ret;
8166 if (records[i].defend.late_release) {
8167 records[i].defend = record.defend;
8168 records[i].defend.expect_release = True;
8170 * wait for the name release demand, which is handled in
8171 * test_conflict_owned_active_vs_replica_handler()
8173 end = timeval_current_ofs(records[i].defend.timeout,0);
8174 records[i].defend.ret = True;
8175 while (records[i].defend.timeout > 0) {
8176 event_loop_once(ctx->nbtsock_srv->event_ctx);
8177 if (timeval_expired(&end)) break;
8179 ret &= records[i].defend.ret;
8182 if (records[i].replica.mhomed_merge) {
8183 ret &= test_wrepl_mhomed_merged(ctx, &ctx->c,
8184 records[i].wins.num_ips, records[i].wins.ips,
8186 records[i].replica.num_ips, records[i].replica.ips,
8188 } else if (records[i].replica.sgroup_merge) {
8189 ret &= test_wrepl_sgroup_merged(ctx, &ctx->c,
8190 records[i].wins.num_ips, records[i].wins.ips,
8192 records[i].replica.num_ips, records[i].replica.ips,
8195 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
8196 records[i].replica.apply_expected);
8199 if (records[i].replica.apply_expected ||
8200 records[i].replica.mhomed_merge) {
8201 wins_name->name = &records[i].name;
8202 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
8203 WREPL_STATE_TOMBSTONE,
8204 WREPL_NODE_B, False);
8205 wins_name->id = ++ctx->b.max_version;
8206 wins_name->addresses.ip = addresses_B_1[0].ip;
8207 wins_name->unknown = "255.255.255.255";
8209 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
8210 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
8212 for (j=0; j < count; j++) {
8213 struct nbt_name_socket *nbtsock = ctx->nbtsock;
8215 if (ctx->myaddr && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2) == 0) {
8216 nbtsock = ctx->nbtsock2;
8219 release->in.name = records[i].name;
8220 release->in.dest_addr = ctx->address;
8221 release->in.address = records[i].wins.ips[j].ip;
8222 release->in.nb_flags = records[i].wins.nb_flags;
8223 release->in.broadcast = False;
8224 release->in.timeout = 30;
8225 release->in.retries = 0;
8227 status = nbt_name_release(nbtsock, ctx, release);
8228 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
8229 printf("No response from %s for name release\n", ctx->address);
8232 if (!NT_STATUS_IS_OK(status)) {
8233 printf("Bad response from %s for name query - %s\n",
8234 ctx->address, nt_errstr(status));
8237 CHECK_VALUE(release->out.rcode, 0);
8240 if (records[i].replica.sgroup_merge) {
8241 /* clean up the SGROUP record */
8242 wins_name->name = &records[i].name;
8243 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
8245 WREPL_NODE_B, False);
8246 wins_name->id = ++ctx->b.max_version;
8247 wins_name->addresses.addresses.num_ips = 0;
8248 wins_name->addresses.addresses.ips = NULL;
8249 wins_name->unknown = "255.255.255.255";
8250 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
8252 /* take ownership of the SGROUP record */
8253 wins_name->name = &records[i].name;
8254 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
8256 WREPL_NODE_B, False);
8257 wins_name->id = ++ctx->b.max_version;
8258 wins_name->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
8259 wins_name->addresses.addresses.ips = discard_const(addresses_B_1);
8260 wins_name->unknown = "255.255.255.255";
8261 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
8262 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
8264 /* overwrite the SGROUP record with unique,tombstone */
8265 wins_name->name = &records[i].name;
8266 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
8267 WREPL_STATE_TOMBSTONE,
8268 WREPL_NODE_B, False);
8269 wins_name->id = ++ctx->b.max_version;
8270 wins_name->addresses.ip = addresses_A_1[0].ip;
8271 wins_name->unknown = "255.255.255.255";
8272 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
8273 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
8279 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
8287 #define _NBT_ASSERT(v, correct) do { \
8288 if ((v) != (correct)) { \
8289 printf("(%s) Incorrect value %s=%d - should be %s (%d)\n", \
8290 __location__, #v, v, #correct, correct); \
8295 #define _NBT_ASSERT_STRING(v, correct) do { \
8296 if ( ((!v) && (correct)) || \
8297 ((v) && (!correct)) || \
8298 ((v) && (correct) && strcmp(v,correct) != 0)) { \
8299 printf("(%s) Incorrect value %s=%s - should be %s\n", \
8300 __location__, #v, v, correct); \
8305 static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
8306 struct nbt_name_packet *req_packet,
8307 const struct nbt_peer_socket *src)
8309 struct nbt_name *name;
8310 struct nbt_name_packet *rep_packet;
8311 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
8313 _NBT_ASSERT(req_packet->qdcount, 1);
8314 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
8315 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
8317 name = &req_packet->questions[0].name;
8319 _NBT_ASSERT(name->type, rec->name.type);
8320 _NBT_ASSERT_STRING(name->name, rec->name.name);
8321 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
8323 _NBT_ASSERT(rec->defend.expect_release, False);
8325 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
8326 if (rep_packet == NULL) return;
8328 rep_packet->name_trn_id = req_packet->name_trn_id;
8329 rep_packet->ancount = 1;
8331 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
8332 if (rep_packet->answers == NULL) return;
8334 rep_packet->answers[0].name = *name;
8335 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
8336 rep_packet->answers[0].ttl = 0;
8338 if (rec->defend.positive) {
8339 uint32_t i, num_ips;
8340 const struct wrepl_ip *ips;
8342 if (rec->defend.num_ips > 0) {
8343 num_ips = rec->defend.num_ips;
8344 ips = rec->defend.ips;
8346 num_ips = rec->wins.num_ips;
8347 ips = rec->wins.ips;
8350 /* send a positive reply */
8351 rep_packet->operation =
8354 NBT_FLAG_AUTHORITIVE |
8355 NBT_FLAG_RECURSION_DESIRED |
8356 NBT_FLAG_RECURSION_AVAIL;
8358 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
8360 rep_packet->answers[0].rdata.netbios.length = num_ips*6;
8361 rep_packet->answers[0].rdata.netbios.addresses =
8362 talloc_array(rep_packet->answers, struct nbt_rdata_address, num_ips);
8363 if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return;
8365 for (i=0; i < num_ips; i++) {
8366 struct nbt_rdata_address *addr =
8367 &rep_packet->answers[0].rdata.netbios.addresses[i];
8368 addr->nb_flags = rec->wins.nb_flags;
8369 addr->ipaddr = ips[i].ip;
8371 DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
8372 nbt_name_string(rep_packet, name), src->addr, src->port));
8374 /* send a negative reply */
8375 rep_packet->operation =
8378 NBT_FLAG_AUTHORITIVE |
8381 rep_packet->answers[0].rr_type = NBT_QTYPE_NULL;
8383 ZERO_STRUCT(rep_packet->answers[0].rdata);
8385 DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
8386 nbt_name_string(rep_packet, name), src->addr, src->port));
8389 nbt_name_reply_send(nbtsock, src, rep_packet);
8390 talloc_free(rep_packet);
8392 /* make sure we push the reply to the wire */
8393 event_loop_once(nbtsock->event_ctx);
8395 rec->defend.timeout = 0;
8396 rec->defend.ret = True;
8399 static void test_conflict_owned_active_vs_replica_handler_release(struct nbt_name_socket *nbtsock,
8400 struct nbt_name_packet *req_packet,
8401 const struct nbt_peer_socket *src)
8403 struct nbt_name *name;
8404 struct nbt_name_packet *rep_packet;
8405 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
8407 _NBT_ASSERT(req_packet->qdcount, 1);
8408 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
8409 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
8411 name = &req_packet->questions[0].name;
8413 _NBT_ASSERT(name->type, rec->name.type);
8414 _NBT_ASSERT_STRING(name->name, rec->name.name);
8415 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
8417 _NBT_ASSERT(rec->defend.expect_release, True);
8419 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
8420 if (rep_packet == NULL) return;
8422 rep_packet->name_trn_id = req_packet->name_trn_id;
8423 rep_packet->ancount = 1;
8424 rep_packet->operation =
8426 NBT_OPCODE_RELEASE |
8427 NBT_FLAG_AUTHORITIVE;
8429 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
8430 if (rep_packet->answers == NULL) return;
8432 rep_packet->answers[0].name = *name;
8433 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
8434 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
8435 rep_packet->answers[0].ttl = req_packet->additional[0].ttl;
8436 rep_packet->answers[0].rdata = req_packet->additional[0].rdata;
8438 DEBUG(2,("Sending name release reply for %s to %s:%d\n",
8439 nbt_name_string(rep_packet, name), src->addr, src->port));
8441 nbt_name_reply_send(nbtsock, src, rep_packet);
8442 talloc_free(rep_packet);
8444 /* make sure we push the reply to the wire */
8445 event_loop_once(nbtsock->event_ctx);
8447 rec->defend.timeout = 0;
8448 rec->defend.ret = True;
8451 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
8452 struct nbt_name_packet *req_packet,
8453 const struct nbt_peer_socket *src)
8455 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
8457 rec->defend.ret = False;
8459 switch (req_packet->operation & NBT_OPCODE) {
8460 case NBT_OPCODE_QUERY:
8461 test_conflict_owned_active_vs_replica_handler_query(nbtsock, req_packet, src);
8463 case NBT_OPCODE_RELEASE:
8464 test_conflict_owned_active_vs_replica_handler_release(nbtsock, req_packet, src);
8467 printf("%s: unexpected incoming packet\n", __location__);
8473 test WINS replication operations
8475 BOOL torture_nbt_winsreplication_quick(void)
8477 const char *address;
8478 struct nbt_name name;
8479 TALLOC_CTX *mem_ctx = talloc_new(NULL);
8483 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
8485 /* do an initial name resolution to find its IP */
8486 status = resolve_name(&name, mem_ctx, &address, NULL);
8487 if (!NT_STATUS_IS_OK(status)) {
8488 printf("Failed to resolve %s - %s\n",
8489 name.name, nt_errstr(status));
8490 talloc_free(mem_ctx);
8494 ret &= test_assoc_ctx1(mem_ctx, address);
8495 ret &= test_assoc_ctx2(mem_ctx, address);
8497 ret &= test_wins_replication(mem_ctx, address);
8499 talloc_free(mem_ctx);
8505 test WINS replication operations
8507 BOOL torture_nbt_winsreplication(void)
8509 const char *address;
8510 struct nbt_name name;
8511 TALLOC_CTX *mem_ctx = talloc_new(NULL);
8514 struct test_wrepl_conflict_conn *ctx;
8516 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
8518 /* do an initial name resolution to find its IP */
8519 status = resolve_name(&name, mem_ctx, &address, NULL);
8520 if (!NT_STATUS_IS_OK(status)) {
8521 printf("Failed to resolve %s - %s\n",
8522 name.name, nt_errstr(status));
8523 talloc_free(mem_ctx);
8527 ret &= test_assoc_ctx1(mem_ctx, address);
8528 ret &= test_assoc_ctx2(mem_ctx, address);
8530 ret &= test_wins_replication(mem_ctx, address);
8532 ctx = test_create_conflict_ctx(mem_ctx, address);
8534 ret &= test_conflict_same_owner(ctx);
8535 ret &= test_conflict_different_owner(ctx);
8536 ret &= test_conflict_owned_released_vs_replica(ctx);
8537 ret &= test_conflict_owned_active_vs_replica(ctx);
8539 talloc_free(mem_ctx);