2 Unix SMB/CIFS implementation.
4 WINS replication testing
6 Copyright (C) Andrew Tridgell 2005
7 Copyright (C) Stefan Metzmacher 2005
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #include "libcli/wrepl/winsrepl.h"
25 #include "lib/events/events.h"
26 #include "lib/socket/socket.h"
27 #include "libcli/resolve/resolve.h"
28 #include "system/network.h"
29 #include "lib/socket/netif.h"
30 #include "librpc/gen_ndr/ndr_nbt.h"
31 #include "torture/torture.h"
32 #include "torture/nbt/proto.h"
34 #define CHECK_STATUS(tctx, status, correct) \
35 torture_assert_ntstatus_equal(tctx, status, correct, \
38 #define CHECK_VALUE(tctx, v, correct) \
39 torture_assert(tctx, (v) == (correct), \
40 talloc_asprintf(tctx, "Incorrect value %s=%d - should be %d\n", \
43 #define CHECK_VALUE_UINT64(tctx, v, correct) \
44 torture_assert(tctx, (v) == (correct), \
45 talloc_asprintf(tctx, "Incorrect value %s=%llu - should be %llu\n", \
46 #v, (long long)v, (long long)correct))
48 #define CHECK_VALUE_STRING(tctx, v, correct) \
49 torture_assert_str_equal(tctx, v, correct, "Invalid value")
51 #define _NBT_NAME(n,t,s) {\
57 static const char *wrepl_name_type_string(enum wrepl_name_type type)
60 case WREPL_TYPE_UNIQUE: return "UNIQUE";
61 case WREPL_TYPE_GROUP: return "GROUP";
62 case WREPL_TYPE_SGROUP: return "SGROUP";
63 case WREPL_TYPE_MHOMED: return "MHOMED";
65 return "UNKNOWN_TYPE";
68 static const char *wrepl_name_state_string(enum wrepl_name_state state)
71 case WREPL_STATE_ACTIVE: return "ACTIVE";
72 case WREPL_STATE_RELEASED: return "RELEASED";
73 case WREPL_STATE_TOMBSTONE: return "TOMBSTONE";
74 case WREPL_STATE_RESERVED: return "RESERVED";
76 return "UNKNOWN_STATE";
80 test how assoc_ctx's are only usable on the connection
83 static bool test_assoc_ctx1(struct torture_context *tctx)
86 struct wrepl_request *req;
87 struct wrepl_socket *wrepl_socket1;
88 struct wrepl_associate associate1;
89 struct wrepl_socket *wrepl_socket2;
90 struct wrepl_associate associate2;
91 struct wrepl_pull_table pull_table;
92 struct wrepl_packet packet;
93 struct wrepl_send_ctrl ctrl;
94 struct wrepl_packet *rep_packet;
95 struct wrepl_associate_stop assoc_stop;
100 if (!torture_setting_bool(tctx, "dangerous", false)) {
101 torture_skip(tctx, "winsrepl: cross connection assoc_ctx usage disabled - enable dangerous tests to use");
104 if (!torture_nbt_get_name(tctx, &name, &address))
107 torture_comment(tctx, "Test if assoc_ctx is only valid on the conection it was created on\n");
109 wrepl_socket1 = wrepl_socket_init(tctx, NULL);
110 wrepl_socket2 = wrepl_socket_init(tctx, NULL);
112 torture_comment(tctx, "Setup 2 wrepl connections\n");
113 status = wrepl_connect(wrepl_socket1, NULL, address);
114 CHECK_STATUS(tctx, status, NT_STATUS_OK);
116 status = wrepl_connect(wrepl_socket2, NULL, address);
117 CHECK_STATUS(tctx, status, NT_STATUS_OK);
119 torture_comment(tctx, "Send a start association request (conn1)\n");
120 status = wrepl_associate(wrepl_socket1, &associate1);
121 CHECK_STATUS(tctx, status, NT_STATUS_OK);
123 torture_comment(tctx, "association context (conn1): 0x%x\n", associate1.out.assoc_ctx);
125 torture_comment(tctx, "Send a start association request (conn2)\n");
126 status = wrepl_associate(wrepl_socket2, &associate2);
127 CHECK_STATUS(tctx, status, NT_STATUS_OK);
129 torture_comment(tctx, "association context (conn2): 0x%x\n", associate2.out.assoc_ctx);
131 torture_comment(tctx, "Send a replication table query, with assoc 1 (conn2), the anwser should be on conn1\n");
133 packet.opcode = WREPL_OPCODE_BITS;
134 packet.assoc_ctx = associate1.out.assoc_ctx;
135 packet.mess_type = WREPL_REPLICATION;
136 packet.message.replication.command = WREPL_REPL_TABLE_QUERY;
138 ctrl.send_only = true;
139 req = wrepl_request_send(wrepl_socket2, &packet, &ctrl);
140 status = wrepl_request_recv(req, tctx, &rep_packet);
141 CHECK_STATUS(tctx, status, NT_STATUS_OK);
143 torture_comment(tctx, "Send a association request (conn2), to make sure the last request was ignored\n");
144 status = wrepl_associate(wrepl_socket2, &associate2);
145 CHECK_STATUS(tctx, status, NT_STATUS_OK);
147 torture_comment(tctx, "Send a replication table query, with invalid assoc (conn1), receive answer from conn2\n");
148 pull_table.in.assoc_ctx = 0;
149 req = wrepl_pull_table_send(wrepl_socket1, &pull_table);
150 status = wrepl_request_recv(req, tctx, &rep_packet);
151 CHECK_STATUS(tctx, status, NT_STATUS_OK);
153 torture_comment(tctx, "Send a association request (conn1), to make sure the last request was handled correct\n");
154 status = wrepl_associate(wrepl_socket1, &associate2);
155 CHECK_STATUS(tctx, status, NT_STATUS_OK);
157 assoc_stop.in.assoc_ctx = associate1.out.assoc_ctx;
158 assoc_stop.in.reason = 4;
159 torture_comment(tctx, "Send a association stop request (conn1), reson: %u\n", assoc_stop.in.reason);
160 status = wrepl_associate_stop(wrepl_socket1, &assoc_stop);
161 CHECK_STATUS(tctx, status, NT_STATUS_END_OF_FILE);
163 assoc_stop.in.assoc_ctx = associate2.out.assoc_ctx;
164 assoc_stop.in.reason = 0;
165 torture_comment(tctx, "Send a association stop request (conn2), reson: %u\n", assoc_stop.in.reason);
166 status = wrepl_associate_stop(wrepl_socket2, &assoc_stop);
167 CHECK_STATUS(tctx, status, NT_STATUS_OK);
169 torture_comment(tctx, "Close 2 wrepl connections\n");
170 talloc_free(wrepl_socket1);
171 talloc_free(wrepl_socket2);
176 test if we always get back the same assoc_ctx
178 static bool test_assoc_ctx2(struct torture_context *tctx)
180 struct wrepl_socket *wrepl_socket;
181 struct wrepl_associate associate;
183 struct nbt_name name;
187 if (!torture_nbt_get_name(tctx, &name, &address))
190 torture_comment(tctx, "Test if we always get back the same assoc_ctx\n");
192 wrepl_socket = wrepl_socket_init(tctx, NULL);
194 torture_comment(tctx, "Setup wrepl connections\n");
195 status = wrepl_connect(wrepl_socket, NULL, address);
196 CHECK_STATUS(tctx, status, NT_STATUS_OK);
198 torture_comment(tctx, "Send 1st start association request\n");
199 status = wrepl_associate(wrepl_socket, &associate);
200 CHECK_STATUS(tctx, status, NT_STATUS_OK);
201 assoc_ctx1 = associate.out.assoc_ctx;
202 torture_comment(tctx, "1st association context: 0x%x\n", associate.out.assoc_ctx);
204 torture_comment(tctx, "Send 2nd start association request\n");
205 status = wrepl_associate(wrepl_socket, &associate);
206 torture_assert_ntstatus_ok(tctx, status, "2nd start association failed");
207 torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1,
208 "Different context returned");
209 torture_comment(tctx, "2nd association context: 0x%x\n", associate.out.assoc_ctx);
211 torture_comment(tctx, "Send 3rd start association request\n");
212 status = wrepl_associate(wrepl_socket, &associate);
213 torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1,
214 "Different context returned");
215 CHECK_STATUS(tctx, status, NT_STATUS_OK);
216 torture_comment(tctx, "3rd association context: 0x%x\n", associate.out.assoc_ctx);
218 torture_comment(tctx, "Close wrepl connections\n");
219 talloc_free(wrepl_socket);
225 display a replication entry
227 static void display_entry(TALLOC_CTX *tctx, struct wrepl_name *name)
231 torture_comment(tctx, "%s\n", nbt_name_string(tctx, &name->name));
232 torture_comment(tctx, "\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n",
233 name->type, name->state, name->node, name->is_static, (long long)name->version_id);
234 torture_comment(tctx, "\tRAW_FLAGS: 0x%08X OWNER: %-15s\n",
235 name->raw_flags, name->owner);
236 for (i=0;i<name->num_addresses;i++) {
237 torture_comment(tctx, "\tADDR: %-15s OWNER: %-15s\n",
238 name->addresses[i].address, name->addresses[i].owner);
243 test a full replication dump from a WINS server
245 static bool test_wins_replication(struct torture_context *tctx)
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;
253 struct nbt_name name;
256 if (!torture_nbt_get_name(tctx, &name, &address))
259 torture_comment(tctx, "Test one pull replication cycle\n");
261 wrepl_socket = wrepl_socket_init(tctx, NULL);
263 torture_comment(tctx, "Setup wrepl connections\n");
264 status = wrepl_connect(wrepl_socket, NULL, address);
265 CHECK_STATUS(tctx, status, NT_STATUS_OK);
267 torture_comment(tctx, "Send a start association request\n");
269 status = wrepl_associate(wrepl_socket, &associate);
270 CHECK_STATUS(tctx, status, NT_STATUS_OK);
272 torture_comment(tctx, "association context: 0x%x\n", associate.out.assoc_ctx);
274 torture_comment(tctx, "Send a replication table query\n");
275 pull_table.in.assoc_ctx = associate.out.assoc_ctx;
277 status = wrepl_pull_table(wrepl_socket, tctx, &pull_table);
278 if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) {
279 struct wrepl_packet packet;
280 struct wrepl_request *req;
283 packet.opcode = WREPL_OPCODE_BITS;
284 packet.assoc_ctx = associate.out.assoc_ctx;
285 packet.mess_type = WREPL_STOP_ASSOCIATION;
286 packet.message.stop.reason = 0;
288 req = wrepl_request_send(wrepl_socket, &packet, NULL);
291 torture_fail(tctx, "We are not a valid pull partner for the server");
293 CHECK_STATUS(tctx, status, NT_STATUS_OK);
295 torture_comment(tctx, "Found %d replication partners\n", pull_table.out.num_partners);
297 for (i=0;i<pull_table.out.num_partners;i++) {
298 struct wrepl_wins_owner *partner = &pull_table.out.partners[i];
299 torture_comment(tctx, "%s max_version=%6llu min_version=%6llu type=%d\n",
301 (long long)partner->max_version,
302 (long long)partner->min_version,
305 pull_names.in.assoc_ctx = associate.out.assoc_ctx;
306 pull_names.in.partner = *partner;
308 status = wrepl_pull_names(wrepl_socket, tctx, &pull_names);
309 CHECK_STATUS(tctx, status, NT_STATUS_OK);
311 torture_comment(tctx, "Received %d names\n", pull_names.out.num_names);
313 for (j=0;j<pull_names.out.num_names;j++) {
314 display_entry(tctx, &pull_names.out.names[j]);
318 torture_comment(tctx, "Close wrepl connections\n");
319 talloc_free(wrepl_socket);
323 struct test_wrepl_conflict_conn {
325 struct wrepl_socket *pull;
328 #define TEST_OWNER_A_ADDRESS "127.65.65.1"
329 #define TEST_ADDRESS_A_PREFIX "127.0.65"
330 #define TEST_OWNER_B_ADDRESS "127.66.66.1"
331 #define TEST_ADDRESS_B_PREFIX "127.0.66"
332 #define TEST_OWNER_X_ADDRESS "127.88.88.1"
333 #define TEST_ADDRESS_X_PREFIX "127.0.88"
335 struct wrepl_wins_owner a, b, c, x;
337 struct socket_address *myaddr;
338 struct socket_address *myaddr2;
339 struct nbt_name_socket *nbtsock;
340 struct nbt_name_socket *nbtsock2;
342 struct nbt_name_socket *nbtsock_srv;
343 struct nbt_name_socket *nbtsock_srv2;
345 uint32_t addresses_best_num;
346 struct wrepl_ip *addresses_best;
348 uint32_t addresses_best2_num;
349 struct wrepl_ip *addresses_best2;
351 uint32_t addresses_all_num;
352 struct wrepl_ip *addresses_all;
354 uint32_t addresses_mhomed_num;
355 struct wrepl_ip *addresses_mhomed;
358 static const struct wrepl_ip addresses_A_1[] = {
360 .owner = TEST_OWNER_A_ADDRESS,
361 .ip = TEST_ADDRESS_A_PREFIX".1"
364 static const struct wrepl_ip addresses_A_2[] = {
366 .owner = TEST_OWNER_A_ADDRESS,
367 .ip = TEST_ADDRESS_A_PREFIX".2"
370 static const struct wrepl_ip addresses_A_3_4[] = {
372 .owner = TEST_OWNER_A_ADDRESS,
373 .ip = TEST_ADDRESS_A_PREFIX".3"
376 .owner = TEST_OWNER_A_ADDRESS,
377 .ip = TEST_ADDRESS_A_PREFIX".4"
380 static const struct wrepl_ip addresses_A_3_4_X_3_4[] = {
382 .owner = TEST_OWNER_A_ADDRESS,
383 .ip = TEST_ADDRESS_A_PREFIX".3"
386 .owner = TEST_OWNER_A_ADDRESS,
387 .ip = TEST_ADDRESS_A_PREFIX".4"
390 .owner = TEST_OWNER_X_ADDRESS,
391 .ip = TEST_ADDRESS_X_PREFIX".3"
394 .owner = TEST_OWNER_X_ADDRESS,
395 .ip = TEST_ADDRESS_X_PREFIX".4"
398 static const struct wrepl_ip addresses_A_3_4_B_3_4[] = {
400 .owner = TEST_OWNER_A_ADDRESS,
401 .ip = TEST_ADDRESS_A_PREFIX".3"
404 .owner = TEST_OWNER_A_ADDRESS,
405 .ip = TEST_ADDRESS_A_PREFIX".4"
408 .owner = TEST_OWNER_B_ADDRESS,
409 .ip = TEST_ADDRESS_B_PREFIX".3"
412 .owner = TEST_OWNER_B_ADDRESS,
413 .ip = TEST_ADDRESS_B_PREFIX".4"
416 static const struct wrepl_ip addresses_A_3_4_OWNER_B[] = {
418 .owner = TEST_OWNER_B_ADDRESS,
419 .ip = TEST_ADDRESS_A_PREFIX".3"
422 .owner = TEST_OWNER_B_ADDRESS,
423 .ip = TEST_ADDRESS_A_PREFIX".4"
426 static const struct wrepl_ip addresses_A_3_4_X_3_4_OWNER_B[] = {
428 .owner = TEST_OWNER_B_ADDRESS,
429 .ip = TEST_ADDRESS_A_PREFIX".3"
432 .owner = TEST_OWNER_B_ADDRESS,
433 .ip = TEST_ADDRESS_A_PREFIX".4"
436 .owner = TEST_OWNER_B_ADDRESS,
437 .ip = TEST_ADDRESS_X_PREFIX".3"
440 .owner = TEST_OWNER_B_ADDRESS,
441 .ip = TEST_ADDRESS_X_PREFIX".4"
445 static const struct wrepl_ip addresses_A_3_4_X_1_2[] = {
447 .owner = TEST_OWNER_A_ADDRESS,
448 .ip = TEST_ADDRESS_A_PREFIX".3"
451 .owner = TEST_OWNER_A_ADDRESS,
452 .ip = TEST_ADDRESS_A_PREFIX".4"
455 .owner = TEST_OWNER_X_ADDRESS,
456 .ip = TEST_ADDRESS_X_PREFIX".1"
459 .owner = TEST_OWNER_X_ADDRESS,
460 .ip = TEST_ADDRESS_X_PREFIX".2"
464 static const struct wrepl_ip addresses_B_1[] = {
466 .owner = TEST_OWNER_B_ADDRESS,
467 .ip = TEST_ADDRESS_B_PREFIX".1"
470 static const struct wrepl_ip addresses_B_2[] = {
472 .owner = TEST_OWNER_B_ADDRESS,
473 .ip = TEST_ADDRESS_B_PREFIX".2"
476 static const struct wrepl_ip addresses_B_3_4[] = {
478 .owner = TEST_OWNER_B_ADDRESS,
479 .ip = TEST_ADDRESS_B_PREFIX".3"
482 .owner = TEST_OWNER_B_ADDRESS,
483 .ip = TEST_ADDRESS_B_PREFIX".4"
486 static const struct wrepl_ip addresses_B_3_4_X_3_4[] = {
488 .owner = TEST_OWNER_B_ADDRESS,
489 .ip = TEST_ADDRESS_B_PREFIX".3"
492 .owner = TEST_OWNER_B_ADDRESS,
493 .ip = TEST_ADDRESS_B_PREFIX".4"
496 .owner = TEST_OWNER_X_ADDRESS,
497 .ip = TEST_ADDRESS_X_PREFIX".3"
500 .owner = TEST_OWNER_X_ADDRESS,
501 .ip = TEST_ADDRESS_X_PREFIX".4"
504 static const struct wrepl_ip addresses_B_3_4_X_1_2[] = {
506 .owner = TEST_OWNER_B_ADDRESS,
507 .ip = TEST_ADDRESS_B_PREFIX".3"
510 .owner = TEST_OWNER_B_ADDRESS,
511 .ip = TEST_ADDRESS_B_PREFIX".4"
514 .owner = TEST_OWNER_X_ADDRESS,
515 .ip = TEST_ADDRESS_X_PREFIX".1"
518 .owner = TEST_OWNER_X_ADDRESS,
519 .ip = TEST_ADDRESS_X_PREFIX".2"
523 static const struct wrepl_ip addresses_X_1_2[] = {
525 .owner = TEST_OWNER_X_ADDRESS,
526 .ip = TEST_ADDRESS_X_PREFIX".1"
529 .owner = TEST_OWNER_X_ADDRESS,
530 .ip = TEST_ADDRESS_X_PREFIX".2"
533 static const struct wrepl_ip addresses_X_3_4[] = {
535 .owner = TEST_OWNER_X_ADDRESS,
536 .ip = TEST_ADDRESS_X_PREFIX".3"
539 .owner = TEST_OWNER_X_ADDRESS,
540 .ip = TEST_ADDRESS_X_PREFIX".4"
544 static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *tctx,
547 struct test_wrepl_conflict_conn *ctx;
548 struct wrepl_associate associate;
549 struct wrepl_pull_table pull_table;
550 struct socket_address *nbt_srv_addr;
554 ctx = talloc_zero(tctx, struct test_wrepl_conflict_conn);
555 if (!ctx) return NULL;
557 ctx->address = address;
558 ctx->pull = wrepl_socket_init(ctx, NULL);
559 if (!ctx->pull) return NULL;
561 torture_comment(tctx, "Setup wrepl conflict pull connection\n");
562 status = wrepl_connect(ctx->pull, NULL, ctx->address);
563 if (!NT_STATUS_IS_OK(status)) return NULL;
565 status = wrepl_associate(ctx->pull, &associate);
566 if (!NT_STATUS_IS_OK(status)) return NULL;
568 ctx->pull_assoc = associate.out.assoc_ctx;
570 ctx->a.address = TEST_OWNER_A_ADDRESS;
571 ctx->a.max_version = 0;
572 ctx->a.min_version = 0;
575 ctx->b.address = TEST_OWNER_B_ADDRESS;
576 ctx->b.max_version = 0;
577 ctx->b.min_version = 0;
580 ctx->x.address = TEST_OWNER_X_ADDRESS;
581 ctx->x.max_version = 0;
582 ctx->x.min_version = 0;
585 ctx->c.address = address;
586 ctx->c.max_version = 0;
587 ctx->c.min_version = 0;
590 pull_table.in.assoc_ctx = ctx->pull_assoc;
591 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
592 if (!NT_STATUS_IS_OK(status)) return NULL;
594 for (i=0; i < pull_table.out.num_partners; i++) {
595 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
596 ctx->a.max_version = pull_table.out.partners[i].max_version;
597 ctx->a.min_version = pull_table.out.partners[i].min_version;
599 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
600 ctx->b.max_version = pull_table.out.partners[i].max_version;
601 ctx->b.min_version = pull_table.out.partners[i].min_version;
603 if (strcmp(TEST_OWNER_X_ADDRESS,pull_table.out.partners[i].address)==0) {
604 ctx->x.max_version = pull_table.out.partners[i].max_version;
605 ctx->x.min_version = pull_table.out.partners[i].min_version;
607 if (strcmp(address,pull_table.out.partners[i].address)==0) {
608 ctx->c.max_version = pull_table.out.partners[i].max_version;
609 ctx->c.min_version = pull_table.out.partners[i].min_version;
613 talloc_free(pull_table.out.partners);
615 ctx->nbtsock = nbt_name_socket_init(ctx, NULL);
616 if (!ctx->nbtsock) return NULL;
618 ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_best_ip(address), 0);
619 if (!ctx->myaddr) return NULL;
621 for (i = 0; i < iface_count(); i++) {
622 if (strcmp(ctx->myaddr->addr, iface_n_ip(i)) == 0) continue;
623 ctx->myaddr2 = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_n_ip(i), 0);
624 if (!ctx->myaddr2) return NULL;
628 status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0);
629 if (!NT_STATUS_IS_OK(status)) return NULL;
631 ctx->nbtsock_srv = nbt_name_socket_init(ctx, NULL);
632 if (!ctx->nbtsock_srv) return NULL;
634 /* Make a port 137 version of ctx->myaddr */
635 nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lp_nbt_port());
636 if (!nbt_srv_addr) return NULL;
638 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
639 status = socket_listen(ctx->nbtsock_srv->sock, nbt_srv_addr, 0, 0);
640 talloc_free(nbt_srv_addr);
641 if (!NT_STATUS_IS_OK(status)) {
642 /* this isn't fatal */
643 talloc_free(ctx->nbtsock_srv);
644 ctx->nbtsock_srv = NULL;
647 if (ctx->myaddr2 && ctx->nbtsock_srv) {
648 ctx->nbtsock2 = nbt_name_socket_init(ctx, NULL);
649 if (!ctx->nbtsock2) return NULL;
651 status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0);
652 if (!NT_STATUS_IS_OK(status)) return NULL;
654 ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx);
655 if (!ctx->nbtsock_srv2) return NULL;
657 /* Make a port 137 version of ctx->myaddr2 */
658 nbt_srv_addr = socket_address_from_strings(tctx,
659 ctx->nbtsock_srv->sock->backend_name,
660 ctx->myaddr2->addr, lp_nbt_port());
661 if (!nbt_srv_addr) return NULL;
663 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
664 status = socket_listen(ctx->nbtsock_srv2->sock, ctx->myaddr2, 0, 0);
665 talloc_free(nbt_srv_addr);
666 if (!NT_STATUS_IS_OK(status)) {
667 /* this isn't fatal */
668 talloc_free(ctx->nbtsock_srv2);
669 ctx->nbtsock_srv2 = NULL;
673 ctx->addresses_best_num = 1;
674 ctx->addresses_best = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best_num);
675 if (!ctx->addresses_best) return NULL;
676 ctx->addresses_best[0].owner = ctx->b.address;
677 ctx->addresses_best[0].ip = ctx->myaddr->addr;
679 ctx->addresses_all_num = iface_count();
680 ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num);
681 if (!ctx->addresses_all) return NULL;
682 for (i=0; i < ctx->addresses_all_num; i++) {
683 ctx->addresses_all[i].owner = ctx->b.address;
684 ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(i));
685 if (!ctx->addresses_all[i].ip) return NULL;
688 if (ctx->nbtsock_srv2) {
689 ctx->addresses_best2_num = 1;
690 ctx->addresses_best2 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best2_num);
691 if (!ctx->addresses_best2) return NULL;
692 ctx->addresses_best2[0].owner = ctx->b.address;
693 ctx->addresses_best2[0].ip = ctx->myaddr2->addr;
695 ctx->addresses_mhomed_num = 2;
696 ctx->addresses_mhomed = talloc_array(ctx, struct wrepl_ip, ctx->addresses_mhomed_num);
697 if (!ctx->addresses_mhomed) return NULL;
698 ctx->addresses_mhomed[0].owner = ctx->b.address;
699 ctx->addresses_mhomed[0].ip = ctx->myaddr->addr;
700 ctx->addresses_mhomed[1].owner = ctx->b.address;
701 ctx->addresses_mhomed[1].ip = ctx->myaddr2->addr;
707 static bool test_wrepl_update_one(struct torture_context *tctx,
708 struct test_wrepl_conflict_conn *ctx,
709 const struct wrepl_wins_owner *owner,
710 const struct wrepl_wins_name *name)
712 struct wrepl_socket *wrepl_socket;
713 struct wrepl_associate associate;
714 struct wrepl_packet update_packet, repl_send;
715 struct wrepl_table *update;
716 struct wrepl_wins_owner wrepl_wins_owners[1];
717 struct wrepl_packet *repl_recv;
718 struct wrepl_wins_owner *send_request;
719 struct wrepl_send_reply *send_reply;
720 struct wrepl_wins_name wrepl_wins_names[1];
724 wrepl_socket = wrepl_socket_init(ctx, NULL);
726 status = wrepl_connect(wrepl_socket, NULL, ctx->address);
727 CHECK_STATUS(tctx, status, NT_STATUS_OK);
729 status = wrepl_associate(wrepl_socket, &associate);
730 CHECK_STATUS(tctx, status, NT_STATUS_OK);
731 assoc_ctx = associate.out.assoc_ctx;
733 /* now send a WREPL_REPL_UPDATE message */
734 ZERO_STRUCT(update_packet);
735 update_packet.opcode = WREPL_OPCODE_BITS;
736 update_packet.assoc_ctx = assoc_ctx;
737 update_packet.mess_type = WREPL_REPLICATION;
738 update_packet.message.replication.command = WREPL_REPL_UPDATE;
739 update = &update_packet.message.replication.info.table;
741 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
742 update->partners = wrepl_wins_owners;
743 update->initiator = "0.0.0.0";
745 wrepl_wins_owners[0] = *owner;
747 status = wrepl_request(wrepl_socket, wrepl_socket,
748 &update_packet, &repl_recv);
749 CHECK_STATUS(tctx, status, NT_STATUS_OK);
750 CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_REPLICATION);
751 CHECK_VALUE(tctx, repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
752 send_request = &repl_recv->message.replication.info.owner;
754 ZERO_STRUCT(repl_send);
755 repl_send.opcode = WREPL_OPCODE_BITS;
756 repl_send.assoc_ctx = assoc_ctx;
757 repl_send.mess_type = WREPL_REPLICATION;
758 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
759 send_reply = &repl_send.message.replication.info.reply;
761 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
762 send_reply->names = wrepl_wins_names;
764 wrepl_wins_names[0] = *name;
766 status = wrepl_request(wrepl_socket, wrepl_socket,
767 &repl_send, &repl_recv);
768 CHECK_STATUS(tctx, status, NT_STATUS_OK);
769 CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
770 CHECK_VALUE(tctx, repl_recv->message.stop.reason, 0);
772 talloc_free(wrepl_socket);
776 static bool test_wrepl_is_applied(struct torture_context *tctx,
777 struct test_wrepl_conflict_conn *ctx,
778 const struct wrepl_wins_owner *owner,
779 const struct wrepl_wins_name *name,
783 struct wrepl_pull_names pull_names;
784 struct wrepl_name *names;
786 pull_names.in.assoc_ctx = ctx->pull_assoc;
787 pull_names.in.partner = *owner;
788 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
790 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
791 CHECK_STATUS(tctx, status, NT_STATUS_OK);
792 torture_assert(tctx, pull_names.out.num_names == (expected?1:0),
793 talloc_asprintf(tctx, "Invalid number of records returned - expected %d got %d", expected, pull_names.out.num_names));
795 names = pull_names.out.names;
798 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
802 CHECK_VALUE(tctx, names[0].name.type, name->name->type);
803 CHECK_VALUE_STRING(tctx, names[0].name.name, name->name->name);
804 CHECK_VALUE_STRING(tctx, names[0].name.scope, name->name->scope);
805 CHECK_VALUE(tctx, flags, name->flags);
806 CHECK_VALUE_UINT64(tctx, names[0].version_id, name->id);
809 CHECK_VALUE(tctx, names[0].num_addresses,
810 name->addresses.addresses.num_ips);
812 CHECK_VALUE(tctx, names[0].num_addresses, 1);
813 CHECK_VALUE_STRING(tctx, names[0].addresses[0].address,
817 talloc_free(pull_names.out.names);
821 static bool test_wrepl_mhomed_merged(struct torture_context *tctx,
822 struct test_wrepl_conflict_conn *ctx,
823 const struct wrepl_wins_owner *owner1,
824 uint32_t num_ips1, const struct wrepl_ip *ips1,
825 const struct wrepl_wins_owner *owner2,
826 uint32_t num_ips2, const struct wrepl_ip *ips2,
827 const struct wrepl_wins_name *name2)
830 struct wrepl_pull_names pull_names;
831 struct wrepl_name *names;
834 uint32_t num_ips = num_ips1 + num_ips2;
836 for (i = 0; i < num_ips2; i++) {
837 for (j = 0; j < num_ips1; j++) {
838 if (strcmp(ips2[i].ip,ips1[j].ip) == 0) {
845 pull_names.in.assoc_ctx = ctx->pull_assoc;
846 pull_names.in.partner = *owner2;
847 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
849 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
850 CHECK_STATUS(tctx, status, NT_STATUS_OK);
851 CHECK_VALUE(tctx, pull_names.out.num_names, 1);
853 names = pull_names.out.names;
855 flags = WREPL_NAME_FLAGS(names[0].type,
859 CHECK_VALUE(tctx, names[0].name.type, name2->name->type);
860 CHECK_VALUE_STRING(tctx, names[0].name.name, name2->name->name);
861 CHECK_VALUE_STRING(tctx, names[0].name.scope, name2->name->scope);
862 CHECK_VALUE(tctx, flags, name2->flags | WREPL_TYPE_MHOMED);
863 CHECK_VALUE_UINT64(tctx, names[0].version_id, name2->id);
865 CHECK_VALUE(tctx, names[0].num_addresses, num_ips);
867 for (i = 0; i < names[0].num_addresses; i++) {
868 const char *addr = names[0].addresses[i].address;
869 const char *owner = names[0].addresses[i].owner;
872 for (j = 0; j < num_ips2; j++) {
873 if (strcmp(addr, ips2[j].ip) == 0) {
875 CHECK_VALUE_STRING(tctx, owner, owner2->address);
882 for (j = 0; j < num_ips1; j++) {
883 if (strcmp(addr, ips1[j].ip) == 0) {
885 CHECK_VALUE_STRING(tctx, owner, owner1->address);
892 CHECK_VALUE_STRING(tctx, addr, "not found in address list");
894 talloc_free(pull_names.out.names);
898 static bool test_wrepl_sgroup_merged(struct torture_context *tctx,
899 struct test_wrepl_conflict_conn *ctx,
900 struct wrepl_wins_owner *merge_owner,
901 struct wrepl_wins_owner *owner1,
902 uint32_t num_ips1, const struct wrepl_ip *ips1,
903 struct wrepl_wins_owner *owner2,
904 uint32_t num_ips2, const struct wrepl_ip *ips2,
905 const struct wrepl_wins_name *name2)
908 struct wrepl_pull_names pull_names;
909 struct wrepl_name *names;
910 struct wrepl_name *name = NULL;
913 uint32_t num_ips = num_ips1 + num_ips2;
916 merge_owner = &ctx->c;
919 for (i = 0; i < num_ips1; i++) {
920 if (owner1 != &ctx->c && strcmp(ips1[i].owner,owner2->address) == 0) {
924 for (j = 0; j < num_ips2; j++) {
925 if (strcmp(ips1[i].ip,ips2[j].ip) == 0) {
933 pull_names.in.assoc_ctx = ctx->pull_assoc;
934 pull_names.in.partner = *merge_owner;
935 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
936 pull_names.in.partner.max_version = 0;
938 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
939 CHECK_STATUS(tctx, status, NT_STATUS_OK);
941 names = pull_names.out.names;
943 for (i = 0; i < pull_names.out.num_names; i++) {
944 if (names[i].name.type != name2->name->type) continue;
945 if (!names[i].name.name) continue;
946 if (strcmp(names[i].name.name, name2->name->name) != 0) continue;
947 if (names[i].name.scope) continue;
952 if (pull_names.out.num_names > 0) {
953 merge_owner->max_version = names[pull_names.out.num_names-1].version_id;
957 torture_comment(tctx, "%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name));
961 flags = WREPL_NAME_FLAGS(name->type,
965 CHECK_VALUE(tctx, name->name.type, name2->name->type);
966 CHECK_VALUE_STRING(tctx, name->name.name, name2->name->name);
967 CHECK_VALUE_STRING(tctx, name->name.scope, name2->name->scope);
968 CHECK_VALUE(tctx, flags, name2->flags);
970 CHECK_VALUE(tctx, name->num_addresses, num_ips);
972 for (i = 0; i < name->num_addresses; i++) {
973 const char *addr = name->addresses[i].address;
974 const char *owner = name->addresses[i].owner;
977 for (j = 0; j < num_ips2; j++) {
978 if (strcmp(addr, ips2[j].ip) == 0) {
980 CHECK_VALUE_STRING(tctx, owner, ips2[j].owner);
987 for (j = 0; j < num_ips1; j++) {
988 if (strcmp(addr, ips1[j].ip) == 0) {
990 if (owner1 == &ctx->c) {
991 CHECK_VALUE_STRING(tctx, owner, owner1->address);
993 CHECK_VALUE_STRING(tctx, owner, ips1[j].owner);
1001 CHECK_VALUE_STRING(tctx, addr, "not found in address list");
1003 talloc_free(pull_names.out.names);
1007 static bool test_conflict_same_owner(struct torture_context *tctx,
1008 struct test_wrepl_conflict_conn *ctx)
1010 static bool ret = true;
1011 struct nbt_name name;
1012 struct wrepl_wins_name wins_name1;
1013 struct wrepl_wins_name wins_name2;
1014 struct wrepl_wins_name *wins_name_tmp;
1015 struct wrepl_wins_name *wins_name_last;
1016 struct wrepl_wins_name *wins_name_cur;
1018 uint8_t types[] = { 0x00, 0x1C };
1020 enum wrepl_name_type type;
1021 enum wrepl_name_state state;
1022 enum wrepl_name_node node;
1025 const struct wrepl_ip *ips;
1028 .type = WREPL_TYPE_GROUP,
1029 .state = WREPL_STATE_ACTIVE,
1030 .node = WREPL_NODE_B,
1032 .num_ips = ARRAY_SIZE(addresses_A_1),
1033 .ips = addresses_A_1,
1035 .type = WREPL_TYPE_UNIQUE,
1036 .state = WREPL_STATE_ACTIVE,
1037 .node = WREPL_NODE_B,
1039 .num_ips = ARRAY_SIZE(addresses_A_1),
1040 .ips = addresses_A_1,
1042 .type = WREPL_TYPE_UNIQUE,
1043 .state = WREPL_STATE_ACTIVE,
1044 .node = WREPL_NODE_B,
1046 .num_ips = ARRAY_SIZE(addresses_A_2),
1047 .ips = addresses_A_2,
1049 .type = WREPL_TYPE_UNIQUE,
1050 .state = WREPL_STATE_ACTIVE,
1051 .node = WREPL_NODE_B,
1053 .num_ips = ARRAY_SIZE(addresses_A_1),
1054 .ips = addresses_A_1,
1056 .type = WREPL_TYPE_UNIQUE,
1057 .state = WREPL_STATE_ACTIVE,
1058 .node = WREPL_NODE_B,
1060 .num_ips = ARRAY_SIZE(addresses_A_2),
1061 .ips = addresses_A_2,
1063 .type = WREPL_TYPE_SGROUP,
1064 .state = WREPL_STATE_TOMBSTONE,
1065 .node = WREPL_NODE_B,
1067 .num_ips = ARRAY_SIZE(addresses_A_2),
1068 .ips = addresses_A_2,
1070 .type = WREPL_TYPE_MHOMED,
1071 .state = WREPL_STATE_TOMBSTONE,
1072 .node = WREPL_NODE_B,
1074 .num_ips = ARRAY_SIZE(addresses_A_1),
1075 .ips = addresses_A_1,
1077 .type = WREPL_TYPE_MHOMED,
1078 .state = WREPL_STATE_RELEASED,
1079 .node = WREPL_NODE_B,
1081 .num_ips = ARRAY_SIZE(addresses_A_2),
1082 .ips = addresses_A_2,
1084 .type = WREPL_TYPE_SGROUP,
1085 .state = WREPL_STATE_ACTIVE,
1086 .node = WREPL_NODE_B,
1088 .num_ips = ARRAY_SIZE(addresses_A_1),
1089 .ips = addresses_A_1,
1091 .type = WREPL_TYPE_SGROUP,
1092 .state = WREPL_STATE_ACTIVE,
1093 .node = WREPL_NODE_B,
1095 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1096 .ips = addresses_A_3_4,
1098 .type = WREPL_TYPE_SGROUP,
1099 .state = WREPL_STATE_TOMBSTONE,
1100 .node = WREPL_NODE_B,
1102 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1103 .ips = addresses_B_3_4,
1105 /* the last one should always be a unique,tomstone record! */
1106 .type = WREPL_TYPE_UNIQUE,
1107 .state = WREPL_STATE_TOMBSTONE,
1108 .node = WREPL_NODE_B,
1110 .num_ips = ARRAY_SIZE(addresses_A_1),
1111 .ips = addresses_A_1,
1115 name.name = "_SAME_OWNER_A";
1119 wins_name_tmp = NULL;
1120 wins_name_last = &wins_name2;
1121 wins_name_cur = &wins_name1;
1123 for (j=0; ret && j < ARRAY_SIZE(types); j++) {
1124 name.type = types[j];
1125 torture_comment(tctx, "Test Replica Conflicts with same owner[%s] for %s\n",
1126 nbt_name_string(ctx, &name), ctx->a.address);
1128 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
1129 wins_name_tmp = wins_name_last;
1130 wins_name_last = wins_name_cur;
1131 wins_name_cur = wins_name_tmp;
1134 torture_comment(tctx, "%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
1135 wrepl_name_type_string(records[i-1].type),
1136 wrepl_name_state_string(records[i-1].state),
1137 (records[i-1].is_static?",static":""),
1138 wrepl_name_type_string(records[i].type),
1139 wrepl_name_state_string(records[i].state),
1140 (records[i].is_static?",static":""),
1141 (records[i-1].ips==records[i].ips?"same":"different"),
1145 wins_name_cur->name = &name;
1146 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
1149 records[i].is_static);
1150 wins_name_cur->id = ++ctx->a.max_version;
1151 if (wins_name_cur->flags & 2) {
1152 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
1153 wins_name_cur->addresses.addresses.ips = discard_const(records[i].ips);
1155 wins_name_cur->addresses.ip = records[i].ips[0].ip;
1157 wins_name_cur->unknown = "255.255.255.255";
1159 ret &= test_wrepl_update_one(tctx, ctx, &ctx->a,wins_name_cur);
1160 if (records[i].state == WREPL_STATE_RELEASED) {
1161 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_last, false);
1162 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, false);
1164 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, true);
1167 /* the first one is a cleanup run */
1168 if (!ret && i == 0) ret = true;
1171 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, __location__);
1179 static bool test_conflict_different_owner(struct torture_context *tctx,
1180 struct test_wrepl_conflict_conn *ctx)
1183 struct wrepl_wins_name wins_name1;
1184 struct wrepl_wins_name wins_name2;
1185 struct wrepl_wins_name *wins_name_r1;
1186 struct wrepl_wins_name *wins_name_r2;
1189 const char *line; /* just better debugging */
1190 struct nbt_name name;
1191 const char *comment;
1192 bool extra; /* not the worst case, this is an extra test */
1195 struct wrepl_wins_owner *owner;
1196 enum wrepl_name_type type;
1197 enum wrepl_name_state state;
1198 enum wrepl_name_node node;
1201 const struct wrepl_ip *ips;
1202 bool apply_expected;
1204 struct wrepl_wins_owner *merge_owner;
1205 bool sgroup_cleanup;
1209 * NOTE: the first record and the last applied one
1210 * needs to be from the same owner,
1211 * to not conflict in the next smbtorture run!!!
1214 .line = __location__,
1215 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1219 .type = WREPL_TYPE_UNIQUE,
1220 .state = WREPL_STATE_TOMBSTONE,
1221 .node = WREPL_NODE_B,
1223 .num_ips = ARRAY_SIZE(addresses_B_1),
1224 .ips = addresses_B_1,
1225 .apply_expected = true /* ignored */
1229 .type = WREPL_TYPE_UNIQUE,
1230 .state = WREPL_STATE_TOMBSTONE,
1231 .node = WREPL_NODE_B,
1233 .num_ips = ARRAY_SIZE(addresses_A_1),
1234 .ips = addresses_A_1,
1235 .apply_expected = true /* ignored */
1240 * unique vs unique section
1243 * unique,active vs. unique,active
1244 * => should be replaced
1247 .line = __location__,
1248 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1251 .type = WREPL_TYPE_UNIQUE,
1252 .state = WREPL_STATE_ACTIVE,
1253 .node = WREPL_NODE_B,
1255 .num_ips = ARRAY_SIZE(addresses_A_1),
1256 .ips = addresses_A_1,
1257 .apply_expected = true
1261 .type = WREPL_TYPE_UNIQUE,
1262 .state = WREPL_STATE_ACTIVE,
1263 .node = WREPL_NODE_B,
1265 .num_ips = ARRAY_SIZE(addresses_B_1),
1266 .ips = addresses_B_1,
1267 .apply_expected = true
1272 * unique,active vs. unique,tombstone
1273 * => should NOT be replaced
1276 .line = __location__,
1277 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1280 .type = WREPL_TYPE_UNIQUE,
1281 .state = WREPL_STATE_ACTIVE,
1282 .node = WREPL_NODE_B,
1284 .num_ips = ARRAY_SIZE(addresses_B_1),
1285 .ips = addresses_B_1,
1286 .apply_expected = true
1290 .type = WREPL_TYPE_UNIQUE,
1291 .state = WREPL_STATE_TOMBSTONE,
1292 .node = WREPL_NODE_B,
1294 .num_ips = ARRAY_SIZE(addresses_B_1),
1295 .ips = addresses_B_1,
1296 .apply_expected = false
1301 * unique,released vs. unique,active
1302 * => should be replaced
1305 .line = __location__,
1306 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1309 .type = WREPL_TYPE_UNIQUE,
1310 .state = WREPL_STATE_RELEASED,
1311 .node = WREPL_NODE_B,
1313 .num_ips = ARRAY_SIZE(addresses_B_1),
1314 .ips = addresses_B_1,
1315 .apply_expected = false
1319 .type = WREPL_TYPE_UNIQUE,
1320 .state = WREPL_STATE_ACTIVE,
1321 .node = WREPL_NODE_B,
1323 .num_ips = ARRAY_SIZE(addresses_A_1),
1324 .ips = addresses_A_1,
1325 .apply_expected = true
1330 * unique,released vs. unique,tombstone
1331 * => should be replaced
1334 .line = __location__,
1335 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1338 .type = WREPL_TYPE_UNIQUE,
1339 .state = WREPL_STATE_RELEASED,
1340 .node = WREPL_NODE_B,
1342 .num_ips = ARRAY_SIZE(addresses_A_1),
1343 .ips = addresses_A_1,
1344 .apply_expected = false
1348 .type = WREPL_TYPE_UNIQUE,
1349 .state = WREPL_STATE_TOMBSTONE,
1350 .node = WREPL_NODE_B,
1352 .num_ips = ARRAY_SIZE(addresses_B_1),
1353 .ips = addresses_B_1,
1354 .apply_expected = true
1359 * unique,tombstone vs. unique,active
1360 * => should be replaced
1363 .line = __location__,
1364 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1367 .type = WREPL_TYPE_UNIQUE,
1368 .state = WREPL_STATE_TOMBSTONE,
1369 .node = WREPL_NODE_B,
1371 .num_ips = ARRAY_SIZE(addresses_B_1),
1372 .ips = addresses_B_1,
1373 .apply_expected = true
1377 .type = WREPL_TYPE_UNIQUE,
1378 .state = WREPL_STATE_ACTIVE,
1379 .node = WREPL_NODE_B,
1381 .num_ips = ARRAY_SIZE(addresses_A_1),
1382 .ips = addresses_A_1,
1383 .apply_expected = true
1388 * unique,tombstone vs. unique,tombstone
1389 * => should be replaced
1392 .line = __location__,
1393 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1396 .type = WREPL_TYPE_UNIQUE,
1397 .state = WREPL_STATE_TOMBSTONE,
1398 .node = WREPL_NODE_B,
1400 .num_ips = ARRAY_SIZE(addresses_A_1),
1401 .ips = addresses_A_1,
1402 .apply_expected = true
1406 .type = WREPL_TYPE_UNIQUE,
1407 .state = WREPL_STATE_TOMBSTONE,
1408 .node = WREPL_NODE_B,
1410 .num_ips = ARRAY_SIZE(addresses_B_1),
1411 .ips = addresses_B_1,
1412 .apply_expected = true
1418 * unique vs normal groups section,
1421 * unique,active vs. group,active
1422 * => should be replaced
1425 .line = __location__,
1426 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1429 .type = WREPL_TYPE_UNIQUE,
1430 .state = WREPL_STATE_ACTIVE,
1431 .node = WREPL_NODE_B,
1433 .num_ips = ARRAY_SIZE(addresses_B_1),
1434 .ips = addresses_B_1,
1435 .apply_expected = true
1439 .type = WREPL_TYPE_GROUP,
1440 .state = WREPL_STATE_ACTIVE,
1441 .node = WREPL_NODE_B,
1443 .num_ips = ARRAY_SIZE(addresses_A_1),
1444 .ips = addresses_A_1,
1445 .apply_expected = true
1450 * unique,active vs. group,tombstone
1451 * => should NOT be replaced
1454 .line = __location__,
1455 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1458 .type = WREPL_TYPE_UNIQUE,
1459 .state = WREPL_STATE_ACTIVE,
1460 .node = WREPL_NODE_B,
1462 .num_ips = ARRAY_SIZE(addresses_A_1),
1463 .ips = addresses_A_1,
1464 .apply_expected = true
1468 .type = WREPL_TYPE_GROUP,
1469 .state = WREPL_STATE_TOMBSTONE,
1470 .node = WREPL_NODE_B,
1472 .num_ips = ARRAY_SIZE(addresses_A_1),
1473 .ips = addresses_A_1,
1474 .apply_expected = false
1479 * unique,released vs. group,active
1480 * => should be replaced
1483 .line = __location__,
1484 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1487 .type = WREPL_TYPE_UNIQUE,
1488 .state = WREPL_STATE_RELEASED,
1489 .node = WREPL_NODE_B,
1491 .num_ips = ARRAY_SIZE(addresses_A_1),
1492 .ips = addresses_A_1,
1493 .apply_expected = false
1497 .type = WREPL_TYPE_GROUP,
1498 .state = WREPL_STATE_ACTIVE,
1499 .node = WREPL_NODE_B,
1501 .num_ips = ARRAY_SIZE(addresses_B_1),
1502 .ips = addresses_B_1,
1503 .apply_expected = true
1508 * unique,released vs. group,tombstone
1509 * => should be replaced
1512 .line = __location__,
1513 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1516 .type = WREPL_TYPE_UNIQUE,
1517 .state = WREPL_STATE_RELEASED,
1518 .node = WREPL_NODE_B,
1520 .num_ips = ARRAY_SIZE(addresses_B_1),
1521 .ips = addresses_B_1,
1522 .apply_expected = false
1526 .type = WREPL_TYPE_GROUP,
1527 .state = WREPL_STATE_TOMBSTONE,
1528 .node = WREPL_NODE_B,
1530 .num_ips = ARRAY_SIZE(addresses_A_1),
1531 .ips = addresses_A_1,
1532 .apply_expected = true
1537 * unique,tombstone vs. group,active
1538 * => should be replaced
1541 .line = __location__,
1542 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1545 .type = WREPL_TYPE_UNIQUE,
1546 .state = WREPL_STATE_TOMBSTONE,
1547 .node = WREPL_NODE_B,
1549 .num_ips = ARRAY_SIZE(addresses_A_1),
1550 .ips = addresses_A_1,
1551 .apply_expected = true
1555 .type = WREPL_TYPE_GROUP,
1556 .state = WREPL_STATE_ACTIVE,
1557 .node = WREPL_NODE_B,
1559 .num_ips = ARRAY_SIZE(addresses_B_1),
1560 .ips = addresses_B_1,
1561 .apply_expected = true
1566 * unique,tombstone vs. group,tombstone
1567 * => should be replaced
1570 .line = __location__,
1571 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1574 .type = WREPL_TYPE_UNIQUE,
1575 .state = WREPL_STATE_TOMBSTONE,
1576 .node = WREPL_NODE_B,
1578 .num_ips = ARRAY_SIZE(addresses_B_1),
1579 .ips = addresses_B_1,
1580 .apply_expected = true
1584 .type = WREPL_TYPE_GROUP,
1585 .state = WREPL_STATE_TOMBSTONE,
1586 .node = WREPL_NODE_B,
1588 .num_ips = ARRAY_SIZE(addresses_A_1),
1589 .ips = addresses_A_1,
1590 .apply_expected = true
1595 * unique vs special groups section,
1598 * unique,active vs. sgroup,active
1599 * => should NOT be replaced
1602 .line = __location__,
1603 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1606 .type = WREPL_TYPE_UNIQUE,
1607 .state = WREPL_STATE_ACTIVE,
1608 .node = WREPL_NODE_B,
1610 .num_ips = ARRAY_SIZE(addresses_A_1),
1611 .ips = addresses_A_1,
1612 .apply_expected = true
1616 .type = WREPL_TYPE_SGROUP,
1617 .state = WREPL_STATE_ACTIVE,
1618 .node = WREPL_NODE_B,
1620 .num_ips = ARRAY_SIZE(addresses_A_1),
1621 .ips = addresses_A_1,
1622 .apply_expected = false
1627 * unique,active vs. sgroup,tombstone
1628 * => should NOT be replaced
1631 .line = __location__,
1632 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1635 .type = WREPL_TYPE_UNIQUE,
1636 .state = WREPL_STATE_ACTIVE,
1637 .node = WREPL_NODE_B,
1639 .num_ips = ARRAY_SIZE(addresses_A_1),
1640 .ips = addresses_A_1,
1641 .apply_expected = true
1645 .type = WREPL_TYPE_SGROUP,
1646 .state = WREPL_STATE_TOMBSTONE,
1647 .node = WREPL_NODE_B,
1649 .num_ips = ARRAY_SIZE(addresses_A_1),
1650 .ips = addresses_A_1,
1651 .apply_expected = false
1656 * unique,released vs. sgroup,active
1657 * => should be replaced
1660 .line = __location__,
1661 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1664 .type = WREPL_TYPE_UNIQUE,
1665 .state = WREPL_STATE_RELEASED,
1666 .node = WREPL_NODE_B,
1668 .num_ips = ARRAY_SIZE(addresses_A_1),
1669 .ips = addresses_A_1,
1670 .apply_expected = false
1674 .type = WREPL_TYPE_SGROUP,
1675 .state = WREPL_STATE_ACTIVE,
1676 .node = WREPL_NODE_B,
1678 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1679 .ips = addresses_B_3_4,
1680 .apply_expected = true
1685 * unique,released vs. sgroup,tombstone
1686 * => should be replaced
1689 .line = __location__,
1690 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1693 .type = WREPL_TYPE_UNIQUE,
1694 .state = WREPL_STATE_RELEASED,
1695 .node = WREPL_NODE_B,
1697 .num_ips = ARRAY_SIZE(addresses_B_1),
1698 .ips = addresses_B_1,
1699 .apply_expected = false
1703 .type = WREPL_TYPE_SGROUP,
1704 .state = WREPL_STATE_TOMBSTONE,
1705 .node = WREPL_NODE_B,
1707 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1708 .ips = addresses_A_3_4,
1709 .apply_expected = true
1714 * unique,tombstone vs. sgroup,active
1715 * => should be replaced
1718 .line = __location__,
1719 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1722 .type = WREPL_TYPE_UNIQUE,
1723 .state = WREPL_STATE_TOMBSTONE,
1724 .node = WREPL_NODE_B,
1726 .num_ips = ARRAY_SIZE(addresses_A_1),
1727 .ips = addresses_A_1,
1728 .apply_expected = true
1732 .type = WREPL_TYPE_SGROUP,
1733 .state = WREPL_STATE_ACTIVE,
1734 .node = WREPL_NODE_B,
1736 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1737 .ips = addresses_B_3_4,
1738 .apply_expected = true
1743 * unique,tombstone vs. sgroup,tombstone
1744 * => should be replaced
1747 .line = __location__,
1748 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1751 .type = WREPL_TYPE_UNIQUE,
1752 .state = WREPL_STATE_TOMBSTONE,
1753 .node = WREPL_NODE_B,
1755 .num_ips = ARRAY_SIZE(addresses_B_1),
1756 .ips = addresses_B_1,
1757 .apply_expected = true
1761 .type = WREPL_TYPE_SGROUP,
1762 .state = WREPL_STATE_TOMBSTONE,
1763 .node = WREPL_NODE_B,
1765 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1766 .ips = addresses_A_3_4,
1767 .apply_expected = true
1772 * unique vs multi homed section,
1775 * unique,active vs. mhomed,active
1776 * => should be replaced
1779 .line = __location__,
1780 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1783 .type = WREPL_TYPE_UNIQUE,
1784 .state = WREPL_STATE_ACTIVE,
1785 .node = WREPL_NODE_B,
1787 .num_ips = ARRAY_SIZE(addresses_A_1),
1788 .ips = addresses_A_1,
1789 .apply_expected = true
1793 .type = WREPL_TYPE_MHOMED,
1794 .state = WREPL_STATE_ACTIVE,
1795 .node = WREPL_NODE_B,
1797 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1798 .ips = addresses_B_3_4,
1799 .apply_expected = true
1804 * unique,active vs. mhomed,tombstone
1805 * => should NOT be replaced
1808 .line = __location__,
1809 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1812 .type = WREPL_TYPE_UNIQUE,
1813 .state = WREPL_STATE_ACTIVE,
1814 .node = WREPL_NODE_B,
1816 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1817 .ips = addresses_B_3_4,
1818 .apply_expected = true
1822 .type = WREPL_TYPE_MHOMED,
1823 .state = WREPL_STATE_TOMBSTONE,
1824 .node = WREPL_NODE_B,
1826 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1827 .ips = addresses_B_3_4,
1828 .apply_expected = false
1833 * unique,released vs. mhomed,active
1834 * => should be replaced
1837 .line = __location__,
1838 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1841 .type = WREPL_TYPE_UNIQUE,
1842 .state = WREPL_STATE_RELEASED,
1843 .node = WREPL_NODE_B,
1845 .num_ips = ARRAY_SIZE(addresses_B_1),
1846 .ips = addresses_B_1,
1847 .apply_expected = false
1851 .type = WREPL_TYPE_MHOMED,
1852 .state = WREPL_STATE_ACTIVE,
1853 .node = WREPL_NODE_B,
1855 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1856 .ips = addresses_A_3_4,
1857 .apply_expected = true
1862 * unique,released vs. mhomed,tombstone
1863 * => should be replaced
1866 .line = __location__,
1867 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1870 .type = WREPL_TYPE_UNIQUE,
1871 .state = WREPL_STATE_RELEASED,
1872 .node = WREPL_NODE_B,
1874 .num_ips = ARRAY_SIZE(addresses_A_1),
1875 .ips = addresses_A_1,
1876 .apply_expected = false
1880 .type = WREPL_TYPE_MHOMED,
1881 .state = WREPL_STATE_TOMBSTONE,
1882 .node = WREPL_NODE_B,
1884 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1885 .ips = addresses_B_3_4,
1886 .apply_expected = true
1891 * unique,tombstone vs. mhomed,active
1892 * => should be replaced
1895 .line = __location__,
1896 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1899 .type = WREPL_TYPE_UNIQUE,
1900 .state = WREPL_STATE_TOMBSTONE,
1901 .node = WREPL_NODE_B,
1903 .num_ips = ARRAY_SIZE(addresses_B_1),
1904 .ips = addresses_B_1,
1905 .apply_expected = true
1909 .type = WREPL_TYPE_MHOMED,
1910 .state = WREPL_STATE_ACTIVE,
1911 .node = WREPL_NODE_B,
1913 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1914 .ips = addresses_A_3_4,
1915 .apply_expected = true
1920 * unique,tombstone vs. mhomed,tombstone
1921 * => should be replaced
1924 .line = __location__,
1925 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1928 .type = WREPL_TYPE_UNIQUE,
1929 .state = WREPL_STATE_TOMBSTONE,
1930 .node = WREPL_NODE_B,
1932 .num_ips = ARRAY_SIZE(addresses_A_1),
1933 .ips = addresses_A_1,
1934 .apply_expected = true
1938 .type = WREPL_TYPE_MHOMED,
1939 .state = WREPL_STATE_TOMBSTONE,
1940 .node = WREPL_NODE_B,
1942 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1943 .ips = addresses_B_3_4,
1944 .apply_expected = true
1949 * normal groups vs unique section,
1952 * group,active vs. unique,active
1953 * => should NOT be replaced
1956 .line = __location__,
1957 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1960 .type = WREPL_TYPE_GROUP,
1961 .state = WREPL_STATE_ACTIVE,
1962 .node = WREPL_NODE_B,
1964 .num_ips = ARRAY_SIZE(addresses_A_1),
1965 .ips = addresses_A_1,
1966 .apply_expected = true
1970 .type = WREPL_TYPE_UNIQUE,
1971 .state = WREPL_STATE_ACTIVE,
1972 .node = WREPL_NODE_B,
1974 .num_ips = ARRAY_SIZE(addresses_A_1),
1975 .ips = addresses_A_1,
1976 .apply_expected = false
1981 * group,active vs. unique,tombstone
1982 * => should NOT be replaced
1985 .line = __location__,
1986 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1989 .type = WREPL_TYPE_GROUP,
1990 .state = WREPL_STATE_ACTIVE,
1991 .node = WREPL_NODE_B,
1993 .num_ips = ARRAY_SIZE(addresses_A_1),
1994 .ips = addresses_A_1,
1995 .apply_expected = true
1999 .type = WREPL_TYPE_UNIQUE,
2000 .state = WREPL_STATE_TOMBSTONE,
2001 .node = WREPL_NODE_B,
2003 .num_ips = ARRAY_SIZE(addresses_A_1),
2004 .ips = addresses_A_1,
2005 .apply_expected = false
2010 * group,released vs. unique,active
2011 * => should NOT be replaced
2014 .line = __location__,
2015 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2018 .type = WREPL_TYPE_GROUP,
2019 .state = WREPL_STATE_RELEASED,
2020 .node = WREPL_NODE_B,
2022 .num_ips = ARRAY_SIZE(addresses_A_1),
2023 .ips = addresses_A_1,
2024 .apply_expected = false
2028 .type = WREPL_TYPE_UNIQUE,
2029 .state = WREPL_STATE_ACTIVE,
2030 .node = WREPL_NODE_B,
2032 .num_ips = ARRAY_SIZE(addresses_A_1),
2033 .ips = addresses_A_1,
2034 .apply_expected = false
2039 * group,released vs. unique,tombstone
2040 * => should NOT be replaced
2043 .line = __location__,
2044 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2047 .type = WREPL_TYPE_GROUP,
2048 .state = WREPL_STATE_RELEASED,
2049 .node = WREPL_NODE_B,
2051 .num_ips = ARRAY_SIZE(addresses_A_1),
2052 .ips = addresses_A_1,
2053 .apply_expected = false
2057 .type = WREPL_TYPE_UNIQUE,
2058 .state = WREPL_STATE_TOMBSTONE,
2059 .node = WREPL_NODE_B,
2061 .num_ips = ARRAY_SIZE(addresses_A_1),
2062 .ips = addresses_A_1,
2063 .apply_expected = false
2068 * group,tombstone vs. unique,active
2069 * => should NOT be replaced
2072 .line = __location__,
2073 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2076 .type = WREPL_TYPE_GROUP,
2077 .state = WREPL_STATE_TOMBSTONE,
2078 .node = WREPL_NODE_B,
2080 .num_ips = ARRAY_SIZE(addresses_A_1),
2081 .ips = addresses_A_1,
2082 .apply_expected = true
2086 .type = WREPL_TYPE_UNIQUE,
2087 .state = WREPL_STATE_ACTIVE,
2088 .node = WREPL_NODE_B,
2090 .num_ips = ARRAY_SIZE(addresses_A_1),
2091 .ips = addresses_A_1,
2092 .apply_expected = false
2097 * group,tombstone vs. unique,tombstone
2098 * => should NOT be replaced
2101 .line = __location__,
2102 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2105 .type = WREPL_TYPE_GROUP,
2106 .state = WREPL_STATE_TOMBSTONE,
2107 .node = WREPL_NODE_B,
2109 .num_ips = ARRAY_SIZE(addresses_A_1),
2110 .ips = addresses_A_1,
2111 .apply_expected = true
2115 .type = WREPL_TYPE_UNIQUE,
2116 .state = WREPL_STATE_TOMBSTONE,
2117 .node = WREPL_NODE_B,
2119 .num_ips = ARRAY_SIZE(addresses_A_1),
2120 .ips = addresses_A_1,
2121 .apply_expected = false
2126 * normal groups vs normal groups section,
2129 * group,active vs. group,active
2130 * => should NOT be replaced
2133 .line = __location__,
2134 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2137 .type = WREPL_TYPE_GROUP,
2138 .state = WREPL_STATE_ACTIVE,
2139 .node = WREPL_NODE_B,
2141 .num_ips = ARRAY_SIZE(addresses_A_1),
2142 .ips = addresses_A_1,
2143 .apply_expected = true
2147 .type = WREPL_TYPE_GROUP,
2148 .state = WREPL_STATE_ACTIVE,
2149 .node = WREPL_NODE_B,
2151 .num_ips = ARRAY_SIZE(addresses_A_1),
2152 .ips = addresses_A_1,
2153 .apply_expected = false
2158 * group,active vs. group,tombstone
2159 * => should NOT be replaced
2162 .line = __location__,
2163 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2166 .type = WREPL_TYPE_GROUP,
2167 .state = WREPL_STATE_ACTIVE,
2168 .node = WREPL_NODE_B,
2170 .num_ips = ARRAY_SIZE(addresses_A_1),
2171 .ips = addresses_A_1,
2172 .apply_expected = true
2176 .type = WREPL_TYPE_GROUP,
2177 .state = WREPL_STATE_TOMBSTONE,
2178 .node = WREPL_NODE_B,
2180 .num_ips = ARRAY_SIZE(addresses_A_1),
2181 .ips = addresses_A_1,
2182 .apply_expected = false
2187 * group,released vs. group,active
2188 * => should be replaced
2191 .line = __location__,
2192 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2195 .type = WREPL_TYPE_GROUP,
2196 .state = WREPL_STATE_RELEASED,
2197 .node = WREPL_NODE_B,
2199 .num_ips = ARRAY_SIZE(addresses_A_1),
2200 .ips = addresses_A_1,
2201 .apply_expected = false
2205 .type = WREPL_TYPE_GROUP,
2206 .state = WREPL_STATE_ACTIVE,
2207 .node = WREPL_NODE_B,
2209 .num_ips = ARRAY_SIZE(addresses_B_1),
2210 .ips = addresses_B_1,
2211 .apply_expected = true
2216 * group,released vs. group,tombstone
2217 * => should be replaced
2220 .line = __location__,
2221 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2224 .type = WREPL_TYPE_GROUP,
2225 .state = WREPL_STATE_RELEASED,
2226 .node = WREPL_NODE_B,
2228 .num_ips = ARRAY_SIZE(addresses_A_1),
2229 .ips = addresses_A_1,
2230 .apply_expected = false
2234 .type = WREPL_TYPE_GROUP,
2235 .state = WREPL_STATE_TOMBSTONE,
2236 .node = WREPL_NODE_B,
2238 .num_ips = ARRAY_SIZE(addresses_B_1),
2239 .ips = addresses_B_1,
2240 .apply_expected = true
2245 * group,tombstone vs. group,active
2246 * => should be replaced
2249 .line = __location__,
2250 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2253 .type = WREPL_TYPE_GROUP,
2254 .state = WREPL_STATE_TOMBSTONE,
2255 .node = WREPL_NODE_B,
2257 .num_ips = ARRAY_SIZE(addresses_B_1),
2258 .ips = addresses_B_1,
2259 .apply_expected = true
2263 .type = WREPL_TYPE_GROUP,
2264 .state = WREPL_STATE_ACTIVE,
2265 .node = WREPL_NODE_B,
2267 .num_ips = ARRAY_SIZE(addresses_A_1),
2268 .ips = addresses_A_1,
2269 .apply_expected = true
2274 * group,tombstone vs. group,tombstone
2275 * => should be replaced
2278 .line = __location__,
2279 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2282 .type = WREPL_TYPE_GROUP,
2283 .state = WREPL_STATE_TOMBSTONE,
2284 .node = WREPL_NODE_B,
2286 .num_ips = ARRAY_SIZE(addresses_A_1),
2287 .ips = addresses_A_1,
2288 .apply_expected = true
2292 .type = WREPL_TYPE_GROUP,
2293 .state = WREPL_STATE_TOMBSTONE,
2294 .node = WREPL_NODE_B,
2296 .num_ips = ARRAY_SIZE(addresses_B_1),
2297 .ips = addresses_B_1,
2298 .apply_expected = true
2303 * normal groups vs special groups section,
2306 * group,active vs. sgroup,active
2307 * => should NOT be replaced
2310 .line = __location__,
2311 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2314 .type = WREPL_TYPE_GROUP,
2315 .state = WREPL_STATE_ACTIVE,
2316 .node = WREPL_NODE_B,
2318 .num_ips = ARRAY_SIZE(addresses_B_1),
2319 .ips = addresses_B_1,
2320 .apply_expected = true
2324 .type = WREPL_TYPE_SGROUP,
2325 .state = WREPL_STATE_ACTIVE,
2326 .node = WREPL_NODE_B,
2328 .num_ips = ARRAY_SIZE(addresses_B_1),
2329 .ips = addresses_B_1,
2330 .apply_expected = false
2335 * group,active vs. sgroup,tombstone
2336 * => should NOT be replaced
2339 .line = __location__,
2340 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2343 .type = WREPL_TYPE_GROUP,
2344 .state = WREPL_STATE_ACTIVE,
2345 .node = WREPL_NODE_B,
2347 .num_ips = ARRAY_SIZE(addresses_B_1),
2348 .ips = addresses_B_1,
2349 .apply_expected = true
2353 .type = WREPL_TYPE_SGROUP,
2354 .state = WREPL_STATE_TOMBSTONE,
2355 .node = WREPL_NODE_B,
2357 .num_ips = ARRAY_SIZE(addresses_B_1),
2358 .ips = addresses_B_1,
2359 .apply_expected = false
2364 * group,released vs. sgroup,active
2365 * => should be replaced
2368 .line = __location__,
2369 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2372 .type = WREPL_TYPE_GROUP,
2373 .state = WREPL_STATE_RELEASED,
2374 .node = WREPL_NODE_B,
2376 .num_ips = ARRAY_SIZE(addresses_A_1),
2377 .ips = addresses_A_1,
2378 .apply_expected = false
2382 .type = WREPL_TYPE_SGROUP,
2383 .state = WREPL_STATE_ACTIVE,
2384 .node = WREPL_NODE_B,
2386 .num_ips = ARRAY_SIZE(addresses_B_1),
2387 .ips = addresses_B_1,
2388 .apply_expected = true
2393 * group,released vs. sgroup,tombstone
2394 * => should NOT be replaced
2397 .line = __location__,
2398 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2401 .type = WREPL_TYPE_GROUP,
2402 .state = WREPL_STATE_RELEASED,
2403 .node = WREPL_NODE_B,
2405 .num_ips = ARRAY_SIZE(addresses_B_1),
2406 .ips = addresses_B_1,
2407 .apply_expected = false
2411 .type = WREPL_TYPE_SGROUP,
2412 .state = WREPL_STATE_TOMBSTONE,
2413 .node = WREPL_NODE_B,
2415 .num_ips = ARRAY_SIZE(addresses_B_1),
2416 .ips = addresses_B_1,
2417 .apply_expected = false
2422 * group,tombstone vs. sgroup,active
2423 * => should be replaced
2426 .line = __location__,
2427 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2430 .type = WREPL_TYPE_GROUP,
2431 .state = WREPL_STATE_TOMBSTONE,
2432 .node = WREPL_NODE_B,
2434 .num_ips = ARRAY_SIZE(addresses_B_1),
2435 .ips = addresses_B_1,
2436 .apply_expected = true
2440 .type = WREPL_TYPE_SGROUP,
2441 .state = WREPL_STATE_ACTIVE,
2442 .node = WREPL_NODE_B,
2444 .num_ips = ARRAY_SIZE(addresses_A_1),
2445 .ips = addresses_A_1,
2446 .apply_expected = true
2451 * group,tombstone vs. sgroup,tombstone
2452 * => should be replaced
2455 .line = __location__,
2456 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2459 .type = WREPL_TYPE_GROUP,
2460 .state = WREPL_STATE_TOMBSTONE,
2461 .node = WREPL_NODE_B,
2463 .num_ips = ARRAY_SIZE(addresses_A_1),
2464 .ips = addresses_A_1,
2465 .apply_expected = true
2469 .type = WREPL_TYPE_SGROUP,
2470 .state = WREPL_STATE_TOMBSTONE,
2471 .node = WREPL_NODE_B,
2473 .num_ips = ARRAY_SIZE(addresses_B_1),
2474 .ips = addresses_B_1,
2475 .apply_expected = true
2480 * normal groups vs multi homed section,
2483 * group,active vs. mhomed,active
2484 * => should NOT be replaced
2487 .line = __location__,
2488 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2491 .type = WREPL_TYPE_GROUP,
2492 .state = WREPL_STATE_ACTIVE,
2493 .node = WREPL_NODE_B,
2495 .num_ips = ARRAY_SIZE(addresses_B_1),
2496 .ips = addresses_B_1,
2497 .apply_expected = true
2501 .type = WREPL_TYPE_MHOMED,
2502 .state = WREPL_STATE_ACTIVE,
2503 .node = WREPL_NODE_B,
2505 .num_ips = ARRAY_SIZE(addresses_B_1),
2506 .ips = addresses_B_1,
2507 .apply_expected = false
2512 * group,active vs. mhomed,tombstone
2513 * => should NOT be replaced
2516 .line = __location__,
2517 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2520 .type = WREPL_TYPE_GROUP,
2521 .state = WREPL_STATE_ACTIVE,
2522 .node = WREPL_NODE_B,
2524 .num_ips = ARRAY_SIZE(addresses_B_1),
2525 .ips = addresses_B_1,
2526 .apply_expected = true
2530 .type = WREPL_TYPE_MHOMED,
2531 .state = WREPL_STATE_TOMBSTONE,
2532 .node = WREPL_NODE_B,
2534 .num_ips = ARRAY_SIZE(addresses_B_1),
2535 .ips = addresses_B_1,
2536 .apply_expected = false
2541 * group,released vs. mhomed,active
2542 * => should NOT be replaced
2545 .line = __location__,
2546 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2549 .type = WREPL_TYPE_GROUP,
2550 .state = WREPL_STATE_RELEASED,
2551 .node = WREPL_NODE_B,
2553 .num_ips = ARRAY_SIZE(addresses_B_1),
2554 .ips = addresses_B_1,
2555 .apply_expected = false
2559 .type = WREPL_TYPE_MHOMED,
2560 .state = WREPL_STATE_ACTIVE,
2561 .node = WREPL_NODE_B,
2563 .num_ips = ARRAY_SIZE(addresses_B_1),
2564 .ips = addresses_B_1,
2565 .apply_expected = false
2570 * group,released vs. mhomed,tombstone
2571 * => should NOT be replaced
2574 .line = __location__,
2575 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2578 .type = WREPL_TYPE_GROUP,
2579 .state = WREPL_STATE_RELEASED,
2580 .node = WREPL_NODE_B,
2582 .num_ips = ARRAY_SIZE(addresses_B_1),
2583 .ips = addresses_B_1,
2584 .apply_expected = false
2588 .type = WREPL_TYPE_MHOMED,
2589 .state = WREPL_STATE_TOMBSTONE,
2590 .node = WREPL_NODE_B,
2592 .num_ips = ARRAY_SIZE(addresses_B_1),
2593 .ips = addresses_B_1,
2594 .apply_expected = false
2599 * group,tombstone vs. mhomed,active
2600 * => should be replaced
2603 .line = __location__,
2604 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2607 .type = WREPL_TYPE_GROUP,
2608 .state = WREPL_STATE_TOMBSTONE,
2609 .node = WREPL_NODE_B,
2611 .num_ips = ARRAY_SIZE(addresses_B_1),
2612 .ips = addresses_B_1,
2613 .apply_expected = true
2617 .type = WREPL_TYPE_MHOMED,
2618 .state = WREPL_STATE_ACTIVE,
2619 .node = WREPL_NODE_B,
2621 .num_ips = ARRAY_SIZE(addresses_A_1),
2622 .ips = addresses_A_1,
2623 .apply_expected = true
2628 * group,tombstone vs. mhomed,tombstone
2629 * => should be replaced
2632 .line = __location__,
2633 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2636 .type = WREPL_TYPE_GROUP,
2637 .state = WREPL_STATE_TOMBSTONE,
2638 .node = WREPL_NODE_B,
2640 .num_ips = ARRAY_SIZE(addresses_A_1),
2641 .ips = addresses_A_1,
2642 .apply_expected = true
2646 .type = WREPL_TYPE_MHOMED,
2647 .state = WREPL_STATE_TOMBSTONE,
2648 .node = WREPL_NODE_B,
2650 .num_ips = ARRAY_SIZE(addresses_B_1),
2651 .ips = addresses_B_1,
2652 .apply_expected = true
2657 * special groups vs unique section,
2660 * sgroup,active vs. unique,active
2661 * => should NOT be replaced
2664 .line = __location__,
2665 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2668 .type = WREPL_TYPE_SGROUP,
2669 .state = WREPL_STATE_ACTIVE,
2670 .node = WREPL_NODE_B,
2672 .num_ips = ARRAY_SIZE(addresses_B_1),
2673 .ips = addresses_B_1,
2674 .apply_expected = true
2678 .type = WREPL_TYPE_UNIQUE,
2679 .state = WREPL_STATE_ACTIVE,
2680 .node = WREPL_NODE_B,
2682 .num_ips = ARRAY_SIZE(addresses_B_1),
2683 .ips = addresses_B_1,
2684 .apply_expected = false
2689 * sgroup,active vs. unique,tombstone
2690 * => should NOT be replaced
2693 .line = __location__,
2694 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2697 .type = WREPL_TYPE_SGROUP,
2698 .state = WREPL_STATE_ACTIVE,
2699 .node = WREPL_NODE_B,
2701 .num_ips = ARRAY_SIZE(addresses_B_1),
2702 .ips = addresses_B_1,
2703 .apply_expected = true
2707 .type = WREPL_TYPE_UNIQUE,
2708 .state = WREPL_STATE_TOMBSTONE,
2709 .node = WREPL_NODE_B,
2711 .num_ips = ARRAY_SIZE(addresses_B_1),
2712 .ips = addresses_B_1,
2713 .apply_expected = false
2718 * sgroup,released vs. unique,active
2719 * => should be replaced
2722 .line = __location__,
2723 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2726 .type = WREPL_TYPE_SGROUP,
2727 .state = WREPL_STATE_RELEASED,
2728 .node = WREPL_NODE_B,
2730 .num_ips = ARRAY_SIZE(addresses_B_1),
2731 .ips = addresses_B_1,
2732 .apply_expected = false
2736 .type = WREPL_TYPE_UNIQUE,
2737 .state = WREPL_STATE_ACTIVE,
2738 .node = WREPL_NODE_B,
2740 .num_ips = ARRAY_SIZE(addresses_A_1),
2741 .ips = addresses_A_1,
2742 .apply_expected = true
2747 * sgroup,released vs. unique,tombstone
2748 * => should be replaced
2751 .line = __location__,
2752 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2755 .type = WREPL_TYPE_SGROUP,
2756 .state = WREPL_STATE_RELEASED,
2757 .node = WREPL_NODE_B,
2759 .num_ips = ARRAY_SIZE(addresses_A_1),
2760 .ips = addresses_A_1,
2761 .apply_expected = false
2765 .type = WREPL_TYPE_UNIQUE,
2766 .state = WREPL_STATE_TOMBSTONE,
2767 .node = WREPL_NODE_B,
2769 .num_ips = ARRAY_SIZE(addresses_B_1),
2770 .ips = addresses_B_1,
2771 .apply_expected = true
2776 * sgroup,tombstone vs. unique,active
2777 * => should be replaced
2780 .line = __location__,
2781 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2784 .type = WREPL_TYPE_SGROUP,
2785 .state = WREPL_STATE_TOMBSTONE,
2786 .node = WREPL_NODE_B,
2788 .num_ips = ARRAY_SIZE(addresses_A_1),
2789 .ips = addresses_A_1,
2790 .apply_expected = true
2794 .type = WREPL_TYPE_UNIQUE,
2795 .state = WREPL_STATE_ACTIVE,
2796 .node = WREPL_NODE_B,
2798 .num_ips = ARRAY_SIZE(addresses_B_1),
2799 .ips = addresses_B_1,
2800 .apply_expected = true
2805 * sgroup,tombstone vs. unique,tombstone
2806 * => should be replaced
2809 .line = __location__,
2810 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2813 .type = WREPL_TYPE_SGROUP,
2814 .state = WREPL_STATE_TOMBSTONE,
2815 .node = WREPL_NODE_B,
2817 .num_ips = ARRAY_SIZE(addresses_B_1),
2818 .ips = addresses_B_1,
2819 .apply_expected = true
2823 .type = WREPL_TYPE_UNIQUE,
2824 .state = WREPL_STATE_TOMBSTONE,
2825 .node = WREPL_NODE_B,
2827 .num_ips = ARRAY_SIZE(addresses_A_1),
2828 .ips = addresses_A_1,
2829 .apply_expected = true
2834 * special groups vs normal group section,
2837 * sgroup,active vs. group,active
2838 * => should NOT be replaced
2841 .line = __location__,
2842 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2845 .type = WREPL_TYPE_SGROUP,
2846 .state = WREPL_STATE_ACTIVE,
2847 .node = WREPL_NODE_B,
2849 .num_ips = ARRAY_SIZE(addresses_A_1),
2850 .ips = addresses_A_1,
2851 .apply_expected = true
2855 .type = WREPL_TYPE_GROUP,
2856 .state = WREPL_STATE_ACTIVE,
2857 .node = WREPL_NODE_B,
2859 .num_ips = ARRAY_SIZE(addresses_A_1),
2860 .ips = addresses_A_1,
2861 .apply_expected = false
2866 * sgroup,active vs. group,tombstone
2867 * => should NOT be replaced
2870 .line = __location__,
2871 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2874 .type = WREPL_TYPE_SGROUP,
2875 .state = WREPL_STATE_ACTIVE,
2876 .node = WREPL_NODE_B,
2878 .num_ips = ARRAY_SIZE(addresses_A_1),
2879 .ips = addresses_A_1,
2880 .apply_expected = true
2884 .type = WREPL_TYPE_GROUP,
2885 .state = WREPL_STATE_TOMBSTONE,
2886 .node = WREPL_NODE_B,
2888 .num_ips = ARRAY_SIZE(addresses_A_1),
2889 .ips = addresses_A_1,
2890 .apply_expected = false
2895 * sgroup,released vs. group,active
2896 * => should be replaced
2899 .line = __location__,
2900 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2903 .type = WREPL_TYPE_SGROUP,
2904 .state = WREPL_STATE_RELEASED,
2905 .node = WREPL_NODE_B,
2907 .num_ips = ARRAY_SIZE(addresses_A_1),
2908 .ips = addresses_A_1,
2909 .apply_expected = false
2913 .type = WREPL_TYPE_GROUP,
2914 .state = WREPL_STATE_ACTIVE,
2915 .node = WREPL_NODE_B,
2917 .num_ips = ARRAY_SIZE(addresses_B_1),
2918 .ips = addresses_B_1,
2919 .apply_expected = true
2924 * sgroup,released vs. group,tombstone
2925 * => should be replaced
2928 .line = __location__,
2929 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2932 .type = WREPL_TYPE_SGROUP,
2933 .state = WREPL_STATE_RELEASED,
2934 .node = WREPL_NODE_B,
2936 .num_ips = ARRAY_SIZE(addresses_B_1),
2937 .ips = addresses_B_1,
2938 .apply_expected = false
2942 .type = WREPL_TYPE_GROUP,
2943 .state = WREPL_STATE_TOMBSTONE,
2944 .node = WREPL_NODE_B,
2946 .num_ips = ARRAY_SIZE(addresses_A_1),
2947 .ips = addresses_A_1,
2948 .apply_expected = true
2953 * sgroup,tombstone vs. group,active
2954 * => should NOT be replaced
2957 .line = __location__,
2958 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2961 .type = WREPL_TYPE_SGROUP,
2962 .state = WREPL_STATE_TOMBSTONE,
2963 .node = WREPL_NODE_B,
2965 .num_ips = ARRAY_SIZE(addresses_A_1),
2966 .ips = addresses_A_1,
2967 .apply_expected = true
2971 .type = WREPL_TYPE_GROUP,
2972 .state = WREPL_STATE_ACTIVE,
2973 .node = WREPL_NODE_B,
2975 .num_ips = ARRAY_SIZE(addresses_B_1),
2976 .ips = addresses_B_1,
2977 .apply_expected = true
2982 * sgroup,tombstone vs. group,tombstone
2983 * => should NOT be replaced
2986 .line = __location__,
2987 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2990 .type = WREPL_TYPE_SGROUP,
2991 .state = WREPL_STATE_TOMBSTONE,
2992 .node = WREPL_NODE_B,
2994 .num_ips = ARRAY_SIZE(addresses_B_1),
2995 .ips = addresses_B_1,
2996 .apply_expected = true
3000 .type = WREPL_TYPE_GROUP,
3001 .state = WREPL_STATE_TOMBSTONE,
3002 .node = WREPL_NODE_B,
3004 .num_ips = ARRAY_SIZE(addresses_A_1),
3005 .ips = addresses_A_1,
3006 .apply_expected = true
3011 * special groups (not active) vs special group section,
3014 * sgroup,released vs. sgroup,active
3015 * => should be replaced
3018 .line = __location__,
3019 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3022 .type = WREPL_TYPE_SGROUP,
3023 .state = WREPL_STATE_RELEASED,
3024 .node = WREPL_NODE_B,
3026 .num_ips = ARRAY_SIZE(addresses_A_1),
3027 .ips = addresses_A_1,
3028 .apply_expected = false
3032 .type = WREPL_TYPE_SGROUP,
3033 .state = WREPL_STATE_ACTIVE,
3034 .node = WREPL_NODE_B,
3036 .num_ips = ARRAY_SIZE(addresses_B_1),
3037 .ips = addresses_B_1,
3038 .apply_expected = true
3043 * sgroup,released vs. sgroup,tombstone
3044 * => should be replaced
3047 .line = __location__,
3048 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3051 .type = WREPL_TYPE_SGROUP,
3052 .state = WREPL_STATE_RELEASED,
3053 .node = WREPL_NODE_B,
3055 .num_ips = ARRAY_SIZE(addresses_B_1),
3056 .ips = addresses_B_1,
3057 .apply_expected = false
3061 .type = WREPL_TYPE_SGROUP,
3062 .state = WREPL_STATE_TOMBSTONE,
3063 .node = WREPL_NODE_B,
3065 .num_ips = ARRAY_SIZE(addresses_A_1),
3066 .ips = addresses_A_1,
3067 .apply_expected = true
3072 * sgroup,tombstone vs. sgroup,active
3073 * => should NOT be replaced
3076 .line = __location__,
3077 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3080 .type = WREPL_TYPE_SGROUP,
3081 .state = WREPL_STATE_TOMBSTONE,
3082 .node = WREPL_NODE_B,
3084 .num_ips = ARRAY_SIZE(addresses_A_1),
3085 .ips = addresses_A_1,
3086 .apply_expected = true
3090 .type = WREPL_TYPE_SGROUP,
3091 .state = WREPL_STATE_ACTIVE,
3092 .node = WREPL_NODE_B,
3094 .num_ips = ARRAY_SIZE(addresses_B_1),
3095 .ips = addresses_B_1,
3096 .apply_expected = true
3101 * sgroup,tombstone vs. sgroup,tombstone
3102 * => should NOT be replaced
3105 .line = __location__,
3106 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3109 .type = WREPL_TYPE_SGROUP,
3110 .state = WREPL_STATE_TOMBSTONE,
3111 .node = WREPL_NODE_B,
3113 .num_ips = ARRAY_SIZE(addresses_B_1),
3114 .ips = addresses_B_1,
3115 .apply_expected = true
3119 .type = WREPL_TYPE_SGROUP,
3120 .state = WREPL_STATE_TOMBSTONE,
3121 .node = WREPL_NODE_B,
3123 .num_ips = ARRAY_SIZE(addresses_A_1),
3124 .ips = addresses_A_1,
3125 .apply_expected = true
3130 * special groups vs multi homed section,
3133 * sgroup,active vs. mhomed,active
3134 * => should NOT be replaced
3137 .line = __location__,
3138 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3141 .type = WREPL_TYPE_SGROUP,
3142 .state = WREPL_STATE_ACTIVE,
3143 .node = WREPL_NODE_B,
3145 .num_ips = ARRAY_SIZE(addresses_A_1),
3146 .ips = addresses_A_1,
3147 .apply_expected = true
3151 .type = WREPL_TYPE_MHOMED,
3152 .state = WREPL_STATE_ACTIVE,
3153 .node = WREPL_NODE_B,
3155 .num_ips = ARRAY_SIZE(addresses_A_1),
3156 .ips = addresses_A_1,
3157 .apply_expected = false
3162 * sgroup,active vs. mhomed,tombstone
3163 * => should NOT be replaced
3166 .line = __location__,
3167 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3170 .type = WREPL_TYPE_SGROUP,
3171 .state = WREPL_STATE_ACTIVE,
3172 .node = WREPL_NODE_B,
3174 .num_ips = ARRAY_SIZE(addresses_A_1),
3175 .ips = addresses_A_1,
3176 .apply_expected = true
3180 .type = WREPL_TYPE_MHOMED,
3181 .state = WREPL_STATE_TOMBSTONE,
3182 .node = WREPL_NODE_B,
3184 .num_ips = ARRAY_SIZE(addresses_A_1),
3185 .ips = addresses_A_1,
3186 .apply_expected = false
3191 * sgroup,released vs. mhomed,active
3192 * => should be replaced
3195 .line = __location__,
3196 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3199 .type = WREPL_TYPE_SGROUP,
3200 .state = WREPL_STATE_RELEASED,
3201 .node = WREPL_NODE_B,
3203 .num_ips = ARRAY_SIZE(addresses_A_1),
3204 .ips = addresses_A_1,
3205 .apply_expected = false
3209 .type = WREPL_TYPE_MHOMED,
3210 .state = WREPL_STATE_ACTIVE,
3211 .node = WREPL_NODE_B,
3213 .num_ips = ARRAY_SIZE(addresses_B_1),
3214 .ips = addresses_B_1,
3215 .apply_expected = true
3220 * sgroup,released vs. mhomed,tombstone
3221 * => should be replaced
3224 .line = __location__,
3225 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3228 .type = WREPL_TYPE_SGROUP,
3229 .state = WREPL_STATE_RELEASED,
3230 .node = WREPL_NODE_B,
3232 .num_ips = ARRAY_SIZE(addresses_B_1),
3233 .ips = addresses_B_1,
3234 .apply_expected = false
3238 .type = WREPL_TYPE_MHOMED,
3239 .state = WREPL_STATE_TOMBSTONE,
3240 .node = WREPL_NODE_B,
3242 .num_ips = ARRAY_SIZE(addresses_A_1),
3243 .ips = addresses_A_1,
3244 .apply_expected = true
3249 * sgroup,tombstone vs. mhomed,active
3250 * => should be replaced
3253 .line = __location__,
3254 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3257 .type = WREPL_TYPE_SGROUP,
3258 .state = WREPL_STATE_TOMBSTONE,
3259 .node = WREPL_NODE_B,
3261 .num_ips = ARRAY_SIZE(addresses_A_1),
3262 .ips = addresses_A_1,
3263 .apply_expected = true
3267 .type = WREPL_TYPE_MHOMED,
3268 .state = WREPL_STATE_ACTIVE,
3269 .node = WREPL_NODE_B,
3271 .num_ips = ARRAY_SIZE(addresses_B_1),
3272 .ips = addresses_B_1,
3273 .apply_expected = true
3278 * sgroup,tombstone vs. mhomed,tombstone
3279 * => should be replaced
3282 .line = __location__,
3283 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3286 .type = WREPL_TYPE_SGROUP,
3287 .state = WREPL_STATE_TOMBSTONE,
3288 .node = WREPL_NODE_B,
3290 .num_ips = ARRAY_SIZE(addresses_B_1),
3291 .ips = addresses_B_1,
3292 .apply_expected = true
3296 .type = WREPL_TYPE_MHOMED,
3297 .state = WREPL_STATE_TOMBSTONE,
3298 .node = WREPL_NODE_B,
3300 .num_ips = ARRAY_SIZE(addresses_A_1),
3301 .ips = addresses_A_1,
3302 .apply_expected = true
3307 * multi homed vs. unique section,
3310 * mhomed,active vs. unique,active
3311 * => should be replaced
3314 .line = __location__,
3315 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3318 .type = WREPL_TYPE_MHOMED,
3319 .state = WREPL_STATE_ACTIVE,
3320 .node = WREPL_NODE_B,
3322 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3323 .ips = addresses_A_3_4,
3324 .apply_expected = true
3328 .type = WREPL_TYPE_UNIQUE,
3329 .state = WREPL_STATE_ACTIVE,
3330 .node = WREPL_NODE_B,
3332 .num_ips = ARRAY_SIZE(addresses_B_1),
3333 .ips = addresses_B_1,
3334 .apply_expected = true
3339 * mhomed,active vs. unique,tombstone
3340 * => should NOT be replaced
3343 .line = __location__,
3344 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3347 .type = WREPL_TYPE_MHOMED,
3348 .state = WREPL_STATE_ACTIVE,
3349 .node = WREPL_NODE_B,
3351 .num_ips = ARRAY_SIZE(addresses_B_1),
3352 .ips = addresses_B_1,
3353 .apply_expected = true
3357 .type = WREPL_TYPE_UNIQUE,
3358 .state = WREPL_STATE_TOMBSTONE,
3359 .node = WREPL_NODE_B,
3361 .num_ips = ARRAY_SIZE(addresses_B_1),
3362 .ips = addresses_B_1,
3363 .apply_expected = false
3368 * mhomed,released vs. unique,active
3369 * => should be replaced
3372 .line = __location__,
3373 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3376 .type = WREPL_TYPE_MHOMED,
3377 .state = WREPL_STATE_RELEASED,
3378 .node = WREPL_NODE_B,
3380 .num_ips = ARRAY_SIZE(addresses_A_1),
3381 .ips = addresses_A_1,
3382 .apply_expected = false
3386 .type = WREPL_TYPE_UNIQUE,
3387 .state = WREPL_STATE_ACTIVE,
3388 .node = WREPL_NODE_B,
3390 .num_ips = ARRAY_SIZE(addresses_B_1),
3391 .ips = addresses_B_1,
3392 .apply_expected = true
3397 * mhomed,released vs. uinique,tombstone
3398 * => should be replaced
3401 .line = __location__,
3402 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3405 .type = WREPL_TYPE_MHOMED,
3406 .state = WREPL_STATE_RELEASED,
3407 .node = WREPL_NODE_B,
3409 .num_ips = ARRAY_SIZE(addresses_B_1),
3410 .ips = addresses_B_1,
3411 .apply_expected = false
3415 .type = WREPL_TYPE_UNIQUE,
3416 .state = WREPL_STATE_TOMBSTONE,
3417 .node = WREPL_NODE_B,
3419 .num_ips = ARRAY_SIZE(addresses_A_1),
3420 .ips = addresses_A_1,
3421 .apply_expected = true
3426 * mhomed,tombstone vs. unique,active
3427 * => should be replaced
3430 .line = __location__,
3431 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3434 .type = WREPL_TYPE_MHOMED,
3435 .state = WREPL_STATE_TOMBSTONE,
3436 .node = WREPL_NODE_B,
3438 .num_ips = ARRAY_SIZE(addresses_A_1),
3439 .ips = addresses_A_1,
3440 .apply_expected = true
3444 .type = WREPL_TYPE_UNIQUE,
3445 .state = WREPL_STATE_ACTIVE,
3446 .node = WREPL_NODE_B,
3448 .num_ips = ARRAY_SIZE(addresses_B_1),
3449 .ips = addresses_B_1,
3450 .apply_expected = true
3455 * mhomed,tombstone vs. uinique,tombstone
3456 * => should be replaced
3459 .line = __location__,
3460 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3463 .type = WREPL_TYPE_MHOMED,
3464 .state = WREPL_STATE_TOMBSTONE,
3465 .node = WREPL_NODE_B,
3467 .num_ips = ARRAY_SIZE(addresses_B_1),
3468 .ips = addresses_B_1,
3469 .apply_expected = true
3473 .type = WREPL_TYPE_UNIQUE,
3474 .state = WREPL_STATE_TOMBSTONE,
3475 .node = WREPL_NODE_B,
3477 .num_ips = ARRAY_SIZE(addresses_A_1),
3478 .ips = addresses_A_1,
3479 .apply_expected = true
3484 * multi homed vs. normal group section,
3487 * mhomed,active vs. group,active
3488 * => should be replaced
3491 .line = __location__,
3492 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3495 .type = WREPL_TYPE_MHOMED,
3496 .state = WREPL_STATE_ACTIVE,
3497 .node = WREPL_NODE_B,
3499 .num_ips = ARRAY_SIZE(addresses_A_1),
3500 .ips = addresses_A_1,
3501 .apply_expected = true
3505 .type = WREPL_TYPE_GROUP,
3506 .state = WREPL_STATE_ACTIVE,
3507 .node = WREPL_NODE_B,
3509 .num_ips = ARRAY_SIZE(addresses_B_1),
3510 .ips = addresses_B_1,
3511 .apply_expected = true
3516 * mhomed,active vs. group,tombstone
3517 * => should NOT be replaced
3520 .line = __location__,
3521 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3524 .type = WREPL_TYPE_MHOMED,
3525 .state = WREPL_STATE_ACTIVE,
3526 .node = WREPL_NODE_B,
3528 .num_ips = ARRAY_SIZE(addresses_B_1),
3529 .ips = addresses_B_1,
3530 .apply_expected = true
3534 .type = WREPL_TYPE_GROUP,
3535 .state = WREPL_STATE_TOMBSTONE,
3536 .node = WREPL_NODE_B,
3538 .num_ips = ARRAY_SIZE(addresses_B_1),
3539 .ips = addresses_B_1,
3540 .apply_expected = false
3545 * mhomed,released vs. group,active
3546 * => should be replaced
3549 .line = __location__,
3550 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3553 .type = WREPL_TYPE_MHOMED,
3554 .state = WREPL_STATE_RELEASED,
3555 .node = WREPL_NODE_B,
3557 .num_ips = ARRAY_SIZE(addresses_B_1),
3558 .ips = addresses_B_1,
3559 .apply_expected = false
3563 .type = WREPL_TYPE_GROUP,
3564 .state = WREPL_STATE_ACTIVE,
3565 .node = WREPL_NODE_B,
3567 .num_ips = ARRAY_SIZE(addresses_A_1),
3568 .ips = addresses_A_1,
3569 .apply_expected = true
3574 * mhomed,released vs. group,tombstone
3575 * => should be replaced
3578 .line = __location__,
3579 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3582 .type = WREPL_TYPE_MHOMED,
3583 .state = WREPL_STATE_RELEASED,
3584 .node = WREPL_NODE_B,
3586 .num_ips = ARRAY_SIZE(addresses_A_1),
3587 .ips = addresses_A_1,
3588 .apply_expected = false
3592 .type = WREPL_TYPE_GROUP,
3593 .state = WREPL_STATE_TOMBSTONE,
3594 .node = WREPL_NODE_B,
3596 .num_ips = ARRAY_SIZE(addresses_B_1),
3597 .ips = addresses_B_1,
3598 .apply_expected = true
3603 * mhomed,tombstone vs. group,active
3604 * => should be replaced
3607 .line = __location__,
3608 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3611 .type = WREPL_TYPE_MHOMED,
3612 .state = WREPL_STATE_TOMBSTONE,
3613 .node = WREPL_NODE_B,
3615 .num_ips = ARRAY_SIZE(addresses_B_1),
3616 .ips = addresses_B_1,
3617 .apply_expected = true
3621 .type = WREPL_TYPE_GROUP,
3622 .state = WREPL_STATE_ACTIVE,
3623 .node = WREPL_NODE_B,
3625 .num_ips = ARRAY_SIZE(addresses_A_1),
3626 .ips = addresses_A_1,
3627 .apply_expected = true
3632 * mhomed,tombstone vs. group,tombstone
3633 * => should be replaced
3636 .line = __location__,
3637 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3640 .type = WREPL_TYPE_MHOMED,
3641 .state = WREPL_STATE_TOMBSTONE,
3642 .node = WREPL_NODE_B,
3644 .num_ips = ARRAY_SIZE(addresses_A_1),
3645 .ips = addresses_A_1,
3646 .apply_expected = true
3650 .type = WREPL_TYPE_GROUP,
3651 .state = WREPL_STATE_TOMBSTONE,
3652 .node = WREPL_NODE_B,
3654 .num_ips = ARRAY_SIZE(addresses_B_1),
3655 .ips = addresses_B_1,
3656 .apply_expected = true
3661 * multi homed vs. special group section,
3664 * mhomed,active vs. sgroup,active
3665 * => should NOT be replaced
3668 .line = __location__,
3669 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3672 .type = WREPL_TYPE_MHOMED,
3673 .state = WREPL_STATE_ACTIVE,
3674 .node = WREPL_NODE_B,
3676 .num_ips = ARRAY_SIZE(addresses_A_1),
3677 .ips = addresses_A_1,
3678 .apply_expected = true
3682 .type = WREPL_TYPE_SGROUP,
3683 .state = WREPL_STATE_ACTIVE,
3684 .node = WREPL_NODE_B,
3686 .num_ips = ARRAY_SIZE(addresses_A_1),
3687 .ips = addresses_A_1,
3688 .apply_expected = false
3693 * mhomed,active vs. sgroup,tombstone
3694 * => should NOT be replaced
3697 .line = __location__,
3698 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3701 .type = WREPL_TYPE_MHOMED,
3702 .state = WREPL_STATE_ACTIVE,
3703 .node = WREPL_NODE_B,
3705 .num_ips = ARRAY_SIZE(addresses_A_1),
3706 .ips = addresses_A_1,
3707 .apply_expected = true
3711 .type = WREPL_TYPE_SGROUP,
3712 .state = WREPL_STATE_TOMBSTONE,
3713 .node = WREPL_NODE_B,
3715 .num_ips = ARRAY_SIZE(addresses_A_1),
3716 .ips = addresses_A_1,
3717 .apply_expected = false
3722 * mhomed,released vs. sgroup,active
3723 * => should be replaced
3726 .line = __location__,
3727 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3730 .type = WREPL_TYPE_MHOMED,
3731 .state = WREPL_STATE_RELEASED,
3732 .node = WREPL_NODE_B,
3734 .num_ips = ARRAY_SIZE(addresses_A_1),
3735 .ips = addresses_A_1,
3736 .apply_expected = false
3740 .type = WREPL_TYPE_SGROUP,
3741 .state = WREPL_STATE_ACTIVE,
3742 .node = WREPL_NODE_B,
3744 .num_ips = ARRAY_SIZE(addresses_B_1),
3745 .ips = addresses_B_1,
3746 .apply_expected = true
3751 * mhomed,released vs. sgroup,tombstone
3752 * => should be replaced
3755 .line = __location__,
3756 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3759 .type = WREPL_TYPE_MHOMED,
3760 .state = WREPL_STATE_RELEASED,
3761 .node = WREPL_NODE_B,
3763 .num_ips = ARRAY_SIZE(addresses_B_1),
3764 .ips = addresses_B_1,
3765 .apply_expected = false
3769 .type = WREPL_TYPE_SGROUP,
3770 .state = WREPL_STATE_TOMBSTONE,
3771 .node = WREPL_NODE_B,
3773 .num_ips = ARRAY_SIZE(addresses_A_1),
3774 .ips = addresses_A_1,
3775 .apply_expected = true
3780 * mhomed,tombstone vs. sgroup,active
3781 * => should be replaced
3784 .line = __location__,
3785 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3788 .type = WREPL_TYPE_MHOMED,
3789 .state = WREPL_STATE_TOMBSTONE,
3790 .node = WREPL_NODE_B,
3792 .num_ips = ARRAY_SIZE(addresses_A_1),
3793 .ips = addresses_A_1,
3794 .apply_expected = true
3798 .type = WREPL_TYPE_SGROUP,
3799 .state = WREPL_STATE_ACTIVE,
3800 .node = WREPL_NODE_B,
3802 .num_ips = ARRAY_SIZE(addresses_B_1),
3803 .ips = addresses_B_1,
3804 .apply_expected = true
3809 * mhomed,tombstone vs. sgroup,tombstone
3810 * => should be replaced
3813 .line = __location__,
3814 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3817 .type = WREPL_TYPE_MHOMED,
3818 .state = WREPL_STATE_TOMBSTONE,
3819 .node = WREPL_NODE_B,
3821 .num_ips = ARRAY_SIZE(addresses_B_1),
3822 .ips = addresses_B_1,
3823 .apply_expected = true
3827 .type = WREPL_TYPE_SGROUP,
3828 .state = WREPL_STATE_TOMBSTONE,
3829 .node = WREPL_NODE_B,
3831 .num_ips = ARRAY_SIZE(addresses_A_1),
3832 .ips = addresses_A_1,
3833 .apply_expected = true
3838 * multi homed vs. mlti homed section,
3841 * mhomed,active vs. mhomed,active
3842 * => should be replaced
3845 .line = __location__,
3846 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3849 .type = WREPL_TYPE_MHOMED,
3850 .state = WREPL_STATE_ACTIVE,
3851 .node = WREPL_NODE_B,
3853 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3854 .ips = addresses_A_3_4,
3855 .apply_expected = true
3859 .type = WREPL_TYPE_MHOMED,
3860 .state = WREPL_STATE_ACTIVE,
3861 .node = WREPL_NODE_B,
3863 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3864 .ips = addresses_B_3_4,
3865 .apply_expected = true
3870 * mhomed,active vs. mhomed,tombstone
3871 * => should NOT be replaced
3874 .line = __location__,
3875 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3878 .type = WREPL_TYPE_MHOMED,
3879 .state = WREPL_STATE_ACTIVE,
3880 .node = WREPL_NODE_B,
3882 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3883 .ips = addresses_B_3_4,
3884 .apply_expected = true
3888 .type = WREPL_TYPE_MHOMED,
3889 .state = WREPL_STATE_TOMBSTONE,
3890 .node = WREPL_NODE_B,
3892 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3893 .ips = addresses_B_3_4,
3894 .apply_expected = false
3899 * mhomed,released vs. mhomed,active
3900 * => should be replaced
3903 .line = __location__,
3904 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3907 .type = WREPL_TYPE_MHOMED,
3908 .state = WREPL_STATE_RELEASED,
3909 .node = WREPL_NODE_B,
3911 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3912 .ips = addresses_B_3_4,
3913 .apply_expected = false
3917 .type = WREPL_TYPE_MHOMED,
3918 .state = WREPL_STATE_ACTIVE,
3919 .node = WREPL_NODE_B,
3921 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3922 .ips = addresses_A_3_4,
3923 .apply_expected = true
3928 * mhomed,released vs. mhomed,tombstone
3929 * => should be replaced
3932 .line = __location__,
3933 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3936 .type = WREPL_TYPE_MHOMED,
3937 .state = WREPL_STATE_RELEASED,
3938 .node = WREPL_NODE_B,
3940 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3941 .ips = addresses_A_3_4,
3942 .apply_expected = false
3946 .type = WREPL_TYPE_MHOMED,
3947 .state = WREPL_STATE_TOMBSTONE,
3948 .node = WREPL_NODE_B,
3950 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3951 .ips = addresses_B_3_4,
3952 .apply_expected = true
3957 * mhomed,tombstone vs. mhomed,active
3958 * => should be replaced
3961 .line = __location__,
3962 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3965 .type = WREPL_TYPE_MHOMED,
3966 .state = WREPL_STATE_TOMBSTONE,
3967 .node = WREPL_NODE_B,
3969 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3970 .ips = addresses_B_3_4,
3971 .apply_expected = true
3975 .type = WREPL_TYPE_MHOMED,
3976 .state = WREPL_STATE_ACTIVE,
3977 .node = WREPL_NODE_B,
3979 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3980 .ips = addresses_A_3_4,
3981 .apply_expected = true
3986 * mhomed,tombstone vs. mhomed,tombstone
3987 * => should be replaced
3990 .line = __location__,
3991 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3994 .type = WREPL_TYPE_MHOMED,
3995 .state = WREPL_STATE_TOMBSTONE,
3996 .node = WREPL_NODE_B,
3998 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3999 .ips = addresses_A_3_4,
4000 .apply_expected = true
4004 .type = WREPL_TYPE_MHOMED,
4005 .state = WREPL_STATE_TOMBSTONE,
4006 .node = WREPL_NODE_B,
4008 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4009 .ips = addresses_B_3_4,
4010 .apply_expected = true
4014 .line = __location__,
4015 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4019 .type = WREPL_TYPE_UNIQUE,
4020 .state = WREPL_STATE_TOMBSTONE,
4021 .node = WREPL_NODE_B,
4023 .num_ips = ARRAY_SIZE(addresses_B_1),
4024 .ips = addresses_B_1,
4025 .apply_expected = true,
4029 .type = WREPL_TYPE_UNIQUE,
4030 .state = WREPL_STATE_TOMBSTONE,
4031 .node = WREPL_NODE_B,
4033 .num_ips = ARRAY_SIZE(addresses_A_1),
4034 .ips = addresses_A_1,
4035 .apply_expected = true,
4039 * special group vs special group section,
4042 * sgroup,active vs. sgroup,active same addresses
4043 * => should be NOT replaced
4046 .line = __location__,
4047 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4048 .comment= "A:A_3_4 vs. B:A_3_4",
4052 .type = WREPL_TYPE_SGROUP,
4053 .state = WREPL_STATE_ACTIVE,
4054 .node = WREPL_NODE_B,
4056 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4057 .ips = addresses_A_3_4,
4058 .apply_expected = true
4062 .type = WREPL_TYPE_SGROUP,
4063 .state = WREPL_STATE_ACTIVE,
4064 .node = WREPL_NODE_B,
4066 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4067 .ips = addresses_A_3_4,
4068 .apply_expected = false,
4069 .sgroup_cleanup = true
4073 * sgroup,active vs. sgroup,active same addresses
4074 * => should be NOT replaced
4077 .line = __location__,
4078 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4079 .comment= "A:A_3_4 vs. B:NULL",
4083 .type = WREPL_TYPE_SGROUP,
4084 .state = WREPL_STATE_ACTIVE,
4085 .node = WREPL_NODE_B,
4087 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4088 .ips = addresses_A_3_4,
4089 .apply_expected = true
4093 .type = WREPL_TYPE_SGROUP,
4094 .state = WREPL_STATE_ACTIVE,
4095 .node = WREPL_NODE_B,
4099 .apply_expected = false,
4100 .sgroup_cleanup = true
4104 * sgroup,active vs. sgroup,active subset addresses, special case...
4105 * => should NOT be replaced
4108 .line = __location__,
4109 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4110 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4",
4114 .type = WREPL_TYPE_SGROUP,
4115 .state = WREPL_STATE_ACTIVE,
4116 .node = WREPL_NODE_B,
4118 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4119 .ips = addresses_A_3_4_X_3_4,
4120 .apply_expected = true,
4124 .type = WREPL_TYPE_SGROUP,
4125 .state = WREPL_STATE_ACTIVE,
4126 .node = WREPL_NODE_B,
4128 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4129 .ips = addresses_A_3_4,
4130 .apply_expected = false,
4134 .line = __location__,
4135 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4139 .type = WREPL_TYPE_SGROUP,
4140 .state = WREPL_STATE_ACTIVE,
4141 .node = WREPL_NODE_B,
4145 .apply_expected = false,
4149 .type = WREPL_TYPE_SGROUP,
4150 .state = WREPL_STATE_ACTIVE,
4151 .node = WREPL_NODE_B,
4155 .apply_expected = false,
4159 * sgroup,active vs. sgroup,active different addresses, but owner changed
4160 * => should be replaced
4163 .line = __location__,
4164 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4165 .comment= "A:B_3_4 vs. B:A_3_4",
4169 .type = WREPL_TYPE_SGROUP,
4170 .state = WREPL_STATE_ACTIVE,
4171 .node = WREPL_NODE_B,
4173 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4174 .ips = addresses_B_3_4,
4175 .apply_expected = true,
4179 .type = WREPL_TYPE_SGROUP,
4180 .state = WREPL_STATE_ACTIVE,
4181 .node = WREPL_NODE_B,
4183 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4184 .ips = addresses_A_3_4,
4185 .apply_expected = true,
4186 .sgroup_cleanup = true
4190 * sgroup,active vs. sgroup,active different addresses, but owner changed
4191 * => should be replaced
4194 .line = __location__,
4195 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4196 .comment= "A:A_3_4 vs. B:A_3_4_OWNER_B",
4200 .type = WREPL_TYPE_SGROUP,
4201 .state = WREPL_STATE_ACTIVE,
4202 .node = WREPL_NODE_B,
4204 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4205 .ips = addresses_A_3_4,
4206 .apply_expected = true,
4210 .type = WREPL_TYPE_SGROUP,
4211 .state = WREPL_STATE_ACTIVE,
4212 .node = WREPL_NODE_B,
4214 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4215 .ips = addresses_A_3_4_OWNER_B,
4216 .apply_expected = true,
4217 .sgroup_cleanup = true
4221 * sgroup,active vs. sgroup,active different addresses, but owner changed
4222 * => should be replaced
4225 .line = __location__,
4226 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4227 .comment= "A:A_3_4_OWNER_B vs. B:A_3_4",
4231 .type = WREPL_TYPE_SGROUP,
4232 .state = WREPL_STATE_ACTIVE,
4233 .node = WREPL_NODE_B,
4235 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4236 .ips = addresses_A_3_4_OWNER_B,
4237 .apply_expected = true,
4241 .type = WREPL_TYPE_SGROUP,
4242 .state = WREPL_STATE_ACTIVE,
4243 .node = WREPL_NODE_B,
4245 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4246 .ips = addresses_A_3_4,
4247 .apply_expected = true,
4248 .sgroup_cleanup = true
4252 * sgroup,active vs. sgroup,active different addresses
4253 * => should be merged
4256 .line = __location__,
4257 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4258 .comment= "A:A_3_4 vs. B:B_3_4 => C:A_3_4_B_3_4",
4262 .type = WREPL_TYPE_SGROUP,
4263 .state = WREPL_STATE_ACTIVE,
4264 .node = WREPL_NODE_B,
4266 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4267 .ips = addresses_A_3_4,
4268 .apply_expected = true,
4272 .type = WREPL_TYPE_SGROUP,
4273 .state = WREPL_STATE_ACTIVE,
4274 .node = WREPL_NODE_B,
4276 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4277 .ips = addresses_B_3_4,
4278 .sgroup_merge = true,
4279 .sgroup_cleanup = true,
4283 * sgroup,active vs. sgroup,active different addresses, special case...
4284 * => should be merged
4287 .line = __location__,
4288 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4289 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4_X_3_4",
4293 .type = WREPL_TYPE_SGROUP,
4294 .state = WREPL_STATE_ACTIVE,
4295 .node = WREPL_NODE_B,
4297 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4298 .ips = addresses_B_3_4_X_3_4,
4299 .apply_expected = true,
4303 .type = WREPL_TYPE_SGROUP,
4304 .state = WREPL_STATE_ACTIVE,
4305 .node = WREPL_NODE_B,
4307 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4308 .ips = addresses_A_3_4,
4309 .sgroup_merge = true,
4310 .merge_owner = &ctx->b,
4311 .sgroup_cleanup = false
4315 .line = __location__,
4316 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4320 .type = WREPL_TYPE_SGROUP,
4321 .state = WREPL_STATE_ACTIVE,
4322 .node = WREPL_NODE_B,
4324 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4_OWNER_B),
4325 .ips = addresses_A_3_4_X_3_4_OWNER_B,
4326 .apply_expected = true,
4330 .type = WREPL_TYPE_SGROUP,
4331 .state = WREPL_STATE_ACTIVE,
4332 .node = WREPL_NODE_B,
4336 .apply_expected = false,
4340 * sgroup,active vs. sgroup,active different addresses, special case...
4341 * => should be merged
4344 .line = __location__,
4345 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4346 .comment= "A:X_3_4 vs. B:A_3_4 => C:A_3_4_X_3_4",
4350 .type = WREPL_TYPE_SGROUP,
4351 .state = WREPL_STATE_ACTIVE,
4352 .node = WREPL_NODE_B,
4354 .num_ips = ARRAY_SIZE(addresses_X_3_4),
4355 .ips = addresses_X_3_4,
4356 .apply_expected = true,
4360 .type = WREPL_TYPE_SGROUP,
4361 .state = WREPL_STATE_ACTIVE,
4362 .node = WREPL_NODE_B,
4364 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4365 .ips = addresses_A_3_4,
4366 .sgroup_merge = true,
4367 .sgroup_cleanup = false
4371 .line = __location__,
4372 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4376 .type = WREPL_TYPE_SGROUP,
4377 .state = WREPL_STATE_ACTIVE,
4378 .node = WREPL_NODE_B,
4382 .apply_expected = false,
4386 .type = WREPL_TYPE_SGROUP,
4387 .state = WREPL_STATE_ACTIVE,
4388 .node = WREPL_NODE_B,
4392 .apply_expected = false,
4396 * sgroup,active vs. sgroup,active different addresses, special case...
4397 * => should be merged
4400 .line = __location__,
4401 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4402 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4_OWNER_B => B:A_3_4_OWNER_B_X_3_4",
4406 .type = WREPL_TYPE_SGROUP,
4407 .state = WREPL_STATE_ACTIVE,
4408 .node = WREPL_NODE_B,
4410 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4411 .ips = addresses_A_3_4_X_3_4,
4412 .apply_expected = true,
4416 .type = WREPL_TYPE_SGROUP,
4417 .state = WREPL_STATE_ACTIVE,
4418 .node = WREPL_NODE_B,
4420 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4421 .ips = addresses_A_3_4_OWNER_B,
4422 .sgroup_merge = true,
4423 .merge_owner = &ctx->b,
4427 .line = __location__,
4428 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4432 .type = WREPL_TYPE_SGROUP,
4433 .state = WREPL_STATE_ACTIVE,
4434 .node = WREPL_NODE_B,
4438 .apply_expected = false,
4442 .type = WREPL_TYPE_SGROUP,
4443 .state = WREPL_STATE_ACTIVE,
4444 .node = WREPL_NODE_B,
4448 .apply_expected = false,
4452 * sgroup,active vs. sgroup,active partly different addresses, special case...
4453 * => should be merged
4456 .line = __location__,
4457 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4458 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4_X_1_2 => C:B_3_4_X_1_2_3_4",
4462 .type = WREPL_TYPE_SGROUP,
4463 .state = WREPL_STATE_ACTIVE,
4464 .node = WREPL_NODE_B,
4466 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4467 .ips = addresses_B_3_4_X_3_4,
4468 .apply_expected = true,
4472 .type = WREPL_TYPE_SGROUP,
4473 .state = WREPL_STATE_ACTIVE,
4474 .node = WREPL_NODE_B,
4476 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_1_2),
4477 .ips = addresses_B_3_4_X_1_2,
4478 .sgroup_merge = true,
4479 .sgroup_cleanup = false
4483 .line = __location__,
4484 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4488 .type = WREPL_TYPE_SGROUP,
4489 .state = WREPL_STATE_ACTIVE,
4490 .node = WREPL_NODE_B,
4494 .apply_expected = false,
4498 .type = WREPL_TYPE_SGROUP,
4499 .state = WREPL_STATE_ACTIVE,
4500 .node = WREPL_NODE_B,
4504 .apply_expected = false,
4508 * sgroup,active vs. sgroup,active different addresses, special case...
4509 * => should be merged
4512 .line = __location__,
4513 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4514 .comment= "A:A_3_4_B_3_4 vs. B:NULL => B:A_3_4",
4518 .type = WREPL_TYPE_SGROUP,
4519 .state = WREPL_STATE_ACTIVE,
4520 .node = WREPL_NODE_B,
4522 .num_ips = ARRAY_SIZE(addresses_A_3_4_B_3_4),
4523 .ips = addresses_A_3_4_B_3_4,
4524 .apply_expected = true,
4528 .type = WREPL_TYPE_SGROUP,
4529 .state = WREPL_STATE_ACTIVE,
4530 .node = WREPL_NODE_B,
4534 .sgroup_merge = true,
4535 .merge_owner = &ctx->b,
4536 .sgroup_cleanup = true
4540 .line = __location__,
4541 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4545 .type = WREPL_TYPE_SGROUP,
4546 .state = WREPL_STATE_ACTIVE,
4547 .node = WREPL_NODE_B,
4551 .apply_expected = false,
4555 .type = WREPL_TYPE_UNIQUE,
4556 .state = WREPL_STATE_TOMBSTONE,
4557 .node = WREPL_NODE_B,
4559 .num_ips = ARRAY_SIZE(addresses_A_1),
4560 .ips = addresses_A_1,
4561 .apply_expected = true,
4565 * sgroup,active vs. sgroup,active different addresses, special case...
4566 * => should be merged
4569 .line = __location__,
4570 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4571 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:X_3_4",
4575 .type = WREPL_TYPE_SGROUP,
4576 .state = WREPL_STATE_ACTIVE,
4577 .node = WREPL_NODE_B,
4579 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4580 .ips = addresses_B_3_4_X_3_4,
4581 .apply_expected = true,
4585 .type = WREPL_TYPE_SGROUP,
4586 .state = WREPL_STATE_ACTIVE,
4587 .node = WREPL_NODE_B,
4591 .sgroup_merge = true,
4592 .merge_owner = &ctx->b,
4593 .sgroup_cleanup = true
4597 .line = __location__,
4598 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4602 .type = WREPL_TYPE_SGROUP,
4603 .state = WREPL_STATE_ACTIVE,
4604 .node = WREPL_NODE_B,
4608 .apply_expected = false,
4612 .type = WREPL_TYPE_UNIQUE,
4613 .state = WREPL_STATE_TOMBSTONE,
4614 .node = WREPL_NODE_B,
4616 .num_ips = ARRAY_SIZE(addresses_A_1),
4617 .ips = addresses_A_1,
4618 .apply_expected = true,
4623 * sgroup,active vs. sgroup,tombstone different no addresses, special
4624 * => should be replaced
4627 .line = __location__,
4628 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4629 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:NULL",
4633 .type = WREPL_TYPE_SGROUP,
4634 .state = WREPL_STATE_ACTIVE,
4635 .node = WREPL_NODE_B,
4637 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4638 .ips = addresses_B_3_4_X_3_4,
4639 .apply_expected = true,
4643 .type = WREPL_TYPE_SGROUP,
4644 .state = WREPL_STATE_TOMBSTONE,
4645 .node = WREPL_NODE_B,
4649 .apply_expected = true,
4653 * sgroup,active vs. sgroup,tombstone different addresses
4654 * => should be replaced
4657 .line = __location__,
4658 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4659 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4",
4663 .type = WREPL_TYPE_SGROUP,
4664 .state = WREPL_STATE_ACTIVE,
4665 .node = WREPL_NODE_B,
4667 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4668 .ips = addresses_B_3_4_X_3_4,
4669 .apply_expected = true,
4673 .type = WREPL_TYPE_SGROUP,
4674 .state = WREPL_STATE_TOMBSTONE,
4675 .node = WREPL_NODE_B,
4677 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4678 .ips = addresses_A_3_4,
4679 .apply_expected = true,
4683 * sgroup,active vs. sgroup,tombstone subset addresses
4684 * => should be replaced
4687 .line = __location__,
4688 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4689 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4 => B:B_3_4",
4693 .type = WREPL_TYPE_SGROUP,
4694 .state = WREPL_STATE_ACTIVE,
4695 .node = WREPL_NODE_B,
4697 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4698 .ips = addresses_B_3_4_X_3_4,
4699 .apply_expected = true,
4703 .type = WREPL_TYPE_SGROUP,
4704 .state = WREPL_STATE_TOMBSTONE,
4705 .node = WREPL_NODE_B,
4707 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4708 .ips = addresses_B_3_4,
4709 .apply_expected = true,
4713 * sgroup,active vs. sgroup,active same addresses
4714 * => should be replaced
4717 .line = __location__,
4718 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4719 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4_X_3_4 => B:B_3_4_X_3_4",
4723 .type = WREPL_TYPE_SGROUP,
4724 .state = WREPL_STATE_ACTIVE,
4725 .node = WREPL_NODE_B,
4727 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4728 .ips = addresses_B_3_4_X_3_4,
4729 .apply_expected = true,
4733 .type = WREPL_TYPE_SGROUP,
4734 .state = WREPL_STATE_TOMBSTONE,
4735 .node = WREPL_NODE_B,
4737 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4738 .ips = addresses_B_3_4_X_3_4,
4739 .apply_expected = true,
4744 * This should be the last record in this array,
4745 * we need to make sure the we leave a tombstoned unique entry
4749 .line = __location__,
4750 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4754 .type = WREPL_TYPE_UNIQUE,
4755 .state = WREPL_STATE_TOMBSTONE,
4756 .node = WREPL_NODE_B,
4758 .num_ips = ARRAY_SIZE(addresses_A_1),
4759 .ips = addresses_A_1,
4760 .apply_expected = true
4764 .type = WREPL_TYPE_UNIQUE,
4765 .state = WREPL_STATE_TOMBSTONE,
4766 .node = WREPL_NODE_B,
4768 .num_ips = ARRAY_SIZE(addresses_A_1),
4769 .ips = addresses_A_1,
4770 .apply_expected = true
4772 }}; /* do not add entries here, this should be the last record! */
4774 wins_name_r1 = &wins_name1;
4775 wins_name_r2 = &wins_name2;
4777 torture_comment(tctx, "Test Replica Conflicts with different owners\n");
4779 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
4781 if (!records[i].extra && !records[i].cleanup) {
4782 /* we should test the worst cases */
4783 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
4784 torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n",
4785 __location__, i, records[i].line);
4787 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
4788 torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n",
4789 __location__, i, records[i].line);
4794 if (!records[i].cleanup) {
4795 const char *expected;
4798 if (records[i].r2.sgroup_merge) {
4799 expected = "SGROUP_MERGE";
4800 } else if (records[i].r2.apply_expected) {
4801 expected = "REPLACE";
4803 expected = "NOT REPLACE";
4806 if (!records[i].r1.ips && !records[i].r2.ips) {
4807 ips = "with no ip(s)";
4808 } else if (records[i].r1.ips==records[i].r2.ips) {
4809 ips = "with same ip(s)";
4811 ips = "with different ip(s)";
4814 torture_comment(tctx, "%s,%s%s vs. %s,%s%s %s => %s\n",
4815 wrepl_name_type_string(records[i].r1.type),
4816 wrepl_name_state_string(records[i].r1.state),
4817 (records[i].r1.is_static?",static":""),
4818 wrepl_name_type_string(records[i].r2.type),
4819 wrepl_name_state_string(records[i].r2.state),
4820 (records[i].r2.is_static?",static":""),
4821 (records[i].comment?records[i].comment:ips),
4828 wins_name_r1->name = &records[i].name;
4829 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
4830 records[i].r1.state,
4832 records[i].r1.is_static);
4833 wins_name_r1->id = ++records[i].r1.owner->max_version;
4834 if (wins_name_r1->flags & 2) {
4835 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
4836 wins_name_r1->addresses.addresses.ips = discard_const(records[i].r1.ips);
4838 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
4840 wins_name_r1->unknown = "255.255.255.255";
4843 ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1);
4844 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4845 wins_name_r1, records[i].r1.apply_expected);
4850 wins_name_r2->name = &records[i].name;
4851 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
4852 records[i].r2.state,
4854 records[i].r2.is_static);
4855 wins_name_r2->id = ++records[i].r2.owner->max_version;
4856 if (wins_name_r2->flags & 2) {
4857 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
4858 wins_name_r2->addresses.addresses.ips = discard_const(records[i].r2.ips);
4860 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
4862 wins_name_r2->unknown = "255.255.255.255";
4865 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4866 if (records[i].r1.state == WREPL_STATE_RELEASED) {
4867 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4868 wins_name_r1, false);
4869 } else if (records[i].r2.sgroup_merge) {
4870 ret &= test_wrepl_sgroup_merged(tctx, ctx, records[i].r2.merge_owner,
4871 records[i].r1.owner,
4872 records[i].r1.num_ips, records[i].r1.ips,
4873 records[i].r2.owner,
4874 records[i].r2.num_ips, records[i].r2.ips,
4876 } else if (records[i].r1.owner != records[i].r2.owner) {
4878 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
4879 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4880 wins_name_r1, _expected);
4882 if (records[i].r2.state == WREPL_STATE_RELEASED) {
4883 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner,
4884 wins_name_r2, false);
4885 } else if (!records[i].r2.sgroup_merge) {
4886 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner,
4887 wins_name_r2, records[i].r2.apply_expected);
4890 if (records[i].r2.sgroup_cleanup) {
4892 torture_comment(tctx, "failed before sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4896 /* clean up the SGROUP record */
4897 wins_name_r1->name = &records[i].name;
4898 wins_name_r1->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4900 WREPL_NODE_B, false);
4901 wins_name_r1->id = ++records[i].r1.owner->max_version;
4902 wins_name_r1->addresses.addresses.num_ips = 0;
4903 wins_name_r1->addresses.addresses.ips = NULL;
4904 wins_name_r1->unknown = "255.255.255.255";
4905 ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1);
4907 /* here we test how names from an owner are deleted */
4908 if (records[i].r2.sgroup_merge && records[i].r2.num_ips) {
4909 ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL,
4910 records[i].r2.owner,
4911 records[i].r2.num_ips, records[i].r2.ips,
4912 records[i].r1.owner,
4917 /* clean up the SGROUP record */
4918 wins_name_r2->name = &records[i].name;
4919 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4921 WREPL_NODE_B, false);
4922 wins_name_r2->id = ++records[i].r2.owner->max_version;
4923 wins_name_r2->addresses.addresses.num_ips = 0;
4924 wins_name_r2->addresses.addresses.ips = NULL;
4925 wins_name_r2->unknown = "255.255.255.255";
4926 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4928 /* take ownership of the SGROUP record */
4929 wins_name_r2->name = &records[i].name;
4930 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4932 WREPL_NODE_B, false);
4933 wins_name_r2->id = ++records[i].r2.owner->max_version;
4934 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4935 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4936 wins_name_r2->unknown = "255.255.255.255";
4937 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4938 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true);
4940 /* overwrite the SGROUP record with unique,tombstone */
4941 wins_name_r2->name = &records[i].name;
4942 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4943 WREPL_STATE_TOMBSTONE,
4944 WREPL_NODE_B, false);
4945 wins_name_r2->id = ++records[i].r2.owner->max_version;
4946 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4947 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4948 wins_name_r2->unknown = "255.255.255.255";
4949 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4950 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true);
4953 torture_comment(tctx, "failed in sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4958 /* the first one is a cleanup run */
4959 if (!ret && i == 0) ret = true;
4962 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
4970 static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx,
4971 struct test_wrepl_conflict_conn *ctx)
4975 struct wrepl_wins_name wins_name_;
4976 struct wrepl_wins_name *wins_name = &wins_name_;
4977 struct nbt_name_register name_register_;
4978 struct nbt_name_register *name_register = &name_register_;
4979 struct nbt_name_release release_;
4980 struct nbt_name_release *release = &release_;
4983 const char *line; /* just better debugging */
4984 struct nbt_name name;
4989 const struct wrepl_ip *ips;
4990 bool apply_expected;
4993 enum wrepl_name_type type;
4994 enum wrepl_name_state state;
4995 enum wrepl_name_node node;
4998 const struct wrepl_ip *ips;
4999 bool apply_expected;
5003 * unique vs. unique section
5006 * unique,released vs. unique,active with same ip(s)
5009 .line = __location__,
5010 .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL),
5014 .num_ips = ctx->addresses_best_num,
5015 .ips = ctx->addresses_best,
5016 .apply_expected = true
5019 .type = WREPL_TYPE_UNIQUE,
5020 .state = WREPL_STATE_ACTIVE,
5021 .node = WREPL_NODE_B,
5023 .num_ips = ctx->addresses_best_num,
5024 .ips = ctx->addresses_best,
5025 .apply_expected = true
5029 * unique,released vs. unique,active with different ip(s)
5032 .line = __location__,
5033 .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL),
5037 .num_ips = ctx->addresses_best_num,
5038 .ips = ctx->addresses_best,
5039 .apply_expected = true
5042 .type = WREPL_TYPE_UNIQUE,
5043 .state = WREPL_STATE_ACTIVE,
5044 .node = WREPL_NODE_B,
5046 .num_ips = ARRAY_SIZE(addresses_B_1),
5047 .ips = addresses_B_1,
5048 .apply_expected = true
5052 * unique,released vs. unique,tombstone with same ip(s)
5055 .line = __location__,
5056 .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL),
5060 .num_ips = ctx->addresses_best_num,
5061 .ips = ctx->addresses_best,
5062 .apply_expected = true
5065 .type = WREPL_TYPE_UNIQUE,
5066 .state = WREPL_STATE_TOMBSTONE,
5067 .node = WREPL_NODE_B,
5069 .num_ips = ctx->addresses_best_num,
5070 .ips = ctx->addresses_best,
5071 .apply_expected = true
5075 * unique,released vs. unique,tombstone with different ip(s)
5078 .line = __location__,
5079 .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL),
5083 .num_ips = ctx->addresses_best_num,
5084 .ips = ctx->addresses_best,
5085 .apply_expected = true
5088 .type = WREPL_TYPE_UNIQUE,
5089 .state = WREPL_STATE_TOMBSTONE,
5090 .node = WREPL_NODE_B,
5092 .num_ips = ARRAY_SIZE(addresses_B_1),
5093 .ips = addresses_B_1,
5094 .apply_expected = true
5098 * unique vs. group section
5101 * unique,released vs. group,active with same ip(s)
5104 .line = __location__,
5105 .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL),
5109 .num_ips = ctx->addresses_best_num,
5110 .ips = ctx->addresses_best,
5111 .apply_expected = true
5114 .type = WREPL_TYPE_GROUP,
5115 .state = WREPL_STATE_ACTIVE,
5116 .node = WREPL_NODE_B,
5118 .num_ips = ctx->addresses_best_num,
5119 .ips = ctx->addresses_best,
5120 .apply_expected = true
5124 * unique,released vs. group,active with different ip(s)
5127 .line = __location__,
5128 .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL),
5132 .num_ips = ctx->addresses_best_num,
5133 .ips = ctx->addresses_best,
5134 .apply_expected = true
5137 .type = WREPL_TYPE_GROUP,
5138 .state = WREPL_STATE_ACTIVE,
5139 .node = WREPL_NODE_B,
5141 .num_ips = ARRAY_SIZE(addresses_B_1),
5142 .ips = addresses_B_1,
5143 .apply_expected = true
5147 * unique,released vs. group,tombstone with same ip(s)
5150 .line = __location__,
5151 .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL),
5155 .num_ips = ctx->addresses_best_num,
5156 .ips = ctx->addresses_best,
5157 .apply_expected = true
5160 .type = WREPL_TYPE_GROUP,
5161 .state = WREPL_STATE_TOMBSTONE,
5162 .node = WREPL_NODE_B,
5164 .num_ips = ctx->addresses_best_num,
5165 .ips = ctx->addresses_best,
5166 .apply_expected = true
5170 * unique,released vs. group,tombstone with different ip(s)
5173 .line = __location__,
5174 .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL),
5178 .num_ips = ctx->addresses_best_num,
5179 .ips = ctx->addresses_best,
5180 .apply_expected = true
5183 .type = WREPL_TYPE_GROUP,
5184 .state = WREPL_STATE_TOMBSTONE,
5185 .node = WREPL_NODE_B,
5187 .num_ips = ARRAY_SIZE(addresses_B_1),
5188 .ips = addresses_B_1,
5189 .apply_expected = true
5193 * unique vs. special group section
5196 * unique,released vs. sgroup,active with same ip(s)
5199 .line = __location__,
5200 .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL),
5204 .num_ips = ctx->addresses_best_num,
5205 .ips = ctx->addresses_best,
5206 .apply_expected = true
5209 .type = WREPL_TYPE_SGROUP,
5210 .state = WREPL_STATE_ACTIVE,
5211 .node = WREPL_NODE_B,
5213 .num_ips = ctx->addresses_best_num,
5214 .ips = ctx->addresses_best,
5215 .apply_expected = true
5219 * unique,released vs. sgroup,active with different ip(s)
5222 .line = __location__,
5223 .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL),
5227 .num_ips = ctx->addresses_best_num,
5228 .ips = ctx->addresses_best,
5229 .apply_expected = true
5232 .type = WREPL_TYPE_SGROUP,
5233 .state = WREPL_STATE_ACTIVE,
5234 .node = WREPL_NODE_B,
5236 .num_ips = ARRAY_SIZE(addresses_B_1),
5237 .ips = addresses_B_1,
5238 .apply_expected = true
5242 * unique,released vs. sgroup,tombstone with same ip(s)
5245 .line = __location__,
5246 .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL),
5250 .num_ips = ctx->addresses_best_num,
5251 .ips = ctx->addresses_best,
5252 .apply_expected = true
5255 .type = WREPL_TYPE_SGROUP,
5256 .state = WREPL_STATE_TOMBSTONE,
5257 .node = WREPL_NODE_B,
5259 .num_ips = ctx->addresses_best_num,
5260 .ips = ctx->addresses_best,
5261 .apply_expected = true
5265 * unique,released vs. sgroup,tombstone with different ip(s)
5268 .line = __location__,
5269 .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL),
5273 .num_ips = ctx->addresses_best_num,
5274 .ips = ctx->addresses_best,
5275 .apply_expected = true
5278 .type = WREPL_TYPE_SGROUP,
5279 .state = WREPL_STATE_TOMBSTONE,
5280 .node = WREPL_NODE_B,
5282 .num_ips = ARRAY_SIZE(addresses_B_1),
5283 .ips = addresses_B_1,
5284 .apply_expected = true
5288 * unique vs. multi homed section
5291 * unique,released vs. mhomed,active with same ip(s)
5294 .line = __location__,
5295 .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL),
5299 .num_ips = ctx->addresses_best_num,
5300 .ips = ctx->addresses_best,
5301 .apply_expected = true
5304 .type = WREPL_TYPE_MHOMED,
5305 .state = WREPL_STATE_ACTIVE,
5306 .node = WREPL_NODE_B,
5308 .num_ips = ctx->addresses_best_num,
5309 .ips = ctx->addresses_best,
5310 .apply_expected = true
5314 * unique,released vs. mhomed,active with different ip(s)
5317 .line = __location__,
5318 .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL),
5322 .num_ips = ctx->addresses_best_num,
5323 .ips = ctx->addresses_best,
5324 .apply_expected = true
5327 .type = WREPL_TYPE_MHOMED,
5328 .state = WREPL_STATE_ACTIVE,
5329 .node = WREPL_NODE_B,
5331 .num_ips = ARRAY_SIZE(addresses_B_1),
5332 .ips = addresses_B_1,
5333 .apply_expected = true
5337 * unique,released vs. mhomed,tombstone with same ip(s)
5340 .line = __location__,
5341 .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL),
5345 .num_ips = ctx->addresses_best_num,
5346 .ips = ctx->addresses_best,
5347 .apply_expected = true
5350 .type = WREPL_TYPE_MHOMED,
5351 .state = WREPL_STATE_TOMBSTONE,
5352 .node = WREPL_NODE_B,
5354 .num_ips = ctx->addresses_best_num,
5355 .ips = ctx->addresses_best,
5356 .apply_expected = true
5360 * unique,released vs. mhomed,tombstone with different ip(s)
5363 .line = __location__,
5364 .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL),
5368 .num_ips = ctx->addresses_best_num,
5369 .ips = ctx->addresses_best,
5370 .apply_expected = true
5373 .type = WREPL_TYPE_MHOMED,
5374 .state = WREPL_STATE_TOMBSTONE,
5375 .node = WREPL_NODE_B,
5377 .num_ips = ARRAY_SIZE(addresses_B_1),
5378 .ips = addresses_B_1,
5379 .apply_expected = true
5383 * group vs. unique section
5386 * group,released vs. unique,active with same ip(s)
5389 .line = __location__,
5390 .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL),
5392 .nb_flags = NBT_NM_GROUP,
5394 .num_ips = ctx->addresses_best_num,
5395 .ips = ctx->addresses_best,
5396 .apply_expected = true
5399 .type = WREPL_TYPE_UNIQUE,
5400 .state = WREPL_STATE_ACTIVE,
5401 .node = WREPL_NODE_B,
5403 .num_ips = ctx->addresses_best_num,
5404 .ips = ctx->addresses_best,
5405 .apply_expected = false
5409 * group,released vs. unique,active with different ip(s)
5412 .line = __location__,
5413 .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL),
5415 .nb_flags = NBT_NM_GROUP,
5417 .num_ips = ctx->addresses_best_num,
5418 .ips = ctx->addresses_best,
5419 .apply_expected = true
5422 .type = WREPL_TYPE_UNIQUE,
5423 .state = WREPL_STATE_ACTIVE,
5424 .node = WREPL_NODE_B,
5426 .num_ips = ARRAY_SIZE(addresses_B_1),
5427 .ips = addresses_B_1,
5428 .apply_expected = false
5432 * group,released vs. unique,tombstone with same ip(s)
5435 .line = __location__,
5436 .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL),
5438 .nb_flags = NBT_NM_GROUP,
5440 .num_ips = ctx->addresses_best_num,
5441 .ips = ctx->addresses_best,
5442 .apply_expected = true
5445 .type = WREPL_TYPE_UNIQUE,
5446 .state = WREPL_STATE_TOMBSTONE,
5447 .node = WREPL_NODE_B,
5449 .num_ips = ctx->addresses_best_num,
5450 .ips = ctx->addresses_best,
5451 .apply_expected = false
5455 * group,released vs. unique,tombstone with different ip(s)
5458 .line = __location__,
5459 .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL),
5461 .nb_flags = NBT_NM_GROUP,
5463 .num_ips = ctx->addresses_best_num,
5464 .ips = ctx->addresses_best,
5465 .apply_expected = true
5468 .type = WREPL_TYPE_UNIQUE,
5469 .state = WREPL_STATE_TOMBSTONE,
5470 .node = WREPL_NODE_B,
5472 .num_ips = ARRAY_SIZE(addresses_B_1),
5473 .ips = addresses_B_1,
5474 .apply_expected = false
5478 * group vs. group section
5481 * group,released vs. group,active with same ip(s)
5484 .line = __location__,
5485 .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL),
5487 .nb_flags = NBT_NM_GROUP,
5489 .num_ips = ctx->addresses_best_num,
5490 .ips = ctx->addresses_best,
5491 .apply_expected = true
5494 .type = WREPL_TYPE_GROUP,
5495 .state = WREPL_STATE_ACTIVE,
5496 .node = WREPL_NODE_B,
5498 .num_ips = ctx->addresses_best_num,
5499 .ips = ctx->addresses_best,
5500 .apply_expected = true
5504 * group,released vs. group,active with different ip(s)
5507 .line = __location__,
5508 .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL),
5510 .nb_flags = NBT_NM_GROUP,
5512 .num_ips = ctx->addresses_best_num,
5513 .ips = ctx->addresses_best,
5514 .apply_expected = true
5517 .type = WREPL_TYPE_GROUP,
5518 .state = WREPL_STATE_ACTIVE,
5519 .node = WREPL_NODE_B,
5521 .num_ips = ARRAY_SIZE(addresses_B_1),
5522 .ips = addresses_B_1,
5523 .apply_expected = true
5527 * group,released vs. group,tombstone with same ip(s)
5530 .line = __location__,
5531 .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL),
5533 .nb_flags = NBT_NM_GROUP,
5535 .num_ips = ctx->addresses_best_num,
5536 .ips = ctx->addresses_best,
5537 .apply_expected = true
5540 .type = WREPL_TYPE_GROUP,
5541 .state = WREPL_STATE_TOMBSTONE,
5542 .node = WREPL_NODE_B,
5544 .num_ips = ctx->addresses_best_num,
5545 .ips = ctx->addresses_best,
5546 .apply_expected = true
5550 * group,released vs. group,tombstone with different ip(s)
5553 .line = __location__,
5554 .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL),
5556 .nb_flags = NBT_NM_GROUP,
5558 .num_ips = ctx->addresses_best_num,
5559 .ips = ctx->addresses_best,
5560 .apply_expected = true
5563 .type = WREPL_TYPE_GROUP,
5564 .state = WREPL_STATE_TOMBSTONE,
5565 .node = WREPL_NODE_B,
5567 .num_ips = ARRAY_SIZE(addresses_B_1),
5568 .ips = addresses_B_1,
5569 .apply_expected = true
5573 * group vs. special group section
5576 * group,released vs. sgroup,active with same ip(s)
5579 .line = __location__,
5580 .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL),
5582 .nb_flags = NBT_NM_GROUP,
5584 .num_ips = ctx->addresses_best_num,
5585 .ips = ctx->addresses_best,
5586 .apply_expected = true
5589 .type = WREPL_TYPE_SGROUP,
5590 .state = WREPL_STATE_ACTIVE,
5591 .node = WREPL_NODE_B,
5593 .num_ips = ctx->addresses_best_num,
5594 .ips = ctx->addresses_best,
5595 .apply_expected = false
5599 * group,released vs. sgroup,active with different ip(s)
5602 .line = __location__,
5603 .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL),
5605 .nb_flags = NBT_NM_GROUP,
5607 .num_ips = ctx->addresses_best_num,
5608 .ips = ctx->addresses_best,
5609 .apply_expected = true
5612 .type = WREPL_TYPE_SGROUP,
5613 .state = WREPL_STATE_ACTIVE,
5614 .node = WREPL_NODE_B,
5616 .num_ips = ARRAY_SIZE(addresses_B_1),
5617 .ips = addresses_B_1,
5618 .apply_expected = false
5622 * group,released vs. sgroup,tombstone with same ip(s)
5625 .line = __location__,
5626 .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL),
5628 .nb_flags = NBT_NM_GROUP,
5630 .num_ips = ctx->addresses_best_num,
5631 .ips = ctx->addresses_best,
5632 .apply_expected = true
5635 .type = WREPL_TYPE_SGROUP,
5636 .state = WREPL_STATE_TOMBSTONE,
5637 .node = WREPL_NODE_B,
5639 .num_ips = ctx->addresses_best_num,
5640 .ips = ctx->addresses_best,
5641 .apply_expected = false
5645 * group,released vs. sgroup,tombstone with different ip(s)
5648 .line = __location__,
5649 .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL),
5651 .nb_flags = NBT_NM_GROUP,
5653 .num_ips = ctx->addresses_best_num,
5654 .ips = ctx->addresses_best,
5655 .apply_expected = true
5658 .type = WREPL_TYPE_SGROUP,
5659 .state = WREPL_STATE_TOMBSTONE,
5660 .node = WREPL_NODE_B,
5662 .num_ips = ARRAY_SIZE(addresses_B_1),
5663 .ips = addresses_B_1,
5664 .apply_expected = false
5668 * group vs. multi homed section
5671 * group,released vs. mhomed,active with same ip(s)
5674 .line = __location__,
5675 .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL),
5677 .nb_flags = NBT_NM_GROUP,
5679 .num_ips = ctx->addresses_best_num,
5680 .ips = ctx->addresses_best,
5681 .apply_expected = true
5684 .type = WREPL_TYPE_MHOMED,
5685 .state = WREPL_STATE_ACTIVE,
5686 .node = WREPL_NODE_B,
5688 .num_ips = ctx->addresses_best_num,
5689 .ips = ctx->addresses_best,
5690 .apply_expected = false
5694 * group,released vs. mhomed,active with different ip(s)
5697 .line = __location__,
5698 .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL),
5700 .nb_flags = NBT_NM_GROUP,
5702 .num_ips = ctx->addresses_best_num,
5703 .ips = ctx->addresses_best,
5704 .apply_expected = true
5707 .type = WREPL_TYPE_MHOMED,
5708 .state = WREPL_STATE_ACTIVE,
5709 .node = WREPL_NODE_B,
5711 .num_ips = ARRAY_SIZE(addresses_B_1),
5712 .ips = addresses_B_1,
5713 .apply_expected = false
5717 * group,released vs. mhomed,tombstone with same ip(s)
5720 .line = __location__,
5721 .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL),
5723 .nb_flags = NBT_NM_GROUP,
5725 .num_ips = ctx->addresses_best_num,
5726 .ips = ctx->addresses_best,
5727 .apply_expected = true
5730 .type = WREPL_TYPE_MHOMED,
5731 .state = WREPL_STATE_TOMBSTONE,
5732 .node = WREPL_NODE_B,
5734 .num_ips = ctx->addresses_best_num,
5735 .ips = ctx->addresses_best,
5736 .apply_expected = false
5740 * group,released vs. mhomed,tombstone with different ip(s)
5743 .line = __location__,
5744 .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL),
5746 .nb_flags = NBT_NM_GROUP,
5748 .num_ips = ctx->addresses_best_num,
5749 .ips = ctx->addresses_best,
5750 .apply_expected = true
5753 .type = WREPL_TYPE_MHOMED,
5754 .state = WREPL_STATE_TOMBSTONE,
5755 .node = WREPL_NODE_B,
5757 .num_ips = ARRAY_SIZE(addresses_B_1),
5758 .ips = addresses_B_1,
5759 .apply_expected = false
5763 * special group vs. unique section
5766 * sgroup,released vs. unique,active with same ip(s)
5769 .line = __location__,
5770 .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL),
5772 .nb_flags = NBT_NM_GROUP,
5774 .num_ips = ctx->addresses_best_num,
5775 .ips = ctx->addresses_best,
5776 .apply_expected = true
5779 .type = WREPL_TYPE_UNIQUE,
5780 .state = WREPL_STATE_ACTIVE,
5781 .node = WREPL_NODE_B,
5783 .num_ips = ctx->addresses_best_num,
5784 .ips = ctx->addresses_best,
5785 .apply_expected = true
5789 * sgroup,released vs. unique,active with different ip(s)
5792 .line = __location__,
5793 .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL),
5795 .nb_flags = NBT_NM_GROUP,
5797 .num_ips = ctx->addresses_best_num,
5798 .ips = ctx->addresses_best,
5799 .apply_expected = true
5802 .type = WREPL_TYPE_UNIQUE,
5803 .state = WREPL_STATE_ACTIVE,
5804 .node = WREPL_NODE_B,
5806 .num_ips = ARRAY_SIZE(addresses_B_1),
5807 .ips = addresses_B_1,
5808 .apply_expected = true
5812 * sgroup,released vs. unique,tombstone with same ip(s)
5815 .line = __location__,
5816 .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL),
5818 .nb_flags = NBT_NM_GROUP,
5820 .num_ips = ctx->addresses_best_num,
5821 .ips = ctx->addresses_best,
5822 .apply_expected = true
5825 .type = WREPL_TYPE_UNIQUE,
5826 .state = WREPL_STATE_TOMBSTONE,
5827 .node = WREPL_NODE_B,
5829 .num_ips = ctx->addresses_best_num,
5830 .ips = ctx->addresses_best,
5831 .apply_expected = true
5835 * sgroup,released vs. unique,tombstone with different ip(s)
5838 .line = __location__,
5839 .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL),
5841 .nb_flags = NBT_NM_GROUP,
5843 .num_ips = ctx->addresses_best_num,
5844 .ips = ctx->addresses_best,
5845 .apply_expected = true
5848 .type = WREPL_TYPE_UNIQUE,
5849 .state = WREPL_STATE_TOMBSTONE,
5850 .node = WREPL_NODE_B,
5852 .num_ips = ARRAY_SIZE(addresses_B_1),
5853 .ips = addresses_B_1,
5854 .apply_expected = true
5858 * special group vs. group section
5861 * sgroup,released vs. group,active with same ip(s)
5864 .line = __location__,
5865 .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL),
5867 .nb_flags = NBT_NM_GROUP,
5869 .num_ips = ctx->addresses_best_num,
5870 .ips = ctx->addresses_best,
5871 .apply_expected = true
5874 .type = WREPL_TYPE_GROUP,
5875 .state = WREPL_STATE_ACTIVE,
5876 .node = WREPL_NODE_B,
5878 .num_ips = ctx->addresses_best_num,
5879 .ips = ctx->addresses_best,
5880 .apply_expected = true
5884 * sgroup,released vs. group,active with different ip(s)
5887 .line = __location__,
5888 .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL),
5890 .nb_flags = NBT_NM_GROUP,
5892 .num_ips = ctx->addresses_best_num,
5893 .ips = ctx->addresses_best,
5894 .apply_expected = true
5897 .type = WREPL_TYPE_GROUP,
5898 .state = WREPL_STATE_ACTIVE,
5899 .node = WREPL_NODE_B,
5901 .num_ips = ARRAY_SIZE(addresses_B_1),
5902 .ips = addresses_B_1,
5903 .apply_expected = true
5907 * sgroup,released vs. group,tombstone with same ip(s)
5910 .line = __location__,
5911 .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL),
5913 .nb_flags = NBT_NM_GROUP,
5915 .num_ips = ctx->addresses_best_num,
5916 .ips = ctx->addresses_best,
5917 .apply_expected = true
5920 .type = WREPL_TYPE_GROUP,
5921 .state = WREPL_STATE_TOMBSTONE,
5922 .node = WREPL_NODE_B,
5924 .num_ips = ctx->addresses_best_num,
5925 .ips = ctx->addresses_best,
5926 .apply_expected = true
5930 * sgroup,released vs. group,tombstone with different ip(s)
5933 .line = __location__,
5934 .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL),
5936 .nb_flags = NBT_NM_GROUP,
5938 .num_ips = ctx->addresses_best_num,
5939 .ips = ctx->addresses_best,
5940 .apply_expected = true
5943 .type = WREPL_TYPE_GROUP,
5944 .state = WREPL_STATE_TOMBSTONE,
5945 .node = WREPL_NODE_B,
5947 .num_ips = ARRAY_SIZE(addresses_B_1),
5948 .ips = addresses_B_1,
5949 .apply_expected = true
5953 * special group vs. special group section
5956 * sgroup,released vs. sgroup,active with same ip(s)
5959 .line = __location__,
5960 .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL),
5962 .nb_flags = NBT_NM_GROUP,
5964 .num_ips = ctx->addresses_best_num,
5965 .ips = ctx->addresses_best,
5966 .apply_expected = true
5969 .type = WREPL_TYPE_SGROUP,
5970 .state = WREPL_STATE_ACTIVE,
5971 .node = WREPL_NODE_B,
5973 .num_ips = ctx->addresses_best_num,
5974 .ips = ctx->addresses_best,
5975 .apply_expected = true
5979 * sgroup,released vs. sgroup,active with different ip(s)
5982 .line = __location__,
5983 .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL),
5985 .nb_flags = NBT_NM_GROUP,
5987 .num_ips = ctx->addresses_best_num,
5988 .ips = ctx->addresses_best,
5989 .apply_expected = true
5992 .type = WREPL_TYPE_SGROUP,
5993 .state = WREPL_STATE_ACTIVE,
5994 .node = WREPL_NODE_B,
5996 .num_ips = ARRAY_SIZE(addresses_B_1),
5997 .ips = addresses_B_1,
5998 .apply_expected = true
6002 * sgroup,released vs. sgroup,tombstone with same ip(s)
6005 .line = __location__,
6006 .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL),
6008 .nb_flags = NBT_NM_GROUP,
6010 .num_ips = ctx->addresses_best_num,
6011 .ips = ctx->addresses_best,
6012 .apply_expected = true
6015 .type = WREPL_TYPE_SGROUP,
6016 .state = WREPL_STATE_TOMBSTONE,
6017 .node = WREPL_NODE_B,
6019 .num_ips = ctx->addresses_best_num,
6020 .ips = ctx->addresses_best,
6021 .apply_expected = true
6025 * sgroup,released vs. sgroup,tombstone with different ip(s)
6028 .line = __location__,
6029 .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL),
6031 .nb_flags = NBT_NM_GROUP,
6033 .num_ips = ctx->addresses_best_num,
6034 .ips = ctx->addresses_best,
6035 .apply_expected = true
6038 .type = WREPL_TYPE_SGROUP,
6039 .state = WREPL_STATE_TOMBSTONE,
6040 .node = WREPL_NODE_B,
6042 .num_ips = ARRAY_SIZE(addresses_B_1),
6043 .ips = addresses_B_1,
6044 .apply_expected = true
6048 * special group vs. multi homed section
6051 * sgroup,released vs. mhomed,active with same ip(s)
6054 .line = __location__,
6055 .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL),
6057 .nb_flags = NBT_NM_GROUP,
6059 .num_ips = ctx->addresses_best_num,
6060 .ips = ctx->addresses_best,
6061 .apply_expected = true
6064 .type = WREPL_TYPE_MHOMED,
6065 .state = WREPL_STATE_ACTIVE,
6066 .node = WREPL_NODE_B,
6068 .num_ips = ctx->addresses_best_num,
6069 .ips = ctx->addresses_best,
6070 .apply_expected = true
6074 * sgroup,released vs. mhomed,active with different ip(s)
6077 .line = __location__,
6078 .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL),
6080 .nb_flags = NBT_NM_GROUP,
6082 .num_ips = ctx->addresses_best_num,
6083 .ips = ctx->addresses_best,
6084 .apply_expected = true
6087 .type = WREPL_TYPE_MHOMED,
6088 .state = WREPL_STATE_ACTIVE,
6089 .node = WREPL_NODE_B,
6091 .num_ips = ARRAY_SIZE(addresses_B_1),
6092 .ips = addresses_B_1,
6093 .apply_expected = true
6097 * sgroup,released vs. mhomed,tombstone with same ip(s)
6100 .line = __location__,
6101 .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL),
6103 .nb_flags = NBT_NM_GROUP,
6105 .num_ips = ctx->addresses_best_num,
6106 .ips = ctx->addresses_best,
6107 .apply_expected = true
6110 .type = WREPL_TYPE_MHOMED,
6111 .state = WREPL_STATE_TOMBSTONE,
6112 .node = WREPL_NODE_B,
6114 .num_ips = ctx->addresses_best_num,
6115 .ips = ctx->addresses_best,
6116 .apply_expected = true
6120 * sgroup,released vs. mhomed,tombstone with different ip(s)
6123 .line = __location__,
6124 .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL),
6126 .nb_flags = NBT_NM_GROUP,
6128 .num_ips = ctx->addresses_best_num,
6129 .ips = ctx->addresses_best,
6130 .apply_expected = true
6133 .type = WREPL_TYPE_MHOMED,
6134 .state = WREPL_STATE_TOMBSTONE,
6135 .node = WREPL_NODE_B,
6137 .num_ips = ARRAY_SIZE(addresses_B_1),
6138 .ips = addresses_B_1,
6139 .apply_expected = true
6143 * multi homed vs. unique section
6146 * mhomed,released vs. unique,active with same ip(s)
6149 .line = __location__,
6150 .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL),
6154 .num_ips = ctx->addresses_best_num,
6155 .ips = ctx->addresses_best,
6156 .apply_expected = true
6159 .type = WREPL_TYPE_UNIQUE,
6160 .state = WREPL_STATE_ACTIVE,
6161 .node = WREPL_NODE_B,
6163 .num_ips = ctx->addresses_best_num,
6164 .ips = ctx->addresses_best,
6165 .apply_expected = true
6169 * mhomed,released vs. unique,active with different ip(s)
6172 .line = __location__,
6173 .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL),
6177 .num_ips = ctx->addresses_best_num,
6178 .ips = ctx->addresses_best,
6179 .apply_expected = true
6182 .type = WREPL_TYPE_UNIQUE,
6183 .state = WREPL_STATE_ACTIVE,
6184 .node = WREPL_NODE_B,
6186 .num_ips = ARRAY_SIZE(addresses_B_1),
6187 .ips = addresses_B_1,
6188 .apply_expected = true
6192 * mhomed,released vs. unique,tombstone with same ip(s)
6195 .line = __location__,
6196 .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL),
6200 .num_ips = ctx->addresses_best_num,
6201 .ips = ctx->addresses_best,
6202 .apply_expected = true
6205 .type = WREPL_TYPE_UNIQUE,
6206 .state = WREPL_STATE_TOMBSTONE,
6207 .node = WREPL_NODE_B,
6209 .num_ips = ctx->addresses_best_num,
6210 .ips = ctx->addresses_best,
6211 .apply_expected = true
6215 * mhomed,released vs. unique,tombstone with different ip(s)
6218 .line = __location__,
6219 .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL),
6223 .num_ips = ctx->addresses_best_num,
6224 .ips = ctx->addresses_best,
6225 .apply_expected = true
6228 .type = WREPL_TYPE_UNIQUE,
6229 .state = WREPL_STATE_TOMBSTONE,
6230 .node = WREPL_NODE_B,
6232 .num_ips = ARRAY_SIZE(addresses_B_1),
6233 .ips = addresses_B_1,
6234 .apply_expected = true
6238 * multi homed vs. group section
6241 * mhomed,released vs. group,active with same ip(s)
6244 .line = __location__,
6245 .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL),
6249 .num_ips = ctx->addresses_best_num,
6250 .ips = ctx->addresses_best,
6251 .apply_expected = true
6254 .type = WREPL_TYPE_GROUP,
6255 .state = WREPL_STATE_ACTIVE,
6256 .node = WREPL_NODE_B,
6258 .num_ips = ctx->addresses_best_num,
6259 .ips = ctx->addresses_best,
6260 .apply_expected = true
6264 * mhomed,released vs. group,active with different ip(s)
6267 .line = __location__,
6268 .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL),
6272 .num_ips = ctx->addresses_best_num,
6273 .ips = ctx->addresses_best,
6274 .apply_expected = true
6277 .type = WREPL_TYPE_GROUP,
6278 .state = WREPL_STATE_ACTIVE,
6279 .node = WREPL_NODE_B,
6281 .num_ips = ARRAY_SIZE(addresses_B_1),
6282 .ips = addresses_B_1,
6283 .apply_expected = true
6287 * mhomed,released vs. group,tombstone with same ip(s)
6290 .line = __location__,
6291 .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL),
6295 .num_ips = ctx->addresses_best_num,
6296 .ips = ctx->addresses_best,
6297 .apply_expected = true
6300 .type = WREPL_TYPE_GROUP,
6301 .state = WREPL_STATE_TOMBSTONE,
6302 .node = WREPL_NODE_B,
6304 .num_ips = ctx->addresses_best_num,
6305 .ips = ctx->addresses_best,
6306 .apply_expected = true
6310 * mhomed,released vs. group,tombstone with different ip(s)
6313 .line = __location__,
6314 .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL),
6318 .num_ips = ctx->addresses_best_num,
6319 .ips = ctx->addresses_best,
6320 .apply_expected = true
6323 .type = WREPL_TYPE_GROUP,
6324 .state = WREPL_STATE_TOMBSTONE,
6325 .node = WREPL_NODE_B,
6327 .num_ips = ARRAY_SIZE(addresses_B_1),
6328 .ips = addresses_B_1,
6329 .apply_expected = true
6333 * multi homed vs. special group section
6336 * mhomed,released vs. sgroup,active with same ip(s)
6339 .line = __location__,
6340 .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL),
6344 .num_ips = ctx->addresses_best_num,
6345 .ips = ctx->addresses_best,
6346 .apply_expected = true
6349 .type = WREPL_TYPE_SGROUP,
6350 .state = WREPL_STATE_ACTIVE,
6351 .node = WREPL_NODE_B,
6353 .num_ips = ctx->addresses_best_num,
6354 .ips = ctx->addresses_best,
6355 .apply_expected = true
6359 * mhomed,released vs. sgroup,active with different ip(s)
6362 .line = __location__,
6363 .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL),
6367 .num_ips = ctx->addresses_best_num,
6368 .ips = ctx->addresses_best,
6369 .apply_expected = true
6372 .type = WREPL_TYPE_SGROUP,
6373 .state = WREPL_STATE_ACTIVE,
6374 .node = WREPL_NODE_B,
6376 .num_ips = ARRAY_SIZE(addresses_B_1),
6377 .ips = addresses_B_1,
6378 .apply_expected = true
6382 * mhomed,released vs. sgroup,tombstone with same ip(s)
6385 .line = __location__,
6386 .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL),
6390 .num_ips = ctx->addresses_best_num,
6391 .ips = ctx->addresses_best,
6392 .apply_expected = true
6395 .type = WREPL_TYPE_SGROUP,
6396 .state = WREPL_STATE_TOMBSTONE,
6397 .node = WREPL_NODE_B,
6399 .num_ips = ctx->addresses_best_num,
6400 .ips = ctx->addresses_best,
6401 .apply_expected = true
6405 * mhomed,released vs. sgroup,tombstone with different ip(s)
6408 .line = __location__,
6409 .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL),
6413 .num_ips = ctx->addresses_best_num,
6414 .ips = ctx->addresses_best,
6415 .apply_expected = true
6418 .type = WREPL_TYPE_SGROUP,
6419 .state = WREPL_STATE_TOMBSTONE,
6420 .node = WREPL_NODE_B,
6422 .num_ips = ARRAY_SIZE(addresses_B_1),
6423 .ips = addresses_B_1,
6424 .apply_expected = true
6428 * multi homed vs. multi homed section
6431 * mhomed,released vs. mhomed,active with same ip(s)
6434 .line = __location__,
6435 .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL),
6439 .num_ips = ctx->addresses_best_num,
6440 .ips = ctx->addresses_best,
6441 .apply_expected = true
6444 .type = WREPL_TYPE_MHOMED,
6445 .state = WREPL_STATE_ACTIVE,
6446 .node = WREPL_NODE_B,
6448 .num_ips = ctx->addresses_best_num,
6449 .ips = ctx->addresses_best,
6450 .apply_expected = true
6454 * mhomed,released vs. mhomed,active with different ip(s)
6457 .line = __location__,
6458 .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL),
6462 .num_ips = ctx->addresses_best_num,
6463 .ips = ctx->addresses_best,
6464 .apply_expected = true
6467 .type = WREPL_TYPE_MHOMED,
6468 .state = WREPL_STATE_ACTIVE,
6469 .node = WREPL_NODE_B,
6471 .num_ips = ARRAY_SIZE(addresses_B_1),
6472 .ips = addresses_B_1,
6473 .apply_expected = true
6477 * mhomed,released vs. mhomed,tombstone with same ip(s)
6480 .line = __location__,
6481 .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL),
6485 .num_ips = ctx->addresses_best_num,
6486 .ips = ctx->addresses_best,
6487 .apply_expected = true
6490 .type = WREPL_TYPE_MHOMED,
6491 .state = WREPL_STATE_TOMBSTONE,
6492 .node = WREPL_NODE_B,
6494 .num_ips = ctx->addresses_best_num,
6495 .ips = ctx->addresses_best,
6496 .apply_expected = true
6500 * mhomed,released vs. mhomed,tombstone with different ip(s)
6503 .line = __location__,
6504 .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL),
6508 .num_ips = ctx->addresses_best_num,
6509 .ips = ctx->addresses_best,
6510 .apply_expected = true
6513 .type = WREPL_TYPE_MHOMED,
6514 .state = WREPL_STATE_TOMBSTONE,
6515 .node = WREPL_NODE_B,
6517 .num_ips = ARRAY_SIZE(addresses_B_1),
6518 .ips = addresses_B_1,
6519 .apply_expected = true
6524 torture_comment(tctx, "Test Replica records vs. owned released records\n");
6526 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
6527 torture_comment(tctx, "%s => %s\n", nbt_name_string(ctx, &records[i].name),
6528 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
6533 name_register->in.name = records[i].name;
6534 name_register->in.dest_addr = ctx->address;
6535 name_register->in.address = records[i].wins.ips[0].ip;
6536 name_register->in.nb_flags = records[i].wins.nb_flags;
6537 name_register->in.register_demand= false;
6538 name_register->in.broadcast = false;
6539 name_register->in.multi_homed = records[i].wins.mhomed;
6540 name_register->in.ttl = 300000;
6541 name_register->in.timeout = 70;
6542 name_register->in.retries = 0;
6544 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
6545 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6546 torture_comment(tctx, "No response from %s for name register\n", ctx->address);
6549 if (!NT_STATUS_IS_OK(status)) {
6550 torture_comment(tctx, "Bad response from %s for name register - %s\n",
6551 ctx->address, nt_errstr(status));
6554 CHECK_VALUE(tctx, name_register->out.rcode, 0);
6555 CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address);
6556 CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type);
6557 CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name);
6558 CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope);
6559 CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[0].ip);
6561 /* release the record */
6562 release->in.name = records[i].name;
6563 release->in.dest_addr = ctx->address;
6564 release->in.address = records[i].wins.ips[0].ip;
6565 release->in.nb_flags = records[i].wins.nb_flags;
6566 release->in.broadcast = false;
6567 release->in.timeout = 30;
6568 release->in.retries = 0;
6570 status = nbt_name_release(ctx->nbtsock, ctx, release);
6571 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6572 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
6575 if (!NT_STATUS_IS_OK(status)) {
6576 torture_comment(tctx, "Bad response from %s for name query - %s\n",
6577 ctx->address, nt_errstr(status));
6580 CHECK_VALUE(tctx, release->out.rcode, 0);
6585 wins_name->name = &records[i].name;
6586 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
6587 records[i].replica.state,
6588 records[i].replica.node,
6589 records[i].replica.is_static);
6590 wins_name->id = ++ctx->b.max_version;
6591 if (wins_name->flags & 2) {
6592 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
6593 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
6595 wins_name->addresses.ip = records[i].replica.ips[0].ip;
6597 wins_name->unknown = "255.255.255.255";
6599 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
6600 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name,
6601 records[i].replica.apply_expected);
6603 if (records[i].replica.apply_expected) {
6604 wins_name->name = &records[i].name;
6605 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
6606 WREPL_STATE_TOMBSTONE,
6607 WREPL_NODE_B, false);
6608 wins_name->id = ++ctx->b.max_version;
6609 wins_name->addresses.ip = addresses_B_1[0].ip;
6610 wins_name->unknown = "255.255.255.255";
6612 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
6613 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
6615 release->in.name = records[i].name;
6616 release->in.dest_addr = ctx->address;
6617 release->in.address = records[i].wins.ips[0].ip;
6618 release->in.nb_flags = records[i].wins.nb_flags;
6619 release->in.broadcast = false;
6620 release->in.timeout = 30;
6621 release->in.retries = 0;
6623 status = nbt_name_release(ctx->nbtsock, ctx, release);
6624 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6625 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
6628 if (!NT_STATUS_IS_OK(status)) {
6629 torture_comment(tctx, "Bad response from %s for name query - %s\n",
6630 ctx->address, nt_errstr(status));
6633 CHECK_VALUE(tctx, release->out.rcode, 0);
6636 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
6644 struct test_conflict_owned_active_vs_replica_struct {
6645 const char *line; /* just better debugging */
6646 const char *section; /* just better debugging */
6647 struct nbt_name name;
6648 const char *comment;
6654 const struct wrepl_ip *ips;
6655 bool apply_expected;
6660 bool expect_release;
6663 /* when num_ips == 0, then .wins.ips are used */
6665 const struct wrepl_ip *ips;
6668 enum wrepl_name_type type;
6669 enum wrepl_name_state state;
6670 enum wrepl_name_node node;
6673 const struct wrepl_ip *ips;
6674 bool apply_expected;
6680 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
6681 struct nbt_name_packet *req_packet,
6682 struct socket_address *src);
6684 static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx,
6685 struct test_wrepl_conflict_conn *ctx)
6689 struct wrepl_wins_name wins_name_;
6690 struct wrepl_wins_name *wins_name = &wins_name_;
6691 struct nbt_name_register name_register_;
6692 struct nbt_name_register *name_register = &name_register_;
6693 struct nbt_name_release release_;
6694 struct nbt_name_release *release = &release_;
6696 struct test_conflict_owned_active_vs_replica_struct records[] = {
6698 * unique vs. unique section
6700 #if METZE_NEEDS_TO_LOOK_AT_THIS_ONE
6702 * unique,active vs. unique,active with same ip(s), unchecked
6705 .line = __location__,
6706 .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL),
6710 .num_ips = ctx->addresses_best_num,
6711 .ips = ctx->addresses_best,
6712 .apply_expected = true
6718 .type = WREPL_TYPE_UNIQUE,
6719 .state = WREPL_STATE_ACTIVE,
6720 .node = WREPL_NODE_B,
6722 .num_ips = ctx->addresses_best_num,
6723 .ips = ctx->addresses_best,
6724 .apply_expected = true
6729 * unique,active vs. unique,active with different ip(s), positive response
6732 .line = __location__,
6733 .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL),
6737 .num_ips = ctx->addresses_best_num,
6738 .ips = ctx->addresses_best,
6739 .apply_expected = true
6746 .type = WREPL_TYPE_UNIQUE,
6747 .state = WREPL_STATE_ACTIVE,
6748 .node = WREPL_NODE_B,
6750 .num_ips = ARRAY_SIZE(addresses_B_1),
6751 .ips = addresses_B_1,
6752 .apply_expected = false
6756 * unique,active vs. unique,active with different ip(s), positive response other ips
6759 .line = __location__,
6760 .name = _NBT_NAME("_UA_UA_DI_O", 0x00, NULL),
6764 .num_ips = ctx->addresses_best_num,
6765 .ips = ctx->addresses_best,
6766 .apply_expected = true
6771 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6772 .ips = addresses_A_3_4,
6775 .type = WREPL_TYPE_UNIQUE,
6776 .state = WREPL_STATE_ACTIVE,
6777 .node = WREPL_NODE_B,
6779 .num_ips = ARRAY_SIZE(addresses_B_1),
6780 .ips = addresses_B_1,
6781 .apply_expected = false
6785 * unique,active vs. unique,active with different ip(s), negative response
6788 .line = __location__,
6789 .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL),
6793 .num_ips = ctx->addresses_best_num,
6794 .ips = ctx->addresses_best,
6795 .apply_expected = true
6802 .type = WREPL_TYPE_UNIQUE,
6803 .state = WREPL_STATE_ACTIVE,
6804 .node = WREPL_NODE_B,
6806 .num_ips = ARRAY_SIZE(addresses_B_1),
6807 .ips = addresses_B_1,
6808 .apply_expected = true
6812 * unique,active vs. unique,tombstone with same ip(s), unchecked
6815 .line = __location__,
6816 .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL),
6820 .num_ips = ctx->addresses_best_num,
6821 .ips = ctx->addresses_best,
6822 .apply_expected = true
6828 .type = WREPL_TYPE_UNIQUE,
6829 .state = WREPL_STATE_TOMBSTONE,
6830 .node = WREPL_NODE_B,
6832 .num_ips = ctx->addresses_best_num,
6833 .ips = ctx->addresses_best,
6834 .apply_expected = false
6838 * unique,active vs. unique,tombstone with different ip(s), unchecked
6841 .line = __location__,
6842 .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL),
6846 .num_ips = ctx->addresses_best_num,
6847 .ips = ctx->addresses_best,
6848 .apply_expected = true
6854 .type = WREPL_TYPE_UNIQUE,
6855 .state = WREPL_STATE_TOMBSTONE,
6856 .node = WREPL_NODE_B,
6858 .num_ips = ARRAY_SIZE(addresses_B_1),
6859 .ips = addresses_B_1,
6860 .apply_expected = false
6864 * unique vs. group section
6867 * unique,active vs. group,active with same ip(s), release expected
6870 .line = __location__,
6871 .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL),
6875 .num_ips = ctx->addresses_best_num,
6876 .ips = ctx->addresses_best,
6877 .apply_expected = true
6881 .expect_release = true,
6884 .type = WREPL_TYPE_GROUP,
6885 .state = WREPL_STATE_ACTIVE,
6886 .node = WREPL_NODE_B,
6888 .num_ips = ctx->addresses_best_num,
6889 .ips = ctx->addresses_best,
6890 .apply_expected = true
6894 * unique,active vs. group,active with different ip(s), release expected
6897 .line = __location__,
6898 .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL),
6902 .num_ips = ctx->addresses_best_num,
6903 .ips = ctx->addresses_best,
6904 .apply_expected = true
6908 .expect_release = true,
6911 .type = WREPL_TYPE_GROUP,
6912 .state = WREPL_STATE_ACTIVE,
6913 .node = WREPL_NODE_B,
6915 .num_ips = ARRAY_SIZE(addresses_B_1),
6916 .ips = addresses_B_1,
6917 .apply_expected = true
6921 * unique,active vs. group,tombstone with same ip(s), unchecked
6924 .line = __location__,
6925 .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL),
6929 .num_ips = ctx->addresses_best_num,
6930 .ips = ctx->addresses_best,
6931 .apply_expected = true
6937 .type = WREPL_TYPE_GROUP,
6938 .state = WREPL_STATE_TOMBSTONE,
6939 .node = WREPL_NODE_B,
6941 .num_ips = ctx->addresses_best_num,
6942 .ips = ctx->addresses_best,
6943 .apply_expected = false
6947 * unique,active vs. group,tombstone with different ip(s), unchecked
6950 .line = __location__,
6951 .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL),
6955 .num_ips = ctx->addresses_best_num,
6956 .ips = ctx->addresses_best,
6957 .apply_expected = true
6963 .type = WREPL_TYPE_GROUP,
6964 .state = WREPL_STATE_TOMBSTONE,
6965 .node = WREPL_NODE_B,
6967 .num_ips = ARRAY_SIZE(addresses_B_1),
6968 .ips = addresses_B_1,
6969 .apply_expected = false
6973 * unique vs. special group section
6976 * unique,active vs. sgroup,active with same ip(s), release expected
6979 .line = __location__,
6980 .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL),
6984 .num_ips = ctx->addresses_best_num,
6985 .ips = ctx->addresses_best,
6986 .apply_expected = true
6990 .expect_release = true,
6993 .type = WREPL_TYPE_SGROUP,
6994 .state = WREPL_STATE_ACTIVE,
6995 .node = WREPL_NODE_B,
6997 .num_ips = ctx->addresses_best_num,
6998 .ips = ctx->addresses_best,
6999 .apply_expected = true
7003 * unique,active vs. group,active with different ip(s), release expected
7006 .line = __location__,
7007 .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL),
7011 .num_ips = ctx->addresses_best_num,
7012 .ips = ctx->addresses_best,
7013 .apply_expected = true
7017 .expect_release = true,
7020 .type = WREPL_TYPE_SGROUP,
7021 .state = WREPL_STATE_ACTIVE,
7022 .node = WREPL_NODE_B,
7024 .num_ips = ARRAY_SIZE(addresses_B_1),
7025 .ips = addresses_B_1,
7026 .apply_expected = true
7030 * unique,active vs. sgroup,tombstone with same ip(s), unchecked
7033 .line = __location__,
7034 .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL),
7038 .num_ips = ctx->addresses_best_num,
7039 .ips = ctx->addresses_best,
7040 .apply_expected = true
7046 .type = WREPL_TYPE_SGROUP,
7047 .state = WREPL_STATE_TOMBSTONE,
7048 .node = WREPL_NODE_B,
7050 .num_ips = ctx->addresses_best_num,
7051 .ips = ctx->addresses_best,
7052 .apply_expected = false
7056 * unique,active vs. sgroup,tombstone with different ip(s), unchecked
7059 .line = __location__,
7060 .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL),
7064 .num_ips = ctx->addresses_best_num,
7065 .ips = ctx->addresses_best,
7066 .apply_expected = true
7072 .type = WREPL_TYPE_SGROUP,
7073 .state = WREPL_STATE_TOMBSTONE,
7074 .node = WREPL_NODE_B,
7076 .num_ips = ARRAY_SIZE(addresses_B_1),
7077 .ips = addresses_B_1,
7078 .apply_expected = false
7082 * unique vs. multi homed section
7085 * unique,active vs. mhomed,active with same ip(s), unchecked
7088 .line = __location__,
7089 .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL),
7093 .num_ips = ctx->addresses_best_num,
7094 .ips = ctx->addresses_best,
7095 .apply_expected = true
7101 .type = WREPL_TYPE_MHOMED,
7102 .state = WREPL_STATE_ACTIVE,
7103 .node = WREPL_NODE_B,
7105 .num_ips = ctx->addresses_best_num,
7106 .ips = ctx->addresses_best,
7107 .apply_expected = true
7111 * unique,active vs. mhomed,active with superset ip(s), unchecked
7114 .line = __location__,
7115 .name = _NBT_NAME("_UA_MA_SP_U", 0x00, NULL),
7119 .num_ips = ctx->addresses_best_num,
7120 .ips = ctx->addresses_best,
7121 .apply_expected = true
7127 .type = WREPL_TYPE_MHOMED,
7128 .state = WREPL_STATE_ACTIVE,
7129 .node = WREPL_NODE_B,
7131 .num_ips = ctx->addresses_all_num,
7132 .ips = ctx->addresses_all,
7133 .apply_expected = true
7137 * unique,active vs. mhomed,active with different ip(s), positive response
7140 .line = __location__,
7141 .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL),
7145 .num_ips = ctx->addresses_best_num,
7146 .ips = ctx->addresses_best,
7147 .apply_expected = true
7154 .type = WREPL_TYPE_MHOMED,
7155 .state = WREPL_STATE_ACTIVE,
7156 .node = WREPL_NODE_B,
7158 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7159 .ips = addresses_B_3_4,
7160 .apply_expected = false
7164 * unique,active vs. mhomed,active with different ip(s), positive response other ips
7167 .line = __location__,
7168 .name = _NBT_NAME("_UA_MA_DI_O", 0x00, NULL),
7172 .num_ips = ctx->addresses_best_num,
7173 .ips = ctx->addresses_best,
7174 .apply_expected = true
7179 .num_ips = ARRAY_SIZE(addresses_A_3_4),
7180 .ips = addresses_A_3_4,
7183 .type = WREPL_TYPE_MHOMED,
7184 .state = WREPL_STATE_ACTIVE,
7185 .node = WREPL_NODE_B,
7187 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7188 .ips = addresses_B_3_4,
7189 .apply_expected = false
7193 * unique,active vs. mhomed,active with different ip(s), negative response
7196 .line = __location__,
7197 .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL),
7201 .num_ips = ctx->addresses_best_num,
7202 .ips = ctx->addresses_best,
7203 .apply_expected = true
7210 .type = WREPL_TYPE_MHOMED,
7211 .state = WREPL_STATE_ACTIVE,
7212 .node = WREPL_NODE_B,
7214 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7215 .ips = addresses_B_3_4,
7216 .apply_expected = true
7220 * unique,active vs. mhomed,tombstone with same ip(s), unchecked
7223 .line = __location__,
7224 .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL),
7228 .num_ips = ctx->addresses_best_num,
7229 .ips = ctx->addresses_best,
7230 .apply_expected = true
7236 .type = WREPL_TYPE_MHOMED,
7237 .state = WREPL_STATE_TOMBSTONE,
7238 .node = WREPL_NODE_B,
7240 .num_ips = ctx->addresses_best_num,
7241 .ips = ctx->addresses_best,
7242 .apply_expected = false
7246 * unique,active vs. mhomed,tombstone with different ip(s), unchecked
7249 .line = __location__,
7250 .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL),
7254 .num_ips = ctx->addresses_best_num,
7255 .ips = ctx->addresses_best,
7256 .apply_expected = true
7262 .type = WREPL_TYPE_MHOMED,
7263 .state = WREPL_STATE_TOMBSTONE,
7264 .node = WREPL_NODE_B,
7266 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7267 .ips = addresses_B_3_4,
7268 .apply_expected = false
7272 * normal group vs. unique section
7275 * group,active vs. unique,active with same ip(s), unchecked
7278 .line = __location__,
7279 .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL),
7281 .nb_flags = NBT_NM_GROUP,
7283 .num_ips = ctx->addresses_best_num,
7284 .ips = ctx->addresses_best,
7285 .apply_expected = true
7291 .type = WREPL_TYPE_UNIQUE,
7292 .state = WREPL_STATE_ACTIVE,
7293 .node = WREPL_NODE_B,
7295 .num_ips = ctx->addresses_best_num,
7296 .ips = ctx->addresses_best,
7297 .apply_expected = false
7301 * group,active vs. unique,active with different ip(s), unchecked
7304 .line = __location__,
7305 .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL),
7307 .nb_flags = NBT_NM_GROUP,
7309 .num_ips = ctx->addresses_best_num,
7310 .ips = ctx->addresses_best,
7311 .apply_expected = true
7317 .type = WREPL_TYPE_UNIQUE,
7318 .state = WREPL_STATE_ACTIVE,
7319 .node = WREPL_NODE_B,
7321 .num_ips = ARRAY_SIZE(addresses_B_1),
7322 .ips = addresses_B_1,
7323 .apply_expected = false
7327 * group,active vs. unique,tombstone with same ip(s), unchecked
7330 .line = __location__,
7331 .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL),
7333 .nb_flags = NBT_NM_GROUP,
7335 .num_ips = ctx->addresses_best_num,
7336 .ips = ctx->addresses_best,
7337 .apply_expected = true
7343 .type = WREPL_TYPE_UNIQUE,
7344 .state = WREPL_STATE_TOMBSTONE,
7345 .node = WREPL_NODE_B,
7347 .num_ips = ctx->addresses_best_num,
7348 .ips = ctx->addresses_best,
7349 .apply_expected = false
7353 * group,active vs. unique,tombstone with different ip(s), unchecked
7356 .line = __location__,
7357 .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL),
7359 .nb_flags = NBT_NM_GROUP,
7361 .num_ips = ctx->addresses_best_num,
7362 .ips = ctx->addresses_best,
7363 .apply_expected = true
7369 .type = WREPL_TYPE_UNIQUE,
7370 .state = WREPL_STATE_TOMBSTONE,
7371 .node = WREPL_NODE_B,
7373 .num_ips = ARRAY_SIZE(addresses_B_1),
7374 .ips = addresses_B_1,
7375 .apply_expected = false
7379 * normal group vs. normal group section
7382 * group,active vs. group,active with same ip(s), unchecked
7385 .line = __location__,
7386 .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL),
7388 .nb_flags = NBT_NM_GROUP,
7390 .num_ips = ctx->addresses_best_num,
7391 .ips = ctx->addresses_best,
7392 .apply_expected = true
7398 .type = WREPL_TYPE_GROUP,
7399 .state = WREPL_STATE_ACTIVE,
7400 .node = WREPL_NODE_B,
7402 .num_ips = ctx->addresses_best_num,
7403 .ips = ctx->addresses_best,
7404 .apply_expected = true
7408 * group,active vs. group,active with different ip(s), unchecked
7411 .line = __location__,
7412 .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL),
7414 .nb_flags = NBT_NM_GROUP,
7416 .num_ips = ctx->addresses_best_num,
7417 .ips = ctx->addresses_best,
7418 .apply_expected = true
7424 .type = WREPL_TYPE_GROUP,
7425 .state = WREPL_STATE_ACTIVE,
7426 .node = WREPL_NODE_B,
7428 .num_ips = ARRAY_SIZE(addresses_B_1),
7429 .ips = addresses_B_1,
7430 .apply_expected = true
7434 * group,active vs. group,tombstone with same ip(s), unchecked
7437 .line = __location__,
7438 .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL),
7440 .nb_flags = NBT_NM_GROUP,
7442 .num_ips = ctx->addresses_best_num,
7443 .ips = ctx->addresses_best,
7444 .apply_expected = true
7450 .type = WREPL_TYPE_GROUP,
7451 .state = WREPL_STATE_TOMBSTONE,
7452 .node = WREPL_NODE_B,
7454 .num_ips = ctx->addresses_best_num,
7455 .ips = ctx->addresses_best,
7456 .apply_expected = false
7460 * group,active vs. group,tombstone with different ip(s), unchecked
7463 .line = __location__,
7464 .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL),
7466 .nb_flags = NBT_NM_GROUP,
7468 .num_ips = ctx->addresses_best_num,
7469 .ips = ctx->addresses_best,
7470 .apply_expected = true
7476 .type = WREPL_TYPE_GROUP,
7477 .state = WREPL_STATE_TOMBSTONE,
7478 .node = WREPL_NODE_B,
7480 .num_ips = ARRAY_SIZE(addresses_B_1),
7481 .ips = addresses_B_1,
7482 .apply_expected = false
7486 * normal group vs. special group section
7489 * group,active vs. sgroup,active with same ip(s), unchecked
7492 .line = __location__,
7493 .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL),
7495 .nb_flags = NBT_NM_GROUP,
7497 .num_ips = ctx->addresses_best_num,
7498 .ips = ctx->addresses_best,
7499 .apply_expected = true
7505 .type = WREPL_TYPE_SGROUP,
7506 .state = WREPL_STATE_ACTIVE,
7507 .node = WREPL_NODE_B,
7509 .num_ips = ctx->addresses_best_num,
7510 .ips = ctx->addresses_best,
7511 .apply_expected = false
7515 * group,active vs. sgroup,active with different ip(s), unchecked
7518 .line = __location__,
7519 .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL),
7521 .nb_flags = NBT_NM_GROUP,
7523 .num_ips = ctx->addresses_best_num,
7524 .ips = ctx->addresses_best,
7525 .apply_expected = true
7531 .type = WREPL_TYPE_SGROUP,
7532 .state = WREPL_STATE_ACTIVE,
7533 .node = WREPL_NODE_B,
7535 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7536 .ips = addresses_B_3_4,
7537 .apply_expected = false
7541 * group,active vs. sgroup,tombstone with same ip(s), unchecked
7544 .line = __location__,
7545 .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL),
7547 .nb_flags = NBT_NM_GROUP,
7549 .num_ips = ctx->addresses_best_num,
7550 .ips = ctx->addresses_best,
7551 .apply_expected = true
7557 .type = WREPL_TYPE_SGROUP,
7558 .state = WREPL_STATE_TOMBSTONE,
7559 .node = WREPL_NODE_B,
7561 .num_ips = ctx->addresses_best_num,
7562 .ips = ctx->addresses_best,
7563 .apply_expected = false
7567 * group,active vs. sgroup,tombstone with different ip(s), unchecked
7570 .line = __location__,
7571 .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL),
7573 .nb_flags = NBT_NM_GROUP,
7575 .num_ips = ctx->addresses_best_num,
7576 .ips = ctx->addresses_best,
7577 .apply_expected = true
7583 .type = WREPL_TYPE_SGROUP,
7584 .state = WREPL_STATE_TOMBSTONE,
7585 .node = WREPL_NODE_B,
7587 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7588 .ips = addresses_B_3_4,
7589 .apply_expected = false
7593 * normal group vs. multi homed section
7596 * group,active vs. mhomed,active with same ip(s), unchecked
7599 .line = __location__,
7600 .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL),
7602 .nb_flags = NBT_NM_GROUP,
7604 .num_ips = ctx->addresses_best_num,
7605 .ips = ctx->addresses_best,
7606 .apply_expected = true
7612 .type = WREPL_TYPE_MHOMED,
7613 .state = WREPL_STATE_ACTIVE,
7614 .node = WREPL_NODE_B,
7616 .num_ips = ctx->addresses_best_num,
7617 .ips = ctx->addresses_best,
7618 .apply_expected = false
7622 * group,active vs. mhomed,active with different ip(s), unchecked
7625 .line = __location__,
7626 .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL),
7628 .nb_flags = NBT_NM_GROUP,
7630 .num_ips = ctx->addresses_best_num,
7631 .ips = ctx->addresses_best,
7632 .apply_expected = true
7638 .type = WREPL_TYPE_MHOMED,
7639 .state = WREPL_STATE_ACTIVE,
7640 .node = WREPL_NODE_B,
7642 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7643 .ips = addresses_B_3_4,
7644 .apply_expected = false
7648 * group,active vs. mhomed,tombstone with same ip(s), unchecked
7651 .line = __location__,
7652 .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL),
7654 .nb_flags = NBT_NM_GROUP,
7656 .num_ips = ctx->addresses_best_num,
7657 .ips = ctx->addresses_best,
7658 .apply_expected = true
7664 .type = WREPL_TYPE_MHOMED,
7665 .state = WREPL_STATE_TOMBSTONE,
7666 .node = WREPL_NODE_B,
7668 .num_ips = ctx->addresses_best_num,
7669 .ips = ctx->addresses_best,
7670 .apply_expected = false
7674 * group,active vs. mhomed,tombstone with different ip(s), unchecked
7677 .line = __location__,
7678 .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL),
7680 .nb_flags = NBT_NM_GROUP,
7682 .num_ips = ctx->addresses_best_num,
7683 .ips = ctx->addresses_best,
7684 .apply_expected = true
7690 .type = WREPL_TYPE_MHOMED,
7691 .state = WREPL_STATE_TOMBSTONE,
7692 .node = WREPL_NODE_B,
7694 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7695 .ips = addresses_B_3_4,
7696 .apply_expected = false
7700 * special group vs. unique section
7703 * sgroup,active vs. unique,active with same ip(s), unchecked
7706 .line = __location__,
7707 .name = _NBT_NAME("_SA_UA_SI_U", 0x1C, NULL),
7709 .nb_flags = NBT_NM_GROUP,
7711 .num_ips = ctx->addresses_best_num,
7712 .ips = ctx->addresses_best,
7713 .apply_expected = true
7719 .type = WREPL_TYPE_UNIQUE,
7720 .state = WREPL_STATE_ACTIVE,
7721 .node = WREPL_NODE_B,
7723 .num_ips = ctx->addresses_best_num,
7724 .ips = ctx->addresses_best,
7725 .apply_expected = false
7729 * sgroup,active vs. unique,active with different ip(s), unchecked
7732 .line = __location__,
7733 .name = _NBT_NAME("_SA_UA_DI_U", 0x1C, NULL),
7735 .nb_flags = NBT_NM_GROUP,
7737 .num_ips = ctx->addresses_best_num,
7738 .ips = ctx->addresses_best,
7739 .apply_expected = true
7745 .type = WREPL_TYPE_UNIQUE,
7746 .state = WREPL_STATE_ACTIVE,
7747 .node = WREPL_NODE_B,
7749 .num_ips = ARRAY_SIZE(addresses_B_1),
7750 .ips = addresses_B_1,
7751 .apply_expected = false
7755 * sgroup,active vs. unique,tombstone with same ip(s), unchecked
7758 .line = __location__,
7759 .name = _NBT_NAME("_SA_UT_SI_U", 0x1C, NULL),
7761 .nb_flags = NBT_NM_GROUP,
7763 .num_ips = ctx->addresses_best_num,
7764 .ips = ctx->addresses_best,
7765 .apply_expected = true
7771 .type = WREPL_TYPE_UNIQUE,
7772 .state = WREPL_STATE_TOMBSTONE,
7773 .node = WREPL_NODE_B,
7775 .num_ips = ctx->addresses_best_num,
7776 .ips = ctx->addresses_best,
7777 .apply_expected = false
7781 * sgroup,active vs. unique,tombstone with different ip(s), unchecked
7784 .line = __location__,
7785 .name = _NBT_NAME("_SA_UT_DI_U", 0x1C, NULL),
7787 .nb_flags = NBT_NM_GROUP,
7789 .num_ips = ctx->addresses_best_num,
7790 .ips = ctx->addresses_best,
7791 .apply_expected = true
7797 .type = WREPL_TYPE_UNIQUE,
7798 .state = WREPL_STATE_TOMBSTONE,
7799 .node = WREPL_NODE_B,
7801 .num_ips = ARRAY_SIZE(addresses_B_1),
7802 .ips = addresses_B_1,
7803 .apply_expected = false
7807 * special group vs. normal group section
7810 * sgroup,active vs. group,active with same ip(s), unchecked
7813 .line = __location__,
7814 .name = _NBT_NAME("_SA_GA_SI_U", 0x1C, NULL),
7816 .nb_flags = NBT_NM_GROUP,
7818 .num_ips = ctx->addresses_best_num,
7819 .ips = ctx->addresses_best,
7820 .apply_expected = true
7826 .type = WREPL_TYPE_GROUP,
7827 .state = WREPL_STATE_ACTIVE,
7828 .node = WREPL_NODE_B,
7830 .num_ips = ctx->addresses_best_num,
7831 .ips = ctx->addresses_best,
7832 .apply_expected = false
7836 * sgroup,active vs. group,active with different ip(s), unchecked
7839 .line = __location__,
7840 .name = _NBT_NAME("_SA_GA_DI_U", 0x1C, NULL),
7842 .nb_flags = NBT_NM_GROUP,
7844 .num_ips = ctx->addresses_best_num,
7845 .ips = ctx->addresses_best,
7846 .apply_expected = true
7852 .type = WREPL_TYPE_GROUP,
7853 .state = WREPL_STATE_ACTIVE,
7854 .node = WREPL_NODE_B,
7856 .num_ips = ARRAY_SIZE(addresses_B_1),
7857 .ips = addresses_B_1,
7858 .apply_expected = false
7862 * sgroup,active vs. group,tombstone with same ip(s), unchecked
7865 .line = __location__,
7866 .name = _NBT_NAME("_SA_GT_SI_U", 0x1C, NULL),
7868 .nb_flags = NBT_NM_GROUP,
7870 .num_ips = ctx->addresses_best_num,
7871 .ips = ctx->addresses_best,
7872 .apply_expected = true
7878 .type = WREPL_TYPE_GROUP,
7879 .state = WREPL_STATE_TOMBSTONE,
7880 .node = WREPL_NODE_B,
7882 .num_ips = ctx->addresses_best_num,
7883 .ips = ctx->addresses_best,
7884 .apply_expected = false
7888 * sgroup,active vs. group,tombstone with different ip(s), unchecked
7891 .line = __location__,
7892 .name = _NBT_NAME("_SA_GT_DI_U", 0x1C, NULL),
7894 .nb_flags = NBT_NM_GROUP,
7896 .num_ips = ctx->addresses_best_num,
7897 .ips = ctx->addresses_best,
7898 .apply_expected = true
7904 .type = WREPL_TYPE_GROUP,
7905 .state = WREPL_STATE_TOMBSTONE,
7906 .node = WREPL_NODE_B,
7908 .num_ips = ARRAY_SIZE(addresses_B_1),
7909 .ips = addresses_B_1,
7910 .apply_expected = false
7914 * special group vs. multi homed section
7917 * sgroup,active vs. mhomed,active with same ip(s), unchecked
7920 .line = __location__,
7921 .name = _NBT_NAME("_SA_MA_SI_U", 0x1C, NULL),
7923 .nb_flags = NBT_NM_GROUP,
7925 .num_ips = ctx->addresses_best_num,
7926 .ips = ctx->addresses_best,
7927 .apply_expected = true
7933 .type = WREPL_TYPE_MHOMED,
7934 .state = WREPL_STATE_ACTIVE,
7935 .node = WREPL_NODE_B,
7937 .num_ips = ctx->addresses_best_num,
7938 .ips = ctx->addresses_best,
7939 .apply_expected = false
7943 * sgroup,active vs. mhomed,active with different ip(s), unchecked
7946 .line = __location__,
7947 .name = _NBT_NAME("_SA_MA_DI_U", 0x1C, NULL),
7949 .nb_flags = NBT_NM_GROUP,
7951 .num_ips = ctx->addresses_best_num,
7952 .ips = ctx->addresses_best,
7953 .apply_expected = true
7959 .type = WREPL_TYPE_MHOMED,
7960 .state = WREPL_STATE_ACTIVE,
7961 .node = WREPL_NODE_B,
7963 .num_ips = ARRAY_SIZE(addresses_B_1),
7964 .ips = addresses_B_1,
7965 .apply_expected = false
7969 * sgroup,active vs. mhomed,tombstone with same ip(s), unchecked
7972 .line = __location__,
7973 .name = _NBT_NAME("_SA_MT_SI_U", 0x1C, NULL),
7975 .nb_flags = NBT_NM_GROUP,
7977 .num_ips = ctx->addresses_best_num,
7978 .ips = ctx->addresses_best,
7979 .apply_expected = true
7985 .type = WREPL_TYPE_MHOMED,
7986 .state = WREPL_STATE_TOMBSTONE,
7987 .node = WREPL_NODE_B,
7989 .num_ips = ctx->addresses_best_num,
7990 .ips = ctx->addresses_best,
7991 .apply_expected = false
7995 * sgroup,active vs. mhomed,tombstone with different ip(s), unchecked
7998 .line = __location__,
7999 .name = _NBT_NAME("_SA_MT_DI_U", 0x1C, NULL),
8001 .nb_flags = NBT_NM_GROUP,
8003 .num_ips = ctx->addresses_best_num,
8004 .ips = ctx->addresses_best,
8005 .apply_expected = true
8011 .type = WREPL_TYPE_MHOMED,
8012 .state = WREPL_STATE_TOMBSTONE,
8013 .node = WREPL_NODE_B,
8015 .num_ips = ARRAY_SIZE(addresses_B_1),
8016 .ips = addresses_B_1,
8017 .apply_expected = false
8021 * multi homed vs. unique section
8024 * mhomed,active vs. unique,active with same ip(s), unchecked
8027 .line = __location__,
8028 .name = _NBT_NAME("_MA_UA_SI_U", 0x00, NULL),
8032 .num_ips = ctx->addresses_best_num,
8033 .ips = ctx->addresses_best,
8034 .apply_expected = true
8040 .type = WREPL_TYPE_UNIQUE,
8041 .state = WREPL_STATE_ACTIVE,
8042 .node = WREPL_NODE_B,
8044 .num_ips = ctx->addresses_best_num,
8045 .ips = ctx->addresses_best,
8046 .apply_expected = true
8050 * mhomed,active vs. unique,active with different ip(s), positive response
8053 .line = __location__,
8054 .name = _NBT_NAME("_MA_UA_DI_P", 0x00, NULL),
8058 .num_ips = ctx->addresses_best_num,
8059 .ips = ctx->addresses_best,
8060 .apply_expected = true
8067 .type = WREPL_TYPE_UNIQUE,
8068 .state = WREPL_STATE_ACTIVE,
8069 .node = WREPL_NODE_B,
8071 .num_ips = ARRAY_SIZE(addresses_B_1),
8072 .ips = addresses_B_1,
8073 .apply_expected = false
8077 * mhomed,active vs. unique,active with different ip(s), positive response other ips
8080 .line = __location__,
8081 .name = _NBT_NAME("_MA_UA_DI_O", 0x00, NULL),
8085 .num_ips = ctx->addresses_best_num,
8086 .ips = ctx->addresses_best,
8087 .apply_expected = true
8092 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8093 .ips = addresses_A_3_4,
8096 .type = WREPL_TYPE_UNIQUE,
8097 .state = WREPL_STATE_ACTIVE,
8098 .node = WREPL_NODE_B,
8100 .num_ips = ARRAY_SIZE(addresses_B_1),
8101 .ips = addresses_B_1,
8102 .apply_expected = false
8106 * mhomed,active vs. unique,active with different ip(s), negative response
8109 .line = __location__,
8110 .name = _NBT_NAME("_MA_UA_DI_N", 0x00, NULL),
8114 .num_ips = ctx->addresses_best_num,
8115 .ips = ctx->addresses_best,
8116 .apply_expected = true
8123 .type = WREPL_TYPE_UNIQUE,
8124 .state = WREPL_STATE_ACTIVE,
8125 .node = WREPL_NODE_B,
8127 .num_ips = ARRAY_SIZE(addresses_B_1),
8128 .ips = addresses_B_1,
8129 .apply_expected = true
8133 * mhomed,active vs. unique,tombstone with same ip(s), unchecked
8136 .line = __location__,
8137 .name = _NBT_NAME("_MA_UT_SI_U", 0x00, NULL),
8141 .num_ips = ctx->addresses_best_num,
8142 .ips = ctx->addresses_best,
8143 .apply_expected = true
8149 .type = WREPL_TYPE_UNIQUE,
8150 .state = WREPL_STATE_TOMBSTONE,
8151 .node = WREPL_NODE_B,
8153 .num_ips = ctx->addresses_best_num,
8154 .ips = ctx->addresses_best,
8155 .apply_expected = false
8159 * mhomed,active vs. unique,tombstone with different ip(s), unchecked
8162 .line = __location__,
8163 .name = _NBT_NAME("_MA_UT_DI_U", 0x00, NULL),
8167 .num_ips = ctx->addresses_best_num,
8168 .ips = ctx->addresses_best,
8169 .apply_expected = true
8175 .type = WREPL_TYPE_UNIQUE,
8176 .state = WREPL_STATE_TOMBSTONE,
8177 .node = WREPL_NODE_B,
8179 .num_ips = ARRAY_SIZE(addresses_B_1),
8180 .ips = addresses_B_1,
8181 .apply_expected = false
8185 * multi homed vs. normal group section
8188 * mhomed,active vs. group,active with same ip(s), release expected
8191 .line = __location__,
8192 .name = _NBT_NAME("_MA_GA_SI_R", 0x00, NULL),
8196 .num_ips = ctx->addresses_best_num,
8197 .ips = ctx->addresses_best,
8198 .apply_expected = true
8202 .expect_release = true,
8205 .type = WREPL_TYPE_GROUP,
8206 .state = WREPL_STATE_ACTIVE,
8207 .node = WREPL_NODE_B,
8209 .num_ips = ctx->addresses_best_num,
8210 .ips = ctx->addresses_best,
8211 .apply_expected = true
8215 * mhomed,active vs. group,active with different ip(s), release expected
8218 .line = __location__,
8219 .name = _NBT_NAME("_MA_GA_DI_R", 0x00, NULL),
8223 .num_ips = ctx->addresses_best_num,
8224 .ips = ctx->addresses_best,
8225 .apply_expected = true
8229 .expect_release = true,
8232 .type = WREPL_TYPE_GROUP,
8233 .state = WREPL_STATE_ACTIVE,
8234 .node = WREPL_NODE_B,
8236 .num_ips = ARRAY_SIZE(addresses_B_1),
8237 .ips = addresses_B_1,
8238 .apply_expected = true
8242 * mhomed,active vs. group,tombstone with same ip(s), unchecked
8245 .line = __location__,
8246 .name = _NBT_NAME("_MA_GT_SI_U", 0x00, NULL),
8250 .num_ips = ctx->addresses_best_num,
8251 .ips = ctx->addresses_best,
8252 .apply_expected = true
8258 .type = WREPL_TYPE_GROUP,
8259 .state = WREPL_STATE_TOMBSTONE,
8260 .node = WREPL_NODE_B,
8262 .num_ips = ctx->addresses_best_num,
8263 .ips = ctx->addresses_best,
8264 .apply_expected = false
8268 * mhomed,active vs. group,tombstone with different ip(s), unchecked
8271 .line = __location__,
8272 .name = _NBT_NAME("_MA_GT_DI_U", 0x00, NULL),
8276 .num_ips = ctx->addresses_best_num,
8277 .ips = ctx->addresses_best,
8278 .apply_expected = true
8284 .type = WREPL_TYPE_GROUP,
8285 .state = WREPL_STATE_TOMBSTONE,
8286 .node = WREPL_NODE_B,
8288 .num_ips = ARRAY_SIZE(addresses_B_1),
8289 .ips = addresses_B_1,
8290 .apply_expected = false
8294 * multi homed vs. special group section
8297 * mhomed,active vs. sgroup,active with same ip(s), release expected
8300 .line = __location__,
8301 .name = _NBT_NAME("_MA_SA_SI_R", 0x00, NULL),
8305 .num_ips = ctx->addresses_best_num,
8306 .ips = ctx->addresses_best,
8307 .apply_expected = true
8311 .expect_release = true,
8314 .type = WREPL_TYPE_SGROUP,
8315 .state = WREPL_STATE_ACTIVE,
8316 .node = WREPL_NODE_B,
8318 .num_ips = ctx->addresses_best_num,
8319 .ips = ctx->addresses_best,
8320 .apply_expected = true
8324 * mhomed,active vs. group,active with different ip(s), release expected
8327 .line = __location__,
8328 .name = _NBT_NAME("_MA_SA_DI_R", 0x00, NULL),
8332 .num_ips = ctx->addresses_best_num,
8333 .ips = ctx->addresses_best,
8334 .apply_expected = true
8338 .expect_release = true,
8341 .type = WREPL_TYPE_SGROUP,
8342 .state = WREPL_STATE_ACTIVE,
8343 .node = WREPL_NODE_B,
8345 .num_ips = ARRAY_SIZE(addresses_B_1),
8346 .ips = addresses_B_1,
8347 .apply_expected = true
8351 * mhomed,active vs. sgroup,tombstone with same ip(s), unchecked
8354 .line = __location__,
8355 .name = _NBT_NAME("_MA_ST_SI_U", 0x00, NULL),
8359 .num_ips = ctx->addresses_best_num,
8360 .ips = ctx->addresses_best,
8361 .apply_expected = true
8367 .type = WREPL_TYPE_SGROUP,
8368 .state = WREPL_STATE_TOMBSTONE,
8369 .node = WREPL_NODE_B,
8371 .num_ips = ctx->addresses_best_num,
8372 .ips = ctx->addresses_best,
8373 .apply_expected = false
8377 * mhomed,active vs. sgroup,tombstone with different ip(s), unchecked
8380 .line = __location__,
8381 .name = _NBT_NAME("_MA_ST_DI_U", 0x00, NULL),
8385 .num_ips = ctx->addresses_best_num,
8386 .ips = ctx->addresses_best,
8387 .apply_expected = true
8393 .type = WREPL_TYPE_SGROUP,
8394 .state = WREPL_STATE_TOMBSTONE,
8395 .node = WREPL_NODE_B,
8397 .num_ips = ARRAY_SIZE(addresses_B_1),
8398 .ips = addresses_B_1,
8399 .apply_expected = false
8403 * multi homed vs. multi homed section
8406 * mhomed,active vs. mhomed,active with same ip(s), unchecked
8409 .line = __location__,
8410 .name = _NBT_NAME("_MA_MA_SI_U", 0x00, NULL),
8414 .num_ips = ctx->addresses_best_num,
8415 .ips = ctx->addresses_best,
8416 .apply_expected = true
8422 .type = WREPL_TYPE_MHOMED,
8423 .state = WREPL_STATE_ACTIVE,
8424 .node = WREPL_NODE_B,
8426 .num_ips = ctx->addresses_best_num,
8427 .ips = ctx->addresses_best,
8428 .apply_expected = true
8432 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8435 .line = __location__,
8436 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8440 .num_ips = ctx->addresses_best_num,
8441 .ips = ctx->addresses_best,
8442 .apply_expected = true
8448 .type = WREPL_TYPE_MHOMED,
8449 .state = WREPL_STATE_ACTIVE,
8450 .node = WREPL_NODE_B,
8452 .num_ips = ctx->addresses_all_num,
8453 .ips = ctx->addresses_all,
8454 .apply_expected = true
8458 * mhomed,active vs. mhomed,active with different ip(s), positive response
8461 .line = __location__,
8462 .name = _NBT_NAME("_MA_MA_DI_P", 0x00, NULL),
8466 .num_ips = ctx->addresses_best_num,
8467 .ips = ctx->addresses_best,
8468 .apply_expected = true
8475 .type = WREPL_TYPE_MHOMED,
8476 .state = WREPL_STATE_ACTIVE,
8477 .node = WREPL_NODE_B,
8479 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8480 .ips = addresses_B_3_4,
8481 .apply_expected = false
8485 * mhomed,active vs. mhomed,active with different ip(s), positive response other ips
8488 .line = __location__,
8489 .name = _NBT_NAME("_MA_MA_DI_O", 0x00, NULL),
8493 .num_ips = ctx->addresses_best_num,
8494 .ips = ctx->addresses_best,
8495 .apply_expected = true
8500 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8501 .ips = addresses_A_3_4,
8504 .type = WREPL_TYPE_MHOMED,
8505 .state = WREPL_STATE_ACTIVE,
8506 .node = WREPL_NODE_B,
8508 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8509 .ips = addresses_B_3_4,
8510 .apply_expected = false
8514 * mhomed,active vs. mhomed,active with different ip(s), negative response
8517 .line = __location__,
8518 .name = _NBT_NAME("_MA_MA_DI_N", 0x00, NULL),
8522 .num_ips = ctx->addresses_best_num,
8523 .ips = ctx->addresses_best,
8524 .apply_expected = true
8531 .type = WREPL_TYPE_MHOMED,
8532 .state = WREPL_STATE_ACTIVE,
8533 .node = WREPL_NODE_B,
8535 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8536 .ips = addresses_B_3_4,
8537 .apply_expected = true
8541 * mhomed,active vs. mhomed,tombstone with same ip(s), unchecked
8544 .line = __location__,
8545 .name = _NBT_NAME("_MA_MT_SI_U", 0x00, NULL),
8549 .num_ips = ctx->addresses_best_num,
8550 .ips = ctx->addresses_best,
8551 .apply_expected = true
8557 .type = WREPL_TYPE_MHOMED,
8558 .state = WREPL_STATE_TOMBSTONE,
8559 .node = WREPL_NODE_B,
8561 .num_ips = ctx->addresses_best_num,
8562 .ips = ctx->addresses_best,
8563 .apply_expected = false
8567 * mhomed,active vs. mhomed,tombstone with different ip(s), unchecked
8570 .line = __location__,
8571 .name = _NBT_NAME("_MA_MT_DI_U", 0x00, NULL),
8575 .num_ips = ctx->addresses_best_num,
8576 .ips = ctx->addresses_best,
8577 .apply_expected = true
8583 .type = WREPL_TYPE_MHOMED,
8584 .state = WREPL_STATE_TOMBSTONE,
8585 .node = WREPL_NODE_B,
8587 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8588 .ips = addresses_B_3_4,
8589 .apply_expected = false
8593 * some more multi homed test, including merging
8596 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8599 .line = __location__,
8600 .section= "Test Replica vs. owned active: some more MHOMED combinations",
8601 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8602 .comment= "C:MHOMED vs. B:ALL => B:ALL",
8603 .skip = (ctx->addresses_all_num < 3),
8607 .num_ips = ctx->addresses_mhomed_num,
8608 .ips = ctx->addresses_mhomed,
8609 .apply_expected = true
8615 .type = WREPL_TYPE_MHOMED,
8616 .state = WREPL_STATE_ACTIVE,
8617 .node = WREPL_NODE_B,
8619 .num_ips = ctx->addresses_all_num,
8620 .ips = ctx->addresses_all,
8621 .apply_expected = true
8625 * mhomed,active vs. mhomed,active with same ips, unchecked
8628 .line = __location__,
8629 .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL),
8630 .comment= "C:MHOMED vs. B:MHOMED => B:MHOMED",
8631 .skip = (ctx->addresses_mhomed_num < 2),
8635 .num_ips = ctx->addresses_mhomed_num,
8636 .ips = ctx->addresses_mhomed,
8637 .apply_expected = true
8643 .type = WREPL_TYPE_MHOMED,
8644 .state = WREPL_STATE_ACTIVE,
8645 .node = WREPL_NODE_B,
8647 .num_ips = ctx->addresses_mhomed_num,
8648 .ips = ctx->addresses_mhomed,
8649 .apply_expected = true
8653 * mhomed,active vs. mhomed,active with subset ip(s), positive response
8656 .line = __location__,
8657 .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL),
8658 .comment= "C:MHOMED vs. B:BEST (C:MHOMED) => B:MHOMED",
8659 .skip = (ctx->addresses_mhomed_num < 2),
8663 .num_ips = ctx->addresses_mhomed_num,
8664 .ips = ctx->addresses_mhomed,
8665 .apply_expected = true
8672 .type = WREPL_TYPE_MHOMED,
8673 .state = WREPL_STATE_ACTIVE,
8674 .node = WREPL_NODE_B,
8676 .num_ips = ctx->addresses_best_num,
8677 .ips = ctx->addresses_best,
8678 .mhomed_merge = true
8682 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with all addresses
8685 .line = __location__,
8686 .name = _NBT_NAME("_MA_MA_SB_A", 0x00, NULL),
8687 .comment= "C:MHOMED vs. B:BEST (C:ALL) => B:MHOMED",
8688 .skip = (ctx->addresses_all_num < 3),
8692 .num_ips = ctx->addresses_mhomed_num,
8693 .ips = ctx->addresses_mhomed,
8694 .apply_expected = true
8699 .num_ips = ctx->addresses_all_num,
8700 .ips = ctx->addresses_all,
8703 .type = WREPL_TYPE_MHOMED,
8704 .state = WREPL_STATE_ACTIVE,
8705 .node = WREPL_NODE_B,
8707 .num_ips = ctx->addresses_best_num,
8708 .ips = ctx->addresses_best,
8709 .mhomed_merge = true
8713 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with replicas addresses
8714 * TODO: check why the server sends a name release demand for one address?
8715 * the release demand has no effect to the database record...
8718 .line = __location__,
8719 .name = _NBT_NAME("_MA_MA_SB_PRA", 0x00, NULL),
8720 .comment= "C:MHOMED vs. B:BEST (C:BEST) => C:MHOMED",
8721 .skip = (ctx->addresses_all_num < 2),
8725 .num_ips = ctx->addresses_mhomed_num,
8726 .ips = ctx->addresses_mhomed,
8727 .apply_expected = true
8732 .num_ips = ctx->addresses_best_num,
8733 .ips = ctx->addresses_best,
8734 .late_release = true
8737 .type = WREPL_TYPE_MHOMED,
8738 .state = WREPL_STATE_ACTIVE,
8739 .node = WREPL_NODE_B,
8741 .num_ips = ctx->addresses_best_num,
8742 .ips = ctx->addresses_best,
8743 .apply_expected = false
8747 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with other addresses
8750 .line = __location__,
8751 .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL),
8752 .comment= "C:MHOMED vs. B:BEST (B:B_3_4) =>C:MHOMED",
8753 .skip = (ctx->addresses_all_num < 2),
8757 .num_ips = ctx->addresses_mhomed_num,
8758 .ips = ctx->addresses_mhomed,
8759 .apply_expected = true
8764 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8765 .ips = addresses_B_3_4,
8768 .type = WREPL_TYPE_MHOMED,
8769 .state = WREPL_STATE_ACTIVE,
8770 .node = WREPL_NODE_B,
8772 .num_ips = ctx->addresses_best_num,
8773 .ips = ctx->addresses_best,
8774 .apply_expected = false
8778 * mhomed,active vs. mhomed,active with subset ip(s), negative response
8781 .line = __location__,
8782 .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL),
8783 .comment= "C:MHOMED vs. B:BEST (NEGATIVE) => B:BEST",
8784 .skip = (ctx->addresses_mhomed_num < 2),
8788 .num_ips = ctx->addresses_mhomed_num,
8789 .ips = ctx->addresses_mhomed,
8790 .apply_expected = true
8797 .type = WREPL_TYPE_MHOMED,
8798 .state = WREPL_STATE_ACTIVE,
8799 .node = WREPL_NODE_B,
8801 .num_ips = ctx->addresses_best_num,
8802 .ips = ctx->addresses_best,
8803 .apply_expected = true
8807 * some more multi homed and unique test, including merging
8810 * mhomed,active vs. unique,active with subset ip(s), positive response
8813 .line = __location__,
8814 .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations",
8815 .name = _NBT_NAME("_MA_UA_SB_P", 0x00, NULL),
8816 .comment= "C:MHOMED vs. B:UNIQUE,BEST (C:MHOMED) => B:MHOMED",
8817 .skip = (ctx->addresses_all_num < 2),
8821 .num_ips = ctx->addresses_mhomed_num,
8822 .ips = ctx->addresses_mhomed,
8823 .apply_expected = true
8830 .type = WREPL_TYPE_UNIQUE,
8831 .state = WREPL_STATE_ACTIVE,
8832 .node = WREPL_NODE_B,
8834 .num_ips = ctx->addresses_best_num,
8835 .ips = ctx->addresses_best,
8836 .mhomed_merge = true
8840 * unique,active vs. unique,active with different ip(s), positive response, with replicas address
8841 * TODO: check why the server sends a name release demand for one address?
8842 * the release demand has no effect to the database record...
8845 .line = __location__,
8846 .name = _NBT_NAME("_UA_UA_DI_PRA", 0x00, NULL),
8847 .comment= "C:BEST vs. B:BEST2 (C:BEST2,LR:BEST2) => C:BEST",
8848 .skip = (ctx->addresses_all_num < 2),
8852 .num_ips = ctx->addresses_best_num,
8853 .ips = ctx->addresses_best,
8854 .apply_expected = true
8859 .num_ips = ctx->addresses_best2_num,
8860 .ips = ctx->addresses_best2,
8861 .late_release = true
8864 .type = WREPL_TYPE_UNIQUE,
8865 .state = WREPL_STATE_ACTIVE,
8866 .node = WREPL_NODE_B,
8868 .num_ips = ctx->addresses_best2_num,
8869 .ips = ctx->addresses_best2,
8870 .apply_expected = false,
8874 * unique,active vs. unique,active with different ip(s), positive response, with all addresses
8877 .line = __location__,
8878 .name = _NBT_NAME("_UA_UA_DI_A", 0x00, NULL),
8879 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
8880 .skip = (ctx->addresses_all_num < 3),
8884 .num_ips = ctx->addresses_best_num,
8885 .ips = ctx->addresses_best,
8886 .apply_expected = true
8891 .num_ips = ctx->addresses_all_num,
8892 .ips = ctx->addresses_all,
8895 .type = WREPL_TYPE_UNIQUE,
8896 .state = WREPL_STATE_ACTIVE,
8897 .node = WREPL_NODE_B,
8899 .num_ips = ctx->addresses_best2_num,
8900 .ips = ctx->addresses_best2,
8901 .mhomed_merge = true,
8905 * unique,active vs. mhomed,active with different ip(s), positive response, with all addresses
8908 .line = __location__,
8909 .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL),
8910 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
8911 .skip = (ctx->addresses_all_num < 3),
8915 .num_ips = ctx->addresses_best_num,
8916 .ips = ctx->addresses_best,
8917 .apply_expected = true
8922 .num_ips = ctx->addresses_all_num,
8923 .ips = ctx->addresses_all,
8926 .type = WREPL_TYPE_MHOMED,
8927 .state = WREPL_STATE_ACTIVE,
8928 .node = WREPL_NODE_B,
8930 .num_ips = ctx->addresses_best2_num,
8931 .ips = ctx->addresses_best2,
8932 .mhomed_merge = true,
8936 * special group vs. special group merging section
8939 * sgroup,active vs. sgroup,active with different ip(s)
8942 .line = __location__,
8943 .section= "Test Replica vs. owned active: SGROUP vs. SGROUP tests",
8944 .name = _NBT_NAME("_SA_SA_DI_U", 0x1C, NULL),
8945 .skip = (ctx->addresses_all_num < 3),
8947 .nb_flags = NBT_NM_GROUP,
8949 .num_ips = ctx->addresses_mhomed_num,
8950 .ips = ctx->addresses_mhomed,
8951 .apply_expected = true
8957 .type = WREPL_TYPE_SGROUP,
8958 .state = WREPL_STATE_ACTIVE,
8959 .node = WREPL_NODE_B,
8961 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8962 .ips = addresses_B_3_4,
8963 .sgroup_merge = true
8968 * sgroup,active vs. sgroup,active with same ip(s)
8971 .line = __location__,
8972 .name = _NBT_NAME("_SA_SA_SI_U", 0x1C, NULL),
8973 .skip = (ctx->addresses_all_num < 3),
8975 .nb_flags = NBT_NM_GROUP,
8977 .num_ips = ctx->addresses_mhomed_num,
8978 .ips = ctx->addresses_mhomed,
8979 .apply_expected = true
8985 .type = WREPL_TYPE_SGROUP,
8986 .state = WREPL_STATE_ACTIVE,
8987 .node = WREPL_NODE_B,
8989 .num_ips = ctx->addresses_mhomed_num,
8990 .ips = ctx->addresses_mhomed,
8991 .sgroup_merge = true
8995 * sgroup,active vs. sgroup,active with superset ip(s)
8998 .line = __location__,
8999 .name = _NBT_NAME("_SA_SA_SP_U", 0x1C, NULL),
9000 .skip = (ctx->addresses_all_num < 3),
9002 .nb_flags = NBT_NM_GROUP,
9004 .num_ips = ctx->addresses_mhomed_num,
9005 .ips = ctx->addresses_mhomed,
9006 .apply_expected = true
9012 .type = WREPL_TYPE_SGROUP,
9013 .state = WREPL_STATE_ACTIVE,
9014 .node = WREPL_NODE_B,
9016 .num_ips = ctx->addresses_all_num,
9017 .ips = ctx->addresses_all,
9018 .sgroup_merge = true
9022 * sgroup,active vs. sgroup,active with subset ip(s)
9025 .line = __location__,
9026 .name = _NBT_NAME("_SA_SA_SB_U", 0x1C, NULL),
9027 .skip = (ctx->addresses_all_num < 3),
9029 .nb_flags = NBT_NM_GROUP,
9031 .num_ips = ctx->addresses_mhomed_num,
9032 .ips = ctx->addresses_mhomed,
9033 .apply_expected = true
9039 .type = WREPL_TYPE_SGROUP,
9040 .state = WREPL_STATE_ACTIVE,
9041 .node = WREPL_NODE_B,
9043 .num_ips = ctx->addresses_best_num,
9044 .ips = ctx->addresses_best,
9045 .sgroup_merge = true
9049 * sgroup,active vs. sgroup,tombstone with different ip(s)
9052 .line = __location__,
9053 .name = _NBT_NAME("_SA_ST_DI_U", 0x1C, NULL),
9054 .skip = (ctx->addresses_all_num < 3),
9056 .nb_flags = NBT_NM_GROUP,
9058 .num_ips = ctx->addresses_mhomed_num,
9059 .ips = ctx->addresses_mhomed,
9060 .apply_expected = true
9066 .type = WREPL_TYPE_SGROUP,
9067 .state = WREPL_STATE_TOMBSTONE,
9068 .node = WREPL_NODE_B,
9070 .num_ips = ARRAY_SIZE(addresses_B_3_4),
9071 .ips = addresses_B_3_4,
9072 .apply_expected = false
9076 * sgroup,active vs. sgroup,tombstone with same ip(s)
9079 .line = __location__,
9080 .name = _NBT_NAME("_SA_ST_SI_U", 0x1C, NULL),
9081 .skip = (ctx->addresses_all_num < 3),
9083 .nb_flags = NBT_NM_GROUP,
9085 .num_ips = ctx->addresses_mhomed_num,
9086 .ips = ctx->addresses_mhomed,
9087 .apply_expected = true
9093 .type = WREPL_TYPE_SGROUP,
9094 .state = WREPL_STATE_TOMBSTONE,
9095 .node = WREPL_NODE_B,
9097 .num_ips = ctx->addresses_mhomed_num,
9098 .ips = ctx->addresses_mhomed,
9099 .apply_expected = false
9103 * sgroup,active vs. sgroup,tombstone with superset ip(s)
9106 .line = __location__,
9107 .name = _NBT_NAME("_SA_ST_SP_U", 0x1C, NULL),
9108 .skip = (ctx->addresses_all_num < 3),
9110 .nb_flags = NBT_NM_GROUP,
9112 .num_ips = ctx->addresses_mhomed_num,
9113 .ips = ctx->addresses_mhomed,
9114 .apply_expected = true
9120 .type = WREPL_TYPE_SGROUP,
9121 .state = WREPL_STATE_TOMBSTONE,
9122 .node = WREPL_NODE_B,
9124 .num_ips = ctx->addresses_all_num,
9125 .ips = ctx->addresses_all,
9126 .apply_expected = false
9130 * sgroup,active vs. sgroup,tombstone with subset ip(s)
9133 .line = __location__,
9134 .name = _NBT_NAME("_SA_ST_SB_U", 0x1C, NULL),
9135 .skip = (ctx->addresses_all_num < 3),
9137 .nb_flags = NBT_NM_GROUP,
9139 .num_ips = ctx->addresses_mhomed_num,
9140 .ips = ctx->addresses_mhomed,
9141 .apply_expected = true
9147 .type = WREPL_TYPE_SGROUP,
9148 .state = WREPL_STATE_TOMBSTONE,
9149 .node = WREPL_NODE_B,
9151 .num_ips = ctx->addresses_best_num,
9152 .ips = ctx->addresses_best,
9153 .apply_expected = false
9159 if (!ctx->nbtsock_srv) {
9160 torture_comment(tctx, "SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
9165 torture_comment(tctx, "Test Replica records vs. owned active records\n");
9167 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
9169 struct test_conflict_owned_active_vs_replica_struct record = records[i];
9170 uint32_t j, count = 1;
9173 if (records[i].wins.mhomed || records[i].name.type == 0x1C) {
9174 count = records[i].wins.num_ips;
9177 if (records[i].section) {
9178 torture_comment(tctx, "%s\n", records[i].section);
9181 if (records[i].skip) {
9182 torture_comment(tctx, "%s => SKIPPED\n", nbt_name_string(ctx, &records[i].name));
9186 if (records[i].replica.mhomed_merge) {
9187 action = "MHOMED_MERGE";
9188 } else if (records[i].replica.sgroup_merge) {
9189 action = "SGROUP_MERGE";
9190 } else if (records[i].replica.apply_expected) {
9193 action = "NOT REPLACE";
9196 torture_comment(tctx, "%s%s%s => %s\n",
9197 nbt_name_string(ctx, &records[i].name),
9198 (records[i].comment?": ":""),
9199 (records[i].comment?records[i].comment:""),
9202 /* Prepare for multi homed registration */
9203 ZERO_STRUCT(records[i].defend);
9204 records[i].defend.timeout = 10;
9205 records[i].defend.positive = true;
9206 nbt_set_incoming_handler(ctx->nbtsock_srv,
9207 test_conflict_owned_active_vs_replica_handler,
9209 if (ctx->nbtsock_srv2) {
9210 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9211 test_conflict_owned_active_vs_replica_handler,
9218 for (j=0; j < count; j++) {
9219 struct nbt_name_request *req;
9221 name_register->in.name = records[i].name;
9222 name_register->in.dest_addr = ctx->address;
9223 name_register->in.address = records[i].wins.ips[j].ip;
9224 name_register->in.nb_flags = records[i].wins.nb_flags;
9225 name_register->in.register_demand= false;
9226 name_register->in.broadcast = false;
9227 name_register->in.multi_homed = records[i].wins.mhomed;
9228 name_register->in.ttl = 300000;
9229 name_register->in.timeout = 70;
9230 name_register->in.retries = 0;
9232 req = nbt_name_register_send(ctx->nbtsock, name_register);
9234 /* push the request on the wire */
9235 event_loop_once(ctx->nbtsock->event_ctx);
9238 * if we register multiple addresses,
9239 * the server will do name queries to see if the old addresses
9242 if (records[i].wins.mhomed && j > 0) {
9243 end = timeval_current_ofs(records[i].defend.timeout,0);
9244 records[i].defend.ret = true;
9245 while (records[i].defend.timeout > 0) {
9246 event_loop_once(ctx->nbtsock_srv->event_ctx);
9247 if (timeval_expired(&end)) break;
9249 ret &= records[i].defend.ret;
9252 status = nbt_name_register_recv(req, ctx, name_register);
9253 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9254 torture_comment(tctx, "No response from %s for name register\n", ctx->address);
9257 if (!NT_STATUS_IS_OK(status)) {
9258 torture_comment(tctx, "Bad response from %s for name register - %s\n",
9259 ctx->address, nt_errstr(status));
9262 CHECK_VALUE(tctx, name_register->out.rcode, 0);
9263 CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address);
9264 CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type);
9265 CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name);
9266 CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope);
9267 CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[j].ip);
9270 /* Prepare for the current test */
9271 records[i].defend = record.defend;
9272 nbt_set_incoming_handler(ctx->nbtsock_srv,
9273 test_conflict_owned_active_vs_replica_handler,
9275 if (ctx->nbtsock_srv2) {
9276 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9277 test_conflict_owned_active_vs_replica_handler,
9284 wins_name->name = &records[i].name;
9285 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
9286 records[i].replica.state,
9287 records[i].replica.node,
9288 records[i].replica.is_static);
9289 wins_name->id = ++ctx->b.max_version;
9290 if (wins_name->flags & 2) {
9291 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
9292 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
9294 wins_name->addresses.ip = records[i].replica.ips[0].ip;
9296 wins_name->unknown = "255.255.255.255";
9298 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9301 * wait for the name query, which is handled in
9302 * test_conflict_owned_active_vs_replica_handler()
9304 end = timeval_current_ofs(records[i].defend.timeout,0);
9305 records[i].defend.ret = true;
9306 while (records[i].defend.timeout > 0) {
9307 event_loop_once(ctx->nbtsock_srv->event_ctx);
9308 if (timeval_expired(&end)) break;
9310 ret &= records[i].defend.ret;
9312 if (records[i].defend.late_release) {
9313 records[i].defend = record.defend;
9314 records[i].defend.expect_release = true;
9316 * wait for the name release demand, which is handled in
9317 * test_conflict_owned_active_vs_replica_handler()
9319 end = timeval_current_ofs(records[i].defend.timeout,0);
9320 records[i].defend.ret = true;
9321 while (records[i].defend.timeout > 0) {
9322 event_loop_once(ctx->nbtsock_srv->event_ctx);
9323 if (timeval_expired(&end)) break;
9325 ret &= records[i].defend.ret;
9328 if (records[i].replica.mhomed_merge) {
9329 ret &= test_wrepl_mhomed_merged(tctx, ctx, &ctx->c,
9330 records[i].wins.num_ips, records[i].wins.ips,
9332 records[i].replica.num_ips, records[i].replica.ips,
9334 } else if (records[i].replica.sgroup_merge) {
9335 ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL,
9337 records[i].wins.num_ips, records[i].wins.ips,
9339 records[i].replica.num_ips, records[i].replica.ips,
9342 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name,
9343 records[i].replica.apply_expected);
9346 if (records[i].replica.apply_expected ||
9347 records[i].replica.mhomed_merge) {
9348 wins_name->name = &records[i].name;
9349 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9350 WREPL_STATE_TOMBSTONE,
9351 WREPL_NODE_B, false);
9352 wins_name->id = ++ctx->b.max_version;
9353 wins_name->addresses.ip = addresses_B_1[0].ip;
9354 wins_name->unknown = "255.255.255.255";
9356 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9357 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9359 for (j=0; j < count; j++) {
9360 struct nbt_name_socket *nbtsock = ctx->nbtsock;
9362 if (ctx->myaddr2 && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2->addr) == 0) {
9363 nbtsock = ctx->nbtsock2;
9366 release->in.name = records[i].name;
9367 release->in.dest_addr = ctx->address;
9368 release->in.address = records[i].wins.ips[j].ip;
9369 release->in.nb_flags = records[i].wins.nb_flags;
9370 release->in.broadcast = false;
9371 release->in.timeout = 30;
9372 release->in.retries = 0;
9374 status = nbt_name_release(nbtsock, ctx, release);
9375 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9376 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
9379 if (!NT_STATUS_IS_OK(status)) {
9380 torture_comment(tctx, "Bad response from %s for name query - %s\n",
9381 ctx->address, nt_errstr(status));
9384 CHECK_VALUE(tctx, release->out.rcode, 0);
9387 if (records[i].replica.sgroup_merge) {
9388 /* clean up the SGROUP record */
9389 wins_name->name = &records[i].name;
9390 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9392 WREPL_NODE_B, false);
9393 wins_name->id = ++ctx->b.max_version;
9394 wins_name->addresses.addresses.num_ips = 0;
9395 wins_name->addresses.addresses.ips = NULL;
9396 wins_name->unknown = "255.255.255.255";
9397 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9399 /* take ownership of the SGROUP record */
9400 wins_name->name = &records[i].name;
9401 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9403 WREPL_NODE_B, false);
9404 wins_name->id = ++ctx->b.max_version;
9405 wins_name->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
9406 wins_name->addresses.addresses.ips = discard_const(addresses_B_1);
9407 wins_name->unknown = "255.255.255.255";
9408 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9409 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9411 /* overwrite the SGROUP record with unique,tombstone */
9412 wins_name->name = &records[i].name;
9413 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9414 WREPL_STATE_TOMBSTONE,
9415 WREPL_NODE_B, false);
9416 wins_name->id = ++ctx->b.max_version;
9417 wins_name->addresses.ip = addresses_A_1[0].ip;
9418 wins_name->unknown = "255.255.255.255";
9419 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9420 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9425 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
9433 #define _NBT_ASSERT(v, correct) do { \
9434 if ((v) != (correct)) { \
9435 printf("(%s) Incorrect value %s=%d - should be %s (%d)\n", \
9436 __location__, #v, v, #correct, correct); \
9441 #define _NBT_ASSERT_STRING(v, correct) do { \
9442 if ( ((!v) && (correct)) || \
9443 ((v) && (!correct)) || \
9444 ((v) && (correct) && strcmp(v,correct) != 0)) { \
9445 printf("(%s) Incorrect value %s=%s - should be %s\n", \
9446 __location__, #v, v, correct); \
9451 static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
9452 struct nbt_name_packet *req_packet,
9453 struct socket_address *src)
9455 struct nbt_name *name;
9456 struct nbt_name_packet *rep_packet;
9457 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9459 _NBT_ASSERT(req_packet->qdcount, 1);
9460 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9461 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9463 name = &req_packet->questions[0].name;
9465 _NBT_ASSERT(name->type, rec->name.type);
9466 _NBT_ASSERT_STRING(name->name, rec->name.name);
9467 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9469 _NBT_ASSERT(rec->defend.expect_release, false);
9471 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9472 if (rep_packet == NULL) return;
9474 rep_packet->name_trn_id = req_packet->name_trn_id;
9475 rep_packet->ancount = 1;
9477 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9478 if (rep_packet->answers == NULL) return;
9480 rep_packet->answers[0].name = *name;
9481 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9482 rep_packet->answers[0].ttl = 0;
9484 if (rec->defend.positive) {
9485 uint32_t i, num_ips;
9486 const struct wrepl_ip *ips;
9488 if (rec->defend.num_ips > 0) {
9489 num_ips = rec->defend.num_ips;
9490 ips = rec->defend.ips;
9492 num_ips = rec->wins.num_ips;
9493 ips = rec->wins.ips;
9496 /* send a positive reply */
9497 rep_packet->operation =
9500 NBT_FLAG_AUTHORITIVE |
9501 NBT_FLAG_RECURSION_DESIRED |
9502 NBT_FLAG_RECURSION_AVAIL;
9504 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9506 rep_packet->answers[0].rdata.netbios.length = num_ips*6;
9507 rep_packet->answers[0].rdata.netbios.addresses =
9508 talloc_array(rep_packet->answers, struct nbt_rdata_address, num_ips);
9509 if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return;
9511 for (i=0; i < num_ips; i++) {
9512 struct nbt_rdata_address *addr =
9513 &rep_packet->answers[0].rdata.netbios.addresses[i];
9514 addr->nb_flags = rec->wins.nb_flags;
9515 addr->ipaddr = ips[i].ip;
9517 DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
9518 nbt_name_string(rep_packet, name), src->addr, src->port));
9520 /* send a negative reply */
9521 rep_packet->operation =
9524 NBT_FLAG_AUTHORITIVE |
9527 rep_packet->answers[0].rr_type = NBT_QTYPE_NULL;
9529 ZERO_STRUCT(rep_packet->answers[0].rdata);
9531 DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
9532 nbt_name_string(rep_packet, name), src->addr, src->port));
9535 nbt_name_reply_send(nbtsock, src, rep_packet);
9536 talloc_free(rep_packet);
9538 /* make sure we push the reply to the wire */
9539 event_loop_once(nbtsock->event_ctx);
9542 rec->defend.timeout = 0;
9543 rec->defend.ret = true;
9546 static void test_conflict_owned_active_vs_replica_handler_release(
9547 struct nbt_name_socket *nbtsock,
9548 struct nbt_name_packet *req_packet,
9549 struct socket_address *src)
9551 struct nbt_name *name;
9552 struct nbt_name_packet *rep_packet;
9553 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9555 _NBT_ASSERT(req_packet->qdcount, 1);
9556 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9557 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9559 name = &req_packet->questions[0].name;
9561 _NBT_ASSERT(name->type, rec->name.type);
9562 _NBT_ASSERT_STRING(name->name, rec->name.name);
9563 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9565 _NBT_ASSERT(rec->defend.expect_release, true);
9567 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9568 if (rep_packet == NULL) return;
9570 rep_packet->name_trn_id = req_packet->name_trn_id;
9571 rep_packet->ancount = 1;
9572 rep_packet->operation =
9574 NBT_OPCODE_RELEASE |
9575 NBT_FLAG_AUTHORITIVE;
9577 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9578 if (rep_packet->answers == NULL) return;
9580 rep_packet->answers[0].name = *name;
9581 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9582 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9583 rep_packet->answers[0].ttl = req_packet->additional[0].ttl;
9584 rep_packet->answers[0].rdata = req_packet->additional[0].rdata;
9586 DEBUG(2,("Sending name release reply for %s to %s:%d\n",
9587 nbt_name_string(rep_packet, name), src->addr, src->port));
9589 nbt_name_reply_send(nbtsock, src, rep_packet);
9590 talloc_free(rep_packet);
9592 /* make sure we push the reply to the wire */
9593 event_loop_once(nbtsock->event_ctx);
9596 rec->defend.timeout = 0;
9597 rec->defend.ret = true;
9600 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
9601 struct nbt_name_packet *req_packet,
9602 struct socket_address *src)
9604 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9606 rec->defend.ret = false;
9608 switch (req_packet->operation & NBT_OPCODE) {
9609 case NBT_OPCODE_QUERY:
9610 test_conflict_owned_active_vs_replica_handler_query(nbtsock, req_packet, src);
9612 case NBT_OPCODE_RELEASE:
9613 test_conflict_owned_active_vs_replica_handler_release(nbtsock, req_packet, src);
9616 printf("%s: unexpected incoming packet\n", __location__);
9622 test WINS replication replica conflicts operations
9624 static bool torture_nbt_winsreplication_replica(struct torture_context *tctx)
9627 struct test_wrepl_conflict_conn *ctx;
9629 const char *address;
9630 struct nbt_name name;
9632 if (!torture_nbt_get_name(tctx, &name, &address))
9635 ctx = test_create_conflict_ctx(tctx, address);
9636 if (!ctx) return false;
9638 ret &= test_conflict_same_owner(tctx, ctx);
9639 ret &= test_conflict_different_owner(tctx, ctx);
9645 test WINS replication owned conflicts operations
9647 static bool torture_nbt_winsreplication_owned(struct torture_context *tctx)
9649 const char *address;
9650 struct nbt_name name;
9652 struct test_wrepl_conflict_conn *ctx;
9654 if (lp_parm_bool(-1, "torture", "quick", False)) {
9655 printf("skip NBT-WINSREPLICATION-OWNED test in quick test mode\n");
9659 if (!torture_nbt_get_name(tctx, &name, &address))
9662 ctx = test_create_conflict_ctx(tctx, address);
9663 torture_assert(tctx, ctx != NULL, "Creating context failed");
9665 ret &= test_conflict_owned_released_vs_replica(tctx, ctx);
9666 ret &= test_conflict_owned_active_vs_replica(tctx, ctx);
9672 test simple WINS replication operations
9674 struct torture_suite *torture_nbt_winsreplication(void)
9676 struct torture_suite *suite = torture_suite_create(
9677 talloc_autofree_context(),
9679 torture_suite_add_simple_test(suite, "assoc_ctx1",
9682 torture_suite_add_simple_test(suite, "assoc_ctx2",
9685 torture_suite_add_simple_test(suite, "wins_replication",
9686 test_wins_replication);
9688 torture_suite_add_simple_test(suite, "replica",
9689 torture_nbt_winsreplication_replica);
9691 torture_suite_add_simple_test(suite, "owned",
9692 torture_nbt_winsreplication_owned);