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_is_merged(struct test_wrepl_conflict_conn *ctx,
805 const struct wrepl_wins_name *name1,
806 const struct wrepl_wins_name *name2)
812 struct wrepl_pull_names pull_names;
813 struct wrepl_name *names;
816 pull_names.in.assoc_ctx = ctx->pull_assoc;
817 pull_names.in.partner = ctx->c;
818 pull_names.in.partner.min_version = ctx->c.max_version-1;
820 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
821 CHECK_STATUS(status, NT_STATUS_OK);
822 CHECK_VALUE(pull_names.out.num_names, 1);
824 names = pull_names.out.names;
826 num_ips = name1->addresses.addresses.num_ips + name2->addresses.addresses.num_ips;
828 CHECK_VALUE(names[0].name.type, name1->name->type);
829 CHECK_VALUE_STRING(names[0].name.name, name1->name->name);
830 CHECK_VALUE_STRING(names[0].name.scope, name1->name->scope);
831 CHECK_VALUE(names[0].type, WREPL_TYPE_SGROUP);
832 CHECK_VALUE(names[0].state, (num_ips>0?WREPL_STATE_ACTIVE:WREPL_STATE_RELEASED));
833 CHECK_VALUE_UINT64(names[0].version_id, ctx->c.max_version);
835 CHECK_VALUE(names[0].num_addresses,
836 name1->addresses.addresses.num_ips+
837 name2->addresses.addresses.num_ips);
839 talloc_free(pull_names.out.names);
844 static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx)
847 struct nbt_name name;
848 struct wrepl_wins_name wins_name1;
849 struct wrepl_wins_name wins_name2;
850 struct wrepl_wins_name *wins_name_tmp;
851 struct wrepl_wins_name *wins_name_last;
852 struct wrepl_wins_name *wins_name_cur;
854 uint8_t types[] = { 0x00, 0x1C };
856 enum wrepl_name_type type;
857 enum wrepl_name_state state;
858 enum wrepl_name_node node;
861 const struct wrepl_ip *ips;
864 .type = WREPL_TYPE_GROUP,
865 .state = WREPL_STATE_ACTIVE,
866 .node = WREPL_NODE_B,
868 .num_ips = ARRAY_SIZE(addresses_A_1),
869 .ips = addresses_A_1,
871 .type = WREPL_TYPE_UNIQUE,
872 .state = WREPL_STATE_ACTIVE,
873 .node = WREPL_NODE_B,
875 .num_ips = ARRAY_SIZE(addresses_A_1),
876 .ips = addresses_A_1,
878 .type = WREPL_TYPE_UNIQUE,
879 .state = WREPL_STATE_ACTIVE,
880 .node = WREPL_NODE_B,
882 .num_ips = ARRAY_SIZE(addresses_A_2),
883 .ips = addresses_A_2,
885 .type = WREPL_TYPE_UNIQUE,
886 .state = WREPL_STATE_ACTIVE,
887 .node = WREPL_NODE_B,
889 .num_ips = ARRAY_SIZE(addresses_A_1),
890 .ips = addresses_A_1,
892 .type = WREPL_TYPE_UNIQUE,
893 .state = WREPL_STATE_ACTIVE,
894 .node = WREPL_NODE_B,
896 .num_ips = ARRAY_SIZE(addresses_A_2),
897 .ips = addresses_A_2,
899 .type = WREPL_TYPE_SGROUP,
900 .state = WREPL_STATE_TOMBSTONE,
901 .node = WREPL_NODE_B,
903 .num_ips = ARRAY_SIZE(addresses_A_2),
904 .ips = addresses_A_2,
906 .type = WREPL_TYPE_MHOMED,
907 .state = WREPL_STATE_TOMBSTONE,
908 .node = WREPL_NODE_B,
910 .num_ips = ARRAY_SIZE(addresses_A_1),
911 .ips = addresses_A_1,
913 .type = WREPL_TYPE_MHOMED,
914 .state = WREPL_STATE_RELEASED,
915 .node = WREPL_NODE_B,
917 .num_ips = ARRAY_SIZE(addresses_A_2),
918 .ips = addresses_A_2,
920 .type = WREPL_TYPE_SGROUP,
921 .state = WREPL_STATE_ACTIVE,
922 .node = WREPL_NODE_B,
924 .num_ips = ARRAY_SIZE(addresses_A_1),
925 .ips = addresses_A_1,
927 .type = WREPL_TYPE_SGROUP,
928 .state = WREPL_STATE_ACTIVE,
929 .node = WREPL_NODE_B,
931 .num_ips = ARRAY_SIZE(addresses_A_3_4),
932 .ips = addresses_A_3_4,
934 .type = WREPL_TYPE_SGROUP,
935 .state = WREPL_STATE_TOMBSTONE,
936 .node = WREPL_NODE_B,
938 .num_ips = ARRAY_SIZE(addresses_B_3_4),
939 .ips = addresses_B_3_4,
941 /* the last one should always be a unique,tomstone record! */
942 .type = WREPL_TYPE_UNIQUE,
943 .state = WREPL_STATE_TOMBSTONE,
944 .node = WREPL_NODE_B,
946 .num_ips = ARRAY_SIZE(addresses_A_1),
947 .ips = addresses_A_1,
951 if (!ctx) return False;
953 name.name = "_SAME_OWNER_A";
957 wins_name_tmp = NULL;
958 wins_name_last = &wins_name2;
959 wins_name_cur = &wins_name1;
961 for (j=0; ret && j < ARRAY_SIZE(types); j++) {
962 name.type = types[j];
963 printf("Test Replica Conflicts with same owner[%s] for %s\n",
964 nbt_name_string(ctx, &name), ctx->a.address);
966 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
967 wins_name_tmp = wins_name_last;
968 wins_name_last = wins_name_cur;
969 wins_name_cur = wins_name_tmp;
972 printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
973 wrepl_name_type_string(records[i-1].type),
974 wrepl_name_state_string(records[i-1].state),
975 (records[i-1].is_static?",static":""),
976 wrepl_name_type_string(records[i].type),
977 wrepl_name_state_string(records[i].state),
978 (records[i].is_static?",static":""),
979 (records[i-1].ips==records[i].ips?"same":"different"),
983 wins_name_cur->name = &name;
984 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
987 records[i].is_static);
988 wins_name_cur->id = ++ctx->a.max_version;
989 if (wins_name_cur->flags & 2) {
990 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
991 wins_name_cur->addresses.addresses.ips = discard_const(records[i].ips);
993 wins_name_cur->addresses.ip = records[i].ips[0].ip;
995 wins_name_cur->unknown = "255.255.255.255";
997 ret &= test_wrepl_update_one(ctx, &ctx->a,wins_name_cur);
998 if (records[i].state == WREPL_STATE_RELEASED) {
999 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_last, False);
1000 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, False);
1002 ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, True);
1005 /* the first one is a cleanup run */
1006 if (!ret && i == 0) ret = True;
1009 printf("conflict handled wrong or record[%u]: %s\n", i, __location__);
1017 static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx)
1020 struct wrepl_wins_name wins_name1;
1021 struct wrepl_wins_name wins_name2;
1022 struct wrepl_wins_name *wins_name_r1;
1023 struct wrepl_wins_name *wins_name_r2;
1026 const char *line; /* just better debugging */
1027 struct nbt_name name;
1028 BOOL extra; /* not the worst case, this is an extra test */
1031 struct wrepl_wins_owner *owner;
1032 enum wrepl_name_type type;
1033 enum wrepl_name_state state;
1034 enum wrepl_name_node node;
1037 const struct wrepl_ip *ips;
1038 BOOL apply_expected;
1039 BOOL merge_expected;
1043 * NOTE: the first record and the last applied one
1044 * needs to be from the same owner,
1045 * to not conflict in the next smbtorture run!!!
1048 .line = __location__,
1049 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1053 .type = WREPL_TYPE_UNIQUE,
1054 .state = WREPL_STATE_TOMBSTONE,
1055 .node = WREPL_NODE_B,
1057 .num_ips = ARRAY_SIZE(addresses_B_1),
1058 .ips = addresses_B_1,
1059 .apply_expected = True /* ignored */
1063 .type = WREPL_TYPE_UNIQUE,
1064 .state = WREPL_STATE_TOMBSTONE,
1065 .node = WREPL_NODE_B,
1067 .num_ips = ARRAY_SIZE(addresses_A_1),
1068 .ips = addresses_A_1,
1069 .apply_expected = True /* ignored */
1074 * unique vs unique section
1077 * unique,active vs. unique,active
1078 * => should be replaced
1081 .line = __location__,
1082 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1085 .type = WREPL_TYPE_UNIQUE,
1086 .state = WREPL_STATE_ACTIVE,
1087 .node = WREPL_NODE_B,
1089 .num_ips = ARRAY_SIZE(addresses_A_1),
1090 .ips = addresses_A_1,
1091 .apply_expected = True
1095 .type = WREPL_TYPE_UNIQUE,
1096 .state = WREPL_STATE_ACTIVE,
1097 .node = WREPL_NODE_B,
1099 .num_ips = ARRAY_SIZE(addresses_B_1),
1100 .ips = addresses_B_1,
1101 .apply_expected = True
1106 * unique,active vs. unique,tombstone
1107 * => should NOT be replaced
1110 .line = __location__,
1111 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1114 .type = WREPL_TYPE_UNIQUE,
1115 .state = WREPL_STATE_ACTIVE,
1116 .node = WREPL_NODE_B,
1118 .num_ips = ARRAY_SIZE(addresses_B_1),
1119 .ips = addresses_B_1,
1120 .apply_expected = True
1124 .type = WREPL_TYPE_UNIQUE,
1125 .state = WREPL_STATE_TOMBSTONE,
1126 .node = WREPL_NODE_B,
1128 .num_ips = ARRAY_SIZE(addresses_B_1),
1129 .ips = addresses_B_1,
1130 .apply_expected = False
1135 * unique,released vs. unique,active
1136 * => should be replaced
1139 .line = __location__,
1140 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1143 .type = WREPL_TYPE_UNIQUE,
1144 .state = WREPL_STATE_RELEASED,
1145 .node = WREPL_NODE_B,
1147 .num_ips = ARRAY_SIZE(addresses_B_1),
1148 .ips = addresses_B_1,
1149 .apply_expected = False
1153 .type = WREPL_TYPE_UNIQUE,
1154 .state = WREPL_STATE_ACTIVE,
1155 .node = WREPL_NODE_B,
1157 .num_ips = ARRAY_SIZE(addresses_A_1),
1158 .ips = addresses_A_1,
1159 .apply_expected = True
1164 * unique,released vs. unique,tombstone
1165 * => should be replaced
1168 .line = __location__,
1169 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1172 .type = WREPL_TYPE_UNIQUE,
1173 .state = WREPL_STATE_RELEASED,
1174 .node = WREPL_NODE_B,
1176 .num_ips = ARRAY_SIZE(addresses_A_1),
1177 .ips = addresses_A_1,
1178 .apply_expected = False
1182 .type = WREPL_TYPE_UNIQUE,
1183 .state = WREPL_STATE_TOMBSTONE,
1184 .node = WREPL_NODE_B,
1186 .num_ips = ARRAY_SIZE(addresses_B_1),
1187 .ips = addresses_B_1,
1188 .apply_expected = True
1193 * unique,tombstone vs. unique,active
1194 * => should be replaced
1197 .line = __location__,
1198 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1201 .type = WREPL_TYPE_UNIQUE,
1202 .state = WREPL_STATE_TOMBSTONE,
1203 .node = WREPL_NODE_B,
1205 .num_ips = ARRAY_SIZE(addresses_B_1),
1206 .ips = addresses_B_1,
1207 .apply_expected = True
1211 .type = WREPL_TYPE_UNIQUE,
1212 .state = WREPL_STATE_ACTIVE,
1213 .node = WREPL_NODE_B,
1215 .num_ips = ARRAY_SIZE(addresses_A_1),
1216 .ips = addresses_A_1,
1217 .apply_expected = True
1222 * unique,tombstone vs. unique,tombstone
1223 * => should be replaced
1226 .line = __location__,
1227 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1230 .type = WREPL_TYPE_UNIQUE,
1231 .state = WREPL_STATE_TOMBSTONE,
1232 .node = WREPL_NODE_B,
1234 .num_ips = ARRAY_SIZE(addresses_A_1),
1235 .ips = addresses_A_1,
1236 .apply_expected = True
1240 .type = WREPL_TYPE_UNIQUE,
1241 .state = WREPL_STATE_TOMBSTONE,
1242 .node = WREPL_NODE_B,
1244 .num_ips = ARRAY_SIZE(addresses_B_1),
1245 .ips = addresses_B_1,
1246 .apply_expected = True
1252 * unique vs normal groups section,
1255 * unique,active vs. group,active
1256 * => should be replaced
1259 .line = __location__,
1260 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1263 .type = WREPL_TYPE_UNIQUE,
1264 .state = WREPL_STATE_ACTIVE,
1265 .node = WREPL_NODE_B,
1267 .num_ips = ARRAY_SIZE(addresses_B_1),
1268 .ips = addresses_B_1,
1269 .apply_expected = True
1273 .type = WREPL_TYPE_GROUP,
1274 .state = WREPL_STATE_ACTIVE,
1275 .node = WREPL_NODE_B,
1277 .num_ips = ARRAY_SIZE(addresses_A_1),
1278 .ips = addresses_A_1,
1279 .apply_expected = True
1284 * unique,active vs. group,tombstone
1285 * => should NOT be replaced
1288 .line = __location__,
1289 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1292 .type = WREPL_TYPE_UNIQUE,
1293 .state = WREPL_STATE_ACTIVE,
1294 .node = WREPL_NODE_B,
1296 .num_ips = ARRAY_SIZE(addresses_A_1),
1297 .ips = addresses_A_1,
1298 .apply_expected = True
1302 .type = WREPL_TYPE_GROUP,
1303 .state = WREPL_STATE_TOMBSTONE,
1304 .node = WREPL_NODE_B,
1306 .num_ips = ARRAY_SIZE(addresses_A_1),
1307 .ips = addresses_A_1,
1308 .apply_expected = False
1313 * unique,released vs. group,active
1314 * => should be replaced
1317 .line = __location__,
1318 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1321 .type = WREPL_TYPE_UNIQUE,
1322 .state = WREPL_STATE_RELEASED,
1323 .node = WREPL_NODE_B,
1325 .num_ips = ARRAY_SIZE(addresses_A_1),
1326 .ips = addresses_A_1,
1327 .apply_expected = False
1331 .type = WREPL_TYPE_GROUP,
1332 .state = WREPL_STATE_ACTIVE,
1333 .node = WREPL_NODE_B,
1335 .num_ips = ARRAY_SIZE(addresses_B_1),
1336 .ips = addresses_B_1,
1337 .apply_expected = True
1342 * unique,released vs. group,tombstone
1343 * => should be replaced
1346 .line = __location__,
1347 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1350 .type = WREPL_TYPE_UNIQUE,
1351 .state = WREPL_STATE_RELEASED,
1352 .node = WREPL_NODE_B,
1354 .num_ips = ARRAY_SIZE(addresses_B_1),
1355 .ips = addresses_B_1,
1356 .apply_expected = False
1360 .type = WREPL_TYPE_GROUP,
1361 .state = WREPL_STATE_TOMBSTONE,
1362 .node = WREPL_NODE_B,
1364 .num_ips = ARRAY_SIZE(addresses_A_1),
1365 .ips = addresses_A_1,
1366 .apply_expected = True
1371 * unique,tombstone vs. group,active
1372 * => should be replaced
1375 .line = __location__,
1376 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1379 .type = WREPL_TYPE_UNIQUE,
1380 .state = WREPL_STATE_TOMBSTONE,
1381 .node = WREPL_NODE_B,
1383 .num_ips = ARRAY_SIZE(addresses_A_1),
1384 .ips = addresses_A_1,
1385 .apply_expected = True
1389 .type = WREPL_TYPE_GROUP,
1390 .state = WREPL_STATE_ACTIVE,
1391 .node = WREPL_NODE_B,
1393 .num_ips = ARRAY_SIZE(addresses_B_1),
1394 .ips = addresses_B_1,
1395 .apply_expected = True
1400 * unique,tombstone vs. group,tombstone
1401 * => should be replaced
1404 .line = __location__,
1405 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1408 .type = WREPL_TYPE_UNIQUE,
1409 .state = WREPL_STATE_TOMBSTONE,
1410 .node = WREPL_NODE_B,
1412 .num_ips = ARRAY_SIZE(addresses_B_1),
1413 .ips = addresses_B_1,
1414 .apply_expected = True
1418 .type = WREPL_TYPE_GROUP,
1419 .state = WREPL_STATE_TOMBSTONE,
1420 .node = WREPL_NODE_B,
1422 .num_ips = ARRAY_SIZE(addresses_A_1),
1423 .ips = addresses_A_1,
1424 .apply_expected = True
1429 * unique vs special groups section,
1432 * unique,active vs. sgroup,active
1433 * => should NOT be replaced
1436 .line = __location__,
1437 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1440 .type = WREPL_TYPE_UNIQUE,
1441 .state = WREPL_STATE_ACTIVE,
1442 .node = WREPL_NODE_B,
1444 .num_ips = ARRAY_SIZE(addresses_A_1),
1445 .ips = addresses_A_1,
1446 .apply_expected = True
1450 .type = WREPL_TYPE_SGROUP,
1451 .state = WREPL_STATE_ACTIVE,
1452 .node = WREPL_NODE_B,
1454 .num_ips = ARRAY_SIZE(addresses_A_1),
1455 .ips = addresses_A_1,
1456 .apply_expected = False
1461 * unique,active vs. sgroup,tombstone
1462 * => should NOT be replaced
1465 .line = __location__,
1466 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1469 .type = WREPL_TYPE_UNIQUE,
1470 .state = WREPL_STATE_ACTIVE,
1471 .node = WREPL_NODE_B,
1473 .num_ips = ARRAY_SIZE(addresses_A_1),
1474 .ips = addresses_A_1,
1475 .apply_expected = True
1479 .type = WREPL_TYPE_SGROUP,
1480 .state = WREPL_STATE_TOMBSTONE,
1481 .node = WREPL_NODE_B,
1483 .num_ips = ARRAY_SIZE(addresses_A_1),
1484 .ips = addresses_A_1,
1485 .apply_expected = False
1490 * unique,released vs. sgroup,active
1491 * => should be replaced
1494 .line = __location__,
1495 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1498 .type = WREPL_TYPE_UNIQUE,
1499 .state = WREPL_STATE_RELEASED,
1500 .node = WREPL_NODE_B,
1502 .num_ips = ARRAY_SIZE(addresses_A_1),
1503 .ips = addresses_A_1,
1504 .apply_expected = False
1508 .type = WREPL_TYPE_SGROUP,
1509 .state = WREPL_STATE_ACTIVE,
1510 .node = WREPL_NODE_B,
1512 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1513 .ips = addresses_B_3_4,
1514 .apply_expected = True
1519 * unique,released vs. sgroup,tombstone
1520 * => should be replaced
1523 .line = __location__,
1524 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1527 .type = WREPL_TYPE_UNIQUE,
1528 .state = WREPL_STATE_RELEASED,
1529 .node = WREPL_NODE_B,
1531 .num_ips = ARRAY_SIZE(addresses_B_1),
1532 .ips = addresses_B_1,
1533 .apply_expected = False
1537 .type = WREPL_TYPE_SGROUP,
1538 .state = WREPL_STATE_TOMBSTONE,
1539 .node = WREPL_NODE_B,
1541 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1542 .ips = addresses_A_3_4,
1543 .apply_expected = True
1548 * unique,tombstone vs. sgroup,active
1549 * => should be replaced
1552 .line = __location__,
1553 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1556 .type = WREPL_TYPE_UNIQUE,
1557 .state = WREPL_STATE_TOMBSTONE,
1558 .node = WREPL_NODE_B,
1560 .num_ips = ARRAY_SIZE(addresses_A_1),
1561 .ips = addresses_A_1,
1562 .apply_expected = True
1566 .type = WREPL_TYPE_SGROUP,
1567 .state = WREPL_STATE_ACTIVE,
1568 .node = WREPL_NODE_B,
1570 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1571 .ips = addresses_B_3_4,
1572 .apply_expected = True
1577 * unique,tombstone vs. sgroup,tombstone
1578 * => should be replaced
1581 .line = __location__,
1582 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1585 .type = WREPL_TYPE_UNIQUE,
1586 .state = WREPL_STATE_TOMBSTONE,
1587 .node = WREPL_NODE_B,
1589 .num_ips = ARRAY_SIZE(addresses_B_1),
1590 .ips = addresses_B_1,
1591 .apply_expected = True
1595 .type = WREPL_TYPE_SGROUP,
1596 .state = WREPL_STATE_TOMBSTONE,
1597 .node = WREPL_NODE_B,
1599 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1600 .ips = addresses_A_3_4,
1601 .apply_expected = True
1606 * unique vs multi homed section,
1609 * unique,active vs. mhomed,active
1610 * => should be replaced
1613 .line = __location__,
1614 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1617 .type = WREPL_TYPE_UNIQUE,
1618 .state = WREPL_STATE_ACTIVE,
1619 .node = WREPL_NODE_B,
1621 .num_ips = ARRAY_SIZE(addresses_A_1),
1622 .ips = addresses_A_1,
1623 .apply_expected = True
1627 .type = WREPL_TYPE_MHOMED,
1628 .state = WREPL_STATE_ACTIVE,
1629 .node = WREPL_NODE_B,
1631 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1632 .ips = addresses_B_3_4,
1633 .apply_expected = True
1638 * unique,active vs. mhomed,tombstone
1639 * => should NOT be replaced
1642 .line = __location__,
1643 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1646 .type = WREPL_TYPE_UNIQUE,
1647 .state = WREPL_STATE_ACTIVE,
1648 .node = WREPL_NODE_B,
1650 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1651 .ips = addresses_B_3_4,
1652 .apply_expected = True
1656 .type = WREPL_TYPE_MHOMED,
1657 .state = WREPL_STATE_TOMBSTONE,
1658 .node = WREPL_NODE_B,
1660 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1661 .ips = addresses_B_3_4,
1662 .apply_expected = False
1667 * unique,released vs. mhomed,active
1668 * => should be replaced
1671 .line = __location__,
1672 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1675 .type = WREPL_TYPE_UNIQUE,
1676 .state = WREPL_STATE_RELEASED,
1677 .node = WREPL_NODE_B,
1679 .num_ips = ARRAY_SIZE(addresses_B_1),
1680 .ips = addresses_B_1,
1681 .apply_expected = False
1685 .type = WREPL_TYPE_MHOMED,
1686 .state = WREPL_STATE_ACTIVE,
1687 .node = WREPL_NODE_B,
1689 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1690 .ips = addresses_A_3_4,
1691 .apply_expected = True
1696 * unique,released vs. mhomed,tombstone
1697 * => should be replaced
1700 .line = __location__,
1701 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1704 .type = WREPL_TYPE_UNIQUE,
1705 .state = WREPL_STATE_RELEASED,
1706 .node = WREPL_NODE_B,
1708 .num_ips = ARRAY_SIZE(addresses_A_1),
1709 .ips = addresses_A_1,
1710 .apply_expected = False
1714 .type = WREPL_TYPE_MHOMED,
1715 .state = WREPL_STATE_TOMBSTONE,
1716 .node = WREPL_NODE_B,
1718 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1719 .ips = addresses_B_3_4,
1720 .apply_expected = True
1725 * unique,tombstone vs. mhomed,active
1726 * => should be replaced
1729 .line = __location__,
1730 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1733 .type = WREPL_TYPE_UNIQUE,
1734 .state = WREPL_STATE_TOMBSTONE,
1735 .node = WREPL_NODE_B,
1737 .num_ips = ARRAY_SIZE(addresses_B_1),
1738 .ips = addresses_B_1,
1739 .apply_expected = True
1743 .type = WREPL_TYPE_MHOMED,
1744 .state = WREPL_STATE_ACTIVE,
1745 .node = WREPL_NODE_B,
1747 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1748 .ips = addresses_A_3_4,
1749 .apply_expected = True
1754 * unique,tombstone vs. mhomed,tombstone
1755 * => should be replaced
1758 .line = __location__,
1759 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1762 .type = WREPL_TYPE_UNIQUE,
1763 .state = WREPL_STATE_TOMBSTONE,
1764 .node = WREPL_NODE_B,
1766 .num_ips = ARRAY_SIZE(addresses_A_1),
1767 .ips = addresses_A_1,
1768 .apply_expected = True
1772 .type = WREPL_TYPE_MHOMED,
1773 .state = WREPL_STATE_TOMBSTONE,
1774 .node = WREPL_NODE_B,
1776 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1777 .ips = addresses_B_3_4,
1778 .apply_expected = True
1783 * normal groups vs unique section,
1786 * group,active vs. unique,active
1787 * => should NOT be replaced
1790 .line = __location__,
1791 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1794 .type = WREPL_TYPE_GROUP,
1795 .state = WREPL_STATE_ACTIVE,
1796 .node = WREPL_NODE_B,
1798 .num_ips = ARRAY_SIZE(addresses_A_1),
1799 .ips = addresses_A_1,
1800 .apply_expected = True
1804 .type = WREPL_TYPE_UNIQUE,
1805 .state = WREPL_STATE_ACTIVE,
1806 .node = WREPL_NODE_B,
1808 .num_ips = ARRAY_SIZE(addresses_A_1),
1809 .ips = addresses_A_1,
1810 .apply_expected = False
1815 * group,active vs. unique,tombstone
1816 * => should NOT be replaced
1819 .line = __location__,
1820 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1823 .type = WREPL_TYPE_GROUP,
1824 .state = WREPL_STATE_ACTIVE,
1825 .node = WREPL_NODE_B,
1827 .num_ips = ARRAY_SIZE(addresses_A_1),
1828 .ips = addresses_A_1,
1829 .apply_expected = True
1833 .type = WREPL_TYPE_UNIQUE,
1834 .state = WREPL_STATE_TOMBSTONE,
1835 .node = WREPL_NODE_B,
1837 .num_ips = ARRAY_SIZE(addresses_A_1),
1838 .ips = addresses_A_1,
1839 .apply_expected = False
1844 * group,released vs. unique,active
1845 * => should NOT be replaced
1848 .line = __location__,
1849 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1852 .type = WREPL_TYPE_GROUP,
1853 .state = WREPL_STATE_RELEASED,
1854 .node = WREPL_NODE_B,
1856 .num_ips = ARRAY_SIZE(addresses_A_1),
1857 .ips = addresses_A_1,
1858 .apply_expected = False
1862 .type = WREPL_TYPE_UNIQUE,
1863 .state = WREPL_STATE_ACTIVE,
1864 .node = WREPL_NODE_B,
1866 .num_ips = ARRAY_SIZE(addresses_A_1),
1867 .ips = addresses_A_1,
1868 .apply_expected = False
1873 * group,released vs. unique,tombstone
1874 * => should NOT be replaced
1877 .line = __location__,
1878 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1881 .type = WREPL_TYPE_GROUP,
1882 .state = WREPL_STATE_RELEASED,
1883 .node = WREPL_NODE_B,
1885 .num_ips = ARRAY_SIZE(addresses_A_1),
1886 .ips = addresses_A_1,
1887 .apply_expected = False
1891 .type = WREPL_TYPE_UNIQUE,
1892 .state = WREPL_STATE_TOMBSTONE,
1893 .node = WREPL_NODE_B,
1895 .num_ips = ARRAY_SIZE(addresses_A_1),
1896 .ips = addresses_A_1,
1897 .apply_expected = False
1902 * group,tombstone vs. unique,active
1903 * => should NOT be replaced
1906 .line = __location__,
1907 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1910 .type = WREPL_TYPE_GROUP,
1911 .state = WREPL_STATE_TOMBSTONE,
1912 .node = WREPL_NODE_B,
1914 .num_ips = ARRAY_SIZE(addresses_A_1),
1915 .ips = addresses_A_1,
1916 .apply_expected = True
1920 .type = WREPL_TYPE_UNIQUE,
1921 .state = WREPL_STATE_ACTIVE,
1922 .node = WREPL_NODE_B,
1924 .num_ips = ARRAY_SIZE(addresses_A_1),
1925 .ips = addresses_A_1,
1926 .apply_expected = False
1931 * group,tombstone vs. unique,tombstone
1932 * => should NOT be replaced
1935 .line = __location__,
1936 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1939 .type = WREPL_TYPE_GROUP,
1940 .state = WREPL_STATE_TOMBSTONE,
1941 .node = WREPL_NODE_B,
1943 .num_ips = ARRAY_SIZE(addresses_A_1),
1944 .ips = addresses_A_1,
1945 .apply_expected = True
1949 .type = WREPL_TYPE_UNIQUE,
1950 .state = WREPL_STATE_TOMBSTONE,
1951 .node = WREPL_NODE_B,
1953 .num_ips = ARRAY_SIZE(addresses_A_1),
1954 .ips = addresses_A_1,
1955 .apply_expected = False
1960 * normal groups vs normal groups section,
1963 * group,active vs. group,active
1964 * => should NOT be replaced
1967 .line = __location__,
1968 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1971 .type = WREPL_TYPE_GROUP,
1972 .state = WREPL_STATE_ACTIVE,
1973 .node = WREPL_NODE_B,
1975 .num_ips = ARRAY_SIZE(addresses_A_1),
1976 .ips = addresses_A_1,
1977 .apply_expected = True
1981 .type = WREPL_TYPE_GROUP,
1982 .state = WREPL_STATE_ACTIVE,
1983 .node = WREPL_NODE_B,
1985 .num_ips = ARRAY_SIZE(addresses_A_1),
1986 .ips = addresses_A_1,
1987 .apply_expected = False
1992 * group,active vs. group,tombstone
1993 * => should NOT be replaced
1996 .line = __location__,
1997 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2000 .type = WREPL_TYPE_GROUP,
2001 .state = WREPL_STATE_ACTIVE,
2002 .node = WREPL_NODE_B,
2004 .num_ips = ARRAY_SIZE(addresses_A_1),
2005 .ips = addresses_A_1,
2006 .apply_expected = True
2010 .type = WREPL_TYPE_GROUP,
2011 .state = WREPL_STATE_TOMBSTONE,
2012 .node = WREPL_NODE_B,
2014 .num_ips = ARRAY_SIZE(addresses_A_1),
2015 .ips = addresses_A_1,
2016 .apply_expected = False
2021 * group,released vs. group,active
2022 * => should be replaced
2025 .line = __location__,
2026 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2029 .type = WREPL_TYPE_GROUP,
2030 .state = WREPL_STATE_RELEASED,
2031 .node = WREPL_NODE_B,
2033 .num_ips = ARRAY_SIZE(addresses_A_1),
2034 .ips = addresses_A_1,
2035 .apply_expected = False
2039 .type = WREPL_TYPE_GROUP,
2040 .state = WREPL_STATE_ACTIVE,
2041 .node = WREPL_NODE_B,
2043 .num_ips = ARRAY_SIZE(addresses_B_1),
2044 .ips = addresses_B_1,
2045 .apply_expected = True
2050 * group,released vs. group,tombstone
2051 * => should be replaced
2054 .line = __location__,
2055 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2058 .type = WREPL_TYPE_GROUP,
2059 .state = WREPL_STATE_RELEASED,
2060 .node = WREPL_NODE_B,
2062 .num_ips = ARRAY_SIZE(addresses_A_1),
2063 .ips = addresses_A_1,
2064 .apply_expected = False
2068 .type = WREPL_TYPE_GROUP,
2069 .state = WREPL_STATE_TOMBSTONE,
2070 .node = WREPL_NODE_B,
2072 .num_ips = ARRAY_SIZE(addresses_B_1),
2073 .ips = addresses_B_1,
2074 .apply_expected = True
2079 * group,tombstone vs. group,active
2080 * => should be replaced
2083 .line = __location__,
2084 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2087 .type = WREPL_TYPE_GROUP,
2088 .state = WREPL_STATE_TOMBSTONE,
2089 .node = WREPL_NODE_B,
2091 .num_ips = ARRAY_SIZE(addresses_B_1),
2092 .ips = addresses_B_1,
2093 .apply_expected = True
2097 .type = WREPL_TYPE_GROUP,
2098 .state = WREPL_STATE_ACTIVE,
2099 .node = WREPL_NODE_B,
2101 .num_ips = ARRAY_SIZE(addresses_A_1),
2102 .ips = addresses_A_1,
2103 .apply_expected = True
2108 * group,tombstone vs. group,tombstone
2109 * => should be replaced
2112 .line = __location__,
2113 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2116 .type = WREPL_TYPE_GROUP,
2117 .state = WREPL_STATE_TOMBSTONE,
2118 .node = WREPL_NODE_B,
2120 .num_ips = ARRAY_SIZE(addresses_A_1),
2121 .ips = addresses_A_1,
2122 .apply_expected = True
2126 .type = WREPL_TYPE_GROUP,
2127 .state = WREPL_STATE_TOMBSTONE,
2128 .node = WREPL_NODE_B,
2130 .num_ips = ARRAY_SIZE(addresses_B_1),
2131 .ips = addresses_B_1,
2132 .apply_expected = True
2137 * normal groups vs special groups section,
2140 * group,active vs. sgroup,active
2141 * => should NOT be replaced
2144 .line = __location__,
2145 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2148 .type = WREPL_TYPE_GROUP,
2149 .state = WREPL_STATE_ACTIVE,
2150 .node = WREPL_NODE_B,
2152 .num_ips = ARRAY_SIZE(addresses_B_1),
2153 .ips = addresses_B_1,
2154 .apply_expected = True
2158 .type = WREPL_TYPE_SGROUP,
2159 .state = WREPL_STATE_ACTIVE,
2160 .node = WREPL_NODE_B,
2162 .num_ips = ARRAY_SIZE(addresses_B_1),
2163 .ips = addresses_B_1,
2164 .apply_expected = False
2169 * group,active vs. sgroup,tombstone
2170 * => should NOT be replaced
2173 .line = __location__,
2174 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2177 .type = WREPL_TYPE_GROUP,
2178 .state = WREPL_STATE_ACTIVE,
2179 .node = WREPL_NODE_B,
2181 .num_ips = ARRAY_SIZE(addresses_B_1),
2182 .ips = addresses_B_1,
2183 .apply_expected = True
2187 .type = WREPL_TYPE_SGROUP,
2188 .state = WREPL_STATE_TOMBSTONE,
2189 .node = WREPL_NODE_B,
2191 .num_ips = ARRAY_SIZE(addresses_B_1),
2192 .ips = addresses_B_1,
2193 .apply_expected = False
2198 * group,released vs. sgroup,active
2199 * => should be replaced
2202 .line = __location__,
2203 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2206 .type = WREPL_TYPE_GROUP,
2207 .state = WREPL_STATE_RELEASED,
2208 .node = WREPL_NODE_B,
2210 .num_ips = ARRAY_SIZE(addresses_A_1),
2211 .ips = addresses_A_1,
2212 .apply_expected = False
2216 .type = WREPL_TYPE_SGROUP,
2217 .state = WREPL_STATE_ACTIVE,
2218 .node = WREPL_NODE_B,
2220 .num_ips = ARRAY_SIZE(addresses_B_1),
2221 .ips = addresses_B_1,
2222 .apply_expected = True
2227 * group,released vs. sgroup,tombstone
2228 * => should NOT be replaced
2231 .line = __location__,
2232 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2235 .type = WREPL_TYPE_GROUP,
2236 .state = WREPL_STATE_RELEASED,
2237 .node = WREPL_NODE_B,
2239 .num_ips = ARRAY_SIZE(addresses_B_1),
2240 .ips = addresses_B_1,
2241 .apply_expected = False
2245 .type = WREPL_TYPE_SGROUP,
2246 .state = WREPL_STATE_TOMBSTONE,
2247 .node = WREPL_NODE_B,
2249 .num_ips = ARRAY_SIZE(addresses_B_1),
2250 .ips = addresses_B_1,
2251 .apply_expected = False
2256 * group,tombstone vs. sgroup,active
2257 * => should be replaced
2260 .line = __location__,
2261 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2264 .type = WREPL_TYPE_GROUP,
2265 .state = WREPL_STATE_TOMBSTONE,
2266 .node = WREPL_NODE_B,
2268 .num_ips = ARRAY_SIZE(addresses_B_1),
2269 .ips = addresses_B_1,
2270 .apply_expected = True
2274 .type = WREPL_TYPE_SGROUP,
2275 .state = WREPL_STATE_ACTIVE,
2276 .node = WREPL_NODE_B,
2278 .num_ips = ARRAY_SIZE(addresses_A_1),
2279 .ips = addresses_A_1,
2280 .apply_expected = True
2285 * group,tombstone vs. sgroup,tombstone
2286 * => should be replaced
2289 .line = __location__,
2290 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2293 .type = WREPL_TYPE_GROUP,
2294 .state = WREPL_STATE_TOMBSTONE,
2295 .node = WREPL_NODE_B,
2297 .num_ips = ARRAY_SIZE(addresses_A_1),
2298 .ips = addresses_A_1,
2299 .apply_expected = True
2303 .type = WREPL_TYPE_SGROUP,
2304 .state = WREPL_STATE_TOMBSTONE,
2305 .node = WREPL_NODE_B,
2307 .num_ips = ARRAY_SIZE(addresses_B_1),
2308 .ips = addresses_B_1,
2309 .apply_expected = True
2314 * normal groups vs multi homed section,
2317 * group,active vs. mhomed,active
2318 * => should NOT be replaced
2321 .line = __location__,
2322 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2325 .type = WREPL_TYPE_GROUP,
2326 .state = WREPL_STATE_ACTIVE,
2327 .node = WREPL_NODE_B,
2329 .num_ips = ARRAY_SIZE(addresses_B_1),
2330 .ips = addresses_B_1,
2331 .apply_expected = True
2335 .type = WREPL_TYPE_MHOMED,
2336 .state = WREPL_STATE_ACTIVE,
2337 .node = WREPL_NODE_B,
2339 .num_ips = ARRAY_SIZE(addresses_B_1),
2340 .ips = addresses_B_1,
2341 .apply_expected = False
2346 * group,active vs. mhomed,tombstone
2347 * => should NOT be replaced
2350 .line = __location__,
2351 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2354 .type = WREPL_TYPE_GROUP,
2355 .state = WREPL_STATE_ACTIVE,
2356 .node = WREPL_NODE_B,
2358 .num_ips = ARRAY_SIZE(addresses_B_1),
2359 .ips = addresses_B_1,
2360 .apply_expected = True
2364 .type = WREPL_TYPE_MHOMED,
2365 .state = WREPL_STATE_TOMBSTONE,
2366 .node = WREPL_NODE_B,
2368 .num_ips = ARRAY_SIZE(addresses_B_1),
2369 .ips = addresses_B_1,
2370 .apply_expected = False
2375 * group,released vs. mhomed,active
2376 * => should NOT be replaced
2379 .line = __location__,
2380 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2383 .type = WREPL_TYPE_GROUP,
2384 .state = WREPL_STATE_RELEASED,
2385 .node = WREPL_NODE_B,
2387 .num_ips = ARRAY_SIZE(addresses_B_1),
2388 .ips = addresses_B_1,
2389 .apply_expected = False
2393 .type = WREPL_TYPE_MHOMED,
2394 .state = WREPL_STATE_ACTIVE,
2395 .node = WREPL_NODE_B,
2397 .num_ips = ARRAY_SIZE(addresses_B_1),
2398 .ips = addresses_B_1,
2399 .apply_expected = False
2404 * group,released vs. mhomed,tombstone
2405 * => should NOT be replaced
2408 .line = __location__,
2409 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2412 .type = WREPL_TYPE_GROUP,
2413 .state = WREPL_STATE_RELEASED,
2414 .node = WREPL_NODE_B,
2416 .num_ips = ARRAY_SIZE(addresses_B_1),
2417 .ips = addresses_B_1,
2418 .apply_expected = False
2422 .type = WREPL_TYPE_MHOMED,
2423 .state = WREPL_STATE_TOMBSTONE,
2424 .node = WREPL_NODE_B,
2426 .num_ips = ARRAY_SIZE(addresses_B_1),
2427 .ips = addresses_B_1,
2428 .apply_expected = False
2433 * group,tombstone vs. mhomed,active
2434 * => should be replaced
2437 .line = __location__,
2438 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2441 .type = WREPL_TYPE_GROUP,
2442 .state = WREPL_STATE_TOMBSTONE,
2443 .node = WREPL_NODE_B,
2445 .num_ips = ARRAY_SIZE(addresses_B_1),
2446 .ips = addresses_B_1,
2447 .apply_expected = True
2451 .type = WREPL_TYPE_MHOMED,
2452 .state = WREPL_STATE_ACTIVE,
2453 .node = WREPL_NODE_B,
2455 .num_ips = ARRAY_SIZE(addresses_A_1),
2456 .ips = addresses_A_1,
2457 .apply_expected = True
2462 * group,tombstone vs. mhomed,tombstone
2463 * => should be replaced
2466 .line = __location__,
2467 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2470 .type = WREPL_TYPE_GROUP,
2471 .state = WREPL_STATE_TOMBSTONE,
2472 .node = WREPL_NODE_B,
2474 .num_ips = ARRAY_SIZE(addresses_A_1),
2475 .ips = addresses_A_1,
2476 .apply_expected = True
2480 .type = WREPL_TYPE_MHOMED,
2481 .state = WREPL_STATE_TOMBSTONE,
2482 .node = WREPL_NODE_B,
2484 .num_ips = ARRAY_SIZE(addresses_B_1),
2485 .ips = addresses_B_1,
2486 .apply_expected = True
2491 * special groups vs unique section,
2494 * sgroup,active vs. unique,active
2495 * => should NOT be replaced
2498 .line = __location__,
2499 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2502 .type = WREPL_TYPE_SGROUP,
2503 .state = WREPL_STATE_ACTIVE,
2504 .node = WREPL_NODE_B,
2506 .num_ips = ARRAY_SIZE(addresses_B_1),
2507 .ips = addresses_B_1,
2508 .apply_expected = True
2512 .type = WREPL_TYPE_UNIQUE,
2513 .state = WREPL_STATE_ACTIVE,
2514 .node = WREPL_NODE_B,
2516 .num_ips = ARRAY_SIZE(addresses_B_1),
2517 .ips = addresses_B_1,
2518 .apply_expected = False
2523 * sgroup,active vs. unique,tombstone
2524 * => should NOT be replaced
2527 .line = __location__,
2528 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2531 .type = WREPL_TYPE_SGROUP,
2532 .state = WREPL_STATE_ACTIVE,
2533 .node = WREPL_NODE_B,
2535 .num_ips = ARRAY_SIZE(addresses_B_1),
2536 .ips = addresses_B_1,
2537 .apply_expected = True
2541 .type = WREPL_TYPE_UNIQUE,
2542 .state = WREPL_STATE_TOMBSTONE,
2543 .node = WREPL_NODE_B,
2545 .num_ips = ARRAY_SIZE(addresses_B_1),
2546 .ips = addresses_B_1,
2547 .apply_expected = False
2552 * sgroup,released vs. unique,active
2553 * => should be replaced
2556 .line = __location__,
2557 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2560 .type = WREPL_TYPE_SGROUP,
2561 .state = WREPL_STATE_RELEASED,
2562 .node = WREPL_NODE_B,
2564 .num_ips = ARRAY_SIZE(addresses_B_1),
2565 .ips = addresses_B_1,
2566 .apply_expected = False
2570 .type = WREPL_TYPE_UNIQUE,
2571 .state = WREPL_STATE_ACTIVE,
2572 .node = WREPL_NODE_B,
2574 .num_ips = ARRAY_SIZE(addresses_A_1),
2575 .ips = addresses_A_1,
2576 .apply_expected = True
2581 * sgroup,released vs. unique,tombstone
2582 * => should be replaced
2585 .line = __location__,
2586 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2589 .type = WREPL_TYPE_SGROUP,
2590 .state = WREPL_STATE_RELEASED,
2591 .node = WREPL_NODE_B,
2593 .num_ips = ARRAY_SIZE(addresses_A_1),
2594 .ips = addresses_A_1,
2595 .apply_expected = False
2599 .type = WREPL_TYPE_UNIQUE,
2600 .state = WREPL_STATE_TOMBSTONE,
2601 .node = WREPL_NODE_B,
2603 .num_ips = ARRAY_SIZE(addresses_B_1),
2604 .ips = addresses_B_1,
2605 .apply_expected = True
2610 * sgroup,tombstone vs. unique,active
2611 * => should be replaced
2614 .line = __location__,
2615 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2618 .type = WREPL_TYPE_SGROUP,
2619 .state = WREPL_STATE_TOMBSTONE,
2620 .node = WREPL_NODE_B,
2622 .num_ips = ARRAY_SIZE(addresses_A_1),
2623 .ips = addresses_A_1,
2624 .apply_expected = True
2628 .type = WREPL_TYPE_UNIQUE,
2629 .state = WREPL_STATE_ACTIVE,
2630 .node = WREPL_NODE_B,
2632 .num_ips = ARRAY_SIZE(addresses_B_1),
2633 .ips = addresses_B_1,
2634 .apply_expected = True
2639 * sgroup,tombstone vs. unique,tombstone
2640 * => should be replaced
2643 .line = __location__,
2644 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2647 .type = WREPL_TYPE_SGROUP,
2648 .state = WREPL_STATE_TOMBSTONE,
2649 .node = WREPL_NODE_B,
2651 .num_ips = ARRAY_SIZE(addresses_B_1),
2652 .ips = addresses_B_1,
2653 .apply_expected = True
2657 .type = WREPL_TYPE_UNIQUE,
2658 .state = WREPL_STATE_TOMBSTONE,
2659 .node = WREPL_NODE_B,
2661 .num_ips = ARRAY_SIZE(addresses_A_1),
2662 .ips = addresses_A_1,
2663 .apply_expected = True
2668 * special groups vs normal group section,
2671 * sgroup,active vs. group,active
2672 * => should NOT be replaced
2675 .line = __location__,
2676 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2679 .type = WREPL_TYPE_SGROUP,
2680 .state = WREPL_STATE_ACTIVE,
2681 .node = WREPL_NODE_B,
2683 .num_ips = ARRAY_SIZE(addresses_A_1),
2684 .ips = addresses_A_1,
2685 .apply_expected = True
2689 .type = WREPL_TYPE_GROUP,
2690 .state = WREPL_STATE_ACTIVE,
2691 .node = WREPL_NODE_B,
2693 .num_ips = ARRAY_SIZE(addresses_A_1),
2694 .ips = addresses_A_1,
2695 .apply_expected = False
2700 * sgroup,active vs. group,tombstone
2701 * => should NOT be replaced
2704 .line = __location__,
2705 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2708 .type = WREPL_TYPE_SGROUP,
2709 .state = WREPL_STATE_ACTIVE,
2710 .node = WREPL_NODE_B,
2712 .num_ips = ARRAY_SIZE(addresses_A_1),
2713 .ips = addresses_A_1,
2714 .apply_expected = True
2718 .type = WREPL_TYPE_GROUP,
2719 .state = WREPL_STATE_TOMBSTONE,
2720 .node = WREPL_NODE_B,
2722 .num_ips = ARRAY_SIZE(addresses_A_1),
2723 .ips = addresses_A_1,
2724 .apply_expected = False
2729 * sgroup,released vs. group,active
2730 * => should be replaced
2733 .line = __location__,
2734 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2737 .type = WREPL_TYPE_SGROUP,
2738 .state = WREPL_STATE_RELEASED,
2739 .node = WREPL_NODE_B,
2741 .num_ips = ARRAY_SIZE(addresses_A_1),
2742 .ips = addresses_A_1,
2743 .apply_expected = False
2747 .type = WREPL_TYPE_GROUP,
2748 .state = WREPL_STATE_ACTIVE,
2749 .node = WREPL_NODE_B,
2751 .num_ips = ARRAY_SIZE(addresses_B_1),
2752 .ips = addresses_B_1,
2753 .apply_expected = True
2758 * sgroup,released vs. group,tombstone
2759 * => should be replaced
2762 .line = __location__,
2763 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2766 .type = WREPL_TYPE_SGROUP,
2767 .state = WREPL_STATE_RELEASED,
2768 .node = WREPL_NODE_B,
2770 .num_ips = ARRAY_SIZE(addresses_B_1),
2771 .ips = addresses_B_1,
2772 .apply_expected = False
2776 .type = WREPL_TYPE_GROUP,
2777 .state = WREPL_STATE_TOMBSTONE,
2778 .node = WREPL_NODE_B,
2780 .num_ips = ARRAY_SIZE(addresses_A_1),
2781 .ips = addresses_A_1,
2782 .apply_expected = True
2787 * sgroup,tombstone vs. group,active
2788 * => should NOT be replaced
2791 .line = __location__,
2792 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2795 .type = WREPL_TYPE_SGROUP,
2796 .state = WREPL_STATE_TOMBSTONE,
2797 .node = WREPL_NODE_B,
2799 .num_ips = ARRAY_SIZE(addresses_A_1),
2800 .ips = addresses_A_1,
2801 .apply_expected = True
2805 .type = WREPL_TYPE_GROUP,
2806 .state = WREPL_STATE_ACTIVE,
2807 .node = WREPL_NODE_B,
2809 .num_ips = ARRAY_SIZE(addresses_B_1),
2810 .ips = addresses_B_1,
2811 .apply_expected = True
2816 * sgroup,tombstone vs. group,tombstone
2817 * => should NOT be replaced
2820 .line = __location__,
2821 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2824 .type = WREPL_TYPE_SGROUP,
2825 .state = WREPL_STATE_TOMBSTONE,
2826 .node = WREPL_NODE_B,
2828 .num_ips = ARRAY_SIZE(addresses_B_1),
2829 .ips = addresses_B_1,
2830 .apply_expected = True
2834 .type = WREPL_TYPE_GROUP,
2835 .state = WREPL_STATE_TOMBSTONE,
2836 .node = WREPL_NODE_B,
2838 .num_ips = ARRAY_SIZE(addresses_A_1),
2839 .ips = addresses_A_1,
2840 .apply_expected = True
2845 * special groups vs multi homed section,
2848 * sgroup,active vs. mhomed,active
2849 * => should NOT be replaced
2852 .line = __location__,
2853 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2856 .type = WREPL_TYPE_SGROUP,
2857 .state = WREPL_STATE_ACTIVE,
2858 .node = WREPL_NODE_B,
2860 .num_ips = ARRAY_SIZE(addresses_A_1),
2861 .ips = addresses_A_1,
2862 .apply_expected = True
2866 .type = WREPL_TYPE_MHOMED,
2867 .state = WREPL_STATE_ACTIVE,
2868 .node = WREPL_NODE_B,
2870 .num_ips = ARRAY_SIZE(addresses_A_1),
2871 .ips = addresses_A_1,
2872 .apply_expected = False
2877 * sgroup,active vs. mhomed,tombstone
2878 * => should NOT be replaced
2881 .line = __location__,
2882 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2885 .type = WREPL_TYPE_SGROUP,
2886 .state = WREPL_STATE_ACTIVE,
2887 .node = WREPL_NODE_B,
2889 .num_ips = ARRAY_SIZE(addresses_A_1),
2890 .ips = addresses_A_1,
2891 .apply_expected = True
2895 .type = WREPL_TYPE_MHOMED,
2896 .state = WREPL_STATE_TOMBSTONE,
2897 .node = WREPL_NODE_B,
2899 .num_ips = ARRAY_SIZE(addresses_A_1),
2900 .ips = addresses_A_1,
2901 .apply_expected = False
2906 * sgroup,released vs. mhomed,active
2907 * => should be replaced
2910 .line = __location__,
2911 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2914 .type = WREPL_TYPE_SGROUP,
2915 .state = WREPL_STATE_RELEASED,
2916 .node = WREPL_NODE_B,
2918 .num_ips = ARRAY_SIZE(addresses_A_1),
2919 .ips = addresses_A_1,
2920 .apply_expected = False
2924 .type = WREPL_TYPE_MHOMED,
2925 .state = WREPL_STATE_ACTIVE,
2926 .node = WREPL_NODE_B,
2928 .num_ips = ARRAY_SIZE(addresses_B_1),
2929 .ips = addresses_B_1,
2930 .apply_expected = True
2935 * sgroup,released vs. mhomed,tombstone
2936 * => should be replaced
2939 .line = __location__,
2940 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2943 .type = WREPL_TYPE_SGROUP,
2944 .state = WREPL_STATE_RELEASED,
2945 .node = WREPL_NODE_B,
2947 .num_ips = ARRAY_SIZE(addresses_B_1),
2948 .ips = addresses_B_1,
2949 .apply_expected = False
2953 .type = WREPL_TYPE_MHOMED,
2954 .state = WREPL_STATE_TOMBSTONE,
2955 .node = WREPL_NODE_B,
2957 .num_ips = ARRAY_SIZE(addresses_A_1),
2958 .ips = addresses_A_1,
2959 .apply_expected = True
2964 * sgroup,tombstone vs. mhomed,active
2965 * => should be replaced
2968 .line = __location__,
2969 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2972 .type = WREPL_TYPE_SGROUP,
2973 .state = WREPL_STATE_TOMBSTONE,
2974 .node = WREPL_NODE_B,
2976 .num_ips = ARRAY_SIZE(addresses_A_1),
2977 .ips = addresses_A_1,
2978 .apply_expected = True
2982 .type = WREPL_TYPE_MHOMED,
2983 .state = WREPL_STATE_ACTIVE,
2984 .node = WREPL_NODE_B,
2986 .num_ips = ARRAY_SIZE(addresses_B_1),
2987 .ips = addresses_B_1,
2988 .apply_expected = True
2993 * sgroup,tombstone vs. mhomed,tombstone
2994 * => should be replaced
2997 .line = __location__,
2998 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3001 .type = WREPL_TYPE_SGROUP,
3002 .state = WREPL_STATE_TOMBSTONE,
3003 .node = WREPL_NODE_B,
3005 .num_ips = ARRAY_SIZE(addresses_B_1),
3006 .ips = addresses_B_1,
3007 .apply_expected = True
3011 .type = WREPL_TYPE_MHOMED,
3012 .state = WREPL_STATE_TOMBSTONE,
3013 .node = WREPL_NODE_B,
3015 .num_ips = ARRAY_SIZE(addresses_A_1),
3016 .ips = addresses_A_1,
3017 .apply_expected = True
3022 * multi homed vs. unique section,
3025 * mhomed,active vs. unique,active
3026 * => should be replaced
3029 .line = __location__,
3030 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3033 .type = WREPL_TYPE_MHOMED,
3034 .state = WREPL_STATE_ACTIVE,
3035 .node = WREPL_NODE_B,
3037 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3038 .ips = addresses_A_3_4,
3039 .apply_expected = True
3043 .type = WREPL_TYPE_UNIQUE,
3044 .state = WREPL_STATE_ACTIVE,
3045 .node = WREPL_NODE_B,
3047 .num_ips = ARRAY_SIZE(addresses_B_1),
3048 .ips = addresses_B_1,
3049 .apply_expected = True
3054 * mhomed,active vs. unique,tombstone
3055 * => should NOT be replaced
3058 .line = __location__,
3059 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3062 .type = WREPL_TYPE_MHOMED,
3063 .state = WREPL_STATE_ACTIVE,
3064 .node = WREPL_NODE_B,
3066 .num_ips = ARRAY_SIZE(addresses_B_1),
3067 .ips = addresses_B_1,
3068 .apply_expected = True
3072 .type = WREPL_TYPE_UNIQUE,
3073 .state = WREPL_STATE_TOMBSTONE,
3074 .node = WREPL_NODE_B,
3076 .num_ips = ARRAY_SIZE(addresses_B_1),
3077 .ips = addresses_B_1,
3078 .apply_expected = False
3083 * mhomed,released vs. unique,active
3084 * => should be replaced
3087 .line = __location__,
3088 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3091 .type = WREPL_TYPE_MHOMED,
3092 .state = WREPL_STATE_RELEASED,
3093 .node = WREPL_NODE_B,
3095 .num_ips = ARRAY_SIZE(addresses_A_1),
3096 .ips = addresses_A_1,
3097 .apply_expected = False
3101 .type = WREPL_TYPE_UNIQUE,
3102 .state = WREPL_STATE_ACTIVE,
3103 .node = WREPL_NODE_B,
3105 .num_ips = ARRAY_SIZE(addresses_B_1),
3106 .ips = addresses_B_1,
3107 .apply_expected = True
3112 * mhomed,released vs. uinique,tombstone
3113 * => should be replaced
3116 .line = __location__,
3117 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3120 .type = WREPL_TYPE_MHOMED,
3121 .state = WREPL_STATE_RELEASED,
3122 .node = WREPL_NODE_B,
3124 .num_ips = ARRAY_SIZE(addresses_B_1),
3125 .ips = addresses_B_1,
3126 .apply_expected = False
3130 .type = WREPL_TYPE_UNIQUE,
3131 .state = WREPL_STATE_TOMBSTONE,
3132 .node = WREPL_NODE_B,
3134 .num_ips = ARRAY_SIZE(addresses_A_1),
3135 .ips = addresses_A_1,
3136 .apply_expected = True
3141 * mhomed,tombstone vs. unique,active
3142 * => should be replaced
3145 .line = __location__,
3146 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3149 .type = WREPL_TYPE_MHOMED,
3150 .state = WREPL_STATE_TOMBSTONE,
3151 .node = WREPL_NODE_B,
3153 .num_ips = ARRAY_SIZE(addresses_A_1),
3154 .ips = addresses_A_1,
3155 .apply_expected = True
3159 .type = WREPL_TYPE_UNIQUE,
3160 .state = WREPL_STATE_ACTIVE,
3161 .node = WREPL_NODE_B,
3163 .num_ips = ARRAY_SIZE(addresses_B_1),
3164 .ips = addresses_B_1,
3165 .apply_expected = True
3170 * mhomed,tombstone vs. uinique,tombstone
3171 * => should be replaced
3174 .line = __location__,
3175 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3178 .type = WREPL_TYPE_MHOMED,
3179 .state = WREPL_STATE_TOMBSTONE,
3180 .node = WREPL_NODE_B,
3182 .num_ips = ARRAY_SIZE(addresses_B_1),
3183 .ips = addresses_B_1,
3184 .apply_expected = True
3188 .type = WREPL_TYPE_UNIQUE,
3189 .state = WREPL_STATE_TOMBSTONE,
3190 .node = WREPL_NODE_B,
3192 .num_ips = ARRAY_SIZE(addresses_A_1),
3193 .ips = addresses_A_1,
3194 .apply_expected = True
3199 * multi homed vs. normal group section,
3202 * mhomed,active vs. group,active
3203 * => should be replaced
3206 .line = __location__,
3207 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3210 .type = WREPL_TYPE_MHOMED,
3211 .state = WREPL_STATE_ACTIVE,
3212 .node = WREPL_NODE_B,
3214 .num_ips = ARRAY_SIZE(addresses_A_1),
3215 .ips = addresses_A_1,
3216 .apply_expected = True
3220 .type = WREPL_TYPE_GROUP,
3221 .state = WREPL_STATE_ACTIVE,
3222 .node = WREPL_NODE_B,
3224 .num_ips = ARRAY_SIZE(addresses_B_1),
3225 .ips = addresses_B_1,
3226 .apply_expected = True
3231 * mhomed,active vs. group,tombstone
3232 * => should NOT be replaced
3235 .line = __location__,
3236 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3239 .type = WREPL_TYPE_MHOMED,
3240 .state = WREPL_STATE_ACTIVE,
3241 .node = WREPL_NODE_B,
3243 .num_ips = ARRAY_SIZE(addresses_B_1),
3244 .ips = addresses_B_1,
3245 .apply_expected = True
3249 .type = WREPL_TYPE_GROUP,
3250 .state = WREPL_STATE_TOMBSTONE,
3251 .node = WREPL_NODE_B,
3253 .num_ips = ARRAY_SIZE(addresses_B_1),
3254 .ips = addresses_B_1,
3255 .apply_expected = False
3260 * mhomed,released vs. group,active
3261 * => should be replaced
3264 .line = __location__,
3265 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3268 .type = WREPL_TYPE_MHOMED,
3269 .state = WREPL_STATE_RELEASED,
3270 .node = WREPL_NODE_B,
3272 .num_ips = ARRAY_SIZE(addresses_B_1),
3273 .ips = addresses_B_1,
3274 .apply_expected = False
3278 .type = WREPL_TYPE_GROUP,
3279 .state = WREPL_STATE_ACTIVE,
3280 .node = WREPL_NODE_B,
3282 .num_ips = ARRAY_SIZE(addresses_A_1),
3283 .ips = addresses_A_1,
3284 .apply_expected = True
3289 * mhomed,released vs. group,tombstone
3290 * => should be replaced
3293 .line = __location__,
3294 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3297 .type = WREPL_TYPE_MHOMED,
3298 .state = WREPL_STATE_RELEASED,
3299 .node = WREPL_NODE_B,
3301 .num_ips = ARRAY_SIZE(addresses_A_1),
3302 .ips = addresses_A_1,
3303 .apply_expected = False
3307 .type = WREPL_TYPE_GROUP,
3308 .state = WREPL_STATE_TOMBSTONE,
3309 .node = WREPL_NODE_B,
3311 .num_ips = ARRAY_SIZE(addresses_B_1),
3312 .ips = addresses_B_1,
3313 .apply_expected = True
3318 * mhomed,tombstone vs. group,active
3319 * => should be replaced
3322 .line = __location__,
3323 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3326 .type = WREPL_TYPE_MHOMED,
3327 .state = WREPL_STATE_TOMBSTONE,
3328 .node = WREPL_NODE_B,
3330 .num_ips = ARRAY_SIZE(addresses_B_1),
3331 .ips = addresses_B_1,
3332 .apply_expected = True
3336 .type = WREPL_TYPE_GROUP,
3337 .state = WREPL_STATE_ACTIVE,
3338 .node = WREPL_NODE_B,
3340 .num_ips = ARRAY_SIZE(addresses_A_1),
3341 .ips = addresses_A_1,
3342 .apply_expected = True
3347 * mhomed,tombstone vs. group,tombstone
3348 * => should be replaced
3351 .line = __location__,
3352 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3355 .type = WREPL_TYPE_MHOMED,
3356 .state = WREPL_STATE_TOMBSTONE,
3357 .node = WREPL_NODE_B,
3359 .num_ips = ARRAY_SIZE(addresses_A_1),
3360 .ips = addresses_A_1,
3361 .apply_expected = True
3365 .type = WREPL_TYPE_GROUP,
3366 .state = WREPL_STATE_TOMBSTONE,
3367 .node = WREPL_NODE_B,
3369 .num_ips = ARRAY_SIZE(addresses_B_1),
3370 .ips = addresses_B_1,
3371 .apply_expected = True
3376 * multi homed vs. special group section,
3379 * mhomed,active vs. sgroup,active
3380 * => should NOT be replaced
3383 .line = __location__,
3384 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3387 .type = WREPL_TYPE_MHOMED,
3388 .state = WREPL_STATE_ACTIVE,
3389 .node = WREPL_NODE_B,
3391 .num_ips = ARRAY_SIZE(addresses_A_1),
3392 .ips = addresses_A_1,
3393 .apply_expected = True
3397 .type = WREPL_TYPE_SGROUP,
3398 .state = WREPL_STATE_ACTIVE,
3399 .node = WREPL_NODE_B,
3401 .num_ips = ARRAY_SIZE(addresses_A_1),
3402 .ips = addresses_A_1,
3403 .apply_expected = False
3408 * mhomed,active vs. sgroup,tombstone
3409 * => should NOT be replaced
3412 .line = __location__,
3413 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3416 .type = WREPL_TYPE_MHOMED,
3417 .state = WREPL_STATE_ACTIVE,
3418 .node = WREPL_NODE_B,
3420 .num_ips = ARRAY_SIZE(addresses_A_1),
3421 .ips = addresses_A_1,
3422 .apply_expected = True
3426 .type = WREPL_TYPE_SGROUP,
3427 .state = WREPL_STATE_TOMBSTONE,
3428 .node = WREPL_NODE_B,
3430 .num_ips = ARRAY_SIZE(addresses_A_1),
3431 .ips = addresses_A_1,
3432 .apply_expected = False
3437 * mhomed,released vs. sgroup,active
3438 * => should be replaced
3441 .line = __location__,
3442 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3445 .type = WREPL_TYPE_MHOMED,
3446 .state = WREPL_STATE_RELEASED,
3447 .node = WREPL_NODE_B,
3449 .num_ips = ARRAY_SIZE(addresses_A_1),
3450 .ips = addresses_A_1,
3451 .apply_expected = False
3455 .type = WREPL_TYPE_SGROUP,
3456 .state = WREPL_STATE_ACTIVE,
3457 .node = WREPL_NODE_B,
3459 .num_ips = ARRAY_SIZE(addresses_B_1),
3460 .ips = addresses_B_1,
3461 .apply_expected = True
3466 * mhomed,released vs. sgroup,tombstone
3467 * => should be replaced
3470 .line = __location__,
3471 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3474 .type = WREPL_TYPE_MHOMED,
3475 .state = WREPL_STATE_RELEASED,
3476 .node = WREPL_NODE_B,
3478 .num_ips = ARRAY_SIZE(addresses_B_1),
3479 .ips = addresses_B_1,
3480 .apply_expected = False
3484 .type = WREPL_TYPE_SGROUP,
3485 .state = WREPL_STATE_TOMBSTONE,
3486 .node = WREPL_NODE_B,
3488 .num_ips = ARRAY_SIZE(addresses_A_1),
3489 .ips = addresses_A_1,
3490 .apply_expected = True
3495 * mhomed,tombstone vs. sgroup,active
3496 * => should be replaced
3499 .line = __location__,
3500 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3503 .type = WREPL_TYPE_MHOMED,
3504 .state = WREPL_STATE_TOMBSTONE,
3505 .node = WREPL_NODE_B,
3507 .num_ips = ARRAY_SIZE(addresses_A_1),
3508 .ips = addresses_A_1,
3509 .apply_expected = True
3513 .type = WREPL_TYPE_SGROUP,
3514 .state = WREPL_STATE_ACTIVE,
3515 .node = WREPL_NODE_B,
3517 .num_ips = ARRAY_SIZE(addresses_B_1),
3518 .ips = addresses_B_1,
3519 .apply_expected = True
3524 * mhomed,tombstone vs. sgroup,tombstone
3525 * => should be replaced
3528 .line = __location__,
3529 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3532 .type = WREPL_TYPE_MHOMED,
3533 .state = WREPL_STATE_TOMBSTONE,
3534 .node = WREPL_NODE_B,
3536 .num_ips = ARRAY_SIZE(addresses_B_1),
3537 .ips = addresses_B_1,
3538 .apply_expected = True
3542 .type = WREPL_TYPE_SGROUP,
3543 .state = WREPL_STATE_TOMBSTONE,
3544 .node = WREPL_NODE_B,
3546 .num_ips = ARRAY_SIZE(addresses_A_1),
3547 .ips = addresses_A_1,
3548 .apply_expected = True
3553 * multi homed vs. mlti homed section,
3556 * mhomed,active vs. mhomed,active
3557 * => should be replaced
3560 .line = __location__,
3561 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3564 .type = WREPL_TYPE_MHOMED,
3565 .state = WREPL_STATE_ACTIVE,
3566 .node = WREPL_NODE_B,
3568 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3569 .ips = addresses_A_3_4,
3570 .apply_expected = True
3574 .type = WREPL_TYPE_MHOMED,
3575 .state = WREPL_STATE_ACTIVE,
3576 .node = WREPL_NODE_B,
3578 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3579 .ips = addresses_B_3_4,
3580 .apply_expected = True
3585 * mhomed,active vs. mhomed,tombstone
3586 * => should NOT be replaced
3589 .line = __location__,
3590 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3593 .type = WREPL_TYPE_MHOMED,
3594 .state = WREPL_STATE_ACTIVE,
3595 .node = WREPL_NODE_B,
3597 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3598 .ips = addresses_B_3_4,
3599 .apply_expected = True
3603 .type = WREPL_TYPE_MHOMED,
3604 .state = WREPL_STATE_TOMBSTONE,
3605 .node = WREPL_NODE_B,
3607 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3608 .ips = addresses_B_3_4,
3609 .apply_expected = False
3614 * mhomed,released vs. mhomed,active
3615 * => should be replaced
3618 .line = __location__,
3619 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3622 .type = WREPL_TYPE_MHOMED,
3623 .state = WREPL_STATE_RELEASED,
3624 .node = WREPL_NODE_B,
3626 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3627 .ips = addresses_B_3_4,
3628 .apply_expected = False
3632 .type = WREPL_TYPE_MHOMED,
3633 .state = WREPL_STATE_ACTIVE,
3634 .node = WREPL_NODE_B,
3636 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3637 .ips = addresses_A_3_4,
3638 .apply_expected = True
3643 * mhomed,released vs. mhomed,tombstone
3644 * => should be replaced
3647 .line = __location__,
3648 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3651 .type = WREPL_TYPE_MHOMED,
3652 .state = WREPL_STATE_RELEASED,
3653 .node = WREPL_NODE_B,
3655 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3656 .ips = addresses_A_3_4,
3657 .apply_expected = False
3661 .type = WREPL_TYPE_MHOMED,
3662 .state = WREPL_STATE_TOMBSTONE,
3663 .node = WREPL_NODE_B,
3665 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3666 .ips = addresses_B_3_4,
3667 .apply_expected = True
3672 * mhomed,tombstone vs. mhomed,active
3673 * => should be replaced
3676 .line = __location__,
3677 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3680 .type = WREPL_TYPE_MHOMED,
3681 .state = WREPL_STATE_TOMBSTONE,
3682 .node = WREPL_NODE_B,
3684 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3685 .ips = addresses_B_3_4,
3686 .apply_expected = True
3690 .type = WREPL_TYPE_MHOMED,
3691 .state = WREPL_STATE_ACTIVE,
3692 .node = WREPL_NODE_B,
3694 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3695 .ips = addresses_A_3_4,
3696 .apply_expected = True
3701 * mhomed,tombstone vs. mhomed,tombstone
3702 * => should be replaced
3705 .line = __location__,
3706 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3709 .type = WREPL_TYPE_MHOMED,
3710 .state = WREPL_STATE_TOMBSTONE,
3711 .node = WREPL_NODE_B,
3713 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3714 .ips = addresses_A_3_4,
3715 .apply_expected = True
3719 .type = WREPL_TYPE_MHOMED,
3720 .state = WREPL_STATE_TOMBSTONE,
3721 .node = WREPL_NODE_B,
3723 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3724 .ips = addresses_B_3_4,
3725 .apply_expected = True
3731 * special group vs special group section,
3734 * sgroup,active vs. sgroup,active
3735 * => should be merged
3738 .line = __location__,
3739 .name = _NBT_NAME("_DIFF_OWNER_SG", 0x00, NULL),
3743 .type = WREPL_TYPE_SGROUP,
3744 .state = WREPL_STATE_ACTIVE,
3745 .node = WREPL_NODE_B,
3747 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3748 .ips = addresses_A_3_4,
3749 .apply_expected = True,
3753 .type = WREPL_TYPE_SGROUP,
3754 .state = WREPL_STATE_ACTIVE,
3755 .node = WREPL_NODE_B,
3757 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3758 .ips = addresses_B_3_4,
3759 .apply_expected = False,
3760 .merge_expected = True
3764 .line = __location__,
3765 .name = _NBT_NAME("_DIFF_OWNER_SG", 0x00, NULL),
3769 .type = WREPL_TYPE_SGROUP,
3770 .state = WREPL_STATE_ACTIVE,
3771 .node = WREPL_NODE_B,
3775 .apply_expected = False
3779 .type = WREPL_TYPE_SGROUP,
3780 .state = WREPL_STATE_ACTIVE,
3781 .node = WREPL_NODE_B,
3785 .apply_expected = False,
3786 .merge_expected = False
3790 .line = __location__,
3791 .name = _NBT_NAME("_DIFF_OWNER_SG", 0x00, NULL),
3795 .type = WREPL_TYPE_SGROUP,
3796 .state = WREPL_STATE_ACTIVE,
3797 .node = WREPL_NODE_B,
3799 .num_ips = ARRAY_SIZE(addresses_A_1),
3800 .ips = addresses_A_1,
3801 .apply_expected = True
3805 .type = WREPL_TYPE_UNIQUE,
3806 .state = WREPL_STATE_TOMBSTONE,
3807 .node = WREPL_NODE_B,
3809 .num_ips = ARRAY_SIZE(addresses_A_1),
3810 .ips = addresses_A_1,
3811 .apply_expected = True
3816 * This should be the last record in this array,
3817 * we need to make sure the we leave a tombstoned unique entry
3821 .line = __location__,
3822 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3826 .type = WREPL_TYPE_UNIQUE,
3827 .state = WREPL_STATE_TOMBSTONE,
3828 .node = WREPL_NODE_B,
3830 .num_ips = ARRAY_SIZE(addresses_A_1),
3831 .ips = addresses_A_1,
3832 .apply_expected = True
3836 .type = WREPL_TYPE_UNIQUE,
3837 .state = WREPL_STATE_TOMBSTONE,
3838 .node = WREPL_NODE_B,
3840 .num_ips = ARRAY_SIZE(addresses_A_1),
3841 .ips = addresses_A_1,
3842 .apply_expected = True
3844 }}; /* do not add entries here, this should be the last record! */
3846 if (!ctx) return False;
3848 wins_name_r1 = &wins_name1;
3849 wins_name_r2 = &wins_name2;
3851 printf("Test Replica Conflicts with different owners\n");
3853 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
3855 if (!records[i].extra && !records[i].cleanup) {
3856 /* we should test the worst cases */
3857 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
3858 printf("(%s) Programmer error, invalid record[%u]: %s\n",
3859 __location__, i, records[i].line);
3861 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
3862 printf("(%s) Programmer error, invalid record[%u]: %s\n",
3863 __location__, i, records[i].line);
3868 if (!records[i].cleanup) {
3869 const char *expected;
3872 if (records[i].r2.merge_expected) {
3874 } else if (records[i].r2.apply_expected) {
3875 expected = "REPLACE";
3877 expected = "NOT REPLACE";
3880 if (!records[i].r1.ips && !records[i].r2.ips) {
3882 } else if (records[i].r1.ips==records[i].r2.ips) {
3888 printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
3889 wrepl_name_type_string(records[i].r1.type),
3890 wrepl_name_state_string(records[i].r1.state),
3891 (records[i].r1.is_static?",static":""),
3892 wrepl_name_type_string(records[i].r2.type),
3893 wrepl_name_state_string(records[i].r2.state),
3894 (records[i].r2.is_static?",static":""),
3901 wins_name_r1->name = &records[i].name;
3902 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
3903 records[i].r1.state,
3905 records[i].r1.is_static);
3906 wins_name_r1->id = ++records[i].r1.owner->max_version;
3907 if (wins_name_r1->flags & 2) {
3908 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
3909 wins_name_r1->addresses.addresses.ips = discard_const(records[i].r1.ips);
3911 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
3913 wins_name_r1->unknown = "255.255.255.255";
3916 ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1);
3917 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
3918 wins_name_r1, records[i].r1.apply_expected);
3923 wins_name_r2->name = &records[i].name;
3924 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
3925 records[i].r2.state,
3927 records[i].r2.is_static);
3928 wins_name_r2->id = ++records[i].r2.owner->max_version;
3929 if (wins_name_r2->flags & 2) {
3930 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
3931 wins_name_r2->addresses.addresses.ips = discard_const(records[i].r2.ips);
3933 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
3935 wins_name_r2->unknown = "255.255.255.255";
3938 ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2);
3939 if (records[i].r1.state == WREPL_STATE_RELEASED) {
3940 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
3941 wins_name_r1, False);
3942 } else if (records[i].r2.merge_expected) {
3943 ret &= test_wrepl_is_merged(ctx, wins_name_r1, wins_name_r2);
3944 } else if (records[i].r1.owner != records[i].r2.owner) {
3946 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
3947 ret &= test_wrepl_is_applied(ctx, records[i].r1.owner,
3948 wins_name_r1, _expected);
3950 if (records[i].r2.state == WREPL_STATE_RELEASED) {
3951 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
3952 wins_name_r2, False);
3953 } else if (!records[i].r2.merge_expected) {
3954 ret &= test_wrepl_is_applied(ctx, records[i].r2.owner,
3955 wins_name_r2, records[i].r2.apply_expected);
3958 /* the first one is a cleanup run */
3959 if (!ret && i == 0) ret = True;
3962 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
3970 static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_conn *ctx)
3974 struct wrepl_wins_name wins_name_;
3975 struct wrepl_wins_name *wins_name = &wins_name_;
3976 struct nbt_name_register name_register_;
3977 struct nbt_name_register *name_register = &name_register_;
3978 struct nbt_name_release release_;
3979 struct nbt_name_release *release = &release_;
3982 const char *line; /* just better debugging */
3983 struct nbt_name name;
3988 const struct wrepl_ip *ips;
3989 BOOL apply_expected;
3992 enum wrepl_name_type type;
3993 enum wrepl_name_state state;
3994 enum wrepl_name_node node;
3997 const struct wrepl_ip *ips;
3998 BOOL apply_expected;
4002 * unique vs. unique section
4005 * unique,released vs. unique,active with same ip(s)
4008 .line = __location__,
4009 .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL),
4013 .num_ips = ctx->addresses_best_num,
4014 .ips = ctx->addresses_best,
4015 .apply_expected = True
4018 .type = WREPL_TYPE_UNIQUE,
4019 .state = WREPL_STATE_ACTIVE,
4020 .node = WREPL_NODE_B,
4022 .num_ips = ctx->addresses_best_num,
4023 .ips = ctx->addresses_best,
4024 .apply_expected = True
4028 * unique,released vs. unique,active with different ip(s)
4031 .line = __location__,
4032 .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL),
4036 .num_ips = ctx->addresses_best_num,
4037 .ips = ctx->addresses_best,
4038 .apply_expected = True
4041 .type = WREPL_TYPE_UNIQUE,
4042 .state = WREPL_STATE_ACTIVE,
4043 .node = WREPL_NODE_B,
4045 .num_ips = ARRAY_SIZE(addresses_B_1),
4046 .ips = addresses_B_1,
4047 .apply_expected = True
4051 * unique,released vs. unique,tombstone with same ip(s)
4054 .line = __location__,
4055 .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL),
4059 .num_ips = ctx->addresses_best_num,
4060 .ips = ctx->addresses_best,
4061 .apply_expected = True
4064 .type = WREPL_TYPE_UNIQUE,
4065 .state = WREPL_STATE_TOMBSTONE,
4066 .node = WREPL_NODE_B,
4068 .num_ips = ctx->addresses_best_num,
4069 .ips = ctx->addresses_best,
4070 .apply_expected = True
4074 * unique,released vs. unique,tombstone with different ip(s)
4077 .line = __location__,
4078 .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL),
4082 .num_ips = ctx->addresses_best_num,
4083 .ips = ctx->addresses_best,
4084 .apply_expected = True
4087 .type = WREPL_TYPE_UNIQUE,
4088 .state = WREPL_STATE_TOMBSTONE,
4089 .node = WREPL_NODE_B,
4091 .num_ips = ARRAY_SIZE(addresses_B_1),
4092 .ips = addresses_B_1,
4093 .apply_expected = True
4097 * unique vs. group section
4100 * unique,released vs. group,active with same ip(s)
4103 .line = __location__,
4104 .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL),
4108 .num_ips = ctx->addresses_best_num,
4109 .ips = ctx->addresses_best,
4110 .apply_expected = True
4113 .type = WREPL_TYPE_GROUP,
4114 .state = WREPL_STATE_ACTIVE,
4115 .node = WREPL_NODE_B,
4117 .num_ips = ctx->addresses_best_num,
4118 .ips = ctx->addresses_best,
4119 .apply_expected = True
4123 * unique,released vs. group,active with different ip(s)
4126 .line = __location__,
4127 .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL),
4131 .num_ips = ctx->addresses_best_num,
4132 .ips = ctx->addresses_best,
4133 .apply_expected = True
4136 .type = WREPL_TYPE_GROUP,
4137 .state = WREPL_STATE_ACTIVE,
4138 .node = WREPL_NODE_B,
4140 .num_ips = ARRAY_SIZE(addresses_B_1),
4141 .ips = addresses_B_1,
4142 .apply_expected = True
4146 * unique,released vs. group,tombstone with same ip(s)
4149 .line = __location__,
4150 .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL),
4154 .num_ips = ctx->addresses_best_num,
4155 .ips = ctx->addresses_best,
4156 .apply_expected = True
4159 .type = WREPL_TYPE_GROUP,
4160 .state = WREPL_STATE_TOMBSTONE,
4161 .node = WREPL_NODE_B,
4163 .num_ips = ctx->addresses_best_num,
4164 .ips = ctx->addresses_best,
4165 .apply_expected = True
4169 * unique,released vs. group,tombstone with different ip(s)
4172 .line = __location__,
4173 .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL),
4177 .num_ips = ctx->addresses_best_num,
4178 .ips = ctx->addresses_best,
4179 .apply_expected = True
4182 .type = WREPL_TYPE_GROUP,
4183 .state = WREPL_STATE_TOMBSTONE,
4184 .node = WREPL_NODE_B,
4186 .num_ips = ARRAY_SIZE(addresses_B_1),
4187 .ips = addresses_B_1,
4188 .apply_expected = True
4192 * unique vs. special group section
4195 * unique,released vs. sgroup,active with same ip(s)
4198 .line = __location__,
4199 .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL),
4203 .num_ips = ctx->addresses_best_num,
4204 .ips = ctx->addresses_best,
4205 .apply_expected = True
4208 .type = WREPL_TYPE_SGROUP,
4209 .state = WREPL_STATE_ACTIVE,
4210 .node = WREPL_NODE_B,
4212 .num_ips = ctx->addresses_best_num,
4213 .ips = ctx->addresses_best,
4214 .apply_expected = True
4218 * unique,released vs. sgroup,active with different ip(s)
4221 .line = __location__,
4222 .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL),
4226 .num_ips = ctx->addresses_best_num,
4227 .ips = ctx->addresses_best,
4228 .apply_expected = True
4231 .type = WREPL_TYPE_SGROUP,
4232 .state = WREPL_STATE_ACTIVE,
4233 .node = WREPL_NODE_B,
4235 .num_ips = ARRAY_SIZE(addresses_B_1),
4236 .ips = addresses_B_1,
4237 .apply_expected = True
4241 * unique,released vs. sgroup,tombstone with same ip(s)
4244 .line = __location__,
4245 .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL),
4249 .num_ips = ctx->addresses_best_num,
4250 .ips = ctx->addresses_best,
4251 .apply_expected = True
4254 .type = WREPL_TYPE_SGROUP,
4255 .state = WREPL_STATE_TOMBSTONE,
4256 .node = WREPL_NODE_B,
4258 .num_ips = ctx->addresses_best_num,
4259 .ips = ctx->addresses_best,
4260 .apply_expected = True
4264 * unique,released vs. sgroup,tombstone with different ip(s)
4267 .line = __location__,
4268 .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL),
4272 .num_ips = ctx->addresses_best_num,
4273 .ips = ctx->addresses_best,
4274 .apply_expected = True
4277 .type = WREPL_TYPE_SGROUP,
4278 .state = WREPL_STATE_TOMBSTONE,
4279 .node = WREPL_NODE_B,
4281 .num_ips = ARRAY_SIZE(addresses_B_1),
4282 .ips = addresses_B_1,
4283 .apply_expected = True
4287 * unique vs. multi homed section
4290 * unique,released vs. mhomed,active with same ip(s)
4293 .line = __location__,
4294 .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL),
4298 .num_ips = ctx->addresses_best_num,
4299 .ips = ctx->addresses_best,
4300 .apply_expected = True
4303 .type = WREPL_TYPE_MHOMED,
4304 .state = WREPL_STATE_ACTIVE,
4305 .node = WREPL_NODE_B,
4307 .num_ips = ctx->addresses_best_num,
4308 .ips = ctx->addresses_best,
4309 .apply_expected = True
4313 * unique,released vs. mhomed,active with different ip(s)
4316 .line = __location__,
4317 .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL),
4321 .num_ips = ctx->addresses_best_num,
4322 .ips = ctx->addresses_best,
4323 .apply_expected = True
4326 .type = WREPL_TYPE_MHOMED,
4327 .state = WREPL_STATE_ACTIVE,
4328 .node = WREPL_NODE_B,
4330 .num_ips = ARRAY_SIZE(addresses_B_1),
4331 .ips = addresses_B_1,
4332 .apply_expected = True
4336 * unique,released vs. mhomed,tombstone with same ip(s)
4339 .line = __location__,
4340 .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL),
4344 .num_ips = ctx->addresses_best_num,
4345 .ips = ctx->addresses_best,
4346 .apply_expected = True
4349 .type = WREPL_TYPE_MHOMED,
4350 .state = WREPL_STATE_TOMBSTONE,
4351 .node = WREPL_NODE_B,
4353 .num_ips = ctx->addresses_best_num,
4354 .ips = ctx->addresses_best,
4355 .apply_expected = True
4359 * unique,released vs. mhomed,tombstone with different ip(s)
4362 .line = __location__,
4363 .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL),
4367 .num_ips = ctx->addresses_best_num,
4368 .ips = ctx->addresses_best,
4369 .apply_expected = True
4372 .type = WREPL_TYPE_MHOMED,
4373 .state = WREPL_STATE_TOMBSTONE,
4374 .node = WREPL_NODE_B,
4376 .num_ips = ARRAY_SIZE(addresses_B_1),
4377 .ips = addresses_B_1,
4378 .apply_expected = True
4382 * group vs. unique section
4385 * group,released vs. unique,active with same ip(s)
4388 .line = __location__,
4389 .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL),
4391 .nb_flags = NBT_NM_GROUP,
4393 .num_ips = ctx->addresses_best_num,
4394 .ips = ctx->addresses_best,
4395 .apply_expected = True
4398 .type = WREPL_TYPE_UNIQUE,
4399 .state = WREPL_STATE_ACTIVE,
4400 .node = WREPL_NODE_B,
4402 .num_ips = ctx->addresses_best_num,
4403 .ips = ctx->addresses_best,
4404 .apply_expected = False
4408 * group,released vs. unique,active with different ip(s)
4411 .line = __location__,
4412 .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL),
4414 .nb_flags = NBT_NM_GROUP,
4416 .num_ips = ctx->addresses_best_num,
4417 .ips = ctx->addresses_best,
4418 .apply_expected = True
4421 .type = WREPL_TYPE_UNIQUE,
4422 .state = WREPL_STATE_ACTIVE,
4423 .node = WREPL_NODE_B,
4425 .num_ips = ARRAY_SIZE(addresses_B_1),
4426 .ips = addresses_B_1,
4427 .apply_expected = False
4431 * group,released vs. unique,tombstone with same ip(s)
4434 .line = __location__,
4435 .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL),
4437 .nb_flags = NBT_NM_GROUP,
4439 .num_ips = ctx->addresses_best_num,
4440 .ips = ctx->addresses_best,
4441 .apply_expected = True
4444 .type = WREPL_TYPE_UNIQUE,
4445 .state = WREPL_STATE_TOMBSTONE,
4446 .node = WREPL_NODE_B,
4448 .num_ips = ctx->addresses_best_num,
4449 .ips = ctx->addresses_best,
4450 .apply_expected = False
4454 * group,released vs. unique,tombstone with different ip(s)
4457 .line = __location__,
4458 .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL),
4460 .nb_flags = NBT_NM_GROUP,
4462 .num_ips = ctx->addresses_best_num,
4463 .ips = ctx->addresses_best,
4464 .apply_expected = True
4467 .type = WREPL_TYPE_UNIQUE,
4468 .state = WREPL_STATE_TOMBSTONE,
4469 .node = WREPL_NODE_B,
4471 .num_ips = ARRAY_SIZE(addresses_B_1),
4472 .ips = addresses_B_1,
4473 .apply_expected = False
4477 * group vs. group section
4480 * group,released vs. group,active with same ip(s)
4483 .line = __location__,
4484 .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL),
4486 .nb_flags = NBT_NM_GROUP,
4488 .num_ips = ctx->addresses_best_num,
4489 .ips = ctx->addresses_best,
4490 .apply_expected = True
4493 .type = WREPL_TYPE_GROUP,
4494 .state = WREPL_STATE_ACTIVE,
4495 .node = WREPL_NODE_B,
4497 .num_ips = ctx->addresses_best_num,
4498 .ips = ctx->addresses_best,
4499 .apply_expected = True
4503 * group,released vs. group,active with different ip(s)
4506 .line = __location__,
4507 .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL),
4509 .nb_flags = NBT_NM_GROUP,
4511 .num_ips = ctx->addresses_best_num,
4512 .ips = ctx->addresses_best,
4513 .apply_expected = True
4516 .type = WREPL_TYPE_GROUP,
4517 .state = WREPL_STATE_ACTIVE,
4518 .node = WREPL_NODE_B,
4520 .num_ips = ARRAY_SIZE(addresses_B_1),
4521 .ips = addresses_B_1,
4522 .apply_expected = True
4526 * group,released vs. group,tombstone with same ip(s)
4529 .line = __location__,
4530 .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL),
4532 .nb_flags = NBT_NM_GROUP,
4534 .num_ips = ctx->addresses_best_num,
4535 .ips = ctx->addresses_best,
4536 .apply_expected = True
4539 .type = WREPL_TYPE_GROUP,
4540 .state = WREPL_STATE_TOMBSTONE,
4541 .node = WREPL_NODE_B,
4543 .num_ips = ctx->addresses_best_num,
4544 .ips = ctx->addresses_best,
4545 .apply_expected = True
4549 * group,released vs. group,tombstone with different ip(s)
4552 .line = __location__,
4553 .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL),
4555 .nb_flags = NBT_NM_GROUP,
4557 .num_ips = ctx->addresses_best_num,
4558 .ips = ctx->addresses_best,
4559 .apply_expected = True
4562 .type = WREPL_TYPE_GROUP,
4563 .state = WREPL_STATE_TOMBSTONE,
4564 .node = WREPL_NODE_B,
4566 .num_ips = ARRAY_SIZE(addresses_B_1),
4567 .ips = addresses_B_1,
4568 .apply_expected = True
4572 * group vs. special group section
4575 * group,released vs. sgroup,active with same ip(s)
4578 .line = __location__,
4579 .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL),
4581 .nb_flags = NBT_NM_GROUP,
4583 .num_ips = ctx->addresses_best_num,
4584 .ips = ctx->addresses_best,
4585 .apply_expected = True
4588 .type = WREPL_TYPE_SGROUP,
4589 .state = WREPL_STATE_ACTIVE,
4590 .node = WREPL_NODE_B,
4592 .num_ips = ctx->addresses_best_num,
4593 .ips = ctx->addresses_best,
4594 .apply_expected = False
4598 * group,released vs. sgroup,active with different ip(s)
4601 .line = __location__,
4602 .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL),
4604 .nb_flags = NBT_NM_GROUP,
4606 .num_ips = ctx->addresses_best_num,
4607 .ips = ctx->addresses_best,
4608 .apply_expected = True
4611 .type = WREPL_TYPE_SGROUP,
4612 .state = WREPL_STATE_ACTIVE,
4613 .node = WREPL_NODE_B,
4615 .num_ips = ARRAY_SIZE(addresses_B_1),
4616 .ips = addresses_B_1,
4617 .apply_expected = False
4621 * group,released vs. sgroup,tombstone with same ip(s)
4624 .line = __location__,
4625 .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL),
4627 .nb_flags = NBT_NM_GROUP,
4629 .num_ips = ctx->addresses_best_num,
4630 .ips = ctx->addresses_best,
4631 .apply_expected = True
4634 .type = WREPL_TYPE_SGROUP,
4635 .state = WREPL_STATE_TOMBSTONE,
4636 .node = WREPL_NODE_B,
4638 .num_ips = ctx->addresses_best_num,
4639 .ips = ctx->addresses_best,
4640 .apply_expected = False
4644 * group,released vs. sgroup,tombstone with different ip(s)
4647 .line = __location__,
4648 .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL),
4650 .nb_flags = NBT_NM_GROUP,
4652 .num_ips = ctx->addresses_best_num,
4653 .ips = ctx->addresses_best,
4654 .apply_expected = True
4657 .type = WREPL_TYPE_SGROUP,
4658 .state = WREPL_STATE_TOMBSTONE,
4659 .node = WREPL_NODE_B,
4661 .num_ips = ARRAY_SIZE(addresses_B_1),
4662 .ips = addresses_B_1,
4663 .apply_expected = False
4667 * group vs. multi homed section
4670 * group,released vs. mhomed,active with same ip(s)
4673 .line = __location__,
4674 .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL),
4676 .nb_flags = NBT_NM_GROUP,
4678 .num_ips = ctx->addresses_best_num,
4679 .ips = ctx->addresses_best,
4680 .apply_expected = True
4683 .type = WREPL_TYPE_MHOMED,
4684 .state = WREPL_STATE_ACTIVE,
4685 .node = WREPL_NODE_B,
4687 .num_ips = ctx->addresses_best_num,
4688 .ips = ctx->addresses_best,
4689 .apply_expected = False
4693 * group,released vs. mhomed,active with different ip(s)
4696 .line = __location__,
4697 .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL),
4699 .nb_flags = NBT_NM_GROUP,
4701 .num_ips = ctx->addresses_best_num,
4702 .ips = ctx->addresses_best,
4703 .apply_expected = True
4706 .type = WREPL_TYPE_MHOMED,
4707 .state = WREPL_STATE_ACTIVE,
4708 .node = WREPL_NODE_B,
4710 .num_ips = ARRAY_SIZE(addresses_B_1),
4711 .ips = addresses_B_1,
4712 .apply_expected = False
4716 * group,released vs. mhomed,tombstone with same ip(s)
4719 .line = __location__,
4720 .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL),
4722 .nb_flags = NBT_NM_GROUP,
4724 .num_ips = ctx->addresses_best_num,
4725 .ips = ctx->addresses_best,
4726 .apply_expected = True
4729 .type = WREPL_TYPE_MHOMED,
4730 .state = WREPL_STATE_TOMBSTONE,
4731 .node = WREPL_NODE_B,
4733 .num_ips = ctx->addresses_best_num,
4734 .ips = ctx->addresses_best,
4735 .apply_expected = False
4739 * group,released vs. mhomed,tombstone with different ip(s)
4742 .line = __location__,
4743 .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL),
4745 .nb_flags = NBT_NM_GROUP,
4747 .num_ips = ctx->addresses_best_num,
4748 .ips = ctx->addresses_best,
4749 .apply_expected = True
4752 .type = WREPL_TYPE_MHOMED,
4753 .state = WREPL_STATE_TOMBSTONE,
4754 .node = WREPL_NODE_B,
4756 .num_ips = ARRAY_SIZE(addresses_B_1),
4757 .ips = addresses_B_1,
4758 .apply_expected = False
4762 * special group vs. unique section
4765 * sgroup,released vs. unique,active with same ip(s)
4768 .line = __location__,
4769 .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL),
4771 .nb_flags = NBT_NM_GROUP,
4773 .num_ips = ctx->addresses_best_num,
4774 .ips = ctx->addresses_best,
4775 .apply_expected = True
4778 .type = WREPL_TYPE_UNIQUE,
4779 .state = WREPL_STATE_ACTIVE,
4780 .node = WREPL_NODE_B,
4782 .num_ips = ctx->addresses_best_num,
4783 .ips = ctx->addresses_best,
4784 .apply_expected = True
4788 * sgroup,released vs. unique,active with different ip(s)
4791 .line = __location__,
4792 .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL),
4794 .nb_flags = NBT_NM_GROUP,
4796 .num_ips = ctx->addresses_best_num,
4797 .ips = ctx->addresses_best,
4798 .apply_expected = True
4801 .type = WREPL_TYPE_UNIQUE,
4802 .state = WREPL_STATE_ACTIVE,
4803 .node = WREPL_NODE_B,
4805 .num_ips = ARRAY_SIZE(addresses_B_1),
4806 .ips = addresses_B_1,
4807 .apply_expected = True
4811 * sgroup,released vs. unique,tombstone with same ip(s)
4814 .line = __location__,
4815 .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL),
4817 .nb_flags = NBT_NM_GROUP,
4819 .num_ips = ctx->addresses_best_num,
4820 .ips = ctx->addresses_best,
4821 .apply_expected = True
4824 .type = WREPL_TYPE_UNIQUE,
4825 .state = WREPL_STATE_TOMBSTONE,
4826 .node = WREPL_NODE_B,
4828 .num_ips = ctx->addresses_best_num,
4829 .ips = ctx->addresses_best,
4830 .apply_expected = True
4834 * sgroup,released vs. unique,tombstone with different ip(s)
4837 .line = __location__,
4838 .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL),
4840 .nb_flags = NBT_NM_GROUP,
4842 .num_ips = ctx->addresses_best_num,
4843 .ips = ctx->addresses_best,
4844 .apply_expected = True
4847 .type = WREPL_TYPE_UNIQUE,
4848 .state = WREPL_STATE_TOMBSTONE,
4849 .node = WREPL_NODE_B,
4851 .num_ips = ARRAY_SIZE(addresses_B_1),
4852 .ips = addresses_B_1,
4853 .apply_expected = True
4857 * special group vs. group section
4860 * sgroup,released vs. group,active with same ip(s)
4863 .line = __location__,
4864 .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL),
4866 .nb_flags = NBT_NM_GROUP,
4868 .num_ips = ctx->addresses_best_num,
4869 .ips = ctx->addresses_best,
4870 .apply_expected = True
4873 .type = WREPL_TYPE_GROUP,
4874 .state = WREPL_STATE_ACTIVE,
4875 .node = WREPL_NODE_B,
4877 .num_ips = ctx->addresses_best_num,
4878 .ips = ctx->addresses_best,
4879 .apply_expected = True
4883 * sgroup,released vs. group,active with different ip(s)
4886 .line = __location__,
4887 .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL),
4889 .nb_flags = NBT_NM_GROUP,
4891 .num_ips = ctx->addresses_best_num,
4892 .ips = ctx->addresses_best,
4893 .apply_expected = True
4896 .type = WREPL_TYPE_GROUP,
4897 .state = WREPL_STATE_ACTIVE,
4898 .node = WREPL_NODE_B,
4900 .num_ips = ARRAY_SIZE(addresses_B_1),
4901 .ips = addresses_B_1,
4902 .apply_expected = True
4906 * sgroup,released vs. group,tombstone with same ip(s)
4909 .line = __location__,
4910 .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL),
4912 .nb_flags = NBT_NM_GROUP,
4914 .num_ips = ctx->addresses_best_num,
4915 .ips = ctx->addresses_best,
4916 .apply_expected = True
4919 .type = WREPL_TYPE_GROUP,
4920 .state = WREPL_STATE_TOMBSTONE,
4921 .node = WREPL_NODE_B,
4923 .num_ips = ctx->addresses_best_num,
4924 .ips = ctx->addresses_best,
4925 .apply_expected = True
4929 * sgroup,released vs. group,tombstone with different ip(s)
4932 .line = __location__,
4933 .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL),
4935 .nb_flags = NBT_NM_GROUP,
4937 .num_ips = ctx->addresses_best_num,
4938 .ips = ctx->addresses_best,
4939 .apply_expected = True
4942 .type = WREPL_TYPE_GROUP,
4943 .state = WREPL_STATE_TOMBSTONE,
4944 .node = WREPL_NODE_B,
4946 .num_ips = ARRAY_SIZE(addresses_B_1),
4947 .ips = addresses_B_1,
4948 .apply_expected = True
4952 * special group vs. special group section
4955 * sgroup,released vs. sgroup,active with same ip(s)
4958 .line = __location__,
4959 .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL),
4961 .nb_flags = NBT_NM_GROUP,
4963 .num_ips = ctx->addresses_best_num,
4964 .ips = ctx->addresses_best,
4965 .apply_expected = True
4968 .type = WREPL_TYPE_SGROUP,
4969 .state = WREPL_STATE_ACTIVE,
4970 .node = WREPL_NODE_B,
4972 .num_ips = ctx->addresses_best_num,
4973 .ips = ctx->addresses_best,
4974 .apply_expected = True
4978 * sgroup,released vs. sgroup,active with different ip(s)
4981 .line = __location__,
4982 .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL),
4984 .nb_flags = NBT_NM_GROUP,
4986 .num_ips = ctx->addresses_best_num,
4987 .ips = ctx->addresses_best,
4988 .apply_expected = True
4991 .type = WREPL_TYPE_SGROUP,
4992 .state = WREPL_STATE_ACTIVE,
4993 .node = WREPL_NODE_B,
4995 .num_ips = ARRAY_SIZE(addresses_B_1),
4996 .ips = addresses_B_1,
4997 .apply_expected = True
5001 * sgroup,released vs. sgroup,tombstone with same ip(s)
5004 .line = __location__,
5005 .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL),
5007 .nb_flags = NBT_NM_GROUP,
5009 .num_ips = ctx->addresses_best_num,
5010 .ips = ctx->addresses_best,
5011 .apply_expected = True
5014 .type = WREPL_TYPE_SGROUP,
5015 .state = WREPL_STATE_TOMBSTONE,
5016 .node = WREPL_NODE_B,
5018 .num_ips = ctx->addresses_best_num,
5019 .ips = ctx->addresses_best,
5020 .apply_expected = True
5024 * sgroup,released vs. sgroup,tombstone with different ip(s)
5027 .line = __location__,
5028 .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL),
5030 .nb_flags = NBT_NM_GROUP,
5032 .num_ips = ctx->addresses_best_num,
5033 .ips = ctx->addresses_best,
5034 .apply_expected = True
5037 .type = WREPL_TYPE_SGROUP,
5038 .state = WREPL_STATE_TOMBSTONE,
5039 .node = WREPL_NODE_B,
5041 .num_ips = ARRAY_SIZE(addresses_B_1),
5042 .ips = addresses_B_1,
5043 .apply_expected = True
5047 * special group vs. multi homed section
5050 * sgroup,released vs. mhomed,active with same ip(s)
5053 .line = __location__,
5054 .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL),
5056 .nb_flags = NBT_NM_GROUP,
5058 .num_ips = ctx->addresses_best_num,
5059 .ips = ctx->addresses_best,
5060 .apply_expected = True
5063 .type = WREPL_TYPE_MHOMED,
5064 .state = WREPL_STATE_ACTIVE,
5065 .node = WREPL_NODE_B,
5067 .num_ips = ctx->addresses_best_num,
5068 .ips = ctx->addresses_best,
5069 .apply_expected = True
5073 * sgroup,released vs. mhomed,active with different ip(s)
5076 .line = __location__,
5077 .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL),
5079 .nb_flags = NBT_NM_GROUP,
5081 .num_ips = ctx->addresses_best_num,
5082 .ips = ctx->addresses_best,
5083 .apply_expected = True
5086 .type = WREPL_TYPE_MHOMED,
5087 .state = WREPL_STATE_ACTIVE,
5088 .node = WREPL_NODE_B,
5090 .num_ips = ARRAY_SIZE(addresses_B_1),
5091 .ips = addresses_B_1,
5092 .apply_expected = True
5096 * sgroup,released vs. mhomed,tombstone with same ip(s)
5099 .line = __location__,
5100 .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL),
5102 .nb_flags = NBT_NM_GROUP,
5104 .num_ips = ctx->addresses_best_num,
5105 .ips = ctx->addresses_best,
5106 .apply_expected = True
5109 .type = WREPL_TYPE_MHOMED,
5110 .state = WREPL_STATE_TOMBSTONE,
5111 .node = WREPL_NODE_B,
5113 .num_ips = ctx->addresses_best_num,
5114 .ips = ctx->addresses_best,
5115 .apply_expected = True
5119 * sgroup,released vs. mhomed,tombstone with different ip(s)
5122 .line = __location__,
5123 .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL),
5125 .nb_flags = NBT_NM_GROUP,
5127 .num_ips = ctx->addresses_best_num,
5128 .ips = ctx->addresses_best,
5129 .apply_expected = True
5132 .type = WREPL_TYPE_MHOMED,
5133 .state = WREPL_STATE_TOMBSTONE,
5134 .node = WREPL_NODE_B,
5136 .num_ips = ARRAY_SIZE(addresses_B_1),
5137 .ips = addresses_B_1,
5138 .apply_expected = True
5142 * multi homed vs. unique section
5145 * mhomed,released vs. unique,active with same ip(s)
5148 .line = __location__,
5149 .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL),
5153 .num_ips = ctx->addresses_best_num,
5154 .ips = ctx->addresses_best,
5155 .apply_expected = True
5158 .type = WREPL_TYPE_UNIQUE,
5159 .state = WREPL_STATE_ACTIVE,
5160 .node = WREPL_NODE_B,
5162 .num_ips = ctx->addresses_best_num,
5163 .ips = ctx->addresses_best,
5164 .apply_expected = True
5168 * mhomed,released vs. unique,active with different ip(s)
5171 .line = __location__,
5172 .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL),
5176 .num_ips = ctx->addresses_best_num,
5177 .ips = ctx->addresses_best,
5178 .apply_expected = True
5181 .type = WREPL_TYPE_UNIQUE,
5182 .state = WREPL_STATE_ACTIVE,
5183 .node = WREPL_NODE_B,
5185 .num_ips = ARRAY_SIZE(addresses_B_1),
5186 .ips = addresses_B_1,
5187 .apply_expected = True
5191 * mhomed,released vs. unique,tombstone with same ip(s)
5194 .line = __location__,
5195 .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL),
5199 .num_ips = ctx->addresses_best_num,
5200 .ips = ctx->addresses_best,
5201 .apply_expected = True
5204 .type = WREPL_TYPE_UNIQUE,
5205 .state = WREPL_STATE_TOMBSTONE,
5206 .node = WREPL_NODE_B,
5208 .num_ips = ctx->addresses_best_num,
5209 .ips = ctx->addresses_best,
5210 .apply_expected = True
5214 * mhomed,released vs. unique,tombstone with different ip(s)
5217 .line = __location__,
5218 .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL),
5222 .num_ips = ctx->addresses_best_num,
5223 .ips = ctx->addresses_best,
5224 .apply_expected = True
5227 .type = WREPL_TYPE_UNIQUE,
5228 .state = WREPL_STATE_TOMBSTONE,
5229 .node = WREPL_NODE_B,
5231 .num_ips = ARRAY_SIZE(addresses_B_1),
5232 .ips = addresses_B_1,
5233 .apply_expected = True
5237 * multi homed vs. group section
5240 * mhomed,released vs. group,active with same ip(s)
5243 .line = __location__,
5244 .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL),
5248 .num_ips = ctx->addresses_best_num,
5249 .ips = ctx->addresses_best,
5250 .apply_expected = True
5253 .type = WREPL_TYPE_GROUP,
5254 .state = WREPL_STATE_ACTIVE,
5255 .node = WREPL_NODE_B,
5257 .num_ips = ctx->addresses_best_num,
5258 .ips = ctx->addresses_best,
5259 .apply_expected = True
5263 * mhomed,released vs. group,active with different ip(s)
5266 .line = __location__,
5267 .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL),
5271 .num_ips = ctx->addresses_best_num,
5272 .ips = ctx->addresses_best,
5273 .apply_expected = True
5276 .type = WREPL_TYPE_GROUP,
5277 .state = WREPL_STATE_ACTIVE,
5278 .node = WREPL_NODE_B,
5280 .num_ips = ARRAY_SIZE(addresses_B_1),
5281 .ips = addresses_B_1,
5282 .apply_expected = True
5286 * mhomed,released vs. group,tombstone with same ip(s)
5289 .line = __location__,
5290 .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL),
5294 .num_ips = ctx->addresses_best_num,
5295 .ips = ctx->addresses_best,
5296 .apply_expected = True
5299 .type = WREPL_TYPE_GROUP,
5300 .state = WREPL_STATE_TOMBSTONE,
5301 .node = WREPL_NODE_B,
5303 .num_ips = ctx->addresses_best_num,
5304 .ips = ctx->addresses_best,
5305 .apply_expected = True
5309 * mhomed,released vs. group,tombstone with different ip(s)
5312 .line = __location__,
5313 .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL),
5317 .num_ips = ctx->addresses_best_num,
5318 .ips = ctx->addresses_best,
5319 .apply_expected = True
5322 .type = WREPL_TYPE_GROUP,
5323 .state = WREPL_STATE_TOMBSTONE,
5324 .node = WREPL_NODE_B,
5326 .num_ips = ARRAY_SIZE(addresses_B_1),
5327 .ips = addresses_B_1,
5328 .apply_expected = True
5332 * multi homed vs. special group section
5335 * mhomed,released vs. sgroup,active with same ip(s)
5338 .line = __location__,
5339 .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL),
5343 .num_ips = ctx->addresses_best_num,
5344 .ips = ctx->addresses_best,
5345 .apply_expected = True
5348 .type = WREPL_TYPE_SGROUP,
5349 .state = WREPL_STATE_ACTIVE,
5350 .node = WREPL_NODE_B,
5352 .num_ips = ctx->addresses_best_num,
5353 .ips = ctx->addresses_best,
5354 .apply_expected = True
5358 * mhomed,released vs. sgroup,active with different ip(s)
5361 .line = __location__,
5362 .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL),
5366 .num_ips = ctx->addresses_best_num,
5367 .ips = ctx->addresses_best,
5368 .apply_expected = True
5371 .type = WREPL_TYPE_SGROUP,
5372 .state = WREPL_STATE_ACTIVE,
5373 .node = WREPL_NODE_B,
5375 .num_ips = ARRAY_SIZE(addresses_B_1),
5376 .ips = addresses_B_1,
5377 .apply_expected = True
5381 * mhomed,released vs. sgroup,tombstone with same ip(s)
5384 .line = __location__,
5385 .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL),
5389 .num_ips = ctx->addresses_best_num,
5390 .ips = ctx->addresses_best,
5391 .apply_expected = True
5394 .type = WREPL_TYPE_SGROUP,
5395 .state = WREPL_STATE_TOMBSTONE,
5396 .node = WREPL_NODE_B,
5398 .num_ips = ctx->addresses_best_num,
5399 .ips = ctx->addresses_best,
5400 .apply_expected = True
5404 * mhomed,released vs. sgroup,tombstone with different ip(s)
5407 .line = __location__,
5408 .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL),
5412 .num_ips = ctx->addresses_best_num,
5413 .ips = ctx->addresses_best,
5414 .apply_expected = True
5417 .type = WREPL_TYPE_SGROUP,
5418 .state = WREPL_STATE_TOMBSTONE,
5419 .node = WREPL_NODE_B,
5421 .num_ips = ARRAY_SIZE(addresses_B_1),
5422 .ips = addresses_B_1,
5423 .apply_expected = True
5427 * multi homed vs. multi homed section
5430 * mhomed,released vs. mhomed,active with same ip(s)
5433 .line = __location__,
5434 .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL),
5438 .num_ips = ctx->addresses_best_num,
5439 .ips = ctx->addresses_best,
5440 .apply_expected = True
5443 .type = WREPL_TYPE_MHOMED,
5444 .state = WREPL_STATE_ACTIVE,
5445 .node = WREPL_NODE_B,
5447 .num_ips = ctx->addresses_best_num,
5448 .ips = ctx->addresses_best,
5449 .apply_expected = True
5453 * mhomed,released vs. mhomed,active with different ip(s)
5456 .line = __location__,
5457 .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL),
5461 .num_ips = ctx->addresses_best_num,
5462 .ips = ctx->addresses_best,
5463 .apply_expected = True
5466 .type = WREPL_TYPE_MHOMED,
5467 .state = WREPL_STATE_ACTIVE,
5468 .node = WREPL_NODE_B,
5470 .num_ips = ARRAY_SIZE(addresses_B_1),
5471 .ips = addresses_B_1,
5472 .apply_expected = True
5476 * mhomed,released vs. mhomed,tombstone with same ip(s)
5479 .line = __location__,
5480 .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL),
5484 .num_ips = ctx->addresses_best_num,
5485 .ips = ctx->addresses_best,
5486 .apply_expected = True
5489 .type = WREPL_TYPE_MHOMED,
5490 .state = WREPL_STATE_TOMBSTONE,
5491 .node = WREPL_NODE_B,
5493 .num_ips = ctx->addresses_best_num,
5494 .ips = ctx->addresses_best,
5495 .apply_expected = True
5499 * mhomed,released vs. mhomed,tombstone with different ip(s)
5502 .line = __location__,
5503 .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL),
5507 .num_ips = ctx->addresses_best_num,
5508 .ips = ctx->addresses_best,
5509 .apply_expected = True
5512 .type = WREPL_TYPE_MHOMED,
5513 .state = WREPL_STATE_TOMBSTONE,
5514 .node = WREPL_NODE_B,
5516 .num_ips = ARRAY_SIZE(addresses_B_1),
5517 .ips = addresses_B_1,
5518 .apply_expected = True
5523 if (!ctx) return False;
5525 printf("Test Replica records vs. owned released records\n");
5527 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
5528 printf("%s => %s\n", nbt_name_string(ctx, &records[i].name),
5529 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
5534 name_register->in.name = records[i].name;
5535 name_register->in.dest_addr = ctx->address;
5536 name_register->in.address = records[i].wins.ips[0].ip;
5537 name_register->in.nb_flags = records[i].wins.nb_flags;
5538 name_register->in.register_demand= False;
5539 name_register->in.broadcast = False;
5540 name_register->in.multi_homed = records[i].wins.mhomed;
5541 name_register->in.ttl = 300000;
5542 name_register->in.timeout = 70;
5543 name_register->in.retries = 0;
5545 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
5546 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
5547 printf("No response from %s for name register\n", ctx->address);
5550 if (!NT_STATUS_IS_OK(status)) {
5551 printf("Bad response from %s for name register - %s\n",
5552 ctx->address, nt_errstr(status));
5555 CHECK_VALUE(name_register->out.rcode, 0);
5556 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
5557 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
5558 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
5559 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
5560 CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[0].ip);
5562 /* release the record */
5563 release->in.name = records[i].name;
5564 release->in.dest_addr = ctx->address;
5565 release->in.address = records[i].wins.ips[0].ip;
5566 release->in.nb_flags = records[i].wins.nb_flags;
5567 release->in.broadcast = False;
5568 release->in.timeout = 30;
5569 release->in.retries = 0;
5571 status = nbt_name_release(ctx->nbtsock, ctx, release);
5572 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
5573 printf("No response from %s for name release\n", ctx->address);
5576 if (!NT_STATUS_IS_OK(status)) {
5577 printf("Bad response from %s for name query - %s\n",
5578 ctx->address, nt_errstr(status));
5581 CHECK_VALUE(release->out.rcode, 0);
5586 wins_name->name = &records[i].name;
5587 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
5588 records[i].replica.state,
5589 records[i].replica.node,
5590 records[i].replica.is_static);
5591 wins_name->id = ++ctx->b.max_version;
5592 if (wins_name->flags & 2) {
5593 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
5594 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
5596 wins_name->addresses.ip = records[i].replica.ips[0].ip;
5598 wins_name->unknown = "255.255.255.255";
5600 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
5601 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
5602 records[i].replica.apply_expected);
5604 if (records[i].replica.apply_expected) {
5605 wins_name->name = &records[i].name;
5606 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
5607 WREPL_STATE_TOMBSTONE,
5608 WREPL_NODE_B, False);
5609 wins_name->id = ++ctx->b.max_version;
5610 wins_name->addresses.ip = addresses_B_1[0].ip;
5611 wins_name->unknown = "255.255.255.255";
5613 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
5614 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
5616 release->in.name = records[i].name;
5617 release->in.dest_addr = ctx->address;
5618 release->in.address = records[i].wins.ips[0].ip;
5619 release->in.nb_flags = records[i].wins.nb_flags;
5620 release->in.broadcast = False;
5621 release->in.timeout = 30;
5622 release->in.retries = 0;
5624 status = nbt_name_release(ctx->nbtsock, ctx, release);
5625 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
5626 printf("No response from %s for name release\n", ctx->address);
5629 if (!NT_STATUS_IS_OK(status)) {
5630 printf("Bad response from %s for name query - %s\n",
5631 ctx->address, nt_errstr(status));
5634 CHECK_VALUE(release->out.rcode, 0);
5638 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
5646 struct test_conflict_owned_active_vs_replica_struct {
5647 const char *line; /* just better debugging */
5648 const char *section; /* just better debugging */
5649 struct nbt_name name;
5655 const struct wrepl_ip *ips;
5656 BOOL apply_expected;
5661 BOOL expect_release;
5663 /* when num_ips == 0, then .wins.ips are used */
5665 const struct wrepl_ip *ips;
5668 enum wrepl_name_type type;
5669 enum wrepl_name_state state;
5670 enum wrepl_name_node node;
5673 const struct wrepl_ip *ips;
5674 BOOL apply_expected;
5679 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
5680 struct nbt_name_packet *req_packet,
5681 const struct nbt_peer_socket *src);
5683 static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_conn *ctx)
5687 struct wrepl_wins_name wins_name_;
5688 struct wrepl_wins_name *wins_name = &wins_name_;
5689 struct nbt_name_register name_register_;
5690 struct nbt_name_register *name_register = &name_register_;
5691 struct nbt_name_release release_;
5692 struct nbt_name_release *release = &release_;
5694 struct test_conflict_owned_active_vs_replica_struct records[] = {
5696 * unique vs. unique section
5699 * unique,active vs. unique,active with same ip(s), unchecked
5702 .line = __location__,
5703 .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL),
5707 .num_ips = ctx->addresses_best_num,
5708 .ips = ctx->addresses_best,
5709 .apply_expected = True
5715 .type = WREPL_TYPE_UNIQUE,
5716 .state = WREPL_STATE_ACTIVE,
5717 .node = WREPL_NODE_B,
5719 .num_ips = ctx->addresses_best_num,
5720 .ips = ctx->addresses_best,
5721 .apply_expected = True
5725 * unique,active vs. unique,active with different ip(s), positive response
5728 .line = __location__,
5729 .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL),
5733 .num_ips = ctx->addresses_best_num,
5734 .ips = ctx->addresses_best,
5735 .apply_expected = True
5742 .type = WREPL_TYPE_UNIQUE,
5743 .state = WREPL_STATE_ACTIVE,
5744 .node = WREPL_NODE_B,
5746 .num_ips = ARRAY_SIZE(addresses_B_1),
5747 .ips = addresses_B_1,
5748 .apply_expected = False
5752 * unique,active vs. unique,active with different ip(s), positive response other ips
5755 .line = __location__,
5756 .name = _NBT_NAME("_UA_UA_DI_O", 0x00, NULL),
5760 .num_ips = ctx->addresses_best_num,
5761 .ips = ctx->addresses_best,
5762 .apply_expected = True
5767 .num_ips = ARRAY_SIZE(addresses_A_3_4),
5768 .ips = addresses_A_3_4,
5771 .type = WREPL_TYPE_UNIQUE,
5772 .state = WREPL_STATE_ACTIVE,
5773 .node = WREPL_NODE_B,
5775 .num_ips = ARRAY_SIZE(addresses_B_1),
5776 .ips = addresses_B_1,
5777 .apply_expected = False
5781 * unique,active vs. unique,active with different ip(s), negative response
5784 .line = __location__,
5785 .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL),
5789 .num_ips = ctx->addresses_best_num,
5790 .ips = ctx->addresses_best,
5791 .apply_expected = True
5798 .type = WREPL_TYPE_UNIQUE,
5799 .state = WREPL_STATE_ACTIVE,
5800 .node = WREPL_NODE_B,
5802 .num_ips = ARRAY_SIZE(addresses_B_1),
5803 .ips = addresses_B_1,
5804 .apply_expected = True
5808 * unique,active vs. unique,tombstone with same ip(s), unchecked
5811 .line = __location__,
5812 .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL),
5816 .num_ips = ctx->addresses_best_num,
5817 .ips = ctx->addresses_best,
5818 .apply_expected = True
5824 .type = WREPL_TYPE_UNIQUE,
5825 .state = WREPL_STATE_TOMBSTONE,
5826 .node = WREPL_NODE_B,
5828 .num_ips = ctx->addresses_best_num,
5829 .ips = ctx->addresses_best,
5830 .apply_expected = False
5834 * unique,active vs. unique,tombstone with different ip(s), unchecked
5837 .line = __location__,
5838 .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL),
5842 .num_ips = ctx->addresses_best_num,
5843 .ips = ctx->addresses_best,
5844 .apply_expected = True
5850 .type = WREPL_TYPE_UNIQUE,
5851 .state = WREPL_STATE_TOMBSTONE,
5852 .node = WREPL_NODE_B,
5854 .num_ips = ARRAY_SIZE(addresses_B_1),
5855 .ips = addresses_B_1,
5856 .apply_expected = False
5860 * unique vs. group section
5863 * unique,active vs. group,active with same ip(s), release expected
5866 .line = __location__,
5867 .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL),
5871 .num_ips = ctx->addresses_best_num,
5872 .ips = ctx->addresses_best,
5873 .apply_expected = True
5877 .expect_release = True,
5880 .type = WREPL_TYPE_GROUP,
5881 .state = WREPL_STATE_ACTIVE,
5882 .node = WREPL_NODE_B,
5884 .num_ips = ctx->addresses_best_num,
5885 .ips = ctx->addresses_best,
5886 .apply_expected = True
5890 * unique,active vs. group,active with different ip(s), release expected
5893 .line = __location__,
5894 .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL),
5898 .num_ips = ctx->addresses_best_num,
5899 .ips = ctx->addresses_best,
5900 .apply_expected = True
5904 .expect_release = True,
5907 .type = WREPL_TYPE_GROUP,
5908 .state = WREPL_STATE_ACTIVE,
5909 .node = WREPL_NODE_B,
5911 .num_ips = ARRAY_SIZE(addresses_B_1),
5912 .ips = addresses_B_1,
5913 .apply_expected = True
5917 * unique,active vs. group,tombstone with same ip(s), unchecked
5920 .line = __location__,
5921 .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL),
5925 .num_ips = ctx->addresses_best_num,
5926 .ips = ctx->addresses_best,
5927 .apply_expected = True
5933 .type = WREPL_TYPE_GROUP,
5934 .state = WREPL_STATE_TOMBSTONE,
5935 .node = WREPL_NODE_B,
5937 .num_ips = ctx->addresses_best_num,
5938 .ips = ctx->addresses_best,
5939 .apply_expected = False
5943 * unique,active vs. group,tombstone with different ip(s), unchecked
5946 .line = __location__,
5947 .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL),
5951 .num_ips = ctx->addresses_best_num,
5952 .ips = ctx->addresses_best,
5953 .apply_expected = True
5959 .type = WREPL_TYPE_GROUP,
5960 .state = WREPL_STATE_TOMBSTONE,
5961 .node = WREPL_NODE_B,
5963 .num_ips = ARRAY_SIZE(addresses_B_1),
5964 .ips = addresses_B_1,
5965 .apply_expected = False
5969 * unique vs. special group section
5972 * unique,active vs. sgroup,active with same ip(s), release expected
5975 .line = __location__,
5976 .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL),
5980 .num_ips = ctx->addresses_best_num,
5981 .ips = ctx->addresses_best,
5982 .apply_expected = True
5986 .expect_release = True,
5989 .type = WREPL_TYPE_SGROUP,
5990 .state = WREPL_STATE_ACTIVE,
5991 .node = WREPL_NODE_B,
5993 .num_ips = ctx->addresses_best_num,
5994 .ips = ctx->addresses_best,
5995 .apply_expected = True
5999 * unique,active vs. group,active with different ip(s), release expected
6002 .line = __location__,
6003 .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL),
6007 .num_ips = ctx->addresses_best_num,
6008 .ips = ctx->addresses_best,
6009 .apply_expected = True
6013 .expect_release = True,
6016 .type = WREPL_TYPE_SGROUP,
6017 .state = WREPL_STATE_ACTIVE,
6018 .node = WREPL_NODE_B,
6020 .num_ips = ARRAY_SIZE(addresses_B_1),
6021 .ips = addresses_B_1,
6022 .apply_expected = True
6026 * unique,active vs. sgroup,tombstone with same ip(s), unchecked
6029 .line = __location__,
6030 .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL),
6034 .num_ips = ctx->addresses_best_num,
6035 .ips = ctx->addresses_best,
6036 .apply_expected = True
6042 .type = WREPL_TYPE_SGROUP,
6043 .state = WREPL_STATE_TOMBSTONE,
6044 .node = WREPL_NODE_B,
6046 .num_ips = ctx->addresses_best_num,
6047 .ips = ctx->addresses_best,
6048 .apply_expected = False
6052 * unique,active vs. sgroup,tombstone with different ip(s), unchecked
6055 .line = __location__,
6056 .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL),
6060 .num_ips = ctx->addresses_best_num,
6061 .ips = ctx->addresses_best,
6062 .apply_expected = True
6068 .type = WREPL_TYPE_SGROUP,
6069 .state = WREPL_STATE_TOMBSTONE,
6070 .node = WREPL_NODE_B,
6072 .num_ips = ARRAY_SIZE(addresses_B_1),
6073 .ips = addresses_B_1,
6074 .apply_expected = False
6078 * unique vs. multi homed section
6081 * unique,active vs. mhomed,active with same ip(s), unchecked
6084 .line = __location__,
6085 .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL),
6089 .num_ips = ctx->addresses_best_num,
6090 .ips = ctx->addresses_best,
6091 .apply_expected = True
6097 .type = WREPL_TYPE_MHOMED,
6098 .state = WREPL_STATE_ACTIVE,
6099 .node = WREPL_NODE_B,
6101 .num_ips = ctx->addresses_best_num,
6102 .ips = ctx->addresses_best,
6103 .apply_expected = True
6107 * unique,active vs. mhomed,active with superset ip(s), unchecked
6110 .line = __location__,
6111 .name = _NBT_NAME("_UA_MA_SP_U", 0x00, NULL),
6115 .num_ips = ctx->addresses_best_num,
6116 .ips = ctx->addresses_best,
6117 .apply_expected = True
6123 .type = WREPL_TYPE_MHOMED,
6124 .state = WREPL_STATE_ACTIVE,
6125 .node = WREPL_NODE_B,
6127 .num_ips = ctx->addresses_all_num,
6128 .ips = ctx->addresses_all,
6129 .apply_expected = True
6133 * unique,active vs. mhomed,active with different ip(s), positive response
6136 .line = __location__,
6137 .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL),
6141 .num_ips = ctx->addresses_best_num,
6142 .ips = ctx->addresses_best,
6143 .apply_expected = True
6150 .type = WREPL_TYPE_MHOMED,
6151 .state = WREPL_STATE_ACTIVE,
6152 .node = WREPL_NODE_B,
6154 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6155 .ips = addresses_B_3_4,
6156 .apply_expected = False
6160 * unique,active vs. mhomed,active with different ip(s), positive response other ips
6163 .line = __location__,
6164 .name = _NBT_NAME("_UA_MA_DI_O", 0x00, NULL),
6168 .num_ips = ctx->addresses_best_num,
6169 .ips = ctx->addresses_best,
6170 .apply_expected = True
6175 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6176 .ips = addresses_A_3_4,
6179 .type = WREPL_TYPE_MHOMED,
6180 .state = WREPL_STATE_ACTIVE,
6181 .node = WREPL_NODE_B,
6183 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6184 .ips = addresses_B_3_4,
6185 .apply_expected = False
6189 * unique,active vs. mhomed,active with different ip(s), negative response
6192 .line = __location__,
6193 .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL),
6197 .num_ips = ctx->addresses_best_num,
6198 .ips = ctx->addresses_best,
6199 .apply_expected = True
6206 .type = WREPL_TYPE_MHOMED,
6207 .state = WREPL_STATE_ACTIVE,
6208 .node = WREPL_NODE_B,
6210 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6211 .ips = addresses_B_3_4,
6212 .apply_expected = True
6216 * unique,active vs. mhomed,tombstone with same ip(s), unchecked
6219 .line = __location__,
6220 .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL),
6224 .num_ips = ctx->addresses_best_num,
6225 .ips = ctx->addresses_best,
6226 .apply_expected = True
6232 .type = WREPL_TYPE_MHOMED,
6233 .state = WREPL_STATE_TOMBSTONE,
6234 .node = WREPL_NODE_B,
6236 .num_ips = ctx->addresses_best_num,
6237 .ips = ctx->addresses_best,
6238 .apply_expected = False
6242 * unique,active vs. mhomed,tombstone with different ip(s), unchecked
6245 .line = __location__,
6246 .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL),
6250 .num_ips = ctx->addresses_best_num,
6251 .ips = ctx->addresses_best,
6252 .apply_expected = True
6258 .type = WREPL_TYPE_MHOMED,
6259 .state = WREPL_STATE_TOMBSTONE,
6260 .node = WREPL_NODE_B,
6262 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6263 .ips = addresses_B_3_4,
6264 .apply_expected = False
6268 * normal group vs. unique section
6271 * group,active vs. unique,active with same ip(s), unchecked
6274 .line = __location__,
6275 .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL),
6277 .nb_flags = NBT_NM_GROUP,
6279 .num_ips = ctx->addresses_best_num,
6280 .ips = ctx->addresses_best,
6281 .apply_expected = True
6287 .type = WREPL_TYPE_UNIQUE,
6288 .state = WREPL_STATE_ACTIVE,
6289 .node = WREPL_NODE_B,
6291 .num_ips = ctx->addresses_best_num,
6292 .ips = ctx->addresses_best,
6293 .apply_expected = False
6297 * group,active vs. unique,active with different ip(s), unchecked
6300 .line = __location__,
6301 .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL),
6303 .nb_flags = NBT_NM_GROUP,
6305 .num_ips = ctx->addresses_best_num,
6306 .ips = ctx->addresses_best,
6307 .apply_expected = True
6313 .type = WREPL_TYPE_UNIQUE,
6314 .state = WREPL_STATE_ACTIVE,
6315 .node = WREPL_NODE_B,
6317 .num_ips = ARRAY_SIZE(addresses_B_1),
6318 .ips = addresses_B_1,
6319 .apply_expected = False
6323 * group,active vs. unique,tombstone with same ip(s), unchecked
6326 .line = __location__,
6327 .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL),
6329 .nb_flags = NBT_NM_GROUP,
6331 .num_ips = ctx->addresses_best_num,
6332 .ips = ctx->addresses_best,
6333 .apply_expected = True
6339 .type = WREPL_TYPE_UNIQUE,
6340 .state = WREPL_STATE_TOMBSTONE,
6341 .node = WREPL_NODE_B,
6343 .num_ips = ctx->addresses_best_num,
6344 .ips = ctx->addresses_best,
6345 .apply_expected = False
6349 * group,active vs. unique,tombstone with different ip(s), unchecked
6352 .line = __location__,
6353 .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL),
6355 .nb_flags = NBT_NM_GROUP,
6357 .num_ips = ctx->addresses_best_num,
6358 .ips = ctx->addresses_best,
6359 .apply_expected = True
6365 .type = WREPL_TYPE_UNIQUE,
6366 .state = WREPL_STATE_TOMBSTONE,
6367 .node = WREPL_NODE_B,
6369 .num_ips = ARRAY_SIZE(addresses_B_1),
6370 .ips = addresses_B_1,
6371 .apply_expected = False
6375 * normal group vs. normal group section
6378 * group,active vs. group,active with same ip(s), unchecked
6381 .line = __location__,
6382 .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL),
6384 .nb_flags = NBT_NM_GROUP,
6386 .num_ips = ctx->addresses_best_num,
6387 .ips = ctx->addresses_best,
6388 .apply_expected = True
6394 .type = WREPL_TYPE_GROUP,
6395 .state = WREPL_STATE_ACTIVE,
6396 .node = WREPL_NODE_B,
6398 .num_ips = ctx->addresses_best_num,
6399 .ips = ctx->addresses_best,
6400 .apply_expected = True
6404 * group,active vs. group,active with different ip(s), unchecked
6407 .line = __location__,
6408 .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL),
6410 .nb_flags = NBT_NM_GROUP,
6412 .num_ips = ctx->addresses_best_num,
6413 .ips = ctx->addresses_best,
6414 .apply_expected = True
6420 .type = WREPL_TYPE_GROUP,
6421 .state = WREPL_STATE_ACTIVE,
6422 .node = WREPL_NODE_B,
6424 .num_ips = ARRAY_SIZE(addresses_B_1),
6425 .ips = addresses_B_1,
6426 .apply_expected = True
6430 * group,active vs. group,tombstone with same ip(s), unchecked
6433 .line = __location__,
6434 .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL),
6436 .nb_flags = NBT_NM_GROUP,
6438 .num_ips = ctx->addresses_best_num,
6439 .ips = ctx->addresses_best,
6440 .apply_expected = True
6446 .type = WREPL_TYPE_GROUP,
6447 .state = WREPL_STATE_TOMBSTONE,
6448 .node = WREPL_NODE_B,
6450 .num_ips = ctx->addresses_best_num,
6451 .ips = ctx->addresses_best,
6452 .apply_expected = False
6456 * group,active vs. group,tombstone with different ip(s), unchecked
6459 .line = __location__,
6460 .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL),
6462 .nb_flags = NBT_NM_GROUP,
6464 .num_ips = ctx->addresses_best_num,
6465 .ips = ctx->addresses_best,
6466 .apply_expected = True
6472 .type = WREPL_TYPE_GROUP,
6473 .state = WREPL_STATE_TOMBSTONE,
6474 .node = WREPL_NODE_B,
6476 .num_ips = ARRAY_SIZE(addresses_B_1),
6477 .ips = addresses_B_1,
6478 .apply_expected = False
6482 * normal group vs. special group section
6485 * group,active vs. sgroup,active with same ip(s), unchecked
6488 .line = __location__,
6489 .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL),
6491 .nb_flags = NBT_NM_GROUP,
6493 .num_ips = ctx->addresses_best_num,
6494 .ips = ctx->addresses_best,
6495 .apply_expected = True
6501 .type = WREPL_TYPE_SGROUP,
6502 .state = WREPL_STATE_ACTIVE,
6503 .node = WREPL_NODE_B,
6505 .num_ips = ctx->addresses_best_num,
6506 .ips = ctx->addresses_best,
6507 .apply_expected = False
6511 * group,active vs. sgroup,active with different ip(s), unchecked
6514 .line = __location__,
6515 .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL),
6517 .nb_flags = NBT_NM_GROUP,
6519 .num_ips = ctx->addresses_best_num,
6520 .ips = ctx->addresses_best,
6521 .apply_expected = True
6527 .type = WREPL_TYPE_SGROUP,
6528 .state = WREPL_STATE_ACTIVE,
6529 .node = WREPL_NODE_B,
6531 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6532 .ips = addresses_B_3_4,
6533 .apply_expected = False
6537 * group,active vs. sgroup,tombstone with same ip(s), unchecked
6540 .line = __location__,
6541 .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL),
6543 .nb_flags = NBT_NM_GROUP,
6545 .num_ips = ctx->addresses_best_num,
6546 .ips = ctx->addresses_best,
6547 .apply_expected = True
6553 .type = WREPL_TYPE_SGROUP,
6554 .state = WREPL_STATE_TOMBSTONE,
6555 .node = WREPL_NODE_B,
6557 .num_ips = ctx->addresses_best_num,
6558 .ips = ctx->addresses_best,
6559 .apply_expected = False
6563 * group,active vs. sgroup,tombstone with different ip(s), unchecked
6566 .line = __location__,
6567 .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL),
6569 .nb_flags = NBT_NM_GROUP,
6571 .num_ips = ctx->addresses_best_num,
6572 .ips = ctx->addresses_best,
6573 .apply_expected = True
6579 .type = WREPL_TYPE_SGROUP,
6580 .state = WREPL_STATE_TOMBSTONE,
6581 .node = WREPL_NODE_B,
6583 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6584 .ips = addresses_B_3_4,
6585 .apply_expected = False
6589 * normal group vs. multi homed section
6592 * group,active vs. mhomed,active with same ip(s), unchecked
6595 .line = __location__,
6596 .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL),
6598 .nb_flags = NBT_NM_GROUP,
6600 .num_ips = ctx->addresses_best_num,
6601 .ips = ctx->addresses_best,
6602 .apply_expected = True
6608 .type = WREPL_TYPE_MHOMED,
6609 .state = WREPL_STATE_ACTIVE,
6610 .node = WREPL_NODE_B,
6612 .num_ips = ctx->addresses_best_num,
6613 .ips = ctx->addresses_best,
6614 .apply_expected = False
6618 * group,active vs. mhomed,active with different ip(s), unchecked
6621 .line = __location__,
6622 .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL),
6624 .nb_flags = NBT_NM_GROUP,
6626 .num_ips = ctx->addresses_best_num,
6627 .ips = ctx->addresses_best,
6628 .apply_expected = True
6634 .type = WREPL_TYPE_MHOMED,
6635 .state = WREPL_STATE_ACTIVE,
6636 .node = WREPL_NODE_B,
6638 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6639 .ips = addresses_B_3_4,
6640 .apply_expected = False
6644 * group,active vs. mhomed,tombstone with same ip(s), unchecked
6647 .line = __location__,
6648 .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL),
6650 .nb_flags = NBT_NM_GROUP,
6652 .num_ips = ctx->addresses_best_num,
6653 .ips = ctx->addresses_best,
6654 .apply_expected = True
6660 .type = WREPL_TYPE_MHOMED,
6661 .state = WREPL_STATE_TOMBSTONE,
6662 .node = WREPL_NODE_B,
6664 .num_ips = ctx->addresses_best_num,
6665 .ips = ctx->addresses_best,
6666 .apply_expected = False
6670 * group,active vs. mhomed,tombstone with different ip(s), unchecked
6673 .line = __location__,
6674 .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL),
6676 .nb_flags = NBT_NM_GROUP,
6678 .num_ips = ctx->addresses_best_num,
6679 .ips = ctx->addresses_best,
6680 .apply_expected = True
6686 .type = WREPL_TYPE_MHOMED,
6687 .state = WREPL_STATE_TOMBSTONE,
6688 .node = WREPL_NODE_B,
6690 .num_ips = ARRAY_SIZE(addresses_B_3_4),
6691 .ips = addresses_B_3_4,
6692 .apply_expected = False
6696 * special group vs. unique section
6699 * sgroup,active vs. unique,active with same ip(s), unchecked
6702 .line = __location__,
6703 .name = _NBT_NAME("_SA_UA_SI_U", 0x1C, NULL),
6705 .nb_flags = NBT_NM_GROUP,
6707 .num_ips = ctx->addresses_best_num,
6708 .ips = ctx->addresses_best,
6709 .apply_expected = True
6715 .type = WREPL_TYPE_UNIQUE,
6716 .state = WREPL_STATE_ACTIVE,
6717 .node = WREPL_NODE_B,
6719 .num_ips = ctx->addresses_best_num,
6720 .ips = ctx->addresses_best,
6721 .apply_expected = False
6725 * sgroup,active vs. unique,active with different ip(s), unchecked
6728 .line = __location__,
6729 .name = _NBT_NAME("_SA_UA_DI_U", 0x1C, NULL),
6731 .nb_flags = NBT_NM_GROUP,
6733 .num_ips = ctx->addresses_best_num,
6734 .ips = ctx->addresses_best,
6735 .apply_expected = True
6741 .type = WREPL_TYPE_UNIQUE,
6742 .state = WREPL_STATE_ACTIVE,
6743 .node = WREPL_NODE_B,
6745 .num_ips = ARRAY_SIZE(addresses_B_1),
6746 .ips = addresses_B_1,
6747 .apply_expected = False
6751 * sgroup,active vs. unique,tombstone with same ip(s), unchecked
6754 .line = __location__,
6755 .name = _NBT_NAME("_SA_UT_SI_U", 0x1C, NULL),
6757 .nb_flags = NBT_NM_GROUP,
6759 .num_ips = ctx->addresses_best_num,
6760 .ips = ctx->addresses_best,
6761 .apply_expected = True
6767 .type = WREPL_TYPE_UNIQUE,
6768 .state = WREPL_STATE_TOMBSTONE,
6769 .node = WREPL_NODE_B,
6771 .num_ips = ctx->addresses_best_num,
6772 .ips = ctx->addresses_best,
6773 .apply_expected = False
6777 * sgroup,active vs. unique,tombstone with different ip(s), unchecked
6780 .line = __location__,
6781 .name = _NBT_NAME("_SA_UT_DI_U", 0x1C, NULL),
6783 .nb_flags = NBT_NM_GROUP,
6785 .num_ips = ctx->addresses_best_num,
6786 .ips = ctx->addresses_best,
6787 .apply_expected = True
6793 .type = WREPL_TYPE_UNIQUE,
6794 .state = WREPL_STATE_TOMBSTONE,
6795 .node = WREPL_NODE_B,
6797 .num_ips = ARRAY_SIZE(addresses_B_1),
6798 .ips = addresses_B_1,
6799 .apply_expected = False
6803 * special group vs. normal group section
6806 * sgroup,active vs. group,active with same ip(s), unchecked
6809 .line = __location__,
6810 .name = _NBT_NAME("_SA_GA_SI_U", 0x1C, NULL),
6812 .nb_flags = NBT_NM_GROUP,
6814 .num_ips = ctx->addresses_best_num,
6815 .ips = ctx->addresses_best,
6816 .apply_expected = True
6822 .type = WREPL_TYPE_GROUP,
6823 .state = WREPL_STATE_ACTIVE,
6824 .node = WREPL_NODE_B,
6826 .num_ips = ctx->addresses_best_num,
6827 .ips = ctx->addresses_best,
6828 .apply_expected = False
6832 * sgroup,active vs. group,active with different ip(s), unchecked
6835 .line = __location__,
6836 .name = _NBT_NAME("_SA_GA_DI_U", 0x1C, NULL),
6838 .nb_flags = NBT_NM_GROUP,
6840 .num_ips = ctx->addresses_best_num,
6841 .ips = ctx->addresses_best,
6842 .apply_expected = True
6848 .type = WREPL_TYPE_GROUP,
6849 .state = WREPL_STATE_ACTIVE,
6850 .node = WREPL_NODE_B,
6852 .num_ips = ARRAY_SIZE(addresses_B_1),
6853 .ips = addresses_B_1,
6854 .apply_expected = False
6858 * sgroup,active vs. group,tombstone with same ip(s), unchecked
6861 .line = __location__,
6862 .name = _NBT_NAME("_SA_GT_SI_U", 0x1C, NULL),
6864 .nb_flags = NBT_NM_GROUP,
6866 .num_ips = ctx->addresses_best_num,
6867 .ips = ctx->addresses_best,
6868 .apply_expected = True
6874 .type = WREPL_TYPE_GROUP,
6875 .state = WREPL_STATE_TOMBSTONE,
6876 .node = WREPL_NODE_B,
6878 .num_ips = ctx->addresses_best_num,
6879 .ips = ctx->addresses_best,
6880 .apply_expected = False
6884 * sgroup,active vs. group,tombstone with different ip(s), unchecked
6887 .line = __location__,
6888 .name = _NBT_NAME("_SA_GT_DI_U", 0x1C, NULL),
6890 .nb_flags = NBT_NM_GROUP,
6892 .num_ips = ctx->addresses_best_num,
6893 .ips = ctx->addresses_best,
6894 .apply_expected = True
6900 .type = WREPL_TYPE_GROUP,
6901 .state = WREPL_STATE_TOMBSTONE,
6902 .node = WREPL_NODE_B,
6904 .num_ips = ARRAY_SIZE(addresses_B_1),
6905 .ips = addresses_B_1,
6906 .apply_expected = False
6910 * special group vs. multi homed section
6913 * sgroup,active vs. mhomed,active with same ip(s), unchecked
6916 .line = __location__,
6917 .name = _NBT_NAME("_SA_MA_SI_U", 0x1C, NULL),
6919 .nb_flags = NBT_NM_GROUP,
6921 .num_ips = ctx->addresses_best_num,
6922 .ips = ctx->addresses_best,
6923 .apply_expected = True
6929 .type = WREPL_TYPE_MHOMED,
6930 .state = WREPL_STATE_ACTIVE,
6931 .node = WREPL_NODE_B,
6933 .num_ips = ctx->addresses_best_num,
6934 .ips = ctx->addresses_best,
6935 .apply_expected = False
6939 * sgroup,active vs. mhomed,active with different ip(s), unchecked
6942 .line = __location__,
6943 .name = _NBT_NAME("_SA_MA_DI_U", 0x1C, NULL),
6945 .nb_flags = NBT_NM_GROUP,
6947 .num_ips = ctx->addresses_best_num,
6948 .ips = ctx->addresses_best,
6949 .apply_expected = True
6955 .type = WREPL_TYPE_MHOMED,
6956 .state = WREPL_STATE_ACTIVE,
6957 .node = WREPL_NODE_B,
6959 .num_ips = ARRAY_SIZE(addresses_B_1),
6960 .ips = addresses_B_1,
6961 .apply_expected = False
6965 * sgroup,active vs. mhomed,tombstone with same ip(s), unchecked
6968 .line = __location__,
6969 .name = _NBT_NAME("_SA_MT_SI_U", 0x1C, NULL),
6971 .nb_flags = NBT_NM_GROUP,
6973 .num_ips = ctx->addresses_best_num,
6974 .ips = ctx->addresses_best,
6975 .apply_expected = True
6981 .type = WREPL_TYPE_MHOMED,
6982 .state = WREPL_STATE_TOMBSTONE,
6983 .node = WREPL_NODE_B,
6985 .num_ips = ctx->addresses_best_num,
6986 .ips = ctx->addresses_best,
6987 .apply_expected = False
6991 * sgroup,active vs. mhomed,tombstone with different ip(s), unchecked
6994 .line = __location__,
6995 .name = _NBT_NAME("_SA_MT_DI_U", 0x1C, NULL),
6997 .nb_flags = NBT_NM_GROUP,
6999 .num_ips = ctx->addresses_best_num,
7000 .ips = ctx->addresses_best,
7001 .apply_expected = True
7007 .type = WREPL_TYPE_MHOMED,
7008 .state = WREPL_STATE_TOMBSTONE,
7009 .node = WREPL_NODE_B,
7011 .num_ips = ARRAY_SIZE(addresses_B_1),
7012 .ips = addresses_B_1,
7013 .apply_expected = False
7017 * multi homed vs. unique section
7020 * mhomed,active vs. unique,active with same ip(s), unchecked
7023 .line = __location__,
7024 .name = _NBT_NAME("_MA_UA_SI_U", 0x00, NULL),
7028 .num_ips = ctx->addresses_best_num,
7029 .ips = ctx->addresses_best,
7030 .apply_expected = True
7036 .type = WREPL_TYPE_UNIQUE,
7037 .state = WREPL_STATE_ACTIVE,
7038 .node = WREPL_NODE_B,
7040 .num_ips = ctx->addresses_best_num,
7041 .ips = ctx->addresses_best,
7042 .apply_expected = True
7046 * mhomed,active vs. unique,active with different ip(s), positive response
7049 .line = __location__,
7050 .name = _NBT_NAME("_MA_UA_DI_P", 0x00, NULL),
7054 .num_ips = ctx->addresses_best_num,
7055 .ips = ctx->addresses_best,
7056 .apply_expected = True
7063 .type = WREPL_TYPE_UNIQUE,
7064 .state = WREPL_STATE_ACTIVE,
7065 .node = WREPL_NODE_B,
7067 .num_ips = ARRAY_SIZE(addresses_B_1),
7068 .ips = addresses_B_1,
7069 .apply_expected = False
7073 * mhomed,active vs. unique,active with different ip(s), positive response other ips
7076 .line = __location__,
7077 .name = _NBT_NAME("_MA_UA_DI_O", 0x00, NULL),
7081 .num_ips = ctx->addresses_best_num,
7082 .ips = ctx->addresses_best,
7083 .apply_expected = True
7088 .num_ips = ARRAY_SIZE(addresses_A_3_4),
7089 .ips = addresses_A_3_4,
7092 .type = WREPL_TYPE_UNIQUE,
7093 .state = WREPL_STATE_ACTIVE,
7094 .node = WREPL_NODE_B,
7096 .num_ips = ARRAY_SIZE(addresses_B_1),
7097 .ips = addresses_B_1,
7098 .apply_expected = False
7102 * mhomed,active vs. unique,active with different ip(s), negative response
7105 .line = __location__,
7106 .name = _NBT_NAME("_MA_UA_DI_N", 0x00, NULL),
7110 .num_ips = ctx->addresses_best_num,
7111 .ips = ctx->addresses_best,
7112 .apply_expected = True
7119 .type = WREPL_TYPE_UNIQUE,
7120 .state = WREPL_STATE_ACTIVE,
7121 .node = WREPL_NODE_B,
7123 .num_ips = ARRAY_SIZE(addresses_B_1),
7124 .ips = addresses_B_1,
7125 .apply_expected = True
7129 * mhomed,active vs. unique,tombstone with same ip(s), unchecked
7132 .line = __location__,
7133 .name = _NBT_NAME("_MA_UT_SI_U", 0x00, NULL),
7137 .num_ips = ctx->addresses_best_num,
7138 .ips = ctx->addresses_best,
7139 .apply_expected = True
7145 .type = WREPL_TYPE_UNIQUE,
7146 .state = WREPL_STATE_TOMBSTONE,
7147 .node = WREPL_NODE_B,
7149 .num_ips = ctx->addresses_best_num,
7150 .ips = ctx->addresses_best,
7151 .apply_expected = False
7155 * mhomed,active vs. unique,tombstone with different ip(s), unchecked
7158 .line = __location__,
7159 .name = _NBT_NAME("_MA_UT_DI_U", 0x00, NULL),
7163 .num_ips = ctx->addresses_best_num,
7164 .ips = ctx->addresses_best,
7165 .apply_expected = True
7171 .type = WREPL_TYPE_UNIQUE,
7172 .state = WREPL_STATE_TOMBSTONE,
7173 .node = WREPL_NODE_B,
7175 .num_ips = ARRAY_SIZE(addresses_B_1),
7176 .ips = addresses_B_1,
7177 .apply_expected = False
7181 * multi homed vs. normal group section
7184 * mhomed,active vs. group,active with same ip(s), release expected
7187 .line = __location__,
7188 .name = _NBT_NAME("_MA_GA_SI_R", 0x00, NULL),
7192 .num_ips = ctx->addresses_best_num,
7193 .ips = ctx->addresses_best,
7194 .apply_expected = True
7198 .expect_release = True,
7201 .type = WREPL_TYPE_GROUP,
7202 .state = WREPL_STATE_ACTIVE,
7203 .node = WREPL_NODE_B,
7205 .num_ips = ctx->addresses_best_num,
7206 .ips = ctx->addresses_best,
7207 .apply_expected = True
7211 * mhomed,active vs. group,active with different ip(s), release expected
7214 .line = __location__,
7215 .name = _NBT_NAME("_MA_GA_DI_R", 0x00, NULL),
7219 .num_ips = ctx->addresses_best_num,
7220 .ips = ctx->addresses_best,
7221 .apply_expected = True
7225 .expect_release = True,
7228 .type = WREPL_TYPE_GROUP,
7229 .state = WREPL_STATE_ACTIVE,
7230 .node = WREPL_NODE_B,
7232 .num_ips = ARRAY_SIZE(addresses_B_1),
7233 .ips = addresses_B_1,
7234 .apply_expected = True
7238 * mhomed,active vs. group,tombstone with same ip(s), unchecked
7241 .line = __location__,
7242 .name = _NBT_NAME("_MA_GT_SI_U", 0x00, NULL),
7246 .num_ips = ctx->addresses_best_num,
7247 .ips = ctx->addresses_best,
7248 .apply_expected = True
7254 .type = WREPL_TYPE_GROUP,
7255 .state = WREPL_STATE_TOMBSTONE,
7256 .node = WREPL_NODE_B,
7258 .num_ips = ctx->addresses_best_num,
7259 .ips = ctx->addresses_best,
7260 .apply_expected = False
7264 * mhomed,active vs. group,tombstone with different ip(s), unchecked
7267 .line = __location__,
7268 .name = _NBT_NAME("_MA_GT_DI_U", 0x00, NULL),
7272 .num_ips = ctx->addresses_best_num,
7273 .ips = ctx->addresses_best,
7274 .apply_expected = True
7280 .type = WREPL_TYPE_GROUP,
7281 .state = WREPL_STATE_TOMBSTONE,
7282 .node = WREPL_NODE_B,
7284 .num_ips = ARRAY_SIZE(addresses_B_1),
7285 .ips = addresses_B_1,
7286 .apply_expected = False
7290 * multi homed vs. special group section
7293 * mhomed,active vs. sgroup,active with same ip(s), release expected
7296 .line = __location__,
7297 .name = _NBT_NAME("_MA_SA_SI_R", 0x00, NULL),
7301 .num_ips = ctx->addresses_best_num,
7302 .ips = ctx->addresses_best,
7303 .apply_expected = True
7307 .expect_release = True,
7310 .type = WREPL_TYPE_SGROUP,
7311 .state = WREPL_STATE_ACTIVE,
7312 .node = WREPL_NODE_B,
7314 .num_ips = ctx->addresses_best_num,
7315 .ips = ctx->addresses_best,
7316 .apply_expected = True
7320 * mhomed,active vs. group,active with different ip(s), release expected
7323 .line = __location__,
7324 .name = _NBT_NAME("_MA_SA_DI_R", 0x00, NULL),
7328 .num_ips = ctx->addresses_best_num,
7329 .ips = ctx->addresses_best,
7330 .apply_expected = True
7334 .expect_release = True,
7337 .type = WREPL_TYPE_SGROUP,
7338 .state = WREPL_STATE_ACTIVE,
7339 .node = WREPL_NODE_B,
7341 .num_ips = ARRAY_SIZE(addresses_B_1),
7342 .ips = addresses_B_1,
7343 .apply_expected = True
7347 * mhomed,active vs. sgroup,tombstone with same ip(s), unchecked
7350 .line = __location__,
7351 .name = _NBT_NAME("_MA_ST_SI_U", 0x00, NULL),
7355 .num_ips = ctx->addresses_best_num,
7356 .ips = ctx->addresses_best,
7357 .apply_expected = True
7363 .type = WREPL_TYPE_SGROUP,
7364 .state = WREPL_STATE_TOMBSTONE,
7365 .node = WREPL_NODE_B,
7367 .num_ips = ctx->addresses_best_num,
7368 .ips = ctx->addresses_best,
7369 .apply_expected = False
7373 * mhomed,active vs. sgroup,tombstone with different ip(s), unchecked
7376 .line = __location__,
7377 .name = _NBT_NAME("_MA_ST_DI_U", 0x00, NULL),
7381 .num_ips = ctx->addresses_best_num,
7382 .ips = ctx->addresses_best,
7383 .apply_expected = True
7389 .type = WREPL_TYPE_SGROUP,
7390 .state = WREPL_STATE_TOMBSTONE,
7391 .node = WREPL_NODE_B,
7393 .num_ips = ARRAY_SIZE(addresses_B_1),
7394 .ips = addresses_B_1,
7395 .apply_expected = False
7399 * multi homed vs. multi homed section
7402 * mhomed,active vs. mhomed,active with same ip(s), unchecked
7405 .line = __location__,
7406 .name = _NBT_NAME("_MA_MA_SI_U", 0x00, NULL),
7410 .num_ips = ctx->addresses_best_num,
7411 .ips = ctx->addresses_best,
7412 .apply_expected = True
7418 .type = WREPL_TYPE_MHOMED,
7419 .state = WREPL_STATE_ACTIVE,
7420 .node = WREPL_NODE_B,
7422 .num_ips = ctx->addresses_best_num,
7423 .ips = ctx->addresses_best,
7424 .apply_expected = True
7428 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
7431 .line = __location__,
7432 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
7436 .num_ips = ctx->addresses_best_num,
7437 .ips = ctx->addresses_best,
7438 .apply_expected = True
7444 .type = WREPL_TYPE_MHOMED,
7445 .state = WREPL_STATE_ACTIVE,
7446 .node = WREPL_NODE_B,
7448 .num_ips = ctx->addresses_all_num,
7449 .ips = ctx->addresses_all,
7450 .apply_expected = True
7454 * mhomed,active vs. mhomed,active with different ip(s), positive response
7457 .line = __location__,
7458 .name = _NBT_NAME("_MA_MA_DI_P", 0x00, NULL),
7462 .num_ips = ctx->addresses_best_num,
7463 .ips = ctx->addresses_best,
7464 .apply_expected = True
7471 .type = WREPL_TYPE_MHOMED,
7472 .state = WREPL_STATE_ACTIVE,
7473 .node = WREPL_NODE_B,
7475 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7476 .ips = addresses_B_3_4,
7477 .apply_expected = False
7481 * mhomed,active vs. mhomed,active with different ip(s), positive response other ips
7484 .line = __location__,
7485 .name = _NBT_NAME("_MA_MA_DI_O", 0x00, NULL),
7489 .num_ips = ctx->addresses_best_num,
7490 .ips = ctx->addresses_best,
7491 .apply_expected = True
7496 .num_ips = ARRAY_SIZE(addresses_A_3_4),
7497 .ips = addresses_A_3_4,
7500 .type = WREPL_TYPE_MHOMED,
7501 .state = WREPL_STATE_ACTIVE,
7502 .node = WREPL_NODE_B,
7504 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7505 .ips = addresses_B_3_4,
7506 .apply_expected = False
7510 * mhomed,active vs. mhomed,active with different ip(s), negative response
7513 .line = __location__,
7514 .name = _NBT_NAME("_MA_MA_DI_N", 0x00, NULL),
7518 .num_ips = ctx->addresses_best_num,
7519 .ips = ctx->addresses_best,
7520 .apply_expected = True
7527 .type = WREPL_TYPE_MHOMED,
7528 .state = WREPL_STATE_ACTIVE,
7529 .node = WREPL_NODE_B,
7531 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7532 .ips = addresses_B_3_4,
7533 .apply_expected = True
7537 * mhomed,active vs. mhomed,tombstone with same ip(s), unchecked
7540 .line = __location__,
7541 .name = _NBT_NAME("_MA_MT_SI_U", 0x00, NULL),
7545 .num_ips = ctx->addresses_best_num,
7546 .ips = ctx->addresses_best,
7547 .apply_expected = True
7553 .type = WREPL_TYPE_MHOMED,
7554 .state = WREPL_STATE_TOMBSTONE,
7555 .node = WREPL_NODE_B,
7557 .num_ips = ctx->addresses_best_num,
7558 .ips = ctx->addresses_best,
7559 .apply_expected = False
7563 * mhomed,active vs. mhomed,tombstone with different ip(s), unchecked
7566 .line = __location__,
7567 .name = _NBT_NAME("_MA_MT_DI_U", 0x00, NULL),
7571 .num_ips = ctx->addresses_best_num,
7572 .ips = ctx->addresses_best,
7573 .apply_expected = True
7579 .type = WREPL_TYPE_MHOMED,
7580 .state = WREPL_STATE_TOMBSTONE,
7581 .node = WREPL_NODE_B,
7583 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7584 .ips = addresses_B_3_4,
7585 .apply_expected = False
7589 * some more multi homed test, including merging
7592 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
7595 .line = __location__,
7596 .section= "Test Replica vs. owned active: some more MHOMED combinations",
7597 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
7598 .skip = (ctx->addresses_all_num < 3),
7602 .num_ips = ctx->addresses_mhomed_num,
7603 .ips = ctx->addresses_mhomed,
7604 .apply_expected = True
7610 .type = WREPL_TYPE_MHOMED,
7611 .state = WREPL_STATE_ACTIVE,
7612 .node = WREPL_NODE_B,
7614 .num_ips = ctx->addresses_all_num,
7615 .ips = ctx->addresses_all,
7616 .apply_expected = True
7620 * mhomed,active vs. mhomed,active with same ips, unchecked
7623 .line = __location__,
7624 .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL),
7625 .skip = (ctx->addresses_mhomed_num != 2),
7629 .num_ips = ctx->addresses_mhomed_num,
7630 .ips = ctx->addresses_mhomed,
7631 .apply_expected = True
7637 .type = WREPL_TYPE_MHOMED,
7638 .state = WREPL_STATE_ACTIVE,
7639 .node = WREPL_NODE_B,
7641 .num_ips = ctx->addresses_mhomed_num,
7642 .ips = ctx->addresses_mhomed,
7643 .apply_expected = True
7647 * mhomed,active vs. mhomed,active with subset ip(s), positive response
7650 .line = __location__,
7651 .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL),
7652 .skip = (ctx->addresses_mhomed_num != 2),
7656 .num_ips = ctx->addresses_mhomed_num,
7657 .ips = ctx->addresses_mhomed,
7658 .apply_expected = True
7665 .type = WREPL_TYPE_MHOMED,
7666 .state = WREPL_STATE_ACTIVE,
7667 .node = WREPL_NODE_B,
7669 .num_ips = ctx->addresses_best_num,
7670 .ips = ctx->addresses_best,
7671 .mhomed_merge = True
7675 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with all addresses
7678 .line = __location__,
7679 .name = _NBT_NAME("_MA_MA_SB_A", 0x00, NULL),
7680 .skip = (ctx->addresses_all_num < 3),
7684 .num_ips = ctx->addresses_mhomed_num,
7685 .ips = ctx->addresses_mhomed,
7686 .apply_expected = True
7691 .num_ips = ctx->addresses_all_num,
7692 .ips = ctx->addresses_all,
7695 .type = WREPL_TYPE_MHOMED,
7696 .state = WREPL_STATE_ACTIVE,
7697 .node = WREPL_NODE_B,
7699 .num_ips = ctx->addresses_best_num,
7700 .ips = ctx->addresses_best,
7701 .mhomed_merge = True
7705 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with replicas addresses
7706 * TODO: here we got a release demand for the replica address from the server after doing
7707 * a positive response with the replicas addresses
7710 .line = __location__,
7711 .name = _NBT_NAME("_MA_MA_SB_C", 0x00, NULL),
7712 .skip = (True /*ctx->addresses_all_num < 3*/),
7716 .num_ips = ctx->addresses_mhomed_num,
7717 .ips = ctx->addresses_mhomed,
7718 .apply_expected = True
7723 .num_ips = ctx->addresses_best_num,
7724 .ips = ctx->addresses_best,
7727 .type = WREPL_TYPE_MHOMED,
7728 .state = WREPL_STATE_ACTIVE,
7729 .node = WREPL_NODE_B,
7731 .num_ips = ctx->addresses_best_num,
7732 .ips = ctx->addresses_best,
7733 .apply_expected = False
7737 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with other addresses
7738 * TODO: here the record is not applied and the old record becomes released
7741 .line = __location__,
7742 .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL),
7744 .skip = (True /*ctx->addresses_all_num < 3*/),
7748 .num_ips = ctx->addresses_mhomed_num,
7749 .ips = ctx->addresses_mhomed,
7750 .apply_expected = True
7755 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7756 .ips = addresses_B_3_4,
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 .apply_expected = False
7769 * mhomed,active vs. mhomed,active with subset ip(s), negative response
7772 .line = __location__,
7773 .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL),
7774 .skip = (ctx->addresses_mhomed_num != 2),
7778 .num_ips = ctx->addresses_mhomed_num,
7779 .ips = ctx->addresses_mhomed,
7780 .apply_expected = True
7787 .type = WREPL_TYPE_MHOMED,
7788 .state = WREPL_STATE_ACTIVE,
7789 .node = WREPL_NODE_B,
7791 .num_ips = ctx->addresses_best_num,
7792 .ips = ctx->addresses_best,
7793 .apply_expected = True
7797 * some more multi homed and unique test, including merging
7800 * mhomed,active vs. unique,active with subset ip(s), positive response
7803 .line = __location__,
7804 .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations",
7805 .name = _NBT_NAME("_MA_UA_SB_A", 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
7819 .type = WREPL_TYPE_UNIQUE,
7820 .state = WREPL_STATE_ACTIVE,
7821 .node = WREPL_NODE_B,
7823 .num_ips = ctx->addresses_best_num,
7824 .ips = ctx->addresses_best,
7825 .mhomed_merge = True
7829 * unique,active vs. unique,active with different ip(s), positive response, with all addresses
7832 .line = __location__,
7833 .name = _NBT_NAME("_UA_UA_DI_A", 0x00, NULL),
7834 .skip = (ctx->addresses_all_num < 3),
7838 .num_ips = ctx->addresses_best_num,
7839 .ips = ctx->addresses_best,
7840 .apply_expected = True
7845 .num_ips = ctx->addresses_all_num,
7846 .ips = ctx->addresses_all,
7849 .type = WREPL_TYPE_UNIQUE,
7850 .state = WREPL_STATE_ACTIVE,
7851 .node = WREPL_NODE_B,
7853 .num_ips = ctx->addresses_best2_num,
7854 .ips = ctx->addresses_best2,
7855 .mhomed_merge = True,
7859 * unique,active vs. mhomed,active with different ip(s), positive response, with all addresses
7862 .line = __location__,
7863 .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL),
7864 .skip = (ctx->addresses_all_num < 3),
7868 .num_ips = ctx->addresses_best_num,
7869 .ips = ctx->addresses_best,
7870 .apply_expected = True
7875 .num_ips = ctx->addresses_all_num,
7876 .ips = ctx->addresses_all,
7879 .type = WREPL_TYPE_MHOMED,
7880 .state = WREPL_STATE_ACTIVE,
7881 .node = WREPL_NODE_B,
7883 .num_ips = ctx->addresses_best2_num,
7884 .ips = ctx->addresses_best2,
7885 .mhomed_merge = True,
7890 if (!ctx) return False;
7892 if (!ctx->nbtsock_srv) {
7893 printf("SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
7898 printf("Test Replica records vs. owned active records\n");
7900 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
7902 struct test_conflict_owned_active_vs_replica_struct record = records[i];
7903 uint32_t j, count = 1;
7906 if (records[i].wins.mhomed) {
7907 count = records[i].wins.num_ips;
7910 if (records[i].section) {
7911 printf("%s\n", records[i].section);
7914 if (records[i].skip) {
7915 printf("%s => SKIPPED\n", nbt_name_string(ctx, &records[i].name));
7919 if (records[i].replica.mhomed_merge) {
7920 action = "MHOMED_MERGE";
7921 } else if (records[i].replica.apply_expected) {
7924 action = "NOT REPLACE";
7927 printf("%s => %s\n", nbt_name_string(ctx, &records[i].name), action);
7929 /* Prepare for multi homed registration */
7930 ZERO_STRUCT(records[i].defend);
7931 records[i].defend.timeout = 10;
7932 records[i].defend.positive = True;
7933 nbt_set_incoming_handler(ctx->nbtsock_srv,
7934 test_conflict_owned_active_vs_replica_handler,
7936 if (ctx->nbtsock_srv2) {
7937 nbt_set_incoming_handler(ctx->nbtsock_srv2,
7938 test_conflict_owned_active_vs_replica_handler,
7945 for (j=0; j < count; j++) {
7946 struct nbt_name_request *req;
7948 name_register->in.name = records[i].name;
7949 name_register->in.dest_addr = ctx->address;
7950 name_register->in.address = records[i].wins.ips[j].ip;
7951 name_register->in.nb_flags = records[i].wins.nb_flags;
7952 name_register->in.register_demand= False;
7953 name_register->in.broadcast = False;
7954 name_register->in.multi_homed = records[i].wins.mhomed;
7955 name_register->in.ttl = 300000;
7956 name_register->in.timeout = 70;
7957 name_register->in.retries = 0;
7959 req = nbt_name_register_send(ctx->nbtsock, name_register);
7961 /* push the request on the wire */
7962 event_loop_once(ctx->nbtsock->event_ctx);
7965 * if we register multiple addresses,
7966 * the server will do name queries to see if the old addresses
7970 end = timeval_current_ofs(records[i].defend.timeout,0);
7971 records[i].defend.ret = True;
7972 while (records[i].defend.timeout > 0) {
7973 event_loop_once(ctx->nbtsock_srv->event_ctx);
7974 if (timeval_expired(&end)) break;
7976 ret &= records[i].defend.ret;
7979 status = nbt_name_register_recv(req, ctx, name_register);
7980 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
7981 printf("No response from %s for name register\n", ctx->address);
7984 if (!NT_STATUS_IS_OK(status)) {
7985 printf("Bad response from %s for name register - %s\n",
7986 ctx->address, nt_errstr(status));
7989 CHECK_VALUE(name_register->out.rcode, 0);
7990 CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address);
7991 CHECK_VALUE(name_register->out.name.type, records[i].name.type);
7992 CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name);
7993 CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope);
7994 CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[j].ip);
7997 /* Prepare for the current test */
7998 records[i].defend = record.defend;
7999 nbt_set_incoming_handler(ctx->nbtsock_srv,
8000 test_conflict_owned_active_vs_replica_handler,
8002 if (ctx->nbtsock_srv2) {
8003 nbt_set_incoming_handler(ctx->nbtsock_srv2,
8004 test_conflict_owned_active_vs_replica_handler,
8011 wins_name->name = &records[i].name;
8012 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
8013 records[i].replica.state,
8014 records[i].replica.node,
8015 records[i].replica.is_static);
8016 wins_name->id = ++ctx->b.max_version;
8017 if (wins_name->flags & 2) {
8018 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
8019 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
8021 wins_name->addresses.ip = records[i].replica.ips[0].ip;
8023 wins_name->unknown = "255.255.255.255";
8025 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
8028 * wait for the name query, which is handled in
8029 * test_conflict_owned_active_vs_replica_handler()
8031 end = timeval_current_ofs(records[i].defend.timeout,0);
8032 records[i].defend.ret = True;
8033 while (records[i].defend.timeout > 0) {
8034 event_loop_once(ctx->nbtsock_srv->event_ctx);
8035 if (timeval_expired(&end)) break;
8037 ret &= records[i].defend.ret;
8039 if (records[i].replica.mhomed_merge) {
8040 ret &= test_wrepl_mhomed_merged(ctx, &ctx->c,
8041 records[i].wins.num_ips, records[i].wins.ips,
8043 records[i].replica.num_ips, records[i].replica.ips,
8046 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name,
8047 records[i].replica.apply_expected);
8050 if (records[i].replica.apply_expected ||
8051 records[i].replica.mhomed_merge) {
8052 wins_name->name = &records[i].name;
8053 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
8054 WREPL_STATE_TOMBSTONE,
8055 WREPL_NODE_B, False);
8056 wins_name->id = ++ctx->b.max_version;
8057 wins_name->addresses.ip = addresses_B_1[0].ip;
8058 wins_name->unknown = "255.255.255.255";
8060 ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name);
8061 ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True);
8063 for (j=0; j < count; j++) {
8064 struct nbt_name_socket *nbtsock = ctx->nbtsock;
8066 if (ctx->myaddr && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2) == 0) {
8067 nbtsock = ctx->nbtsock2;
8070 release->in.name = records[i].name;
8071 release->in.dest_addr = ctx->address;
8072 release->in.address = records[i].wins.ips[j].ip;
8073 release->in.nb_flags = records[i].wins.nb_flags;
8074 release->in.broadcast = False;
8075 release->in.timeout = 30;
8076 release->in.retries = 0;
8078 status = nbt_name_release(nbtsock, ctx, release);
8079 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
8080 printf("No response from %s for name release\n", ctx->address);
8083 if (!NT_STATUS_IS_OK(status)) {
8084 printf("Bad response from %s for name query - %s\n",
8085 ctx->address, nt_errstr(status));
8088 CHECK_VALUE(release->out.rcode, 0);
8094 printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line);
8102 #define _NBT_ASSERT(v, correct) do { \
8103 if ((v) != (correct)) { \
8104 printf("(%s) Incorrect value %s=%d - should be %s (%d)\n", \
8105 __location__, #v, v, #correct, correct); \
8110 #define _NBT_ASSERT_STRING(v, correct) do { \
8111 if ( ((!v) && (correct)) || \
8112 ((v) && (!correct)) || \
8113 ((v) && (correct) && strcmp(v,correct) != 0)) { \
8114 printf("(%s) Incorrect value %s=%s - should be %s\n", \
8115 __location__, #v, v, correct); \
8120 static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
8121 struct nbt_name_packet *req_packet,
8122 const struct nbt_peer_socket *src)
8124 struct nbt_name *name;
8125 struct nbt_name_packet *rep_packet;
8126 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
8128 _NBT_ASSERT(req_packet->qdcount, 1);
8129 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
8130 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
8132 name = &req_packet->questions[0].name;
8134 _NBT_ASSERT(name->type, rec->name.type);
8135 _NBT_ASSERT_STRING(name->name, rec->name.name);
8136 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
8138 _NBT_ASSERT(rec->defend.expect_release, False);
8140 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
8141 if (rep_packet == NULL) return;
8143 rep_packet->name_trn_id = req_packet->name_trn_id;
8144 rep_packet->ancount = 1;
8146 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
8147 if (rep_packet->answers == NULL) return;
8149 rep_packet->answers[0].name = *name;
8150 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
8151 rep_packet->answers[0].ttl = 0;
8153 if (rec->defend.positive) {
8154 uint32_t i, num_ips;
8155 const struct wrepl_ip *ips;
8157 if (rec->defend.num_ips > 0) {
8158 num_ips = rec->defend.num_ips;
8159 ips = rec->defend.ips;
8161 num_ips = rec->wins.num_ips;
8162 ips = rec->wins.ips;
8165 /* send a positive reply */
8166 rep_packet->operation =
8169 NBT_FLAG_AUTHORITIVE |
8170 NBT_FLAG_RECURSION_DESIRED |
8171 NBT_FLAG_RECURSION_AVAIL;
8173 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
8175 rep_packet->answers[0].rdata.netbios.length = num_ips*6;
8176 rep_packet->answers[0].rdata.netbios.addresses =
8177 talloc_array(rep_packet->answers, struct nbt_rdata_address, num_ips);
8178 if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return;
8180 for (i=0; i < num_ips; i++) {
8181 struct nbt_rdata_address *addr =
8182 &rep_packet->answers[0].rdata.netbios.addresses[i];
8183 addr->nb_flags = rec->wins.nb_flags;
8184 addr->ipaddr = ips[i].ip;
8186 DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
8187 nbt_name_string(rep_packet, name), src->addr, src->port));
8189 /* send a negative reply */
8190 rep_packet->operation =
8193 NBT_FLAG_AUTHORITIVE |
8196 rep_packet->answers[0].rr_type = NBT_QTYPE_NULL;
8198 ZERO_STRUCT(rep_packet->answers[0].rdata);
8200 DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
8201 nbt_name_string(rep_packet, name), src->addr, src->port));
8204 nbt_name_reply_send(nbtsock, src, rep_packet);
8205 talloc_free(rep_packet);
8207 /* make sure we push the reply to the wire */
8208 event_loop_once(nbtsock->event_ctx);
8210 rec->defend.timeout = 0;
8211 rec->defend.ret = True;
8214 static void test_conflict_owned_active_vs_replica_handler_release(struct nbt_name_socket *nbtsock,
8215 struct nbt_name_packet *req_packet,
8216 const struct nbt_peer_socket *src)
8218 struct nbt_name *name;
8219 struct nbt_name_packet *rep_packet;
8220 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
8222 _NBT_ASSERT(req_packet->qdcount, 1);
8223 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
8224 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
8226 name = &req_packet->questions[0].name;
8228 _NBT_ASSERT(name->type, rec->name.type);
8229 _NBT_ASSERT_STRING(name->name, rec->name.name);
8230 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
8232 _NBT_ASSERT(rec->defend.expect_release, True);
8234 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
8235 if (rep_packet == NULL) return;
8237 rep_packet->name_trn_id = req_packet->name_trn_id;
8238 rep_packet->ancount = 1;
8239 rep_packet->operation =
8241 NBT_OPCODE_RELEASE |
8242 NBT_FLAG_AUTHORITIVE;
8244 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
8245 if (rep_packet->answers == NULL) return;
8247 rep_packet->answers[0].name = *name;
8248 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
8249 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
8250 rep_packet->answers[0].ttl = req_packet->additional[0].ttl;
8251 rep_packet->answers[0].rdata = req_packet->additional[0].rdata;
8253 DEBUG(2,("Sending name release reply for %s to %s:%d\n",
8254 nbt_name_string(rep_packet, name), src->addr, src->port));
8256 nbt_name_reply_send(nbtsock, src, rep_packet);
8257 talloc_free(rep_packet);
8259 /* make sure we push the reply to the wire */
8260 event_loop_once(nbtsock->event_ctx);
8262 rec->defend.timeout = 0;
8263 rec->defend.ret = True;
8266 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
8267 struct nbt_name_packet *req_packet,
8268 const struct nbt_peer_socket *src)
8270 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
8272 rec->defend.ret = False;
8274 switch (req_packet->operation & NBT_OPCODE) {
8275 case NBT_OPCODE_QUERY:
8276 test_conflict_owned_active_vs_replica_handler_query(nbtsock, req_packet, src);
8278 case NBT_OPCODE_RELEASE:
8279 test_conflict_owned_active_vs_replica_handler_release(nbtsock, req_packet, src);
8282 printf("%s: unexpected incoming packet\n", __location__);
8288 test WINS replication operations
8290 BOOL torture_nbt_winsreplication_quick(void)
8292 const char *address;
8293 struct nbt_name name;
8294 TALLOC_CTX *mem_ctx = talloc_new(NULL);
8298 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
8300 /* do an initial name resolution to find its IP */
8301 status = resolve_name(&name, mem_ctx, &address, NULL);
8302 if (!NT_STATUS_IS_OK(status)) {
8303 printf("Failed to resolve %s - %s\n",
8304 name.name, nt_errstr(status));
8305 talloc_free(mem_ctx);
8309 ret &= test_assoc_ctx1(mem_ctx, address);
8310 ret &= test_assoc_ctx2(mem_ctx, address);
8312 talloc_free(mem_ctx);
8318 test WINS replication operations
8320 BOOL torture_nbt_winsreplication(void)
8322 const char *address;
8323 struct nbt_name name;
8324 TALLOC_CTX *mem_ctx = talloc_new(NULL);
8327 struct test_wrepl_conflict_conn *ctx;
8329 make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host"));
8331 /* do an initial name resolution to find its IP */
8332 status = resolve_name(&name, mem_ctx, &address, NULL);
8333 if (!NT_STATUS_IS_OK(status)) {
8334 printf("Failed to resolve %s - %s\n",
8335 name.name, nt_errstr(status));
8336 talloc_free(mem_ctx);
8340 ret &= test_assoc_ctx1(mem_ctx, address);
8341 ret &= test_assoc_ctx2(mem_ctx, address);
8343 ret &= test_wins_replication(mem_ctx, address);
8345 ctx = test_create_conflict_ctx(mem_ctx, address);
8347 ret &= test_conflict_same_owner(ctx);
8348 ret &= test_conflict_different_owner(ctx);
8349 ret &= test_conflict_owned_released_vs_replica(ctx);
8350 ret &= test_conflict_owned_active_vs_replica(ctx);
8352 talloc_free(mem_ctx);