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;
559 struct interface *ifaces;
561 ctx = talloc_zero(tctx, struct test_wrepl_conflict_conn);
562 if (!ctx) return NULL;
564 ctx->address = address;
565 ctx->pull = wrepl_socket_init(ctx, tctx->ev);
566 if (!ctx->pull) return NULL;
568 torture_comment(tctx, "Setup wrepl conflict pull connection\n");
569 status = wrepl_connect(ctx->pull, wrepl_best_ip(tctx->lp_ctx, ctx->address), ctx->address);
570 if (!NT_STATUS_IS_OK(status)) return NULL;
572 status = wrepl_associate(ctx->pull, &associate);
573 if (!NT_STATUS_IS_OK(status)) return NULL;
575 ctx->pull_assoc = associate.out.assoc_ctx;
577 ctx->a.address = TEST_OWNER_A_ADDRESS;
578 ctx->a.max_version = 0;
579 ctx->a.min_version = 0;
582 ctx->b.address = TEST_OWNER_B_ADDRESS;
583 ctx->b.max_version = 0;
584 ctx->b.min_version = 0;
587 ctx->x.address = TEST_OWNER_X_ADDRESS;
588 ctx->x.max_version = 0;
589 ctx->x.min_version = 0;
592 ctx->c.address = address;
593 ctx->c.max_version = 0;
594 ctx->c.min_version = 0;
597 pull_table.in.assoc_ctx = ctx->pull_assoc;
598 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
599 if (!NT_STATUS_IS_OK(status)) return NULL;
601 for (i=0; i < pull_table.out.num_partners; i++) {
602 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
603 ctx->a.max_version = pull_table.out.partners[i].max_version;
604 ctx->a.min_version = pull_table.out.partners[i].min_version;
606 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
607 ctx->b.max_version = pull_table.out.partners[i].max_version;
608 ctx->b.min_version = pull_table.out.partners[i].min_version;
610 if (strcmp(TEST_OWNER_X_ADDRESS,pull_table.out.partners[i].address)==0) {
611 ctx->x.max_version = pull_table.out.partners[i].max_version;
612 ctx->x.min_version = pull_table.out.partners[i].min_version;
614 if (strcmp(address,pull_table.out.partners[i].address)==0) {
615 ctx->c.max_version = pull_table.out.partners[i].max_version;
616 ctx->c.min_version = pull_table.out.partners[i].min_version;
620 talloc_free(pull_table.out.partners);
622 ctx->nbtsock = nbt_name_socket_init(ctx, tctx->ev);
623 if (!ctx->nbtsock) return NULL;
625 load_interface_list(tctx, tctx->lp_ctx, &ifaces);
627 ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_list_best_ip(ifaces, address), 0);
628 if (!ctx->myaddr) return NULL;
630 for (i = 0; i < iface_list_count(ifaces); i++) {
631 if (!iface_list_n_is_v4(ifaces, i)) continue;
632 if (strcmp(ctx->myaddr->addr, iface_list_n_ip(ifaces, i)) == 0) continue;
633 ctx->myaddr2 = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_list_n_ip(ifaces, i), 0);
634 if (!ctx->myaddr2) return NULL;
638 status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0);
639 if (!NT_STATUS_IS_OK(status)) return NULL;
641 ctx->nbtsock_srv = nbt_name_socket_init(ctx, tctx->ev);
642 if (!ctx->nbtsock_srv) return NULL;
644 /* Make a port 137 version of ctx->myaddr */
645 nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lpcfg_nbt_port(tctx->lp_ctx));
646 if (!nbt_srv_addr) return NULL;
648 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
649 status = socket_listen(ctx->nbtsock_srv->sock, nbt_srv_addr, 0, 0);
650 talloc_free(nbt_srv_addr);
651 if (!NT_STATUS_IS_OK(status)) {
652 /* this isn't fatal */
653 talloc_free(ctx->nbtsock_srv);
654 ctx->nbtsock_srv = NULL;
657 if (ctx->myaddr2 && ctx->nbtsock_srv) {
658 ctx->nbtsock2 = nbt_name_socket_init(ctx, tctx->ev);
659 if (!ctx->nbtsock2) return NULL;
661 status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0);
662 if (!NT_STATUS_IS_OK(status)) return NULL;
664 ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx);
665 if (!ctx->nbtsock_srv2) return NULL;
667 /* Make a port 137 version of ctx->myaddr2 */
668 nbt_srv_addr = socket_address_from_strings(tctx,
669 ctx->nbtsock_srv->sock->backend_name,
671 lpcfg_nbt_port(tctx->lp_ctx));
672 if (!nbt_srv_addr) return NULL;
674 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
675 status = socket_listen(ctx->nbtsock_srv2->sock, ctx->myaddr2, 0, 0);
676 talloc_free(nbt_srv_addr);
677 if (!NT_STATUS_IS_OK(status)) {
678 /* this isn't fatal */
679 talloc_free(ctx->nbtsock_srv2);
680 ctx->nbtsock_srv2 = NULL;
684 ctx->addresses_best_num = 1;
685 ctx->addresses_best = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best_num);
686 if (!ctx->addresses_best) return NULL;
687 ctx->addresses_best[0].owner = ctx->b.address;
688 ctx->addresses_best[0].ip = ctx->myaddr->addr;
691 num_ifaces = iface_list_count(ifaces);
692 ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, num_ifaces);
693 ctx->addresses_all_num = 0;
694 if (!ctx->addresses_all) return NULL;
695 for (i=0; i < num_ifaces; i++) {
696 if (!iface_list_n_is_v4(ifaces, i)) continue;
697 ctx->addresses_all[i].owner = ctx->b.address;
698 ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_list_n_ip(ifaces, i));
699 ctx->addresses_all_num++;
700 if (!ctx->addresses_all[i].ip) return NULL;
703 if (ctx->nbtsock_srv2) {
704 ctx->addresses_best2_num = 1;
705 ctx->addresses_best2 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best2_num);
706 if (!ctx->addresses_best2) return NULL;
707 ctx->addresses_best2[0].owner = ctx->b.address;
708 ctx->addresses_best2[0].ip = ctx->myaddr2->addr;
710 ctx->addresses_mhomed_num = 2;
711 ctx->addresses_mhomed = talloc_array(ctx, struct wrepl_ip, ctx->addresses_mhomed_num);
712 if (!ctx->addresses_mhomed) return NULL;
713 ctx->addresses_mhomed[0].owner = ctx->b.address;
714 ctx->addresses_mhomed[0].ip = ctx->myaddr->addr;
715 ctx->addresses_mhomed[1].owner = ctx->b.address;
716 ctx->addresses_mhomed[1].ip = ctx->myaddr2->addr;
722 static bool test_wrepl_update_one(struct torture_context *tctx,
723 struct test_wrepl_conflict_conn *ctx,
724 const struct wrepl_wins_owner *owner,
725 const struct wrepl_wins_name *name)
727 struct wrepl_socket *wrepl_socket;
728 struct wrepl_associate associate;
729 struct wrepl_packet update_packet, repl_send;
730 struct wrepl_table *update;
731 struct wrepl_wins_owner wrepl_wins_owners[1];
732 struct wrepl_packet *repl_recv;
733 struct wrepl_send_reply *send_reply;
734 struct wrepl_wins_name wrepl_wins_names[1];
738 wrepl_socket = wrepl_socket_init(ctx, tctx->ev);
740 status = wrepl_connect(wrepl_socket, wrepl_best_ip(tctx->lp_ctx, ctx->address), ctx->address);
741 CHECK_STATUS(tctx, status, NT_STATUS_OK);
743 status = wrepl_associate(wrepl_socket, &associate);
744 CHECK_STATUS(tctx, status, NT_STATUS_OK);
745 assoc_ctx = associate.out.assoc_ctx;
747 /* now send a WREPL_REPL_UPDATE message */
748 ZERO_STRUCT(update_packet);
749 update_packet.opcode = WREPL_OPCODE_BITS;
750 update_packet.assoc_ctx = assoc_ctx;
751 update_packet.mess_type = WREPL_REPLICATION;
752 update_packet.message.replication.command = WREPL_REPL_UPDATE;
753 update = &update_packet.message.replication.info.table;
755 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
756 update->partners = wrepl_wins_owners;
757 update->initiator = "0.0.0.0";
759 wrepl_wins_owners[0] = *owner;
761 status = wrepl_request(wrepl_socket, wrepl_socket,
762 &update_packet, &repl_recv);
763 CHECK_STATUS(tctx, status, NT_STATUS_OK);
764 CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_REPLICATION);
765 CHECK_VALUE(tctx, repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
767 ZERO_STRUCT(repl_send);
768 repl_send.opcode = WREPL_OPCODE_BITS;
769 repl_send.assoc_ctx = assoc_ctx;
770 repl_send.mess_type = WREPL_REPLICATION;
771 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
772 send_reply = &repl_send.message.replication.info.reply;
774 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
775 send_reply->names = wrepl_wins_names;
777 wrepl_wins_names[0] = *name;
779 status = wrepl_request(wrepl_socket, wrepl_socket,
780 &repl_send, &repl_recv);
781 CHECK_STATUS(tctx, status, NT_STATUS_OK);
782 CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
783 CHECK_VALUE(tctx, repl_recv->message.stop.reason, 0);
785 talloc_free(wrepl_socket);
789 static bool test_wrepl_is_applied(struct torture_context *tctx,
790 struct test_wrepl_conflict_conn *ctx,
791 const struct wrepl_wins_owner *owner,
792 const struct wrepl_wins_name *name,
796 struct wrepl_pull_names pull_names;
797 struct wrepl_name *names;
799 pull_names.in.assoc_ctx = ctx->pull_assoc;
800 pull_names.in.partner = *owner;
801 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
803 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
804 CHECK_STATUS(tctx, status, NT_STATUS_OK);
805 torture_assert(tctx, pull_names.out.num_names == (expected?1:0),
806 talloc_asprintf(tctx, "Invalid number of records returned - expected %d got %d", expected, pull_names.out.num_names));
808 names = pull_names.out.names;
811 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
815 char *expected_scope = NULL;
816 CHECK_VALUE(tctx, names[0].name.type, name->name->type);
817 CHECK_VALUE_STRING(tctx, names[0].name.name, name->name->name);
819 if (names[0].name.scope) {
820 expected_scope = talloc_strndup(tctx,
824 CHECK_VALUE_STRING(tctx, names[0].name.scope, expected_scope);
825 CHECK_VALUE(tctx, flags, name->flags);
826 CHECK_VALUE_UINT64(tctx, names[0].version_id, name->id);
829 CHECK_VALUE(tctx, names[0].num_addresses,
830 name->addresses.addresses.num_ips);
832 CHECK_VALUE(tctx, names[0].num_addresses, 1);
833 CHECK_VALUE_STRING(tctx, names[0].addresses[0].address,
837 talloc_free(pull_names.out.names);
841 static bool test_wrepl_mhomed_merged(struct torture_context *tctx,
842 struct test_wrepl_conflict_conn *ctx,
843 const struct wrepl_wins_owner *owner1,
844 uint32_t num_ips1, const struct wrepl_ip *ips1,
845 const struct wrepl_wins_owner *owner2,
846 uint32_t num_ips2, const struct wrepl_ip *ips2,
847 const struct wrepl_wins_name *name2)
850 struct wrepl_pull_names pull_names;
851 struct wrepl_name *names;
854 uint32_t num_ips = num_ips1 + num_ips2;
856 for (i = 0; i < num_ips2; i++) {
857 for (j = 0; j < num_ips1; j++) {
858 if (strcmp(ips2[i].ip,ips1[j].ip) == 0) {
865 pull_names.in.assoc_ctx = ctx->pull_assoc;
866 pull_names.in.partner = *owner2;
867 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
869 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
870 CHECK_STATUS(tctx, status, NT_STATUS_OK);
871 CHECK_VALUE(tctx, pull_names.out.num_names, 1);
873 names = pull_names.out.names;
875 flags = WREPL_NAME_FLAGS(names[0].type,
879 CHECK_VALUE(tctx, names[0].name.type, name2->name->type);
880 CHECK_VALUE_STRING(tctx, names[0].name.name, name2->name->name);
881 CHECK_VALUE_STRING(tctx, names[0].name.scope, name2->name->scope);
882 CHECK_VALUE(tctx, flags, name2->flags | WREPL_TYPE_MHOMED);
883 CHECK_VALUE_UINT64(tctx, names[0].version_id, name2->id);
885 CHECK_VALUE(tctx, names[0].num_addresses, num_ips);
887 for (i = 0; i < names[0].num_addresses; i++) {
888 const char *addr = names[0].addresses[i].address;
889 const char *owner = names[0].addresses[i].owner;
892 for (j = 0; j < num_ips2; j++) {
893 if (strcmp(addr, ips2[j].ip) == 0) {
895 CHECK_VALUE_STRING(tctx, owner, owner2->address);
902 for (j = 0; j < num_ips1; j++) {
903 if (strcmp(addr, ips1[j].ip) == 0) {
905 CHECK_VALUE_STRING(tctx, owner, owner1->address);
912 CHECK_VALUE_STRING(tctx, addr, "not found in address list");
914 talloc_free(pull_names.out.names);
918 static bool test_wrepl_sgroup_merged(struct torture_context *tctx,
919 struct test_wrepl_conflict_conn *ctx,
920 struct wrepl_wins_owner *merge_owner,
921 struct wrepl_wins_owner *owner1,
922 uint32_t num_ips1, const struct wrepl_ip *ips1,
923 struct wrepl_wins_owner *owner2,
924 uint32_t num_ips2, const struct wrepl_ip *ips2,
925 const struct wrepl_wins_name *name2)
928 struct wrepl_pull_names pull_names;
929 struct wrepl_name *names;
930 struct wrepl_name *name = NULL;
933 uint32_t num_ips = num_ips1 + num_ips2;
936 merge_owner = &ctx->c;
939 for (i = 0; i < num_ips1; i++) {
940 if (owner1 != &ctx->c && strcmp(ips1[i].owner,owner2->address) == 0) {
944 for (j = 0; j < num_ips2; j++) {
945 if (strcmp(ips1[i].ip,ips2[j].ip) == 0) {
953 pull_names.in.assoc_ctx = ctx->pull_assoc;
954 pull_names.in.partner = *merge_owner;
955 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
956 pull_names.in.partner.max_version = 0;
958 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
959 CHECK_STATUS(tctx, status, NT_STATUS_OK);
961 names = pull_names.out.names;
963 for (i = 0; i < pull_names.out.num_names; i++) {
964 if (names[i].name.type != name2->name->type) continue;
965 if (!names[i].name.name) continue;
966 if (strcmp(names[i].name.name, name2->name->name) != 0) continue;
967 if (names[i].name.scope) continue;
972 if (pull_names.out.num_names > 0) {
973 merge_owner->max_version = names[pull_names.out.num_names-1].version_id;
977 torture_comment(tctx, "%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name));
981 flags = WREPL_NAME_FLAGS(name->type,
985 CHECK_VALUE(tctx, name->name.type, name2->name->type);
986 CHECK_VALUE_STRING(tctx, name->name.name, name2->name->name);
987 CHECK_VALUE_STRING(tctx, name->name.scope, name2->name->scope);
988 CHECK_VALUE(tctx, flags, name2->flags);
990 CHECK_VALUE(tctx, name->num_addresses, num_ips);
992 for (i = 0; i < name->num_addresses; i++) {
993 const char *addr = name->addresses[i].address;
994 const char *owner = name->addresses[i].owner;
997 for (j = 0; j < num_ips2; j++) {
998 if (strcmp(addr, ips2[j].ip) == 0) {
1000 CHECK_VALUE_STRING(tctx, owner, ips2[j].owner);
1005 if (found) continue;
1007 for (j = 0; j < num_ips1; j++) {
1008 if (strcmp(addr, ips1[j].ip) == 0) {
1010 if (owner1 == &ctx->c) {
1011 CHECK_VALUE_STRING(tctx, owner, owner1->address);
1013 CHECK_VALUE_STRING(tctx, owner, ips1[j].owner);
1019 if (found) continue;
1021 CHECK_VALUE_STRING(tctx, addr, "not found in address list");
1023 talloc_free(pull_names.out.names);
1027 static char *test_nbt_winsrepl_scope_string(TALLOC_CTX *mem_ctx, uint8_t count)
1032 res = talloc_array(mem_ctx, char, count+1);
1037 for (i=0; i < count; i++) {
1038 res[i] = '0' + (i%10);
1043 talloc_set_name_const(res, res);
1048 static bool test_conflict_same_owner(struct torture_context *tctx,
1049 struct test_wrepl_conflict_conn *ctx)
1052 struct wrepl_wins_name wins_name1;
1053 struct wrepl_wins_name wins_name2;
1054 struct wrepl_wins_name *wins_name_tmp;
1055 struct wrepl_wins_name *wins_name_last;
1056 struct wrepl_wins_name *wins_name_cur;
1058 struct nbt_name names[] = {
1059 _NBT_NAME("_SAME_OWNER_A", 0x00, NULL),
1060 _NBT_NAME("_SAME_OWNER_A", 0x00,
1061 test_nbt_winsrepl_scope_string(tctx, 1)),
1062 _NBT_NAME("_SAME_OWNER_A", 0x00,
1063 test_nbt_winsrepl_scope_string(tctx, 2)),
1064 _NBT_NAME("_SAME_OWNER_A", 0x00,
1065 test_nbt_winsrepl_scope_string(tctx, 3)),
1066 _NBT_NAME("_SAME_OWNER_A", 0x00,
1067 test_nbt_winsrepl_scope_string(tctx, 4)),
1068 _NBT_NAME("_SAME_OWNER_A", 0x00,
1069 test_nbt_winsrepl_scope_string(tctx, 5)),
1070 _NBT_NAME("_SAME_OWNER_A", 0x00,
1071 test_nbt_winsrepl_scope_string(tctx, 6)),
1072 _NBT_NAME("_SAME_OWNER_A", 0x00,
1073 test_nbt_winsrepl_scope_string(tctx, 7)),
1074 _NBT_NAME("_SAME_OWNER_A", 0x00,
1075 test_nbt_winsrepl_scope_string(tctx, 8)),
1076 _NBT_NAME("_SAME_OWNER_A", 0x00,
1077 test_nbt_winsrepl_scope_string(tctx, 9)),
1078 _NBT_NAME("_SAME_OWNER_A", 0x00,
1079 test_nbt_winsrepl_scope_string(tctx, 237)),
1080 _NBT_NAME("_SAME_OWNER_A", 0x00,
1081 test_nbt_winsrepl_scope_string(tctx, 238)),
1082 _NBT_NAME("_SAME_OWNER_A", 0x1C, NULL),
1085 enum wrepl_name_type type;
1086 enum wrepl_name_state state;
1087 enum wrepl_name_node node;
1090 const struct wrepl_ip *ips;
1093 .type = WREPL_TYPE_GROUP,
1094 .state = WREPL_STATE_ACTIVE,
1095 .node = WREPL_NODE_B,
1097 .num_ips = ARRAY_SIZE(addresses_A_1),
1098 .ips = addresses_A_1,
1100 .type = WREPL_TYPE_UNIQUE,
1101 .state = WREPL_STATE_ACTIVE,
1102 .node = WREPL_NODE_B,
1104 .num_ips = ARRAY_SIZE(addresses_A_1),
1105 .ips = addresses_A_1,
1107 .type = WREPL_TYPE_UNIQUE,
1108 .state = WREPL_STATE_ACTIVE,
1109 .node = WREPL_NODE_B,
1111 .num_ips = ARRAY_SIZE(addresses_A_2),
1112 .ips = addresses_A_2,
1114 .type = WREPL_TYPE_UNIQUE,
1115 .state = WREPL_STATE_ACTIVE,
1116 .node = WREPL_NODE_B,
1118 .num_ips = ARRAY_SIZE(addresses_A_1),
1119 .ips = addresses_A_1,
1121 .type = WREPL_TYPE_UNIQUE,
1122 .state = WREPL_STATE_ACTIVE,
1123 .node = WREPL_NODE_B,
1125 .num_ips = ARRAY_SIZE(addresses_A_2),
1126 .ips = addresses_A_2,
1128 .type = WREPL_TYPE_SGROUP,
1129 .state = WREPL_STATE_TOMBSTONE,
1130 .node = WREPL_NODE_B,
1132 .num_ips = ARRAY_SIZE(addresses_A_2),
1133 .ips = addresses_A_2,
1135 .type = WREPL_TYPE_MHOMED,
1136 .state = WREPL_STATE_TOMBSTONE,
1137 .node = WREPL_NODE_B,
1139 .num_ips = ARRAY_SIZE(addresses_A_1),
1140 .ips = addresses_A_1,
1142 .type = WREPL_TYPE_MHOMED,
1143 .state = WREPL_STATE_RELEASED,
1144 .node = WREPL_NODE_B,
1146 .num_ips = ARRAY_SIZE(addresses_A_2),
1147 .ips = addresses_A_2,
1149 .type = WREPL_TYPE_SGROUP,
1150 .state = WREPL_STATE_ACTIVE,
1151 .node = WREPL_NODE_B,
1153 .num_ips = ARRAY_SIZE(addresses_A_1),
1154 .ips = addresses_A_1,
1156 .type = WREPL_TYPE_SGROUP,
1157 .state = WREPL_STATE_ACTIVE,
1158 .node = WREPL_NODE_B,
1160 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1161 .ips = addresses_A_3_4,
1163 .type = WREPL_TYPE_SGROUP,
1164 .state = WREPL_STATE_TOMBSTONE,
1165 .node = WREPL_NODE_B,
1167 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1168 .ips = addresses_B_3_4,
1170 /* the last one should always be a unique,tomstone record! */
1171 .type = WREPL_TYPE_UNIQUE,
1172 .state = WREPL_STATE_TOMBSTONE,
1173 .node = WREPL_NODE_B,
1175 .num_ips = ARRAY_SIZE(addresses_A_1),
1176 .ips = addresses_A_1,
1180 wins_name_tmp = NULL;
1181 wins_name_last = &wins_name2;
1182 wins_name_cur = &wins_name1;
1184 for (j=0; ret && j < ARRAY_SIZE(names); j++) {
1185 torture_comment(tctx, "Test Replica Conflicts with same owner[%s] for %s\n",
1186 nbt_name_string(ctx, &names[j]), ctx->a.address);
1188 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
1189 wins_name_tmp = wins_name_last;
1190 wins_name_last = wins_name_cur;
1191 wins_name_cur = wins_name_tmp;
1194 torture_comment(tctx, "%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
1195 wrepl_name_type_string(records[i-1].type),
1196 wrepl_name_state_string(records[i-1].state),
1197 (records[i-1].is_static?",static":""),
1198 wrepl_name_type_string(records[i].type),
1199 wrepl_name_state_string(records[i].state),
1200 (records[i].is_static?",static":""),
1201 (records[i-1].ips==records[i].ips?"same":"different"),
1205 wins_name_cur->name = &names[j];
1206 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
1209 records[i].is_static);
1210 wins_name_cur->id = ++ctx->a.max_version;
1211 if (wins_name_cur->flags & 2) {
1212 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
1213 wins_name_cur->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
1216 wins_name_cur->addresses.ip = records[i].ips[0].ip;
1218 wins_name_cur->unknown = "255.255.255.255";
1220 ret &= test_wrepl_update_one(tctx, ctx, &ctx->a,wins_name_cur);
1221 if (records[i].state == WREPL_STATE_RELEASED) {
1222 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_last, false);
1223 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, false);
1225 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, true);
1228 /* the first one is a cleanup run */
1229 if (!ret && i == 0) ret = true;
1232 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, __location__);
1240 static bool test_conflict_different_owner(struct torture_context *tctx,
1241 struct test_wrepl_conflict_conn *ctx)
1244 struct wrepl_wins_name wins_name1;
1245 struct wrepl_wins_name wins_name2;
1246 struct wrepl_wins_name *wins_name_r1;
1247 struct wrepl_wins_name *wins_name_r2;
1250 const char *line; /* just better debugging */
1251 struct nbt_name name;
1252 const char *comment;
1253 bool extra; /* not the worst case, this is an extra test */
1256 struct wrepl_wins_owner *owner;
1257 enum wrepl_name_type type;
1258 enum wrepl_name_state state;
1259 enum wrepl_name_node node;
1262 const struct wrepl_ip *ips;
1263 bool apply_expected;
1265 struct wrepl_wins_owner *merge_owner;
1266 bool sgroup_cleanup;
1270 * NOTE: the first record and the last applied one
1271 * needs to be from the same owner,
1272 * to not conflict in the next smbtorture run!!!
1275 .line = __location__,
1276 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1280 .type = WREPL_TYPE_UNIQUE,
1281 .state = WREPL_STATE_TOMBSTONE,
1282 .node = WREPL_NODE_B,
1284 .num_ips = ARRAY_SIZE(addresses_B_1),
1285 .ips = addresses_B_1,
1286 .apply_expected = true /* ignored */
1290 .type = WREPL_TYPE_UNIQUE,
1291 .state = WREPL_STATE_TOMBSTONE,
1292 .node = WREPL_NODE_B,
1294 .num_ips = ARRAY_SIZE(addresses_A_1),
1295 .ips = addresses_A_1,
1296 .apply_expected = true /* ignored */
1301 * unique vs unique section
1304 * unique,active vs. unique,active
1305 * => should be replaced
1308 .line = __location__,
1309 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1312 .type = WREPL_TYPE_UNIQUE,
1313 .state = WREPL_STATE_ACTIVE,
1314 .node = WREPL_NODE_B,
1316 .num_ips = ARRAY_SIZE(addresses_A_1),
1317 .ips = addresses_A_1,
1318 .apply_expected = true
1322 .type = WREPL_TYPE_UNIQUE,
1323 .state = WREPL_STATE_ACTIVE,
1324 .node = WREPL_NODE_B,
1326 .num_ips = ARRAY_SIZE(addresses_B_1),
1327 .ips = addresses_B_1,
1328 .apply_expected = true
1333 * unique,active vs. unique,tombstone
1334 * => should NOT be replaced
1337 .line = __location__,
1338 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1341 .type = WREPL_TYPE_UNIQUE,
1342 .state = WREPL_STATE_ACTIVE,
1343 .node = WREPL_NODE_B,
1345 .num_ips = ARRAY_SIZE(addresses_B_1),
1346 .ips = addresses_B_1,
1347 .apply_expected = true
1351 .type = WREPL_TYPE_UNIQUE,
1352 .state = WREPL_STATE_TOMBSTONE,
1353 .node = WREPL_NODE_B,
1355 .num_ips = ARRAY_SIZE(addresses_B_1),
1356 .ips = addresses_B_1,
1357 .apply_expected = false
1362 * unique,released vs. unique,active
1363 * => should be replaced
1366 .line = __location__,
1367 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1370 .type = WREPL_TYPE_UNIQUE,
1371 .state = WREPL_STATE_RELEASED,
1372 .node = WREPL_NODE_B,
1374 .num_ips = ARRAY_SIZE(addresses_B_1),
1375 .ips = addresses_B_1,
1376 .apply_expected = false
1380 .type = WREPL_TYPE_UNIQUE,
1381 .state = WREPL_STATE_ACTIVE,
1382 .node = WREPL_NODE_B,
1384 .num_ips = ARRAY_SIZE(addresses_A_1),
1385 .ips = addresses_A_1,
1386 .apply_expected = true
1391 * unique,released vs. unique,tombstone
1392 * => should be replaced
1395 .line = __location__,
1396 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1399 .type = WREPL_TYPE_UNIQUE,
1400 .state = WREPL_STATE_RELEASED,
1401 .node = WREPL_NODE_B,
1403 .num_ips = ARRAY_SIZE(addresses_A_1),
1404 .ips = addresses_A_1,
1405 .apply_expected = false
1409 .type = WREPL_TYPE_UNIQUE,
1410 .state = WREPL_STATE_TOMBSTONE,
1411 .node = WREPL_NODE_B,
1413 .num_ips = ARRAY_SIZE(addresses_B_1),
1414 .ips = addresses_B_1,
1415 .apply_expected = true
1420 * unique,tombstone vs. unique,active
1421 * => should be replaced
1424 .line = __location__,
1425 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1428 .type = WREPL_TYPE_UNIQUE,
1429 .state = WREPL_STATE_TOMBSTONE,
1430 .node = WREPL_NODE_B,
1432 .num_ips = ARRAY_SIZE(addresses_B_1),
1433 .ips = addresses_B_1,
1434 .apply_expected = true
1438 .type = WREPL_TYPE_UNIQUE,
1439 .state = WREPL_STATE_ACTIVE,
1440 .node = WREPL_NODE_B,
1442 .num_ips = ARRAY_SIZE(addresses_A_1),
1443 .ips = addresses_A_1,
1444 .apply_expected = true
1449 * unique,tombstone vs. unique,tombstone
1450 * => should be replaced
1453 .line = __location__,
1454 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1457 .type = WREPL_TYPE_UNIQUE,
1458 .state = WREPL_STATE_TOMBSTONE,
1459 .node = WREPL_NODE_B,
1461 .num_ips = ARRAY_SIZE(addresses_A_1),
1462 .ips = addresses_A_1,
1463 .apply_expected = true
1467 .type = WREPL_TYPE_UNIQUE,
1468 .state = WREPL_STATE_TOMBSTONE,
1469 .node = WREPL_NODE_B,
1471 .num_ips = ARRAY_SIZE(addresses_B_1),
1472 .ips = addresses_B_1,
1473 .apply_expected = true
1479 * unique vs normal groups section,
1482 * unique,active vs. group,active
1483 * => should be replaced
1486 .line = __location__,
1487 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1490 .type = WREPL_TYPE_UNIQUE,
1491 .state = WREPL_STATE_ACTIVE,
1492 .node = WREPL_NODE_B,
1494 .num_ips = ARRAY_SIZE(addresses_B_1),
1495 .ips = addresses_B_1,
1496 .apply_expected = true
1500 .type = WREPL_TYPE_GROUP,
1501 .state = WREPL_STATE_ACTIVE,
1502 .node = WREPL_NODE_B,
1504 .num_ips = ARRAY_SIZE(addresses_A_1),
1505 .ips = addresses_A_1,
1506 .apply_expected = true
1511 * unique,active vs. group,tombstone
1512 * => should NOT be replaced
1515 .line = __location__,
1516 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1519 .type = WREPL_TYPE_UNIQUE,
1520 .state = WREPL_STATE_ACTIVE,
1521 .node = WREPL_NODE_B,
1523 .num_ips = ARRAY_SIZE(addresses_A_1),
1524 .ips = addresses_A_1,
1525 .apply_expected = true
1529 .type = WREPL_TYPE_GROUP,
1530 .state = WREPL_STATE_TOMBSTONE,
1531 .node = WREPL_NODE_B,
1533 .num_ips = ARRAY_SIZE(addresses_A_1),
1534 .ips = addresses_A_1,
1535 .apply_expected = false
1540 * unique,released vs. group,active
1541 * => should be replaced
1544 .line = __location__,
1545 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1548 .type = WREPL_TYPE_UNIQUE,
1549 .state = WREPL_STATE_RELEASED,
1550 .node = WREPL_NODE_B,
1552 .num_ips = ARRAY_SIZE(addresses_A_1),
1553 .ips = addresses_A_1,
1554 .apply_expected = false
1558 .type = WREPL_TYPE_GROUP,
1559 .state = WREPL_STATE_ACTIVE,
1560 .node = WREPL_NODE_B,
1562 .num_ips = ARRAY_SIZE(addresses_B_1),
1563 .ips = addresses_B_1,
1564 .apply_expected = true
1569 * unique,released vs. group,tombstone
1570 * => should be replaced
1573 .line = __location__,
1574 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1577 .type = WREPL_TYPE_UNIQUE,
1578 .state = WREPL_STATE_RELEASED,
1579 .node = WREPL_NODE_B,
1581 .num_ips = ARRAY_SIZE(addresses_B_1),
1582 .ips = addresses_B_1,
1583 .apply_expected = false
1587 .type = WREPL_TYPE_GROUP,
1588 .state = WREPL_STATE_TOMBSTONE,
1589 .node = WREPL_NODE_B,
1591 .num_ips = ARRAY_SIZE(addresses_A_1),
1592 .ips = addresses_A_1,
1593 .apply_expected = true
1598 * unique,tombstone vs. group,active
1599 * => should be replaced
1602 .line = __location__,
1603 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1606 .type = WREPL_TYPE_UNIQUE,
1607 .state = WREPL_STATE_TOMBSTONE,
1608 .node = WREPL_NODE_B,
1610 .num_ips = ARRAY_SIZE(addresses_A_1),
1611 .ips = addresses_A_1,
1612 .apply_expected = true
1616 .type = WREPL_TYPE_GROUP,
1617 .state = WREPL_STATE_ACTIVE,
1618 .node = WREPL_NODE_B,
1620 .num_ips = ARRAY_SIZE(addresses_B_1),
1621 .ips = addresses_B_1,
1622 .apply_expected = true
1627 * unique,tombstone vs. group,tombstone
1628 * => should be replaced
1631 .line = __location__,
1632 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1635 .type = WREPL_TYPE_UNIQUE,
1636 .state = WREPL_STATE_TOMBSTONE,
1637 .node = WREPL_NODE_B,
1639 .num_ips = ARRAY_SIZE(addresses_B_1),
1640 .ips = addresses_B_1,
1641 .apply_expected = true
1645 .type = WREPL_TYPE_GROUP,
1646 .state = WREPL_STATE_TOMBSTONE,
1647 .node = WREPL_NODE_B,
1649 .num_ips = ARRAY_SIZE(addresses_A_1),
1650 .ips = addresses_A_1,
1651 .apply_expected = true
1656 * unique vs special groups section,
1659 * unique,active vs. sgroup,active
1660 * => should NOT be replaced
1663 .line = __location__,
1664 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1667 .type = WREPL_TYPE_UNIQUE,
1668 .state = WREPL_STATE_ACTIVE,
1669 .node = WREPL_NODE_B,
1671 .num_ips = ARRAY_SIZE(addresses_A_1),
1672 .ips = addresses_A_1,
1673 .apply_expected = true
1677 .type = WREPL_TYPE_SGROUP,
1678 .state = WREPL_STATE_ACTIVE,
1679 .node = WREPL_NODE_B,
1681 .num_ips = ARRAY_SIZE(addresses_A_1),
1682 .ips = addresses_A_1,
1683 .apply_expected = false
1688 * unique,active vs. sgroup,tombstone
1689 * => should NOT be replaced
1692 .line = __location__,
1693 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1696 .type = WREPL_TYPE_UNIQUE,
1697 .state = WREPL_STATE_ACTIVE,
1698 .node = WREPL_NODE_B,
1700 .num_ips = ARRAY_SIZE(addresses_A_1),
1701 .ips = addresses_A_1,
1702 .apply_expected = true
1706 .type = WREPL_TYPE_SGROUP,
1707 .state = WREPL_STATE_TOMBSTONE,
1708 .node = WREPL_NODE_B,
1710 .num_ips = ARRAY_SIZE(addresses_A_1),
1711 .ips = addresses_A_1,
1712 .apply_expected = false
1717 * unique,released vs. sgroup,active
1718 * => should be replaced
1721 .line = __location__,
1722 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1725 .type = WREPL_TYPE_UNIQUE,
1726 .state = WREPL_STATE_RELEASED,
1727 .node = WREPL_NODE_B,
1729 .num_ips = ARRAY_SIZE(addresses_A_1),
1730 .ips = addresses_A_1,
1731 .apply_expected = false
1735 .type = WREPL_TYPE_SGROUP,
1736 .state = WREPL_STATE_ACTIVE,
1737 .node = WREPL_NODE_B,
1739 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1740 .ips = addresses_B_3_4,
1741 .apply_expected = true
1746 * unique,released vs. sgroup,tombstone
1747 * => should be replaced
1750 .line = __location__,
1751 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1754 .type = WREPL_TYPE_UNIQUE,
1755 .state = WREPL_STATE_RELEASED,
1756 .node = WREPL_NODE_B,
1758 .num_ips = ARRAY_SIZE(addresses_B_1),
1759 .ips = addresses_B_1,
1760 .apply_expected = false
1764 .type = WREPL_TYPE_SGROUP,
1765 .state = WREPL_STATE_TOMBSTONE,
1766 .node = WREPL_NODE_B,
1768 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1769 .ips = addresses_A_3_4,
1770 .apply_expected = true
1775 * unique,tombstone vs. sgroup,active
1776 * => should be replaced
1779 .line = __location__,
1780 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1783 .type = WREPL_TYPE_UNIQUE,
1784 .state = WREPL_STATE_TOMBSTONE,
1785 .node = WREPL_NODE_B,
1787 .num_ips = ARRAY_SIZE(addresses_A_1),
1788 .ips = addresses_A_1,
1789 .apply_expected = true
1793 .type = WREPL_TYPE_SGROUP,
1794 .state = WREPL_STATE_ACTIVE,
1795 .node = WREPL_NODE_B,
1797 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1798 .ips = addresses_B_3_4,
1799 .apply_expected = true
1804 * unique,tombstone vs. sgroup,tombstone
1805 * => should be replaced
1808 .line = __location__,
1809 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1812 .type = WREPL_TYPE_UNIQUE,
1813 .state = WREPL_STATE_TOMBSTONE,
1814 .node = WREPL_NODE_B,
1816 .num_ips = ARRAY_SIZE(addresses_B_1),
1817 .ips = addresses_B_1,
1818 .apply_expected = true
1822 .type = WREPL_TYPE_SGROUP,
1823 .state = WREPL_STATE_TOMBSTONE,
1824 .node = WREPL_NODE_B,
1826 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1827 .ips = addresses_A_3_4,
1828 .apply_expected = true
1833 * unique vs multi homed section,
1836 * unique,active vs. mhomed,active
1837 * => should be replaced
1840 .line = __location__,
1841 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1844 .type = WREPL_TYPE_UNIQUE,
1845 .state = WREPL_STATE_ACTIVE,
1846 .node = WREPL_NODE_B,
1848 .num_ips = ARRAY_SIZE(addresses_A_1),
1849 .ips = addresses_A_1,
1850 .apply_expected = true
1854 .type = WREPL_TYPE_MHOMED,
1855 .state = WREPL_STATE_ACTIVE,
1856 .node = WREPL_NODE_B,
1858 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1859 .ips = addresses_B_3_4,
1860 .apply_expected = true
1865 * unique,active vs. mhomed,tombstone
1866 * => should NOT be replaced
1869 .line = __location__,
1870 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1873 .type = WREPL_TYPE_UNIQUE,
1874 .state = WREPL_STATE_ACTIVE,
1875 .node = WREPL_NODE_B,
1877 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1878 .ips = addresses_B_3_4,
1879 .apply_expected = true
1883 .type = WREPL_TYPE_MHOMED,
1884 .state = WREPL_STATE_TOMBSTONE,
1885 .node = WREPL_NODE_B,
1887 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1888 .ips = addresses_B_3_4,
1889 .apply_expected = false
1894 * unique,released vs. mhomed,active
1895 * => should be replaced
1898 .line = __location__,
1899 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1902 .type = WREPL_TYPE_UNIQUE,
1903 .state = WREPL_STATE_RELEASED,
1904 .node = WREPL_NODE_B,
1906 .num_ips = ARRAY_SIZE(addresses_B_1),
1907 .ips = addresses_B_1,
1908 .apply_expected = false
1912 .type = WREPL_TYPE_MHOMED,
1913 .state = WREPL_STATE_ACTIVE,
1914 .node = WREPL_NODE_B,
1916 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1917 .ips = addresses_A_3_4,
1918 .apply_expected = true
1923 * unique,released vs. mhomed,tombstone
1924 * => should be replaced
1927 .line = __location__,
1928 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1931 .type = WREPL_TYPE_UNIQUE,
1932 .state = WREPL_STATE_RELEASED,
1933 .node = WREPL_NODE_B,
1935 .num_ips = ARRAY_SIZE(addresses_A_1),
1936 .ips = addresses_A_1,
1937 .apply_expected = false
1941 .type = WREPL_TYPE_MHOMED,
1942 .state = WREPL_STATE_TOMBSTONE,
1943 .node = WREPL_NODE_B,
1945 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1946 .ips = addresses_B_3_4,
1947 .apply_expected = true
1952 * unique,tombstone vs. mhomed,active
1953 * => should be replaced
1956 .line = __location__,
1957 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1960 .type = WREPL_TYPE_UNIQUE,
1961 .state = WREPL_STATE_TOMBSTONE,
1962 .node = WREPL_NODE_B,
1964 .num_ips = ARRAY_SIZE(addresses_B_1),
1965 .ips = addresses_B_1,
1966 .apply_expected = true
1970 .type = WREPL_TYPE_MHOMED,
1971 .state = WREPL_STATE_ACTIVE,
1972 .node = WREPL_NODE_B,
1974 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1975 .ips = addresses_A_3_4,
1976 .apply_expected = true
1981 * unique,tombstone vs. mhomed,tombstone
1982 * => should be replaced
1985 .line = __location__,
1986 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1989 .type = WREPL_TYPE_UNIQUE,
1990 .state = WREPL_STATE_TOMBSTONE,
1991 .node = WREPL_NODE_B,
1993 .num_ips = ARRAY_SIZE(addresses_A_1),
1994 .ips = addresses_A_1,
1995 .apply_expected = true
1999 .type = WREPL_TYPE_MHOMED,
2000 .state = WREPL_STATE_TOMBSTONE,
2001 .node = WREPL_NODE_B,
2003 .num_ips = ARRAY_SIZE(addresses_B_3_4),
2004 .ips = addresses_B_3_4,
2005 .apply_expected = true
2010 * normal groups vs unique section,
2013 * group,active vs. unique,active
2014 * => should NOT be replaced
2017 .line = __location__,
2018 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2021 .type = WREPL_TYPE_GROUP,
2022 .state = WREPL_STATE_ACTIVE,
2023 .node = WREPL_NODE_B,
2025 .num_ips = ARRAY_SIZE(addresses_A_1),
2026 .ips = addresses_A_1,
2027 .apply_expected = true
2031 .type = WREPL_TYPE_UNIQUE,
2032 .state = WREPL_STATE_ACTIVE,
2033 .node = WREPL_NODE_B,
2035 .num_ips = ARRAY_SIZE(addresses_A_1),
2036 .ips = addresses_A_1,
2037 .apply_expected = false
2042 * group,active vs. unique,tombstone
2043 * => should NOT be replaced
2046 .line = __location__,
2047 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2050 .type = WREPL_TYPE_GROUP,
2051 .state = WREPL_STATE_ACTIVE,
2052 .node = WREPL_NODE_B,
2054 .num_ips = ARRAY_SIZE(addresses_A_1),
2055 .ips = addresses_A_1,
2056 .apply_expected = true
2060 .type = WREPL_TYPE_UNIQUE,
2061 .state = WREPL_STATE_TOMBSTONE,
2062 .node = WREPL_NODE_B,
2064 .num_ips = ARRAY_SIZE(addresses_A_1),
2065 .ips = addresses_A_1,
2066 .apply_expected = false
2071 * group,released vs. unique,active
2072 * => should NOT be replaced
2075 .line = __location__,
2076 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2079 .type = WREPL_TYPE_GROUP,
2080 .state = WREPL_STATE_RELEASED,
2081 .node = WREPL_NODE_B,
2083 .num_ips = ARRAY_SIZE(addresses_A_1),
2084 .ips = addresses_A_1,
2085 .apply_expected = false
2089 .type = WREPL_TYPE_UNIQUE,
2090 .state = WREPL_STATE_ACTIVE,
2091 .node = WREPL_NODE_B,
2093 .num_ips = ARRAY_SIZE(addresses_A_1),
2094 .ips = addresses_A_1,
2095 .apply_expected = false
2100 * group,released vs. unique,tombstone
2101 * => should NOT be replaced
2104 .line = __location__,
2105 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2108 .type = WREPL_TYPE_GROUP,
2109 .state = WREPL_STATE_RELEASED,
2110 .node = WREPL_NODE_B,
2112 .num_ips = ARRAY_SIZE(addresses_A_1),
2113 .ips = addresses_A_1,
2114 .apply_expected = false
2118 .type = WREPL_TYPE_UNIQUE,
2119 .state = WREPL_STATE_TOMBSTONE,
2120 .node = WREPL_NODE_B,
2122 .num_ips = ARRAY_SIZE(addresses_A_1),
2123 .ips = addresses_A_1,
2124 .apply_expected = false
2129 * group,tombstone vs. unique,active
2130 * => should NOT be replaced
2133 .line = __location__,
2134 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2137 .type = WREPL_TYPE_GROUP,
2138 .state = WREPL_STATE_TOMBSTONE,
2139 .node = WREPL_NODE_B,
2141 .num_ips = ARRAY_SIZE(addresses_A_1),
2142 .ips = addresses_A_1,
2143 .apply_expected = true
2147 .type = WREPL_TYPE_UNIQUE,
2148 .state = WREPL_STATE_ACTIVE,
2149 .node = WREPL_NODE_B,
2151 .num_ips = ARRAY_SIZE(addresses_A_1),
2152 .ips = addresses_A_1,
2153 .apply_expected = false
2158 * group,tombstone vs. unique,tombstone
2159 * => should NOT be replaced
2162 .line = __location__,
2163 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2166 .type = WREPL_TYPE_GROUP,
2167 .state = WREPL_STATE_TOMBSTONE,
2168 .node = WREPL_NODE_B,
2170 .num_ips = ARRAY_SIZE(addresses_A_1),
2171 .ips = addresses_A_1,
2172 .apply_expected = true
2176 .type = WREPL_TYPE_UNIQUE,
2177 .state = WREPL_STATE_TOMBSTONE,
2178 .node = WREPL_NODE_B,
2180 .num_ips = ARRAY_SIZE(addresses_A_1),
2181 .ips = addresses_A_1,
2182 .apply_expected = false
2187 * normal groups vs normal groups section,
2190 * group,active vs. group,active
2191 * => should NOT be replaced
2194 .line = __location__,
2195 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2198 .type = WREPL_TYPE_GROUP,
2199 .state = WREPL_STATE_ACTIVE,
2200 .node = WREPL_NODE_B,
2202 .num_ips = ARRAY_SIZE(addresses_A_1),
2203 .ips = addresses_A_1,
2204 .apply_expected = true
2208 .type = WREPL_TYPE_GROUP,
2209 .state = WREPL_STATE_ACTIVE,
2210 .node = WREPL_NODE_B,
2212 .num_ips = ARRAY_SIZE(addresses_A_1),
2213 .ips = addresses_A_1,
2214 .apply_expected = false
2219 * group,active vs. group,tombstone
2220 * => should NOT be replaced
2223 .line = __location__,
2224 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2227 .type = WREPL_TYPE_GROUP,
2228 .state = WREPL_STATE_ACTIVE,
2229 .node = WREPL_NODE_B,
2231 .num_ips = ARRAY_SIZE(addresses_A_1),
2232 .ips = addresses_A_1,
2233 .apply_expected = true
2237 .type = WREPL_TYPE_GROUP,
2238 .state = WREPL_STATE_TOMBSTONE,
2239 .node = WREPL_NODE_B,
2241 .num_ips = ARRAY_SIZE(addresses_A_1),
2242 .ips = addresses_A_1,
2243 .apply_expected = false
2248 * group,released vs. group,active
2249 * => should be replaced
2252 .line = __location__,
2253 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2256 .type = WREPL_TYPE_GROUP,
2257 .state = WREPL_STATE_RELEASED,
2258 .node = WREPL_NODE_B,
2260 .num_ips = ARRAY_SIZE(addresses_A_1),
2261 .ips = addresses_A_1,
2262 .apply_expected = false
2266 .type = WREPL_TYPE_GROUP,
2267 .state = WREPL_STATE_ACTIVE,
2268 .node = WREPL_NODE_B,
2270 .num_ips = ARRAY_SIZE(addresses_B_1),
2271 .ips = addresses_B_1,
2272 .apply_expected = true
2277 * group,released vs. group,tombstone
2278 * => should be replaced
2281 .line = __location__,
2282 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2285 .type = WREPL_TYPE_GROUP,
2286 .state = WREPL_STATE_RELEASED,
2287 .node = WREPL_NODE_B,
2289 .num_ips = ARRAY_SIZE(addresses_A_1),
2290 .ips = addresses_A_1,
2291 .apply_expected = false
2295 .type = WREPL_TYPE_GROUP,
2296 .state = WREPL_STATE_TOMBSTONE,
2297 .node = WREPL_NODE_B,
2299 .num_ips = ARRAY_SIZE(addresses_B_1),
2300 .ips = addresses_B_1,
2301 .apply_expected = true
2306 * group,tombstone vs. group,active
2307 * => should be replaced
2310 .line = __location__,
2311 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2314 .type = WREPL_TYPE_GROUP,
2315 .state = WREPL_STATE_TOMBSTONE,
2316 .node = WREPL_NODE_B,
2318 .num_ips = ARRAY_SIZE(addresses_B_1),
2319 .ips = addresses_B_1,
2320 .apply_expected = true
2324 .type = WREPL_TYPE_GROUP,
2325 .state = WREPL_STATE_ACTIVE,
2326 .node = WREPL_NODE_B,
2328 .num_ips = ARRAY_SIZE(addresses_A_1),
2329 .ips = addresses_A_1,
2330 .apply_expected = true
2335 * group,tombstone vs. group,tombstone
2336 * => should be replaced
2339 .line = __location__,
2340 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2343 .type = WREPL_TYPE_GROUP,
2344 .state = WREPL_STATE_TOMBSTONE,
2345 .node = WREPL_NODE_B,
2347 .num_ips = ARRAY_SIZE(addresses_A_1),
2348 .ips = addresses_A_1,
2349 .apply_expected = true
2353 .type = WREPL_TYPE_GROUP,
2354 .state = WREPL_STATE_TOMBSTONE,
2355 .node = WREPL_NODE_B,
2357 .num_ips = ARRAY_SIZE(addresses_B_1),
2358 .ips = addresses_B_1,
2359 .apply_expected = true
2364 * normal groups vs special groups section,
2367 * group,active vs. sgroup,active
2368 * => should NOT be replaced
2371 .line = __location__,
2372 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2375 .type = WREPL_TYPE_GROUP,
2376 .state = WREPL_STATE_ACTIVE,
2377 .node = WREPL_NODE_B,
2379 .num_ips = ARRAY_SIZE(addresses_B_1),
2380 .ips = addresses_B_1,
2381 .apply_expected = true
2385 .type = WREPL_TYPE_SGROUP,
2386 .state = WREPL_STATE_ACTIVE,
2387 .node = WREPL_NODE_B,
2389 .num_ips = ARRAY_SIZE(addresses_B_1),
2390 .ips = addresses_B_1,
2391 .apply_expected = false
2396 * group,active vs. sgroup,tombstone
2397 * => should NOT be replaced
2400 .line = __location__,
2401 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2404 .type = WREPL_TYPE_GROUP,
2405 .state = WREPL_STATE_ACTIVE,
2406 .node = WREPL_NODE_B,
2408 .num_ips = ARRAY_SIZE(addresses_B_1),
2409 .ips = addresses_B_1,
2410 .apply_expected = true
2414 .type = WREPL_TYPE_SGROUP,
2415 .state = WREPL_STATE_TOMBSTONE,
2416 .node = WREPL_NODE_B,
2418 .num_ips = ARRAY_SIZE(addresses_B_1),
2419 .ips = addresses_B_1,
2420 .apply_expected = false
2425 * group,released vs. sgroup,active
2426 * => should be replaced
2429 .line = __location__,
2430 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2433 .type = WREPL_TYPE_GROUP,
2434 .state = WREPL_STATE_RELEASED,
2435 .node = WREPL_NODE_B,
2437 .num_ips = ARRAY_SIZE(addresses_A_1),
2438 .ips = addresses_A_1,
2439 .apply_expected = false
2443 .type = WREPL_TYPE_SGROUP,
2444 .state = WREPL_STATE_ACTIVE,
2445 .node = WREPL_NODE_B,
2447 .num_ips = ARRAY_SIZE(addresses_B_1),
2448 .ips = addresses_B_1,
2449 .apply_expected = true
2454 * group,released vs. sgroup,tombstone
2455 * => should NOT be replaced
2458 .line = __location__,
2459 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2462 .type = WREPL_TYPE_GROUP,
2463 .state = WREPL_STATE_RELEASED,
2464 .node = WREPL_NODE_B,
2466 .num_ips = ARRAY_SIZE(addresses_B_1),
2467 .ips = addresses_B_1,
2468 .apply_expected = false
2472 .type = WREPL_TYPE_SGROUP,
2473 .state = WREPL_STATE_TOMBSTONE,
2474 .node = WREPL_NODE_B,
2476 .num_ips = ARRAY_SIZE(addresses_B_1),
2477 .ips = addresses_B_1,
2478 .apply_expected = false
2483 * group,tombstone vs. sgroup,active
2484 * => should be replaced
2487 .line = __location__,
2488 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2491 .type = WREPL_TYPE_GROUP,
2492 .state = WREPL_STATE_TOMBSTONE,
2493 .node = WREPL_NODE_B,
2495 .num_ips = ARRAY_SIZE(addresses_B_1),
2496 .ips = addresses_B_1,
2497 .apply_expected = true
2501 .type = WREPL_TYPE_SGROUP,
2502 .state = WREPL_STATE_ACTIVE,
2503 .node = WREPL_NODE_B,
2505 .num_ips = ARRAY_SIZE(addresses_A_1),
2506 .ips = addresses_A_1,
2507 .apply_expected = true
2512 * group,tombstone vs. sgroup,tombstone
2513 * => should be replaced
2516 .line = __location__,
2517 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2520 .type = WREPL_TYPE_GROUP,
2521 .state = WREPL_STATE_TOMBSTONE,
2522 .node = WREPL_NODE_B,
2524 .num_ips = ARRAY_SIZE(addresses_A_1),
2525 .ips = addresses_A_1,
2526 .apply_expected = true
2530 .type = WREPL_TYPE_SGROUP,
2531 .state = WREPL_STATE_TOMBSTONE,
2532 .node = WREPL_NODE_B,
2534 .num_ips = ARRAY_SIZE(addresses_B_1),
2535 .ips = addresses_B_1,
2536 .apply_expected = true
2541 * normal groups vs multi homed section,
2544 * group,active vs. mhomed,active
2545 * => should NOT be replaced
2548 .line = __location__,
2549 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2552 .type = WREPL_TYPE_GROUP,
2553 .state = WREPL_STATE_ACTIVE,
2554 .node = WREPL_NODE_B,
2556 .num_ips = ARRAY_SIZE(addresses_B_1),
2557 .ips = addresses_B_1,
2558 .apply_expected = true
2562 .type = WREPL_TYPE_MHOMED,
2563 .state = WREPL_STATE_ACTIVE,
2564 .node = WREPL_NODE_B,
2566 .num_ips = ARRAY_SIZE(addresses_B_1),
2567 .ips = addresses_B_1,
2568 .apply_expected = false
2573 * group,active vs. mhomed,tombstone
2574 * => should NOT be replaced
2577 .line = __location__,
2578 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2581 .type = WREPL_TYPE_GROUP,
2582 .state = WREPL_STATE_ACTIVE,
2583 .node = WREPL_NODE_B,
2585 .num_ips = ARRAY_SIZE(addresses_B_1),
2586 .ips = addresses_B_1,
2587 .apply_expected = true
2591 .type = WREPL_TYPE_MHOMED,
2592 .state = WREPL_STATE_TOMBSTONE,
2593 .node = WREPL_NODE_B,
2595 .num_ips = ARRAY_SIZE(addresses_B_1),
2596 .ips = addresses_B_1,
2597 .apply_expected = false
2602 * group,released vs. mhomed,active
2603 * => should NOT be replaced
2606 .line = __location__,
2607 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2610 .type = WREPL_TYPE_GROUP,
2611 .state = WREPL_STATE_RELEASED,
2612 .node = WREPL_NODE_B,
2614 .num_ips = ARRAY_SIZE(addresses_B_1),
2615 .ips = addresses_B_1,
2616 .apply_expected = false
2620 .type = WREPL_TYPE_MHOMED,
2621 .state = WREPL_STATE_ACTIVE,
2622 .node = WREPL_NODE_B,
2624 .num_ips = ARRAY_SIZE(addresses_B_1),
2625 .ips = addresses_B_1,
2626 .apply_expected = false
2631 * group,released vs. mhomed,tombstone
2632 * => should NOT be replaced
2635 .line = __location__,
2636 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2639 .type = WREPL_TYPE_GROUP,
2640 .state = WREPL_STATE_RELEASED,
2641 .node = WREPL_NODE_B,
2643 .num_ips = ARRAY_SIZE(addresses_B_1),
2644 .ips = addresses_B_1,
2645 .apply_expected = false
2649 .type = WREPL_TYPE_MHOMED,
2650 .state = WREPL_STATE_TOMBSTONE,
2651 .node = WREPL_NODE_B,
2653 .num_ips = ARRAY_SIZE(addresses_B_1),
2654 .ips = addresses_B_1,
2655 .apply_expected = false
2660 * group,tombstone vs. mhomed,active
2661 * => should be replaced
2664 .line = __location__,
2665 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2668 .type = WREPL_TYPE_GROUP,
2669 .state = WREPL_STATE_TOMBSTONE,
2670 .node = WREPL_NODE_B,
2672 .num_ips = ARRAY_SIZE(addresses_B_1),
2673 .ips = addresses_B_1,
2674 .apply_expected = true
2678 .type = WREPL_TYPE_MHOMED,
2679 .state = WREPL_STATE_ACTIVE,
2680 .node = WREPL_NODE_B,
2682 .num_ips = ARRAY_SIZE(addresses_A_1),
2683 .ips = addresses_A_1,
2684 .apply_expected = true
2689 * group,tombstone vs. mhomed,tombstone
2690 * => should be replaced
2693 .line = __location__,
2694 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2697 .type = WREPL_TYPE_GROUP,
2698 .state = WREPL_STATE_TOMBSTONE,
2699 .node = WREPL_NODE_B,
2701 .num_ips = ARRAY_SIZE(addresses_A_1),
2702 .ips = addresses_A_1,
2703 .apply_expected = true
2707 .type = WREPL_TYPE_MHOMED,
2708 .state = WREPL_STATE_TOMBSTONE,
2709 .node = WREPL_NODE_B,
2711 .num_ips = ARRAY_SIZE(addresses_B_1),
2712 .ips = addresses_B_1,
2713 .apply_expected = true
2718 * special groups vs unique section,
2721 * sgroup,active vs. unique,active
2722 * => should NOT be replaced
2725 .line = __location__,
2726 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2729 .type = WREPL_TYPE_SGROUP,
2730 .state = WREPL_STATE_ACTIVE,
2731 .node = WREPL_NODE_B,
2733 .num_ips = ARRAY_SIZE(addresses_B_1),
2734 .ips = addresses_B_1,
2735 .apply_expected = true
2739 .type = WREPL_TYPE_UNIQUE,
2740 .state = WREPL_STATE_ACTIVE,
2741 .node = WREPL_NODE_B,
2743 .num_ips = ARRAY_SIZE(addresses_B_1),
2744 .ips = addresses_B_1,
2745 .apply_expected = false
2750 * sgroup,active vs. unique,tombstone
2751 * => should NOT be replaced
2754 .line = __location__,
2755 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2758 .type = WREPL_TYPE_SGROUP,
2759 .state = WREPL_STATE_ACTIVE,
2760 .node = WREPL_NODE_B,
2762 .num_ips = ARRAY_SIZE(addresses_B_1),
2763 .ips = addresses_B_1,
2764 .apply_expected = true
2768 .type = WREPL_TYPE_UNIQUE,
2769 .state = WREPL_STATE_TOMBSTONE,
2770 .node = WREPL_NODE_B,
2772 .num_ips = ARRAY_SIZE(addresses_B_1),
2773 .ips = addresses_B_1,
2774 .apply_expected = false
2779 * sgroup,released vs. unique,active
2780 * => should be replaced
2783 .line = __location__,
2784 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2787 .type = WREPL_TYPE_SGROUP,
2788 .state = WREPL_STATE_RELEASED,
2789 .node = WREPL_NODE_B,
2791 .num_ips = ARRAY_SIZE(addresses_B_1),
2792 .ips = addresses_B_1,
2793 .apply_expected = false
2797 .type = WREPL_TYPE_UNIQUE,
2798 .state = WREPL_STATE_ACTIVE,
2799 .node = WREPL_NODE_B,
2801 .num_ips = ARRAY_SIZE(addresses_A_1),
2802 .ips = addresses_A_1,
2803 .apply_expected = true
2808 * sgroup,released vs. unique,tombstone
2809 * => should be replaced
2812 .line = __location__,
2813 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2816 .type = WREPL_TYPE_SGROUP,
2817 .state = WREPL_STATE_RELEASED,
2818 .node = WREPL_NODE_B,
2820 .num_ips = ARRAY_SIZE(addresses_A_1),
2821 .ips = addresses_A_1,
2822 .apply_expected = false
2826 .type = WREPL_TYPE_UNIQUE,
2827 .state = WREPL_STATE_TOMBSTONE,
2828 .node = WREPL_NODE_B,
2830 .num_ips = ARRAY_SIZE(addresses_B_1),
2831 .ips = addresses_B_1,
2832 .apply_expected = true
2837 * sgroup,tombstone vs. unique,active
2838 * => should be replaced
2841 .line = __location__,
2842 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2845 .type = WREPL_TYPE_SGROUP,
2846 .state = WREPL_STATE_TOMBSTONE,
2847 .node = WREPL_NODE_B,
2849 .num_ips = ARRAY_SIZE(addresses_A_1),
2850 .ips = addresses_A_1,
2851 .apply_expected = true
2855 .type = WREPL_TYPE_UNIQUE,
2856 .state = WREPL_STATE_ACTIVE,
2857 .node = WREPL_NODE_B,
2859 .num_ips = ARRAY_SIZE(addresses_B_1),
2860 .ips = addresses_B_1,
2861 .apply_expected = true
2866 * sgroup,tombstone vs. unique,tombstone
2867 * => should be replaced
2870 .line = __location__,
2871 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2874 .type = WREPL_TYPE_SGROUP,
2875 .state = WREPL_STATE_TOMBSTONE,
2876 .node = WREPL_NODE_B,
2878 .num_ips = ARRAY_SIZE(addresses_B_1),
2879 .ips = addresses_B_1,
2880 .apply_expected = true
2884 .type = WREPL_TYPE_UNIQUE,
2885 .state = WREPL_STATE_TOMBSTONE,
2886 .node = WREPL_NODE_B,
2888 .num_ips = ARRAY_SIZE(addresses_A_1),
2889 .ips = addresses_A_1,
2890 .apply_expected = true
2895 * special groups vs normal group section,
2898 * sgroup,active vs. group,active
2899 * => should NOT be replaced
2902 .line = __location__,
2903 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2906 .type = WREPL_TYPE_SGROUP,
2907 .state = WREPL_STATE_ACTIVE,
2908 .node = WREPL_NODE_B,
2910 .num_ips = ARRAY_SIZE(addresses_A_1),
2911 .ips = addresses_A_1,
2912 .apply_expected = true
2916 .type = WREPL_TYPE_GROUP,
2917 .state = WREPL_STATE_ACTIVE,
2918 .node = WREPL_NODE_B,
2920 .num_ips = ARRAY_SIZE(addresses_A_1),
2921 .ips = addresses_A_1,
2922 .apply_expected = false
2927 * sgroup,active vs. group,tombstone
2928 * => should NOT be replaced
2931 .line = __location__,
2932 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2935 .type = WREPL_TYPE_SGROUP,
2936 .state = WREPL_STATE_ACTIVE,
2937 .node = WREPL_NODE_B,
2939 .num_ips = ARRAY_SIZE(addresses_A_1),
2940 .ips = addresses_A_1,
2941 .apply_expected = true
2945 .type = WREPL_TYPE_GROUP,
2946 .state = WREPL_STATE_TOMBSTONE,
2947 .node = WREPL_NODE_B,
2949 .num_ips = ARRAY_SIZE(addresses_A_1),
2950 .ips = addresses_A_1,
2951 .apply_expected = false
2956 * sgroup,released vs. group,active
2957 * => should be replaced
2960 .line = __location__,
2961 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2964 .type = WREPL_TYPE_SGROUP,
2965 .state = WREPL_STATE_RELEASED,
2966 .node = WREPL_NODE_B,
2968 .num_ips = ARRAY_SIZE(addresses_A_1),
2969 .ips = addresses_A_1,
2970 .apply_expected = false
2974 .type = WREPL_TYPE_GROUP,
2975 .state = WREPL_STATE_ACTIVE,
2976 .node = WREPL_NODE_B,
2978 .num_ips = ARRAY_SIZE(addresses_B_1),
2979 .ips = addresses_B_1,
2980 .apply_expected = true
2985 * sgroup,released vs. group,tombstone
2986 * => should be replaced
2989 .line = __location__,
2990 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2993 .type = WREPL_TYPE_SGROUP,
2994 .state = WREPL_STATE_RELEASED,
2995 .node = WREPL_NODE_B,
2997 .num_ips = ARRAY_SIZE(addresses_B_1),
2998 .ips = addresses_B_1,
2999 .apply_expected = false
3003 .type = WREPL_TYPE_GROUP,
3004 .state = WREPL_STATE_TOMBSTONE,
3005 .node = WREPL_NODE_B,
3007 .num_ips = ARRAY_SIZE(addresses_A_1),
3008 .ips = addresses_A_1,
3009 .apply_expected = true
3014 * sgroup,tombstone vs. group,active
3015 * => should NOT be replaced
3018 .line = __location__,
3019 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3022 .type = WREPL_TYPE_SGROUP,
3023 .state = WREPL_STATE_TOMBSTONE,
3024 .node = WREPL_NODE_B,
3026 .num_ips = ARRAY_SIZE(addresses_A_1),
3027 .ips = addresses_A_1,
3028 .apply_expected = true
3032 .type = WREPL_TYPE_GROUP,
3033 .state = WREPL_STATE_ACTIVE,
3034 .node = WREPL_NODE_B,
3036 .num_ips = ARRAY_SIZE(addresses_B_1),
3037 .ips = addresses_B_1,
3038 .apply_expected = true
3043 * sgroup,tombstone vs. group,tombstone
3044 * => should NOT be replaced
3047 .line = __location__,
3048 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3051 .type = WREPL_TYPE_SGROUP,
3052 .state = WREPL_STATE_TOMBSTONE,
3053 .node = WREPL_NODE_B,
3055 .num_ips = ARRAY_SIZE(addresses_B_1),
3056 .ips = addresses_B_1,
3057 .apply_expected = true
3061 .type = WREPL_TYPE_GROUP,
3062 .state = WREPL_STATE_TOMBSTONE,
3063 .node = WREPL_NODE_B,
3065 .num_ips = ARRAY_SIZE(addresses_A_1),
3066 .ips = addresses_A_1,
3067 .apply_expected = true
3072 * special groups (not active) vs special group section,
3075 * sgroup,released vs. sgroup,active
3076 * => should be replaced
3079 .line = __location__,
3080 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3083 .type = WREPL_TYPE_SGROUP,
3084 .state = WREPL_STATE_RELEASED,
3085 .node = WREPL_NODE_B,
3087 .num_ips = ARRAY_SIZE(addresses_A_1),
3088 .ips = addresses_A_1,
3089 .apply_expected = false
3093 .type = WREPL_TYPE_SGROUP,
3094 .state = WREPL_STATE_ACTIVE,
3095 .node = WREPL_NODE_B,
3097 .num_ips = ARRAY_SIZE(addresses_B_1),
3098 .ips = addresses_B_1,
3099 .apply_expected = true
3104 * sgroup,released vs. sgroup,tombstone
3105 * => should be replaced
3108 .line = __location__,
3109 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3112 .type = WREPL_TYPE_SGROUP,
3113 .state = WREPL_STATE_RELEASED,
3114 .node = WREPL_NODE_B,
3116 .num_ips = ARRAY_SIZE(addresses_B_1),
3117 .ips = addresses_B_1,
3118 .apply_expected = false
3122 .type = WREPL_TYPE_SGROUP,
3123 .state = WREPL_STATE_TOMBSTONE,
3124 .node = WREPL_NODE_B,
3126 .num_ips = ARRAY_SIZE(addresses_A_1),
3127 .ips = addresses_A_1,
3128 .apply_expected = true
3133 * sgroup,tombstone vs. sgroup,active
3134 * => should NOT be replaced
3137 .line = __location__,
3138 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3141 .type = WREPL_TYPE_SGROUP,
3142 .state = WREPL_STATE_TOMBSTONE,
3143 .node = WREPL_NODE_B,
3145 .num_ips = ARRAY_SIZE(addresses_A_1),
3146 .ips = addresses_A_1,
3147 .apply_expected = true
3151 .type = WREPL_TYPE_SGROUP,
3152 .state = WREPL_STATE_ACTIVE,
3153 .node = WREPL_NODE_B,
3155 .num_ips = ARRAY_SIZE(addresses_B_1),
3156 .ips = addresses_B_1,
3157 .apply_expected = true
3162 * sgroup,tombstone vs. sgroup,tombstone
3163 * => should NOT be replaced
3166 .line = __location__,
3167 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3170 .type = WREPL_TYPE_SGROUP,
3171 .state = WREPL_STATE_TOMBSTONE,
3172 .node = WREPL_NODE_B,
3174 .num_ips = ARRAY_SIZE(addresses_B_1),
3175 .ips = addresses_B_1,
3176 .apply_expected = true
3180 .type = WREPL_TYPE_SGROUP,
3181 .state = WREPL_STATE_TOMBSTONE,
3182 .node = WREPL_NODE_B,
3184 .num_ips = ARRAY_SIZE(addresses_A_1),
3185 .ips = addresses_A_1,
3186 .apply_expected = true
3191 * special groups vs multi homed section,
3194 * sgroup,active vs. mhomed,active
3195 * => should NOT be replaced
3198 .line = __location__,
3199 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3202 .type = WREPL_TYPE_SGROUP,
3203 .state = WREPL_STATE_ACTIVE,
3204 .node = WREPL_NODE_B,
3206 .num_ips = ARRAY_SIZE(addresses_A_1),
3207 .ips = addresses_A_1,
3208 .apply_expected = true
3212 .type = WREPL_TYPE_MHOMED,
3213 .state = WREPL_STATE_ACTIVE,
3214 .node = WREPL_NODE_B,
3216 .num_ips = ARRAY_SIZE(addresses_A_1),
3217 .ips = addresses_A_1,
3218 .apply_expected = false
3223 * sgroup,active vs. mhomed,tombstone
3224 * => should NOT be replaced
3227 .line = __location__,
3228 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3231 .type = WREPL_TYPE_SGROUP,
3232 .state = WREPL_STATE_ACTIVE,
3233 .node = WREPL_NODE_B,
3235 .num_ips = ARRAY_SIZE(addresses_A_1),
3236 .ips = addresses_A_1,
3237 .apply_expected = true
3241 .type = WREPL_TYPE_MHOMED,
3242 .state = WREPL_STATE_TOMBSTONE,
3243 .node = WREPL_NODE_B,
3245 .num_ips = ARRAY_SIZE(addresses_A_1),
3246 .ips = addresses_A_1,
3247 .apply_expected = false
3252 * sgroup,released vs. mhomed,active
3253 * => should be replaced
3256 .line = __location__,
3257 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3260 .type = WREPL_TYPE_SGROUP,
3261 .state = WREPL_STATE_RELEASED,
3262 .node = WREPL_NODE_B,
3264 .num_ips = ARRAY_SIZE(addresses_A_1),
3265 .ips = addresses_A_1,
3266 .apply_expected = false
3270 .type = WREPL_TYPE_MHOMED,
3271 .state = WREPL_STATE_ACTIVE,
3272 .node = WREPL_NODE_B,
3274 .num_ips = ARRAY_SIZE(addresses_B_1),
3275 .ips = addresses_B_1,
3276 .apply_expected = true
3281 * sgroup,released vs. mhomed,tombstone
3282 * => should be replaced
3285 .line = __location__,
3286 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3289 .type = WREPL_TYPE_SGROUP,
3290 .state = WREPL_STATE_RELEASED,
3291 .node = WREPL_NODE_B,
3293 .num_ips = ARRAY_SIZE(addresses_B_1),
3294 .ips = addresses_B_1,
3295 .apply_expected = false
3299 .type = WREPL_TYPE_MHOMED,
3300 .state = WREPL_STATE_TOMBSTONE,
3301 .node = WREPL_NODE_B,
3303 .num_ips = ARRAY_SIZE(addresses_A_1),
3304 .ips = addresses_A_1,
3305 .apply_expected = true
3310 * sgroup,tombstone vs. mhomed,active
3311 * => should be replaced
3314 .line = __location__,
3315 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3318 .type = WREPL_TYPE_SGROUP,
3319 .state = WREPL_STATE_TOMBSTONE,
3320 .node = WREPL_NODE_B,
3322 .num_ips = ARRAY_SIZE(addresses_A_1),
3323 .ips = addresses_A_1,
3324 .apply_expected = true
3328 .type = WREPL_TYPE_MHOMED,
3329 .state = WREPL_STATE_ACTIVE,
3330 .node = WREPL_NODE_B,
3332 .num_ips = ARRAY_SIZE(addresses_B_1),
3333 .ips = addresses_B_1,
3334 .apply_expected = true
3339 * sgroup,tombstone vs. mhomed,tombstone
3340 * => should be replaced
3343 .line = __location__,
3344 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3347 .type = WREPL_TYPE_SGROUP,
3348 .state = WREPL_STATE_TOMBSTONE,
3349 .node = WREPL_NODE_B,
3351 .num_ips = ARRAY_SIZE(addresses_B_1),
3352 .ips = addresses_B_1,
3353 .apply_expected = true
3357 .type = WREPL_TYPE_MHOMED,
3358 .state = WREPL_STATE_TOMBSTONE,
3359 .node = WREPL_NODE_B,
3361 .num_ips = ARRAY_SIZE(addresses_A_1),
3362 .ips = addresses_A_1,
3363 .apply_expected = true
3368 * multi homed vs. unique section,
3371 * mhomed,active vs. unique,active
3372 * => should be replaced
3375 .line = __location__,
3376 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3379 .type = WREPL_TYPE_MHOMED,
3380 .state = WREPL_STATE_ACTIVE,
3381 .node = WREPL_NODE_B,
3383 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3384 .ips = addresses_A_3_4,
3385 .apply_expected = true
3389 .type = WREPL_TYPE_UNIQUE,
3390 .state = WREPL_STATE_ACTIVE,
3391 .node = WREPL_NODE_B,
3393 .num_ips = ARRAY_SIZE(addresses_B_1),
3394 .ips = addresses_B_1,
3395 .apply_expected = true
3400 * mhomed,active vs. unique,tombstone
3401 * => should NOT be replaced
3404 .line = __location__,
3405 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3408 .type = WREPL_TYPE_MHOMED,
3409 .state = WREPL_STATE_ACTIVE,
3410 .node = WREPL_NODE_B,
3412 .num_ips = ARRAY_SIZE(addresses_B_1),
3413 .ips = addresses_B_1,
3414 .apply_expected = true
3418 .type = WREPL_TYPE_UNIQUE,
3419 .state = WREPL_STATE_TOMBSTONE,
3420 .node = WREPL_NODE_B,
3422 .num_ips = ARRAY_SIZE(addresses_B_1),
3423 .ips = addresses_B_1,
3424 .apply_expected = false
3429 * mhomed,released vs. unique,active
3430 * => should be replaced
3433 .line = __location__,
3434 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3437 .type = WREPL_TYPE_MHOMED,
3438 .state = WREPL_STATE_RELEASED,
3439 .node = WREPL_NODE_B,
3441 .num_ips = ARRAY_SIZE(addresses_A_1),
3442 .ips = addresses_A_1,
3443 .apply_expected = false
3447 .type = WREPL_TYPE_UNIQUE,
3448 .state = WREPL_STATE_ACTIVE,
3449 .node = WREPL_NODE_B,
3451 .num_ips = ARRAY_SIZE(addresses_B_1),
3452 .ips = addresses_B_1,
3453 .apply_expected = true
3458 * mhomed,released vs. uinique,tombstone
3459 * => should be replaced
3462 .line = __location__,
3463 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3466 .type = WREPL_TYPE_MHOMED,
3467 .state = WREPL_STATE_RELEASED,
3468 .node = WREPL_NODE_B,
3470 .num_ips = ARRAY_SIZE(addresses_B_1),
3471 .ips = addresses_B_1,
3472 .apply_expected = false
3476 .type = WREPL_TYPE_UNIQUE,
3477 .state = WREPL_STATE_TOMBSTONE,
3478 .node = WREPL_NODE_B,
3480 .num_ips = ARRAY_SIZE(addresses_A_1),
3481 .ips = addresses_A_1,
3482 .apply_expected = true
3487 * mhomed,tombstone vs. unique,active
3488 * => should be replaced
3491 .line = __location__,
3492 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3495 .type = WREPL_TYPE_MHOMED,
3496 .state = WREPL_STATE_TOMBSTONE,
3497 .node = WREPL_NODE_B,
3499 .num_ips = ARRAY_SIZE(addresses_A_1),
3500 .ips = addresses_A_1,
3501 .apply_expected = true
3505 .type = WREPL_TYPE_UNIQUE,
3506 .state = WREPL_STATE_ACTIVE,
3507 .node = WREPL_NODE_B,
3509 .num_ips = ARRAY_SIZE(addresses_B_1),
3510 .ips = addresses_B_1,
3511 .apply_expected = true
3516 * mhomed,tombstone vs. uinique,tombstone
3517 * => should be replaced
3520 .line = __location__,
3521 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3524 .type = WREPL_TYPE_MHOMED,
3525 .state = WREPL_STATE_TOMBSTONE,
3526 .node = WREPL_NODE_B,
3528 .num_ips = ARRAY_SIZE(addresses_B_1),
3529 .ips = addresses_B_1,
3530 .apply_expected = true
3534 .type = WREPL_TYPE_UNIQUE,
3535 .state = WREPL_STATE_TOMBSTONE,
3536 .node = WREPL_NODE_B,
3538 .num_ips = ARRAY_SIZE(addresses_A_1),
3539 .ips = addresses_A_1,
3540 .apply_expected = true
3545 * multi homed vs. normal group section,
3548 * mhomed,active vs. group,active
3549 * => should be replaced
3552 .line = __location__,
3553 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3556 .type = WREPL_TYPE_MHOMED,
3557 .state = WREPL_STATE_ACTIVE,
3558 .node = WREPL_NODE_B,
3560 .num_ips = ARRAY_SIZE(addresses_A_1),
3561 .ips = addresses_A_1,
3562 .apply_expected = true
3566 .type = WREPL_TYPE_GROUP,
3567 .state = WREPL_STATE_ACTIVE,
3568 .node = WREPL_NODE_B,
3570 .num_ips = ARRAY_SIZE(addresses_B_1),
3571 .ips = addresses_B_1,
3572 .apply_expected = true
3577 * mhomed,active vs. group,tombstone
3578 * => should NOT be replaced
3581 .line = __location__,
3582 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3585 .type = WREPL_TYPE_MHOMED,
3586 .state = WREPL_STATE_ACTIVE,
3587 .node = WREPL_NODE_B,
3589 .num_ips = ARRAY_SIZE(addresses_B_1),
3590 .ips = addresses_B_1,
3591 .apply_expected = true
3595 .type = WREPL_TYPE_GROUP,
3596 .state = WREPL_STATE_TOMBSTONE,
3597 .node = WREPL_NODE_B,
3599 .num_ips = ARRAY_SIZE(addresses_B_1),
3600 .ips = addresses_B_1,
3601 .apply_expected = false
3606 * mhomed,released vs. group,active
3607 * => should be replaced
3610 .line = __location__,
3611 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3614 .type = WREPL_TYPE_MHOMED,
3615 .state = WREPL_STATE_RELEASED,
3616 .node = WREPL_NODE_B,
3618 .num_ips = ARRAY_SIZE(addresses_B_1),
3619 .ips = addresses_B_1,
3620 .apply_expected = false
3624 .type = WREPL_TYPE_GROUP,
3625 .state = WREPL_STATE_ACTIVE,
3626 .node = WREPL_NODE_B,
3628 .num_ips = ARRAY_SIZE(addresses_A_1),
3629 .ips = addresses_A_1,
3630 .apply_expected = true
3635 * mhomed,released vs. group,tombstone
3636 * => should be replaced
3639 .line = __location__,
3640 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3643 .type = WREPL_TYPE_MHOMED,
3644 .state = WREPL_STATE_RELEASED,
3645 .node = WREPL_NODE_B,
3647 .num_ips = ARRAY_SIZE(addresses_A_1),
3648 .ips = addresses_A_1,
3649 .apply_expected = false
3653 .type = WREPL_TYPE_GROUP,
3654 .state = WREPL_STATE_TOMBSTONE,
3655 .node = WREPL_NODE_B,
3657 .num_ips = ARRAY_SIZE(addresses_B_1),
3658 .ips = addresses_B_1,
3659 .apply_expected = true
3664 * mhomed,tombstone vs. group,active
3665 * => should be replaced
3668 .line = __location__,
3669 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3672 .type = WREPL_TYPE_MHOMED,
3673 .state = WREPL_STATE_TOMBSTONE,
3674 .node = WREPL_NODE_B,
3676 .num_ips = ARRAY_SIZE(addresses_B_1),
3677 .ips = addresses_B_1,
3678 .apply_expected = true
3682 .type = WREPL_TYPE_GROUP,
3683 .state = WREPL_STATE_ACTIVE,
3684 .node = WREPL_NODE_B,
3686 .num_ips = ARRAY_SIZE(addresses_A_1),
3687 .ips = addresses_A_1,
3688 .apply_expected = true
3693 * mhomed,tombstone vs. group,tombstone
3694 * => should be replaced
3697 .line = __location__,
3698 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3701 .type = WREPL_TYPE_MHOMED,
3702 .state = WREPL_STATE_TOMBSTONE,
3703 .node = WREPL_NODE_B,
3705 .num_ips = ARRAY_SIZE(addresses_A_1),
3706 .ips = addresses_A_1,
3707 .apply_expected = true
3711 .type = WREPL_TYPE_GROUP,
3712 .state = WREPL_STATE_TOMBSTONE,
3713 .node = WREPL_NODE_B,
3715 .num_ips = ARRAY_SIZE(addresses_B_1),
3716 .ips = addresses_B_1,
3717 .apply_expected = true
3722 * multi homed vs. special group section,
3725 * mhomed,active vs. sgroup,active
3726 * => should NOT be replaced
3729 .line = __location__,
3730 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3733 .type = WREPL_TYPE_MHOMED,
3734 .state = WREPL_STATE_ACTIVE,
3735 .node = WREPL_NODE_B,
3737 .num_ips = ARRAY_SIZE(addresses_A_1),
3738 .ips = addresses_A_1,
3739 .apply_expected = true
3743 .type = WREPL_TYPE_SGROUP,
3744 .state = WREPL_STATE_ACTIVE,
3745 .node = WREPL_NODE_B,
3747 .num_ips = ARRAY_SIZE(addresses_A_1),
3748 .ips = addresses_A_1,
3749 .apply_expected = false
3754 * mhomed,active vs. sgroup,tombstone
3755 * => should NOT be replaced
3758 .line = __location__,
3759 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3762 .type = WREPL_TYPE_MHOMED,
3763 .state = WREPL_STATE_ACTIVE,
3764 .node = WREPL_NODE_B,
3766 .num_ips = ARRAY_SIZE(addresses_A_1),
3767 .ips = addresses_A_1,
3768 .apply_expected = true
3772 .type = WREPL_TYPE_SGROUP,
3773 .state = WREPL_STATE_TOMBSTONE,
3774 .node = WREPL_NODE_B,
3776 .num_ips = ARRAY_SIZE(addresses_A_1),
3777 .ips = addresses_A_1,
3778 .apply_expected = false
3783 * mhomed,released vs. sgroup,active
3784 * => should be replaced
3787 .line = __location__,
3788 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3791 .type = WREPL_TYPE_MHOMED,
3792 .state = WREPL_STATE_RELEASED,
3793 .node = WREPL_NODE_B,
3795 .num_ips = ARRAY_SIZE(addresses_A_1),
3796 .ips = addresses_A_1,
3797 .apply_expected = false
3801 .type = WREPL_TYPE_SGROUP,
3802 .state = WREPL_STATE_ACTIVE,
3803 .node = WREPL_NODE_B,
3805 .num_ips = ARRAY_SIZE(addresses_B_1),
3806 .ips = addresses_B_1,
3807 .apply_expected = true
3812 * mhomed,released vs. sgroup,tombstone
3813 * => should be replaced
3816 .line = __location__,
3817 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3820 .type = WREPL_TYPE_MHOMED,
3821 .state = WREPL_STATE_RELEASED,
3822 .node = WREPL_NODE_B,
3824 .num_ips = ARRAY_SIZE(addresses_B_1),
3825 .ips = addresses_B_1,
3826 .apply_expected = false
3830 .type = WREPL_TYPE_SGROUP,
3831 .state = WREPL_STATE_TOMBSTONE,
3832 .node = WREPL_NODE_B,
3834 .num_ips = ARRAY_SIZE(addresses_A_1),
3835 .ips = addresses_A_1,
3836 .apply_expected = true
3841 * mhomed,tombstone vs. sgroup,active
3842 * => should be replaced
3845 .line = __location__,
3846 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3849 .type = WREPL_TYPE_MHOMED,
3850 .state = WREPL_STATE_TOMBSTONE,
3851 .node = WREPL_NODE_B,
3853 .num_ips = ARRAY_SIZE(addresses_A_1),
3854 .ips = addresses_A_1,
3855 .apply_expected = true
3859 .type = WREPL_TYPE_SGROUP,
3860 .state = WREPL_STATE_ACTIVE,
3861 .node = WREPL_NODE_B,
3863 .num_ips = ARRAY_SIZE(addresses_B_1),
3864 .ips = addresses_B_1,
3865 .apply_expected = true
3870 * mhomed,tombstone vs. sgroup,tombstone
3871 * => should be replaced
3874 .line = __location__,
3875 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3878 .type = WREPL_TYPE_MHOMED,
3879 .state = WREPL_STATE_TOMBSTONE,
3880 .node = WREPL_NODE_B,
3882 .num_ips = ARRAY_SIZE(addresses_B_1),
3883 .ips = addresses_B_1,
3884 .apply_expected = true
3888 .type = WREPL_TYPE_SGROUP,
3889 .state = WREPL_STATE_TOMBSTONE,
3890 .node = WREPL_NODE_B,
3892 .num_ips = ARRAY_SIZE(addresses_A_1),
3893 .ips = addresses_A_1,
3894 .apply_expected = true
3899 * multi homed vs. mlti homed section,
3902 * mhomed,active vs. mhomed,active
3903 * => should be replaced
3906 .line = __location__,
3907 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3910 .type = WREPL_TYPE_MHOMED,
3911 .state = WREPL_STATE_ACTIVE,
3912 .node = WREPL_NODE_B,
3914 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3915 .ips = addresses_A_3_4,
3916 .apply_expected = true
3920 .type = WREPL_TYPE_MHOMED,
3921 .state = WREPL_STATE_ACTIVE,
3922 .node = WREPL_NODE_B,
3924 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3925 .ips = addresses_B_3_4,
3926 .apply_expected = true
3931 * mhomed,active vs. mhomed,tombstone
3932 * => should NOT be replaced
3935 .line = __location__,
3936 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3939 .type = WREPL_TYPE_MHOMED,
3940 .state = WREPL_STATE_ACTIVE,
3941 .node = WREPL_NODE_B,
3943 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3944 .ips = addresses_B_3_4,
3945 .apply_expected = true
3949 .type = WREPL_TYPE_MHOMED,
3950 .state = WREPL_STATE_TOMBSTONE,
3951 .node = WREPL_NODE_B,
3953 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3954 .ips = addresses_B_3_4,
3955 .apply_expected = false
3960 * mhomed,released vs. mhomed,active
3961 * => should be replaced
3964 .line = __location__,
3965 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3968 .type = WREPL_TYPE_MHOMED,
3969 .state = WREPL_STATE_RELEASED,
3970 .node = WREPL_NODE_B,
3972 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3973 .ips = addresses_B_3_4,
3974 .apply_expected = false
3978 .type = WREPL_TYPE_MHOMED,
3979 .state = WREPL_STATE_ACTIVE,
3980 .node = WREPL_NODE_B,
3982 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3983 .ips = addresses_A_3_4,
3984 .apply_expected = true
3989 * mhomed,released vs. mhomed,tombstone
3990 * => should be replaced
3993 .line = __location__,
3994 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3997 .type = WREPL_TYPE_MHOMED,
3998 .state = WREPL_STATE_RELEASED,
3999 .node = WREPL_NODE_B,
4001 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4002 .ips = addresses_A_3_4,
4003 .apply_expected = false
4007 .type = WREPL_TYPE_MHOMED,
4008 .state = WREPL_STATE_TOMBSTONE,
4009 .node = WREPL_NODE_B,
4011 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4012 .ips = addresses_B_3_4,
4013 .apply_expected = true
4018 * mhomed,tombstone vs. mhomed,active
4019 * => should be replaced
4022 .line = __location__,
4023 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4026 .type = WREPL_TYPE_MHOMED,
4027 .state = WREPL_STATE_TOMBSTONE,
4028 .node = WREPL_NODE_B,
4030 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4031 .ips = addresses_B_3_4,
4032 .apply_expected = true
4036 .type = WREPL_TYPE_MHOMED,
4037 .state = WREPL_STATE_ACTIVE,
4038 .node = WREPL_NODE_B,
4040 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4041 .ips = addresses_A_3_4,
4042 .apply_expected = true
4047 * mhomed,tombstone vs. mhomed,tombstone
4048 * => should be replaced
4051 .line = __location__,
4052 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4055 .type = WREPL_TYPE_MHOMED,
4056 .state = WREPL_STATE_TOMBSTONE,
4057 .node = WREPL_NODE_B,
4059 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4060 .ips = addresses_A_3_4,
4061 .apply_expected = true
4065 .type = WREPL_TYPE_MHOMED,
4066 .state = WREPL_STATE_TOMBSTONE,
4067 .node = WREPL_NODE_B,
4069 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4070 .ips = addresses_B_3_4,
4071 .apply_expected = true
4075 .line = __location__,
4076 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4080 .type = WREPL_TYPE_UNIQUE,
4081 .state = WREPL_STATE_TOMBSTONE,
4082 .node = WREPL_NODE_B,
4084 .num_ips = ARRAY_SIZE(addresses_B_1),
4085 .ips = addresses_B_1,
4086 .apply_expected = true,
4090 .type = WREPL_TYPE_UNIQUE,
4091 .state = WREPL_STATE_TOMBSTONE,
4092 .node = WREPL_NODE_B,
4094 .num_ips = ARRAY_SIZE(addresses_A_1),
4095 .ips = addresses_A_1,
4096 .apply_expected = true,
4100 * special group vs special group section,
4103 * sgroup,active vs. sgroup,active same addresses
4104 * => should be NOT replaced
4107 .line = __location__,
4108 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4109 .comment= "A:A_3_4 vs. B:A_3_4",
4113 .type = WREPL_TYPE_SGROUP,
4114 .state = WREPL_STATE_ACTIVE,
4115 .node = WREPL_NODE_B,
4117 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4118 .ips = addresses_A_3_4,
4119 .apply_expected = true
4123 .type = WREPL_TYPE_SGROUP,
4124 .state = WREPL_STATE_ACTIVE,
4125 .node = WREPL_NODE_B,
4127 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4128 .ips = addresses_A_3_4,
4129 .apply_expected = false,
4130 .sgroup_cleanup = true
4134 * sgroup,active vs. sgroup,active same addresses
4135 * => should be NOT replaced
4138 .line = __location__,
4139 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4140 .comment= "A:A_3_4 vs. B:NULL",
4144 .type = WREPL_TYPE_SGROUP,
4145 .state = WREPL_STATE_ACTIVE,
4146 .node = WREPL_NODE_B,
4148 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4149 .ips = addresses_A_3_4,
4150 .apply_expected = true
4154 .type = WREPL_TYPE_SGROUP,
4155 .state = WREPL_STATE_ACTIVE,
4156 .node = WREPL_NODE_B,
4160 .apply_expected = false,
4161 .sgroup_cleanup = true
4165 * sgroup,active vs. sgroup,active subset addresses, special case...
4166 * => should NOT be replaced
4169 .line = __location__,
4170 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4171 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4",
4175 .type = WREPL_TYPE_SGROUP,
4176 .state = WREPL_STATE_ACTIVE,
4177 .node = WREPL_NODE_B,
4179 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4180 .ips = addresses_A_3_4_X_3_4,
4181 .apply_expected = true,
4185 .type = WREPL_TYPE_SGROUP,
4186 .state = WREPL_STATE_ACTIVE,
4187 .node = WREPL_NODE_B,
4189 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4190 .ips = addresses_A_3_4,
4191 .apply_expected = false,
4195 .line = __location__,
4196 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4200 .type = WREPL_TYPE_SGROUP,
4201 .state = WREPL_STATE_ACTIVE,
4202 .node = WREPL_NODE_B,
4206 .apply_expected = false,
4210 .type = WREPL_TYPE_SGROUP,
4211 .state = WREPL_STATE_ACTIVE,
4212 .node = WREPL_NODE_B,
4216 .apply_expected = false,
4220 * sgroup,active vs. sgroup,active different addresses, but owner changed
4221 * => should be replaced
4224 .line = __location__,
4225 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4226 .comment= "A:B_3_4 vs. B:A_3_4",
4230 .type = WREPL_TYPE_SGROUP,
4231 .state = WREPL_STATE_ACTIVE,
4232 .node = WREPL_NODE_B,
4234 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4235 .ips = addresses_B_3_4,
4236 .apply_expected = true,
4240 .type = WREPL_TYPE_SGROUP,
4241 .state = WREPL_STATE_ACTIVE,
4242 .node = WREPL_NODE_B,
4244 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4245 .ips = addresses_A_3_4,
4246 .apply_expected = true,
4247 .sgroup_cleanup = true
4251 * sgroup,active vs. sgroup,active different addresses, but owner changed
4252 * => should be replaced
4255 .line = __location__,
4256 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4257 .comment= "A:A_3_4 vs. B:A_3_4_OWNER_B",
4261 .type = WREPL_TYPE_SGROUP,
4262 .state = WREPL_STATE_ACTIVE,
4263 .node = WREPL_NODE_B,
4265 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4266 .ips = addresses_A_3_4,
4267 .apply_expected = true,
4271 .type = WREPL_TYPE_SGROUP,
4272 .state = WREPL_STATE_ACTIVE,
4273 .node = WREPL_NODE_B,
4275 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4276 .ips = addresses_A_3_4_OWNER_B,
4277 .apply_expected = true,
4278 .sgroup_cleanup = true
4282 * sgroup,active vs. sgroup,active different addresses, but owner changed
4283 * => should be replaced
4286 .line = __location__,
4287 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4288 .comment= "A:A_3_4_OWNER_B vs. B:A_3_4",
4292 .type = WREPL_TYPE_SGROUP,
4293 .state = WREPL_STATE_ACTIVE,
4294 .node = WREPL_NODE_B,
4296 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4297 .ips = addresses_A_3_4_OWNER_B,
4298 .apply_expected = true,
4302 .type = WREPL_TYPE_SGROUP,
4303 .state = WREPL_STATE_ACTIVE,
4304 .node = WREPL_NODE_B,
4306 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4307 .ips = addresses_A_3_4,
4308 .apply_expected = true,
4309 .sgroup_cleanup = true
4313 * sgroup,active vs. sgroup,active different addresses
4314 * => should be merged
4317 .line = __location__,
4318 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4319 .comment= "A:A_3_4 vs. B:B_3_4 => C:A_3_4_B_3_4",
4323 .type = WREPL_TYPE_SGROUP,
4324 .state = WREPL_STATE_ACTIVE,
4325 .node = WREPL_NODE_B,
4327 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4328 .ips = addresses_A_3_4,
4329 .apply_expected = true,
4333 .type = WREPL_TYPE_SGROUP,
4334 .state = WREPL_STATE_ACTIVE,
4335 .node = WREPL_NODE_B,
4337 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4338 .ips = addresses_B_3_4,
4339 .sgroup_merge = true,
4340 .sgroup_cleanup = true,
4344 * sgroup,active vs. sgroup,active different addresses, special case...
4345 * => should be merged
4348 .line = __location__,
4349 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4350 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4_X_3_4",
4354 .type = WREPL_TYPE_SGROUP,
4355 .state = WREPL_STATE_ACTIVE,
4356 .node = WREPL_NODE_B,
4358 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4359 .ips = addresses_B_3_4_X_3_4,
4360 .apply_expected = true,
4364 .type = WREPL_TYPE_SGROUP,
4365 .state = WREPL_STATE_ACTIVE,
4366 .node = WREPL_NODE_B,
4368 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4369 .ips = addresses_A_3_4,
4370 .sgroup_merge = true,
4371 .merge_owner = &ctx->b,
4372 .sgroup_cleanup = false
4376 .line = __location__,
4377 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4381 .type = WREPL_TYPE_SGROUP,
4382 .state = WREPL_STATE_ACTIVE,
4383 .node = WREPL_NODE_B,
4385 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4_OWNER_B),
4386 .ips = addresses_A_3_4_X_3_4_OWNER_B,
4387 .apply_expected = true,
4391 .type = WREPL_TYPE_SGROUP,
4392 .state = WREPL_STATE_ACTIVE,
4393 .node = WREPL_NODE_B,
4397 .apply_expected = false,
4401 * sgroup,active vs. sgroup,active different addresses, special case...
4402 * => should be merged
4405 .line = __location__,
4406 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4407 .comment= "A:X_3_4 vs. B:A_3_4 => C:A_3_4_X_3_4",
4411 .type = WREPL_TYPE_SGROUP,
4412 .state = WREPL_STATE_ACTIVE,
4413 .node = WREPL_NODE_B,
4415 .num_ips = ARRAY_SIZE(addresses_X_3_4),
4416 .ips = addresses_X_3_4,
4417 .apply_expected = true,
4421 .type = WREPL_TYPE_SGROUP,
4422 .state = WREPL_STATE_ACTIVE,
4423 .node = WREPL_NODE_B,
4425 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4426 .ips = addresses_A_3_4,
4427 .sgroup_merge = true,
4428 .sgroup_cleanup = false
4432 .line = __location__,
4433 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4437 .type = WREPL_TYPE_SGROUP,
4438 .state = WREPL_STATE_ACTIVE,
4439 .node = WREPL_NODE_B,
4443 .apply_expected = false,
4447 .type = WREPL_TYPE_SGROUP,
4448 .state = WREPL_STATE_ACTIVE,
4449 .node = WREPL_NODE_B,
4453 .apply_expected = false,
4457 * sgroup,active vs. sgroup,active different addresses, special case...
4458 * => should be merged
4461 .line = __location__,
4462 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4463 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4_OWNER_B => B:A_3_4_OWNER_B_X_3_4",
4467 .type = WREPL_TYPE_SGROUP,
4468 .state = WREPL_STATE_ACTIVE,
4469 .node = WREPL_NODE_B,
4471 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4472 .ips = addresses_A_3_4_X_3_4,
4473 .apply_expected = true,
4477 .type = WREPL_TYPE_SGROUP,
4478 .state = WREPL_STATE_ACTIVE,
4479 .node = WREPL_NODE_B,
4481 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4482 .ips = addresses_A_3_4_OWNER_B,
4483 .sgroup_merge = true,
4484 .merge_owner = &ctx->b,
4488 .line = __location__,
4489 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4493 .type = WREPL_TYPE_SGROUP,
4494 .state = WREPL_STATE_ACTIVE,
4495 .node = WREPL_NODE_B,
4499 .apply_expected = false,
4503 .type = WREPL_TYPE_SGROUP,
4504 .state = WREPL_STATE_ACTIVE,
4505 .node = WREPL_NODE_B,
4509 .apply_expected = false,
4513 * sgroup,active vs. sgroup,active partly different addresses, special case...
4514 * => should be merged
4517 .line = __location__,
4518 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4519 .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",
4523 .type = WREPL_TYPE_SGROUP,
4524 .state = WREPL_STATE_ACTIVE,
4525 .node = WREPL_NODE_B,
4527 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4528 .ips = addresses_B_3_4_X_3_4,
4529 .apply_expected = true,
4533 .type = WREPL_TYPE_SGROUP,
4534 .state = WREPL_STATE_ACTIVE,
4535 .node = WREPL_NODE_B,
4537 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_1_2),
4538 .ips = addresses_B_3_4_X_1_2,
4539 .sgroup_merge = true,
4540 .sgroup_cleanup = false
4544 .line = __location__,
4545 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4549 .type = WREPL_TYPE_SGROUP,
4550 .state = WREPL_STATE_ACTIVE,
4551 .node = WREPL_NODE_B,
4555 .apply_expected = false,
4559 .type = WREPL_TYPE_SGROUP,
4560 .state = WREPL_STATE_ACTIVE,
4561 .node = WREPL_NODE_B,
4565 .apply_expected = false,
4569 * sgroup,active vs. sgroup,active different addresses, special case...
4570 * => should be merged
4573 .line = __location__,
4574 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4575 .comment= "A:A_3_4_B_3_4 vs. B:NULL => B:A_3_4",
4579 .type = WREPL_TYPE_SGROUP,
4580 .state = WREPL_STATE_ACTIVE,
4581 .node = WREPL_NODE_B,
4583 .num_ips = ARRAY_SIZE(addresses_A_3_4_B_3_4),
4584 .ips = addresses_A_3_4_B_3_4,
4585 .apply_expected = true,
4589 .type = WREPL_TYPE_SGROUP,
4590 .state = WREPL_STATE_ACTIVE,
4591 .node = WREPL_NODE_B,
4595 .sgroup_merge = true,
4596 .merge_owner = &ctx->b,
4597 .sgroup_cleanup = true
4601 .line = __location__,
4602 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4606 .type = WREPL_TYPE_SGROUP,
4607 .state = WREPL_STATE_ACTIVE,
4608 .node = WREPL_NODE_B,
4612 .apply_expected = false,
4616 .type = WREPL_TYPE_UNIQUE,
4617 .state = WREPL_STATE_TOMBSTONE,
4618 .node = WREPL_NODE_B,
4620 .num_ips = ARRAY_SIZE(addresses_A_1),
4621 .ips = addresses_A_1,
4622 .apply_expected = true,
4626 * sgroup,active vs. sgroup,active different addresses, special case...
4627 * => should be merged
4630 .line = __location__,
4631 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4632 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:X_3_4",
4636 .type = WREPL_TYPE_SGROUP,
4637 .state = WREPL_STATE_ACTIVE,
4638 .node = WREPL_NODE_B,
4640 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4641 .ips = addresses_B_3_4_X_3_4,
4642 .apply_expected = true,
4646 .type = WREPL_TYPE_SGROUP,
4647 .state = WREPL_STATE_ACTIVE,
4648 .node = WREPL_NODE_B,
4652 .sgroup_merge = true,
4653 .merge_owner = &ctx->b,
4654 .sgroup_cleanup = true
4658 .line = __location__,
4659 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4663 .type = WREPL_TYPE_SGROUP,
4664 .state = WREPL_STATE_ACTIVE,
4665 .node = WREPL_NODE_B,
4669 .apply_expected = false,
4673 .type = WREPL_TYPE_UNIQUE,
4674 .state = WREPL_STATE_TOMBSTONE,
4675 .node = WREPL_NODE_B,
4677 .num_ips = ARRAY_SIZE(addresses_A_1),
4678 .ips = addresses_A_1,
4679 .apply_expected = true,
4684 * sgroup,active vs. sgroup,tombstone different no addresses, special
4685 * => should be replaced
4688 .line = __location__,
4689 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4690 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:NULL",
4694 .type = WREPL_TYPE_SGROUP,
4695 .state = WREPL_STATE_ACTIVE,
4696 .node = WREPL_NODE_B,
4698 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4699 .ips = addresses_B_3_4_X_3_4,
4700 .apply_expected = true,
4704 .type = WREPL_TYPE_SGROUP,
4705 .state = WREPL_STATE_TOMBSTONE,
4706 .node = WREPL_NODE_B,
4710 .apply_expected = true,
4714 * sgroup,active vs. sgroup,tombstone different addresses
4715 * => should be replaced
4718 .line = __location__,
4719 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4720 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4",
4724 .type = WREPL_TYPE_SGROUP,
4725 .state = WREPL_STATE_ACTIVE,
4726 .node = WREPL_NODE_B,
4728 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4729 .ips = addresses_B_3_4_X_3_4,
4730 .apply_expected = true,
4734 .type = WREPL_TYPE_SGROUP,
4735 .state = WREPL_STATE_TOMBSTONE,
4736 .node = WREPL_NODE_B,
4738 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4739 .ips = addresses_A_3_4,
4740 .apply_expected = true,
4744 * sgroup,active vs. sgroup,tombstone subset addresses
4745 * => should be replaced
4748 .line = __location__,
4749 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4750 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4 => B:B_3_4",
4754 .type = WREPL_TYPE_SGROUP,
4755 .state = WREPL_STATE_ACTIVE,
4756 .node = WREPL_NODE_B,
4758 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4759 .ips = addresses_B_3_4_X_3_4,
4760 .apply_expected = true,
4764 .type = WREPL_TYPE_SGROUP,
4765 .state = WREPL_STATE_TOMBSTONE,
4766 .node = WREPL_NODE_B,
4768 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4769 .ips = addresses_B_3_4,
4770 .apply_expected = true,
4774 * sgroup,active vs. sgroup,active same addresses
4775 * => should be replaced
4778 .line = __location__,
4779 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4780 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4_X_3_4 => B:B_3_4_X_3_4",
4784 .type = WREPL_TYPE_SGROUP,
4785 .state = WREPL_STATE_ACTIVE,
4786 .node = WREPL_NODE_B,
4788 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4789 .ips = addresses_B_3_4_X_3_4,
4790 .apply_expected = true,
4794 .type = WREPL_TYPE_SGROUP,
4795 .state = WREPL_STATE_TOMBSTONE,
4796 .node = WREPL_NODE_B,
4798 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4799 .ips = addresses_B_3_4_X_3_4,
4800 .apply_expected = true,
4805 * This should be the last record in this array,
4806 * we need to make sure the we leave a tombstoned unique entry
4810 .line = __location__,
4811 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4815 .type = WREPL_TYPE_UNIQUE,
4816 .state = WREPL_STATE_TOMBSTONE,
4817 .node = WREPL_NODE_B,
4819 .num_ips = ARRAY_SIZE(addresses_A_1),
4820 .ips = addresses_A_1,
4821 .apply_expected = true
4825 .type = WREPL_TYPE_UNIQUE,
4826 .state = WREPL_STATE_TOMBSTONE,
4827 .node = WREPL_NODE_B,
4829 .num_ips = ARRAY_SIZE(addresses_A_1),
4830 .ips = addresses_A_1,
4831 .apply_expected = true
4833 }}; /* do not add entries here, this should be the last record! */
4835 wins_name_r1 = &wins_name1;
4836 wins_name_r2 = &wins_name2;
4838 torture_comment(tctx, "Test Replica Conflicts with different owners\n");
4840 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
4842 if (!records[i].extra && !records[i].cleanup) {
4843 /* we should test the worst cases */
4844 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
4845 torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n",
4846 __location__, i, records[i].line);
4848 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
4849 torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n",
4850 __location__, i, records[i].line);
4855 if (!records[i].cleanup) {
4856 const char *expected;
4859 if (records[i].r2.sgroup_merge) {
4860 expected = "SGROUP_MERGE";
4861 } else if (records[i].r2.apply_expected) {
4862 expected = "REPLACE";
4864 expected = "NOT REPLACE";
4867 if (!records[i].r1.ips && !records[i].r2.ips) {
4868 ips = "with no ip(s)";
4869 } else if (records[i].r1.ips==records[i].r2.ips) {
4870 ips = "with same ip(s)";
4872 ips = "with different ip(s)";
4875 torture_comment(tctx, "%s,%s%s vs. %s,%s%s %s => %s\n",
4876 wrepl_name_type_string(records[i].r1.type),
4877 wrepl_name_state_string(records[i].r1.state),
4878 (records[i].r1.is_static?",static":""),
4879 wrepl_name_type_string(records[i].r2.type),
4880 wrepl_name_state_string(records[i].r2.state),
4881 (records[i].r2.is_static?",static":""),
4882 (records[i].comment?records[i].comment:ips),
4889 wins_name_r1->name = &records[i].name;
4890 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
4891 records[i].r1.state,
4893 records[i].r1.is_static);
4894 wins_name_r1->id = ++records[i].r1.owner->max_version;
4895 if (wins_name_r1->flags & 2) {
4896 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
4897 wins_name_r1->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
4900 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
4902 wins_name_r1->unknown = "255.255.255.255";
4905 ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1);
4906 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4907 wins_name_r1, records[i].r1.apply_expected);
4912 wins_name_r2->name = &records[i].name;
4913 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
4914 records[i].r2.state,
4916 records[i].r2.is_static);
4917 wins_name_r2->id = ++records[i].r2.owner->max_version;
4918 if (wins_name_r2->flags & 2) {
4919 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
4920 wins_name_r2->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
4923 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
4925 wins_name_r2->unknown = "255.255.255.255";
4928 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4929 if (records[i].r1.state == WREPL_STATE_RELEASED) {
4930 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4931 wins_name_r1, false);
4932 } else if (records[i].r2.sgroup_merge) {
4933 ret &= test_wrepl_sgroup_merged(tctx, ctx, records[i].r2.merge_owner,
4934 records[i].r1.owner,
4935 records[i].r1.num_ips, records[i].r1.ips,
4936 records[i].r2.owner,
4937 records[i].r2.num_ips, records[i].r2.ips,
4939 } else if (records[i].r1.owner != records[i].r2.owner) {
4941 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
4942 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4943 wins_name_r1, _expected);
4945 if (records[i].r2.state == WREPL_STATE_RELEASED) {
4946 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner,
4947 wins_name_r2, false);
4948 } else if (!records[i].r2.sgroup_merge) {
4949 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner,
4950 wins_name_r2, records[i].r2.apply_expected);
4953 if (records[i].r2.sgroup_cleanup) {
4955 torture_comment(tctx, "failed before sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4959 /* clean up the SGROUP record */
4960 wins_name_r1->name = &records[i].name;
4961 wins_name_r1->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4963 WREPL_NODE_B, false);
4964 wins_name_r1->id = ++records[i].r1.owner->max_version;
4965 wins_name_r1->addresses.addresses.num_ips = 0;
4966 wins_name_r1->addresses.addresses.ips = NULL;
4967 wins_name_r1->unknown = "255.255.255.255";
4968 ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1);
4970 /* here we test how names from an owner are deleted */
4971 if (records[i].r2.sgroup_merge && records[i].r2.num_ips) {
4972 ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL,
4973 records[i].r2.owner,
4974 records[i].r2.num_ips, records[i].r2.ips,
4975 records[i].r1.owner,
4980 /* clean up the SGROUP record */
4981 wins_name_r2->name = &records[i].name;
4982 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4984 WREPL_NODE_B, false);
4985 wins_name_r2->id = ++records[i].r2.owner->max_version;
4986 wins_name_r2->addresses.addresses.num_ips = 0;
4987 wins_name_r2->addresses.addresses.ips = NULL;
4988 wins_name_r2->unknown = "255.255.255.255";
4989 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4991 /* take ownership of the SGROUP record */
4992 wins_name_r2->name = &records[i].name;
4993 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4995 WREPL_NODE_B, false);
4996 wins_name_r2->id = ++records[i].r2.owner->max_version;
4997 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4998 wins_name_r2->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
5000 wins_name_r2->unknown = "255.255.255.255";
5001 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
5002 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true);
5004 /* overwrite the SGROUP record with unique,tombstone */
5005 wins_name_r2->name = &records[i].name;
5006 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
5007 WREPL_STATE_TOMBSTONE,
5008 WREPL_NODE_B, false);
5009 wins_name_r2->id = ++records[i].r2.owner->max_version;
5010 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
5011 wins_name_r2->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
5013 wins_name_r2->unknown = "255.255.255.255";
5014 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
5015 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true);
5018 torture_comment(tctx, "failed in sgroup_cleanup record[%u]: %s\n", i, records[i].line);
5023 /* the first one is a cleanup run */
5024 if (!ret && i == 0) ret = true;
5027 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
5035 static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx,
5036 struct test_wrepl_conflict_conn *ctx)
5040 struct wrepl_wins_name wins_name_;
5041 struct wrepl_wins_name *wins_name = &wins_name_;
5042 struct nbt_name_register name_register_;
5043 struct nbt_name_register *name_register = &name_register_;
5044 struct nbt_name_release release_;
5045 struct nbt_name_release *release = &release_;
5048 const char *line; /* just better debugging */
5049 struct nbt_name name;
5054 const struct wrepl_ip *ips;
5055 bool apply_expected;
5058 enum wrepl_name_type type;
5059 enum wrepl_name_state state;
5060 enum wrepl_name_node node;
5063 const struct wrepl_ip *ips;
5064 bool apply_expected;
5068 * unique vs. unique section
5071 * unique,released vs. unique,active with same ip(s)
5074 .line = __location__,
5075 .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL),
5079 .num_ips = ctx->addresses_best_num,
5080 .ips = ctx->addresses_best,
5081 .apply_expected = true
5084 .type = WREPL_TYPE_UNIQUE,
5085 .state = WREPL_STATE_ACTIVE,
5086 .node = WREPL_NODE_B,
5088 .num_ips = ctx->addresses_best_num,
5089 .ips = ctx->addresses_best,
5090 .apply_expected = true
5094 * unique,released vs. unique,active with different ip(s)
5097 .line = __location__,
5098 .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL),
5102 .num_ips = ctx->addresses_best_num,
5103 .ips = ctx->addresses_best,
5104 .apply_expected = true
5107 .type = WREPL_TYPE_UNIQUE,
5108 .state = WREPL_STATE_ACTIVE,
5109 .node = WREPL_NODE_B,
5111 .num_ips = ARRAY_SIZE(addresses_B_1),
5112 .ips = addresses_B_1,
5113 .apply_expected = true
5117 * unique,released vs. unique,tombstone with same ip(s)
5120 .line = __location__,
5121 .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL),
5125 .num_ips = ctx->addresses_best_num,
5126 .ips = ctx->addresses_best,
5127 .apply_expected = true
5130 .type = WREPL_TYPE_UNIQUE,
5131 .state = WREPL_STATE_TOMBSTONE,
5132 .node = WREPL_NODE_B,
5134 .num_ips = ctx->addresses_best_num,
5135 .ips = ctx->addresses_best,
5136 .apply_expected = true
5140 * unique,released vs. unique,tombstone with different ip(s)
5143 .line = __location__,
5144 .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL),
5148 .num_ips = ctx->addresses_best_num,
5149 .ips = ctx->addresses_best,
5150 .apply_expected = true
5153 .type = WREPL_TYPE_UNIQUE,
5154 .state = WREPL_STATE_TOMBSTONE,
5155 .node = WREPL_NODE_B,
5157 .num_ips = ARRAY_SIZE(addresses_B_1),
5158 .ips = addresses_B_1,
5159 .apply_expected = true
5163 * unique vs. group section
5166 * unique,released vs. group,active with same ip(s)
5169 .line = __location__,
5170 .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL),
5174 .num_ips = ctx->addresses_best_num,
5175 .ips = ctx->addresses_best,
5176 .apply_expected = true
5179 .type = WREPL_TYPE_GROUP,
5180 .state = WREPL_STATE_ACTIVE,
5181 .node = WREPL_NODE_B,
5183 .num_ips = ctx->addresses_best_num,
5184 .ips = ctx->addresses_best,
5185 .apply_expected = true
5189 * unique,released vs. group,active with different ip(s)
5192 .line = __location__,
5193 .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL),
5197 .num_ips = ctx->addresses_best_num,
5198 .ips = ctx->addresses_best,
5199 .apply_expected = true
5202 .type = WREPL_TYPE_GROUP,
5203 .state = WREPL_STATE_ACTIVE,
5204 .node = WREPL_NODE_B,
5206 .num_ips = ARRAY_SIZE(addresses_B_1),
5207 .ips = addresses_B_1,
5208 .apply_expected = true
5212 * unique,released vs. group,tombstone with same ip(s)
5215 .line = __location__,
5216 .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL),
5220 .num_ips = ctx->addresses_best_num,
5221 .ips = ctx->addresses_best,
5222 .apply_expected = true
5225 .type = WREPL_TYPE_GROUP,
5226 .state = WREPL_STATE_TOMBSTONE,
5227 .node = WREPL_NODE_B,
5229 .num_ips = ctx->addresses_best_num,
5230 .ips = ctx->addresses_best,
5231 .apply_expected = true
5235 * unique,released vs. group,tombstone with different ip(s)
5238 .line = __location__,
5239 .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL),
5243 .num_ips = ctx->addresses_best_num,
5244 .ips = ctx->addresses_best,
5245 .apply_expected = true
5248 .type = WREPL_TYPE_GROUP,
5249 .state = WREPL_STATE_TOMBSTONE,
5250 .node = WREPL_NODE_B,
5252 .num_ips = ARRAY_SIZE(addresses_B_1),
5253 .ips = addresses_B_1,
5254 .apply_expected = true
5258 * unique vs. special group section
5261 * unique,released vs. sgroup,active with same ip(s)
5264 .line = __location__,
5265 .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL),
5269 .num_ips = ctx->addresses_best_num,
5270 .ips = ctx->addresses_best,
5271 .apply_expected = true
5274 .type = WREPL_TYPE_SGROUP,
5275 .state = WREPL_STATE_ACTIVE,
5276 .node = WREPL_NODE_B,
5278 .num_ips = ctx->addresses_best_num,
5279 .ips = ctx->addresses_best,
5280 .apply_expected = true
5284 * unique,released vs. sgroup,active with different ip(s)
5287 .line = __location__,
5288 .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL),
5292 .num_ips = ctx->addresses_best_num,
5293 .ips = ctx->addresses_best,
5294 .apply_expected = true
5297 .type = WREPL_TYPE_SGROUP,
5298 .state = WREPL_STATE_ACTIVE,
5299 .node = WREPL_NODE_B,
5301 .num_ips = ARRAY_SIZE(addresses_B_1),
5302 .ips = addresses_B_1,
5303 .apply_expected = true
5307 * unique,released vs. sgroup,tombstone with same ip(s)
5310 .line = __location__,
5311 .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL),
5315 .num_ips = ctx->addresses_best_num,
5316 .ips = ctx->addresses_best,
5317 .apply_expected = true
5320 .type = WREPL_TYPE_SGROUP,
5321 .state = WREPL_STATE_TOMBSTONE,
5322 .node = WREPL_NODE_B,
5324 .num_ips = ctx->addresses_best_num,
5325 .ips = ctx->addresses_best,
5326 .apply_expected = true
5330 * unique,released vs. sgroup,tombstone with different ip(s)
5333 .line = __location__,
5334 .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL),
5338 .num_ips = ctx->addresses_best_num,
5339 .ips = ctx->addresses_best,
5340 .apply_expected = true
5343 .type = WREPL_TYPE_SGROUP,
5344 .state = WREPL_STATE_TOMBSTONE,
5345 .node = WREPL_NODE_B,
5347 .num_ips = ARRAY_SIZE(addresses_B_1),
5348 .ips = addresses_B_1,
5349 .apply_expected = true
5353 * unique vs. multi homed section
5356 * unique,released vs. mhomed,active with same ip(s)
5359 .line = __location__,
5360 .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL),
5364 .num_ips = ctx->addresses_best_num,
5365 .ips = ctx->addresses_best,
5366 .apply_expected = true
5369 .type = WREPL_TYPE_MHOMED,
5370 .state = WREPL_STATE_ACTIVE,
5371 .node = WREPL_NODE_B,
5373 .num_ips = ctx->addresses_best_num,
5374 .ips = ctx->addresses_best,
5375 .apply_expected = true
5379 * unique,released vs. mhomed,active with different ip(s)
5382 .line = __location__,
5383 .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL),
5387 .num_ips = ctx->addresses_best_num,
5388 .ips = ctx->addresses_best,
5389 .apply_expected = true
5392 .type = WREPL_TYPE_MHOMED,
5393 .state = WREPL_STATE_ACTIVE,
5394 .node = WREPL_NODE_B,
5396 .num_ips = ARRAY_SIZE(addresses_B_1),
5397 .ips = addresses_B_1,
5398 .apply_expected = true
5402 * unique,released vs. mhomed,tombstone with same ip(s)
5405 .line = __location__,
5406 .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL),
5410 .num_ips = ctx->addresses_best_num,
5411 .ips = ctx->addresses_best,
5412 .apply_expected = true
5415 .type = WREPL_TYPE_MHOMED,
5416 .state = WREPL_STATE_TOMBSTONE,
5417 .node = WREPL_NODE_B,
5419 .num_ips = ctx->addresses_best_num,
5420 .ips = ctx->addresses_best,
5421 .apply_expected = true
5425 * unique,released vs. mhomed,tombstone with different ip(s)
5428 .line = __location__,
5429 .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL),
5433 .num_ips = ctx->addresses_best_num,
5434 .ips = ctx->addresses_best,
5435 .apply_expected = true
5438 .type = WREPL_TYPE_MHOMED,
5439 .state = WREPL_STATE_TOMBSTONE,
5440 .node = WREPL_NODE_B,
5442 .num_ips = ARRAY_SIZE(addresses_B_1),
5443 .ips = addresses_B_1,
5444 .apply_expected = true
5448 * group vs. unique section
5451 * group,released vs. unique,active with same ip(s)
5454 .line = __location__,
5455 .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL),
5457 .nb_flags = NBT_NM_GROUP,
5459 .num_ips = ctx->addresses_best_num,
5460 .ips = ctx->addresses_best,
5461 .apply_expected = true
5464 .type = WREPL_TYPE_UNIQUE,
5465 .state = WREPL_STATE_ACTIVE,
5466 .node = WREPL_NODE_B,
5468 .num_ips = ctx->addresses_best_num,
5469 .ips = ctx->addresses_best,
5470 .apply_expected = false
5474 * group,released vs. unique,active with different ip(s)
5477 .line = __location__,
5478 .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL),
5480 .nb_flags = NBT_NM_GROUP,
5482 .num_ips = ctx->addresses_best_num,
5483 .ips = ctx->addresses_best,
5484 .apply_expected = true
5487 .type = WREPL_TYPE_UNIQUE,
5488 .state = WREPL_STATE_ACTIVE,
5489 .node = WREPL_NODE_B,
5491 .num_ips = ARRAY_SIZE(addresses_B_1),
5492 .ips = addresses_B_1,
5493 .apply_expected = false
5497 * group,released vs. unique,tombstone with same ip(s)
5500 .line = __location__,
5501 .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL),
5503 .nb_flags = NBT_NM_GROUP,
5505 .num_ips = ctx->addresses_best_num,
5506 .ips = ctx->addresses_best,
5507 .apply_expected = true
5510 .type = WREPL_TYPE_UNIQUE,
5511 .state = WREPL_STATE_TOMBSTONE,
5512 .node = WREPL_NODE_B,
5514 .num_ips = ctx->addresses_best_num,
5515 .ips = ctx->addresses_best,
5516 .apply_expected = false
5520 * group,released vs. unique,tombstone with different ip(s)
5523 .line = __location__,
5524 .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL),
5526 .nb_flags = NBT_NM_GROUP,
5528 .num_ips = ctx->addresses_best_num,
5529 .ips = ctx->addresses_best,
5530 .apply_expected = true
5533 .type = WREPL_TYPE_UNIQUE,
5534 .state = WREPL_STATE_TOMBSTONE,
5535 .node = WREPL_NODE_B,
5537 .num_ips = ARRAY_SIZE(addresses_B_1),
5538 .ips = addresses_B_1,
5539 .apply_expected = false
5543 * group vs. group section
5546 * group,released vs. group,active with same ip(s)
5549 .line = __location__,
5550 .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL),
5552 .nb_flags = NBT_NM_GROUP,
5554 .num_ips = ctx->addresses_best_num,
5555 .ips = ctx->addresses_best,
5556 .apply_expected = true
5559 .type = WREPL_TYPE_GROUP,
5560 .state = WREPL_STATE_ACTIVE,
5561 .node = WREPL_NODE_B,
5563 .num_ips = ctx->addresses_best_num,
5564 .ips = ctx->addresses_best,
5565 .apply_expected = true
5569 * group,released vs. group,active with different ip(s)
5572 .line = __location__,
5573 .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL),
5575 .nb_flags = NBT_NM_GROUP,
5577 .num_ips = ctx->addresses_best_num,
5578 .ips = ctx->addresses_best,
5579 .apply_expected = true
5582 .type = WREPL_TYPE_GROUP,
5583 .state = WREPL_STATE_ACTIVE,
5584 .node = WREPL_NODE_B,
5586 .num_ips = ARRAY_SIZE(addresses_B_1),
5587 .ips = addresses_B_1,
5588 .apply_expected = true
5592 * group,released vs. group,tombstone with same ip(s)
5595 .line = __location__,
5596 .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL),
5598 .nb_flags = NBT_NM_GROUP,
5600 .num_ips = ctx->addresses_best_num,
5601 .ips = ctx->addresses_best,
5602 .apply_expected = true
5605 .type = WREPL_TYPE_GROUP,
5606 .state = WREPL_STATE_TOMBSTONE,
5607 .node = WREPL_NODE_B,
5609 .num_ips = ctx->addresses_best_num,
5610 .ips = ctx->addresses_best,
5611 .apply_expected = true
5615 * group,released vs. group,tombstone with different ip(s)
5618 .line = __location__,
5619 .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL),
5621 .nb_flags = NBT_NM_GROUP,
5623 .num_ips = ctx->addresses_best_num,
5624 .ips = ctx->addresses_best,
5625 .apply_expected = true
5628 .type = WREPL_TYPE_GROUP,
5629 .state = WREPL_STATE_TOMBSTONE,
5630 .node = WREPL_NODE_B,
5632 .num_ips = ARRAY_SIZE(addresses_B_1),
5633 .ips = addresses_B_1,
5634 .apply_expected = true
5638 * group vs. special group section
5641 * group,released vs. sgroup,active with same ip(s)
5644 .line = __location__,
5645 .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL),
5647 .nb_flags = NBT_NM_GROUP,
5649 .num_ips = ctx->addresses_best_num,
5650 .ips = ctx->addresses_best,
5651 .apply_expected = true
5654 .type = WREPL_TYPE_SGROUP,
5655 .state = WREPL_STATE_ACTIVE,
5656 .node = WREPL_NODE_B,
5658 .num_ips = ctx->addresses_best_num,
5659 .ips = ctx->addresses_best,
5660 .apply_expected = false
5664 * group,released vs. sgroup,active with different ip(s)
5667 .line = __location__,
5668 .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL),
5670 .nb_flags = NBT_NM_GROUP,
5672 .num_ips = ctx->addresses_best_num,
5673 .ips = ctx->addresses_best,
5674 .apply_expected = true
5677 .type = WREPL_TYPE_SGROUP,
5678 .state = WREPL_STATE_ACTIVE,
5679 .node = WREPL_NODE_B,
5681 .num_ips = ARRAY_SIZE(addresses_B_1),
5682 .ips = addresses_B_1,
5683 .apply_expected = false
5687 * group,released vs. sgroup,tombstone with same ip(s)
5690 .line = __location__,
5691 .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL),
5693 .nb_flags = NBT_NM_GROUP,
5695 .num_ips = ctx->addresses_best_num,
5696 .ips = ctx->addresses_best,
5697 .apply_expected = true
5700 .type = WREPL_TYPE_SGROUP,
5701 .state = WREPL_STATE_TOMBSTONE,
5702 .node = WREPL_NODE_B,
5704 .num_ips = ctx->addresses_best_num,
5705 .ips = ctx->addresses_best,
5706 .apply_expected = false
5710 * group,released vs. sgroup,tombstone with different ip(s)
5713 .line = __location__,
5714 .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL),
5716 .nb_flags = NBT_NM_GROUP,
5718 .num_ips = ctx->addresses_best_num,
5719 .ips = ctx->addresses_best,
5720 .apply_expected = true
5723 .type = WREPL_TYPE_SGROUP,
5724 .state = WREPL_STATE_TOMBSTONE,
5725 .node = WREPL_NODE_B,
5727 .num_ips = ARRAY_SIZE(addresses_B_1),
5728 .ips = addresses_B_1,
5729 .apply_expected = false
5733 * group vs. multi homed section
5736 * group,released vs. mhomed,active with same ip(s)
5739 .line = __location__,
5740 .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL),
5742 .nb_flags = NBT_NM_GROUP,
5744 .num_ips = ctx->addresses_best_num,
5745 .ips = ctx->addresses_best,
5746 .apply_expected = true
5749 .type = WREPL_TYPE_MHOMED,
5750 .state = WREPL_STATE_ACTIVE,
5751 .node = WREPL_NODE_B,
5753 .num_ips = ctx->addresses_best_num,
5754 .ips = ctx->addresses_best,
5755 .apply_expected = false
5759 * group,released vs. mhomed,active with different ip(s)
5762 .line = __location__,
5763 .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL),
5765 .nb_flags = NBT_NM_GROUP,
5767 .num_ips = ctx->addresses_best_num,
5768 .ips = ctx->addresses_best,
5769 .apply_expected = true
5772 .type = WREPL_TYPE_MHOMED,
5773 .state = WREPL_STATE_ACTIVE,
5774 .node = WREPL_NODE_B,
5776 .num_ips = ARRAY_SIZE(addresses_B_1),
5777 .ips = addresses_B_1,
5778 .apply_expected = false
5782 * group,released vs. mhomed,tombstone with same ip(s)
5785 .line = __location__,
5786 .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL),
5788 .nb_flags = NBT_NM_GROUP,
5790 .num_ips = ctx->addresses_best_num,
5791 .ips = ctx->addresses_best,
5792 .apply_expected = true
5795 .type = WREPL_TYPE_MHOMED,
5796 .state = WREPL_STATE_TOMBSTONE,
5797 .node = WREPL_NODE_B,
5799 .num_ips = ctx->addresses_best_num,
5800 .ips = ctx->addresses_best,
5801 .apply_expected = false
5805 * group,released vs. mhomed,tombstone with different ip(s)
5808 .line = __location__,
5809 .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL),
5811 .nb_flags = NBT_NM_GROUP,
5813 .num_ips = ctx->addresses_best_num,
5814 .ips = ctx->addresses_best,
5815 .apply_expected = true
5818 .type = WREPL_TYPE_MHOMED,
5819 .state = WREPL_STATE_TOMBSTONE,
5820 .node = WREPL_NODE_B,
5822 .num_ips = ARRAY_SIZE(addresses_B_1),
5823 .ips = addresses_B_1,
5824 .apply_expected = false
5828 * special group vs. unique section
5831 * sgroup,released vs. unique,active with same ip(s)
5834 .line = __location__,
5835 .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL),
5837 .nb_flags = NBT_NM_GROUP,
5839 .num_ips = ctx->addresses_best_num,
5840 .ips = ctx->addresses_best,
5841 .apply_expected = true
5844 .type = WREPL_TYPE_UNIQUE,
5845 .state = WREPL_STATE_ACTIVE,
5846 .node = WREPL_NODE_B,
5848 .num_ips = ctx->addresses_best_num,
5849 .ips = ctx->addresses_best,
5850 .apply_expected = true
5854 * sgroup,released vs. unique,active with different ip(s)
5857 .line = __location__,
5858 .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL),
5860 .nb_flags = NBT_NM_GROUP,
5862 .num_ips = ctx->addresses_best_num,
5863 .ips = ctx->addresses_best,
5864 .apply_expected = true
5867 .type = WREPL_TYPE_UNIQUE,
5868 .state = WREPL_STATE_ACTIVE,
5869 .node = WREPL_NODE_B,
5871 .num_ips = ARRAY_SIZE(addresses_B_1),
5872 .ips = addresses_B_1,
5873 .apply_expected = true
5877 * sgroup,released vs. unique,tombstone with same ip(s)
5880 .line = __location__,
5881 .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL),
5883 .nb_flags = NBT_NM_GROUP,
5885 .num_ips = ctx->addresses_best_num,
5886 .ips = ctx->addresses_best,
5887 .apply_expected = true
5890 .type = WREPL_TYPE_UNIQUE,
5891 .state = WREPL_STATE_TOMBSTONE,
5892 .node = WREPL_NODE_B,
5894 .num_ips = ctx->addresses_best_num,
5895 .ips = ctx->addresses_best,
5896 .apply_expected = true
5900 * sgroup,released vs. unique,tombstone with different ip(s)
5903 .line = __location__,
5904 .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL),
5906 .nb_flags = NBT_NM_GROUP,
5908 .num_ips = ctx->addresses_best_num,
5909 .ips = ctx->addresses_best,
5910 .apply_expected = true
5913 .type = WREPL_TYPE_UNIQUE,
5914 .state = WREPL_STATE_TOMBSTONE,
5915 .node = WREPL_NODE_B,
5917 .num_ips = ARRAY_SIZE(addresses_B_1),
5918 .ips = addresses_B_1,
5919 .apply_expected = true
5923 * special group vs. group section
5926 * sgroup,released vs. group,active with same ip(s)
5929 .line = __location__,
5930 .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL),
5932 .nb_flags = NBT_NM_GROUP,
5934 .num_ips = ctx->addresses_best_num,
5935 .ips = ctx->addresses_best,
5936 .apply_expected = true
5939 .type = WREPL_TYPE_GROUP,
5940 .state = WREPL_STATE_ACTIVE,
5941 .node = WREPL_NODE_B,
5943 .num_ips = ctx->addresses_best_num,
5944 .ips = ctx->addresses_best,
5945 .apply_expected = true
5949 * sgroup,released vs. group,active with different ip(s)
5952 .line = __location__,
5953 .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL),
5955 .nb_flags = NBT_NM_GROUP,
5957 .num_ips = ctx->addresses_best_num,
5958 .ips = ctx->addresses_best,
5959 .apply_expected = true
5962 .type = WREPL_TYPE_GROUP,
5963 .state = WREPL_STATE_ACTIVE,
5964 .node = WREPL_NODE_B,
5966 .num_ips = ARRAY_SIZE(addresses_B_1),
5967 .ips = addresses_B_1,
5968 .apply_expected = true
5972 * sgroup,released vs. group,tombstone with same ip(s)
5975 .line = __location__,
5976 .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL),
5978 .nb_flags = NBT_NM_GROUP,
5980 .num_ips = ctx->addresses_best_num,
5981 .ips = ctx->addresses_best,
5982 .apply_expected = true
5985 .type = WREPL_TYPE_GROUP,
5986 .state = WREPL_STATE_TOMBSTONE,
5987 .node = WREPL_NODE_B,
5989 .num_ips = ctx->addresses_best_num,
5990 .ips = ctx->addresses_best,
5991 .apply_expected = true
5995 * sgroup,released vs. group,tombstone with different ip(s)
5998 .line = __location__,
5999 .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL),
6001 .nb_flags = NBT_NM_GROUP,
6003 .num_ips = ctx->addresses_best_num,
6004 .ips = ctx->addresses_best,
6005 .apply_expected = true
6008 .type = WREPL_TYPE_GROUP,
6009 .state = WREPL_STATE_TOMBSTONE,
6010 .node = WREPL_NODE_B,
6012 .num_ips = ARRAY_SIZE(addresses_B_1),
6013 .ips = addresses_B_1,
6014 .apply_expected = true
6018 * special group vs. special group section
6021 * sgroup,released vs. sgroup,active with same ip(s)
6024 .line = __location__,
6025 .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL),
6027 .nb_flags = NBT_NM_GROUP,
6029 .num_ips = ctx->addresses_best_num,
6030 .ips = ctx->addresses_best,
6031 .apply_expected = true
6034 .type = WREPL_TYPE_SGROUP,
6035 .state = WREPL_STATE_ACTIVE,
6036 .node = WREPL_NODE_B,
6038 .num_ips = ctx->addresses_best_num,
6039 .ips = ctx->addresses_best,
6040 .apply_expected = true
6044 * sgroup,released vs. sgroup,active with different ip(s)
6047 .line = __location__,
6048 .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL),
6050 .nb_flags = NBT_NM_GROUP,
6052 .num_ips = ctx->addresses_best_num,
6053 .ips = ctx->addresses_best,
6054 .apply_expected = true
6057 .type = WREPL_TYPE_SGROUP,
6058 .state = WREPL_STATE_ACTIVE,
6059 .node = WREPL_NODE_B,
6061 .num_ips = ARRAY_SIZE(addresses_B_1),
6062 .ips = addresses_B_1,
6063 .apply_expected = true
6067 * sgroup,released vs. sgroup,tombstone with same ip(s)
6070 .line = __location__,
6071 .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL),
6073 .nb_flags = NBT_NM_GROUP,
6075 .num_ips = ctx->addresses_best_num,
6076 .ips = ctx->addresses_best,
6077 .apply_expected = true
6080 .type = WREPL_TYPE_SGROUP,
6081 .state = WREPL_STATE_TOMBSTONE,
6082 .node = WREPL_NODE_B,
6084 .num_ips = ctx->addresses_best_num,
6085 .ips = ctx->addresses_best,
6086 .apply_expected = true
6090 * sgroup,released vs. sgroup,tombstone with different ip(s)
6093 .line = __location__,
6094 .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL),
6096 .nb_flags = NBT_NM_GROUP,
6098 .num_ips = ctx->addresses_best_num,
6099 .ips = ctx->addresses_best,
6100 .apply_expected = true
6103 .type = WREPL_TYPE_SGROUP,
6104 .state = WREPL_STATE_TOMBSTONE,
6105 .node = WREPL_NODE_B,
6107 .num_ips = ARRAY_SIZE(addresses_B_1),
6108 .ips = addresses_B_1,
6109 .apply_expected = true
6113 * special group vs. multi homed section
6116 * sgroup,released vs. mhomed,active with same ip(s)
6119 .line = __location__,
6120 .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL),
6122 .nb_flags = NBT_NM_GROUP,
6124 .num_ips = ctx->addresses_best_num,
6125 .ips = ctx->addresses_best,
6126 .apply_expected = true
6129 .type = WREPL_TYPE_MHOMED,
6130 .state = WREPL_STATE_ACTIVE,
6131 .node = WREPL_NODE_B,
6133 .num_ips = ctx->addresses_best_num,
6134 .ips = ctx->addresses_best,
6135 .apply_expected = true
6139 * sgroup,released vs. mhomed,active with different ip(s)
6142 .line = __location__,
6143 .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL),
6145 .nb_flags = NBT_NM_GROUP,
6147 .num_ips = ctx->addresses_best_num,
6148 .ips = ctx->addresses_best,
6149 .apply_expected = true
6152 .type = WREPL_TYPE_MHOMED,
6153 .state = WREPL_STATE_ACTIVE,
6154 .node = WREPL_NODE_B,
6156 .num_ips = ARRAY_SIZE(addresses_B_1),
6157 .ips = addresses_B_1,
6158 .apply_expected = true
6162 * sgroup,released vs. mhomed,tombstone with same ip(s)
6165 .line = __location__,
6166 .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL),
6168 .nb_flags = NBT_NM_GROUP,
6170 .num_ips = ctx->addresses_best_num,
6171 .ips = ctx->addresses_best,
6172 .apply_expected = true
6175 .type = WREPL_TYPE_MHOMED,
6176 .state = WREPL_STATE_TOMBSTONE,
6177 .node = WREPL_NODE_B,
6179 .num_ips = ctx->addresses_best_num,
6180 .ips = ctx->addresses_best,
6181 .apply_expected = true
6185 * sgroup,released vs. mhomed,tombstone with different ip(s)
6188 .line = __location__,
6189 .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL),
6191 .nb_flags = NBT_NM_GROUP,
6193 .num_ips = ctx->addresses_best_num,
6194 .ips = ctx->addresses_best,
6195 .apply_expected = true
6198 .type = WREPL_TYPE_MHOMED,
6199 .state = WREPL_STATE_TOMBSTONE,
6200 .node = WREPL_NODE_B,
6202 .num_ips = ARRAY_SIZE(addresses_B_1),
6203 .ips = addresses_B_1,
6204 .apply_expected = true
6208 * multi homed vs. unique section
6211 * mhomed,released vs. unique,active with same ip(s)
6214 .line = __location__,
6215 .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL),
6219 .num_ips = ctx->addresses_best_num,
6220 .ips = ctx->addresses_best,
6221 .apply_expected = true
6224 .type = WREPL_TYPE_UNIQUE,
6225 .state = WREPL_STATE_ACTIVE,
6226 .node = WREPL_NODE_B,
6228 .num_ips = ctx->addresses_best_num,
6229 .ips = ctx->addresses_best,
6230 .apply_expected = true
6234 * mhomed,released vs. unique,active with different ip(s)
6237 .line = __location__,
6238 .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL),
6242 .num_ips = ctx->addresses_best_num,
6243 .ips = ctx->addresses_best,
6244 .apply_expected = true
6247 .type = WREPL_TYPE_UNIQUE,
6248 .state = WREPL_STATE_ACTIVE,
6249 .node = WREPL_NODE_B,
6251 .num_ips = ARRAY_SIZE(addresses_B_1),
6252 .ips = addresses_B_1,
6253 .apply_expected = true
6257 * mhomed,released vs. unique,tombstone with same ip(s)
6260 .line = __location__,
6261 .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL),
6265 .num_ips = ctx->addresses_best_num,
6266 .ips = ctx->addresses_best,
6267 .apply_expected = true
6270 .type = WREPL_TYPE_UNIQUE,
6271 .state = WREPL_STATE_TOMBSTONE,
6272 .node = WREPL_NODE_B,
6274 .num_ips = ctx->addresses_best_num,
6275 .ips = ctx->addresses_best,
6276 .apply_expected = true
6280 * mhomed,released vs. unique,tombstone with different ip(s)
6283 .line = __location__,
6284 .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL),
6288 .num_ips = ctx->addresses_best_num,
6289 .ips = ctx->addresses_best,
6290 .apply_expected = true
6293 .type = WREPL_TYPE_UNIQUE,
6294 .state = WREPL_STATE_TOMBSTONE,
6295 .node = WREPL_NODE_B,
6297 .num_ips = ARRAY_SIZE(addresses_B_1),
6298 .ips = addresses_B_1,
6299 .apply_expected = true
6303 * multi homed vs. group section
6306 * mhomed,released vs. group,active with same ip(s)
6309 .line = __location__,
6310 .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL),
6314 .num_ips = ctx->addresses_best_num,
6315 .ips = ctx->addresses_best,
6316 .apply_expected = true
6319 .type = WREPL_TYPE_GROUP,
6320 .state = WREPL_STATE_ACTIVE,
6321 .node = WREPL_NODE_B,
6323 .num_ips = ctx->addresses_best_num,
6324 .ips = ctx->addresses_best,
6325 .apply_expected = true
6329 * mhomed,released vs. group,active with different ip(s)
6332 .line = __location__,
6333 .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL),
6337 .num_ips = ctx->addresses_best_num,
6338 .ips = ctx->addresses_best,
6339 .apply_expected = true
6342 .type = WREPL_TYPE_GROUP,
6343 .state = WREPL_STATE_ACTIVE,
6344 .node = WREPL_NODE_B,
6346 .num_ips = ARRAY_SIZE(addresses_B_1),
6347 .ips = addresses_B_1,
6348 .apply_expected = true
6352 * mhomed,released vs. group,tombstone with same ip(s)
6355 .line = __location__,
6356 .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL),
6360 .num_ips = ctx->addresses_best_num,
6361 .ips = ctx->addresses_best,
6362 .apply_expected = true
6365 .type = WREPL_TYPE_GROUP,
6366 .state = WREPL_STATE_TOMBSTONE,
6367 .node = WREPL_NODE_B,
6369 .num_ips = ctx->addresses_best_num,
6370 .ips = ctx->addresses_best,
6371 .apply_expected = true
6375 * mhomed,released vs. group,tombstone with different ip(s)
6378 .line = __location__,
6379 .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL),
6383 .num_ips = ctx->addresses_best_num,
6384 .ips = ctx->addresses_best,
6385 .apply_expected = true
6388 .type = WREPL_TYPE_GROUP,
6389 .state = WREPL_STATE_TOMBSTONE,
6390 .node = WREPL_NODE_B,
6392 .num_ips = ARRAY_SIZE(addresses_B_1),
6393 .ips = addresses_B_1,
6394 .apply_expected = true
6398 * multi homed vs. special group section
6401 * mhomed,released vs. sgroup,active with same ip(s)
6404 .line = __location__,
6405 .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL),
6409 .num_ips = ctx->addresses_best_num,
6410 .ips = ctx->addresses_best,
6411 .apply_expected = true
6414 .type = WREPL_TYPE_SGROUP,
6415 .state = WREPL_STATE_ACTIVE,
6416 .node = WREPL_NODE_B,
6418 .num_ips = ctx->addresses_best_num,
6419 .ips = ctx->addresses_best,
6420 .apply_expected = true
6424 * mhomed,released vs. sgroup,active with different ip(s)
6427 .line = __location__,
6428 .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL),
6432 .num_ips = ctx->addresses_best_num,
6433 .ips = ctx->addresses_best,
6434 .apply_expected = true
6437 .type = WREPL_TYPE_SGROUP,
6438 .state = WREPL_STATE_ACTIVE,
6439 .node = WREPL_NODE_B,
6441 .num_ips = ARRAY_SIZE(addresses_B_1),
6442 .ips = addresses_B_1,
6443 .apply_expected = true
6447 * mhomed,released vs. sgroup,tombstone with same ip(s)
6450 .line = __location__,
6451 .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL),
6455 .num_ips = ctx->addresses_best_num,
6456 .ips = ctx->addresses_best,
6457 .apply_expected = true
6460 .type = WREPL_TYPE_SGROUP,
6461 .state = WREPL_STATE_TOMBSTONE,
6462 .node = WREPL_NODE_B,
6464 .num_ips = ctx->addresses_best_num,
6465 .ips = ctx->addresses_best,
6466 .apply_expected = true
6470 * mhomed,released vs. sgroup,tombstone with different ip(s)
6473 .line = __location__,
6474 .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL),
6478 .num_ips = ctx->addresses_best_num,
6479 .ips = ctx->addresses_best,
6480 .apply_expected = true
6483 .type = WREPL_TYPE_SGROUP,
6484 .state = WREPL_STATE_TOMBSTONE,
6485 .node = WREPL_NODE_B,
6487 .num_ips = ARRAY_SIZE(addresses_B_1),
6488 .ips = addresses_B_1,
6489 .apply_expected = true
6493 * multi homed vs. multi homed section
6496 * mhomed,released vs. mhomed,active with same ip(s)
6499 .line = __location__,
6500 .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL),
6504 .num_ips = ctx->addresses_best_num,
6505 .ips = ctx->addresses_best,
6506 .apply_expected = true
6509 .type = WREPL_TYPE_MHOMED,
6510 .state = WREPL_STATE_ACTIVE,
6511 .node = WREPL_NODE_B,
6513 .num_ips = ctx->addresses_best_num,
6514 .ips = ctx->addresses_best,
6515 .apply_expected = true
6519 * mhomed,released vs. mhomed,active with different ip(s)
6522 .line = __location__,
6523 .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL),
6527 .num_ips = ctx->addresses_best_num,
6528 .ips = ctx->addresses_best,
6529 .apply_expected = true
6532 .type = WREPL_TYPE_MHOMED,
6533 .state = WREPL_STATE_ACTIVE,
6534 .node = WREPL_NODE_B,
6536 .num_ips = ARRAY_SIZE(addresses_B_1),
6537 .ips = addresses_B_1,
6538 .apply_expected = true
6542 * mhomed,released vs. mhomed,tombstone with same ip(s)
6545 .line = __location__,
6546 .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL),
6550 .num_ips = ctx->addresses_best_num,
6551 .ips = ctx->addresses_best,
6552 .apply_expected = true
6555 .type = WREPL_TYPE_MHOMED,
6556 .state = WREPL_STATE_TOMBSTONE,
6557 .node = WREPL_NODE_B,
6559 .num_ips = ctx->addresses_best_num,
6560 .ips = ctx->addresses_best,
6561 .apply_expected = true
6565 * mhomed,released vs. mhomed,tombstone with different ip(s)
6568 .line = __location__,
6569 .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL),
6573 .num_ips = ctx->addresses_best_num,
6574 .ips = ctx->addresses_best,
6575 .apply_expected = true
6578 .type = WREPL_TYPE_MHOMED,
6579 .state = WREPL_STATE_TOMBSTONE,
6580 .node = WREPL_NODE_B,
6582 .num_ips = ARRAY_SIZE(addresses_B_1),
6583 .ips = addresses_B_1,
6584 .apply_expected = true
6589 torture_comment(tctx, "Test Replica records vs. owned released records\n");
6591 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
6592 torture_comment(tctx, "%s => %s\n", nbt_name_string(ctx, &records[i].name),
6593 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
6598 name_register->in.name = records[i].name;
6599 name_register->in.dest_addr = ctx->address;
6600 name_register->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
6601 name_register->in.address = records[i].wins.ips[0].ip;
6602 name_register->in.nb_flags = records[i].wins.nb_flags;
6603 name_register->in.register_demand= false;
6604 name_register->in.broadcast = false;
6605 name_register->in.multi_homed = records[i].wins.mhomed;
6606 name_register->in.ttl = 300000;
6607 name_register->in.timeout = 70;
6608 name_register->in.retries = 0;
6610 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
6611 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6612 torture_comment(tctx, "No response from %s for name register\n", ctx->address);
6615 if (!NT_STATUS_IS_OK(status)) {
6616 torture_comment(tctx, "Bad response from %s for name register - %s\n",
6617 ctx->address, nt_errstr(status));
6620 CHECK_VALUE(tctx, name_register->out.rcode, 0);
6621 CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address);
6622 CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type);
6623 CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name);
6624 CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope);
6625 CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[0].ip);
6627 /* release the record */
6628 release->in.name = records[i].name;
6629 release->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
6630 release->in.dest_addr = ctx->address;
6631 release->in.address = records[i].wins.ips[0].ip;
6632 release->in.nb_flags = records[i].wins.nb_flags;
6633 release->in.broadcast = false;
6634 release->in.timeout = 30;
6635 release->in.retries = 0;
6637 status = nbt_name_release(ctx->nbtsock, ctx, release);
6638 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6639 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
6642 if (!NT_STATUS_IS_OK(status)) {
6643 torture_comment(tctx, "Bad response from %s for name query - %s\n",
6644 ctx->address, nt_errstr(status));
6647 CHECK_VALUE(tctx, release->out.rcode, 0);
6652 wins_name->name = &records[i].name;
6653 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
6654 records[i].replica.state,
6655 records[i].replica.node,
6656 records[i].replica.is_static);
6657 wins_name->id = ++ctx->b.max_version;
6658 if (wins_name->flags & 2) {
6659 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
6660 wins_name->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
6661 records[i].replica.ips);
6663 wins_name->addresses.ip = records[i].replica.ips[0].ip;
6665 wins_name->unknown = "255.255.255.255";
6667 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
6668 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name,
6669 records[i].replica.apply_expected);
6671 if (records[i].replica.apply_expected) {
6672 wins_name->name = &records[i].name;
6673 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
6674 WREPL_STATE_TOMBSTONE,
6675 WREPL_NODE_B, false);
6676 wins_name->id = ++ctx->b.max_version;
6677 wins_name->addresses.ip = addresses_B_1[0].ip;
6678 wins_name->unknown = "255.255.255.255";
6680 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
6681 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
6683 release->in.name = records[i].name;
6684 release->in.dest_addr = ctx->address;
6685 release->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
6686 release->in.address = records[i].wins.ips[0].ip;
6687 release->in.nb_flags = records[i].wins.nb_flags;
6688 release->in.broadcast = false;
6689 release->in.timeout = 30;
6690 release->in.retries = 0;
6692 status = nbt_name_release(ctx->nbtsock, ctx, release);
6693 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6694 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
6697 if (!NT_STATUS_IS_OK(status)) {
6698 torture_comment(tctx, "Bad response from %s for name query - %s\n",
6699 ctx->address, nt_errstr(status));
6702 CHECK_VALUE(tctx, release->out.rcode, 0);
6705 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
6713 struct test_conflict_owned_active_vs_replica_struct {
6714 struct torture_context *tctx;
6715 const char *line; /* just better debugging */
6716 const char *section; /* just better debugging */
6717 struct nbt_name name;
6718 const char *comment;
6724 const struct wrepl_ip *ips;
6725 bool apply_expected;
6730 bool expect_release;
6733 /* when num_ips == 0, then .wins.ips are used */
6735 const struct wrepl_ip *ips;
6738 enum wrepl_name_type type;
6739 enum wrepl_name_state state;
6740 enum wrepl_name_node node;
6743 const struct wrepl_ip *ips;
6744 bool apply_expected;
6750 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
6751 struct nbt_name_packet *req_packet,
6752 struct socket_address *src);
6754 static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx,
6755 struct test_wrepl_conflict_conn *ctx)
6759 struct wrepl_wins_name wins_name_;
6760 struct wrepl_wins_name *wins_name = &wins_name_;
6761 struct nbt_name_register name_register_;
6762 struct nbt_name_register *name_register = &name_register_;
6763 struct nbt_name_release release_;
6764 struct nbt_name_release *release = &release_;
6766 struct test_conflict_owned_active_vs_replica_struct records[] = {
6768 * unique vs. unique section
6771 * unique,active vs. unique,active with same ip(s), unchecked
6775 .line = __location__,
6776 .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL),
6780 .num_ips = ctx->addresses_best_num,
6781 .ips = ctx->addresses_best,
6782 .apply_expected = true
6788 .type = WREPL_TYPE_UNIQUE,
6789 .state = WREPL_STATE_ACTIVE,
6790 .node = WREPL_NODE_B,
6792 .num_ips = ctx->addresses_best_num,
6793 .ips = ctx->addresses_best,
6794 .apply_expected = true
6798 * unique,active vs. unique,active with different ip(s), positive response
6802 .line = __location__,
6803 .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL),
6807 .num_ips = ctx->addresses_best_num,
6808 .ips = ctx->addresses_best,
6809 .apply_expected = true
6816 .type = WREPL_TYPE_UNIQUE,
6817 .state = WREPL_STATE_ACTIVE,
6818 .node = WREPL_NODE_B,
6820 .num_ips = ARRAY_SIZE(addresses_B_1),
6821 .ips = addresses_B_1,
6822 .apply_expected = false
6826 * unique,active vs. unique,active with different ip(s), positive response other ips
6830 .line = __location__,
6831 .name = _NBT_NAME("_UA_UA_DI_O", 0x00, NULL),
6835 .num_ips = ctx->addresses_best_num,
6836 .ips = ctx->addresses_best,
6837 .apply_expected = true
6842 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6843 .ips = addresses_A_3_4,
6846 .type = WREPL_TYPE_UNIQUE,
6847 .state = WREPL_STATE_ACTIVE,
6848 .node = WREPL_NODE_B,
6850 .num_ips = ARRAY_SIZE(addresses_B_1),
6851 .ips = addresses_B_1,
6852 .apply_expected = false
6856 * unique,active vs. unique,active with different ip(s), negative response
6860 .line = __location__,
6861 .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL),
6865 .num_ips = ctx->addresses_best_num,
6866 .ips = ctx->addresses_best,
6867 .apply_expected = true
6874 .type = WREPL_TYPE_UNIQUE,
6875 .state = WREPL_STATE_ACTIVE,
6876 .node = WREPL_NODE_B,
6878 .num_ips = ARRAY_SIZE(addresses_B_1),
6879 .ips = addresses_B_1,
6880 .apply_expected = true
6884 * unique,active vs. unique,tombstone with same ip(s), unchecked
6888 .line = __location__,
6889 .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL),
6893 .num_ips = ctx->addresses_best_num,
6894 .ips = ctx->addresses_best,
6895 .apply_expected = true
6901 .type = WREPL_TYPE_UNIQUE,
6902 .state = WREPL_STATE_TOMBSTONE,
6903 .node = WREPL_NODE_B,
6905 .num_ips = ctx->addresses_best_num,
6906 .ips = ctx->addresses_best,
6907 .apply_expected = false
6911 * unique,active vs. unique,tombstone with different ip(s), unchecked
6915 .line = __location__,
6916 .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL),
6920 .num_ips = ctx->addresses_best_num,
6921 .ips = ctx->addresses_best,
6922 .apply_expected = true
6928 .type = WREPL_TYPE_UNIQUE,
6929 .state = WREPL_STATE_TOMBSTONE,
6930 .node = WREPL_NODE_B,
6932 .num_ips = ARRAY_SIZE(addresses_B_1),
6933 .ips = addresses_B_1,
6934 .apply_expected = false
6938 * unique vs. group section
6941 * unique,active vs. group,active with same ip(s), release expected
6945 .line = __location__,
6946 .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL),
6950 .num_ips = ctx->addresses_best_num,
6951 .ips = ctx->addresses_best,
6952 .apply_expected = true
6956 .expect_release = true,
6959 .type = WREPL_TYPE_GROUP,
6960 .state = WREPL_STATE_ACTIVE,
6961 .node = WREPL_NODE_B,
6963 .num_ips = ctx->addresses_best_num,
6964 .ips = ctx->addresses_best,
6965 .apply_expected = true
6969 * unique,active vs. group,active with different ip(s), release expected
6973 .line = __location__,
6974 .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL),
6978 .num_ips = ctx->addresses_best_num,
6979 .ips = ctx->addresses_best,
6980 .apply_expected = true
6984 .expect_release = true,
6987 .type = WREPL_TYPE_GROUP,
6988 .state = WREPL_STATE_ACTIVE,
6989 .node = WREPL_NODE_B,
6991 .num_ips = ARRAY_SIZE(addresses_B_1),
6992 .ips = addresses_B_1,
6993 .apply_expected = true
6997 * unique,active vs. group,tombstone with same ip(s), unchecked
7001 .line = __location__,
7002 .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL),
7006 .num_ips = ctx->addresses_best_num,
7007 .ips = ctx->addresses_best,
7008 .apply_expected = true
7014 .type = WREPL_TYPE_GROUP,
7015 .state = WREPL_STATE_TOMBSTONE,
7016 .node = WREPL_NODE_B,
7018 .num_ips = ctx->addresses_best_num,
7019 .ips = ctx->addresses_best,
7020 .apply_expected = false
7024 * unique,active vs. group,tombstone with different ip(s), unchecked
7028 .line = __location__,
7029 .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL),
7033 .num_ips = ctx->addresses_best_num,
7034 .ips = ctx->addresses_best,
7035 .apply_expected = true
7041 .type = WREPL_TYPE_GROUP,
7042 .state = WREPL_STATE_TOMBSTONE,
7043 .node = WREPL_NODE_B,
7045 .num_ips = ARRAY_SIZE(addresses_B_1),
7046 .ips = addresses_B_1,
7047 .apply_expected = false
7051 * unique vs. special group section
7054 * unique,active vs. sgroup,active with same ip(s), release expected
7058 .line = __location__,
7059 .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL),
7063 .num_ips = ctx->addresses_best_num,
7064 .ips = ctx->addresses_best,
7065 .apply_expected = true
7069 .expect_release = true,
7072 .type = WREPL_TYPE_SGROUP,
7073 .state = WREPL_STATE_ACTIVE,
7074 .node = WREPL_NODE_B,
7076 .num_ips = ctx->addresses_best_num,
7077 .ips = ctx->addresses_best,
7078 .apply_expected = true
7082 * unique,active vs. group,active with different ip(s), release expected
7086 .line = __location__,
7087 .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL),
7091 .num_ips = ctx->addresses_best_num,
7092 .ips = ctx->addresses_best,
7093 .apply_expected = true
7097 .expect_release = true,
7100 .type = WREPL_TYPE_SGROUP,
7101 .state = WREPL_STATE_ACTIVE,
7102 .node = WREPL_NODE_B,
7104 .num_ips = ARRAY_SIZE(addresses_B_1),
7105 .ips = addresses_B_1,
7106 .apply_expected = true
7110 * unique,active vs. sgroup,tombstone with same ip(s), unchecked
7114 .line = __location__,
7115 .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL),
7119 .num_ips = ctx->addresses_best_num,
7120 .ips = ctx->addresses_best,
7121 .apply_expected = true
7127 .type = WREPL_TYPE_SGROUP,
7128 .state = WREPL_STATE_TOMBSTONE,
7129 .node = WREPL_NODE_B,
7131 .num_ips = ctx->addresses_best_num,
7132 .ips = ctx->addresses_best,
7133 .apply_expected = false
7137 * unique,active vs. sgroup,tombstone with different ip(s), unchecked
7141 .line = __location__,
7142 .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL),
7146 .num_ips = ctx->addresses_best_num,
7147 .ips = ctx->addresses_best,
7148 .apply_expected = true
7154 .type = WREPL_TYPE_SGROUP,
7155 .state = WREPL_STATE_TOMBSTONE,
7156 .node = WREPL_NODE_B,
7158 .num_ips = ARRAY_SIZE(addresses_B_1),
7159 .ips = addresses_B_1,
7160 .apply_expected = false
7164 * unique vs. multi homed section
7167 * unique,active vs. mhomed,active with same ip(s), unchecked
7171 .line = __location__,
7172 .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL),
7176 .num_ips = ctx->addresses_best_num,
7177 .ips = ctx->addresses_best,
7178 .apply_expected = true
7184 .type = WREPL_TYPE_MHOMED,
7185 .state = WREPL_STATE_ACTIVE,
7186 .node = WREPL_NODE_B,
7188 .num_ips = ctx->addresses_best_num,
7189 .ips = ctx->addresses_best,
7190 .apply_expected = true
7194 * unique,active vs. mhomed,active with superset ip(s), unchecked
7198 .line = __location__,
7199 .name = _NBT_NAME("_UA_MA_SP_U", 0x00, NULL),
7203 .num_ips = ctx->addresses_best_num,
7204 .ips = ctx->addresses_best,
7205 .apply_expected = true
7211 .type = WREPL_TYPE_MHOMED,
7212 .state = WREPL_STATE_ACTIVE,
7213 .node = WREPL_NODE_B,
7215 .num_ips = ctx->addresses_all_num,
7216 .ips = ctx->addresses_all,
7217 .apply_expected = true
7221 * unique,active vs. mhomed,active with different ip(s), positive response
7225 .line = __location__,
7226 .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL),
7230 .num_ips = ctx->addresses_best_num,
7231 .ips = ctx->addresses_best,
7232 .apply_expected = true
7239 .type = WREPL_TYPE_MHOMED,
7240 .state = WREPL_STATE_ACTIVE,
7241 .node = WREPL_NODE_B,
7243 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7244 .ips = addresses_B_3_4,
7245 .apply_expected = false
7249 * unique,active vs. mhomed,active with different ip(s), positive response other ips
7253 .line = __location__,
7254 .name = _NBT_NAME("_UA_MA_DI_O", 0x00, NULL),
7258 .num_ips = ctx->addresses_best_num,
7259 .ips = ctx->addresses_best,
7260 .apply_expected = true
7265 .num_ips = ARRAY_SIZE(addresses_A_3_4),
7266 .ips = addresses_A_3_4,
7269 .type = WREPL_TYPE_MHOMED,
7270 .state = WREPL_STATE_ACTIVE,
7271 .node = WREPL_NODE_B,
7273 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7274 .ips = addresses_B_3_4,
7275 .apply_expected = false
7279 * unique,active vs. mhomed,active with different ip(s), negative response
7283 .line = __location__,
7284 .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL),
7288 .num_ips = ctx->addresses_best_num,
7289 .ips = ctx->addresses_best,
7290 .apply_expected = true
7297 .type = WREPL_TYPE_MHOMED,
7298 .state = WREPL_STATE_ACTIVE,
7299 .node = WREPL_NODE_B,
7301 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7302 .ips = addresses_B_3_4,
7303 .apply_expected = true
7307 * unique,active vs. mhomed,tombstone with same ip(s), unchecked
7311 .line = __location__,
7312 .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL),
7316 .num_ips = ctx->addresses_best_num,
7317 .ips = ctx->addresses_best,
7318 .apply_expected = true
7324 .type = WREPL_TYPE_MHOMED,
7325 .state = WREPL_STATE_TOMBSTONE,
7326 .node = WREPL_NODE_B,
7328 .num_ips = ctx->addresses_best_num,
7329 .ips = ctx->addresses_best,
7330 .apply_expected = false
7334 * unique,active vs. mhomed,tombstone with different ip(s), unchecked
7338 .line = __location__,
7339 .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL),
7343 .num_ips = ctx->addresses_best_num,
7344 .ips = ctx->addresses_best,
7345 .apply_expected = true
7351 .type = WREPL_TYPE_MHOMED,
7352 .state = WREPL_STATE_TOMBSTONE,
7353 .node = WREPL_NODE_B,
7355 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7356 .ips = addresses_B_3_4,
7357 .apply_expected = false
7361 * normal group vs. unique section
7364 * group,active vs. unique,active with same ip(s), unchecked
7368 .line = __location__,
7369 .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL),
7371 .nb_flags = NBT_NM_GROUP,
7373 .num_ips = ctx->addresses_best_num,
7374 .ips = ctx->addresses_best,
7375 .apply_expected = true
7381 .type = WREPL_TYPE_UNIQUE,
7382 .state = WREPL_STATE_ACTIVE,
7383 .node = WREPL_NODE_B,
7385 .num_ips = ctx->addresses_best_num,
7386 .ips = ctx->addresses_best,
7387 .apply_expected = false
7391 * group,active vs. unique,active with different ip(s), unchecked
7395 .line = __location__,
7396 .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL),
7398 .nb_flags = NBT_NM_GROUP,
7400 .num_ips = ctx->addresses_best_num,
7401 .ips = ctx->addresses_best,
7402 .apply_expected = true
7408 .type = WREPL_TYPE_UNIQUE,
7409 .state = WREPL_STATE_ACTIVE,
7410 .node = WREPL_NODE_B,
7412 .num_ips = ARRAY_SIZE(addresses_B_1),
7413 .ips = addresses_B_1,
7414 .apply_expected = false
7418 * group,active vs. unique,tombstone with same ip(s), unchecked
7422 .line = __location__,
7423 .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL),
7425 .nb_flags = NBT_NM_GROUP,
7427 .num_ips = ctx->addresses_best_num,
7428 .ips = ctx->addresses_best,
7429 .apply_expected = true
7435 .type = WREPL_TYPE_UNIQUE,
7436 .state = WREPL_STATE_TOMBSTONE,
7437 .node = WREPL_NODE_B,
7439 .num_ips = ctx->addresses_best_num,
7440 .ips = ctx->addresses_best,
7441 .apply_expected = false
7445 * group,active vs. unique,tombstone with different ip(s), unchecked
7449 .line = __location__,
7450 .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL),
7452 .nb_flags = NBT_NM_GROUP,
7454 .num_ips = ctx->addresses_best_num,
7455 .ips = ctx->addresses_best,
7456 .apply_expected = true
7462 .type = WREPL_TYPE_UNIQUE,
7463 .state = WREPL_STATE_TOMBSTONE,
7464 .node = WREPL_NODE_B,
7466 .num_ips = ARRAY_SIZE(addresses_B_1),
7467 .ips = addresses_B_1,
7468 .apply_expected = false
7472 * normal group vs. normal group section
7475 * group,active vs. group,active with same ip(s), unchecked
7479 .line = __location__,
7480 .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL),
7482 .nb_flags = NBT_NM_GROUP,
7484 .num_ips = ctx->addresses_best_num,
7485 .ips = ctx->addresses_best,
7486 .apply_expected = true
7492 .type = WREPL_TYPE_GROUP,
7493 .state = WREPL_STATE_ACTIVE,
7494 .node = WREPL_NODE_B,
7496 .num_ips = ctx->addresses_best_num,
7497 .ips = ctx->addresses_best,
7498 .apply_expected = true
7502 * group,active vs. group,active with different ip(s), unchecked
7506 .line = __location__,
7507 .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL),
7509 .nb_flags = NBT_NM_GROUP,
7511 .num_ips = ctx->addresses_best_num,
7512 .ips = ctx->addresses_best,
7513 .apply_expected = true
7519 .type = WREPL_TYPE_GROUP,
7520 .state = WREPL_STATE_ACTIVE,
7521 .node = WREPL_NODE_B,
7523 .num_ips = ARRAY_SIZE(addresses_B_1),
7524 .ips = addresses_B_1,
7525 .apply_expected = true
7529 * group,active vs. group,tombstone with same ip(s), unchecked
7533 .line = __location__,
7534 .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL),
7536 .nb_flags = NBT_NM_GROUP,
7538 .num_ips = ctx->addresses_best_num,
7539 .ips = ctx->addresses_best,
7540 .apply_expected = true
7546 .type = WREPL_TYPE_GROUP,
7547 .state = WREPL_STATE_TOMBSTONE,
7548 .node = WREPL_NODE_B,
7550 .num_ips = ctx->addresses_best_num,
7551 .ips = ctx->addresses_best,
7552 .apply_expected = false
7556 * group,active vs. group,tombstone with different ip(s), unchecked
7560 .line = __location__,
7561 .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL),
7563 .nb_flags = NBT_NM_GROUP,
7565 .num_ips = ctx->addresses_best_num,
7566 .ips = ctx->addresses_best,
7567 .apply_expected = true
7573 .type = WREPL_TYPE_GROUP,
7574 .state = WREPL_STATE_TOMBSTONE,
7575 .node = WREPL_NODE_B,
7577 .num_ips = ARRAY_SIZE(addresses_B_1),
7578 .ips = addresses_B_1,
7579 .apply_expected = false
7583 * normal group vs. special group section
7586 * group,active vs. sgroup,active with same ip(s), unchecked
7590 .line = __location__,
7591 .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL),
7593 .nb_flags = NBT_NM_GROUP,
7595 .num_ips = ctx->addresses_best_num,
7596 .ips = ctx->addresses_best,
7597 .apply_expected = true
7603 .type = WREPL_TYPE_SGROUP,
7604 .state = WREPL_STATE_ACTIVE,
7605 .node = WREPL_NODE_B,
7607 .num_ips = ctx->addresses_best_num,
7608 .ips = ctx->addresses_best,
7609 .apply_expected = false
7613 * group,active vs. sgroup,active with different ip(s), unchecked
7617 .line = __location__,
7618 .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL),
7620 .nb_flags = NBT_NM_GROUP,
7622 .num_ips = ctx->addresses_best_num,
7623 .ips = ctx->addresses_best,
7624 .apply_expected = true
7630 .type = WREPL_TYPE_SGROUP,
7631 .state = WREPL_STATE_ACTIVE,
7632 .node = WREPL_NODE_B,
7634 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7635 .ips = addresses_B_3_4,
7636 .apply_expected = false
7640 * group,active vs. sgroup,tombstone with same ip(s), unchecked
7644 .line = __location__,
7645 .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL),
7647 .nb_flags = NBT_NM_GROUP,
7649 .num_ips = ctx->addresses_best_num,
7650 .ips = ctx->addresses_best,
7651 .apply_expected = true
7657 .type = WREPL_TYPE_SGROUP,
7658 .state = WREPL_STATE_TOMBSTONE,
7659 .node = WREPL_NODE_B,
7661 .num_ips = ctx->addresses_best_num,
7662 .ips = ctx->addresses_best,
7663 .apply_expected = false
7667 * group,active vs. sgroup,tombstone with different ip(s), unchecked
7671 .line = __location__,
7672 .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL),
7674 .nb_flags = NBT_NM_GROUP,
7676 .num_ips = ctx->addresses_best_num,
7677 .ips = ctx->addresses_best,
7678 .apply_expected = true
7684 .type = WREPL_TYPE_SGROUP,
7685 .state = WREPL_STATE_TOMBSTONE,
7686 .node = WREPL_NODE_B,
7688 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7689 .ips = addresses_B_3_4,
7690 .apply_expected = false
7694 * normal group vs. multi homed section
7697 * group,active vs. mhomed,active with same ip(s), unchecked
7701 .line = __location__,
7702 .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL),
7704 .nb_flags = NBT_NM_GROUP,
7706 .num_ips = ctx->addresses_best_num,
7707 .ips = ctx->addresses_best,
7708 .apply_expected = true
7714 .type = WREPL_TYPE_MHOMED,
7715 .state = WREPL_STATE_ACTIVE,
7716 .node = WREPL_NODE_B,
7718 .num_ips = ctx->addresses_best_num,
7719 .ips = ctx->addresses_best,
7720 .apply_expected = false
7724 * group,active vs. mhomed,active with different ip(s), unchecked
7728 .line = __location__,
7729 .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL),
7731 .nb_flags = NBT_NM_GROUP,
7733 .num_ips = ctx->addresses_best_num,
7734 .ips = ctx->addresses_best,
7735 .apply_expected = true
7741 .type = WREPL_TYPE_MHOMED,
7742 .state = WREPL_STATE_ACTIVE,
7743 .node = WREPL_NODE_B,
7745 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7746 .ips = addresses_B_3_4,
7747 .apply_expected = false
7751 * group,active vs. mhomed,tombstone with same ip(s), unchecked
7755 .line = __location__,
7756 .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL),
7758 .nb_flags = NBT_NM_GROUP,
7760 .num_ips = ctx->addresses_best_num,
7761 .ips = ctx->addresses_best,
7762 .apply_expected = true
7768 .type = WREPL_TYPE_MHOMED,
7769 .state = WREPL_STATE_TOMBSTONE,
7770 .node = WREPL_NODE_B,
7772 .num_ips = ctx->addresses_best_num,
7773 .ips = ctx->addresses_best,
7774 .apply_expected = false
7778 * group,active vs. mhomed,tombstone with different ip(s), unchecked
7782 .line = __location__,
7783 .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL),
7785 .nb_flags = NBT_NM_GROUP,
7787 .num_ips = ctx->addresses_best_num,
7788 .ips = ctx->addresses_best,
7789 .apply_expected = true
7795 .type = WREPL_TYPE_MHOMED,
7796 .state = WREPL_STATE_TOMBSTONE,
7797 .node = WREPL_NODE_B,
7799 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7800 .ips = addresses_B_3_4,
7801 .apply_expected = false
7805 * special group vs. unique section
7808 * sgroup,active vs. unique,active with same ip(s), unchecked
7812 .line = __location__,
7813 .name = _NBT_NAME("_SA_UA_SI_U", 0x1C, NULL),
7815 .nb_flags = NBT_NM_GROUP,
7817 .num_ips = ctx->addresses_best_num,
7818 .ips = ctx->addresses_best,
7819 .apply_expected = true
7825 .type = WREPL_TYPE_UNIQUE,
7826 .state = WREPL_STATE_ACTIVE,
7827 .node = WREPL_NODE_B,
7829 .num_ips = ctx->addresses_best_num,
7830 .ips = ctx->addresses_best,
7831 .apply_expected = false
7835 * sgroup,active vs. unique,active with different ip(s), unchecked
7839 .line = __location__,
7840 .name = _NBT_NAME("_SA_UA_DI_U", 0x1C, NULL),
7842 .nb_flags = NBT_NM_GROUP,
7844 .num_ips = ctx->addresses_best_num,
7845 .ips = ctx->addresses_best,
7846 .apply_expected = true
7852 .type = WREPL_TYPE_UNIQUE,
7853 .state = WREPL_STATE_ACTIVE,
7854 .node = WREPL_NODE_B,
7856 .num_ips = ARRAY_SIZE(addresses_B_1),
7857 .ips = addresses_B_1,
7858 .apply_expected = false
7862 * sgroup,active vs. unique,tombstone with same ip(s), unchecked
7866 .line = __location__,
7867 .name = _NBT_NAME("_SA_UT_SI_U", 0x1C, NULL),
7869 .nb_flags = NBT_NM_GROUP,
7871 .num_ips = ctx->addresses_best_num,
7872 .ips = ctx->addresses_best,
7873 .apply_expected = true
7879 .type = WREPL_TYPE_UNIQUE,
7880 .state = WREPL_STATE_TOMBSTONE,
7881 .node = WREPL_NODE_B,
7883 .num_ips = ctx->addresses_best_num,
7884 .ips = ctx->addresses_best,
7885 .apply_expected = false
7889 * sgroup,active vs. unique,tombstone with different ip(s), unchecked
7893 .line = __location__,
7894 .name = _NBT_NAME("_SA_UT_DI_U", 0x1C, NULL),
7896 .nb_flags = NBT_NM_GROUP,
7898 .num_ips = ctx->addresses_best_num,
7899 .ips = ctx->addresses_best,
7900 .apply_expected = true
7906 .type = WREPL_TYPE_UNIQUE,
7907 .state = WREPL_STATE_TOMBSTONE,
7908 .node = WREPL_NODE_B,
7910 .num_ips = ARRAY_SIZE(addresses_B_1),
7911 .ips = addresses_B_1,
7912 .apply_expected = false
7916 * special group vs. normal group section
7919 * sgroup,active vs. group,active with same ip(s), unchecked
7923 .line = __location__,
7924 .name = _NBT_NAME("_SA_GA_SI_U", 0x1C, NULL),
7926 .nb_flags = NBT_NM_GROUP,
7928 .num_ips = ctx->addresses_best_num,
7929 .ips = ctx->addresses_best,
7930 .apply_expected = true
7936 .type = WREPL_TYPE_GROUP,
7937 .state = WREPL_STATE_ACTIVE,
7938 .node = WREPL_NODE_B,
7940 .num_ips = ctx->addresses_best_num,
7941 .ips = ctx->addresses_best,
7942 .apply_expected = false
7946 * sgroup,active vs. group,active with different ip(s), unchecked
7950 .line = __location__,
7951 .name = _NBT_NAME("_SA_GA_DI_U", 0x1C, NULL),
7953 .nb_flags = NBT_NM_GROUP,
7955 .num_ips = ctx->addresses_best_num,
7956 .ips = ctx->addresses_best,
7957 .apply_expected = true
7963 .type = WREPL_TYPE_GROUP,
7964 .state = WREPL_STATE_ACTIVE,
7965 .node = WREPL_NODE_B,
7967 .num_ips = ARRAY_SIZE(addresses_B_1),
7968 .ips = addresses_B_1,
7969 .apply_expected = false
7973 * sgroup,active vs. group,tombstone with same ip(s), unchecked
7977 .line = __location__,
7978 .name = _NBT_NAME("_SA_GT_SI_U", 0x1C, NULL),
7980 .nb_flags = NBT_NM_GROUP,
7982 .num_ips = ctx->addresses_best_num,
7983 .ips = ctx->addresses_best,
7984 .apply_expected = true
7990 .type = WREPL_TYPE_GROUP,
7991 .state = WREPL_STATE_TOMBSTONE,
7992 .node = WREPL_NODE_B,
7994 .num_ips = ctx->addresses_best_num,
7995 .ips = ctx->addresses_best,
7996 .apply_expected = false
8000 * sgroup,active vs. group,tombstone with different ip(s), unchecked
8004 .line = __location__,
8005 .name = _NBT_NAME("_SA_GT_DI_U", 0x1C, NULL),
8007 .nb_flags = NBT_NM_GROUP,
8009 .num_ips = ctx->addresses_best_num,
8010 .ips = ctx->addresses_best,
8011 .apply_expected = true
8017 .type = WREPL_TYPE_GROUP,
8018 .state = WREPL_STATE_TOMBSTONE,
8019 .node = WREPL_NODE_B,
8021 .num_ips = ARRAY_SIZE(addresses_B_1),
8022 .ips = addresses_B_1,
8023 .apply_expected = false
8027 * special group vs. multi homed section
8030 * sgroup,active vs. mhomed,active with same ip(s), unchecked
8034 .line = __location__,
8035 .name = _NBT_NAME("_SA_MA_SI_U", 0x1C, NULL),
8037 .nb_flags = NBT_NM_GROUP,
8039 .num_ips = ctx->addresses_best_num,
8040 .ips = ctx->addresses_best,
8041 .apply_expected = true
8047 .type = WREPL_TYPE_MHOMED,
8048 .state = WREPL_STATE_ACTIVE,
8049 .node = WREPL_NODE_B,
8051 .num_ips = ctx->addresses_best_num,
8052 .ips = ctx->addresses_best,
8053 .apply_expected = false
8057 * sgroup,active vs. mhomed,active with different ip(s), unchecked
8061 .line = __location__,
8062 .name = _NBT_NAME("_SA_MA_DI_U", 0x1C, NULL),
8064 .nb_flags = NBT_NM_GROUP,
8066 .num_ips = ctx->addresses_best_num,
8067 .ips = ctx->addresses_best,
8068 .apply_expected = true
8074 .type = WREPL_TYPE_MHOMED,
8075 .state = WREPL_STATE_ACTIVE,
8076 .node = WREPL_NODE_B,
8078 .num_ips = ARRAY_SIZE(addresses_B_1),
8079 .ips = addresses_B_1,
8080 .apply_expected = false
8084 * sgroup,active vs. mhomed,tombstone with same ip(s), unchecked
8088 .line = __location__,
8089 .name = _NBT_NAME("_SA_MT_SI_U", 0x1C, NULL),
8091 .nb_flags = NBT_NM_GROUP,
8093 .num_ips = ctx->addresses_best_num,
8094 .ips = ctx->addresses_best,
8095 .apply_expected = true
8101 .type = WREPL_TYPE_MHOMED,
8102 .state = WREPL_STATE_TOMBSTONE,
8103 .node = WREPL_NODE_B,
8105 .num_ips = ctx->addresses_best_num,
8106 .ips = ctx->addresses_best,
8107 .apply_expected = false
8111 * sgroup,active vs. mhomed,tombstone with different ip(s), unchecked
8115 .line = __location__,
8116 .name = _NBT_NAME("_SA_MT_DI_U", 0x1C, NULL),
8118 .nb_flags = NBT_NM_GROUP,
8120 .num_ips = ctx->addresses_best_num,
8121 .ips = ctx->addresses_best,
8122 .apply_expected = true
8128 .type = WREPL_TYPE_MHOMED,
8129 .state = WREPL_STATE_TOMBSTONE,
8130 .node = WREPL_NODE_B,
8132 .num_ips = ARRAY_SIZE(addresses_B_1),
8133 .ips = addresses_B_1,
8134 .apply_expected = false
8138 * multi homed vs. unique section
8141 * mhomed,active vs. unique,active with same ip(s), unchecked
8145 .line = __location__,
8146 .name = _NBT_NAME("_MA_UA_SI_U", 0x00, NULL),
8150 .num_ips = ctx->addresses_best_num,
8151 .ips = ctx->addresses_best,
8152 .apply_expected = true
8158 .type = WREPL_TYPE_UNIQUE,
8159 .state = WREPL_STATE_ACTIVE,
8160 .node = WREPL_NODE_B,
8162 .num_ips = ctx->addresses_best_num,
8163 .ips = ctx->addresses_best,
8164 .apply_expected = true
8168 * mhomed,active vs. unique,active with different ip(s), positive response
8172 .line = __location__,
8173 .name = _NBT_NAME("_MA_UA_DI_P", 0x00, NULL),
8177 .num_ips = ctx->addresses_best_num,
8178 .ips = ctx->addresses_best,
8179 .apply_expected = true
8186 .type = WREPL_TYPE_UNIQUE,
8187 .state = WREPL_STATE_ACTIVE,
8188 .node = WREPL_NODE_B,
8190 .num_ips = ARRAY_SIZE(addresses_B_1),
8191 .ips = addresses_B_1,
8192 .apply_expected = false
8196 * mhomed,active vs. unique,active with different ip(s), positive response other ips
8200 .line = __location__,
8201 .name = _NBT_NAME("_MA_UA_DI_O", 0x00, NULL),
8205 .num_ips = ctx->addresses_best_num,
8206 .ips = ctx->addresses_best,
8207 .apply_expected = true
8212 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8213 .ips = addresses_A_3_4,
8216 .type = WREPL_TYPE_UNIQUE,
8217 .state = WREPL_STATE_ACTIVE,
8218 .node = WREPL_NODE_B,
8220 .num_ips = ARRAY_SIZE(addresses_B_1),
8221 .ips = addresses_B_1,
8222 .apply_expected = false
8226 * mhomed,active vs. unique,active with different ip(s), negative response
8230 .line = __location__,
8231 .name = _NBT_NAME("_MA_UA_DI_N", 0x00, NULL),
8235 .num_ips = ctx->addresses_best_num,
8236 .ips = ctx->addresses_best,
8237 .apply_expected = true
8244 .type = WREPL_TYPE_UNIQUE,
8245 .state = WREPL_STATE_ACTIVE,
8246 .node = WREPL_NODE_B,
8248 .num_ips = ARRAY_SIZE(addresses_B_1),
8249 .ips = addresses_B_1,
8250 .apply_expected = true
8254 * mhomed,active vs. unique,tombstone with same ip(s), unchecked
8258 .line = __location__,
8259 .name = _NBT_NAME("_MA_UT_SI_U", 0x00, NULL),
8263 .num_ips = ctx->addresses_best_num,
8264 .ips = ctx->addresses_best,
8265 .apply_expected = true
8271 .type = WREPL_TYPE_UNIQUE,
8272 .state = WREPL_STATE_TOMBSTONE,
8273 .node = WREPL_NODE_B,
8275 .num_ips = ctx->addresses_best_num,
8276 .ips = ctx->addresses_best,
8277 .apply_expected = false
8281 * mhomed,active vs. unique,tombstone with different ip(s), unchecked
8285 .line = __location__,
8286 .name = _NBT_NAME("_MA_UT_DI_U", 0x00, NULL),
8290 .num_ips = ctx->addresses_best_num,
8291 .ips = ctx->addresses_best,
8292 .apply_expected = true
8298 .type = WREPL_TYPE_UNIQUE,
8299 .state = WREPL_STATE_TOMBSTONE,
8300 .node = WREPL_NODE_B,
8302 .num_ips = ARRAY_SIZE(addresses_B_1),
8303 .ips = addresses_B_1,
8304 .apply_expected = false
8308 * multi homed vs. normal group section
8311 * mhomed,active vs. group,active with same ip(s), release expected
8315 .line = __location__,
8316 .name = _NBT_NAME("_MA_GA_SI_R", 0x00, NULL),
8320 .num_ips = ctx->addresses_best_num,
8321 .ips = ctx->addresses_best,
8322 .apply_expected = true
8326 .expect_release = true,
8329 .type = WREPL_TYPE_GROUP,
8330 .state = WREPL_STATE_ACTIVE,
8331 .node = WREPL_NODE_B,
8333 .num_ips = ctx->addresses_best_num,
8334 .ips = ctx->addresses_best,
8335 .apply_expected = true
8339 * mhomed,active vs. group,active with different ip(s), release expected
8343 .line = __location__,
8344 .name = _NBT_NAME("_MA_GA_DI_R", 0x00, NULL),
8348 .num_ips = ctx->addresses_best_num,
8349 .ips = ctx->addresses_best,
8350 .apply_expected = true
8354 .expect_release = true,
8357 .type = WREPL_TYPE_GROUP,
8358 .state = WREPL_STATE_ACTIVE,
8359 .node = WREPL_NODE_B,
8361 .num_ips = ARRAY_SIZE(addresses_B_1),
8362 .ips = addresses_B_1,
8363 .apply_expected = true
8367 * mhomed,active vs. group,tombstone with same ip(s), unchecked
8371 .line = __location__,
8372 .name = _NBT_NAME("_MA_GT_SI_U", 0x00, NULL),
8376 .num_ips = ctx->addresses_best_num,
8377 .ips = ctx->addresses_best,
8378 .apply_expected = true
8384 .type = WREPL_TYPE_GROUP,
8385 .state = WREPL_STATE_TOMBSTONE,
8386 .node = WREPL_NODE_B,
8388 .num_ips = ctx->addresses_best_num,
8389 .ips = ctx->addresses_best,
8390 .apply_expected = false
8394 * mhomed,active vs. group,tombstone with different ip(s), unchecked
8398 .line = __location__,
8399 .name = _NBT_NAME("_MA_GT_DI_U", 0x00, NULL),
8403 .num_ips = ctx->addresses_best_num,
8404 .ips = ctx->addresses_best,
8405 .apply_expected = true
8411 .type = WREPL_TYPE_GROUP,
8412 .state = WREPL_STATE_TOMBSTONE,
8413 .node = WREPL_NODE_B,
8415 .num_ips = ARRAY_SIZE(addresses_B_1),
8416 .ips = addresses_B_1,
8417 .apply_expected = false
8421 * multi homed vs. special group section
8424 * mhomed,active vs. sgroup,active with same ip(s), release expected
8428 .line = __location__,
8429 .name = _NBT_NAME("_MA_SA_SI_R", 0x00, NULL),
8433 .num_ips = ctx->addresses_best_num,
8434 .ips = ctx->addresses_best,
8435 .apply_expected = true
8439 .expect_release = true,
8442 .type = WREPL_TYPE_SGROUP,
8443 .state = WREPL_STATE_ACTIVE,
8444 .node = WREPL_NODE_B,
8446 .num_ips = ctx->addresses_best_num,
8447 .ips = ctx->addresses_best,
8448 .apply_expected = true
8452 * mhomed,active vs. group,active with different ip(s), release expected
8456 .line = __location__,
8457 .name = _NBT_NAME("_MA_SA_DI_R", 0x00, NULL),
8461 .num_ips = ctx->addresses_best_num,
8462 .ips = ctx->addresses_best,
8463 .apply_expected = true
8467 .expect_release = true,
8470 .type = WREPL_TYPE_SGROUP,
8471 .state = WREPL_STATE_ACTIVE,
8472 .node = WREPL_NODE_B,
8474 .num_ips = ARRAY_SIZE(addresses_B_1),
8475 .ips = addresses_B_1,
8476 .apply_expected = true
8480 * mhomed,active vs. sgroup,tombstone with same ip(s), unchecked
8484 .line = __location__,
8485 .name = _NBT_NAME("_MA_ST_SI_U", 0x00, NULL),
8489 .num_ips = ctx->addresses_best_num,
8490 .ips = ctx->addresses_best,
8491 .apply_expected = true
8497 .type = WREPL_TYPE_SGROUP,
8498 .state = WREPL_STATE_TOMBSTONE,
8499 .node = WREPL_NODE_B,
8501 .num_ips = ctx->addresses_best_num,
8502 .ips = ctx->addresses_best,
8503 .apply_expected = false
8507 * mhomed,active vs. sgroup,tombstone with different ip(s), unchecked
8511 .line = __location__,
8512 .name = _NBT_NAME("_MA_ST_DI_U", 0x00, NULL),
8516 .num_ips = ctx->addresses_best_num,
8517 .ips = ctx->addresses_best,
8518 .apply_expected = true
8524 .type = WREPL_TYPE_SGROUP,
8525 .state = WREPL_STATE_TOMBSTONE,
8526 .node = WREPL_NODE_B,
8528 .num_ips = ARRAY_SIZE(addresses_B_1),
8529 .ips = addresses_B_1,
8530 .apply_expected = false
8534 * multi homed vs. multi homed section
8537 * mhomed,active vs. mhomed,active with same ip(s), unchecked
8541 .line = __location__,
8542 .name = _NBT_NAME("_MA_MA_SI_U", 0x00, NULL),
8546 .num_ips = ctx->addresses_best_num,
8547 .ips = ctx->addresses_best,
8548 .apply_expected = true
8554 .type = WREPL_TYPE_MHOMED,
8555 .state = WREPL_STATE_ACTIVE,
8556 .node = WREPL_NODE_B,
8558 .num_ips = ctx->addresses_best_num,
8559 .ips = ctx->addresses_best,
8560 .apply_expected = true
8564 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8568 .line = __location__,
8569 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8573 .num_ips = ctx->addresses_best_num,
8574 .ips = ctx->addresses_best,
8575 .apply_expected = true
8581 .type = WREPL_TYPE_MHOMED,
8582 .state = WREPL_STATE_ACTIVE,
8583 .node = WREPL_NODE_B,
8585 .num_ips = ctx->addresses_all_num,
8586 .ips = ctx->addresses_all,
8587 .apply_expected = true
8591 * mhomed,active vs. mhomed,active with different ip(s), positive response
8595 .line = __location__,
8596 .name = _NBT_NAME("_MA_MA_DI_P", 0x00, NULL),
8600 .num_ips = ctx->addresses_best_num,
8601 .ips = ctx->addresses_best,
8602 .apply_expected = true
8609 .type = WREPL_TYPE_MHOMED,
8610 .state = WREPL_STATE_ACTIVE,
8611 .node = WREPL_NODE_B,
8613 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8614 .ips = addresses_B_3_4,
8615 .apply_expected = false
8619 * mhomed,active vs. mhomed,active with different ip(s), positive response other ips
8623 .line = __location__,
8624 .name = _NBT_NAME("_MA_MA_DI_O", 0x00, NULL),
8628 .num_ips = ctx->addresses_best_num,
8629 .ips = ctx->addresses_best,
8630 .apply_expected = true
8635 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8636 .ips = addresses_A_3_4,
8639 .type = WREPL_TYPE_MHOMED,
8640 .state = WREPL_STATE_ACTIVE,
8641 .node = WREPL_NODE_B,
8643 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8644 .ips = addresses_B_3_4,
8645 .apply_expected = false
8649 * mhomed,active vs. mhomed,active with different ip(s), negative response
8653 .line = __location__,
8654 .name = _NBT_NAME("_MA_MA_DI_N", 0x00, NULL),
8658 .num_ips = ctx->addresses_best_num,
8659 .ips = ctx->addresses_best,
8660 .apply_expected = true
8667 .type = WREPL_TYPE_MHOMED,
8668 .state = WREPL_STATE_ACTIVE,
8669 .node = WREPL_NODE_B,
8671 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8672 .ips = addresses_B_3_4,
8673 .apply_expected = true
8677 * mhomed,active vs. mhomed,tombstone with same ip(s), unchecked
8681 .line = __location__,
8682 .name = _NBT_NAME("_MA_MT_SI_U", 0x00, NULL),
8686 .num_ips = ctx->addresses_best_num,
8687 .ips = ctx->addresses_best,
8688 .apply_expected = true
8694 .type = WREPL_TYPE_MHOMED,
8695 .state = WREPL_STATE_TOMBSTONE,
8696 .node = WREPL_NODE_B,
8698 .num_ips = ctx->addresses_best_num,
8699 .ips = ctx->addresses_best,
8700 .apply_expected = false
8704 * mhomed,active vs. mhomed,tombstone with different ip(s), unchecked
8708 .line = __location__,
8709 .name = _NBT_NAME("_MA_MT_DI_U", 0x00, NULL),
8713 .num_ips = ctx->addresses_best_num,
8714 .ips = ctx->addresses_best,
8715 .apply_expected = true
8721 .type = WREPL_TYPE_MHOMED,
8722 .state = WREPL_STATE_TOMBSTONE,
8723 .node = WREPL_NODE_B,
8725 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8726 .ips = addresses_B_3_4,
8727 .apply_expected = false
8731 * some more multi homed test, including merging
8734 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8738 .line = __location__,
8739 .section= "Test Replica vs. owned active: some more MHOMED combinations",
8740 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8741 .comment= "C:MHOMED vs. B:ALL => B:ALL",
8742 .skip = (ctx->addresses_all_num < 3),
8746 .num_ips = ctx->addresses_mhomed_num,
8747 .ips = ctx->addresses_mhomed,
8748 .apply_expected = true
8754 .type = WREPL_TYPE_MHOMED,
8755 .state = WREPL_STATE_ACTIVE,
8756 .node = WREPL_NODE_B,
8758 .num_ips = ctx->addresses_all_num,
8759 .ips = ctx->addresses_all,
8760 .apply_expected = true
8764 * mhomed,active vs. mhomed,active with same ips, unchecked
8768 .line = __location__,
8769 .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL),
8770 .comment= "C:MHOMED vs. B:MHOMED => B:MHOMED",
8771 .skip = (ctx->addresses_mhomed_num < 2),
8775 .num_ips = ctx->addresses_mhomed_num,
8776 .ips = ctx->addresses_mhomed,
8777 .apply_expected = true
8783 .type = WREPL_TYPE_MHOMED,
8784 .state = WREPL_STATE_ACTIVE,
8785 .node = WREPL_NODE_B,
8787 .num_ips = ctx->addresses_mhomed_num,
8788 .ips = ctx->addresses_mhomed,
8789 .apply_expected = true
8793 * mhomed,active vs. mhomed,active with subset ip(s), positive response
8797 .line = __location__,
8798 .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL),
8799 .comment= "C:MHOMED vs. B:BEST (C:MHOMED) => B:MHOMED",
8800 .skip = (ctx->addresses_mhomed_num < 2),
8804 .num_ips = ctx->addresses_mhomed_num,
8805 .ips = ctx->addresses_mhomed,
8806 .apply_expected = true
8813 .type = WREPL_TYPE_MHOMED,
8814 .state = WREPL_STATE_ACTIVE,
8815 .node = WREPL_NODE_B,
8817 .num_ips = ctx->addresses_best_num,
8818 .ips = ctx->addresses_best,
8819 .mhomed_merge = true
8823 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with all addresses
8827 .line = __location__,
8828 .name = _NBT_NAME("_MA_MA_SB_A", 0x00, NULL),
8829 .comment= "C:MHOMED vs. B:BEST (C:ALL) => B:MHOMED",
8830 .skip = (ctx->addresses_all_num < 3),
8834 .num_ips = ctx->addresses_mhomed_num,
8835 .ips = ctx->addresses_mhomed,
8836 .apply_expected = true
8841 .num_ips = ctx->addresses_all_num,
8842 .ips = ctx->addresses_all,
8845 .type = WREPL_TYPE_MHOMED,
8846 .state = WREPL_STATE_ACTIVE,
8847 .node = WREPL_NODE_B,
8849 .num_ips = ctx->addresses_best_num,
8850 .ips = ctx->addresses_best,
8851 .mhomed_merge = true
8855 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with replicas addresses
8856 * TODO: check why the server sends a name release demand for one address?
8857 * the release demand has no effect to the database record...
8861 .line = __location__,
8862 .name = _NBT_NAME("_MA_MA_SB_PRA", 0x00, NULL),
8863 .comment= "C:MHOMED vs. B:BEST (C:BEST) => C:MHOMED",
8864 .skip = (ctx->addresses_all_num < 2),
8868 .num_ips = ctx->addresses_mhomed_num,
8869 .ips = ctx->addresses_mhomed,
8870 .apply_expected = true
8875 .num_ips = ctx->addresses_best_num,
8876 .ips = ctx->addresses_best,
8877 .late_release = true
8880 .type = WREPL_TYPE_MHOMED,
8881 .state = WREPL_STATE_ACTIVE,
8882 .node = WREPL_NODE_B,
8884 .num_ips = ctx->addresses_best_num,
8885 .ips = ctx->addresses_best,
8886 .apply_expected = false
8890 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with other addresses
8894 .line = __location__,
8895 .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL),
8896 .comment= "C:MHOMED vs. B:BEST (B:B_3_4) =>C:MHOMED",
8897 .skip = (ctx->addresses_all_num < 2),
8901 .num_ips = ctx->addresses_mhomed_num,
8902 .ips = ctx->addresses_mhomed,
8903 .apply_expected = true
8908 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8909 .ips = addresses_B_3_4,
8912 .type = WREPL_TYPE_MHOMED,
8913 .state = WREPL_STATE_ACTIVE,
8914 .node = WREPL_NODE_B,
8916 .num_ips = ctx->addresses_best_num,
8917 .ips = ctx->addresses_best,
8918 .apply_expected = false
8922 * mhomed,active vs. mhomed,active with subset ip(s), negative response
8926 .line = __location__,
8927 .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL),
8928 .comment= "C:MHOMED vs. B:BEST (NEGATIVE) => B:BEST",
8929 .skip = (ctx->addresses_mhomed_num < 2),
8933 .num_ips = ctx->addresses_mhomed_num,
8934 .ips = ctx->addresses_mhomed,
8935 .apply_expected = true
8942 .type = WREPL_TYPE_MHOMED,
8943 .state = WREPL_STATE_ACTIVE,
8944 .node = WREPL_NODE_B,
8946 .num_ips = ctx->addresses_best_num,
8947 .ips = ctx->addresses_best,
8948 .apply_expected = true
8952 * some more multi homed and unique test, including merging
8955 * mhomed,active vs. unique,active with subset ip(s), positive response
8959 .line = __location__,
8960 .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations",
8961 .name = _NBT_NAME("_MA_UA_SB_P", 0x00, NULL),
8962 .comment= "C:MHOMED vs. B:UNIQUE,BEST (C:MHOMED) => B:MHOMED",
8963 .skip = (ctx->addresses_all_num < 2),
8967 .num_ips = ctx->addresses_mhomed_num,
8968 .ips = ctx->addresses_mhomed,
8969 .apply_expected = true
8976 .type = WREPL_TYPE_UNIQUE,
8977 .state = WREPL_STATE_ACTIVE,
8978 .node = WREPL_NODE_B,
8980 .num_ips = ctx->addresses_best_num,
8981 .ips = ctx->addresses_best,
8982 .mhomed_merge = true
8986 * unique,active vs. unique,active with different ip(s), positive response, with replicas address
8987 * TODO: check why the server sends a name release demand for one address?
8988 * the release demand has no effect to the database record...
8992 .line = __location__,
8993 .name = _NBT_NAME("_UA_UA_DI_PRA", 0x00, NULL),
8994 .comment= "C:BEST vs. B:BEST2 (C:BEST2,LR:BEST2) => C:BEST",
8995 .skip = (ctx->addresses_all_num < 2),
8999 .num_ips = ctx->addresses_best_num,
9000 .ips = ctx->addresses_best,
9001 .apply_expected = true
9006 .num_ips = ctx->addresses_best2_num,
9007 .ips = ctx->addresses_best2,
9008 .late_release = true
9011 .type = WREPL_TYPE_UNIQUE,
9012 .state = WREPL_STATE_ACTIVE,
9013 .node = WREPL_NODE_B,
9015 .num_ips = ctx->addresses_best2_num,
9016 .ips = ctx->addresses_best2,
9017 .apply_expected = false,
9021 * unique,active vs. unique,active with different ip(s), positive response, with all addresses
9025 .line = __location__,
9026 .name = _NBT_NAME("_UA_UA_DI_A", 0x00, NULL),
9027 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
9028 .skip = (ctx->addresses_all_num < 3),
9032 .num_ips = ctx->addresses_best_num,
9033 .ips = ctx->addresses_best,
9034 .apply_expected = true
9039 .num_ips = ctx->addresses_all_num,
9040 .ips = ctx->addresses_all,
9043 .type = WREPL_TYPE_UNIQUE,
9044 .state = WREPL_STATE_ACTIVE,
9045 .node = WREPL_NODE_B,
9047 .num_ips = ctx->addresses_best2_num,
9048 .ips = ctx->addresses_best2,
9049 .mhomed_merge = true,
9053 * unique,active vs. mhomed,active with different ip(s), positive response, with all addresses
9057 .line = __location__,
9058 .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL),
9059 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
9060 .skip = (ctx->addresses_all_num < 3),
9064 .num_ips = ctx->addresses_best_num,
9065 .ips = ctx->addresses_best,
9066 .apply_expected = true
9071 .num_ips = ctx->addresses_all_num,
9072 .ips = ctx->addresses_all,
9075 .type = WREPL_TYPE_MHOMED,
9076 .state = WREPL_STATE_ACTIVE,
9077 .node = WREPL_NODE_B,
9079 .num_ips = ctx->addresses_best2_num,
9080 .ips = ctx->addresses_best2,
9081 .mhomed_merge = true,
9085 * special group vs. special group merging section
9088 * sgroup,active vs. sgroup,active with different ip(s)
9092 .line = __location__,
9093 .section= "Test Replica vs. owned active: SGROUP vs. SGROUP tests",
9094 .name = _NBT_NAME("_SA_SA_DI_U", 0x1C, NULL),
9095 .skip = (ctx->addresses_all_num < 3),
9097 .nb_flags = NBT_NM_GROUP,
9099 .num_ips = ctx->addresses_mhomed_num,
9100 .ips = ctx->addresses_mhomed,
9101 .apply_expected = true
9107 .type = WREPL_TYPE_SGROUP,
9108 .state = WREPL_STATE_ACTIVE,
9109 .node = WREPL_NODE_B,
9111 .num_ips = ARRAY_SIZE(addresses_B_3_4),
9112 .ips = addresses_B_3_4,
9113 .sgroup_merge = true
9117 * sgroup,active vs. sgroup,active with same ip(s)
9121 .line = __location__,
9122 .name = _NBT_NAME("_SA_SA_SI_U", 0x1C, NULL),
9123 .skip = (ctx->addresses_all_num < 3),
9125 .nb_flags = NBT_NM_GROUP,
9127 .num_ips = ctx->addresses_mhomed_num,
9128 .ips = ctx->addresses_mhomed,
9129 .apply_expected = true
9135 .type = WREPL_TYPE_SGROUP,
9136 .state = WREPL_STATE_ACTIVE,
9137 .node = WREPL_NODE_B,
9139 .num_ips = ctx->addresses_mhomed_num,
9140 .ips = ctx->addresses_mhomed,
9141 .sgroup_merge = true
9145 * sgroup,active vs. sgroup,active with superset ip(s)
9149 .line = __location__,
9150 .name = _NBT_NAME("_SA_SA_SP_U", 0x1C, NULL),
9151 .skip = (ctx->addresses_all_num < 3),
9153 .nb_flags = NBT_NM_GROUP,
9155 .num_ips = ctx->addresses_mhomed_num,
9156 .ips = ctx->addresses_mhomed,
9157 .apply_expected = true
9163 .type = WREPL_TYPE_SGROUP,
9164 .state = WREPL_STATE_ACTIVE,
9165 .node = WREPL_NODE_B,
9167 .num_ips = ctx->addresses_all_num,
9168 .ips = ctx->addresses_all,
9169 .sgroup_merge = true
9173 * sgroup,active vs. sgroup,active with subset ip(s)
9177 .line = __location__,
9178 .name = _NBT_NAME("_SA_SA_SB_U", 0x1C, NULL),
9179 .skip = (ctx->addresses_all_num < 3),
9181 .nb_flags = NBT_NM_GROUP,
9183 .num_ips = ctx->addresses_mhomed_num,
9184 .ips = ctx->addresses_mhomed,
9185 .apply_expected = true
9191 .type = WREPL_TYPE_SGROUP,
9192 .state = WREPL_STATE_ACTIVE,
9193 .node = WREPL_NODE_B,
9195 .num_ips = ctx->addresses_best_num,
9196 .ips = ctx->addresses_best,
9197 .sgroup_merge = true
9201 * sgroup,active vs. sgroup,tombstone with different ip(s)
9205 .line = __location__,
9206 .name = _NBT_NAME("_SA_ST_DI_U", 0x1C, NULL),
9207 .skip = (ctx->addresses_all_num < 3),
9209 .nb_flags = NBT_NM_GROUP,
9211 .num_ips = ctx->addresses_mhomed_num,
9212 .ips = ctx->addresses_mhomed,
9213 .apply_expected = true
9219 .type = WREPL_TYPE_SGROUP,
9220 .state = WREPL_STATE_TOMBSTONE,
9221 .node = WREPL_NODE_B,
9223 .num_ips = ARRAY_SIZE(addresses_B_3_4),
9224 .ips = addresses_B_3_4,
9225 .apply_expected = false
9229 * sgroup,active vs. sgroup,tombstone with same ip(s)
9233 .line = __location__,
9234 .name = _NBT_NAME("_SA_ST_SI_U", 0x1C, NULL),
9235 .skip = (ctx->addresses_all_num < 3),
9237 .nb_flags = NBT_NM_GROUP,
9239 .num_ips = ctx->addresses_mhomed_num,
9240 .ips = ctx->addresses_mhomed,
9241 .apply_expected = true
9247 .type = WREPL_TYPE_SGROUP,
9248 .state = WREPL_STATE_TOMBSTONE,
9249 .node = WREPL_NODE_B,
9251 .num_ips = ctx->addresses_mhomed_num,
9252 .ips = ctx->addresses_mhomed,
9253 .apply_expected = false
9257 * sgroup,active vs. sgroup,tombstone with superset ip(s)
9261 .line = __location__,
9262 .name = _NBT_NAME("_SA_ST_SP_U", 0x1C, NULL),
9263 .skip = (ctx->addresses_all_num < 3),
9265 .nb_flags = NBT_NM_GROUP,
9267 .num_ips = ctx->addresses_mhomed_num,
9268 .ips = ctx->addresses_mhomed,
9269 .apply_expected = true
9275 .type = WREPL_TYPE_SGROUP,
9276 .state = WREPL_STATE_TOMBSTONE,
9277 .node = WREPL_NODE_B,
9279 .num_ips = ctx->addresses_all_num,
9280 .ips = ctx->addresses_all,
9281 .apply_expected = false
9285 * sgroup,active vs. sgroup,tombstone with subset ip(s)
9289 .line = __location__,
9290 .name = _NBT_NAME("_SA_ST_SB_U", 0x1C, NULL),
9291 .skip = (ctx->addresses_all_num < 3),
9293 .nb_flags = NBT_NM_GROUP,
9295 .num_ips = ctx->addresses_mhomed_num,
9296 .ips = ctx->addresses_mhomed,
9297 .apply_expected = true
9303 .type = WREPL_TYPE_SGROUP,
9304 .state = WREPL_STATE_TOMBSTONE,
9305 .node = WREPL_NODE_B,
9307 .num_ips = ctx->addresses_best_num,
9308 .ips = ctx->addresses_best,
9309 .apply_expected = false
9314 if (!ctx->nbtsock_srv) {
9315 torture_comment(tctx, "SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
9316 lpcfg_nbt_port(tctx->lp_ctx));
9320 torture_comment(tctx, "Test Replica records vs. owned active records\n");
9322 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
9324 struct test_conflict_owned_active_vs_replica_struct record = records[i];
9325 uint32_t j, count = 1;
9328 if (records[i].wins.mhomed || records[i].name.type == 0x1C) {
9329 count = records[i].wins.num_ips;
9332 if (records[i].section) {
9333 torture_comment(tctx, "%s\n", records[i].section);
9336 if (records[i].skip) {
9337 torture_comment(tctx, "%s => SKIPPED\n", nbt_name_string(ctx, &records[i].name));
9341 if (records[i].replica.mhomed_merge) {
9342 action = "MHOMED_MERGE";
9343 } else if (records[i].replica.sgroup_merge) {
9344 action = "SGROUP_MERGE";
9345 } else if (records[i].replica.apply_expected) {
9348 action = "NOT REPLACE";
9351 torture_comment(tctx, "%s%s%s => %s\n",
9352 nbt_name_string(ctx, &records[i].name),
9353 (records[i].comment?": ":""),
9354 (records[i].comment?records[i].comment:""),
9357 /* Prepare for multi homed registration */
9358 ZERO_STRUCT(records[i].defend);
9359 records[i].defend.timeout = 10;
9360 records[i].defend.positive = true;
9361 nbt_set_incoming_handler(ctx->nbtsock_srv,
9362 test_conflict_owned_active_vs_replica_handler,
9364 if (ctx->nbtsock_srv2) {
9365 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9366 test_conflict_owned_active_vs_replica_handler,
9373 for (j=0; j < count; j++) {
9374 struct nbt_name_request *req;
9376 name_register->in.name = records[i].name;
9377 name_register->in.dest_addr = ctx->address;
9378 name_register->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
9379 name_register->in.address = records[i].wins.ips[j].ip;
9380 name_register->in.nb_flags = records[i].wins.nb_flags;
9381 name_register->in.register_demand= false;
9382 name_register->in.broadcast = false;
9383 name_register->in.multi_homed = records[i].wins.mhomed;
9384 name_register->in.ttl = 300000;
9385 name_register->in.timeout = 70;
9386 name_register->in.retries = 0;
9388 req = nbt_name_register_send(ctx->nbtsock, name_register);
9390 /* push the request on the wire */
9391 tevent_loop_once(ctx->nbtsock->event_ctx);
9394 * if we register multiple addresses,
9395 * the server will do name queries to see if the old addresses
9398 if (records[i].wins.mhomed && j > 0) {
9399 end = timeval_current_ofs(records[i].defend.timeout,0);
9400 records[i].defend.ret = true;
9401 while (records[i].defend.timeout > 0) {
9402 tevent_loop_once(ctx->nbtsock_srv->event_ctx);
9403 if (timeval_expired(&end)) break;
9405 ret &= records[i].defend.ret;
9408 status = nbt_name_register_recv(req, ctx, name_register);
9409 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9410 torture_comment(tctx, "No response from %s for name register\n", ctx->address);
9413 if (!NT_STATUS_IS_OK(status)) {
9414 torture_comment(tctx, "Bad response from %s for name register - %s\n",
9415 ctx->address, nt_errstr(status));
9418 CHECK_VALUE(tctx, name_register->out.rcode, 0);
9419 CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address);
9420 CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type);
9421 CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name);
9422 CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope);
9423 CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[j].ip);
9426 /* Prepare for the current test */
9427 records[i].defend = record.defend;
9428 nbt_set_incoming_handler(ctx->nbtsock_srv,
9429 test_conflict_owned_active_vs_replica_handler,
9431 if (ctx->nbtsock_srv2) {
9432 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9433 test_conflict_owned_active_vs_replica_handler,
9440 wins_name->name = &records[i].name;
9441 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
9442 records[i].replica.state,
9443 records[i].replica.node,
9444 records[i].replica.is_static);
9445 wins_name->id = ++ctx->b.max_version;
9446 if (wins_name->flags & 2) {
9447 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
9448 wins_name->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
9449 records[i].replica.ips);
9451 wins_name->addresses.ip = records[i].replica.ips[0].ip;
9453 wins_name->unknown = "255.255.255.255";
9455 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9458 * wait for the name query, which is handled in
9459 * test_conflict_owned_active_vs_replica_handler()
9461 end = timeval_current_ofs(records[i].defend.timeout,0);
9462 records[i].defend.ret = true;
9463 while (records[i].defend.timeout > 0) {
9464 tevent_loop_once(ctx->nbtsock_srv->event_ctx);
9465 if (timeval_expired(&end)) break;
9467 ret &= records[i].defend.ret;
9469 if (records[i].defend.late_release) {
9470 records[i].defend = record.defend;
9471 records[i].defend.expect_release = true;
9473 * wait for the name release demand, which is handled in
9474 * test_conflict_owned_active_vs_replica_handler()
9476 end = timeval_current_ofs(records[i].defend.timeout,0);
9477 records[i].defend.ret = true;
9478 while (records[i].defend.timeout > 0) {
9479 tevent_loop_once(ctx->nbtsock_srv->event_ctx);
9480 if (timeval_expired(&end)) break;
9482 ret &= records[i].defend.ret;
9485 if (records[i].replica.mhomed_merge) {
9486 ret &= test_wrepl_mhomed_merged(tctx, ctx, &ctx->c,
9487 records[i].wins.num_ips, records[i].wins.ips,
9489 records[i].replica.num_ips, records[i].replica.ips,
9491 } else if (records[i].replica.sgroup_merge) {
9492 ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL,
9494 records[i].wins.num_ips, records[i].wins.ips,
9496 records[i].replica.num_ips, records[i].replica.ips,
9499 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name,
9500 records[i].replica.apply_expected);
9503 if (records[i].replica.apply_expected ||
9504 records[i].replica.mhomed_merge) {
9505 wins_name->name = &records[i].name;
9506 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9507 WREPL_STATE_TOMBSTONE,
9508 WREPL_NODE_B, false);
9509 wins_name->id = ++ctx->b.max_version;
9510 wins_name->addresses.ip = addresses_B_1[0].ip;
9511 wins_name->unknown = "255.255.255.255";
9513 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9514 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9516 for (j=0; j < count; j++) {
9517 struct nbt_name_socket *nbtsock = ctx->nbtsock;
9519 if (ctx->myaddr2 && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2->addr) == 0) {
9520 nbtsock = ctx->nbtsock2;
9523 release->in.name = records[i].name;
9524 release->in.dest_addr = ctx->address;
9525 release->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
9526 release->in.address = records[i].wins.ips[j].ip;
9527 release->in.nb_flags = records[i].wins.nb_flags;
9528 release->in.broadcast = false;
9529 release->in.timeout = 30;
9530 release->in.retries = 0;
9532 status = nbt_name_release(nbtsock, ctx, release);
9533 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9534 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
9537 if (!NT_STATUS_IS_OK(status)) {
9538 torture_comment(tctx, "Bad response from %s for name query - %s\n",
9539 ctx->address, nt_errstr(status));
9542 CHECK_VALUE(tctx, release->out.rcode, 0);
9545 if (records[i].replica.sgroup_merge) {
9546 /* clean up the SGROUP record */
9547 wins_name->name = &records[i].name;
9548 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9550 WREPL_NODE_B, false);
9551 wins_name->id = ++ctx->b.max_version;
9552 wins_name->addresses.addresses.num_ips = 0;
9553 wins_name->addresses.addresses.ips = NULL;
9554 wins_name->unknown = "255.255.255.255";
9555 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9557 /* take ownership of the SGROUP record */
9558 wins_name->name = &records[i].name;
9559 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9561 WREPL_NODE_B, false);
9562 wins_name->id = ++ctx->b.max_version;
9563 wins_name->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
9564 wins_name->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
9566 wins_name->unknown = "255.255.255.255";
9567 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9568 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9570 /* overwrite the SGROUP record with unique,tombstone */
9571 wins_name->name = &records[i].name;
9572 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9573 WREPL_STATE_TOMBSTONE,
9574 WREPL_NODE_B, false);
9575 wins_name->id = ++ctx->b.max_version;
9576 wins_name->addresses.ip = addresses_A_1[0].ip;
9577 wins_name->unknown = "255.255.255.255";
9578 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9579 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9584 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
9592 #define __NBT_LABEL_CAT1__(a,b) a##b
9593 #define __NBT_LABEL_CAT2__(a,b) __NBT_LABEL_CAT1__(a,b)
9594 #define _NBT_LABEL __NBT_LABEL_CAT2__(_label_, __LINE__)
9596 #define _NBT_ASSERT(v, correct) do { \
9598 torture_assert_int_equal_goto(rec->tctx, v, correct, \
9599 _ret, _NBT_LABEL, "Invalid int value"); \
9606 #define _NBT_ASSERT_STRING(v, correct) do { \
9608 torture_assert_str_equal_goto(rec->tctx, v, correct, \
9609 _ret, _NBT_LABEL, "Invalid string value"); \
9616 static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
9617 struct nbt_name_packet *req_packet,
9618 struct socket_address *src)
9620 struct nbt_name *name;
9621 struct nbt_name_packet *rep_packet;
9622 struct test_conflict_owned_active_vs_replica_struct *rec =
9623 (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
9625 _NBT_ASSERT(req_packet->qdcount, 1);
9626 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9627 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9629 name = &req_packet->questions[0].name;
9631 _NBT_ASSERT_STRING(name->name, rec->name.name);
9632 _NBT_ASSERT(name->type, rec->name.type);
9633 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9635 _NBT_ASSERT(rec->defend.expect_release, false);
9637 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9638 if (rep_packet == NULL) return;
9640 rep_packet->name_trn_id = req_packet->name_trn_id;
9641 rep_packet->ancount = 1;
9643 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9644 if (rep_packet->answers == NULL) return;
9646 rep_packet->answers[0].name = *name;
9647 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9648 rep_packet->answers[0].ttl = 0;
9650 if (rec->defend.positive) {
9651 uint32_t i, num_ips;
9652 const struct wrepl_ip *ips;
9654 if (rec->defend.num_ips > 0) {
9655 num_ips = rec->defend.num_ips;
9656 ips = rec->defend.ips;
9658 num_ips = rec->wins.num_ips;
9659 ips = rec->wins.ips;
9662 /* send a positive reply */
9663 rep_packet->operation =
9666 NBT_FLAG_AUTHORITATIVE |
9667 NBT_FLAG_RECURSION_DESIRED |
9668 NBT_FLAG_RECURSION_AVAIL;
9670 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9672 rep_packet->answers[0].rdata.netbios.length = num_ips*6;
9673 rep_packet->answers[0].rdata.netbios.addresses =
9674 talloc_array(rep_packet->answers, struct nbt_rdata_address, num_ips);
9675 if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return;
9677 for (i=0; i < num_ips; i++) {
9678 struct nbt_rdata_address *addr =
9679 &rep_packet->answers[0].rdata.netbios.addresses[i];
9680 addr->nb_flags = rec->wins.nb_flags;
9681 addr->ipaddr = ips[i].ip;
9683 DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
9684 nbt_name_string(rep_packet, name), src->addr, src->port));
9686 /* send a negative reply */
9687 rep_packet->operation =
9690 NBT_FLAG_AUTHORITATIVE |
9693 rep_packet->answers[0].rr_type = NBT_QTYPE_NULL;
9695 ZERO_STRUCT(rep_packet->answers[0].rdata);
9697 DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
9698 nbt_name_string(rep_packet, name), src->addr, src->port));
9701 nbt_name_reply_send(nbtsock, src, rep_packet);
9702 talloc_free(rep_packet);
9704 /* make sure we push the reply to the wire */
9705 while (nbtsock->send_queue) {
9706 tevent_loop_once(nbtsock->event_ctx);
9710 rec->defend.timeout = 0;
9711 rec->defend.ret = true;
9714 static void test_conflict_owned_active_vs_replica_handler_release(
9715 struct nbt_name_socket *nbtsock,
9716 struct nbt_name_packet *req_packet,
9717 struct socket_address *src)
9719 struct nbt_name *name;
9720 struct nbt_name_packet *rep_packet;
9721 struct test_conflict_owned_active_vs_replica_struct *rec =
9722 (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
9724 _NBT_ASSERT(req_packet->qdcount, 1);
9725 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9726 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9728 name = &req_packet->questions[0].name;
9730 _NBT_ASSERT_STRING(name->name, rec->name.name);
9731 _NBT_ASSERT(name->type, rec->name.type);
9732 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9734 _NBT_ASSERT(rec->defend.expect_release, true);
9736 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9737 if (rep_packet == NULL) return;
9739 rep_packet->name_trn_id = req_packet->name_trn_id;
9740 rep_packet->ancount = 1;
9741 rep_packet->operation =
9743 NBT_OPCODE_RELEASE |
9744 NBT_FLAG_AUTHORITATIVE;
9746 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9747 if (rep_packet->answers == NULL) return;
9749 rep_packet->answers[0].name = *name;
9750 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9751 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9752 rep_packet->answers[0].ttl = req_packet->additional[0].ttl;
9753 rep_packet->answers[0].rdata = req_packet->additional[0].rdata;
9755 DEBUG(2,("Sending name release reply for %s to %s:%d\n",
9756 nbt_name_string(rep_packet, name), src->addr, src->port));
9758 nbt_name_reply_send(nbtsock, src, rep_packet);
9759 talloc_free(rep_packet);
9761 /* make sure we push the reply to the wire */
9762 while (nbtsock->send_queue) {
9763 tevent_loop_once(nbtsock->event_ctx);
9767 rec->defend.timeout = 0;
9768 rec->defend.ret = true;
9771 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
9772 struct nbt_name_packet *req_packet,
9773 struct socket_address *src)
9775 struct test_conflict_owned_active_vs_replica_struct *rec =
9776 (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
9777 struct nbt_name *name = &req_packet->questions[0].name;
9779 if (req_packet->operation & NBT_FLAG_BROADCAST) {
9780 torture_comment(rec->tctx,
9781 "%s: incoming packet name[%s] flags[0x%08X] from[%s]\n",
9783 nbt_name_string(rec->tctx, name),
9784 req_packet->operation,
9789 rec->defend.ret = false;
9791 switch (req_packet->operation & NBT_OPCODE) {
9792 case NBT_OPCODE_QUERY:
9793 test_conflict_owned_active_vs_replica_handler_query(nbtsock, req_packet, src);
9795 case NBT_OPCODE_RELEASE:
9796 test_conflict_owned_active_vs_replica_handler_release(nbtsock, req_packet, src);
9799 torture_comment(rec->tctx,
9800 "%s: unexpected packet name[%s] flags[0x%08X] from[%s]\n",
9802 nbt_name_string(rec->tctx, name),
9803 req_packet->operation,
9805 _NBT_ASSERT((req_packet->operation & NBT_OPCODE), NBT_OPCODE_QUERY);
9811 test WINS replication replica conflicts operations
9813 static bool torture_nbt_winsreplication_replica(struct torture_context *tctx)
9816 struct test_wrepl_conflict_conn *ctx;
9818 const char *address;
9819 struct nbt_name name;
9821 if (!torture_nbt_get_name(tctx, &name, &address))
9824 ctx = test_create_conflict_ctx(tctx, address);
9825 if (!ctx) return false;
9827 ret &= test_conflict_same_owner(tctx, ctx);
9828 ret &= test_conflict_different_owner(tctx, ctx);
9834 test WINS replication owned conflicts operations
9836 static bool torture_nbt_winsreplication_owned(struct torture_context *tctx)
9838 const char *address;
9839 struct nbt_name name;
9841 struct test_wrepl_conflict_conn *ctx;
9843 if (torture_setting_bool(tctx, "quick", false))
9845 "skip NBT-WINSREPLICATION-OWNED test in quick test mode\n");
9847 if (!torture_nbt_get_name(tctx, &name, &address))
9850 ctx = test_create_conflict_ctx(tctx, address);
9851 torture_assert(tctx, ctx != NULL, "Creating context failed");
9853 ret &= test_conflict_owned_released_vs_replica(tctx, ctx);
9854 ret &= test_conflict_owned_active_vs_replica(tctx, ctx);
9860 test simple WINS replication operations
9862 struct torture_suite *torture_nbt_winsreplication(TALLOC_CTX *mem_ctx)
9864 struct torture_suite *suite = torture_suite_create(
9865 mem_ctx, "winsreplication");
9866 struct torture_tcase *tcase;
9868 tcase = torture_suite_add_simple_test(suite, "assoc_ctx1",
9870 tcase->tests->dangerous = true;
9872 torture_suite_add_simple_test(suite, "assoc_ctx2", test_assoc_ctx2);
9874 torture_suite_add_simple_test(suite, "wins_replication",
9875 test_wins_replication);
9877 torture_suite_add_simple_test(suite, "replica",
9878 torture_nbt_winsreplication_replica);
9880 torture_suite_add_simple_test(suite, "owned",
9881 torture_nbt_winsreplication_owned);