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 "system/network.h"
28 #include "lib/socket/netif.h"
29 #include "librpc/gen_ndr/ndr_nbt.h"
30 #include "libcli/nbt/libnbt.h"
31 #include "torture/torture.h"
32 #include "torture/nbt/proto.h"
33 #include "param/param.h"
35 #define CHECK_STATUS(tctx, status, correct) \
36 torture_assert_ntstatus_equal(tctx, status, correct, \
39 #define CHECK_VALUE(tctx, v, correct) \
40 torture_assert(tctx, (v) == (correct), \
41 talloc_asprintf(tctx, "Incorrect value %s=%d - should be %d\n", \
44 #define CHECK_VALUE_UINT64(tctx, v, correct) \
45 torture_assert(tctx, (v) == (correct), \
46 talloc_asprintf(tctx, "Incorrect value %s=%llu - should be %llu\n", \
47 #v, (long long)v, (long long)correct))
49 #define CHECK_VALUE_STRING(tctx, v, correct) \
50 torture_assert_str_equal(tctx, v, correct, "Invalid value")
52 #define _NBT_NAME(n,t,s) {\
58 static const char *wrepl_name_type_string(enum wrepl_name_type type)
61 case WREPL_TYPE_UNIQUE: return "UNIQUE";
62 case WREPL_TYPE_GROUP: return "GROUP";
63 case WREPL_TYPE_SGROUP: return "SGROUP";
64 case WREPL_TYPE_MHOMED: return "MHOMED";
66 return "UNKNOWN_TYPE";
69 static const char *wrepl_name_state_string(enum wrepl_name_state state)
72 case WREPL_STATE_ACTIVE: return "ACTIVE";
73 case WREPL_STATE_RELEASED: return "RELEASED";
74 case WREPL_STATE_TOMBSTONE: return "TOMBSTONE";
75 case WREPL_STATE_RESERVED: return "RESERVED";
77 return "UNKNOWN_STATE";
81 test how assoc_ctx's are only usable on the connection
84 static bool test_assoc_ctx1(struct torture_context *tctx)
87 struct tevent_req *subreq;
88 struct wrepl_socket *wrepl_socket1;
89 struct wrepl_associate associate1;
90 struct wrepl_socket *wrepl_socket2;
91 struct wrepl_associate associate2;
92 struct wrepl_packet packet;
93 struct wrepl_send_ctrl ctrl;
94 struct wrepl_packet *rep_packet;
95 struct wrepl_associate_stop assoc_stop;
101 if (!torture_nbt_get_name(tctx, &name, &address))
104 torture_comment(tctx, "Test if assoc_ctx is only valid on the connection it was created on\n");
106 wrepl_socket1 = wrepl_socket_init(tctx, tctx->ev);
107 wrepl_socket2 = wrepl_socket_init(tctx, tctx->ev);
109 torture_comment(tctx, "Setup 2 wrepl connections\n");
110 status = wrepl_connect(wrepl_socket1, wrepl_best_ip(tctx->lp_ctx, address), address);
111 CHECK_STATUS(tctx, status, NT_STATUS_OK);
113 status = wrepl_connect(wrepl_socket2, wrepl_best_ip(tctx->lp_ctx, address), address);
114 CHECK_STATUS(tctx, status, NT_STATUS_OK);
116 torture_comment(tctx, "Send a start association request (conn1)\n");
117 status = wrepl_associate(wrepl_socket1, &associate1);
118 CHECK_STATUS(tctx, status, NT_STATUS_OK);
120 torture_comment(tctx, "association context (conn1): 0x%x\n", associate1.out.assoc_ctx);
122 torture_comment(tctx, "Send a start association request (conn2)\n");
123 status = wrepl_associate(wrepl_socket2, &associate2);
124 CHECK_STATUS(tctx, status, NT_STATUS_OK);
126 torture_comment(tctx, "association context (conn2): 0x%x\n", associate2.out.assoc_ctx);
128 torture_comment(tctx, "Send a replication table query, with assoc 1 (conn2), the answer should be on conn1\n");
130 packet.opcode = WREPL_OPCODE_BITS;
131 packet.assoc_ctx = associate1.out.assoc_ctx;
132 packet.mess_type = WREPL_REPLICATION;
133 packet.message.replication.command = WREPL_REPL_TABLE_QUERY;
135 ctrl.send_only = true;
136 subreq = wrepl_request_send(tctx, tctx->ev, wrepl_socket2, &packet, &ctrl);
137 ok = tevent_req_poll(subreq, tctx->ev);
139 CHECK_STATUS(tctx, NT_STATUS_INTERNAL_ERROR, NT_STATUS_OK);
141 status = wrepl_request_recv(subreq, tctx, &rep_packet);
143 CHECK_STATUS(tctx, status, NT_STATUS_OK);
145 torture_comment(tctx, "Send a association request (conn2), to make sure the last request was ignored\n");
146 status = wrepl_associate(wrepl_socket2, &associate2);
147 CHECK_STATUS(tctx, status, NT_STATUS_OK);
149 torture_comment(tctx, "Send a replication table query, with invalid assoc (conn1), receive answer from conn2\n");
151 packet.opcode = WREPL_OPCODE_BITS;
152 packet.assoc_ctx = 0;
153 packet.mess_type = WREPL_REPLICATION;
154 packet.message.replication.command = WREPL_REPL_TABLE_QUERY;
155 status = wrepl_request(wrepl_socket1, tctx, &packet, &rep_packet);
156 CHECK_STATUS(tctx, status, NT_STATUS_OK);
158 torture_comment(tctx, "Send a association request (conn1), to make sure the last request was handled correct\n");
159 status = wrepl_associate(wrepl_socket1, &associate2);
160 CHECK_STATUS(tctx, status, NT_STATUS_OK);
162 assoc_stop.in.assoc_ctx = associate1.out.assoc_ctx;
163 assoc_stop.in.reason = 4;
164 torture_comment(tctx, "Send a association stop request (conn1), reson: %u\n", assoc_stop.in.reason);
165 status = wrepl_associate_stop(wrepl_socket1, &assoc_stop);
166 CHECK_STATUS(tctx, status, NT_STATUS_END_OF_FILE);
168 assoc_stop.in.assoc_ctx = associate2.out.assoc_ctx;
169 assoc_stop.in.reason = 0;
170 torture_comment(tctx, "Send a association stop request (conn2), reson: %u\n", assoc_stop.in.reason);
171 status = wrepl_associate_stop(wrepl_socket2, &assoc_stop);
172 CHECK_STATUS(tctx, status, NT_STATUS_OK);
174 torture_comment(tctx, "Close 2 wrepl connections\n");
175 talloc_free(wrepl_socket1);
176 talloc_free(wrepl_socket2);
181 test if we always get back the same assoc_ctx
183 static bool test_assoc_ctx2(struct torture_context *tctx)
185 struct wrepl_socket *wrepl_socket;
186 struct wrepl_associate associate;
188 struct nbt_name name;
192 if (!torture_nbt_get_name(tctx, &name, &address))
195 torture_comment(tctx, "Test if we always get back the same assoc_ctx\n");
197 wrepl_socket = wrepl_socket_init(tctx, tctx->ev);
199 torture_comment(tctx, "Setup wrepl connections\n");
200 status = wrepl_connect(wrepl_socket, wrepl_best_ip(tctx->lp_ctx, address), address);
201 CHECK_STATUS(tctx, status, NT_STATUS_OK);
203 torture_comment(tctx, "Send 1st start association request\n");
204 status = wrepl_associate(wrepl_socket, &associate);
205 CHECK_STATUS(tctx, status, NT_STATUS_OK);
206 assoc_ctx1 = associate.out.assoc_ctx;
207 torture_comment(tctx, "1st association context: 0x%x\n", associate.out.assoc_ctx);
209 torture_comment(tctx, "Send 2nd start association request\n");
210 status = wrepl_associate(wrepl_socket, &associate);
211 torture_assert_ntstatus_ok(tctx, status, "2nd start association failed");
212 torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1,
213 "Different context returned");
214 torture_comment(tctx, "2nd association context: 0x%x\n", associate.out.assoc_ctx);
216 torture_comment(tctx, "Send 3rd start association request\n");
217 status = wrepl_associate(wrepl_socket, &associate);
218 torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1,
219 "Different context returned");
220 CHECK_STATUS(tctx, status, NT_STATUS_OK);
221 torture_comment(tctx, "3rd association context: 0x%x\n", associate.out.assoc_ctx);
223 torture_comment(tctx, "Close wrepl connections\n");
224 talloc_free(wrepl_socket);
230 display a replication entry
232 static void display_entry(struct torture_context *tctx, struct wrepl_name *name)
236 torture_comment(tctx, "%s\n", nbt_name_string(tctx, &name->name));
237 torture_comment(tctx, "\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n",
238 name->type, name->state, name->node, name->is_static, (long long)name->version_id);
239 torture_comment(tctx, "\tRAW_FLAGS: 0x%08X OWNER: %-15s\n",
240 name->raw_flags, name->owner);
241 for (i=0;i<name->num_addresses;i++) {
242 torture_comment(tctx, "\tADDR: %-15s OWNER: %-15s\n",
243 name->addresses[i].address, name->addresses[i].owner);
248 test a full replication dump from a WINS server
250 static bool test_wins_replication(struct torture_context *tctx)
252 struct wrepl_socket *wrepl_socket;
255 struct wrepl_associate associate;
256 struct wrepl_pull_table pull_table;
257 struct wrepl_pull_names pull_names;
258 struct nbt_name name;
261 if (!torture_nbt_get_name(tctx, &name, &address))
264 torture_comment(tctx, "Test one pull replication cycle\n");
266 wrepl_socket = wrepl_socket_init(tctx, tctx->ev);
268 torture_comment(tctx, "Setup wrepl connections\n");
269 status = wrepl_connect(wrepl_socket, wrepl_best_ip(tctx->lp_ctx, address), address);
270 CHECK_STATUS(tctx, status, NT_STATUS_OK);
272 torture_comment(tctx, "Send a start association request\n");
274 status = wrepl_associate(wrepl_socket, &associate);
275 CHECK_STATUS(tctx, status, NT_STATUS_OK);
277 torture_comment(tctx, "association context: 0x%x\n", associate.out.assoc_ctx);
279 torture_comment(tctx, "Send a replication table query\n");
280 pull_table.in.assoc_ctx = associate.out.assoc_ctx;
282 status = wrepl_pull_table(wrepl_socket, tctx, &pull_table);
283 if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) {
284 struct wrepl_associate_stop assoc_stop;
286 assoc_stop.in.assoc_ctx = associate.out.assoc_ctx;
287 assoc_stop.in.reason = 0;
289 wrepl_associate_stop(wrepl_socket, &assoc_stop);
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"
471 static const struct wrepl_ip addresses_B_2[] = {
473 .owner = TEST_OWNER_B_ADDRESS,
474 .ip = TEST_ADDRESS_B_PREFIX".2"
478 static const struct wrepl_ip addresses_B_3_4[] = {
480 .owner = TEST_OWNER_B_ADDRESS,
481 .ip = TEST_ADDRESS_B_PREFIX".3"
484 .owner = TEST_OWNER_B_ADDRESS,
485 .ip = TEST_ADDRESS_B_PREFIX".4"
488 static const struct wrepl_ip addresses_B_3_4_X_3_4[] = {
490 .owner = TEST_OWNER_B_ADDRESS,
491 .ip = TEST_ADDRESS_B_PREFIX".3"
494 .owner = TEST_OWNER_B_ADDRESS,
495 .ip = TEST_ADDRESS_B_PREFIX".4"
498 .owner = TEST_OWNER_X_ADDRESS,
499 .ip = TEST_ADDRESS_X_PREFIX".3"
502 .owner = TEST_OWNER_X_ADDRESS,
503 .ip = TEST_ADDRESS_X_PREFIX".4"
506 static const struct wrepl_ip addresses_B_3_4_X_1_2[] = {
508 .owner = TEST_OWNER_B_ADDRESS,
509 .ip = TEST_ADDRESS_B_PREFIX".3"
512 .owner = TEST_OWNER_B_ADDRESS,
513 .ip = TEST_ADDRESS_B_PREFIX".4"
516 .owner = TEST_OWNER_X_ADDRESS,
517 .ip = TEST_ADDRESS_X_PREFIX".1"
520 .owner = TEST_OWNER_X_ADDRESS,
521 .ip = TEST_ADDRESS_X_PREFIX".2"
526 static const struct wrepl_ip addresses_X_1_2[] = {
528 .owner = TEST_OWNER_X_ADDRESS,
529 .ip = TEST_ADDRESS_X_PREFIX".1"
532 .owner = TEST_OWNER_X_ADDRESS,
533 .ip = TEST_ADDRESS_X_PREFIX".2"
538 static const struct wrepl_ip addresses_X_3_4[] = {
540 .owner = TEST_OWNER_X_ADDRESS,
541 .ip = TEST_ADDRESS_X_PREFIX".3"
544 .owner = TEST_OWNER_X_ADDRESS,
545 .ip = TEST_ADDRESS_X_PREFIX".4"
549 static struct test_wrepl_conflict_conn *test_create_conflict_ctx(
550 struct torture_context *tctx, const char *address)
552 struct test_wrepl_conflict_conn *ctx;
553 struct wrepl_associate associate;
554 struct wrepl_pull_table pull_table;
555 struct socket_address *nbt_srv_addr;
558 struct interface *ifaces;
560 ctx = talloc_zero(tctx, struct test_wrepl_conflict_conn);
561 if (!ctx) return NULL;
563 ctx->address = address;
564 ctx->pull = wrepl_socket_init(ctx, tctx->ev);
565 if (!ctx->pull) return NULL;
567 torture_comment(tctx, "Setup wrepl conflict pull connection\n");
568 status = wrepl_connect(ctx->pull, wrepl_best_ip(tctx->lp_ctx, ctx->address), ctx->address);
569 if (!NT_STATUS_IS_OK(status)) return NULL;
571 status = wrepl_associate(ctx->pull, &associate);
572 if (!NT_STATUS_IS_OK(status)) return NULL;
574 ctx->pull_assoc = associate.out.assoc_ctx;
576 ctx->a.address = TEST_OWNER_A_ADDRESS;
577 ctx->a.max_version = 0;
578 ctx->a.min_version = 0;
581 ctx->b.address = TEST_OWNER_B_ADDRESS;
582 ctx->b.max_version = 0;
583 ctx->b.min_version = 0;
586 ctx->x.address = TEST_OWNER_X_ADDRESS;
587 ctx->x.max_version = 0;
588 ctx->x.min_version = 0;
591 ctx->c.address = address;
592 ctx->c.max_version = 0;
593 ctx->c.min_version = 0;
596 pull_table.in.assoc_ctx = ctx->pull_assoc;
597 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
598 if (!NT_STATUS_IS_OK(status)) return NULL;
600 for (i=0; i < pull_table.out.num_partners; i++) {
601 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
602 ctx->a.max_version = pull_table.out.partners[i].max_version;
603 ctx->a.min_version = pull_table.out.partners[i].min_version;
605 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
606 ctx->b.max_version = pull_table.out.partners[i].max_version;
607 ctx->b.min_version = pull_table.out.partners[i].min_version;
609 if (strcmp(TEST_OWNER_X_ADDRESS,pull_table.out.partners[i].address)==0) {
610 ctx->x.max_version = pull_table.out.partners[i].max_version;
611 ctx->x.min_version = pull_table.out.partners[i].min_version;
613 if (strcmp(address,pull_table.out.partners[i].address)==0) {
614 ctx->c.max_version = pull_table.out.partners[i].max_version;
615 ctx->c.min_version = pull_table.out.partners[i].min_version;
619 talloc_free(pull_table.out.partners);
621 ctx->nbtsock = nbt_name_socket_init(ctx, tctx->ev);
622 if (!ctx->nbtsock) return NULL;
624 load_interface_list(tctx, tctx->lp_ctx, &ifaces);
626 ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_list_best_ip(ifaces, address), 0);
627 if (!ctx->myaddr) return NULL;
629 for (i = 0; i < iface_list_count(ifaces); i++) {
630 if (strcmp(ctx->myaddr->addr, iface_list_n_ip(ifaces, i)) == 0) continue;
631 ctx->myaddr2 = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_list_n_ip(ifaces, i), 0);
632 if (!ctx->myaddr2) return NULL;
636 status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0);
637 if (!NT_STATUS_IS_OK(status)) return NULL;
639 ctx->nbtsock_srv = nbt_name_socket_init(ctx, tctx->ev);
640 if (!ctx->nbtsock_srv) return NULL;
642 /* Make a port 137 version of ctx->myaddr */
643 nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lpcfg_nbt_port(tctx->lp_ctx));
644 if (!nbt_srv_addr) return NULL;
646 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
647 status = socket_listen(ctx->nbtsock_srv->sock, nbt_srv_addr, 0, 0);
648 talloc_free(nbt_srv_addr);
649 if (!NT_STATUS_IS_OK(status)) {
650 /* this isn't fatal */
651 talloc_free(ctx->nbtsock_srv);
652 ctx->nbtsock_srv = NULL;
655 if (ctx->myaddr2 && ctx->nbtsock_srv) {
656 ctx->nbtsock2 = nbt_name_socket_init(ctx, tctx->ev);
657 if (!ctx->nbtsock2) return NULL;
659 status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0);
660 if (!NT_STATUS_IS_OK(status)) return NULL;
662 ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx);
663 if (!ctx->nbtsock_srv2) return NULL;
665 /* Make a port 137 version of ctx->myaddr2 */
666 nbt_srv_addr = socket_address_from_strings(tctx,
667 ctx->nbtsock_srv->sock->backend_name,
669 lpcfg_nbt_port(tctx->lp_ctx));
670 if (!nbt_srv_addr) return NULL;
672 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
673 status = socket_listen(ctx->nbtsock_srv2->sock, ctx->myaddr2, 0, 0);
674 talloc_free(nbt_srv_addr);
675 if (!NT_STATUS_IS_OK(status)) {
676 /* this isn't fatal */
677 talloc_free(ctx->nbtsock_srv2);
678 ctx->nbtsock_srv2 = NULL;
682 ctx->addresses_best_num = 1;
683 ctx->addresses_best = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best_num);
684 if (!ctx->addresses_best) return NULL;
685 ctx->addresses_best[0].owner = ctx->b.address;
686 ctx->addresses_best[0].ip = ctx->myaddr->addr;
688 ctx->addresses_all_num = iface_list_count(ifaces);
689 ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num);
690 if (!ctx->addresses_all) return NULL;
691 for (i=0; i < ctx->addresses_all_num; i++) {
692 ctx->addresses_all[i].owner = ctx->b.address;
693 ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_list_n_ip(ifaces, i));
694 if (!ctx->addresses_all[i].ip) return NULL;
697 if (ctx->nbtsock_srv2) {
698 ctx->addresses_best2_num = 1;
699 ctx->addresses_best2 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best2_num);
700 if (!ctx->addresses_best2) return NULL;
701 ctx->addresses_best2[0].owner = ctx->b.address;
702 ctx->addresses_best2[0].ip = ctx->myaddr2->addr;
704 ctx->addresses_mhomed_num = 2;
705 ctx->addresses_mhomed = talloc_array(ctx, struct wrepl_ip, ctx->addresses_mhomed_num);
706 if (!ctx->addresses_mhomed) return NULL;
707 ctx->addresses_mhomed[0].owner = ctx->b.address;
708 ctx->addresses_mhomed[0].ip = ctx->myaddr->addr;
709 ctx->addresses_mhomed[1].owner = ctx->b.address;
710 ctx->addresses_mhomed[1].ip = ctx->myaddr2->addr;
716 static bool test_wrepl_update_one(struct torture_context *tctx,
717 struct test_wrepl_conflict_conn *ctx,
718 const struct wrepl_wins_owner *owner,
719 const struct wrepl_wins_name *name)
721 struct wrepl_socket *wrepl_socket;
722 struct wrepl_associate associate;
723 struct wrepl_packet update_packet, repl_send;
724 struct wrepl_table *update;
725 struct wrepl_wins_owner wrepl_wins_owners[1];
726 struct wrepl_packet *repl_recv;
727 struct wrepl_send_reply *send_reply;
728 struct wrepl_wins_name wrepl_wins_names[1];
732 wrepl_socket = wrepl_socket_init(ctx, tctx->ev);
734 status = wrepl_connect(wrepl_socket, wrepl_best_ip(tctx->lp_ctx, ctx->address), ctx->address);
735 CHECK_STATUS(tctx, status, NT_STATUS_OK);
737 status = wrepl_associate(wrepl_socket, &associate);
738 CHECK_STATUS(tctx, status, NT_STATUS_OK);
739 assoc_ctx = associate.out.assoc_ctx;
741 /* now send a WREPL_REPL_UPDATE message */
742 ZERO_STRUCT(update_packet);
743 update_packet.opcode = WREPL_OPCODE_BITS;
744 update_packet.assoc_ctx = assoc_ctx;
745 update_packet.mess_type = WREPL_REPLICATION;
746 update_packet.message.replication.command = WREPL_REPL_UPDATE;
747 update = &update_packet.message.replication.info.table;
749 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
750 update->partners = wrepl_wins_owners;
751 update->initiator = "0.0.0.0";
753 wrepl_wins_owners[0] = *owner;
755 status = wrepl_request(wrepl_socket, wrepl_socket,
756 &update_packet, &repl_recv);
757 CHECK_STATUS(tctx, status, NT_STATUS_OK);
758 CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_REPLICATION);
759 CHECK_VALUE(tctx, repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
761 ZERO_STRUCT(repl_send);
762 repl_send.opcode = WREPL_OPCODE_BITS;
763 repl_send.assoc_ctx = assoc_ctx;
764 repl_send.mess_type = WREPL_REPLICATION;
765 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
766 send_reply = &repl_send.message.replication.info.reply;
768 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
769 send_reply->names = wrepl_wins_names;
771 wrepl_wins_names[0] = *name;
773 status = wrepl_request(wrepl_socket, wrepl_socket,
774 &repl_send, &repl_recv);
775 CHECK_STATUS(tctx, status, NT_STATUS_OK);
776 CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
777 CHECK_VALUE(tctx, repl_recv->message.stop.reason, 0);
779 talloc_free(wrepl_socket);
783 static bool test_wrepl_is_applied(struct torture_context *tctx,
784 struct test_wrepl_conflict_conn *ctx,
785 const struct wrepl_wins_owner *owner,
786 const struct wrepl_wins_name *name,
790 struct wrepl_pull_names pull_names;
791 struct wrepl_name *names;
793 pull_names.in.assoc_ctx = ctx->pull_assoc;
794 pull_names.in.partner = *owner;
795 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
797 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
798 CHECK_STATUS(tctx, status, NT_STATUS_OK);
799 torture_assert(tctx, pull_names.out.num_names == (expected?1:0),
800 talloc_asprintf(tctx, "Invalid number of records returned - expected %d got %d", expected, pull_names.out.num_names));
802 names = pull_names.out.names;
805 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
809 char *expected_scope = NULL;
810 CHECK_VALUE(tctx, names[0].name.type, name->name->type);
811 CHECK_VALUE_STRING(tctx, names[0].name.name, name->name->name);
813 if (names[0].name.scope) {
814 expected_scope = talloc_strndup(tctx,
818 CHECK_VALUE_STRING(tctx, names[0].name.scope, expected_scope);
819 CHECK_VALUE(tctx, flags, name->flags);
820 CHECK_VALUE_UINT64(tctx, names[0].version_id, name->id);
823 CHECK_VALUE(tctx, names[0].num_addresses,
824 name->addresses.addresses.num_ips);
826 CHECK_VALUE(tctx, names[0].num_addresses, 1);
827 CHECK_VALUE_STRING(tctx, names[0].addresses[0].address,
831 talloc_free(pull_names.out.names);
835 static bool test_wrepl_mhomed_merged(struct torture_context *tctx,
836 struct test_wrepl_conflict_conn *ctx,
837 const struct wrepl_wins_owner *owner1,
838 uint32_t num_ips1, const struct wrepl_ip *ips1,
839 const struct wrepl_wins_owner *owner2,
840 uint32_t num_ips2, const struct wrepl_ip *ips2,
841 const struct wrepl_wins_name *name2)
844 struct wrepl_pull_names pull_names;
845 struct wrepl_name *names;
848 uint32_t num_ips = num_ips1 + num_ips2;
850 for (i = 0; i < num_ips2; i++) {
851 for (j = 0; j < num_ips1; j++) {
852 if (strcmp(ips2[i].ip,ips1[j].ip) == 0) {
859 pull_names.in.assoc_ctx = ctx->pull_assoc;
860 pull_names.in.partner = *owner2;
861 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
863 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
864 CHECK_STATUS(tctx, status, NT_STATUS_OK);
865 CHECK_VALUE(tctx, pull_names.out.num_names, 1);
867 names = pull_names.out.names;
869 flags = WREPL_NAME_FLAGS(names[0].type,
873 CHECK_VALUE(tctx, names[0].name.type, name2->name->type);
874 CHECK_VALUE_STRING(tctx, names[0].name.name, name2->name->name);
875 CHECK_VALUE_STRING(tctx, names[0].name.scope, name2->name->scope);
876 CHECK_VALUE(tctx, flags, name2->flags | WREPL_TYPE_MHOMED);
877 CHECK_VALUE_UINT64(tctx, names[0].version_id, name2->id);
879 CHECK_VALUE(tctx, names[0].num_addresses, num_ips);
881 for (i = 0; i < names[0].num_addresses; i++) {
882 const char *addr = names[0].addresses[i].address;
883 const char *owner = names[0].addresses[i].owner;
886 for (j = 0; j < num_ips2; j++) {
887 if (strcmp(addr, ips2[j].ip) == 0) {
889 CHECK_VALUE_STRING(tctx, owner, owner2->address);
896 for (j = 0; j < num_ips1; j++) {
897 if (strcmp(addr, ips1[j].ip) == 0) {
899 CHECK_VALUE_STRING(tctx, owner, owner1->address);
906 CHECK_VALUE_STRING(tctx, addr, "not found in address list");
908 talloc_free(pull_names.out.names);
912 static bool test_wrepl_sgroup_merged(struct torture_context *tctx,
913 struct test_wrepl_conflict_conn *ctx,
914 struct wrepl_wins_owner *merge_owner,
915 struct wrepl_wins_owner *owner1,
916 uint32_t num_ips1, const struct wrepl_ip *ips1,
917 struct wrepl_wins_owner *owner2,
918 uint32_t num_ips2, const struct wrepl_ip *ips2,
919 const struct wrepl_wins_name *name2)
922 struct wrepl_pull_names pull_names;
923 struct wrepl_name *names;
924 struct wrepl_name *name = NULL;
927 uint32_t num_ips = num_ips1 + num_ips2;
930 merge_owner = &ctx->c;
933 for (i = 0; i < num_ips1; i++) {
934 if (owner1 != &ctx->c && strcmp(ips1[i].owner,owner2->address) == 0) {
938 for (j = 0; j < num_ips2; j++) {
939 if (strcmp(ips1[i].ip,ips2[j].ip) == 0) {
947 pull_names.in.assoc_ctx = ctx->pull_assoc;
948 pull_names.in.partner = *merge_owner;
949 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
950 pull_names.in.partner.max_version = 0;
952 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
953 CHECK_STATUS(tctx, status, NT_STATUS_OK);
955 names = pull_names.out.names;
957 for (i = 0; i < pull_names.out.num_names; i++) {
958 if (names[i].name.type != name2->name->type) continue;
959 if (!names[i].name.name) continue;
960 if (strcmp(names[i].name.name, name2->name->name) != 0) continue;
961 if (names[i].name.scope) continue;
966 if (pull_names.out.num_names > 0) {
967 merge_owner->max_version = names[pull_names.out.num_names-1].version_id;
971 torture_comment(tctx, "%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name));
975 flags = WREPL_NAME_FLAGS(name->type,
979 CHECK_VALUE(tctx, name->name.type, name2->name->type);
980 CHECK_VALUE_STRING(tctx, name->name.name, name2->name->name);
981 CHECK_VALUE_STRING(tctx, name->name.scope, name2->name->scope);
982 CHECK_VALUE(tctx, flags, name2->flags);
984 CHECK_VALUE(tctx, name->num_addresses, num_ips);
986 for (i = 0; i < name->num_addresses; i++) {
987 const char *addr = name->addresses[i].address;
988 const char *owner = name->addresses[i].owner;
991 for (j = 0; j < num_ips2; j++) {
992 if (strcmp(addr, ips2[j].ip) == 0) {
994 CHECK_VALUE_STRING(tctx, owner, ips2[j].owner);
1001 for (j = 0; j < num_ips1; j++) {
1002 if (strcmp(addr, ips1[j].ip) == 0) {
1004 if (owner1 == &ctx->c) {
1005 CHECK_VALUE_STRING(tctx, owner, owner1->address);
1007 CHECK_VALUE_STRING(tctx, owner, ips1[j].owner);
1013 if (found) continue;
1015 CHECK_VALUE_STRING(tctx, addr, "not found in address list");
1017 talloc_free(pull_names.out.names);
1021 static char *test_nbt_winsrepl_scope_string(TALLOC_CTX *mem_ctx, uint8_t count)
1026 res = talloc_array(mem_ctx, char, count+1);
1031 for (i=0; i < count; i++) {
1032 res[i] = '0' + (i%10);
1037 talloc_set_name_const(res, res);
1042 static bool test_conflict_same_owner(struct torture_context *tctx,
1043 struct test_wrepl_conflict_conn *ctx)
1046 struct wrepl_wins_name wins_name1;
1047 struct wrepl_wins_name wins_name2;
1048 struct wrepl_wins_name *wins_name_tmp;
1049 struct wrepl_wins_name *wins_name_last;
1050 struct wrepl_wins_name *wins_name_cur;
1052 struct nbt_name names[] = {
1053 _NBT_NAME("_SAME_OWNER_A", 0x00, NULL),
1054 _NBT_NAME("_SAME_OWNER_A", 0x00,
1055 test_nbt_winsrepl_scope_string(tctx, 1)),
1056 _NBT_NAME("_SAME_OWNER_A", 0x00,
1057 test_nbt_winsrepl_scope_string(tctx, 2)),
1058 _NBT_NAME("_SAME_OWNER_A", 0x00,
1059 test_nbt_winsrepl_scope_string(tctx, 3)),
1060 _NBT_NAME("_SAME_OWNER_A", 0x00,
1061 test_nbt_winsrepl_scope_string(tctx, 4)),
1062 _NBT_NAME("_SAME_OWNER_A", 0x00,
1063 test_nbt_winsrepl_scope_string(tctx, 5)),
1064 _NBT_NAME("_SAME_OWNER_A", 0x00,
1065 test_nbt_winsrepl_scope_string(tctx, 6)),
1066 _NBT_NAME("_SAME_OWNER_A", 0x00,
1067 test_nbt_winsrepl_scope_string(tctx, 7)),
1068 _NBT_NAME("_SAME_OWNER_A", 0x00,
1069 test_nbt_winsrepl_scope_string(tctx, 8)),
1070 _NBT_NAME("_SAME_OWNER_A", 0x00,
1071 test_nbt_winsrepl_scope_string(tctx, 9)),
1072 _NBT_NAME("_SAME_OWNER_A", 0x00,
1073 test_nbt_winsrepl_scope_string(tctx, 237)),
1074 _NBT_NAME("_SAME_OWNER_A", 0x00,
1075 test_nbt_winsrepl_scope_string(tctx, 238)),
1076 _NBT_NAME("_SAME_OWNER_A", 0x1C, NULL),
1079 enum wrepl_name_type type;
1080 enum wrepl_name_state state;
1081 enum wrepl_name_node node;
1084 const struct wrepl_ip *ips;
1087 .type = WREPL_TYPE_GROUP,
1088 .state = WREPL_STATE_ACTIVE,
1089 .node = WREPL_NODE_B,
1091 .num_ips = ARRAY_SIZE(addresses_A_1),
1092 .ips = addresses_A_1,
1094 .type = WREPL_TYPE_UNIQUE,
1095 .state = WREPL_STATE_ACTIVE,
1096 .node = WREPL_NODE_B,
1098 .num_ips = ARRAY_SIZE(addresses_A_1),
1099 .ips = addresses_A_1,
1101 .type = WREPL_TYPE_UNIQUE,
1102 .state = WREPL_STATE_ACTIVE,
1103 .node = WREPL_NODE_B,
1105 .num_ips = ARRAY_SIZE(addresses_A_2),
1106 .ips = addresses_A_2,
1108 .type = WREPL_TYPE_UNIQUE,
1109 .state = WREPL_STATE_ACTIVE,
1110 .node = WREPL_NODE_B,
1112 .num_ips = ARRAY_SIZE(addresses_A_1),
1113 .ips = addresses_A_1,
1115 .type = WREPL_TYPE_UNIQUE,
1116 .state = WREPL_STATE_ACTIVE,
1117 .node = WREPL_NODE_B,
1119 .num_ips = ARRAY_SIZE(addresses_A_2),
1120 .ips = addresses_A_2,
1122 .type = WREPL_TYPE_SGROUP,
1123 .state = WREPL_STATE_TOMBSTONE,
1124 .node = WREPL_NODE_B,
1126 .num_ips = ARRAY_SIZE(addresses_A_2),
1127 .ips = addresses_A_2,
1129 .type = WREPL_TYPE_MHOMED,
1130 .state = WREPL_STATE_TOMBSTONE,
1131 .node = WREPL_NODE_B,
1133 .num_ips = ARRAY_SIZE(addresses_A_1),
1134 .ips = addresses_A_1,
1136 .type = WREPL_TYPE_MHOMED,
1137 .state = WREPL_STATE_RELEASED,
1138 .node = WREPL_NODE_B,
1140 .num_ips = ARRAY_SIZE(addresses_A_2),
1141 .ips = addresses_A_2,
1143 .type = WREPL_TYPE_SGROUP,
1144 .state = WREPL_STATE_ACTIVE,
1145 .node = WREPL_NODE_B,
1147 .num_ips = ARRAY_SIZE(addresses_A_1),
1148 .ips = addresses_A_1,
1150 .type = WREPL_TYPE_SGROUP,
1151 .state = WREPL_STATE_ACTIVE,
1152 .node = WREPL_NODE_B,
1154 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1155 .ips = addresses_A_3_4,
1157 .type = WREPL_TYPE_SGROUP,
1158 .state = WREPL_STATE_TOMBSTONE,
1159 .node = WREPL_NODE_B,
1161 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1162 .ips = addresses_B_3_4,
1164 /* the last one should always be a unique,tomstone record! */
1165 .type = WREPL_TYPE_UNIQUE,
1166 .state = WREPL_STATE_TOMBSTONE,
1167 .node = WREPL_NODE_B,
1169 .num_ips = ARRAY_SIZE(addresses_A_1),
1170 .ips = addresses_A_1,
1174 wins_name_tmp = NULL;
1175 wins_name_last = &wins_name2;
1176 wins_name_cur = &wins_name1;
1178 for (j=0; ret && j < ARRAY_SIZE(names); j++) {
1179 torture_comment(tctx, "Test Replica Conflicts with same owner[%s] for %s\n",
1180 nbt_name_string(ctx, &names[j]), ctx->a.address);
1182 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
1183 wins_name_tmp = wins_name_last;
1184 wins_name_last = wins_name_cur;
1185 wins_name_cur = wins_name_tmp;
1188 torture_comment(tctx, "%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
1189 wrepl_name_type_string(records[i-1].type),
1190 wrepl_name_state_string(records[i-1].state),
1191 (records[i-1].is_static?",static":""),
1192 wrepl_name_type_string(records[i].type),
1193 wrepl_name_state_string(records[i].state),
1194 (records[i].is_static?",static":""),
1195 (records[i-1].ips==records[i].ips?"same":"different"),
1199 wins_name_cur->name = &names[j];
1200 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
1203 records[i].is_static);
1204 wins_name_cur->id = ++ctx->a.max_version;
1205 if (wins_name_cur->flags & 2) {
1206 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
1207 wins_name_cur->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
1210 wins_name_cur->addresses.ip = records[i].ips[0].ip;
1212 wins_name_cur->unknown = "255.255.255.255";
1214 ret &= test_wrepl_update_one(tctx, ctx, &ctx->a,wins_name_cur);
1215 if (records[i].state == WREPL_STATE_RELEASED) {
1216 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_last, false);
1217 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, false);
1219 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, true);
1222 /* the first one is a cleanup run */
1223 if (!ret && i == 0) ret = true;
1226 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, __location__);
1234 static bool test_conflict_different_owner(struct torture_context *tctx,
1235 struct test_wrepl_conflict_conn *ctx)
1238 struct wrepl_wins_name wins_name1;
1239 struct wrepl_wins_name wins_name2;
1240 struct wrepl_wins_name *wins_name_r1;
1241 struct wrepl_wins_name *wins_name_r2;
1244 const char *line; /* just better debugging */
1245 struct nbt_name name;
1246 const char *comment;
1247 bool extra; /* not the worst case, this is an extra test */
1250 struct wrepl_wins_owner *owner;
1251 enum wrepl_name_type type;
1252 enum wrepl_name_state state;
1253 enum wrepl_name_node node;
1256 const struct wrepl_ip *ips;
1257 bool apply_expected;
1259 struct wrepl_wins_owner *merge_owner;
1260 bool sgroup_cleanup;
1264 * NOTE: the first record and the last applied one
1265 * needs to be from the same owner,
1266 * to not conflict in the next smbtorture run!!!
1269 .line = __location__,
1270 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1274 .type = WREPL_TYPE_UNIQUE,
1275 .state = WREPL_STATE_TOMBSTONE,
1276 .node = WREPL_NODE_B,
1278 .num_ips = ARRAY_SIZE(addresses_B_1),
1279 .ips = addresses_B_1,
1280 .apply_expected = true /* ignored */
1284 .type = WREPL_TYPE_UNIQUE,
1285 .state = WREPL_STATE_TOMBSTONE,
1286 .node = WREPL_NODE_B,
1288 .num_ips = ARRAY_SIZE(addresses_A_1),
1289 .ips = addresses_A_1,
1290 .apply_expected = true /* ignored */
1295 * unique vs unique section
1298 * unique,active vs. unique,active
1299 * => should be replaced
1302 .line = __location__,
1303 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1306 .type = WREPL_TYPE_UNIQUE,
1307 .state = WREPL_STATE_ACTIVE,
1308 .node = WREPL_NODE_B,
1310 .num_ips = ARRAY_SIZE(addresses_A_1),
1311 .ips = addresses_A_1,
1312 .apply_expected = true
1316 .type = WREPL_TYPE_UNIQUE,
1317 .state = WREPL_STATE_ACTIVE,
1318 .node = WREPL_NODE_B,
1320 .num_ips = ARRAY_SIZE(addresses_B_1),
1321 .ips = addresses_B_1,
1322 .apply_expected = true
1327 * unique,active vs. unique,tombstone
1328 * => should NOT be replaced
1331 .line = __location__,
1332 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1335 .type = WREPL_TYPE_UNIQUE,
1336 .state = WREPL_STATE_ACTIVE,
1337 .node = WREPL_NODE_B,
1339 .num_ips = ARRAY_SIZE(addresses_B_1),
1340 .ips = addresses_B_1,
1341 .apply_expected = true
1345 .type = WREPL_TYPE_UNIQUE,
1346 .state = WREPL_STATE_TOMBSTONE,
1347 .node = WREPL_NODE_B,
1349 .num_ips = ARRAY_SIZE(addresses_B_1),
1350 .ips = addresses_B_1,
1351 .apply_expected = false
1356 * unique,released vs. unique,active
1357 * => should be replaced
1360 .line = __location__,
1361 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1364 .type = WREPL_TYPE_UNIQUE,
1365 .state = WREPL_STATE_RELEASED,
1366 .node = WREPL_NODE_B,
1368 .num_ips = ARRAY_SIZE(addresses_B_1),
1369 .ips = addresses_B_1,
1370 .apply_expected = false
1374 .type = WREPL_TYPE_UNIQUE,
1375 .state = WREPL_STATE_ACTIVE,
1376 .node = WREPL_NODE_B,
1378 .num_ips = ARRAY_SIZE(addresses_A_1),
1379 .ips = addresses_A_1,
1380 .apply_expected = true
1385 * unique,released vs. unique,tombstone
1386 * => should be replaced
1389 .line = __location__,
1390 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1393 .type = WREPL_TYPE_UNIQUE,
1394 .state = WREPL_STATE_RELEASED,
1395 .node = WREPL_NODE_B,
1397 .num_ips = ARRAY_SIZE(addresses_A_1),
1398 .ips = addresses_A_1,
1399 .apply_expected = false
1403 .type = WREPL_TYPE_UNIQUE,
1404 .state = WREPL_STATE_TOMBSTONE,
1405 .node = WREPL_NODE_B,
1407 .num_ips = ARRAY_SIZE(addresses_B_1),
1408 .ips = addresses_B_1,
1409 .apply_expected = true
1414 * unique,tombstone vs. unique,active
1415 * => should be replaced
1418 .line = __location__,
1419 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1422 .type = WREPL_TYPE_UNIQUE,
1423 .state = WREPL_STATE_TOMBSTONE,
1424 .node = WREPL_NODE_B,
1426 .num_ips = ARRAY_SIZE(addresses_B_1),
1427 .ips = addresses_B_1,
1428 .apply_expected = true
1432 .type = WREPL_TYPE_UNIQUE,
1433 .state = WREPL_STATE_ACTIVE,
1434 .node = WREPL_NODE_B,
1436 .num_ips = ARRAY_SIZE(addresses_A_1),
1437 .ips = addresses_A_1,
1438 .apply_expected = true
1443 * unique,tombstone vs. unique,tombstone
1444 * => should be replaced
1447 .line = __location__,
1448 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1451 .type = WREPL_TYPE_UNIQUE,
1452 .state = WREPL_STATE_TOMBSTONE,
1453 .node = WREPL_NODE_B,
1455 .num_ips = ARRAY_SIZE(addresses_A_1),
1456 .ips = addresses_A_1,
1457 .apply_expected = true
1461 .type = WREPL_TYPE_UNIQUE,
1462 .state = WREPL_STATE_TOMBSTONE,
1463 .node = WREPL_NODE_B,
1465 .num_ips = ARRAY_SIZE(addresses_B_1),
1466 .ips = addresses_B_1,
1467 .apply_expected = true
1473 * unique vs normal groups section,
1476 * unique,active vs. group,active
1477 * => should be replaced
1480 .line = __location__,
1481 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1484 .type = WREPL_TYPE_UNIQUE,
1485 .state = WREPL_STATE_ACTIVE,
1486 .node = WREPL_NODE_B,
1488 .num_ips = ARRAY_SIZE(addresses_B_1),
1489 .ips = addresses_B_1,
1490 .apply_expected = true
1494 .type = WREPL_TYPE_GROUP,
1495 .state = WREPL_STATE_ACTIVE,
1496 .node = WREPL_NODE_B,
1498 .num_ips = ARRAY_SIZE(addresses_A_1),
1499 .ips = addresses_A_1,
1500 .apply_expected = true
1505 * unique,active vs. group,tombstone
1506 * => should NOT be replaced
1509 .line = __location__,
1510 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1513 .type = WREPL_TYPE_UNIQUE,
1514 .state = WREPL_STATE_ACTIVE,
1515 .node = WREPL_NODE_B,
1517 .num_ips = ARRAY_SIZE(addresses_A_1),
1518 .ips = addresses_A_1,
1519 .apply_expected = true
1523 .type = WREPL_TYPE_GROUP,
1524 .state = WREPL_STATE_TOMBSTONE,
1525 .node = WREPL_NODE_B,
1527 .num_ips = ARRAY_SIZE(addresses_A_1),
1528 .ips = addresses_A_1,
1529 .apply_expected = false
1534 * unique,released vs. group,active
1535 * => should be replaced
1538 .line = __location__,
1539 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1542 .type = WREPL_TYPE_UNIQUE,
1543 .state = WREPL_STATE_RELEASED,
1544 .node = WREPL_NODE_B,
1546 .num_ips = ARRAY_SIZE(addresses_A_1),
1547 .ips = addresses_A_1,
1548 .apply_expected = false
1552 .type = WREPL_TYPE_GROUP,
1553 .state = WREPL_STATE_ACTIVE,
1554 .node = WREPL_NODE_B,
1556 .num_ips = ARRAY_SIZE(addresses_B_1),
1557 .ips = addresses_B_1,
1558 .apply_expected = true
1563 * unique,released vs. group,tombstone
1564 * => should be replaced
1567 .line = __location__,
1568 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1571 .type = WREPL_TYPE_UNIQUE,
1572 .state = WREPL_STATE_RELEASED,
1573 .node = WREPL_NODE_B,
1575 .num_ips = ARRAY_SIZE(addresses_B_1),
1576 .ips = addresses_B_1,
1577 .apply_expected = false
1581 .type = WREPL_TYPE_GROUP,
1582 .state = WREPL_STATE_TOMBSTONE,
1583 .node = WREPL_NODE_B,
1585 .num_ips = ARRAY_SIZE(addresses_A_1),
1586 .ips = addresses_A_1,
1587 .apply_expected = true
1592 * unique,tombstone vs. group,active
1593 * => should be replaced
1596 .line = __location__,
1597 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1600 .type = WREPL_TYPE_UNIQUE,
1601 .state = WREPL_STATE_TOMBSTONE,
1602 .node = WREPL_NODE_B,
1604 .num_ips = ARRAY_SIZE(addresses_A_1),
1605 .ips = addresses_A_1,
1606 .apply_expected = true
1610 .type = WREPL_TYPE_GROUP,
1611 .state = WREPL_STATE_ACTIVE,
1612 .node = WREPL_NODE_B,
1614 .num_ips = ARRAY_SIZE(addresses_B_1),
1615 .ips = addresses_B_1,
1616 .apply_expected = true
1621 * unique,tombstone vs. group,tombstone
1622 * => should be replaced
1625 .line = __location__,
1626 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1629 .type = WREPL_TYPE_UNIQUE,
1630 .state = WREPL_STATE_TOMBSTONE,
1631 .node = WREPL_NODE_B,
1633 .num_ips = ARRAY_SIZE(addresses_B_1),
1634 .ips = addresses_B_1,
1635 .apply_expected = true
1639 .type = WREPL_TYPE_GROUP,
1640 .state = WREPL_STATE_TOMBSTONE,
1641 .node = WREPL_NODE_B,
1643 .num_ips = ARRAY_SIZE(addresses_A_1),
1644 .ips = addresses_A_1,
1645 .apply_expected = true
1650 * unique vs special groups section,
1653 * unique,active vs. sgroup,active
1654 * => should NOT be replaced
1657 .line = __location__,
1658 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1661 .type = WREPL_TYPE_UNIQUE,
1662 .state = WREPL_STATE_ACTIVE,
1663 .node = WREPL_NODE_B,
1665 .num_ips = ARRAY_SIZE(addresses_A_1),
1666 .ips = addresses_A_1,
1667 .apply_expected = true
1671 .type = WREPL_TYPE_SGROUP,
1672 .state = WREPL_STATE_ACTIVE,
1673 .node = WREPL_NODE_B,
1675 .num_ips = ARRAY_SIZE(addresses_A_1),
1676 .ips = addresses_A_1,
1677 .apply_expected = false
1682 * unique,active vs. sgroup,tombstone
1683 * => should NOT be replaced
1686 .line = __location__,
1687 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1690 .type = WREPL_TYPE_UNIQUE,
1691 .state = WREPL_STATE_ACTIVE,
1692 .node = WREPL_NODE_B,
1694 .num_ips = ARRAY_SIZE(addresses_A_1),
1695 .ips = addresses_A_1,
1696 .apply_expected = true
1700 .type = WREPL_TYPE_SGROUP,
1701 .state = WREPL_STATE_TOMBSTONE,
1702 .node = WREPL_NODE_B,
1704 .num_ips = ARRAY_SIZE(addresses_A_1),
1705 .ips = addresses_A_1,
1706 .apply_expected = false
1711 * unique,released vs. sgroup,active
1712 * => should be replaced
1715 .line = __location__,
1716 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1719 .type = WREPL_TYPE_UNIQUE,
1720 .state = WREPL_STATE_RELEASED,
1721 .node = WREPL_NODE_B,
1723 .num_ips = ARRAY_SIZE(addresses_A_1),
1724 .ips = addresses_A_1,
1725 .apply_expected = false
1729 .type = WREPL_TYPE_SGROUP,
1730 .state = WREPL_STATE_ACTIVE,
1731 .node = WREPL_NODE_B,
1733 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1734 .ips = addresses_B_3_4,
1735 .apply_expected = true
1740 * unique,released vs. sgroup,tombstone
1741 * => should be replaced
1744 .line = __location__,
1745 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1748 .type = WREPL_TYPE_UNIQUE,
1749 .state = WREPL_STATE_RELEASED,
1750 .node = WREPL_NODE_B,
1752 .num_ips = ARRAY_SIZE(addresses_B_1),
1753 .ips = addresses_B_1,
1754 .apply_expected = false
1758 .type = WREPL_TYPE_SGROUP,
1759 .state = WREPL_STATE_TOMBSTONE,
1760 .node = WREPL_NODE_B,
1762 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1763 .ips = addresses_A_3_4,
1764 .apply_expected = true
1769 * unique,tombstone vs. sgroup,active
1770 * => should be replaced
1773 .line = __location__,
1774 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1777 .type = WREPL_TYPE_UNIQUE,
1778 .state = WREPL_STATE_TOMBSTONE,
1779 .node = WREPL_NODE_B,
1781 .num_ips = ARRAY_SIZE(addresses_A_1),
1782 .ips = addresses_A_1,
1783 .apply_expected = true
1787 .type = WREPL_TYPE_SGROUP,
1788 .state = WREPL_STATE_ACTIVE,
1789 .node = WREPL_NODE_B,
1791 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1792 .ips = addresses_B_3_4,
1793 .apply_expected = true
1798 * unique,tombstone vs. sgroup,tombstone
1799 * => should be replaced
1802 .line = __location__,
1803 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1806 .type = WREPL_TYPE_UNIQUE,
1807 .state = WREPL_STATE_TOMBSTONE,
1808 .node = WREPL_NODE_B,
1810 .num_ips = ARRAY_SIZE(addresses_B_1),
1811 .ips = addresses_B_1,
1812 .apply_expected = true
1816 .type = WREPL_TYPE_SGROUP,
1817 .state = WREPL_STATE_TOMBSTONE,
1818 .node = WREPL_NODE_B,
1820 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1821 .ips = addresses_A_3_4,
1822 .apply_expected = true
1827 * unique vs multi homed section,
1830 * unique,active vs. mhomed,active
1831 * => should be replaced
1834 .line = __location__,
1835 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1838 .type = WREPL_TYPE_UNIQUE,
1839 .state = WREPL_STATE_ACTIVE,
1840 .node = WREPL_NODE_B,
1842 .num_ips = ARRAY_SIZE(addresses_A_1),
1843 .ips = addresses_A_1,
1844 .apply_expected = true
1848 .type = WREPL_TYPE_MHOMED,
1849 .state = WREPL_STATE_ACTIVE,
1850 .node = WREPL_NODE_B,
1852 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1853 .ips = addresses_B_3_4,
1854 .apply_expected = true
1859 * unique,active vs. mhomed,tombstone
1860 * => should NOT be replaced
1863 .line = __location__,
1864 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1867 .type = WREPL_TYPE_UNIQUE,
1868 .state = WREPL_STATE_ACTIVE,
1869 .node = WREPL_NODE_B,
1871 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1872 .ips = addresses_B_3_4,
1873 .apply_expected = true
1877 .type = WREPL_TYPE_MHOMED,
1878 .state = WREPL_STATE_TOMBSTONE,
1879 .node = WREPL_NODE_B,
1881 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1882 .ips = addresses_B_3_4,
1883 .apply_expected = false
1888 * unique,released vs. mhomed,active
1889 * => should be replaced
1892 .line = __location__,
1893 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1896 .type = WREPL_TYPE_UNIQUE,
1897 .state = WREPL_STATE_RELEASED,
1898 .node = WREPL_NODE_B,
1900 .num_ips = ARRAY_SIZE(addresses_B_1),
1901 .ips = addresses_B_1,
1902 .apply_expected = false
1906 .type = WREPL_TYPE_MHOMED,
1907 .state = WREPL_STATE_ACTIVE,
1908 .node = WREPL_NODE_B,
1910 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1911 .ips = addresses_A_3_4,
1912 .apply_expected = true
1917 * unique,released vs. mhomed,tombstone
1918 * => should be replaced
1921 .line = __location__,
1922 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1925 .type = WREPL_TYPE_UNIQUE,
1926 .state = WREPL_STATE_RELEASED,
1927 .node = WREPL_NODE_B,
1929 .num_ips = ARRAY_SIZE(addresses_A_1),
1930 .ips = addresses_A_1,
1931 .apply_expected = false
1935 .type = WREPL_TYPE_MHOMED,
1936 .state = WREPL_STATE_TOMBSTONE,
1937 .node = WREPL_NODE_B,
1939 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1940 .ips = addresses_B_3_4,
1941 .apply_expected = true
1946 * unique,tombstone vs. mhomed,active
1947 * => should be replaced
1950 .line = __location__,
1951 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1954 .type = WREPL_TYPE_UNIQUE,
1955 .state = WREPL_STATE_TOMBSTONE,
1956 .node = WREPL_NODE_B,
1958 .num_ips = ARRAY_SIZE(addresses_B_1),
1959 .ips = addresses_B_1,
1960 .apply_expected = true
1964 .type = WREPL_TYPE_MHOMED,
1965 .state = WREPL_STATE_ACTIVE,
1966 .node = WREPL_NODE_B,
1968 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1969 .ips = addresses_A_3_4,
1970 .apply_expected = true
1975 * unique,tombstone vs. mhomed,tombstone
1976 * => should be replaced
1979 .line = __location__,
1980 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1983 .type = WREPL_TYPE_UNIQUE,
1984 .state = WREPL_STATE_TOMBSTONE,
1985 .node = WREPL_NODE_B,
1987 .num_ips = ARRAY_SIZE(addresses_A_1),
1988 .ips = addresses_A_1,
1989 .apply_expected = true
1993 .type = WREPL_TYPE_MHOMED,
1994 .state = WREPL_STATE_TOMBSTONE,
1995 .node = WREPL_NODE_B,
1997 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1998 .ips = addresses_B_3_4,
1999 .apply_expected = true
2004 * normal groups vs unique section,
2007 * group,active vs. unique,active
2008 * => should NOT be replaced
2011 .line = __location__,
2012 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2015 .type = WREPL_TYPE_GROUP,
2016 .state = WREPL_STATE_ACTIVE,
2017 .node = WREPL_NODE_B,
2019 .num_ips = ARRAY_SIZE(addresses_A_1),
2020 .ips = addresses_A_1,
2021 .apply_expected = true
2025 .type = WREPL_TYPE_UNIQUE,
2026 .state = WREPL_STATE_ACTIVE,
2027 .node = WREPL_NODE_B,
2029 .num_ips = ARRAY_SIZE(addresses_A_1),
2030 .ips = addresses_A_1,
2031 .apply_expected = false
2036 * group,active vs. unique,tombstone
2037 * => should NOT be replaced
2040 .line = __location__,
2041 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2044 .type = WREPL_TYPE_GROUP,
2045 .state = WREPL_STATE_ACTIVE,
2046 .node = WREPL_NODE_B,
2048 .num_ips = ARRAY_SIZE(addresses_A_1),
2049 .ips = addresses_A_1,
2050 .apply_expected = true
2054 .type = WREPL_TYPE_UNIQUE,
2055 .state = WREPL_STATE_TOMBSTONE,
2056 .node = WREPL_NODE_B,
2058 .num_ips = ARRAY_SIZE(addresses_A_1),
2059 .ips = addresses_A_1,
2060 .apply_expected = false
2065 * group,released vs. unique,active
2066 * => should NOT be replaced
2069 .line = __location__,
2070 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2073 .type = WREPL_TYPE_GROUP,
2074 .state = WREPL_STATE_RELEASED,
2075 .node = WREPL_NODE_B,
2077 .num_ips = ARRAY_SIZE(addresses_A_1),
2078 .ips = addresses_A_1,
2079 .apply_expected = false
2083 .type = WREPL_TYPE_UNIQUE,
2084 .state = WREPL_STATE_ACTIVE,
2085 .node = WREPL_NODE_B,
2087 .num_ips = ARRAY_SIZE(addresses_A_1),
2088 .ips = addresses_A_1,
2089 .apply_expected = false
2094 * group,released vs. unique,tombstone
2095 * => should NOT be replaced
2098 .line = __location__,
2099 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2102 .type = WREPL_TYPE_GROUP,
2103 .state = WREPL_STATE_RELEASED,
2104 .node = WREPL_NODE_B,
2106 .num_ips = ARRAY_SIZE(addresses_A_1),
2107 .ips = addresses_A_1,
2108 .apply_expected = false
2112 .type = WREPL_TYPE_UNIQUE,
2113 .state = WREPL_STATE_TOMBSTONE,
2114 .node = WREPL_NODE_B,
2116 .num_ips = ARRAY_SIZE(addresses_A_1),
2117 .ips = addresses_A_1,
2118 .apply_expected = false
2123 * group,tombstone vs. unique,active
2124 * => should NOT be replaced
2127 .line = __location__,
2128 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2131 .type = WREPL_TYPE_GROUP,
2132 .state = WREPL_STATE_TOMBSTONE,
2133 .node = WREPL_NODE_B,
2135 .num_ips = ARRAY_SIZE(addresses_A_1),
2136 .ips = addresses_A_1,
2137 .apply_expected = true
2141 .type = WREPL_TYPE_UNIQUE,
2142 .state = WREPL_STATE_ACTIVE,
2143 .node = WREPL_NODE_B,
2145 .num_ips = ARRAY_SIZE(addresses_A_1),
2146 .ips = addresses_A_1,
2147 .apply_expected = false
2152 * group,tombstone vs. unique,tombstone
2153 * => should NOT be replaced
2156 .line = __location__,
2157 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2160 .type = WREPL_TYPE_GROUP,
2161 .state = WREPL_STATE_TOMBSTONE,
2162 .node = WREPL_NODE_B,
2164 .num_ips = ARRAY_SIZE(addresses_A_1),
2165 .ips = addresses_A_1,
2166 .apply_expected = true
2170 .type = WREPL_TYPE_UNIQUE,
2171 .state = WREPL_STATE_TOMBSTONE,
2172 .node = WREPL_NODE_B,
2174 .num_ips = ARRAY_SIZE(addresses_A_1),
2175 .ips = addresses_A_1,
2176 .apply_expected = false
2181 * normal groups vs normal groups section,
2184 * group,active vs. group,active
2185 * => should NOT be replaced
2188 .line = __location__,
2189 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2192 .type = WREPL_TYPE_GROUP,
2193 .state = WREPL_STATE_ACTIVE,
2194 .node = WREPL_NODE_B,
2196 .num_ips = ARRAY_SIZE(addresses_A_1),
2197 .ips = addresses_A_1,
2198 .apply_expected = true
2202 .type = WREPL_TYPE_GROUP,
2203 .state = WREPL_STATE_ACTIVE,
2204 .node = WREPL_NODE_B,
2206 .num_ips = ARRAY_SIZE(addresses_A_1),
2207 .ips = addresses_A_1,
2208 .apply_expected = false
2213 * group,active vs. group,tombstone
2214 * => should NOT be replaced
2217 .line = __location__,
2218 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2221 .type = WREPL_TYPE_GROUP,
2222 .state = WREPL_STATE_ACTIVE,
2223 .node = WREPL_NODE_B,
2225 .num_ips = ARRAY_SIZE(addresses_A_1),
2226 .ips = addresses_A_1,
2227 .apply_expected = true
2231 .type = WREPL_TYPE_GROUP,
2232 .state = WREPL_STATE_TOMBSTONE,
2233 .node = WREPL_NODE_B,
2235 .num_ips = ARRAY_SIZE(addresses_A_1),
2236 .ips = addresses_A_1,
2237 .apply_expected = false
2242 * group,released vs. group,active
2243 * => should be replaced
2246 .line = __location__,
2247 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2250 .type = WREPL_TYPE_GROUP,
2251 .state = WREPL_STATE_RELEASED,
2252 .node = WREPL_NODE_B,
2254 .num_ips = ARRAY_SIZE(addresses_A_1),
2255 .ips = addresses_A_1,
2256 .apply_expected = false
2260 .type = WREPL_TYPE_GROUP,
2261 .state = WREPL_STATE_ACTIVE,
2262 .node = WREPL_NODE_B,
2264 .num_ips = ARRAY_SIZE(addresses_B_1),
2265 .ips = addresses_B_1,
2266 .apply_expected = true
2271 * group,released vs. group,tombstone
2272 * => should be replaced
2275 .line = __location__,
2276 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2279 .type = WREPL_TYPE_GROUP,
2280 .state = WREPL_STATE_RELEASED,
2281 .node = WREPL_NODE_B,
2283 .num_ips = ARRAY_SIZE(addresses_A_1),
2284 .ips = addresses_A_1,
2285 .apply_expected = false
2289 .type = WREPL_TYPE_GROUP,
2290 .state = WREPL_STATE_TOMBSTONE,
2291 .node = WREPL_NODE_B,
2293 .num_ips = ARRAY_SIZE(addresses_B_1),
2294 .ips = addresses_B_1,
2295 .apply_expected = true
2300 * group,tombstone vs. group,active
2301 * => should be replaced
2304 .line = __location__,
2305 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2308 .type = WREPL_TYPE_GROUP,
2309 .state = WREPL_STATE_TOMBSTONE,
2310 .node = WREPL_NODE_B,
2312 .num_ips = ARRAY_SIZE(addresses_B_1),
2313 .ips = addresses_B_1,
2314 .apply_expected = true
2318 .type = WREPL_TYPE_GROUP,
2319 .state = WREPL_STATE_ACTIVE,
2320 .node = WREPL_NODE_B,
2322 .num_ips = ARRAY_SIZE(addresses_A_1),
2323 .ips = addresses_A_1,
2324 .apply_expected = true
2329 * group,tombstone vs. group,tombstone
2330 * => should be replaced
2333 .line = __location__,
2334 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2337 .type = WREPL_TYPE_GROUP,
2338 .state = WREPL_STATE_TOMBSTONE,
2339 .node = WREPL_NODE_B,
2341 .num_ips = ARRAY_SIZE(addresses_A_1),
2342 .ips = addresses_A_1,
2343 .apply_expected = true
2347 .type = WREPL_TYPE_GROUP,
2348 .state = WREPL_STATE_TOMBSTONE,
2349 .node = WREPL_NODE_B,
2351 .num_ips = ARRAY_SIZE(addresses_B_1),
2352 .ips = addresses_B_1,
2353 .apply_expected = true
2358 * normal groups vs special groups section,
2361 * group,active vs. sgroup,active
2362 * => should NOT be replaced
2365 .line = __location__,
2366 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2369 .type = WREPL_TYPE_GROUP,
2370 .state = WREPL_STATE_ACTIVE,
2371 .node = WREPL_NODE_B,
2373 .num_ips = ARRAY_SIZE(addresses_B_1),
2374 .ips = addresses_B_1,
2375 .apply_expected = true
2379 .type = WREPL_TYPE_SGROUP,
2380 .state = WREPL_STATE_ACTIVE,
2381 .node = WREPL_NODE_B,
2383 .num_ips = ARRAY_SIZE(addresses_B_1),
2384 .ips = addresses_B_1,
2385 .apply_expected = false
2390 * group,active vs. sgroup,tombstone
2391 * => should NOT be replaced
2394 .line = __location__,
2395 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2398 .type = WREPL_TYPE_GROUP,
2399 .state = WREPL_STATE_ACTIVE,
2400 .node = WREPL_NODE_B,
2402 .num_ips = ARRAY_SIZE(addresses_B_1),
2403 .ips = addresses_B_1,
2404 .apply_expected = true
2408 .type = WREPL_TYPE_SGROUP,
2409 .state = WREPL_STATE_TOMBSTONE,
2410 .node = WREPL_NODE_B,
2412 .num_ips = ARRAY_SIZE(addresses_B_1),
2413 .ips = addresses_B_1,
2414 .apply_expected = false
2419 * group,released vs. sgroup,active
2420 * => should be replaced
2423 .line = __location__,
2424 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2427 .type = WREPL_TYPE_GROUP,
2428 .state = WREPL_STATE_RELEASED,
2429 .node = WREPL_NODE_B,
2431 .num_ips = ARRAY_SIZE(addresses_A_1),
2432 .ips = addresses_A_1,
2433 .apply_expected = false
2437 .type = WREPL_TYPE_SGROUP,
2438 .state = WREPL_STATE_ACTIVE,
2439 .node = WREPL_NODE_B,
2441 .num_ips = ARRAY_SIZE(addresses_B_1),
2442 .ips = addresses_B_1,
2443 .apply_expected = true
2448 * group,released vs. sgroup,tombstone
2449 * => should NOT be replaced
2452 .line = __location__,
2453 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2456 .type = WREPL_TYPE_GROUP,
2457 .state = WREPL_STATE_RELEASED,
2458 .node = WREPL_NODE_B,
2460 .num_ips = ARRAY_SIZE(addresses_B_1),
2461 .ips = addresses_B_1,
2462 .apply_expected = false
2466 .type = WREPL_TYPE_SGROUP,
2467 .state = WREPL_STATE_TOMBSTONE,
2468 .node = WREPL_NODE_B,
2470 .num_ips = ARRAY_SIZE(addresses_B_1),
2471 .ips = addresses_B_1,
2472 .apply_expected = false
2477 * group,tombstone vs. sgroup,active
2478 * => should be replaced
2481 .line = __location__,
2482 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2485 .type = WREPL_TYPE_GROUP,
2486 .state = WREPL_STATE_TOMBSTONE,
2487 .node = WREPL_NODE_B,
2489 .num_ips = ARRAY_SIZE(addresses_B_1),
2490 .ips = addresses_B_1,
2491 .apply_expected = true
2495 .type = WREPL_TYPE_SGROUP,
2496 .state = WREPL_STATE_ACTIVE,
2497 .node = WREPL_NODE_B,
2499 .num_ips = ARRAY_SIZE(addresses_A_1),
2500 .ips = addresses_A_1,
2501 .apply_expected = true
2506 * group,tombstone vs. sgroup,tombstone
2507 * => should be replaced
2510 .line = __location__,
2511 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2514 .type = WREPL_TYPE_GROUP,
2515 .state = WREPL_STATE_TOMBSTONE,
2516 .node = WREPL_NODE_B,
2518 .num_ips = ARRAY_SIZE(addresses_A_1),
2519 .ips = addresses_A_1,
2520 .apply_expected = true
2524 .type = WREPL_TYPE_SGROUP,
2525 .state = WREPL_STATE_TOMBSTONE,
2526 .node = WREPL_NODE_B,
2528 .num_ips = ARRAY_SIZE(addresses_B_1),
2529 .ips = addresses_B_1,
2530 .apply_expected = true
2535 * normal groups vs multi homed section,
2538 * group,active vs. mhomed,active
2539 * => should NOT be replaced
2542 .line = __location__,
2543 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2546 .type = WREPL_TYPE_GROUP,
2547 .state = WREPL_STATE_ACTIVE,
2548 .node = WREPL_NODE_B,
2550 .num_ips = ARRAY_SIZE(addresses_B_1),
2551 .ips = addresses_B_1,
2552 .apply_expected = true
2556 .type = WREPL_TYPE_MHOMED,
2557 .state = WREPL_STATE_ACTIVE,
2558 .node = WREPL_NODE_B,
2560 .num_ips = ARRAY_SIZE(addresses_B_1),
2561 .ips = addresses_B_1,
2562 .apply_expected = false
2567 * group,active vs. mhomed,tombstone
2568 * => should NOT be replaced
2571 .line = __location__,
2572 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2575 .type = WREPL_TYPE_GROUP,
2576 .state = WREPL_STATE_ACTIVE,
2577 .node = WREPL_NODE_B,
2579 .num_ips = ARRAY_SIZE(addresses_B_1),
2580 .ips = addresses_B_1,
2581 .apply_expected = true
2585 .type = WREPL_TYPE_MHOMED,
2586 .state = WREPL_STATE_TOMBSTONE,
2587 .node = WREPL_NODE_B,
2589 .num_ips = ARRAY_SIZE(addresses_B_1),
2590 .ips = addresses_B_1,
2591 .apply_expected = false
2596 * group,released vs. mhomed,active
2597 * => should NOT be replaced
2600 .line = __location__,
2601 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2604 .type = WREPL_TYPE_GROUP,
2605 .state = WREPL_STATE_RELEASED,
2606 .node = WREPL_NODE_B,
2608 .num_ips = ARRAY_SIZE(addresses_B_1),
2609 .ips = addresses_B_1,
2610 .apply_expected = false
2614 .type = WREPL_TYPE_MHOMED,
2615 .state = WREPL_STATE_ACTIVE,
2616 .node = WREPL_NODE_B,
2618 .num_ips = ARRAY_SIZE(addresses_B_1),
2619 .ips = addresses_B_1,
2620 .apply_expected = false
2625 * group,released vs. mhomed,tombstone
2626 * => should NOT be replaced
2629 .line = __location__,
2630 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2633 .type = WREPL_TYPE_GROUP,
2634 .state = WREPL_STATE_RELEASED,
2635 .node = WREPL_NODE_B,
2637 .num_ips = ARRAY_SIZE(addresses_B_1),
2638 .ips = addresses_B_1,
2639 .apply_expected = false
2643 .type = WREPL_TYPE_MHOMED,
2644 .state = WREPL_STATE_TOMBSTONE,
2645 .node = WREPL_NODE_B,
2647 .num_ips = ARRAY_SIZE(addresses_B_1),
2648 .ips = addresses_B_1,
2649 .apply_expected = false
2654 * group,tombstone vs. mhomed,active
2655 * => should be replaced
2658 .line = __location__,
2659 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2662 .type = WREPL_TYPE_GROUP,
2663 .state = WREPL_STATE_TOMBSTONE,
2664 .node = WREPL_NODE_B,
2666 .num_ips = ARRAY_SIZE(addresses_B_1),
2667 .ips = addresses_B_1,
2668 .apply_expected = true
2672 .type = WREPL_TYPE_MHOMED,
2673 .state = WREPL_STATE_ACTIVE,
2674 .node = WREPL_NODE_B,
2676 .num_ips = ARRAY_SIZE(addresses_A_1),
2677 .ips = addresses_A_1,
2678 .apply_expected = true
2683 * group,tombstone vs. mhomed,tombstone
2684 * => should be replaced
2687 .line = __location__,
2688 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2691 .type = WREPL_TYPE_GROUP,
2692 .state = WREPL_STATE_TOMBSTONE,
2693 .node = WREPL_NODE_B,
2695 .num_ips = ARRAY_SIZE(addresses_A_1),
2696 .ips = addresses_A_1,
2697 .apply_expected = true
2701 .type = WREPL_TYPE_MHOMED,
2702 .state = WREPL_STATE_TOMBSTONE,
2703 .node = WREPL_NODE_B,
2705 .num_ips = ARRAY_SIZE(addresses_B_1),
2706 .ips = addresses_B_1,
2707 .apply_expected = true
2712 * special groups vs unique section,
2715 * sgroup,active vs. unique,active
2716 * => should NOT be replaced
2719 .line = __location__,
2720 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2723 .type = WREPL_TYPE_SGROUP,
2724 .state = WREPL_STATE_ACTIVE,
2725 .node = WREPL_NODE_B,
2727 .num_ips = ARRAY_SIZE(addresses_B_1),
2728 .ips = addresses_B_1,
2729 .apply_expected = true
2733 .type = WREPL_TYPE_UNIQUE,
2734 .state = WREPL_STATE_ACTIVE,
2735 .node = WREPL_NODE_B,
2737 .num_ips = ARRAY_SIZE(addresses_B_1),
2738 .ips = addresses_B_1,
2739 .apply_expected = false
2744 * sgroup,active vs. unique,tombstone
2745 * => should NOT be replaced
2748 .line = __location__,
2749 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2752 .type = WREPL_TYPE_SGROUP,
2753 .state = WREPL_STATE_ACTIVE,
2754 .node = WREPL_NODE_B,
2756 .num_ips = ARRAY_SIZE(addresses_B_1),
2757 .ips = addresses_B_1,
2758 .apply_expected = true
2762 .type = WREPL_TYPE_UNIQUE,
2763 .state = WREPL_STATE_TOMBSTONE,
2764 .node = WREPL_NODE_B,
2766 .num_ips = ARRAY_SIZE(addresses_B_1),
2767 .ips = addresses_B_1,
2768 .apply_expected = false
2773 * sgroup,released vs. unique,active
2774 * => should be replaced
2777 .line = __location__,
2778 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2781 .type = WREPL_TYPE_SGROUP,
2782 .state = WREPL_STATE_RELEASED,
2783 .node = WREPL_NODE_B,
2785 .num_ips = ARRAY_SIZE(addresses_B_1),
2786 .ips = addresses_B_1,
2787 .apply_expected = false
2791 .type = WREPL_TYPE_UNIQUE,
2792 .state = WREPL_STATE_ACTIVE,
2793 .node = WREPL_NODE_B,
2795 .num_ips = ARRAY_SIZE(addresses_A_1),
2796 .ips = addresses_A_1,
2797 .apply_expected = true
2802 * sgroup,released vs. unique,tombstone
2803 * => should be replaced
2806 .line = __location__,
2807 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2810 .type = WREPL_TYPE_SGROUP,
2811 .state = WREPL_STATE_RELEASED,
2812 .node = WREPL_NODE_B,
2814 .num_ips = ARRAY_SIZE(addresses_A_1),
2815 .ips = addresses_A_1,
2816 .apply_expected = false
2820 .type = WREPL_TYPE_UNIQUE,
2821 .state = WREPL_STATE_TOMBSTONE,
2822 .node = WREPL_NODE_B,
2824 .num_ips = ARRAY_SIZE(addresses_B_1),
2825 .ips = addresses_B_1,
2826 .apply_expected = true
2831 * sgroup,tombstone vs. unique,active
2832 * => should be replaced
2835 .line = __location__,
2836 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2839 .type = WREPL_TYPE_SGROUP,
2840 .state = WREPL_STATE_TOMBSTONE,
2841 .node = WREPL_NODE_B,
2843 .num_ips = ARRAY_SIZE(addresses_A_1),
2844 .ips = addresses_A_1,
2845 .apply_expected = true
2849 .type = WREPL_TYPE_UNIQUE,
2850 .state = WREPL_STATE_ACTIVE,
2851 .node = WREPL_NODE_B,
2853 .num_ips = ARRAY_SIZE(addresses_B_1),
2854 .ips = addresses_B_1,
2855 .apply_expected = true
2860 * sgroup,tombstone vs. unique,tombstone
2861 * => should be replaced
2864 .line = __location__,
2865 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2868 .type = WREPL_TYPE_SGROUP,
2869 .state = WREPL_STATE_TOMBSTONE,
2870 .node = WREPL_NODE_B,
2872 .num_ips = ARRAY_SIZE(addresses_B_1),
2873 .ips = addresses_B_1,
2874 .apply_expected = true
2878 .type = WREPL_TYPE_UNIQUE,
2879 .state = WREPL_STATE_TOMBSTONE,
2880 .node = WREPL_NODE_B,
2882 .num_ips = ARRAY_SIZE(addresses_A_1),
2883 .ips = addresses_A_1,
2884 .apply_expected = true
2889 * special groups vs normal group section,
2892 * sgroup,active vs. group,active
2893 * => should NOT be replaced
2896 .line = __location__,
2897 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2900 .type = WREPL_TYPE_SGROUP,
2901 .state = WREPL_STATE_ACTIVE,
2902 .node = WREPL_NODE_B,
2904 .num_ips = ARRAY_SIZE(addresses_A_1),
2905 .ips = addresses_A_1,
2906 .apply_expected = true
2910 .type = WREPL_TYPE_GROUP,
2911 .state = WREPL_STATE_ACTIVE,
2912 .node = WREPL_NODE_B,
2914 .num_ips = ARRAY_SIZE(addresses_A_1),
2915 .ips = addresses_A_1,
2916 .apply_expected = false
2921 * sgroup,active vs. group,tombstone
2922 * => should NOT be replaced
2925 .line = __location__,
2926 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2929 .type = WREPL_TYPE_SGROUP,
2930 .state = WREPL_STATE_ACTIVE,
2931 .node = WREPL_NODE_B,
2933 .num_ips = ARRAY_SIZE(addresses_A_1),
2934 .ips = addresses_A_1,
2935 .apply_expected = true
2939 .type = WREPL_TYPE_GROUP,
2940 .state = WREPL_STATE_TOMBSTONE,
2941 .node = WREPL_NODE_B,
2943 .num_ips = ARRAY_SIZE(addresses_A_1),
2944 .ips = addresses_A_1,
2945 .apply_expected = false
2950 * sgroup,released vs. group,active
2951 * => should be replaced
2954 .line = __location__,
2955 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2958 .type = WREPL_TYPE_SGROUP,
2959 .state = WREPL_STATE_RELEASED,
2960 .node = WREPL_NODE_B,
2962 .num_ips = ARRAY_SIZE(addresses_A_1),
2963 .ips = addresses_A_1,
2964 .apply_expected = false
2968 .type = WREPL_TYPE_GROUP,
2969 .state = WREPL_STATE_ACTIVE,
2970 .node = WREPL_NODE_B,
2972 .num_ips = ARRAY_SIZE(addresses_B_1),
2973 .ips = addresses_B_1,
2974 .apply_expected = true
2979 * sgroup,released vs. group,tombstone
2980 * => should be replaced
2983 .line = __location__,
2984 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2987 .type = WREPL_TYPE_SGROUP,
2988 .state = WREPL_STATE_RELEASED,
2989 .node = WREPL_NODE_B,
2991 .num_ips = ARRAY_SIZE(addresses_B_1),
2992 .ips = addresses_B_1,
2993 .apply_expected = false
2997 .type = WREPL_TYPE_GROUP,
2998 .state = WREPL_STATE_TOMBSTONE,
2999 .node = WREPL_NODE_B,
3001 .num_ips = ARRAY_SIZE(addresses_A_1),
3002 .ips = addresses_A_1,
3003 .apply_expected = true
3008 * sgroup,tombstone vs. group,active
3009 * => should NOT be replaced
3012 .line = __location__,
3013 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3016 .type = WREPL_TYPE_SGROUP,
3017 .state = WREPL_STATE_TOMBSTONE,
3018 .node = WREPL_NODE_B,
3020 .num_ips = ARRAY_SIZE(addresses_A_1),
3021 .ips = addresses_A_1,
3022 .apply_expected = true
3026 .type = WREPL_TYPE_GROUP,
3027 .state = WREPL_STATE_ACTIVE,
3028 .node = WREPL_NODE_B,
3030 .num_ips = ARRAY_SIZE(addresses_B_1),
3031 .ips = addresses_B_1,
3032 .apply_expected = true
3037 * sgroup,tombstone vs. group,tombstone
3038 * => should NOT be replaced
3041 .line = __location__,
3042 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3045 .type = WREPL_TYPE_SGROUP,
3046 .state = WREPL_STATE_TOMBSTONE,
3047 .node = WREPL_NODE_B,
3049 .num_ips = ARRAY_SIZE(addresses_B_1),
3050 .ips = addresses_B_1,
3051 .apply_expected = true
3055 .type = WREPL_TYPE_GROUP,
3056 .state = WREPL_STATE_TOMBSTONE,
3057 .node = WREPL_NODE_B,
3059 .num_ips = ARRAY_SIZE(addresses_A_1),
3060 .ips = addresses_A_1,
3061 .apply_expected = true
3066 * special groups (not active) vs special group section,
3069 * sgroup,released vs. sgroup,active
3070 * => should be replaced
3073 .line = __location__,
3074 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3077 .type = WREPL_TYPE_SGROUP,
3078 .state = WREPL_STATE_RELEASED,
3079 .node = WREPL_NODE_B,
3081 .num_ips = ARRAY_SIZE(addresses_A_1),
3082 .ips = addresses_A_1,
3083 .apply_expected = false
3087 .type = WREPL_TYPE_SGROUP,
3088 .state = WREPL_STATE_ACTIVE,
3089 .node = WREPL_NODE_B,
3091 .num_ips = ARRAY_SIZE(addresses_B_1),
3092 .ips = addresses_B_1,
3093 .apply_expected = true
3098 * sgroup,released vs. sgroup,tombstone
3099 * => should be replaced
3102 .line = __location__,
3103 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3106 .type = WREPL_TYPE_SGROUP,
3107 .state = WREPL_STATE_RELEASED,
3108 .node = WREPL_NODE_B,
3110 .num_ips = ARRAY_SIZE(addresses_B_1),
3111 .ips = addresses_B_1,
3112 .apply_expected = false
3116 .type = WREPL_TYPE_SGROUP,
3117 .state = WREPL_STATE_TOMBSTONE,
3118 .node = WREPL_NODE_B,
3120 .num_ips = ARRAY_SIZE(addresses_A_1),
3121 .ips = addresses_A_1,
3122 .apply_expected = true
3127 * sgroup,tombstone vs. sgroup,active
3128 * => should NOT be replaced
3131 .line = __location__,
3132 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3135 .type = WREPL_TYPE_SGROUP,
3136 .state = WREPL_STATE_TOMBSTONE,
3137 .node = WREPL_NODE_B,
3139 .num_ips = ARRAY_SIZE(addresses_A_1),
3140 .ips = addresses_A_1,
3141 .apply_expected = true
3145 .type = WREPL_TYPE_SGROUP,
3146 .state = WREPL_STATE_ACTIVE,
3147 .node = WREPL_NODE_B,
3149 .num_ips = ARRAY_SIZE(addresses_B_1),
3150 .ips = addresses_B_1,
3151 .apply_expected = true
3156 * sgroup,tombstone vs. sgroup,tombstone
3157 * => should NOT be replaced
3160 .line = __location__,
3161 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3164 .type = WREPL_TYPE_SGROUP,
3165 .state = WREPL_STATE_TOMBSTONE,
3166 .node = WREPL_NODE_B,
3168 .num_ips = ARRAY_SIZE(addresses_B_1),
3169 .ips = addresses_B_1,
3170 .apply_expected = true
3174 .type = WREPL_TYPE_SGROUP,
3175 .state = WREPL_STATE_TOMBSTONE,
3176 .node = WREPL_NODE_B,
3178 .num_ips = ARRAY_SIZE(addresses_A_1),
3179 .ips = addresses_A_1,
3180 .apply_expected = true
3185 * special groups vs multi homed section,
3188 * sgroup,active vs. mhomed,active
3189 * => should NOT be replaced
3192 .line = __location__,
3193 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3196 .type = WREPL_TYPE_SGROUP,
3197 .state = WREPL_STATE_ACTIVE,
3198 .node = WREPL_NODE_B,
3200 .num_ips = ARRAY_SIZE(addresses_A_1),
3201 .ips = addresses_A_1,
3202 .apply_expected = true
3206 .type = WREPL_TYPE_MHOMED,
3207 .state = WREPL_STATE_ACTIVE,
3208 .node = WREPL_NODE_B,
3210 .num_ips = ARRAY_SIZE(addresses_A_1),
3211 .ips = addresses_A_1,
3212 .apply_expected = false
3217 * sgroup,active vs. mhomed,tombstone
3218 * => should NOT be replaced
3221 .line = __location__,
3222 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3225 .type = WREPL_TYPE_SGROUP,
3226 .state = WREPL_STATE_ACTIVE,
3227 .node = WREPL_NODE_B,
3229 .num_ips = ARRAY_SIZE(addresses_A_1),
3230 .ips = addresses_A_1,
3231 .apply_expected = true
3235 .type = WREPL_TYPE_MHOMED,
3236 .state = WREPL_STATE_TOMBSTONE,
3237 .node = WREPL_NODE_B,
3239 .num_ips = ARRAY_SIZE(addresses_A_1),
3240 .ips = addresses_A_1,
3241 .apply_expected = false
3246 * sgroup,released vs. mhomed,active
3247 * => should be replaced
3250 .line = __location__,
3251 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3254 .type = WREPL_TYPE_SGROUP,
3255 .state = WREPL_STATE_RELEASED,
3256 .node = WREPL_NODE_B,
3258 .num_ips = ARRAY_SIZE(addresses_A_1),
3259 .ips = addresses_A_1,
3260 .apply_expected = false
3264 .type = WREPL_TYPE_MHOMED,
3265 .state = WREPL_STATE_ACTIVE,
3266 .node = WREPL_NODE_B,
3268 .num_ips = ARRAY_SIZE(addresses_B_1),
3269 .ips = addresses_B_1,
3270 .apply_expected = true
3275 * sgroup,released vs. mhomed,tombstone
3276 * => should be replaced
3279 .line = __location__,
3280 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3283 .type = WREPL_TYPE_SGROUP,
3284 .state = WREPL_STATE_RELEASED,
3285 .node = WREPL_NODE_B,
3287 .num_ips = ARRAY_SIZE(addresses_B_1),
3288 .ips = addresses_B_1,
3289 .apply_expected = false
3293 .type = WREPL_TYPE_MHOMED,
3294 .state = WREPL_STATE_TOMBSTONE,
3295 .node = WREPL_NODE_B,
3297 .num_ips = ARRAY_SIZE(addresses_A_1),
3298 .ips = addresses_A_1,
3299 .apply_expected = true
3304 * sgroup,tombstone vs. mhomed,active
3305 * => should be replaced
3308 .line = __location__,
3309 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3312 .type = WREPL_TYPE_SGROUP,
3313 .state = WREPL_STATE_TOMBSTONE,
3314 .node = WREPL_NODE_B,
3316 .num_ips = ARRAY_SIZE(addresses_A_1),
3317 .ips = addresses_A_1,
3318 .apply_expected = true
3322 .type = WREPL_TYPE_MHOMED,
3323 .state = WREPL_STATE_ACTIVE,
3324 .node = WREPL_NODE_B,
3326 .num_ips = ARRAY_SIZE(addresses_B_1),
3327 .ips = addresses_B_1,
3328 .apply_expected = true
3333 * sgroup,tombstone vs. mhomed,tombstone
3334 * => should be replaced
3337 .line = __location__,
3338 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3341 .type = WREPL_TYPE_SGROUP,
3342 .state = WREPL_STATE_TOMBSTONE,
3343 .node = WREPL_NODE_B,
3345 .num_ips = ARRAY_SIZE(addresses_B_1),
3346 .ips = addresses_B_1,
3347 .apply_expected = true
3351 .type = WREPL_TYPE_MHOMED,
3352 .state = WREPL_STATE_TOMBSTONE,
3353 .node = WREPL_NODE_B,
3355 .num_ips = ARRAY_SIZE(addresses_A_1),
3356 .ips = addresses_A_1,
3357 .apply_expected = true
3362 * multi homed vs. unique section,
3365 * mhomed,active vs. unique,active
3366 * => should be replaced
3369 .line = __location__,
3370 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3373 .type = WREPL_TYPE_MHOMED,
3374 .state = WREPL_STATE_ACTIVE,
3375 .node = WREPL_NODE_B,
3377 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3378 .ips = addresses_A_3_4,
3379 .apply_expected = true
3383 .type = WREPL_TYPE_UNIQUE,
3384 .state = WREPL_STATE_ACTIVE,
3385 .node = WREPL_NODE_B,
3387 .num_ips = ARRAY_SIZE(addresses_B_1),
3388 .ips = addresses_B_1,
3389 .apply_expected = true
3394 * mhomed,active vs. unique,tombstone
3395 * => should NOT be replaced
3398 .line = __location__,
3399 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3402 .type = WREPL_TYPE_MHOMED,
3403 .state = WREPL_STATE_ACTIVE,
3404 .node = WREPL_NODE_B,
3406 .num_ips = ARRAY_SIZE(addresses_B_1),
3407 .ips = addresses_B_1,
3408 .apply_expected = true
3412 .type = WREPL_TYPE_UNIQUE,
3413 .state = WREPL_STATE_TOMBSTONE,
3414 .node = WREPL_NODE_B,
3416 .num_ips = ARRAY_SIZE(addresses_B_1),
3417 .ips = addresses_B_1,
3418 .apply_expected = false
3423 * mhomed,released vs. unique,active
3424 * => should be replaced
3427 .line = __location__,
3428 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3431 .type = WREPL_TYPE_MHOMED,
3432 .state = WREPL_STATE_RELEASED,
3433 .node = WREPL_NODE_B,
3435 .num_ips = ARRAY_SIZE(addresses_A_1),
3436 .ips = addresses_A_1,
3437 .apply_expected = false
3441 .type = WREPL_TYPE_UNIQUE,
3442 .state = WREPL_STATE_ACTIVE,
3443 .node = WREPL_NODE_B,
3445 .num_ips = ARRAY_SIZE(addresses_B_1),
3446 .ips = addresses_B_1,
3447 .apply_expected = true
3452 * mhomed,released vs. uinique,tombstone
3453 * => should be replaced
3456 .line = __location__,
3457 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3460 .type = WREPL_TYPE_MHOMED,
3461 .state = WREPL_STATE_RELEASED,
3462 .node = WREPL_NODE_B,
3464 .num_ips = ARRAY_SIZE(addresses_B_1),
3465 .ips = addresses_B_1,
3466 .apply_expected = false
3470 .type = WREPL_TYPE_UNIQUE,
3471 .state = WREPL_STATE_TOMBSTONE,
3472 .node = WREPL_NODE_B,
3474 .num_ips = ARRAY_SIZE(addresses_A_1),
3475 .ips = addresses_A_1,
3476 .apply_expected = true
3481 * mhomed,tombstone vs. unique,active
3482 * => should be replaced
3485 .line = __location__,
3486 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3489 .type = WREPL_TYPE_MHOMED,
3490 .state = WREPL_STATE_TOMBSTONE,
3491 .node = WREPL_NODE_B,
3493 .num_ips = ARRAY_SIZE(addresses_A_1),
3494 .ips = addresses_A_1,
3495 .apply_expected = true
3499 .type = WREPL_TYPE_UNIQUE,
3500 .state = WREPL_STATE_ACTIVE,
3501 .node = WREPL_NODE_B,
3503 .num_ips = ARRAY_SIZE(addresses_B_1),
3504 .ips = addresses_B_1,
3505 .apply_expected = true
3510 * mhomed,tombstone vs. uinique,tombstone
3511 * => should be replaced
3514 .line = __location__,
3515 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3518 .type = WREPL_TYPE_MHOMED,
3519 .state = WREPL_STATE_TOMBSTONE,
3520 .node = WREPL_NODE_B,
3522 .num_ips = ARRAY_SIZE(addresses_B_1),
3523 .ips = addresses_B_1,
3524 .apply_expected = true
3528 .type = WREPL_TYPE_UNIQUE,
3529 .state = WREPL_STATE_TOMBSTONE,
3530 .node = WREPL_NODE_B,
3532 .num_ips = ARRAY_SIZE(addresses_A_1),
3533 .ips = addresses_A_1,
3534 .apply_expected = true
3539 * multi homed vs. normal group section,
3542 * mhomed,active vs. group,active
3543 * => should be replaced
3546 .line = __location__,
3547 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3550 .type = WREPL_TYPE_MHOMED,
3551 .state = WREPL_STATE_ACTIVE,
3552 .node = WREPL_NODE_B,
3554 .num_ips = ARRAY_SIZE(addresses_A_1),
3555 .ips = addresses_A_1,
3556 .apply_expected = true
3560 .type = WREPL_TYPE_GROUP,
3561 .state = WREPL_STATE_ACTIVE,
3562 .node = WREPL_NODE_B,
3564 .num_ips = ARRAY_SIZE(addresses_B_1),
3565 .ips = addresses_B_1,
3566 .apply_expected = true
3571 * mhomed,active vs. group,tombstone
3572 * => should NOT be replaced
3575 .line = __location__,
3576 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3579 .type = WREPL_TYPE_MHOMED,
3580 .state = WREPL_STATE_ACTIVE,
3581 .node = WREPL_NODE_B,
3583 .num_ips = ARRAY_SIZE(addresses_B_1),
3584 .ips = addresses_B_1,
3585 .apply_expected = true
3589 .type = WREPL_TYPE_GROUP,
3590 .state = WREPL_STATE_TOMBSTONE,
3591 .node = WREPL_NODE_B,
3593 .num_ips = ARRAY_SIZE(addresses_B_1),
3594 .ips = addresses_B_1,
3595 .apply_expected = false
3600 * mhomed,released vs. group,active
3601 * => should be replaced
3604 .line = __location__,
3605 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3608 .type = WREPL_TYPE_MHOMED,
3609 .state = WREPL_STATE_RELEASED,
3610 .node = WREPL_NODE_B,
3612 .num_ips = ARRAY_SIZE(addresses_B_1),
3613 .ips = addresses_B_1,
3614 .apply_expected = false
3618 .type = WREPL_TYPE_GROUP,
3619 .state = WREPL_STATE_ACTIVE,
3620 .node = WREPL_NODE_B,
3622 .num_ips = ARRAY_SIZE(addresses_A_1),
3623 .ips = addresses_A_1,
3624 .apply_expected = true
3629 * mhomed,released vs. group,tombstone
3630 * => should be replaced
3633 .line = __location__,
3634 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3637 .type = WREPL_TYPE_MHOMED,
3638 .state = WREPL_STATE_RELEASED,
3639 .node = WREPL_NODE_B,
3641 .num_ips = ARRAY_SIZE(addresses_A_1),
3642 .ips = addresses_A_1,
3643 .apply_expected = false
3647 .type = WREPL_TYPE_GROUP,
3648 .state = WREPL_STATE_TOMBSTONE,
3649 .node = WREPL_NODE_B,
3651 .num_ips = ARRAY_SIZE(addresses_B_1),
3652 .ips = addresses_B_1,
3653 .apply_expected = true
3658 * mhomed,tombstone vs. group,active
3659 * => should be replaced
3662 .line = __location__,
3663 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3666 .type = WREPL_TYPE_MHOMED,
3667 .state = WREPL_STATE_TOMBSTONE,
3668 .node = WREPL_NODE_B,
3670 .num_ips = ARRAY_SIZE(addresses_B_1),
3671 .ips = addresses_B_1,
3672 .apply_expected = true
3676 .type = WREPL_TYPE_GROUP,
3677 .state = WREPL_STATE_ACTIVE,
3678 .node = WREPL_NODE_B,
3680 .num_ips = ARRAY_SIZE(addresses_A_1),
3681 .ips = addresses_A_1,
3682 .apply_expected = true
3687 * mhomed,tombstone vs. group,tombstone
3688 * => should be replaced
3691 .line = __location__,
3692 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3695 .type = WREPL_TYPE_MHOMED,
3696 .state = WREPL_STATE_TOMBSTONE,
3697 .node = WREPL_NODE_B,
3699 .num_ips = ARRAY_SIZE(addresses_A_1),
3700 .ips = addresses_A_1,
3701 .apply_expected = true
3705 .type = WREPL_TYPE_GROUP,
3706 .state = WREPL_STATE_TOMBSTONE,
3707 .node = WREPL_NODE_B,
3709 .num_ips = ARRAY_SIZE(addresses_B_1),
3710 .ips = addresses_B_1,
3711 .apply_expected = true
3716 * multi homed vs. special group section,
3719 * mhomed,active vs. sgroup,active
3720 * => should NOT be replaced
3723 .line = __location__,
3724 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3727 .type = WREPL_TYPE_MHOMED,
3728 .state = WREPL_STATE_ACTIVE,
3729 .node = WREPL_NODE_B,
3731 .num_ips = ARRAY_SIZE(addresses_A_1),
3732 .ips = addresses_A_1,
3733 .apply_expected = true
3737 .type = WREPL_TYPE_SGROUP,
3738 .state = WREPL_STATE_ACTIVE,
3739 .node = WREPL_NODE_B,
3741 .num_ips = ARRAY_SIZE(addresses_A_1),
3742 .ips = addresses_A_1,
3743 .apply_expected = false
3748 * mhomed,active vs. sgroup,tombstone
3749 * => should NOT be replaced
3752 .line = __location__,
3753 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3756 .type = WREPL_TYPE_MHOMED,
3757 .state = WREPL_STATE_ACTIVE,
3758 .node = WREPL_NODE_B,
3760 .num_ips = ARRAY_SIZE(addresses_A_1),
3761 .ips = addresses_A_1,
3762 .apply_expected = true
3766 .type = WREPL_TYPE_SGROUP,
3767 .state = WREPL_STATE_TOMBSTONE,
3768 .node = WREPL_NODE_B,
3770 .num_ips = ARRAY_SIZE(addresses_A_1),
3771 .ips = addresses_A_1,
3772 .apply_expected = false
3777 * mhomed,released vs. sgroup,active
3778 * => should be replaced
3781 .line = __location__,
3782 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3785 .type = WREPL_TYPE_MHOMED,
3786 .state = WREPL_STATE_RELEASED,
3787 .node = WREPL_NODE_B,
3789 .num_ips = ARRAY_SIZE(addresses_A_1),
3790 .ips = addresses_A_1,
3791 .apply_expected = false
3795 .type = WREPL_TYPE_SGROUP,
3796 .state = WREPL_STATE_ACTIVE,
3797 .node = WREPL_NODE_B,
3799 .num_ips = ARRAY_SIZE(addresses_B_1),
3800 .ips = addresses_B_1,
3801 .apply_expected = true
3806 * mhomed,released vs. sgroup,tombstone
3807 * => should be replaced
3810 .line = __location__,
3811 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3814 .type = WREPL_TYPE_MHOMED,
3815 .state = WREPL_STATE_RELEASED,
3816 .node = WREPL_NODE_B,
3818 .num_ips = ARRAY_SIZE(addresses_B_1),
3819 .ips = addresses_B_1,
3820 .apply_expected = false
3824 .type = WREPL_TYPE_SGROUP,
3825 .state = WREPL_STATE_TOMBSTONE,
3826 .node = WREPL_NODE_B,
3828 .num_ips = ARRAY_SIZE(addresses_A_1),
3829 .ips = addresses_A_1,
3830 .apply_expected = true
3835 * mhomed,tombstone vs. sgroup,active
3836 * => should be replaced
3839 .line = __location__,
3840 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3843 .type = WREPL_TYPE_MHOMED,
3844 .state = WREPL_STATE_TOMBSTONE,
3845 .node = WREPL_NODE_B,
3847 .num_ips = ARRAY_SIZE(addresses_A_1),
3848 .ips = addresses_A_1,
3849 .apply_expected = true
3853 .type = WREPL_TYPE_SGROUP,
3854 .state = WREPL_STATE_ACTIVE,
3855 .node = WREPL_NODE_B,
3857 .num_ips = ARRAY_SIZE(addresses_B_1),
3858 .ips = addresses_B_1,
3859 .apply_expected = true
3864 * mhomed,tombstone vs. sgroup,tombstone
3865 * => should be replaced
3868 .line = __location__,
3869 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3872 .type = WREPL_TYPE_MHOMED,
3873 .state = WREPL_STATE_TOMBSTONE,
3874 .node = WREPL_NODE_B,
3876 .num_ips = ARRAY_SIZE(addresses_B_1),
3877 .ips = addresses_B_1,
3878 .apply_expected = true
3882 .type = WREPL_TYPE_SGROUP,
3883 .state = WREPL_STATE_TOMBSTONE,
3884 .node = WREPL_NODE_B,
3886 .num_ips = ARRAY_SIZE(addresses_A_1),
3887 .ips = addresses_A_1,
3888 .apply_expected = true
3893 * multi homed vs. mlti homed section,
3896 * mhomed,active vs. mhomed,active
3897 * => should be replaced
3900 .line = __location__,
3901 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3904 .type = WREPL_TYPE_MHOMED,
3905 .state = WREPL_STATE_ACTIVE,
3906 .node = WREPL_NODE_B,
3908 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3909 .ips = addresses_A_3_4,
3910 .apply_expected = true
3914 .type = WREPL_TYPE_MHOMED,
3915 .state = WREPL_STATE_ACTIVE,
3916 .node = WREPL_NODE_B,
3918 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3919 .ips = addresses_B_3_4,
3920 .apply_expected = true
3925 * mhomed,active vs. mhomed,tombstone
3926 * => should NOT be replaced
3929 .line = __location__,
3930 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3933 .type = WREPL_TYPE_MHOMED,
3934 .state = WREPL_STATE_ACTIVE,
3935 .node = WREPL_NODE_B,
3937 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3938 .ips = addresses_B_3_4,
3939 .apply_expected = true
3943 .type = WREPL_TYPE_MHOMED,
3944 .state = WREPL_STATE_TOMBSTONE,
3945 .node = WREPL_NODE_B,
3947 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3948 .ips = addresses_B_3_4,
3949 .apply_expected = false
3954 * mhomed,released vs. mhomed,active
3955 * => should be replaced
3958 .line = __location__,
3959 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3962 .type = WREPL_TYPE_MHOMED,
3963 .state = WREPL_STATE_RELEASED,
3964 .node = WREPL_NODE_B,
3966 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3967 .ips = addresses_B_3_4,
3968 .apply_expected = false
3972 .type = WREPL_TYPE_MHOMED,
3973 .state = WREPL_STATE_ACTIVE,
3974 .node = WREPL_NODE_B,
3976 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3977 .ips = addresses_A_3_4,
3978 .apply_expected = true
3983 * mhomed,released vs. mhomed,tombstone
3984 * => should be replaced
3987 .line = __location__,
3988 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3991 .type = WREPL_TYPE_MHOMED,
3992 .state = WREPL_STATE_RELEASED,
3993 .node = WREPL_NODE_B,
3995 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3996 .ips = addresses_A_3_4,
3997 .apply_expected = false
4001 .type = WREPL_TYPE_MHOMED,
4002 .state = WREPL_STATE_TOMBSTONE,
4003 .node = WREPL_NODE_B,
4005 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4006 .ips = addresses_B_3_4,
4007 .apply_expected = true
4012 * mhomed,tombstone vs. mhomed,active
4013 * => should be replaced
4016 .line = __location__,
4017 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4020 .type = WREPL_TYPE_MHOMED,
4021 .state = WREPL_STATE_TOMBSTONE,
4022 .node = WREPL_NODE_B,
4024 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4025 .ips = addresses_B_3_4,
4026 .apply_expected = true
4030 .type = WREPL_TYPE_MHOMED,
4031 .state = WREPL_STATE_ACTIVE,
4032 .node = WREPL_NODE_B,
4034 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4035 .ips = addresses_A_3_4,
4036 .apply_expected = true
4041 * mhomed,tombstone vs. mhomed,tombstone
4042 * => should be replaced
4045 .line = __location__,
4046 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4049 .type = WREPL_TYPE_MHOMED,
4050 .state = WREPL_STATE_TOMBSTONE,
4051 .node = WREPL_NODE_B,
4053 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4054 .ips = addresses_A_3_4,
4055 .apply_expected = true
4059 .type = WREPL_TYPE_MHOMED,
4060 .state = WREPL_STATE_TOMBSTONE,
4061 .node = WREPL_NODE_B,
4063 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4064 .ips = addresses_B_3_4,
4065 .apply_expected = true
4069 .line = __location__,
4070 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4074 .type = WREPL_TYPE_UNIQUE,
4075 .state = WREPL_STATE_TOMBSTONE,
4076 .node = WREPL_NODE_B,
4078 .num_ips = ARRAY_SIZE(addresses_B_1),
4079 .ips = addresses_B_1,
4080 .apply_expected = true,
4084 .type = WREPL_TYPE_UNIQUE,
4085 .state = WREPL_STATE_TOMBSTONE,
4086 .node = WREPL_NODE_B,
4088 .num_ips = ARRAY_SIZE(addresses_A_1),
4089 .ips = addresses_A_1,
4090 .apply_expected = true,
4094 * special group vs special group section,
4097 * sgroup,active vs. sgroup,active same addresses
4098 * => should be NOT replaced
4101 .line = __location__,
4102 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4103 .comment= "A:A_3_4 vs. B:A_3_4",
4107 .type = WREPL_TYPE_SGROUP,
4108 .state = WREPL_STATE_ACTIVE,
4109 .node = WREPL_NODE_B,
4111 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4112 .ips = addresses_A_3_4,
4113 .apply_expected = true
4117 .type = WREPL_TYPE_SGROUP,
4118 .state = WREPL_STATE_ACTIVE,
4119 .node = WREPL_NODE_B,
4121 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4122 .ips = addresses_A_3_4,
4123 .apply_expected = false,
4124 .sgroup_cleanup = true
4128 * sgroup,active vs. sgroup,active same addresses
4129 * => should be NOT replaced
4132 .line = __location__,
4133 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4134 .comment= "A:A_3_4 vs. B:NULL",
4138 .type = WREPL_TYPE_SGROUP,
4139 .state = WREPL_STATE_ACTIVE,
4140 .node = WREPL_NODE_B,
4142 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4143 .ips = addresses_A_3_4,
4144 .apply_expected = true
4148 .type = WREPL_TYPE_SGROUP,
4149 .state = WREPL_STATE_ACTIVE,
4150 .node = WREPL_NODE_B,
4154 .apply_expected = false,
4155 .sgroup_cleanup = true
4159 * sgroup,active vs. sgroup,active subset addresses, special case...
4160 * => should NOT be replaced
4163 .line = __location__,
4164 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4165 .comment= "A:A_3_4_X_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_A_3_4_X_3_4),
4174 .ips = addresses_A_3_4_X_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 = false,
4189 .line = __location__,
4190 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4194 .type = WREPL_TYPE_SGROUP,
4195 .state = WREPL_STATE_ACTIVE,
4196 .node = WREPL_NODE_B,
4200 .apply_expected = false,
4204 .type = WREPL_TYPE_SGROUP,
4205 .state = WREPL_STATE_ACTIVE,
4206 .node = WREPL_NODE_B,
4210 .apply_expected = false,
4214 * sgroup,active vs. sgroup,active different addresses, but owner changed
4215 * => should be replaced
4218 .line = __location__,
4219 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4220 .comment= "A:B_3_4 vs. B:A_3_4",
4224 .type = WREPL_TYPE_SGROUP,
4225 .state = WREPL_STATE_ACTIVE,
4226 .node = WREPL_NODE_B,
4228 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4229 .ips = addresses_B_3_4,
4230 .apply_expected = true,
4234 .type = WREPL_TYPE_SGROUP,
4235 .state = WREPL_STATE_ACTIVE,
4236 .node = WREPL_NODE_B,
4238 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4239 .ips = addresses_A_3_4,
4240 .apply_expected = true,
4241 .sgroup_cleanup = true
4245 * sgroup,active vs. sgroup,active different addresses, but owner changed
4246 * => should be replaced
4249 .line = __location__,
4250 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4251 .comment= "A:A_3_4 vs. B:A_3_4_OWNER_B",
4255 .type = WREPL_TYPE_SGROUP,
4256 .state = WREPL_STATE_ACTIVE,
4257 .node = WREPL_NODE_B,
4259 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4260 .ips = addresses_A_3_4,
4261 .apply_expected = true,
4265 .type = WREPL_TYPE_SGROUP,
4266 .state = WREPL_STATE_ACTIVE,
4267 .node = WREPL_NODE_B,
4269 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4270 .ips = addresses_A_3_4_OWNER_B,
4271 .apply_expected = true,
4272 .sgroup_cleanup = true
4276 * sgroup,active vs. sgroup,active different addresses, but owner changed
4277 * => should be replaced
4280 .line = __location__,
4281 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4282 .comment= "A:A_3_4_OWNER_B vs. B:A_3_4",
4286 .type = WREPL_TYPE_SGROUP,
4287 .state = WREPL_STATE_ACTIVE,
4288 .node = WREPL_NODE_B,
4290 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4291 .ips = addresses_A_3_4_OWNER_B,
4292 .apply_expected = true,
4296 .type = WREPL_TYPE_SGROUP,
4297 .state = WREPL_STATE_ACTIVE,
4298 .node = WREPL_NODE_B,
4300 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4301 .ips = addresses_A_3_4,
4302 .apply_expected = true,
4303 .sgroup_cleanup = true
4307 * sgroup,active vs. sgroup,active different addresses
4308 * => should be merged
4311 .line = __location__,
4312 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4313 .comment= "A:A_3_4 vs. B:B_3_4 => C:A_3_4_B_3_4",
4317 .type = WREPL_TYPE_SGROUP,
4318 .state = WREPL_STATE_ACTIVE,
4319 .node = WREPL_NODE_B,
4321 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4322 .ips = addresses_A_3_4,
4323 .apply_expected = true,
4327 .type = WREPL_TYPE_SGROUP,
4328 .state = WREPL_STATE_ACTIVE,
4329 .node = WREPL_NODE_B,
4331 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4332 .ips = addresses_B_3_4,
4333 .sgroup_merge = true,
4334 .sgroup_cleanup = true,
4338 * sgroup,active vs. sgroup,active different addresses, special case...
4339 * => should be merged
4342 .line = __location__,
4343 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4344 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4_X_3_4",
4348 .type = WREPL_TYPE_SGROUP,
4349 .state = WREPL_STATE_ACTIVE,
4350 .node = WREPL_NODE_B,
4352 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4353 .ips = addresses_B_3_4_X_3_4,
4354 .apply_expected = true,
4358 .type = WREPL_TYPE_SGROUP,
4359 .state = WREPL_STATE_ACTIVE,
4360 .node = WREPL_NODE_B,
4362 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4363 .ips = addresses_A_3_4,
4364 .sgroup_merge = true,
4365 .merge_owner = &ctx->b,
4366 .sgroup_cleanup = false
4370 .line = __location__,
4371 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4375 .type = WREPL_TYPE_SGROUP,
4376 .state = WREPL_STATE_ACTIVE,
4377 .node = WREPL_NODE_B,
4379 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4_OWNER_B),
4380 .ips = addresses_A_3_4_X_3_4_OWNER_B,
4381 .apply_expected = true,
4385 .type = WREPL_TYPE_SGROUP,
4386 .state = WREPL_STATE_ACTIVE,
4387 .node = WREPL_NODE_B,
4391 .apply_expected = false,
4395 * sgroup,active vs. sgroup,active different addresses, special case...
4396 * => should be merged
4399 .line = __location__,
4400 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4401 .comment= "A:X_3_4 vs. B:A_3_4 => C:A_3_4_X_3_4",
4405 .type = WREPL_TYPE_SGROUP,
4406 .state = WREPL_STATE_ACTIVE,
4407 .node = WREPL_NODE_B,
4409 .num_ips = ARRAY_SIZE(addresses_X_3_4),
4410 .ips = addresses_X_3_4,
4411 .apply_expected = true,
4415 .type = WREPL_TYPE_SGROUP,
4416 .state = WREPL_STATE_ACTIVE,
4417 .node = WREPL_NODE_B,
4419 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4420 .ips = addresses_A_3_4,
4421 .sgroup_merge = true,
4422 .sgroup_cleanup = false
4426 .line = __location__,
4427 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4431 .type = WREPL_TYPE_SGROUP,
4432 .state = WREPL_STATE_ACTIVE,
4433 .node = WREPL_NODE_B,
4437 .apply_expected = false,
4441 .type = WREPL_TYPE_SGROUP,
4442 .state = WREPL_STATE_ACTIVE,
4443 .node = WREPL_NODE_B,
4447 .apply_expected = false,
4451 * sgroup,active vs. sgroup,active different addresses, special case...
4452 * => should be merged
4455 .line = __location__,
4456 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4457 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4_OWNER_B => B:A_3_4_OWNER_B_X_3_4",
4461 .type = WREPL_TYPE_SGROUP,
4462 .state = WREPL_STATE_ACTIVE,
4463 .node = WREPL_NODE_B,
4465 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4466 .ips = addresses_A_3_4_X_3_4,
4467 .apply_expected = true,
4471 .type = WREPL_TYPE_SGROUP,
4472 .state = WREPL_STATE_ACTIVE,
4473 .node = WREPL_NODE_B,
4475 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4476 .ips = addresses_A_3_4_OWNER_B,
4477 .sgroup_merge = true,
4478 .merge_owner = &ctx->b,
4482 .line = __location__,
4483 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4487 .type = WREPL_TYPE_SGROUP,
4488 .state = WREPL_STATE_ACTIVE,
4489 .node = WREPL_NODE_B,
4493 .apply_expected = false,
4497 .type = WREPL_TYPE_SGROUP,
4498 .state = WREPL_STATE_ACTIVE,
4499 .node = WREPL_NODE_B,
4503 .apply_expected = false,
4507 * sgroup,active vs. sgroup,active partly different addresses, special case...
4508 * => should be merged
4511 .line = __location__,
4512 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4513 .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",
4517 .type = WREPL_TYPE_SGROUP,
4518 .state = WREPL_STATE_ACTIVE,
4519 .node = WREPL_NODE_B,
4521 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4522 .ips = addresses_B_3_4_X_3_4,
4523 .apply_expected = true,
4527 .type = WREPL_TYPE_SGROUP,
4528 .state = WREPL_STATE_ACTIVE,
4529 .node = WREPL_NODE_B,
4531 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_1_2),
4532 .ips = addresses_B_3_4_X_1_2,
4533 .sgroup_merge = true,
4534 .sgroup_cleanup = false
4538 .line = __location__,
4539 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4543 .type = WREPL_TYPE_SGROUP,
4544 .state = WREPL_STATE_ACTIVE,
4545 .node = WREPL_NODE_B,
4549 .apply_expected = false,
4553 .type = WREPL_TYPE_SGROUP,
4554 .state = WREPL_STATE_ACTIVE,
4555 .node = WREPL_NODE_B,
4559 .apply_expected = false,
4563 * sgroup,active vs. sgroup,active different addresses, special case...
4564 * => should be merged
4567 .line = __location__,
4568 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4569 .comment= "A:A_3_4_B_3_4 vs. B:NULL => B:A_3_4",
4573 .type = WREPL_TYPE_SGROUP,
4574 .state = WREPL_STATE_ACTIVE,
4575 .node = WREPL_NODE_B,
4577 .num_ips = ARRAY_SIZE(addresses_A_3_4_B_3_4),
4578 .ips = addresses_A_3_4_B_3_4,
4579 .apply_expected = true,
4583 .type = WREPL_TYPE_SGROUP,
4584 .state = WREPL_STATE_ACTIVE,
4585 .node = WREPL_NODE_B,
4589 .sgroup_merge = true,
4590 .merge_owner = &ctx->b,
4591 .sgroup_cleanup = true
4595 .line = __location__,
4596 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4600 .type = WREPL_TYPE_SGROUP,
4601 .state = WREPL_STATE_ACTIVE,
4602 .node = WREPL_NODE_B,
4606 .apply_expected = false,
4610 .type = WREPL_TYPE_UNIQUE,
4611 .state = WREPL_STATE_TOMBSTONE,
4612 .node = WREPL_NODE_B,
4614 .num_ips = ARRAY_SIZE(addresses_A_1),
4615 .ips = addresses_A_1,
4616 .apply_expected = true,
4620 * sgroup,active vs. sgroup,active different addresses, special case...
4621 * => should be merged
4624 .line = __location__,
4625 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4626 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:X_3_4",
4630 .type = WREPL_TYPE_SGROUP,
4631 .state = WREPL_STATE_ACTIVE,
4632 .node = WREPL_NODE_B,
4634 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4635 .ips = addresses_B_3_4_X_3_4,
4636 .apply_expected = true,
4640 .type = WREPL_TYPE_SGROUP,
4641 .state = WREPL_STATE_ACTIVE,
4642 .node = WREPL_NODE_B,
4646 .sgroup_merge = true,
4647 .merge_owner = &ctx->b,
4648 .sgroup_cleanup = true
4652 .line = __location__,
4653 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4657 .type = WREPL_TYPE_SGROUP,
4658 .state = WREPL_STATE_ACTIVE,
4659 .node = WREPL_NODE_B,
4663 .apply_expected = false,
4667 .type = WREPL_TYPE_UNIQUE,
4668 .state = WREPL_STATE_TOMBSTONE,
4669 .node = WREPL_NODE_B,
4671 .num_ips = ARRAY_SIZE(addresses_A_1),
4672 .ips = addresses_A_1,
4673 .apply_expected = true,
4678 * sgroup,active vs. sgroup,tombstone different no addresses, special
4679 * => should be replaced
4682 .line = __location__,
4683 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4684 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:NULL",
4688 .type = WREPL_TYPE_SGROUP,
4689 .state = WREPL_STATE_ACTIVE,
4690 .node = WREPL_NODE_B,
4692 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4693 .ips = addresses_B_3_4_X_3_4,
4694 .apply_expected = true,
4698 .type = WREPL_TYPE_SGROUP,
4699 .state = WREPL_STATE_TOMBSTONE,
4700 .node = WREPL_NODE_B,
4704 .apply_expected = true,
4708 * sgroup,active vs. sgroup,tombstone different addresses
4709 * => should be replaced
4712 .line = __location__,
4713 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4714 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4",
4718 .type = WREPL_TYPE_SGROUP,
4719 .state = WREPL_STATE_ACTIVE,
4720 .node = WREPL_NODE_B,
4722 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4723 .ips = addresses_B_3_4_X_3_4,
4724 .apply_expected = true,
4728 .type = WREPL_TYPE_SGROUP,
4729 .state = WREPL_STATE_TOMBSTONE,
4730 .node = WREPL_NODE_B,
4732 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4733 .ips = addresses_A_3_4,
4734 .apply_expected = true,
4738 * sgroup,active vs. sgroup,tombstone subset addresses
4739 * => should be replaced
4742 .line = __location__,
4743 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4744 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4 => B:B_3_4",
4748 .type = WREPL_TYPE_SGROUP,
4749 .state = WREPL_STATE_ACTIVE,
4750 .node = WREPL_NODE_B,
4752 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4753 .ips = addresses_B_3_4_X_3_4,
4754 .apply_expected = true,
4758 .type = WREPL_TYPE_SGROUP,
4759 .state = WREPL_STATE_TOMBSTONE,
4760 .node = WREPL_NODE_B,
4762 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4763 .ips = addresses_B_3_4,
4764 .apply_expected = true,
4768 * sgroup,active vs. sgroup,active same addresses
4769 * => should be replaced
4772 .line = __location__,
4773 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4774 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4_X_3_4 => B:B_3_4_X_3_4",
4778 .type = WREPL_TYPE_SGROUP,
4779 .state = WREPL_STATE_ACTIVE,
4780 .node = WREPL_NODE_B,
4782 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4783 .ips = addresses_B_3_4_X_3_4,
4784 .apply_expected = true,
4788 .type = WREPL_TYPE_SGROUP,
4789 .state = WREPL_STATE_TOMBSTONE,
4790 .node = WREPL_NODE_B,
4792 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4793 .ips = addresses_B_3_4_X_3_4,
4794 .apply_expected = true,
4799 * This should be the last record in this array,
4800 * we need to make sure the we leave a tombstoned unique entry
4804 .line = __location__,
4805 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4809 .type = WREPL_TYPE_UNIQUE,
4810 .state = WREPL_STATE_TOMBSTONE,
4811 .node = WREPL_NODE_B,
4813 .num_ips = ARRAY_SIZE(addresses_A_1),
4814 .ips = addresses_A_1,
4815 .apply_expected = true
4819 .type = WREPL_TYPE_UNIQUE,
4820 .state = WREPL_STATE_TOMBSTONE,
4821 .node = WREPL_NODE_B,
4823 .num_ips = ARRAY_SIZE(addresses_A_1),
4824 .ips = addresses_A_1,
4825 .apply_expected = true
4827 }}; /* do not add entries here, this should be the last record! */
4829 wins_name_r1 = &wins_name1;
4830 wins_name_r2 = &wins_name2;
4832 torture_comment(tctx, "Test Replica Conflicts with different owners\n");
4834 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
4836 if (!records[i].extra && !records[i].cleanup) {
4837 /* we should test the worst cases */
4838 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
4839 torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n",
4840 __location__, i, records[i].line);
4842 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
4843 torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n",
4844 __location__, i, records[i].line);
4849 if (!records[i].cleanup) {
4850 const char *expected;
4853 if (records[i].r2.sgroup_merge) {
4854 expected = "SGROUP_MERGE";
4855 } else if (records[i].r2.apply_expected) {
4856 expected = "REPLACE";
4858 expected = "NOT REPLACE";
4861 if (!records[i].r1.ips && !records[i].r2.ips) {
4862 ips = "with no ip(s)";
4863 } else if (records[i].r1.ips==records[i].r2.ips) {
4864 ips = "with same ip(s)";
4866 ips = "with different ip(s)";
4869 torture_comment(tctx, "%s,%s%s vs. %s,%s%s %s => %s\n",
4870 wrepl_name_type_string(records[i].r1.type),
4871 wrepl_name_state_string(records[i].r1.state),
4872 (records[i].r1.is_static?",static":""),
4873 wrepl_name_type_string(records[i].r2.type),
4874 wrepl_name_state_string(records[i].r2.state),
4875 (records[i].r2.is_static?",static":""),
4876 (records[i].comment?records[i].comment:ips),
4883 wins_name_r1->name = &records[i].name;
4884 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
4885 records[i].r1.state,
4887 records[i].r1.is_static);
4888 wins_name_r1->id = ++records[i].r1.owner->max_version;
4889 if (wins_name_r1->flags & 2) {
4890 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
4891 wins_name_r1->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
4894 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
4896 wins_name_r1->unknown = "255.255.255.255";
4899 ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1);
4900 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4901 wins_name_r1, records[i].r1.apply_expected);
4906 wins_name_r2->name = &records[i].name;
4907 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
4908 records[i].r2.state,
4910 records[i].r2.is_static);
4911 wins_name_r2->id = ++records[i].r2.owner->max_version;
4912 if (wins_name_r2->flags & 2) {
4913 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
4914 wins_name_r2->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
4917 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
4919 wins_name_r2->unknown = "255.255.255.255";
4922 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4923 if (records[i].r1.state == WREPL_STATE_RELEASED) {
4924 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4925 wins_name_r1, false);
4926 } else if (records[i].r2.sgroup_merge) {
4927 ret &= test_wrepl_sgroup_merged(tctx, ctx, records[i].r2.merge_owner,
4928 records[i].r1.owner,
4929 records[i].r1.num_ips, records[i].r1.ips,
4930 records[i].r2.owner,
4931 records[i].r2.num_ips, records[i].r2.ips,
4933 } else if (records[i].r1.owner != records[i].r2.owner) {
4935 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
4936 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4937 wins_name_r1, _expected);
4939 if (records[i].r2.state == WREPL_STATE_RELEASED) {
4940 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner,
4941 wins_name_r2, false);
4942 } else if (!records[i].r2.sgroup_merge) {
4943 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner,
4944 wins_name_r2, records[i].r2.apply_expected);
4947 if (records[i].r2.sgroup_cleanup) {
4949 torture_comment(tctx, "failed before sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4953 /* clean up the SGROUP record */
4954 wins_name_r1->name = &records[i].name;
4955 wins_name_r1->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4957 WREPL_NODE_B, false);
4958 wins_name_r1->id = ++records[i].r1.owner->max_version;
4959 wins_name_r1->addresses.addresses.num_ips = 0;
4960 wins_name_r1->addresses.addresses.ips = NULL;
4961 wins_name_r1->unknown = "255.255.255.255";
4962 ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1);
4964 /* here we test how names from an owner are deleted */
4965 if (records[i].r2.sgroup_merge && records[i].r2.num_ips) {
4966 ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL,
4967 records[i].r2.owner,
4968 records[i].r2.num_ips, records[i].r2.ips,
4969 records[i].r1.owner,
4974 /* clean up the SGROUP record */
4975 wins_name_r2->name = &records[i].name;
4976 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4978 WREPL_NODE_B, false);
4979 wins_name_r2->id = ++records[i].r2.owner->max_version;
4980 wins_name_r2->addresses.addresses.num_ips = 0;
4981 wins_name_r2->addresses.addresses.ips = NULL;
4982 wins_name_r2->unknown = "255.255.255.255";
4983 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4985 /* take ownership of the SGROUP record */
4986 wins_name_r2->name = &records[i].name;
4987 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4989 WREPL_NODE_B, false);
4990 wins_name_r2->id = ++records[i].r2.owner->max_version;
4991 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4992 wins_name_r2->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
4994 wins_name_r2->unknown = "255.255.255.255";
4995 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4996 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true);
4998 /* overwrite the SGROUP record with unique,tombstone */
4999 wins_name_r2->name = &records[i].name;
5000 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
5001 WREPL_STATE_TOMBSTONE,
5002 WREPL_NODE_B, false);
5003 wins_name_r2->id = ++records[i].r2.owner->max_version;
5004 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
5005 wins_name_r2->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
5007 wins_name_r2->unknown = "255.255.255.255";
5008 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
5009 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true);
5012 torture_comment(tctx, "failed in sgroup_cleanup record[%u]: %s\n", i, records[i].line);
5017 /* the first one is a cleanup run */
5018 if (!ret && i == 0) ret = true;
5021 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
5029 static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx,
5030 struct test_wrepl_conflict_conn *ctx)
5034 struct wrepl_wins_name wins_name_;
5035 struct wrepl_wins_name *wins_name = &wins_name_;
5036 struct nbt_name_register name_register_;
5037 struct nbt_name_register *name_register = &name_register_;
5038 struct nbt_name_release release_;
5039 struct nbt_name_release *release = &release_;
5042 const char *line; /* just better debugging */
5043 struct nbt_name name;
5048 const struct wrepl_ip *ips;
5049 bool apply_expected;
5052 enum wrepl_name_type type;
5053 enum wrepl_name_state state;
5054 enum wrepl_name_node node;
5057 const struct wrepl_ip *ips;
5058 bool apply_expected;
5062 * unique vs. unique section
5065 * unique,released vs. unique,active with same ip(s)
5068 .line = __location__,
5069 .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL),
5073 .num_ips = ctx->addresses_best_num,
5074 .ips = ctx->addresses_best,
5075 .apply_expected = true
5078 .type = WREPL_TYPE_UNIQUE,
5079 .state = WREPL_STATE_ACTIVE,
5080 .node = WREPL_NODE_B,
5082 .num_ips = ctx->addresses_best_num,
5083 .ips = ctx->addresses_best,
5084 .apply_expected = true
5088 * unique,released vs. unique,active with different ip(s)
5091 .line = __location__,
5092 .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL),
5096 .num_ips = ctx->addresses_best_num,
5097 .ips = ctx->addresses_best,
5098 .apply_expected = true
5101 .type = WREPL_TYPE_UNIQUE,
5102 .state = WREPL_STATE_ACTIVE,
5103 .node = WREPL_NODE_B,
5105 .num_ips = ARRAY_SIZE(addresses_B_1),
5106 .ips = addresses_B_1,
5107 .apply_expected = true
5111 * unique,released vs. unique,tombstone with same ip(s)
5114 .line = __location__,
5115 .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL),
5119 .num_ips = ctx->addresses_best_num,
5120 .ips = ctx->addresses_best,
5121 .apply_expected = true
5124 .type = WREPL_TYPE_UNIQUE,
5125 .state = WREPL_STATE_TOMBSTONE,
5126 .node = WREPL_NODE_B,
5128 .num_ips = ctx->addresses_best_num,
5129 .ips = ctx->addresses_best,
5130 .apply_expected = true
5134 * unique,released vs. unique,tombstone with different ip(s)
5137 .line = __location__,
5138 .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL),
5142 .num_ips = ctx->addresses_best_num,
5143 .ips = ctx->addresses_best,
5144 .apply_expected = true
5147 .type = WREPL_TYPE_UNIQUE,
5148 .state = WREPL_STATE_TOMBSTONE,
5149 .node = WREPL_NODE_B,
5151 .num_ips = ARRAY_SIZE(addresses_B_1),
5152 .ips = addresses_B_1,
5153 .apply_expected = true
5157 * unique vs. group section
5160 * unique,released vs. group,active with same ip(s)
5163 .line = __location__,
5164 .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL),
5168 .num_ips = ctx->addresses_best_num,
5169 .ips = ctx->addresses_best,
5170 .apply_expected = true
5173 .type = WREPL_TYPE_GROUP,
5174 .state = WREPL_STATE_ACTIVE,
5175 .node = WREPL_NODE_B,
5177 .num_ips = ctx->addresses_best_num,
5178 .ips = ctx->addresses_best,
5179 .apply_expected = true
5183 * unique,released vs. group,active with different ip(s)
5186 .line = __location__,
5187 .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL),
5191 .num_ips = ctx->addresses_best_num,
5192 .ips = ctx->addresses_best,
5193 .apply_expected = true
5196 .type = WREPL_TYPE_GROUP,
5197 .state = WREPL_STATE_ACTIVE,
5198 .node = WREPL_NODE_B,
5200 .num_ips = ARRAY_SIZE(addresses_B_1),
5201 .ips = addresses_B_1,
5202 .apply_expected = true
5206 * unique,released vs. group,tombstone with same ip(s)
5209 .line = __location__,
5210 .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL),
5214 .num_ips = ctx->addresses_best_num,
5215 .ips = ctx->addresses_best,
5216 .apply_expected = true
5219 .type = WREPL_TYPE_GROUP,
5220 .state = WREPL_STATE_TOMBSTONE,
5221 .node = WREPL_NODE_B,
5223 .num_ips = ctx->addresses_best_num,
5224 .ips = ctx->addresses_best,
5225 .apply_expected = true
5229 * unique,released vs. group,tombstone with different ip(s)
5232 .line = __location__,
5233 .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL),
5237 .num_ips = ctx->addresses_best_num,
5238 .ips = ctx->addresses_best,
5239 .apply_expected = true
5242 .type = WREPL_TYPE_GROUP,
5243 .state = WREPL_STATE_TOMBSTONE,
5244 .node = WREPL_NODE_B,
5246 .num_ips = ARRAY_SIZE(addresses_B_1),
5247 .ips = addresses_B_1,
5248 .apply_expected = true
5252 * unique vs. special group section
5255 * unique,released vs. sgroup,active with same ip(s)
5258 .line = __location__,
5259 .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL),
5263 .num_ips = ctx->addresses_best_num,
5264 .ips = ctx->addresses_best,
5265 .apply_expected = true
5268 .type = WREPL_TYPE_SGROUP,
5269 .state = WREPL_STATE_ACTIVE,
5270 .node = WREPL_NODE_B,
5272 .num_ips = ctx->addresses_best_num,
5273 .ips = ctx->addresses_best,
5274 .apply_expected = true
5278 * unique,released vs. sgroup,active with different ip(s)
5281 .line = __location__,
5282 .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL),
5286 .num_ips = ctx->addresses_best_num,
5287 .ips = ctx->addresses_best,
5288 .apply_expected = true
5291 .type = WREPL_TYPE_SGROUP,
5292 .state = WREPL_STATE_ACTIVE,
5293 .node = WREPL_NODE_B,
5295 .num_ips = ARRAY_SIZE(addresses_B_1),
5296 .ips = addresses_B_1,
5297 .apply_expected = true
5301 * unique,released vs. sgroup,tombstone with same ip(s)
5304 .line = __location__,
5305 .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL),
5309 .num_ips = ctx->addresses_best_num,
5310 .ips = ctx->addresses_best,
5311 .apply_expected = true
5314 .type = WREPL_TYPE_SGROUP,
5315 .state = WREPL_STATE_TOMBSTONE,
5316 .node = WREPL_NODE_B,
5318 .num_ips = ctx->addresses_best_num,
5319 .ips = ctx->addresses_best,
5320 .apply_expected = true
5324 * unique,released vs. sgroup,tombstone with different ip(s)
5327 .line = __location__,
5328 .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL),
5332 .num_ips = ctx->addresses_best_num,
5333 .ips = ctx->addresses_best,
5334 .apply_expected = true
5337 .type = WREPL_TYPE_SGROUP,
5338 .state = WREPL_STATE_TOMBSTONE,
5339 .node = WREPL_NODE_B,
5341 .num_ips = ARRAY_SIZE(addresses_B_1),
5342 .ips = addresses_B_1,
5343 .apply_expected = true
5347 * unique vs. multi homed section
5350 * unique,released vs. mhomed,active with same ip(s)
5353 .line = __location__,
5354 .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL),
5358 .num_ips = ctx->addresses_best_num,
5359 .ips = ctx->addresses_best,
5360 .apply_expected = true
5363 .type = WREPL_TYPE_MHOMED,
5364 .state = WREPL_STATE_ACTIVE,
5365 .node = WREPL_NODE_B,
5367 .num_ips = ctx->addresses_best_num,
5368 .ips = ctx->addresses_best,
5369 .apply_expected = true
5373 * unique,released vs. mhomed,active with different ip(s)
5376 .line = __location__,
5377 .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL),
5381 .num_ips = ctx->addresses_best_num,
5382 .ips = ctx->addresses_best,
5383 .apply_expected = true
5386 .type = WREPL_TYPE_MHOMED,
5387 .state = WREPL_STATE_ACTIVE,
5388 .node = WREPL_NODE_B,
5390 .num_ips = ARRAY_SIZE(addresses_B_1),
5391 .ips = addresses_B_1,
5392 .apply_expected = true
5396 * unique,released vs. mhomed,tombstone with same ip(s)
5399 .line = __location__,
5400 .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL),
5404 .num_ips = ctx->addresses_best_num,
5405 .ips = ctx->addresses_best,
5406 .apply_expected = true
5409 .type = WREPL_TYPE_MHOMED,
5410 .state = WREPL_STATE_TOMBSTONE,
5411 .node = WREPL_NODE_B,
5413 .num_ips = ctx->addresses_best_num,
5414 .ips = ctx->addresses_best,
5415 .apply_expected = true
5419 * unique,released vs. mhomed,tombstone with different ip(s)
5422 .line = __location__,
5423 .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL),
5427 .num_ips = ctx->addresses_best_num,
5428 .ips = ctx->addresses_best,
5429 .apply_expected = true
5432 .type = WREPL_TYPE_MHOMED,
5433 .state = WREPL_STATE_TOMBSTONE,
5434 .node = WREPL_NODE_B,
5436 .num_ips = ARRAY_SIZE(addresses_B_1),
5437 .ips = addresses_B_1,
5438 .apply_expected = true
5442 * group vs. unique section
5445 * group,released vs. unique,active with same ip(s)
5448 .line = __location__,
5449 .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL),
5451 .nb_flags = NBT_NM_GROUP,
5453 .num_ips = ctx->addresses_best_num,
5454 .ips = ctx->addresses_best,
5455 .apply_expected = true
5458 .type = WREPL_TYPE_UNIQUE,
5459 .state = WREPL_STATE_ACTIVE,
5460 .node = WREPL_NODE_B,
5462 .num_ips = ctx->addresses_best_num,
5463 .ips = ctx->addresses_best,
5464 .apply_expected = false
5468 * group,released vs. unique,active with different ip(s)
5471 .line = __location__,
5472 .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL),
5474 .nb_flags = NBT_NM_GROUP,
5476 .num_ips = ctx->addresses_best_num,
5477 .ips = ctx->addresses_best,
5478 .apply_expected = true
5481 .type = WREPL_TYPE_UNIQUE,
5482 .state = WREPL_STATE_ACTIVE,
5483 .node = WREPL_NODE_B,
5485 .num_ips = ARRAY_SIZE(addresses_B_1),
5486 .ips = addresses_B_1,
5487 .apply_expected = false
5491 * group,released vs. unique,tombstone with same ip(s)
5494 .line = __location__,
5495 .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL),
5497 .nb_flags = NBT_NM_GROUP,
5499 .num_ips = ctx->addresses_best_num,
5500 .ips = ctx->addresses_best,
5501 .apply_expected = true
5504 .type = WREPL_TYPE_UNIQUE,
5505 .state = WREPL_STATE_TOMBSTONE,
5506 .node = WREPL_NODE_B,
5508 .num_ips = ctx->addresses_best_num,
5509 .ips = ctx->addresses_best,
5510 .apply_expected = false
5514 * group,released vs. unique,tombstone with different ip(s)
5517 .line = __location__,
5518 .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL),
5520 .nb_flags = NBT_NM_GROUP,
5522 .num_ips = ctx->addresses_best_num,
5523 .ips = ctx->addresses_best,
5524 .apply_expected = true
5527 .type = WREPL_TYPE_UNIQUE,
5528 .state = WREPL_STATE_TOMBSTONE,
5529 .node = WREPL_NODE_B,
5531 .num_ips = ARRAY_SIZE(addresses_B_1),
5532 .ips = addresses_B_1,
5533 .apply_expected = false
5537 * group vs. group section
5540 * group,released vs. group,active with same ip(s)
5543 .line = __location__,
5544 .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL),
5546 .nb_flags = NBT_NM_GROUP,
5548 .num_ips = ctx->addresses_best_num,
5549 .ips = ctx->addresses_best,
5550 .apply_expected = true
5553 .type = WREPL_TYPE_GROUP,
5554 .state = WREPL_STATE_ACTIVE,
5555 .node = WREPL_NODE_B,
5557 .num_ips = ctx->addresses_best_num,
5558 .ips = ctx->addresses_best,
5559 .apply_expected = true
5563 * group,released vs. group,active with different ip(s)
5566 .line = __location__,
5567 .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL),
5569 .nb_flags = NBT_NM_GROUP,
5571 .num_ips = ctx->addresses_best_num,
5572 .ips = ctx->addresses_best,
5573 .apply_expected = true
5576 .type = WREPL_TYPE_GROUP,
5577 .state = WREPL_STATE_ACTIVE,
5578 .node = WREPL_NODE_B,
5580 .num_ips = ARRAY_SIZE(addresses_B_1),
5581 .ips = addresses_B_1,
5582 .apply_expected = true
5586 * group,released vs. group,tombstone with same ip(s)
5589 .line = __location__,
5590 .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL),
5592 .nb_flags = NBT_NM_GROUP,
5594 .num_ips = ctx->addresses_best_num,
5595 .ips = ctx->addresses_best,
5596 .apply_expected = true
5599 .type = WREPL_TYPE_GROUP,
5600 .state = WREPL_STATE_TOMBSTONE,
5601 .node = WREPL_NODE_B,
5603 .num_ips = ctx->addresses_best_num,
5604 .ips = ctx->addresses_best,
5605 .apply_expected = true
5609 * group,released vs. group,tombstone with different ip(s)
5612 .line = __location__,
5613 .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL),
5615 .nb_flags = NBT_NM_GROUP,
5617 .num_ips = ctx->addresses_best_num,
5618 .ips = ctx->addresses_best,
5619 .apply_expected = true
5622 .type = WREPL_TYPE_GROUP,
5623 .state = WREPL_STATE_TOMBSTONE,
5624 .node = WREPL_NODE_B,
5626 .num_ips = ARRAY_SIZE(addresses_B_1),
5627 .ips = addresses_B_1,
5628 .apply_expected = true
5632 * group vs. special group section
5635 * group,released vs. sgroup,active with same ip(s)
5638 .line = __location__,
5639 .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL),
5641 .nb_flags = NBT_NM_GROUP,
5643 .num_ips = ctx->addresses_best_num,
5644 .ips = ctx->addresses_best,
5645 .apply_expected = true
5648 .type = WREPL_TYPE_SGROUP,
5649 .state = WREPL_STATE_ACTIVE,
5650 .node = WREPL_NODE_B,
5652 .num_ips = ctx->addresses_best_num,
5653 .ips = ctx->addresses_best,
5654 .apply_expected = false
5658 * group,released vs. sgroup,active with different ip(s)
5661 .line = __location__,
5662 .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL),
5664 .nb_flags = NBT_NM_GROUP,
5666 .num_ips = ctx->addresses_best_num,
5667 .ips = ctx->addresses_best,
5668 .apply_expected = true
5671 .type = WREPL_TYPE_SGROUP,
5672 .state = WREPL_STATE_ACTIVE,
5673 .node = WREPL_NODE_B,
5675 .num_ips = ARRAY_SIZE(addresses_B_1),
5676 .ips = addresses_B_1,
5677 .apply_expected = false
5681 * group,released vs. sgroup,tombstone with same ip(s)
5684 .line = __location__,
5685 .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL),
5687 .nb_flags = NBT_NM_GROUP,
5689 .num_ips = ctx->addresses_best_num,
5690 .ips = ctx->addresses_best,
5691 .apply_expected = true
5694 .type = WREPL_TYPE_SGROUP,
5695 .state = WREPL_STATE_TOMBSTONE,
5696 .node = WREPL_NODE_B,
5698 .num_ips = ctx->addresses_best_num,
5699 .ips = ctx->addresses_best,
5700 .apply_expected = false
5704 * group,released vs. sgroup,tombstone with different ip(s)
5707 .line = __location__,
5708 .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL),
5710 .nb_flags = NBT_NM_GROUP,
5712 .num_ips = ctx->addresses_best_num,
5713 .ips = ctx->addresses_best,
5714 .apply_expected = true
5717 .type = WREPL_TYPE_SGROUP,
5718 .state = WREPL_STATE_TOMBSTONE,
5719 .node = WREPL_NODE_B,
5721 .num_ips = ARRAY_SIZE(addresses_B_1),
5722 .ips = addresses_B_1,
5723 .apply_expected = false
5727 * group vs. multi homed section
5730 * group,released vs. mhomed,active with same ip(s)
5733 .line = __location__,
5734 .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL),
5736 .nb_flags = NBT_NM_GROUP,
5738 .num_ips = ctx->addresses_best_num,
5739 .ips = ctx->addresses_best,
5740 .apply_expected = true
5743 .type = WREPL_TYPE_MHOMED,
5744 .state = WREPL_STATE_ACTIVE,
5745 .node = WREPL_NODE_B,
5747 .num_ips = ctx->addresses_best_num,
5748 .ips = ctx->addresses_best,
5749 .apply_expected = false
5753 * group,released vs. mhomed,active with different ip(s)
5756 .line = __location__,
5757 .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL),
5759 .nb_flags = NBT_NM_GROUP,
5761 .num_ips = ctx->addresses_best_num,
5762 .ips = ctx->addresses_best,
5763 .apply_expected = true
5766 .type = WREPL_TYPE_MHOMED,
5767 .state = WREPL_STATE_ACTIVE,
5768 .node = WREPL_NODE_B,
5770 .num_ips = ARRAY_SIZE(addresses_B_1),
5771 .ips = addresses_B_1,
5772 .apply_expected = false
5776 * group,released vs. mhomed,tombstone with same ip(s)
5779 .line = __location__,
5780 .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL),
5782 .nb_flags = NBT_NM_GROUP,
5784 .num_ips = ctx->addresses_best_num,
5785 .ips = ctx->addresses_best,
5786 .apply_expected = true
5789 .type = WREPL_TYPE_MHOMED,
5790 .state = WREPL_STATE_TOMBSTONE,
5791 .node = WREPL_NODE_B,
5793 .num_ips = ctx->addresses_best_num,
5794 .ips = ctx->addresses_best,
5795 .apply_expected = false
5799 * group,released vs. mhomed,tombstone with different ip(s)
5802 .line = __location__,
5803 .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL),
5805 .nb_flags = NBT_NM_GROUP,
5807 .num_ips = ctx->addresses_best_num,
5808 .ips = ctx->addresses_best,
5809 .apply_expected = true
5812 .type = WREPL_TYPE_MHOMED,
5813 .state = WREPL_STATE_TOMBSTONE,
5814 .node = WREPL_NODE_B,
5816 .num_ips = ARRAY_SIZE(addresses_B_1),
5817 .ips = addresses_B_1,
5818 .apply_expected = false
5822 * special group vs. unique section
5825 * sgroup,released vs. unique,active with same ip(s)
5828 .line = __location__,
5829 .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL),
5831 .nb_flags = NBT_NM_GROUP,
5833 .num_ips = ctx->addresses_best_num,
5834 .ips = ctx->addresses_best,
5835 .apply_expected = true
5838 .type = WREPL_TYPE_UNIQUE,
5839 .state = WREPL_STATE_ACTIVE,
5840 .node = WREPL_NODE_B,
5842 .num_ips = ctx->addresses_best_num,
5843 .ips = ctx->addresses_best,
5844 .apply_expected = true
5848 * sgroup,released vs. unique,active with different ip(s)
5851 .line = __location__,
5852 .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL),
5854 .nb_flags = NBT_NM_GROUP,
5856 .num_ips = ctx->addresses_best_num,
5857 .ips = ctx->addresses_best,
5858 .apply_expected = true
5861 .type = WREPL_TYPE_UNIQUE,
5862 .state = WREPL_STATE_ACTIVE,
5863 .node = WREPL_NODE_B,
5865 .num_ips = ARRAY_SIZE(addresses_B_1),
5866 .ips = addresses_B_1,
5867 .apply_expected = true
5871 * sgroup,released vs. unique,tombstone with same ip(s)
5874 .line = __location__,
5875 .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL),
5877 .nb_flags = NBT_NM_GROUP,
5879 .num_ips = ctx->addresses_best_num,
5880 .ips = ctx->addresses_best,
5881 .apply_expected = true
5884 .type = WREPL_TYPE_UNIQUE,
5885 .state = WREPL_STATE_TOMBSTONE,
5886 .node = WREPL_NODE_B,
5888 .num_ips = ctx->addresses_best_num,
5889 .ips = ctx->addresses_best,
5890 .apply_expected = true
5894 * sgroup,released vs. unique,tombstone with different ip(s)
5897 .line = __location__,
5898 .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL),
5900 .nb_flags = NBT_NM_GROUP,
5902 .num_ips = ctx->addresses_best_num,
5903 .ips = ctx->addresses_best,
5904 .apply_expected = true
5907 .type = WREPL_TYPE_UNIQUE,
5908 .state = WREPL_STATE_TOMBSTONE,
5909 .node = WREPL_NODE_B,
5911 .num_ips = ARRAY_SIZE(addresses_B_1),
5912 .ips = addresses_B_1,
5913 .apply_expected = true
5917 * special group vs. group section
5920 * sgroup,released vs. group,active with same ip(s)
5923 .line = __location__,
5924 .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL),
5926 .nb_flags = NBT_NM_GROUP,
5928 .num_ips = ctx->addresses_best_num,
5929 .ips = ctx->addresses_best,
5930 .apply_expected = true
5933 .type = WREPL_TYPE_GROUP,
5934 .state = WREPL_STATE_ACTIVE,
5935 .node = WREPL_NODE_B,
5937 .num_ips = ctx->addresses_best_num,
5938 .ips = ctx->addresses_best,
5939 .apply_expected = true
5943 * sgroup,released vs. group,active with different ip(s)
5946 .line = __location__,
5947 .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL),
5949 .nb_flags = NBT_NM_GROUP,
5951 .num_ips = ctx->addresses_best_num,
5952 .ips = ctx->addresses_best,
5953 .apply_expected = true
5956 .type = WREPL_TYPE_GROUP,
5957 .state = WREPL_STATE_ACTIVE,
5958 .node = WREPL_NODE_B,
5960 .num_ips = ARRAY_SIZE(addresses_B_1),
5961 .ips = addresses_B_1,
5962 .apply_expected = true
5966 * sgroup,released vs. group,tombstone with same ip(s)
5969 .line = __location__,
5970 .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL),
5972 .nb_flags = NBT_NM_GROUP,
5974 .num_ips = ctx->addresses_best_num,
5975 .ips = ctx->addresses_best,
5976 .apply_expected = true
5979 .type = WREPL_TYPE_GROUP,
5980 .state = WREPL_STATE_TOMBSTONE,
5981 .node = WREPL_NODE_B,
5983 .num_ips = ctx->addresses_best_num,
5984 .ips = ctx->addresses_best,
5985 .apply_expected = true
5989 * sgroup,released vs. group,tombstone with different ip(s)
5992 .line = __location__,
5993 .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL),
5995 .nb_flags = NBT_NM_GROUP,
5997 .num_ips = ctx->addresses_best_num,
5998 .ips = ctx->addresses_best,
5999 .apply_expected = true
6002 .type = WREPL_TYPE_GROUP,
6003 .state = WREPL_STATE_TOMBSTONE,
6004 .node = WREPL_NODE_B,
6006 .num_ips = ARRAY_SIZE(addresses_B_1),
6007 .ips = addresses_B_1,
6008 .apply_expected = true
6012 * special group vs. special group section
6015 * sgroup,released vs. sgroup,active with same ip(s)
6018 .line = __location__,
6019 .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL),
6021 .nb_flags = NBT_NM_GROUP,
6023 .num_ips = ctx->addresses_best_num,
6024 .ips = ctx->addresses_best,
6025 .apply_expected = true
6028 .type = WREPL_TYPE_SGROUP,
6029 .state = WREPL_STATE_ACTIVE,
6030 .node = WREPL_NODE_B,
6032 .num_ips = ctx->addresses_best_num,
6033 .ips = ctx->addresses_best,
6034 .apply_expected = true
6038 * sgroup,released vs. sgroup,active with different ip(s)
6041 .line = __location__,
6042 .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL),
6044 .nb_flags = NBT_NM_GROUP,
6046 .num_ips = ctx->addresses_best_num,
6047 .ips = ctx->addresses_best,
6048 .apply_expected = true
6051 .type = WREPL_TYPE_SGROUP,
6052 .state = WREPL_STATE_ACTIVE,
6053 .node = WREPL_NODE_B,
6055 .num_ips = ARRAY_SIZE(addresses_B_1),
6056 .ips = addresses_B_1,
6057 .apply_expected = true
6061 * sgroup,released vs. sgroup,tombstone with same ip(s)
6064 .line = __location__,
6065 .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL),
6067 .nb_flags = NBT_NM_GROUP,
6069 .num_ips = ctx->addresses_best_num,
6070 .ips = ctx->addresses_best,
6071 .apply_expected = true
6074 .type = WREPL_TYPE_SGROUP,
6075 .state = WREPL_STATE_TOMBSTONE,
6076 .node = WREPL_NODE_B,
6078 .num_ips = ctx->addresses_best_num,
6079 .ips = ctx->addresses_best,
6080 .apply_expected = true
6084 * sgroup,released vs. sgroup,tombstone with different ip(s)
6087 .line = __location__,
6088 .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL),
6090 .nb_flags = NBT_NM_GROUP,
6092 .num_ips = ctx->addresses_best_num,
6093 .ips = ctx->addresses_best,
6094 .apply_expected = true
6097 .type = WREPL_TYPE_SGROUP,
6098 .state = WREPL_STATE_TOMBSTONE,
6099 .node = WREPL_NODE_B,
6101 .num_ips = ARRAY_SIZE(addresses_B_1),
6102 .ips = addresses_B_1,
6103 .apply_expected = true
6107 * special group vs. multi homed section
6110 * sgroup,released vs. mhomed,active with same ip(s)
6113 .line = __location__,
6114 .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL),
6116 .nb_flags = NBT_NM_GROUP,
6118 .num_ips = ctx->addresses_best_num,
6119 .ips = ctx->addresses_best,
6120 .apply_expected = true
6123 .type = WREPL_TYPE_MHOMED,
6124 .state = WREPL_STATE_ACTIVE,
6125 .node = WREPL_NODE_B,
6127 .num_ips = ctx->addresses_best_num,
6128 .ips = ctx->addresses_best,
6129 .apply_expected = true
6133 * sgroup,released vs. mhomed,active with different ip(s)
6136 .line = __location__,
6137 .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL),
6139 .nb_flags = NBT_NM_GROUP,
6141 .num_ips = ctx->addresses_best_num,
6142 .ips = ctx->addresses_best,
6143 .apply_expected = true
6146 .type = WREPL_TYPE_MHOMED,
6147 .state = WREPL_STATE_ACTIVE,
6148 .node = WREPL_NODE_B,
6150 .num_ips = ARRAY_SIZE(addresses_B_1),
6151 .ips = addresses_B_1,
6152 .apply_expected = true
6156 * sgroup,released vs. mhomed,tombstone with same ip(s)
6159 .line = __location__,
6160 .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL),
6162 .nb_flags = NBT_NM_GROUP,
6164 .num_ips = ctx->addresses_best_num,
6165 .ips = ctx->addresses_best,
6166 .apply_expected = true
6169 .type = WREPL_TYPE_MHOMED,
6170 .state = WREPL_STATE_TOMBSTONE,
6171 .node = WREPL_NODE_B,
6173 .num_ips = ctx->addresses_best_num,
6174 .ips = ctx->addresses_best,
6175 .apply_expected = true
6179 * sgroup,released vs. mhomed,tombstone with different ip(s)
6182 .line = __location__,
6183 .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL),
6185 .nb_flags = NBT_NM_GROUP,
6187 .num_ips = ctx->addresses_best_num,
6188 .ips = ctx->addresses_best,
6189 .apply_expected = true
6192 .type = WREPL_TYPE_MHOMED,
6193 .state = WREPL_STATE_TOMBSTONE,
6194 .node = WREPL_NODE_B,
6196 .num_ips = ARRAY_SIZE(addresses_B_1),
6197 .ips = addresses_B_1,
6198 .apply_expected = true
6202 * multi homed vs. unique section
6205 * mhomed,released vs. unique,active with same ip(s)
6208 .line = __location__,
6209 .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL),
6213 .num_ips = ctx->addresses_best_num,
6214 .ips = ctx->addresses_best,
6215 .apply_expected = true
6218 .type = WREPL_TYPE_UNIQUE,
6219 .state = WREPL_STATE_ACTIVE,
6220 .node = WREPL_NODE_B,
6222 .num_ips = ctx->addresses_best_num,
6223 .ips = ctx->addresses_best,
6224 .apply_expected = true
6228 * mhomed,released vs. unique,active with different ip(s)
6231 .line = __location__,
6232 .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL),
6236 .num_ips = ctx->addresses_best_num,
6237 .ips = ctx->addresses_best,
6238 .apply_expected = true
6241 .type = WREPL_TYPE_UNIQUE,
6242 .state = WREPL_STATE_ACTIVE,
6243 .node = WREPL_NODE_B,
6245 .num_ips = ARRAY_SIZE(addresses_B_1),
6246 .ips = addresses_B_1,
6247 .apply_expected = true
6251 * mhomed,released vs. unique,tombstone with same ip(s)
6254 .line = __location__,
6255 .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL),
6259 .num_ips = ctx->addresses_best_num,
6260 .ips = ctx->addresses_best,
6261 .apply_expected = true
6264 .type = WREPL_TYPE_UNIQUE,
6265 .state = WREPL_STATE_TOMBSTONE,
6266 .node = WREPL_NODE_B,
6268 .num_ips = ctx->addresses_best_num,
6269 .ips = ctx->addresses_best,
6270 .apply_expected = true
6274 * mhomed,released vs. unique,tombstone with different ip(s)
6277 .line = __location__,
6278 .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL),
6282 .num_ips = ctx->addresses_best_num,
6283 .ips = ctx->addresses_best,
6284 .apply_expected = true
6287 .type = WREPL_TYPE_UNIQUE,
6288 .state = WREPL_STATE_TOMBSTONE,
6289 .node = WREPL_NODE_B,
6291 .num_ips = ARRAY_SIZE(addresses_B_1),
6292 .ips = addresses_B_1,
6293 .apply_expected = true
6297 * multi homed vs. group section
6300 * mhomed,released vs. group,active with same ip(s)
6303 .line = __location__,
6304 .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL),
6308 .num_ips = ctx->addresses_best_num,
6309 .ips = ctx->addresses_best,
6310 .apply_expected = true
6313 .type = WREPL_TYPE_GROUP,
6314 .state = WREPL_STATE_ACTIVE,
6315 .node = WREPL_NODE_B,
6317 .num_ips = ctx->addresses_best_num,
6318 .ips = ctx->addresses_best,
6319 .apply_expected = true
6323 * mhomed,released vs. group,active with different ip(s)
6326 .line = __location__,
6327 .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL),
6331 .num_ips = ctx->addresses_best_num,
6332 .ips = ctx->addresses_best,
6333 .apply_expected = true
6336 .type = WREPL_TYPE_GROUP,
6337 .state = WREPL_STATE_ACTIVE,
6338 .node = WREPL_NODE_B,
6340 .num_ips = ARRAY_SIZE(addresses_B_1),
6341 .ips = addresses_B_1,
6342 .apply_expected = true
6346 * mhomed,released vs. group,tombstone with same ip(s)
6349 .line = __location__,
6350 .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL),
6354 .num_ips = ctx->addresses_best_num,
6355 .ips = ctx->addresses_best,
6356 .apply_expected = true
6359 .type = WREPL_TYPE_GROUP,
6360 .state = WREPL_STATE_TOMBSTONE,
6361 .node = WREPL_NODE_B,
6363 .num_ips = ctx->addresses_best_num,
6364 .ips = ctx->addresses_best,
6365 .apply_expected = true
6369 * mhomed,released vs. group,tombstone with different ip(s)
6372 .line = __location__,
6373 .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL),
6377 .num_ips = ctx->addresses_best_num,
6378 .ips = ctx->addresses_best,
6379 .apply_expected = true
6382 .type = WREPL_TYPE_GROUP,
6383 .state = WREPL_STATE_TOMBSTONE,
6384 .node = WREPL_NODE_B,
6386 .num_ips = ARRAY_SIZE(addresses_B_1),
6387 .ips = addresses_B_1,
6388 .apply_expected = true
6392 * multi homed vs. special group section
6395 * mhomed,released vs. sgroup,active with same ip(s)
6398 .line = __location__,
6399 .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL),
6403 .num_ips = ctx->addresses_best_num,
6404 .ips = ctx->addresses_best,
6405 .apply_expected = true
6408 .type = WREPL_TYPE_SGROUP,
6409 .state = WREPL_STATE_ACTIVE,
6410 .node = WREPL_NODE_B,
6412 .num_ips = ctx->addresses_best_num,
6413 .ips = ctx->addresses_best,
6414 .apply_expected = true
6418 * mhomed,released vs. sgroup,active with different ip(s)
6421 .line = __location__,
6422 .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL),
6426 .num_ips = ctx->addresses_best_num,
6427 .ips = ctx->addresses_best,
6428 .apply_expected = true
6431 .type = WREPL_TYPE_SGROUP,
6432 .state = WREPL_STATE_ACTIVE,
6433 .node = WREPL_NODE_B,
6435 .num_ips = ARRAY_SIZE(addresses_B_1),
6436 .ips = addresses_B_1,
6437 .apply_expected = true
6441 * mhomed,released vs. sgroup,tombstone with same ip(s)
6444 .line = __location__,
6445 .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL),
6449 .num_ips = ctx->addresses_best_num,
6450 .ips = ctx->addresses_best,
6451 .apply_expected = true
6454 .type = WREPL_TYPE_SGROUP,
6455 .state = WREPL_STATE_TOMBSTONE,
6456 .node = WREPL_NODE_B,
6458 .num_ips = ctx->addresses_best_num,
6459 .ips = ctx->addresses_best,
6460 .apply_expected = true
6464 * mhomed,released vs. sgroup,tombstone with different ip(s)
6467 .line = __location__,
6468 .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL),
6472 .num_ips = ctx->addresses_best_num,
6473 .ips = ctx->addresses_best,
6474 .apply_expected = true
6477 .type = WREPL_TYPE_SGROUP,
6478 .state = WREPL_STATE_TOMBSTONE,
6479 .node = WREPL_NODE_B,
6481 .num_ips = ARRAY_SIZE(addresses_B_1),
6482 .ips = addresses_B_1,
6483 .apply_expected = true
6487 * multi homed vs. multi homed section
6490 * mhomed,released vs. mhomed,active with same ip(s)
6493 .line = __location__,
6494 .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL),
6498 .num_ips = ctx->addresses_best_num,
6499 .ips = ctx->addresses_best,
6500 .apply_expected = true
6503 .type = WREPL_TYPE_MHOMED,
6504 .state = WREPL_STATE_ACTIVE,
6505 .node = WREPL_NODE_B,
6507 .num_ips = ctx->addresses_best_num,
6508 .ips = ctx->addresses_best,
6509 .apply_expected = true
6513 * mhomed,released vs. mhomed,active with different ip(s)
6516 .line = __location__,
6517 .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL),
6521 .num_ips = ctx->addresses_best_num,
6522 .ips = ctx->addresses_best,
6523 .apply_expected = true
6526 .type = WREPL_TYPE_MHOMED,
6527 .state = WREPL_STATE_ACTIVE,
6528 .node = WREPL_NODE_B,
6530 .num_ips = ARRAY_SIZE(addresses_B_1),
6531 .ips = addresses_B_1,
6532 .apply_expected = true
6536 * mhomed,released vs. mhomed,tombstone with same ip(s)
6539 .line = __location__,
6540 .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL),
6544 .num_ips = ctx->addresses_best_num,
6545 .ips = ctx->addresses_best,
6546 .apply_expected = true
6549 .type = WREPL_TYPE_MHOMED,
6550 .state = WREPL_STATE_TOMBSTONE,
6551 .node = WREPL_NODE_B,
6553 .num_ips = ctx->addresses_best_num,
6554 .ips = ctx->addresses_best,
6555 .apply_expected = true
6559 * mhomed,released vs. mhomed,tombstone with different ip(s)
6562 .line = __location__,
6563 .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL),
6567 .num_ips = ctx->addresses_best_num,
6568 .ips = ctx->addresses_best,
6569 .apply_expected = true
6572 .type = WREPL_TYPE_MHOMED,
6573 .state = WREPL_STATE_TOMBSTONE,
6574 .node = WREPL_NODE_B,
6576 .num_ips = ARRAY_SIZE(addresses_B_1),
6577 .ips = addresses_B_1,
6578 .apply_expected = true
6583 torture_comment(tctx, "Test Replica records vs. owned released records\n");
6585 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
6586 torture_comment(tctx, "%s => %s\n", nbt_name_string(ctx, &records[i].name),
6587 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
6592 name_register->in.name = records[i].name;
6593 name_register->in.dest_addr = ctx->address;
6594 name_register->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
6595 name_register->in.address = records[i].wins.ips[0].ip;
6596 name_register->in.nb_flags = records[i].wins.nb_flags;
6597 name_register->in.register_demand= false;
6598 name_register->in.broadcast = false;
6599 name_register->in.multi_homed = records[i].wins.mhomed;
6600 name_register->in.ttl = 300000;
6601 name_register->in.timeout = 70;
6602 name_register->in.retries = 0;
6604 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
6605 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6606 torture_comment(tctx, "No response from %s for name register\n", ctx->address);
6609 if (!NT_STATUS_IS_OK(status)) {
6610 torture_comment(tctx, "Bad response from %s for name register - %s\n",
6611 ctx->address, nt_errstr(status));
6614 CHECK_VALUE(tctx, name_register->out.rcode, 0);
6615 CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address);
6616 CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type);
6617 CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name);
6618 CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope);
6619 CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[0].ip);
6621 /* release the record */
6622 release->in.name = records[i].name;
6623 release->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
6624 release->in.dest_addr = ctx->address;
6625 release->in.address = records[i].wins.ips[0].ip;
6626 release->in.nb_flags = records[i].wins.nb_flags;
6627 release->in.broadcast = false;
6628 release->in.timeout = 30;
6629 release->in.retries = 0;
6631 status = nbt_name_release(ctx->nbtsock, ctx, release);
6632 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6633 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
6636 if (!NT_STATUS_IS_OK(status)) {
6637 torture_comment(tctx, "Bad response from %s for name query - %s\n",
6638 ctx->address, nt_errstr(status));
6641 CHECK_VALUE(tctx, release->out.rcode, 0);
6646 wins_name->name = &records[i].name;
6647 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
6648 records[i].replica.state,
6649 records[i].replica.node,
6650 records[i].replica.is_static);
6651 wins_name->id = ++ctx->b.max_version;
6652 if (wins_name->flags & 2) {
6653 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
6654 wins_name->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
6655 records[i].replica.ips);
6657 wins_name->addresses.ip = records[i].replica.ips[0].ip;
6659 wins_name->unknown = "255.255.255.255";
6661 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
6662 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name,
6663 records[i].replica.apply_expected);
6665 if (records[i].replica.apply_expected) {
6666 wins_name->name = &records[i].name;
6667 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
6668 WREPL_STATE_TOMBSTONE,
6669 WREPL_NODE_B, false);
6670 wins_name->id = ++ctx->b.max_version;
6671 wins_name->addresses.ip = addresses_B_1[0].ip;
6672 wins_name->unknown = "255.255.255.255";
6674 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
6675 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
6677 release->in.name = records[i].name;
6678 release->in.dest_addr = ctx->address;
6679 release->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
6680 release->in.address = records[i].wins.ips[0].ip;
6681 release->in.nb_flags = records[i].wins.nb_flags;
6682 release->in.broadcast = false;
6683 release->in.timeout = 30;
6684 release->in.retries = 0;
6686 status = nbt_name_release(ctx->nbtsock, ctx, release);
6687 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6688 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
6691 if (!NT_STATUS_IS_OK(status)) {
6692 torture_comment(tctx, "Bad response from %s for name query - %s\n",
6693 ctx->address, nt_errstr(status));
6696 CHECK_VALUE(tctx, release->out.rcode, 0);
6699 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
6707 struct test_conflict_owned_active_vs_replica_struct {
6708 struct torture_context *tctx;
6709 const char *line; /* just better debugging */
6710 const char *section; /* just better debugging */
6711 struct nbt_name name;
6712 const char *comment;
6718 const struct wrepl_ip *ips;
6719 bool apply_expected;
6724 bool expect_release;
6727 /* when num_ips == 0, then .wins.ips are used */
6729 const struct wrepl_ip *ips;
6732 enum wrepl_name_type type;
6733 enum wrepl_name_state state;
6734 enum wrepl_name_node node;
6737 const struct wrepl_ip *ips;
6738 bool apply_expected;
6744 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
6745 struct nbt_name_packet *req_packet,
6746 struct socket_address *src);
6748 static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx,
6749 struct test_wrepl_conflict_conn *ctx)
6753 struct wrepl_wins_name wins_name_;
6754 struct wrepl_wins_name *wins_name = &wins_name_;
6755 struct nbt_name_register name_register_;
6756 struct nbt_name_register *name_register = &name_register_;
6757 struct nbt_name_release release_;
6758 struct nbt_name_release *release = &release_;
6760 struct test_conflict_owned_active_vs_replica_struct records[] = {
6762 * unique vs. unique section
6765 * unique,active vs. unique,active with same ip(s), unchecked
6769 .line = __location__,
6770 .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL),
6774 .num_ips = ctx->addresses_best_num,
6775 .ips = ctx->addresses_best,
6776 .apply_expected = true
6782 .type = WREPL_TYPE_UNIQUE,
6783 .state = WREPL_STATE_ACTIVE,
6784 .node = WREPL_NODE_B,
6786 .num_ips = ctx->addresses_best_num,
6787 .ips = ctx->addresses_best,
6788 .apply_expected = true
6792 * unique,active vs. unique,active with different ip(s), positive response
6796 .line = __location__,
6797 .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL),
6801 .num_ips = ctx->addresses_best_num,
6802 .ips = ctx->addresses_best,
6803 .apply_expected = true
6810 .type = WREPL_TYPE_UNIQUE,
6811 .state = WREPL_STATE_ACTIVE,
6812 .node = WREPL_NODE_B,
6814 .num_ips = ARRAY_SIZE(addresses_B_1),
6815 .ips = addresses_B_1,
6816 .apply_expected = false
6820 * unique,active vs. unique,active with different ip(s), positive response other ips
6824 .line = __location__,
6825 .name = _NBT_NAME("_UA_UA_DI_O", 0x00, NULL),
6829 .num_ips = ctx->addresses_best_num,
6830 .ips = ctx->addresses_best,
6831 .apply_expected = true
6836 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6837 .ips = addresses_A_3_4,
6840 .type = WREPL_TYPE_UNIQUE,
6841 .state = WREPL_STATE_ACTIVE,
6842 .node = WREPL_NODE_B,
6844 .num_ips = ARRAY_SIZE(addresses_B_1),
6845 .ips = addresses_B_1,
6846 .apply_expected = false
6850 * unique,active vs. unique,active with different ip(s), negative response
6854 .line = __location__,
6855 .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL),
6859 .num_ips = ctx->addresses_best_num,
6860 .ips = ctx->addresses_best,
6861 .apply_expected = true
6868 .type = WREPL_TYPE_UNIQUE,
6869 .state = WREPL_STATE_ACTIVE,
6870 .node = WREPL_NODE_B,
6872 .num_ips = ARRAY_SIZE(addresses_B_1),
6873 .ips = addresses_B_1,
6874 .apply_expected = true
6878 * unique,active vs. unique,tombstone with same ip(s), unchecked
6882 .line = __location__,
6883 .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL),
6887 .num_ips = ctx->addresses_best_num,
6888 .ips = ctx->addresses_best,
6889 .apply_expected = true
6895 .type = WREPL_TYPE_UNIQUE,
6896 .state = WREPL_STATE_TOMBSTONE,
6897 .node = WREPL_NODE_B,
6899 .num_ips = ctx->addresses_best_num,
6900 .ips = ctx->addresses_best,
6901 .apply_expected = false
6905 * unique,active vs. unique,tombstone with different ip(s), unchecked
6909 .line = __location__,
6910 .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL),
6914 .num_ips = ctx->addresses_best_num,
6915 .ips = ctx->addresses_best,
6916 .apply_expected = true
6922 .type = WREPL_TYPE_UNIQUE,
6923 .state = WREPL_STATE_TOMBSTONE,
6924 .node = WREPL_NODE_B,
6926 .num_ips = ARRAY_SIZE(addresses_B_1),
6927 .ips = addresses_B_1,
6928 .apply_expected = false
6932 * unique vs. group section
6935 * unique,active vs. group,active with same ip(s), release expected
6939 .line = __location__,
6940 .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL),
6944 .num_ips = ctx->addresses_best_num,
6945 .ips = ctx->addresses_best,
6946 .apply_expected = true
6950 .expect_release = true,
6953 .type = WREPL_TYPE_GROUP,
6954 .state = WREPL_STATE_ACTIVE,
6955 .node = WREPL_NODE_B,
6957 .num_ips = ctx->addresses_best_num,
6958 .ips = ctx->addresses_best,
6959 .apply_expected = true
6963 * unique,active vs. group,active with different ip(s), release expected
6967 .line = __location__,
6968 .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL),
6972 .num_ips = ctx->addresses_best_num,
6973 .ips = ctx->addresses_best,
6974 .apply_expected = true
6978 .expect_release = true,
6981 .type = WREPL_TYPE_GROUP,
6982 .state = WREPL_STATE_ACTIVE,
6983 .node = WREPL_NODE_B,
6985 .num_ips = ARRAY_SIZE(addresses_B_1),
6986 .ips = addresses_B_1,
6987 .apply_expected = true
6991 * unique,active vs. group,tombstone with same ip(s), unchecked
6995 .line = __location__,
6996 .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL),
7000 .num_ips = ctx->addresses_best_num,
7001 .ips = ctx->addresses_best,
7002 .apply_expected = true
7008 .type = WREPL_TYPE_GROUP,
7009 .state = WREPL_STATE_TOMBSTONE,
7010 .node = WREPL_NODE_B,
7012 .num_ips = ctx->addresses_best_num,
7013 .ips = ctx->addresses_best,
7014 .apply_expected = false
7018 * unique,active vs. group,tombstone with different ip(s), unchecked
7022 .line = __location__,
7023 .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL),
7027 .num_ips = ctx->addresses_best_num,
7028 .ips = ctx->addresses_best,
7029 .apply_expected = true
7035 .type = WREPL_TYPE_GROUP,
7036 .state = WREPL_STATE_TOMBSTONE,
7037 .node = WREPL_NODE_B,
7039 .num_ips = ARRAY_SIZE(addresses_B_1),
7040 .ips = addresses_B_1,
7041 .apply_expected = false
7045 * unique vs. special group section
7048 * unique,active vs. sgroup,active with same ip(s), release expected
7052 .line = __location__,
7053 .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL),
7057 .num_ips = ctx->addresses_best_num,
7058 .ips = ctx->addresses_best,
7059 .apply_expected = true
7063 .expect_release = true,
7066 .type = WREPL_TYPE_SGROUP,
7067 .state = WREPL_STATE_ACTIVE,
7068 .node = WREPL_NODE_B,
7070 .num_ips = ctx->addresses_best_num,
7071 .ips = ctx->addresses_best,
7072 .apply_expected = true
7076 * unique,active vs. group,active with different ip(s), release expected
7080 .line = __location__,
7081 .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL),
7085 .num_ips = ctx->addresses_best_num,
7086 .ips = ctx->addresses_best,
7087 .apply_expected = true
7091 .expect_release = true,
7094 .type = WREPL_TYPE_SGROUP,
7095 .state = WREPL_STATE_ACTIVE,
7096 .node = WREPL_NODE_B,
7098 .num_ips = ARRAY_SIZE(addresses_B_1),
7099 .ips = addresses_B_1,
7100 .apply_expected = true
7104 * unique,active vs. sgroup,tombstone with same ip(s), unchecked
7108 .line = __location__,
7109 .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL),
7113 .num_ips = ctx->addresses_best_num,
7114 .ips = ctx->addresses_best,
7115 .apply_expected = true
7121 .type = WREPL_TYPE_SGROUP,
7122 .state = WREPL_STATE_TOMBSTONE,
7123 .node = WREPL_NODE_B,
7125 .num_ips = ctx->addresses_best_num,
7126 .ips = ctx->addresses_best,
7127 .apply_expected = false
7131 * unique,active vs. sgroup,tombstone with different ip(s), unchecked
7135 .line = __location__,
7136 .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL),
7140 .num_ips = ctx->addresses_best_num,
7141 .ips = ctx->addresses_best,
7142 .apply_expected = true
7148 .type = WREPL_TYPE_SGROUP,
7149 .state = WREPL_STATE_TOMBSTONE,
7150 .node = WREPL_NODE_B,
7152 .num_ips = ARRAY_SIZE(addresses_B_1),
7153 .ips = addresses_B_1,
7154 .apply_expected = false
7158 * unique vs. multi homed section
7161 * unique,active vs. mhomed,active with same ip(s), unchecked
7165 .line = __location__,
7166 .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL),
7170 .num_ips = ctx->addresses_best_num,
7171 .ips = ctx->addresses_best,
7172 .apply_expected = true
7178 .type = WREPL_TYPE_MHOMED,
7179 .state = WREPL_STATE_ACTIVE,
7180 .node = WREPL_NODE_B,
7182 .num_ips = ctx->addresses_best_num,
7183 .ips = ctx->addresses_best,
7184 .apply_expected = true
7188 * unique,active vs. mhomed,active with superset ip(s), unchecked
7192 .line = __location__,
7193 .name = _NBT_NAME("_UA_MA_SP_U", 0x00, NULL),
7197 .num_ips = ctx->addresses_best_num,
7198 .ips = ctx->addresses_best,
7199 .apply_expected = true
7205 .type = WREPL_TYPE_MHOMED,
7206 .state = WREPL_STATE_ACTIVE,
7207 .node = WREPL_NODE_B,
7209 .num_ips = ctx->addresses_all_num,
7210 .ips = ctx->addresses_all,
7211 .apply_expected = true
7215 * unique,active vs. mhomed,active with different ip(s), positive response
7219 .line = __location__,
7220 .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL),
7224 .num_ips = ctx->addresses_best_num,
7225 .ips = ctx->addresses_best,
7226 .apply_expected = true
7233 .type = WREPL_TYPE_MHOMED,
7234 .state = WREPL_STATE_ACTIVE,
7235 .node = WREPL_NODE_B,
7237 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7238 .ips = addresses_B_3_4,
7239 .apply_expected = false
7243 * unique,active vs. mhomed,active with different ip(s), positive response other ips
7247 .line = __location__,
7248 .name = _NBT_NAME("_UA_MA_DI_O", 0x00, NULL),
7252 .num_ips = ctx->addresses_best_num,
7253 .ips = ctx->addresses_best,
7254 .apply_expected = true
7259 .num_ips = ARRAY_SIZE(addresses_A_3_4),
7260 .ips = addresses_A_3_4,
7263 .type = WREPL_TYPE_MHOMED,
7264 .state = WREPL_STATE_ACTIVE,
7265 .node = WREPL_NODE_B,
7267 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7268 .ips = addresses_B_3_4,
7269 .apply_expected = false
7273 * unique,active vs. mhomed,active with different ip(s), negative response
7277 .line = __location__,
7278 .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL),
7282 .num_ips = ctx->addresses_best_num,
7283 .ips = ctx->addresses_best,
7284 .apply_expected = true
7291 .type = WREPL_TYPE_MHOMED,
7292 .state = WREPL_STATE_ACTIVE,
7293 .node = WREPL_NODE_B,
7295 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7296 .ips = addresses_B_3_4,
7297 .apply_expected = true
7301 * unique,active vs. mhomed,tombstone with same ip(s), unchecked
7305 .line = __location__,
7306 .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL),
7310 .num_ips = ctx->addresses_best_num,
7311 .ips = ctx->addresses_best,
7312 .apply_expected = true
7318 .type = WREPL_TYPE_MHOMED,
7319 .state = WREPL_STATE_TOMBSTONE,
7320 .node = WREPL_NODE_B,
7322 .num_ips = ctx->addresses_best_num,
7323 .ips = ctx->addresses_best,
7324 .apply_expected = false
7328 * unique,active vs. mhomed,tombstone with different ip(s), unchecked
7332 .line = __location__,
7333 .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL),
7337 .num_ips = ctx->addresses_best_num,
7338 .ips = ctx->addresses_best,
7339 .apply_expected = true
7345 .type = WREPL_TYPE_MHOMED,
7346 .state = WREPL_STATE_TOMBSTONE,
7347 .node = WREPL_NODE_B,
7349 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7350 .ips = addresses_B_3_4,
7351 .apply_expected = false
7355 * normal group vs. unique section
7358 * group,active vs. unique,active with same ip(s), unchecked
7362 .line = __location__,
7363 .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL),
7365 .nb_flags = NBT_NM_GROUP,
7367 .num_ips = ctx->addresses_best_num,
7368 .ips = ctx->addresses_best,
7369 .apply_expected = true
7375 .type = WREPL_TYPE_UNIQUE,
7376 .state = WREPL_STATE_ACTIVE,
7377 .node = WREPL_NODE_B,
7379 .num_ips = ctx->addresses_best_num,
7380 .ips = ctx->addresses_best,
7381 .apply_expected = false
7385 * group,active vs. unique,active with different ip(s), unchecked
7389 .line = __location__,
7390 .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL),
7392 .nb_flags = NBT_NM_GROUP,
7394 .num_ips = ctx->addresses_best_num,
7395 .ips = ctx->addresses_best,
7396 .apply_expected = true
7402 .type = WREPL_TYPE_UNIQUE,
7403 .state = WREPL_STATE_ACTIVE,
7404 .node = WREPL_NODE_B,
7406 .num_ips = ARRAY_SIZE(addresses_B_1),
7407 .ips = addresses_B_1,
7408 .apply_expected = false
7412 * group,active vs. unique,tombstone with same ip(s), unchecked
7416 .line = __location__,
7417 .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL),
7419 .nb_flags = NBT_NM_GROUP,
7421 .num_ips = ctx->addresses_best_num,
7422 .ips = ctx->addresses_best,
7423 .apply_expected = true
7429 .type = WREPL_TYPE_UNIQUE,
7430 .state = WREPL_STATE_TOMBSTONE,
7431 .node = WREPL_NODE_B,
7433 .num_ips = ctx->addresses_best_num,
7434 .ips = ctx->addresses_best,
7435 .apply_expected = false
7439 * group,active vs. unique,tombstone with different ip(s), unchecked
7443 .line = __location__,
7444 .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL),
7446 .nb_flags = NBT_NM_GROUP,
7448 .num_ips = ctx->addresses_best_num,
7449 .ips = ctx->addresses_best,
7450 .apply_expected = true
7456 .type = WREPL_TYPE_UNIQUE,
7457 .state = WREPL_STATE_TOMBSTONE,
7458 .node = WREPL_NODE_B,
7460 .num_ips = ARRAY_SIZE(addresses_B_1),
7461 .ips = addresses_B_1,
7462 .apply_expected = false
7466 * normal group vs. normal group section
7469 * group,active vs. group,active with same ip(s), unchecked
7473 .line = __location__,
7474 .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL),
7476 .nb_flags = NBT_NM_GROUP,
7478 .num_ips = ctx->addresses_best_num,
7479 .ips = ctx->addresses_best,
7480 .apply_expected = true
7486 .type = WREPL_TYPE_GROUP,
7487 .state = WREPL_STATE_ACTIVE,
7488 .node = WREPL_NODE_B,
7490 .num_ips = ctx->addresses_best_num,
7491 .ips = ctx->addresses_best,
7492 .apply_expected = true
7496 * group,active vs. group,active with different ip(s), unchecked
7500 .line = __location__,
7501 .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL),
7503 .nb_flags = NBT_NM_GROUP,
7505 .num_ips = ctx->addresses_best_num,
7506 .ips = ctx->addresses_best,
7507 .apply_expected = true
7513 .type = WREPL_TYPE_GROUP,
7514 .state = WREPL_STATE_ACTIVE,
7515 .node = WREPL_NODE_B,
7517 .num_ips = ARRAY_SIZE(addresses_B_1),
7518 .ips = addresses_B_1,
7519 .apply_expected = true
7523 * group,active vs. group,tombstone with same ip(s), unchecked
7527 .line = __location__,
7528 .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL),
7530 .nb_flags = NBT_NM_GROUP,
7532 .num_ips = ctx->addresses_best_num,
7533 .ips = ctx->addresses_best,
7534 .apply_expected = true
7540 .type = WREPL_TYPE_GROUP,
7541 .state = WREPL_STATE_TOMBSTONE,
7542 .node = WREPL_NODE_B,
7544 .num_ips = ctx->addresses_best_num,
7545 .ips = ctx->addresses_best,
7546 .apply_expected = false
7550 * group,active vs. group,tombstone with different ip(s), unchecked
7554 .line = __location__,
7555 .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL),
7557 .nb_flags = NBT_NM_GROUP,
7559 .num_ips = ctx->addresses_best_num,
7560 .ips = ctx->addresses_best,
7561 .apply_expected = true
7567 .type = WREPL_TYPE_GROUP,
7568 .state = WREPL_STATE_TOMBSTONE,
7569 .node = WREPL_NODE_B,
7571 .num_ips = ARRAY_SIZE(addresses_B_1),
7572 .ips = addresses_B_1,
7573 .apply_expected = false
7577 * normal group vs. special group section
7580 * group,active vs. sgroup,active with same ip(s), unchecked
7584 .line = __location__,
7585 .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL),
7587 .nb_flags = NBT_NM_GROUP,
7589 .num_ips = ctx->addresses_best_num,
7590 .ips = ctx->addresses_best,
7591 .apply_expected = true
7597 .type = WREPL_TYPE_SGROUP,
7598 .state = WREPL_STATE_ACTIVE,
7599 .node = WREPL_NODE_B,
7601 .num_ips = ctx->addresses_best_num,
7602 .ips = ctx->addresses_best,
7603 .apply_expected = false
7607 * group,active vs. sgroup,active with different ip(s), unchecked
7611 .line = __location__,
7612 .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL),
7614 .nb_flags = NBT_NM_GROUP,
7616 .num_ips = ctx->addresses_best_num,
7617 .ips = ctx->addresses_best,
7618 .apply_expected = true
7624 .type = WREPL_TYPE_SGROUP,
7625 .state = WREPL_STATE_ACTIVE,
7626 .node = WREPL_NODE_B,
7628 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7629 .ips = addresses_B_3_4,
7630 .apply_expected = false
7634 * group,active vs. sgroup,tombstone with same ip(s), unchecked
7638 .line = __location__,
7639 .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL),
7641 .nb_flags = NBT_NM_GROUP,
7643 .num_ips = ctx->addresses_best_num,
7644 .ips = ctx->addresses_best,
7645 .apply_expected = true
7651 .type = WREPL_TYPE_SGROUP,
7652 .state = WREPL_STATE_TOMBSTONE,
7653 .node = WREPL_NODE_B,
7655 .num_ips = ctx->addresses_best_num,
7656 .ips = ctx->addresses_best,
7657 .apply_expected = false
7661 * group,active vs. sgroup,tombstone with different ip(s), unchecked
7665 .line = __location__,
7666 .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL),
7668 .nb_flags = NBT_NM_GROUP,
7670 .num_ips = ctx->addresses_best_num,
7671 .ips = ctx->addresses_best,
7672 .apply_expected = true
7678 .type = WREPL_TYPE_SGROUP,
7679 .state = WREPL_STATE_TOMBSTONE,
7680 .node = WREPL_NODE_B,
7682 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7683 .ips = addresses_B_3_4,
7684 .apply_expected = false
7688 * normal group vs. multi homed section
7691 * group,active vs. mhomed,active with same ip(s), unchecked
7695 .line = __location__,
7696 .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL),
7698 .nb_flags = NBT_NM_GROUP,
7700 .num_ips = ctx->addresses_best_num,
7701 .ips = ctx->addresses_best,
7702 .apply_expected = true
7708 .type = WREPL_TYPE_MHOMED,
7709 .state = WREPL_STATE_ACTIVE,
7710 .node = WREPL_NODE_B,
7712 .num_ips = ctx->addresses_best_num,
7713 .ips = ctx->addresses_best,
7714 .apply_expected = false
7718 * group,active vs. mhomed,active with different ip(s), unchecked
7722 .line = __location__,
7723 .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL),
7725 .nb_flags = NBT_NM_GROUP,
7727 .num_ips = ctx->addresses_best_num,
7728 .ips = ctx->addresses_best,
7729 .apply_expected = true
7735 .type = WREPL_TYPE_MHOMED,
7736 .state = WREPL_STATE_ACTIVE,
7737 .node = WREPL_NODE_B,
7739 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7740 .ips = addresses_B_3_4,
7741 .apply_expected = false
7745 * group,active vs. mhomed,tombstone with same ip(s), unchecked
7749 .line = __location__,
7750 .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL),
7752 .nb_flags = NBT_NM_GROUP,
7754 .num_ips = ctx->addresses_best_num,
7755 .ips = ctx->addresses_best,
7756 .apply_expected = true
7762 .type = WREPL_TYPE_MHOMED,
7763 .state = WREPL_STATE_TOMBSTONE,
7764 .node = WREPL_NODE_B,
7766 .num_ips = ctx->addresses_best_num,
7767 .ips = ctx->addresses_best,
7768 .apply_expected = false
7772 * group,active vs. mhomed,tombstone with different ip(s), unchecked
7776 .line = __location__,
7777 .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL),
7779 .nb_flags = NBT_NM_GROUP,
7781 .num_ips = ctx->addresses_best_num,
7782 .ips = ctx->addresses_best,
7783 .apply_expected = true
7789 .type = WREPL_TYPE_MHOMED,
7790 .state = WREPL_STATE_TOMBSTONE,
7791 .node = WREPL_NODE_B,
7793 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7794 .ips = addresses_B_3_4,
7795 .apply_expected = false
7799 * special group vs. unique section
7802 * sgroup,active vs. unique,active with same ip(s), unchecked
7806 .line = __location__,
7807 .name = _NBT_NAME("_SA_UA_SI_U", 0x1C, NULL),
7809 .nb_flags = NBT_NM_GROUP,
7811 .num_ips = ctx->addresses_best_num,
7812 .ips = ctx->addresses_best,
7813 .apply_expected = true
7819 .type = WREPL_TYPE_UNIQUE,
7820 .state = WREPL_STATE_ACTIVE,
7821 .node = WREPL_NODE_B,
7823 .num_ips = ctx->addresses_best_num,
7824 .ips = ctx->addresses_best,
7825 .apply_expected = false
7829 * sgroup,active vs. unique,active with different ip(s), unchecked
7833 .line = __location__,
7834 .name = _NBT_NAME("_SA_UA_DI_U", 0x1C, NULL),
7836 .nb_flags = NBT_NM_GROUP,
7838 .num_ips = ctx->addresses_best_num,
7839 .ips = ctx->addresses_best,
7840 .apply_expected = true
7846 .type = WREPL_TYPE_UNIQUE,
7847 .state = WREPL_STATE_ACTIVE,
7848 .node = WREPL_NODE_B,
7850 .num_ips = ARRAY_SIZE(addresses_B_1),
7851 .ips = addresses_B_1,
7852 .apply_expected = false
7856 * sgroup,active vs. unique,tombstone with same ip(s), unchecked
7860 .line = __location__,
7861 .name = _NBT_NAME("_SA_UT_SI_U", 0x1C, NULL),
7863 .nb_flags = NBT_NM_GROUP,
7865 .num_ips = ctx->addresses_best_num,
7866 .ips = ctx->addresses_best,
7867 .apply_expected = true
7873 .type = WREPL_TYPE_UNIQUE,
7874 .state = WREPL_STATE_TOMBSTONE,
7875 .node = WREPL_NODE_B,
7877 .num_ips = ctx->addresses_best_num,
7878 .ips = ctx->addresses_best,
7879 .apply_expected = false
7883 * sgroup,active vs. unique,tombstone with different ip(s), unchecked
7887 .line = __location__,
7888 .name = _NBT_NAME("_SA_UT_DI_U", 0x1C, NULL),
7890 .nb_flags = NBT_NM_GROUP,
7892 .num_ips = ctx->addresses_best_num,
7893 .ips = ctx->addresses_best,
7894 .apply_expected = true
7900 .type = WREPL_TYPE_UNIQUE,
7901 .state = WREPL_STATE_TOMBSTONE,
7902 .node = WREPL_NODE_B,
7904 .num_ips = ARRAY_SIZE(addresses_B_1),
7905 .ips = addresses_B_1,
7906 .apply_expected = false
7910 * special group vs. normal group section
7913 * sgroup,active vs. group,active with same ip(s), unchecked
7917 .line = __location__,
7918 .name = _NBT_NAME("_SA_GA_SI_U", 0x1C, NULL),
7920 .nb_flags = NBT_NM_GROUP,
7922 .num_ips = ctx->addresses_best_num,
7923 .ips = ctx->addresses_best,
7924 .apply_expected = true
7930 .type = WREPL_TYPE_GROUP,
7931 .state = WREPL_STATE_ACTIVE,
7932 .node = WREPL_NODE_B,
7934 .num_ips = ctx->addresses_best_num,
7935 .ips = ctx->addresses_best,
7936 .apply_expected = false
7940 * sgroup,active vs. group,active with different ip(s), unchecked
7944 .line = __location__,
7945 .name = _NBT_NAME("_SA_GA_DI_U", 0x1C, NULL),
7947 .nb_flags = NBT_NM_GROUP,
7949 .num_ips = ctx->addresses_best_num,
7950 .ips = ctx->addresses_best,
7951 .apply_expected = true
7957 .type = WREPL_TYPE_GROUP,
7958 .state = WREPL_STATE_ACTIVE,
7959 .node = WREPL_NODE_B,
7961 .num_ips = ARRAY_SIZE(addresses_B_1),
7962 .ips = addresses_B_1,
7963 .apply_expected = false
7967 * sgroup,active vs. group,tombstone with same ip(s), unchecked
7971 .line = __location__,
7972 .name = _NBT_NAME("_SA_GT_SI_U", 0x1C, NULL),
7974 .nb_flags = NBT_NM_GROUP,
7976 .num_ips = ctx->addresses_best_num,
7977 .ips = ctx->addresses_best,
7978 .apply_expected = true
7984 .type = WREPL_TYPE_GROUP,
7985 .state = WREPL_STATE_TOMBSTONE,
7986 .node = WREPL_NODE_B,
7988 .num_ips = ctx->addresses_best_num,
7989 .ips = ctx->addresses_best,
7990 .apply_expected = false
7994 * sgroup,active vs. group,tombstone with different ip(s), unchecked
7998 .line = __location__,
7999 .name = _NBT_NAME("_SA_GT_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_GROUP,
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 * special group vs. multi homed section
8024 * sgroup,active vs. mhomed,active with same ip(s), unchecked
8028 .line = __location__,
8029 .name = _NBT_NAME("_SA_MA_SI_U", 0x1C, NULL),
8031 .nb_flags = NBT_NM_GROUP,
8033 .num_ips = ctx->addresses_best_num,
8034 .ips = ctx->addresses_best,
8035 .apply_expected = true
8041 .type = WREPL_TYPE_MHOMED,
8042 .state = WREPL_STATE_ACTIVE,
8043 .node = WREPL_NODE_B,
8045 .num_ips = ctx->addresses_best_num,
8046 .ips = ctx->addresses_best,
8047 .apply_expected = false
8051 * sgroup,active vs. mhomed,active with different ip(s), unchecked
8055 .line = __location__,
8056 .name = _NBT_NAME("_SA_MA_DI_U", 0x1C, NULL),
8058 .nb_flags = NBT_NM_GROUP,
8060 .num_ips = ctx->addresses_best_num,
8061 .ips = ctx->addresses_best,
8062 .apply_expected = true
8068 .type = WREPL_TYPE_MHOMED,
8069 .state = WREPL_STATE_ACTIVE,
8070 .node = WREPL_NODE_B,
8072 .num_ips = ARRAY_SIZE(addresses_B_1),
8073 .ips = addresses_B_1,
8074 .apply_expected = false
8078 * sgroup,active vs. mhomed,tombstone with same ip(s), unchecked
8082 .line = __location__,
8083 .name = _NBT_NAME("_SA_MT_SI_U", 0x1C, NULL),
8085 .nb_flags = NBT_NM_GROUP,
8087 .num_ips = ctx->addresses_best_num,
8088 .ips = ctx->addresses_best,
8089 .apply_expected = true
8095 .type = WREPL_TYPE_MHOMED,
8096 .state = WREPL_STATE_TOMBSTONE,
8097 .node = WREPL_NODE_B,
8099 .num_ips = ctx->addresses_best_num,
8100 .ips = ctx->addresses_best,
8101 .apply_expected = false
8105 * sgroup,active vs. mhomed,tombstone with different ip(s), unchecked
8109 .line = __location__,
8110 .name = _NBT_NAME("_SA_MT_DI_U", 0x1C, NULL),
8112 .nb_flags = NBT_NM_GROUP,
8114 .num_ips = ctx->addresses_best_num,
8115 .ips = ctx->addresses_best,
8116 .apply_expected = true
8122 .type = WREPL_TYPE_MHOMED,
8123 .state = WREPL_STATE_TOMBSTONE,
8124 .node = WREPL_NODE_B,
8126 .num_ips = ARRAY_SIZE(addresses_B_1),
8127 .ips = addresses_B_1,
8128 .apply_expected = false
8132 * multi homed vs. unique section
8135 * mhomed,active vs. unique,active with same ip(s), unchecked
8139 .line = __location__,
8140 .name = _NBT_NAME("_MA_UA_SI_U", 0x00, NULL),
8144 .num_ips = ctx->addresses_best_num,
8145 .ips = ctx->addresses_best,
8146 .apply_expected = true
8152 .type = WREPL_TYPE_UNIQUE,
8153 .state = WREPL_STATE_ACTIVE,
8154 .node = WREPL_NODE_B,
8156 .num_ips = ctx->addresses_best_num,
8157 .ips = ctx->addresses_best,
8158 .apply_expected = true
8162 * mhomed,active vs. unique,active with different ip(s), positive response
8166 .line = __location__,
8167 .name = _NBT_NAME("_MA_UA_DI_P", 0x00, NULL),
8171 .num_ips = ctx->addresses_best_num,
8172 .ips = ctx->addresses_best,
8173 .apply_expected = true
8180 .type = WREPL_TYPE_UNIQUE,
8181 .state = WREPL_STATE_ACTIVE,
8182 .node = WREPL_NODE_B,
8184 .num_ips = ARRAY_SIZE(addresses_B_1),
8185 .ips = addresses_B_1,
8186 .apply_expected = false
8190 * mhomed,active vs. unique,active with different ip(s), positive response other ips
8194 .line = __location__,
8195 .name = _NBT_NAME("_MA_UA_DI_O", 0x00, NULL),
8199 .num_ips = ctx->addresses_best_num,
8200 .ips = ctx->addresses_best,
8201 .apply_expected = true
8206 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8207 .ips = addresses_A_3_4,
8210 .type = WREPL_TYPE_UNIQUE,
8211 .state = WREPL_STATE_ACTIVE,
8212 .node = WREPL_NODE_B,
8214 .num_ips = ARRAY_SIZE(addresses_B_1),
8215 .ips = addresses_B_1,
8216 .apply_expected = false
8220 * mhomed,active vs. unique,active with different ip(s), negative response
8224 .line = __location__,
8225 .name = _NBT_NAME("_MA_UA_DI_N", 0x00, NULL),
8229 .num_ips = ctx->addresses_best_num,
8230 .ips = ctx->addresses_best,
8231 .apply_expected = true
8238 .type = WREPL_TYPE_UNIQUE,
8239 .state = WREPL_STATE_ACTIVE,
8240 .node = WREPL_NODE_B,
8242 .num_ips = ARRAY_SIZE(addresses_B_1),
8243 .ips = addresses_B_1,
8244 .apply_expected = true
8248 * mhomed,active vs. unique,tombstone with same ip(s), unchecked
8252 .line = __location__,
8253 .name = _NBT_NAME("_MA_UT_SI_U", 0x00, NULL),
8257 .num_ips = ctx->addresses_best_num,
8258 .ips = ctx->addresses_best,
8259 .apply_expected = true
8265 .type = WREPL_TYPE_UNIQUE,
8266 .state = WREPL_STATE_TOMBSTONE,
8267 .node = WREPL_NODE_B,
8269 .num_ips = ctx->addresses_best_num,
8270 .ips = ctx->addresses_best,
8271 .apply_expected = false
8275 * mhomed,active vs. unique,tombstone with different ip(s), unchecked
8279 .line = __location__,
8280 .name = _NBT_NAME("_MA_UT_DI_U", 0x00, NULL),
8284 .num_ips = ctx->addresses_best_num,
8285 .ips = ctx->addresses_best,
8286 .apply_expected = true
8292 .type = WREPL_TYPE_UNIQUE,
8293 .state = WREPL_STATE_TOMBSTONE,
8294 .node = WREPL_NODE_B,
8296 .num_ips = ARRAY_SIZE(addresses_B_1),
8297 .ips = addresses_B_1,
8298 .apply_expected = false
8302 * multi homed vs. normal group section
8305 * mhomed,active vs. group,active with same ip(s), release expected
8309 .line = __location__,
8310 .name = _NBT_NAME("_MA_GA_SI_R", 0x00, NULL),
8314 .num_ips = ctx->addresses_best_num,
8315 .ips = ctx->addresses_best,
8316 .apply_expected = true
8320 .expect_release = true,
8323 .type = WREPL_TYPE_GROUP,
8324 .state = WREPL_STATE_ACTIVE,
8325 .node = WREPL_NODE_B,
8327 .num_ips = ctx->addresses_best_num,
8328 .ips = ctx->addresses_best,
8329 .apply_expected = true
8333 * mhomed,active vs. group,active with different ip(s), release expected
8337 .line = __location__,
8338 .name = _NBT_NAME("_MA_GA_DI_R", 0x00, NULL),
8342 .num_ips = ctx->addresses_best_num,
8343 .ips = ctx->addresses_best,
8344 .apply_expected = true
8348 .expect_release = true,
8351 .type = WREPL_TYPE_GROUP,
8352 .state = WREPL_STATE_ACTIVE,
8353 .node = WREPL_NODE_B,
8355 .num_ips = ARRAY_SIZE(addresses_B_1),
8356 .ips = addresses_B_1,
8357 .apply_expected = true
8361 * mhomed,active vs. group,tombstone with same ip(s), unchecked
8365 .line = __location__,
8366 .name = _NBT_NAME("_MA_GT_SI_U", 0x00, NULL),
8370 .num_ips = ctx->addresses_best_num,
8371 .ips = ctx->addresses_best,
8372 .apply_expected = true
8378 .type = WREPL_TYPE_GROUP,
8379 .state = WREPL_STATE_TOMBSTONE,
8380 .node = WREPL_NODE_B,
8382 .num_ips = ctx->addresses_best_num,
8383 .ips = ctx->addresses_best,
8384 .apply_expected = false
8388 * mhomed,active vs. group,tombstone with different ip(s), unchecked
8392 .line = __location__,
8393 .name = _NBT_NAME("_MA_GT_DI_U", 0x00, NULL),
8397 .num_ips = ctx->addresses_best_num,
8398 .ips = ctx->addresses_best,
8399 .apply_expected = true
8405 .type = WREPL_TYPE_GROUP,
8406 .state = WREPL_STATE_TOMBSTONE,
8407 .node = WREPL_NODE_B,
8409 .num_ips = ARRAY_SIZE(addresses_B_1),
8410 .ips = addresses_B_1,
8411 .apply_expected = false
8415 * multi homed vs. special group section
8418 * mhomed,active vs. sgroup,active with same ip(s), release expected
8422 .line = __location__,
8423 .name = _NBT_NAME("_MA_SA_SI_R", 0x00, NULL),
8427 .num_ips = ctx->addresses_best_num,
8428 .ips = ctx->addresses_best,
8429 .apply_expected = true
8433 .expect_release = true,
8436 .type = WREPL_TYPE_SGROUP,
8437 .state = WREPL_STATE_ACTIVE,
8438 .node = WREPL_NODE_B,
8440 .num_ips = ctx->addresses_best_num,
8441 .ips = ctx->addresses_best,
8442 .apply_expected = true
8446 * mhomed,active vs. group,active with different ip(s), release expected
8450 .line = __location__,
8451 .name = _NBT_NAME("_MA_SA_DI_R", 0x00, NULL),
8455 .num_ips = ctx->addresses_best_num,
8456 .ips = ctx->addresses_best,
8457 .apply_expected = true
8461 .expect_release = true,
8464 .type = WREPL_TYPE_SGROUP,
8465 .state = WREPL_STATE_ACTIVE,
8466 .node = WREPL_NODE_B,
8468 .num_ips = ARRAY_SIZE(addresses_B_1),
8469 .ips = addresses_B_1,
8470 .apply_expected = true
8474 * mhomed,active vs. sgroup,tombstone with same ip(s), unchecked
8478 .line = __location__,
8479 .name = _NBT_NAME("_MA_ST_SI_U", 0x00, NULL),
8483 .num_ips = ctx->addresses_best_num,
8484 .ips = ctx->addresses_best,
8485 .apply_expected = true
8491 .type = WREPL_TYPE_SGROUP,
8492 .state = WREPL_STATE_TOMBSTONE,
8493 .node = WREPL_NODE_B,
8495 .num_ips = ctx->addresses_best_num,
8496 .ips = ctx->addresses_best,
8497 .apply_expected = false
8501 * mhomed,active vs. sgroup,tombstone with different ip(s), unchecked
8505 .line = __location__,
8506 .name = _NBT_NAME("_MA_ST_DI_U", 0x00, NULL),
8510 .num_ips = ctx->addresses_best_num,
8511 .ips = ctx->addresses_best,
8512 .apply_expected = true
8518 .type = WREPL_TYPE_SGROUP,
8519 .state = WREPL_STATE_TOMBSTONE,
8520 .node = WREPL_NODE_B,
8522 .num_ips = ARRAY_SIZE(addresses_B_1),
8523 .ips = addresses_B_1,
8524 .apply_expected = false
8528 * multi homed vs. multi homed section
8531 * mhomed,active vs. mhomed,active with same ip(s), unchecked
8535 .line = __location__,
8536 .name = _NBT_NAME("_MA_MA_SI_U", 0x00, NULL),
8540 .num_ips = ctx->addresses_best_num,
8541 .ips = ctx->addresses_best,
8542 .apply_expected = true
8548 .type = WREPL_TYPE_MHOMED,
8549 .state = WREPL_STATE_ACTIVE,
8550 .node = WREPL_NODE_B,
8552 .num_ips = ctx->addresses_best_num,
8553 .ips = ctx->addresses_best,
8554 .apply_expected = true
8558 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8562 .line = __location__,
8563 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8567 .num_ips = ctx->addresses_best_num,
8568 .ips = ctx->addresses_best,
8569 .apply_expected = true
8575 .type = WREPL_TYPE_MHOMED,
8576 .state = WREPL_STATE_ACTIVE,
8577 .node = WREPL_NODE_B,
8579 .num_ips = ctx->addresses_all_num,
8580 .ips = ctx->addresses_all,
8581 .apply_expected = true
8585 * mhomed,active vs. mhomed,active with different ip(s), positive response
8589 .line = __location__,
8590 .name = _NBT_NAME("_MA_MA_DI_P", 0x00, NULL),
8594 .num_ips = ctx->addresses_best_num,
8595 .ips = ctx->addresses_best,
8596 .apply_expected = true
8603 .type = WREPL_TYPE_MHOMED,
8604 .state = WREPL_STATE_ACTIVE,
8605 .node = WREPL_NODE_B,
8607 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8608 .ips = addresses_B_3_4,
8609 .apply_expected = false
8613 * mhomed,active vs. mhomed,active with different ip(s), positive response other ips
8617 .line = __location__,
8618 .name = _NBT_NAME("_MA_MA_DI_O", 0x00, NULL),
8622 .num_ips = ctx->addresses_best_num,
8623 .ips = ctx->addresses_best,
8624 .apply_expected = true
8629 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8630 .ips = addresses_A_3_4,
8633 .type = WREPL_TYPE_MHOMED,
8634 .state = WREPL_STATE_ACTIVE,
8635 .node = WREPL_NODE_B,
8637 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8638 .ips = addresses_B_3_4,
8639 .apply_expected = false
8643 * mhomed,active vs. mhomed,active with different ip(s), negative response
8647 .line = __location__,
8648 .name = _NBT_NAME("_MA_MA_DI_N", 0x00, NULL),
8652 .num_ips = ctx->addresses_best_num,
8653 .ips = ctx->addresses_best,
8654 .apply_expected = true
8661 .type = WREPL_TYPE_MHOMED,
8662 .state = WREPL_STATE_ACTIVE,
8663 .node = WREPL_NODE_B,
8665 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8666 .ips = addresses_B_3_4,
8667 .apply_expected = true
8671 * mhomed,active vs. mhomed,tombstone with same ip(s), unchecked
8675 .line = __location__,
8676 .name = _NBT_NAME("_MA_MT_SI_U", 0x00, NULL),
8680 .num_ips = ctx->addresses_best_num,
8681 .ips = ctx->addresses_best,
8682 .apply_expected = true
8688 .type = WREPL_TYPE_MHOMED,
8689 .state = WREPL_STATE_TOMBSTONE,
8690 .node = WREPL_NODE_B,
8692 .num_ips = ctx->addresses_best_num,
8693 .ips = ctx->addresses_best,
8694 .apply_expected = false
8698 * mhomed,active vs. mhomed,tombstone with different ip(s), unchecked
8702 .line = __location__,
8703 .name = _NBT_NAME("_MA_MT_DI_U", 0x00, NULL),
8707 .num_ips = ctx->addresses_best_num,
8708 .ips = ctx->addresses_best,
8709 .apply_expected = true
8715 .type = WREPL_TYPE_MHOMED,
8716 .state = WREPL_STATE_TOMBSTONE,
8717 .node = WREPL_NODE_B,
8719 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8720 .ips = addresses_B_3_4,
8721 .apply_expected = false
8725 * some more multi homed test, including merging
8728 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8732 .line = __location__,
8733 .section= "Test Replica vs. owned active: some more MHOMED combinations",
8734 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8735 .comment= "C:MHOMED vs. B:ALL => B:ALL",
8736 .skip = (ctx->addresses_all_num < 3),
8740 .num_ips = ctx->addresses_mhomed_num,
8741 .ips = ctx->addresses_mhomed,
8742 .apply_expected = true
8748 .type = WREPL_TYPE_MHOMED,
8749 .state = WREPL_STATE_ACTIVE,
8750 .node = WREPL_NODE_B,
8752 .num_ips = ctx->addresses_all_num,
8753 .ips = ctx->addresses_all,
8754 .apply_expected = true
8758 * mhomed,active vs. mhomed,active with same ips, unchecked
8762 .line = __location__,
8763 .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL),
8764 .comment= "C:MHOMED vs. B:MHOMED => B:MHOMED",
8765 .skip = (ctx->addresses_mhomed_num < 2),
8769 .num_ips = ctx->addresses_mhomed_num,
8770 .ips = ctx->addresses_mhomed,
8771 .apply_expected = true
8777 .type = WREPL_TYPE_MHOMED,
8778 .state = WREPL_STATE_ACTIVE,
8779 .node = WREPL_NODE_B,
8781 .num_ips = ctx->addresses_mhomed_num,
8782 .ips = ctx->addresses_mhomed,
8783 .apply_expected = true
8787 * mhomed,active vs. mhomed,active with subset ip(s), positive response
8791 .line = __location__,
8792 .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL),
8793 .comment= "C:MHOMED vs. B:BEST (C:MHOMED) => B:MHOMED",
8794 .skip = (ctx->addresses_mhomed_num < 2),
8798 .num_ips = ctx->addresses_mhomed_num,
8799 .ips = ctx->addresses_mhomed,
8800 .apply_expected = true
8807 .type = WREPL_TYPE_MHOMED,
8808 .state = WREPL_STATE_ACTIVE,
8809 .node = WREPL_NODE_B,
8811 .num_ips = ctx->addresses_best_num,
8812 .ips = ctx->addresses_best,
8813 .mhomed_merge = true
8817 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with all addresses
8821 .line = __location__,
8822 .name = _NBT_NAME("_MA_MA_SB_A", 0x00, NULL),
8823 .comment= "C:MHOMED vs. B:BEST (C:ALL) => B:MHOMED",
8824 .skip = (ctx->addresses_all_num < 3),
8828 .num_ips = ctx->addresses_mhomed_num,
8829 .ips = ctx->addresses_mhomed,
8830 .apply_expected = true
8835 .num_ips = ctx->addresses_all_num,
8836 .ips = ctx->addresses_all,
8839 .type = WREPL_TYPE_MHOMED,
8840 .state = WREPL_STATE_ACTIVE,
8841 .node = WREPL_NODE_B,
8843 .num_ips = ctx->addresses_best_num,
8844 .ips = ctx->addresses_best,
8845 .mhomed_merge = true
8849 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with replicas addresses
8850 * TODO: check why the server sends a name release demand for one address?
8851 * the release demand has no effect to the database record...
8855 .line = __location__,
8856 .name = _NBT_NAME("_MA_MA_SB_PRA", 0x00, NULL),
8857 .comment= "C:MHOMED vs. B:BEST (C:BEST) => C:MHOMED",
8858 .skip = (ctx->addresses_all_num < 2),
8862 .num_ips = ctx->addresses_mhomed_num,
8863 .ips = ctx->addresses_mhomed,
8864 .apply_expected = true
8869 .num_ips = ctx->addresses_best_num,
8870 .ips = ctx->addresses_best,
8871 .late_release = true
8874 .type = WREPL_TYPE_MHOMED,
8875 .state = WREPL_STATE_ACTIVE,
8876 .node = WREPL_NODE_B,
8878 .num_ips = ctx->addresses_best_num,
8879 .ips = ctx->addresses_best,
8880 .apply_expected = false
8884 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with other addresses
8888 .line = __location__,
8889 .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL),
8890 .comment= "C:MHOMED vs. B:BEST (B:B_3_4) =>C:MHOMED",
8891 .skip = (ctx->addresses_all_num < 2),
8895 .num_ips = ctx->addresses_mhomed_num,
8896 .ips = ctx->addresses_mhomed,
8897 .apply_expected = true
8902 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8903 .ips = addresses_B_3_4,
8906 .type = WREPL_TYPE_MHOMED,
8907 .state = WREPL_STATE_ACTIVE,
8908 .node = WREPL_NODE_B,
8910 .num_ips = ctx->addresses_best_num,
8911 .ips = ctx->addresses_best,
8912 .apply_expected = false
8916 * mhomed,active vs. mhomed,active with subset ip(s), negative response
8920 .line = __location__,
8921 .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL),
8922 .comment= "C:MHOMED vs. B:BEST (NEGATIVE) => B:BEST",
8923 .skip = (ctx->addresses_mhomed_num < 2),
8927 .num_ips = ctx->addresses_mhomed_num,
8928 .ips = ctx->addresses_mhomed,
8929 .apply_expected = true
8936 .type = WREPL_TYPE_MHOMED,
8937 .state = WREPL_STATE_ACTIVE,
8938 .node = WREPL_NODE_B,
8940 .num_ips = ctx->addresses_best_num,
8941 .ips = ctx->addresses_best,
8942 .apply_expected = true
8946 * some more multi homed and unique test, including merging
8949 * mhomed,active vs. unique,active with subset ip(s), positive response
8953 .line = __location__,
8954 .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations",
8955 .name = _NBT_NAME("_MA_UA_SB_P", 0x00, NULL),
8956 .comment= "C:MHOMED vs. B:UNIQUE,BEST (C:MHOMED) => B:MHOMED",
8957 .skip = (ctx->addresses_all_num < 2),
8961 .num_ips = ctx->addresses_mhomed_num,
8962 .ips = ctx->addresses_mhomed,
8963 .apply_expected = true
8970 .type = WREPL_TYPE_UNIQUE,
8971 .state = WREPL_STATE_ACTIVE,
8972 .node = WREPL_NODE_B,
8974 .num_ips = ctx->addresses_best_num,
8975 .ips = ctx->addresses_best,
8976 .mhomed_merge = true
8980 * unique,active vs. unique,active with different ip(s), positive response, with replicas address
8981 * TODO: check why the server sends a name release demand for one address?
8982 * the release demand has no effect to the database record...
8986 .line = __location__,
8987 .name = _NBT_NAME("_UA_UA_DI_PRA", 0x00, NULL),
8988 .comment= "C:BEST vs. B:BEST2 (C:BEST2,LR:BEST2) => C:BEST",
8989 .skip = (ctx->addresses_all_num < 2),
8993 .num_ips = ctx->addresses_best_num,
8994 .ips = ctx->addresses_best,
8995 .apply_expected = true
9000 .num_ips = ctx->addresses_best2_num,
9001 .ips = ctx->addresses_best2,
9002 .late_release = true
9005 .type = WREPL_TYPE_UNIQUE,
9006 .state = WREPL_STATE_ACTIVE,
9007 .node = WREPL_NODE_B,
9009 .num_ips = ctx->addresses_best2_num,
9010 .ips = ctx->addresses_best2,
9011 .apply_expected = false,
9015 * unique,active vs. unique,active with different ip(s), positive response, with all addresses
9019 .line = __location__,
9020 .name = _NBT_NAME("_UA_UA_DI_A", 0x00, NULL),
9021 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
9022 .skip = (ctx->addresses_all_num < 3),
9026 .num_ips = ctx->addresses_best_num,
9027 .ips = ctx->addresses_best,
9028 .apply_expected = true
9033 .num_ips = ctx->addresses_all_num,
9034 .ips = ctx->addresses_all,
9037 .type = WREPL_TYPE_UNIQUE,
9038 .state = WREPL_STATE_ACTIVE,
9039 .node = WREPL_NODE_B,
9041 .num_ips = ctx->addresses_best2_num,
9042 .ips = ctx->addresses_best2,
9043 .mhomed_merge = true,
9047 * unique,active vs. mhomed,active with different ip(s), positive response, with all addresses
9051 .line = __location__,
9052 .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL),
9053 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
9054 .skip = (ctx->addresses_all_num < 3),
9058 .num_ips = ctx->addresses_best_num,
9059 .ips = ctx->addresses_best,
9060 .apply_expected = true
9065 .num_ips = ctx->addresses_all_num,
9066 .ips = ctx->addresses_all,
9069 .type = WREPL_TYPE_MHOMED,
9070 .state = WREPL_STATE_ACTIVE,
9071 .node = WREPL_NODE_B,
9073 .num_ips = ctx->addresses_best2_num,
9074 .ips = ctx->addresses_best2,
9075 .mhomed_merge = true,
9079 * special group vs. special group merging section
9082 * sgroup,active vs. sgroup,active with different ip(s)
9086 .line = __location__,
9087 .section= "Test Replica vs. owned active: SGROUP vs. SGROUP tests",
9088 .name = _NBT_NAME("_SA_SA_DI_U", 0x1C, NULL),
9089 .skip = (ctx->addresses_all_num < 3),
9091 .nb_flags = NBT_NM_GROUP,
9093 .num_ips = ctx->addresses_mhomed_num,
9094 .ips = ctx->addresses_mhomed,
9095 .apply_expected = true
9101 .type = WREPL_TYPE_SGROUP,
9102 .state = WREPL_STATE_ACTIVE,
9103 .node = WREPL_NODE_B,
9105 .num_ips = ARRAY_SIZE(addresses_B_3_4),
9106 .ips = addresses_B_3_4,
9107 .sgroup_merge = true
9111 * sgroup,active vs. sgroup,active with same ip(s)
9115 .line = __location__,
9116 .name = _NBT_NAME("_SA_SA_SI_U", 0x1C, NULL),
9117 .skip = (ctx->addresses_all_num < 3),
9119 .nb_flags = NBT_NM_GROUP,
9121 .num_ips = ctx->addresses_mhomed_num,
9122 .ips = ctx->addresses_mhomed,
9123 .apply_expected = true
9129 .type = WREPL_TYPE_SGROUP,
9130 .state = WREPL_STATE_ACTIVE,
9131 .node = WREPL_NODE_B,
9133 .num_ips = ctx->addresses_mhomed_num,
9134 .ips = ctx->addresses_mhomed,
9135 .sgroup_merge = true
9139 * sgroup,active vs. sgroup,active with superset ip(s)
9143 .line = __location__,
9144 .name = _NBT_NAME("_SA_SA_SP_U", 0x1C, NULL),
9145 .skip = (ctx->addresses_all_num < 3),
9147 .nb_flags = NBT_NM_GROUP,
9149 .num_ips = ctx->addresses_mhomed_num,
9150 .ips = ctx->addresses_mhomed,
9151 .apply_expected = true
9157 .type = WREPL_TYPE_SGROUP,
9158 .state = WREPL_STATE_ACTIVE,
9159 .node = WREPL_NODE_B,
9161 .num_ips = ctx->addresses_all_num,
9162 .ips = ctx->addresses_all,
9163 .sgroup_merge = true
9167 * sgroup,active vs. sgroup,active with subset ip(s)
9171 .line = __location__,
9172 .name = _NBT_NAME("_SA_SA_SB_U", 0x1C, NULL),
9173 .skip = (ctx->addresses_all_num < 3),
9175 .nb_flags = NBT_NM_GROUP,
9177 .num_ips = ctx->addresses_mhomed_num,
9178 .ips = ctx->addresses_mhomed,
9179 .apply_expected = true
9185 .type = WREPL_TYPE_SGROUP,
9186 .state = WREPL_STATE_ACTIVE,
9187 .node = WREPL_NODE_B,
9189 .num_ips = ctx->addresses_best_num,
9190 .ips = ctx->addresses_best,
9191 .sgroup_merge = true
9195 * sgroup,active vs. sgroup,tombstone with different ip(s)
9199 .line = __location__,
9200 .name = _NBT_NAME("_SA_ST_DI_U", 0x1C, NULL),
9201 .skip = (ctx->addresses_all_num < 3),
9203 .nb_flags = NBT_NM_GROUP,
9205 .num_ips = ctx->addresses_mhomed_num,
9206 .ips = ctx->addresses_mhomed,
9207 .apply_expected = true
9213 .type = WREPL_TYPE_SGROUP,
9214 .state = WREPL_STATE_TOMBSTONE,
9215 .node = WREPL_NODE_B,
9217 .num_ips = ARRAY_SIZE(addresses_B_3_4),
9218 .ips = addresses_B_3_4,
9219 .apply_expected = false
9223 * sgroup,active vs. sgroup,tombstone with same ip(s)
9227 .line = __location__,
9228 .name = _NBT_NAME("_SA_ST_SI_U", 0x1C, NULL),
9229 .skip = (ctx->addresses_all_num < 3),
9231 .nb_flags = NBT_NM_GROUP,
9233 .num_ips = ctx->addresses_mhomed_num,
9234 .ips = ctx->addresses_mhomed,
9235 .apply_expected = true
9241 .type = WREPL_TYPE_SGROUP,
9242 .state = WREPL_STATE_TOMBSTONE,
9243 .node = WREPL_NODE_B,
9245 .num_ips = ctx->addresses_mhomed_num,
9246 .ips = ctx->addresses_mhomed,
9247 .apply_expected = false
9251 * sgroup,active vs. sgroup,tombstone with superset ip(s)
9255 .line = __location__,
9256 .name = _NBT_NAME("_SA_ST_SP_U", 0x1C, NULL),
9257 .skip = (ctx->addresses_all_num < 3),
9259 .nb_flags = NBT_NM_GROUP,
9261 .num_ips = ctx->addresses_mhomed_num,
9262 .ips = ctx->addresses_mhomed,
9263 .apply_expected = true
9269 .type = WREPL_TYPE_SGROUP,
9270 .state = WREPL_STATE_TOMBSTONE,
9271 .node = WREPL_NODE_B,
9273 .num_ips = ctx->addresses_all_num,
9274 .ips = ctx->addresses_all,
9275 .apply_expected = false
9279 * sgroup,active vs. sgroup,tombstone with subset ip(s)
9283 .line = __location__,
9284 .name = _NBT_NAME("_SA_ST_SB_U", 0x1C, NULL),
9285 .skip = (ctx->addresses_all_num < 3),
9287 .nb_flags = NBT_NM_GROUP,
9289 .num_ips = ctx->addresses_mhomed_num,
9290 .ips = ctx->addresses_mhomed,
9291 .apply_expected = true
9297 .type = WREPL_TYPE_SGROUP,
9298 .state = WREPL_STATE_TOMBSTONE,
9299 .node = WREPL_NODE_B,
9301 .num_ips = ctx->addresses_best_num,
9302 .ips = ctx->addresses_best,
9303 .apply_expected = false
9308 if (!ctx->nbtsock_srv) {
9309 torture_comment(tctx, "SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
9310 lpcfg_nbt_port(tctx->lp_ctx));
9314 torture_comment(tctx, "Test Replica records vs. owned active records\n");
9316 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
9318 struct test_conflict_owned_active_vs_replica_struct record = records[i];
9319 uint32_t j, count = 1;
9322 if (records[i].wins.mhomed || records[i].name.type == 0x1C) {
9323 count = records[i].wins.num_ips;
9326 if (records[i].section) {
9327 torture_comment(tctx, "%s\n", records[i].section);
9330 if (records[i].skip) {
9331 torture_comment(tctx, "%s => SKIPPED\n", nbt_name_string(ctx, &records[i].name));
9335 if (records[i].replica.mhomed_merge) {
9336 action = "MHOMED_MERGE";
9337 } else if (records[i].replica.sgroup_merge) {
9338 action = "SGROUP_MERGE";
9339 } else if (records[i].replica.apply_expected) {
9342 action = "NOT REPLACE";
9345 torture_comment(tctx, "%s%s%s => %s\n",
9346 nbt_name_string(ctx, &records[i].name),
9347 (records[i].comment?": ":""),
9348 (records[i].comment?records[i].comment:""),
9351 /* Prepare for multi homed registration */
9352 ZERO_STRUCT(records[i].defend);
9353 records[i].defend.timeout = 10;
9354 records[i].defend.positive = true;
9355 nbt_set_incoming_handler(ctx->nbtsock_srv,
9356 test_conflict_owned_active_vs_replica_handler,
9358 if (ctx->nbtsock_srv2) {
9359 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9360 test_conflict_owned_active_vs_replica_handler,
9367 for (j=0; j < count; j++) {
9368 struct nbt_name_request *req;
9370 name_register->in.name = records[i].name;
9371 name_register->in.dest_addr = ctx->address;
9372 name_register->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
9373 name_register->in.address = records[i].wins.ips[j].ip;
9374 name_register->in.nb_flags = records[i].wins.nb_flags;
9375 name_register->in.register_demand= false;
9376 name_register->in.broadcast = false;
9377 name_register->in.multi_homed = records[i].wins.mhomed;
9378 name_register->in.ttl = 300000;
9379 name_register->in.timeout = 70;
9380 name_register->in.retries = 0;
9382 req = nbt_name_register_send(ctx->nbtsock, name_register);
9384 /* push the request on the wire */
9385 tevent_loop_once(ctx->nbtsock->event_ctx);
9388 * if we register multiple addresses,
9389 * the server will do name queries to see if the old addresses
9392 if (records[i].wins.mhomed && j > 0) {
9393 end = timeval_current_ofs(records[i].defend.timeout,0);
9394 records[i].defend.ret = true;
9395 while (records[i].defend.timeout > 0) {
9396 tevent_loop_once(ctx->nbtsock_srv->event_ctx);
9397 if (timeval_expired(&end)) break;
9399 ret &= records[i].defend.ret;
9402 status = nbt_name_register_recv(req, ctx, name_register);
9403 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9404 torture_comment(tctx, "No response from %s for name register\n", ctx->address);
9407 if (!NT_STATUS_IS_OK(status)) {
9408 torture_comment(tctx, "Bad response from %s for name register - %s\n",
9409 ctx->address, nt_errstr(status));
9412 CHECK_VALUE(tctx, name_register->out.rcode, 0);
9413 CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address);
9414 CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type);
9415 CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name);
9416 CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope);
9417 CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[j].ip);
9420 /* Prepare for the current test */
9421 records[i].defend = record.defend;
9422 nbt_set_incoming_handler(ctx->nbtsock_srv,
9423 test_conflict_owned_active_vs_replica_handler,
9425 if (ctx->nbtsock_srv2) {
9426 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9427 test_conflict_owned_active_vs_replica_handler,
9434 wins_name->name = &records[i].name;
9435 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
9436 records[i].replica.state,
9437 records[i].replica.node,
9438 records[i].replica.is_static);
9439 wins_name->id = ++ctx->b.max_version;
9440 if (wins_name->flags & 2) {
9441 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
9442 wins_name->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
9443 records[i].replica.ips);
9445 wins_name->addresses.ip = records[i].replica.ips[0].ip;
9447 wins_name->unknown = "255.255.255.255";
9449 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9452 * wait for the name query, which is handled in
9453 * test_conflict_owned_active_vs_replica_handler()
9455 end = timeval_current_ofs(records[i].defend.timeout,0);
9456 records[i].defend.ret = true;
9457 while (records[i].defend.timeout > 0) {
9458 tevent_loop_once(ctx->nbtsock_srv->event_ctx);
9459 if (timeval_expired(&end)) break;
9461 ret &= records[i].defend.ret;
9463 if (records[i].defend.late_release) {
9464 records[i].defend = record.defend;
9465 records[i].defend.expect_release = true;
9467 * wait for the name release demand, which is handled in
9468 * test_conflict_owned_active_vs_replica_handler()
9470 end = timeval_current_ofs(records[i].defend.timeout,0);
9471 records[i].defend.ret = true;
9472 while (records[i].defend.timeout > 0) {
9473 tevent_loop_once(ctx->nbtsock_srv->event_ctx);
9474 if (timeval_expired(&end)) break;
9476 ret &= records[i].defend.ret;
9479 if (records[i].replica.mhomed_merge) {
9480 ret &= test_wrepl_mhomed_merged(tctx, ctx, &ctx->c,
9481 records[i].wins.num_ips, records[i].wins.ips,
9483 records[i].replica.num_ips, records[i].replica.ips,
9485 } else if (records[i].replica.sgroup_merge) {
9486 ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL,
9488 records[i].wins.num_ips, records[i].wins.ips,
9490 records[i].replica.num_ips, records[i].replica.ips,
9493 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name,
9494 records[i].replica.apply_expected);
9497 if (records[i].replica.apply_expected ||
9498 records[i].replica.mhomed_merge) {
9499 wins_name->name = &records[i].name;
9500 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9501 WREPL_STATE_TOMBSTONE,
9502 WREPL_NODE_B, false);
9503 wins_name->id = ++ctx->b.max_version;
9504 wins_name->addresses.ip = addresses_B_1[0].ip;
9505 wins_name->unknown = "255.255.255.255";
9507 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9508 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9510 for (j=0; j < count; j++) {
9511 struct nbt_name_socket *nbtsock = ctx->nbtsock;
9513 if (ctx->myaddr2 && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2->addr) == 0) {
9514 nbtsock = ctx->nbtsock2;
9517 release->in.name = records[i].name;
9518 release->in.dest_addr = ctx->address;
9519 release->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
9520 release->in.address = records[i].wins.ips[j].ip;
9521 release->in.nb_flags = records[i].wins.nb_flags;
9522 release->in.broadcast = false;
9523 release->in.timeout = 30;
9524 release->in.retries = 0;
9526 status = nbt_name_release(nbtsock, ctx, release);
9527 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9528 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
9531 if (!NT_STATUS_IS_OK(status)) {
9532 torture_comment(tctx, "Bad response from %s for name query - %s\n",
9533 ctx->address, nt_errstr(status));
9536 CHECK_VALUE(tctx, release->out.rcode, 0);
9539 if (records[i].replica.sgroup_merge) {
9540 /* clean up the SGROUP record */
9541 wins_name->name = &records[i].name;
9542 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9544 WREPL_NODE_B, false);
9545 wins_name->id = ++ctx->b.max_version;
9546 wins_name->addresses.addresses.num_ips = 0;
9547 wins_name->addresses.addresses.ips = NULL;
9548 wins_name->unknown = "255.255.255.255";
9549 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9551 /* take ownership of the SGROUP record */
9552 wins_name->name = &records[i].name;
9553 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9555 WREPL_NODE_B, false);
9556 wins_name->id = ++ctx->b.max_version;
9557 wins_name->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
9558 wins_name->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
9560 wins_name->unknown = "255.255.255.255";
9561 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9562 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9564 /* overwrite the SGROUP record with unique,tombstone */
9565 wins_name->name = &records[i].name;
9566 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9567 WREPL_STATE_TOMBSTONE,
9568 WREPL_NODE_B, false);
9569 wins_name->id = ++ctx->b.max_version;
9570 wins_name->addresses.ip = addresses_A_1[0].ip;
9571 wins_name->unknown = "255.255.255.255";
9572 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9573 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9578 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
9586 #define __NBT_LABEL_CAT1__(a,b) a##b
9587 #define __NBT_LABEL_CAT2__(a,b) __NBT_LABEL_CAT1__(a,b)
9588 #define _NBT_LABEL __NBT_LABEL_CAT2__(_label_, __LINE__)
9590 #define _NBT_ASSERT(v, correct) do { \
9592 torture_assert_int_equal_goto(rec->tctx, v, correct, \
9593 _ret, _NBT_LABEL, "Invalid int value"); \
9600 #define _NBT_ASSERT_STRING(v, correct) do { \
9602 torture_assert_str_equal_goto(rec->tctx, v, correct, \
9603 _ret, _NBT_LABEL, "Invalid string value"); \
9610 static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
9611 struct nbt_name_packet *req_packet,
9612 struct socket_address *src)
9614 struct nbt_name *name;
9615 struct nbt_name_packet *rep_packet;
9616 struct test_conflict_owned_active_vs_replica_struct *rec =
9617 (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
9619 _NBT_ASSERT(req_packet->qdcount, 1);
9620 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9621 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9623 name = &req_packet->questions[0].name;
9625 _NBT_ASSERT_STRING(name->name, rec->name.name);
9626 _NBT_ASSERT(name->type, rec->name.type);
9627 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9629 _NBT_ASSERT(rec->defend.expect_release, false);
9631 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9632 if (rep_packet == NULL) return;
9634 rep_packet->name_trn_id = req_packet->name_trn_id;
9635 rep_packet->ancount = 1;
9637 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9638 if (rep_packet->answers == NULL) return;
9640 rep_packet->answers[0].name = *name;
9641 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9642 rep_packet->answers[0].ttl = 0;
9644 if (rec->defend.positive) {
9645 uint32_t i, num_ips;
9646 const struct wrepl_ip *ips;
9648 if (rec->defend.num_ips > 0) {
9649 num_ips = rec->defend.num_ips;
9650 ips = rec->defend.ips;
9652 num_ips = rec->wins.num_ips;
9653 ips = rec->wins.ips;
9656 /* send a positive reply */
9657 rep_packet->operation =
9660 NBT_FLAG_AUTHORITATIVE |
9661 NBT_FLAG_RECURSION_DESIRED |
9662 NBT_FLAG_RECURSION_AVAIL;
9664 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9666 rep_packet->answers[0].rdata.netbios.length = num_ips*6;
9667 rep_packet->answers[0].rdata.netbios.addresses =
9668 talloc_array(rep_packet->answers, struct nbt_rdata_address, num_ips);
9669 if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return;
9671 for (i=0; i < num_ips; i++) {
9672 struct nbt_rdata_address *addr =
9673 &rep_packet->answers[0].rdata.netbios.addresses[i];
9674 addr->nb_flags = rec->wins.nb_flags;
9675 addr->ipaddr = ips[i].ip;
9677 DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
9678 nbt_name_string(rep_packet, name), src->addr, src->port));
9680 /* send a negative reply */
9681 rep_packet->operation =
9684 NBT_FLAG_AUTHORITATIVE |
9687 rep_packet->answers[0].rr_type = NBT_QTYPE_NULL;
9689 ZERO_STRUCT(rep_packet->answers[0].rdata);
9691 DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
9692 nbt_name_string(rep_packet, name), src->addr, src->port));
9695 nbt_name_reply_send(nbtsock, src, rep_packet);
9696 talloc_free(rep_packet);
9698 /* make sure we push the reply to the wire */
9699 while (nbtsock->send_queue) {
9700 tevent_loop_once(nbtsock->event_ctx);
9704 rec->defend.timeout = 0;
9705 rec->defend.ret = true;
9708 static void test_conflict_owned_active_vs_replica_handler_release(
9709 struct nbt_name_socket *nbtsock,
9710 struct nbt_name_packet *req_packet,
9711 struct socket_address *src)
9713 struct nbt_name *name;
9714 struct nbt_name_packet *rep_packet;
9715 struct test_conflict_owned_active_vs_replica_struct *rec =
9716 (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
9718 _NBT_ASSERT(req_packet->qdcount, 1);
9719 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9720 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9722 name = &req_packet->questions[0].name;
9724 _NBT_ASSERT_STRING(name->name, rec->name.name);
9725 _NBT_ASSERT(name->type, rec->name.type);
9726 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9728 _NBT_ASSERT(rec->defend.expect_release, true);
9730 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9731 if (rep_packet == NULL) return;
9733 rep_packet->name_trn_id = req_packet->name_trn_id;
9734 rep_packet->ancount = 1;
9735 rep_packet->operation =
9737 NBT_OPCODE_RELEASE |
9738 NBT_FLAG_AUTHORITATIVE;
9740 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9741 if (rep_packet->answers == NULL) return;
9743 rep_packet->answers[0].name = *name;
9744 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9745 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9746 rep_packet->answers[0].ttl = req_packet->additional[0].ttl;
9747 rep_packet->answers[0].rdata = req_packet->additional[0].rdata;
9749 DEBUG(2,("Sending name release reply for %s to %s:%d\n",
9750 nbt_name_string(rep_packet, name), src->addr, src->port));
9752 nbt_name_reply_send(nbtsock, src, rep_packet);
9753 talloc_free(rep_packet);
9755 /* make sure we push the reply to the wire */
9756 while (nbtsock->send_queue) {
9757 tevent_loop_once(nbtsock->event_ctx);
9761 rec->defend.timeout = 0;
9762 rec->defend.ret = true;
9765 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
9766 struct nbt_name_packet *req_packet,
9767 struct socket_address *src)
9769 struct test_conflict_owned_active_vs_replica_struct *rec =
9770 (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
9771 struct nbt_name *name = &req_packet->questions[0].name;
9773 if (req_packet->operation & NBT_FLAG_BROADCAST) {
9774 torture_comment(rec->tctx,
9775 "%s: incoming packet name[%s] flags[0x%08X] from[%s]\n",
9777 nbt_name_string(rec->tctx, name),
9778 req_packet->operation,
9783 rec->defend.ret = false;
9785 switch (req_packet->operation & NBT_OPCODE) {
9786 case NBT_OPCODE_QUERY:
9787 test_conflict_owned_active_vs_replica_handler_query(nbtsock, req_packet, src);
9789 case NBT_OPCODE_RELEASE:
9790 test_conflict_owned_active_vs_replica_handler_release(nbtsock, req_packet, src);
9793 torture_comment(rec->tctx,
9794 "%s: unexpected packet name[%s] flags[0x%08X] from[%s]\n",
9796 nbt_name_string(rec->tctx, name),
9797 req_packet->operation,
9799 _NBT_ASSERT((req_packet->operation & NBT_OPCODE), NBT_OPCODE_QUERY);
9805 test WINS replication replica conflicts operations
9807 static bool torture_nbt_winsreplication_replica(struct torture_context *tctx)
9810 struct test_wrepl_conflict_conn *ctx;
9812 const char *address;
9813 struct nbt_name name;
9815 if (!torture_nbt_get_name(tctx, &name, &address))
9818 ctx = test_create_conflict_ctx(tctx, address);
9819 if (!ctx) return false;
9821 ret &= test_conflict_same_owner(tctx, ctx);
9822 ret &= test_conflict_different_owner(tctx, ctx);
9828 test WINS replication owned conflicts operations
9830 static bool torture_nbt_winsreplication_owned(struct torture_context *tctx)
9832 const char *address;
9833 struct nbt_name name;
9835 struct test_wrepl_conflict_conn *ctx;
9837 if (torture_setting_bool(tctx, "quick", false))
9839 "skip NBT-WINSREPLICATION-OWNED test in quick test mode\n");
9841 if (!torture_nbt_get_name(tctx, &name, &address))
9844 ctx = test_create_conflict_ctx(tctx, address);
9845 torture_assert(tctx, ctx != NULL, "Creating context failed");
9847 ret &= test_conflict_owned_released_vs_replica(tctx, ctx);
9848 ret &= test_conflict_owned_active_vs_replica(tctx, ctx);
9854 test simple WINS replication operations
9856 struct torture_suite *torture_nbt_winsreplication(TALLOC_CTX *mem_ctx)
9858 struct torture_suite *suite = torture_suite_create(
9859 mem_ctx, "winsreplication");
9860 struct torture_tcase *tcase;
9862 tcase = torture_suite_add_simple_test(suite, "assoc_ctx1",
9864 tcase->tests->dangerous = true;
9866 torture_suite_add_simple_test(suite, "assoc_ctx2", test_assoc_ctx2);
9868 torture_suite_add_simple_test(suite, "wins_replication",
9869 test_wins_replication);
9871 torture_suite_add_simple_test(suite, "replica",
9872 torture_nbt_winsreplication_replica);
9874 torture_suite_add_simple_test(suite, "owned",
9875 torture_nbt_winsreplication_owned);