2 Unix SMB/CIFS implementation.
4 WINS replication testing
6 Copyright (C) Andrew Tridgell 2005
7 Copyright (C) Stefan Metzmacher 2005
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #include "libcli/wrepl/winsrepl.h"
25 #include "lib/events/events.h"
26 #include "lib/socket/socket.h"
27 #include "libcli/resolve/resolve.h"
28 #include "system/network.h"
29 #include "lib/socket/netif.h"
30 #include "librpc/gen_ndr/ndr_nbt.h"
31 #include "torture/torture.h"
32 #include "torture/nbt/proto.h"
33 #include "param/param.h"
35 #define CHECK_STATUS(tctx, status, correct) \
36 torture_assert_ntstatus_equal(tctx, status, correct, \
39 #define CHECK_VALUE(tctx, v, correct) \
40 torture_assert(tctx, (v) == (correct), \
41 talloc_asprintf(tctx, "Incorrect value %s=%d - should be %d\n", \
44 #define CHECK_VALUE_UINT64(tctx, v, correct) \
45 torture_assert(tctx, (v) == (correct), \
46 talloc_asprintf(tctx, "Incorrect value %s=%llu - should be %llu\n", \
47 #v, (long long)v, (long long)correct))
49 #define CHECK_VALUE_STRING(tctx, v, correct) \
50 torture_assert_str_equal(tctx, v, correct, "Invalid value")
52 #define _NBT_NAME(n,t,s) {\
58 static const char *wrepl_name_type_string(enum wrepl_name_type type)
61 case WREPL_TYPE_UNIQUE: return "UNIQUE";
62 case WREPL_TYPE_GROUP: return "GROUP";
63 case WREPL_TYPE_SGROUP: return "SGROUP";
64 case WREPL_TYPE_MHOMED: return "MHOMED";
66 return "UNKNOWN_TYPE";
69 static const char *wrepl_name_state_string(enum wrepl_name_state state)
72 case WREPL_STATE_ACTIVE: return "ACTIVE";
73 case WREPL_STATE_RELEASED: return "RELEASED";
74 case WREPL_STATE_TOMBSTONE: return "TOMBSTONE";
75 case WREPL_STATE_RESERVED: return "RESERVED";
77 return "UNKNOWN_STATE";
81 test how assoc_ctx's are only usable on the connection
84 static bool test_assoc_ctx1(struct torture_context *tctx)
87 struct 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_nbt_get_name(tctx, &name, &address))
104 torture_comment(tctx, "Test if assoc_ctx is only valid on the conection it was created on\n");
106 wrepl_socket1 = wrepl_socket_init(tctx, NULL);
107 wrepl_socket2 = wrepl_socket_init(tctx, NULL);
109 torture_comment(tctx, "Setup 2 wrepl connections\n");
110 status = wrepl_connect(wrepl_socket1, NULL, address);
111 CHECK_STATUS(tctx, status, NT_STATUS_OK);
113 status = wrepl_connect(wrepl_socket2, NULL, address);
114 CHECK_STATUS(tctx, status, NT_STATUS_OK);
116 torture_comment(tctx, "Send a start association request (conn1)\n");
117 status = wrepl_associate(wrepl_socket1, &associate1);
118 CHECK_STATUS(tctx, status, NT_STATUS_OK);
120 torture_comment(tctx, "association context (conn1): 0x%x\n", associate1.out.assoc_ctx);
122 torture_comment(tctx, "Send a start association request (conn2)\n");
123 status = wrepl_associate(wrepl_socket2, &associate2);
124 CHECK_STATUS(tctx, status, NT_STATUS_OK);
126 torture_comment(tctx, "association context (conn2): 0x%x\n", associate2.out.assoc_ctx);
128 torture_comment(tctx, "Send a replication table query, with assoc 1 (conn2), the anwser should be on conn1\n");
130 packet.opcode = WREPL_OPCODE_BITS;
131 packet.assoc_ctx = associate1.out.assoc_ctx;
132 packet.mess_type = WREPL_REPLICATION;
133 packet.message.replication.command = WREPL_REPL_TABLE_QUERY;
135 ctrl.send_only = true;
136 req = wrepl_request_send(wrepl_socket2, &packet, &ctrl);
137 status = wrepl_request_recv(req, tctx, &rep_packet);
138 CHECK_STATUS(tctx, status, NT_STATUS_OK);
140 torture_comment(tctx, "Send a association request (conn2), to make sure the last request was ignored\n");
141 status = wrepl_associate(wrepl_socket2, &associate2);
142 CHECK_STATUS(tctx, status, NT_STATUS_OK);
144 torture_comment(tctx, "Send a replication table query, with invalid assoc (conn1), receive answer from conn2\n");
145 pull_table.in.assoc_ctx = 0;
146 req = wrepl_pull_table_send(wrepl_socket1, &pull_table);
147 status = wrepl_request_recv(req, tctx, &rep_packet);
148 CHECK_STATUS(tctx, status, NT_STATUS_OK);
150 torture_comment(tctx, "Send a association request (conn1), to make sure the last request was handled correct\n");
151 status = wrepl_associate(wrepl_socket1, &associate2);
152 CHECK_STATUS(tctx, status, NT_STATUS_OK);
154 assoc_stop.in.assoc_ctx = associate1.out.assoc_ctx;
155 assoc_stop.in.reason = 4;
156 torture_comment(tctx, "Send a association stop request (conn1), reson: %u\n", assoc_stop.in.reason);
157 status = wrepl_associate_stop(wrepl_socket1, &assoc_stop);
158 CHECK_STATUS(tctx, status, NT_STATUS_END_OF_FILE);
160 assoc_stop.in.assoc_ctx = associate2.out.assoc_ctx;
161 assoc_stop.in.reason = 0;
162 torture_comment(tctx, "Send a association stop request (conn2), reson: %u\n", assoc_stop.in.reason);
163 status = wrepl_associate_stop(wrepl_socket2, &assoc_stop);
164 CHECK_STATUS(tctx, status, NT_STATUS_OK);
166 torture_comment(tctx, "Close 2 wrepl connections\n");
167 talloc_free(wrepl_socket1);
168 talloc_free(wrepl_socket2);
173 test if we always get back the same assoc_ctx
175 static bool test_assoc_ctx2(struct torture_context *tctx)
177 struct wrepl_socket *wrepl_socket;
178 struct wrepl_associate associate;
180 struct nbt_name name;
184 if (!torture_nbt_get_name(tctx, &name, &address))
187 torture_comment(tctx, "Test if we always get back the same assoc_ctx\n");
189 wrepl_socket = wrepl_socket_init(tctx, NULL);
191 torture_comment(tctx, "Setup wrepl connections\n");
192 status = wrepl_connect(wrepl_socket, NULL, address);
193 CHECK_STATUS(tctx, status, NT_STATUS_OK);
195 torture_comment(tctx, "Send 1st start association request\n");
196 status = wrepl_associate(wrepl_socket, &associate);
197 CHECK_STATUS(tctx, status, NT_STATUS_OK);
198 assoc_ctx1 = associate.out.assoc_ctx;
199 torture_comment(tctx, "1st association context: 0x%x\n", associate.out.assoc_ctx);
201 torture_comment(tctx, "Send 2nd start association request\n");
202 status = wrepl_associate(wrepl_socket, &associate);
203 torture_assert_ntstatus_ok(tctx, status, "2nd start association failed");
204 torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1,
205 "Different context returned");
206 torture_comment(tctx, "2nd association context: 0x%x\n", associate.out.assoc_ctx);
208 torture_comment(tctx, "Send 3rd start association request\n");
209 status = wrepl_associate(wrepl_socket, &associate);
210 torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1,
211 "Different context returned");
212 CHECK_STATUS(tctx, status, NT_STATUS_OK);
213 torture_comment(tctx, "3rd association context: 0x%x\n", associate.out.assoc_ctx);
215 torture_comment(tctx, "Close wrepl connections\n");
216 talloc_free(wrepl_socket);
222 display a replication entry
224 static void display_entry(struct torture_context *tctx, struct wrepl_name *name)
228 torture_comment(tctx, "%s\n", nbt_name_string(tctx, &name->name));
229 torture_comment(tctx, "\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n",
230 name->type, name->state, name->node, name->is_static, (long long)name->version_id);
231 torture_comment(tctx, "\tRAW_FLAGS: 0x%08X OWNER: %-15s\n",
232 name->raw_flags, name->owner);
233 for (i=0;i<name->num_addresses;i++) {
234 torture_comment(tctx, "\tADDR: %-15s OWNER: %-15s\n",
235 name->addresses[i].address, name->addresses[i].owner);
240 test a full replication dump from a WINS server
242 static bool test_wins_replication(struct torture_context *tctx)
244 struct wrepl_socket *wrepl_socket;
247 struct wrepl_associate associate;
248 struct wrepl_pull_table pull_table;
249 struct wrepl_pull_names pull_names;
250 struct nbt_name name;
253 if (!torture_nbt_get_name(tctx, &name, &address))
256 torture_comment(tctx, "Test one pull replication cycle\n");
258 wrepl_socket = wrepl_socket_init(tctx, NULL);
260 torture_comment(tctx, "Setup wrepl connections\n");
261 status = wrepl_connect(wrepl_socket, NULL, address);
262 CHECK_STATUS(tctx, status, NT_STATUS_OK);
264 torture_comment(tctx, "Send a start association request\n");
266 status = wrepl_associate(wrepl_socket, &associate);
267 CHECK_STATUS(tctx, status, NT_STATUS_OK);
269 torture_comment(tctx, "association context: 0x%x\n", associate.out.assoc_ctx);
271 torture_comment(tctx, "Send a replication table query\n");
272 pull_table.in.assoc_ctx = associate.out.assoc_ctx;
274 status = wrepl_pull_table(wrepl_socket, tctx, &pull_table);
275 if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) {
276 struct wrepl_packet packet;
277 struct wrepl_request *req;
280 packet.opcode = WREPL_OPCODE_BITS;
281 packet.assoc_ctx = associate.out.assoc_ctx;
282 packet.mess_type = WREPL_STOP_ASSOCIATION;
283 packet.message.stop.reason = 0;
285 req = wrepl_request_send(wrepl_socket, &packet, NULL);
288 torture_fail(tctx, "We are not a valid pull partner for the server");
290 CHECK_STATUS(tctx, status, NT_STATUS_OK);
292 torture_comment(tctx, "Found %d replication partners\n", pull_table.out.num_partners);
294 for (i=0;i<pull_table.out.num_partners;i++) {
295 struct wrepl_wins_owner *partner = &pull_table.out.partners[i];
296 torture_comment(tctx, "%s max_version=%6llu min_version=%6llu type=%d\n",
298 (long long)partner->max_version,
299 (long long)partner->min_version,
302 pull_names.in.assoc_ctx = associate.out.assoc_ctx;
303 pull_names.in.partner = *partner;
305 status = wrepl_pull_names(wrepl_socket, tctx, &pull_names);
306 CHECK_STATUS(tctx, status, NT_STATUS_OK);
308 torture_comment(tctx, "Received %d names\n", pull_names.out.num_names);
310 for (j=0;j<pull_names.out.num_names;j++) {
311 display_entry(tctx, &pull_names.out.names[j]);
315 torture_comment(tctx, "Close wrepl connections\n");
316 talloc_free(wrepl_socket);
320 struct test_wrepl_conflict_conn {
322 struct wrepl_socket *pull;
325 #define TEST_OWNER_A_ADDRESS "127.65.65.1"
326 #define TEST_ADDRESS_A_PREFIX "127.0.65"
327 #define TEST_OWNER_B_ADDRESS "127.66.66.1"
328 #define TEST_ADDRESS_B_PREFIX "127.0.66"
329 #define TEST_OWNER_X_ADDRESS "127.88.88.1"
330 #define TEST_ADDRESS_X_PREFIX "127.0.88"
332 struct wrepl_wins_owner a, b, c, x;
334 struct socket_address *myaddr;
335 struct socket_address *myaddr2;
336 struct nbt_name_socket *nbtsock;
337 struct nbt_name_socket *nbtsock2;
339 struct nbt_name_socket *nbtsock_srv;
340 struct nbt_name_socket *nbtsock_srv2;
342 uint32_t addresses_best_num;
343 struct wrepl_ip *addresses_best;
345 uint32_t addresses_best2_num;
346 struct wrepl_ip *addresses_best2;
348 uint32_t addresses_all_num;
349 struct wrepl_ip *addresses_all;
351 uint32_t addresses_mhomed_num;
352 struct wrepl_ip *addresses_mhomed;
355 static const struct wrepl_ip addresses_A_1[] = {
357 .owner = TEST_OWNER_A_ADDRESS,
358 .ip = TEST_ADDRESS_A_PREFIX".1"
361 static const struct wrepl_ip addresses_A_2[] = {
363 .owner = TEST_OWNER_A_ADDRESS,
364 .ip = TEST_ADDRESS_A_PREFIX".2"
367 static const struct wrepl_ip addresses_A_3_4[] = {
369 .owner = TEST_OWNER_A_ADDRESS,
370 .ip = TEST_ADDRESS_A_PREFIX".3"
373 .owner = TEST_OWNER_A_ADDRESS,
374 .ip = TEST_ADDRESS_A_PREFIX".4"
377 static const struct wrepl_ip addresses_A_3_4_X_3_4[] = {
379 .owner = TEST_OWNER_A_ADDRESS,
380 .ip = TEST_ADDRESS_A_PREFIX".3"
383 .owner = TEST_OWNER_A_ADDRESS,
384 .ip = TEST_ADDRESS_A_PREFIX".4"
387 .owner = TEST_OWNER_X_ADDRESS,
388 .ip = TEST_ADDRESS_X_PREFIX".3"
391 .owner = TEST_OWNER_X_ADDRESS,
392 .ip = TEST_ADDRESS_X_PREFIX".4"
395 static const struct wrepl_ip addresses_A_3_4_B_3_4[] = {
397 .owner = TEST_OWNER_A_ADDRESS,
398 .ip = TEST_ADDRESS_A_PREFIX".3"
401 .owner = TEST_OWNER_A_ADDRESS,
402 .ip = TEST_ADDRESS_A_PREFIX".4"
405 .owner = TEST_OWNER_B_ADDRESS,
406 .ip = TEST_ADDRESS_B_PREFIX".3"
409 .owner = TEST_OWNER_B_ADDRESS,
410 .ip = TEST_ADDRESS_B_PREFIX".4"
413 static const struct wrepl_ip addresses_A_3_4_OWNER_B[] = {
415 .owner = TEST_OWNER_B_ADDRESS,
416 .ip = TEST_ADDRESS_A_PREFIX".3"
419 .owner = TEST_OWNER_B_ADDRESS,
420 .ip = TEST_ADDRESS_A_PREFIX".4"
423 static const struct wrepl_ip addresses_A_3_4_X_3_4_OWNER_B[] = {
425 .owner = TEST_OWNER_B_ADDRESS,
426 .ip = TEST_ADDRESS_A_PREFIX".3"
429 .owner = TEST_OWNER_B_ADDRESS,
430 .ip = TEST_ADDRESS_A_PREFIX".4"
433 .owner = TEST_OWNER_B_ADDRESS,
434 .ip = TEST_ADDRESS_X_PREFIX".3"
437 .owner = TEST_OWNER_B_ADDRESS,
438 .ip = TEST_ADDRESS_X_PREFIX".4"
442 static const struct wrepl_ip addresses_A_3_4_X_1_2[] = {
444 .owner = TEST_OWNER_A_ADDRESS,
445 .ip = TEST_ADDRESS_A_PREFIX".3"
448 .owner = TEST_OWNER_A_ADDRESS,
449 .ip = TEST_ADDRESS_A_PREFIX".4"
452 .owner = TEST_OWNER_X_ADDRESS,
453 .ip = TEST_ADDRESS_X_PREFIX".1"
456 .owner = TEST_OWNER_X_ADDRESS,
457 .ip = TEST_ADDRESS_X_PREFIX".2"
461 static const struct wrepl_ip addresses_B_1[] = {
463 .owner = TEST_OWNER_B_ADDRESS,
464 .ip = TEST_ADDRESS_B_PREFIX".1"
467 static const struct wrepl_ip addresses_B_2[] = {
469 .owner = TEST_OWNER_B_ADDRESS,
470 .ip = TEST_ADDRESS_B_PREFIX".2"
473 static const struct wrepl_ip addresses_B_3_4[] = {
475 .owner = TEST_OWNER_B_ADDRESS,
476 .ip = TEST_ADDRESS_B_PREFIX".3"
479 .owner = TEST_OWNER_B_ADDRESS,
480 .ip = TEST_ADDRESS_B_PREFIX".4"
483 static const struct wrepl_ip addresses_B_3_4_X_3_4[] = {
485 .owner = TEST_OWNER_B_ADDRESS,
486 .ip = TEST_ADDRESS_B_PREFIX".3"
489 .owner = TEST_OWNER_B_ADDRESS,
490 .ip = TEST_ADDRESS_B_PREFIX".4"
493 .owner = TEST_OWNER_X_ADDRESS,
494 .ip = TEST_ADDRESS_X_PREFIX".3"
497 .owner = TEST_OWNER_X_ADDRESS,
498 .ip = TEST_ADDRESS_X_PREFIX".4"
501 static const struct wrepl_ip addresses_B_3_4_X_1_2[] = {
503 .owner = TEST_OWNER_B_ADDRESS,
504 .ip = TEST_ADDRESS_B_PREFIX".3"
507 .owner = TEST_OWNER_B_ADDRESS,
508 .ip = TEST_ADDRESS_B_PREFIX".4"
511 .owner = TEST_OWNER_X_ADDRESS,
512 .ip = TEST_ADDRESS_X_PREFIX".1"
515 .owner = TEST_OWNER_X_ADDRESS,
516 .ip = TEST_ADDRESS_X_PREFIX".2"
520 static const struct wrepl_ip addresses_X_1_2[] = {
522 .owner = TEST_OWNER_X_ADDRESS,
523 .ip = TEST_ADDRESS_X_PREFIX".1"
526 .owner = TEST_OWNER_X_ADDRESS,
527 .ip = TEST_ADDRESS_X_PREFIX".2"
530 static const struct wrepl_ip addresses_X_3_4[] = {
532 .owner = TEST_OWNER_X_ADDRESS,
533 .ip = TEST_ADDRESS_X_PREFIX".3"
536 .owner = TEST_OWNER_X_ADDRESS,
537 .ip = TEST_ADDRESS_X_PREFIX".4"
541 static struct test_wrepl_conflict_conn *test_create_conflict_ctx(
542 struct torture_context *tctx, const char *address)
544 struct test_wrepl_conflict_conn *ctx;
545 struct wrepl_associate associate;
546 struct wrepl_pull_table pull_table;
547 struct socket_address *nbt_srv_addr;
551 ctx = talloc_zero(tctx, struct test_wrepl_conflict_conn);
552 if (!ctx) return NULL;
554 ctx->address = address;
555 ctx->pull = wrepl_socket_init(ctx, NULL);
556 if (!ctx->pull) return NULL;
558 torture_comment(tctx, "Setup wrepl conflict pull connection\n");
559 status = wrepl_connect(ctx->pull, NULL, ctx->address);
560 if (!NT_STATUS_IS_OK(status)) return NULL;
562 status = wrepl_associate(ctx->pull, &associate);
563 if (!NT_STATUS_IS_OK(status)) return NULL;
565 ctx->pull_assoc = associate.out.assoc_ctx;
567 ctx->a.address = TEST_OWNER_A_ADDRESS;
568 ctx->a.max_version = 0;
569 ctx->a.min_version = 0;
572 ctx->b.address = TEST_OWNER_B_ADDRESS;
573 ctx->b.max_version = 0;
574 ctx->b.min_version = 0;
577 ctx->x.address = TEST_OWNER_X_ADDRESS;
578 ctx->x.max_version = 0;
579 ctx->x.min_version = 0;
582 ctx->c.address = address;
583 ctx->c.max_version = 0;
584 ctx->c.min_version = 0;
587 pull_table.in.assoc_ctx = ctx->pull_assoc;
588 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
589 if (!NT_STATUS_IS_OK(status)) return NULL;
591 for (i=0; i < pull_table.out.num_partners; i++) {
592 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
593 ctx->a.max_version = pull_table.out.partners[i].max_version;
594 ctx->a.min_version = pull_table.out.partners[i].min_version;
596 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
597 ctx->b.max_version = pull_table.out.partners[i].max_version;
598 ctx->b.min_version = pull_table.out.partners[i].min_version;
600 if (strcmp(TEST_OWNER_X_ADDRESS,pull_table.out.partners[i].address)==0) {
601 ctx->x.max_version = pull_table.out.partners[i].max_version;
602 ctx->x.min_version = pull_table.out.partners[i].min_version;
604 if (strcmp(address,pull_table.out.partners[i].address)==0) {
605 ctx->c.max_version = pull_table.out.partners[i].max_version;
606 ctx->c.min_version = pull_table.out.partners[i].min_version;
610 talloc_free(pull_table.out.partners);
612 ctx->nbtsock = nbt_name_socket_init(ctx, NULL);
613 if (!ctx->nbtsock) return NULL;
615 ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_best_ip(address), 0);
616 if (!ctx->myaddr) return NULL;
618 for (i = 0; i < iface_count(); i++) {
619 if (strcmp(ctx->myaddr->addr, iface_n_ip(i)) == 0) continue;
620 ctx->myaddr2 = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_n_ip(i), 0);
621 if (!ctx->myaddr2) return NULL;
625 status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0);
626 if (!NT_STATUS_IS_OK(status)) return NULL;
628 ctx->nbtsock_srv = nbt_name_socket_init(ctx, NULL);
629 if (!ctx->nbtsock_srv) return NULL;
631 /* Make a port 137 version of ctx->myaddr */
632 nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lp_nbt_port(global_loadparm));
633 if (!nbt_srv_addr) return NULL;
635 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
636 status = socket_listen(ctx->nbtsock_srv->sock, nbt_srv_addr, 0, 0);
637 talloc_free(nbt_srv_addr);
638 if (!NT_STATUS_IS_OK(status)) {
639 /* this isn't fatal */
640 talloc_free(ctx->nbtsock_srv);
641 ctx->nbtsock_srv = NULL;
644 if (ctx->myaddr2 && ctx->nbtsock_srv) {
645 ctx->nbtsock2 = nbt_name_socket_init(ctx, NULL);
646 if (!ctx->nbtsock2) return NULL;
648 status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0);
649 if (!NT_STATUS_IS_OK(status)) return NULL;
651 ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx);
652 if (!ctx->nbtsock_srv2) return NULL;
654 /* Make a port 137 version of ctx->myaddr2 */
655 nbt_srv_addr = socket_address_from_strings(tctx,
656 ctx->nbtsock_srv->sock->backend_name,
658 lp_nbt_port(global_loadparm));
659 if (!nbt_srv_addr) return NULL;
661 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
662 status = socket_listen(ctx->nbtsock_srv2->sock, ctx->myaddr2, 0, 0);
663 talloc_free(nbt_srv_addr);
664 if (!NT_STATUS_IS_OK(status)) {
665 /* this isn't fatal */
666 talloc_free(ctx->nbtsock_srv2);
667 ctx->nbtsock_srv2 = NULL;
671 ctx->addresses_best_num = 1;
672 ctx->addresses_best = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best_num);
673 if (!ctx->addresses_best) return NULL;
674 ctx->addresses_best[0].owner = ctx->b.address;
675 ctx->addresses_best[0].ip = ctx->myaddr->addr;
677 ctx->addresses_all_num = iface_count();
678 ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num);
679 if (!ctx->addresses_all) return NULL;
680 for (i=0; i < ctx->addresses_all_num; i++) {
681 ctx->addresses_all[i].owner = ctx->b.address;
682 ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(i));
683 if (!ctx->addresses_all[i].ip) return NULL;
686 if (ctx->nbtsock_srv2) {
687 ctx->addresses_best2_num = 1;
688 ctx->addresses_best2 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best2_num);
689 if (!ctx->addresses_best2) return NULL;
690 ctx->addresses_best2[0].owner = ctx->b.address;
691 ctx->addresses_best2[0].ip = ctx->myaddr2->addr;
693 ctx->addresses_mhomed_num = 2;
694 ctx->addresses_mhomed = talloc_array(ctx, struct wrepl_ip, ctx->addresses_mhomed_num);
695 if (!ctx->addresses_mhomed) return NULL;
696 ctx->addresses_mhomed[0].owner = ctx->b.address;
697 ctx->addresses_mhomed[0].ip = ctx->myaddr->addr;
698 ctx->addresses_mhomed[1].owner = ctx->b.address;
699 ctx->addresses_mhomed[1].ip = ctx->myaddr2->addr;
705 static bool test_wrepl_update_one(struct torture_context *tctx,
706 struct test_wrepl_conflict_conn *ctx,
707 const struct wrepl_wins_owner *owner,
708 const struct wrepl_wins_name *name)
710 struct wrepl_socket *wrepl_socket;
711 struct wrepl_associate associate;
712 struct wrepl_packet update_packet, repl_send;
713 struct wrepl_table *update;
714 struct wrepl_wins_owner wrepl_wins_owners[1];
715 struct wrepl_packet *repl_recv;
716 struct wrepl_wins_owner *send_request;
717 struct wrepl_send_reply *send_reply;
718 struct wrepl_wins_name wrepl_wins_names[1];
722 wrepl_socket = wrepl_socket_init(ctx, NULL);
724 status = wrepl_connect(wrepl_socket, NULL, ctx->address);
725 CHECK_STATUS(tctx, status, NT_STATUS_OK);
727 status = wrepl_associate(wrepl_socket, &associate);
728 CHECK_STATUS(tctx, status, NT_STATUS_OK);
729 assoc_ctx = associate.out.assoc_ctx;
731 /* now send a WREPL_REPL_UPDATE message */
732 ZERO_STRUCT(update_packet);
733 update_packet.opcode = WREPL_OPCODE_BITS;
734 update_packet.assoc_ctx = assoc_ctx;
735 update_packet.mess_type = WREPL_REPLICATION;
736 update_packet.message.replication.command = WREPL_REPL_UPDATE;
737 update = &update_packet.message.replication.info.table;
739 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
740 update->partners = wrepl_wins_owners;
741 update->initiator = "0.0.0.0";
743 wrepl_wins_owners[0] = *owner;
745 status = wrepl_request(wrepl_socket, wrepl_socket,
746 &update_packet, &repl_recv);
747 CHECK_STATUS(tctx, status, NT_STATUS_OK);
748 CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_REPLICATION);
749 CHECK_VALUE(tctx, repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
750 send_request = &repl_recv->message.replication.info.owner;
752 ZERO_STRUCT(repl_send);
753 repl_send.opcode = WREPL_OPCODE_BITS;
754 repl_send.assoc_ctx = assoc_ctx;
755 repl_send.mess_type = WREPL_REPLICATION;
756 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
757 send_reply = &repl_send.message.replication.info.reply;
759 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
760 send_reply->names = wrepl_wins_names;
762 wrepl_wins_names[0] = *name;
764 status = wrepl_request(wrepl_socket, wrepl_socket,
765 &repl_send, &repl_recv);
766 CHECK_STATUS(tctx, status, NT_STATUS_OK);
767 CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
768 CHECK_VALUE(tctx, repl_recv->message.stop.reason, 0);
770 talloc_free(wrepl_socket);
774 static bool test_wrepl_is_applied(struct torture_context *tctx,
775 struct test_wrepl_conflict_conn *ctx,
776 const struct wrepl_wins_owner *owner,
777 const struct wrepl_wins_name *name,
781 struct wrepl_pull_names pull_names;
782 struct wrepl_name *names;
784 pull_names.in.assoc_ctx = ctx->pull_assoc;
785 pull_names.in.partner = *owner;
786 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
788 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
789 CHECK_STATUS(tctx, status, NT_STATUS_OK);
790 torture_assert(tctx, pull_names.out.num_names == (expected?1:0),
791 talloc_asprintf(tctx, "Invalid number of records returned - expected %d got %d", expected, pull_names.out.num_names));
793 names = pull_names.out.names;
796 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
800 CHECK_VALUE(tctx, names[0].name.type, name->name->type);
801 CHECK_VALUE_STRING(tctx, names[0].name.name, name->name->name);
802 CHECK_VALUE_STRING(tctx, names[0].name.scope, name->name->scope);
803 CHECK_VALUE(tctx, flags, name->flags);
804 CHECK_VALUE_UINT64(tctx, names[0].version_id, name->id);
807 CHECK_VALUE(tctx, names[0].num_addresses,
808 name->addresses.addresses.num_ips);
810 CHECK_VALUE(tctx, names[0].num_addresses, 1);
811 CHECK_VALUE_STRING(tctx, names[0].addresses[0].address,
815 talloc_free(pull_names.out.names);
819 static bool test_wrepl_mhomed_merged(struct torture_context *tctx,
820 struct test_wrepl_conflict_conn *ctx,
821 const struct wrepl_wins_owner *owner1,
822 uint32_t num_ips1, const struct wrepl_ip *ips1,
823 const struct wrepl_wins_owner *owner2,
824 uint32_t num_ips2, const struct wrepl_ip *ips2,
825 const struct wrepl_wins_name *name2)
828 struct wrepl_pull_names pull_names;
829 struct wrepl_name *names;
832 uint32_t num_ips = num_ips1 + num_ips2;
834 for (i = 0; i < num_ips2; i++) {
835 for (j = 0; j < num_ips1; j++) {
836 if (strcmp(ips2[i].ip,ips1[j].ip) == 0) {
843 pull_names.in.assoc_ctx = ctx->pull_assoc;
844 pull_names.in.partner = *owner2;
845 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
847 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
848 CHECK_STATUS(tctx, status, NT_STATUS_OK);
849 CHECK_VALUE(tctx, pull_names.out.num_names, 1);
851 names = pull_names.out.names;
853 flags = WREPL_NAME_FLAGS(names[0].type,
857 CHECK_VALUE(tctx, names[0].name.type, name2->name->type);
858 CHECK_VALUE_STRING(tctx, names[0].name.name, name2->name->name);
859 CHECK_VALUE_STRING(tctx, names[0].name.scope, name2->name->scope);
860 CHECK_VALUE(tctx, flags, name2->flags | WREPL_TYPE_MHOMED);
861 CHECK_VALUE_UINT64(tctx, names[0].version_id, name2->id);
863 CHECK_VALUE(tctx, names[0].num_addresses, num_ips);
865 for (i = 0; i < names[0].num_addresses; i++) {
866 const char *addr = names[0].addresses[i].address;
867 const char *owner = names[0].addresses[i].owner;
870 for (j = 0; j < num_ips2; j++) {
871 if (strcmp(addr, ips2[j].ip) == 0) {
873 CHECK_VALUE_STRING(tctx, owner, owner2->address);
880 for (j = 0; j < num_ips1; j++) {
881 if (strcmp(addr, ips1[j].ip) == 0) {
883 CHECK_VALUE_STRING(tctx, owner, owner1->address);
890 CHECK_VALUE_STRING(tctx, addr, "not found in address list");
892 talloc_free(pull_names.out.names);
896 static bool test_wrepl_sgroup_merged(struct torture_context *tctx,
897 struct test_wrepl_conflict_conn *ctx,
898 struct wrepl_wins_owner *merge_owner,
899 struct wrepl_wins_owner *owner1,
900 uint32_t num_ips1, const struct wrepl_ip *ips1,
901 struct wrepl_wins_owner *owner2,
902 uint32_t num_ips2, const struct wrepl_ip *ips2,
903 const struct wrepl_wins_name *name2)
906 struct wrepl_pull_names pull_names;
907 struct wrepl_name *names;
908 struct wrepl_name *name = NULL;
911 uint32_t num_ips = num_ips1 + num_ips2;
914 merge_owner = &ctx->c;
917 for (i = 0; i < num_ips1; i++) {
918 if (owner1 != &ctx->c && strcmp(ips1[i].owner,owner2->address) == 0) {
922 for (j = 0; j < num_ips2; j++) {
923 if (strcmp(ips1[i].ip,ips2[j].ip) == 0) {
931 pull_names.in.assoc_ctx = ctx->pull_assoc;
932 pull_names.in.partner = *merge_owner;
933 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
934 pull_names.in.partner.max_version = 0;
936 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
937 CHECK_STATUS(tctx, status, NT_STATUS_OK);
939 names = pull_names.out.names;
941 for (i = 0; i < pull_names.out.num_names; i++) {
942 if (names[i].name.type != name2->name->type) continue;
943 if (!names[i].name.name) continue;
944 if (strcmp(names[i].name.name, name2->name->name) != 0) continue;
945 if (names[i].name.scope) continue;
950 if (pull_names.out.num_names > 0) {
951 merge_owner->max_version = names[pull_names.out.num_names-1].version_id;
955 torture_comment(tctx, "%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name));
959 flags = WREPL_NAME_FLAGS(name->type,
963 CHECK_VALUE(tctx, name->name.type, name2->name->type);
964 CHECK_VALUE_STRING(tctx, name->name.name, name2->name->name);
965 CHECK_VALUE_STRING(tctx, name->name.scope, name2->name->scope);
966 CHECK_VALUE(tctx, flags, name2->flags);
968 CHECK_VALUE(tctx, name->num_addresses, num_ips);
970 for (i = 0; i < name->num_addresses; i++) {
971 const char *addr = name->addresses[i].address;
972 const char *owner = name->addresses[i].owner;
975 for (j = 0; j < num_ips2; j++) {
976 if (strcmp(addr, ips2[j].ip) == 0) {
978 CHECK_VALUE_STRING(tctx, owner, ips2[j].owner);
985 for (j = 0; j < num_ips1; j++) {
986 if (strcmp(addr, ips1[j].ip) == 0) {
988 if (owner1 == &ctx->c) {
989 CHECK_VALUE_STRING(tctx, owner, owner1->address);
991 CHECK_VALUE_STRING(tctx, owner, ips1[j].owner);
999 CHECK_VALUE_STRING(tctx, addr, "not found in address list");
1001 talloc_free(pull_names.out.names);
1005 static bool test_conflict_same_owner(struct torture_context *tctx,
1006 struct test_wrepl_conflict_conn *ctx)
1008 static bool ret = true;
1009 struct nbt_name name;
1010 struct wrepl_wins_name wins_name1;
1011 struct wrepl_wins_name wins_name2;
1012 struct wrepl_wins_name *wins_name_tmp;
1013 struct wrepl_wins_name *wins_name_last;
1014 struct wrepl_wins_name *wins_name_cur;
1016 uint8_t types[] = { 0x00, 0x1C };
1018 enum wrepl_name_type type;
1019 enum wrepl_name_state state;
1020 enum wrepl_name_node node;
1023 const struct wrepl_ip *ips;
1026 .type = WREPL_TYPE_GROUP,
1027 .state = WREPL_STATE_ACTIVE,
1028 .node = WREPL_NODE_B,
1030 .num_ips = ARRAY_SIZE(addresses_A_1),
1031 .ips = addresses_A_1,
1033 .type = WREPL_TYPE_UNIQUE,
1034 .state = WREPL_STATE_ACTIVE,
1035 .node = WREPL_NODE_B,
1037 .num_ips = ARRAY_SIZE(addresses_A_1),
1038 .ips = addresses_A_1,
1040 .type = WREPL_TYPE_UNIQUE,
1041 .state = WREPL_STATE_ACTIVE,
1042 .node = WREPL_NODE_B,
1044 .num_ips = ARRAY_SIZE(addresses_A_2),
1045 .ips = addresses_A_2,
1047 .type = WREPL_TYPE_UNIQUE,
1048 .state = WREPL_STATE_ACTIVE,
1049 .node = WREPL_NODE_B,
1051 .num_ips = ARRAY_SIZE(addresses_A_1),
1052 .ips = addresses_A_1,
1054 .type = WREPL_TYPE_UNIQUE,
1055 .state = WREPL_STATE_ACTIVE,
1056 .node = WREPL_NODE_B,
1058 .num_ips = ARRAY_SIZE(addresses_A_2),
1059 .ips = addresses_A_2,
1061 .type = WREPL_TYPE_SGROUP,
1062 .state = WREPL_STATE_TOMBSTONE,
1063 .node = WREPL_NODE_B,
1065 .num_ips = ARRAY_SIZE(addresses_A_2),
1066 .ips = addresses_A_2,
1068 .type = WREPL_TYPE_MHOMED,
1069 .state = WREPL_STATE_TOMBSTONE,
1070 .node = WREPL_NODE_B,
1072 .num_ips = ARRAY_SIZE(addresses_A_1),
1073 .ips = addresses_A_1,
1075 .type = WREPL_TYPE_MHOMED,
1076 .state = WREPL_STATE_RELEASED,
1077 .node = WREPL_NODE_B,
1079 .num_ips = ARRAY_SIZE(addresses_A_2),
1080 .ips = addresses_A_2,
1082 .type = WREPL_TYPE_SGROUP,
1083 .state = WREPL_STATE_ACTIVE,
1084 .node = WREPL_NODE_B,
1086 .num_ips = ARRAY_SIZE(addresses_A_1),
1087 .ips = addresses_A_1,
1089 .type = WREPL_TYPE_SGROUP,
1090 .state = WREPL_STATE_ACTIVE,
1091 .node = WREPL_NODE_B,
1093 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1094 .ips = addresses_A_3_4,
1096 .type = WREPL_TYPE_SGROUP,
1097 .state = WREPL_STATE_TOMBSTONE,
1098 .node = WREPL_NODE_B,
1100 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1101 .ips = addresses_B_3_4,
1103 /* the last one should always be a unique,tomstone record! */
1104 .type = WREPL_TYPE_UNIQUE,
1105 .state = WREPL_STATE_TOMBSTONE,
1106 .node = WREPL_NODE_B,
1108 .num_ips = ARRAY_SIZE(addresses_A_1),
1109 .ips = addresses_A_1,
1113 name.name = "_SAME_OWNER_A";
1117 wins_name_tmp = NULL;
1118 wins_name_last = &wins_name2;
1119 wins_name_cur = &wins_name1;
1121 for (j=0; ret && j < ARRAY_SIZE(types); j++) {
1122 name.type = types[j];
1123 torture_comment(tctx, "Test Replica Conflicts with same owner[%s] for %s\n",
1124 nbt_name_string(ctx, &name), ctx->a.address);
1126 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
1127 wins_name_tmp = wins_name_last;
1128 wins_name_last = wins_name_cur;
1129 wins_name_cur = wins_name_tmp;
1132 torture_comment(tctx, "%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
1133 wrepl_name_type_string(records[i-1].type),
1134 wrepl_name_state_string(records[i-1].state),
1135 (records[i-1].is_static?",static":""),
1136 wrepl_name_type_string(records[i].type),
1137 wrepl_name_state_string(records[i].state),
1138 (records[i].is_static?",static":""),
1139 (records[i-1].ips==records[i].ips?"same":"different"),
1143 wins_name_cur->name = &name;
1144 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
1147 records[i].is_static);
1148 wins_name_cur->id = ++ctx->a.max_version;
1149 if (wins_name_cur->flags & 2) {
1150 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
1151 wins_name_cur->addresses.addresses.ips = discard_const(records[i].ips);
1153 wins_name_cur->addresses.ip = records[i].ips[0].ip;
1155 wins_name_cur->unknown = "255.255.255.255";
1157 ret &= test_wrepl_update_one(tctx, ctx, &ctx->a,wins_name_cur);
1158 if (records[i].state == WREPL_STATE_RELEASED) {
1159 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_last, false);
1160 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, false);
1162 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, true);
1165 /* the first one is a cleanup run */
1166 if (!ret && i == 0) ret = true;
1169 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, __location__);
1177 static bool test_conflict_different_owner(struct torture_context *tctx,
1178 struct test_wrepl_conflict_conn *ctx)
1181 struct wrepl_wins_name wins_name1;
1182 struct wrepl_wins_name wins_name2;
1183 struct wrepl_wins_name *wins_name_r1;
1184 struct wrepl_wins_name *wins_name_r2;
1187 const char *line; /* just better debugging */
1188 struct nbt_name name;
1189 const char *comment;
1190 bool extra; /* not the worst case, this is an extra test */
1193 struct wrepl_wins_owner *owner;
1194 enum wrepl_name_type type;
1195 enum wrepl_name_state state;
1196 enum wrepl_name_node node;
1199 const struct wrepl_ip *ips;
1200 bool apply_expected;
1202 struct wrepl_wins_owner *merge_owner;
1203 bool sgroup_cleanup;
1207 * NOTE: the first record and the last applied one
1208 * needs to be from the same owner,
1209 * to not conflict in the next smbtorture run!!!
1212 .line = __location__,
1213 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1217 .type = WREPL_TYPE_UNIQUE,
1218 .state = WREPL_STATE_TOMBSTONE,
1219 .node = WREPL_NODE_B,
1221 .num_ips = ARRAY_SIZE(addresses_B_1),
1222 .ips = addresses_B_1,
1223 .apply_expected = true /* ignored */
1227 .type = WREPL_TYPE_UNIQUE,
1228 .state = WREPL_STATE_TOMBSTONE,
1229 .node = WREPL_NODE_B,
1231 .num_ips = ARRAY_SIZE(addresses_A_1),
1232 .ips = addresses_A_1,
1233 .apply_expected = true /* ignored */
1238 * unique vs unique section
1241 * unique,active vs. unique,active
1242 * => should be replaced
1245 .line = __location__,
1246 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1249 .type = WREPL_TYPE_UNIQUE,
1250 .state = WREPL_STATE_ACTIVE,
1251 .node = WREPL_NODE_B,
1253 .num_ips = ARRAY_SIZE(addresses_A_1),
1254 .ips = addresses_A_1,
1255 .apply_expected = true
1259 .type = WREPL_TYPE_UNIQUE,
1260 .state = WREPL_STATE_ACTIVE,
1261 .node = WREPL_NODE_B,
1263 .num_ips = ARRAY_SIZE(addresses_B_1),
1264 .ips = addresses_B_1,
1265 .apply_expected = true
1270 * unique,active vs. unique,tombstone
1271 * => should NOT be replaced
1274 .line = __location__,
1275 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1278 .type = WREPL_TYPE_UNIQUE,
1279 .state = WREPL_STATE_ACTIVE,
1280 .node = WREPL_NODE_B,
1282 .num_ips = ARRAY_SIZE(addresses_B_1),
1283 .ips = addresses_B_1,
1284 .apply_expected = true
1288 .type = WREPL_TYPE_UNIQUE,
1289 .state = WREPL_STATE_TOMBSTONE,
1290 .node = WREPL_NODE_B,
1292 .num_ips = ARRAY_SIZE(addresses_B_1),
1293 .ips = addresses_B_1,
1294 .apply_expected = false
1299 * unique,released vs. unique,active
1300 * => should be replaced
1303 .line = __location__,
1304 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1307 .type = WREPL_TYPE_UNIQUE,
1308 .state = WREPL_STATE_RELEASED,
1309 .node = WREPL_NODE_B,
1311 .num_ips = ARRAY_SIZE(addresses_B_1),
1312 .ips = addresses_B_1,
1313 .apply_expected = false
1317 .type = WREPL_TYPE_UNIQUE,
1318 .state = WREPL_STATE_ACTIVE,
1319 .node = WREPL_NODE_B,
1321 .num_ips = ARRAY_SIZE(addresses_A_1),
1322 .ips = addresses_A_1,
1323 .apply_expected = true
1328 * unique,released vs. unique,tombstone
1329 * => should be replaced
1332 .line = __location__,
1333 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1336 .type = WREPL_TYPE_UNIQUE,
1337 .state = WREPL_STATE_RELEASED,
1338 .node = WREPL_NODE_B,
1340 .num_ips = ARRAY_SIZE(addresses_A_1),
1341 .ips = addresses_A_1,
1342 .apply_expected = false
1346 .type = WREPL_TYPE_UNIQUE,
1347 .state = WREPL_STATE_TOMBSTONE,
1348 .node = WREPL_NODE_B,
1350 .num_ips = ARRAY_SIZE(addresses_B_1),
1351 .ips = addresses_B_1,
1352 .apply_expected = true
1357 * unique,tombstone vs. unique,active
1358 * => should be replaced
1361 .line = __location__,
1362 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1365 .type = WREPL_TYPE_UNIQUE,
1366 .state = WREPL_STATE_TOMBSTONE,
1367 .node = WREPL_NODE_B,
1369 .num_ips = ARRAY_SIZE(addresses_B_1),
1370 .ips = addresses_B_1,
1371 .apply_expected = true
1375 .type = WREPL_TYPE_UNIQUE,
1376 .state = WREPL_STATE_ACTIVE,
1377 .node = WREPL_NODE_B,
1379 .num_ips = ARRAY_SIZE(addresses_A_1),
1380 .ips = addresses_A_1,
1381 .apply_expected = true
1386 * unique,tombstone vs. unique,tombstone
1387 * => should be replaced
1390 .line = __location__,
1391 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1394 .type = WREPL_TYPE_UNIQUE,
1395 .state = WREPL_STATE_TOMBSTONE,
1396 .node = WREPL_NODE_B,
1398 .num_ips = ARRAY_SIZE(addresses_A_1),
1399 .ips = addresses_A_1,
1400 .apply_expected = true
1404 .type = WREPL_TYPE_UNIQUE,
1405 .state = WREPL_STATE_TOMBSTONE,
1406 .node = WREPL_NODE_B,
1408 .num_ips = ARRAY_SIZE(addresses_B_1),
1409 .ips = addresses_B_1,
1410 .apply_expected = true
1416 * unique vs normal groups section,
1419 * unique,active vs. group,active
1420 * => should be replaced
1423 .line = __location__,
1424 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1427 .type = WREPL_TYPE_UNIQUE,
1428 .state = WREPL_STATE_ACTIVE,
1429 .node = WREPL_NODE_B,
1431 .num_ips = ARRAY_SIZE(addresses_B_1),
1432 .ips = addresses_B_1,
1433 .apply_expected = true
1437 .type = WREPL_TYPE_GROUP,
1438 .state = WREPL_STATE_ACTIVE,
1439 .node = WREPL_NODE_B,
1441 .num_ips = ARRAY_SIZE(addresses_A_1),
1442 .ips = addresses_A_1,
1443 .apply_expected = true
1448 * unique,active vs. group,tombstone
1449 * => should NOT be replaced
1452 .line = __location__,
1453 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1456 .type = WREPL_TYPE_UNIQUE,
1457 .state = WREPL_STATE_ACTIVE,
1458 .node = WREPL_NODE_B,
1460 .num_ips = ARRAY_SIZE(addresses_A_1),
1461 .ips = addresses_A_1,
1462 .apply_expected = true
1466 .type = WREPL_TYPE_GROUP,
1467 .state = WREPL_STATE_TOMBSTONE,
1468 .node = WREPL_NODE_B,
1470 .num_ips = ARRAY_SIZE(addresses_A_1),
1471 .ips = addresses_A_1,
1472 .apply_expected = false
1477 * unique,released vs. group,active
1478 * => should be replaced
1481 .line = __location__,
1482 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1485 .type = WREPL_TYPE_UNIQUE,
1486 .state = WREPL_STATE_RELEASED,
1487 .node = WREPL_NODE_B,
1489 .num_ips = ARRAY_SIZE(addresses_A_1),
1490 .ips = addresses_A_1,
1491 .apply_expected = false
1495 .type = WREPL_TYPE_GROUP,
1496 .state = WREPL_STATE_ACTIVE,
1497 .node = WREPL_NODE_B,
1499 .num_ips = ARRAY_SIZE(addresses_B_1),
1500 .ips = addresses_B_1,
1501 .apply_expected = true
1506 * unique,released vs. group,tombstone
1507 * => should be replaced
1510 .line = __location__,
1511 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1514 .type = WREPL_TYPE_UNIQUE,
1515 .state = WREPL_STATE_RELEASED,
1516 .node = WREPL_NODE_B,
1518 .num_ips = ARRAY_SIZE(addresses_B_1),
1519 .ips = addresses_B_1,
1520 .apply_expected = false
1524 .type = WREPL_TYPE_GROUP,
1525 .state = WREPL_STATE_TOMBSTONE,
1526 .node = WREPL_NODE_B,
1528 .num_ips = ARRAY_SIZE(addresses_A_1),
1529 .ips = addresses_A_1,
1530 .apply_expected = true
1535 * unique,tombstone vs. group,active
1536 * => should be replaced
1539 .line = __location__,
1540 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1543 .type = WREPL_TYPE_UNIQUE,
1544 .state = WREPL_STATE_TOMBSTONE,
1545 .node = WREPL_NODE_B,
1547 .num_ips = ARRAY_SIZE(addresses_A_1),
1548 .ips = addresses_A_1,
1549 .apply_expected = true
1553 .type = WREPL_TYPE_GROUP,
1554 .state = WREPL_STATE_ACTIVE,
1555 .node = WREPL_NODE_B,
1557 .num_ips = ARRAY_SIZE(addresses_B_1),
1558 .ips = addresses_B_1,
1559 .apply_expected = true
1564 * unique,tombstone vs. group,tombstone
1565 * => should be replaced
1568 .line = __location__,
1569 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1572 .type = WREPL_TYPE_UNIQUE,
1573 .state = WREPL_STATE_TOMBSTONE,
1574 .node = WREPL_NODE_B,
1576 .num_ips = ARRAY_SIZE(addresses_B_1),
1577 .ips = addresses_B_1,
1578 .apply_expected = true
1582 .type = WREPL_TYPE_GROUP,
1583 .state = WREPL_STATE_TOMBSTONE,
1584 .node = WREPL_NODE_B,
1586 .num_ips = ARRAY_SIZE(addresses_A_1),
1587 .ips = addresses_A_1,
1588 .apply_expected = true
1593 * unique vs special groups section,
1596 * unique,active vs. sgroup,active
1597 * => should NOT be replaced
1600 .line = __location__,
1601 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1604 .type = WREPL_TYPE_UNIQUE,
1605 .state = WREPL_STATE_ACTIVE,
1606 .node = WREPL_NODE_B,
1608 .num_ips = ARRAY_SIZE(addresses_A_1),
1609 .ips = addresses_A_1,
1610 .apply_expected = true
1614 .type = WREPL_TYPE_SGROUP,
1615 .state = WREPL_STATE_ACTIVE,
1616 .node = WREPL_NODE_B,
1618 .num_ips = ARRAY_SIZE(addresses_A_1),
1619 .ips = addresses_A_1,
1620 .apply_expected = false
1625 * unique,active vs. sgroup,tombstone
1626 * => should NOT be replaced
1629 .line = __location__,
1630 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1633 .type = WREPL_TYPE_UNIQUE,
1634 .state = WREPL_STATE_ACTIVE,
1635 .node = WREPL_NODE_B,
1637 .num_ips = ARRAY_SIZE(addresses_A_1),
1638 .ips = addresses_A_1,
1639 .apply_expected = true
1643 .type = WREPL_TYPE_SGROUP,
1644 .state = WREPL_STATE_TOMBSTONE,
1645 .node = WREPL_NODE_B,
1647 .num_ips = ARRAY_SIZE(addresses_A_1),
1648 .ips = addresses_A_1,
1649 .apply_expected = false
1654 * unique,released vs. sgroup,active
1655 * => should be replaced
1658 .line = __location__,
1659 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1662 .type = WREPL_TYPE_UNIQUE,
1663 .state = WREPL_STATE_RELEASED,
1664 .node = WREPL_NODE_B,
1666 .num_ips = ARRAY_SIZE(addresses_A_1),
1667 .ips = addresses_A_1,
1668 .apply_expected = false
1672 .type = WREPL_TYPE_SGROUP,
1673 .state = WREPL_STATE_ACTIVE,
1674 .node = WREPL_NODE_B,
1676 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1677 .ips = addresses_B_3_4,
1678 .apply_expected = true
1683 * unique,released vs. sgroup,tombstone
1684 * => should be replaced
1687 .line = __location__,
1688 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1691 .type = WREPL_TYPE_UNIQUE,
1692 .state = WREPL_STATE_RELEASED,
1693 .node = WREPL_NODE_B,
1695 .num_ips = ARRAY_SIZE(addresses_B_1),
1696 .ips = addresses_B_1,
1697 .apply_expected = false
1701 .type = WREPL_TYPE_SGROUP,
1702 .state = WREPL_STATE_TOMBSTONE,
1703 .node = WREPL_NODE_B,
1705 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1706 .ips = addresses_A_3_4,
1707 .apply_expected = true
1712 * unique,tombstone vs. sgroup,active
1713 * => should be replaced
1716 .line = __location__,
1717 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1720 .type = WREPL_TYPE_UNIQUE,
1721 .state = WREPL_STATE_TOMBSTONE,
1722 .node = WREPL_NODE_B,
1724 .num_ips = ARRAY_SIZE(addresses_A_1),
1725 .ips = addresses_A_1,
1726 .apply_expected = true
1730 .type = WREPL_TYPE_SGROUP,
1731 .state = WREPL_STATE_ACTIVE,
1732 .node = WREPL_NODE_B,
1734 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1735 .ips = addresses_B_3_4,
1736 .apply_expected = true
1741 * unique,tombstone vs. sgroup,tombstone
1742 * => should be replaced
1745 .line = __location__,
1746 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1749 .type = WREPL_TYPE_UNIQUE,
1750 .state = WREPL_STATE_TOMBSTONE,
1751 .node = WREPL_NODE_B,
1753 .num_ips = ARRAY_SIZE(addresses_B_1),
1754 .ips = addresses_B_1,
1755 .apply_expected = true
1759 .type = WREPL_TYPE_SGROUP,
1760 .state = WREPL_STATE_TOMBSTONE,
1761 .node = WREPL_NODE_B,
1763 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1764 .ips = addresses_A_3_4,
1765 .apply_expected = true
1770 * unique vs multi homed section,
1773 * unique,active vs. mhomed,active
1774 * => should be replaced
1777 .line = __location__,
1778 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1781 .type = WREPL_TYPE_UNIQUE,
1782 .state = WREPL_STATE_ACTIVE,
1783 .node = WREPL_NODE_B,
1785 .num_ips = ARRAY_SIZE(addresses_A_1),
1786 .ips = addresses_A_1,
1787 .apply_expected = true
1791 .type = WREPL_TYPE_MHOMED,
1792 .state = WREPL_STATE_ACTIVE,
1793 .node = WREPL_NODE_B,
1795 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1796 .ips = addresses_B_3_4,
1797 .apply_expected = true
1802 * unique,active vs. mhomed,tombstone
1803 * => should NOT be replaced
1806 .line = __location__,
1807 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1810 .type = WREPL_TYPE_UNIQUE,
1811 .state = WREPL_STATE_ACTIVE,
1812 .node = WREPL_NODE_B,
1814 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1815 .ips = addresses_B_3_4,
1816 .apply_expected = true
1820 .type = WREPL_TYPE_MHOMED,
1821 .state = WREPL_STATE_TOMBSTONE,
1822 .node = WREPL_NODE_B,
1824 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1825 .ips = addresses_B_3_4,
1826 .apply_expected = false
1831 * unique,released vs. mhomed,active
1832 * => should be replaced
1835 .line = __location__,
1836 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1839 .type = WREPL_TYPE_UNIQUE,
1840 .state = WREPL_STATE_RELEASED,
1841 .node = WREPL_NODE_B,
1843 .num_ips = ARRAY_SIZE(addresses_B_1),
1844 .ips = addresses_B_1,
1845 .apply_expected = false
1849 .type = WREPL_TYPE_MHOMED,
1850 .state = WREPL_STATE_ACTIVE,
1851 .node = WREPL_NODE_B,
1853 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1854 .ips = addresses_A_3_4,
1855 .apply_expected = true
1860 * unique,released vs. mhomed,tombstone
1861 * => should be replaced
1864 .line = __location__,
1865 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1868 .type = WREPL_TYPE_UNIQUE,
1869 .state = WREPL_STATE_RELEASED,
1870 .node = WREPL_NODE_B,
1872 .num_ips = ARRAY_SIZE(addresses_A_1),
1873 .ips = addresses_A_1,
1874 .apply_expected = false
1878 .type = WREPL_TYPE_MHOMED,
1879 .state = WREPL_STATE_TOMBSTONE,
1880 .node = WREPL_NODE_B,
1882 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1883 .ips = addresses_B_3_4,
1884 .apply_expected = true
1889 * unique,tombstone vs. mhomed,active
1890 * => should be replaced
1893 .line = __location__,
1894 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1897 .type = WREPL_TYPE_UNIQUE,
1898 .state = WREPL_STATE_TOMBSTONE,
1899 .node = WREPL_NODE_B,
1901 .num_ips = ARRAY_SIZE(addresses_B_1),
1902 .ips = addresses_B_1,
1903 .apply_expected = true
1907 .type = WREPL_TYPE_MHOMED,
1908 .state = WREPL_STATE_ACTIVE,
1909 .node = WREPL_NODE_B,
1911 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1912 .ips = addresses_A_3_4,
1913 .apply_expected = true
1918 * unique,tombstone vs. mhomed,tombstone
1919 * => should be replaced
1922 .line = __location__,
1923 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1926 .type = WREPL_TYPE_UNIQUE,
1927 .state = WREPL_STATE_TOMBSTONE,
1928 .node = WREPL_NODE_B,
1930 .num_ips = ARRAY_SIZE(addresses_A_1),
1931 .ips = addresses_A_1,
1932 .apply_expected = true
1936 .type = WREPL_TYPE_MHOMED,
1937 .state = WREPL_STATE_TOMBSTONE,
1938 .node = WREPL_NODE_B,
1940 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1941 .ips = addresses_B_3_4,
1942 .apply_expected = true
1947 * normal groups vs unique section,
1950 * group,active vs. unique,active
1951 * => should NOT be replaced
1954 .line = __location__,
1955 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1958 .type = WREPL_TYPE_GROUP,
1959 .state = WREPL_STATE_ACTIVE,
1960 .node = WREPL_NODE_B,
1962 .num_ips = ARRAY_SIZE(addresses_A_1),
1963 .ips = addresses_A_1,
1964 .apply_expected = true
1968 .type = WREPL_TYPE_UNIQUE,
1969 .state = WREPL_STATE_ACTIVE,
1970 .node = WREPL_NODE_B,
1972 .num_ips = ARRAY_SIZE(addresses_A_1),
1973 .ips = addresses_A_1,
1974 .apply_expected = false
1979 * group,active vs. unique,tombstone
1980 * => should NOT be replaced
1983 .line = __location__,
1984 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1987 .type = WREPL_TYPE_GROUP,
1988 .state = WREPL_STATE_ACTIVE,
1989 .node = WREPL_NODE_B,
1991 .num_ips = ARRAY_SIZE(addresses_A_1),
1992 .ips = addresses_A_1,
1993 .apply_expected = true
1997 .type = WREPL_TYPE_UNIQUE,
1998 .state = WREPL_STATE_TOMBSTONE,
1999 .node = WREPL_NODE_B,
2001 .num_ips = ARRAY_SIZE(addresses_A_1),
2002 .ips = addresses_A_1,
2003 .apply_expected = false
2008 * group,released vs. unique,active
2009 * => should NOT be replaced
2012 .line = __location__,
2013 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2016 .type = WREPL_TYPE_GROUP,
2017 .state = WREPL_STATE_RELEASED,
2018 .node = WREPL_NODE_B,
2020 .num_ips = ARRAY_SIZE(addresses_A_1),
2021 .ips = addresses_A_1,
2022 .apply_expected = false
2026 .type = WREPL_TYPE_UNIQUE,
2027 .state = WREPL_STATE_ACTIVE,
2028 .node = WREPL_NODE_B,
2030 .num_ips = ARRAY_SIZE(addresses_A_1),
2031 .ips = addresses_A_1,
2032 .apply_expected = false
2037 * group,released vs. unique,tombstone
2038 * => should NOT be replaced
2041 .line = __location__,
2042 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2045 .type = WREPL_TYPE_GROUP,
2046 .state = WREPL_STATE_RELEASED,
2047 .node = WREPL_NODE_B,
2049 .num_ips = ARRAY_SIZE(addresses_A_1),
2050 .ips = addresses_A_1,
2051 .apply_expected = false
2055 .type = WREPL_TYPE_UNIQUE,
2056 .state = WREPL_STATE_TOMBSTONE,
2057 .node = WREPL_NODE_B,
2059 .num_ips = ARRAY_SIZE(addresses_A_1),
2060 .ips = addresses_A_1,
2061 .apply_expected = false
2066 * group,tombstone vs. unique,active
2067 * => should NOT be replaced
2070 .line = __location__,
2071 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2074 .type = WREPL_TYPE_GROUP,
2075 .state = WREPL_STATE_TOMBSTONE,
2076 .node = WREPL_NODE_B,
2078 .num_ips = ARRAY_SIZE(addresses_A_1),
2079 .ips = addresses_A_1,
2080 .apply_expected = true
2084 .type = WREPL_TYPE_UNIQUE,
2085 .state = WREPL_STATE_ACTIVE,
2086 .node = WREPL_NODE_B,
2088 .num_ips = ARRAY_SIZE(addresses_A_1),
2089 .ips = addresses_A_1,
2090 .apply_expected = false
2095 * group,tombstone vs. unique,tombstone
2096 * => should NOT be replaced
2099 .line = __location__,
2100 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2103 .type = WREPL_TYPE_GROUP,
2104 .state = WREPL_STATE_TOMBSTONE,
2105 .node = WREPL_NODE_B,
2107 .num_ips = ARRAY_SIZE(addresses_A_1),
2108 .ips = addresses_A_1,
2109 .apply_expected = true
2113 .type = WREPL_TYPE_UNIQUE,
2114 .state = WREPL_STATE_TOMBSTONE,
2115 .node = WREPL_NODE_B,
2117 .num_ips = ARRAY_SIZE(addresses_A_1),
2118 .ips = addresses_A_1,
2119 .apply_expected = false
2124 * normal groups vs normal groups section,
2127 * group,active vs. group,active
2128 * => should NOT be replaced
2131 .line = __location__,
2132 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2135 .type = WREPL_TYPE_GROUP,
2136 .state = WREPL_STATE_ACTIVE,
2137 .node = WREPL_NODE_B,
2139 .num_ips = ARRAY_SIZE(addresses_A_1),
2140 .ips = addresses_A_1,
2141 .apply_expected = true
2145 .type = WREPL_TYPE_GROUP,
2146 .state = WREPL_STATE_ACTIVE,
2147 .node = WREPL_NODE_B,
2149 .num_ips = ARRAY_SIZE(addresses_A_1),
2150 .ips = addresses_A_1,
2151 .apply_expected = false
2156 * group,active vs. group,tombstone
2157 * => should NOT be replaced
2160 .line = __location__,
2161 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2164 .type = WREPL_TYPE_GROUP,
2165 .state = WREPL_STATE_ACTIVE,
2166 .node = WREPL_NODE_B,
2168 .num_ips = ARRAY_SIZE(addresses_A_1),
2169 .ips = addresses_A_1,
2170 .apply_expected = true
2174 .type = WREPL_TYPE_GROUP,
2175 .state = WREPL_STATE_TOMBSTONE,
2176 .node = WREPL_NODE_B,
2178 .num_ips = ARRAY_SIZE(addresses_A_1),
2179 .ips = addresses_A_1,
2180 .apply_expected = false
2185 * group,released vs. group,active
2186 * => should be replaced
2189 .line = __location__,
2190 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2193 .type = WREPL_TYPE_GROUP,
2194 .state = WREPL_STATE_RELEASED,
2195 .node = WREPL_NODE_B,
2197 .num_ips = ARRAY_SIZE(addresses_A_1),
2198 .ips = addresses_A_1,
2199 .apply_expected = false
2203 .type = WREPL_TYPE_GROUP,
2204 .state = WREPL_STATE_ACTIVE,
2205 .node = WREPL_NODE_B,
2207 .num_ips = ARRAY_SIZE(addresses_B_1),
2208 .ips = addresses_B_1,
2209 .apply_expected = true
2214 * group,released vs. group,tombstone
2215 * => should be replaced
2218 .line = __location__,
2219 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2222 .type = WREPL_TYPE_GROUP,
2223 .state = WREPL_STATE_RELEASED,
2224 .node = WREPL_NODE_B,
2226 .num_ips = ARRAY_SIZE(addresses_A_1),
2227 .ips = addresses_A_1,
2228 .apply_expected = false
2232 .type = WREPL_TYPE_GROUP,
2233 .state = WREPL_STATE_TOMBSTONE,
2234 .node = WREPL_NODE_B,
2236 .num_ips = ARRAY_SIZE(addresses_B_1),
2237 .ips = addresses_B_1,
2238 .apply_expected = true
2243 * group,tombstone vs. group,active
2244 * => should be replaced
2247 .line = __location__,
2248 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2251 .type = WREPL_TYPE_GROUP,
2252 .state = WREPL_STATE_TOMBSTONE,
2253 .node = WREPL_NODE_B,
2255 .num_ips = ARRAY_SIZE(addresses_B_1),
2256 .ips = addresses_B_1,
2257 .apply_expected = true
2261 .type = WREPL_TYPE_GROUP,
2262 .state = WREPL_STATE_ACTIVE,
2263 .node = WREPL_NODE_B,
2265 .num_ips = ARRAY_SIZE(addresses_A_1),
2266 .ips = addresses_A_1,
2267 .apply_expected = true
2272 * group,tombstone vs. group,tombstone
2273 * => should be replaced
2276 .line = __location__,
2277 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2280 .type = WREPL_TYPE_GROUP,
2281 .state = WREPL_STATE_TOMBSTONE,
2282 .node = WREPL_NODE_B,
2284 .num_ips = ARRAY_SIZE(addresses_A_1),
2285 .ips = addresses_A_1,
2286 .apply_expected = true
2290 .type = WREPL_TYPE_GROUP,
2291 .state = WREPL_STATE_TOMBSTONE,
2292 .node = WREPL_NODE_B,
2294 .num_ips = ARRAY_SIZE(addresses_B_1),
2295 .ips = addresses_B_1,
2296 .apply_expected = true
2301 * normal groups vs special groups section,
2304 * group,active vs. sgroup,active
2305 * => should NOT be replaced
2308 .line = __location__,
2309 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2312 .type = WREPL_TYPE_GROUP,
2313 .state = WREPL_STATE_ACTIVE,
2314 .node = WREPL_NODE_B,
2316 .num_ips = ARRAY_SIZE(addresses_B_1),
2317 .ips = addresses_B_1,
2318 .apply_expected = true
2322 .type = WREPL_TYPE_SGROUP,
2323 .state = WREPL_STATE_ACTIVE,
2324 .node = WREPL_NODE_B,
2326 .num_ips = ARRAY_SIZE(addresses_B_1),
2327 .ips = addresses_B_1,
2328 .apply_expected = false
2333 * group,active vs. sgroup,tombstone
2334 * => should NOT be replaced
2337 .line = __location__,
2338 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2341 .type = WREPL_TYPE_GROUP,
2342 .state = WREPL_STATE_ACTIVE,
2343 .node = WREPL_NODE_B,
2345 .num_ips = ARRAY_SIZE(addresses_B_1),
2346 .ips = addresses_B_1,
2347 .apply_expected = true
2351 .type = WREPL_TYPE_SGROUP,
2352 .state = WREPL_STATE_TOMBSTONE,
2353 .node = WREPL_NODE_B,
2355 .num_ips = ARRAY_SIZE(addresses_B_1),
2356 .ips = addresses_B_1,
2357 .apply_expected = false
2362 * group,released vs. sgroup,active
2363 * => should be replaced
2366 .line = __location__,
2367 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2370 .type = WREPL_TYPE_GROUP,
2371 .state = WREPL_STATE_RELEASED,
2372 .node = WREPL_NODE_B,
2374 .num_ips = ARRAY_SIZE(addresses_A_1),
2375 .ips = addresses_A_1,
2376 .apply_expected = false
2380 .type = WREPL_TYPE_SGROUP,
2381 .state = WREPL_STATE_ACTIVE,
2382 .node = WREPL_NODE_B,
2384 .num_ips = ARRAY_SIZE(addresses_B_1),
2385 .ips = addresses_B_1,
2386 .apply_expected = true
2391 * group,released vs. sgroup,tombstone
2392 * => should NOT be replaced
2395 .line = __location__,
2396 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2399 .type = WREPL_TYPE_GROUP,
2400 .state = WREPL_STATE_RELEASED,
2401 .node = WREPL_NODE_B,
2403 .num_ips = ARRAY_SIZE(addresses_B_1),
2404 .ips = addresses_B_1,
2405 .apply_expected = false
2409 .type = WREPL_TYPE_SGROUP,
2410 .state = WREPL_STATE_TOMBSTONE,
2411 .node = WREPL_NODE_B,
2413 .num_ips = ARRAY_SIZE(addresses_B_1),
2414 .ips = addresses_B_1,
2415 .apply_expected = false
2420 * group,tombstone vs. sgroup,active
2421 * => should be replaced
2424 .line = __location__,
2425 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2428 .type = WREPL_TYPE_GROUP,
2429 .state = WREPL_STATE_TOMBSTONE,
2430 .node = WREPL_NODE_B,
2432 .num_ips = ARRAY_SIZE(addresses_B_1),
2433 .ips = addresses_B_1,
2434 .apply_expected = true
2438 .type = WREPL_TYPE_SGROUP,
2439 .state = WREPL_STATE_ACTIVE,
2440 .node = WREPL_NODE_B,
2442 .num_ips = ARRAY_SIZE(addresses_A_1),
2443 .ips = addresses_A_1,
2444 .apply_expected = true
2449 * group,tombstone vs. sgroup,tombstone
2450 * => should be replaced
2453 .line = __location__,
2454 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2457 .type = WREPL_TYPE_GROUP,
2458 .state = WREPL_STATE_TOMBSTONE,
2459 .node = WREPL_NODE_B,
2461 .num_ips = ARRAY_SIZE(addresses_A_1),
2462 .ips = addresses_A_1,
2463 .apply_expected = true
2467 .type = WREPL_TYPE_SGROUP,
2468 .state = WREPL_STATE_TOMBSTONE,
2469 .node = WREPL_NODE_B,
2471 .num_ips = ARRAY_SIZE(addresses_B_1),
2472 .ips = addresses_B_1,
2473 .apply_expected = true
2478 * normal groups vs multi homed section,
2481 * group,active vs. mhomed,active
2482 * => should NOT be replaced
2485 .line = __location__,
2486 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2489 .type = WREPL_TYPE_GROUP,
2490 .state = WREPL_STATE_ACTIVE,
2491 .node = WREPL_NODE_B,
2493 .num_ips = ARRAY_SIZE(addresses_B_1),
2494 .ips = addresses_B_1,
2495 .apply_expected = true
2499 .type = WREPL_TYPE_MHOMED,
2500 .state = WREPL_STATE_ACTIVE,
2501 .node = WREPL_NODE_B,
2503 .num_ips = ARRAY_SIZE(addresses_B_1),
2504 .ips = addresses_B_1,
2505 .apply_expected = false
2510 * group,active vs. mhomed,tombstone
2511 * => should NOT be replaced
2514 .line = __location__,
2515 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2518 .type = WREPL_TYPE_GROUP,
2519 .state = WREPL_STATE_ACTIVE,
2520 .node = WREPL_NODE_B,
2522 .num_ips = ARRAY_SIZE(addresses_B_1),
2523 .ips = addresses_B_1,
2524 .apply_expected = true
2528 .type = WREPL_TYPE_MHOMED,
2529 .state = WREPL_STATE_TOMBSTONE,
2530 .node = WREPL_NODE_B,
2532 .num_ips = ARRAY_SIZE(addresses_B_1),
2533 .ips = addresses_B_1,
2534 .apply_expected = false
2539 * group,released vs. mhomed,active
2540 * => should NOT be replaced
2543 .line = __location__,
2544 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2547 .type = WREPL_TYPE_GROUP,
2548 .state = WREPL_STATE_RELEASED,
2549 .node = WREPL_NODE_B,
2551 .num_ips = ARRAY_SIZE(addresses_B_1),
2552 .ips = addresses_B_1,
2553 .apply_expected = false
2557 .type = WREPL_TYPE_MHOMED,
2558 .state = WREPL_STATE_ACTIVE,
2559 .node = WREPL_NODE_B,
2561 .num_ips = ARRAY_SIZE(addresses_B_1),
2562 .ips = addresses_B_1,
2563 .apply_expected = false
2568 * group,released vs. mhomed,tombstone
2569 * => should NOT be replaced
2572 .line = __location__,
2573 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2576 .type = WREPL_TYPE_GROUP,
2577 .state = WREPL_STATE_RELEASED,
2578 .node = WREPL_NODE_B,
2580 .num_ips = ARRAY_SIZE(addresses_B_1),
2581 .ips = addresses_B_1,
2582 .apply_expected = false
2586 .type = WREPL_TYPE_MHOMED,
2587 .state = WREPL_STATE_TOMBSTONE,
2588 .node = WREPL_NODE_B,
2590 .num_ips = ARRAY_SIZE(addresses_B_1),
2591 .ips = addresses_B_1,
2592 .apply_expected = false
2597 * group,tombstone vs. mhomed,active
2598 * => should be replaced
2601 .line = __location__,
2602 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2605 .type = WREPL_TYPE_GROUP,
2606 .state = WREPL_STATE_TOMBSTONE,
2607 .node = WREPL_NODE_B,
2609 .num_ips = ARRAY_SIZE(addresses_B_1),
2610 .ips = addresses_B_1,
2611 .apply_expected = true
2615 .type = WREPL_TYPE_MHOMED,
2616 .state = WREPL_STATE_ACTIVE,
2617 .node = WREPL_NODE_B,
2619 .num_ips = ARRAY_SIZE(addresses_A_1),
2620 .ips = addresses_A_1,
2621 .apply_expected = true
2626 * group,tombstone vs. mhomed,tombstone
2627 * => should be replaced
2630 .line = __location__,
2631 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2634 .type = WREPL_TYPE_GROUP,
2635 .state = WREPL_STATE_TOMBSTONE,
2636 .node = WREPL_NODE_B,
2638 .num_ips = ARRAY_SIZE(addresses_A_1),
2639 .ips = addresses_A_1,
2640 .apply_expected = true
2644 .type = WREPL_TYPE_MHOMED,
2645 .state = WREPL_STATE_TOMBSTONE,
2646 .node = WREPL_NODE_B,
2648 .num_ips = ARRAY_SIZE(addresses_B_1),
2649 .ips = addresses_B_1,
2650 .apply_expected = true
2655 * special groups vs unique section,
2658 * sgroup,active vs. unique,active
2659 * => should NOT be replaced
2662 .line = __location__,
2663 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2666 .type = WREPL_TYPE_SGROUP,
2667 .state = WREPL_STATE_ACTIVE,
2668 .node = WREPL_NODE_B,
2670 .num_ips = ARRAY_SIZE(addresses_B_1),
2671 .ips = addresses_B_1,
2672 .apply_expected = true
2676 .type = WREPL_TYPE_UNIQUE,
2677 .state = WREPL_STATE_ACTIVE,
2678 .node = WREPL_NODE_B,
2680 .num_ips = ARRAY_SIZE(addresses_B_1),
2681 .ips = addresses_B_1,
2682 .apply_expected = false
2687 * sgroup,active vs. unique,tombstone
2688 * => should NOT be replaced
2691 .line = __location__,
2692 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2695 .type = WREPL_TYPE_SGROUP,
2696 .state = WREPL_STATE_ACTIVE,
2697 .node = WREPL_NODE_B,
2699 .num_ips = ARRAY_SIZE(addresses_B_1),
2700 .ips = addresses_B_1,
2701 .apply_expected = true
2705 .type = WREPL_TYPE_UNIQUE,
2706 .state = WREPL_STATE_TOMBSTONE,
2707 .node = WREPL_NODE_B,
2709 .num_ips = ARRAY_SIZE(addresses_B_1),
2710 .ips = addresses_B_1,
2711 .apply_expected = false
2716 * sgroup,released vs. unique,active
2717 * => should be replaced
2720 .line = __location__,
2721 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2724 .type = WREPL_TYPE_SGROUP,
2725 .state = WREPL_STATE_RELEASED,
2726 .node = WREPL_NODE_B,
2728 .num_ips = ARRAY_SIZE(addresses_B_1),
2729 .ips = addresses_B_1,
2730 .apply_expected = false
2734 .type = WREPL_TYPE_UNIQUE,
2735 .state = WREPL_STATE_ACTIVE,
2736 .node = WREPL_NODE_B,
2738 .num_ips = ARRAY_SIZE(addresses_A_1),
2739 .ips = addresses_A_1,
2740 .apply_expected = true
2745 * sgroup,released vs. unique,tombstone
2746 * => should be replaced
2749 .line = __location__,
2750 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2753 .type = WREPL_TYPE_SGROUP,
2754 .state = WREPL_STATE_RELEASED,
2755 .node = WREPL_NODE_B,
2757 .num_ips = ARRAY_SIZE(addresses_A_1),
2758 .ips = addresses_A_1,
2759 .apply_expected = false
2763 .type = WREPL_TYPE_UNIQUE,
2764 .state = WREPL_STATE_TOMBSTONE,
2765 .node = WREPL_NODE_B,
2767 .num_ips = ARRAY_SIZE(addresses_B_1),
2768 .ips = addresses_B_1,
2769 .apply_expected = true
2774 * sgroup,tombstone vs. unique,active
2775 * => should be replaced
2778 .line = __location__,
2779 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2782 .type = WREPL_TYPE_SGROUP,
2783 .state = WREPL_STATE_TOMBSTONE,
2784 .node = WREPL_NODE_B,
2786 .num_ips = ARRAY_SIZE(addresses_A_1),
2787 .ips = addresses_A_1,
2788 .apply_expected = true
2792 .type = WREPL_TYPE_UNIQUE,
2793 .state = WREPL_STATE_ACTIVE,
2794 .node = WREPL_NODE_B,
2796 .num_ips = ARRAY_SIZE(addresses_B_1),
2797 .ips = addresses_B_1,
2798 .apply_expected = true
2803 * sgroup,tombstone vs. unique,tombstone
2804 * => should be replaced
2807 .line = __location__,
2808 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2811 .type = WREPL_TYPE_SGROUP,
2812 .state = WREPL_STATE_TOMBSTONE,
2813 .node = WREPL_NODE_B,
2815 .num_ips = ARRAY_SIZE(addresses_B_1),
2816 .ips = addresses_B_1,
2817 .apply_expected = true
2821 .type = WREPL_TYPE_UNIQUE,
2822 .state = WREPL_STATE_TOMBSTONE,
2823 .node = WREPL_NODE_B,
2825 .num_ips = ARRAY_SIZE(addresses_A_1),
2826 .ips = addresses_A_1,
2827 .apply_expected = true
2832 * special groups vs normal group section,
2835 * sgroup,active vs. group,active
2836 * => should NOT be replaced
2839 .line = __location__,
2840 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2843 .type = WREPL_TYPE_SGROUP,
2844 .state = WREPL_STATE_ACTIVE,
2845 .node = WREPL_NODE_B,
2847 .num_ips = ARRAY_SIZE(addresses_A_1),
2848 .ips = addresses_A_1,
2849 .apply_expected = true
2853 .type = WREPL_TYPE_GROUP,
2854 .state = WREPL_STATE_ACTIVE,
2855 .node = WREPL_NODE_B,
2857 .num_ips = ARRAY_SIZE(addresses_A_1),
2858 .ips = addresses_A_1,
2859 .apply_expected = false
2864 * sgroup,active vs. group,tombstone
2865 * => should NOT be replaced
2868 .line = __location__,
2869 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2872 .type = WREPL_TYPE_SGROUP,
2873 .state = WREPL_STATE_ACTIVE,
2874 .node = WREPL_NODE_B,
2876 .num_ips = ARRAY_SIZE(addresses_A_1),
2877 .ips = addresses_A_1,
2878 .apply_expected = true
2882 .type = WREPL_TYPE_GROUP,
2883 .state = WREPL_STATE_TOMBSTONE,
2884 .node = WREPL_NODE_B,
2886 .num_ips = ARRAY_SIZE(addresses_A_1),
2887 .ips = addresses_A_1,
2888 .apply_expected = false
2893 * sgroup,released vs. group,active
2894 * => should be replaced
2897 .line = __location__,
2898 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2901 .type = WREPL_TYPE_SGROUP,
2902 .state = WREPL_STATE_RELEASED,
2903 .node = WREPL_NODE_B,
2905 .num_ips = ARRAY_SIZE(addresses_A_1),
2906 .ips = addresses_A_1,
2907 .apply_expected = false
2911 .type = WREPL_TYPE_GROUP,
2912 .state = WREPL_STATE_ACTIVE,
2913 .node = WREPL_NODE_B,
2915 .num_ips = ARRAY_SIZE(addresses_B_1),
2916 .ips = addresses_B_1,
2917 .apply_expected = true
2922 * sgroup,released vs. group,tombstone
2923 * => should be replaced
2926 .line = __location__,
2927 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2930 .type = WREPL_TYPE_SGROUP,
2931 .state = WREPL_STATE_RELEASED,
2932 .node = WREPL_NODE_B,
2934 .num_ips = ARRAY_SIZE(addresses_B_1),
2935 .ips = addresses_B_1,
2936 .apply_expected = false
2940 .type = WREPL_TYPE_GROUP,
2941 .state = WREPL_STATE_TOMBSTONE,
2942 .node = WREPL_NODE_B,
2944 .num_ips = ARRAY_SIZE(addresses_A_1),
2945 .ips = addresses_A_1,
2946 .apply_expected = true
2951 * sgroup,tombstone vs. group,active
2952 * => should NOT be replaced
2955 .line = __location__,
2956 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2959 .type = WREPL_TYPE_SGROUP,
2960 .state = WREPL_STATE_TOMBSTONE,
2961 .node = WREPL_NODE_B,
2963 .num_ips = ARRAY_SIZE(addresses_A_1),
2964 .ips = addresses_A_1,
2965 .apply_expected = true
2969 .type = WREPL_TYPE_GROUP,
2970 .state = WREPL_STATE_ACTIVE,
2971 .node = WREPL_NODE_B,
2973 .num_ips = ARRAY_SIZE(addresses_B_1),
2974 .ips = addresses_B_1,
2975 .apply_expected = true
2980 * sgroup,tombstone vs. group,tombstone
2981 * => should NOT be replaced
2984 .line = __location__,
2985 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2988 .type = WREPL_TYPE_SGROUP,
2989 .state = WREPL_STATE_TOMBSTONE,
2990 .node = WREPL_NODE_B,
2992 .num_ips = ARRAY_SIZE(addresses_B_1),
2993 .ips = addresses_B_1,
2994 .apply_expected = true
2998 .type = WREPL_TYPE_GROUP,
2999 .state = WREPL_STATE_TOMBSTONE,
3000 .node = WREPL_NODE_B,
3002 .num_ips = ARRAY_SIZE(addresses_A_1),
3003 .ips = addresses_A_1,
3004 .apply_expected = true
3009 * special groups (not active) vs special group section,
3012 * sgroup,released vs. sgroup,active
3013 * => should be replaced
3016 .line = __location__,
3017 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3020 .type = WREPL_TYPE_SGROUP,
3021 .state = WREPL_STATE_RELEASED,
3022 .node = WREPL_NODE_B,
3024 .num_ips = ARRAY_SIZE(addresses_A_1),
3025 .ips = addresses_A_1,
3026 .apply_expected = false
3030 .type = WREPL_TYPE_SGROUP,
3031 .state = WREPL_STATE_ACTIVE,
3032 .node = WREPL_NODE_B,
3034 .num_ips = ARRAY_SIZE(addresses_B_1),
3035 .ips = addresses_B_1,
3036 .apply_expected = true
3041 * sgroup,released vs. sgroup,tombstone
3042 * => should be replaced
3045 .line = __location__,
3046 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3049 .type = WREPL_TYPE_SGROUP,
3050 .state = WREPL_STATE_RELEASED,
3051 .node = WREPL_NODE_B,
3053 .num_ips = ARRAY_SIZE(addresses_B_1),
3054 .ips = addresses_B_1,
3055 .apply_expected = false
3059 .type = WREPL_TYPE_SGROUP,
3060 .state = WREPL_STATE_TOMBSTONE,
3061 .node = WREPL_NODE_B,
3063 .num_ips = ARRAY_SIZE(addresses_A_1),
3064 .ips = addresses_A_1,
3065 .apply_expected = true
3070 * sgroup,tombstone vs. sgroup,active
3071 * => should NOT be replaced
3074 .line = __location__,
3075 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3078 .type = WREPL_TYPE_SGROUP,
3079 .state = WREPL_STATE_TOMBSTONE,
3080 .node = WREPL_NODE_B,
3082 .num_ips = ARRAY_SIZE(addresses_A_1),
3083 .ips = addresses_A_1,
3084 .apply_expected = true
3088 .type = WREPL_TYPE_SGROUP,
3089 .state = WREPL_STATE_ACTIVE,
3090 .node = WREPL_NODE_B,
3092 .num_ips = ARRAY_SIZE(addresses_B_1),
3093 .ips = addresses_B_1,
3094 .apply_expected = true
3099 * sgroup,tombstone vs. sgroup,tombstone
3100 * => should NOT be replaced
3103 .line = __location__,
3104 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3107 .type = WREPL_TYPE_SGROUP,
3108 .state = WREPL_STATE_TOMBSTONE,
3109 .node = WREPL_NODE_B,
3111 .num_ips = ARRAY_SIZE(addresses_B_1),
3112 .ips = addresses_B_1,
3113 .apply_expected = true
3117 .type = WREPL_TYPE_SGROUP,
3118 .state = WREPL_STATE_TOMBSTONE,
3119 .node = WREPL_NODE_B,
3121 .num_ips = ARRAY_SIZE(addresses_A_1),
3122 .ips = addresses_A_1,
3123 .apply_expected = true
3128 * special groups vs multi homed section,
3131 * sgroup,active vs. mhomed,active
3132 * => should NOT be replaced
3135 .line = __location__,
3136 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3139 .type = WREPL_TYPE_SGROUP,
3140 .state = WREPL_STATE_ACTIVE,
3141 .node = WREPL_NODE_B,
3143 .num_ips = ARRAY_SIZE(addresses_A_1),
3144 .ips = addresses_A_1,
3145 .apply_expected = true
3149 .type = WREPL_TYPE_MHOMED,
3150 .state = WREPL_STATE_ACTIVE,
3151 .node = WREPL_NODE_B,
3153 .num_ips = ARRAY_SIZE(addresses_A_1),
3154 .ips = addresses_A_1,
3155 .apply_expected = false
3160 * sgroup,active vs. mhomed,tombstone
3161 * => should NOT be replaced
3164 .line = __location__,
3165 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3168 .type = WREPL_TYPE_SGROUP,
3169 .state = WREPL_STATE_ACTIVE,
3170 .node = WREPL_NODE_B,
3172 .num_ips = ARRAY_SIZE(addresses_A_1),
3173 .ips = addresses_A_1,
3174 .apply_expected = true
3178 .type = WREPL_TYPE_MHOMED,
3179 .state = WREPL_STATE_TOMBSTONE,
3180 .node = WREPL_NODE_B,
3182 .num_ips = ARRAY_SIZE(addresses_A_1),
3183 .ips = addresses_A_1,
3184 .apply_expected = false
3189 * sgroup,released vs. mhomed,active
3190 * => should be replaced
3193 .line = __location__,
3194 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3197 .type = WREPL_TYPE_SGROUP,
3198 .state = WREPL_STATE_RELEASED,
3199 .node = WREPL_NODE_B,
3201 .num_ips = ARRAY_SIZE(addresses_A_1),
3202 .ips = addresses_A_1,
3203 .apply_expected = false
3207 .type = WREPL_TYPE_MHOMED,
3208 .state = WREPL_STATE_ACTIVE,
3209 .node = WREPL_NODE_B,
3211 .num_ips = ARRAY_SIZE(addresses_B_1),
3212 .ips = addresses_B_1,
3213 .apply_expected = true
3218 * sgroup,released vs. mhomed,tombstone
3219 * => should be replaced
3222 .line = __location__,
3223 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3226 .type = WREPL_TYPE_SGROUP,
3227 .state = WREPL_STATE_RELEASED,
3228 .node = WREPL_NODE_B,
3230 .num_ips = ARRAY_SIZE(addresses_B_1),
3231 .ips = addresses_B_1,
3232 .apply_expected = false
3236 .type = WREPL_TYPE_MHOMED,
3237 .state = WREPL_STATE_TOMBSTONE,
3238 .node = WREPL_NODE_B,
3240 .num_ips = ARRAY_SIZE(addresses_A_1),
3241 .ips = addresses_A_1,
3242 .apply_expected = true
3247 * sgroup,tombstone vs. mhomed,active
3248 * => should be replaced
3251 .line = __location__,
3252 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3255 .type = WREPL_TYPE_SGROUP,
3256 .state = WREPL_STATE_TOMBSTONE,
3257 .node = WREPL_NODE_B,
3259 .num_ips = ARRAY_SIZE(addresses_A_1),
3260 .ips = addresses_A_1,
3261 .apply_expected = true
3265 .type = WREPL_TYPE_MHOMED,
3266 .state = WREPL_STATE_ACTIVE,
3267 .node = WREPL_NODE_B,
3269 .num_ips = ARRAY_SIZE(addresses_B_1),
3270 .ips = addresses_B_1,
3271 .apply_expected = true
3276 * sgroup,tombstone vs. mhomed,tombstone
3277 * => should be replaced
3280 .line = __location__,
3281 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3284 .type = WREPL_TYPE_SGROUP,
3285 .state = WREPL_STATE_TOMBSTONE,
3286 .node = WREPL_NODE_B,
3288 .num_ips = ARRAY_SIZE(addresses_B_1),
3289 .ips = addresses_B_1,
3290 .apply_expected = true
3294 .type = WREPL_TYPE_MHOMED,
3295 .state = WREPL_STATE_TOMBSTONE,
3296 .node = WREPL_NODE_B,
3298 .num_ips = ARRAY_SIZE(addresses_A_1),
3299 .ips = addresses_A_1,
3300 .apply_expected = true
3305 * multi homed vs. unique section,
3308 * mhomed,active vs. unique,active
3309 * => should be replaced
3312 .line = __location__,
3313 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3316 .type = WREPL_TYPE_MHOMED,
3317 .state = WREPL_STATE_ACTIVE,
3318 .node = WREPL_NODE_B,
3320 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3321 .ips = addresses_A_3_4,
3322 .apply_expected = true
3326 .type = WREPL_TYPE_UNIQUE,
3327 .state = WREPL_STATE_ACTIVE,
3328 .node = WREPL_NODE_B,
3330 .num_ips = ARRAY_SIZE(addresses_B_1),
3331 .ips = addresses_B_1,
3332 .apply_expected = true
3337 * mhomed,active vs. unique,tombstone
3338 * => should NOT be replaced
3341 .line = __location__,
3342 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3345 .type = WREPL_TYPE_MHOMED,
3346 .state = WREPL_STATE_ACTIVE,
3347 .node = WREPL_NODE_B,
3349 .num_ips = ARRAY_SIZE(addresses_B_1),
3350 .ips = addresses_B_1,
3351 .apply_expected = true
3355 .type = WREPL_TYPE_UNIQUE,
3356 .state = WREPL_STATE_TOMBSTONE,
3357 .node = WREPL_NODE_B,
3359 .num_ips = ARRAY_SIZE(addresses_B_1),
3360 .ips = addresses_B_1,
3361 .apply_expected = false
3366 * mhomed,released vs. unique,active
3367 * => should be replaced
3370 .line = __location__,
3371 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3374 .type = WREPL_TYPE_MHOMED,
3375 .state = WREPL_STATE_RELEASED,
3376 .node = WREPL_NODE_B,
3378 .num_ips = ARRAY_SIZE(addresses_A_1),
3379 .ips = addresses_A_1,
3380 .apply_expected = false
3384 .type = WREPL_TYPE_UNIQUE,
3385 .state = WREPL_STATE_ACTIVE,
3386 .node = WREPL_NODE_B,
3388 .num_ips = ARRAY_SIZE(addresses_B_1),
3389 .ips = addresses_B_1,
3390 .apply_expected = true
3395 * mhomed,released vs. uinique,tombstone
3396 * => should be replaced
3399 .line = __location__,
3400 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3403 .type = WREPL_TYPE_MHOMED,
3404 .state = WREPL_STATE_RELEASED,
3405 .node = WREPL_NODE_B,
3407 .num_ips = ARRAY_SIZE(addresses_B_1),
3408 .ips = addresses_B_1,
3409 .apply_expected = false
3413 .type = WREPL_TYPE_UNIQUE,
3414 .state = WREPL_STATE_TOMBSTONE,
3415 .node = WREPL_NODE_B,
3417 .num_ips = ARRAY_SIZE(addresses_A_1),
3418 .ips = addresses_A_1,
3419 .apply_expected = true
3424 * mhomed,tombstone vs. unique,active
3425 * => should be replaced
3428 .line = __location__,
3429 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3432 .type = WREPL_TYPE_MHOMED,
3433 .state = WREPL_STATE_TOMBSTONE,
3434 .node = WREPL_NODE_B,
3436 .num_ips = ARRAY_SIZE(addresses_A_1),
3437 .ips = addresses_A_1,
3438 .apply_expected = true
3442 .type = WREPL_TYPE_UNIQUE,
3443 .state = WREPL_STATE_ACTIVE,
3444 .node = WREPL_NODE_B,
3446 .num_ips = ARRAY_SIZE(addresses_B_1),
3447 .ips = addresses_B_1,
3448 .apply_expected = true
3453 * mhomed,tombstone vs. uinique,tombstone
3454 * => should be replaced
3457 .line = __location__,
3458 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3461 .type = WREPL_TYPE_MHOMED,
3462 .state = WREPL_STATE_TOMBSTONE,
3463 .node = WREPL_NODE_B,
3465 .num_ips = ARRAY_SIZE(addresses_B_1),
3466 .ips = addresses_B_1,
3467 .apply_expected = true
3471 .type = WREPL_TYPE_UNIQUE,
3472 .state = WREPL_STATE_TOMBSTONE,
3473 .node = WREPL_NODE_B,
3475 .num_ips = ARRAY_SIZE(addresses_A_1),
3476 .ips = addresses_A_1,
3477 .apply_expected = true
3482 * multi homed vs. normal group section,
3485 * mhomed,active vs. group,active
3486 * => should be replaced
3489 .line = __location__,
3490 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3493 .type = WREPL_TYPE_MHOMED,
3494 .state = WREPL_STATE_ACTIVE,
3495 .node = WREPL_NODE_B,
3497 .num_ips = ARRAY_SIZE(addresses_A_1),
3498 .ips = addresses_A_1,
3499 .apply_expected = true
3503 .type = WREPL_TYPE_GROUP,
3504 .state = WREPL_STATE_ACTIVE,
3505 .node = WREPL_NODE_B,
3507 .num_ips = ARRAY_SIZE(addresses_B_1),
3508 .ips = addresses_B_1,
3509 .apply_expected = true
3514 * mhomed,active vs. group,tombstone
3515 * => should NOT be replaced
3518 .line = __location__,
3519 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3522 .type = WREPL_TYPE_MHOMED,
3523 .state = WREPL_STATE_ACTIVE,
3524 .node = WREPL_NODE_B,
3526 .num_ips = ARRAY_SIZE(addresses_B_1),
3527 .ips = addresses_B_1,
3528 .apply_expected = true
3532 .type = WREPL_TYPE_GROUP,
3533 .state = WREPL_STATE_TOMBSTONE,
3534 .node = WREPL_NODE_B,
3536 .num_ips = ARRAY_SIZE(addresses_B_1),
3537 .ips = addresses_B_1,
3538 .apply_expected = false
3543 * mhomed,released vs. group,active
3544 * => should be replaced
3547 .line = __location__,
3548 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3551 .type = WREPL_TYPE_MHOMED,
3552 .state = WREPL_STATE_RELEASED,
3553 .node = WREPL_NODE_B,
3555 .num_ips = ARRAY_SIZE(addresses_B_1),
3556 .ips = addresses_B_1,
3557 .apply_expected = false
3561 .type = WREPL_TYPE_GROUP,
3562 .state = WREPL_STATE_ACTIVE,
3563 .node = WREPL_NODE_B,
3565 .num_ips = ARRAY_SIZE(addresses_A_1),
3566 .ips = addresses_A_1,
3567 .apply_expected = true
3572 * mhomed,released vs. group,tombstone
3573 * => should be replaced
3576 .line = __location__,
3577 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3580 .type = WREPL_TYPE_MHOMED,
3581 .state = WREPL_STATE_RELEASED,
3582 .node = WREPL_NODE_B,
3584 .num_ips = ARRAY_SIZE(addresses_A_1),
3585 .ips = addresses_A_1,
3586 .apply_expected = false
3590 .type = WREPL_TYPE_GROUP,
3591 .state = WREPL_STATE_TOMBSTONE,
3592 .node = WREPL_NODE_B,
3594 .num_ips = ARRAY_SIZE(addresses_B_1),
3595 .ips = addresses_B_1,
3596 .apply_expected = true
3601 * mhomed,tombstone vs. group,active
3602 * => should be replaced
3605 .line = __location__,
3606 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3609 .type = WREPL_TYPE_MHOMED,
3610 .state = WREPL_STATE_TOMBSTONE,
3611 .node = WREPL_NODE_B,
3613 .num_ips = ARRAY_SIZE(addresses_B_1),
3614 .ips = addresses_B_1,
3615 .apply_expected = true
3619 .type = WREPL_TYPE_GROUP,
3620 .state = WREPL_STATE_ACTIVE,
3621 .node = WREPL_NODE_B,
3623 .num_ips = ARRAY_SIZE(addresses_A_1),
3624 .ips = addresses_A_1,
3625 .apply_expected = true
3630 * mhomed,tombstone vs. group,tombstone
3631 * => should be replaced
3634 .line = __location__,
3635 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3638 .type = WREPL_TYPE_MHOMED,
3639 .state = WREPL_STATE_TOMBSTONE,
3640 .node = WREPL_NODE_B,
3642 .num_ips = ARRAY_SIZE(addresses_A_1),
3643 .ips = addresses_A_1,
3644 .apply_expected = true
3648 .type = WREPL_TYPE_GROUP,
3649 .state = WREPL_STATE_TOMBSTONE,
3650 .node = WREPL_NODE_B,
3652 .num_ips = ARRAY_SIZE(addresses_B_1),
3653 .ips = addresses_B_1,
3654 .apply_expected = true
3659 * multi homed vs. special group section,
3662 * mhomed,active vs. sgroup,active
3663 * => should NOT be replaced
3666 .line = __location__,
3667 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3670 .type = WREPL_TYPE_MHOMED,
3671 .state = WREPL_STATE_ACTIVE,
3672 .node = WREPL_NODE_B,
3674 .num_ips = ARRAY_SIZE(addresses_A_1),
3675 .ips = addresses_A_1,
3676 .apply_expected = true
3680 .type = WREPL_TYPE_SGROUP,
3681 .state = WREPL_STATE_ACTIVE,
3682 .node = WREPL_NODE_B,
3684 .num_ips = ARRAY_SIZE(addresses_A_1),
3685 .ips = addresses_A_1,
3686 .apply_expected = false
3691 * mhomed,active vs. sgroup,tombstone
3692 * => should NOT be replaced
3695 .line = __location__,
3696 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3699 .type = WREPL_TYPE_MHOMED,
3700 .state = WREPL_STATE_ACTIVE,
3701 .node = WREPL_NODE_B,
3703 .num_ips = ARRAY_SIZE(addresses_A_1),
3704 .ips = addresses_A_1,
3705 .apply_expected = true
3709 .type = WREPL_TYPE_SGROUP,
3710 .state = WREPL_STATE_TOMBSTONE,
3711 .node = WREPL_NODE_B,
3713 .num_ips = ARRAY_SIZE(addresses_A_1),
3714 .ips = addresses_A_1,
3715 .apply_expected = false
3720 * mhomed,released vs. sgroup,active
3721 * => should be replaced
3724 .line = __location__,
3725 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3728 .type = WREPL_TYPE_MHOMED,
3729 .state = WREPL_STATE_RELEASED,
3730 .node = WREPL_NODE_B,
3732 .num_ips = ARRAY_SIZE(addresses_A_1),
3733 .ips = addresses_A_1,
3734 .apply_expected = false
3738 .type = WREPL_TYPE_SGROUP,
3739 .state = WREPL_STATE_ACTIVE,
3740 .node = WREPL_NODE_B,
3742 .num_ips = ARRAY_SIZE(addresses_B_1),
3743 .ips = addresses_B_1,
3744 .apply_expected = true
3749 * mhomed,released vs. sgroup,tombstone
3750 * => should be replaced
3753 .line = __location__,
3754 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3757 .type = WREPL_TYPE_MHOMED,
3758 .state = WREPL_STATE_RELEASED,
3759 .node = WREPL_NODE_B,
3761 .num_ips = ARRAY_SIZE(addresses_B_1),
3762 .ips = addresses_B_1,
3763 .apply_expected = false
3767 .type = WREPL_TYPE_SGROUP,
3768 .state = WREPL_STATE_TOMBSTONE,
3769 .node = WREPL_NODE_B,
3771 .num_ips = ARRAY_SIZE(addresses_A_1),
3772 .ips = addresses_A_1,
3773 .apply_expected = true
3778 * mhomed,tombstone vs. sgroup,active
3779 * => should be replaced
3782 .line = __location__,
3783 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3786 .type = WREPL_TYPE_MHOMED,
3787 .state = WREPL_STATE_TOMBSTONE,
3788 .node = WREPL_NODE_B,
3790 .num_ips = ARRAY_SIZE(addresses_A_1),
3791 .ips = addresses_A_1,
3792 .apply_expected = true
3796 .type = WREPL_TYPE_SGROUP,
3797 .state = WREPL_STATE_ACTIVE,
3798 .node = WREPL_NODE_B,
3800 .num_ips = ARRAY_SIZE(addresses_B_1),
3801 .ips = addresses_B_1,
3802 .apply_expected = true
3807 * mhomed,tombstone vs. sgroup,tombstone
3808 * => should be replaced
3811 .line = __location__,
3812 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3815 .type = WREPL_TYPE_MHOMED,
3816 .state = WREPL_STATE_TOMBSTONE,
3817 .node = WREPL_NODE_B,
3819 .num_ips = ARRAY_SIZE(addresses_B_1),
3820 .ips = addresses_B_1,
3821 .apply_expected = true
3825 .type = WREPL_TYPE_SGROUP,
3826 .state = WREPL_STATE_TOMBSTONE,
3827 .node = WREPL_NODE_B,
3829 .num_ips = ARRAY_SIZE(addresses_A_1),
3830 .ips = addresses_A_1,
3831 .apply_expected = true
3836 * multi homed vs. mlti homed section,
3839 * mhomed,active vs. mhomed,active
3840 * => should be replaced
3843 .line = __location__,
3844 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3847 .type = WREPL_TYPE_MHOMED,
3848 .state = WREPL_STATE_ACTIVE,
3849 .node = WREPL_NODE_B,
3851 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3852 .ips = addresses_A_3_4,
3853 .apply_expected = true
3857 .type = WREPL_TYPE_MHOMED,
3858 .state = WREPL_STATE_ACTIVE,
3859 .node = WREPL_NODE_B,
3861 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3862 .ips = addresses_B_3_4,
3863 .apply_expected = true
3868 * mhomed,active vs. mhomed,tombstone
3869 * => should NOT be replaced
3872 .line = __location__,
3873 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3876 .type = WREPL_TYPE_MHOMED,
3877 .state = WREPL_STATE_ACTIVE,
3878 .node = WREPL_NODE_B,
3880 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3881 .ips = addresses_B_3_4,
3882 .apply_expected = true
3886 .type = WREPL_TYPE_MHOMED,
3887 .state = WREPL_STATE_TOMBSTONE,
3888 .node = WREPL_NODE_B,
3890 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3891 .ips = addresses_B_3_4,
3892 .apply_expected = false
3897 * mhomed,released vs. mhomed,active
3898 * => should be replaced
3901 .line = __location__,
3902 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3905 .type = WREPL_TYPE_MHOMED,
3906 .state = WREPL_STATE_RELEASED,
3907 .node = WREPL_NODE_B,
3909 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3910 .ips = addresses_B_3_4,
3911 .apply_expected = false
3915 .type = WREPL_TYPE_MHOMED,
3916 .state = WREPL_STATE_ACTIVE,
3917 .node = WREPL_NODE_B,
3919 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3920 .ips = addresses_A_3_4,
3921 .apply_expected = true
3926 * mhomed,released vs. mhomed,tombstone
3927 * => should be replaced
3930 .line = __location__,
3931 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3934 .type = WREPL_TYPE_MHOMED,
3935 .state = WREPL_STATE_RELEASED,
3936 .node = WREPL_NODE_B,
3938 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3939 .ips = addresses_A_3_4,
3940 .apply_expected = false
3944 .type = WREPL_TYPE_MHOMED,
3945 .state = WREPL_STATE_TOMBSTONE,
3946 .node = WREPL_NODE_B,
3948 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3949 .ips = addresses_B_3_4,
3950 .apply_expected = true
3955 * mhomed,tombstone vs. mhomed,active
3956 * => should be replaced
3959 .line = __location__,
3960 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3963 .type = WREPL_TYPE_MHOMED,
3964 .state = WREPL_STATE_TOMBSTONE,
3965 .node = WREPL_NODE_B,
3967 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3968 .ips = addresses_B_3_4,
3969 .apply_expected = true
3973 .type = WREPL_TYPE_MHOMED,
3974 .state = WREPL_STATE_ACTIVE,
3975 .node = WREPL_NODE_B,
3977 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3978 .ips = addresses_A_3_4,
3979 .apply_expected = true
3984 * mhomed,tombstone vs. mhomed,tombstone
3985 * => should be replaced
3988 .line = __location__,
3989 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3992 .type = WREPL_TYPE_MHOMED,
3993 .state = WREPL_STATE_TOMBSTONE,
3994 .node = WREPL_NODE_B,
3996 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3997 .ips = addresses_A_3_4,
3998 .apply_expected = true
4002 .type = WREPL_TYPE_MHOMED,
4003 .state = WREPL_STATE_TOMBSTONE,
4004 .node = WREPL_NODE_B,
4006 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4007 .ips = addresses_B_3_4,
4008 .apply_expected = true
4012 .line = __location__,
4013 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4017 .type = WREPL_TYPE_UNIQUE,
4018 .state = WREPL_STATE_TOMBSTONE,
4019 .node = WREPL_NODE_B,
4021 .num_ips = ARRAY_SIZE(addresses_B_1),
4022 .ips = addresses_B_1,
4023 .apply_expected = true,
4027 .type = WREPL_TYPE_UNIQUE,
4028 .state = WREPL_STATE_TOMBSTONE,
4029 .node = WREPL_NODE_B,
4031 .num_ips = ARRAY_SIZE(addresses_A_1),
4032 .ips = addresses_A_1,
4033 .apply_expected = true,
4037 * special group vs special group section,
4040 * sgroup,active vs. sgroup,active same addresses
4041 * => should be NOT replaced
4044 .line = __location__,
4045 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4046 .comment= "A:A_3_4 vs. B:A_3_4",
4050 .type = WREPL_TYPE_SGROUP,
4051 .state = WREPL_STATE_ACTIVE,
4052 .node = WREPL_NODE_B,
4054 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4055 .ips = addresses_A_3_4,
4056 .apply_expected = true
4060 .type = WREPL_TYPE_SGROUP,
4061 .state = WREPL_STATE_ACTIVE,
4062 .node = WREPL_NODE_B,
4064 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4065 .ips = addresses_A_3_4,
4066 .apply_expected = false,
4067 .sgroup_cleanup = true
4071 * sgroup,active vs. sgroup,active same addresses
4072 * => should be NOT replaced
4075 .line = __location__,
4076 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4077 .comment= "A:A_3_4 vs. B:NULL",
4081 .type = WREPL_TYPE_SGROUP,
4082 .state = WREPL_STATE_ACTIVE,
4083 .node = WREPL_NODE_B,
4085 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4086 .ips = addresses_A_3_4,
4087 .apply_expected = true
4091 .type = WREPL_TYPE_SGROUP,
4092 .state = WREPL_STATE_ACTIVE,
4093 .node = WREPL_NODE_B,
4097 .apply_expected = false,
4098 .sgroup_cleanup = true
4102 * sgroup,active vs. sgroup,active subset addresses, special case...
4103 * => should NOT be replaced
4106 .line = __location__,
4107 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4108 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4",
4112 .type = WREPL_TYPE_SGROUP,
4113 .state = WREPL_STATE_ACTIVE,
4114 .node = WREPL_NODE_B,
4116 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4117 .ips = addresses_A_3_4_X_3_4,
4118 .apply_expected = true,
4122 .type = WREPL_TYPE_SGROUP,
4123 .state = WREPL_STATE_ACTIVE,
4124 .node = WREPL_NODE_B,
4126 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4127 .ips = addresses_A_3_4,
4128 .apply_expected = false,
4132 .line = __location__,
4133 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4137 .type = WREPL_TYPE_SGROUP,
4138 .state = WREPL_STATE_ACTIVE,
4139 .node = WREPL_NODE_B,
4143 .apply_expected = false,
4147 .type = WREPL_TYPE_SGROUP,
4148 .state = WREPL_STATE_ACTIVE,
4149 .node = WREPL_NODE_B,
4153 .apply_expected = false,
4157 * sgroup,active vs. sgroup,active different addresses, but owner changed
4158 * => should be replaced
4161 .line = __location__,
4162 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4163 .comment= "A:B_3_4 vs. B:A_3_4",
4167 .type = WREPL_TYPE_SGROUP,
4168 .state = WREPL_STATE_ACTIVE,
4169 .node = WREPL_NODE_B,
4171 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4172 .ips = addresses_B_3_4,
4173 .apply_expected = true,
4177 .type = WREPL_TYPE_SGROUP,
4178 .state = WREPL_STATE_ACTIVE,
4179 .node = WREPL_NODE_B,
4181 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4182 .ips = addresses_A_3_4,
4183 .apply_expected = true,
4184 .sgroup_cleanup = true
4188 * sgroup,active vs. sgroup,active different addresses, but owner changed
4189 * => should be replaced
4192 .line = __location__,
4193 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4194 .comment= "A:A_3_4 vs. B:A_3_4_OWNER_B",
4198 .type = WREPL_TYPE_SGROUP,
4199 .state = WREPL_STATE_ACTIVE,
4200 .node = WREPL_NODE_B,
4202 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4203 .ips = addresses_A_3_4,
4204 .apply_expected = true,
4208 .type = WREPL_TYPE_SGROUP,
4209 .state = WREPL_STATE_ACTIVE,
4210 .node = WREPL_NODE_B,
4212 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4213 .ips = addresses_A_3_4_OWNER_B,
4214 .apply_expected = true,
4215 .sgroup_cleanup = true
4219 * sgroup,active vs. sgroup,active different addresses, but owner changed
4220 * => should be replaced
4223 .line = __location__,
4224 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4225 .comment= "A:A_3_4_OWNER_B vs. B:A_3_4",
4229 .type = WREPL_TYPE_SGROUP,
4230 .state = WREPL_STATE_ACTIVE,
4231 .node = WREPL_NODE_B,
4233 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4234 .ips = addresses_A_3_4_OWNER_B,
4235 .apply_expected = true,
4239 .type = WREPL_TYPE_SGROUP,
4240 .state = WREPL_STATE_ACTIVE,
4241 .node = WREPL_NODE_B,
4243 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4244 .ips = addresses_A_3_4,
4245 .apply_expected = true,
4246 .sgroup_cleanup = true
4250 * sgroup,active vs. sgroup,active different addresses
4251 * => should be merged
4254 .line = __location__,
4255 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4256 .comment= "A:A_3_4 vs. B:B_3_4 => C:A_3_4_B_3_4",
4260 .type = WREPL_TYPE_SGROUP,
4261 .state = WREPL_STATE_ACTIVE,
4262 .node = WREPL_NODE_B,
4264 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4265 .ips = addresses_A_3_4,
4266 .apply_expected = true,
4270 .type = WREPL_TYPE_SGROUP,
4271 .state = WREPL_STATE_ACTIVE,
4272 .node = WREPL_NODE_B,
4274 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4275 .ips = addresses_B_3_4,
4276 .sgroup_merge = true,
4277 .sgroup_cleanup = true,
4281 * sgroup,active vs. sgroup,active different addresses, special case...
4282 * => should be merged
4285 .line = __location__,
4286 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4287 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4_X_3_4",
4291 .type = WREPL_TYPE_SGROUP,
4292 .state = WREPL_STATE_ACTIVE,
4293 .node = WREPL_NODE_B,
4295 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4296 .ips = addresses_B_3_4_X_3_4,
4297 .apply_expected = true,
4301 .type = WREPL_TYPE_SGROUP,
4302 .state = WREPL_STATE_ACTIVE,
4303 .node = WREPL_NODE_B,
4305 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4306 .ips = addresses_A_3_4,
4307 .sgroup_merge = true,
4308 .merge_owner = &ctx->b,
4309 .sgroup_cleanup = false
4313 .line = __location__,
4314 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4318 .type = WREPL_TYPE_SGROUP,
4319 .state = WREPL_STATE_ACTIVE,
4320 .node = WREPL_NODE_B,
4322 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4_OWNER_B),
4323 .ips = addresses_A_3_4_X_3_4_OWNER_B,
4324 .apply_expected = true,
4328 .type = WREPL_TYPE_SGROUP,
4329 .state = WREPL_STATE_ACTIVE,
4330 .node = WREPL_NODE_B,
4334 .apply_expected = false,
4338 * sgroup,active vs. sgroup,active different addresses, special case...
4339 * => should be merged
4342 .line = __location__,
4343 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4344 .comment= "A:X_3_4 vs. B:A_3_4 => C:A_3_4_X_3_4",
4348 .type = WREPL_TYPE_SGROUP,
4349 .state = WREPL_STATE_ACTIVE,
4350 .node = WREPL_NODE_B,
4352 .num_ips = ARRAY_SIZE(addresses_X_3_4),
4353 .ips = addresses_X_3_4,
4354 .apply_expected = true,
4358 .type = WREPL_TYPE_SGROUP,
4359 .state = WREPL_STATE_ACTIVE,
4360 .node = WREPL_NODE_B,
4362 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4363 .ips = addresses_A_3_4,
4364 .sgroup_merge = true,
4365 .sgroup_cleanup = false
4369 .line = __location__,
4370 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4374 .type = WREPL_TYPE_SGROUP,
4375 .state = WREPL_STATE_ACTIVE,
4376 .node = WREPL_NODE_B,
4380 .apply_expected = false,
4384 .type = WREPL_TYPE_SGROUP,
4385 .state = WREPL_STATE_ACTIVE,
4386 .node = WREPL_NODE_B,
4390 .apply_expected = false,
4394 * sgroup,active vs. sgroup,active different addresses, special case...
4395 * => should be merged
4398 .line = __location__,
4399 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4400 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4_OWNER_B => B:A_3_4_OWNER_B_X_3_4",
4404 .type = WREPL_TYPE_SGROUP,
4405 .state = WREPL_STATE_ACTIVE,
4406 .node = WREPL_NODE_B,
4408 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4409 .ips = addresses_A_3_4_X_3_4,
4410 .apply_expected = true,
4414 .type = WREPL_TYPE_SGROUP,
4415 .state = WREPL_STATE_ACTIVE,
4416 .node = WREPL_NODE_B,
4418 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4419 .ips = addresses_A_3_4_OWNER_B,
4420 .sgroup_merge = true,
4421 .merge_owner = &ctx->b,
4425 .line = __location__,
4426 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4430 .type = WREPL_TYPE_SGROUP,
4431 .state = WREPL_STATE_ACTIVE,
4432 .node = WREPL_NODE_B,
4436 .apply_expected = false,
4440 .type = WREPL_TYPE_SGROUP,
4441 .state = WREPL_STATE_ACTIVE,
4442 .node = WREPL_NODE_B,
4446 .apply_expected = false,
4450 * sgroup,active vs. sgroup,active partly different addresses, special case...
4451 * => should be merged
4454 .line = __location__,
4455 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4456 .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",
4460 .type = WREPL_TYPE_SGROUP,
4461 .state = WREPL_STATE_ACTIVE,
4462 .node = WREPL_NODE_B,
4464 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4465 .ips = addresses_B_3_4_X_3_4,
4466 .apply_expected = true,
4470 .type = WREPL_TYPE_SGROUP,
4471 .state = WREPL_STATE_ACTIVE,
4472 .node = WREPL_NODE_B,
4474 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_1_2),
4475 .ips = addresses_B_3_4_X_1_2,
4476 .sgroup_merge = true,
4477 .sgroup_cleanup = false
4481 .line = __location__,
4482 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4486 .type = WREPL_TYPE_SGROUP,
4487 .state = WREPL_STATE_ACTIVE,
4488 .node = WREPL_NODE_B,
4492 .apply_expected = false,
4496 .type = WREPL_TYPE_SGROUP,
4497 .state = WREPL_STATE_ACTIVE,
4498 .node = WREPL_NODE_B,
4502 .apply_expected = false,
4506 * sgroup,active vs. sgroup,active different addresses, special case...
4507 * => should be merged
4510 .line = __location__,
4511 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4512 .comment= "A:A_3_4_B_3_4 vs. B:NULL => B:A_3_4",
4516 .type = WREPL_TYPE_SGROUP,
4517 .state = WREPL_STATE_ACTIVE,
4518 .node = WREPL_NODE_B,
4520 .num_ips = ARRAY_SIZE(addresses_A_3_4_B_3_4),
4521 .ips = addresses_A_3_4_B_3_4,
4522 .apply_expected = true,
4526 .type = WREPL_TYPE_SGROUP,
4527 .state = WREPL_STATE_ACTIVE,
4528 .node = WREPL_NODE_B,
4532 .sgroup_merge = true,
4533 .merge_owner = &ctx->b,
4534 .sgroup_cleanup = true
4538 .line = __location__,
4539 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4543 .type = WREPL_TYPE_SGROUP,
4544 .state = WREPL_STATE_ACTIVE,
4545 .node = WREPL_NODE_B,
4549 .apply_expected = false,
4553 .type = WREPL_TYPE_UNIQUE,
4554 .state = WREPL_STATE_TOMBSTONE,
4555 .node = WREPL_NODE_B,
4557 .num_ips = ARRAY_SIZE(addresses_A_1),
4558 .ips = addresses_A_1,
4559 .apply_expected = true,
4563 * sgroup,active vs. sgroup,active different addresses, special case...
4564 * => should be merged
4567 .line = __location__,
4568 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4569 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:X_3_4",
4573 .type = WREPL_TYPE_SGROUP,
4574 .state = WREPL_STATE_ACTIVE,
4575 .node = WREPL_NODE_B,
4577 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4578 .ips = addresses_B_3_4_X_3_4,
4579 .apply_expected = true,
4583 .type = WREPL_TYPE_SGROUP,
4584 .state = WREPL_STATE_ACTIVE,
4585 .node = WREPL_NODE_B,
4589 .sgroup_merge = true,
4590 .merge_owner = &ctx->b,
4591 .sgroup_cleanup = true
4595 .line = __location__,
4596 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4600 .type = WREPL_TYPE_SGROUP,
4601 .state = WREPL_STATE_ACTIVE,
4602 .node = WREPL_NODE_B,
4606 .apply_expected = false,
4610 .type = WREPL_TYPE_UNIQUE,
4611 .state = WREPL_STATE_TOMBSTONE,
4612 .node = WREPL_NODE_B,
4614 .num_ips = ARRAY_SIZE(addresses_A_1),
4615 .ips = addresses_A_1,
4616 .apply_expected = true,
4621 * sgroup,active vs. sgroup,tombstone different no addresses, special
4622 * => should be replaced
4625 .line = __location__,
4626 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4627 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:NULL",
4631 .type = WREPL_TYPE_SGROUP,
4632 .state = WREPL_STATE_ACTIVE,
4633 .node = WREPL_NODE_B,
4635 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4636 .ips = addresses_B_3_4_X_3_4,
4637 .apply_expected = true,
4641 .type = WREPL_TYPE_SGROUP,
4642 .state = WREPL_STATE_TOMBSTONE,
4643 .node = WREPL_NODE_B,
4647 .apply_expected = true,
4651 * sgroup,active vs. sgroup,tombstone different addresses
4652 * => should be replaced
4655 .line = __location__,
4656 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4657 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4",
4661 .type = WREPL_TYPE_SGROUP,
4662 .state = WREPL_STATE_ACTIVE,
4663 .node = WREPL_NODE_B,
4665 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4666 .ips = addresses_B_3_4_X_3_4,
4667 .apply_expected = true,
4671 .type = WREPL_TYPE_SGROUP,
4672 .state = WREPL_STATE_TOMBSTONE,
4673 .node = WREPL_NODE_B,
4675 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4676 .ips = addresses_A_3_4,
4677 .apply_expected = true,
4681 * sgroup,active vs. sgroup,tombstone subset addresses
4682 * => should be replaced
4685 .line = __location__,
4686 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4687 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4 => B:B_3_4",
4691 .type = WREPL_TYPE_SGROUP,
4692 .state = WREPL_STATE_ACTIVE,
4693 .node = WREPL_NODE_B,
4695 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4696 .ips = addresses_B_3_4_X_3_4,
4697 .apply_expected = true,
4701 .type = WREPL_TYPE_SGROUP,
4702 .state = WREPL_STATE_TOMBSTONE,
4703 .node = WREPL_NODE_B,
4705 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4706 .ips = addresses_B_3_4,
4707 .apply_expected = true,
4711 * sgroup,active vs. sgroup,active same addresses
4712 * => should be replaced
4715 .line = __location__,
4716 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4717 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4_X_3_4 => B:B_3_4_X_3_4",
4721 .type = WREPL_TYPE_SGROUP,
4722 .state = WREPL_STATE_ACTIVE,
4723 .node = WREPL_NODE_B,
4725 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4726 .ips = addresses_B_3_4_X_3_4,
4727 .apply_expected = true,
4731 .type = WREPL_TYPE_SGROUP,
4732 .state = WREPL_STATE_TOMBSTONE,
4733 .node = WREPL_NODE_B,
4735 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4736 .ips = addresses_B_3_4_X_3_4,
4737 .apply_expected = true,
4742 * This should be the last record in this array,
4743 * we need to make sure the we leave a tombstoned unique entry
4747 .line = __location__,
4748 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4752 .type = WREPL_TYPE_UNIQUE,
4753 .state = WREPL_STATE_TOMBSTONE,
4754 .node = WREPL_NODE_B,
4756 .num_ips = ARRAY_SIZE(addresses_A_1),
4757 .ips = addresses_A_1,
4758 .apply_expected = true
4762 .type = WREPL_TYPE_UNIQUE,
4763 .state = WREPL_STATE_TOMBSTONE,
4764 .node = WREPL_NODE_B,
4766 .num_ips = ARRAY_SIZE(addresses_A_1),
4767 .ips = addresses_A_1,
4768 .apply_expected = true
4770 }}; /* do not add entries here, this should be the last record! */
4772 wins_name_r1 = &wins_name1;
4773 wins_name_r2 = &wins_name2;
4775 torture_comment(tctx, "Test Replica Conflicts with different owners\n");
4777 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
4779 if (!records[i].extra && !records[i].cleanup) {
4780 /* we should test the worst cases */
4781 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
4782 torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n",
4783 __location__, i, records[i].line);
4785 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
4786 torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n",
4787 __location__, i, records[i].line);
4792 if (!records[i].cleanup) {
4793 const char *expected;
4796 if (records[i].r2.sgroup_merge) {
4797 expected = "SGROUP_MERGE";
4798 } else if (records[i].r2.apply_expected) {
4799 expected = "REPLACE";
4801 expected = "NOT REPLACE";
4804 if (!records[i].r1.ips && !records[i].r2.ips) {
4805 ips = "with no ip(s)";
4806 } else if (records[i].r1.ips==records[i].r2.ips) {
4807 ips = "with same ip(s)";
4809 ips = "with different ip(s)";
4812 torture_comment(tctx, "%s,%s%s vs. %s,%s%s %s => %s\n",
4813 wrepl_name_type_string(records[i].r1.type),
4814 wrepl_name_state_string(records[i].r1.state),
4815 (records[i].r1.is_static?",static":""),
4816 wrepl_name_type_string(records[i].r2.type),
4817 wrepl_name_state_string(records[i].r2.state),
4818 (records[i].r2.is_static?",static":""),
4819 (records[i].comment?records[i].comment:ips),
4826 wins_name_r1->name = &records[i].name;
4827 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
4828 records[i].r1.state,
4830 records[i].r1.is_static);
4831 wins_name_r1->id = ++records[i].r1.owner->max_version;
4832 if (wins_name_r1->flags & 2) {
4833 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
4834 wins_name_r1->addresses.addresses.ips = discard_const(records[i].r1.ips);
4836 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
4838 wins_name_r1->unknown = "255.255.255.255";
4841 ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1);
4842 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4843 wins_name_r1, records[i].r1.apply_expected);
4848 wins_name_r2->name = &records[i].name;
4849 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
4850 records[i].r2.state,
4852 records[i].r2.is_static);
4853 wins_name_r2->id = ++records[i].r2.owner->max_version;
4854 if (wins_name_r2->flags & 2) {
4855 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
4856 wins_name_r2->addresses.addresses.ips = discard_const(records[i].r2.ips);
4858 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
4860 wins_name_r2->unknown = "255.255.255.255";
4863 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4864 if (records[i].r1.state == WREPL_STATE_RELEASED) {
4865 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4866 wins_name_r1, false);
4867 } else if (records[i].r2.sgroup_merge) {
4868 ret &= test_wrepl_sgroup_merged(tctx, ctx, records[i].r2.merge_owner,
4869 records[i].r1.owner,
4870 records[i].r1.num_ips, records[i].r1.ips,
4871 records[i].r2.owner,
4872 records[i].r2.num_ips, records[i].r2.ips,
4874 } else if (records[i].r1.owner != records[i].r2.owner) {
4876 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
4877 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4878 wins_name_r1, _expected);
4880 if (records[i].r2.state == WREPL_STATE_RELEASED) {
4881 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner,
4882 wins_name_r2, false);
4883 } else if (!records[i].r2.sgroup_merge) {
4884 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner,
4885 wins_name_r2, records[i].r2.apply_expected);
4888 if (records[i].r2.sgroup_cleanup) {
4890 torture_comment(tctx, "failed before sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4894 /* clean up the SGROUP record */
4895 wins_name_r1->name = &records[i].name;
4896 wins_name_r1->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4898 WREPL_NODE_B, false);
4899 wins_name_r1->id = ++records[i].r1.owner->max_version;
4900 wins_name_r1->addresses.addresses.num_ips = 0;
4901 wins_name_r1->addresses.addresses.ips = NULL;
4902 wins_name_r1->unknown = "255.255.255.255";
4903 ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1);
4905 /* here we test how names from an owner are deleted */
4906 if (records[i].r2.sgroup_merge && records[i].r2.num_ips) {
4907 ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL,
4908 records[i].r2.owner,
4909 records[i].r2.num_ips, records[i].r2.ips,
4910 records[i].r1.owner,
4915 /* clean up the SGROUP record */
4916 wins_name_r2->name = &records[i].name;
4917 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4919 WREPL_NODE_B, false);
4920 wins_name_r2->id = ++records[i].r2.owner->max_version;
4921 wins_name_r2->addresses.addresses.num_ips = 0;
4922 wins_name_r2->addresses.addresses.ips = NULL;
4923 wins_name_r2->unknown = "255.255.255.255";
4924 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4926 /* take ownership of the SGROUP record */
4927 wins_name_r2->name = &records[i].name;
4928 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4930 WREPL_NODE_B, false);
4931 wins_name_r2->id = ++records[i].r2.owner->max_version;
4932 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4933 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4934 wins_name_r2->unknown = "255.255.255.255";
4935 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4936 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true);
4938 /* overwrite the SGROUP record with unique,tombstone */
4939 wins_name_r2->name = &records[i].name;
4940 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4941 WREPL_STATE_TOMBSTONE,
4942 WREPL_NODE_B, false);
4943 wins_name_r2->id = ++records[i].r2.owner->max_version;
4944 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4945 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4946 wins_name_r2->unknown = "255.255.255.255";
4947 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4948 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true);
4951 torture_comment(tctx, "failed in sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4956 /* the first one is a cleanup run */
4957 if (!ret && i == 0) ret = true;
4960 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
4968 static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx,
4969 struct test_wrepl_conflict_conn *ctx)
4973 struct wrepl_wins_name wins_name_;
4974 struct wrepl_wins_name *wins_name = &wins_name_;
4975 struct nbt_name_register name_register_;
4976 struct nbt_name_register *name_register = &name_register_;
4977 struct nbt_name_release release_;
4978 struct nbt_name_release *release = &release_;
4981 const char *line; /* just better debugging */
4982 struct nbt_name name;
4987 const struct wrepl_ip *ips;
4988 bool apply_expected;
4991 enum wrepl_name_type type;
4992 enum wrepl_name_state state;
4993 enum wrepl_name_node node;
4996 const struct wrepl_ip *ips;
4997 bool apply_expected;
5001 * unique vs. unique section
5004 * unique,released vs. unique,active with same ip(s)
5007 .line = __location__,
5008 .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL),
5012 .num_ips = ctx->addresses_best_num,
5013 .ips = ctx->addresses_best,
5014 .apply_expected = true
5017 .type = WREPL_TYPE_UNIQUE,
5018 .state = WREPL_STATE_ACTIVE,
5019 .node = WREPL_NODE_B,
5021 .num_ips = ctx->addresses_best_num,
5022 .ips = ctx->addresses_best,
5023 .apply_expected = true
5027 * unique,released vs. unique,active with different ip(s)
5030 .line = __location__,
5031 .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL),
5035 .num_ips = ctx->addresses_best_num,
5036 .ips = ctx->addresses_best,
5037 .apply_expected = true
5040 .type = WREPL_TYPE_UNIQUE,
5041 .state = WREPL_STATE_ACTIVE,
5042 .node = WREPL_NODE_B,
5044 .num_ips = ARRAY_SIZE(addresses_B_1),
5045 .ips = addresses_B_1,
5046 .apply_expected = true
5050 * unique,released vs. unique,tombstone with same ip(s)
5053 .line = __location__,
5054 .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL),
5058 .num_ips = ctx->addresses_best_num,
5059 .ips = ctx->addresses_best,
5060 .apply_expected = true
5063 .type = WREPL_TYPE_UNIQUE,
5064 .state = WREPL_STATE_TOMBSTONE,
5065 .node = WREPL_NODE_B,
5067 .num_ips = ctx->addresses_best_num,
5068 .ips = ctx->addresses_best,
5069 .apply_expected = true
5073 * unique,released vs. unique,tombstone with different ip(s)
5076 .line = __location__,
5077 .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL),
5081 .num_ips = ctx->addresses_best_num,
5082 .ips = ctx->addresses_best,
5083 .apply_expected = true
5086 .type = WREPL_TYPE_UNIQUE,
5087 .state = WREPL_STATE_TOMBSTONE,
5088 .node = WREPL_NODE_B,
5090 .num_ips = ARRAY_SIZE(addresses_B_1),
5091 .ips = addresses_B_1,
5092 .apply_expected = true
5096 * unique vs. group section
5099 * unique,released vs. group,active with same ip(s)
5102 .line = __location__,
5103 .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL),
5107 .num_ips = ctx->addresses_best_num,
5108 .ips = ctx->addresses_best,
5109 .apply_expected = true
5112 .type = WREPL_TYPE_GROUP,
5113 .state = WREPL_STATE_ACTIVE,
5114 .node = WREPL_NODE_B,
5116 .num_ips = ctx->addresses_best_num,
5117 .ips = ctx->addresses_best,
5118 .apply_expected = true
5122 * unique,released vs. group,active with different ip(s)
5125 .line = __location__,
5126 .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL),
5130 .num_ips = ctx->addresses_best_num,
5131 .ips = ctx->addresses_best,
5132 .apply_expected = true
5135 .type = WREPL_TYPE_GROUP,
5136 .state = WREPL_STATE_ACTIVE,
5137 .node = WREPL_NODE_B,
5139 .num_ips = ARRAY_SIZE(addresses_B_1),
5140 .ips = addresses_B_1,
5141 .apply_expected = true
5145 * unique,released vs. group,tombstone with same ip(s)
5148 .line = __location__,
5149 .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL),
5153 .num_ips = ctx->addresses_best_num,
5154 .ips = ctx->addresses_best,
5155 .apply_expected = true
5158 .type = WREPL_TYPE_GROUP,
5159 .state = WREPL_STATE_TOMBSTONE,
5160 .node = WREPL_NODE_B,
5162 .num_ips = ctx->addresses_best_num,
5163 .ips = ctx->addresses_best,
5164 .apply_expected = true
5168 * unique,released vs. group,tombstone with different ip(s)
5171 .line = __location__,
5172 .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL),
5176 .num_ips = ctx->addresses_best_num,
5177 .ips = ctx->addresses_best,
5178 .apply_expected = true
5181 .type = WREPL_TYPE_GROUP,
5182 .state = WREPL_STATE_TOMBSTONE,
5183 .node = WREPL_NODE_B,
5185 .num_ips = ARRAY_SIZE(addresses_B_1),
5186 .ips = addresses_B_1,
5187 .apply_expected = true
5191 * unique vs. special group section
5194 * unique,released vs. sgroup,active with same ip(s)
5197 .line = __location__,
5198 .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL),
5202 .num_ips = ctx->addresses_best_num,
5203 .ips = ctx->addresses_best,
5204 .apply_expected = true
5207 .type = WREPL_TYPE_SGROUP,
5208 .state = WREPL_STATE_ACTIVE,
5209 .node = WREPL_NODE_B,
5211 .num_ips = ctx->addresses_best_num,
5212 .ips = ctx->addresses_best,
5213 .apply_expected = true
5217 * unique,released vs. sgroup,active with different ip(s)
5220 .line = __location__,
5221 .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL),
5225 .num_ips = ctx->addresses_best_num,
5226 .ips = ctx->addresses_best,
5227 .apply_expected = true
5230 .type = WREPL_TYPE_SGROUP,
5231 .state = WREPL_STATE_ACTIVE,
5232 .node = WREPL_NODE_B,
5234 .num_ips = ARRAY_SIZE(addresses_B_1),
5235 .ips = addresses_B_1,
5236 .apply_expected = true
5240 * unique,released vs. sgroup,tombstone with same ip(s)
5243 .line = __location__,
5244 .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL),
5248 .num_ips = ctx->addresses_best_num,
5249 .ips = ctx->addresses_best,
5250 .apply_expected = true
5253 .type = WREPL_TYPE_SGROUP,
5254 .state = WREPL_STATE_TOMBSTONE,
5255 .node = WREPL_NODE_B,
5257 .num_ips = ctx->addresses_best_num,
5258 .ips = ctx->addresses_best,
5259 .apply_expected = true
5263 * unique,released vs. sgroup,tombstone with different ip(s)
5266 .line = __location__,
5267 .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL),
5271 .num_ips = ctx->addresses_best_num,
5272 .ips = ctx->addresses_best,
5273 .apply_expected = true
5276 .type = WREPL_TYPE_SGROUP,
5277 .state = WREPL_STATE_TOMBSTONE,
5278 .node = WREPL_NODE_B,
5280 .num_ips = ARRAY_SIZE(addresses_B_1),
5281 .ips = addresses_B_1,
5282 .apply_expected = true
5286 * unique vs. multi homed section
5289 * unique,released vs. mhomed,active with same ip(s)
5292 .line = __location__,
5293 .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL),
5297 .num_ips = ctx->addresses_best_num,
5298 .ips = ctx->addresses_best,
5299 .apply_expected = true
5302 .type = WREPL_TYPE_MHOMED,
5303 .state = WREPL_STATE_ACTIVE,
5304 .node = WREPL_NODE_B,
5306 .num_ips = ctx->addresses_best_num,
5307 .ips = ctx->addresses_best,
5308 .apply_expected = true
5312 * unique,released vs. mhomed,active with different ip(s)
5315 .line = __location__,
5316 .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL),
5320 .num_ips = ctx->addresses_best_num,
5321 .ips = ctx->addresses_best,
5322 .apply_expected = true
5325 .type = WREPL_TYPE_MHOMED,
5326 .state = WREPL_STATE_ACTIVE,
5327 .node = WREPL_NODE_B,
5329 .num_ips = ARRAY_SIZE(addresses_B_1),
5330 .ips = addresses_B_1,
5331 .apply_expected = true
5335 * unique,released vs. mhomed,tombstone with same ip(s)
5338 .line = __location__,
5339 .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL),
5343 .num_ips = ctx->addresses_best_num,
5344 .ips = ctx->addresses_best,
5345 .apply_expected = true
5348 .type = WREPL_TYPE_MHOMED,
5349 .state = WREPL_STATE_TOMBSTONE,
5350 .node = WREPL_NODE_B,
5352 .num_ips = ctx->addresses_best_num,
5353 .ips = ctx->addresses_best,
5354 .apply_expected = true
5358 * unique,released vs. mhomed,tombstone with different ip(s)
5361 .line = __location__,
5362 .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL),
5366 .num_ips = ctx->addresses_best_num,
5367 .ips = ctx->addresses_best,
5368 .apply_expected = true
5371 .type = WREPL_TYPE_MHOMED,
5372 .state = WREPL_STATE_TOMBSTONE,
5373 .node = WREPL_NODE_B,
5375 .num_ips = ARRAY_SIZE(addresses_B_1),
5376 .ips = addresses_B_1,
5377 .apply_expected = true
5381 * group vs. unique section
5384 * group,released vs. unique,active with same ip(s)
5387 .line = __location__,
5388 .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL),
5390 .nb_flags = NBT_NM_GROUP,
5392 .num_ips = ctx->addresses_best_num,
5393 .ips = ctx->addresses_best,
5394 .apply_expected = true
5397 .type = WREPL_TYPE_UNIQUE,
5398 .state = WREPL_STATE_ACTIVE,
5399 .node = WREPL_NODE_B,
5401 .num_ips = ctx->addresses_best_num,
5402 .ips = ctx->addresses_best,
5403 .apply_expected = false
5407 * group,released vs. unique,active with different ip(s)
5410 .line = __location__,
5411 .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL),
5413 .nb_flags = NBT_NM_GROUP,
5415 .num_ips = ctx->addresses_best_num,
5416 .ips = ctx->addresses_best,
5417 .apply_expected = true
5420 .type = WREPL_TYPE_UNIQUE,
5421 .state = WREPL_STATE_ACTIVE,
5422 .node = WREPL_NODE_B,
5424 .num_ips = ARRAY_SIZE(addresses_B_1),
5425 .ips = addresses_B_1,
5426 .apply_expected = false
5430 * group,released vs. unique,tombstone with same ip(s)
5433 .line = __location__,
5434 .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL),
5436 .nb_flags = NBT_NM_GROUP,
5438 .num_ips = ctx->addresses_best_num,
5439 .ips = ctx->addresses_best,
5440 .apply_expected = true
5443 .type = WREPL_TYPE_UNIQUE,
5444 .state = WREPL_STATE_TOMBSTONE,
5445 .node = WREPL_NODE_B,
5447 .num_ips = ctx->addresses_best_num,
5448 .ips = ctx->addresses_best,
5449 .apply_expected = false
5453 * group,released vs. unique,tombstone with different ip(s)
5456 .line = __location__,
5457 .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL),
5459 .nb_flags = NBT_NM_GROUP,
5461 .num_ips = ctx->addresses_best_num,
5462 .ips = ctx->addresses_best,
5463 .apply_expected = true
5466 .type = WREPL_TYPE_UNIQUE,
5467 .state = WREPL_STATE_TOMBSTONE,
5468 .node = WREPL_NODE_B,
5470 .num_ips = ARRAY_SIZE(addresses_B_1),
5471 .ips = addresses_B_1,
5472 .apply_expected = false
5476 * group vs. group section
5479 * group,released vs. group,active with same ip(s)
5482 .line = __location__,
5483 .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL),
5485 .nb_flags = NBT_NM_GROUP,
5487 .num_ips = ctx->addresses_best_num,
5488 .ips = ctx->addresses_best,
5489 .apply_expected = true
5492 .type = WREPL_TYPE_GROUP,
5493 .state = WREPL_STATE_ACTIVE,
5494 .node = WREPL_NODE_B,
5496 .num_ips = ctx->addresses_best_num,
5497 .ips = ctx->addresses_best,
5498 .apply_expected = true
5502 * group,released vs. group,active with different ip(s)
5505 .line = __location__,
5506 .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL),
5508 .nb_flags = NBT_NM_GROUP,
5510 .num_ips = ctx->addresses_best_num,
5511 .ips = ctx->addresses_best,
5512 .apply_expected = true
5515 .type = WREPL_TYPE_GROUP,
5516 .state = WREPL_STATE_ACTIVE,
5517 .node = WREPL_NODE_B,
5519 .num_ips = ARRAY_SIZE(addresses_B_1),
5520 .ips = addresses_B_1,
5521 .apply_expected = true
5525 * group,released vs. group,tombstone with same ip(s)
5528 .line = __location__,
5529 .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL),
5531 .nb_flags = NBT_NM_GROUP,
5533 .num_ips = ctx->addresses_best_num,
5534 .ips = ctx->addresses_best,
5535 .apply_expected = true
5538 .type = WREPL_TYPE_GROUP,
5539 .state = WREPL_STATE_TOMBSTONE,
5540 .node = WREPL_NODE_B,
5542 .num_ips = ctx->addresses_best_num,
5543 .ips = ctx->addresses_best,
5544 .apply_expected = true
5548 * group,released vs. group,tombstone with different ip(s)
5551 .line = __location__,
5552 .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL),
5554 .nb_flags = NBT_NM_GROUP,
5556 .num_ips = ctx->addresses_best_num,
5557 .ips = ctx->addresses_best,
5558 .apply_expected = true
5561 .type = WREPL_TYPE_GROUP,
5562 .state = WREPL_STATE_TOMBSTONE,
5563 .node = WREPL_NODE_B,
5565 .num_ips = ARRAY_SIZE(addresses_B_1),
5566 .ips = addresses_B_1,
5567 .apply_expected = true
5571 * group vs. special group section
5574 * group,released vs. sgroup,active with same ip(s)
5577 .line = __location__,
5578 .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL),
5580 .nb_flags = NBT_NM_GROUP,
5582 .num_ips = ctx->addresses_best_num,
5583 .ips = ctx->addresses_best,
5584 .apply_expected = true
5587 .type = WREPL_TYPE_SGROUP,
5588 .state = WREPL_STATE_ACTIVE,
5589 .node = WREPL_NODE_B,
5591 .num_ips = ctx->addresses_best_num,
5592 .ips = ctx->addresses_best,
5593 .apply_expected = false
5597 * group,released vs. sgroup,active with different ip(s)
5600 .line = __location__,
5601 .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL),
5603 .nb_flags = NBT_NM_GROUP,
5605 .num_ips = ctx->addresses_best_num,
5606 .ips = ctx->addresses_best,
5607 .apply_expected = true
5610 .type = WREPL_TYPE_SGROUP,
5611 .state = WREPL_STATE_ACTIVE,
5612 .node = WREPL_NODE_B,
5614 .num_ips = ARRAY_SIZE(addresses_B_1),
5615 .ips = addresses_B_1,
5616 .apply_expected = false
5620 * group,released vs. sgroup,tombstone with same ip(s)
5623 .line = __location__,
5624 .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL),
5626 .nb_flags = NBT_NM_GROUP,
5628 .num_ips = ctx->addresses_best_num,
5629 .ips = ctx->addresses_best,
5630 .apply_expected = true
5633 .type = WREPL_TYPE_SGROUP,
5634 .state = WREPL_STATE_TOMBSTONE,
5635 .node = WREPL_NODE_B,
5637 .num_ips = ctx->addresses_best_num,
5638 .ips = ctx->addresses_best,
5639 .apply_expected = false
5643 * group,released vs. sgroup,tombstone with different ip(s)
5646 .line = __location__,
5647 .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL),
5649 .nb_flags = NBT_NM_GROUP,
5651 .num_ips = ctx->addresses_best_num,
5652 .ips = ctx->addresses_best,
5653 .apply_expected = true
5656 .type = WREPL_TYPE_SGROUP,
5657 .state = WREPL_STATE_TOMBSTONE,
5658 .node = WREPL_NODE_B,
5660 .num_ips = ARRAY_SIZE(addresses_B_1),
5661 .ips = addresses_B_1,
5662 .apply_expected = false
5666 * group vs. multi homed section
5669 * group,released vs. mhomed,active with same ip(s)
5672 .line = __location__,
5673 .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL),
5675 .nb_flags = NBT_NM_GROUP,
5677 .num_ips = ctx->addresses_best_num,
5678 .ips = ctx->addresses_best,
5679 .apply_expected = true
5682 .type = WREPL_TYPE_MHOMED,
5683 .state = WREPL_STATE_ACTIVE,
5684 .node = WREPL_NODE_B,
5686 .num_ips = ctx->addresses_best_num,
5687 .ips = ctx->addresses_best,
5688 .apply_expected = false
5692 * group,released vs. mhomed,active with different ip(s)
5695 .line = __location__,
5696 .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL),
5698 .nb_flags = NBT_NM_GROUP,
5700 .num_ips = ctx->addresses_best_num,
5701 .ips = ctx->addresses_best,
5702 .apply_expected = true
5705 .type = WREPL_TYPE_MHOMED,
5706 .state = WREPL_STATE_ACTIVE,
5707 .node = WREPL_NODE_B,
5709 .num_ips = ARRAY_SIZE(addresses_B_1),
5710 .ips = addresses_B_1,
5711 .apply_expected = false
5715 * group,released vs. mhomed,tombstone with same ip(s)
5718 .line = __location__,
5719 .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL),
5721 .nb_flags = NBT_NM_GROUP,
5723 .num_ips = ctx->addresses_best_num,
5724 .ips = ctx->addresses_best,
5725 .apply_expected = true
5728 .type = WREPL_TYPE_MHOMED,
5729 .state = WREPL_STATE_TOMBSTONE,
5730 .node = WREPL_NODE_B,
5732 .num_ips = ctx->addresses_best_num,
5733 .ips = ctx->addresses_best,
5734 .apply_expected = false
5738 * group,released vs. mhomed,tombstone with different ip(s)
5741 .line = __location__,
5742 .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL),
5744 .nb_flags = NBT_NM_GROUP,
5746 .num_ips = ctx->addresses_best_num,
5747 .ips = ctx->addresses_best,
5748 .apply_expected = true
5751 .type = WREPL_TYPE_MHOMED,
5752 .state = WREPL_STATE_TOMBSTONE,
5753 .node = WREPL_NODE_B,
5755 .num_ips = ARRAY_SIZE(addresses_B_1),
5756 .ips = addresses_B_1,
5757 .apply_expected = false
5761 * special group vs. unique section
5764 * sgroup,released vs. unique,active with same ip(s)
5767 .line = __location__,
5768 .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL),
5770 .nb_flags = NBT_NM_GROUP,
5772 .num_ips = ctx->addresses_best_num,
5773 .ips = ctx->addresses_best,
5774 .apply_expected = true
5777 .type = WREPL_TYPE_UNIQUE,
5778 .state = WREPL_STATE_ACTIVE,
5779 .node = WREPL_NODE_B,
5781 .num_ips = ctx->addresses_best_num,
5782 .ips = ctx->addresses_best,
5783 .apply_expected = true
5787 * sgroup,released vs. unique,active with different ip(s)
5790 .line = __location__,
5791 .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL),
5793 .nb_flags = NBT_NM_GROUP,
5795 .num_ips = ctx->addresses_best_num,
5796 .ips = ctx->addresses_best,
5797 .apply_expected = true
5800 .type = WREPL_TYPE_UNIQUE,
5801 .state = WREPL_STATE_ACTIVE,
5802 .node = WREPL_NODE_B,
5804 .num_ips = ARRAY_SIZE(addresses_B_1),
5805 .ips = addresses_B_1,
5806 .apply_expected = true
5810 * sgroup,released vs. unique,tombstone with same ip(s)
5813 .line = __location__,
5814 .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL),
5816 .nb_flags = NBT_NM_GROUP,
5818 .num_ips = ctx->addresses_best_num,
5819 .ips = ctx->addresses_best,
5820 .apply_expected = true
5823 .type = WREPL_TYPE_UNIQUE,
5824 .state = WREPL_STATE_TOMBSTONE,
5825 .node = WREPL_NODE_B,
5827 .num_ips = ctx->addresses_best_num,
5828 .ips = ctx->addresses_best,
5829 .apply_expected = true
5833 * sgroup,released vs. unique,tombstone with different ip(s)
5836 .line = __location__,
5837 .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL),
5839 .nb_flags = NBT_NM_GROUP,
5841 .num_ips = ctx->addresses_best_num,
5842 .ips = ctx->addresses_best,
5843 .apply_expected = true
5846 .type = WREPL_TYPE_UNIQUE,
5847 .state = WREPL_STATE_TOMBSTONE,
5848 .node = WREPL_NODE_B,
5850 .num_ips = ARRAY_SIZE(addresses_B_1),
5851 .ips = addresses_B_1,
5852 .apply_expected = true
5856 * special group vs. group section
5859 * sgroup,released vs. group,active with same ip(s)
5862 .line = __location__,
5863 .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL),
5865 .nb_flags = NBT_NM_GROUP,
5867 .num_ips = ctx->addresses_best_num,
5868 .ips = ctx->addresses_best,
5869 .apply_expected = true
5872 .type = WREPL_TYPE_GROUP,
5873 .state = WREPL_STATE_ACTIVE,
5874 .node = WREPL_NODE_B,
5876 .num_ips = ctx->addresses_best_num,
5877 .ips = ctx->addresses_best,
5878 .apply_expected = true
5882 * sgroup,released vs. group,active with different ip(s)
5885 .line = __location__,
5886 .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL),
5888 .nb_flags = NBT_NM_GROUP,
5890 .num_ips = ctx->addresses_best_num,
5891 .ips = ctx->addresses_best,
5892 .apply_expected = true
5895 .type = WREPL_TYPE_GROUP,
5896 .state = WREPL_STATE_ACTIVE,
5897 .node = WREPL_NODE_B,
5899 .num_ips = ARRAY_SIZE(addresses_B_1),
5900 .ips = addresses_B_1,
5901 .apply_expected = true
5905 * sgroup,released vs. group,tombstone with same ip(s)
5908 .line = __location__,
5909 .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL),
5911 .nb_flags = NBT_NM_GROUP,
5913 .num_ips = ctx->addresses_best_num,
5914 .ips = ctx->addresses_best,
5915 .apply_expected = true
5918 .type = WREPL_TYPE_GROUP,
5919 .state = WREPL_STATE_TOMBSTONE,
5920 .node = WREPL_NODE_B,
5922 .num_ips = ctx->addresses_best_num,
5923 .ips = ctx->addresses_best,
5924 .apply_expected = true
5928 * sgroup,released vs. group,tombstone with different ip(s)
5931 .line = __location__,
5932 .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL),
5934 .nb_flags = NBT_NM_GROUP,
5936 .num_ips = ctx->addresses_best_num,
5937 .ips = ctx->addresses_best,
5938 .apply_expected = true
5941 .type = WREPL_TYPE_GROUP,
5942 .state = WREPL_STATE_TOMBSTONE,
5943 .node = WREPL_NODE_B,
5945 .num_ips = ARRAY_SIZE(addresses_B_1),
5946 .ips = addresses_B_1,
5947 .apply_expected = true
5951 * special group vs. special group section
5954 * sgroup,released vs. sgroup,active with same ip(s)
5957 .line = __location__,
5958 .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL),
5960 .nb_flags = NBT_NM_GROUP,
5962 .num_ips = ctx->addresses_best_num,
5963 .ips = ctx->addresses_best,
5964 .apply_expected = true
5967 .type = WREPL_TYPE_SGROUP,
5968 .state = WREPL_STATE_ACTIVE,
5969 .node = WREPL_NODE_B,
5971 .num_ips = ctx->addresses_best_num,
5972 .ips = ctx->addresses_best,
5973 .apply_expected = true
5977 * sgroup,released vs. sgroup,active with different ip(s)
5980 .line = __location__,
5981 .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL),
5983 .nb_flags = NBT_NM_GROUP,
5985 .num_ips = ctx->addresses_best_num,
5986 .ips = ctx->addresses_best,
5987 .apply_expected = true
5990 .type = WREPL_TYPE_SGROUP,
5991 .state = WREPL_STATE_ACTIVE,
5992 .node = WREPL_NODE_B,
5994 .num_ips = ARRAY_SIZE(addresses_B_1),
5995 .ips = addresses_B_1,
5996 .apply_expected = true
6000 * sgroup,released vs. sgroup,tombstone with same ip(s)
6003 .line = __location__,
6004 .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL),
6006 .nb_flags = NBT_NM_GROUP,
6008 .num_ips = ctx->addresses_best_num,
6009 .ips = ctx->addresses_best,
6010 .apply_expected = true
6013 .type = WREPL_TYPE_SGROUP,
6014 .state = WREPL_STATE_TOMBSTONE,
6015 .node = WREPL_NODE_B,
6017 .num_ips = ctx->addresses_best_num,
6018 .ips = ctx->addresses_best,
6019 .apply_expected = true
6023 * sgroup,released vs. sgroup,tombstone with different ip(s)
6026 .line = __location__,
6027 .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL),
6029 .nb_flags = NBT_NM_GROUP,
6031 .num_ips = ctx->addresses_best_num,
6032 .ips = ctx->addresses_best,
6033 .apply_expected = true
6036 .type = WREPL_TYPE_SGROUP,
6037 .state = WREPL_STATE_TOMBSTONE,
6038 .node = WREPL_NODE_B,
6040 .num_ips = ARRAY_SIZE(addresses_B_1),
6041 .ips = addresses_B_1,
6042 .apply_expected = true
6046 * special group vs. multi homed section
6049 * sgroup,released vs. mhomed,active with same ip(s)
6052 .line = __location__,
6053 .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL),
6055 .nb_flags = NBT_NM_GROUP,
6057 .num_ips = ctx->addresses_best_num,
6058 .ips = ctx->addresses_best,
6059 .apply_expected = true
6062 .type = WREPL_TYPE_MHOMED,
6063 .state = WREPL_STATE_ACTIVE,
6064 .node = WREPL_NODE_B,
6066 .num_ips = ctx->addresses_best_num,
6067 .ips = ctx->addresses_best,
6068 .apply_expected = true
6072 * sgroup,released vs. mhomed,active with different ip(s)
6075 .line = __location__,
6076 .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL),
6078 .nb_flags = NBT_NM_GROUP,
6080 .num_ips = ctx->addresses_best_num,
6081 .ips = ctx->addresses_best,
6082 .apply_expected = true
6085 .type = WREPL_TYPE_MHOMED,
6086 .state = WREPL_STATE_ACTIVE,
6087 .node = WREPL_NODE_B,
6089 .num_ips = ARRAY_SIZE(addresses_B_1),
6090 .ips = addresses_B_1,
6091 .apply_expected = true
6095 * sgroup,released vs. mhomed,tombstone with same ip(s)
6098 .line = __location__,
6099 .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL),
6101 .nb_flags = NBT_NM_GROUP,
6103 .num_ips = ctx->addresses_best_num,
6104 .ips = ctx->addresses_best,
6105 .apply_expected = true
6108 .type = WREPL_TYPE_MHOMED,
6109 .state = WREPL_STATE_TOMBSTONE,
6110 .node = WREPL_NODE_B,
6112 .num_ips = ctx->addresses_best_num,
6113 .ips = ctx->addresses_best,
6114 .apply_expected = true
6118 * sgroup,released vs. mhomed,tombstone with different ip(s)
6121 .line = __location__,
6122 .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL),
6124 .nb_flags = NBT_NM_GROUP,
6126 .num_ips = ctx->addresses_best_num,
6127 .ips = ctx->addresses_best,
6128 .apply_expected = true
6131 .type = WREPL_TYPE_MHOMED,
6132 .state = WREPL_STATE_TOMBSTONE,
6133 .node = WREPL_NODE_B,
6135 .num_ips = ARRAY_SIZE(addresses_B_1),
6136 .ips = addresses_B_1,
6137 .apply_expected = true
6141 * multi homed vs. unique section
6144 * mhomed,released vs. unique,active with same ip(s)
6147 .line = __location__,
6148 .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL),
6152 .num_ips = ctx->addresses_best_num,
6153 .ips = ctx->addresses_best,
6154 .apply_expected = true
6157 .type = WREPL_TYPE_UNIQUE,
6158 .state = WREPL_STATE_ACTIVE,
6159 .node = WREPL_NODE_B,
6161 .num_ips = ctx->addresses_best_num,
6162 .ips = ctx->addresses_best,
6163 .apply_expected = true
6167 * mhomed,released vs. unique,active with different ip(s)
6170 .line = __location__,
6171 .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL),
6175 .num_ips = ctx->addresses_best_num,
6176 .ips = ctx->addresses_best,
6177 .apply_expected = true
6180 .type = WREPL_TYPE_UNIQUE,
6181 .state = WREPL_STATE_ACTIVE,
6182 .node = WREPL_NODE_B,
6184 .num_ips = ARRAY_SIZE(addresses_B_1),
6185 .ips = addresses_B_1,
6186 .apply_expected = true
6190 * mhomed,released vs. unique,tombstone with same ip(s)
6193 .line = __location__,
6194 .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL),
6198 .num_ips = ctx->addresses_best_num,
6199 .ips = ctx->addresses_best,
6200 .apply_expected = true
6203 .type = WREPL_TYPE_UNIQUE,
6204 .state = WREPL_STATE_TOMBSTONE,
6205 .node = WREPL_NODE_B,
6207 .num_ips = ctx->addresses_best_num,
6208 .ips = ctx->addresses_best,
6209 .apply_expected = true
6213 * mhomed,released vs. unique,tombstone with different ip(s)
6216 .line = __location__,
6217 .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL),
6221 .num_ips = ctx->addresses_best_num,
6222 .ips = ctx->addresses_best,
6223 .apply_expected = true
6226 .type = WREPL_TYPE_UNIQUE,
6227 .state = WREPL_STATE_TOMBSTONE,
6228 .node = WREPL_NODE_B,
6230 .num_ips = ARRAY_SIZE(addresses_B_1),
6231 .ips = addresses_B_1,
6232 .apply_expected = true
6236 * multi homed vs. group section
6239 * mhomed,released vs. group,active with same ip(s)
6242 .line = __location__,
6243 .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL),
6247 .num_ips = ctx->addresses_best_num,
6248 .ips = ctx->addresses_best,
6249 .apply_expected = true
6252 .type = WREPL_TYPE_GROUP,
6253 .state = WREPL_STATE_ACTIVE,
6254 .node = WREPL_NODE_B,
6256 .num_ips = ctx->addresses_best_num,
6257 .ips = ctx->addresses_best,
6258 .apply_expected = true
6262 * mhomed,released vs. group,active with different ip(s)
6265 .line = __location__,
6266 .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL),
6270 .num_ips = ctx->addresses_best_num,
6271 .ips = ctx->addresses_best,
6272 .apply_expected = true
6275 .type = WREPL_TYPE_GROUP,
6276 .state = WREPL_STATE_ACTIVE,
6277 .node = WREPL_NODE_B,
6279 .num_ips = ARRAY_SIZE(addresses_B_1),
6280 .ips = addresses_B_1,
6281 .apply_expected = true
6285 * mhomed,released vs. group,tombstone with same ip(s)
6288 .line = __location__,
6289 .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL),
6293 .num_ips = ctx->addresses_best_num,
6294 .ips = ctx->addresses_best,
6295 .apply_expected = true
6298 .type = WREPL_TYPE_GROUP,
6299 .state = WREPL_STATE_TOMBSTONE,
6300 .node = WREPL_NODE_B,
6302 .num_ips = ctx->addresses_best_num,
6303 .ips = ctx->addresses_best,
6304 .apply_expected = true
6308 * mhomed,released vs. group,tombstone with different ip(s)
6311 .line = __location__,
6312 .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL),
6316 .num_ips = ctx->addresses_best_num,
6317 .ips = ctx->addresses_best,
6318 .apply_expected = true
6321 .type = WREPL_TYPE_GROUP,
6322 .state = WREPL_STATE_TOMBSTONE,
6323 .node = WREPL_NODE_B,
6325 .num_ips = ARRAY_SIZE(addresses_B_1),
6326 .ips = addresses_B_1,
6327 .apply_expected = true
6331 * multi homed vs. special group section
6334 * mhomed,released vs. sgroup,active with same ip(s)
6337 .line = __location__,
6338 .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL),
6342 .num_ips = ctx->addresses_best_num,
6343 .ips = ctx->addresses_best,
6344 .apply_expected = true
6347 .type = WREPL_TYPE_SGROUP,
6348 .state = WREPL_STATE_ACTIVE,
6349 .node = WREPL_NODE_B,
6351 .num_ips = ctx->addresses_best_num,
6352 .ips = ctx->addresses_best,
6353 .apply_expected = true
6357 * mhomed,released vs. sgroup,active with different ip(s)
6360 .line = __location__,
6361 .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL),
6365 .num_ips = ctx->addresses_best_num,
6366 .ips = ctx->addresses_best,
6367 .apply_expected = true
6370 .type = WREPL_TYPE_SGROUP,
6371 .state = WREPL_STATE_ACTIVE,
6372 .node = WREPL_NODE_B,
6374 .num_ips = ARRAY_SIZE(addresses_B_1),
6375 .ips = addresses_B_1,
6376 .apply_expected = true
6380 * mhomed,released vs. sgroup,tombstone with same ip(s)
6383 .line = __location__,
6384 .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL),
6388 .num_ips = ctx->addresses_best_num,
6389 .ips = ctx->addresses_best,
6390 .apply_expected = true
6393 .type = WREPL_TYPE_SGROUP,
6394 .state = WREPL_STATE_TOMBSTONE,
6395 .node = WREPL_NODE_B,
6397 .num_ips = ctx->addresses_best_num,
6398 .ips = ctx->addresses_best,
6399 .apply_expected = true
6403 * mhomed,released vs. sgroup,tombstone with different ip(s)
6406 .line = __location__,
6407 .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL),
6411 .num_ips = ctx->addresses_best_num,
6412 .ips = ctx->addresses_best,
6413 .apply_expected = true
6416 .type = WREPL_TYPE_SGROUP,
6417 .state = WREPL_STATE_TOMBSTONE,
6418 .node = WREPL_NODE_B,
6420 .num_ips = ARRAY_SIZE(addresses_B_1),
6421 .ips = addresses_B_1,
6422 .apply_expected = true
6426 * multi homed vs. multi homed section
6429 * mhomed,released vs. mhomed,active with same ip(s)
6432 .line = __location__,
6433 .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL),
6437 .num_ips = ctx->addresses_best_num,
6438 .ips = ctx->addresses_best,
6439 .apply_expected = true
6442 .type = WREPL_TYPE_MHOMED,
6443 .state = WREPL_STATE_ACTIVE,
6444 .node = WREPL_NODE_B,
6446 .num_ips = ctx->addresses_best_num,
6447 .ips = ctx->addresses_best,
6448 .apply_expected = true
6452 * mhomed,released vs. mhomed,active with different ip(s)
6455 .line = __location__,
6456 .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL),
6460 .num_ips = ctx->addresses_best_num,
6461 .ips = ctx->addresses_best,
6462 .apply_expected = true
6465 .type = WREPL_TYPE_MHOMED,
6466 .state = WREPL_STATE_ACTIVE,
6467 .node = WREPL_NODE_B,
6469 .num_ips = ARRAY_SIZE(addresses_B_1),
6470 .ips = addresses_B_1,
6471 .apply_expected = true
6475 * mhomed,released vs. mhomed,tombstone with same ip(s)
6478 .line = __location__,
6479 .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL),
6483 .num_ips = ctx->addresses_best_num,
6484 .ips = ctx->addresses_best,
6485 .apply_expected = true
6488 .type = WREPL_TYPE_MHOMED,
6489 .state = WREPL_STATE_TOMBSTONE,
6490 .node = WREPL_NODE_B,
6492 .num_ips = ctx->addresses_best_num,
6493 .ips = ctx->addresses_best,
6494 .apply_expected = true
6498 * mhomed,released vs. mhomed,tombstone with different ip(s)
6501 .line = __location__,
6502 .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL),
6506 .num_ips = ctx->addresses_best_num,
6507 .ips = ctx->addresses_best,
6508 .apply_expected = true
6511 .type = WREPL_TYPE_MHOMED,
6512 .state = WREPL_STATE_TOMBSTONE,
6513 .node = WREPL_NODE_B,
6515 .num_ips = ARRAY_SIZE(addresses_B_1),
6516 .ips = addresses_B_1,
6517 .apply_expected = true
6522 torture_comment(tctx, "Test Replica records vs. owned released records\n");
6524 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
6525 torture_comment(tctx, "%s => %s\n", nbt_name_string(ctx, &records[i].name),
6526 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
6531 name_register->in.name = records[i].name;
6532 name_register->in.dest_addr = ctx->address;
6533 name_register->in.address = records[i].wins.ips[0].ip;
6534 name_register->in.nb_flags = records[i].wins.nb_flags;
6535 name_register->in.register_demand= false;
6536 name_register->in.broadcast = false;
6537 name_register->in.multi_homed = records[i].wins.mhomed;
6538 name_register->in.ttl = 300000;
6539 name_register->in.timeout = 70;
6540 name_register->in.retries = 0;
6542 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
6543 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6544 torture_comment(tctx, "No response from %s for name register\n", ctx->address);
6547 if (!NT_STATUS_IS_OK(status)) {
6548 torture_comment(tctx, "Bad response from %s for name register - %s\n",
6549 ctx->address, nt_errstr(status));
6552 CHECK_VALUE(tctx, name_register->out.rcode, 0);
6553 CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address);
6554 CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type);
6555 CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name);
6556 CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope);
6557 CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[0].ip);
6559 /* release the record */
6560 release->in.name = records[i].name;
6561 release->in.dest_addr = ctx->address;
6562 release->in.address = records[i].wins.ips[0].ip;
6563 release->in.nb_flags = records[i].wins.nb_flags;
6564 release->in.broadcast = false;
6565 release->in.timeout = 30;
6566 release->in.retries = 0;
6568 status = nbt_name_release(ctx->nbtsock, ctx, release);
6569 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6570 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
6573 if (!NT_STATUS_IS_OK(status)) {
6574 torture_comment(tctx, "Bad response from %s for name query - %s\n",
6575 ctx->address, nt_errstr(status));
6578 CHECK_VALUE(tctx, release->out.rcode, 0);
6583 wins_name->name = &records[i].name;
6584 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
6585 records[i].replica.state,
6586 records[i].replica.node,
6587 records[i].replica.is_static);
6588 wins_name->id = ++ctx->b.max_version;
6589 if (wins_name->flags & 2) {
6590 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
6591 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
6593 wins_name->addresses.ip = records[i].replica.ips[0].ip;
6595 wins_name->unknown = "255.255.255.255";
6597 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
6598 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name,
6599 records[i].replica.apply_expected);
6601 if (records[i].replica.apply_expected) {
6602 wins_name->name = &records[i].name;
6603 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
6604 WREPL_STATE_TOMBSTONE,
6605 WREPL_NODE_B, false);
6606 wins_name->id = ++ctx->b.max_version;
6607 wins_name->addresses.ip = addresses_B_1[0].ip;
6608 wins_name->unknown = "255.255.255.255";
6610 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
6611 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
6613 release->in.name = records[i].name;
6614 release->in.dest_addr = ctx->address;
6615 release->in.address = records[i].wins.ips[0].ip;
6616 release->in.nb_flags = records[i].wins.nb_flags;
6617 release->in.broadcast = false;
6618 release->in.timeout = 30;
6619 release->in.retries = 0;
6621 status = nbt_name_release(ctx->nbtsock, ctx, release);
6622 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6623 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
6626 if (!NT_STATUS_IS_OK(status)) {
6627 torture_comment(tctx, "Bad response from %s for name query - %s\n",
6628 ctx->address, nt_errstr(status));
6631 CHECK_VALUE(tctx, release->out.rcode, 0);
6634 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
6642 struct test_conflict_owned_active_vs_replica_struct {
6643 const char *line; /* just better debugging */
6644 const char *section; /* just better debugging */
6645 struct nbt_name name;
6646 const char *comment;
6652 const struct wrepl_ip *ips;
6653 bool apply_expected;
6658 bool expect_release;
6661 /* when num_ips == 0, then .wins.ips are used */
6663 const struct wrepl_ip *ips;
6666 enum wrepl_name_type type;
6667 enum wrepl_name_state state;
6668 enum wrepl_name_node node;
6671 const struct wrepl_ip *ips;
6672 bool apply_expected;
6678 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
6679 struct nbt_name_packet *req_packet,
6680 struct socket_address *src);
6682 static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx,
6683 struct test_wrepl_conflict_conn *ctx)
6687 struct wrepl_wins_name wins_name_;
6688 struct wrepl_wins_name *wins_name = &wins_name_;
6689 struct nbt_name_register name_register_;
6690 struct nbt_name_register *name_register = &name_register_;
6691 struct nbt_name_release release_;
6692 struct nbt_name_release *release = &release_;
6694 struct test_conflict_owned_active_vs_replica_struct records[] = {
6696 * unique vs. unique section
6698 #if METZE_NEEDS_TO_LOOK_AT_THIS_ONE
6700 * unique,active vs. unique,active with same ip(s), unchecked
6703 .line = __location__,
6704 .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL),
6708 .num_ips = ctx->addresses_best_num,
6709 .ips = ctx->addresses_best,
6710 .apply_expected = true
6716 .type = WREPL_TYPE_UNIQUE,
6717 .state = WREPL_STATE_ACTIVE,
6718 .node = WREPL_NODE_B,
6720 .num_ips = ctx->addresses_best_num,
6721 .ips = ctx->addresses_best,
6722 .apply_expected = true
6727 * unique,active vs. unique,active with different ip(s), positive response
6730 .line = __location__,
6731 .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL),
6735 .num_ips = ctx->addresses_best_num,
6736 .ips = ctx->addresses_best,
6737 .apply_expected = true
6744 .type = WREPL_TYPE_UNIQUE,
6745 .state = WREPL_STATE_ACTIVE,
6746 .node = WREPL_NODE_B,
6748 .num_ips = ARRAY_SIZE(addresses_B_1),
6749 .ips = addresses_B_1,
6750 .apply_expected = false
6754 * unique,active vs. unique,active with different ip(s), positive response other ips
6757 .line = __location__,
6758 .name = _NBT_NAME("_UA_UA_DI_O", 0x00, NULL),
6762 .num_ips = ctx->addresses_best_num,
6763 .ips = ctx->addresses_best,
6764 .apply_expected = true
6769 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6770 .ips = addresses_A_3_4,
6773 .type = WREPL_TYPE_UNIQUE,
6774 .state = WREPL_STATE_ACTIVE,
6775 .node = WREPL_NODE_B,
6777 .num_ips = ARRAY_SIZE(addresses_B_1),
6778 .ips = addresses_B_1,
6779 .apply_expected = false
6783 * unique,active vs. unique,active with different ip(s), negative response
6786 .line = __location__,
6787 .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL),
6791 .num_ips = ctx->addresses_best_num,
6792 .ips = ctx->addresses_best,
6793 .apply_expected = true
6800 .type = WREPL_TYPE_UNIQUE,
6801 .state = WREPL_STATE_ACTIVE,
6802 .node = WREPL_NODE_B,
6804 .num_ips = ARRAY_SIZE(addresses_B_1),
6805 .ips = addresses_B_1,
6806 .apply_expected = true
6810 * unique,active vs. unique,tombstone with same ip(s), unchecked
6813 .line = __location__,
6814 .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL),
6818 .num_ips = ctx->addresses_best_num,
6819 .ips = ctx->addresses_best,
6820 .apply_expected = true
6826 .type = WREPL_TYPE_UNIQUE,
6827 .state = WREPL_STATE_TOMBSTONE,
6828 .node = WREPL_NODE_B,
6830 .num_ips = ctx->addresses_best_num,
6831 .ips = ctx->addresses_best,
6832 .apply_expected = false
6836 * unique,active vs. unique,tombstone with different ip(s), unchecked
6839 .line = __location__,
6840 .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL),
6844 .num_ips = ctx->addresses_best_num,
6845 .ips = ctx->addresses_best,
6846 .apply_expected = true
6852 .type = WREPL_TYPE_UNIQUE,
6853 .state = WREPL_STATE_TOMBSTONE,
6854 .node = WREPL_NODE_B,
6856 .num_ips = ARRAY_SIZE(addresses_B_1),
6857 .ips = addresses_B_1,
6858 .apply_expected = false
6862 * unique vs. group section
6865 * unique,active vs. group,active with same ip(s), release expected
6868 .line = __location__,
6869 .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL),
6873 .num_ips = ctx->addresses_best_num,
6874 .ips = ctx->addresses_best,
6875 .apply_expected = true
6879 .expect_release = true,
6882 .type = WREPL_TYPE_GROUP,
6883 .state = WREPL_STATE_ACTIVE,
6884 .node = WREPL_NODE_B,
6886 .num_ips = ctx->addresses_best_num,
6887 .ips = ctx->addresses_best,
6888 .apply_expected = true
6892 * unique,active vs. group,active with different ip(s), release expected
6895 .line = __location__,
6896 .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL),
6900 .num_ips = ctx->addresses_best_num,
6901 .ips = ctx->addresses_best,
6902 .apply_expected = true
6906 .expect_release = true,
6909 .type = WREPL_TYPE_GROUP,
6910 .state = WREPL_STATE_ACTIVE,
6911 .node = WREPL_NODE_B,
6913 .num_ips = ARRAY_SIZE(addresses_B_1),
6914 .ips = addresses_B_1,
6915 .apply_expected = true
6919 * unique,active vs. group,tombstone with same ip(s), unchecked
6922 .line = __location__,
6923 .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL),
6927 .num_ips = ctx->addresses_best_num,
6928 .ips = ctx->addresses_best,
6929 .apply_expected = true
6935 .type = WREPL_TYPE_GROUP,
6936 .state = WREPL_STATE_TOMBSTONE,
6937 .node = WREPL_NODE_B,
6939 .num_ips = ctx->addresses_best_num,
6940 .ips = ctx->addresses_best,
6941 .apply_expected = false
6945 * unique,active vs. group,tombstone with different ip(s), unchecked
6948 .line = __location__,
6949 .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL),
6953 .num_ips = ctx->addresses_best_num,
6954 .ips = ctx->addresses_best,
6955 .apply_expected = true
6961 .type = WREPL_TYPE_GROUP,
6962 .state = WREPL_STATE_TOMBSTONE,
6963 .node = WREPL_NODE_B,
6965 .num_ips = ARRAY_SIZE(addresses_B_1),
6966 .ips = addresses_B_1,
6967 .apply_expected = false
6971 * unique vs. special group section
6974 * unique,active vs. sgroup,active with same ip(s), release expected
6977 .line = __location__,
6978 .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL),
6982 .num_ips = ctx->addresses_best_num,
6983 .ips = ctx->addresses_best,
6984 .apply_expected = true
6988 .expect_release = true,
6991 .type = WREPL_TYPE_SGROUP,
6992 .state = WREPL_STATE_ACTIVE,
6993 .node = WREPL_NODE_B,
6995 .num_ips = ctx->addresses_best_num,
6996 .ips = ctx->addresses_best,
6997 .apply_expected = true
7001 * unique,active vs. group,active with different ip(s), release expected
7004 .line = __location__,
7005 .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL),
7009 .num_ips = ctx->addresses_best_num,
7010 .ips = ctx->addresses_best,
7011 .apply_expected = true
7015 .expect_release = true,
7018 .type = WREPL_TYPE_SGROUP,
7019 .state = WREPL_STATE_ACTIVE,
7020 .node = WREPL_NODE_B,
7022 .num_ips = ARRAY_SIZE(addresses_B_1),
7023 .ips = addresses_B_1,
7024 .apply_expected = true
7028 * unique,active vs. sgroup,tombstone with same ip(s), unchecked
7031 .line = __location__,
7032 .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL),
7036 .num_ips = ctx->addresses_best_num,
7037 .ips = ctx->addresses_best,
7038 .apply_expected = true
7044 .type = WREPL_TYPE_SGROUP,
7045 .state = WREPL_STATE_TOMBSTONE,
7046 .node = WREPL_NODE_B,
7048 .num_ips = ctx->addresses_best_num,
7049 .ips = ctx->addresses_best,
7050 .apply_expected = false
7054 * unique,active vs. sgroup,tombstone with different ip(s), unchecked
7057 .line = __location__,
7058 .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL),
7062 .num_ips = ctx->addresses_best_num,
7063 .ips = ctx->addresses_best,
7064 .apply_expected = true
7070 .type = WREPL_TYPE_SGROUP,
7071 .state = WREPL_STATE_TOMBSTONE,
7072 .node = WREPL_NODE_B,
7074 .num_ips = ARRAY_SIZE(addresses_B_1),
7075 .ips = addresses_B_1,
7076 .apply_expected = false
7080 * unique vs. multi homed section
7083 * unique,active vs. mhomed,active with same ip(s), unchecked
7086 .line = __location__,
7087 .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL),
7091 .num_ips = ctx->addresses_best_num,
7092 .ips = ctx->addresses_best,
7093 .apply_expected = true
7099 .type = WREPL_TYPE_MHOMED,
7100 .state = WREPL_STATE_ACTIVE,
7101 .node = WREPL_NODE_B,
7103 .num_ips = ctx->addresses_best_num,
7104 .ips = ctx->addresses_best,
7105 .apply_expected = true
7109 * unique,active vs. mhomed,active with superset ip(s), unchecked
7112 .line = __location__,
7113 .name = _NBT_NAME("_UA_MA_SP_U", 0x00, NULL),
7117 .num_ips = ctx->addresses_best_num,
7118 .ips = ctx->addresses_best,
7119 .apply_expected = true
7125 .type = WREPL_TYPE_MHOMED,
7126 .state = WREPL_STATE_ACTIVE,
7127 .node = WREPL_NODE_B,
7129 .num_ips = ctx->addresses_all_num,
7130 .ips = ctx->addresses_all,
7131 .apply_expected = true
7135 * unique,active vs. mhomed,active with different ip(s), positive response
7138 .line = __location__,
7139 .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL),
7143 .num_ips = ctx->addresses_best_num,
7144 .ips = ctx->addresses_best,
7145 .apply_expected = true
7152 .type = WREPL_TYPE_MHOMED,
7153 .state = WREPL_STATE_ACTIVE,
7154 .node = WREPL_NODE_B,
7156 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7157 .ips = addresses_B_3_4,
7158 .apply_expected = false
7162 * unique,active vs. mhomed,active with different ip(s), positive response other ips
7165 .line = __location__,
7166 .name = _NBT_NAME("_UA_MA_DI_O", 0x00, NULL),
7170 .num_ips = ctx->addresses_best_num,
7171 .ips = ctx->addresses_best,
7172 .apply_expected = true
7177 .num_ips = ARRAY_SIZE(addresses_A_3_4),
7178 .ips = addresses_A_3_4,
7181 .type = WREPL_TYPE_MHOMED,
7182 .state = WREPL_STATE_ACTIVE,
7183 .node = WREPL_NODE_B,
7185 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7186 .ips = addresses_B_3_4,
7187 .apply_expected = false
7191 * unique,active vs. mhomed,active with different ip(s), negative response
7194 .line = __location__,
7195 .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL),
7199 .num_ips = ctx->addresses_best_num,
7200 .ips = ctx->addresses_best,
7201 .apply_expected = true
7208 .type = WREPL_TYPE_MHOMED,
7209 .state = WREPL_STATE_ACTIVE,
7210 .node = WREPL_NODE_B,
7212 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7213 .ips = addresses_B_3_4,
7214 .apply_expected = true
7218 * unique,active vs. mhomed,tombstone with same ip(s), unchecked
7221 .line = __location__,
7222 .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL),
7226 .num_ips = ctx->addresses_best_num,
7227 .ips = ctx->addresses_best,
7228 .apply_expected = true
7234 .type = WREPL_TYPE_MHOMED,
7235 .state = WREPL_STATE_TOMBSTONE,
7236 .node = WREPL_NODE_B,
7238 .num_ips = ctx->addresses_best_num,
7239 .ips = ctx->addresses_best,
7240 .apply_expected = false
7244 * unique,active vs. mhomed,tombstone with different ip(s), unchecked
7247 .line = __location__,
7248 .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL),
7252 .num_ips = ctx->addresses_best_num,
7253 .ips = ctx->addresses_best,
7254 .apply_expected = true
7260 .type = WREPL_TYPE_MHOMED,
7261 .state = WREPL_STATE_TOMBSTONE,
7262 .node = WREPL_NODE_B,
7264 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7265 .ips = addresses_B_3_4,
7266 .apply_expected = false
7270 * normal group vs. unique section
7273 * group,active vs. unique,active with same ip(s), unchecked
7276 .line = __location__,
7277 .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL),
7279 .nb_flags = NBT_NM_GROUP,
7281 .num_ips = ctx->addresses_best_num,
7282 .ips = ctx->addresses_best,
7283 .apply_expected = true
7289 .type = WREPL_TYPE_UNIQUE,
7290 .state = WREPL_STATE_ACTIVE,
7291 .node = WREPL_NODE_B,
7293 .num_ips = ctx->addresses_best_num,
7294 .ips = ctx->addresses_best,
7295 .apply_expected = false
7299 * group,active vs. unique,active with different ip(s), unchecked
7302 .line = __location__,
7303 .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL),
7305 .nb_flags = NBT_NM_GROUP,
7307 .num_ips = ctx->addresses_best_num,
7308 .ips = ctx->addresses_best,
7309 .apply_expected = true
7315 .type = WREPL_TYPE_UNIQUE,
7316 .state = WREPL_STATE_ACTIVE,
7317 .node = WREPL_NODE_B,
7319 .num_ips = ARRAY_SIZE(addresses_B_1),
7320 .ips = addresses_B_1,
7321 .apply_expected = false
7325 * group,active vs. unique,tombstone with same ip(s), unchecked
7328 .line = __location__,
7329 .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL),
7331 .nb_flags = NBT_NM_GROUP,
7333 .num_ips = ctx->addresses_best_num,
7334 .ips = ctx->addresses_best,
7335 .apply_expected = true
7341 .type = WREPL_TYPE_UNIQUE,
7342 .state = WREPL_STATE_TOMBSTONE,
7343 .node = WREPL_NODE_B,
7345 .num_ips = ctx->addresses_best_num,
7346 .ips = ctx->addresses_best,
7347 .apply_expected = false
7351 * group,active vs. unique,tombstone with different ip(s), unchecked
7354 .line = __location__,
7355 .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL),
7357 .nb_flags = NBT_NM_GROUP,
7359 .num_ips = ctx->addresses_best_num,
7360 .ips = ctx->addresses_best,
7361 .apply_expected = true
7367 .type = WREPL_TYPE_UNIQUE,
7368 .state = WREPL_STATE_TOMBSTONE,
7369 .node = WREPL_NODE_B,
7371 .num_ips = ARRAY_SIZE(addresses_B_1),
7372 .ips = addresses_B_1,
7373 .apply_expected = false
7377 * normal group vs. normal group section
7380 * group,active vs. group,active with same ip(s), unchecked
7383 .line = __location__,
7384 .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL),
7386 .nb_flags = NBT_NM_GROUP,
7388 .num_ips = ctx->addresses_best_num,
7389 .ips = ctx->addresses_best,
7390 .apply_expected = true
7396 .type = WREPL_TYPE_GROUP,
7397 .state = WREPL_STATE_ACTIVE,
7398 .node = WREPL_NODE_B,
7400 .num_ips = ctx->addresses_best_num,
7401 .ips = ctx->addresses_best,
7402 .apply_expected = true
7406 * group,active vs. group,active with different ip(s), unchecked
7409 .line = __location__,
7410 .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL),
7412 .nb_flags = NBT_NM_GROUP,
7414 .num_ips = ctx->addresses_best_num,
7415 .ips = ctx->addresses_best,
7416 .apply_expected = true
7422 .type = WREPL_TYPE_GROUP,
7423 .state = WREPL_STATE_ACTIVE,
7424 .node = WREPL_NODE_B,
7426 .num_ips = ARRAY_SIZE(addresses_B_1),
7427 .ips = addresses_B_1,
7428 .apply_expected = true
7432 * group,active vs. group,tombstone with same ip(s), unchecked
7435 .line = __location__,
7436 .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL),
7438 .nb_flags = NBT_NM_GROUP,
7440 .num_ips = ctx->addresses_best_num,
7441 .ips = ctx->addresses_best,
7442 .apply_expected = true
7448 .type = WREPL_TYPE_GROUP,
7449 .state = WREPL_STATE_TOMBSTONE,
7450 .node = WREPL_NODE_B,
7452 .num_ips = ctx->addresses_best_num,
7453 .ips = ctx->addresses_best,
7454 .apply_expected = false
7458 * group,active vs. group,tombstone with different ip(s), unchecked
7461 .line = __location__,
7462 .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL),
7464 .nb_flags = NBT_NM_GROUP,
7466 .num_ips = ctx->addresses_best_num,
7467 .ips = ctx->addresses_best,
7468 .apply_expected = true
7474 .type = WREPL_TYPE_GROUP,
7475 .state = WREPL_STATE_TOMBSTONE,
7476 .node = WREPL_NODE_B,
7478 .num_ips = ARRAY_SIZE(addresses_B_1),
7479 .ips = addresses_B_1,
7480 .apply_expected = false
7484 * normal group vs. special group section
7487 * group,active vs. sgroup,active with same ip(s), unchecked
7490 .line = __location__,
7491 .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL),
7493 .nb_flags = NBT_NM_GROUP,
7495 .num_ips = ctx->addresses_best_num,
7496 .ips = ctx->addresses_best,
7497 .apply_expected = true
7503 .type = WREPL_TYPE_SGROUP,
7504 .state = WREPL_STATE_ACTIVE,
7505 .node = WREPL_NODE_B,
7507 .num_ips = ctx->addresses_best_num,
7508 .ips = ctx->addresses_best,
7509 .apply_expected = false
7513 * group,active vs. sgroup,active with different ip(s), unchecked
7516 .line = __location__,
7517 .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL),
7519 .nb_flags = NBT_NM_GROUP,
7521 .num_ips = ctx->addresses_best_num,
7522 .ips = ctx->addresses_best,
7523 .apply_expected = true
7529 .type = WREPL_TYPE_SGROUP,
7530 .state = WREPL_STATE_ACTIVE,
7531 .node = WREPL_NODE_B,
7533 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7534 .ips = addresses_B_3_4,
7535 .apply_expected = false
7539 * group,active vs. sgroup,tombstone with same ip(s), unchecked
7542 .line = __location__,
7543 .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL),
7545 .nb_flags = NBT_NM_GROUP,
7547 .num_ips = ctx->addresses_best_num,
7548 .ips = ctx->addresses_best,
7549 .apply_expected = true
7555 .type = WREPL_TYPE_SGROUP,
7556 .state = WREPL_STATE_TOMBSTONE,
7557 .node = WREPL_NODE_B,
7559 .num_ips = ctx->addresses_best_num,
7560 .ips = ctx->addresses_best,
7561 .apply_expected = false
7565 * group,active vs. sgroup,tombstone with different ip(s), unchecked
7568 .line = __location__,
7569 .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL),
7571 .nb_flags = NBT_NM_GROUP,
7573 .num_ips = ctx->addresses_best_num,
7574 .ips = ctx->addresses_best,
7575 .apply_expected = true
7581 .type = WREPL_TYPE_SGROUP,
7582 .state = WREPL_STATE_TOMBSTONE,
7583 .node = WREPL_NODE_B,
7585 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7586 .ips = addresses_B_3_4,
7587 .apply_expected = false
7591 * normal group vs. multi homed section
7594 * group,active vs. mhomed,active with same ip(s), unchecked
7597 .line = __location__,
7598 .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL),
7600 .nb_flags = NBT_NM_GROUP,
7602 .num_ips = ctx->addresses_best_num,
7603 .ips = ctx->addresses_best,
7604 .apply_expected = true
7610 .type = WREPL_TYPE_MHOMED,
7611 .state = WREPL_STATE_ACTIVE,
7612 .node = WREPL_NODE_B,
7614 .num_ips = ctx->addresses_best_num,
7615 .ips = ctx->addresses_best,
7616 .apply_expected = false
7620 * group,active vs. mhomed,active with different ip(s), unchecked
7623 .line = __location__,
7624 .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL),
7626 .nb_flags = NBT_NM_GROUP,
7628 .num_ips = ctx->addresses_best_num,
7629 .ips = ctx->addresses_best,
7630 .apply_expected = true
7636 .type = WREPL_TYPE_MHOMED,
7637 .state = WREPL_STATE_ACTIVE,
7638 .node = WREPL_NODE_B,
7640 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7641 .ips = addresses_B_3_4,
7642 .apply_expected = false
7646 * group,active vs. mhomed,tombstone with same ip(s), unchecked
7649 .line = __location__,
7650 .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL),
7652 .nb_flags = NBT_NM_GROUP,
7654 .num_ips = ctx->addresses_best_num,
7655 .ips = ctx->addresses_best,
7656 .apply_expected = true
7662 .type = WREPL_TYPE_MHOMED,
7663 .state = WREPL_STATE_TOMBSTONE,
7664 .node = WREPL_NODE_B,
7666 .num_ips = ctx->addresses_best_num,
7667 .ips = ctx->addresses_best,
7668 .apply_expected = false
7672 * group,active vs. mhomed,tombstone with different ip(s), unchecked
7675 .line = __location__,
7676 .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL),
7678 .nb_flags = NBT_NM_GROUP,
7680 .num_ips = ctx->addresses_best_num,
7681 .ips = ctx->addresses_best,
7682 .apply_expected = true
7688 .type = WREPL_TYPE_MHOMED,
7689 .state = WREPL_STATE_TOMBSTONE,
7690 .node = WREPL_NODE_B,
7692 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7693 .ips = addresses_B_3_4,
7694 .apply_expected = false
7698 * special group vs. unique section
7701 * sgroup,active vs. unique,active with same ip(s), unchecked
7704 .line = __location__,
7705 .name = _NBT_NAME("_SA_UA_SI_U", 0x1C, NULL),
7707 .nb_flags = NBT_NM_GROUP,
7709 .num_ips = ctx->addresses_best_num,
7710 .ips = ctx->addresses_best,
7711 .apply_expected = true
7717 .type = WREPL_TYPE_UNIQUE,
7718 .state = WREPL_STATE_ACTIVE,
7719 .node = WREPL_NODE_B,
7721 .num_ips = ctx->addresses_best_num,
7722 .ips = ctx->addresses_best,
7723 .apply_expected = false
7727 * sgroup,active vs. unique,active with different ip(s), unchecked
7730 .line = __location__,
7731 .name = _NBT_NAME("_SA_UA_DI_U", 0x1C, NULL),
7733 .nb_flags = NBT_NM_GROUP,
7735 .num_ips = ctx->addresses_best_num,
7736 .ips = ctx->addresses_best,
7737 .apply_expected = true
7743 .type = WREPL_TYPE_UNIQUE,
7744 .state = WREPL_STATE_ACTIVE,
7745 .node = WREPL_NODE_B,
7747 .num_ips = ARRAY_SIZE(addresses_B_1),
7748 .ips = addresses_B_1,
7749 .apply_expected = false
7753 * sgroup,active vs. unique,tombstone with same ip(s), unchecked
7756 .line = __location__,
7757 .name = _NBT_NAME("_SA_UT_SI_U", 0x1C, NULL),
7759 .nb_flags = NBT_NM_GROUP,
7761 .num_ips = ctx->addresses_best_num,
7762 .ips = ctx->addresses_best,
7763 .apply_expected = true
7769 .type = WREPL_TYPE_UNIQUE,
7770 .state = WREPL_STATE_TOMBSTONE,
7771 .node = WREPL_NODE_B,
7773 .num_ips = ctx->addresses_best_num,
7774 .ips = ctx->addresses_best,
7775 .apply_expected = false
7779 * sgroup,active vs. unique,tombstone with different ip(s), unchecked
7782 .line = __location__,
7783 .name = _NBT_NAME("_SA_UT_DI_U", 0x1C, NULL),
7785 .nb_flags = NBT_NM_GROUP,
7787 .num_ips = ctx->addresses_best_num,
7788 .ips = ctx->addresses_best,
7789 .apply_expected = true
7795 .type = WREPL_TYPE_UNIQUE,
7796 .state = WREPL_STATE_TOMBSTONE,
7797 .node = WREPL_NODE_B,
7799 .num_ips = ARRAY_SIZE(addresses_B_1),
7800 .ips = addresses_B_1,
7801 .apply_expected = false
7805 * special group vs. normal group section
7808 * sgroup,active vs. group,active with same ip(s), unchecked
7811 .line = __location__,
7812 .name = _NBT_NAME("_SA_GA_SI_U", 0x1C, NULL),
7814 .nb_flags = NBT_NM_GROUP,
7816 .num_ips = ctx->addresses_best_num,
7817 .ips = ctx->addresses_best,
7818 .apply_expected = true
7824 .type = WREPL_TYPE_GROUP,
7825 .state = WREPL_STATE_ACTIVE,
7826 .node = WREPL_NODE_B,
7828 .num_ips = ctx->addresses_best_num,
7829 .ips = ctx->addresses_best,
7830 .apply_expected = false
7834 * sgroup,active vs. group,active with different ip(s), unchecked
7837 .line = __location__,
7838 .name = _NBT_NAME("_SA_GA_DI_U", 0x1C, NULL),
7840 .nb_flags = NBT_NM_GROUP,
7842 .num_ips = ctx->addresses_best_num,
7843 .ips = ctx->addresses_best,
7844 .apply_expected = true
7850 .type = WREPL_TYPE_GROUP,
7851 .state = WREPL_STATE_ACTIVE,
7852 .node = WREPL_NODE_B,
7854 .num_ips = ARRAY_SIZE(addresses_B_1),
7855 .ips = addresses_B_1,
7856 .apply_expected = false
7860 * sgroup,active vs. group,tombstone with same ip(s), unchecked
7863 .line = __location__,
7864 .name = _NBT_NAME("_SA_GT_SI_U", 0x1C, NULL),
7866 .nb_flags = NBT_NM_GROUP,
7868 .num_ips = ctx->addresses_best_num,
7869 .ips = ctx->addresses_best,
7870 .apply_expected = true
7876 .type = WREPL_TYPE_GROUP,
7877 .state = WREPL_STATE_TOMBSTONE,
7878 .node = WREPL_NODE_B,
7880 .num_ips = ctx->addresses_best_num,
7881 .ips = ctx->addresses_best,
7882 .apply_expected = false
7886 * sgroup,active vs. group,tombstone with different ip(s), unchecked
7889 .line = __location__,
7890 .name = _NBT_NAME("_SA_GT_DI_U", 0x1C, NULL),
7892 .nb_flags = NBT_NM_GROUP,
7894 .num_ips = ctx->addresses_best_num,
7895 .ips = ctx->addresses_best,
7896 .apply_expected = true
7902 .type = WREPL_TYPE_GROUP,
7903 .state = WREPL_STATE_TOMBSTONE,
7904 .node = WREPL_NODE_B,
7906 .num_ips = ARRAY_SIZE(addresses_B_1),
7907 .ips = addresses_B_1,
7908 .apply_expected = false
7912 * special group vs. multi homed section
7915 * sgroup,active vs. mhomed,active with same ip(s), unchecked
7918 .line = __location__,
7919 .name = _NBT_NAME("_SA_MA_SI_U", 0x1C, NULL),
7921 .nb_flags = NBT_NM_GROUP,
7923 .num_ips = ctx->addresses_best_num,
7924 .ips = ctx->addresses_best,
7925 .apply_expected = true
7931 .type = WREPL_TYPE_MHOMED,
7932 .state = WREPL_STATE_ACTIVE,
7933 .node = WREPL_NODE_B,
7935 .num_ips = ctx->addresses_best_num,
7936 .ips = ctx->addresses_best,
7937 .apply_expected = false
7941 * sgroup,active vs. mhomed,active with different ip(s), unchecked
7944 .line = __location__,
7945 .name = _NBT_NAME("_SA_MA_DI_U", 0x1C, NULL),
7947 .nb_flags = NBT_NM_GROUP,
7949 .num_ips = ctx->addresses_best_num,
7950 .ips = ctx->addresses_best,
7951 .apply_expected = true
7957 .type = WREPL_TYPE_MHOMED,
7958 .state = WREPL_STATE_ACTIVE,
7959 .node = WREPL_NODE_B,
7961 .num_ips = ARRAY_SIZE(addresses_B_1),
7962 .ips = addresses_B_1,
7963 .apply_expected = false
7967 * sgroup,active vs. mhomed,tombstone with same ip(s), unchecked
7970 .line = __location__,
7971 .name = _NBT_NAME("_SA_MT_SI_U", 0x1C, NULL),
7973 .nb_flags = NBT_NM_GROUP,
7975 .num_ips = ctx->addresses_best_num,
7976 .ips = ctx->addresses_best,
7977 .apply_expected = true
7983 .type = WREPL_TYPE_MHOMED,
7984 .state = WREPL_STATE_TOMBSTONE,
7985 .node = WREPL_NODE_B,
7987 .num_ips = ctx->addresses_best_num,
7988 .ips = ctx->addresses_best,
7989 .apply_expected = false
7993 * sgroup,active vs. mhomed,tombstone with different ip(s), unchecked
7996 .line = __location__,
7997 .name = _NBT_NAME("_SA_MT_DI_U", 0x1C, NULL),
7999 .nb_flags = NBT_NM_GROUP,
8001 .num_ips = ctx->addresses_best_num,
8002 .ips = ctx->addresses_best,
8003 .apply_expected = true
8009 .type = WREPL_TYPE_MHOMED,
8010 .state = WREPL_STATE_TOMBSTONE,
8011 .node = WREPL_NODE_B,
8013 .num_ips = ARRAY_SIZE(addresses_B_1),
8014 .ips = addresses_B_1,
8015 .apply_expected = false
8019 * multi homed vs. unique section
8022 * mhomed,active vs. unique,active with same ip(s), unchecked
8025 .line = __location__,
8026 .name = _NBT_NAME("_MA_UA_SI_U", 0x00, NULL),
8030 .num_ips = ctx->addresses_best_num,
8031 .ips = ctx->addresses_best,
8032 .apply_expected = true
8038 .type = WREPL_TYPE_UNIQUE,
8039 .state = WREPL_STATE_ACTIVE,
8040 .node = WREPL_NODE_B,
8042 .num_ips = ctx->addresses_best_num,
8043 .ips = ctx->addresses_best,
8044 .apply_expected = true
8048 * mhomed,active vs. unique,active with different ip(s), positive response
8051 .line = __location__,
8052 .name = _NBT_NAME("_MA_UA_DI_P", 0x00, NULL),
8056 .num_ips = ctx->addresses_best_num,
8057 .ips = ctx->addresses_best,
8058 .apply_expected = true
8065 .type = WREPL_TYPE_UNIQUE,
8066 .state = WREPL_STATE_ACTIVE,
8067 .node = WREPL_NODE_B,
8069 .num_ips = ARRAY_SIZE(addresses_B_1),
8070 .ips = addresses_B_1,
8071 .apply_expected = false
8075 * mhomed,active vs. unique,active with different ip(s), positive response other ips
8078 .line = __location__,
8079 .name = _NBT_NAME("_MA_UA_DI_O", 0x00, NULL),
8083 .num_ips = ctx->addresses_best_num,
8084 .ips = ctx->addresses_best,
8085 .apply_expected = true
8090 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8091 .ips = addresses_A_3_4,
8094 .type = WREPL_TYPE_UNIQUE,
8095 .state = WREPL_STATE_ACTIVE,
8096 .node = WREPL_NODE_B,
8098 .num_ips = ARRAY_SIZE(addresses_B_1),
8099 .ips = addresses_B_1,
8100 .apply_expected = false
8104 * mhomed,active vs. unique,active with different ip(s), negative response
8107 .line = __location__,
8108 .name = _NBT_NAME("_MA_UA_DI_N", 0x00, NULL),
8112 .num_ips = ctx->addresses_best_num,
8113 .ips = ctx->addresses_best,
8114 .apply_expected = true
8121 .type = WREPL_TYPE_UNIQUE,
8122 .state = WREPL_STATE_ACTIVE,
8123 .node = WREPL_NODE_B,
8125 .num_ips = ARRAY_SIZE(addresses_B_1),
8126 .ips = addresses_B_1,
8127 .apply_expected = true
8131 * mhomed,active vs. unique,tombstone with same ip(s), unchecked
8134 .line = __location__,
8135 .name = _NBT_NAME("_MA_UT_SI_U", 0x00, NULL),
8139 .num_ips = ctx->addresses_best_num,
8140 .ips = ctx->addresses_best,
8141 .apply_expected = true
8147 .type = WREPL_TYPE_UNIQUE,
8148 .state = WREPL_STATE_TOMBSTONE,
8149 .node = WREPL_NODE_B,
8151 .num_ips = ctx->addresses_best_num,
8152 .ips = ctx->addresses_best,
8153 .apply_expected = false
8157 * mhomed,active vs. unique,tombstone with different ip(s), unchecked
8160 .line = __location__,
8161 .name = _NBT_NAME("_MA_UT_DI_U", 0x00, NULL),
8165 .num_ips = ctx->addresses_best_num,
8166 .ips = ctx->addresses_best,
8167 .apply_expected = true
8173 .type = WREPL_TYPE_UNIQUE,
8174 .state = WREPL_STATE_TOMBSTONE,
8175 .node = WREPL_NODE_B,
8177 .num_ips = ARRAY_SIZE(addresses_B_1),
8178 .ips = addresses_B_1,
8179 .apply_expected = false
8183 * multi homed vs. normal group section
8186 * mhomed,active vs. group,active with same ip(s), release expected
8189 .line = __location__,
8190 .name = _NBT_NAME("_MA_GA_SI_R", 0x00, NULL),
8194 .num_ips = ctx->addresses_best_num,
8195 .ips = ctx->addresses_best,
8196 .apply_expected = true
8200 .expect_release = true,
8203 .type = WREPL_TYPE_GROUP,
8204 .state = WREPL_STATE_ACTIVE,
8205 .node = WREPL_NODE_B,
8207 .num_ips = ctx->addresses_best_num,
8208 .ips = ctx->addresses_best,
8209 .apply_expected = true
8213 * mhomed,active vs. group,active with different ip(s), release expected
8216 .line = __location__,
8217 .name = _NBT_NAME("_MA_GA_DI_R", 0x00, NULL),
8221 .num_ips = ctx->addresses_best_num,
8222 .ips = ctx->addresses_best,
8223 .apply_expected = true
8227 .expect_release = true,
8230 .type = WREPL_TYPE_GROUP,
8231 .state = WREPL_STATE_ACTIVE,
8232 .node = WREPL_NODE_B,
8234 .num_ips = ARRAY_SIZE(addresses_B_1),
8235 .ips = addresses_B_1,
8236 .apply_expected = true
8240 * mhomed,active vs. group,tombstone with same ip(s), unchecked
8243 .line = __location__,
8244 .name = _NBT_NAME("_MA_GT_SI_U", 0x00, NULL),
8248 .num_ips = ctx->addresses_best_num,
8249 .ips = ctx->addresses_best,
8250 .apply_expected = true
8256 .type = WREPL_TYPE_GROUP,
8257 .state = WREPL_STATE_TOMBSTONE,
8258 .node = WREPL_NODE_B,
8260 .num_ips = ctx->addresses_best_num,
8261 .ips = ctx->addresses_best,
8262 .apply_expected = false
8266 * mhomed,active vs. group,tombstone with different ip(s), unchecked
8269 .line = __location__,
8270 .name = _NBT_NAME("_MA_GT_DI_U", 0x00, NULL),
8274 .num_ips = ctx->addresses_best_num,
8275 .ips = ctx->addresses_best,
8276 .apply_expected = true
8282 .type = WREPL_TYPE_GROUP,
8283 .state = WREPL_STATE_TOMBSTONE,
8284 .node = WREPL_NODE_B,
8286 .num_ips = ARRAY_SIZE(addresses_B_1),
8287 .ips = addresses_B_1,
8288 .apply_expected = false
8292 * multi homed vs. special group section
8295 * mhomed,active vs. sgroup,active with same ip(s), release expected
8298 .line = __location__,
8299 .name = _NBT_NAME("_MA_SA_SI_R", 0x00, NULL),
8303 .num_ips = ctx->addresses_best_num,
8304 .ips = ctx->addresses_best,
8305 .apply_expected = true
8309 .expect_release = true,
8312 .type = WREPL_TYPE_SGROUP,
8313 .state = WREPL_STATE_ACTIVE,
8314 .node = WREPL_NODE_B,
8316 .num_ips = ctx->addresses_best_num,
8317 .ips = ctx->addresses_best,
8318 .apply_expected = true
8322 * mhomed,active vs. group,active with different ip(s), release expected
8325 .line = __location__,
8326 .name = _NBT_NAME("_MA_SA_DI_R", 0x00, NULL),
8330 .num_ips = ctx->addresses_best_num,
8331 .ips = ctx->addresses_best,
8332 .apply_expected = true
8336 .expect_release = true,
8339 .type = WREPL_TYPE_SGROUP,
8340 .state = WREPL_STATE_ACTIVE,
8341 .node = WREPL_NODE_B,
8343 .num_ips = ARRAY_SIZE(addresses_B_1),
8344 .ips = addresses_B_1,
8345 .apply_expected = true
8349 * mhomed,active vs. sgroup,tombstone with same ip(s), unchecked
8352 .line = __location__,
8353 .name = _NBT_NAME("_MA_ST_SI_U", 0x00, NULL),
8357 .num_ips = ctx->addresses_best_num,
8358 .ips = ctx->addresses_best,
8359 .apply_expected = true
8365 .type = WREPL_TYPE_SGROUP,
8366 .state = WREPL_STATE_TOMBSTONE,
8367 .node = WREPL_NODE_B,
8369 .num_ips = ctx->addresses_best_num,
8370 .ips = ctx->addresses_best,
8371 .apply_expected = false
8375 * mhomed,active vs. sgroup,tombstone with different ip(s), unchecked
8378 .line = __location__,
8379 .name = _NBT_NAME("_MA_ST_DI_U", 0x00, NULL),
8383 .num_ips = ctx->addresses_best_num,
8384 .ips = ctx->addresses_best,
8385 .apply_expected = true
8391 .type = WREPL_TYPE_SGROUP,
8392 .state = WREPL_STATE_TOMBSTONE,
8393 .node = WREPL_NODE_B,
8395 .num_ips = ARRAY_SIZE(addresses_B_1),
8396 .ips = addresses_B_1,
8397 .apply_expected = false
8401 * multi homed vs. multi homed section
8404 * mhomed,active vs. mhomed,active with same ip(s), unchecked
8407 .line = __location__,
8408 .name = _NBT_NAME("_MA_MA_SI_U", 0x00, NULL),
8412 .num_ips = ctx->addresses_best_num,
8413 .ips = ctx->addresses_best,
8414 .apply_expected = true
8420 .type = WREPL_TYPE_MHOMED,
8421 .state = WREPL_STATE_ACTIVE,
8422 .node = WREPL_NODE_B,
8424 .num_ips = ctx->addresses_best_num,
8425 .ips = ctx->addresses_best,
8426 .apply_expected = true
8430 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8433 .line = __location__,
8434 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8438 .num_ips = ctx->addresses_best_num,
8439 .ips = ctx->addresses_best,
8440 .apply_expected = true
8446 .type = WREPL_TYPE_MHOMED,
8447 .state = WREPL_STATE_ACTIVE,
8448 .node = WREPL_NODE_B,
8450 .num_ips = ctx->addresses_all_num,
8451 .ips = ctx->addresses_all,
8452 .apply_expected = true
8456 * mhomed,active vs. mhomed,active with different ip(s), positive response
8459 .line = __location__,
8460 .name = _NBT_NAME("_MA_MA_DI_P", 0x00, NULL),
8464 .num_ips = ctx->addresses_best_num,
8465 .ips = ctx->addresses_best,
8466 .apply_expected = true
8473 .type = WREPL_TYPE_MHOMED,
8474 .state = WREPL_STATE_ACTIVE,
8475 .node = WREPL_NODE_B,
8477 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8478 .ips = addresses_B_3_4,
8479 .apply_expected = false
8483 * mhomed,active vs. mhomed,active with different ip(s), positive response other ips
8486 .line = __location__,
8487 .name = _NBT_NAME("_MA_MA_DI_O", 0x00, NULL),
8491 .num_ips = ctx->addresses_best_num,
8492 .ips = ctx->addresses_best,
8493 .apply_expected = true
8498 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8499 .ips = addresses_A_3_4,
8502 .type = WREPL_TYPE_MHOMED,
8503 .state = WREPL_STATE_ACTIVE,
8504 .node = WREPL_NODE_B,
8506 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8507 .ips = addresses_B_3_4,
8508 .apply_expected = false
8512 * mhomed,active vs. mhomed,active with different ip(s), negative response
8515 .line = __location__,
8516 .name = _NBT_NAME("_MA_MA_DI_N", 0x00, NULL),
8520 .num_ips = ctx->addresses_best_num,
8521 .ips = ctx->addresses_best,
8522 .apply_expected = true
8529 .type = WREPL_TYPE_MHOMED,
8530 .state = WREPL_STATE_ACTIVE,
8531 .node = WREPL_NODE_B,
8533 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8534 .ips = addresses_B_3_4,
8535 .apply_expected = true
8539 * mhomed,active vs. mhomed,tombstone with same ip(s), unchecked
8542 .line = __location__,
8543 .name = _NBT_NAME("_MA_MT_SI_U", 0x00, NULL),
8547 .num_ips = ctx->addresses_best_num,
8548 .ips = ctx->addresses_best,
8549 .apply_expected = true
8555 .type = WREPL_TYPE_MHOMED,
8556 .state = WREPL_STATE_TOMBSTONE,
8557 .node = WREPL_NODE_B,
8559 .num_ips = ctx->addresses_best_num,
8560 .ips = ctx->addresses_best,
8561 .apply_expected = false
8565 * mhomed,active vs. mhomed,tombstone with different ip(s), unchecked
8568 .line = __location__,
8569 .name = _NBT_NAME("_MA_MT_DI_U", 0x00, NULL),
8573 .num_ips = ctx->addresses_best_num,
8574 .ips = ctx->addresses_best,
8575 .apply_expected = true
8581 .type = WREPL_TYPE_MHOMED,
8582 .state = WREPL_STATE_TOMBSTONE,
8583 .node = WREPL_NODE_B,
8585 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8586 .ips = addresses_B_3_4,
8587 .apply_expected = false
8591 * some more multi homed test, including merging
8594 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8597 .line = __location__,
8598 .section= "Test Replica vs. owned active: some more MHOMED combinations",
8599 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8600 .comment= "C:MHOMED vs. B:ALL => B:ALL",
8601 .skip = (ctx->addresses_all_num < 3),
8605 .num_ips = ctx->addresses_mhomed_num,
8606 .ips = ctx->addresses_mhomed,
8607 .apply_expected = true
8613 .type = WREPL_TYPE_MHOMED,
8614 .state = WREPL_STATE_ACTIVE,
8615 .node = WREPL_NODE_B,
8617 .num_ips = ctx->addresses_all_num,
8618 .ips = ctx->addresses_all,
8619 .apply_expected = true
8623 * mhomed,active vs. mhomed,active with same ips, unchecked
8626 .line = __location__,
8627 .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL),
8628 .comment= "C:MHOMED vs. B:MHOMED => B:MHOMED",
8629 .skip = (ctx->addresses_mhomed_num < 2),
8633 .num_ips = ctx->addresses_mhomed_num,
8634 .ips = ctx->addresses_mhomed,
8635 .apply_expected = true
8641 .type = WREPL_TYPE_MHOMED,
8642 .state = WREPL_STATE_ACTIVE,
8643 .node = WREPL_NODE_B,
8645 .num_ips = ctx->addresses_mhomed_num,
8646 .ips = ctx->addresses_mhomed,
8647 .apply_expected = true
8651 * mhomed,active vs. mhomed,active with subset ip(s), positive response
8654 .line = __location__,
8655 .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL),
8656 .comment= "C:MHOMED vs. B:BEST (C:MHOMED) => B:MHOMED",
8657 .skip = (ctx->addresses_mhomed_num < 2),
8661 .num_ips = ctx->addresses_mhomed_num,
8662 .ips = ctx->addresses_mhomed,
8663 .apply_expected = true
8670 .type = WREPL_TYPE_MHOMED,
8671 .state = WREPL_STATE_ACTIVE,
8672 .node = WREPL_NODE_B,
8674 .num_ips = ctx->addresses_best_num,
8675 .ips = ctx->addresses_best,
8676 .mhomed_merge = true
8680 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with all addresses
8683 .line = __location__,
8684 .name = _NBT_NAME("_MA_MA_SB_A", 0x00, NULL),
8685 .comment= "C:MHOMED vs. B:BEST (C:ALL) => B:MHOMED",
8686 .skip = (ctx->addresses_all_num < 3),
8690 .num_ips = ctx->addresses_mhomed_num,
8691 .ips = ctx->addresses_mhomed,
8692 .apply_expected = true
8697 .num_ips = ctx->addresses_all_num,
8698 .ips = ctx->addresses_all,
8701 .type = WREPL_TYPE_MHOMED,
8702 .state = WREPL_STATE_ACTIVE,
8703 .node = WREPL_NODE_B,
8705 .num_ips = ctx->addresses_best_num,
8706 .ips = ctx->addresses_best,
8707 .mhomed_merge = true
8711 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with replicas addresses
8712 * TODO: check why the server sends a name release demand for one address?
8713 * the release demand has no effect to the database record...
8716 .line = __location__,
8717 .name = _NBT_NAME("_MA_MA_SB_PRA", 0x00, NULL),
8718 .comment= "C:MHOMED vs. B:BEST (C:BEST) => C:MHOMED",
8719 .skip = (ctx->addresses_all_num < 2),
8723 .num_ips = ctx->addresses_mhomed_num,
8724 .ips = ctx->addresses_mhomed,
8725 .apply_expected = true
8730 .num_ips = ctx->addresses_best_num,
8731 .ips = ctx->addresses_best,
8732 .late_release = true
8735 .type = WREPL_TYPE_MHOMED,
8736 .state = WREPL_STATE_ACTIVE,
8737 .node = WREPL_NODE_B,
8739 .num_ips = ctx->addresses_best_num,
8740 .ips = ctx->addresses_best,
8741 .apply_expected = false
8745 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with other addresses
8748 .line = __location__,
8749 .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL),
8750 .comment= "C:MHOMED vs. B:BEST (B:B_3_4) =>C:MHOMED",
8751 .skip = (ctx->addresses_all_num < 2),
8755 .num_ips = ctx->addresses_mhomed_num,
8756 .ips = ctx->addresses_mhomed,
8757 .apply_expected = true
8762 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8763 .ips = addresses_B_3_4,
8766 .type = WREPL_TYPE_MHOMED,
8767 .state = WREPL_STATE_ACTIVE,
8768 .node = WREPL_NODE_B,
8770 .num_ips = ctx->addresses_best_num,
8771 .ips = ctx->addresses_best,
8772 .apply_expected = false
8776 * mhomed,active vs. mhomed,active with subset ip(s), negative response
8779 .line = __location__,
8780 .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL),
8781 .comment= "C:MHOMED vs. B:BEST (NEGATIVE) => B:BEST",
8782 .skip = (ctx->addresses_mhomed_num < 2),
8786 .num_ips = ctx->addresses_mhomed_num,
8787 .ips = ctx->addresses_mhomed,
8788 .apply_expected = true
8795 .type = WREPL_TYPE_MHOMED,
8796 .state = WREPL_STATE_ACTIVE,
8797 .node = WREPL_NODE_B,
8799 .num_ips = ctx->addresses_best_num,
8800 .ips = ctx->addresses_best,
8801 .apply_expected = true
8805 * some more multi homed and unique test, including merging
8808 * mhomed,active vs. unique,active with subset ip(s), positive response
8811 .line = __location__,
8812 .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations",
8813 .name = _NBT_NAME("_MA_UA_SB_P", 0x00, NULL),
8814 .comment= "C:MHOMED vs. B:UNIQUE,BEST (C:MHOMED) => B:MHOMED",
8815 .skip = (ctx->addresses_all_num < 2),
8819 .num_ips = ctx->addresses_mhomed_num,
8820 .ips = ctx->addresses_mhomed,
8821 .apply_expected = true
8828 .type = WREPL_TYPE_UNIQUE,
8829 .state = WREPL_STATE_ACTIVE,
8830 .node = WREPL_NODE_B,
8832 .num_ips = ctx->addresses_best_num,
8833 .ips = ctx->addresses_best,
8834 .mhomed_merge = true
8838 * unique,active vs. unique,active with different ip(s), positive response, with replicas address
8839 * TODO: check why the server sends a name release demand for one address?
8840 * the release demand has no effect to the database record...
8843 .line = __location__,
8844 .name = _NBT_NAME("_UA_UA_DI_PRA", 0x00, NULL),
8845 .comment= "C:BEST vs. B:BEST2 (C:BEST2,LR:BEST2) => C:BEST",
8846 .skip = (ctx->addresses_all_num < 2),
8850 .num_ips = ctx->addresses_best_num,
8851 .ips = ctx->addresses_best,
8852 .apply_expected = true
8857 .num_ips = ctx->addresses_best2_num,
8858 .ips = ctx->addresses_best2,
8859 .late_release = true
8862 .type = WREPL_TYPE_UNIQUE,
8863 .state = WREPL_STATE_ACTIVE,
8864 .node = WREPL_NODE_B,
8866 .num_ips = ctx->addresses_best2_num,
8867 .ips = ctx->addresses_best2,
8868 .apply_expected = false,
8872 * unique,active vs. unique,active with different ip(s), positive response, with all addresses
8875 .line = __location__,
8876 .name = _NBT_NAME("_UA_UA_DI_A", 0x00, NULL),
8877 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
8878 .skip = (ctx->addresses_all_num < 3),
8882 .num_ips = ctx->addresses_best_num,
8883 .ips = ctx->addresses_best,
8884 .apply_expected = true
8889 .num_ips = ctx->addresses_all_num,
8890 .ips = ctx->addresses_all,
8893 .type = WREPL_TYPE_UNIQUE,
8894 .state = WREPL_STATE_ACTIVE,
8895 .node = WREPL_NODE_B,
8897 .num_ips = ctx->addresses_best2_num,
8898 .ips = ctx->addresses_best2,
8899 .mhomed_merge = true,
8903 * unique,active vs. mhomed,active with different ip(s), positive response, with all addresses
8906 .line = __location__,
8907 .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL),
8908 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
8909 .skip = (ctx->addresses_all_num < 3),
8913 .num_ips = ctx->addresses_best_num,
8914 .ips = ctx->addresses_best,
8915 .apply_expected = true
8920 .num_ips = ctx->addresses_all_num,
8921 .ips = ctx->addresses_all,
8924 .type = WREPL_TYPE_MHOMED,
8925 .state = WREPL_STATE_ACTIVE,
8926 .node = WREPL_NODE_B,
8928 .num_ips = ctx->addresses_best2_num,
8929 .ips = ctx->addresses_best2,
8930 .mhomed_merge = true,
8934 * special group vs. special group merging section
8937 * sgroup,active vs. sgroup,active with different ip(s)
8940 .line = __location__,
8941 .section= "Test Replica vs. owned active: SGROUP vs. SGROUP tests",
8942 .name = _NBT_NAME("_SA_SA_DI_U", 0x1C, NULL),
8943 .skip = (ctx->addresses_all_num < 3),
8945 .nb_flags = NBT_NM_GROUP,
8947 .num_ips = ctx->addresses_mhomed_num,
8948 .ips = ctx->addresses_mhomed,
8949 .apply_expected = true
8955 .type = WREPL_TYPE_SGROUP,
8956 .state = WREPL_STATE_ACTIVE,
8957 .node = WREPL_NODE_B,
8959 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8960 .ips = addresses_B_3_4,
8961 .sgroup_merge = true
8966 * sgroup,active vs. sgroup,active with same ip(s)
8969 .line = __location__,
8970 .name = _NBT_NAME("_SA_SA_SI_U", 0x1C, NULL),
8971 .skip = (ctx->addresses_all_num < 3),
8973 .nb_flags = NBT_NM_GROUP,
8975 .num_ips = ctx->addresses_mhomed_num,
8976 .ips = ctx->addresses_mhomed,
8977 .apply_expected = true
8983 .type = WREPL_TYPE_SGROUP,
8984 .state = WREPL_STATE_ACTIVE,
8985 .node = WREPL_NODE_B,
8987 .num_ips = ctx->addresses_mhomed_num,
8988 .ips = ctx->addresses_mhomed,
8989 .sgroup_merge = true
8993 * sgroup,active vs. sgroup,active with superset ip(s)
8996 .line = __location__,
8997 .name = _NBT_NAME("_SA_SA_SP_U", 0x1C, NULL),
8998 .skip = (ctx->addresses_all_num < 3),
9000 .nb_flags = NBT_NM_GROUP,
9002 .num_ips = ctx->addresses_mhomed_num,
9003 .ips = ctx->addresses_mhomed,
9004 .apply_expected = true
9010 .type = WREPL_TYPE_SGROUP,
9011 .state = WREPL_STATE_ACTIVE,
9012 .node = WREPL_NODE_B,
9014 .num_ips = ctx->addresses_all_num,
9015 .ips = ctx->addresses_all,
9016 .sgroup_merge = true
9020 * sgroup,active vs. sgroup,active with subset ip(s)
9023 .line = __location__,
9024 .name = _NBT_NAME("_SA_SA_SB_U", 0x1C, NULL),
9025 .skip = (ctx->addresses_all_num < 3),
9027 .nb_flags = NBT_NM_GROUP,
9029 .num_ips = ctx->addresses_mhomed_num,
9030 .ips = ctx->addresses_mhomed,
9031 .apply_expected = true
9037 .type = WREPL_TYPE_SGROUP,
9038 .state = WREPL_STATE_ACTIVE,
9039 .node = WREPL_NODE_B,
9041 .num_ips = ctx->addresses_best_num,
9042 .ips = ctx->addresses_best,
9043 .sgroup_merge = true
9047 * sgroup,active vs. sgroup,tombstone with different ip(s)
9050 .line = __location__,
9051 .name = _NBT_NAME("_SA_ST_DI_U", 0x1C, NULL),
9052 .skip = (ctx->addresses_all_num < 3),
9054 .nb_flags = NBT_NM_GROUP,
9056 .num_ips = ctx->addresses_mhomed_num,
9057 .ips = ctx->addresses_mhomed,
9058 .apply_expected = true
9064 .type = WREPL_TYPE_SGROUP,
9065 .state = WREPL_STATE_TOMBSTONE,
9066 .node = WREPL_NODE_B,
9068 .num_ips = ARRAY_SIZE(addresses_B_3_4),
9069 .ips = addresses_B_3_4,
9070 .apply_expected = false
9074 * sgroup,active vs. sgroup,tombstone with same ip(s)
9077 .line = __location__,
9078 .name = _NBT_NAME("_SA_ST_SI_U", 0x1C, NULL),
9079 .skip = (ctx->addresses_all_num < 3),
9081 .nb_flags = NBT_NM_GROUP,
9083 .num_ips = ctx->addresses_mhomed_num,
9084 .ips = ctx->addresses_mhomed,
9085 .apply_expected = true
9091 .type = WREPL_TYPE_SGROUP,
9092 .state = WREPL_STATE_TOMBSTONE,
9093 .node = WREPL_NODE_B,
9095 .num_ips = ctx->addresses_mhomed_num,
9096 .ips = ctx->addresses_mhomed,
9097 .apply_expected = false
9101 * sgroup,active vs. sgroup,tombstone with superset ip(s)
9104 .line = __location__,
9105 .name = _NBT_NAME("_SA_ST_SP_U", 0x1C, NULL),
9106 .skip = (ctx->addresses_all_num < 3),
9108 .nb_flags = NBT_NM_GROUP,
9110 .num_ips = ctx->addresses_mhomed_num,
9111 .ips = ctx->addresses_mhomed,
9112 .apply_expected = true
9118 .type = WREPL_TYPE_SGROUP,
9119 .state = WREPL_STATE_TOMBSTONE,
9120 .node = WREPL_NODE_B,
9122 .num_ips = ctx->addresses_all_num,
9123 .ips = ctx->addresses_all,
9124 .apply_expected = false
9128 * sgroup,active vs. sgroup,tombstone with subset ip(s)
9131 .line = __location__,
9132 .name = _NBT_NAME("_SA_ST_SB_U", 0x1C, NULL),
9133 .skip = (ctx->addresses_all_num < 3),
9135 .nb_flags = NBT_NM_GROUP,
9137 .num_ips = ctx->addresses_mhomed_num,
9138 .ips = ctx->addresses_mhomed,
9139 .apply_expected = true
9145 .type = WREPL_TYPE_SGROUP,
9146 .state = WREPL_STATE_TOMBSTONE,
9147 .node = WREPL_NODE_B,
9149 .num_ips = ctx->addresses_best_num,
9150 .ips = ctx->addresses_best,
9151 .apply_expected = false
9157 if (!ctx->nbtsock_srv) {
9158 torture_comment(tctx, "SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
9159 lp_nbt_port(global_loadparm));
9163 torture_comment(tctx, "Test Replica records vs. owned active records\n");
9165 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
9167 struct test_conflict_owned_active_vs_replica_struct record = records[i];
9168 uint32_t j, count = 1;
9171 if (records[i].wins.mhomed || records[i].name.type == 0x1C) {
9172 count = records[i].wins.num_ips;
9175 if (records[i].section) {
9176 torture_comment(tctx, "%s\n", records[i].section);
9179 if (records[i].skip) {
9180 torture_comment(tctx, "%s => SKIPPED\n", nbt_name_string(ctx, &records[i].name));
9184 if (records[i].replica.mhomed_merge) {
9185 action = "MHOMED_MERGE";
9186 } else if (records[i].replica.sgroup_merge) {
9187 action = "SGROUP_MERGE";
9188 } else if (records[i].replica.apply_expected) {
9191 action = "NOT REPLACE";
9194 torture_comment(tctx, "%s%s%s => %s\n",
9195 nbt_name_string(ctx, &records[i].name),
9196 (records[i].comment?": ":""),
9197 (records[i].comment?records[i].comment:""),
9200 /* Prepare for multi homed registration */
9201 ZERO_STRUCT(records[i].defend);
9202 records[i].defend.timeout = 10;
9203 records[i].defend.positive = true;
9204 nbt_set_incoming_handler(ctx->nbtsock_srv,
9205 test_conflict_owned_active_vs_replica_handler,
9207 if (ctx->nbtsock_srv2) {
9208 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9209 test_conflict_owned_active_vs_replica_handler,
9216 for (j=0; j < count; j++) {
9217 struct nbt_name_request *req;
9219 name_register->in.name = records[i].name;
9220 name_register->in.dest_addr = ctx->address;
9221 name_register->in.address = records[i].wins.ips[j].ip;
9222 name_register->in.nb_flags = records[i].wins.nb_flags;
9223 name_register->in.register_demand= false;
9224 name_register->in.broadcast = false;
9225 name_register->in.multi_homed = records[i].wins.mhomed;
9226 name_register->in.ttl = 300000;
9227 name_register->in.timeout = 70;
9228 name_register->in.retries = 0;
9230 req = nbt_name_register_send(ctx->nbtsock, name_register);
9232 /* push the request on the wire */
9233 event_loop_once(ctx->nbtsock->event_ctx);
9236 * if we register multiple addresses,
9237 * the server will do name queries to see if the old addresses
9240 if (records[i].wins.mhomed && j > 0) {
9241 end = timeval_current_ofs(records[i].defend.timeout,0);
9242 records[i].defend.ret = true;
9243 while (records[i].defend.timeout > 0) {
9244 event_loop_once(ctx->nbtsock_srv->event_ctx);
9245 if (timeval_expired(&end)) break;
9247 ret &= records[i].defend.ret;
9250 status = nbt_name_register_recv(req, ctx, name_register);
9251 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9252 torture_comment(tctx, "No response from %s for name register\n", ctx->address);
9255 if (!NT_STATUS_IS_OK(status)) {
9256 torture_comment(tctx, "Bad response from %s for name register - %s\n",
9257 ctx->address, nt_errstr(status));
9260 CHECK_VALUE(tctx, name_register->out.rcode, 0);
9261 CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address);
9262 CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type);
9263 CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name);
9264 CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope);
9265 CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[j].ip);
9268 /* Prepare for the current test */
9269 records[i].defend = record.defend;
9270 nbt_set_incoming_handler(ctx->nbtsock_srv,
9271 test_conflict_owned_active_vs_replica_handler,
9273 if (ctx->nbtsock_srv2) {
9274 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9275 test_conflict_owned_active_vs_replica_handler,
9282 wins_name->name = &records[i].name;
9283 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
9284 records[i].replica.state,
9285 records[i].replica.node,
9286 records[i].replica.is_static);
9287 wins_name->id = ++ctx->b.max_version;
9288 if (wins_name->flags & 2) {
9289 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
9290 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
9292 wins_name->addresses.ip = records[i].replica.ips[0].ip;
9294 wins_name->unknown = "255.255.255.255";
9296 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9299 * wait for the name query, which is handled in
9300 * test_conflict_owned_active_vs_replica_handler()
9302 end = timeval_current_ofs(records[i].defend.timeout,0);
9303 records[i].defend.ret = true;
9304 while (records[i].defend.timeout > 0) {
9305 event_loop_once(ctx->nbtsock_srv->event_ctx);
9306 if (timeval_expired(&end)) break;
9308 ret &= records[i].defend.ret;
9310 if (records[i].defend.late_release) {
9311 records[i].defend = record.defend;
9312 records[i].defend.expect_release = true;
9314 * wait for the name release demand, which is handled in
9315 * test_conflict_owned_active_vs_replica_handler()
9317 end = timeval_current_ofs(records[i].defend.timeout,0);
9318 records[i].defend.ret = true;
9319 while (records[i].defend.timeout > 0) {
9320 event_loop_once(ctx->nbtsock_srv->event_ctx);
9321 if (timeval_expired(&end)) break;
9323 ret &= records[i].defend.ret;
9326 if (records[i].replica.mhomed_merge) {
9327 ret &= test_wrepl_mhomed_merged(tctx, ctx, &ctx->c,
9328 records[i].wins.num_ips, records[i].wins.ips,
9330 records[i].replica.num_ips, records[i].replica.ips,
9332 } else if (records[i].replica.sgroup_merge) {
9333 ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL,
9335 records[i].wins.num_ips, records[i].wins.ips,
9337 records[i].replica.num_ips, records[i].replica.ips,
9340 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name,
9341 records[i].replica.apply_expected);
9344 if (records[i].replica.apply_expected ||
9345 records[i].replica.mhomed_merge) {
9346 wins_name->name = &records[i].name;
9347 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9348 WREPL_STATE_TOMBSTONE,
9349 WREPL_NODE_B, false);
9350 wins_name->id = ++ctx->b.max_version;
9351 wins_name->addresses.ip = addresses_B_1[0].ip;
9352 wins_name->unknown = "255.255.255.255";
9354 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9355 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9357 for (j=0; j < count; j++) {
9358 struct nbt_name_socket *nbtsock = ctx->nbtsock;
9360 if (ctx->myaddr2 && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2->addr) == 0) {
9361 nbtsock = ctx->nbtsock2;
9364 release->in.name = records[i].name;
9365 release->in.dest_addr = ctx->address;
9366 release->in.address = records[i].wins.ips[j].ip;
9367 release->in.nb_flags = records[i].wins.nb_flags;
9368 release->in.broadcast = false;
9369 release->in.timeout = 30;
9370 release->in.retries = 0;
9372 status = nbt_name_release(nbtsock, ctx, release);
9373 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9374 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
9377 if (!NT_STATUS_IS_OK(status)) {
9378 torture_comment(tctx, "Bad response from %s for name query - %s\n",
9379 ctx->address, nt_errstr(status));
9382 CHECK_VALUE(tctx, release->out.rcode, 0);
9385 if (records[i].replica.sgroup_merge) {
9386 /* clean up the SGROUP record */
9387 wins_name->name = &records[i].name;
9388 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9390 WREPL_NODE_B, false);
9391 wins_name->id = ++ctx->b.max_version;
9392 wins_name->addresses.addresses.num_ips = 0;
9393 wins_name->addresses.addresses.ips = NULL;
9394 wins_name->unknown = "255.255.255.255";
9395 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9397 /* take ownership of the SGROUP record */
9398 wins_name->name = &records[i].name;
9399 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9401 WREPL_NODE_B, false);
9402 wins_name->id = ++ctx->b.max_version;
9403 wins_name->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
9404 wins_name->addresses.addresses.ips = discard_const(addresses_B_1);
9405 wins_name->unknown = "255.255.255.255";
9406 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9407 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9409 /* overwrite the SGROUP record with unique,tombstone */
9410 wins_name->name = &records[i].name;
9411 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9412 WREPL_STATE_TOMBSTONE,
9413 WREPL_NODE_B, false);
9414 wins_name->id = ++ctx->b.max_version;
9415 wins_name->addresses.ip = addresses_A_1[0].ip;
9416 wins_name->unknown = "255.255.255.255";
9417 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9418 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9423 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
9431 #define _NBT_ASSERT(v, correct) do { \
9432 if ((v) != (correct)) { \
9433 printf("(%s) Incorrect value %s=%d - should be %s (%d)\n", \
9434 __location__, #v, v, #correct, correct); \
9439 #define _NBT_ASSERT_STRING(v, correct) do { \
9440 if ( ((!v) && (correct)) || \
9441 ((v) && (!correct)) || \
9442 ((v) && (correct) && strcmp(v,correct) != 0)) { \
9443 printf("(%s) Incorrect value %s=%s - should be %s\n", \
9444 __location__, #v, v, correct); \
9449 static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
9450 struct nbt_name_packet *req_packet,
9451 struct socket_address *src)
9453 struct nbt_name *name;
9454 struct nbt_name_packet *rep_packet;
9455 struct test_conflict_owned_active_vs_replica_struct *rec =
9456 (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private;
9458 _NBT_ASSERT(req_packet->qdcount, 1);
9459 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9460 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9462 name = &req_packet->questions[0].name;
9464 _NBT_ASSERT(name->type, rec->name.type);
9465 _NBT_ASSERT_STRING(name->name, rec->name.name);
9466 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9468 _NBT_ASSERT(rec->defend.expect_release, false);
9470 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9471 if (rep_packet == NULL) return;
9473 rep_packet->name_trn_id = req_packet->name_trn_id;
9474 rep_packet->ancount = 1;
9476 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9477 if (rep_packet->answers == NULL) return;
9479 rep_packet->answers[0].name = *name;
9480 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9481 rep_packet->answers[0].ttl = 0;
9483 if (rec->defend.positive) {
9484 uint32_t i, num_ips;
9485 const struct wrepl_ip *ips;
9487 if (rec->defend.num_ips > 0) {
9488 num_ips = rec->defend.num_ips;
9489 ips = rec->defend.ips;
9491 num_ips = rec->wins.num_ips;
9492 ips = rec->wins.ips;
9495 /* send a positive reply */
9496 rep_packet->operation =
9499 NBT_FLAG_AUTHORITIVE |
9500 NBT_FLAG_RECURSION_DESIRED |
9501 NBT_FLAG_RECURSION_AVAIL;
9503 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9505 rep_packet->answers[0].rdata.netbios.length = num_ips*6;
9506 rep_packet->answers[0].rdata.netbios.addresses =
9507 talloc_array(rep_packet->answers, struct nbt_rdata_address, num_ips);
9508 if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return;
9510 for (i=0; i < num_ips; i++) {
9511 struct nbt_rdata_address *addr =
9512 &rep_packet->answers[0].rdata.netbios.addresses[i];
9513 addr->nb_flags = rec->wins.nb_flags;
9514 addr->ipaddr = ips[i].ip;
9516 DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
9517 nbt_name_string(rep_packet, name), src->addr, src->port));
9519 /* send a negative reply */
9520 rep_packet->operation =
9523 NBT_FLAG_AUTHORITIVE |
9526 rep_packet->answers[0].rr_type = NBT_QTYPE_NULL;
9528 ZERO_STRUCT(rep_packet->answers[0].rdata);
9530 DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
9531 nbt_name_string(rep_packet, name), src->addr, src->port));
9534 nbt_name_reply_send(nbtsock, src, rep_packet);
9535 talloc_free(rep_packet);
9537 /* make sure we push the reply to the wire */
9538 event_loop_once(nbtsock->event_ctx);
9541 rec->defend.timeout = 0;
9542 rec->defend.ret = true;
9545 static void test_conflict_owned_active_vs_replica_handler_release(
9546 struct nbt_name_socket *nbtsock,
9547 struct nbt_name_packet *req_packet,
9548 struct socket_address *src)
9550 struct nbt_name *name;
9551 struct nbt_name_packet *rep_packet;
9552 struct test_conflict_owned_active_vs_replica_struct *rec =
9553 (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private;
9555 _NBT_ASSERT(req_packet->qdcount, 1);
9556 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9557 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9559 name = &req_packet->questions[0].name;
9561 _NBT_ASSERT(name->type, rec->name.type);
9562 _NBT_ASSERT_STRING(name->name, rec->name.name);
9563 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9565 _NBT_ASSERT(rec->defend.expect_release, true);
9567 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9568 if (rep_packet == NULL) return;
9570 rep_packet->name_trn_id = req_packet->name_trn_id;
9571 rep_packet->ancount = 1;
9572 rep_packet->operation =
9574 NBT_OPCODE_RELEASE |
9575 NBT_FLAG_AUTHORITIVE;
9577 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9578 if (rep_packet->answers == NULL) return;
9580 rep_packet->answers[0].name = *name;
9581 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9582 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9583 rep_packet->answers[0].ttl = req_packet->additional[0].ttl;
9584 rep_packet->answers[0].rdata = req_packet->additional[0].rdata;
9586 DEBUG(2,("Sending name release reply for %s to %s:%d\n",
9587 nbt_name_string(rep_packet, name), src->addr, src->port));
9589 nbt_name_reply_send(nbtsock, src, rep_packet);
9590 talloc_free(rep_packet);
9592 /* make sure we push the reply to the wire */
9593 event_loop_once(nbtsock->event_ctx);
9596 rec->defend.timeout = 0;
9597 rec->defend.ret = true;
9600 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
9601 struct nbt_name_packet *req_packet,
9602 struct socket_address *src)
9604 struct test_conflict_owned_active_vs_replica_struct *rec =
9605 (struct test_conflict_owned_active_vs_replica_struct *)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_setting_bool(tctx, "quick", false))
9657 "skip NBT-WINSREPLICATION-OWNED test in quick test mode\n");
9659 if (!torture_nbt_get_name(tctx, &name, &address))
9662 ctx = test_create_conflict_ctx(tctx, address);
9663 torture_assert(tctx, ctx != NULL, "Creating context failed");
9665 ret &= test_conflict_owned_released_vs_replica(tctx, ctx);
9666 ret &= test_conflict_owned_active_vs_replica(tctx, ctx);
9672 test simple WINS replication operations
9674 struct torture_suite *torture_nbt_winsreplication(TALLOC_CTX *mem_ctx)
9676 struct torture_suite *suite = torture_suite_create(
9677 mem_ctx, "WINSREPLICATION");
9678 struct torture_tcase *tcase;
9680 tcase = torture_suite_add_simple_test(suite, "assoc_ctx1",
9682 tcase->tests->dangerous = true;
9684 torture_suite_add_simple_test(suite, "assoc_ctx2",
9687 torture_suite_add_simple_test(suite, "wins_replication",
9688 test_wins_replication);
9690 torture_suite_add_simple_test(suite, "replica",
9691 torture_nbt_winsreplication_replica);
9693 torture_suite_add_simple_test(suite, "owned",
9694 torture_nbt_winsreplication_owned);