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 2 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, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include "libcli/wrepl/winsrepl.h"
26 #include "lib/events/events.h"
27 #include "lib/socket/socket.h"
28 #include "libcli/resolve/resolve.h"
29 #include "system/network.h"
30 #include "lib/socket/netif.h"
31 #include "librpc/gen_ndr/ndr_nbt.h"
32 #include "torture/torture.h"
33 #include "torture/nbt/proto.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 wrepl_request *req;
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_pull_table pull_table;
93 struct wrepl_packet packet;
94 struct wrepl_send_ctrl ctrl;
95 struct wrepl_packet *rep_packet;
96 struct wrepl_associate_stop assoc_stop;
101 if (!torture_setting_bool(tctx, "dangerous", false)) {
102 torture_skip(tctx, "winsrepl: cross connection assoc_ctx usage disabled - enable dangerous tests to use");
105 if (!torture_nbt_get_name(tctx, &name, &address))
108 torture_comment(tctx, "Test if assoc_ctx is only valid on the conection it was created on\n");
110 wrepl_socket1 = wrepl_socket_init(tctx, NULL);
111 wrepl_socket2 = wrepl_socket_init(tctx, NULL);
113 torture_comment(tctx, "Setup 2 wrepl connections\n");
114 status = wrepl_connect(wrepl_socket1, NULL, address);
115 CHECK_STATUS(tctx, status, NT_STATUS_OK);
117 status = wrepl_connect(wrepl_socket2, NULL, address);
118 CHECK_STATUS(tctx, status, NT_STATUS_OK);
120 torture_comment(tctx, "Send a start association request (conn1)\n");
121 status = wrepl_associate(wrepl_socket1, &associate1);
122 CHECK_STATUS(tctx, status, NT_STATUS_OK);
124 torture_comment(tctx, "association context (conn1): 0x%x\n", associate1.out.assoc_ctx);
126 torture_comment(tctx, "Send a start association request (conn2)\n");
127 status = wrepl_associate(wrepl_socket2, &associate2);
128 CHECK_STATUS(tctx, status, NT_STATUS_OK);
130 torture_comment(tctx, "association context (conn2): 0x%x\n", associate2.out.assoc_ctx);
132 torture_comment(tctx, "Send a replication table query, with assoc 1 (conn2), the anwser should be on conn1\n");
134 packet.opcode = WREPL_OPCODE_BITS;
135 packet.assoc_ctx = associate1.out.assoc_ctx;
136 packet.mess_type = WREPL_REPLICATION;
137 packet.message.replication.command = WREPL_REPL_TABLE_QUERY;
139 ctrl.send_only = true;
140 req = wrepl_request_send(wrepl_socket2, &packet, &ctrl);
141 status = wrepl_request_recv(req, tctx, &rep_packet);
142 CHECK_STATUS(tctx, status, NT_STATUS_OK);
144 torture_comment(tctx, "Send a association request (conn2), to make sure the last request was ignored\n");
145 status = wrepl_associate(wrepl_socket2, &associate2);
146 CHECK_STATUS(tctx, status, NT_STATUS_OK);
148 torture_comment(tctx, "Send a replication table query, with invalid assoc (conn1), receive answer from conn2\n");
149 pull_table.in.assoc_ctx = 0;
150 req = wrepl_pull_table_send(wrepl_socket1, &pull_table);
151 status = wrepl_request_recv(req, tctx, &rep_packet);
152 CHECK_STATUS(tctx, status, NT_STATUS_OK);
154 torture_comment(tctx, "Send a association request (conn1), to make sure the last request was handled correct\n");
155 status = wrepl_associate(wrepl_socket1, &associate2);
156 CHECK_STATUS(tctx, status, NT_STATUS_OK);
158 assoc_stop.in.assoc_ctx = associate1.out.assoc_ctx;
159 assoc_stop.in.reason = 4;
160 torture_comment(tctx, "Send a association stop request (conn1), reson: %u\n", assoc_stop.in.reason);
161 status = wrepl_associate_stop(wrepl_socket1, &assoc_stop);
162 CHECK_STATUS(tctx, status, NT_STATUS_END_OF_FILE);
164 assoc_stop.in.assoc_ctx = associate2.out.assoc_ctx;
165 assoc_stop.in.reason = 0;
166 torture_comment(tctx, "Send a association stop request (conn2), reson: %u\n", assoc_stop.in.reason);
167 status = wrepl_associate_stop(wrepl_socket2, &assoc_stop);
168 CHECK_STATUS(tctx, status, NT_STATUS_OK);
170 torture_comment(tctx, "Close 2 wrepl connections\n");
171 talloc_free(wrepl_socket1);
172 talloc_free(wrepl_socket2);
177 test if we always get back the same assoc_ctx
179 static bool test_assoc_ctx2(struct torture_context *tctx)
181 struct wrepl_socket *wrepl_socket;
182 struct wrepl_associate associate;
184 struct nbt_name name;
188 if (!torture_nbt_get_name(tctx, &name, &address))
191 torture_comment(tctx, "Test if we always get back the same assoc_ctx\n");
193 wrepl_socket = wrepl_socket_init(tctx, NULL);
195 torture_comment(tctx, "Setup wrepl connections\n");
196 status = wrepl_connect(wrepl_socket, NULL, address);
197 CHECK_STATUS(tctx, status, NT_STATUS_OK);
199 torture_comment(tctx, "Send 1st start association request\n");
200 status = wrepl_associate(wrepl_socket, &associate);
201 CHECK_STATUS(tctx, status, NT_STATUS_OK);
202 assoc_ctx1 = associate.out.assoc_ctx;
203 torture_comment(tctx, "1st association context: 0x%x\n", associate.out.assoc_ctx);
205 torture_comment(tctx, "Send 2nd start association request\n");
206 status = wrepl_associate(wrepl_socket, &associate);
207 torture_assert_ntstatus_ok(tctx, status, "2nd start association failed");
208 torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1,
209 "Different context returned");
210 torture_comment(tctx, "2nd association context: 0x%x\n", associate.out.assoc_ctx);
212 torture_comment(tctx, "Send 3rd start association request\n");
213 status = wrepl_associate(wrepl_socket, &associate);
214 torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1,
215 "Different context returned");
216 CHECK_STATUS(tctx, status, NT_STATUS_OK);
217 torture_comment(tctx, "3rd association context: 0x%x\n", associate.out.assoc_ctx);
219 torture_comment(tctx, "Close wrepl connections\n");
220 talloc_free(wrepl_socket);
226 display a replication entry
228 static void display_entry(TALLOC_CTX *tctx, struct wrepl_name *name)
232 torture_comment(tctx, "%s\n", nbt_name_string(tctx, &name->name));
233 torture_comment(tctx, "\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n",
234 name->type, name->state, name->node, name->is_static, (long long)name->version_id);
235 torture_comment(tctx, "\tRAW_FLAGS: 0x%08X OWNER: %-15s\n",
236 name->raw_flags, name->owner);
237 for (i=0;i<name->num_addresses;i++) {
238 torture_comment(tctx, "\tADDR: %-15s OWNER: %-15s\n",
239 name->addresses[i].address, name->addresses[i].owner);
244 test a full replication dump from a WINS server
246 static bool test_wins_replication(struct torture_context *tctx)
248 struct wrepl_socket *wrepl_socket;
251 struct wrepl_associate associate;
252 struct wrepl_pull_table pull_table;
253 struct wrepl_pull_names pull_names;
254 struct nbt_name name;
257 if (!torture_nbt_get_name(tctx, &name, &address))
260 torture_comment(tctx, "Test one pull replication cycle\n");
262 wrepl_socket = wrepl_socket_init(tctx, NULL);
264 torture_comment(tctx, "Setup wrepl connections\n");
265 status = wrepl_connect(wrepl_socket, NULL, address);
266 CHECK_STATUS(tctx, status, NT_STATUS_OK);
268 torture_comment(tctx, "Send a start association request\n");
270 status = wrepl_associate(wrepl_socket, &associate);
271 CHECK_STATUS(tctx, status, NT_STATUS_OK);
273 torture_comment(tctx, "association context: 0x%x\n", associate.out.assoc_ctx);
275 torture_comment(tctx, "Send a replication table query\n");
276 pull_table.in.assoc_ctx = associate.out.assoc_ctx;
278 status = wrepl_pull_table(wrepl_socket, tctx, &pull_table);
279 if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) {
280 struct wrepl_packet packet;
281 struct wrepl_request *req;
284 packet.opcode = WREPL_OPCODE_BITS;
285 packet.assoc_ctx = associate.out.assoc_ctx;
286 packet.mess_type = WREPL_STOP_ASSOCIATION;
287 packet.message.stop.reason = 0;
289 req = wrepl_request_send(wrepl_socket, &packet, NULL);
292 torture_fail(tctx, "We are not a valid pull partner for the server");
294 CHECK_STATUS(tctx, status, NT_STATUS_OK);
296 torture_comment(tctx, "Found %d replication partners\n", pull_table.out.num_partners);
298 for (i=0;i<pull_table.out.num_partners;i++) {
299 struct wrepl_wins_owner *partner = &pull_table.out.partners[i];
300 torture_comment(tctx, "%s max_version=%6llu min_version=%6llu type=%d\n",
302 (long long)partner->max_version,
303 (long long)partner->min_version,
306 pull_names.in.assoc_ctx = associate.out.assoc_ctx;
307 pull_names.in.partner = *partner;
309 status = wrepl_pull_names(wrepl_socket, tctx, &pull_names);
310 CHECK_STATUS(tctx, status, NT_STATUS_OK);
312 torture_comment(tctx, "Received %d names\n", pull_names.out.num_names);
314 for (j=0;j<pull_names.out.num_names;j++) {
315 display_entry(tctx, &pull_names.out.names[j]);
319 torture_comment(tctx, "Close wrepl connections\n");
320 talloc_free(wrepl_socket);
324 struct test_wrepl_conflict_conn {
326 struct wrepl_socket *pull;
329 #define TEST_OWNER_A_ADDRESS "127.65.65.1"
330 #define TEST_ADDRESS_A_PREFIX "127.0.65"
331 #define TEST_OWNER_B_ADDRESS "127.66.66.1"
332 #define TEST_ADDRESS_B_PREFIX "127.0.66"
333 #define TEST_OWNER_X_ADDRESS "127.88.88.1"
334 #define TEST_ADDRESS_X_PREFIX "127.0.88"
336 struct wrepl_wins_owner a, b, c, x;
338 struct socket_address *myaddr;
339 struct socket_address *myaddr2;
340 struct nbt_name_socket *nbtsock;
341 struct nbt_name_socket *nbtsock2;
343 struct nbt_name_socket *nbtsock_srv;
344 struct nbt_name_socket *nbtsock_srv2;
346 uint32_t addresses_best_num;
347 struct wrepl_ip *addresses_best;
349 uint32_t addresses_best2_num;
350 struct wrepl_ip *addresses_best2;
352 uint32_t addresses_all_num;
353 struct wrepl_ip *addresses_all;
355 uint32_t addresses_mhomed_num;
356 struct wrepl_ip *addresses_mhomed;
359 static const struct wrepl_ip addresses_A_1[] = {
361 .owner = TEST_OWNER_A_ADDRESS,
362 .ip = TEST_ADDRESS_A_PREFIX".1"
365 static const struct wrepl_ip addresses_A_2[] = {
367 .owner = TEST_OWNER_A_ADDRESS,
368 .ip = TEST_ADDRESS_A_PREFIX".2"
371 static const struct wrepl_ip addresses_A_3_4[] = {
373 .owner = TEST_OWNER_A_ADDRESS,
374 .ip = TEST_ADDRESS_A_PREFIX".3"
377 .owner = TEST_OWNER_A_ADDRESS,
378 .ip = TEST_ADDRESS_A_PREFIX".4"
381 static const struct wrepl_ip addresses_A_3_4_X_3_4[] = {
383 .owner = TEST_OWNER_A_ADDRESS,
384 .ip = TEST_ADDRESS_A_PREFIX".3"
387 .owner = TEST_OWNER_A_ADDRESS,
388 .ip = TEST_ADDRESS_A_PREFIX".4"
391 .owner = TEST_OWNER_X_ADDRESS,
392 .ip = TEST_ADDRESS_X_PREFIX".3"
395 .owner = TEST_OWNER_X_ADDRESS,
396 .ip = TEST_ADDRESS_X_PREFIX".4"
399 static const struct wrepl_ip addresses_A_3_4_B_3_4[] = {
401 .owner = TEST_OWNER_A_ADDRESS,
402 .ip = TEST_ADDRESS_A_PREFIX".3"
405 .owner = TEST_OWNER_A_ADDRESS,
406 .ip = TEST_ADDRESS_A_PREFIX".4"
409 .owner = TEST_OWNER_B_ADDRESS,
410 .ip = TEST_ADDRESS_B_PREFIX".3"
413 .owner = TEST_OWNER_B_ADDRESS,
414 .ip = TEST_ADDRESS_B_PREFIX".4"
417 static const struct wrepl_ip addresses_A_3_4_OWNER_B[] = {
419 .owner = TEST_OWNER_B_ADDRESS,
420 .ip = TEST_ADDRESS_A_PREFIX".3"
423 .owner = TEST_OWNER_B_ADDRESS,
424 .ip = TEST_ADDRESS_A_PREFIX".4"
427 static const struct wrepl_ip addresses_A_3_4_X_3_4_OWNER_B[] = {
429 .owner = TEST_OWNER_B_ADDRESS,
430 .ip = TEST_ADDRESS_A_PREFIX".3"
433 .owner = TEST_OWNER_B_ADDRESS,
434 .ip = TEST_ADDRESS_A_PREFIX".4"
437 .owner = TEST_OWNER_B_ADDRESS,
438 .ip = TEST_ADDRESS_X_PREFIX".3"
441 .owner = TEST_OWNER_B_ADDRESS,
442 .ip = TEST_ADDRESS_X_PREFIX".4"
446 static const struct wrepl_ip addresses_A_3_4_X_1_2[] = {
448 .owner = TEST_OWNER_A_ADDRESS,
449 .ip = TEST_ADDRESS_A_PREFIX".3"
452 .owner = TEST_OWNER_A_ADDRESS,
453 .ip = TEST_ADDRESS_A_PREFIX".4"
456 .owner = TEST_OWNER_X_ADDRESS,
457 .ip = TEST_ADDRESS_X_PREFIX".1"
460 .owner = TEST_OWNER_X_ADDRESS,
461 .ip = TEST_ADDRESS_X_PREFIX".2"
465 static const struct wrepl_ip addresses_B_1[] = {
467 .owner = TEST_OWNER_B_ADDRESS,
468 .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"
477 static const struct wrepl_ip addresses_B_3_4[] = {
479 .owner = TEST_OWNER_B_ADDRESS,
480 .ip = TEST_ADDRESS_B_PREFIX".3"
483 .owner = TEST_OWNER_B_ADDRESS,
484 .ip = TEST_ADDRESS_B_PREFIX".4"
487 static const struct wrepl_ip addresses_B_3_4_X_3_4[] = {
489 .owner = TEST_OWNER_B_ADDRESS,
490 .ip = TEST_ADDRESS_B_PREFIX".3"
493 .owner = TEST_OWNER_B_ADDRESS,
494 .ip = TEST_ADDRESS_B_PREFIX".4"
497 .owner = TEST_OWNER_X_ADDRESS,
498 .ip = TEST_ADDRESS_X_PREFIX".3"
501 .owner = TEST_OWNER_X_ADDRESS,
502 .ip = TEST_ADDRESS_X_PREFIX".4"
505 static const struct wrepl_ip addresses_B_3_4_X_1_2[] = {
507 .owner = TEST_OWNER_B_ADDRESS,
508 .ip = TEST_ADDRESS_B_PREFIX".3"
511 .owner = TEST_OWNER_B_ADDRESS,
512 .ip = TEST_ADDRESS_B_PREFIX".4"
515 .owner = TEST_OWNER_X_ADDRESS,
516 .ip = TEST_ADDRESS_X_PREFIX".1"
519 .owner = TEST_OWNER_X_ADDRESS,
520 .ip = TEST_ADDRESS_X_PREFIX".2"
524 static const struct wrepl_ip addresses_X_1_2[] = {
526 .owner = TEST_OWNER_X_ADDRESS,
527 .ip = TEST_ADDRESS_X_PREFIX".1"
530 .owner = TEST_OWNER_X_ADDRESS,
531 .ip = TEST_ADDRESS_X_PREFIX".2"
534 static const struct wrepl_ip addresses_X_3_4[] = {
536 .owner = TEST_OWNER_X_ADDRESS,
537 .ip = TEST_ADDRESS_X_PREFIX".3"
540 .owner = TEST_OWNER_X_ADDRESS,
541 .ip = TEST_ADDRESS_X_PREFIX".4"
545 static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *tctx,
548 struct test_wrepl_conflict_conn *ctx;
549 struct wrepl_associate associate;
550 struct wrepl_pull_table pull_table;
551 struct socket_address *nbt_srv_addr;
555 ctx = talloc_zero(tctx, struct test_wrepl_conflict_conn);
556 if (!ctx) return NULL;
558 ctx->address = address;
559 ctx->pull = wrepl_socket_init(ctx, NULL);
560 if (!ctx->pull) return NULL;
562 torture_comment(tctx, "Setup wrepl conflict pull connection\n");
563 status = wrepl_connect(ctx->pull, NULL, ctx->address);
564 if (!NT_STATUS_IS_OK(status)) return NULL;
566 status = wrepl_associate(ctx->pull, &associate);
567 if (!NT_STATUS_IS_OK(status)) return NULL;
569 ctx->pull_assoc = associate.out.assoc_ctx;
571 ctx->a.address = TEST_OWNER_A_ADDRESS;
572 ctx->a.max_version = 0;
573 ctx->a.min_version = 0;
576 ctx->b.address = TEST_OWNER_B_ADDRESS;
577 ctx->b.max_version = 0;
578 ctx->b.min_version = 0;
581 ctx->x.address = TEST_OWNER_X_ADDRESS;
582 ctx->x.max_version = 0;
583 ctx->x.min_version = 0;
586 ctx->c.address = address;
587 ctx->c.max_version = 0;
588 ctx->c.min_version = 0;
591 pull_table.in.assoc_ctx = ctx->pull_assoc;
592 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
593 if (!NT_STATUS_IS_OK(status)) return NULL;
595 for (i=0; i < pull_table.out.num_partners; i++) {
596 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
597 ctx->a.max_version = pull_table.out.partners[i].max_version;
598 ctx->a.min_version = pull_table.out.partners[i].min_version;
600 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
601 ctx->b.max_version = pull_table.out.partners[i].max_version;
602 ctx->b.min_version = pull_table.out.partners[i].min_version;
604 if (strcmp(TEST_OWNER_X_ADDRESS,pull_table.out.partners[i].address)==0) {
605 ctx->x.max_version = pull_table.out.partners[i].max_version;
606 ctx->x.min_version = pull_table.out.partners[i].min_version;
608 if (strcmp(address,pull_table.out.partners[i].address)==0) {
609 ctx->c.max_version = pull_table.out.partners[i].max_version;
610 ctx->c.min_version = pull_table.out.partners[i].min_version;
614 talloc_free(pull_table.out.partners);
616 ctx->nbtsock = nbt_name_socket_init(ctx, NULL);
617 if (!ctx->nbtsock) return NULL;
619 ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_best_ip(address), 0);
620 if (!ctx->myaddr) return NULL;
622 for (i = 0; i < iface_count(); i++) {
623 if (strcmp(ctx->myaddr->addr, iface_n_ip(i)) == 0) continue;
624 ctx->myaddr2 = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_n_ip(i), 0);
625 if (!ctx->myaddr2) return NULL;
629 status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0);
630 if (!NT_STATUS_IS_OK(status)) return NULL;
632 ctx->nbtsock_srv = nbt_name_socket_init(ctx, NULL);
633 if (!ctx->nbtsock_srv) return NULL;
635 /* Make a port 137 version of ctx->myaddr */
636 nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lp_nbt_port());
637 if (!nbt_srv_addr) return NULL;
639 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
640 status = socket_listen(ctx->nbtsock_srv->sock, nbt_srv_addr, 0, 0);
641 talloc_free(nbt_srv_addr);
642 if (!NT_STATUS_IS_OK(status)) {
643 /* this isn't fatal */
644 talloc_free(ctx->nbtsock_srv);
645 ctx->nbtsock_srv = NULL;
648 if (ctx->myaddr2 && ctx->nbtsock_srv) {
649 ctx->nbtsock2 = nbt_name_socket_init(ctx, NULL);
650 if (!ctx->nbtsock2) return NULL;
652 status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0);
653 if (!NT_STATUS_IS_OK(status)) return NULL;
655 ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx);
656 if (!ctx->nbtsock_srv2) return NULL;
658 /* Make a port 137 version of ctx->myaddr2 */
659 nbt_srv_addr = socket_address_from_strings(tctx,
660 ctx->nbtsock_srv->sock->backend_name,
661 ctx->myaddr2->addr, lp_nbt_port());
662 if (!nbt_srv_addr) return NULL;
664 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
665 status = socket_listen(ctx->nbtsock_srv2->sock, ctx->myaddr2, 0, 0);
666 talloc_free(nbt_srv_addr);
667 if (!NT_STATUS_IS_OK(status)) {
668 /* this isn't fatal */
669 talloc_free(ctx->nbtsock_srv2);
670 ctx->nbtsock_srv2 = NULL;
674 ctx->addresses_best_num = 1;
675 ctx->addresses_best = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best_num);
676 if (!ctx->addresses_best) return NULL;
677 ctx->addresses_best[0].owner = ctx->b.address;
678 ctx->addresses_best[0].ip = ctx->myaddr->addr;
680 ctx->addresses_all_num = iface_count();
681 ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num);
682 if (!ctx->addresses_all) return NULL;
683 for (i=0; i < ctx->addresses_all_num; i++) {
684 ctx->addresses_all[i].owner = ctx->b.address;
685 ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(i));
686 if (!ctx->addresses_all[i].ip) return NULL;
689 if (ctx->nbtsock_srv2) {
690 ctx->addresses_best2_num = 1;
691 ctx->addresses_best2 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best2_num);
692 if (!ctx->addresses_best2) return NULL;
693 ctx->addresses_best2[0].owner = ctx->b.address;
694 ctx->addresses_best2[0].ip = ctx->myaddr2->addr;
696 ctx->addresses_mhomed_num = 2;
697 ctx->addresses_mhomed = talloc_array(ctx, struct wrepl_ip, ctx->addresses_mhomed_num);
698 if (!ctx->addresses_mhomed) return NULL;
699 ctx->addresses_mhomed[0].owner = ctx->b.address;
700 ctx->addresses_mhomed[0].ip = ctx->myaddr->addr;
701 ctx->addresses_mhomed[1].owner = ctx->b.address;
702 ctx->addresses_mhomed[1].ip = ctx->myaddr2->addr;
708 static bool test_wrepl_update_one(struct torture_context *tctx,
709 struct test_wrepl_conflict_conn *ctx,
710 const struct wrepl_wins_owner *owner,
711 const struct wrepl_wins_name *name)
713 struct wrepl_socket *wrepl_socket;
714 struct wrepl_associate associate;
715 struct wrepl_packet update_packet, repl_send;
716 struct wrepl_table *update;
717 struct wrepl_wins_owner wrepl_wins_owners[1];
718 struct wrepl_packet *repl_recv;
719 struct wrepl_wins_owner *send_request;
720 struct wrepl_send_reply *send_reply;
721 struct wrepl_wins_name wrepl_wins_names[1];
725 wrepl_socket = wrepl_socket_init(ctx, NULL);
727 status = wrepl_connect(wrepl_socket, NULL, ctx->address);
728 CHECK_STATUS(tctx, status, NT_STATUS_OK);
730 status = wrepl_associate(wrepl_socket, &associate);
731 CHECK_STATUS(tctx, status, NT_STATUS_OK);
732 assoc_ctx = associate.out.assoc_ctx;
734 /* now send a WREPL_REPL_UPDATE message */
735 ZERO_STRUCT(update_packet);
736 update_packet.opcode = WREPL_OPCODE_BITS;
737 update_packet.assoc_ctx = assoc_ctx;
738 update_packet.mess_type = WREPL_REPLICATION;
739 update_packet.message.replication.command = WREPL_REPL_UPDATE;
740 update = &update_packet.message.replication.info.table;
742 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
743 update->partners = wrepl_wins_owners;
744 update->initiator = "0.0.0.0";
746 wrepl_wins_owners[0] = *owner;
748 status = wrepl_request(wrepl_socket, wrepl_socket,
749 &update_packet, &repl_recv);
750 CHECK_STATUS(tctx, status, NT_STATUS_OK);
751 CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_REPLICATION);
752 CHECK_VALUE(tctx, repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
753 send_request = &repl_recv->message.replication.info.owner;
755 ZERO_STRUCT(repl_send);
756 repl_send.opcode = WREPL_OPCODE_BITS;
757 repl_send.assoc_ctx = assoc_ctx;
758 repl_send.mess_type = WREPL_REPLICATION;
759 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
760 send_reply = &repl_send.message.replication.info.reply;
762 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
763 send_reply->names = wrepl_wins_names;
765 wrepl_wins_names[0] = *name;
767 status = wrepl_request(wrepl_socket, wrepl_socket,
768 &repl_send, &repl_recv);
769 CHECK_STATUS(tctx, status, NT_STATUS_OK);
770 CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
771 CHECK_VALUE(tctx, repl_recv->message.stop.reason, 0);
773 talloc_free(wrepl_socket);
777 static bool test_wrepl_is_applied(struct torture_context *tctx,
778 struct test_wrepl_conflict_conn *ctx,
779 const struct wrepl_wins_owner *owner,
780 const struct wrepl_wins_name *name,
784 struct wrepl_pull_names pull_names;
785 struct wrepl_name *names;
787 pull_names.in.assoc_ctx = ctx->pull_assoc;
788 pull_names.in.partner = *owner;
789 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
791 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
792 CHECK_STATUS(tctx, status, NT_STATUS_OK);
793 torture_assert(tctx, pull_names.out.num_names == (expected?1:0),
794 talloc_asprintf(tctx, "Invalid number of records returned - expected %d got %d", expected, pull_names.out.num_names));
796 names = pull_names.out.names;
799 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
803 CHECK_VALUE(tctx, names[0].name.type, name->name->type);
804 CHECK_VALUE_STRING(tctx, names[0].name.name, name->name->name);
805 CHECK_VALUE_STRING(tctx, names[0].name.scope, name->name->scope);
806 CHECK_VALUE(tctx, flags, name->flags);
807 CHECK_VALUE_UINT64(tctx, names[0].version_id, name->id);
810 CHECK_VALUE(tctx, names[0].num_addresses,
811 name->addresses.addresses.num_ips);
813 CHECK_VALUE(tctx, names[0].num_addresses, 1);
814 CHECK_VALUE_STRING(tctx, names[0].addresses[0].address,
818 talloc_free(pull_names.out.names);
822 static bool test_wrepl_mhomed_merged(struct torture_context *tctx,
823 struct test_wrepl_conflict_conn *ctx,
824 const struct wrepl_wins_owner *owner1,
825 uint32_t num_ips1, const struct wrepl_ip *ips1,
826 const struct wrepl_wins_owner *owner2,
827 uint32_t num_ips2, const struct wrepl_ip *ips2,
828 const struct wrepl_wins_name *name2)
831 struct wrepl_pull_names pull_names;
832 struct wrepl_name *names;
835 uint32_t num_ips = num_ips1 + num_ips2;
837 for (i = 0; i < num_ips2; i++) {
838 for (j = 0; j < num_ips1; j++) {
839 if (strcmp(ips2[i].ip,ips1[j].ip) == 0) {
846 pull_names.in.assoc_ctx = ctx->pull_assoc;
847 pull_names.in.partner = *owner2;
848 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
850 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
851 CHECK_STATUS(tctx, status, NT_STATUS_OK);
852 CHECK_VALUE(tctx, pull_names.out.num_names, 1);
854 names = pull_names.out.names;
856 flags = WREPL_NAME_FLAGS(names[0].type,
860 CHECK_VALUE(tctx, names[0].name.type, name2->name->type);
861 CHECK_VALUE_STRING(tctx, names[0].name.name, name2->name->name);
862 CHECK_VALUE_STRING(tctx, names[0].name.scope, name2->name->scope);
863 CHECK_VALUE(tctx, flags, name2->flags | WREPL_TYPE_MHOMED);
864 CHECK_VALUE_UINT64(tctx, names[0].version_id, name2->id);
866 CHECK_VALUE(tctx, names[0].num_addresses, num_ips);
868 for (i = 0; i < names[0].num_addresses; i++) {
869 const char *addr = names[0].addresses[i].address;
870 const char *owner = names[0].addresses[i].owner;
873 for (j = 0; j < num_ips2; j++) {
874 if (strcmp(addr, ips2[j].ip) == 0) {
876 CHECK_VALUE_STRING(tctx, owner, owner2->address);
883 for (j = 0; j < num_ips1; j++) {
884 if (strcmp(addr, ips1[j].ip) == 0) {
886 CHECK_VALUE_STRING(tctx, owner, owner1->address);
893 CHECK_VALUE_STRING(tctx, addr, "not found in address list");
895 talloc_free(pull_names.out.names);
899 static bool test_wrepl_sgroup_merged(struct torture_context *tctx,
900 struct test_wrepl_conflict_conn *ctx,
901 struct wrepl_wins_owner *merge_owner,
902 struct wrepl_wins_owner *owner1,
903 uint32_t num_ips1, const struct wrepl_ip *ips1,
904 struct wrepl_wins_owner *owner2,
905 uint32_t num_ips2, const struct wrepl_ip *ips2,
906 const struct wrepl_wins_name *name2)
909 struct wrepl_pull_names pull_names;
910 struct wrepl_name *names;
911 struct wrepl_name *name = NULL;
914 uint32_t num_ips = num_ips1 + num_ips2;
917 merge_owner = &ctx->c;
920 for (i = 0; i < num_ips1; i++) {
921 if (owner1 != &ctx->c && strcmp(ips1[i].owner,owner2->address) == 0) {
925 for (j = 0; j < num_ips2; j++) {
926 if (strcmp(ips1[i].ip,ips2[j].ip) == 0) {
934 pull_names.in.assoc_ctx = ctx->pull_assoc;
935 pull_names.in.partner = *merge_owner;
936 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
937 pull_names.in.partner.max_version = 0;
939 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
940 CHECK_STATUS(tctx, status, NT_STATUS_OK);
942 names = pull_names.out.names;
944 for (i = 0; i < pull_names.out.num_names; i++) {
945 if (names[i].name.type != name2->name->type) continue;
946 if (!names[i].name.name) continue;
947 if (strcmp(names[i].name.name, name2->name->name) != 0) continue;
948 if (names[i].name.scope) continue;
953 if (pull_names.out.num_names > 0) {
954 merge_owner->max_version = names[pull_names.out.num_names-1].version_id;
958 torture_comment(tctx, "%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name));
962 flags = WREPL_NAME_FLAGS(name->type,
966 CHECK_VALUE(tctx, name->name.type, name2->name->type);
967 CHECK_VALUE_STRING(tctx, name->name.name, name2->name->name);
968 CHECK_VALUE_STRING(tctx, name->name.scope, name2->name->scope);
969 CHECK_VALUE(tctx, flags, name2->flags);
971 CHECK_VALUE(tctx, name->num_addresses, num_ips);
973 for (i = 0; i < name->num_addresses; i++) {
974 const char *addr = name->addresses[i].address;
975 const char *owner = name->addresses[i].owner;
978 for (j = 0; j < num_ips2; j++) {
979 if (strcmp(addr, ips2[j].ip) == 0) {
981 CHECK_VALUE_STRING(tctx, owner, ips2[j].owner);
988 for (j = 0; j < num_ips1; j++) {
989 if (strcmp(addr, ips1[j].ip) == 0) {
991 if (owner1 == &ctx->c) {
992 CHECK_VALUE_STRING(tctx, owner, owner1->address);
994 CHECK_VALUE_STRING(tctx, owner, ips1[j].owner);
1000 if (found) continue;
1002 CHECK_VALUE_STRING(tctx, addr, "not found in address list");
1004 talloc_free(pull_names.out.names);
1008 static bool test_conflict_same_owner(struct torture_context *tctx,
1009 struct test_wrepl_conflict_conn *ctx)
1011 static bool ret = true;
1012 struct nbt_name name;
1013 struct wrepl_wins_name wins_name1;
1014 struct wrepl_wins_name wins_name2;
1015 struct wrepl_wins_name *wins_name_tmp;
1016 struct wrepl_wins_name *wins_name_last;
1017 struct wrepl_wins_name *wins_name_cur;
1019 uint8_t types[] = { 0x00, 0x1C };
1021 enum wrepl_name_type type;
1022 enum wrepl_name_state state;
1023 enum wrepl_name_node node;
1026 const struct wrepl_ip *ips;
1029 .type = WREPL_TYPE_GROUP,
1030 .state = WREPL_STATE_ACTIVE,
1031 .node = WREPL_NODE_B,
1033 .num_ips = ARRAY_SIZE(addresses_A_1),
1034 .ips = addresses_A_1,
1036 .type = WREPL_TYPE_UNIQUE,
1037 .state = WREPL_STATE_ACTIVE,
1038 .node = WREPL_NODE_B,
1040 .num_ips = ARRAY_SIZE(addresses_A_1),
1041 .ips = addresses_A_1,
1043 .type = WREPL_TYPE_UNIQUE,
1044 .state = WREPL_STATE_ACTIVE,
1045 .node = WREPL_NODE_B,
1047 .num_ips = ARRAY_SIZE(addresses_A_2),
1048 .ips = addresses_A_2,
1050 .type = WREPL_TYPE_UNIQUE,
1051 .state = WREPL_STATE_ACTIVE,
1052 .node = WREPL_NODE_B,
1054 .num_ips = ARRAY_SIZE(addresses_A_1),
1055 .ips = addresses_A_1,
1057 .type = WREPL_TYPE_UNIQUE,
1058 .state = WREPL_STATE_ACTIVE,
1059 .node = WREPL_NODE_B,
1061 .num_ips = ARRAY_SIZE(addresses_A_2),
1062 .ips = addresses_A_2,
1064 .type = WREPL_TYPE_SGROUP,
1065 .state = WREPL_STATE_TOMBSTONE,
1066 .node = WREPL_NODE_B,
1068 .num_ips = ARRAY_SIZE(addresses_A_2),
1069 .ips = addresses_A_2,
1071 .type = WREPL_TYPE_MHOMED,
1072 .state = WREPL_STATE_TOMBSTONE,
1073 .node = WREPL_NODE_B,
1075 .num_ips = ARRAY_SIZE(addresses_A_1),
1076 .ips = addresses_A_1,
1078 .type = WREPL_TYPE_MHOMED,
1079 .state = WREPL_STATE_RELEASED,
1080 .node = WREPL_NODE_B,
1082 .num_ips = ARRAY_SIZE(addresses_A_2),
1083 .ips = addresses_A_2,
1085 .type = WREPL_TYPE_SGROUP,
1086 .state = WREPL_STATE_ACTIVE,
1087 .node = WREPL_NODE_B,
1089 .num_ips = ARRAY_SIZE(addresses_A_1),
1090 .ips = addresses_A_1,
1092 .type = WREPL_TYPE_SGROUP,
1093 .state = WREPL_STATE_ACTIVE,
1094 .node = WREPL_NODE_B,
1096 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1097 .ips = addresses_A_3_4,
1099 .type = WREPL_TYPE_SGROUP,
1100 .state = WREPL_STATE_TOMBSTONE,
1101 .node = WREPL_NODE_B,
1103 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1104 .ips = addresses_B_3_4,
1106 /* the last one should always be a unique,tomstone record! */
1107 .type = WREPL_TYPE_UNIQUE,
1108 .state = WREPL_STATE_TOMBSTONE,
1109 .node = WREPL_NODE_B,
1111 .num_ips = ARRAY_SIZE(addresses_A_1),
1112 .ips = addresses_A_1,
1116 name.name = "_SAME_OWNER_A";
1120 wins_name_tmp = NULL;
1121 wins_name_last = &wins_name2;
1122 wins_name_cur = &wins_name1;
1124 for (j=0; ret && j < ARRAY_SIZE(types); j++) {
1125 name.type = types[j];
1126 torture_comment(tctx, "Test Replica Conflicts with same owner[%s] for %s\n",
1127 nbt_name_string(ctx, &name), ctx->a.address);
1129 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
1130 wins_name_tmp = wins_name_last;
1131 wins_name_last = wins_name_cur;
1132 wins_name_cur = wins_name_tmp;
1135 torture_comment(tctx, "%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
1136 wrepl_name_type_string(records[i-1].type),
1137 wrepl_name_state_string(records[i-1].state),
1138 (records[i-1].is_static?",static":""),
1139 wrepl_name_type_string(records[i].type),
1140 wrepl_name_state_string(records[i].state),
1141 (records[i].is_static?",static":""),
1142 (records[i-1].ips==records[i].ips?"same":"different"),
1146 wins_name_cur->name = &name;
1147 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
1150 records[i].is_static);
1151 wins_name_cur->id = ++ctx->a.max_version;
1152 if (wins_name_cur->flags & 2) {
1153 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
1154 wins_name_cur->addresses.addresses.ips = discard_const(records[i].ips);
1156 wins_name_cur->addresses.ip = records[i].ips[0].ip;
1158 wins_name_cur->unknown = "255.255.255.255";
1160 ret &= test_wrepl_update_one(tctx, ctx, &ctx->a,wins_name_cur);
1161 if (records[i].state == WREPL_STATE_RELEASED) {
1162 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_last, false);
1163 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, false);
1165 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, true);
1168 /* the first one is a cleanup run */
1169 if (!ret && i == 0) ret = true;
1172 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, __location__);
1180 static bool test_conflict_different_owner(struct torture_context *tctx,
1181 struct test_wrepl_conflict_conn *ctx)
1184 struct wrepl_wins_name wins_name1;
1185 struct wrepl_wins_name wins_name2;
1186 struct wrepl_wins_name *wins_name_r1;
1187 struct wrepl_wins_name *wins_name_r2;
1190 const char *line; /* just better debugging */
1191 struct nbt_name name;
1192 const char *comment;
1193 bool extra; /* not the worst case, this is an extra test */
1196 struct wrepl_wins_owner *owner;
1197 enum wrepl_name_type type;
1198 enum wrepl_name_state state;
1199 enum wrepl_name_node node;
1202 const struct wrepl_ip *ips;
1203 bool apply_expected;
1205 struct wrepl_wins_owner *merge_owner;
1206 bool sgroup_cleanup;
1210 * NOTE: the first record and the last applied one
1211 * needs to be from the same owner,
1212 * to not conflict in the next smbtorture run!!!
1215 .line = __location__,
1216 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1220 .type = WREPL_TYPE_UNIQUE,
1221 .state = WREPL_STATE_TOMBSTONE,
1222 .node = WREPL_NODE_B,
1224 .num_ips = ARRAY_SIZE(addresses_B_1),
1225 .ips = addresses_B_1,
1226 .apply_expected = true /* ignored */
1230 .type = WREPL_TYPE_UNIQUE,
1231 .state = WREPL_STATE_TOMBSTONE,
1232 .node = WREPL_NODE_B,
1234 .num_ips = ARRAY_SIZE(addresses_A_1),
1235 .ips = addresses_A_1,
1236 .apply_expected = true /* ignored */
1241 * unique vs unique section
1244 * unique,active vs. unique,active
1245 * => should be replaced
1248 .line = __location__,
1249 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1252 .type = WREPL_TYPE_UNIQUE,
1253 .state = WREPL_STATE_ACTIVE,
1254 .node = WREPL_NODE_B,
1256 .num_ips = ARRAY_SIZE(addresses_A_1),
1257 .ips = addresses_A_1,
1258 .apply_expected = true
1262 .type = WREPL_TYPE_UNIQUE,
1263 .state = WREPL_STATE_ACTIVE,
1264 .node = WREPL_NODE_B,
1266 .num_ips = ARRAY_SIZE(addresses_B_1),
1267 .ips = addresses_B_1,
1268 .apply_expected = true
1273 * unique,active vs. unique,tombstone
1274 * => should NOT be replaced
1277 .line = __location__,
1278 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1281 .type = WREPL_TYPE_UNIQUE,
1282 .state = WREPL_STATE_ACTIVE,
1283 .node = WREPL_NODE_B,
1285 .num_ips = ARRAY_SIZE(addresses_B_1),
1286 .ips = addresses_B_1,
1287 .apply_expected = true
1291 .type = WREPL_TYPE_UNIQUE,
1292 .state = WREPL_STATE_TOMBSTONE,
1293 .node = WREPL_NODE_B,
1295 .num_ips = ARRAY_SIZE(addresses_B_1),
1296 .ips = addresses_B_1,
1297 .apply_expected = false
1302 * unique,released vs. unique,active
1303 * => should be replaced
1306 .line = __location__,
1307 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1310 .type = WREPL_TYPE_UNIQUE,
1311 .state = WREPL_STATE_RELEASED,
1312 .node = WREPL_NODE_B,
1314 .num_ips = ARRAY_SIZE(addresses_B_1),
1315 .ips = addresses_B_1,
1316 .apply_expected = false
1320 .type = WREPL_TYPE_UNIQUE,
1321 .state = WREPL_STATE_ACTIVE,
1322 .node = WREPL_NODE_B,
1324 .num_ips = ARRAY_SIZE(addresses_A_1),
1325 .ips = addresses_A_1,
1326 .apply_expected = true
1331 * unique,released vs. unique,tombstone
1332 * => should be replaced
1335 .line = __location__,
1336 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1339 .type = WREPL_TYPE_UNIQUE,
1340 .state = WREPL_STATE_RELEASED,
1341 .node = WREPL_NODE_B,
1343 .num_ips = ARRAY_SIZE(addresses_A_1),
1344 .ips = addresses_A_1,
1345 .apply_expected = false
1349 .type = WREPL_TYPE_UNIQUE,
1350 .state = WREPL_STATE_TOMBSTONE,
1351 .node = WREPL_NODE_B,
1353 .num_ips = ARRAY_SIZE(addresses_B_1),
1354 .ips = addresses_B_1,
1355 .apply_expected = true
1360 * unique,tombstone vs. unique,active
1361 * => should be replaced
1364 .line = __location__,
1365 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1368 .type = WREPL_TYPE_UNIQUE,
1369 .state = WREPL_STATE_TOMBSTONE,
1370 .node = WREPL_NODE_B,
1372 .num_ips = ARRAY_SIZE(addresses_B_1),
1373 .ips = addresses_B_1,
1374 .apply_expected = true
1378 .type = WREPL_TYPE_UNIQUE,
1379 .state = WREPL_STATE_ACTIVE,
1380 .node = WREPL_NODE_B,
1382 .num_ips = ARRAY_SIZE(addresses_A_1),
1383 .ips = addresses_A_1,
1384 .apply_expected = true
1389 * unique,tombstone vs. unique,tombstone
1390 * => should be replaced
1393 .line = __location__,
1394 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1397 .type = WREPL_TYPE_UNIQUE,
1398 .state = WREPL_STATE_TOMBSTONE,
1399 .node = WREPL_NODE_B,
1401 .num_ips = ARRAY_SIZE(addresses_A_1),
1402 .ips = addresses_A_1,
1403 .apply_expected = true
1407 .type = WREPL_TYPE_UNIQUE,
1408 .state = WREPL_STATE_TOMBSTONE,
1409 .node = WREPL_NODE_B,
1411 .num_ips = ARRAY_SIZE(addresses_B_1),
1412 .ips = addresses_B_1,
1413 .apply_expected = true
1419 * unique vs normal groups section,
1422 * unique,active vs. group,active
1423 * => should be replaced
1426 .line = __location__,
1427 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1430 .type = WREPL_TYPE_UNIQUE,
1431 .state = WREPL_STATE_ACTIVE,
1432 .node = WREPL_NODE_B,
1434 .num_ips = ARRAY_SIZE(addresses_B_1),
1435 .ips = addresses_B_1,
1436 .apply_expected = true
1440 .type = WREPL_TYPE_GROUP,
1441 .state = WREPL_STATE_ACTIVE,
1442 .node = WREPL_NODE_B,
1444 .num_ips = ARRAY_SIZE(addresses_A_1),
1445 .ips = addresses_A_1,
1446 .apply_expected = true
1451 * unique,active vs. group,tombstone
1452 * => should NOT be replaced
1455 .line = __location__,
1456 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1459 .type = WREPL_TYPE_UNIQUE,
1460 .state = WREPL_STATE_ACTIVE,
1461 .node = WREPL_NODE_B,
1463 .num_ips = ARRAY_SIZE(addresses_A_1),
1464 .ips = addresses_A_1,
1465 .apply_expected = true
1469 .type = WREPL_TYPE_GROUP,
1470 .state = WREPL_STATE_TOMBSTONE,
1471 .node = WREPL_NODE_B,
1473 .num_ips = ARRAY_SIZE(addresses_A_1),
1474 .ips = addresses_A_1,
1475 .apply_expected = false
1480 * unique,released vs. group,active
1481 * => should be replaced
1484 .line = __location__,
1485 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1488 .type = WREPL_TYPE_UNIQUE,
1489 .state = WREPL_STATE_RELEASED,
1490 .node = WREPL_NODE_B,
1492 .num_ips = ARRAY_SIZE(addresses_A_1),
1493 .ips = addresses_A_1,
1494 .apply_expected = false
1498 .type = WREPL_TYPE_GROUP,
1499 .state = WREPL_STATE_ACTIVE,
1500 .node = WREPL_NODE_B,
1502 .num_ips = ARRAY_SIZE(addresses_B_1),
1503 .ips = addresses_B_1,
1504 .apply_expected = true
1509 * unique,released vs. group,tombstone
1510 * => should be replaced
1513 .line = __location__,
1514 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1517 .type = WREPL_TYPE_UNIQUE,
1518 .state = WREPL_STATE_RELEASED,
1519 .node = WREPL_NODE_B,
1521 .num_ips = ARRAY_SIZE(addresses_B_1),
1522 .ips = addresses_B_1,
1523 .apply_expected = false
1527 .type = WREPL_TYPE_GROUP,
1528 .state = WREPL_STATE_TOMBSTONE,
1529 .node = WREPL_NODE_B,
1531 .num_ips = ARRAY_SIZE(addresses_A_1),
1532 .ips = addresses_A_1,
1533 .apply_expected = true
1538 * unique,tombstone vs. group,active
1539 * => should be replaced
1542 .line = __location__,
1543 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1546 .type = WREPL_TYPE_UNIQUE,
1547 .state = WREPL_STATE_TOMBSTONE,
1548 .node = WREPL_NODE_B,
1550 .num_ips = ARRAY_SIZE(addresses_A_1),
1551 .ips = addresses_A_1,
1552 .apply_expected = true
1556 .type = WREPL_TYPE_GROUP,
1557 .state = WREPL_STATE_ACTIVE,
1558 .node = WREPL_NODE_B,
1560 .num_ips = ARRAY_SIZE(addresses_B_1),
1561 .ips = addresses_B_1,
1562 .apply_expected = true
1567 * unique,tombstone vs. group,tombstone
1568 * => should be replaced
1571 .line = __location__,
1572 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1575 .type = WREPL_TYPE_UNIQUE,
1576 .state = WREPL_STATE_TOMBSTONE,
1577 .node = WREPL_NODE_B,
1579 .num_ips = ARRAY_SIZE(addresses_B_1),
1580 .ips = addresses_B_1,
1581 .apply_expected = true
1585 .type = WREPL_TYPE_GROUP,
1586 .state = WREPL_STATE_TOMBSTONE,
1587 .node = WREPL_NODE_B,
1589 .num_ips = ARRAY_SIZE(addresses_A_1),
1590 .ips = addresses_A_1,
1591 .apply_expected = true
1596 * unique vs special groups section,
1599 * unique,active vs. sgroup,active
1600 * => should NOT be replaced
1603 .line = __location__,
1604 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1607 .type = WREPL_TYPE_UNIQUE,
1608 .state = WREPL_STATE_ACTIVE,
1609 .node = WREPL_NODE_B,
1611 .num_ips = ARRAY_SIZE(addresses_A_1),
1612 .ips = addresses_A_1,
1613 .apply_expected = true
1617 .type = WREPL_TYPE_SGROUP,
1618 .state = WREPL_STATE_ACTIVE,
1619 .node = WREPL_NODE_B,
1621 .num_ips = ARRAY_SIZE(addresses_A_1),
1622 .ips = addresses_A_1,
1623 .apply_expected = false
1628 * unique,active vs. sgroup,tombstone
1629 * => should NOT be replaced
1632 .line = __location__,
1633 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1636 .type = WREPL_TYPE_UNIQUE,
1637 .state = WREPL_STATE_ACTIVE,
1638 .node = WREPL_NODE_B,
1640 .num_ips = ARRAY_SIZE(addresses_A_1),
1641 .ips = addresses_A_1,
1642 .apply_expected = true
1646 .type = WREPL_TYPE_SGROUP,
1647 .state = WREPL_STATE_TOMBSTONE,
1648 .node = WREPL_NODE_B,
1650 .num_ips = ARRAY_SIZE(addresses_A_1),
1651 .ips = addresses_A_1,
1652 .apply_expected = false
1657 * unique,released vs. sgroup,active
1658 * => should be replaced
1661 .line = __location__,
1662 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1665 .type = WREPL_TYPE_UNIQUE,
1666 .state = WREPL_STATE_RELEASED,
1667 .node = WREPL_NODE_B,
1669 .num_ips = ARRAY_SIZE(addresses_A_1),
1670 .ips = addresses_A_1,
1671 .apply_expected = false
1675 .type = WREPL_TYPE_SGROUP,
1676 .state = WREPL_STATE_ACTIVE,
1677 .node = WREPL_NODE_B,
1679 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1680 .ips = addresses_B_3_4,
1681 .apply_expected = true
1686 * unique,released vs. sgroup,tombstone
1687 * => should be replaced
1690 .line = __location__,
1691 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1694 .type = WREPL_TYPE_UNIQUE,
1695 .state = WREPL_STATE_RELEASED,
1696 .node = WREPL_NODE_B,
1698 .num_ips = ARRAY_SIZE(addresses_B_1),
1699 .ips = addresses_B_1,
1700 .apply_expected = false
1704 .type = WREPL_TYPE_SGROUP,
1705 .state = WREPL_STATE_TOMBSTONE,
1706 .node = WREPL_NODE_B,
1708 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1709 .ips = addresses_A_3_4,
1710 .apply_expected = true
1715 * unique,tombstone vs. sgroup,active
1716 * => should be replaced
1719 .line = __location__,
1720 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1723 .type = WREPL_TYPE_UNIQUE,
1724 .state = WREPL_STATE_TOMBSTONE,
1725 .node = WREPL_NODE_B,
1727 .num_ips = ARRAY_SIZE(addresses_A_1),
1728 .ips = addresses_A_1,
1729 .apply_expected = true
1733 .type = WREPL_TYPE_SGROUP,
1734 .state = WREPL_STATE_ACTIVE,
1735 .node = WREPL_NODE_B,
1737 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1738 .ips = addresses_B_3_4,
1739 .apply_expected = true
1744 * unique,tombstone vs. sgroup,tombstone
1745 * => should be replaced
1748 .line = __location__,
1749 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1752 .type = WREPL_TYPE_UNIQUE,
1753 .state = WREPL_STATE_TOMBSTONE,
1754 .node = WREPL_NODE_B,
1756 .num_ips = ARRAY_SIZE(addresses_B_1),
1757 .ips = addresses_B_1,
1758 .apply_expected = true
1762 .type = WREPL_TYPE_SGROUP,
1763 .state = WREPL_STATE_TOMBSTONE,
1764 .node = WREPL_NODE_B,
1766 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1767 .ips = addresses_A_3_4,
1768 .apply_expected = true
1773 * unique vs multi homed section,
1776 * unique,active vs. mhomed,active
1777 * => should be replaced
1780 .line = __location__,
1781 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1784 .type = WREPL_TYPE_UNIQUE,
1785 .state = WREPL_STATE_ACTIVE,
1786 .node = WREPL_NODE_B,
1788 .num_ips = ARRAY_SIZE(addresses_A_1),
1789 .ips = addresses_A_1,
1790 .apply_expected = true
1794 .type = WREPL_TYPE_MHOMED,
1795 .state = WREPL_STATE_ACTIVE,
1796 .node = WREPL_NODE_B,
1798 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1799 .ips = addresses_B_3_4,
1800 .apply_expected = true
1805 * unique,active vs. mhomed,tombstone
1806 * => should NOT be replaced
1809 .line = __location__,
1810 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1813 .type = WREPL_TYPE_UNIQUE,
1814 .state = WREPL_STATE_ACTIVE,
1815 .node = WREPL_NODE_B,
1817 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1818 .ips = addresses_B_3_4,
1819 .apply_expected = true
1823 .type = WREPL_TYPE_MHOMED,
1824 .state = WREPL_STATE_TOMBSTONE,
1825 .node = WREPL_NODE_B,
1827 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1828 .ips = addresses_B_3_4,
1829 .apply_expected = false
1834 * unique,released vs. mhomed,active
1835 * => should be replaced
1838 .line = __location__,
1839 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1842 .type = WREPL_TYPE_UNIQUE,
1843 .state = WREPL_STATE_RELEASED,
1844 .node = WREPL_NODE_B,
1846 .num_ips = ARRAY_SIZE(addresses_B_1),
1847 .ips = addresses_B_1,
1848 .apply_expected = false
1852 .type = WREPL_TYPE_MHOMED,
1853 .state = WREPL_STATE_ACTIVE,
1854 .node = WREPL_NODE_B,
1856 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1857 .ips = addresses_A_3_4,
1858 .apply_expected = true
1863 * unique,released vs. mhomed,tombstone
1864 * => should be replaced
1867 .line = __location__,
1868 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1871 .type = WREPL_TYPE_UNIQUE,
1872 .state = WREPL_STATE_RELEASED,
1873 .node = WREPL_NODE_B,
1875 .num_ips = ARRAY_SIZE(addresses_A_1),
1876 .ips = addresses_A_1,
1877 .apply_expected = false
1881 .type = WREPL_TYPE_MHOMED,
1882 .state = WREPL_STATE_TOMBSTONE,
1883 .node = WREPL_NODE_B,
1885 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1886 .ips = addresses_B_3_4,
1887 .apply_expected = true
1892 * unique,tombstone vs. mhomed,active
1893 * => should be replaced
1896 .line = __location__,
1897 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1900 .type = WREPL_TYPE_UNIQUE,
1901 .state = WREPL_STATE_TOMBSTONE,
1902 .node = WREPL_NODE_B,
1904 .num_ips = ARRAY_SIZE(addresses_B_1),
1905 .ips = addresses_B_1,
1906 .apply_expected = true
1910 .type = WREPL_TYPE_MHOMED,
1911 .state = WREPL_STATE_ACTIVE,
1912 .node = WREPL_NODE_B,
1914 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1915 .ips = addresses_A_3_4,
1916 .apply_expected = true
1921 * unique,tombstone vs. mhomed,tombstone
1922 * => should be replaced
1925 .line = __location__,
1926 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1929 .type = WREPL_TYPE_UNIQUE,
1930 .state = WREPL_STATE_TOMBSTONE,
1931 .node = WREPL_NODE_B,
1933 .num_ips = ARRAY_SIZE(addresses_A_1),
1934 .ips = addresses_A_1,
1935 .apply_expected = true
1939 .type = WREPL_TYPE_MHOMED,
1940 .state = WREPL_STATE_TOMBSTONE,
1941 .node = WREPL_NODE_B,
1943 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1944 .ips = addresses_B_3_4,
1945 .apply_expected = true
1950 * normal groups vs unique section,
1953 * group,active vs. unique,active
1954 * => should NOT be replaced
1957 .line = __location__,
1958 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1961 .type = WREPL_TYPE_GROUP,
1962 .state = WREPL_STATE_ACTIVE,
1963 .node = WREPL_NODE_B,
1965 .num_ips = ARRAY_SIZE(addresses_A_1),
1966 .ips = addresses_A_1,
1967 .apply_expected = true
1971 .type = WREPL_TYPE_UNIQUE,
1972 .state = WREPL_STATE_ACTIVE,
1973 .node = WREPL_NODE_B,
1975 .num_ips = ARRAY_SIZE(addresses_A_1),
1976 .ips = addresses_A_1,
1977 .apply_expected = false
1982 * group,active vs. unique,tombstone
1983 * => should NOT be replaced
1986 .line = __location__,
1987 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1990 .type = WREPL_TYPE_GROUP,
1991 .state = WREPL_STATE_ACTIVE,
1992 .node = WREPL_NODE_B,
1994 .num_ips = ARRAY_SIZE(addresses_A_1),
1995 .ips = addresses_A_1,
1996 .apply_expected = true
2000 .type = WREPL_TYPE_UNIQUE,
2001 .state = WREPL_STATE_TOMBSTONE,
2002 .node = WREPL_NODE_B,
2004 .num_ips = ARRAY_SIZE(addresses_A_1),
2005 .ips = addresses_A_1,
2006 .apply_expected = false
2011 * group,released vs. unique,active
2012 * => should NOT be replaced
2015 .line = __location__,
2016 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2019 .type = WREPL_TYPE_GROUP,
2020 .state = WREPL_STATE_RELEASED,
2021 .node = WREPL_NODE_B,
2023 .num_ips = ARRAY_SIZE(addresses_A_1),
2024 .ips = addresses_A_1,
2025 .apply_expected = false
2029 .type = WREPL_TYPE_UNIQUE,
2030 .state = WREPL_STATE_ACTIVE,
2031 .node = WREPL_NODE_B,
2033 .num_ips = ARRAY_SIZE(addresses_A_1),
2034 .ips = addresses_A_1,
2035 .apply_expected = false
2040 * group,released vs. unique,tombstone
2041 * => should NOT be replaced
2044 .line = __location__,
2045 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2048 .type = WREPL_TYPE_GROUP,
2049 .state = WREPL_STATE_RELEASED,
2050 .node = WREPL_NODE_B,
2052 .num_ips = ARRAY_SIZE(addresses_A_1),
2053 .ips = addresses_A_1,
2054 .apply_expected = false
2058 .type = WREPL_TYPE_UNIQUE,
2059 .state = WREPL_STATE_TOMBSTONE,
2060 .node = WREPL_NODE_B,
2062 .num_ips = ARRAY_SIZE(addresses_A_1),
2063 .ips = addresses_A_1,
2064 .apply_expected = false
2069 * group,tombstone vs. unique,active
2070 * => should NOT be replaced
2073 .line = __location__,
2074 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2077 .type = WREPL_TYPE_GROUP,
2078 .state = WREPL_STATE_TOMBSTONE,
2079 .node = WREPL_NODE_B,
2081 .num_ips = ARRAY_SIZE(addresses_A_1),
2082 .ips = addresses_A_1,
2083 .apply_expected = true
2087 .type = WREPL_TYPE_UNIQUE,
2088 .state = WREPL_STATE_ACTIVE,
2089 .node = WREPL_NODE_B,
2091 .num_ips = ARRAY_SIZE(addresses_A_1),
2092 .ips = addresses_A_1,
2093 .apply_expected = false
2098 * group,tombstone vs. unique,tombstone
2099 * => should NOT be replaced
2102 .line = __location__,
2103 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2106 .type = WREPL_TYPE_GROUP,
2107 .state = WREPL_STATE_TOMBSTONE,
2108 .node = WREPL_NODE_B,
2110 .num_ips = ARRAY_SIZE(addresses_A_1),
2111 .ips = addresses_A_1,
2112 .apply_expected = true
2116 .type = WREPL_TYPE_UNIQUE,
2117 .state = WREPL_STATE_TOMBSTONE,
2118 .node = WREPL_NODE_B,
2120 .num_ips = ARRAY_SIZE(addresses_A_1),
2121 .ips = addresses_A_1,
2122 .apply_expected = false
2127 * normal groups vs normal groups section,
2130 * group,active vs. group,active
2131 * => should NOT be replaced
2134 .line = __location__,
2135 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2138 .type = WREPL_TYPE_GROUP,
2139 .state = WREPL_STATE_ACTIVE,
2140 .node = WREPL_NODE_B,
2142 .num_ips = ARRAY_SIZE(addresses_A_1),
2143 .ips = addresses_A_1,
2144 .apply_expected = true
2148 .type = WREPL_TYPE_GROUP,
2149 .state = WREPL_STATE_ACTIVE,
2150 .node = WREPL_NODE_B,
2152 .num_ips = ARRAY_SIZE(addresses_A_1),
2153 .ips = addresses_A_1,
2154 .apply_expected = false
2159 * group,active vs. group,tombstone
2160 * => should NOT be replaced
2163 .line = __location__,
2164 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2167 .type = WREPL_TYPE_GROUP,
2168 .state = WREPL_STATE_ACTIVE,
2169 .node = WREPL_NODE_B,
2171 .num_ips = ARRAY_SIZE(addresses_A_1),
2172 .ips = addresses_A_1,
2173 .apply_expected = true
2177 .type = WREPL_TYPE_GROUP,
2178 .state = WREPL_STATE_TOMBSTONE,
2179 .node = WREPL_NODE_B,
2181 .num_ips = ARRAY_SIZE(addresses_A_1),
2182 .ips = addresses_A_1,
2183 .apply_expected = false
2188 * group,released vs. group,active
2189 * => should be replaced
2192 .line = __location__,
2193 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2196 .type = WREPL_TYPE_GROUP,
2197 .state = WREPL_STATE_RELEASED,
2198 .node = WREPL_NODE_B,
2200 .num_ips = ARRAY_SIZE(addresses_A_1),
2201 .ips = addresses_A_1,
2202 .apply_expected = false
2206 .type = WREPL_TYPE_GROUP,
2207 .state = WREPL_STATE_ACTIVE,
2208 .node = WREPL_NODE_B,
2210 .num_ips = ARRAY_SIZE(addresses_B_1),
2211 .ips = addresses_B_1,
2212 .apply_expected = true
2217 * group,released vs. group,tombstone
2218 * => should be replaced
2221 .line = __location__,
2222 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2225 .type = WREPL_TYPE_GROUP,
2226 .state = WREPL_STATE_RELEASED,
2227 .node = WREPL_NODE_B,
2229 .num_ips = ARRAY_SIZE(addresses_A_1),
2230 .ips = addresses_A_1,
2231 .apply_expected = false
2235 .type = WREPL_TYPE_GROUP,
2236 .state = WREPL_STATE_TOMBSTONE,
2237 .node = WREPL_NODE_B,
2239 .num_ips = ARRAY_SIZE(addresses_B_1),
2240 .ips = addresses_B_1,
2241 .apply_expected = true
2246 * group,tombstone vs. group,active
2247 * => should be replaced
2250 .line = __location__,
2251 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2254 .type = WREPL_TYPE_GROUP,
2255 .state = WREPL_STATE_TOMBSTONE,
2256 .node = WREPL_NODE_B,
2258 .num_ips = ARRAY_SIZE(addresses_B_1),
2259 .ips = addresses_B_1,
2260 .apply_expected = true
2264 .type = WREPL_TYPE_GROUP,
2265 .state = WREPL_STATE_ACTIVE,
2266 .node = WREPL_NODE_B,
2268 .num_ips = ARRAY_SIZE(addresses_A_1),
2269 .ips = addresses_A_1,
2270 .apply_expected = true
2275 * group,tombstone vs. group,tombstone
2276 * => should be replaced
2279 .line = __location__,
2280 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2283 .type = WREPL_TYPE_GROUP,
2284 .state = WREPL_STATE_TOMBSTONE,
2285 .node = WREPL_NODE_B,
2287 .num_ips = ARRAY_SIZE(addresses_A_1),
2288 .ips = addresses_A_1,
2289 .apply_expected = true
2293 .type = WREPL_TYPE_GROUP,
2294 .state = WREPL_STATE_TOMBSTONE,
2295 .node = WREPL_NODE_B,
2297 .num_ips = ARRAY_SIZE(addresses_B_1),
2298 .ips = addresses_B_1,
2299 .apply_expected = true
2304 * normal groups vs special groups section,
2307 * group,active vs. sgroup,active
2308 * => should NOT be replaced
2311 .line = __location__,
2312 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2315 .type = WREPL_TYPE_GROUP,
2316 .state = WREPL_STATE_ACTIVE,
2317 .node = WREPL_NODE_B,
2319 .num_ips = ARRAY_SIZE(addresses_B_1),
2320 .ips = addresses_B_1,
2321 .apply_expected = true
2325 .type = WREPL_TYPE_SGROUP,
2326 .state = WREPL_STATE_ACTIVE,
2327 .node = WREPL_NODE_B,
2329 .num_ips = ARRAY_SIZE(addresses_B_1),
2330 .ips = addresses_B_1,
2331 .apply_expected = false
2336 * group,active vs. sgroup,tombstone
2337 * => should NOT be replaced
2340 .line = __location__,
2341 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2344 .type = WREPL_TYPE_GROUP,
2345 .state = WREPL_STATE_ACTIVE,
2346 .node = WREPL_NODE_B,
2348 .num_ips = ARRAY_SIZE(addresses_B_1),
2349 .ips = addresses_B_1,
2350 .apply_expected = true
2354 .type = WREPL_TYPE_SGROUP,
2355 .state = WREPL_STATE_TOMBSTONE,
2356 .node = WREPL_NODE_B,
2358 .num_ips = ARRAY_SIZE(addresses_B_1),
2359 .ips = addresses_B_1,
2360 .apply_expected = false
2365 * group,released vs. sgroup,active
2366 * => should be replaced
2369 .line = __location__,
2370 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2373 .type = WREPL_TYPE_GROUP,
2374 .state = WREPL_STATE_RELEASED,
2375 .node = WREPL_NODE_B,
2377 .num_ips = ARRAY_SIZE(addresses_A_1),
2378 .ips = addresses_A_1,
2379 .apply_expected = false
2383 .type = WREPL_TYPE_SGROUP,
2384 .state = WREPL_STATE_ACTIVE,
2385 .node = WREPL_NODE_B,
2387 .num_ips = ARRAY_SIZE(addresses_B_1),
2388 .ips = addresses_B_1,
2389 .apply_expected = true
2394 * group,released vs. sgroup,tombstone
2395 * => should NOT be replaced
2398 .line = __location__,
2399 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2402 .type = WREPL_TYPE_GROUP,
2403 .state = WREPL_STATE_RELEASED,
2404 .node = WREPL_NODE_B,
2406 .num_ips = ARRAY_SIZE(addresses_B_1),
2407 .ips = addresses_B_1,
2408 .apply_expected = false
2412 .type = WREPL_TYPE_SGROUP,
2413 .state = WREPL_STATE_TOMBSTONE,
2414 .node = WREPL_NODE_B,
2416 .num_ips = ARRAY_SIZE(addresses_B_1),
2417 .ips = addresses_B_1,
2418 .apply_expected = false
2423 * group,tombstone vs. sgroup,active
2424 * => should be replaced
2427 .line = __location__,
2428 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2431 .type = WREPL_TYPE_GROUP,
2432 .state = WREPL_STATE_TOMBSTONE,
2433 .node = WREPL_NODE_B,
2435 .num_ips = ARRAY_SIZE(addresses_B_1),
2436 .ips = addresses_B_1,
2437 .apply_expected = true
2441 .type = WREPL_TYPE_SGROUP,
2442 .state = WREPL_STATE_ACTIVE,
2443 .node = WREPL_NODE_B,
2445 .num_ips = ARRAY_SIZE(addresses_A_1),
2446 .ips = addresses_A_1,
2447 .apply_expected = true
2452 * group,tombstone vs. sgroup,tombstone
2453 * => should be replaced
2456 .line = __location__,
2457 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2460 .type = WREPL_TYPE_GROUP,
2461 .state = WREPL_STATE_TOMBSTONE,
2462 .node = WREPL_NODE_B,
2464 .num_ips = ARRAY_SIZE(addresses_A_1),
2465 .ips = addresses_A_1,
2466 .apply_expected = true
2470 .type = WREPL_TYPE_SGROUP,
2471 .state = WREPL_STATE_TOMBSTONE,
2472 .node = WREPL_NODE_B,
2474 .num_ips = ARRAY_SIZE(addresses_B_1),
2475 .ips = addresses_B_1,
2476 .apply_expected = true
2481 * normal groups vs multi homed section,
2484 * group,active vs. mhomed,active
2485 * => should NOT be replaced
2488 .line = __location__,
2489 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2492 .type = WREPL_TYPE_GROUP,
2493 .state = WREPL_STATE_ACTIVE,
2494 .node = WREPL_NODE_B,
2496 .num_ips = ARRAY_SIZE(addresses_B_1),
2497 .ips = addresses_B_1,
2498 .apply_expected = true
2502 .type = WREPL_TYPE_MHOMED,
2503 .state = WREPL_STATE_ACTIVE,
2504 .node = WREPL_NODE_B,
2506 .num_ips = ARRAY_SIZE(addresses_B_1),
2507 .ips = addresses_B_1,
2508 .apply_expected = false
2513 * group,active vs. mhomed,tombstone
2514 * => should NOT be replaced
2517 .line = __location__,
2518 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2521 .type = WREPL_TYPE_GROUP,
2522 .state = WREPL_STATE_ACTIVE,
2523 .node = WREPL_NODE_B,
2525 .num_ips = ARRAY_SIZE(addresses_B_1),
2526 .ips = addresses_B_1,
2527 .apply_expected = true
2531 .type = WREPL_TYPE_MHOMED,
2532 .state = WREPL_STATE_TOMBSTONE,
2533 .node = WREPL_NODE_B,
2535 .num_ips = ARRAY_SIZE(addresses_B_1),
2536 .ips = addresses_B_1,
2537 .apply_expected = false
2542 * group,released vs. mhomed,active
2543 * => should NOT be replaced
2546 .line = __location__,
2547 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2550 .type = WREPL_TYPE_GROUP,
2551 .state = WREPL_STATE_RELEASED,
2552 .node = WREPL_NODE_B,
2554 .num_ips = ARRAY_SIZE(addresses_B_1),
2555 .ips = addresses_B_1,
2556 .apply_expected = false
2560 .type = WREPL_TYPE_MHOMED,
2561 .state = WREPL_STATE_ACTIVE,
2562 .node = WREPL_NODE_B,
2564 .num_ips = ARRAY_SIZE(addresses_B_1),
2565 .ips = addresses_B_1,
2566 .apply_expected = false
2571 * group,released vs. mhomed,tombstone
2572 * => should NOT be replaced
2575 .line = __location__,
2576 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2579 .type = WREPL_TYPE_GROUP,
2580 .state = WREPL_STATE_RELEASED,
2581 .node = WREPL_NODE_B,
2583 .num_ips = ARRAY_SIZE(addresses_B_1),
2584 .ips = addresses_B_1,
2585 .apply_expected = false
2589 .type = WREPL_TYPE_MHOMED,
2590 .state = WREPL_STATE_TOMBSTONE,
2591 .node = WREPL_NODE_B,
2593 .num_ips = ARRAY_SIZE(addresses_B_1),
2594 .ips = addresses_B_1,
2595 .apply_expected = false
2600 * group,tombstone vs. mhomed,active
2601 * => should be replaced
2604 .line = __location__,
2605 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2608 .type = WREPL_TYPE_GROUP,
2609 .state = WREPL_STATE_TOMBSTONE,
2610 .node = WREPL_NODE_B,
2612 .num_ips = ARRAY_SIZE(addresses_B_1),
2613 .ips = addresses_B_1,
2614 .apply_expected = true
2618 .type = WREPL_TYPE_MHOMED,
2619 .state = WREPL_STATE_ACTIVE,
2620 .node = WREPL_NODE_B,
2622 .num_ips = ARRAY_SIZE(addresses_A_1),
2623 .ips = addresses_A_1,
2624 .apply_expected = true
2629 * group,tombstone vs. mhomed,tombstone
2630 * => should be replaced
2633 .line = __location__,
2634 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2637 .type = WREPL_TYPE_GROUP,
2638 .state = WREPL_STATE_TOMBSTONE,
2639 .node = WREPL_NODE_B,
2641 .num_ips = ARRAY_SIZE(addresses_A_1),
2642 .ips = addresses_A_1,
2643 .apply_expected = true
2647 .type = WREPL_TYPE_MHOMED,
2648 .state = WREPL_STATE_TOMBSTONE,
2649 .node = WREPL_NODE_B,
2651 .num_ips = ARRAY_SIZE(addresses_B_1),
2652 .ips = addresses_B_1,
2653 .apply_expected = true
2658 * special groups vs unique section,
2661 * sgroup,active vs. unique,active
2662 * => should NOT be replaced
2665 .line = __location__,
2666 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2669 .type = WREPL_TYPE_SGROUP,
2670 .state = WREPL_STATE_ACTIVE,
2671 .node = WREPL_NODE_B,
2673 .num_ips = ARRAY_SIZE(addresses_B_1),
2674 .ips = addresses_B_1,
2675 .apply_expected = true
2679 .type = WREPL_TYPE_UNIQUE,
2680 .state = WREPL_STATE_ACTIVE,
2681 .node = WREPL_NODE_B,
2683 .num_ips = ARRAY_SIZE(addresses_B_1),
2684 .ips = addresses_B_1,
2685 .apply_expected = false
2690 * sgroup,active vs. unique,tombstone
2691 * => should NOT be replaced
2694 .line = __location__,
2695 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2698 .type = WREPL_TYPE_SGROUP,
2699 .state = WREPL_STATE_ACTIVE,
2700 .node = WREPL_NODE_B,
2702 .num_ips = ARRAY_SIZE(addresses_B_1),
2703 .ips = addresses_B_1,
2704 .apply_expected = true
2708 .type = WREPL_TYPE_UNIQUE,
2709 .state = WREPL_STATE_TOMBSTONE,
2710 .node = WREPL_NODE_B,
2712 .num_ips = ARRAY_SIZE(addresses_B_1),
2713 .ips = addresses_B_1,
2714 .apply_expected = false
2719 * sgroup,released vs. unique,active
2720 * => should be replaced
2723 .line = __location__,
2724 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2727 .type = WREPL_TYPE_SGROUP,
2728 .state = WREPL_STATE_RELEASED,
2729 .node = WREPL_NODE_B,
2731 .num_ips = ARRAY_SIZE(addresses_B_1),
2732 .ips = addresses_B_1,
2733 .apply_expected = false
2737 .type = WREPL_TYPE_UNIQUE,
2738 .state = WREPL_STATE_ACTIVE,
2739 .node = WREPL_NODE_B,
2741 .num_ips = ARRAY_SIZE(addresses_A_1),
2742 .ips = addresses_A_1,
2743 .apply_expected = true
2748 * sgroup,released vs. unique,tombstone
2749 * => should be replaced
2752 .line = __location__,
2753 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2756 .type = WREPL_TYPE_SGROUP,
2757 .state = WREPL_STATE_RELEASED,
2758 .node = WREPL_NODE_B,
2760 .num_ips = ARRAY_SIZE(addresses_A_1),
2761 .ips = addresses_A_1,
2762 .apply_expected = false
2766 .type = WREPL_TYPE_UNIQUE,
2767 .state = WREPL_STATE_TOMBSTONE,
2768 .node = WREPL_NODE_B,
2770 .num_ips = ARRAY_SIZE(addresses_B_1),
2771 .ips = addresses_B_1,
2772 .apply_expected = true
2777 * sgroup,tombstone vs. unique,active
2778 * => should be replaced
2781 .line = __location__,
2782 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2785 .type = WREPL_TYPE_SGROUP,
2786 .state = WREPL_STATE_TOMBSTONE,
2787 .node = WREPL_NODE_B,
2789 .num_ips = ARRAY_SIZE(addresses_A_1),
2790 .ips = addresses_A_1,
2791 .apply_expected = true
2795 .type = WREPL_TYPE_UNIQUE,
2796 .state = WREPL_STATE_ACTIVE,
2797 .node = WREPL_NODE_B,
2799 .num_ips = ARRAY_SIZE(addresses_B_1),
2800 .ips = addresses_B_1,
2801 .apply_expected = true
2806 * sgroup,tombstone vs. unique,tombstone
2807 * => should be replaced
2810 .line = __location__,
2811 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2814 .type = WREPL_TYPE_SGROUP,
2815 .state = WREPL_STATE_TOMBSTONE,
2816 .node = WREPL_NODE_B,
2818 .num_ips = ARRAY_SIZE(addresses_B_1),
2819 .ips = addresses_B_1,
2820 .apply_expected = true
2824 .type = WREPL_TYPE_UNIQUE,
2825 .state = WREPL_STATE_TOMBSTONE,
2826 .node = WREPL_NODE_B,
2828 .num_ips = ARRAY_SIZE(addresses_A_1),
2829 .ips = addresses_A_1,
2830 .apply_expected = true
2835 * special groups vs normal group section,
2838 * sgroup,active vs. group,active
2839 * => should NOT be replaced
2842 .line = __location__,
2843 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2846 .type = WREPL_TYPE_SGROUP,
2847 .state = WREPL_STATE_ACTIVE,
2848 .node = WREPL_NODE_B,
2850 .num_ips = ARRAY_SIZE(addresses_A_1),
2851 .ips = addresses_A_1,
2852 .apply_expected = true
2856 .type = WREPL_TYPE_GROUP,
2857 .state = WREPL_STATE_ACTIVE,
2858 .node = WREPL_NODE_B,
2860 .num_ips = ARRAY_SIZE(addresses_A_1),
2861 .ips = addresses_A_1,
2862 .apply_expected = false
2867 * sgroup,active vs. group,tombstone
2868 * => should NOT be replaced
2871 .line = __location__,
2872 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2875 .type = WREPL_TYPE_SGROUP,
2876 .state = WREPL_STATE_ACTIVE,
2877 .node = WREPL_NODE_B,
2879 .num_ips = ARRAY_SIZE(addresses_A_1),
2880 .ips = addresses_A_1,
2881 .apply_expected = true
2885 .type = WREPL_TYPE_GROUP,
2886 .state = WREPL_STATE_TOMBSTONE,
2887 .node = WREPL_NODE_B,
2889 .num_ips = ARRAY_SIZE(addresses_A_1),
2890 .ips = addresses_A_1,
2891 .apply_expected = false
2896 * sgroup,released vs. group,active
2897 * => should be replaced
2900 .line = __location__,
2901 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2904 .type = WREPL_TYPE_SGROUP,
2905 .state = WREPL_STATE_RELEASED,
2906 .node = WREPL_NODE_B,
2908 .num_ips = ARRAY_SIZE(addresses_A_1),
2909 .ips = addresses_A_1,
2910 .apply_expected = false
2914 .type = WREPL_TYPE_GROUP,
2915 .state = WREPL_STATE_ACTIVE,
2916 .node = WREPL_NODE_B,
2918 .num_ips = ARRAY_SIZE(addresses_B_1),
2919 .ips = addresses_B_1,
2920 .apply_expected = true
2925 * sgroup,released vs. group,tombstone
2926 * => should be replaced
2929 .line = __location__,
2930 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2933 .type = WREPL_TYPE_SGROUP,
2934 .state = WREPL_STATE_RELEASED,
2935 .node = WREPL_NODE_B,
2937 .num_ips = ARRAY_SIZE(addresses_B_1),
2938 .ips = addresses_B_1,
2939 .apply_expected = false
2943 .type = WREPL_TYPE_GROUP,
2944 .state = WREPL_STATE_TOMBSTONE,
2945 .node = WREPL_NODE_B,
2947 .num_ips = ARRAY_SIZE(addresses_A_1),
2948 .ips = addresses_A_1,
2949 .apply_expected = true
2954 * sgroup,tombstone vs. group,active
2955 * => should NOT be replaced
2958 .line = __location__,
2959 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2962 .type = WREPL_TYPE_SGROUP,
2963 .state = WREPL_STATE_TOMBSTONE,
2964 .node = WREPL_NODE_B,
2966 .num_ips = ARRAY_SIZE(addresses_A_1),
2967 .ips = addresses_A_1,
2968 .apply_expected = true
2972 .type = WREPL_TYPE_GROUP,
2973 .state = WREPL_STATE_ACTIVE,
2974 .node = WREPL_NODE_B,
2976 .num_ips = ARRAY_SIZE(addresses_B_1),
2977 .ips = addresses_B_1,
2978 .apply_expected = true
2983 * sgroup,tombstone vs. group,tombstone
2984 * => should NOT be replaced
2987 .line = __location__,
2988 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2991 .type = WREPL_TYPE_SGROUP,
2992 .state = WREPL_STATE_TOMBSTONE,
2993 .node = WREPL_NODE_B,
2995 .num_ips = ARRAY_SIZE(addresses_B_1),
2996 .ips = addresses_B_1,
2997 .apply_expected = true
3001 .type = WREPL_TYPE_GROUP,
3002 .state = WREPL_STATE_TOMBSTONE,
3003 .node = WREPL_NODE_B,
3005 .num_ips = ARRAY_SIZE(addresses_A_1),
3006 .ips = addresses_A_1,
3007 .apply_expected = true
3012 * special groups (not active) vs special group section,
3015 * sgroup,released vs. sgroup,active
3016 * => should be replaced
3019 .line = __location__,
3020 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3023 .type = WREPL_TYPE_SGROUP,
3024 .state = WREPL_STATE_RELEASED,
3025 .node = WREPL_NODE_B,
3027 .num_ips = ARRAY_SIZE(addresses_A_1),
3028 .ips = addresses_A_1,
3029 .apply_expected = false
3033 .type = WREPL_TYPE_SGROUP,
3034 .state = WREPL_STATE_ACTIVE,
3035 .node = WREPL_NODE_B,
3037 .num_ips = ARRAY_SIZE(addresses_B_1),
3038 .ips = addresses_B_1,
3039 .apply_expected = true
3044 * sgroup,released vs. sgroup,tombstone
3045 * => should be replaced
3048 .line = __location__,
3049 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3052 .type = WREPL_TYPE_SGROUP,
3053 .state = WREPL_STATE_RELEASED,
3054 .node = WREPL_NODE_B,
3056 .num_ips = ARRAY_SIZE(addresses_B_1),
3057 .ips = addresses_B_1,
3058 .apply_expected = false
3062 .type = WREPL_TYPE_SGROUP,
3063 .state = WREPL_STATE_TOMBSTONE,
3064 .node = WREPL_NODE_B,
3066 .num_ips = ARRAY_SIZE(addresses_A_1),
3067 .ips = addresses_A_1,
3068 .apply_expected = true
3073 * sgroup,tombstone vs. sgroup,active
3074 * => should NOT be replaced
3077 .line = __location__,
3078 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3081 .type = WREPL_TYPE_SGROUP,
3082 .state = WREPL_STATE_TOMBSTONE,
3083 .node = WREPL_NODE_B,
3085 .num_ips = ARRAY_SIZE(addresses_A_1),
3086 .ips = addresses_A_1,
3087 .apply_expected = true
3091 .type = WREPL_TYPE_SGROUP,
3092 .state = WREPL_STATE_ACTIVE,
3093 .node = WREPL_NODE_B,
3095 .num_ips = ARRAY_SIZE(addresses_B_1),
3096 .ips = addresses_B_1,
3097 .apply_expected = true
3102 * sgroup,tombstone vs. sgroup,tombstone
3103 * => should NOT be replaced
3106 .line = __location__,
3107 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3110 .type = WREPL_TYPE_SGROUP,
3111 .state = WREPL_STATE_TOMBSTONE,
3112 .node = WREPL_NODE_B,
3114 .num_ips = ARRAY_SIZE(addresses_B_1),
3115 .ips = addresses_B_1,
3116 .apply_expected = true
3120 .type = WREPL_TYPE_SGROUP,
3121 .state = WREPL_STATE_TOMBSTONE,
3122 .node = WREPL_NODE_B,
3124 .num_ips = ARRAY_SIZE(addresses_A_1),
3125 .ips = addresses_A_1,
3126 .apply_expected = true
3131 * special groups vs multi homed section,
3134 * sgroup,active vs. mhomed,active
3135 * => should NOT be replaced
3138 .line = __location__,
3139 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3142 .type = WREPL_TYPE_SGROUP,
3143 .state = WREPL_STATE_ACTIVE,
3144 .node = WREPL_NODE_B,
3146 .num_ips = ARRAY_SIZE(addresses_A_1),
3147 .ips = addresses_A_1,
3148 .apply_expected = true
3152 .type = WREPL_TYPE_MHOMED,
3153 .state = WREPL_STATE_ACTIVE,
3154 .node = WREPL_NODE_B,
3156 .num_ips = ARRAY_SIZE(addresses_A_1),
3157 .ips = addresses_A_1,
3158 .apply_expected = false
3163 * sgroup,active vs. mhomed,tombstone
3164 * => should NOT be replaced
3167 .line = __location__,
3168 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3171 .type = WREPL_TYPE_SGROUP,
3172 .state = WREPL_STATE_ACTIVE,
3173 .node = WREPL_NODE_B,
3175 .num_ips = ARRAY_SIZE(addresses_A_1),
3176 .ips = addresses_A_1,
3177 .apply_expected = true
3181 .type = WREPL_TYPE_MHOMED,
3182 .state = WREPL_STATE_TOMBSTONE,
3183 .node = WREPL_NODE_B,
3185 .num_ips = ARRAY_SIZE(addresses_A_1),
3186 .ips = addresses_A_1,
3187 .apply_expected = false
3192 * sgroup,released vs. mhomed,active
3193 * => should be replaced
3196 .line = __location__,
3197 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3200 .type = WREPL_TYPE_SGROUP,
3201 .state = WREPL_STATE_RELEASED,
3202 .node = WREPL_NODE_B,
3204 .num_ips = ARRAY_SIZE(addresses_A_1),
3205 .ips = addresses_A_1,
3206 .apply_expected = false
3210 .type = WREPL_TYPE_MHOMED,
3211 .state = WREPL_STATE_ACTIVE,
3212 .node = WREPL_NODE_B,
3214 .num_ips = ARRAY_SIZE(addresses_B_1),
3215 .ips = addresses_B_1,
3216 .apply_expected = true
3221 * sgroup,released vs. mhomed,tombstone
3222 * => should be replaced
3225 .line = __location__,
3226 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3229 .type = WREPL_TYPE_SGROUP,
3230 .state = WREPL_STATE_RELEASED,
3231 .node = WREPL_NODE_B,
3233 .num_ips = ARRAY_SIZE(addresses_B_1),
3234 .ips = addresses_B_1,
3235 .apply_expected = false
3239 .type = WREPL_TYPE_MHOMED,
3240 .state = WREPL_STATE_TOMBSTONE,
3241 .node = WREPL_NODE_B,
3243 .num_ips = ARRAY_SIZE(addresses_A_1),
3244 .ips = addresses_A_1,
3245 .apply_expected = true
3250 * sgroup,tombstone vs. mhomed,active
3251 * => should be replaced
3254 .line = __location__,
3255 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3258 .type = WREPL_TYPE_SGROUP,
3259 .state = WREPL_STATE_TOMBSTONE,
3260 .node = WREPL_NODE_B,
3262 .num_ips = ARRAY_SIZE(addresses_A_1),
3263 .ips = addresses_A_1,
3264 .apply_expected = true
3268 .type = WREPL_TYPE_MHOMED,
3269 .state = WREPL_STATE_ACTIVE,
3270 .node = WREPL_NODE_B,
3272 .num_ips = ARRAY_SIZE(addresses_B_1),
3273 .ips = addresses_B_1,
3274 .apply_expected = true
3279 * sgroup,tombstone vs. mhomed,tombstone
3280 * => should be replaced
3283 .line = __location__,
3284 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3287 .type = WREPL_TYPE_SGROUP,
3288 .state = WREPL_STATE_TOMBSTONE,
3289 .node = WREPL_NODE_B,
3291 .num_ips = ARRAY_SIZE(addresses_B_1),
3292 .ips = addresses_B_1,
3293 .apply_expected = true
3297 .type = WREPL_TYPE_MHOMED,
3298 .state = WREPL_STATE_TOMBSTONE,
3299 .node = WREPL_NODE_B,
3301 .num_ips = ARRAY_SIZE(addresses_A_1),
3302 .ips = addresses_A_1,
3303 .apply_expected = true
3308 * multi homed vs. unique section,
3311 * mhomed,active vs. unique,active
3312 * => should be replaced
3315 .line = __location__,
3316 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3319 .type = WREPL_TYPE_MHOMED,
3320 .state = WREPL_STATE_ACTIVE,
3321 .node = WREPL_NODE_B,
3323 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3324 .ips = addresses_A_3_4,
3325 .apply_expected = true
3329 .type = WREPL_TYPE_UNIQUE,
3330 .state = WREPL_STATE_ACTIVE,
3331 .node = WREPL_NODE_B,
3333 .num_ips = ARRAY_SIZE(addresses_B_1),
3334 .ips = addresses_B_1,
3335 .apply_expected = true
3340 * mhomed,active vs. unique,tombstone
3341 * => should NOT be replaced
3344 .line = __location__,
3345 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3348 .type = WREPL_TYPE_MHOMED,
3349 .state = WREPL_STATE_ACTIVE,
3350 .node = WREPL_NODE_B,
3352 .num_ips = ARRAY_SIZE(addresses_B_1),
3353 .ips = addresses_B_1,
3354 .apply_expected = true
3358 .type = WREPL_TYPE_UNIQUE,
3359 .state = WREPL_STATE_TOMBSTONE,
3360 .node = WREPL_NODE_B,
3362 .num_ips = ARRAY_SIZE(addresses_B_1),
3363 .ips = addresses_B_1,
3364 .apply_expected = false
3369 * mhomed,released vs. unique,active
3370 * => should be replaced
3373 .line = __location__,
3374 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3377 .type = WREPL_TYPE_MHOMED,
3378 .state = WREPL_STATE_RELEASED,
3379 .node = WREPL_NODE_B,
3381 .num_ips = ARRAY_SIZE(addresses_A_1),
3382 .ips = addresses_A_1,
3383 .apply_expected = false
3387 .type = WREPL_TYPE_UNIQUE,
3388 .state = WREPL_STATE_ACTIVE,
3389 .node = WREPL_NODE_B,
3391 .num_ips = ARRAY_SIZE(addresses_B_1),
3392 .ips = addresses_B_1,
3393 .apply_expected = true
3398 * mhomed,released vs. uinique,tombstone
3399 * => should be replaced
3402 .line = __location__,
3403 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3406 .type = WREPL_TYPE_MHOMED,
3407 .state = WREPL_STATE_RELEASED,
3408 .node = WREPL_NODE_B,
3410 .num_ips = ARRAY_SIZE(addresses_B_1),
3411 .ips = addresses_B_1,
3412 .apply_expected = false
3416 .type = WREPL_TYPE_UNIQUE,
3417 .state = WREPL_STATE_TOMBSTONE,
3418 .node = WREPL_NODE_B,
3420 .num_ips = ARRAY_SIZE(addresses_A_1),
3421 .ips = addresses_A_1,
3422 .apply_expected = true
3427 * mhomed,tombstone vs. unique,active
3428 * => should be replaced
3431 .line = __location__,
3432 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3435 .type = WREPL_TYPE_MHOMED,
3436 .state = WREPL_STATE_TOMBSTONE,
3437 .node = WREPL_NODE_B,
3439 .num_ips = ARRAY_SIZE(addresses_A_1),
3440 .ips = addresses_A_1,
3441 .apply_expected = true
3445 .type = WREPL_TYPE_UNIQUE,
3446 .state = WREPL_STATE_ACTIVE,
3447 .node = WREPL_NODE_B,
3449 .num_ips = ARRAY_SIZE(addresses_B_1),
3450 .ips = addresses_B_1,
3451 .apply_expected = true
3456 * mhomed,tombstone vs. uinique,tombstone
3457 * => should be replaced
3460 .line = __location__,
3461 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3464 .type = WREPL_TYPE_MHOMED,
3465 .state = WREPL_STATE_TOMBSTONE,
3466 .node = WREPL_NODE_B,
3468 .num_ips = ARRAY_SIZE(addresses_B_1),
3469 .ips = addresses_B_1,
3470 .apply_expected = true
3474 .type = WREPL_TYPE_UNIQUE,
3475 .state = WREPL_STATE_TOMBSTONE,
3476 .node = WREPL_NODE_B,
3478 .num_ips = ARRAY_SIZE(addresses_A_1),
3479 .ips = addresses_A_1,
3480 .apply_expected = true
3485 * multi homed vs. normal group section,
3488 * mhomed,active vs. group,active
3489 * => should be replaced
3492 .line = __location__,
3493 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3496 .type = WREPL_TYPE_MHOMED,
3497 .state = WREPL_STATE_ACTIVE,
3498 .node = WREPL_NODE_B,
3500 .num_ips = ARRAY_SIZE(addresses_A_1),
3501 .ips = addresses_A_1,
3502 .apply_expected = true
3506 .type = WREPL_TYPE_GROUP,
3507 .state = WREPL_STATE_ACTIVE,
3508 .node = WREPL_NODE_B,
3510 .num_ips = ARRAY_SIZE(addresses_B_1),
3511 .ips = addresses_B_1,
3512 .apply_expected = true
3517 * mhomed,active vs. group,tombstone
3518 * => should NOT be replaced
3521 .line = __location__,
3522 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3525 .type = WREPL_TYPE_MHOMED,
3526 .state = WREPL_STATE_ACTIVE,
3527 .node = WREPL_NODE_B,
3529 .num_ips = ARRAY_SIZE(addresses_B_1),
3530 .ips = addresses_B_1,
3531 .apply_expected = true
3535 .type = WREPL_TYPE_GROUP,
3536 .state = WREPL_STATE_TOMBSTONE,
3537 .node = WREPL_NODE_B,
3539 .num_ips = ARRAY_SIZE(addresses_B_1),
3540 .ips = addresses_B_1,
3541 .apply_expected = false
3546 * mhomed,released vs. group,active
3547 * => should be replaced
3550 .line = __location__,
3551 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3554 .type = WREPL_TYPE_MHOMED,
3555 .state = WREPL_STATE_RELEASED,
3556 .node = WREPL_NODE_B,
3558 .num_ips = ARRAY_SIZE(addresses_B_1),
3559 .ips = addresses_B_1,
3560 .apply_expected = false
3564 .type = WREPL_TYPE_GROUP,
3565 .state = WREPL_STATE_ACTIVE,
3566 .node = WREPL_NODE_B,
3568 .num_ips = ARRAY_SIZE(addresses_A_1),
3569 .ips = addresses_A_1,
3570 .apply_expected = true
3575 * mhomed,released vs. group,tombstone
3576 * => should be replaced
3579 .line = __location__,
3580 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3583 .type = WREPL_TYPE_MHOMED,
3584 .state = WREPL_STATE_RELEASED,
3585 .node = WREPL_NODE_B,
3587 .num_ips = ARRAY_SIZE(addresses_A_1),
3588 .ips = addresses_A_1,
3589 .apply_expected = false
3593 .type = WREPL_TYPE_GROUP,
3594 .state = WREPL_STATE_TOMBSTONE,
3595 .node = WREPL_NODE_B,
3597 .num_ips = ARRAY_SIZE(addresses_B_1),
3598 .ips = addresses_B_1,
3599 .apply_expected = true
3604 * mhomed,tombstone vs. group,active
3605 * => should be replaced
3608 .line = __location__,
3609 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3612 .type = WREPL_TYPE_MHOMED,
3613 .state = WREPL_STATE_TOMBSTONE,
3614 .node = WREPL_NODE_B,
3616 .num_ips = ARRAY_SIZE(addresses_B_1),
3617 .ips = addresses_B_1,
3618 .apply_expected = true
3622 .type = WREPL_TYPE_GROUP,
3623 .state = WREPL_STATE_ACTIVE,
3624 .node = WREPL_NODE_B,
3626 .num_ips = ARRAY_SIZE(addresses_A_1),
3627 .ips = addresses_A_1,
3628 .apply_expected = true
3633 * mhomed,tombstone vs. group,tombstone
3634 * => should be replaced
3637 .line = __location__,
3638 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3641 .type = WREPL_TYPE_MHOMED,
3642 .state = WREPL_STATE_TOMBSTONE,
3643 .node = WREPL_NODE_B,
3645 .num_ips = ARRAY_SIZE(addresses_A_1),
3646 .ips = addresses_A_1,
3647 .apply_expected = true
3651 .type = WREPL_TYPE_GROUP,
3652 .state = WREPL_STATE_TOMBSTONE,
3653 .node = WREPL_NODE_B,
3655 .num_ips = ARRAY_SIZE(addresses_B_1),
3656 .ips = addresses_B_1,
3657 .apply_expected = true
3662 * multi homed vs. special group section,
3665 * mhomed,active vs. sgroup,active
3666 * => should NOT be replaced
3669 .line = __location__,
3670 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3673 .type = WREPL_TYPE_MHOMED,
3674 .state = WREPL_STATE_ACTIVE,
3675 .node = WREPL_NODE_B,
3677 .num_ips = ARRAY_SIZE(addresses_A_1),
3678 .ips = addresses_A_1,
3679 .apply_expected = true
3683 .type = WREPL_TYPE_SGROUP,
3684 .state = WREPL_STATE_ACTIVE,
3685 .node = WREPL_NODE_B,
3687 .num_ips = ARRAY_SIZE(addresses_A_1),
3688 .ips = addresses_A_1,
3689 .apply_expected = false
3694 * mhomed,active vs. sgroup,tombstone
3695 * => should NOT be replaced
3698 .line = __location__,
3699 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3702 .type = WREPL_TYPE_MHOMED,
3703 .state = WREPL_STATE_ACTIVE,
3704 .node = WREPL_NODE_B,
3706 .num_ips = ARRAY_SIZE(addresses_A_1),
3707 .ips = addresses_A_1,
3708 .apply_expected = true
3712 .type = WREPL_TYPE_SGROUP,
3713 .state = WREPL_STATE_TOMBSTONE,
3714 .node = WREPL_NODE_B,
3716 .num_ips = ARRAY_SIZE(addresses_A_1),
3717 .ips = addresses_A_1,
3718 .apply_expected = false
3723 * mhomed,released vs. sgroup,active
3724 * => should be replaced
3727 .line = __location__,
3728 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3731 .type = WREPL_TYPE_MHOMED,
3732 .state = WREPL_STATE_RELEASED,
3733 .node = WREPL_NODE_B,
3735 .num_ips = ARRAY_SIZE(addresses_A_1),
3736 .ips = addresses_A_1,
3737 .apply_expected = false
3741 .type = WREPL_TYPE_SGROUP,
3742 .state = WREPL_STATE_ACTIVE,
3743 .node = WREPL_NODE_B,
3745 .num_ips = ARRAY_SIZE(addresses_B_1),
3746 .ips = addresses_B_1,
3747 .apply_expected = true
3752 * mhomed,released vs. sgroup,tombstone
3753 * => should be replaced
3756 .line = __location__,
3757 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3760 .type = WREPL_TYPE_MHOMED,
3761 .state = WREPL_STATE_RELEASED,
3762 .node = WREPL_NODE_B,
3764 .num_ips = ARRAY_SIZE(addresses_B_1),
3765 .ips = addresses_B_1,
3766 .apply_expected = false
3770 .type = WREPL_TYPE_SGROUP,
3771 .state = WREPL_STATE_TOMBSTONE,
3772 .node = WREPL_NODE_B,
3774 .num_ips = ARRAY_SIZE(addresses_A_1),
3775 .ips = addresses_A_1,
3776 .apply_expected = true
3781 * mhomed,tombstone vs. sgroup,active
3782 * => should be replaced
3785 .line = __location__,
3786 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3789 .type = WREPL_TYPE_MHOMED,
3790 .state = WREPL_STATE_TOMBSTONE,
3791 .node = WREPL_NODE_B,
3793 .num_ips = ARRAY_SIZE(addresses_A_1),
3794 .ips = addresses_A_1,
3795 .apply_expected = true
3799 .type = WREPL_TYPE_SGROUP,
3800 .state = WREPL_STATE_ACTIVE,
3801 .node = WREPL_NODE_B,
3803 .num_ips = ARRAY_SIZE(addresses_B_1),
3804 .ips = addresses_B_1,
3805 .apply_expected = true
3810 * mhomed,tombstone vs. sgroup,tombstone
3811 * => should be replaced
3814 .line = __location__,
3815 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3818 .type = WREPL_TYPE_MHOMED,
3819 .state = WREPL_STATE_TOMBSTONE,
3820 .node = WREPL_NODE_B,
3822 .num_ips = ARRAY_SIZE(addresses_B_1),
3823 .ips = addresses_B_1,
3824 .apply_expected = true
3828 .type = WREPL_TYPE_SGROUP,
3829 .state = WREPL_STATE_TOMBSTONE,
3830 .node = WREPL_NODE_B,
3832 .num_ips = ARRAY_SIZE(addresses_A_1),
3833 .ips = addresses_A_1,
3834 .apply_expected = true
3839 * multi homed vs. mlti homed section,
3842 * mhomed,active vs. mhomed,active
3843 * => should be replaced
3846 .line = __location__,
3847 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3850 .type = WREPL_TYPE_MHOMED,
3851 .state = WREPL_STATE_ACTIVE,
3852 .node = WREPL_NODE_B,
3854 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3855 .ips = addresses_A_3_4,
3856 .apply_expected = true
3860 .type = WREPL_TYPE_MHOMED,
3861 .state = WREPL_STATE_ACTIVE,
3862 .node = WREPL_NODE_B,
3864 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3865 .ips = addresses_B_3_4,
3866 .apply_expected = true
3871 * mhomed,active vs. mhomed,tombstone
3872 * => should NOT be replaced
3875 .line = __location__,
3876 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3879 .type = WREPL_TYPE_MHOMED,
3880 .state = WREPL_STATE_ACTIVE,
3881 .node = WREPL_NODE_B,
3883 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3884 .ips = addresses_B_3_4,
3885 .apply_expected = true
3889 .type = WREPL_TYPE_MHOMED,
3890 .state = WREPL_STATE_TOMBSTONE,
3891 .node = WREPL_NODE_B,
3893 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3894 .ips = addresses_B_3_4,
3895 .apply_expected = false
3900 * mhomed,released vs. mhomed,active
3901 * => should be replaced
3904 .line = __location__,
3905 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3908 .type = WREPL_TYPE_MHOMED,
3909 .state = WREPL_STATE_RELEASED,
3910 .node = WREPL_NODE_B,
3912 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3913 .ips = addresses_B_3_4,
3914 .apply_expected = false
3918 .type = WREPL_TYPE_MHOMED,
3919 .state = WREPL_STATE_ACTIVE,
3920 .node = WREPL_NODE_B,
3922 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3923 .ips = addresses_A_3_4,
3924 .apply_expected = true
3929 * mhomed,released vs. mhomed,tombstone
3930 * => should be replaced
3933 .line = __location__,
3934 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3937 .type = WREPL_TYPE_MHOMED,
3938 .state = WREPL_STATE_RELEASED,
3939 .node = WREPL_NODE_B,
3941 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3942 .ips = addresses_A_3_4,
3943 .apply_expected = false
3947 .type = WREPL_TYPE_MHOMED,
3948 .state = WREPL_STATE_TOMBSTONE,
3949 .node = WREPL_NODE_B,
3951 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3952 .ips = addresses_B_3_4,
3953 .apply_expected = true
3958 * mhomed,tombstone vs. mhomed,active
3959 * => should be replaced
3962 .line = __location__,
3963 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3966 .type = WREPL_TYPE_MHOMED,
3967 .state = WREPL_STATE_TOMBSTONE,
3968 .node = WREPL_NODE_B,
3970 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3971 .ips = addresses_B_3_4,
3972 .apply_expected = true
3976 .type = WREPL_TYPE_MHOMED,
3977 .state = WREPL_STATE_ACTIVE,
3978 .node = WREPL_NODE_B,
3980 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3981 .ips = addresses_A_3_4,
3982 .apply_expected = true
3987 * mhomed,tombstone vs. mhomed,tombstone
3988 * => should be replaced
3991 .line = __location__,
3992 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3995 .type = WREPL_TYPE_MHOMED,
3996 .state = WREPL_STATE_TOMBSTONE,
3997 .node = WREPL_NODE_B,
3999 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4000 .ips = addresses_A_3_4,
4001 .apply_expected = true
4005 .type = WREPL_TYPE_MHOMED,
4006 .state = WREPL_STATE_TOMBSTONE,
4007 .node = WREPL_NODE_B,
4009 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4010 .ips = addresses_B_3_4,
4011 .apply_expected = true
4015 .line = __location__,
4016 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4020 .type = WREPL_TYPE_UNIQUE,
4021 .state = WREPL_STATE_TOMBSTONE,
4022 .node = WREPL_NODE_B,
4024 .num_ips = ARRAY_SIZE(addresses_B_1),
4025 .ips = addresses_B_1,
4026 .apply_expected = true,
4030 .type = WREPL_TYPE_UNIQUE,
4031 .state = WREPL_STATE_TOMBSTONE,
4032 .node = WREPL_NODE_B,
4034 .num_ips = ARRAY_SIZE(addresses_A_1),
4035 .ips = addresses_A_1,
4036 .apply_expected = true,
4040 * special group vs special group section,
4043 * sgroup,active vs. sgroup,active same addresses
4044 * => should be NOT replaced
4047 .line = __location__,
4048 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4049 .comment= "A:A_3_4 vs. B:A_3_4",
4053 .type = WREPL_TYPE_SGROUP,
4054 .state = WREPL_STATE_ACTIVE,
4055 .node = WREPL_NODE_B,
4057 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4058 .ips = addresses_A_3_4,
4059 .apply_expected = true
4063 .type = WREPL_TYPE_SGROUP,
4064 .state = WREPL_STATE_ACTIVE,
4065 .node = WREPL_NODE_B,
4067 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4068 .ips = addresses_A_3_4,
4069 .apply_expected = false,
4070 .sgroup_cleanup = true
4074 * sgroup,active vs. sgroup,active same addresses
4075 * => should be NOT replaced
4078 .line = __location__,
4079 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4080 .comment= "A:A_3_4 vs. B:NULL",
4084 .type = WREPL_TYPE_SGROUP,
4085 .state = WREPL_STATE_ACTIVE,
4086 .node = WREPL_NODE_B,
4088 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4089 .ips = addresses_A_3_4,
4090 .apply_expected = true
4094 .type = WREPL_TYPE_SGROUP,
4095 .state = WREPL_STATE_ACTIVE,
4096 .node = WREPL_NODE_B,
4100 .apply_expected = false,
4101 .sgroup_cleanup = true
4105 * sgroup,active vs. sgroup,active subset addresses, special case...
4106 * => should NOT be replaced
4109 .line = __location__,
4110 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4111 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4",
4115 .type = WREPL_TYPE_SGROUP,
4116 .state = WREPL_STATE_ACTIVE,
4117 .node = WREPL_NODE_B,
4119 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4120 .ips = addresses_A_3_4_X_3_4,
4121 .apply_expected = true,
4125 .type = WREPL_TYPE_SGROUP,
4126 .state = WREPL_STATE_ACTIVE,
4127 .node = WREPL_NODE_B,
4129 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4130 .ips = addresses_A_3_4,
4131 .apply_expected = false,
4135 .line = __location__,
4136 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4140 .type = WREPL_TYPE_SGROUP,
4141 .state = WREPL_STATE_ACTIVE,
4142 .node = WREPL_NODE_B,
4146 .apply_expected = false,
4150 .type = WREPL_TYPE_SGROUP,
4151 .state = WREPL_STATE_ACTIVE,
4152 .node = WREPL_NODE_B,
4156 .apply_expected = false,
4160 * sgroup,active vs. sgroup,active different addresses, but owner changed
4161 * => should be replaced
4164 .line = __location__,
4165 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4166 .comment= "A:B_3_4 vs. B:A_3_4",
4170 .type = WREPL_TYPE_SGROUP,
4171 .state = WREPL_STATE_ACTIVE,
4172 .node = WREPL_NODE_B,
4174 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4175 .ips = addresses_B_3_4,
4176 .apply_expected = true,
4180 .type = WREPL_TYPE_SGROUP,
4181 .state = WREPL_STATE_ACTIVE,
4182 .node = WREPL_NODE_B,
4184 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4185 .ips = addresses_A_3_4,
4186 .apply_expected = true,
4187 .sgroup_cleanup = true
4191 * sgroup,active vs. sgroup,active different addresses, but owner changed
4192 * => should be replaced
4195 .line = __location__,
4196 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4197 .comment= "A:A_3_4 vs. B:A_3_4_OWNER_B",
4201 .type = WREPL_TYPE_SGROUP,
4202 .state = WREPL_STATE_ACTIVE,
4203 .node = WREPL_NODE_B,
4205 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4206 .ips = addresses_A_3_4,
4207 .apply_expected = true,
4211 .type = WREPL_TYPE_SGROUP,
4212 .state = WREPL_STATE_ACTIVE,
4213 .node = WREPL_NODE_B,
4215 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4216 .ips = addresses_A_3_4_OWNER_B,
4217 .apply_expected = true,
4218 .sgroup_cleanup = true
4222 * sgroup,active vs. sgroup,active different addresses, but owner changed
4223 * => should be replaced
4226 .line = __location__,
4227 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4228 .comment= "A:A_3_4_OWNER_B vs. B:A_3_4",
4232 .type = WREPL_TYPE_SGROUP,
4233 .state = WREPL_STATE_ACTIVE,
4234 .node = WREPL_NODE_B,
4236 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4237 .ips = addresses_A_3_4_OWNER_B,
4238 .apply_expected = true,
4242 .type = WREPL_TYPE_SGROUP,
4243 .state = WREPL_STATE_ACTIVE,
4244 .node = WREPL_NODE_B,
4246 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4247 .ips = addresses_A_3_4,
4248 .apply_expected = true,
4249 .sgroup_cleanup = true
4253 * sgroup,active vs. sgroup,active different addresses
4254 * => should be merged
4257 .line = __location__,
4258 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4259 .comment= "A:A_3_4 vs. B:B_3_4 => C:A_3_4_B_3_4",
4263 .type = WREPL_TYPE_SGROUP,
4264 .state = WREPL_STATE_ACTIVE,
4265 .node = WREPL_NODE_B,
4267 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4268 .ips = addresses_A_3_4,
4269 .apply_expected = true,
4273 .type = WREPL_TYPE_SGROUP,
4274 .state = WREPL_STATE_ACTIVE,
4275 .node = WREPL_NODE_B,
4277 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4278 .ips = addresses_B_3_4,
4279 .sgroup_merge = true,
4280 .sgroup_cleanup = true,
4284 * sgroup,active vs. sgroup,active different addresses, special case...
4285 * => should be merged
4288 .line = __location__,
4289 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4290 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4_X_3_4",
4294 .type = WREPL_TYPE_SGROUP,
4295 .state = WREPL_STATE_ACTIVE,
4296 .node = WREPL_NODE_B,
4298 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4299 .ips = addresses_B_3_4_X_3_4,
4300 .apply_expected = true,
4304 .type = WREPL_TYPE_SGROUP,
4305 .state = WREPL_STATE_ACTIVE,
4306 .node = WREPL_NODE_B,
4308 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4309 .ips = addresses_A_3_4,
4310 .sgroup_merge = true,
4311 .merge_owner = &ctx->b,
4312 .sgroup_cleanup = false
4316 .line = __location__,
4317 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4321 .type = WREPL_TYPE_SGROUP,
4322 .state = WREPL_STATE_ACTIVE,
4323 .node = WREPL_NODE_B,
4325 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4_OWNER_B),
4326 .ips = addresses_A_3_4_X_3_4_OWNER_B,
4327 .apply_expected = true,
4331 .type = WREPL_TYPE_SGROUP,
4332 .state = WREPL_STATE_ACTIVE,
4333 .node = WREPL_NODE_B,
4337 .apply_expected = false,
4341 * sgroup,active vs. sgroup,active different addresses, special case...
4342 * => should be merged
4345 .line = __location__,
4346 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4347 .comment= "A:X_3_4 vs. B:A_3_4 => C:A_3_4_X_3_4",
4351 .type = WREPL_TYPE_SGROUP,
4352 .state = WREPL_STATE_ACTIVE,
4353 .node = WREPL_NODE_B,
4355 .num_ips = ARRAY_SIZE(addresses_X_3_4),
4356 .ips = addresses_X_3_4,
4357 .apply_expected = true,
4361 .type = WREPL_TYPE_SGROUP,
4362 .state = WREPL_STATE_ACTIVE,
4363 .node = WREPL_NODE_B,
4365 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4366 .ips = addresses_A_3_4,
4367 .sgroup_merge = true,
4368 .sgroup_cleanup = false
4372 .line = __location__,
4373 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4377 .type = WREPL_TYPE_SGROUP,
4378 .state = WREPL_STATE_ACTIVE,
4379 .node = WREPL_NODE_B,
4383 .apply_expected = false,
4387 .type = WREPL_TYPE_SGROUP,
4388 .state = WREPL_STATE_ACTIVE,
4389 .node = WREPL_NODE_B,
4393 .apply_expected = false,
4397 * sgroup,active vs. sgroup,active different addresses, special case...
4398 * => should be merged
4401 .line = __location__,
4402 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4403 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4_OWNER_B => B:A_3_4_OWNER_B_X_3_4",
4407 .type = WREPL_TYPE_SGROUP,
4408 .state = WREPL_STATE_ACTIVE,
4409 .node = WREPL_NODE_B,
4411 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4412 .ips = addresses_A_3_4_X_3_4,
4413 .apply_expected = true,
4417 .type = WREPL_TYPE_SGROUP,
4418 .state = WREPL_STATE_ACTIVE,
4419 .node = WREPL_NODE_B,
4421 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4422 .ips = addresses_A_3_4_OWNER_B,
4423 .sgroup_merge = true,
4424 .merge_owner = &ctx->b,
4428 .line = __location__,
4429 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4433 .type = WREPL_TYPE_SGROUP,
4434 .state = WREPL_STATE_ACTIVE,
4435 .node = WREPL_NODE_B,
4439 .apply_expected = false,
4443 .type = WREPL_TYPE_SGROUP,
4444 .state = WREPL_STATE_ACTIVE,
4445 .node = WREPL_NODE_B,
4449 .apply_expected = false,
4453 * sgroup,active vs. sgroup,active partly different addresses, special case...
4454 * => should be merged
4457 .line = __location__,
4458 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4459 .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",
4463 .type = WREPL_TYPE_SGROUP,
4464 .state = WREPL_STATE_ACTIVE,
4465 .node = WREPL_NODE_B,
4467 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4468 .ips = addresses_B_3_4_X_3_4,
4469 .apply_expected = true,
4473 .type = WREPL_TYPE_SGROUP,
4474 .state = WREPL_STATE_ACTIVE,
4475 .node = WREPL_NODE_B,
4477 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_1_2),
4478 .ips = addresses_B_3_4_X_1_2,
4479 .sgroup_merge = true,
4480 .sgroup_cleanup = false
4484 .line = __location__,
4485 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4489 .type = WREPL_TYPE_SGROUP,
4490 .state = WREPL_STATE_ACTIVE,
4491 .node = WREPL_NODE_B,
4495 .apply_expected = false,
4499 .type = WREPL_TYPE_SGROUP,
4500 .state = WREPL_STATE_ACTIVE,
4501 .node = WREPL_NODE_B,
4505 .apply_expected = false,
4509 * sgroup,active vs. sgroup,active different addresses, special case...
4510 * => should be merged
4513 .line = __location__,
4514 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4515 .comment= "A:A_3_4_B_3_4 vs. B:NULL => B:A_3_4",
4519 .type = WREPL_TYPE_SGROUP,
4520 .state = WREPL_STATE_ACTIVE,
4521 .node = WREPL_NODE_B,
4523 .num_ips = ARRAY_SIZE(addresses_A_3_4_B_3_4),
4524 .ips = addresses_A_3_4_B_3_4,
4525 .apply_expected = true,
4529 .type = WREPL_TYPE_SGROUP,
4530 .state = WREPL_STATE_ACTIVE,
4531 .node = WREPL_NODE_B,
4535 .sgroup_merge = true,
4536 .merge_owner = &ctx->b,
4537 .sgroup_cleanup = true
4541 .line = __location__,
4542 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4546 .type = WREPL_TYPE_SGROUP,
4547 .state = WREPL_STATE_ACTIVE,
4548 .node = WREPL_NODE_B,
4552 .apply_expected = false,
4556 .type = WREPL_TYPE_UNIQUE,
4557 .state = WREPL_STATE_TOMBSTONE,
4558 .node = WREPL_NODE_B,
4560 .num_ips = ARRAY_SIZE(addresses_A_1),
4561 .ips = addresses_A_1,
4562 .apply_expected = true,
4566 * sgroup,active vs. sgroup,active different addresses, special case...
4567 * => should be merged
4570 .line = __location__,
4571 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4572 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:X_3_4",
4576 .type = WREPL_TYPE_SGROUP,
4577 .state = WREPL_STATE_ACTIVE,
4578 .node = WREPL_NODE_B,
4580 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4581 .ips = addresses_B_3_4_X_3_4,
4582 .apply_expected = true,
4586 .type = WREPL_TYPE_SGROUP,
4587 .state = WREPL_STATE_ACTIVE,
4588 .node = WREPL_NODE_B,
4592 .sgroup_merge = true,
4593 .merge_owner = &ctx->b,
4594 .sgroup_cleanup = true
4598 .line = __location__,
4599 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4603 .type = WREPL_TYPE_SGROUP,
4604 .state = WREPL_STATE_ACTIVE,
4605 .node = WREPL_NODE_B,
4609 .apply_expected = false,
4613 .type = WREPL_TYPE_UNIQUE,
4614 .state = WREPL_STATE_TOMBSTONE,
4615 .node = WREPL_NODE_B,
4617 .num_ips = ARRAY_SIZE(addresses_A_1),
4618 .ips = addresses_A_1,
4619 .apply_expected = true,
4624 * sgroup,active vs. sgroup,tombstone different no addresses, special
4625 * => should be replaced
4628 .line = __location__,
4629 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4630 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:NULL",
4634 .type = WREPL_TYPE_SGROUP,
4635 .state = WREPL_STATE_ACTIVE,
4636 .node = WREPL_NODE_B,
4638 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4639 .ips = addresses_B_3_4_X_3_4,
4640 .apply_expected = true,
4644 .type = WREPL_TYPE_SGROUP,
4645 .state = WREPL_STATE_TOMBSTONE,
4646 .node = WREPL_NODE_B,
4650 .apply_expected = true,
4654 * sgroup,active vs. sgroup,tombstone different addresses
4655 * => should be replaced
4658 .line = __location__,
4659 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4660 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4",
4664 .type = WREPL_TYPE_SGROUP,
4665 .state = WREPL_STATE_ACTIVE,
4666 .node = WREPL_NODE_B,
4668 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4669 .ips = addresses_B_3_4_X_3_4,
4670 .apply_expected = true,
4674 .type = WREPL_TYPE_SGROUP,
4675 .state = WREPL_STATE_TOMBSTONE,
4676 .node = WREPL_NODE_B,
4678 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4679 .ips = addresses_A_3_4,
4680 .apply_expected = true,
4684 * sgroup,active vs. sgroup,tombstone subset addresses
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:B_3_4 => B:B_3_4",
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,
4708 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4709 .ips = addresses_B_3_4,
4710 .apply_expected = true,
4714 * sgroup,active vs. sgroup,active same 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:B_3_4_X_3_4 => B:B_3_4_X_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_B_3_4_X_3_4),
4739 .ips = addresses_B_3_4_X_3_4,
4740 .apply_expected = true,
4745 * This should be the last record in this array,
4746 * we need to make sure the we leave a tombstoned unique entry
4750 .line = __location__,
4751 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4755 .type = WREPL_TYPE_UNIQUE,
4756 .state = WREPL_STATE_TOMBSTONE,
4757 .node = WREPL_NODE_B,
4759 .num_ips = ARRAY_SIZE(addresses_A_1),
4760 .ips = addresses_A_1,
4761 .apply_expected = true
4765 .type = WREPL_TYPE_UNIQUE,
4766 .state = WREPL_STATE_TOMBSTONE,
4767 .node = WREPL_NODE_B,
4769 .num_ips = ARRAY_SIZE(addresses_A_1),
4770 .ips = addresses_A_1,
4771 .apply_expected = true
4773 }}; /* do not add entries here, this should be the last record! */
4775 wins_name_r1 = &wins_name1;
4776 wins_name_r2 = &wins_name2;
4778 torture_comment(tctx, "Test Replica Conflicts with different owners\n");
4780 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
4782 if (!records[i].extra && !records[i].cleanup) {
4783 /* we should test the worst cases */
4784 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
4785 torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n",
4786 __location__, i, records[i].line);
4788 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
4789 torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n",
4790 __location__, i, records[i].line);
4795 if (!records[i].cleanup) {
4796 const char *expected;
4799 if (records[i].r2.sgroup_merge) {
4800 expected = "SGROUP_MERGE";
4801 } else if (records[i].r2.apply_expected) {
4802 expected = "REPLACE";
4804 expected = "NOT REPLACE";
4807 if (!records[i].r1.ips && !records[i].r2.ips) {
4808 ips = "with no ip(s)";
4809 } else if (records[i].r1.ips==records[i].r2.ips) {
4810 ips = "with same ip(s)";
4812 ips = "with different ip(s)";
4815 torture_comment(tctx, "%s,%s%s vs. %s,%s%s %s => %s\n",
4816 wrepl_name_type_string(records[i].r1.type),
4817 wrepl_name_state_string(records[i].r1.state),
4818 (records[i].r1.is_static?",static":""),
4819 wrepl_name_type_string(records[i].r2.type),
4820 wrepl_name_state_string(records[i].r2.state),
4821 (records[i].r2.is_static?",static":""),
4822 (records[i].comment?records[i].comment:ips),
4829 wins_name_r1->name = &records[i].name;
4830 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
4831 records[i].r1.state,
4833 records[i].r1.is_static);
4834 wins_name_r1->id = ++records[i].r1.owner->max_version;
4835 if (wins_name_r1->flags & 2) {
4836 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
4837 wins_name_r1->addresses.addresses.ips = discard_const(records[i].r1.ips);
4839 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
4841 wins_name_r1->unknown = "255.255.255.255";
4844 ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1);
4845 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4846 wins_name_r1, records[i].r1.apply_expected);
4851 wins_name_r2->name = &records[i].name;
4852 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
4853 records[i].r2.state,
4855 records[i].r2.is_static);
4856 wins_name_r2->id = ++records[i].r2.owner->max_version;
4857 if (wins_name_r2->flags & 2) {
4858 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
4859 wins_name_r2->addresses.addresses.ips = discard_const(records[i].r2.ips);
4861 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
4863 wins_name_r2->unknown = "255.255.255.255";
4866 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4867 if (records[i].r1.state == WREPL_STATE_RELEASED) {
4868 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4869 wins_name_r1, false);
4870 } else if (records[i].r2.sgroup_merge) {
4871 ret &= test_wrepl_sgroup_merged(tctx, ctx, records[i].r2.merge_owner,
4872 records[i].r1.owner,
4873 records[i].r1.num_ips, records[i].r1.ips,
4874 records[i].r2.owner,
4875 records[i].r2.num_ips, records[i].r2.ips,
4877 } else if (records[i].r1.owner != records[i].r2.owner) {
4879 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
4880 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4881 wins_name_r1, _expected);
4883 if (records[i].r2.state == WREPL_STATE_RELEASED) {
4884 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner,
4885 wins_name_r2, false);
4886 } else if (!records[i].r2.sgroup_merge) {
4887 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner,
4888 wins_name_r2, records[i].r2.apply_expected);
4891 if (records[i].r2.sgroup_cleanup) {
4893 torture_comment(tctx, "failed before sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4897 /* clean up the SGROUP record */
4898 wins_name_r1->name = &records[i].name;
4899 wins_name_r1->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4901 WREPL_NODE_B, false);
4902 wins_name_r1->id = ++records[i].r1.owner->max_version;
4903 wins_name_r1->addresses.addresses.num_ips = 0;
4904 wins_name_r1->addresses.addresses.ips = NULL;
4905 wins_name_r1->unknown = "255.255.255.255";
4906 ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1);
4908 /* here we test how names from an owner are deleted */
4909 if (records[i].r2.sgroup_merge && records[i].r2.num_ips) {
4910 ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL,
4911 records[i].r2.owner,
4912 records[i].r2.num_ips, records[i].r2.ips,
4913 records[i].r1.owner,
4918 /* clean up the SGROUP record */
4919 wins_name_r2->name = &records[i].name;
4920 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4922 WREPL_NODE_B, false);
4923 wins_name_r2->id = ++records[i].r2.owner->max_version;
4924 wins_name_r2->addresses.addresses.num_ips = 0;
4925 wins_name_r2->addresses.addresses.ips = NULL;
4926 wins_name_r2->unknown = "255.255.255.255";
4927 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4929 /* take ownership of the SGROUP record */
4930 wins_name_r2->name = &records[i].name;
4931 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4933 WREPL_NODE_B, false);
4934 wins_name_r2->id = ++records[i].r2.owner->max_version;
4935 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4936 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4937 wins_name_r2->unknown = "255.255.255.255";
4938 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4939 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true);
4941 /* overwrite the SGROUP record with unique,tombstone */
4942 wins_name_r2->name = &records[i].name;
4943 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4944 WREPL_STATE_TOMBSTONE,
4945 WREPL_NODE_B, false);
4946 wins_name_r2->id = ++records[i].r2.owner->max_version;
4947 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4948 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4949 wins_name_r2->unknown = "255.255.255.255";
4950 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4951 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true);
4954 torture_comment(tctx, "failed in sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4959 /* the first one is a cleanup run */
4960 if (!ret && i == 0) ret = true;
4963 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
4971 static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx,
4972 struct test_wrepl_conflict_conn *ctx)
4976 struct wrepl_wins_name wins_name_;
4977 struct wrepl_wins_name *wins_name = &wins_name_;
4978 struct nbt_name_register name_register_;
4979 struct nbt_name_register *name_register = &name_register_;
4980 struct nbt_name_release release_;
4981 struct nbt_name_release *release = &release_;
4984 const char *line; /* just better debugging */
4985 struct nbt_name name;
4990 const struct wrepl_ip *ips;
4991 bool apply_expected;
4994 enum wrepl_name_type type;
4995 enum wrepl_name_state state;
4996 enum wrepl_name_node node;
4999 const struct wrepl_ip *ips;
5000 bool apply_expected;
5004 * unique vs. unique section
5007 * unique,released vs. unique,active with same ip(s)
5010 .line = __location__,
5011 .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL),
5015 .num_ips = ctx->addresses_best_num,
5016 .ips = ctx->addresses_best,
5017 .apply_expected = true
5020 .type = WREPL_TYPE_UNIQUE,
5021 .state = WREPL_STATE_ACTIVE,
5022 .node = WREPL_NODE_B,
5024 .num_ips = ctx->addresses_best_num,
5025 .ips = ctx->addresses_best,
5026 .apply_expected = true
5030 * unique,released vs. unique,active with different ip(s)
5033 .line = __location__,
5034 .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL),
5038 .num_ips = ctx->addresses_best_num,
5039 .ips = ctx->addresses_best,
5040 .apply_expected = true
5043 .type = WREPL_TYPE_UNIQUE,
5044 .state = WREPL_STATE_ACTIVE,
5045 .node = WREPL_NODE_B,
5047 .num_ips = ARRAY_SIZE(addresses_B_1),
5048 .ips = addresses_B_1,
5049 .apply_expected = true
5053 * unique,released vs. unique,tombstone with same ip(s)
5056 .line = __location__,
5057 .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL),
5061 .num_ips = ctx->addresses_best_num,
5062 .ips = ctx->addresses_best,
5063 .apply_expected = true
5066 .type = WREPL_TYPE_UNIQUE,
5067 .state = WREPL_STATE_TOMBSTONE,
5068 .node = WREPL_NODE_B,
5070 .num_ips = ctx->addresses_best_num,
5071 .ips = ctx->addresses_best,
5072 .apply_expected = true
5076 * unique,released vs. unique,tombstone with different ip(s)
5079 .line = __location__,
5080 .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL),
5084 .num_ips = ctx->addresses_best_num,
5085 .ips = ctx->addresses_best,
5086 .apply_expected = true
5089 .type = WREPL_TYPE_UNIQUE,
5090 .state = WREPL_STATE_TOMBSTONE,
5091 .node = WREPL_NODE_B,
5093 .num_ips = ARRAY_SIZE(addresses_B_1),
5094 .ips = addresses_B_1,
5095 .apply_expected = true
5099 * unique vs. group section
5102 * unique,released vs. group,active with same ip(s)
5105 .line = __location__,
5106 .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL),
5110 .num_ips = ctx->addresses_best_num,
5111 .ips = ctx->addresses_best,
5112 .apply_expected = true
5115 .type = WREPL_TYPE_GROUP,
5116 .state = WREPL_STATE_ACTIVE,
5117 .node = WREPL_NODE_B,
5119 .num_ips = ctx->addresses_best_num,
5120 .ips = ctx->addresses_best,
5121 .apply_expected = true
5125 * unique,released vs. group,active with different ip(s)
5128 .line = __location__,
5129 .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL),
5133 .num_ips = ctx->addresses_best_num,
5134 .ips = ctx->addresses_best,
5135 .apply_expected = true
5138 .type = WREPL_TYPE_GROUP,
5139 .state = WREPL_STATE_ACTIVE,
5140 .node = WREPL_NODE_B,
5142 .num_ips = ARRAY_SIZE(addresses_B_1),
5143 .ips = addresses_B_1,
5144 .apply_expected = true
5148 * unique,released vs. group,tombstone with same ip(s)
5151 .line = __location__,
5152 .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL),
5156 .num_ips = ctx->addresses_best_num,
5157 .ips = ctx->addresses_best,
5158 .apply_expected = true
5161 .type = WREPL_TYPE_GROUP,
5162 .state = WREPL_STATE_TOMBSTONE,
5163 .node = WREPL_NODE_B,
5165 .num_ips = ctx->addresses_best_num,
5166 .ips = ctx->addresses_best,
5167 .apply_expected = true
5171 * unique,released vs. group,tombstone with different ip(s)
5174 .line = __location__,
5175 .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL),
5179 .num_ips = ctx->addresses_best_num,
5180 .ips = ctx->addresses_best,
5181 .apply_expected = true
5184 .type = WREPL_TYPE_GROUP,
5185 .state = WREPL_STATE_TOMBSTONE,
5186 .node = WREPL_NODE_B,
5188 .num_ips = ARRAY_SIZE(addresses_B_1),
5189 .ips = addresses_B_1,
5190 .apply_expected = true
5194 * unique vs. special group section
5197 * unique,released vs. sgroup,active with same ip(s)
5200 .line = __location__,
5201 .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL),
5205 .num_ips = ctx->addresses_best_num,
5206 .ips = ctx->addresses_best,
5207 .apply_expected = true
5210 .type = WREPL_TYPE_SGROUP,
5211 .state = WREPL_STATE_ACTIVE,
5212 .node = WREPL_NODE_B,
5214 .num_ips = ctx->addresses_best_num,
5215 .ips = ctx->addresses_best,
5216 .apply_expected = true
5220 * unique,released vs. sgroup,active with different ip(s)
5223 .line = __location__,
5224 .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL),
5228 .num_ips = ctx->addresses_best_num,
5229 .ips = ctx->addresses_best,
5230 .apply_expected = true
5233 .type = WREPL_TYPE_SGROUP,
5234 .state = WREPL_STATE_ACTIVE,
5235 .node = WREPL_NODE_B,
5237 .num_ips = ARRAY_SIZE(addresses_B_1),
5238 .ips = addresses_B_1,
5239 .apply_expected = true
5243 * unique,released vs. sgroup,tombstone with same ip(s)
5246 .line = __location__,
5247 .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL),
5251 .num_ips = ctx->addresses_best_num,
5252 .ips = ctx->addresses_best,
5253 .apply_expected = true
5256 .type = WREPL_TYPE_SGROUP,
5257 .state = WREPL_STATE_TOMBSTONE,
5258 .node = WREPL_NODE_B,
5260 .num_ips = ctx->addresses_best_num,
5261 .ips = ctx->addresses_best,
5262 .apply_expected = true
5266 * unique,released vs. sgroup,tombstone with different ip(s)
5269 .line = __location__,
5270 .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL),
5274 .num_ips = ctx->addresses_best_num,
5275 .ips = ctx->addresses_best,
5276 .apply_expected = true
5279 .type = WREPL_TYPE_SGROUP,
5280 .state = WREPL_STATE_TOMBSTONE,
5281 .node = WREPL_NODE_B,
5283 .num_ips = ARRAY_SIZE(addresses_B_1),
5284 .ips = addresses_B_1,
5285 .apply_expected = true
5289 * unique vs. multi homed section
5292 * unique,released vs. mhomed,active with same ip(s)
5295 .line = __location__,
5296 .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL),
5300 .num_ips = ctx->addresses_best_num,
5301 .ips = ctx->addresses_best,
5302 .apply_expected = true
5305 .type = WREPL_TYPE_MHOMED,
5306 .state = WREPL_STATE_ACTIVE,
5307 .node = WREPL_NODE_B,
5309 .num_ips = ctx->addresses_best_num,
5310 .ips = ctx->addresses_best,
5311 .apply_expected = true
5315 * unique,released vs. mhomed,active with different ip(s)
5318 .line = __location__,
5319 .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL),
5323 .num_ips = ctx->addresses_best_num,
5324 .ips = ctx->addresses_best,
5325 .apply_expected = true
5328 .type = WREPL_TYPE_MHOMED,
5329 .state = WREPL_STATE_ACTIVE,
5330 .node = WREPL_NODE_B,
5332 .num_ips = ARRAY_SIZE(addresses_B_1),
5333 .ips = addresses_B_1,
5334 .apply_expected = true
5338 * unique,released vs. mhomed,tombstone with same ip(s)
5341 .line = __location__,
5342 .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL),
5346 .num_ips = ctx->addresses_best_num,
5347 .ips = ctx->addresses_best,
5348 .apply_expected = true
5351 .type = WREPL_TYPE_MHOMED,
5352 .state = WREPL_STATE_TOMBSTONE,
5353 .node = WREPL_NODE_B,
5355 .num_ips = ctx->addresses_best_num,
5356 .ips = ctx->addresses_best,
5357 .apply_expected = true
5361 * unique,released vs. mhomed,tombstone with different ip(s)
5364 .line = __location__,
5365 .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL),
5369 .num_ips = ctx->addresses_best_num,
5370 .ips = ctx->addresses_best,
5371 .apply_expected = true
5374 .type = WREPL_TYPE_MHOMED,
5375 .state = WREPL_STATE_TOMBSTONE,
5376 .node = WREPL_NODE_B,
5378 .num_ips = ARRAY_SIZE(addresses_B_1),
5379 .ips = addresses_B_1,
5380 .apply_expected = true
5384 * group vs. unique section
5387 * group,released vs. unique,active with same ip(s)
5390 .line = __location__,
5391 .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL),
5393 .nb_flags = NBT_NM_GROUP,
5395 .num_ips = ctx->addresses_best_num,
5396 .ips = ctx->addresses_best,
5397 .apply_expected = true
5400 .type = WREPL_TYPE_UNIQUE,
5401 .state = WREPL_STATE_ACTIVE,
5402 .node = WREPL_NODE_B,
5404 .num_ips = ctx->addresses_best_num,
5405 .ips = ctx->addresses_best,
5406 .apply_expected = false
5410 * group,released vs. unique,active with different ip(s)
5413 .line = __location__,
5414 .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL),
5416 .nb_flags = NBT_NM_GROUP,
5418 .num_ips = ctx->addresses_best_num,
5419 .ips = ctx->addresses_best,
5420 .apply_expected = true
5423 .type = WREPL_TYPE_UNIQUE,
5424 .state = WREPL_STATE_ACTIVE,
5425 .node = WREPL_NODE_B,
5427 .num_ips = ARRAY_SIZE(addresses_B_1),
5428 .ips = addresses_B_1,
5429 .apply_expected = false
5433 * group,released vs. unique,tombstone with same ip(s)
5436 .line = __location__,
5437 .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL),
5439 .nb_flags = NBT_NM_GROUP,
5441 .num_ips = ctx->addresses_best_num,
5442 .ips = ctx->addresses_best,
5443 .apply_expected = true
5446 .type = WREPL_TYPE_UNIQUE,
5447 .state = WREPL_STATE_TOMBSTONE,
5448 .node = WREPL_NODE_B,
5450 .num_ips = ctx->addresses_best_num,
5451 .ips = ctx->addresses_best,
5452 .apply_expected = false
5456 * group,released vs. unique,tombstone with different ip(s)
5459 .line = __location__,
5460 .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL),
5462 .nb_flags = NBT_NM_GROUP,
5464 .num_ips = ctx->addresses_best_num,
5465 .ips = ctx->addresses_best,
5466 .apply_expected = true
5469 .type = WREPL_TYPE_UNIQUE,
5470 .state = WREPL_STATE_TOMBSTONE,
5471 .node = WREPL_NODE_B,
5473 .num_ips = ARRAY_SIZE(addresses_B_1),
5474 .ips = addresses_B_1,
5475 .apply_expected = false
5479 * group vs. group section
5482 * group,released vs. group,active with same ip(s)
5485 .line = __location__,
5486 .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL),
5488 .nb_flags = NBT_NM_GROUP,
5490 .num_ips = ctx->addresses_best_num,
5491 .ips = ctx->addresses_best,
5492 .apply_expected = true
5495 .type = WREPL_TYPE_GROUP,
5496 .state = WREPL_STATE_ACTIVE,
5497 .node = WREPL_NODE_B,
5499 .num_ips = ctx->addresses_best_num,
5500 .ips = ctx->addresses_best,
5501 .apply_expected = true
5505 * group,released vs. group,active with different ip(s)
5508 .line = __location__,
5509 .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL),
5511 .nb_flags = NBT_NM_GROUP,
5513 .num_ips = ctx->addresses_best_num,
5514 .ips = ctx->addresses_best,
5515 .apply_expected = true
5518 .type = WREPL_TYPE_GROUP,
5519 .state = WREPL_STATE_ACTIVE,
5520 .node = WREPL_NODE_B,
5522 .num_ips = ARRAY_SIZE(addresses_B_1),
5523 .ips = addresses_B_1,
5524 .apply_expected = true
5528 * group,released vs. group,tombstone with same ip(s)
5531 .line = __location__,
5532 .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL),
5534 .nb_flags = NBT_NM_GROUP,
5536 .num_ips = ctx->addresses_best_num,
5537 .ips = ctx->addresses_best,
5538 .apply_expected = true
5541 .type = WREPL_TYPE_GROUP,
5542 .state = WREPL_STATE_TOMBSTONE,
5543 .node = WREPL_NODE_B,
5545 .num_ips = ctx->addresses_best_num,
5546 .ips = ctx->addresses_best,
5547 .apply_expected = true
5551 * group,released vs. group,tombstone with different ip(s)
5554 .line = __location__,
5555 .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL),
5557 .nb_flags = NBT_NM_GROUP,
5559 .num_ips = ctx->addresses_best_num,
5560 .ips = ctx->addresses_best,
5561 .apply_expected = true
5564 .type = WREPL_TYPE_GROUP,
5565 .state = WREPL_STATE_TOMBSTONE,
5566 .node = WREPL_NODE_B,
5568 .num_ips = ARRAY_SIZE(addresses_B_1),
5569 .ips = addresses_B_1,
5570 .apply_expected = true
5574 * group vs. special group section
5577 * group,released vs. sgroup,active with same ip(s)
5580 .line = __location__,
5581 .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL),
5583 .nb_flags = NBT_NM_GROUP,
5585 .num_ips = ctx->addresses_best_num,
5586 .ips = ctx->addresses_best,
5587 .apply_expected = true
5590 .type = WREPL_TYPE_SGROUP,
5591 .state = WREPL_STATE_ACTIVE,
5592 .node = WREPL_NODE_B,
5594 .num_ips = ctx->addresses_best_num,
5595 .ips = ctx->addresses_best,
5596 .apply_expected = false
5600 * group,released vs. sgroup,active with different ip(s)
5603 .line = __location__,
5604 .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL),
5606 .nb_flags = NBT_NM_GROUP,
5608 .num_ips = ctx->addresses_best_num,
5609 .ips = ctx->addresses_best,
5610 .apply_expected = true
5613 .type = WREPL_TYPE_SGROUP,
5614 .state = WREPL_STATE_ACTIVE,
5615 .node = WREPL_NODE_B,
5617 .num_ips = ARRAY_SIZE(addresses_B_1),
5618 .ips = addresses_B_1,
5619 .apply_expected = false
5623 * group,released vs. sgroup,tombstone with same ip(s)
5626 .line = __location__,
5627 .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL),
5629 .nb_flags = NBT_NM_GROUP,
5631 .num_ips = ctx->addresses_best_num,
5632 .ips = ctx->addresses_best,
5633 .apply_expected = true
5636 .type = WREPL_TYPE_SGROUP,
5637 .state = WREPL_STATE_TOMBSTONE,
5638 .node = WREPL_NODE_B,
5640 .num_ips = ctx->addresses_best_num,
5641 .ips = ctx->addresses_best,
5642 .apply_expected = false
5646 * group,released vs. sgroup,tombstone with different ip(s)
5649 .line = __location__,
5650 .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL),
5652 .nb_flags = NBT_NM_GROUP,
5654 .num_ips = ctx->addresses_best_num,
5655 .ips = ctx->addresses_best,
5656 .apply_expected = true
5659 .type = WREPL_TYPE_SGROUP,
5660 .state = WREPL_STATE_TOMBSTONE,
5661 .node = WREPL_NODE_B,
5663 .num_ips = ARRAY_SIZE(addresses_B_1),
5664 .ips = addresses_B_1,
5665 .apply_expected = false
5669 * group vs. multi homed section
5672 * group,released vs. mhomed,active with same ip(s)
5675 .line = __location__,
5676 .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL),
5678 .nb_flags = NBT_NM_GROUP,
5680 .num_ips = ctx->addresses_best_num,
5681 .ips = ctx->addresses_best,
5682 .apply_expected = true
5685 .type = WREPL_TYPE_MHOMED,
5686 .state = WREPL_STATE_ACTIVE,
5687 .node = WREPL_NODE_B,
5689 .num_ips = ctx->addresses_best_num,
5690 .ips = ctx->addresses_best,
5691 .apply_expected = false
5695 * group,released vs. mhomed,active with different ip(s)
5698 .line = __location__,
5699 .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL),
5701 .nb_flags = NBT_NM_GROUP,
5703 .num_ips = ctx->addresses_best_num,
5704 .ips = ctx->addresses_best,
5705 .apply_expected = true
5708 .type = WREPL_TYPE_MHOMED,
5709 .state = WREPL_STATE_ACTIVE,
5710 .node = WREPL_NODE_B,
5712 .num_ips = ARRAY_SIZE(addresses_B_1),
5713 .ips = addresses_B_1,
5714 .apply_expected = false
5718 * group,released vs. mhomed,tombstone with same ip(s)
5721 .line = __location__,
5722 .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL),
5724 .nb_flags = NBT_NM_GROUP,
5726 .num_ips = ctx->addresses_best_num,
5727 .ips = ctx->addresses_best,
5728 .apply_expected = true
5731 .type = WREPL_TYPE_MHOMED,
5732 .state = WREPL_STATE_TOMBSTONE,
5733 .node = WREPL_NODE_B,
5735 .num_ips = ctx->addresses_best_num,
5736 .ips = ctx->addresses_best,
5737 .apply_expected = false
5741 * group,released vs. mhomed,tombstone with different ip(s)
5744 .line = __location__,
5745 .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL),
5747 .nb_flags = NBT_NM_GROUP,
5749 .num_ips = ctx->addresses_best_num,
5750 .ips = ctx->addresses_best,
5751 .apply_expected = true
5754 .type = WREPL_TYPE_MHOMED,
5755 .state = WREPL_STATE_TOMBSTONE,
5756 .node = WREPL_NODE_B,
5758 .num_ips = ARRAY_SIZE(addresses_B_1),
5759 .ips = addresses_B_1,
5760 .apply_expected = false
5764 * special group vs. unique section
5767 * sgroup,released vs. unique,active with same ip(s)
5770 .line = __location__,
5771 .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL),
5773 .nb_flags = NBT_NM_GROUP,
5775 .num_ips = ctx->addresses_best_num,
5776 .ips = ctx->addresses_best,
5777 .apply_expected = true
5780 .type = WREPL_TYPE_UNIQUE,
5781 .state = WREPL_STATE_ACTIVE,
5782 .node = WREPL_NODE_B,
5784 .num_ips = ctx->addresses_best_num,
5785 .ips = ctx->addresses_best,
5786 .apply_expected = true
5790 * sgroup,released vs. unique,active with different ip(s)
5793 .line = __location__,
5794 .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL),
5796 .nb_flags = NBT_NM_GROUP,
5798 .num_ips = ctx->addresses_best_num,
5799 .ips = ctx->addresses_best,
5800 .apply_expected = true
5803 .type = WREPL_TYPE_UNIQUE,
5804 .state = WREPL_STATE_ACTIVE,
5805 .node = WREPL_NODE_B,
5807 .num_ips = ARRAY_SIZE(addresses_B_1),
5808 .ips = addresses_B_1,
5809 .apply_expected = true
5813 * sgroup,released vs. unique,tombstone with same ip(s)
5816 .line = __location__,
5817 .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL),
5819 .nb_flags = NBT_NM_GROUP,
5821 .num_ips = ctx->addresses_best_num,
5822 .ips = ctx->addresses_best,
5823 .apply_expected = true
5826 .type = WREPL_TYPE_UNIQUE,
5827 .state = WREPL_STATE_TOMBSTONE,
5828 .node = WREPL_NODE_B,
5830 .num_ips = ctx->addresses_best_num,
5831 .ips = ctx->addresses_best,
5832 .apply_expected = true
5836 * sgroup,released vs. unique,tombstone with different ip(s)
5839 .line = __location__,
5840 .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL),
5842 .nb_flags = NBT_NM_GROUP,
5844 .num_ips = ctx->addresses_best_num,
5845 .ips = ctx->addresses_best,
5846 .apply_expected = true
5849 .type = WREPL_TYPE_UNIQUE,
5850 .state = WREPL_STATE_TOMBSTONE,
5851 .node = WREPL_NODE_B,
5853 .num_ips = ARRAY_SIZE(addresses_B_1),
5854 .ips = addresses_B_1,
5855 .apply_expected = true
5859 * special group vs. group section
5862 * sgroup,released vs. group,active with same ip(s)
5865 .line = __location__,
5866 .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL),
5868 .nb_flags = NBT_NM_GROUP,
5870 .num_ips = ctx->addresses_best_num,
5871 .ips = ctx->addresses_best,
5872 .apply_expected = true
5875 .type = WREPL_TYPE_GROUP,
5876 .state = WREPL_STATE_ACTIVE,
5877 .node = WREPL_NODE_B,
5879 .num_ips = ctx->addresses_best_num,
5880 .ips = ctx->addresses_best,
5881 .apply_expected = true
5885 * sgroup,released vs. group,active with different ip(s)
5888 .line = __location__,
5889 .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL),
5891 .nb_flags = NBT_NM_GROUP,
5893 .num_ips = ctx->addresses_best_num,
5894 .ips = ctx->addresses_best,
5895 .apply_expected = true
5898 .type = WREPL_TYPE_GROUP,
5899 .state = WREPL_STATE_ACTIVE,
5900 .node = WREPL_NODE_B,
5902 .num_ips = ARRAY_SIZE(addresses_B_1),
5903 .ips = addresses_B_1,
5904 .apply_expected = true
5908 * sgroup,released vs. group,tombstone with same ip(s)
5911 .line = __location__,
5912 .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL),
5914 .nb_flags = NBT_NM_GROUP,
5916 .num_ips = ctx->addresses_best_num,
5917 .ips = ctx->addresses_best,
5918 .apply_expected = true
5921 .type = WREPL_TYPE_GROUP,
5922 .state = WREPL_STATE_TOMBSTONE,
5923 .node = WREPL_NODE_B,
5925 .num_ips = ctx->addresses_best_num,
5926 .ips = ctx->addresses_best,
5927 .apply_expected = true
5931 * sgroup,released vs. group,tombstone with different ip(s)
5934 .line = __location__,
5935 .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL),
5937 .nb_flags = NBT_NM_GROUP,
5939 .num_ips = ctx->addresses_best_num,
5940 .ips = ctx->addresses_best,
5941 .apply_expected = true
5944 .type = WREPL_TYPE_GROUP,
5945 .state = WREPL_STATE_TOMBSTONE,
5946 .node = WREPL_NODE_B,
5948 .num_ips = ARRAY_SIZE(addresses_B_1),
5949 .ips = addresses_B_1,
5950 .apply_expected = true
5954 * special group vs. special group section
5957 * sgroup,released vs. sgroup,active with same ip(s)
5960 .line = __location__,
5961 .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL),
5963 .nb_flags = NBT_NM_GROUP,
5965 .num_ips = ctx->addresses_best_num,
5966 .ips = ctx->addresses_best,
5967 .apply_expected = true
5970 .type = WREPL_TYPE_SGROUP,
5971 .state = WREPL_STATE_ACTIVE,
5972 .node = WREPL_NODE_B,
5974 .num_ips = ctx->addresses_best_num,
5975 .ips = ctx->addresses_best,
5976 .apply_expected = true
5980 * sgroup,released vs. sgroup,active with different ip(s)
5983 .line = __location__,
5984 .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL),
5986 .nb_flags = NBT_NM_GROUP,
5988 .num_ips = ctx->addresses_best_num,
5989 .ips = ctx->addresses_best,
5990 .apply_expected = true
5993 .type = WREPL_TYPE_SGROUP,
5994 .state = WREPL_STATE_ACTIVE,
5995 .node = WREPL_NODE_B,
5997 .num_ips = ARRAY_SIZE(addresses_B_1),
5998 .ips = addresses_B_1,
5999 .apply_expected = true
6003 * sgroup,released vs. sgroup,tombstone with same ip(s)
6006 .line = __location__,
6007 .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL),
6009 .nb_flags = NBT_NM_GROUP,
6011 .num_ips = ctx->addresses_best_num,
6012 .ips = ctx->addresses_best,
6013 .apply_expected = true
6016 .type = WREPL_TYPE_SGROUP,
6017 .state = WREPL_STATE_TOMBSTONE,
6018 .node = WREPL_NODE_B,
6020 .num_ips = ctx->addresses_best_num,
6021 .ips = ctx->addresses_best,
6022 .apply_expected = true
6026 * sgroup,released vs. sgroup,tombstone with different ip(s)
6029 .line = __location__,
6030 .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL),
6032 .nb_flags = NBT_NM_GROUP,
6034 .num_ips = ctx->addresses_best_num,
6035 .ips = ctx->addresses_best,
6036 .apply_expected = true
6039 .type = WREPL_TYPE_SGROUP,
6040 .state = WREPL_STATE_TOMBSTONE,
6041 .node = WREPL_NODE_B,
6043 .num_ips = ARRAY_SIZE(addresses_B_1),
6044 .ips = addresses_B_1,
6045 .apply_expected = true
6049 * special group vs. multi homed section
6052 * sgroup,released vs. mhomed,active with same ip(s)
6055 .line = __location__,
6056 .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL),
6058 .nb_flags = NBT_NM_GROUP,
6060 .num_ips = ctx->addresses_best_num,
6061 .ips = ctx->addresses_best,
6062 .apply_expected = true
6065 .type = WREPL_TYPE_MHOMED,
6066 .state = WREPL_STATE_ACTIVE,
6067 .node = WREPL_NODE_B,
6069 .num_ips = ctx->addresses_best_num,
6070 .ips = ctx->addresses_best,
6071 .apply_expected = true
6075 * sgroup,released vs. mhomed,active with different ip(s)
6078 .line = __location__,
6079 .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL),
6081 .nb_flags = NBT_NM_GROUP,
6083 .num_ips = ctx->addresses_best_num,
6084 .ips = ctx->addresses_best,
6085 .apply_expected = true
6088 .type = WREPL_TYPE_MHOMED,
6089 .state = WREPL_STATE_ACTIVE,
6090 .node = WREPL_NODE_B,
6092 .num_ips = ARRAY_SIZE(addresses_B_1),
6093 .ips = addresses_B_1,
6094 .apply_expected = true
6098 * sgroup,released vs. mhomed,tombstone with same ip(s)
6101 .line = __location__,
6102 .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL),
6104 .nb_flags = NBT_NM_GROUP,
6106 .num_ips = ctx->addresses_best_num,
6107 .ips = ctx->addresses_best,
6108 .apply_expected = true
6111 .type = WREPL_TYPE_MHOMED,
6112 .state = WREPL_STATE_TOMBSTONE,
6113 .node = WREPL_NODE_B,
6115 .num_ips = ctx->addresses_best_num,
6116 .ips = ctx->addresses_best,
6117 .apply_expected = true
6121 * sgroup,released vs. mhomed,tombstone with different ip(s)
6124 .line = __location__,
6125 .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL),
6127 .nb_flags = NBT_NM_GROUP,
6129 .num_ips = ctx->addresses_best_num,
6130 .ips = ctx->addresses_best,
6131 .apply_expected = true
6134 .type = WREPL_TYPE_MHOMED,
6135 .state = WREPL_STATE_TOMBSTONE,
6136 .node = WREPL_NODE_B,
6138 .num_ips = ARRAY_SIZE(addresses_B_1),
6139 .ips = addresses_B_1,
6140 .apply_expected = true
6144 * multi homed vs. unique section
6147 * mhomed,released vs. unique,active with same ip(s)
6150 .line = __location__,
6151 .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL),
6155 .num_ips = ctx->addresses_best_num,
6156 .ips = ctx->addresses_best,
6157 .apply_expected = true
6160 .type = WREPL_TYPE_UNIQUE,
6161 .state = WREPL_STATE_ACTIVE,
6162 .node = WREPL_NODE_B,
6164 .num_ips = ctx->addresses_best_num,
6165 .ips = ctx->addresses_best,
6166 .apply_expected = true
6170 * mhomed,released vs. unique,active with different ip(s)
6173 .line = __location__,
6174 .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL),
6178 .num_ips = ctx->addresses_best_num,
6179 .ips = ctx->addresses_best,
6180 .apply_expected = true
6183 .type = WREPL_TYPE_UNIQUE,
6184 .state = WREPL_STATE_ACTIVE,
6185 .node = WREPL_NODE_B,
6187 .num_ips = ARRAY_SIZE(addresses_B_1),
6188 .ips = addresses_B_1,
6189 .apply_expected = true
6193 * mhomed,released vs. unique,tombstone with same ip(s)
6196 .line = __location__,
6197 .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL),
6201 .num_ips = ctx->addresses_best_num,
6202 .ips = ctx->addresses_best,
6203 .apply_expected = true
6206 .type = WREPL_TYPE_UNIQUE,
6207 .state = WREPL_STATE_TOMBSTONE,
6208 .node = WREPL_NODE_B,
6210 .num_ips = ctx->addresses_best_num,
6211 .ips = ctx->addresses_best,
6212 .apply_expected = true
6216 * mhomed,released vs. unique,tombstone with different ip(s)
6219 .line = __location__,
6220 .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL),
6224 .num_ips = ctx->addresses_best_num,
6225 .ips = ctx->addresses_best,
6226 .apply_expected = true
6229 .type = WREPL_TYPE_UNIQUE,
6230 .state = WREPL_STATE_TOMBSTONE,
6231 .node = WREPL_NODE_B,
6233 .num_ips = ARRAY_SIZE(addresses_B_1),
6234 .ips = addresses_B_1,
6235 .apply_expected = true
6239 * multi homed vs. group section
6242 * mhomed,released vs. group,active with same ip(s)
6245 .line = __location__,
6246 .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL),
6250 .num_ips = ctx->addresses_best_num,
6251 .ips = ctx->addresses_best,
6252 .apply_expected = true
6255 .type = WREPL_TYPE_GROUP,
6256 .state = WREPL_STATE_ACTIVE,
6257 .node = WREPL_NODE_B,
6259 .num_ips = ctx->addresses_best_num,
6260 .ips = ctx->addresses_best,
6261 .apply_expected = true
6265 * mhomed,released vs. group,active with different ip(s)
6268 .line = __location__,
6269 .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL),
6273 .num_ips = ctx->addresses_best_num,
6274 .ips = ctx->addresses_best,
6275 .apply_expected = true
6278 .type = WREPL_TYPE_GROUP,
6279 .state = WREPL_STATE_ACTIVE,
6280 .node = WREPL_NODE_B,
6282 .num_ips = ARRAY_SIZE(addresses_B_1),
6283 .ips = addresses_B_1,
6284 .apply_expected = true
6288 * mhomed,released vs. group,tombstone with same ip(s)
6291 .line = __location__,
6292 .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL),
6296 .num_ips = ctx->addresses_best_num,
6297 .ips = ctx->addresses_best,
6298 .apply_expected = true
6301 .type = WREPL_TYPE_GROUP,
6302 .state = WREPL_STATE_TOMBSTONE,
6303 .node = WREPL_NODE_B,
6305 .num_ips = ctx->addresses_best_num,
6306 .ips = ctx->addresses_best,
6307 .apply_expected = true
6311 * mhomed,released vs. group,tombstone with different ip(s)
6314 .line = __location__,
6315 .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL),
6319 .num_ips = ctx->addresses_best_num,
6320 .ips = ctx->addresses_best,
6321 .apply_expected = true
6324 .type = WREPL_TYPE_GROUP,
6325 .state = WREPL_STATE_TOMBSTONE,
6326 .node = WREPL_NODE_B,
6328 .num_ips = ARRAY_SIZE(addresses_B_1),
6329 .ips = addresses_B_1,
6330 .apply_expected = true
6334 * multi homed vs. special group section
6337 * mhomed,released vs. sgroup,active with same ip(s)
6340 .line = __location__,
6341 .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL),
6345 .num_ips = ctx->addresses_best_num,
6346 .ips = ctx->addresses_best,
6347 .apply_expected = true
6350 .type = WREPL_TYPE_SGROUP,
6351 .state = WREPL_STATE_ACTIVE,
6352 .node = WREPL_NODE_B,
6354 .num_ips = ctx->addresses_best_num,
6355 .ips = ctx->addresses_best,
6356 .apply_expected = true
6360 * mhomed,released vs. sgroup,active with different ip(s)
6363 .line = __location__,
6364 .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL),
6368 .num_ips = ctx->addresses_best_num,
6369 .ips = ctx->addresses_best,
6370 .apply_expected = true
6373 .type = WREPL_TYPE_SGROUP,
6374 .state = WREPL_STATE_ACTIVE,
6375 .node = WREPL_NODE_B,
6377 .num_ips = ARRAY_SIZE(addresses_B_1),
6378 .ips = addresses_B_1,
6379 .apply_expected = true
6383 * mhomed,released vs. sgroup,tombstone with same ip(s)
6386 .line = __location__,
6387 .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL),
6391 .num_ips = ctx->addresses_best_num,
6392 .ips = ctx->addresses_best,
6393 .apply_expected = true
6396 .type = WREPL_TYPE_SGROUP,
6397 .state = WREPL_STATE_TOMBSTONE,
6398 .node = WREPL_NODE_B,
6400 .num_ips = ctx->addresses_best_num,
6401 .ips = ctx->addresses_best,
6402 .apply_expected = true
6406 * mhomed,released vs. sgroup,tombstone with different ip(s)
6409 .line = __location__,
6410 .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL),
6414 .num_ips = ctx->addresses_best_num,
6415 .ips = ctx->addresses_best,
6416 .apply_expected = true
6419 .type = WREPL_TYPE_SGROUP,
6420 .state = WREPL_STATE_TOMBSTONE,
6421 .node = WREPL_NODE_B,
6423 .num_ips = ARRAY_SIZE(addresses_B_1),
6424 .ips = addresses_B_1,
6425 .apply_expected = true
6429 * multi homed vs. multi homed section
6432 * mhomed,released vs. mhomed,active with same ip(s)
6435 .line = __location__,
6436 .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL),
6440 .num_ips = ctx->addresses_best_num,
6441 .ips = ctx->addresses_best,
6442 .apply_expected = true
6445 .type = WREPL_TYPE_MHOMED,
6446 .state = WREPL_STATE_ACTIVE,
6447 .node = WREPL_NODE_B,
6449 .num_ips = ctx->addresses_best_num,
6450 .ips = ctx->addresses_best,
6451 .apply_expected = true
6455 * mhomed,released vs. mhomed,active with different ip(s)
6458 .line = __location__,
6459 .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL),
6463 .num_ips = ctx->addresses_best_num,
6464 .ips = ctx->addresses_best,
6465 .apply_expected = true
6468 .type = WREPL_TYPE_MHOMED,
6469 .state = WREPL_STATE_ACTIVE,
6470 .node = WREPL_NODE_B,
6472 .num_ips = ARRAY_SIZE(addresses_B_1),
6473 .ips = addresses_B_1,
6474 .apply_expected = true
6478 * mhomed,released vs. mhomed,tombstone with same ip(s)
6481 .line = __location__,
6482 .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL),
6486 .num_ips = ctx->addresses_best_num,
6487 .ips = ctx->addresses_best,
6488 .apply_expected = true
6491 .type = WREPL_TYPE_MHOMED,
6492 .state = WREPL_STATE_TOMBSTONE,
6493 .node = WREPL_NODE_B,
6495 .num_ips = ctx->addresses_best_num,
6496 .ips = ctx->addresses_best,
6497 .apply_expected = true
6501 * mhomed,released vs. mhomed,tombstone with different ip(s)
6504 .line = __location__,
6505 .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL),
6509 .num_ips = ctx->addresses_best_num,
6510 .ips = ctx->addresses_best,
6511 .apply_expected = true
6514 .type = WREPL_TYPE_MHOMED,
6515 .state = WREPL_STATE_TOMBSTONE,
6516 .node = WREPL_NODE_B,
6518 .num_ips = ARRAY_SIZE(addresses_B_1),
6519 .ips = addresses_B_1,
6520 .apply_expected = true
6525 torture_comment(tctx, "Test Replica records vs. owned released records\n");
6527 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
6528 torture_comment(tctx, "%s => %s\n", nbt_name_string(ctx, &records[i].name),
6529 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
6534 name_register->in.name = records[i].name;
6535 name_register->in.dest_addr = ctx->address;
6536 name_register->in.address = records[i].wins.ips[0].ip;
6537 name_register->in.nb_flags = records[i].wins.nb_flags;
6538 name_register->in.register_demand= false;
6539 name_register->in.broadcast = false;
6540 name_register->in.multi_homed = records[i].wins.mhomed;
6541 name_register->in.ttl = 300000;
6542 name_register->in.timeout = 70;
6543 name_register->in.retries = 0;
6545 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
6546 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6547 torture_comment(tctx, "No response from %s for name register\n", ctx->address);
6550 if (!NT_STATUS_IS_OK(status)) {
6551 torture_comment(tctx, "Bad response from %s for name register - %s\n",
6552 ctx->address, nt_errstr(status));
6555 CHECK_VALUE(tctx, name_register->out.rcode, 0);
6556 CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address);
6557 CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type);
6558 CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name);
6559 CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope);
6560 CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[0].ip);
6562 /* release the record */
6563 release->in.name = records[i].name;
6564 release->in.dest_addr = ctx->address;
6565 release->in.address = records[i].wins.ips[0].ip;
6566 release->in.nb_flags = records[i].wins.nb_flags;
6567 release->in.broadcast = false;
6568 release->in.timeout = 30;
6569 release->in.retries = 0;
6571 status = nbt_name_release(ctx->nbtsock, ctx, release);
6572 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6573 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
6576 if (!NT_STATUS_IS_OK(status)) {
6577 torture_comment(tctx, "Bad response from %s for name query - %s\n",
6578 ctx->address, nt_errstr(status));
6581 CHECK_VALUE(tctx, release->out.rcode, 0);
6586 wins_name->name = &records[i].name;
6587 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
6588 records[i].replica.state,
6589 records[i].replica.node,
6590 records[i].replica.is_static);
6591 wins_name->id = ++ctx->b.max_version;
6592 if (wins_name->flags & 2) {
6593 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
6594 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
6596 wins_name->addresses.ip = records[i].replica.ips[0].ip;
6598 wins_name->unknown = "255.255.255.255";
6600 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
6601 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name,
6602 records[i].replica.apply_expected);
6604 if (records[i].replica.apply_expected) {
6605 wins_name->name = &records[i].name;
6606 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
6607 WREPL_STATE_TOMBSTONE,
6608 WREPL_NODE_B, false);
6609 wins_name->id = ++ctx->b.max_version;
6610 wins_name->addresses.ip = addresses_B_1[0].ip;
6611 wins_name->unknown = "255.255.255.255";
6613 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
6614 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
6616 release->in.name = records[i].name;
6617 release->in.dest_addr = ctx->address;
6618 release->in.address = records[i].wins.ips[0].ip;
6619 release->in.nb_flags = records[i].wins.nb_flags;
6620 release->in.broadcast = false;
6621 release->in.timeout = 30;
6622 release->in.retries = 0;
6624 status = nbt_name_release(ctx->nbtsock, ctx, release);
6625 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6626 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
6629 if (!NT_STATUS_IS_OK(status)) {
6630 torture_comment(tctx, "Bad response from %s for name query - %s\n",
6631 ctx->address, nt_errstr(status));
6634 CHECK_VALUE(tctx, release->out.rcode, 0);
6637 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
6645 struct test_conflict_owned_active_vs_replica_struct {
6646 const char *line; /* just better debugging */
6647 const char *section; /* just better debugging */
6648 struct nbt_name name;
6649 const char *comment;
6655 const struct wrepl_ip *ips;
6656 bool apply_expected;
6661 bool expect_release;
6664 /* when num_ips == 0, then .wins.ips are used */
6666 const struct wrepl_ip *ips;
6669 enum wrepl_name_type type;
6670 enum wrepl_name_state state;
6671 enum wrepl_name_node node;
6674 const struct wrepl_ip *ips;
6675 bool apply_expected;
6681 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
6682 struct nbt_name_packet *req_packet,
6683 struct socket_address *src);
6685 static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx,
6686 struct test_wrepl_conflict_conn *ctx)
6690 struct wrepl_wins_name wins_name_;
6691 struct wrepl_wins_name *wins_name = &wins_name_;
6692 struct nbt_name_register name_register_;
6693 struct nbt_name_register *name_register = &name_register_;
6694 struct nbt_name_release release_;
6695 struct nbt_name_release *release = &release_;
6697 struct test_conflict_owned_active_vs_replica_struct records[] = {
6699 * unique vs. unique section
6701 #if METZE_NEEDS_TO_LOOK_AT_THIS_ONE
6703 * unique,active vs. unique,active with same ip(s), unchecked
6706 .line = __location__,
6707 .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL),
6711 .num_ips = ctx->addresses_best_num,
6712 .ips = ctx->addresses_best,
6713 .apply_expected = true
6719 .type = WREPL_TYPE_UNIQUE,
6720 .state = WREPL_STATE_ACTIVE,
6721 .node = WREPL_NODE_B,
6723 .num_ips = ctx->addresses_best_num,
6724 .ips = ctx->addresses_best,
6725 .apply_expected = true
6730 * unique,active vs. unique,active with different ip(s), positive response
6733 .line = __location__,
6734 .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL),
6738 .num_ips = ctx->addresses_best_num,
6739 .ips = ctx->addresses_best,
6740 .apply_expected = true
6747 .type = WREPL_TYPE_UNIQUE,
6748 .state = WREPL_STATE_ACTIVE,
6749 .node = WREPL_NODE_B,
6751 .num_ips = ARRAY_SIZE(addresses_B_1),
6752 .ips = addresses_B_1,
6753 .apply_expected = false
6757 * unique,active vs. unique,active with different ip(s), positive response other ips
6760 .line = __location__,
6761 .name = _NBT_NAME("_UA_UA_DI_O", 0x00, NULL),
6765 .num_ips = ctx->addresses_best_num,
6766 .ips = ctx->addresses_best,
6767 .apply_expected = true
6772 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6773 .ips = addresses_A_3_4,
6776 .type = WREPL_TYPE_UNIQUE,
6777 .state = WREPL_STATE_ACTIVE,
6778 .node = WREPL_NODE_B,
6780 .num_ips = ARRAY_SIZE(addresses_B_1),
6781 .ips = addresses_B_1,
6782 .apply_expected = false
6786 * unique,active vs. unique,active with different ip(s), negative response
6789 .line = __location__,
6790 .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL),
6794 .num_ips = ctx->addresses_best_num,
6795 .ips = ctx->addresses_best,
6796 .apply_expected = true
6803 .type = WREPL_TYPE_UNIQUE,
6804 .state = WREPL_STATE_ACTIVE,
6805 .node = WREPL_NODE_B,
6807 .num_ips = ARRAY_SIZE(addresses_B_1),
6808 .ips = addresses_B_1,
6809 .apply_expected = true
6813 * unique,active vs. unique,tombstone with same ip(s), unchecked
6816 .line = __location__,
6817 .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL),
6821 .num_ips = ctx->addresses_best_num,
6822 .ips = ctx->addresses_best,
6823 .apply_expected = true
6829 .type = WREPL_TYPE_UNIQUE,
6830 .state = WREPL_STATE_TOMBSTONE,
6831 .node = WREPL_NODE_B,
6833 .num_ips = ctx->addresses_best_num,
6834 .ips = ctx->addresses_best,
6835 .apply_expected = false
6839 * unique,active vs. unique,tombstone with different ip(s), unchecked
6842 .line = __location__,
6843 .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL),
6847 .num_ips = ctx->addresses_best_num,
6848 .ips = ctx->addresses_best,
6849 .apply_expected = true
6855 .type = WREPL_TYPE_UNIQUE,
6856 .state = WREPL_STATE_TOMBSTONE,
6857 .node = WREPL_NODE_B,
6859 .num_ips = ARRAY_SIZE(addresses_B_1),
6860 .ips = addresses_B_1,
6861 .apply_expected = false
6865 * unique vs. group section
6868 * unique,active vs. group,active with same ip(s), release expected
6871 .line = __location__,
6872 .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL),
6876 .num_ips = ctx->addresses_best_num,
6877 .ips = ctx->addresses_best,
6878 .apply_expected = true
6882 .expect_release = true,
6885 .type = WREPL_TYPE_GROUP,
6886 .state = WREPL_STATE_ACTIVE,
6887 .node = WREPL_NODE_B,
6889 .num_ips = ctx->addresses_best_num,
6890 .ips = ctx->addresses_best,
6891 .apply_expected = true
6895 * unique,active vs. group,active with different ip(s), release expected
6898 .line = __location__,
6899 .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL),
6903 .num_ips = ctx->addresses_best_num,
6904 .ips = ctx->addresses_best,
6905 .apply_expected = true
6909 .expect_release = true,
6912 .type = WREPL_TYPE_GROUP,
6913 .state = WREPL_STATE_ACTIVE,
6914 .node = WREPL_NODE_B,
6916 .num_ips = ARRAY_SIZE(addresses_B_1),
6917 .ips = addresses_B_1,
6918 .apply_expected = true
6922 * unique,active vs. group,tombstone with same ip(s), unchecked
6925 .line = __location__,
6926 .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL),
6930 .num_ips = ctx->addresses_best_num,
6931 .ips = ctx->addresses_best,
6932 .apply_expected = true
6938 .type = WREPL_TYPE_GROUP,
6939 .state = WREPL_STATE_TOMBSTONE,
6940 .node = WREPL_NODE_B,
6942 .num_ips = ctx->addresses_best_num,
6943 .ips = ctx->addresses_best,
6944 .apply_expected = false
6948 * unique,active vs. group,tombstone with different ip(s), unchecked
6951 .line = __location__,
6952 .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL),
6956 .num_ips = ctx->addresses_best_num,
6957 .ips = ctx->addresses_best,
6958 .apply_expected = true
6964 .type = WREPL_TYPE_GROUP,
6965 .state = WREPL_STATE_TOMBSTONE,
6966 .node = WREPL_NODE_B,
6968 .num_ips = ARRAY_SIZE(addresses_B_1),
6969 .ips = addresses_B_1,
6970 .apply_expected = false
6974 * unique vs. special group section
6977 * unique,active vs. sgroup,active with same ip(s), release expected
6980 .line = __location__,
6981 .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL),
6985 .num_ips = ctx->addresses_best_num,
6986 .ips = ctx->addresses_best,
6987 .apply_expected = true
6991 .expect_release = true,
6994 .type = WREPL_TYPE_SGROUP,
6995 .state = WREPL_STATE_ACTIVE,
6996 .node = WREPL_NODE_B,
6998 .num_ips = ctx->addresses_best_num,
6999 .ips = ctx->addresses_best,
7000 .apply_expected = true
7004 * unique,active vs. group,active with different ip(s), release expected
7007 .line = __location__,
7008 .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL),
7012 .num_ips = ctx->addresses_best_num,
7013 .ips = ctx->addresses_best,
7014 .apply_expected = true
7018 .expect_release = true,
7021 .type = WREPL_TYPE_SGROUP,
7022 .state = WREPL_STATE_ACTIVE,
7023 .node = WREPL_NODE_B,
7025 .num_ips = ARRAY_SIZE(addresses_B_1),
7026 .ips = addresses_B_1,
7027 .apply_expected = true
7031 * unique,active vs. sgroup,tombstone with same ip(s), unchecked
7034 .line = __location__,
7035 .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL),
7039 .num_ips = ctx->addresses_best_num,
7040 .ips = ctx->addresses_best,
7041 .apply_expected = true
7047 .type = WREPL_TYPE_SGROUP,
7048 .state = WREPL_STATE_TOMBSTONE,
7049 .node = WREPL_NODE_B,
7051 .num_ips = ctx->addresses_best_num,
7052 .ips = ctx->addresses_best,
7053 .apply_expected = false
7057 * unique,active vs. sgroup,tombstone with different ip(s), unchecked
7060 .line = __location__,
7061 .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL),
7065 .num_ips = ctx->addresses_best_num,
7066 .ips = ctx->addresses_best,
7067 .apply_expected = true
7073 .type = WREPL_TYPE_SGROUP,
7074 .state = WREPL_STATE_TOMBSTONE,
7075 .node = WREPL_NODE_B,
7077 .num_ips = ARRAY_SIZE(addresses_B_1),
7078 .ips = addresses_B_1,
7079 .apply_expected = false
7083 * unique vs. multi homed section
7086 * unique,active vs. mhomed,active with same ip(s), unchecked
7089 .line = __location__,
7090 .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL),
7094 .num_ips = ctx->addresses_best_num,
7095 .ips = ctx->addresses_best,
7096 .apply_expected = true
7102 .type = WREPL_TYPE_MHOMED,
7103 .state = WREPL_STATE_ACTIVE,
7104 .node = WREPL_NODE_B,
7106 .num_ips = ctx->addresses_best_num,
7107 .ips = ctx->addresses_best,
7108 .apply_expected = true
7112 * unique,active vs. mhomed,active with superset ip(s), unchecked
7115 .line = __location__,
7116 .name = _NBT_NAME("_UA_MA_SP_U", 0x00, NULL),
7120 .num_ips = ctx->addresses_best_num,
7121 .ips = ctx->addresses_best,
7122 .apply_expected = true
7128 .type = WREPL_TYPE_MHOMED,
7129 .state = WREPL_STATE_ACTIVE,
7130 .node = WREPL_NODE_B,
7132 .num_ips = ctx->addresses_all_num,
7133 .ips = ctx->addresses_all,
7134 .apply_expected = true
7138 * unique,active vs. mhomed,active with different ip(s), positive response
7141 .line = __location__,
7142 .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL),
7146 .num_ips = ctx->addresses_best_num,
7147 .ips = ctx->addresses_best,
7148 .apply_expected = true
7155 .type = WREPL_TYPE_MHOMED,
7156 .state = WREPL_STATE_ACTIVE,
7157 .node = WREPL_NODE_B,
7159 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7160 .ips = addresses_B_3_4,
7161 .apply_expected = false
7165 * unique,active vs. mhomed,active with different ip(s), positive response other ips
7168 .line = __location__,
7169 .name = _NBT_NAME("_UA_MA_DI_O", 0x00, NULL),
7173 .num_ips = ctx->addresses_best_num,
7174 .ips = ctx->addresses_best,
7175 .apply_expected = true
7180 .num_ips = ARRAY_SIZE(addresses_A_3_4),
7181 .ips = addresses_A_3_4,
7184 .type = WREPL_TYPE_MHOMED,
7185 .state = WREPL_STATE_ACTIVE,
7186 .node = WREPL_NODE_B,
7188 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7189 .ips = addresses_B_3_4,
7190 .apply_expected = false
7194 * unique,active vs. mhomed,active with different ip(s), negative response
7197 .line = __location__,
7198 .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL),
7202 .num_ips = ctx->addresses_best_num,
7203 .ips = ctx->addresses_best,
7204 .apply_expected = true
7211 .type = WREPL_TYPE_MHOMED,
7212 .state = WREPL_STATE_ACTIVE,
7213 .node = WREPL_NODE_B,
7215 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7216 .ips = addresses_B_3_4,
7217 .apply_expected = true
7221 * unique,active vs. mhomed,tombstone with same ip(s), unchecked
7224 .line = __location__,
7225 .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL),
7229 .num_ips = ctx->addresses_best_num,
7230 .ips = ctx->addresses_best,
7231 .apply_expected = true
7237 .type = WREPL_TYPE_MHOMED,
7238 .state = WREPL_STATE_TOMBSTONE,
7239 .node = WREPL_NODE_B,
7241 .num_ips = ctx->addresses_best_num,
7242 .ips = ctx->addresses_best,
7243 .apply_expected = false
7247 * unique,active vs. mhomed,tombstone with different ip(s), unchecked
7250 .line = __location__,
7251 .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL),
7255 .num_ips = ctx->addresses_best_num,
7256 .ips = ctx->addresses_best,
7257 .apply_expected = true
7263 .type = WREPL_TYPE_MHOMED,
7264 .state = WREPL_STATE_TOMBSTONE,
7265 .node = WREPL_NODE_B,
7267 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7268 .ips = addresses_B_3_4,
7269 .apply_expected = false
7273 * normal group vs. unique section
7276 * group,active vs. unique,active with same ip(s), unchecked
7279 .line = __location__,
7280 .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL),
7282 .nb_flags = NBT_NM_GROUP,
7284 .num_ips = ctx->addresses_best_num,
7285 .ips = ctx->addresses_best,
7286 .apply_expected = true
7292 .type = WREPL_TYPE_UNIQUE,
7293 .state = WREPL_STATE_ACTIVE,
7294 .node = WREPL_NODE_B,
7296 .num_ips = ctx->addresses_best_num,
7297 .ips = ctx->addresses_best,
7298 .apply_expected = false
7302 * group,active vs. unique,active with different ip(s), unchecked
7305 .line = __location__,
7306 .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL),
7308 .nb_flags = NBT_NM_GROUP,
7310 .num_ips = ctx->addresses_best_num,
7311 .ips = ctx->addresses_best,
7312 .apply_expected = true
7318 .type = WREPL_TYPE_UNIQUE,
7319 .state = WREPL_STATE_ACTIVE,
7320 .node = WREPL_NODE_B,
7322 .num_ips = ARRAY_SIZE(addresses_B_1),
7323 .ips = addresses_B_1,
7324 .apply_expected = false
7328 * group,active vs. unique,tombstone with same ip(s), unchecked
7331 .line = __location__,
7332 .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL),
7334 .nb_flags = NBT_NM_GROUP,
7336 .num_ips = ctx->addresses_best_num,
7337 .ips = ctx->addresses_best,
7338 .apply_expected = true
7344 .type = WREPL_TYPE_UNIQUE,
7345 .state = WREPL_STATE_TOMBSTONE,
7346 .node = WREPL_NODE_B,
7348 .num_ips = ctx->addresses_best_num,
7349 .ips = ctx->addresses_best,
7350 .apply_expected = false
7354 * group,active vs. unique,tombstone with different ip(s), unchecked
7357 .line = __location__,
7358 .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL),
7360 .nb_flags = NBT_NM_GROUP,
7362 .num_ips = ctx->addresses_best_num,
7363 .ips = ctx->addresses_best,
7364 .apply_expected = true
7370 .type = WREPL_TYPE_UNIQUE,
7371 .state = WREPL_STATE_TOMBSTONE,
7372 .node = WREPL_NODE_B,
7374 .num_ips = ARRAY_SIZE(addresses_B_1),
7375 .ips = addresses_B_1,
7376 .apply_expected = false
7380 * normal group vs. normal group section
7383 * group,active vs. group,active with same ip(s), unchecked
7386 .line = __location__,
7387 .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL),
7389 .nb_flags = NBT_NM_GROUP,
7391 .num_ips = ctx->addresses_best_num,
7392 .ips = ctx->addresses_best,
7393 .apply_expected = true
7399 .type = WREPL_TYPE_GROUP,
7400 .state = WREPL_STATE_ACTIVE,
7401 .node = WREPL_NODE_B,
7403 .num_ips = ctx->addresses_best_num,
7404 .ips = ctx->addresses_best,
7405 .apply_expected = true
7409 * group,active vs. group,active with different ip(s), unchecked
7412 .line = __location__,
7413 .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL),
7415 .nb_flags = NBT_NM_GROUP,
7417 .num_ips = ctx->addresses_best_num,
7418 .ips = ctx->addresses_best,
7419 .apply_expected = true
7425 .type = WREPL_TYPE_GROUP,
7426 .state = WREPL_STATE_ACTIVE,
7427 .node = WREPL_NODE_B,
7429 .num_ips = ARRAY_SIZE(addresses_B_1),
7430 .ips = addresses_B_1,
7431 .apply_expected = true
7435 * group,active vs. group,tombstone with same ip(s), unchecked
7438 .line = __location__,
7439 .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL),
7441 .nb_flags = NBT_NM_GROUP,
7443 .num_ips = ctx->addresses_best_num,
7444 .ips = ctx->addresses_best,
7445 .apply_expected = true
7451 .type = WREPL_TYPE_GROUP,
7452 .state = WREPL_STATE_TOMBSTONE,
7453 .node = WREPL_NODE_B,
7455 .num_ips = ctx->addresses_best_num,
7456 .ips = ctx->addresses_best,
7457 .apply_expected = false
7461 * group,active vs. group,tombstone with different ip(s), unchecked
7464 .line = __location__,
7465 .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL),
7467 .nb_flags = NBT_NM_GROUP,
7469 .num_ips = ctx->addresses_best_num,
7470 .ips = ctx->addresses_best,
7471 .apply_expected = true
7477 .type = WREPL_TYPE_GROUP,
7478 .state = WREPL_STATE_TOMBSTONE,
7479 .node = WREPL_NODE_B,
7481 .num_ips = ARRAY_SIZE(addresses_B_1),
7482 .ips = addresses_B_1,
7483 .apply_expected = false
7487 * normal group vs. special group section
7490 * group,active vs. sgroup,active with same ip(s), unchecked
7493 .line = __location__,
7494 .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL),
7496 .nb_flags = NBT_NM_GROUP,
7498 .num_ips = ctx->addresses_best_num,
7499 .ips = ctx->addresses_best,
7500 .apply_expected = true
7506 .type = WREPL_TYPE_SGROUP,
7507 .state = WREPL_STATE_ACTIVE,
7508 .node = WREPL_NODE_B,
7510 .num_ips = ctx->addresses_best_num,
7511 .ips = ctx->addresses_best,
7512 .apply_expected = false
7516 * group,active vs. sgroup,active with different ip(s), unchecked
7519 .line = __location__,
7520 .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL),
7522 .nb_flags = NBT_NM_GROUP,
7524 .num_ips = ctx->addresses_best_num,
7525 .ips = ctx->addresses_best,
7526 .apply_expected = true
7532 .type = WREPL_TYPE_SGROUP,
7533 .state = WREPL_STATE_ACTIVE,
7534 .node = WREPL_NODE_B,
7536 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7537 .ips = addresses_B_3_4,
7538 .apply_expected = false
7542 * group,active vs. sgroup,tombstone with same ip(s), unchecked
7545 .line = __location__,
7546 .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL),
7548 .nb_flags = NBT_NM_GROUP,
7550 .num_ips = ctx->addresses_best_num,
7551 .ips = ctx->addresses_best,
7552 .apply_expected = true
7558 .type = WREPL_TYPE_SGROUP,
7559 .state = WREPL_STATE_TOMBSTONE,
7560 .node = WREPL_NODE_B,
7562 .num_ips = ctx->addresses_best_num,
7563 .ips = ctx->addresses_best,
7564 .apply_expected = false
7568 * group,active vs. sgroup,tombstone with different ip(s), unchecked
7571 .line = __location__,
7572 .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL),
7574 .nb_flags = NBT_NM_GROUP,
7576 .num_ips = ctx->addresses_best_num,
7577 .ips = ctx->addresses_best,
7578 .apply_expected = true
7584 .type = WREPL_TYPE_SGROUP,
7585 .state = WREPL_STATE_TOMBSTONE,
7586 .node = WREPL_NODE_B,
7588 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7589 .ips = addresses_B_3_4,
7590 .apply_expected = false
7594 * normal group vs. multi homed section
7597 * group,active vs. mhomed,active with same ip(s), unchecked
7600 .line = __location__,
7601 .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL),
7603 .nb_flags = NBT_NM_GROUP,
7605 .num_ips = ctx->addresses_best_num,
7606 .ips = ctx->addresses_best,
7607 .apply_expected = true
7613 .type = WREPL_TYPE_MHOMED,
7614 .state = WREPL_STATE_ACTIVE,
7615 .node = WREPL_NODE_B,
7617 .num_ips = ctx->addresses_best_num,
7618 .ips = ctx->addresses_best,
7619 .apply_expected = false
7623 * group,active vs. mhomed,active with different ip(s), unchecked
7626 .line = __location__,
7627 .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL),
7629 .nb_flags = NBT_NM_GROUP,
7631 .num_ips = ctx->addresses_best_num,
7632 .ips = ctx->addresses_best,
7633 .apply_expected = true
7639 .type = WREPL_TYPE_MHOMED,
7640 .state = WREPL_STATE_ACTIVE,
7641 .node = WREPL_NODE_B,
7643 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7644 .ips = addresses_B_3_4,
7645 .apply_expected = false
7649 * group,active vs. mhomed,tombstone with same ip(s), unchecked
7652 .line = __location__,
7653 .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL),
7655 .nb_flags = NBT_NM_GROUP,
7657 .num_ips = ctx->addresses_best_num,
7658 .ips = ctx->addresses_best,
7659 .apply_expected = true
7665 .type = WREPL_TYPE_MHOMED,
7666 .state = WREPL_STATE_TOMBSTONE,
7667 .node = WREPL_NODE_B,
7669 .num_ips = ctx->addresses_best_num,
7670 .ips = ctx->addresses_best,
7671 .apply_expected = false
7675 * group,active vs. mhomed,tombstone with different ip(s), unchecked
7678 .line = __location__,
7679 .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL),
7681 .nb_flags = NBT_NM_GROUP,
7683 .num_ips = ctx->addresses_best_num,
7684 .ips = ctx->addresses_best,
7685 .apply_expected = true
7691 .type = WREPL_TYPE_MHOMED,
7692 .state = WREPL_STATE_TOMBSTONE,
7693 .node = WREPL_NODE_B,
7695 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7696 .ips = addresses_B_3_4,
7697 .apply_expected = false
7701 * special group vs. unique section
7704 * sgroup,active vs. unique,active with same ip(s), unchecked
7707 .line = __location__,
7708 .name = _NBT_NAME("_SA_UA_SI_U", 0x1C, NULL),
7710 .nb_flags = NBT_NM_GROUP,
7712 .num_ips = ctx->addresses_best_num,
7713 .ips = ctx->addresses_best,
7714 .apply_expected = true
7720 .type = WREPL_TYPE_UNIQUE,
7721 .state = WREPL_STATE_ACTIVE,
7722 .node = WREPL_NODE_B,
7724 .num_ips = ctx->addresses_best_num,
7725 .ips = ctx->addresses_best,
7726 .apply_expected = false
7730 * sgroup,active vs. unique,active with different ip(s), unchecked
7733 .line = __location__,
7734 .name = _NBT_NAME("_SA_UA_DI_U", 0x1C, NULL),
7736 .nb_flags = NBT_NM_GROUP,
7738 .num_ips = ctx->addresses_best_num,
7739 .ips = ctx->addresses_best,
7740 .apply_expected = true
7746 .type = WREPL_TYPE_UNIQUE,
7747 .state = WREPL_STATE_ACTIVE,
7748 .node = WREPL_NODE_B,
7750 .num_ips = ARRAY_SIZE(addresses_B_1),
7751 .ips = addresses_B_1,
7752 .apply_expected = false
7756 * sgroup,active vs. unique,tombstone with same ip(s), unchecked
7759 .line = __location__,
7760 .name = _NBT_NAME("_SA_UT_SI_U", 0x1C, NULL),
7762 .nb_flags = NBT_NM_GROUP,
7764 .num_ips = ctx->addresses_best_num,
7765 .ips = ctx->addresses_best,
7766 .apply_expected = true
7772 .type = WREPL_TYPE_UNIQUE,
7773 .state = WREPL_STATE_TOMBSTONE,
7774 .node = WREPL_NODE_B,
7776 .num_ips = ctx->addresses_best_num,
7777 .ips = ctx->addresses_best,
7778 .apply_expected = false
7782 * sgroup,active vs. unique,tombstone with different ip(s), unchecked
7785 .line = __location__,
7786 .name = _NBT_NAME("_SA_UT_DI_U", 0x1C, NULL),
7788 .nb_flags = NBT_NM_GROUP,
7790 .num_ips = ctx->addresses_best_num,
7791 .ips = ctx->addresses_best,
7792 .apply_expected = true
7798 .type = WREPL_TYPE_UNIQUE,
7799 .state = WREPL_STATE_TOMBSTONE,
7800 .node = WREPL_NODE_B,
7802 .num_ips = ARRAY_SIZE(addresses_B_1),
7803 .ips = addresses_B_1,
7804 .apply_expected = false
7808 * special group vs. normal group section
7811 * sgroup,active vs. group,active with same ip(s), unchecked
7814 .line = __location__,
7815 .name = _NBT_NAME("_SA_GA_SI_U", 0x1C, NULL),
7817 .nb_flags = NBT_NM_GROUP,
7819 .num_ips = ctx->addresses_best_num,
7820 .ips = ctx->addresses_best,
7821 .apply_expected = true
7827 .type = WREPL_TYPE_GROUP,
7828 .state = WREPL_STATE_ACTIVE,
7829 .node = WREPL_NODE_B,
7831 .num_ips = ctx->addresses_best_num,
7832 .ips = ctx->addresses_best,
7833 .apply_expected = false
7837 * sgroup,active vs. group,active with different ip(s), unchecked
7840 .line = __location__,
7841 .name = _NBT_NAME("_SA_GA_DI_U", 0x1C, NULL),
7843 .nb_flags = NBT_NM_GROUP,
7845 .num_ips = ctx->addresses_best_num,
7846 .ips = ctx->addresses_best,
7847 .apply_expected = true
7853 .type = WREPL_TYPE_GROUP,
7854 .state = WREPL_STATE_ACTIVE,
7855 .node = WREPL_NODE_B,
7857 .num_ips = ARRAY_SIZE(addresses_B_1),
7858 .ips = addresses_B_1,
7859 .apply_expected = false
7863 * sgroup,active vs. group,tombstone with same ip(s), unchecked
7866 .line = __location__,
7867 .name = _NBT_NAME("_SA_GT_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_GROUP,
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. group,tombstone with different ip(s), unchecked
7892 .line = __location__,
7893 .name = _NBT_NAME("_SA_GT_DI_U", 0x1C, NULL),
7895 .nb_flags = NBT_NM_GROUP,
7897 .num_ips = ctx->addresses_best_num,
7898 .ips = ctx->addresses_best,
7899 .apply_expected = true
7905 .type = WREPL_TYPE_GROUP,
7906 .state = WREPL_STATE_TOMBSTONE,
7907 .node = WREPL_NODE_B,
7909 .num_ips = ARRAY_SIZE(addresses_B_1),
7910 .ips = addresses_B_1,
7911 .apply_expected = false
7915 * special group vs. multi homed section
7918 * sgroup,active vs. mhomed,active with same ip(s), unchecked
7921 .line = __location__,
7922 .name = _NBT_NAME("_SA_MA_SI_U", 0x1C, NULL),
7924 .nb_flags = NBT_NM_GROUP,
7926 .num_ips = ctx->addresses_best_num,
7927 .ips = ctx->addresses_best,
7928 .apply_expected = true
7934 .type = WREPL_TYPE_MHOMED,
7935 .state = WREPL_STATE_ACTIVE,
7936 .node = WREPL_NODE_B,
7938 .num_ips = ctx->addresses_best_num,
7939 .ips = ctx->addresses_best,
7940 .apply_expected = false
7944 * sgroup,active vs. mhomed,active with different ip(s), unchecked
7947 .line = __location__,
7948 .name = _NBT_NAME("_SA_MA_DI_U", 0x1C, NULL),
7950 .nb_flags = NBT_NM_GROUP,
7952 .num_ips = ctx->addresses_best_num,
7953 .ips = ctx->addresses_best,
7954 .apply_expected = true
7960 .type = WREPL_TYPE_MHOMED,
7961 .state = WREPL_STATE_ACTIVE,
7962 .node = WREPL_NODE_B,
7964 .num_ips = ARRAY_SIZE(addresses_B_1),
7965 .ips = addresses_B_1,
7966 .apply_expected = false
7970 * sgroup,active vs. mhomed,tombstone with same ip(s), unchecked
7973 .line = __location__,
7974 .name = _NBT_NAME("_SA_MT_SI_U", 0x1C, NULL),
7976 .nb_flags = NBT_NM_GROUP,
7978 .num_ips = ctx->addresses_best_num,
7979 .ips = ctx->addresses_best,
7980 .apply_expected = true
7986 .type = WREPL_TYPE_MHOMED,
7987 .state = WREPL_STATE_TOMBSTONE,
7988 .node = WREPL_NODE_B,
7990 .num_ips = ctx->addresses_best_num,
7991 .ips = ctx->addresses_best,
7992 .apply_expected = false
7996 * sgroup,active vs. mhomed,tombstone with different ip(s), unchecked
7999 .line = __location__,
8000 .name = _NBT_NAME("_SA_MT_DI_U", 0x1C, NULL),
8002 .nb_flags = NBT_NM_GROUP,
8004 .num_ips = ctx->addresses_best_num,
8005 .ips = ctx->addresses_best,
8006 .apply_expected = true
8012 .type = WREPL_TYPE_MHOMED,
8013 .state = WREPL_STATE_TOMBSTONE,
8014 .node = WREPL_NODE_B,
8016 .num_ips = ARRAY_SIZE(addresses_B_1),
8017 .ips = addresses_B_1,
8018 .apply_expected = false
8022 * multi homed vs. unique section
8025 * mhomed,active vs. unique,active with same ip(s), unchecked
8028 .line = __location__,
8029 .name = _NBT_NAME("_MA_UA_SI_U", 0x00, NULL),
8033 .num_ips = ctx->addresses_best_num,
8034 .ips = ctx->addresses_best,
8035 .apply_expected = true
8041 .type = WREPL_TYPE_UNIQUE,
8042 .state = WREPL_STATE_ACTIVE,
8043 .node = WREPL_NODE_B,
8045 .num_ips = ctx->addresses_best_num,
8046 .ips = ctx->addresses_best,
8047 .apply_expected = true
8051 * mhomed,active vs. unique,active with different ip(s), positive response
8054 .line = __location__,
8055 .name = _NBT_NAME("_MA_UA_DI_P", 0x00, NULL),
8059 .num_ips = ctx->addresses_best_num,
8060 .ips = ctx->addresses_best,
8061 .apply_expected = true
8068 .type = WREPL_TYPE_UNIQUE,
8069 .state = WREPL_STATE_ACTIVE,
8070 .node = WREPL_NODE_B,
8072 .num_ips = ARRAY_SIZE(addresses_B_1),
8073 .ips = addresses_B_1,
8074 .apply_expected = false
8078 * mhomed,active vs. unique,active with different ip(s), positive response other ips
8081 .line = __location__,
8082 .name = _NBT_NAME("_MA_UA_DI_O", 0x00, NULL),
8086 .num_ips = ctx->addresses_best_num,
8087 .ips = ctx->addresses_best,
8088 .apply_expected = true
8093 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8094 .ips = addresses_A_3_4,
8097 .type = WREPL_TYPE_UNIQUE,
8098 .state = WREPL_STATE_ACTIVE,
8099 .node = WREPL_NODE_B,
8101 .num_ips = ARRAY_SIZE(addresses_B_1),
8102 .ips = addresses_B_1,
8103 .apply_expected = false
8107 * mhomed,active vs. unique,active with different ip(s), negative response
8110 .line = __location__,
8111 .name = _NBT_NAME("_MA_UA_DI_N", 0x00, NULL),
8115 .num_ips = ctx->addresses_best_num,
8116 .ips = ctx->addresses_best,
8117 .apply_expected = true
8124 .type = WREPL_TYPE_UNIQUE,
8125 .state = WREPL_STATE_ACTIVE,
8126 .node = WREPL_NODE_B,
8128 .num_ips = ARRAY_SIZE(addresses_B_1),
8129 .ips = addresses_B_1,
8130 .apply_expected = true
8134 * mhomed,active vs. unique,tombstone with same ip(s), unchecked
8137 .line = __location__,
8138 .name = _NBT_NAME("_MA_UT_SI_U", 0x00, NULL),
8142 .num_ips = ctx->addresses_best_num,
8143 .ips = ctx->addresses_best,
8144 .apply_expected = true
8150 .type = WREPL_TYPE_UNIQUE,
8151 .state = WREPL_STATE_TOMBSTONE,
8152 .node = WREPL_NODE_B,
8154 .num_ips = ctx->addresses_best_num,
8155 .ips = ctx->addresses_best,
8156 .apply_expected = false
8160 * mhomed,active vs. unique,tombstone with different ip(s), unchecked
8163 .line = __location__,
8164 .name = _NBT_NAME("_MA_UT_DI_U", 0x00, NULL),
8168 .num_ips = ctx->addresses_best_num,
8169 .ips = ctx->addresses_best,
8170 .apply_expected = true
8176 .type = WREPL_TYPE_UNIQUE,
8177 .state = WREPL_STATE_TOMBSTONE,
8178 .node = WREPL_NODE_B,
8180 .num_ips = ARRAY_SIZE(addresses_B_1),
8181 .ips = addresses_B_1,
8182 .apply_expected = false
8186 * multi homed vs. normal group section
8189 * mhomed,active vs. group,active with same ip(s), release expected
8192 .line = __location__,
8193 .name = _NBT_NAME("_MA_GA_SI_R", 0x00, NULL),
8197 .num_ips = ctx->addresses_best_num,
8198 .ips = ctx->addresses_best,
8199 .apply_expected = true
8203 .expect_release = true,
8206 .type = WREPL_TYPE_GROUP,
8207 .state = WREPL_STATE_ACTIVE,
8208 .node = WREPL_NODE_B,
8210 .num_ips = ctx->addresses_best_num,
8211 .ips = ctx->addresses_best,
8212 .apply_expected = true
8216 * mhomed,active vs. group,active with different ip(s), release expected
8219 .line = __location__,
8220 .name = _NBT_NAME("_MA_GA_DI_R", 0x00, NULL),
8224 .num_ips = ctx->addresses_best_num,
8225 .ips = ctx->addresses_best,
8226 .apply_expected = true
8230 .expect_release = true,
8233 .type = WREPL_TYPE_GROUP,
8234 .state = WREPL_STATE_ACTIVE,
8235 .node = WREPL_NODE_B,
8237 .num_ips = ARRAY_SIZE(addresses_B_1),
8238 .ips = addresses_B_1,
8239 .apply_expected = true
8243 * mhomed,active vs. group,tombstone with same ip(s), unchecked
8246 .line = __location__,
8247 .name = _NBT_NAME("_MA_GT_SI_U", 0x00, NULL),
8251 .num_ips = ctx->addresses_best_num,
8252 .ips = ctx->addresses_best,
8253 .apply_expected = true
8259 .type = WREPL_TYPE_GROUP,
8260 .state = WREPL_STATE_TOMBSTONE,
8261 .node = WREPL_NODE_B,
8263 .num_ips = ctx->addresses_best_num,
8264 .ips = ctx->addresses_best,
8265 .apply_expected = false
8269 * mhomed,active vs. group,tombstone with different ip(s), unchecked
8272 .line = __location__,
8273 .name = _NBT_NAME("_MA_GT_DI_U", 0x00, NULL),
8277 .num_ips = ctx->addresses_best_num,
8278 .ips = ctx->addresses_best,
8279 .apply_expected = true
8285 .type = WREPL_TYPE_GROUP,
8286 .state = WREPL_STATE_TOMBSTONE,
8287 .node = WREPL_NODE_B,
8289 .num_ips = ARRAY_SIZE(addresses_B_1),
8290 .ips = addresses_B_1,
8291 .apply_expected = false
8295 * multi homed vs. special group section
8298 * mhomed,active vs. sgroup,active with same ip(s), release expected
8301 .line = __location__,
8302 .name = _NBT_NAME("_MA_SA_SI_R", 0x00, NULL),
8306 .num_ips = ctx->addresses_best_num,
8307 .ips = ctx->addresses_best,
8308 .apply_expected = true
8312 .expect_release = true,
8315 .type = WREPL_TYPE_SGROUP,
8316 .state = WREPL_STATE_ACTIVE,
8317 .node = WREPL_NODE_B,
8319 .num_ips = ctx->addresses_best_num,
8320 .ips = ctx->addresses_best,
8321 .apply_expected = true
8325 * mhomed,active vs. group,active with different ip(s), release expected
8328 .line = __location__,
8329 .name = _NBT_NAME("_MA_SA_DI_R", 0x00, NULL),
8333 .num_ips = ctx->addresses_best_num,
8334 .ips = ctx->addresses_best,
8335 .apply_expected = true
8339 .expect_release = true,
8342 .type = WREPL_TYPE_SGROUP,
8343 .state = WREPL_STATE_ACTIVE,
8344 .node = WREPL_NODE_B,
8346 .num_ips = ARRAY_SIZE(addresses_B_1),
8347 .ips = addresses_B_1,
8348 .apply_expected = true
8352 * mhomed,active vs. sgroup,tombstone with same ip(s), unchecked
8355 .line = __location__,
8356 .name = _NBT_NAME("_MA_ST_SI_U", 0x00, NULL),
8360 .num_ips = ctx->addresses_best_num,
8361 .ips = ctx->addresses_best,
8362 .apply_expected = true
8368 .type = WREPL_TYPE_SGROUP,
8369 .state = WREPL_STATE_TOMBSTONE,
8370 .node = WREPL_NODE_B,
8372 .num_ips = ctx->addresses_best_num,
8373 .ips = ctx->addresses_best,
8374 .apply_expected = false
8378 * mhomed,active vs. sgroup,tombstone with different ip(s), unchecked
8381 .line = __location__,
8382 .name = _NBT_NAME("_MA_ST_DI_U", 0x00, NULL),
8386 .num_ips = ctx->addresses_best_num,
8387 .ips = ctx->addresses_best,
8388 .apply_expected = true
8394 .type = WREPL_TYPE_SGROUP,
8395 .state = WREPL_STATE_TOMBSTONE,
8396 .node = WREPL_NODE_B,
8398 .num_ips = ARRAY_SIZE(addresses_B_1),
8399 .ips = addresses_B_1,
8400 .apply_expected = false
8404 * multi homed vs. multi homed section
8407 * mhomed,active vs. mhomed,active with same ip(s), unchecked
8410 .line = __location__,
8411 .name = _NBT_NAME("_MA_MA_SI_U", 0x00, NULL),
8415 .num_ips = ctx->addresses_best_num,
8416 .ips = ctx->addresses_best,
8417 .apply_expected = true
8423 .type = WREPL_TYPE_MHOMED,
8424 .state = WREPL_STATE_ACTIVE,
8425 .node = WREPL_NODE_B,
8427 .num_ips = ctx->addresses_best_num,
8428 .ips = ctx->addresses_best,
8429 .apply_expected = true
8433 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8436 .line = __location__,
8437 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8441 .num_ips = ctx->addresses_best_num,
8442 .ips = ctx->addresses_best,
8443 .apply_expected = true
8449 .type = WREPL_TYPE_MHOMED,
8450 .state = WREPL_STATE_ACTIVE,
8451 .node = WREPL_NODE_B,
8453 .num_ips = ctx->addresses_all_num,
8454 .ips = ctx->addresses_all,
8455 .apply_expected = true
8459 * mhomed,active vs. mhomed,active with different ip(s), positive response
8462 .line = __location__,
8463 .name = _NBT_NAME("_MA_MA_DI_P", 0x00, NULL),
8467 .num_ips = ctx->addresses_best_num,
8468 .ips = ctx->addresses_best,
8469 .apply_expected = true
8476 .type = WREPL_TYPE_MHOMED,
8477 .state = WREPL_STATE_ACTIVE,
8478 .node = WREPL_NODE_B,
8480 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8481 .ips = addresses_B_3_4,
8482 .apply_expected = false
8486 * mhomed,active vs. mhomed,active with different ip(s), positive response other ips
8489 .line = __location__,
8490 .name = _NBT_NAME("_MA_MA_DI_O", 0x00, NULL),
8494 .num_ips = ctx->addresses_best_num,
8495 .ips = ctx->addresses_best,
8496 .apply_expected = true
8501 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8502 .ips = addresses_A_3_4,
8505 .type = WREPL_TYPE_MHOMED,
8506 .state = WREPL_STATE_ACTIVE,
8507 .node = WREPL_NODE_B,
8509 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8510 .ips = addresses_B_3_4,
8511 .apply_expected = false
8515 * mhomed,active vs. mhomed,active with different ip(s), negative response
8518 .line = __location__,
8519 .name = _NBT_NAME("_MA_MA_DI_N", 0x00, NULL),
8523 .num_ips = ctx->addresses_best_num,
8524 .ips = ctx->addresses_best,
8525 .apply_expected = true
8532 .type = WREPL_TYPE_MHOMED,
8533 .state = WREPL_STATE_ACTIVE,
8534 .node = WREPL_NODE_B,
8536 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8537 .ips = addresses_B_3_4,
8538 .apply_expected = true
8542 * mhomed,active vs. mhomed,tombstone with same ip(s), unchecked
8545 .line = __location__,
8546 .name = _NBT_NAME("_MA_MT_SI_U", 0x00, NULL),
8550 .num_ips = ctx->addresses_best_num,
8551 .ips = ctx->addresses_best,
8552 .apply_expected = true
8558 .type = WREPL_TYPE_MHOMED,
8559 .state = WREPL_STATE_TOMBSTONE,
8560 .node = WREPL_NODE_B,
8562 .num_ips = ctx->addresses_best_num,
8563 .ips = ctx->addresses_best,
8564 .apply_expected = false
8568 * mhomed,active vs. mhomed,tombstone with different ip(s), unchecked
8571 .line = __location__,
8572 .name = _NBT_NAME("_MA_MT_DI_U", 0x00, NULL),
8576 .num_ips = ctx->addresses_best_num,
8577 .ips = ctx->addresses_best,
8578 .apply_expected = true
8584 .type = WREPL_TYPE_MHOMED,
8585 .state = WREPL_STATE_TOMBSTONE,
8586 .node = WREPL_NODE_B,
8588 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8589 .ips = addresses_B_3_4,
8590 .apply_expected = false
8594 * some more multi homed test, including merging
8597 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8600 .line = __location__,
8601 .section= "Test Replica vs. owned active: some more MHOMED combinations",
8602 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8603 .comment= "C:MHOMED vs. B:ALL => B:ALL",
8604 .skip = (ctx->addresses_all_num < 3),
8608 .num_ips = ctx->addresses_mhomed_num,
8609 .ips = ctx->addresses_mhomed,
8610 .apply_expected = true
8616 .type = WREPL_TYPE_MHOMED,
8617 .state = WREPL_STATE_ACTIVE,
8618 .node = WREPL_NODE_B,
8620 .num_ips = ctx->addresses_all_num,
8621 .ips = ctx->addresses_all,
8622 .apply_expected = true
8626 * mhomed,active vs. mhomed,active with same ips, unchecked
8629 .line = __location__,
8630 .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL),
8631 .comment= "C:MHOMED vs. B:MHOMED => B:MHOMED",
8632 .skip = (ctx->addresses_mhomed_num < 2),
8636 .num_ips = ctx->addresses_mhomed_num,
8637 .ips = ctx->addresses_mhomed,
8638 .apply_expected = true
8644 .type = WREPL_TYPE_MHOMED,
8645 .state = WREPL_STATE_ACTIVE,
8646 .node = WREPL_NODE_B,
8648 .num_ips = ctx->addresses_mhomed_num,
8649 .ips = ctx->addresses_mhomed,
8650 .apply_expected = true
8654 * mhomed,active vs. mhomed,active with subset ip(s), positive response
8657 .line = __location__,
8658 .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL),
8659 .comment= "C:MHOMED vs. B:BEST (C:MHOMED) => B:MHOMED",
8660 .skip = (ctx->addresses_mhomed_num < 2),
8664 .num_ips = ctx->addresses_mhomed_num,
8665 .ips = ctx->addresses_mhomed,
8666 .apply_expected = true
8673 .type = WREPL_TYPE_MHOMED,
8674 .state = WREPL_STATE_ACTIVE,
8675 .node = WREPL_NODE_B,
8677 .num_ips = ctx->addresses_best_num,
8678 .ips = ctx->addresses_best,
8679 .mhomed_merge = true
8683 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with all addresses
8686 .line = __location__,
8687 .name = _NBT_NAME("_MA_MA_SB_A", 0x00, NULL),
8688 .comment= "C:MHOMED vs. B:BEST (C:ALL) => B:MHOMED",
8689 .skip = (ctx->addresses_all_num < 3),
8693 .num_ips = ctx->addresses_mhomed_num,
8694 .ips = ctx->addresses_mhomed,
8695 .apply_expected = true
8700 .num_ips = ctx->addresses_all_num,
8701 .ips = ctx->addresses_all,
8704 .type = WREPL_TYPE_MHOMED,
8705 .state = WREPL_STATE_ACTIVE,
8706 .node = WREPL_NODE_B,
8708 .num_ips = ctx->addresses_best_num,
8709 .ips = ctx->addresses_best,
8710 .mhomed_merge = true
8714 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with replicas addresses
8715 * TODO: check why the server sends a name release demand for one address?
8716 * the release demand has no effect to the database record...
8719 .line = __location__,
8720 .name = _NBT_NAME("_MA_MA_SB_PRA", 0x00, NULL),
8721 .comment= "C:MHOMED vs. B:BEST (C:BEST) => C:MHOMED",
8722 .skip = (ctx->addresses_all_num < 2),
8726 .num_ips = ctx->addresses_mhomed_num,
8727 .ips = ctx->addresses_mhomed,
8728 .apply_expected = true
8733 .num_ips = ctx->addresses_best_num,
8734 .ips = ctx->addresses_best,
8735 .late_release = true
8738 .type = WREPL_TYPE_MHOMED,
8739 .state = WREPL_STATE_ACTIVE,
8740 .node = WREPL_NODE_B,
8742 .num_ips = ctx->addresses_best_num,
8743 .ips = ctx->addresses_best,
8744 .apply_expected = false
8748 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with other addresses
8751 .line = __location__,
8752 .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL),
8753 .comment= "C:MHOMED vs. B:BEST (B:B_3_4) =>C:MHOMED",
8754 .skip = (ctx->addresses_all_num < 2),
8758 .num_ips = ctx->addresses_mhomed_num,
8759 .ips = ctx->addresses_mhomed,
8760 .apply_expected = true
8765 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8766 .ips = addresses_B_3_4,
8769 .type = WREPL_TYPE_MHOMED,
8770 .state = WREPL_STATE_ACTIVE,
8771 .node = WREPL_NODE_B,
8773 .num_ips = ctx->addresses_best_num,
8774 .ips = ctx->addresses_best,
8775 .apply_expected = false
8779 * mhomed,active vs. mhomed,active with subset ip(s), negative response
8782 .line = __location__,
8783 .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL),
8784 .comment= "C:MHOMED vs. B:BEST (NEGATIVE) => B:BEST",
8785 .skip = (ctx->addresses_mhomed_num < 2),
8789 .num_ips = ctx->addresses_mhomed_num,
8790 .ips = ctx->addresses_mhomed,
8791 .apply_expected = true
8798 .type = WREPL_TYPE_MHOMED,
8799 .state = WREPL_STATE_ACTIVE,
8800 .node = WREPL_NODE_B,
8802 .num_ips = ctx->addresses_best_num,
8803 .ips = ctx->addresses_best,
8804 .apply_expected = true
8808 * some more multi homed and unique test, including merging
8811 * mhomed,active vs. unique,active with subset ip(s), positive response
8814 .line = __location__,
8815 .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations",
8816 .name = _NBT_NAME("_MA_UA_SB_P", 0x00, NULL),
8817 .comment= "C:MHOMED vs. B:UNIQUE,BEST (C:MHOMED) => B:MHOMED",
8818 .skip = (ctx->addresses_all_num < 2),
8822 .num_ips = ctx->addresses_mhomed_num,
8823 .ips = ctx->addresses_mhomed,
8824 .apply_expected = true
8831 .type = WREPL_TYPE_UNIQUE,
8832 .state = WREPL_STATE_ACTIVE,
8833 .node = WREPL_NODE_B,
8835 .num_ips = ctx->addresses_best_num,
8836 .ips = ctx->addresses_best,
8837 .mhomed_merge = true
8841 * unique,active vs. unique,active with different ip(s), positive response, with replicas address
8842 * TODO: check why the server sends a name release demand for one address?
8843 * the release demand has no effect to the database record...
8846 .line = __location__,
8847 .name = _NBT_NAME("_UA_UA_DI_PRA", 0x00, NULL),
8848 .comment= "C:BEST vs. B:BEST2 (C:BEST2,LR:BEST2) => C:BEST",
8849 .skip = (ctx->addresses_all_num < 2),
8853 .num_ips = ctx->addresses_best_num,
8854 .ips = ctx->addresses_best,
8855 .apply_expected = true
8860 .num_ips = ctx->addresses_best2_num,
8861 .ips = ctx->addresses_best2,
8862 .late_release = true
8865 .type = WREPL_TYPE_UNIQUE,
8866 .state = WREPL_STATE_ACTIVE,
8867 .node = WREPL_NODE_B,
8869 .num_ips = ctx->addresses_best2_num,
8870 .ips = ctx->addresses_best2,
8871 .apply_expected = false,
8875 * unique,active vs. unique,active with different ip(s), positive response, with all addresses
8878 .line = __location__,
8879 .name = _NBT_NAME("_UA_UA_DI_A", 0x00, NULL),
8880 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
8881 .skip = (ctx->addresses_all_num < 3),
8885 .num_ips = ctx->addresses_best_num,
8886 .ips = ctx->addresses_best,
8887 .apply_expected = true
8892 .num_ips = ctx->addresses_all_num,
8893 .ips = ctx->addresses_all,
8896 .type = WREPL_TYPE_UNIQUE,
8897 .state = WREPL_STATE_ACTIVE,
8898 .node = WREPL_NODE_B,
8900 .num_ips = ctx->addresses_best2_num,
8901 .ips = ctx->addresses_best2,
8902 .mhomed_merge = true,
8906 * unique,active vs. mhomed,active with different ip(s), positive response, with all addresses
8909 .line = __location__,
8910 .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL),
8911 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
8912 .skip = (ctx->addresses_all_num < 3),
8916 .num_ips = ctx->addresses_best_num,
8917 .ips = ctx->addresses_best,
8918 .apply_expected = true
8923 .num_ips = ctx->addresses_all_num,
8924 .ips = ctx->addresses_all,
8927 .type = WREPL_TYPE_MHOMED,
8928 .state = WREPL_STATE_ACTIVE,
8929 .node = WREPL_NODE_B,
8931 .num_ips = ctx->addresses_best2_num,
8932 .ips = ctx->addresses_best2,
8933 .mhomed_merge = true,
8937 * special group vs. special group merging section
8940 * sgroup,active vs. sgroup,active with different ip(s)
8943 .line = __location__,
8944 .section= "Test Replica vs. owned active: SGROUP vs. SGROUP tests",
8945 .name = _NBT_NAME("_SA_SA_DI_U", 0x1C, NULL),
8946 .skip = (ctx->addresses_all_num < 3),
8948 .nb_flags = NBT_NM_GROUP,
8950 .num_ips = ctx->addresses_mhomed_num,
8951 .ips = ctx->addresses_mhomed,
8952 .apply_expected = true
8958 .type = WREPL_TYPE_SGROUP,
8959 .state = WREPL_STATE_ACTIVE,
8960 .node = WREPL_NODE_B,
8962 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8963 .ips = addresses_B_3_4,
8964 .sgroup_merge = true
8969 * sgroup,active vs. sgroup,active with same ip(s)
8972 .line = __location__,
8973 .name = _NBT_NAME("_SA_SA_SI_U", 0x1C, NULL),
8974 .skip = (ctx->addresses_all_num < 3),
8976 .nb_flags = NBT_NM_GROUP,
8978 .num_ips = ctx->addresses_mhomed_num,
8979 .ips = ctx->addresses_mhomed,
8980 .apply_expected = true
8986 .type = WREPL_TYPE_SGROUP,
8987 .state = WREPL_STATE_ACTIVE,
8988 .node = WREPL_NODE_B,
8990 .num_ips = ctx->addresses_mhomed_num,
8991 .ips = ctx->addresses_mhomed,
8992 .sgroup_merge = true
8996 * sgroup,active vs. sgroup,active with superset ip(s)
8999 .line = __location__,
9000 .name = _NBT_NAME("_SA_SA_SP_U", 0x1C, NULL),
9001 .skip = (ctx->addresses_all_num < 3),
9003 .nb_flags = NBT_NM_GROUP,
9005 .num_ips = ctx->addresses_mhomed_num,
9006 .ips = ctx->addresses_mhomed,
9007 .apply_expected = true
9013 .type = WREPL_TYPE_SGROUP,
9014 .state = WREPL_STATE_ACTIVE,
9015 .node = WREPL_NODE_B,
9017 .num_ips = ctx->addresses_all_num,
9018 .ips = ctx->addresses_all,
9019 .sgroup_merge = true
9023 * sgroup,active vs. sgroup,active with subset ip(s)
9026 .line = __location__,
9027 .name = _NBT_NAME("_SA_SA_SB_U", 0x1C, NULL),
9028 .skip = (ctx->addresses_all_num < 3),
9030 .nb_flags = NBT_NM_GROUP,
9032 .num_ips = ctx->addresses_mhomed_num,
9033 .ips = ctx->addresses_mhomed,
9034 .apply_expected = true
9040 .type = WREPL_TYPE_SGROUP,
9041 .state = WREPL_STATE_ACTIVE,
9042 .node = WREPL_NODE_B,
9044 .num_ips = ctx->addresses_best_num,
9045 .ips = ctx->addresses_best,
9046 .sgroup_merge = true
9050 * sgroup,active vs. sgroup,tombstone with different ip(s)
9053 .line = __location__,
9054 .name = _NBT_NAME("_SA_ST_DI_U", 0x1C, NULL),
9055 .skip = (ctx->addresses_all_num < 3),
9057 .nb_flags = NBT_NM_GROUP,
9059 .num_ips = ctx->addresses_mhomed_num,
9060 .ips = ctx->addresses_mhomed,
9061 .apply_expected = true
9067 .type = WREPL_TYPE_SGROUP,
9068 .state = WREPL_STATE_TOMBSTONE,
9069 .node = WREPL_NODE_B,
9071 .num_ips = ARRAY_SIZE(addresses_B_3_4),
9072 .ips = addresses_B_3_4,
9073 .apply_expected = false
9077 * sgroup,active vs. sgroup,tombstone with same ip(s)
9080 .line = __location__,
9081 .name = _NBT_NAME("_SA_ST_SI_U", 0x1C, NULL),
9082 .skip = (ctx->addresses_all_num < 3),
9084 .nb_flags = NBT_NM_GROUP,
9086 .num_ips = ctx->addresses_mhomed_num,
9087 .ips = ctx->addresses_mhomed,
9088 .apply_expected = true
9094 .type = WREPL_TYPE_SGROUP,
9095 .state = WREPL_STATE_TOMBSTONE,
9096 .node = WREPL_NODE_B,
9098 .num_ips = ctx->addresses_mhomed_num,
9099 .ips = ctx->addresses_mhomed,
9100 .apply_expected = false
9104 * sgroup,active vs. sgroup,tombstone with superset ip(s)
9107 .line = __location__,
9108 .name = _NBT_NAME("_SA_ST_SP_U", 0x1C, NULL),
9109 .skip = (ctx->addresses_all_num < 3),
9111 .nb_flags = NBT_NM_GROUP,
9113 .num_ips = ctx->addresses_mhomed_num,
9114 .ips = ctx->addresses_mhomed,
9115 .apply_expected = true
9121 .type = WREPL_TYPE_SGROUP,
9122 .state = WREPL_STATE_TOMBSTONE,
9123 .node = WREPL_NODE_B,
9125 .num_ips = ctx->addresses_all_num,
9126 .ips = ctx->addresses_all,
9127 .apply_expected = false
9131 * sgroup,active vs. sgroup,tombstone with subset ip(s)
9134 .line = __location__,
9135 .name = _NBT_NAME("_SA_ST_SB_U", 0x1C, NULL),
9136 .skip = (ctx->addresses_all_num < 3),
9138 .nb_flags = NBT_NM_GROUP,
9140 .num_ips = ctx->addresses_mhomed_num,
9141 .ips = ctx->addresses_mhomed,
9142 .apply_expected = true
9148 .type = WREPL_TYPE_SGROUP,
9149 .state = WREPL_STATE_TOMBSTONE,
9150 .node = WREPL_NODE_B,
9152 .num_ips = ctx->addresses_best_num,
9153 .ips = ctx->addresses_best,
9154 .apply_expected = false
9160 if (!ctx->nbtsock_srv) {
9161 torture_comment(tctx, "SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
9166 torture_comment(tctx, "Test Replica records vs. owned active records\n");
9168 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
9170 struct test_conflict_owned_active_vs_replica_struct record = records[i];
9171 uint32_t j, count = 1;
9174 if (records[i].wins.mhomed || records[i].name.type == 0x1C) {
9175 count = records[i].wins.num_ips;
9178 if (records[i].section) {
9179 torture_comment(tctx, "%s\n", records[i].section);
9182 if (records[i].skip) {
9183 torture_comment(tctx, "%s => SKIPPED\n", nbt_name_string(ctx, &records[i].name));
9187 if (records[i].replica.mhomed_merge) {
9188 action = "MHOMED_MERGE";
9189 } else if (records[i].replica.sgroup_merge) {
9190 action = "SGROUP_MERGE";
9191 } else if (records[i].replica.apply_expected) {
9194 action = "NOT REPLACE";
9197 torture_comment(tctx, "%s%s%s => %s\n",
9198 nbt_name_string(ctx, &records[i].name),
9199 (records[i].comment?": ":""),
9200 (records[i].comment?records[i].comment:""),
9203 /* Prepare for multi homed registration */
9204 ZERO_STRUCT(records[i].defend);
9205 records[i].defend.timeout = 10;
9206 records[i].defend.positive = true;
9207 nbt_set_incoming_handler(ctx->nbtsock_srv,
9208 test_conflict_owned_active_vs_replica_handler,
9210 if (ctx->nbtsock_srv2) {
9211 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9212 test_conflict_owned_active_vs_replica_handler,
9219 for (j=0; j < count; j++) {
9220 struct nbt_name_request *req;
9222 name_register->in.name = records[i].name;
9223 name_register->in.dest_addr = ctx->address;
9224 name_register->in.address = records[i].wins.ips[j].ip;
9225 name_register->in.nb_flags = records[i].wins.nb_flags;
9226 name_register->in.register_demand= false;
9227 name_register->in.broadcast = false;
9228 name_register->in.multi_homed = records[i].wins.mhomed;
9229 name_register->in.ttl = 300000;
9230 name_register->in.timeout = 70;
9231 name_register->in.retries = 0;
9233 req = nbt_name_register_send(ctx->nbtsock, name_register);
9235 /* push the request on the wire */
9236 event_loop_once(ctx->nbtsock->event_ctx);
9239 * if we register multiple addresses,
9240 * the server will do name queries to see if the old addresses
9243 if (records[i].wins.mhomed && j > 0) {
9244 end = timeval_current_ofs(records[i].defend.timeout,0);
9245 records[i].defend.ret = true;
9246 while (records[i].defend.timeout > 0) {
9247 event_loop_once(ctx->nbtsock_srv->event_ctx);
9248 if (timeval_expired(&end)) break;
9250 ret &= records[i].defend.ret;
9253 status = nbt_name_register_recv(req, ctx, name_register);
9254 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9255 torture_comment(tctx, "No response from %s for name register\n", ctx->address);
9258 if (!NT_STATUS_IS_OK(status)) {
9259 torture_comment(tctx, "Bad response from %s for name register - %s\n",
9260 ctx->address, nt_errstr(status));
9263 CHECK_VALUE(tctx, name_register->out.rcode, 0);
9264 CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address);
9265 CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type);
9266 CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name);
9267 CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope);
9268 CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[j].ip);
9271 /* Prepare for the current test */
9272 records[i].defend = record.defend;
9273 nbt_set_incoming_handler(ctx->nbtsock_srv,
9274 test_conflict_owned_active_vs_replica_handler,
9276 if (ctx->nbtsock_srv2) {
9277 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9278 test_conflict_owned_active_vs_replica_handler,
9285 wins_name->name = &records[i].name;
9286 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
9287 records[i].replica.state,
9288 records[i].replica.node,
9289 records[i].replica.is_static);
9290 wins_name->id = ++ctx->b.max_version;
9291 if (wins_name->flags & 2) {
9292 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
9293 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
9295 wins_name->addresses.ip = records[i].replica.ips[0].ip;
9297 wins_name->unknown = "255.255.255.255";
9299 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9302 * wait for the name query, which is handled in
9303 * test_conflict_owned_active_vs_replica_handler()
9305 end = timeval_current_ofs(records[i].defend.timeout,0);
9306 records[i].defend.ret = true;
9307 while (records[i].defend.timeout > 0) {
9308 event_loop_once(ctx->nbtsock_srv->event_ctx);
9309 if (timeval_expired(&end)) break;
9311 ret &= records[i].defend.ret;
9313 if (records[i].defend.late_release) {
9314 records[i].defend = record.defend;
9315 records[i].defend.expect_release = true;
9317 * wait for the name release demand, which is handled in
9318 * test_conflict_owned_active_vs_replica_handler()
9320 end = timeval_current_ofs(records[i].defend.timeout,0);
9321 records[i].defend.ret = true;
9322 while (records[i].defend.timeout > 0) {
9323 event_loop_once(ctx->nbtsock_srv->event_ctx);
9324 if (timeval_expired(&end)) break;
9326 ret &= records[i].defend.ret;
9329 if (records[i].replica.mhomed_merge) {
9330 ret &= test_wrepl_mhomed_merged(tctx, ctx, &ctx->c,
9331 records[i].wins.num_ips, records[i].wins.ips,
9333 records[i].replica.num_ips, records[i].replica.ips,
9335 } else if (records[i].replica.sgroup_merge) {
9336 ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL,
9338 records[i].wins.num_ips, records[i].wins.ips,
9340 records[i].replica.num_ips, records[i].replica.ips,
9343 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name,
9344 records[i].replica.apply_expected);
9347 if (records[i].replica.apply_expected ||
9348 records[i].replica.mhomed_merge) {
9349 wins_name->name = &records[i].name;
9350 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9351 WREPL_STATE_TOMBSTONE,
9352 WREPL_NODE_B, false);
9353 wins_name->id = ++ctx->b.max_version;
9354 wins_name->addresses.ip = addresses_B_1[0].ip;
9355 wins_name->unknown = "255.255.255.255";
9357 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9358 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9360 for (j=0; j < count; j++) {
9361 struct nbt_name_socket *nbtsock = ctx->nbtsock;
9363 if (ctx->myaddr2 && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2->addr) == 0) {
9364 nbtsock = ctx->nbtsock2;
9367 release->in.name = records[i].name;
9368 release->in.dest_addr = ctx->address;
9369 release->in.address = records[i].wins.ips[j].ip;
9370 release->in.nb_flags = records[i].wins.nb_flags;
9371 release->in.broadcast = false;
9372 release->in.timeout = 30;
9373 release->in.retries = 0;
9375 status = nbt_name_release(nbtsock, ctx, release);
9376 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9377 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
9380 if (!NT_STATUS_IS_OK(status)) {
9381 torture_comment(tctx, "Bad response from %s for name query - %s\n",
9382 ctx->address, nt_errstr(status));
9385 CHECK_VALUE(tctx, release->out.rcode, 0);
9388 if (records[i].replica.sgroup_merge) {
9389 /* clean up the SGROUP record */
9390 wins_name->name = &records[i].name;
9391 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9393 WREPL_NODE_B, false);
9394 wins_name->id = ++ctx->b.max_version;
9395 wins_name->addresses.addresses.num_ips = 0;
9396 wins_name->addresses.addresses.ips = NULL;
9397 wins_name->unknown = "255.255.255.255";
9398 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9400 /* take ownership of the SGROUP record */
9401 wins_name->name = &records[i].name;
9402 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9404 WREPL_NODE_B, false);
9405 wins_name->id = ++ctx->b.max_version;
9406 wins_name->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
9407 wins_name->addresses.addresses.ips = discard_const(addresses_B_1);
9408 wins_name->unknown = "255.255.255.255";
9409 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9410 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9412 /* overwrite the SGROUP record with unique,tombstone */
9413 wins_name->name = &records[i].name;
9414 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9415 WREPL_STATE_TOMBSTONE,
9416 WREPL_NODE_B, false);
9417 wins_name->id = ++ctx->b.max_version;
9418 wins_name->addresses.ip = addresses_A_1[0].ip;
9419 wins_name->unknown = "255.255.255.255";
9420 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9421 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9426 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
9434 #define _NBT_ASSERT(v, correct) do { \
9435 if ((v) != (correct)) { \
9436 printf("(%s) Incorrect value %s=%d - should be %s (%d)\n", \
9437 __location__, #v, v, #correct, correct); \
9442 #define _NBT_ASSERT_STRING(v, correct) do { \
9443 if ( ((!v) && (correct)) || \
9444 ((v) && (!correct)) || \
9445 ((v) && (correct) && strcmp(v,correct) != 0)) { \
9446 printf("(%s) Incorrect value %s=%s - should be %s\n", \
9447 __location__, #v, v, correct); \
9452 static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
9453 struct nbt_name_packet *req_packet,
9454 struct socket_address *src)
9456 struct nbt_name *name;
9457 struct nbt_name_packet *rep_packet;
9458 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9460 _NBT_ASSERT(req_packet->qdcount, 1);
9461 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9462 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9464 name = &req_packet->questions[0].name;
9466 _NBT_ASSERT(name->type, rec->name.type);
9467 _NBT_ASSERT_STRING(name->name, rec->name.name);
9468 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9470 _NBT_ASSERT(rec->defend.expect_release, false);
9472 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9473 if (rep_packet == NULL) return;
9475 rep_packet->name_trn_id = req_packet->name_trn_id;
9476 rep_packet->ancount = 1;
9478 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9479 if (rep_packet->answers == NULL) return;
9481 rep_packet->answers[0].name = *name;
9482 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9483 rep_packet->answers[0].ttl = 0;
9485 if (rec->defend.positive) {
9486 uint32_t i, num_ips;
9487 const struct wrepl_ip *ips;
9489 if (rec->defend.num_ips > 0) {
9490 num_ips = rec->defend.num_ips;
9491 ips = rec->defend.ips;
9493 num_ips = rec->wins.num_ips;
9494 ips = rec->wins.ips;
9497 /* send a positive reply */
9498 rep_packet->operation =
9501 NBT_FLAG_AUTHORITIVE |
9502 NBT_FLAG_RECURSION_DESIRED |
9503 NBT_FLAG_RECURSION_AVAIL;
9505 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9507 rep_packet->answers[0].rdata.netbios.length = num_ips*6;
9508 rep_packet->answers[0].rdata.netbios.addresses =
9509 talloc_array(rep_packet->answers, struct nbt_rdata_address, num_ips);
9510 if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return;
9512 for (i=0; i < num_ips; i++) {
9513 struct nbt_rdata_address *addr =
9514 &rep_packet->answers[0].rdata.netbios.addresses[i];
9515 addr->nb_flags = rec->wins.nb_flags;
9516 addr->ipaddr = ips[i].ip;
9518 DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
9519 nbt_name_string(rep_packet, name), src->addr, src->port));
9521 /* send a negative reply */
9522 rep_packet->operation =
9525 NBT_FLAG_AUTHORITIVE |
9528 rep_packet->answers[0].rr_type = NBT_QTYPE_NULL;
9530 ZERO_STRUCT(rep_packet->answers[0].rdata);
9532 DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
9533 nbt_name_string(rep_packet, name), src->addr, src->port));
9536 nbt_name_reply_send(nbtsock, src, rep_packet);
9537 talloc_free(rep_packet);
9539 /* make sure we push the reply to the wire */
9540 event_loop_once(nbtsock->event_ctx);
9543 rec->defend.timeout = 0;
9544 rec->defend.ret = true;
9547 static void test_conflict_owned_active_vs_replica_handler_release(
9548 struct nbt_name_socket *nbtsock,
9549 struct nbt_name_packet *req_packet,
9550 struct socket_address *src)
9552 struct nbt_name *name;
9553 struct nbt_name_packet *rep_packet;
9554 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9556 _NBT_ASSERT(req_packet->qdcount, 1);
9557 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9558 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9560 name = &req_packet->questions[0].name;
9562 _NBT_ASSERT(name->type, rec->name.type);
9563 _NBT_ASSERT_STRING(name->name, rec->name.name);
9564 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9566 _NBT_ASSERT(rec->defend.expect_release, true);
9568 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9569 if (rep_packet == NULL) return;
9571 rep_packet->name_trn_id = req_packet->name_trn_id;
9572 rep_packet->ancount = 1;
9573 rep_packet->operation =
9575 NBT_OPCODE_RELEASE |
9576 NBT_FLAG_AUTHORITIVE;
9578 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9579 if (rep_packet->answers == NULL) return;
9581 rep_packet->answers[0].name = *name;
9582 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9583 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9584 rep_packet->answers[0].ttl = req_packet->additional[0].ttl;
9585 rep_packet->answers[0].rdata = req_packet->additional[0].rdata;
9587 DEBUG(2,("Sending name release reply for %s to %s:%d\n",
9588 nbt_name_string(rep_packet, name), src->addr, src->port));
9590 nbt_name_reply_send(nbtsock, src, rep_packet);
9591 talloc_free(rep_packet);
9593 /* make sure we push the reply to the wire */
9594 event_loop_once(nbtsock->event_ctx);
9597 rec->defend.timeout = 0;
9598 rec->defend.ret = true;
9601 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
9602 struct nbt_name_packet *req_packet,
9603 struct socket_address *src)
9605 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9607 rec->defend.ret = false;
9609 switch (req_packet->operation & NBT_OPCODE) {
9610 case NBT_OPCODE_QUERY:
9611 test_conflict_owned_active_vs_replica_handler_query(nbtsock, req_packet, src);
9613 case NBT_OPCODE_RELEASE:
9614 test_conflict_owned_active_vs_replica_handler_release(nbtsock, req_packet, src);
9617 printf("%s: unexpected incoming packet\n", __location__);
9623 test WINS replication replica conflicts operations
9625 static bool torture_nbt_winsreplication_replica(struct torture_context *tctx)
9628 struct test_wrepl_conflict_conn *ctx;
9630 const char *address;
9631 struct nbt_name name;
9633 if (!torture_nbt_get_name(tctx, &name, &address))
9636 ctx = test_create_conflict_ctx(tctx, address);
9637 if (!ctx) return false;
9639 ret &= test_conflict_same_owner(tctx, ctx);
9640 ret &= test_conflict_different_owner(tctx, ctx);
9646 test WINS replication owned conflicts operations
9648 static bool torture_nbt_winsreplication_owned(struct torture_context *tctx)
9650 const char *address;
9651 struct nbt_name name;
9653 struct test_wrepl_conflict_conn *ctx;
9655 if (!torture_nbt_get_name(tctx, &name, &address))
9658 ctx = test_create_conflict_ctx(tctx, address);
9659 torture_assert(tctx, ctx != NULL, "Creating context failed");
9661 ret &= test_conflict_owned_released_vs_replica(tctx, ctx);
9662 ret &= test_conflict_owned_active_vs_replica(tctx, ctx);
9668 test simple WINS replication operations
9670 struct torture_suite *torture_nbt_winsreplication(void)
9672 struct torture_suite *suite = torture_suite_create(
9673 talloc_autofree_context(),
9675 torture_suite_add_simple_test(suite, "assoc_ctx1",
9678 torture_suite_add_simple_test(suite, "assoc_ctx2",
9681 torture_suite_add_simple_test(suite, "wins_replication",
9682 test_wins_replication);
9684 torture_suite_add_simple_test(suite, "replica",
9685 torture_nbt_winsreplication_replica);
9687 torture_suite_add_simple_test(suite, "owned",
9688 torture_nbt_winsreplication_owned);