2 Unix SMB/CIFS implementation.
4 WINS replication testing
6 Copyright (C) Andrew Tridgell 2005
7 Copyright (C) Stefan Metzmacher 2005
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #include "libcli/wrepl/winsrepl.h"
25 #include "lib/events/events.h"
26 #include "lib/socket/socket.h"
27 #include "libcli/resolve/resolve.h"
28 #include "system/network.h"
29 #include "lib/socket/netif.h"
30 #include "librpc/gen_ndr/ndr_nbt.h"
31 #include "torture/torture.h"
32 #include "torture/nbt/proto.h"
34 #define CHECK_STATUS(tctx, status, correct) \
35 torture_assert_ntstatus_equal(tctx, status, correct, \
38 #define CHECK_VALUE(tctx, v, correct) \
39 torture_assert(tctx, (v) == (correct), \
40 talloc_asprintf(tctx, "Incorrect value %s=%d - should be %d\n", \
43 #define CHECK_VALUE_UINT64(tctx, v, correct) \
44 torture_assert(tctx, (v) == (correct), \
45 talloc_asprintf(tctx, "Incorrect value %s=%llu - should be %llu\n", \
46 #v, (long long)v, (long long)correct))
48 #define CHECK_VALUE_STRING(tctx, v, correct) \
49 torture_assert_str_equal(tctx, v, correct, "Invalid value")
51 #define _NBT_NAME(n,t,s) {\
57 static const char *wrepl_name_type_string(enum wrepl_name_type type)
60 case WREPL_TYPE_UNIQUE: return "UNIQUE";
61 case WREPL_TYPE_GROUP: return "GROUP";
62 case WREPL_TYPE_SGROUP: return "SGROUP";
63 case WREPL_TYPE_MHOMED: return "MHOMED";
65 return "UNKNOWN_TYPE";
68 static const char *wrepl_name_state_string(enum wrepl_name_state state)
71 case WREPL_STATE_ACTIVE: return "ACTIVE";
72 case WREPL_STATE_RELEASED: return "RELEASED";
73 case WREPL_STATE_TOMBSTONE: return "TOMBSTONE";
74 case WREPL_STATE_RESERVED: return "RESERVED";
76 return "UNKNOWN_STATE";
80 test how assoc_ctx's are only usable on the connection
83 static bool test_assoc_ctx1(struct torture_context *tctx)
86 struct wrepl_request *req;
87 struct wrepl_socket *wrepl_socket1;
88 struct wrepl_associate associate1;
89 struct wrepl_socket *wrepl_socket2;
90 struct wrepl_associate associate2;
91 struct wrepl_pull_table pull_table;
92 struct wrepl_packet packet;
93 struct wrepl_send_ctrl ctrl;
94 struct wrepl_packet *rep_packet;
95 struct wrepl_associate_stop assoc_stop;
100 if (!torture_nbt_get_name(tctx, &name, &address))
103 torture_comment(tctx, "Test if assoc_ctx is only valid on the conection it was created on\n");
105 wrepl_socket1 = wrepl_socket_init(tctx, NULL);
106 wrepl_socket2 = wrepl_socket_init(tctx, NULL);
108 torture_comment(tctx, "Setup 2 wrepl connections\n");
109 status = wrepl_connect(wrepl_socket1, NULL, address);
110 CHECK_STATUS(tctx, status, NT_STATUS_OK);
112 status = wrepl_connect(wrepl_socket2, NULL, address);
113 CHECK_STATUS(tctx, status, NT_STATUS_OK);
115 torture_comment(tctx, "Send a start association request (conn1)\n");
116 status = wrepl_associate(wrepl_socket1, &associate1);
117 CHECK_STATUS(tctx, status, NT_STATUS_OK);
119 torture_comment(tctx, "association context (conn1): 0x%x\n", associate1.out.assoc_ctx);
121 torture_comment(tctx, "Send a start association request (conn2)\n");
122 status = wrepl_associate(wrepl_socket2, &associate2);
123 CHECK_STATUS(tctx, status, NT_STATUS_OK);
125 torture_comment(tctx, "association context (conn2): 0x%x\n", associate2.out.assoc_ctx);
127 torture_comment(tctx, "Send a replication table query, with assoc 1 (conn2), the anwser should be on conn1\n");
129 packet.opcode = WREPL_OPCODE_BITS;
130 packet.assoc_ctx = associate1.out.assoc_ctx;
131 packet.mess_type = WREPL_REPLICATION;
132 packet.message.replication.command = WREPL_REPL_TABLE_QUERY;
134 ctrl.send_only = true;
135 req = wrepl_request_send(wrepl_socket2, &packet, &ctrl);
136 status = wrepl_request_recv(req, tctx, &rep_packet);
137 CHECK_STATUS(tctx, status, NT_STATUS_OK);
139 torture_comment(tctx, "Send a association request (conn2), to make sure the last request was ignored\n");
140 status = wrepl_associate(wrepl_socket2, &associate2);
141 CHECK_STATUS(tctx, status, NT_STATUS_OK);
143 torture_comment(tctx, "Send a replication table query, with invalid assoc (conn1), receive answer from conn2\n");
144 pull_table.in.assoc_ctx = 0;
145 req = wrepl_pull_table_send(wrepl_socket1, &pull_table);
146 status = wrepl_request_recv(req, tctx, &rep_packet);
147 CHECK_STATUS(tctx, status, NT_STATUS_OK);
149 torture_comment(tctx, "Send a association request (conn1), to make sure the last request was handled correct\n");
150 status = wrepl_associate(wrepl_socket1, &associate2);
151 CHECK_STATUS(tctx, status, NT_STATUS_OK);
153 assoc_stop.in.assoc_ctx = associate1.out.assoc_ctx;
154 assoc_stop.in.reason = 4;
155 torture_comment(tctx, "Send a association stop request (conn1), reson: %u\n", assoc_stop.in.reason);
156 status = wrepl_associate_stop(wrepl_socket1, &assoc_stop);
157 CHECK_STATUS(tctx, status, NT_STATUS_END_OF_FILE);
159 assoc_stop.in.assoc_ctx = associate2.out.assoc_ctx;
160 assoc_stop.in.reason = 0;
161 torture_comment(tctx, "Send a association stop request (conn2), reson: %u\n", assoc_stop.in.reason);
162 status = wrepl_associate_stop(wrepl_socket2, &assoc_stop);
163 CHECK_STATUS(tctx, status, NT_STATUS_OK);
165 torture_comment(tctx, "Close 2 wrepl connections\n");
166 talloc_free(wrepl_socket1);
167 talloc_free(wrepl_socket2);
172 test if we always get back the same assoc_ctx
174 static bool test_assoc_ctx2(struct torture_context *tctx)
176 struct wrepl_socket *wrepl_socket;
177 struct wrepl_associate associate;
179 struct nbt_name name;
183 if (!torture_nbt_get_name(tctx, &name, &address))
186 torture_comment(tctx, "Test if we always get back the same assoc_ctx\n");
188 wrepl_socket = wrepl_socket_init(tctx, NULL);
190 torture_comment(tctx, "Setup wrepl connections\n");
191 status = wrepl_connect(wrepl_socket, NULL, address);
192 CHECK_STATUS(tctx, status, NT_STATUS_OK);
194 torture_comment(tctx, "Send 1st start association request\n");
195 status = wrepl_associate(wrepl_socket, &associate);
196 CHECK_STATUS(tctx, status, NT_STATUS_OK);
197 assoc_ctx1 = associate.out.assoc_ctx;
198 torture_comment(tctx, "1st association context: 0x%x\n", associate.out.assoc_ctx);
200 torture_comment(tctx, "Send 2nd start association request\n");
201 status = wrepl_associate(wrepl_socket, &associate);
202 torture_assert_ntstatus_ok(tctx, status, "2nd start association failed");
203 torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1,
204 "Different context returned");
205 torture_comment(tctx, "2nd association context: 0x%x\n", associate.out.assoc_ctx);
207 torture_comment(tctx, "Send 3rd start association request\n");
208 status = wrepl_associate(wrepl_socket, &associate);
209 torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1,
210 "Different context returned");
211 CHECK_STATUS(tctx, status, NT_STATUS_OK);
212 torture_comment(tctx, "3rd association context: 0x%x\n", associate.out.assoc_ctx);
214 torture_comment(tctx, "Close wrepl connections\n");
215 talloc_free(wrepl_socket);
221 display a replication entry
223 static void display_entry(TALLOC_CTX *tctx, struct wrepl_name *name)
227 torture_comment(tctx, "%s\n", nbt_name_string(tctx, &name->name));
228 torture_comment(tctx, "\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n",
229 name->type, name->state, name->node, name->is_static, (long long)name->version_id);
230 torture_comment(tctx, "\tRAW_FLAGS: 0x%08X OWNER: %-15s\n",
231 name->raw_flags, name->owner);
232 for (i=0;i<name->num_addresses;i++) {
233 torture_comment(tctx, "\tADDR: %-15s OWNER: %-15s\n",
234 name->addresses[i].address, name->addresses[i].owner);
239 test a full replication dump from a WINS server
241 static bool test_wins_replication(struct torture_context *tctx)
243 struct wrepl_socket *wrepl_socket;
246 struct wrepl_associate associate;
247 struct wrepl_pull_table pull_table;
248 struct wrepl_pull_names pull_names;
249 struct nbt_name name;
252 if (!torture_nbt_get_name(tctx, &name, &address))
255 torture_comment(tctx, "Test one pull replication cycle\n");
257 wrepl_socket = wrepl_socket_init(tctx, NULL);
259 torture_comment(tctx, "Setup wrepl connections\n");
260 status = wrepl_connect(wrepl_socket, NULL, address);
261 CHECK_STATUS(tctx, status, NT_STATUS_OK);
263 torture_comment(tctx, "Send a start association request\n");
265 status = wrepl_associate(wrepl_socket, &associate);
266 CHECK_STATUS(tctx, status, NT_STATUS_OK);
268 torture_comment(tctx, "association context: 0x%x\n", associate.out.assoc_ctx);
270 torture_comment(tctx, "Send a replication table query\n");
271 pull_table.in.assoc_ctx = associate.out.assoc_ctx;
273 status = wrepl_pull_table(wrepl_socket, tctx, &pull_table);
274 if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) {
275 struct wrepl_packet packet;
276 struct wrepl_request *req;
279 packet.opcode = WREPL_OPCODE_BITS;
280 packet.assoc_ctx = associate.out.assoc_ctx;
281 packet.mess_type = WREPL_STOP_ASSOCIATION;
282 packet.message.stop.reason = 0;
284 req = wrepl_request_send(wrepl_socket, &packet, NULL);
287 torture_fail(tctx, "We are not a valid pull partner for the server");
289 CHECK_STATUS(tctx, status, NT_STATUS_OK);
291 torture_comment(tctx, "Found %d replication partners\n", pull_table.out.num_partners);
293 for (i=0;i<pull_table.out.num_partners;i++) {
294 struct wrepl_wins_owner *partner = &pull_table.out.partners[i];
295 torture_comment(tctx, "%s max_version=%6llu min_version=%6llu type=%d\n",
297 (long long)partner->max_version,
298 (long long)partner->min_version,
301 pull_names.in.assoc_ctx = associate.out.assoc_ctx;
302 pull_names.in.partner = *partner;
304 status = wrepl_pull_names(wrepl_socket, tctx, &pull_names);
305 CHECK_STATUS(tctx, status, NT_STATUS_OK);
307 torture_comment(tctx, "Received %d names\n", pull_names.out.num_names);
309 for (j=0;j<pull_names.out.num_names;j++) {
310 display_entry(tctx, &pull_names.out.names[j]);
314 torture_comment(tctx, "Close wrepl connections\n");
315 talloc_free(wrepl_socket);
319 struct test_wrepl_conflict_conn {
321 struct wrepl_socket *pull;
324 #define TEST_OWNER_A_ADDRESS "127.65.65.1"
325 #define TEST_ADDRESS_A_PREFIX "127.0.65"
326 #define TEST_OWNER_B_ADDRESS "127.66.66.1"
327 #define TEST_ADDRESS_B_PREFIX "127.0.66"
328 #define TEST_OWNER_X_ADDRESS "127.88.88.1"
329 #define TEST_ADDRESS_X_PREFIX "127.0.88"
331 struct wrepl_wins_owner a, b, c, x;
333 struct socket_address *myaddr;
334 struct socket_address *myaddr2;
335 struct nbt_name_socket *nbtsock;
336 struct nbt_name_socket *nbtsock2;
338 struct nbt_name_socket *nbtsock_srv;
339 struct nbt_name_socket *nbtsock_srv2;
341 uint32_t addresses_best_num;
342 struct wrepl_ip *addresses_best;
344 uint32_t addresses_best2_num;
345 struct wrepl_ip *addresses_best2;
347 uint32_t addresses_all_num;
348 struct wrepl_ip *addresses_all;
350 uint32_t addresses_mhomed_num;
351 struct wrepl_ip *addresses_mhomed;
354 static const struct wrepl_ip addresses_A_1[] = {
356 .owner = TEST_OWNER_A_ADDRESS,
357 .ip = TEST_ADDRESS_A_PREFIX".1"
360 static const struct wrepl_ip addresses_A_2[] = {
362 .owner = TEST_OWNER_A_ADDRESS,
363 .ip = TEST_ADDRESS_A_PREFIX".2"
366 static const struct wrepl_ip addresses_A_3_4[] = {
368 .owner = TEST_OWNER_A_ADDRESS,
369 .ip = TEST_ADDRESS_A_PREFIX".3"
372 .owner = TEST_OWNER_A_ADDRESS,
373 .ip = TEST_ADDRESS_A_PREFIX".4"
376 static const struct wrepl_ip addresses_A_3_4_X_3_4[] = {
378 .owner = TEST_OWNER_A_ADDRESS,
379 .ip = TEST_ADDRESS_A_PREFIX".3"
382 .owner = TEST_OWNER_A_ADDRESS,
383 .ip = TEST_ADDRESS_A_PREFIX".4"
386 .owner = TEST_OWNER_X_ADDRESS,
387 .ip = TEST_ADDRESS_X_PREFIX".3"
390 .owner = TEST_OWNER_X_ADDRESS,
391 .ip = TEST_ADDRESS_X_PREFIX".4"
394 static const struct wrepl_ip addresses_A_3_4_B_3_4[] = {
396 .owner = TEST_OWNER_A_ADDRESS,
397 .ip = TEST_ADDRESS_A_PREFIX".3"
400 .owner = TEST_OWNER_A_ADDRESS,
401 .ip = TEST_ADDRESS_A_PREFIX".4"
404 .owner = TEST_OWNER_B_ADDRESS,
405 .ip = TEST_ADDRESS_B_PREFIX".3"
408 .owner = TEST_OWNER_B_ADDRESS,
409 .ip = TEST_ADDRESS_B_PREFIX".4"
412 static const struct wrepl_ip addresses_A_3_4_OWNER_B[] = {
414 .owner = TEST_OWNER_B_ADDRESS,
415 .ip = TEST_ADDRESS_A_PREFIX".3"
418 .owner = TEST_OWNER_B_ADDRESS,
419 .ip = TEST_ADDRESS_A_PREFIX".4"
422 static const struct wrepl_ip addresses_A_3_4_X_3_4_OWNER_B[] = {
424 .owner = TEST_OWNER_B_ADDRESS,
425 .ip = TEST_ADDRESS_A_PREFIX".3"
428 .owner = TEST_OWNER_B_ADDRESS,
429 .ip = TEST_ADDRESS_A_PREFIX".4"
432 .owner = TEST_OWNER_B_ADDRESS,
433 .ip = TEST_ADDRESS_X_PREFIX".3"
436 .owner = TEST_OWNER_B_ADDRESS,
437 .ip = TEST_ADDRESS_X_PREFIX".4"
441 static const struct wrepl_ip addresses_A_3_4_X_1_2[] = {
443 .owner = TEST_OWNER_A_ADDRESS,
444 .ip = TEST_ADDRESS_A_PREFIX".3"
447 .owner = TEST_OWNER_A_ADDRESS,
448 .ip = TEST_ADDRESS_A_PREFIX".4"
451 .owner = TEST_OWNER_X_ADDRESS,
452 .ip = TEST_ADDRESS_X_PREFIX".1"
455 .owner = TEST_OWNER_X_ADDRESS,
456 .ip = TEST_ADDRESS_X_PREFIX".2"
460 static const struct wrepl_ip addresses_B_1[] = {
462 .owner = TEST_OWNER_B_ADDRESS,
463 .ip = TEST_ADDRESS_B_PREFIX".1"
466 static const struct wrepl_ip addresses_B_2[] = {
468 .owner = TEST_OWNER_B_ADDRESS,
469 .ip = TEST_ADDRESS_B_PREFIX".2"
472 static const struct wrepl_ip addresses_B_3_4[] = {
474 .owner = TEST_OWNER_B_ADDRESS,
475 .ip = TEST_ADDRESS_B_PREFIX".3"
478 .owner = TEST_OWNER_B_ADDRESS,
479 .ip = TEST_ADDRESS_B_PREFIX".4"
482 static const struct wrepl_ip addresses_B_3_4_X_3_4[] = {
484 .owner = TEST_OWNER_B_ADDRESS,
485 .ip = TEST_ADDRESS_B_PREFIX".3"
488 .owner = TEST_OWNER_B_ADDRESS,
489 .ip = TEST_ADDRESS_B_PREFIX".4"
492 .owner = TEST_OWNER_X_ADDRESS,
493 .ip = TEST_ADDRESS_X_PREFIX".3"
496 .owner = TEST_OWNER_X_ADDRESS,
497 .ip = TEST_ADDRESS_X_PREFIX".4"
500 static const struct wrepl_ip addresses_B_3_4_X_1_2[] = {
502 .owner = TEST_OWNER_B_ADDRESS,
503 .ip = TEST_ADDRESS_B_PREFIX".3"
506 .owner = TEST_OWNER_B_ADDRESS,
507 .ip = TEST_ADDRESS_B_PREFIX".4"
510 .owner = TEST_OWNER_X_ADDRESS,
511 .ip = TEST_ADDRESS_X_PREFIX".1"
514 .owner = TEST_OWNER_X_ADDRESS,
515 .ip = TEST_ADDRESS_X_PREFIX".2"
519 static const struct wrepl_ip addresses_X_1_2[] = {
521 .owner = TEST_OWNER_X_ADDRESS,
522 .ip = TEST_ADDRESS_X_PREFIX".1"
525 .owner = TEST_OWNER_X_ADDRESS,
526 .ip = TEST_ADDRESS_X_PREFIX".2"
529 static const struct wrepl_ip addresses_X_3_4[] = {
531 .owner = TEST_OWNER_X_ADDRESS,
532 .ip = TEST_ADDRESS_X_PREFIX".3"
535 .owner = TEST_OWNER_X_ADDRESS,
536 .ip = TEST_ADDRESS_X_PREFIX".4"
540 static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *tctx,
543 struct test_wrepl_conflict_conn *ctx;
544 struct wrepl_associate associate;
545 struct wrepl_pull_table pull_table;
546 struct socket_address *nbt_srv_addr;
550 ctx = talloc_zero(tctx, struct test_wrepl_conflict_conn);
551 if (!ctx) return NULL;
553 ctx->address = address;
554 ctx->pull = wrepl_socket_init(ctx, NULL);
555 if (!ctx->pull) return NULL;
557 torture_comment(tctx, "Setup wrepl conflict pull connection\n");
558 status = wrepl_connect(ctx->pull, NULL, ctx->address);
559 if (!NT_STATUS_IS_OK(status)) return NULL;
561 status = wrepl_associate(ctx->pull, &associate);
562 if (!NT_STATUS_IS_OK(status)) return NULL;
564 ctx->pull_assoc = associate.out.assoc_ctx;
566 ctx->a.address = TEST_OWNER_A_ADDRESS;
567 ctx->a.max_version = 0;
568 ctx->a.min_version = 0;
571 ctx->b.address = TEST_OWNER_B_ADDRESS;
572 ctx->b.max_version = 0;
573 ctx->b.min_version = 0;
576 ctx->x.address = TEST_OWNER_X_ADDRESS;
577 ctx->x.max_version = 0;
578 ctx->x.min_version = 0;
581 ctx->c.address = address;
582 ctx->c.max_version = 0;
583 ctx->c.min_version = 0;
586 pull_table.in.assoc_ctx = ctx->pull_assoc;
587 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
588 if (!NT_STATUS_IS_OK(status)) return NULL;
590 for (i=0; i < pull_table.out.num_partners; i++) {
591 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
592 ctx->a.max_version = pull_table.out.partners[i].max_version;
593 ctx->a.min_version = pull_table.out.partners[i].min_version;
595 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
596 ctx->b.max_version = pull_table.out.partners[i].max_version;
597 ctx->b.min_version = pull_table.out.partners[i].min_version;
599 if (strcmp(TEST_OWNER_X_ADDRESS,pull_table.out.partners[i].address)==0) {
600 ctx->x.max_version = pull_table.out.partners[i].max_version;
601 ctx->x.min_version = pull_table.out.partners[i].min_version;
603 if (strcmp(address,pull_table.out.partners[i].address)==0) {
604 ctx->c.max_version = pull_table.out.partners[i].max_version;
605 ctx->c.min_version = pull_table.out.partners[i].min_version;
609 talloc_free(pull_table.out.partners);
611 ctx->nbtsock = nbt_name_socket_init(ctx, NULL);
612 if (!ctx->nbtsock) return NULL;
614 ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_best_ip(address), 0);
615 if (!ctx->myaddr) return NULL;
617 for (i = 0; i < iface_count(); i++) {
618 if (strcmp(ctx->myaddr->addr, iface_n_ip(i)) == 0) continue;
619 ctx->myaddr2 = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_n_ip(i), 0);
620 if (!ctx->myaddr2) return NULL;
624 status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0);
625 if (!NT_STATUS_IS_OK(status)) return NULL;
627 ctx->nbtsock_srv = nbt_name_socket_init(ctx, NULL);
628 if (!ctx->nbtsock_srv) return NULL;
630 /* Make a port 137 version of ctx->myaddr */
631 nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lp_nbt_port());
632 if (!nbt_srv_addr) return NULL;
634 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
635 status = socket_listen(ctx->nbtsock_srv->sock, nbt_srv_addr, 0, 0);
636 talloc_free(nbt_srv_addr);
637 if (!NT_STATUS_IS_OK(status)) {
638 /* this isn't fatal */
639 talloc_free(ctx->nbtsock_srv);
640 ctx->nbtsock_srv = NULL;
643 if (ctx->myaddr2 && ctx->nbtsock_srv) {
644 ctx->nbtsock2 = nbt_name_socket_init(ctx, NULL);
645 if (!ctx->nbtsock2) return NULL;
647 status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0);
648 if (!NT_STATUS_IS_OK(status)) return NULL;
650 ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx);
651 if (!ctx->nbtsock_srv2) return NULL;
653 /* Make a port 137 version of ctx->myaddr2 */
654 nbt_srv_addr = socket_address_from_strings(tctx,
655 ctx->nbtsock_srv->sock->backend_name,
656 ctx->myaddr2->addr, lp_nbt_port());
657 if (!nbt_srv_addr) return NULL;
659 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
660 status = socket_listen(ctx->nbtsock_srv2->sock, ctx->myaddr2, 0, 0);
661 talloc_free(nbt_srv_addr);
662 if (!NT_STATUS_IS_OK(status)) {
663 /* this isn't fatal */
664 talloc_free(ctx->nbtsock_srv2);
665 ctx->nbtsock_srv2 = NULL;
669 ctx->addresses_best_num = 1;
670 ctx->addresses_best = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best_num);
671 if (!ctx->addresses_best) return NULL;
672 ctx->addresses_best[0].owner = ctx->b.address;
673 ctx->addresses_best[0].ip = ctx->myaddr->addr;
675 ctx->addresses_all_num = iface_count();
676 ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num);
677 if (!ctx->addresses_all) return NULL;
678 for (i=0; i < ctx->addresses_all_num; i++) {
679 ctx->addresses_all[i].owner = ctx->b.address;
680 ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(i));
681 if (!ctx->addresses_all[i].ip) return NULL;
684 if (ctx->nbtsock_srv2) {
685 ctx->addresses_best2_num = 1;
686 ctx->addresses_best2 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best2_num);
687 if (!ctx->addresses_best2) return NULL;
688 ctx->addresses_best2[0].owner = ctx->b.address;
689 ctx->addresses_best2[0].ip = ctx->myaddr2->addr;
691 ctx->addresses_mhomed_num = 2;
692 ctx->addresses_mhomed = talloc_array(ctx, struct wrepl_ip, ctx->addresses_mhomed_num);
693 if (!ctx->addresses_mhomed) return NULL;
694 ctx->addresses_mhomed[0].owner = ctx->b.address;
695 ctx->addresses_mhomed[0].ip = ctx->myaddr->addr;
696 ctx->addresses_mhomed[1].owner = ctx->b.address;
697 ctx->addresses_mhomed[1].ip = ctx->myaddr2->addr;
703 static bool test_wrepl_update_one(struct torture_context *tctx,
704 struct test_wrepl_conflict_conn *ctx,
705 const struct wrepl_wins_owner *owner,
706 const struct wrepl_wins_name *name)
708 struct wrepl_socket *wrepl_socket;
709 struct wrepl_associate associate;
710 struct wrepl_packet update_packet, repl_send;
711 struct wrepl_table *update;
712 struct wrepl_wins_owner wrepl_wins_owners[1];
713 struct wrepl_packet *repl_recv;
714 struct wrepl_wins_owner *send_request;
715 struct wrepl_send_reply *send_reply;
716 struct wrepl_wins_name wrepl_wins_names[1];
720 wrepl_socket = wrepl_socket_init(ctx, NULL);
722 status = wrepl_connect(wrepl_socket, NULL, ctx->address);
723 CHECK_STATUS(tctx, status, NT_STATUS_OK);
725 status = wrepl_associate(wrepl_socket, &associate);
726 CHECK_STATUS(tctx, status, NT_STATUS_OK);
727 assoc_ctx = associate.out.assoc_ctx;
729 /* now send a WREPL_REPL_UPDATE message */
730 ZERO_STRUCT(update_packet);
731 update_packet.opcode = WREPL_OPCODE_BITS;
732 update_packet.assoc_ctx = assoc_ctx;
733 update_packet.mess_type = WREPL_REPLICATION;
734 update_packet.message.replication.command = WREPL_REPL_UPDATE;
735 update = &update_packet.message.replication.info.table;
737 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
738 update->partners = wrepl_wins_owners;
739 update->initiator = "0.0.0.0";
741 wrepl_wins_owners[0] = *owner;
743 status = wrepl_request(wrepl_socket, wrepl_socket,
744 &update_packet, &repl_recv);
745 CHECK_STATUS(tctx, status, NT_STATUS_OK);
746 CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_REPLICATION);
747 CHECK_VALUE(tctx, repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
748 send_request = &repl_recv->message.replication.info.owner;
750 ZERO_STRUCT(repl_send);
751 repl_send.opcode = WREPL_OPCODE_BITS;
752 repl_send.assoc_ctx = assoc_ctx;
753 repl_send.mess_type = WREPL_REPLICATION;
754 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
755 send_reply = &repl_send.message.replication.info.reply;
757 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
758 send_reply->names = wrepl_wins_names;
760 wrepl_wins_names[0] = *name;
762 status = wrepl_request(wrepl_socket, wrepl_socket,
763 &repl_send, &repl_recv);
764 CHECK_STATUS(tctx, status, NT_STATUS_OK);
765 CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
766 CHECK_VALUE(tctx, repl_recv->message.stop.reason, 0);
768 talloc_free(wrepl_socket);
772 static bool test_wrepl_is_applied(struct torture_context *tctx,
773 struct test_wrepl_conflict_conn *ctx,
774 const struct wrepl_wins_owner *owner,
775 const struct wrepl_wins_name *name,
779 struct wrepl_pull_names pull_names;
780 struct wrepl_name *names;
782 pull_names.in.assoc_ctx = ctx->pull_assoc;
783 pull_names.in.partner = *owner;
784 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
786 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
787 CHECK_STATUS(tctx, status, NT_STATUS_OK);
788 torture_assert(tctx, pull_names.out.num_names == (expected?1:0),
789 talloc_asprintf(tctx, "Invalid number of records returned - expected %d got %d", expected, pull_names.out.num_names));
791 names = pull_names.out.names;
794 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
798 CHECK_VALUE(tctx, names[0].name.type, name->name->type);
799 CHECK_VALUE_STRING(tctx, names[0].name.name, name->name->name);
800 CHECK_VALUE_STRING(tctx, names[0].name.scope, name->name->scope);
801 CHECK_VALUE(tctx, flags, name->flags);
802 CHECK_VALUE_UINT64(tctx, names[0].version_id, name->id);
805 CHECK_VALUE(tctx, names[0].num_addresses,
806 name->addresses.addresses.num_ips);
808 CHECK_VALUE(tctx, names[0].num_addresses, 1);
809 CHECK_VALUE_STRING(tctx, names[0].addresses[0].address,
813 talloc_free(pull_names.out.names);
817 static bool test_wrepl_mhomed_merged(struct torture_context *tctx,
818 struct test_wrepl_conflict_conn *ctx,
819 const struct wrepl_wins_owner *owner1,
820 uint32_t num_ips1, const struct wrepl_ip *ips1,
821 const struct wrepl_wins_owner *owner2,
822 uint32_t num_ips2, const struct wrepl_ip *ips2,
823 const struct wrepl_wins_name *name2)
826 struct wrepl_pull_names pull_names;
827 struct wrepl_name *names;
830 uint32_t num_ips = num_ips1 + num_ips2;
832 for (i = 0; i < num_ips2; i++) {
833 for (j = 0; j < num_ips1; j++) {
834 if (strcmp(ips2[i].ip,ips1[j].ip) == 0) {
841 pull_names.in.assoc_ctx = ctx->pull_assoc;
842 pull_names.in.partner = *owner2;
843 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
845 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
846 CHECK_STATUS(tctx, status, NT_STATUS_OK);
847 CHECK_VALUE(tctx, pull_names.out.num_names, 1);
849 names = pull_names.out.names;
851 flags = WREPL_NAME_FLAGS(names[0].type,
855 CHECK_VALUE(tctx, names[0].name.type, name2->name->type);
856 CHECK_VALUE_STRING(tctx, names[0].name.name, name2->name->name);
857 CHECK_VALUE_STRING(tctx, names[0].name.scope, name2->name->scope);
858 CHECK_VALUE(tctx, flags, name2->flags | WREPL_TYPE_MHOMED);
859 CHECK_VALUE_UINT64(tctx, names[0].version_id, name2->id);
861 CHECK_VALUE(tctx, names[0].num_addresses, num_ips);
863 for (i = 0; i < names[0].num_addresses; i++) {
864 const char *addr = names[0].addresses[i].address;
865 const char *owner = names[0].addresses[i].owner;
868 for (j = 0; j < num_ips2; j++) {
869 if (strcmp(addr, ips2[j].ip) == 0) {
871 CHECK_VALUE_STRING(tctx, owner, owner2->address);
878 for (j = 0; j < num_ips1; j++) {
879 if (strcmp(addr, ips1[j].ip) == 0) {
881 CHECK_VALUE_STRING(tctx, owner, owner1->address);
888 CHECK_VALUE_STRING(tctx, addr, "not found in address list");
890 talloc_free(pull_names.out.names);
894 static bool test_wrepl_sgroup_merged(struct torture_context *tctx,
895 struct test_wrepl_conflict_conn *ctx,
896 struct wrepl_wins_owner *merge_owner,
897 struct wrepl_wins_owner *owner1,
898 uint32_t num_ips1, const struct wrepl_ip *ips1,
899 struct wrepl_wins_owner *owner2,
900 uint32_t num_ips2, const struct wrepl_ip *ips2,
901 const struct wrepl_wins_name *name2)
904 struct wrepl_pull_names pull_names;
905 struct wrepl_name *names;
906 struct wrepl_name *name = NULL;
909 uint32_t num_ips = num_ips1 + num_ips2;
912 merge_owner = &ctx->c;
915 for (i = 0; i < num_ips1; i++) {
916 if (owner1 != &ctx->c && strcmp(ips1[i].owner,owner2->address) == 0) {
920 for (j = 0; j < num_ips2; j++) {
921 if (strcmp(ips1[i].ip,ips2[j].ip) == 0) {
929 pull_names.in.assoc_ctx = ctx->pull_assoc;
930 pull_names.in.partner = *merge_owner;
931 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
932 pull_names.in.partner.max_version = 0;
934 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
935 CHECK_STATUS(tctx, status, NT_STATUS_OK);
937 names = pull_names.out.names;
939 for (i = 0; i < pull_names.out.num_names; i++) {
940 if (names[i].name.type != name2->name->type) continue;
941 if (!names[i].name.name) continue;
942 if (strcmp(names[i].name.name, name2->name->name) != 0) continue;
943 if (names[i].name.scope) continue;
948 if (pull_names.out.num_names > 0) {
949 merge_owner->max_version = names[pull_names.out.num_names-1].version_id;
953 torture_comment(tctx, "%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name));
957 flags = WREPL_NAME_FLAGS(name->type,
961 CHECK_VALUE(tctx, name->name.type, name2->name->type);
962 CHECK_VALUE_STRING(tctx, name->name.name, name2->name->name);
963 CHECK_VALUE_STRING(tctx, name->name.scope, name2->name->scope);
964 CHECK_VALUE(tctx, flags, name2->flags);
966 CHECK_VALUE(tctx, name->num_addresses, num_ips);
968 for (i = 0; i < name->num_addresses; i++) {
969 const char *addr = name->addresses[i].address;
970 const char *owner = name->addresses[i].owner;
973 for (j = 0; j < num_ips2; j++) {
974 if (strcmp(addr, ips2[j].ip) == 0) {
976 CHECK_VALUE_STRING(tctx, owner, ips2[j].owner);
983 for (j = 0; j < num_ips1; j++) {
984 if (strcmp(addr, ips1[j].ip) == 0) {
986 if (owner1 == &ctx->c) {
987 CHECK_VALUE_STRING(tctx, owner, owner1->address);
989 CHECK_VALUE_STRING(tctx, owner, ips1[j].owner);
997 CHECK_VALUE_STRING(tctx, addr, "not found in address list");
999 talloc_free(pull_names.out.names);
1003 static bool test_conflict_same_owner(struct torture_context *tctx,
1004 struct test_wrepl_conflict_conn *ctx)
1006 static bool ret = true;
1007 struct nbt_name name;
1008 struct wrepl_wins_name wins_name1;
1009 struct wrepl_wins_name wins_name2;
1010 struct wrepl_wins_name *wins_name_tmp;
1011 struct wrepl_wins_name *wins_name_last;
1012 struct wrepl_wins_name *wins_name_cur;
1014 uint8_t types[] = { 0x00, 0x1C };
1016 enum wrepl_name_type type;
1017 enum wrepl_name_state state;
1018 enum wrepl_name_node node;
1021 const struct wrepl_ip *ips;
1024 .type = WREPL_TYPE_GROUP,
1025 .state = WREPL_STATE_ACTIVE,
1026 .node = WREPL_NODE_B,
1028 .num_ips = ARRAY_SIZE(addresses_A_1),
1029 .ips = addresses_A_1,
1031 .type = WREPL_TYPE_UNIQUE,
1032 .state = WREPL_STATE_ACTIVE,
1033 .node = WREPL_NODE_B,
1035 .num_ips = ARRAY_SIZE(addresses_A_1),
1036 .ips = addresses_A_1,
1038 .type = WREPL_TYPE_UNIQUE,
1039 .state = WREPL_STATE_ACTIVE,
1040 .node = WREPL_NODE_B,
1042 .num_ips = ARRAY_SIZE(addresses_A_2),
1043 .ips = addresses_A_2,
1045 .type = WREPL_TYPE_UNIQUE,
1046 .state = WREPL_STATE_ACTIVE,
1047 .node = WREPL_NODE_B,
1049 .num_ips = ARRAY_SIZE(addresses_A_1),
1050 .ips = addresses_A_1,
1052 .type = WREPL_TYPE_UNIQUE,
1053 .state = WREPL_STATE_ACTIVE,
1054 .node = WREPL_NODE_B,
1056 .num_ips = ARRAY_SIZE(addresses_A_2),
1057 .ips = addresses_A_2,
1059 .type = WREPL_TYPE_SGROUP,
1060 .state = WREPL_STATE_TOMBSTONE,
1061 .node = WREPL_NODE_B,
1063 .num_ips = ARRAY_SIZE(addresses_A_2),
1064 .ips = addresses_A_2,
1066 .type = WREPL_TYPE_MHOMED,
1067 .state = WREPL_STATE_TOMBSTONE,
1068 .node = WREPL_NODE_B,
1070 .num_ips = ARRAY_SIZE(addresses_A_1),
1071 .ips = addresses_A_1,
1073 .type = WREPL_TYPE_MHOMED,
1074 .state = WREPL_STATE_RELEASED,
1075 .node = WREPL_NODE_B,
1077 .num_ips = ARRAY_SIZE(addresses_A_2),
1078 .ips = addresses_A_2,
1080 .type = WREPL_TYPE_SGROUP,
1081 .state = WREPL_STATE_ACTIVE,
1082 .node = WREPL_NODE_B,
1084 .num_ips = ARRAY_SIZE(addresses_A_1),
1085 .ips = addresses_A_1,
1087 .type = WREPL_TYPE_SGROUP,
1088 .state = WREPL_STATE_ACTIVE,
1089 .node = WREPL_NODE_B,
1091 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1092 .ips = addresses_A_3_4,
1094 .type = WREPL_TYPE_SGROUP,
1095 .state = WREPL_STATE_TOMBSTONE,
1096 .node = WREPL_NODE_B,
1098 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1099 .ips = addresses_B_3_4,
1101 /* the last one should always be a unique,tomstone record! */
1102 .type = WREPL_TYPE_UNIQUE,
1103 .state = WREPL_STATE_TOMBSTONE,
1104 .node = WREPL_NODE_B,
1106 .num_ips = ARRAY_SIZE(addresses_A_1),
1107 .ips = addresses_A_1,
1111 name.name = "_SAME_OWNER_A";
1115 wins_name_tmp = NULL;
1116 wins_name_last = &wins_name2;
1117 wins_name_cur = &wins_name1;
1119 for (j=0; ret && j < ARRAY_SIZE(types); j++) {
1120 name.type = types[j];
1121 torture_comment(tctx, "Test Replica Conflicts with same owner[%s] for %s\n",
1122 nbt_name_string(ctx, &name), ctx->a.address);
1124 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
1125 wins_name_tmp = wins_name_last;
1126 wins_name_last = wins_name_cur;
1127 wins_name_cur = wins_name_tmp;
1130 torture_comment(tctx, "%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
1131 wrepl_name_type_string(records[i-1].type),
1132 wrepl_name_state_string(records[i-1].state),
1133 (records[i-1].is_static?",static":""),
1134 wrepl_name_type_string(records[i].type),
1135 wrepl_name_state_string(records[i].state),
1136 (records[i].is_static?",static":""),
1137 (records[i-1].ips==records[i].ips?"same":"different"),
1141 wins_name_cur->name = &name;
1142 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
1145 records[i].is_static);
1146 wins_name_cur->id = ++ctx->a.max_version;
1147 if (wins_name_cur->flags & 2) {
1148 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
1149 wins_name_cur->addresses.addresses.ips = discard_const(records[i].ips);
1151 wins_name_cur->addresses.ip = records[i].ips[0].ip;
1153 wins_name_cur->unknown = "255.255.255.255";
1155 ret &= test_wrepl_update_one(tctx, ctx, &ctx->a,wins_name_cur);
1156 if (records[i].state == WREPL_STATE_RELEASED) {
1157 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_last, false);
1158 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, false);
1160 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, true);
1163 /* the first one is a cleanup run */
1164 if (!ret && i == 0) ret = true;
1167 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, __location__);
1175 static bool test_conflict_different_owner(struct torture_context *tctx,
1176 struct test_wrepl_conflict_conn *ctx)
1179 struct wrepl_wins_name wins_name1;
1180 struct wrepl_wins_name wins_name2;
1181 struct wrepl_wins_name *wins_name_r1;
1182 struct wrepl_wins_name *wins_name_r2;
1185 const char *line; /* just better debugging */
1186 struct nbt_name name;
1187 const char *comment;
1188 bool extra; /* not the worst case, this is an extra test */
1191 struct wrepl_wins_owner *owner;
1192 enum wrepl_name_type type;
1193 enum wrepl_name_state state;
1194 enum wrepl_name_node node;
1197 const struct wrepl_ip *ips;
1198 bool apply_expected;
1200 struct wrepl_wins_owner *merge_owner;
1201 bool sgroup_cleanup;
1205 * NOTE: the first record and the last applied one
1206 * needs to be from the same owner,
1207 * to not conflict in the next smbtorture run!!!
1210 .line = __location__,
1211 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1215 .type = WREPL_TYPE_UNIQUE,
1216 .state = WREPL_STATE_TOMBSTONE,
1217 .node = WREPL_NODE_B,
1219 .num_ips = ARRAY_SIZE(addresses_B_1),
1220 .ips = addresses_B_1,
1221 .apply_expected = true /* ignored */
1225 .type = WREPL_TYPE_UNIQUE,
1226 .state = WREPL_STATE_TOMBSTONE,
1227 .node = WREPL_NODE_B,
1229 .num_ips = ARRAY_SIZE(addresses_A_1),
1230 .ips = addresses_A_1,
1231 .apply_expected = true /* ignored */
1236 * unique vs unique section
1239 * unique,active vs. unique,active
1240 * => should be replaced
1243 .line = __location__,
1244 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1247 .type = WREPL_TYPE_UNIQUE,
1248 .state = WREPL_STATE_ACTIVE,
1249 .node = WREPL_NODE_B,
1251 .num_ips = ARRAY_SIZE(addresses_A_1),
1252 .ips = addresses_A_1,
1253 .apply_expected = true
1257 .type = WREPL_TYPE_UNIQUE,
1258 .state = WREPL_STATE_ACTIVE,
1259 .node = WREPL_NODE_B,
1261 .num_ips = ARRAY_SIZE(addresses_B_1),
1262 .ips = addresses_B_1,
1263 .apply_expected = true
1268 * unique,active vs. unique,tombstone
1269 * => should NOT be replaced
1272 .line = __location__,
1273 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1276 .type = WREPL_TYPE_UNIQUE,
1277 .state = WREPL_STATE_ACTIVE,
1278 .node = WREPL_NODE_B,
1280 .num_ips = ARRAY_SIZE(addresses_B_1),
1281 .ips = addresses_B_1,
1282 .apply_expected = true
1286 .type = WREPL_TYPE_UNIQUE,
1287 .state = WREPL_STATE_TOMBSTONE,
1288 .node = WREPL_NODE_B,
1290 .num_ips = ARRAY_SIZE(addresses_B_1),
1291 .ips = addresses_B_1,
1292 .apply_expected = false
1297 * unique,released vs. unique,active
1298 * => should be replaced
1301 .line = __location__,
1302 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1305 .type = WREPL_TYPE_UNIQUE,
1306 .state = WREPL_STATE_RELEASED,
1307 .node = WREPL_NODE_B,
1309 .num_ips = ARRAY_SIZE(addresses_B_1),
1310 .ips = addresses_B_1,
1311 .apply_expected = false
1315 .type = WREPL_TYPE_UNIQUE,
1316 .state = WREPL_STATE_ACTIVE,
1317 .node = WREPL_NODE_B,
1319 .num_ips = ARRAY_SIZE(addresses_A_1),
1320 .ips = addresses_A_1,
1321 .apply_expected = true
1326 * unique,released vs. unique,tombstone
1327 * => should be replaced
1330 .line = __location__,
1331 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1334 .type = WREPL_TYPE_UNIQUE,
1335 .state = WREPL_STATE_RELEASED,
1336 .node = WREPL_NODE_B,
1338 .num_ips = ARRAY_SIZE(addresses_A_1),
1339 .ips = addresses_A_1,
1340 .apply_expected = false
1344 .type = WREPL_TYPE_UNIQUE,
1345 .state = WREPL_STATE_TOMBSTONE,
1346 .node = WREPL_NODE_B,
1348 .num_ips = ARRAY_SIZE(addresses_B_1),
1349 .ips = addresses_B_1,
1350 .apply_expected = true
1355 * unique,tombstone vs. unique,active
1356 * => should be replaced
1359 .line = __location__,
1360 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1363 .type = WREPL_TYPE_UNIQUE,
1364 .state = WREPL_STATE_TOMBSTONE,
1365 .node = WREPL_NODE_B,
1367 .num_ips = ARRAY_SIZE(addresses_B_1),
1368 .ips = addresses_B_1,
1369 .apply_expected = true
1373 .type = WREPL_TYPE_UNIQUE,
1374 .state = WREPL_STATE_ACTIVE,
1375 .node = WREPL_NODE_B,
1377 .num_ips = ARRAY_SIZE(addresses_A_1),
1378 .ips = addresses_A_1,
1379 .apply_expected = true
1384 * unique,tombstone vs. unique,tombstone
1385 * => should be replaced
1388 .line = __location__,
1389 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1392 .type = WREPL_TYPE_UNIQUE,
1393 .state = WREPL_STATE_TOMBSTONE,
1394 .node = WREPL_NODE_B,
1396 .num_ips = ARRAY_SIZE(addresses_A_1),
1397 .ips = addresses_A_1,
1398 .apply_expected = true
1402 .type = WREPL_TYPE_UNIQUE,
1403 .state = WREPL_STATE_TOMBSTONE,
1404 .node = WREPL_NODE_B,
1406 .num_ips = ARRAY_SIZE(addresses_B_1),
1407 .ips = addresses_B_1,
1408 .apply_expected = true
1414 * unique vs normal groups section,
1417 * unique,active vs. group,active
1418 * => should be replaced
1421 .line = __location__,
1422 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1425 .type = WREPL_TYPE_UNIQUE,
1426 .state = WREPL_STATE_ACTIVE,
1427 .node = WREPL_NODE_B,
1429 .num_ips = ARRAY_SIZE(addresses_B_1),
1430 .ips = addresses_B_1,
1431 .apply_expected = true
1435 .type = WREPL_TYPE_GROUP,
1436 .state = WREPL_STATE_ACTIVE,
1437 .node = WREPL_NODE_B,
1439 .num_ips = ARRAY_SIZE(addresses_A_1),
1440 .ips = addresses_A_1,
1441 .apply_expected = true
1446 * unique,active vs. group,tombstone
1447 * => should NOT be replaced
1450 .line = __location__,
1451 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1454 .type = WREPL_TYPE_UNIQUE,
1455 .state = WREPL_STATE_ACTIVE,
1456 .node = WREPL_NODE_B,
1458 .num_ips = ARRAY_SIZE(addresses_A_1),
1459 .ips = addresses_A_1,
1460 .apply_expected = true
1464 .type = WREPL_TYPE_GROUP,
1465 .state = WREPL_STATE_TOMBSTONE,
1466 .node = WREPL_NODE_B,
1468 .num_ips = ARRAY_SIZE(addresses_A_1),
1469 .ips = addresses_A_1,
1470 .apply_expected = false
1475 * unique,released vs. group,active
1476 * => should be replaced
1479 .line = __location__,
1480 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1483 .type = WREPL_TYPE_UNIQUE,
1484 .state = WREPL_STATE_RELEASED,
1485 .node = WREPL_NODE_B,
1487 .num_ips = ARRAY_SIZE(addresses_A_1),
1488 .ips = addresses_A_1,
1489 .apply_expected = false
1493 .type = WREPL_TYPE_GROUP,
1494 .state = WREPL_STATE_ACTIVE,
1495 .node = WREPL_NODE_B,
1497 .num_ips = ARRAY_SIZE(addresses_B_1),
1498 .ips = addresses_B_1,
1499 .apply_expected = true
1504 * unique,released vs. group,tombstone
1505 * => should be replaced
1508 .line = __location__,
1509 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1512 .type = WREPL_TYPE_UNIQUE,
1513 .state = WREPL_STATE_RELEASED,
1514 .node = WREPL_NODE_B,
1516 .num_ips = ARRAY_SIZE(addresses_B_1),
1517 .ips = addresses_B_1,
1518 .apply_expected = false
1522 .type = WREPL_TYPE_GROUP,
1523 .state = WREPL_STATE_TOMBSTONE,
1524 .node = WREPL_NODE_B,
1526 .num_ips = ARRAY_SIZE(addresses_A_1),
1527 .ips = addresses_A_1,
1528 .apply_expected = true
1533 * unique,tombstone vs. group,active
1534 * => should be replaced
1537 .line = __location__,
1538 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1541 .type = WREPL_TYPE_UNIQUE,
1542 .state = WREPL_STATE_TOMBSTONE,
1543 .node = WREPL_NODE_B,
1545 .num_ips = ARRAY_SIZE(addresses_A_1),
1546 .ips = addresses_A_1,
1547 .apply_expected = true
1551 .type = WREPL_TYPE_GROUP,
1552 .state = WREPL_STATE_ACTIVE,
1553 .node = WREPL_NODE_B,
1555 .num_ips = ARRAY_SIZE(addresses_B_1),
1556 .ips = addresses_B_1,
1557 .apply_expected = true
1562 * unique,tombstone vs. group,tombstone
1563 * => should be replaced
1566 .line = __location__,
1567 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1570 .type = WREPL_TYPE_UNIQUE,
1571 .state = WREPL_STATE_TOMBSTONE,
1572 .node = WREPL_NODE_B,
1574 .num_ips = ARRAY_SIZE(addresses_B_1),
1575 .ips = addresses_B_1,
1576 .apply_expected = true
1580 .type = WREPL_TYPE_GROUP,
1581 .state = WREPL_STATE_TOMBSTONE,
1582 .node = WREPL_NODE_B,
1584 .num_ips = ARRAY_SIZE(addresses_A_1),
1585 .ips = addresses_A_1,
1586 .apply_expected = true
1591 * unique vs special groups section,
1594 * unique,active vs. sgroup,active
1595 * => should NOT be replaced
1598 .line = __location__,
1599 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1602 .type = WREPL_TYPE_UNIQUE,
1603 .state = WREPL_STATE_ACTIVE,
1604 .node = WREPL_NODE_B,
1606 .num_ips = ARRAY_SIZE(addresses_A_1),
1607 .ips = addresses_A_1,
1608 .apply_expected = true
1612 .type = WREPL_TYPE_SGROUP,
1613 .state = WREPL_STATE_ACTIVE,
1614 .node = WREPL_NODE_B,
1616 .num_ips = ARRAY_SIZE(addresses_A_1),
1617 .ips = addresses_A_1,
1618 .apply_expected = false
1623 * unique,active vs. sgroup,tombstone
1624 * => should NOT be replaced
1627 .line = __location__,
1628 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1631 .type = WREPL_TYPE_UNIQUE,
1632 .state = WREPL_STATE_ACTIVE,
1633 .node = WREPL_NODE_B,
1635 .num_ips = ARRAY_SIZE(addresses_A_1),
1636 .ips = addresses_A_1,
1637 .apply_expected = true
1641 .type = WREPL_TYPE_SGROUP,
1642 .state = WREPL_STATE_TOMBSTONE,
1643 .node = WREPL_NODE_B,
1645 .num_ips = ARRAY_SIZE(addresses_A_1),
1646 .ips = addresses_A_1,
1647 .apply_expected = false
1652 * unique,released vs. sgroup,active
1653 * => should be replaced
1656 .line = __location__,
1657 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1660 .type = WREPL_TYPE_UNIQUE,
1661 .state = WREPL_STATE_RELEASED,
1662 .node = WREPL_NODE_B,
1664 .num_ips = ARRAY_SIZE(addresses_A_1),
1665 .ips = addresses_A_1,
1666 .apply_expected = false
1670 .type = WREPL_TYPE_SGROUP,
1671 .state = WREPL_STATE_ACTIVE,
1672 .node = WREPL_NODE_B,
1674 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1675 .ips = addresses_B_3_4,
1676 .apply_expected = true
1681 * unique,released vs. sgroup,tombstone
1682 * => should be replaced
1685 .line = __location__,
1686 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1689 .type = WREPL_TYPE_UNIQUE,
1690 .state = WREPL_STATE_RELEASED,
1691 .node = WREPL_NODE_B,
1693 .num_ips = ARRAY_SIZE(addresses_B_1),
1694 .ips = addresses_B_1,
1695 .apply_expected = false
1699 .type = WREPL_TYPE_SGROUP,
1700 .state = WREPL_STATE_TOMBSTONE,
1701 .node = WREPL_NODE_B,
1703 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1704 .ips = addresses_A_3_4,
1705 .apply_expected = true
1710 * unique,tombstone vs. sgroup,active
1711 * => should be replaced
1714 .line = __location__,
1715 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1718 .type = WREPL_TYPE_UNIQUE,
1719 .state = WREPL_STATE_TOMBSTONE,
1720 .node = WREPL_NODE_B,
1722 .num_ips = ARRAY_SIZE(addresses_A_1),
1723 .ips = addresses_A_1,
1724 .apply_expected = true
1728 .type = WREPL_TYPE_SGROUP,
1729 .state = WREPL_STATE_ACTIVE,
1730 .node = WREPL_NODE_B,
1732 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1733 .ips = addresses_B_3_4,
1734 .apply_expected = true
1739 * unique,tombstone vs. sgroup,tombstone
1740 * => should be replaced
1743 .line = __location__,
1744 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1747 .type = WREPL_TYPE_UNIQUE,
1748 .state = WREPL_STATE_TOMBSTONE,
1749 .node = WREPL_NODE_B,
1751 .num_ips = ARRAY_SIZE(addresses_B_1),
1752 .ips = addresses_B_1,
1753 .apply_expected = true
1757 .type = WREPL_TYPE_SGROUP,
1758 .state = WREPL_STATE_TOMBSTONE,
1759 .node = WREPL_NODE_B,
1761 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1762 .ips = addresses_A_3_4,
1763 .apply_expected = true
1768 * unique vs multi homed section,
1771 * unique,active vs. mhomed,active
1772 * => should be replaced
1775 .line = __location__,
1776 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1779 .type = WREPL_TYPE_UNIQUE,
1780 .state = WREPL_STATE_ACTIVE,
1781 .node = WREPL_NODE_B,
1783 .num_ips = ARRAY_SIZE(addresses_A_1),
1784 .ips = addresses_A_1,
1785 .apply_expected = true
1789 .type = WREPL_TYPE_MHOMED,
1790 .state = WREPL_STATE_ACTIVE,
1791 .node = WREPL_NODE_B,
1793 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1794 .ips = addresses_B_3_4,
1795 .apply_expected = true
1800 * unique,active vs. mhomed,tombstone
1801 * => should NOT be replaced
1804 .line = __location__,
1805 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1808 .type = WREPL_TYPE_UNIQUE,
1809 .state = WREPL_STATE_ACTIVE,
1810 .node = WREPL_NODE_B,
1812 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1813 .ips = addresses_B_3_4,
1814 .apply_expected = true
1818 .type = WREPL_TYPE_MHOMED,
1819 .state = WREPL_STATE_TOMBSTONE,
1820 .node = WREPL_NODE_B,
1822 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1823 .ips = addresses_B_3_4,
1824 .apply_expected = false
1829 * unique,released vs. mhomed,active
1830 * => should be replaced
1833 .line = __location__,
1834 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1837 .type = WREPL_TYPE_UNIQUE,
1838 .state = WREPL_STATE_RELEASED,
1839 .node = WREPL_NODE_B,
1841 .num_ips = ARRAY_SIZE(addresses_B_1),
1842 .ips = addresses_B_1,
1843 .apply_expected = false
1847 .type = WREPL_TYPE_MHOMED,
1848 .state = WREPL_STATE_ACTIVE,
1849 .node = WREPL_NODE_B,
1851 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1852 .ips = addresses_A_3_4,
1853 .apply_expected = true
1858 * unique,released vs. mhomed,tombstone
1859 * => should be replaced
1862 .line = __location__,
1863 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1866 .type = WREPL_TYPE_UNIQUE,
1867 .state = WREPL_STATE_RELEASED,
1868 .node = WREPL_NODE_B,
1870 .num_ips = ARRAY_SIZE(addresses_A_1),
1871 .ips = addresses_A_1,
1872 .apply_expected = false
1876 .type = WREPL_TYPE_MHOMED,
1877 .state = WREPL_STATE_TOMBSTONE,
1878 .node = WREPL_NODE_B,
1880 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1881 .ips = addresses_B_3_4,
1882 .apply_expected = true
1887 * unique,tombstone vs. mhomed,active
1888 * => should be replaced
1891 .line = __location__,
1892 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1895 .type = WREPL_TYPE_UNIQUE,
1896 .state = WREPL_STATE_TOMBSTONE,
1897 .node = WREPL_NODE_B,
1899 .num_ips = ARRAY_SIZE(addresses_B_1),
1900 .ips = addresses_B_1,
1901 .apply_expected = true
1905 .type = WREPL_TYPE_MHOMED,
1906 .state = WREPL_STATE_ACTIVE,
1907 .node = WREPL_NODE_B,
1909 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1910 .ips = addresses_A_3_4,
1911 .apply_expected = true
1916 * unique,tombstone vs. mhomed,tombstone
1917 * => should be replaced
1920 .line = __location__,
1921 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1924 .type = WREPL_TYPE_UNIQUE,
1925 .state = WREPL_STATE_TOMBSTONE,
1926 .node = WREPL_NODE_B,
1928 .num_ips = ARRAY_SIZE(addresses_A_1),
1929 .ips = addresses_A_1,
1930 .apply_expected = true
1934 .type = WREPL_TYPE_MHOMED,
1935 .state = WREPL_STATE_TOMBSTONE,
1936 .node = WREPL_NODE_B,
1938 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1939 .ips = addresses_B_3_4,
1940 .apply_expected = true
1945 * normal groups vs unique section,
1948 * group,active vs. unique,active
1949 * => should NOT be replaced
1952 .line = __location__,
1953 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1956 .type = WREPL_TYPE_GROUP,
1957 .state = WREPL_STATE_ACTIVE,
1958 .node = WREPL_NODE_B,
1960 .num_ips = ARRAY_SIZE(addresses_A_1),
1961 .ips = addresses_A_1,
1962 .apply_expected = true
1966 .type = WREPL_TYPE_UNIQUE,
1967 .state = WREPL_STATE_ACTIVE,
1968 .node = WREPL_NODE_B,
1970 .num_ips = ARRAY_SIZE(addresses_A_1),
1971 .ips = addresses_A_1,
1972 .apply_expected = false
1977 * group,active vs. unique,tombstone
1978 * => should NOT be replaced
1981 .line = __location__,
1982 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1985 .type = WREPL_TYPE_GROUP,
1986 .state = WREPL_STATE_ACTIVE,
1987 .node = WREPL_NODE_B,
1989 .num_ips = ARRAY_SIZE(addresses_A_1),
1990 .ips = addresses_A_1,
1991 .apply_expected = true
1995 .type = WREPL_TYPE_UNIQUE,
1996 .state = WREPL_STATE_TOMBSTONE,
1997 .node = WREPL_NODE_B,
1999 .num_ips = ARRAY_SIZE(addresses_A_1),
2000 .ips = addresses_A_1,
2001 .apply_expected = false
2006 * group,released vs. unique,active
2007 * => should NOT be replaced
2010 .line = __location__,
2011 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2014 .type = WREPL_TYPE_GROUP,
2015 .state = WREPL_STATE_RELEASED,
2016 .node = WREPL_NODE_B,
2018 .num_ips = ARRAY_SIZE(addresses_A_1),
2019 .ips = addresses_A_1,
2020 .apply_expected = false
2024 .type = WREPL_TYPE_UNIQUE,
2025 .state = WREPL_STATE_ACTIVE,
2026 .node = WREPL_NODE_B,
2028 .num_ips = ARRAY_SIZE(addresses_A_1),
2029 .ips = addresses_A_1,
2030 .apply_expected = false
2035 * group,released vs. unique,tombstone
2036 * => should NOT be replaced
2039 .line = __location__,
2040 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2043 .type = WREPL_TYPE_GROUP,
2044 .state = WREPL_STATE_RELEASED,
2045 .node = WREPL_NODE_B,
2047 .num_ips = ARRAY_SIZE(addresses_A_1),
2048 .ips = addresses_A_1,
2049 .apply_expected = false
2053 .type = WREPL_TYPE_UNIQUE,
2054 .state = WREPL_STATE_TOMBSTONE,
2055 .node = WREPL_NODE_B,
2057 .num_ips = ARRAY_SIZE(addresses_A_1),
2058 .ips = addresses_A_1,
2059 .apply_expected = false
2064 * group,tombstone vs. unique,active
2065 * => should NOT be replaced
2068 .line = __location__,
2069 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2072 .type = WREPL_TYPE_GROUP,
2073 .state = WREPL_STATE_TOMBSTONE,
2074 .node = WREPL_NODE_B,
2076 .num_ips = ARRAY_SIZE(addresses_A_1),
2077 .ips = addresses_A_1,
2078 .apply_expected = true
2082 .type = WREPL_TYPE_UNIQUE,
2083 .state = WREPL_STATE_ACTIVE,
2084 .node = WREPL_NODE_B,
2086 .num_ips = ARRAY_SIZE(addresses_A_1),
2087 .ips = addresses_A_1,
2088 .apply_expected = false
2093 * group,tombstone vs. unique,tombstone
2094 * => should NOT be replaced
2097 .line = __location__,
2098 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2101 .type = WREPL_TYPE_GROUP,
2102 .state = WREPL_STATE_TOMBSTONE,
2103 .node = WREPL_NODE_B,
2105 .num_ips = ARRAY_SIZE(addresses_A_1),
2106 .ips = addresses_A_1,
2107 .apply_expected = true
2111 .type = WREPL_TYPE_UNIQUE,
2112 .state = WREPL_STATE_TOMBSTONE,
2113 .node = WREPL_NODE_B,
2115 .num_ips = ARRAY_SIZE(addresses_A_1),
2116 .ips = addresses_A_1,
2117 .apply_expected = false
2122 * normal groups vs normal groups section,
2125 * group,active vs. group,active
2126 * => should NOT be replaced
2129 .line = __location__,
2130 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2133 .type = WREPL_TYPE_GROUP,
2134 .state = WREPL_STATE_ACTIVE,
2135 .node = WREPL_NODE_B,
2137 .num_ips = ARRAY_SIZE(addresses_A_1),
2138 .ips = addresses_A_1,
2139 .apply_expected = true
2143 .type = WREPL_TYPE_GROUP,
2144 .state = WREPL_STATE_ACTIVE,
2145 .node = WREPL_NODE_B,
2147 .num_ips = ARRAY_SIZE(addresses_A_1),
2148 .ips = addresses_A_1,
2149 .apply_expected = false
2154 * group,active vs. group,tombstone
2155 * => should NOT be replaced
2158 .line = __location__,
2159 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2162 .type = WREPL_TYPE_GROUP,
2163 .state = WREPL_STATE_ACTIVE,
2164 .node = WREPL_NODE_B,
2166 .num_ips = ARRAY_SIZE(addresses_A_1),
2167 .ips = addresses_A_1,
2168 .apply_expected = true
2172 .type = WREPL_TYPE_GROUP,
2173 .state = WREPL_STATE_TOMBSTONE,
2174 .node = WREPL_NODE_B,
2176 .num_ips = ARRAY_SIZE(addresses_A_1),
2177 .ips = addresses_A_1,
2178 .apply_expected = false
2183 * group,released vs. group,active
2184 * => should be replaced
2187 .line = __location__,
2188 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2191 .type = WREPL_TYPE_GROUP,
2192 .state = WREPL_STATE_RELEASED,
2193 .node = WREPL_NODE_B,
2195 .num_ips = ARRAY_SIZE(addresses_A_1),
2196 .ips = addresses_A_1,
2197 .apply_expected = false
2201 .type = WREPL_TYPE_GROUP,
2202 .state = WREPL_STATE_ACTIVE,
2203 .node = WREPL_NODE_B,
2205 .num_ips = ARRAY_SIZE(addresses_B_1),
2206 .ips = addresses_B_1,
2207 .apply_expected = true
2212 * group,released vs. group,tombstone
2213 * => should be replaced
2216 .line = __location__,
2217 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2220 .type = WREPL_TYPE_GROUP,
2221 .state = WREPL_STATE_RELEASED,
2222 .node = WREPL_NODE_B,
2224 .num_ips = ARRAY_SIZE(addresses_A_1),
2225 .ips = addresses_A_1,
2226 .apply_expected = false
2230 .type = WREPL_TYPE_GROUP,
2231 .state = WREPL_STATE_TOMBSTONE,
2232 .node = WREPL_NODE_B,
2234 .num_ips = ARRAY_SIZE(addresses_B_1),
2235 .ips = addresses_B_1,
2236 .apply_expected = true
2241 * group,tombstone vs. group,active
2242 * => should be replaced
2245 .line = __location__,
2246 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2249 .type = WREPL_TYPE_GROUP,
2250 .state = WREPL_STATE_TOMBSTONE,
2251 .node = WREPL_NODE_B,
2253 .num_ips = ARRAY_SIZE(addresses_B_1),
2254 .ips = addresses_B_1,
2255 .apply_expected = true
2259 .type = WREPL_TYPE_GROUP,
2260 .state = WREPL_STATE_ACTIVE,
2261 .node = WREPL_NODE_B,
2263 .num_ips = ARRAY_SIZE(addresses_A_1),
2264 .ips = addresses_A_1,
2265 .apply_expected = true
2270 * group,tombstone vs. group,tombstone
2271 * => should be replaced
2274 .line = __location__,
2275 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2278 .type = WREPL_TYPE_GROUP,
2279 .state = WREPL_STATE_TOMBSTONE,
2280 .node = WREPL_NODE_B,
2282 .num_ips = ARRAY_SIZE(addresses_A_1),
2283 .ips = addresses_A_1,
2284 .apply_expected = true
2288 .type = WREPL_TYPE_GROUP,
2289 .state = WREPL_STATE_TOMBSTONE,
2290 .node = WREPL_NODE_B,
2292 .num_ips = ARRAY_SIZE(addresses_B_1),
2293 .ips = addresses_B_1,
2294 .apply_expected = true
2299 * normal groups vs special groups section,
2302 * group,active vs. sgroup,active
2303 * => should NOT be replaced
2306 .line = __location__,
2307 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2310 .type = WREPL_TYPE_GROUP,
2311 .state = WREPL_STATE_ACTIVE,
2312 .node = WREPL_NODE_B,
2314 .num_ips = ARRAY_SIZE(addresses_B_1),
2315 .ips = addresses_B_1,
2316 .apply_expected = true
2320 .type = WREPL_TYPE_SGROUP,
2321 .state = WREPL_STATE_ACTIVE,
2322 .node = WREPL_NODE_B,
2324 .num_ips = ARRAY_SIZE(addresses_B_1),
2325 .ips = addresses_B_1,
2326 .apply_expected = false
2331 * group,active vs. sgroup,tombstone
2332 * => should NOT be replaced
2335 .line = __location__,
2336 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2339 .type = WREPL_TYPE_GROUP,
2340 .state = WREPL_STATE_ACTIVE,
2341 .node = WREPL_NODE_B,
2343 .num_ips = ARRAY_SIZE(addresses_B_1),
2344 .ips = addresses_B_1,
2345 .apply_expected = true
2349 .type = WREPL_TYPE_SGROUP,
2350 .state = WREPL_STATE_TOMBSTONE,
2351 .node = WREPL_NODE_B,
2353 .num_ips = ARRAY_SIZE(addresses_B_1),
2354 .ips = addresses_B_1,
2355 .apply_expected = false
2360 * group,released vs. sgroup,active
2361 * => should be replaced
2364 .line = __location__,
2365 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2368 .type = WREPL_TYPE_GROUP,
2369 .state = WREPL_STATE_RELEASED,
2370 .node = WREPL_NODE_B,
2372 .num_ips = ARRAY_SIZE(addresses_A_1),
2373 .ips = addresses_A_1,
2374 .apply_expected = false
2378 .type = WREPL_TYPE_SGROUP,
2379 .state = WREPL_STATE_ACTIVE,
2380 .node = WREPL_NODE_B,
2382 .num_ips = ARRAY_SIZE(addresses_B_1),
2383 .ips = addresses_B_1,
2384 .apply_expected = true
2389 * group,released vs. sgroup,tombstone
2390 * => should NOT be replaced
2393 .line = __location__,
2394 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2397 .type = WREPL_TYPE_GROUP,
2398 .state = WREPL_STATE_RELEASED,
2399 .node = WREPL_NODE_B,
2401 .num_ips = ARRAY_SIZE(addresses_B_1),
2402 .ips = addresses_B_1,
2403 .apply_expected = false
2407 .type = WREPL_TYPE_SGROUP,
2408 .state = WREPL_STATE_TOMBSTONE,
2409 .node = WREPL_NODE_B,
2411 .num_ips = ARRAY_SIZE(addresses_B_1),
2412 .ips = addresses_B_1,
2413 .apply_expected = false
2418 * group,tombstone vs. sgroup,active
2419 * => should be replaced
2422 .line = __location__,
2423 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2426 .type = WREPL_TYPE_GROUP,
2427 .state = WREPL_STATE_TOMBSTONE,
2428 .node = WREPL_NODE_B,
2430 .num_ips = ARRAY_SIZE(addresses_B_1),
2431 .ips = addresses_B_1,
2432 .apply_expected = true
2436 .type = WREPL_TYPE_SGROUP,
2437 .state = WREPL_STATE_ACTIVE,
2438 .node = WREPL_NODE_B,
2440 .num_ips = ARRAY_SIZE(addresses_A_1),
2441 .ips = addresses_A_1,
2442 .apply_expected = true
2447 * group,tombstone vs. sgroup,tombstone
2448 * => should be replaced
2451 .line = __location__,
2452 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2455 .type = WREPL_TYPE_GROUP,
2456 .state = WREPL_STATE_TOMBSTONE,
2457 .node = WREPL_NODE_B,
2459 .num_ips = ARRAY_SIZE(addresses_A_1),
2460 .ips = addresses_A_1,
2461 .apply_expected = true
2465 .type = WREPL_TYPE_SGROUP,
2466 .state = WREPL_STATE_TOMBSTONE,
2467 .node = WREPL_NODE_B,
2469 .num_ips = ARRAY_SIZE(addresses_B_1),
2470 .ips = addresses_B_1,
2471 .apply_expected = true
2476 * normal groups vs multi homed section,
2479 * group,active vs. mhomed,active
2480 * => should NOT be replaced
2483 .line = __location__,
2484 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2487 .type = WREPL_TYPE_GROUP,
2488 .state = WREPL_STATE_ACTIVE,
2489 .node = WREPL_NODE_B,
2491 .num_ips = ARRAY_SIZE(addresses_B_1),
2492 .ips = addresses_B_1,
2493 .apply_expected = true
2497 .type = WREPL_TYPE_MHOMED,
2498 .state = WREPL_STATE_ACTIVE,
2499 .node = WREPL_NODE_B,
2501 .num_ips = ARRAY_SIZE(addresses_B_1),
2502 .ips = addresses_B_1,
2503 .apply_expected = false
2508 * group,active vs. mhomed,tombstone
2509 * => should NOT be replaced
2512 .line = __location__,
2513 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2516 .type = WREPL_TYPE_GROUP,
2517 .state = WREPL_STATE_ACTIVE,
2518 .node = WREPL_NODE_B,
2520 .num_ips = ARRAY_SIZE(addresses_B_1),
2521 .ips = addresses_B_1,
2522 .apply_expected = true
2526 .type = WREPL_TYPE_MHOMED,
2527 .state = WREPL_STATE_TOMBSTONE,
2528 .node = WREPL_NODE_B,
2530 .num_ips = ARRAY_SIZE(addresses_B_1),
2531 .ips = addresses_B_1,
2532 .apply_expected = false
2537 * group,released vs. mhomed,active
2538 * => should NOT be replaced
2541 .line = __location__,
2542 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2545 .type = WREPL_TYPE_GROUP,
2546 .state = WREPL_STATE_RELEASED,
2547 .node = WREPL_NODE_B,
2549 .num_ips = ARRAY_SIZE(addresses_B_1),
2550 .ips = addresses_B_1,
2551 .apply_expected = false
2555 .type = WREPL_TYPE_MHOMED,
2556 .state = WREPL_STATE_ACTIVE,
2557 .node = WREPL_NODE_B,
2559 .num_ips = ARRAY_SIZE(addresses_B_1),
2560 .ips = addresses_B_1,
2561 .apply_expected = false
2566 * group,released vs. mhomed,tombstone
2567 * => should NOT be replaced
2570 .line = __location__,
2571 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2574 .type = WREPL_TYPE_GROUP,
2575 .state = WREPL_STATE_RELEASED,
2576 .node = WREPL_NODE_B,
2578 .num_ips = ARRAY_SIZE(addresses_B_1),
2579 .ips = addresses_B_1,
2580 .apply_expected = false
2584 .type = WREPL_TYPE_MHOMED,
2585 .state = WREPL_STATE_TOMBSTONE,
2586 .node = WREPL_NODE_B,
2588 .num_ips = ARRAY_SIZE(addresses_B_1),
2589 .ips = addresses_B_1,
2590 .apply_expected = false
2595 * group,tombstone vs. mhomed,active
2596 * => should be replaced
2599 .line = __location__,
2600 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2603 .type = WREPL_TYPE_GROUP,
2604 .state = WREPL_STATE_TOMBSTONE,
2605 .node = WREPL_NODE_B,
2607 .num_ips = ARRAY_SIZE(addresses_B_1),
2608 .ips = addresses_B_1,
2609 .apply_expected = true
2613 .type = WREPL_TYPE_MHOMED,
2614 .state = WREPL_STATE_ACTIVE,
2615 .node = WREPL_NODE_B,
2617 .num_ips = ARRAY_SIZE(addresses_A_1),
2618 .ips = addresses_A_1,
2619 .apply_expected = true
2624 * group,tombstone vs. mhomed,tombstone
2625 * => should be replaced
2628 .line = __location__,
2629 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2632 .type = WREPL_TYPE_GROUP,
2633 .state = WREPL_STATE_TOMBSTONE,
2634 .node = WREPL_NODE_B,
2636 .num_ips = ARRAY_SIZE(addresses_A_1),
2637 .ips = addresses_A_1,
2638 .apply_expected = true
2642 .type = WREPL_TYPE_MHOMED,
2643 .state = WREPL_STATE_TOMBSTONE,
2644 .node = WREPL_NODE_B,
2646 .num_ips = ARRAY_SIZE(addresses_B_1),
2647 .ips = addresses_B_1,
2648 .apply_expected = true
2653 * special groups vs unique section,
2656 * sgroup,active vs. unique,active
2657 * => should NOT be replaced
2660 .line = __location__,
2661 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2664 .type = WREPL_TYPE_SGROUP,
2665 .state = WREPL_STATE_ACTIVE,
2666 .node = WREPL_NODE_B,
2668 .num_ips = ARRAY_SIZE(addresses_B_1),
2669 .ips = addresses_B_1,
2670 .apply_expected = true
2674 .type = WREPL_TYPE_UNIQUE,
2675 .state = WREPL_STATE_ACTIVE,
2676 .node = WREPL_NODE_B,
2678 .num_ips = ARRAY_SIZE(addresses_B_1),
2679 .ips = addresses_B_1,
2680 .apply_expected = false
2685 * sgroup,active vs. unique,tombstone
2686 * => should NOT be replaced
2689 .line = __location__,
2690 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2693 .type = WREPL_TYPE_SGROUP,
2694 .state = WREPL_STATE_ACTIVE,
2695 .node = WREPL_NODE_B,
2697 .num_ips = ARRAY_SIZE(addresses_B_1),
2698 .ips = addresses_B_1,
2699 .apply_expected = true
2703 .type = WREPL_TYPE_UNIQUE,
2704 .state = WREPL_STATE_TOMBSTONE,
2705 .node = WREPL_NODE_B,
2707 .num_ips = ARRAY_SIZE(addresses_B_1),
2708 .ips = addresses_B_1,
2709 .apply_expected = false
2714 * sgroup,released vs. unique,active
2715 * => should be replaced
2718 .line = __location__,
2719 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2722 .type = WREPL_TYPE_SGROUP,
2723 .state = WREPL_STATE_RELEASED,
2724 .node = WREPL_NODE_B,
2726 .num_ips = ARRAY_SIZE(addresses_B_1),
2727 .ips = addresses_B_1,
2728 .apply_expected = false
2732 .type = WREPL_TYPE_UNIQUE,
2733 .state = WREPL_STATE_ACTIVE,
2734 .node = WREPL_NODE_B,
2736 .num_ips = ARRAY_SIZE(addresses_A_1),
2737 .ips = addresses_A_1,
2738 .apply_expected = true
2743 * sgroup,released vs. unique,tombstone
2744 * => should be replaced
2747 .line = __location__,
2748 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2751 .type = WREPL_TYPE_SGROUP,
2752 .state = WREPL_STATE_RELEASED,
2753 .node = WREPL_NODE_B,
2755 .num_ips = ARRAY_SIZE(addresses_A_1),
2756 .ips = addresses_A_1,
2757 .apply_expected = false
2761 .type = WREPL_TYPE_UNIQUE,
2762 .state = WREPL_STATE_TOMBSTONE,
2763 .node = WREPL_NODE_B,
2765 .num_ips = ARRAY_SIZE(addresses_B_1),
2766 .ips = addresses_B_1,
2767 .apply_expected = true
2772 * sgroup,tombstone vs. unique,active
2773 * => should be replaced
2776 .line = __location__,
2777 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2780 .type = WREPL_TYPE_SGROUP,
2781 .state = WREPL_STATE_TOMBSTONE,
2782 .node = WREPL_NODE_B,
2784 .num_ips = ARRAY_SIZE(addresses_A_1),
2785 .ips = addresses_A_1,
2786 .apply_expected = true
2790 .type = WREPL_TYPE_UNIQUE,
2791 .state = WREPL_STATE_ACTIVE,
2792 .node = WREPL_NODE_B,
2794 .num_ips = ARRAY_SIZE(addresses_B_1),
2795 .ips = addresses_B_1,
2796 .apply_expected = true
2801 * sgroup,tombstone vs. unique,tombstone
2802 * => should be replaced
2805 .line = __location__,
2806 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2809 .type = WREPL_TYPE_SGROUP,
2810 .state = WREPL_STATE_TOMBSTONE,
2811 .node = WREPL_NODE_B,
2813 .num_ips = ARRAY_SIZE(addresses_B_1),
2814 .ips = addresses_B_1,
2815 .apply_expected = true
2819 .type = WREPL_TYPE_UNIQUE,
2820 .state = WREPL_STATE_TOMBSTONE,
2821 .node = WREPL_NODE_B,
2823 .num_ips = ARRAY_SIZE(addresses_A_1),
2824 .ips = addresses_A_1,
2825 .apply_expected = true
2830 * special groups vs normal group section,
2833 * sgroup,active vs. group,active
2834 * => should NOT be replaced
2837 .line = __location__,
2838 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2841 .type = WREPL_TYPE_SGROUP,
2842 .state = WREPL_STATE_ACTIVE,
2843 .node = WREPL_NODE_B,
2845 .num_ips = ARRAY_SIZE(addresses_A_1),
2846 .ips = addresses_A_1,
2847 .apply_expected = true
2851 .type = WREPL_TYPE_GROUP,
2852 .state = WREPL_STATE_ACTIVE,
2853 .node = WREPL_NODE_B,
2855 .num_ips = ARRAY_SIZE(addresses_A_1),
2856 .ips = addresses_A_1,
2857 .apply_expected = false
2862 * sgroup,active vs. group,tombstone
2863 * => should NOT be replaced
2866 .line = __location__,
2867 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2870 .type = WREPL_TYPE_SGROUP,
2871 .state = WREPL_STATE_ACTIVE,
2872 .node = WREPL_NODE_B,
2874 .num_ips = ARRAY_SIZE(addresses_A_1),
2875 .ips = addresses_A_1,
2876 .apply_expected = true
2880 .type = WREPL_TYPE_GROUP,
2881 .state = WREPL_STATE_TOMBSTONE,
2882 .node = WREPL_NODE_B,
2884 .num_ips = ARRAY_SIZE(addresses_A_1),
2885 .ips = addresses_A_1,
2886 .apply_expected = false
2891 * sgroup,released vs. group,active
2892 * => should be replaced
2895 .line = __location__,
2896 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2899 .type = WREPL_TYPE_SGROUP,
2900 .state = WREPL_STATE_RELEASED,
2901 .node = WREPL_NODE_B,
2903 .num_ips = ARRAY_SIZE(addresses_A_1),
2904 .ips = addresses_A_1,
2905 .apply_expected = false
2909 .type = WREPL_TYPE_GROUP,
2910 .state = WREPL_STATE_ACTIVE,
2911 .node = WREPL_NODE_B,
2913 .num_ips = ARRAY_SIZE(addresses_B_1),
2914 .ips = addresses_B_1,
2915 .apply_expected = true
2920 * sgroup,released vs. group,tombstone
2921 * => should be replaced
2924 .line = __location__,
2925 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2928 .type = WREPL_TYPE_SGROUP,
2929 .state = WREPL_STATE_RELEASED,
2930 .node = WREPL_NODE_B,
2932 .num_ips = ARRAY_SIZE(addresses_B_1),
2933 .ips = addresses_B_1,
2934 .apply_expected = false
2938 .type = WREPL_TYPE_GROUP,
2939 .state = WREPL_STATE_TOMBSTONE,
2940 .node = WREPL_NODE_B,
2942 .num_ips = ARRAY_SIZE(addresses_A_1),
2943 .ips = addresses_A_1,
2944 .apply_expected = true
2949 * sgroup,tombstone vs. group,active
2950 * => should NOT be replaced
2953 .line = __location__,
2954 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2957 .type = WREPL_TYPE_SGROUP,
2958 .state = WREPL_STATE_TOMBSTONE,
2959 .node = WREPL_NODE_B,
2961 .num_ips = ARRAY_SIZE(addresses_A_1),
2962 .ips = addresses_A_1,
2963 .apply_expected = true
2967 .type = WREPL_TYPE_GROUP,
2968 .state = WREPL_STATE_ACTIVE,
2969 .node = WREPL_NODE_B,
2971 .num_ips = ARRAY_SIZE(addresses_B_1),
2972 .ips = addresses_B_1,
2973 .apply_expected = true
2978 * sgroup,tombstone vs. group,tombstone
2979 * => should NOT be replaced
2982 .line = __location__,
2983 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2986 .type = WREPL_TYPE_SGROUP,
2987 .state = WREPL_STATE_TOMBSTONE,
2988 .node = WREPL_NODE_B,
2990 .num_ips = ARRAY_SIZE(addresses_B_1),
2991 .ips = addresses_B_1,
2992 .apply_expected = true
2996 .type = WREPL_TYPE_GROUP,
2997 .state = WREPL_STATE_TOMBSTONE,
2998 .node = WREPL_NODE_B,
3000 .num_ips = ARRAY_SIZE(addresses_A_1),
3001 .ips = addresses_A_1,
3002 .apply_expected = true
3007 * special groups (not active) vs special group section,
3010 * sgroup,released vs. sgroup,active
3011 * => should be replaced
3014 .line = __location__,
3015 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3018 .type = WREPL_TYPE_SGROUP,
3019 .state = WREPL_STATE_RELEASED,
3020 .node = WREPL_NODE_B,
3022 .num_ips = ARRAY_SIZE(addresses_A_1),
3023 .ips = addresses_A_1,
3024 .apply_expected = false
3028 .type = WREPL_TYPE_SGROUP,
3029 .state = WREPL_STATE_ACTIVE,
3030 .node = WREPL_NODE_B,
3032 .num_ips = ARRAY_SIZE(addresses_B_1),
3033 .ips = addresses_B_1,
3034 .apply_expected = true
3039 * sgroup,released vs. sgroup,tombstone
3040 * => should be replaced
3043 .line = __location__,
3044 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3047 .type = WREPL_TYPE_SGROUP,
3048 .state = WREPL_STATE_RELEASED,
3049 .node = WREPL_NODE_B,
3051 .num_ips = ARRAY_SIZE(addresses_B_1),
3052 .ips = addresses_B_1,
3053 .apply_expected = false
3057 .type = WREPL_TYPE_SGROUP,
3058 .state = WREPL_STATE_TOMBSTONE,
3059 .node = WREPL_NODE_B,
3061 .num_ips = ARRAY_SIZE(addresses_A_1),
3062 .ips = addresses_A_1,
3063 .apply_expected = true
3068 * sgroup,tombstone vs. sgroup,active
3069 * => should NOT be replaced
3072 .line = __location__,
3073 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3076 .type = WREPL_TYPE_SGROUP,
3077 .state = WREPL_STATE_TOMBSTONE,
3078 .node = WREPL_NODE_B,
3080 .num_ips = ARRAY_SIZE(addresses_A_1),
3081 .ips = addresses_A_1,
3082 .apply_expected = true
3086 .type = WREPL_TYPE_SGROUP,
3087 .state = WREPL_STATE_ACTIVE,
3088 .node = WREPL_NODE_B,
3090 .num_ips = ARRAY_SIZE(addresses_B_1),
3091 .ips = addresses_B_1,
3092 .apply_expected = true
3097 * sgroup,tombstone vs. sgroup,tombstone
3098 * => should NOT be replaced
3101 .line = __location__,
3102 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3105 .type = WREPL_TYPE_SGROUP,
3106 .state = WREPL_STATE_TOMBSTONE,
3107 .node = WREPL_NODE_B,
3109 .num_ips = ARRAY_SIZE(addresses_B_1),
3110 .ips = addresses_B_1,
3111 .apply_expected = true
3115 .type = WREPL_TYPE_SGROUP,
3116 .state = WREPL_STATE_TOMBSTONE,
3117 .node = WREPL_NODE_B,
3119 .num_ips = ARRAY_SIZE(addresses_A_1),
3120 .ips = addresses_A_1,
3121 .apply_expected = true
3126 * special groups vs multi homed section,
3129 * sgroup,active vs. mhomed,active
3130 * => should NOT be replaced
3133 .line = __location__,
3134 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3137 .type = WREPL_TYPE_SGROUP,
3138 .state = WREPL_STATE_ACTIVE,
3139 .node = WREPL_NODE_B,
3141 .num_ips = ARRAY_SIZE(addresses_A_1),
3142 .ips = addresses_A_1,
3143 .apply_expected = true
3147 .type = WREPL_TYPE_MHOMED,
3148 .state = WREPL_STATE_ACTIVE,
3149 .node = WREPL_NODE_B,
3151 .num_ips = ARRAY_SIZE(addresses_A_1),
3152 .ips = addresses_A_1,
3153 .apply_expected = false
3158 * sgroup,active vs. mhomed,tombstone
3159 * => should NOT be replaced
3162 .line = __location__,
3163 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3166 .type = WREPL_TYPE_SGROUP,
3167 .state = WREPL_STATE_ACTIVE,
3168 .node = WREPL_NODE_B,
3170 .num_ips = ARRAY_SIZE(addresses_A_1),
3171 .ips = addresses_A_1,
3172 .apply_expected = true
3176 .type = WREPL_TYPE_MHOMED,
3177 .state = WREPL_STATE_TOMBSTONE,
3178 .node = WREPL_NODE_B,
3180 .num_ips = ARRAY_SIZE(addresses_A_1),
3181 .ips = addresses_A_1,
3182 .apply_expected = false
3187 * sgroup,released vs. mhomed,active
3188 * => should be replaced
3191 .line = __location__,
3192 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3195 .type = WREPL_TYPE_SGROUP,
3196 .state = WREPL_STATE_RELEASED,
3197 .node = WREPL_NODE_B,
3199 .num_ips = ARRAY_SIZE(addresses_A_1),
3200 .ips = addresses_A_1,
3201 .apply_expected = false
3205 .type = WREPL_TYPE_MHOMED,
3206 .state = WREPL_STATE_ACTIVE,
3207 .node = WREPL_NODE_B,
3209 .num_ips = ARRAY_SIZE(addresses_B_1),
3210 .ips = addresses_B_1,
3211 .apply_expected = true
3216 * sgroup,released vs. mhomed,tombstone
3217 * => should be replaced
3220 .line = __location__,
3221 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3224 .type = WREPL_TYPE_SGROUP,
3225 .state = WREPL_STATE_RELEASED,
3226 .node = WREPL_NODE_B,
3228 .num_ips = ARRAY_SIZE(addresses_B_1),
3229 .ips = addresses_B_1,
3230 .apply_expected = false
3234 .type = WREPL_TYPE_MHOMED,
3235 .state = WREPL_STATE_TOMBSTONE,
3236 .node = WREPL_NODE_B,
3238 .num_ips = ARRAY_SIZE(addresses_A_1),
3239 .ips = addresses_A_1,
3240 .apply_expected = true
3245 * sgroup,tombstone vs. mhomed,active
3246 * => should be replaced
3249 .line = __location__,
3250 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3253 .type = WREPL_TYPE_SGROUP,
3254 .state = WREPL_STATE_TOMBSTONE,
3255 .node = WREPL_NODE_B,
3257 .num_ips = ARRAY_SIZE(addresses_A_1),
3258 .ips = addresses_A_1,
3259 .apply_expected = true
3263 .type = WREPL_TYPE_MHOMED,
3264 .state = WREPL_STATE_ACTIVE,
3265 .node = WREPL_NODE_B,
3267 .num_ips = ARRAY_SIZE(addresses_B_1),
3268 .ips = addresses_B_1,
3269 .apply_expected = true
3274 * sgroup,tombstone vs. mhomed,tombstone
3275 * => should be replaced
3278 .line = __location__,
3279 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3282 .type = WREPL_TYPE_SGROUP,
3283 .state = WREPL_STATE_TOMBSTONE,
3284 .node = WREPL_NODE_B,
3286 .num_ips = ARRAY_SIZE(addresses_B_1),
3287 .ips = addresses_B_1,
3288 .apply_expected = true
3292 .type = WREPL_TYPE_MHOMED,
3293 .state = WREPL_STATE_TOMBSTONE,
3294 .node = WREPL_NODE_B,
3296 .num_ips = ARRAY_SIZE(addresses_A_1),
3297 .ips = addresses_A_1,
3298 .apply_expected = true
3303 * multi homed vs. unique section,
3306 * mhomed,active vs. unique,active
3307 * => should be replaced
3310 .line = __location__,
3311 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3314 .type = WREPL_TYPE_MHOMED,
3315 .state = WREPL_STATE_ACTIVE,
3316 .node = WREPL_NODE_B,
3318 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3319 .ips = addresses_A_3_4,
3320 .apply_expected = true
3324 .type = WREPL_TYPE_UNIQUE,
3325 .state = WREPL_STATE_ACTIVE,
3326 .node = WREPL_NODE_B,
3328 .num_ips = ARRAY_SIZE(addresses_B_1),
3329 .ips = addresses_B_1,
3330 .apply_expected = true
3335 * mhomed,active vs. unique,tombstone
3336 * => should NOT be replaced
3339 .line = __location__,
3340 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3343 .type = WREPL_TYPE_MHOMED,
3344 .state = WREPL_STATE_ACTIVE,
3345 .node = WREPL_NODE_B,
3347 .num_ips = ARRAY_SIZE(addresses_B_1),
3348 .ips = addresses_B_1,
3349 .apply_expected = true
3353 .type = WREPL_TYPE_UNIQUE,
3354 .state = WREPL_STATE_TOMBSTONE,
3355 .node = WREPL_NODE_B,
3357 .num_ips = ARRAY_SIZE(addresses_B_1),
3358 .ips = addresses_B_1,
3359 .apply_expected = false
3364 * mhomed,released vs. unique,active
3365 * => should be replaced
3368 .line = __location__,
3369 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3372 .type = WREPL_TYPE_MHOMED,
3373 .state = WREPL_STATE_RELEASED,
3374 .node = WREPL_NODE_B,
3376 .num_ips = ARRAY_SIZE(addresses_A_1),
3377 .ips = addresses_A_1,
3378 .apply_expected = false
3382 .type = WREPL_TYPE_UNIQUE,
3383 .state = WREPL_STATE_ACTIVE,
3384 .node = WREPL_NODE_B,
3386 .num_ips = ARRAY_SIZE(addresses_B_1),
3387 .ips = addresses_B_1,
3388 .apply_expected = true
3393 * mhomed,released vs. uinique,tombstone
3394 * => should be replaced
3397 .line = __location__,
3398 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3401 .type = WREPL_TYPE_MHOMED,
3402 .state = WREPL_STATE_RELEASED,
3403 .node = WREPL_NODE_B,
3405 .num_ips = ARRAY_SIZE(addresses_B_1),
3406 .ips = addresses_B_1,
3407 .apply_expected = false
3411 .type = WREPL_TYPE_UNIQUE,
3412 .state = WREPL_STATE_TOMBSTONE,
3413 .node = WREPL_NODE_B,
3415 .num_ips = ARRAY_SIZE(addresses_A_1),
3416 .ips = addresses_A_1,
3417 .apply_expected = true
3422 * mhomed,tombstone vs. unique,active
3423 * => should be replaced
3426 .line = __location__,
3427 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3430 .type = WREPL_TYPE_MHOMED,
3431 .state = WREPL_STATE_TOMBSTONE,
3432 .node = WREPL_NODE_B,
3434 .num_ips = ARRAY_SIZE(addresses_A_1),
3435 .ips = addresses_A_1,
3436 .apply_expected = true
3440 .type = WREPL_TYPE_UNIQUE,
3441 .state = WREPL_STATE_ACTIVE,
3442 .node = WREPL_NODE_B,
3444 .num_ips = ARRAY_SIZE(addresses_B_1),
3445 .ips = addresses_B_1,
3446 .apply_expected = true
3451 * mhomed,tombstone vs. uinique,tombstone
3452 * => should be replaced
3455 .line = __location__,
3456 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3459 .type = WREPL_TYPE_MHOMED,
3460 .state = WREPL_STATE_TOMBSTONE,
3461 .node = WREPL_NODE_B,
3463 .num_ips = ARRAY_SIZE(addresses_B_1),
3464 .ips = addresses_B_1,
3465 .apply_expected = true
3469 .type = WREPL_TYPE_UNIQUE,
3470 .state = WREPL_STATE_TOMBSTONE,
3471 .node = WREPL_NODE_B,
3473 .num_ips = ARRAY_SIZE(addresses_A_1),
3474 .ips = addresses_A_1,
3475 .apply_expected = true
3480 * multi homed vs. normal group section,
3483 * mhomed,active vs. group,active
3484 * => should be replaced
3487 .line = __location__,
3488 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3491 .type = WREPL_TYPE_MHOMED,
3492 .state = WREPL_STATE_ACTIVE,
3493 .node = WREPL_NODE_B,
3495 .num_ips = ARRAY_SIZE(addresses_A_1),
3496 .ips = addresses_A_1,
3497 .apply_expected = true
3501 .type = WREPL_TYPE_GROUP,
3502 .state = WREPL_STATE_ACTIVE,
3503 .node = WREPL_NODE_B,
3505 .num_ips = ARRAY_SIZE(addresses_B_1),
3506 .ips = addresses_B_1,
3507 .apply_expected = true
3512 * mhomed,active vs. group,tombstone
3513 * => should NOT be replaced
3516 .line = __location__,
3517 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3520 .type = WREPL_TYPE_MHOMED,
3521 .state = WREPL_STATE_ACTIVE,
3522 .node = WREPL_NODE_B,
3524 .num_ips = ARRAY_SIZE(addresses_B_1),
3525 .ips = addresses_B_1,
3526 .apply_expected = true
3530 .type = WREPL_TYPE_GROUP,
3531 .state = WREPL_STATE_TOMBSTONE,
3532 .node = WREPL_NODE_B,
3534 .num_ips = ARRAY_SIZE(addresses_B_1),
3535 .ips = addresses_B_1,
3536 .apply_expected = false
3541 * mhomed,released vs. group,active
3542 * => should be replaced
3545 .line = __location__,
3546 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3549 .type = WREPL_TYPE_MHOMED,
3550 .state = WREPL_STATE_RELEASED,
3551 .node = WREPL_NODE_B,
3553 .num_ips = ARRAY_SIZE(addresses_B_1),
3554 .ips = addresses_B_1,
3555 .apply_expected = false
3559 .type = WREPL_TYPE_GROUP,
3560 .state = WREPL_STATE_ACTIVE,
3561 .node = WREPL_NODE_B,
3563 .num_ips = ARRAY_SIZE(addresses_A_1),
3564 .ips = addresses_A_1,
3565 .apply_expected = true
3570 * mhomed,released vs. group,tombstone
3571 * => should be replaced
3574 .line = __location__,
3575 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3578 .type = WREPL_TYPE_MHOMED,
3579 .state = WREPL_STATE_RELEASED,
3580 .node = WREPL_NODE_B,
3582 .num_ips = ARRAY_SIZE(addresses_A_1),
3583 .ips = addresses_A_1,
3584 .apply_expected = false
3588 .type = WREPL_TYPE_GROUP,
3589 .state = WREPL_STATE_TOMBSTONE,
3590 .node = WREPL_NODE_B,
3592 .num_ips = ARRAY_SIZE(addresses_B_1),
3593 .ips = addresses_B_1,
3594 .apply_expected = true
3599 * mhomed,tombstone vs. group,active
3600 * => should be replaced
3603 .line = __location__,
3604 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3607 .type = WREPL_TYPE_MHOMED,
3608 .state = WREPL_STATE_TOMBSTONE,
3609 .node = WREPL_NODE_B,
3611 .num_ips = ARRAY_SIZE(addresses_B_1),
3612 .ips = addresses_B_1,
3613 .apply_expected = true
3617 .type = WREPL_TYPE_GROUP,
3618 .state = WREPL_STATE_ACTIVE,
3619 .node = WREPL_NODE_B,
3621 .num_ips = ARRAY_SIZE(addresses_A_1),
3622 .ips = addresses_A_1,
3623 .apply_expected = true
3628 * mhomed,tombstone vs. group,tombstone
3629 * => should be replaced
3632 .line = __location__,
3633 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3636 .type = WREPL_TYPE_MHOMED,
3637 .state = WREPL_STATE_TOMBSTONE,
3638 .node = WREPL_NODE_B,
3640 .num_ips = ARRAY_SIZE(addresses_A_1),
3641 .ips = addresses_A_1,
3642 .apply_expected = true
3646 .type = WREPL_TYPE_GROUP,
3647 .state = WREPL_STATE_TOMBSTONE,
3648 .node = WREPL_NODE_B,
3650 .num_ips = ARRAY_SIZE(addresses_B_1),
3651 .ips = addresses_B_1,
3652 .apply_expected = true
3657 * multi homed vs. special group section,
3660 * mhomed,active vs. sgroup,active
3661 * => should NOT be replaced
3664 .line = __location__,
3665 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3668 .type = WREPL_TYPE_MHOMED,
3669 .state = WREPL_STATE_ACTIVE,
3670 .node = WREPL_NODE_B,
3672 .num_ips = ARRAY_SIZE(addresses_A_1),
3673 .ips = addresses_A_1,
3674 .apply_expected = true
3678 .type = WREPL_TYPE_SGROUP,
3679 .state = WREPL_STATE_ACTIVE,
3680 .node = WREPL_NODE_B,
3682 .num_ips = ARRAY_SIZE(addresses_A_1),
3683 .ips = addresses_A_1,
3684 .apply_expected = false
3689 * mhomed,active vs. sgroup,tombstone
3690 * => should NOT be replaced
3693 .line = __location__,
3694 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3697 .type = WREPL_TYPE_MHOMED,
3698 .state = WREPL_STATE_ACTIVE,
3699 .node = WREPL_NODE_B,
3701 .num_ips = ARRAY_SIZE(addresses_A_1),
3702 .ips = addresses_A_1,
3703 .apply_expected = true
3707 .type = WREPL_TYPE_SGROUP,
3708 .state = WREPL_STATE_TOMBSTONE,
3709 .node = WREPL_NODE_B,
3711 .num_ips = ARRAY_SIZE(addresses_A_1),
3712 .ips = addresses_A_1,
3713 .apply_expected = false
3718 * mhomed,released vs. sgroup,active
3719 * => should be replaced
3722 .line = __location__,
3723 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3726 .type = WREPL_TYPE_MHOMED,
3727 .state = WREPL_STATE_RELEASED,
3728 .node = WREPL_NODE_B,
3730 .num_ips = ARRAY_SIZE(addresses_A_1),
3731 .ips = addresses_A_1,
3732 .apply_expected = false
3736 .type = WREPL_TYPE_SGROUP,
3737 .state = WREPL_STATE_ACTIVE,
3738 .node = WREPL_NODE_B,
3740 .num_ips = ARRAY_SIZE(addresses_B_1),
3741 .ips = addresses_B_1,
3742 .apply_expected = true
3747 * mhomed,released vs. sgroup,tombstone
3748 * => should be replaced
3751 .line = __location__,
3752 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3755 .type = WREPL_TYPE_MHOMED,
3756 .state = WREPL_STATE_RELEASED,
3757 .node = WREPL_NODE_B,
3759 .num_ips = ARRAY_SIZE(addresses_B_1),
3760 .ips = addresses_B_1,
3761 .apply_expected = false
3765 .type = WREPL_TYPE_SGROUP,
3766 .state = WREPL_STATE_TOMBSTONE,
3767 .node = WREPL_NODE_B,
3769 .num_ips = ARRAY_SIZE(addresses_A_1),
3770 .ips = addresses_A_1,
3771 .apply_expected = true
3776 * mhomed,tombstone vs. sgroup,active
3777 * => should be replaced
3780 .line = __location__,
3781 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3784 .type = WREPL_TYPE_MHOMED,
3785 .state = WREPL_STATE_TOMBSTONE,
3786 .node = WREPL_NODE_B,
3788 .num_ips = ARRAY_SIZE(addresses_A_1),
3789 .ips = addresses_A_1,
3790 .apply_expected = true
3794 .type = WREPL_TYPE_SGROUP,
3795 .state = WREPL_STATE_ACTIVE,
3796 .node = WREPL_NODE_B,
3798 .num_ips = ARRAY_SIZE(addresses_B_1),
3799 .ips = addresses_B_1,
3800 .apply_expected = true
3805 * mhomed,tombstone vs. sgroup,tombstone
3806 * => should be replaced
3809 .line = __location__,
3810 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3813 .type = WREPL_TYPE_MHOMED,
3814 .state = WREPL_STATE_TOMBSTONE,
3815 .node = WREPL_NODE_B,
3817 .num_ips = ARRAY_SIZE(addresses_B_1),
3818 .ips = addresses_B_1,
3819 .apply_expected = true
3823 .type = WREPL_TYPE_SGROUP,
3824 .state = WREPL_STATE_TOMBSTONE,
3825 .node = WREPL_NODE_B,
3827 .num_ips = ARRAY_SIZE(addresses_A_1),
3828 .ips = addresses_A_1,
3829 .apply_expected = true
3834 * multi homed vs. mlti homed section,
3837 * mhomed,active vs. mhomed,active
3838 * => should be replaced
3841 .line = __location__,
3842 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3845 .type = WREPL_TYPE_MHOMED,
3846 .state = WREPL_STATE_ACTIVE,
3847 .node = WREPL_NODE_B,
3849 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3850 .ips = addresses_A_3_4,
3851 .apply_expected = true
3855 .type = WREPL_TYPE_MHOMED,
3856 .state = WREPL_STATE_ACTIVE,
3857 .node = WREPL_NODE_B,
3859 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3860 .ips = addresses_B_3_4,
3861 .apply_expected = true
3866 * mhomed,active vs. mhomed,tombstone
3867 * => should NOT be replaced
3870 .line = __location__,
3871 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3874 .type = WREPL_TYPE_MHOMED,
3875 .state = WREPL_STATE_ACTIVE,
3876 .node = WREPL_NODE_B,
3878 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3879 .ips = addresses_B_3_4,
3880 .apply_expected = true
3884 .type = WREPL_TYPE_MHOMED,
3885 .state = WREPL_STATE_TOMBSTONE,
3886 .node = WREPL_NODE_B,
3888 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3889 .ips = addresses_B_3_4,
3890 .apply_expected = false
3895 * mhomed,released vs. mhomed,active
3896 * => should be replaced
3899 .line = __location__,
3900 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3903 .type = WREPL_TYPE_MHOMED,
3904 .state = WREPL_STATE_RELEASED,
3905 .node = WREPL_NODE_B,
3907 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3908 .ips = addresses_B_3_4,
3909 .apply_expected = false
3913 .type = WREPL_TYPE_MHOMED,
3914 .state = WREPL_STATE_ACTIVE,
3915 .node = WREPL_NODE_B,
3917 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3918 .ips = addresses_A_3_4,
3919 .apply_expected = true
3924 * mhomed,released vs. mhomed,tombstone
3925 * => should be replaced
3928 .line = __location__,
3929 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3932 .type = WREPL_TYPE_MHOMED,
3933 .state = WREPL_STATE_RELEASED,
3934 .node = WREPL_NODE_B,
3936 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3937 .ips = addresses_A_3_4,
3938 .apply_expected = false
3942 .type = WREPL_TYPE_MHOMED,
3943 .state = WREPL_STATE_TOMBSTONE,
3944 .node = WREPL_NODE_B,
3946 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3947 .ips = addresses_B_3_4,
3948 .apply_expected = true
3953 * mhomed,tombstone vs. mhomed,active
3954 * => should be replaced
3957 .line = __location__,
3958 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3961 .type = WREPL_TYPE_MHOMED,
3962 .state = WREPL_STATE_TOMBSTONE,
3963 .node = WREPL_NODE_B,
3965 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3966 .ips = addresses_B_3_4,
3967 .apply_expected = true
3971 .type = WREPL_TYPE_MHOMED,
3972 .state = WREPL_STATE_ACTIVE,
3973 .node = WREPL_NODE_B,
3975 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3976 .ips = addresses_A_3_4,
3977 .apply_expected = true
3982 * mhomed,tombstone vs. mhomed,tombstone
3983 * => should be replaced
3986 .line = __location__,
3987 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3990 .type = WREPL_TYPE_MHOMED,
3991 .state = WREPL_STATE_TOMBSTONE,
3992 .node = WREPL_NODE_B,
3994 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3995 .ips = addresses_A_3_4,
3996 .apply_expected = true
4000 .type = WREPL_TYPE_MHOMED,
4001 .state = WREPL_STATE_TOMBSTONE,
4002 .node = WREPL_NODE_B,
4004 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4005 .ips = addresses_B_3_4,
4006 .apply_expected = true
4010 .line = __location__,
4011 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4015 .type = WREPL_TYPE_UNIQUE,
4016 .state = WREPL_STATE_TOMBSTONE,
4017 .node = WREPL_NODE_B,
4019 .num_ips = ARRAY_SIZE(addresses_B_1),
4020 .ips = addresses_B_1,
4021 .apply_expected = true,
4025 .type = WREPL_TYPE_UNIQUE,
4026 .state = WREPL_STATE_TOMBSTONE,
4027 .node = WREPL_NODE_B,
4029 .num_ips = ARRAY_SIZE(addresses_A_1),
4030 .ips = addresses_A_1,
4031 .apply_expected = true,
4035 * special group vs special group section,
4038 * sgroup,active vs. sgroup,active same addresses
4039 * => should be NOT replaced
4042 .line = __location__,
4043 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4044 .comment= "A:A_3_4 vs. B:A_3_4",
4048 .type = WREPL_TYPE_SGROUP,
4049 .state = WREPL_STATE_ACTIVE,
4050 .node = WREPL_NODE_B,
4052 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4053 .ips = addresses_A_3_4,
4054 .apply_expected = true
4058 .type = WREPL_TYPE_SGROUP,
4059 .state = WREPL_STATE_ACTIVE,
4060 .node = WREPL_NODE_B,
4062 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4063 .ips = addresses_A_3_4,
4064 .apply_expected = false,
4065 .sgroup_cleanup = true
4069 * sgroup,active vs. sgroup,active same addresses
4070 * => should be NOT replaced
4073 .line = __location__,
4074 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4075 .comment= "A:A_3_4 vs. B:NULL",
4079 .type = WREPL_TYPE_SGROUP,
4080 .state = WREPL_STATE_ACTIVE,
4081 .node = WREPL_NODE_B,
4083 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4084 .ips = addresses_A_3_4,
4085 .apply_expected = true
4089 .type = WREPL_TYPE_SGROUP,
4090 .state = WREPL_STATE_ACTIVE,
4091 .node = WREPL_NODE_B,
4095 .apply_expected = false,
4096 .sgroup_cleanup = true
4100 * sgroup,active vs. sgroup,active subset addresses, special case...
4101 * => should NOT be replaced
4104 .line = __location__,
4105 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4106 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4",
4110 .type = WREPL_TYPE_SGROUP,
4111 .state = WREPL_STATE_ACTIVE,
4112 .node = WREPL_NODE_B,
4114 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4115 .ips = addresses_A_3_4_X_3_4,
4116 .apply_expected = true,
4120 .type = WREPL_TYPE_SGROUP,
4121 .state = WREPL_STATE_ACTIVE,
4122 .node = WREPL_NODE_B,
4124 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4125 .ips = addresses_A_3_4,
4126 .apply_expected = false,
4130 .line = __location__,
4131 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4135 .type = WREPL_TYPE_SGROUP,
4136 .state = WREPL_STATE_ACTIVE,
4137 .node = WREPL_NODE_B,
4141 .apply_expected = false,
4145 .type = WREPL_TYPE_SGROUP,
4146 .state = WREPL_STATE_ACTIVE,
4147 .node = WREPL_NODE_B,
4151 .apply_expected = false,
4155 * sgroup,active vs. sgroup,active different addresses, but owner changed
4156 * => should be replaced
4159 .line = __location__,
4160 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4161 .comment= "A:B_3_4 vs. B:A_3_4",
4165 .type = WREPL_TYPE_SGROUP,
4166 .state = WREPL_STATE_ACTIVE,
4167 .node = WREPL_NODE_B,
4169 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4170 .ips = addresses_B_3_4,
4171 .apply_expected = true,
4175 .type = WREPL_TYPE_SGROUP,
4176 .state = WREPL_STATE_ACTIVE,
4177 .node = WREPL_NODE_B,
4179 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4180 .ips = addresses_A_3_4,
4181 .apply_expected = true,
4182 .sgroup_cleanup = true
4186 * sgroup,active vs. sgroup,active different addresses, but owner changed
4187 * => should be replaced
4190 .line = __location__,
4191 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4192 .comment= "A:A_3_4 vs. B:A_3_4_OWNER_B",
4196 .type = WREPL_TYPE_SGROUP,
4197 .state = WREPL_STATE_ACTIVE,
4198 .node = WREPL_NODE_B,
4200 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4201 .ips = addresses_A_3_4,
4202 .apply_expected = true,
4206 .type = WREPL_TYPE_SGROUP,
4207 .state = WREPL_STATE_ACTIVE,
4208 .node = WREPL_NODE_B,
4210 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4211 .ips = addresses_A_3_4_OWNER_B,
4212 .apply_expected = true,
4213 .sgroup_cleanup = true
4217 * sgroup,active vs. sgroup,active different addresses, but owner changed
4218 * => should be replaced
4221 .line = __location__,
4222 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4223 .comment= "A:A_3_4_OWNER_B vs. B:A_3_4",
4227 .type = WREPL_TYPE_SGROUP,
4228 .state = WREPL_STATE_ACTIVE,
4229 .node = WREPL_NODE_B,
4231 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4232 .ips = addresses_A_3_4_OWNER_B,
4233 .apply_expected = true,
4237 .type = WREPL_TYPE_SGROUP,
4238 .state = WREPL_STATE_ACTIVE,
4239 .node = WREPL_NODE_B,
4241 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4242 .ips = addresses_A_3_4,
4243 .apply_expected = true,
4244 .sgroup_cleanup = true
4248 * sgroup,active vs. sgroup,active different addresses
4249 * => should be merged
4252 .line = __location__,
4253 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4254 .comment= "A:A_3_4 vs. B:B_3_4 => C:A_3_4_B_3_4",
4258 .type = WREPL_TYPE_SGROUP,
4259 .state = WREPL_STATE_ACTIVE,
4260 .node = WREPL_NODE_B,
4262 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4263 .ips = addresses_A_3_4,
4264 .apply_expected = true,
4268 .type = WREPL_TYPE_SGROUP,
4269 .state = WREPL_STATE_ACTIVE,
4270 .node = WREPL_NODE_B,
4272 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4273 .ips = addresses_B_3_4,
4274 .sgroup_merge = true,
4275 .sgroup_cleanup = true,
4279 * sgroup,active vs. sgroup,active different addresses, special case...
4280 * => should be merged
4283 .line = __location__,
4284 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4285 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4_X_3_4",
4289 .type = WREPL_TYPE_SGROUP,
4290 .state = WREPL_STATE_ACTIVE,
4291 .node = WREPL_NODE_B,
4293 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4294 .ips = addresses_B_3_4_X_3_4,
4295 .apply_expected = true,
4299 .type = WREPL_TYPE_SGROUP,
4300 .state = WREPL_STATE_ACTIVE,
4301 .node = WREPL_NODE_B,
4303 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4304 .ips = addresses_A_3_4,
4305 .sgroup_merge = true,
4306 .merge_owner = &ctx->b,
4307 .sgroup_cleanup = false
4311 .line = __location__,
4312 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4316 .type = WREPL_TYPE_SGROUP,
4317 .state = WREPL_STATE_ACTIVE,
4318 .node = WREPL_NODE_B,
4320 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4_OWNER_B),
4321 .ips = addresses_A_3_4_X_3_4_OWNER_B,
4322 .apply_expected = true,
4326 .type = WREPL_TYPE_SGROUP,
4327 .state = WREPL_STATE_ACTIVE,
4328 .node = WREPL_NODE_B,
4332 .apply_expected = false,
4336 * sgroup,active vs. sgroup,active different addresses, special case...
4337 * => should be merged
4340 .line = __location__,
4341 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4342 .comment= "A:X_3_4 vs. B:A_3_4 => C:A_3_4_X_3_4",
4346 .type = WREPL_TYPE_SGROUP,
4347 .state = WREPL_STATE_ACTIVE,
4348 .node = WREPL_NODE_B,
4350 .num_ips = ARRAY_SIZE(addresses_X_3_4),
4351 .ips = addresses_X_3_4,
4352 .apply_expected = true,
4356 .type = WREPL_TYPE_SGROUP,
4357 .state = WREPL_STATE_ACTIVE,
4358 .node = WREPL_NODE_B,
4360 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4361 .ips = addresses_A_3_4,
4362 .sgroup_merge = true,
4363 .sgroup_cleanup = false
4367 .line = __location__,
4368 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4372 .type = WREPL_TYPE_SGROUP,
4373 .state = WREPL_STATE_ACTIVE,
4374 .node = WREPL_NODE_B,
4378 .apply_expected = false,
4382 .type = WREPL_TYPE_SGROUP,
4383 .state = WREPL_STATE_ACTIVE,
4384 .node = WREPL_NODE_B,
4388 .apply_expected = false,
4392 * sgroup,active vs. sgroup,active different addresses, special case...
4393 * => should be merged
4396 .line = __location__,
4397 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4398 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4_OWNER_B => B:A_3_4_OWNER_B_X_3_4",
4402 .type = WREPL_TYPE_SGROUP,
4403 .state = WREPL_STATE_ACTIVE,
4404 .node = WREPL_NODE_B,
4406 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4407 .ips = addresses_A_3_4_X_3_4,
4408 .apply_expected = true,
4412 .type = WREPL_TYPE_SGROUP,
4413 .state = WREPL_STATE_ACTIVE,
4414 .node = WREPL_NODE_B,
4416 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4417 .ips = addresses_A_3_4_OWNER_B,
4418 .sgroup_merge = true,
4419 .merge_owner = &ctx->b,
4423 .line = __location__,
4424 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4428 .type = WREPL_TYPE_SGROUP,
4429 .state = WREPL_STATE_ACTIVE,
4430 .node = WREPL_NODE_B,
4434 .apply_expected = false,
4438 .type = WREPL_TYPE_SGROUP,
4439 .state = WREPL_STATE_ACTIVE,
4440 .node = WREPL_NODE_B,
4444 .apply_expected = false,
4448 * sgroup,active vs. sgroup,active partly different addresses, special case...
4449 * => should be merged
4452 .line = __location__,
4453 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4454 .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",
4458 .type = WREPL_TYPE_SGROUP,
4459 .state = WREPL_STATE_ACTIVE,
4460 .node = WREPL_NODE_B,
4462 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4463 .ips = addresses_B_3_4_X_3_4,
4464 .apply_expected = true,
4468 .type = WREPL_TYPE_SGROUP,
4469 .state = WREPL_STATE_ACTIVE,
4470 .node = WREPL_NODE_B,
4472 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_1_2),
4473 .ips = addresses_B_3_4_X_1_2,
4474 .sgroup_merge = true,
4475 .sgroup_cleanup = false
4479 .line = __location__,
4480 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4484 .type = WREPL_TYPE_SGROUP,
4485 .state = WREPL_STATE_ACTIVE,
4486 .node = WREPL_NODE_B,
4490 .apply_expected = false,
4494 .type = WREPL_TYPE_SGROUP,
4495 .state = WREPL_STATE_ACTIVE,
4496 .node = WREPL_NODE_B,
4500 .apply_expected = false,
4504 * sgroup,active vs. sgroup,active different addresses, special case...
4505 * => should be merged
4508 .line = __location__,
4509 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4510 .comment= "A:A_3_4_B_3_4 vs. B:NULL => B:A_3_4",
4514 .type = WREPL_TYPE_SGROUP,
4515 .state = WREPL_STATE_ACTIVE,
4516 .node = WREPL_NODE_B,
4518 .num_ips = ARRAY_SIZE(addresses_A_3_4_B_3_4),
4519 .ips = addresses_A_3_4_B_3_4,
4520 .apply_expected = true,
4524 .type = WREPL_TYPE_SGROUP,
4525 .state = WREPL_STATE_ACTIVE,
4526 .node = WREPL_NODE_B,
4530 .sgroup_merge = true,
4531 .merge_owner = &ctx->b,
4532 .sgroup_cleanup = true
4536 .line = __location__,
4537 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4541 .type = WREPL_TYPE_SGROUP,
4542 .state = WREPL_STATE_ACTIVE,
4543 .node = WREPL_NODE_B,
4547 .apply_expected = false,
4551 .type = WREPL_TYPE_UNIQUE,
4552 .state = WREPL_STATE_TOMBSTONE,
4553 .node = WREPL_NODE_B,
4555 .num_ips = ARRAY_SIZE(addresses_A_1),
4556 .ips = addresses_A_1,
4557 .apply_expected = true,
4561 * sgroup,active vs. sgroup,active different addresses, special case...
4562 * => should be merged
4565 .line = __location__,
4566 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4567 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:X_3_4",
4571 .type = WREPL_TYPE_SGROUP,
4572 .state = WREPL_STATE_ACTIVE,
4573 .node = WREPL_NODE_B,
4575 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4576 .ips = addresses_B_3_4_X_3_4,
4577 .apply_expected = true,
4581 .type = WREPL_TYPE_SGROUP,
4582 .state = WREPL_STATE_ACTIVE,
4583 .node = WREPL_NODE_B,
4587 .sgroup_merge = true,
4588 .merge_owner = &ctx->b,
4589 .sgroup_cleanup = true
4593 .line = __location__,
4594 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4598 .type = WREPL_TYPE_SGROUP,
4599 .state = WREPL_STATE_ACTIVE,
4600 .node = WREPL_NODE_B,
4604 .apply_expected = false,
4608 .type = WREPL_TYPE_UNIQUE,
4609 .state = WREPL_STATE_TOMBSTONE,
4610 .node = WREPL_NODE_B,
4612 .num_ips = ARRAY_SIZE(addresses_A_1),
4613 .ips = addresses_A_1,
4614 .apply_expected = true,
4619 * sgroup,active vs. sgroup,tombstone different no addresses, special
4620 * => should be replaced
4623 .line = __location__,
4624 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4625 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:NULL",
4629 .type = WREPL_TYPE_SGROUP,
4630 .state = WREPL_STATE_ACTIVE,
4631 .node = WREPL_NODE_B,
4633 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4634 .ips = addresses_B_3_4_X_3_4,
4635 .apply_expected = true,
4639 .type = WREPL_TYPE_SGROUP,
4640 .state = WREPL_STATE_TOMBSTONE,
4641 .node = WREPL_NODE_B,
4645 .apply_expected = true,
4649 * sgroup,active vs. sgroup,tombstone different addresses
4650 * => should be replaced
4653 .line = __location__,
4654 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4655 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4",
4659 .type = WREPL_TYPE_SGROUP,
4660 .state = WREPL_STATE_ACTIVE,
4661 .node = WREPL_NODE_B,
4663 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4664 .ips = addresses_B_3_4_X_3_4,
4665 .apply_expected = true,
4669 .type = WREPL_TYPE_SGROUP,
4670 .state = WREPL_STATE_TOMBSTONE,
4671 .node = WREPL_NODE_B,
4673 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4674 .ips = addresses_A_3_4,
4675 .apply_expected = true,
4679 * sgroup,active vs. sgroup,tombstone subset addresses
4680 * => should be replaced
4683 .line = __location__,
4684 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4685 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4 => B:B_3_4",
4689 .type = WREPL_TYPE_SGROUP,
4690 .state = WREPL_STATE_ACTIVE,
4691 .node = WREPL_NODE_B,
4693 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4694 .ips = addresses_B_3_4_X_3_4,
4695 .apply_expected = true,
4699 .type = WREPL_TYPE_SGROUP,
4700 .state = WREPL_STATE_TOMBSTONE,
4701 .node = WREPL_NODE_B,
4703 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4704 .ips = addresses_B_3_4,
4705 .apply_expected = true,
4709 * sgroup,active vs. sgroup,active same addresses
4710 * => should be replaced
4713 .line = __location__,
4714 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4715 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4_X_3_4 => B:B_3_4_X_3_4",
4719 .type = WREPL_TYPE_SGROUP,
4720 .state = WREPL_STATE_ACTIVE,
4721 .node = WREPL_NODE_B,
4723 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4724 .ips = addresses_B_3_4_X_3_4,
4725 .apply_expected = true,
4729 .type = WREPL_TYPE_SGROUP,
4730 .state = WREPL_STATE_TOMBSTONE,
4731 .node = WREPL_NODE_B,
4733 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4734 .ips = addresses_B_3_4_X_3_4,
4735 .apply_expected = true,
4740 * This should be the last record in this array,
4741 * we need to make sure the we leave a tombstoned unique entry
4745 .line = __location__,
4746 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4750 .type = WREPL_TYPE_UNIQUE,
4751 .state = WREPL_STATE_TOMBSTONE,
4752 .node = WREPL_NODE_B,
4754 .num_ips = ARRAY_SIZE(addresses_A_1),
4755 .ips = addresses_A_1,
4756 .apply_expected = true
4760 .type = WREPL_TYPE_UNIQUE,
4761 .state = WREPL_STATE_TOMBSTONE,
4762 .node = WREPL_NODE_B,
4764 .num_ips = ARRAY_SIZE(addresses_A_1),
4765 .ips = addresses_A_1,
4766 .apply_expected = true
4768 }}; /* do not add entries here, this should be the last record! */
4770 wins_name_r1 = &wins_name1;
4771 wins_name_r2 = &wins_name2;
4773 torture_comment(tctx, "Test Replica Conflicts with different owners\n");
4775 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
4777 if (!records[i].extra && !records[i].cleanup) {
4778 /* we should test the worst cases */
4779 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
4780 torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n",
4781 __location__, i, records[i].line);
4783 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
4784 torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n",
4785 __location__, i, records[i].line);
4790 if (!records[i].cleanup) {
4791 const char *expected;
4794 if (records[i].r2.sgroup_merge) {
4795 expected = "SGROUP_MERGE";
4796 } else if (records[i].r2.apply_expected) {
4797 expected = "REPLACE";
4799 expected = "NOT REPLACE";
4802 if (!records[i].r1.ips && !records[i].r2.ips) {
4803 ips = "with no ip(s)";
4804 } else if (records[i].r1.ips==records[i].r2.ips) {
4805 ips = "with same ip(s)";
4807 ips = "with different ip(s)";
4810 torture_comment(tctx, "%s,%s%s vs. %s,%s%s %s => %s\n",
4811 wrepl_name_type_string(records[i].r1.type),
4812 wrepl_name_state_string(records[i].r1.state),
4813 (records[i].r1.is_static?",static":""),
4814 wrepl_name_type_string(records[i].r2.type),
4815 wrepl_name_state_string(records[i].r2.state),
4816 (records[i].r2.is_static?",static":""),
4817 (records[i].comment?records[i].comment:ips),
4824 wins_name_r1->name = &records[i].name;
4825 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
4826 records[i].r1.state,
4828 records[i].r1.is_static);
4829 wins_name_r1->id = ++records[i].r1.owner->max_version;
4830 if (wins_name_r1->flags & 2) {
4831 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
4832 wins_name_r1->addresses.addresses.ips = discard_const(records[i].r1.ips);
4834 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
4836 wins_name_r1->unknown = "255.255.255.255";
4839 ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1);
4840 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4841 wins_name_r1, records[i].r1.apply_expected);
4846 wins_name_r2->name = &records[i].name;
4847 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
4848 records[i].r2.state,
4850 records[i].r2.is_static);
4851 wins_name_r2->id = ++records[i].r2.owner->max_version;
4852 if (wins_name_r2->flags & 2) {
4853 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
4854 wins_name_r2->addresses.addresses.ips = discard_const(records[i].r2.ips);
4856 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
4858 wins_name_r2->unknown = "255.255.255.255";
4861 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4862 if (records[i].r1.state == WREPL_STATE_RELEASED) {
4863 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4864 wins_name_r1, false);
4865 } else if (records[i].r2.sgroup_merge) {
4866 ret &= test_wrepl_sgroup_merged(tctx, ctx, records[i].r2.merge_owner,
4867 records[i].r1.owner,
4868 records[i].r1.num_ips, records[i].r1.ips,
4869 records[i].r2.owner,
4870 records[i].r2.num_ips, records[i].r2.ips,
4872 } else if (records[i].r1.owner != records[i].r2.owner) {
4874 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
4875 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4876 wins_name_r1, _expected);
4878 if (records[i].r2.state == WREPL_STATE_RELEASED) {
4879 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner,
4880 wins_name_r2, false);
4881 } else if (!records[i].r2.sgroup_merge) {
4882 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner,
4883 wins_name_r2, records[i].r2.apply_expected);
4886 if (records[i].r2.sgroup_cleanup) {
4888 torture_comment(tctx, "failed before sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4892 /* clean up the SGROUP record */
4893 wins_name_r1->name = &records[i].name;
4894 wins_name_r1->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4896 WREPL_NODE_B, false);
4897 wins_name_r1->id = ++records[i].r1.owner->max_version;
4898 wins_name_r1->addresses.addresses.num_ips = 0;
4899 wins_name_r1->addresses.addresses.ips = NULL;
4900 wins_name_r1->unknown = "255.255.255.255";
4901 ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1);
4903 /* here we test how names from an owner are deleted */
4904 if (records[i].r2.sgroup_merge && records[i].r2.num_ips) {
4905 ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL,
4906 records[i].r2.owner,
4907 records[i].r2.num_ips, records[i].r2.ips,
4908 records[i].r1.owner,
4913 /* clean up the SGROUP record */
4914 wins_name_r2->name = &records[i].name;
4915 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4917 WREPL_NODE_B, false);
4918 wins_name_r2->id = ++records[i].r2.owner->max_version;
4919 wins_name_r2->addresses.addresses.num_ips = 0;
4920 wins_name_r2->addresses.addresses.ips = NULL;
4921 wins_name_r2->unknown = "255.255.255.255";
4922 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4924 /* take ownership of the SGROUP record */
4925 wins_name_r2->name = &records[i].name;
4926 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4928 WREPL_NODE_B, false);
4929 wins_name_r2->id = ++records[i].r2.owner->max_version;
4930 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4931 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4932 wins_name_r2->unknown = "255.255.255.255";
4933 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4934 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true);
4936 /* overwrite the SGROUP record with unique,tombstone */
4937 wins_name_r2->name = &records[i].name;
4938 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4939 WREPL_STATE_TOMBSTONE,
4940 WREPL_NODE_B, false);
4941 wins_name_r2->id = ++records[i].r2.owner->max_version;
4942 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4943 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4944 wins_name_r2->unknown = "255.255.255.255";
4945 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4946 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true);
4949 torture_comment(tctx, "failed in sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4954 /* the first one is a cleanup run */
4955 if (!ret && i == 0) ret = true;
4958 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
4966 static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx,
4967 struct test_wrepl_conflict_conn *ctx)
4971 struct wrepl_wins_name wins_name_;
4972 struct wrepl_wins_name *wins_name = &wins_name_;
4973 struct nbt_name_register name_register_;
4974 struct nbt_name_register *name_register = &name_register_;
4975 struct nbt_name_release release_;
4976 struct nbt_name_release *release = &release_;
4979 const char *line; /* just better debugging */
4980 struct nbt_name name;
4985 const struct wrepl_ip *ips;
4986 bool apply_expected;
4989 enum wrepl_name_type type;
4990 enum wrepl_name_state state;
4991 enum wrepl_name_node node;
4994 const struct wrepl_ip *ips;
4995 bool apply_expected;
4999 * unique vs. unique section
5002 * unique,released vs. unique,active with same ip(s)
5005 .line = __location__,
5006 .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL),
5010 .num_ips = ctx->addresses_best_num,
5011 .ips = ctx->addresses_best,
5012 .apply_expected = true
5015 .type = WREPL_TYPE_UNIQUE,
5016 .state = WREPL_STATE_ACTIVE,
5017 .node = WREPL_NODE_B,
5019 .num_ips = ctx->addresses_best_num,
5020 .ips = ctx->addresses_best,
5021 .apply_expected = true
5025 * unique,released vs. unique,active with different ip(s)
5028 .line = __location__,
5029 .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL),
5033 .num_ips = ctx->addresses_best_num,
5034 .ips = ctx->addresses_best,
5035 .apply_expected = true
5038 .type = WREPL_TYPE_UNIQUE,
5039 .state = WREPL_STATE_ACTIVE,
5040 .node = WREPL_NODE_B,
5042 .num_ips = ARRAY_SIZE(addresses_B_1),
5043 .ips = addresses_B_1,
5044 .apply_expected = true
5048 * unique,released vs. unique,tombstone with same ip(s)
5051 .line = __location__,
5052 .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL),
5056 .num_ips = ctx->addresses_best_num,
5057 .ips = ctx->addresses_best,
5058 .apply_expected = true
5061 .type = WREPL_TYPE_UNIQUE,
5062 .state = WREPL_STATE_TOMBSTONE,
5063 .node = WREPL_NODE_B,
5065 .num_ips = ctx->addresses_best_num,
5066 .ips = ctx->addresses_best,
5067 .apply_expected = true
5071 * unique,released vs. unique,tombstone with different ip(s)
5074 .line = __location__,
5075 .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL),
5079 .num_ips = ctx->addresses_best_num,
5080 .ips = ctx->addresses_best,
5081 .apply_expected = true
5084 .type = WREPL_TYPE_UNIQUE,
5085 .state = WREPL_STATE_TOMBSTONE,
5086 .node = WREPL_NODE_B,
5088 .num_ips = ARRAY_SIZE(addresses_B_1),
5089 .ips = addresses_B_1,
5090 .apply_expected = true
5094 * unique vs. group section
5097 * unique,released vs. group,active with same ip(s)
5100 .line = __location__,
5101 .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL),
5105 .num_ips = ctx->addresses_best_num,
5106 .ips = ctx->addresses_best,
5107 .apply_expected = true
5110 .type = WREPL_TYPE_GROUP,
5111 .state = WREPL_STATE_ACTIVE,
5112 .node = WREPL_NODE_B,
5114 .num_ips = ctx->addresses_best_num,
5115 .ips = ctx->addresses_best,
5116 .apply_expected = true
5120 * unique,released vs. group,active with different ip(s)
5123 .line = __location__,
5124 .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL),
5128 .num_ips = ctx->addresses_best_num,
5129 .ips = ctx->addresses_best,
5130 .apply_expected = true
5133 .type = WREPL_TYPE_GROUP,
5134 .state = WREPL_STATE_ACTIVE,
5135 .node = WREPL_NODE_B,
5137 .num_ips = ARRAY_SIZE(addresses_B_1),
5138 .ips = addresses_B_1,
5139 .apply_expected = true
5143 * unique,released vs. group,tombstone with same ip(s)
5146 .line = __location__,
5147 .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL),
5151 .num_ips = ctx->addresses_best_num,
5152 .ips = ctx->addresses_best,
5153 .apply_expected = true
5156 .type = WREPL_TYPE_GROUP,
5157 .state = WREPL_STATE_TOMBSTONE,
5158 .node = WREPL_NODE_B,
5160 .num_ips = ctx->addresses_best_num,
5161 .ips = ctx->addresses_best,
5162 .apply_expected = true
5166 * unique,released vs. group,tombstone with different ip(s)
5169 .line = __location__,
5170 .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL),
5174 .num_ips = ctx->addresses_best_num,
5175 .ips = ctx->addresses_best,
5176 .apply_expected = true
5179 .type = WREPL_TYPE_GROUP,
5180 .state = WREPL_STATE_TOMBSTONE,
5181 .node = WREPL_NODE_B,
5183 .num_ips = ARRAY_SIZE(addresses_B_1),
5184 .ips = addresses_B_1,
5185 .apply_expected = true
5189 * unique vs. special group section
5192 * unique,released vs. sgroup,active with same ip(s)
5195 .line = __location__,
5196 .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL),
5200 .num_ips = ctx->addresses_best_num,
5201 .ips = ctx->addresses_best,
5202 .apply_expected = true
5205 .type = WREPL_TYPE_SGROUP,
5206 .state = WREPL_STATE_ACTIVE,
5207 .node = WREPL_NODE_B,
5209 .num_ips = ctx->addresses_best_num,
5210 .ips = ctx->addresses_best,
5211 .apply_expected = true
5215 * unique,released vs. sgroup,active with different ip(s)
5218 .line = __location__,
5219 .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL),
5223 .num_ips = ctx->addresses_best_num,
5224 .ips = ctx->addresses_best,
5225 .apply_expected = true
5228 .type = WREPL_TYPE_SGROUP,
5229 .state = WREPL_STATE_ACTIVE,
5230 .node = WREPL_NODE_B,
5232 .num_ips = ARRAY_SIZE(addresses_B_1),
5233 .ips = addresses_B_1,
5234 .apply_expected = true
5238 * unique,released vs. sgroup,tombstone with same ip(s)
5241 .line = __location__,
5242 .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL),
5246 .num_ips = ctx->addresses_best_num,
5247 .ips = ctx->addresses_best,
5248 .apply_expected = true
5251 .type = WREPL_TYPE_SGROUP,
5252 .state = WREPL_STATE_TOMBSTONE,
5253 .node = WREPL_NODE_B,
5255 .num_ips = ctx->addresses_best_num,
5256 .ips = ctx->addresses_best,
5257 .apply_expected = true
5261 * unique,released vs. sgroup,tombstone with different ip(s)
5264 .line = __location__,
5265 .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL),
5269 .num_ips = ctx->addresses_best_num,
5270 .ips = ctx->addresses_best,
5271 .apply_expected = true
5274 .type = WREPL_TYPE_SGROUP,
5275 .state = WREPL_STATE_TOMBSTONE,
5276 .node = WREPL_NODE_B,
5278 .num_ips = ARRAY_SIZE(addresses_B_1),
5279 .ips = addresses_B_1,
5280 .apply_expected = true
5284 * unique vs. multi homed section
5287 * unique,released vs. mhomed,active with same ip(s)
5290 .line = __location__,
5291 .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL),
5295 .num_ips = ctx->addresses_best_num,
5296 .ips = ctx->addresses_best,
5297 .apply_expected = true
5300 .type = WREPL_TYPE_MHOMED,
5301 .state = WREPL_STATE_ACTIVE,
5302 .node = WREPL_NODE_B,
5304 .num_ips = ctx->addresses_best_num,
5305 .ips = ctx->addresses_best,
5306 .apply_expected = true
5310 * unique,released vs. mhomed,active with different ip(s)
5313 .line = __location__,
5314 .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL),
5318 .num_ips = ctx->addresses_best_num,
5319 .ips = ctx->addresses_best,
5320 .apply_expected = true
5323 .type = WREPL_TYPE_MHOMED,
5324 .state = WREPL_STATE_ACTIVE,
5325 .node = WREPL_NODE_B,
5327 .num_ips = ARRAY_SIZE(addresses_B_1),
5328 .ips = addresses_B_1,
5329 .apply_expected = true
5333 * unique,released vs. mhomed,tombstone with same ip(s)
5336 .line = __location__,
5337 .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL),
5341 .num_ips = ctx->addresses_best_num,
5342 .ips = ctx->addresses_best,
5343 .apply_expected = true
5346 .type = WREPL_TYPE_MHOMED,
5347 .state = WREPL_STATE_TOMBSTONE,
5348 .node = WREPL_NODE_B,
5350 .num_ips = ctx->addresses_best_num,
5351 .ips = ctx->addresses_best,
5352 .apply_expected = true
5356 * unique,released vs. mhomed,tombstone with different ip(s)
5359 .line = __location__,
5360 .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL),
5364 .num_ips = ctx->addresses_best_num,
5365 .ips = ctx->addresses_best,
5366 .apply_expected = true
5369 .type = WREPL_TYPE_MHOMED,
5370 .state = WREPL_STATE_TOMBSTONE,
5371 .node = WREPL_NODE_B,
5373 .num_ips = ARRAY_SIZE(addresses_B_1),
5374 .ips = addresses_B_1,
5375 .apply_expected = true
5379 * group vs. unique section
5382 * group,released vs. unique,active with same ip(s)
5385 .line = __location__,
5386 .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL),
5388 .nb_flags = NBT_NM_GROUP,
5390 .num_ips = ctx->addresses_best_num,
5391 .ips = ctx->addresses_best,
5392 .apply_expected = true
5395 .type = WREPL_TYPE_UNIQUE,
5396 .state = WREPL_STATE_ACTIVE,
5397 .node = WREPL_NODE_B,
5399 .num_ips = ctx->addresses_best_num,
5400 .ips = ctx->addresses_best,
5401 .apply_expected = false
5405 * group,released vs. unique,active with different ip(s)
5408 .line = __location__,
5409 .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL),
5411 .nb_flags = NBT_NM_GROUP,
5413 .num_ips = ctx->addresses_best_num,
5414 .ips = ctx->addresses_best,
5415 .apply_expected = true
5418 .type = WREPL_TYPE_UNIQUE,
5419 .state = WREPL_STATE_ACTIVE,
5420 .node = WREPL_NODE_B,
5422 .num_ips = ARRAY_SIZE(addresses_B_1),
5423 .ips = addresses_B_1,
5424 .apply_expected = false
5428 * group,released vs. unique,tombstone with same ip(s)
5431 .line = __location__,
5432 .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL),
5434 .nb_flags = NBT_NM_GROUP,
5436 .num_ips = ctx->addresses_best_num,
5437 .ips = ctx->addresses_best,
5438 .apply_expected = true
5441 .type = WREPL_TYPE_UNIQUE,
5442 .state = WREPL_STATE_TOMBSTONE,
5443 .node = WREPL_NODE_B,
5445 .num_ips = ctx->addresses_best_num,
5446 .ips = ctx->addresses_best,
5447 .apply_expected = false
5451 * group,released vs. unique,tombstone with different ip(s)
5454 .line = __location__,
5455 .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL),
5457 .nb_flags = NBT_NM_GROUP,
5459 .num_ips = ctx->addresses_best_num,
5460 .ips = ctx->addresses_best,
5461 .apply_expected = true
5464 .type = WREPL_TYPE_UNIQUE,
5465 .state = WREPL_STATE_TOMBSTONE,
5466 .node = WREPL_NODE_B,
5468 .num_ips = ARRAY_SIZE(addresses_B_1),
5469 .ips = addresses_B_1,
5470 .apply_expected = false
5474 * group vs. group section
5477 * group,released vs. group,active with same ip(s)
5480 .line = __location__,
5481 .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL),
5483 .nb_flags = NBT_NM_GROUP,
5485 .num_ips = ctx->addresses_best_num,
5486 .ips = ctx->addresses_best,
5487 .apply_expected = true
5490 .type = WREPL_TYPE_GROUP,
5491 .state = WREPL_STATE_ACTIVE,
5492 .node = WREPL_NODE_B,
5494 .num_ips = ctx->addresses_best_num,
5495 .ips = ctx->addresses_best,
5496 .apply_expected = true
5500 * group,released vs. group,active with different ip(s)
5503 .line = __location__,
5504 .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL),
5506 .nb_flags = NBT_NM_GROUP,
5508 .num_ips = ctx->addresses_best_num,
5509 .ips = ctx->addresses_best,
5510 .apply_expected = true
5513 .type = WREPL_TYPE_GROUP,
5514 .state = WREPL_STATE_ACTIVE,
5515 .node = WREPL_NODE_B,
5517 .num_ips = ARRAY_SIZE(addresses_B_1),
5518 .ips = addresses_B_1,
5519 .apply_expected = true
5523 * group,released vs. group,tombstone with same ip(s)
5526 .line = __location__,
5527 .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL),
5529 .nb_flags = NBT_NM_GROUP,
5531 .num_ips = ctx->addresses_best_num,
5532 .ips = ctx->addresses_best,
5533 .apply_expected = true
5536 .type = WREPL_TYPE_GROUP,
5537 .state = WREPL_STATE_TOMBSTONE,
5538 .node = WREPL_NODE_B,
5540 .num_ips = ctx->addresses_best_num,
5541 .ips = ctx->addresses_best,
5542 .apply_expected = true
5546 * group,released vs. group,tombstone with different ip(s)
5549 .line = __location__,
5550 .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL),
5552 .nb_flags = NBT_NM_GROUP,
5554 .num_ips = ctx->addresses_best_num,
5555 .ips = ctx->addresses_best,
5556 .apply_expected = true
5559 .type = WREPL_TYPE_GROUP,
5560 .state = WREPL_STATE_TOMBSTONE,
5561 .node = WREPL_NODE_B,
5563 .num_ips = ARRAY_SIZE(addresses_B_1),
5564 .ips = addresses_B_1,
5565 .apply_expected = true
5569 * group vs. special group section
5572 * group,released vs. sgroup,active with same ip(s)
5575 .line = __location__,
5576 .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL),
5578 .nb_flags = NBT_NM_GROUP,
5580 .num_ips = ctx->addresses_best_num,
5581 .ips = ctx->addresses_best,
5582 .apply_expected = true
5585 .type = WREPL_TYPE_SGROUP,
5586 .state = WREPL_STATE_ACTIVE,
5587 .node = WREPL_NODE_B,
5589 .num_ips = ctx->addresses_best_num,
5590 .ips = ctx->addresses_best,
5591 .apply_expected = false
5595 * group,released vs. sgroup,active with different ip(s)
5598 .line = __location__,
5599 .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL),
5601 .nb_flags = NBT_NM_GROUP,
5603 .num_ips = ctx->addresses_best_num,
5604 .ips = ctx->addresses_best,
5605 .apply_expected = true
5608 .type = WREPL_TYPE_SGROUP,
5609 .state = WREPL_STATE_ACTIVE,
5610 .node = WREPL_NODE_B,
5612 .num_ips = ARRAY_SIZE(addresses_B_1),
5613 .ips = addresses_B_1,
5614 .apply_expected = false
5618 * group,released vs. sgroup,tombstone with same ip(s)
5621 .line = __location__,
5622 .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL),
5624 .nb_flags = NBT_NM_GROUP,
5626 .num_ips = ctx->addresses_best_num,
5627 .ips = ctx->addresses_best,
5628 .apply_expected = true
5631 .type = WREPL_TYPE_SGROUP,
5632 .state = WREPL_STATE_TOMBSTONE,
5633 .node = WREPL_NODE_B,
5635 .num_ips = ctx->addresses_best_num,
5636 .ips = ctx->addresses_best,
5637 .apply_expected = false
5641 * group,released vs. sgroup,tombstone with different ip(s)
5644 .line = __location__,
5645 .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL),
5647 .nb_flags = NBT_NM_GROUP,
5649 .num_ips = ctx->addresses_best_num,
5650 .ips = ctx->addresses_best,
5651 .apply_expected = true
5654 .type = WREPL_TYPE_SGROUP,
5655 .state = WREPL_STATE_TOMBSTONE,
5656 .node = WREPL_NODE_B,
5658 .num_ips = ARRAY_SIZE(addresses_B_1),
5659 .ips = addresses_B_1,
5660 .apply_expected = false
5664 * group vs. multi homed section
5667 * group,released vs. mhomed,active with same ip(s)
5670 .line = __location__,
5671 .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL),
5673 .nb_flags = NBT_NM_GROUP,
5675 .num_ips = ctx->addresses_best_num,
5676 .ips = ctx->addresses_best,
5677 .apply_expected = true
5680 .type = WREPL_TYPE_MHOMED,
5681 .state = WREPL_STATE_ACTIVE,
5682 .node = WREPL_NODE_B,
5684 .num_ips = ctx->addresses_best_num,
5685 .ips = ctx->addresses_best,
5686 .apply_expected = false
5690 * group,released vs. mhomed,active with different ip(s)
5693 .line = __location__,
5694 .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL),
5696 .nb_flags = NBT_NM_GROUP,
5698 .num_ips = ctx->addresses_best_num,
5699 .ips = ctx->addresses_best,
5700 .apply_expected = true
5703 .type = WREPL_TYPE_MHOMED,
5704 .state = WREPL_STATE_ACTIVE,
5705 .node = WREPL_NODE_B,
5707 .num_ips = ARRAY_SIZE(addresses_B_1),
5708 .ips = addresses_B_1,
5709 .apply_expected = false
5713 * group,released vs. mhomed,tombstone with same ip(s)
5716 .line = __location__,
5717 .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL),
5719 .nb_flags = NBT_NM_GROUP,
5721 .num_ips = ctx->addresses_best_num,
5722 .ips = ctx->addresses_best,
5723 .apply_expected = true
5726 .type = WREPL_TYPE_MHOMED,
5727 .state = WREPL_STATE_TOMBSTONE,
5728 .node = WREPL_NODE_B,
5730 .num_ips = ctx->addresses_best_num,
5731 .ips = ctx->addresses_best,
5732 .apply_expected = false
5736 * group,released vs. mhomed,tombstone with different ip(s)
5739 .line = __location__,
5740 .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL),
5742 .nb_flags = NBT_NM_GROUP,
5744 .num_ips = ctx->addresses_best_num,
5745 .ips = ctx->addresses_best,
5746 .apply_expected = true
5749 .type = WREPL_TYPE_MHOMED,
5750 .state = WREPL_STATE_TOMBSTONE,
5751 .node = WREPL_NODE_B,
5753 .num_ips = ARRAY_SIZE(addresses_B_1),
5754 .ips = addresses_B_1,
5755 .apply_expected = false
5759 * special group vs. unique section
5762 * sgroup,released vs. unique,active with same ip(s)
5765 .line = __location__,
5766 .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL),
5768 .nb_flags = NBT_NM_GROUP,
5770 .num_ips = ctx->addresses_best_num,
5771 .ips = ctx->addresses_best,
5772 .apply_expected = true
5775 .type = WREPL_TYPE_UNIQUE,
5776 .state = WREPL_STATE_ACTIVE,
5777 .node = WREPL_NODE_B,
5779 .num_ips = ctx->addresses_best_num,
5780 .ips = ctx->addresses_best,
5781 .apply_expected = true
5785 * sgroup,released vs. unique,active with different ip(s)
5788 .line = __location__,
5789 .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL),
5791 .nb_flags = NBT_NM_GROUP,
5793 .num_ips = ctx->addresses_best_num,
5794 .ips = ctx->addresses_best,
5795 .apply_expected = true
5798 .type = WREPL_TYPE_UNIQUE,
5799 .state = WREPL_STATE_ACTIVE,
5800 .node = WREPL_NODE_B,
5802 .num_ips = ARRAY_SIZE(addresses_B_1),
5803 .ips = addresses_B_1,
5804 .apply_expected = true
5808 * sgroup,released vs. unique,tombstone with same ip(s)
5811 .line = __location__,
5812 .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL),
5814 .nb_flags = NBT_NM_GROUP,
5816 .num_ips = ctx->addresses_best_num,
5817 .ips = ctx->addresses_best,
5818 .apply_expected = true
5821 .type = WREPL_TYPE_UNIQUE,
5822 .state = WREPL_STATE_TOMBSTONE,
5823 .node = WREPL_NODE_B,
5825 .num_ips = ctx->addresses_best_num,
5826 .ips = ctx->addresses_best,
5827 .apply_expected = true
5831 * sgroup,released vs. unique,tombstone with different ip(s)
5834 .line = __location__,
5835 .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL),
5837 .nb_flags = NBT_NM_GROUP,
5839 .num_ips = ctx->addresses_best_num,
5840 .ips = ctx->addresses_best,
5841 .apply_expected = true
5844 .type = WREPL_TYPE_UNIQUE,
5845 .state = WREPL_STATE_TOMBSTONE,
5846 .node = WREPL_NODE_B,
5848 .num_ips = ARRAY_SIZE(addresses_B_1),
5849 .ips = addresses_B_1,
5850 .apply_expected = true
5854 * special group vs. group section
5857 * sgroup,released vs. group,active with same ip(s)
5860 .line = __location__,
5861 .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL),
5863 .nb_flags = NBT_NM_GROUP,
5865 .num_ips = ctx->addresses_best_num,
5866 .ips = ctx->addresses_best,
5867 .apply_expected = true
5870 .type = WREPL_TYPE_GROUP,
5871 .state = WREPL_STATE_ACTIVE,
5872 .node = WREPL_NODE_B,
5874 .num_ips = ctx->addresses_best_num,
5875 .ips = ctx->addresses_best,
5876 .apply_expected = true
5880 * sgroup,released vs. group,active with different ip(s)
5883 .line = __location__,
5884 .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL),
5886 .nb_flags = NBT_NM_GROUP,
5888 .num_ips = ctx->addresses_best_num,
5889 .ips = ctx->addresses_best,
5890 .apply_expected = true
5893 .type = WREPL_TYPE_GROUP,
5894 .state = WREPL_STATE_ACTIVE,
5895 .node = WREPL_NODE_B,
5897 .num_ips = ARRAY_SIZE(addresses_B_1),
5898 .ips = addresses_B_1,
5899 .apply_expected = true
5903 * sgroup,released vs. group,tombstone with same ip(s)
5906 .line = __location__,
5907 .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL),
5909 .nb_flags = NBT_NM_GROUP,
5911 .num_ips = ctx->addresses_best_num,
5912 .ips = ctx->addresses_best,
5913 .apply_expected = true
5916 .type = WREPL_TYPE_GROUP,
5917 .state = WREPL_STATE_TOMBSTONE,
5918 .node = WREPL_NODE_B,
5920 .num_ips = ctx->addresses_best_num,
5921 .ips = ctx->addresses_best,
5922 .apply_expected = true
5926 * sgroup,released vs. group,tombstone with different ip(s)
5929 .line = __location__,
5930 .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL),
5932 .nb_flags = NBT_NM_GROUP,
5934 .num_ips = ctx->addresses_best_num,
5935 .ips = ctx->addresses_best,
5936 .apply_expected = true
5939 .type = WREPL_TYPE_GROUP,
5940 .state = WREPL_STATE_TOMBSTONE,
5941 .node = WREPL_NODE_B,
5943 .num_ips = ARRAY_SIZE(addresses_B_1),
5944 .ips = addresses_B_1,
5945 .apply_expected = true
5949 * special group vs. special group section
5952 * sgroup,released vs. sgroup,active with same ip(s)
5955 .line = __location__,
5956 .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL),
5958 .nb_flags = NBT_NM_GROUP,
5960 .num_ips = ctx->addresses_best_num,
5961 .ips = ctx->addresses_best,
5962 .apply_expected = true
5965 .type = WREPL_TYPE_SGROUP,
5966 .state = WREPL_STATE_ACTIVE,
5967 .node = WREPL_NODE_B,
5969 .num_ips = ctx->addresses_best_num,
5970 .ips = ctx->addresses_best,
5971 .apply_expected = true
5975 * sgroup,released vs. sgroup,active with different ip(s)
5978 .line = __location__,
5979 .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL),
5981 .nb_flags = NBT_NM_GROUP,
5983 .num_ips = ctx->addresses_best_num,
5984 .ips = ctx->addresses_best,
5985 .apply_expected = true
5988 .type = WREPL_TYPE_SGROUP,
5989 .state = WREPL_STATE_ACTIVE,
5990 .node = WREPL_NODE_B,
5992 .num_ips = ARRAY_SIZE(addresses_B_1),
5993 .ips = addresses_B_1,
5994 .apply_expected = true
5998 * sgroup,released vs. sgroup,tombstone with same ip(s)
6001 .line = __location__,
6002 .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL),
6004 .nb_flags = NBT_NM_GROUP,
6006 .num_ips = ctx->addresses_best_num,
6007 .ips = ctx->addresses_best,
6008 .apply_expected = true
6011 .type = WREPL_TYPE_SGROUP,
6012 .state = WREPL_STATE_TOMBSTONE,
6013 .node = WREPL_NODE_B,
6015 .num_ips = ctx->addresses_best_num,
6016 .ips = ctx->addresses_best,
6017 .apply_expected = true
6021 * sgroup,released vs. sgroup,tombstone with different ip(s)
6024 .line = __location__,
6025 .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL),
6027 .nb_flags = NBT_NM_GROUP,
6029 .num_ips = ctx->addresses_best_num,
6030 .ips = ctx->addresses_best,
6031 .apply_expected = true
6034 .type = WREPL_TYPE_SGROUP,
6035 .state = WREPL_STATE_TOMBSTONE,
6036 .node = WREPL_NODE_B,
6038 .num_ips = ARRAY_SIZE(addresses_B_1),
6039 .ips = addresses_B_1,
6040 .apply_expected = true
6044 * special group vs. multi homed section
6047 * sgroup,released vs. mhomed,active with same ip(s)
6050 .line = __location__,
6051 .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL),
6053 .nb_flags = NBT_NM_GROUP,
6055 .num_ips = ctx->addresses_best_num,
6056 .ips = ctx->addresses_best,
6057 .apply_expected = true
6060 .type = WREPL_TYPE_MHOMED,
6061 .state = WREPL_STATE_ACTIVE,
6062 .node = WREPL_NODE_B,
6064 .num_ips = ctx->addresses_best_num,
6065 .ips = ctx->addresses_best,
6066 .apply_expected = true
6070 * sgroup,released vs. mhomed,active with different ip(s)
6073 .line = __location__,
6074 .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL),
6076 .nb_flags = NBT_NM_GROUP,
6078 .num_ips = ctx->addresses_best_num,
6079 .ips = ctx->addresses_best,
6080 .apply_expected = true
6083 .type = WREPL_TYPE_MHOMED,
6084 .state = WREPL_STATE_ACTIVE,
6085 .node = WREPL_NODE_B,
6087 .num_ips = ARRAY_SIZE(addresses_B_1),
6088 .ips = addresses_B_1,
6089 .apply_expected = true
6093 * sgroup,released vs. mhomed,tombstone with same ip(s)
6096 .line = __location__,
6097 .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL),
6099 .nb_flags = NBT_NM_GROUP,
6101 .num_ips = ctx->addresses_best_num,
6102 .ips = ctx->addresses_best,
6103 .apply_expected = true
6106 .type = WREPL_TYPE_MHOMED,
6107 .state = WREPL_STATE_TOMBSTONE,
6108 .node = WREPL_NODE_B,
6110 .num_ips = ctx->addresses_best_num,
6111 .ips = ctx->addresses_best,
6112 .apply_expected = true
6116 * sgroup,released vs. mhomed,tombstone with different ip(s)
6119 .line = __location__,
6120 .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL),
6122 .nb_flags = NBT_NM_GROUP,
6124 .num_ips = ctx->addresses_best_num,
6125 .ips = ctx->addresses_best,
6126 .apply_expected = true
6129 .type = WREPL_TYPE_MHOMED,
6130 .state = WREPL_STATE_TOMBSTONE,
6131 .node = WREPL_NODE_B,
6133 .num_ips = ARRAY_SIZE(addresses_B_1),
6134 .ips = addresses_B_1,
6135 .apply_expected = true
6139 * multi homed vs. unique section
6142 * mhomed,released vs. unique,active with same ip(s)
6145 .line = __location__,
6146 .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL),
6150 .num_ips = ctx->addresses_best_num,
6151 .ips = ctx->addresses_best,
6152 .apply_expected = true
6155 .type = WREPL_TYPE_UNIQUE,
6156 .state = WREPL_STATE_ACTIVE,
6157 .node = WREPL_NODE_B,
6159 .num_ips = ctx->addresses_best_num,
6160 .ips = ctx->addresses_best,
6161 .apply_expected = true
6165 * mhomed,released vs. unique,active with different ip(s)
6168 .line = __location__,
6169 .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL),
6173 .num_ips = ctx->addresses_best_num,
6174 .ips = ctx->addresses_best,
6175 .apply_expected = true
6178 .type = WREPL_TYPE_UNIQUE,
6179 .state = WREPL_STATE_ACTIVE,
6180 .node = WREPL_NODE_B,
6182 .num_ips = ARRAY_SIZE(addresses_B_1),
6183 .ips = addresses_B_1,
6184 .apply_expected = true
6188 * mhomed,released vs. unique,tombstone with same ip(s)
6191 .line = __location__,
6192 .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL),
6196 .num_ips = ctx->addresses_best_num,
6197 .ips = ctx->addresses_best,
6198 .apply_expected = true
6201 .type = WREPL_TYPE_UNIQUE,
6202 .state = WREPL_STATE_TOMBSTONE,
6203 .node = WREPL_NODE_B,
6205 .num_ips = ctx->addresses_best_num,
6206 .ips = ctx->addresses_best,
6207 .apply_expected = true
6211 * mhomed,released vs. unique,tombstone with different ip(s)
6214 .line = __location__,
6215 .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL),
6219 .num_ips = ctx->addresses_best_num,
6220 .ips = ctx->addresses_best,
6221 .apply_expected = true
6224 .type = WREPL_TYPE_UNIQUE,
6225 .state = WREPL_STATE_TOMBSTONE,
6226 .node = WREPL_NODE_B,
6228 .num_ips = ARRAY_SIZE(addresses_B_1),
6229 .ips = addresses_B_1,
6230 .apply_expected = true
6234 * multi homed vs. group section
6237 * mhomed,released vs. group,active with same ip(s)
6240 .line = __location__,
6241 .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL),
6245 .num_ips = ctx->addresses_best_num,
6246 .ips = ctx->addresses_best,
6247 .apply_expected = true
6250 .type = WREPL_TYPE_GROUP,
6251 .state = WREPL_STATE_ACTIVE,
6252 .node = WREPL_NODE_B,
6254 .num_ips = ctx->addresses_best_num,
6255 .ips = ctx->addresses_best,
6256 .apply_expected = true
6260 * mhomed,released vs. group,active with different ip(s)
6263 .line = __location__,
6264 .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL),
6268 .num_ips = ctx->addresses_best_num,
6269 .ips = ctx->addresses_best,
6270 .apply_expected = true
6273 .type = WREPL_TYPE_GROUP,
6274 .state = WREPL_STATE_ACTIVE,
6275 .node = WREPL_NODE_B,
6277 .num_ips = ARRAY_SIZE(addresses_B_1),
6278 .ips = addresses_B_1,
6279 .apply_expected = true
6283 * mhomed,released vs. group,tombstone with same ip(s)
6286 .line = __location__,
6287 .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL),
6291 .num_ips = ctx->addresses_best_num,
6292 .ips = ctx->addresses_best,
6293 .apply_expected = true
6296 .type = WREPL_TYPE_GROUP,
6297 .state = WREPL_STATE_TOMBSTONE,
6298 .node = WREPL_NODE_B,
6300 .num_ips = ctx->addresses_best_num,
6301 .ips = ctx->addresses_best,
6302 .apply_expected = true
6306 * mhomed,released vs. group,tombstone with different ip(s)
6309 .line = __location__,
6310 .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL),
6314 .num_ips = ctx->addresses_best_num,
6315 .ips = ctx->addresses_best,
6316 .apply_expected = true
6319 .type = WREPL_TYPE_GROUP,
6320 .state = WREPL_STATE_TOMBSTONE,
6321 .node = WREPL_NODE_B,
6323 .num_ips = ARRAY_SIZE(addresses_B_1),
6324 .ips = addresses_B_1,
6325 .apply_expected = true
6329 * multi homed vs. special group section
6332 * mhomed,released vs. sgroup,active with same ip(s)
6335 .line = __location__,
6336 .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL),
6340 .num_ips = ctx->addresses_best_num,
6341 .ips = ctx->addresses_best,
6342 .apply_expected = true
6345 .type = WREPL_TYPE_SGROUP,
6346 .state = WREPL_STATE_ACTIVE,
6347 .node = WREPL_NODE_B,
6349 .num_ips = ctx->addresses_best_num,
6350 .ips = ctx->addresses_best,
6351 .apply_expected = true
6355 * mhomed,released vs. sgroup,active with different ip(s)
6358 .line = __location__,
6359 .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL),
6363 .num_ips = ctx->addresses_best_num,
6364 .ips = ctx->addresses_best,
6365 .apply_expected = true
6368 .type = WREPL_TYPE_SGROUP,
6369 .state = WREPL_STATE_ACTIVE,
6370 .node = WREPL_NODE_B,
6372 .num_ips = ARRAY_SIZE(addresses_B_1),
6373 .ips = addresses_B_1,
6374 .apply_expected = true
6378 * mhomed,released vs. sgroup,tombstone with same ip(s)
6381 .line = __location__,
6382 .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL),
6386 .num_ips = ctx->addresses_best_num,
6387 .ips = ctx->addresses_best,
6388 .apply_expected = true
6391 .type = WREPL_TYPE_SGROUP,
6392 .state = WREPL_STATE_TOMBSTONE,
6393 .node = WREPL_NODE_B,
6395 .num_ips = ctx->addresses_best_num,
6396 .ips = ctx->addresses_best,
6397 .apply_expected = true
6401 * mhomed,released vs. sgroup,tombstone with different ip(s)
6404 .line = __location__,
6405 .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL),
6409 .num_ips = ctx->addresses_best_num,
6410 .ips = ctx->addresses_best,
6411 .apply_expected = true
6414 .type = WREPL_TYPE_SGROUP,
6415 .state = WREPL_STATE_TOMBSTONE,
6416 .node = WREPL_NODE_B,
6418 .num_ips = ARRAY_SIZE(addresses_B_1),
6419 .ips = addresses_B_1,
6420 .apply_expected = true
6424 * multi homed vs. multi homed section
6427 * mhomed,released vs. mhomed,active with same ip(s)
6430 .line = __location__,
6431 .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL),
6435 .num_ips = ctx->addresses_best_num,
6436 .ips = ctx->addresses_best,
6437 .apply_expected = true
6440 .type = WREPL_TYPE_MHOMED,
6441 .state = WREPL_STATE_ACTIVE,
6442 .node = WREPL_NODE_B,
6444 .num_ips = ctx->addresses_best_num,
6445 .ips = ctx->addresses_best,
6446 .apply_expected = true
6450 * mhomed,released vs. mhomed,active with different ip(s)
6453 .line = __location__,
6454 .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL),
6458 .num_ips = ctx->addresses_best_num,
6459 .ips = ctx->addresses_best,
6460 .apply_expected = true
6463 .type = WREPL_TYPE_MHOMED,
6464 .state = WREPL_STATE_ACTIVE,
6465 .node = WREPL_NODE_B,
6467 .num_ips = ARRAY_SIZE(addresses_B_1),
6468 .ips = addresses_B_1,
6469 .apply_expected = true
6473 * mhomed,released vs. mhomed,tombstone with same ip(s)
6476 .line = __location__,
6477 .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL),
6481 .num_ips = ctx->addresses_best_num,
6482 .ips = ctx->addresses_best,
6483 .apply_expected = true
6486 .type = WREPL_TYPE_MHOMED,
6487 .state = WREPL_STATE_TOMBSTONE,
6488 .node = WREPL_NODE_B,
6490 .num_ips = ctx->addresses_best_num,
6491 .ips = ctx->addresses_best,
6492 .apply_expected = true
6496 * mhomed,released vs. mhomed,tombstone with different ip(s)
6499 .line = __location__,
6500 .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL),
6504 .num_ips = ctx->addresses_best_num,
6505 .ips = ctx->addresses_best,
6506 .apply_expected = true
6509 .type = WREPL_TYPE_MHOMED,
6510 .state = WREPL_STATE_TOMBSTONE,
6511 .node = WREPL_NODE_B,
6513 .num_ips = ARRAY_SIZE(addresses_B_1),
6514 .ips = addresses_B_1,
6515 .apply_expected = true
6520 torture_comment(tctx, "Test Replica records vs. owned released records\n");
6522 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
6523 torture_comment(tctx, "%s => %s\n", nbt_name_string(ctx, &records[i].name),
6524 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
6529 name_register->in.name = records[i].name;
6530 name_register->in.dest_addr = ctx->address;
6531 name_register->in.address = records[i].wins.ips[0].ip;
6532 name_register->in.nb_flags = records[i].wins.nb_flags;
6533 name_register->in.register_demand= false;
6534 name_register->in.broadcast = false;
6535 name_register->in.multi_homed = records[i].wins.mhomed;
6536 name_register->in.ttl = 300000;
6537 name_register->in.timeout = 70;
6538 name_register->in.retries = 0;
6540 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
6541 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6542 torture_comment(tctx, "No response from %s for name register\n", ctx->address);
6545 if (!NT_STATUS_IS_OK(status)) {
6546 torture_comment(tctx, "Bad response from %s for name register - %s\n",
6547 ctx->address, nt_errstr(status));
6550 CHECK_VALUE(tctx, name_register->out.rcode, 0);
6551 CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address);
6552 CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type);
6553 CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name);
6554 CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope);
6555 CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[0].ip);
6557 /* release the record */
6558 release->in.name = records[i].name;
6559 release->in.dest_addr = ctx->address;
6560 release->in.address = records[i].wins.ips[0].ip;
6561 release->in.nb_flags = records[i].wins.nb_flags;
6562 release->in.broadcast = false;
6563 release->in.timeout = 30;
6564 release->in.retries = 0;
6566 status = nbt_name_release(ctx->nbtsock, ctx, release);
6567 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6568 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
6571 if (!NT_STATUS_IS_OK(status)) {
6572 torture_comment(tctx, "Bad response from %s for name query - %s\n",
6573 ctx->address, nt_errstr(status));
6576 CHECK_VALUE(tctx, release->out.rcode, 0);
6581 wins_name->name = &records[i].name;
6582 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
6583 records[i].replica.state,
6584 records[i].replica.node,
6585 records[i].replica.is_static);
6586 wins_name->id = ++ctx->b.max_version;
6587 if (wins_name->flags & 2) {
6588 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
6589 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
6591 wins_name->addresses.ip = records[i].replica.ips[0].ip;
6593 wins_name->unknown = "255.255.255.255";
6595 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
6596 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name,
6597 records[i].replica.apply_expected);
6599 if (records[i].replica.apply_expected) {
6600 wins_name->name = &records[i].name;
6601 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
6602 WREPL_STATE_TOMBSTONE,
6603 WREPL_NODE_B, false);
6604 wins_name->id = ++ctx->b.max_version;
6605 wins_name->addresses.ip = addresses_B_1[0].ip;
6606 wins_name->unknown = "255.255.255.255";
6608 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
6609 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
6611 release->in.name = records[i].name;
6612 release->in.dest_addr = ctx->address;
6613 release->in.address = records[i].wins.ips[0].ip;
6614 release->in.nb_flags = records[i].wins.nb_flags;
6615 release->in.broadcast = false;
6616 release->in.timeout = 30;
6617 release->in.retries = 0;
6619 status = nbt_name_release(ctx->nbtsock, ctx, release);
6620 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6621 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
6624 if (!NT_STATUS_IS_OK(status)) {
6625 torture_comment(tctx, "Bad response from %s for name query - %s\n",
6626 ctx->address, nt_errstr(status));
6629 CHECK_VALUE(tctx, release->out.rcode, 0);
6632 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
6640 struct test_conflict_owned_active_vs_replica_struct {
6641 const char *line; /* just better debugging */
6642 const char *section; /* just better debugging */
6643 struct nbt_name name;
6644 const char *comment;
6650 const struct wrepl_ip *ips;
6651 bool apply_expected;
6656 bool expect_release;
6659 /* when num_ips == 0, then .wins.ips are used */
6661 const struct wrepl_ip *ips;
6664 enum wrepl_name_type type;
6665 enum wrepl_name_state state;
6666 enum wrepl_name_node node;
6669 const struct wrepl_ip *ips;
6670 bool apply_expected;
6676 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
6677 struct nbt_name_packet *req_packet,
6678 struct socket_address *src);
6680 static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx,
6681 struct test_wrepl_conflict_conn *ctx)
6685 struct wrepl_wins_name wins_name_;
6686 struct wrepl_wins_name *wins_name = &wins_name_;
6687 struct nbt_name_register name_register_;
6688 struct nbt_name_register *name_register = &name_register_;
6689 struct nbt_name_release release_;
6690 struct nbt_name_release *release = &release_;
6692 struct test_conflict_owned_active_vs_replica_struct records[] = {
6694 * unique vs. unique section
6696 #if METZE_NEEDS_TO_LOOK_AT_THIS_ONE
6698 * unique,active vs. unique,active with same ip(s), unchecked
6701 .line = __location__,
6702 .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL),
6706 .num_ips = ctx->addresses_best_num,
6707 .ips = ctx->addresses_best,
6708 .apply_expected = true
6714 .type = WREPL_TYPE_UNIQUE,
6715 .state = WREPL_STATE_ACTIVE,
6716 .node = WREPL_NODE_B,
6718 .num_ips = ctx->addresses_best_num,
6719 .ips = ctx->addresses_best,
6720 .apply_expected = true
6725 * unique,active vs. unique,active with different ip(s), positive response
6728 .line = __location__,
6729 .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL),
6733 .num_ips = ctx->addresses_best_num,
6734 .ips = ctx->addresses_best,
6735 .apply_expected = true
6742 .type = WREPL_TYPE_UNIQUE,
6743 .state = WREPL_STATE_ACTIVE,
6744 .node = WREPL_NODE_B,
6746 .num_ips = ARRAY_SIZE(addresses_B_1),
6747 .ips = addresses_B_1,
6748 .apply_expected = false
6752 * unique,active vs. unique,active with different ip(s), positive response other ips
6755 .line = __location__,
6756 .name = _NBT_NAME("_UA_UA_DI_O", 0x00, NULL),
6760 .num_ips = ctx->addresses_best_num,
6761 .ips = ctx->addresses_best,
6762 .apply_expected = true
6767 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6768 .ips = addresses_A_3_4,
6771 .type = WREPL_TYPE_UNIQUE,
6772 .state = WREPL_STATE_ACTIVE,
6773 .node = WREPL_NODE_B,
6775 .num_ips = ARRAY_SIZE(addresses_B_1),
6776 .ips = addresses_B_1,
6777 .apply_expected = false
6781 * unique,active vs. unique,active with different ip(s), negative response
6784 .line = __location__,
6785 .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL),
6789 .num_ips = ctx->addresses_best_num,
6790 .ips = ctx->addresses_best,
6791 .apply_expected = true
6798 .type = WREPL_TYPE_UNIQUE,
6799 .state = WREPL_STATE_ACTIVE,
6800 .node = WREPL_NODE_B,
6802 .num_ips = ARRAY_SIZE(addresses_B_1),
6803 .ips = addresses_B_1,
6804 .apply_expected = true
6808 * unique,active vs. unique,tombstone with same ip(s), unchecked
6811 .line = __location__,
6812 .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL),
6816 .num_ips = ctx->addresses_best_num,
6817 .ips = ctx->addresses_best,
6818 .apply_expected = true
6824 .type = WREPL_TYPE_UNIQUE,
6825 .state = WREPL_STATE_TOMBSTONE,
6826 .node = WREPL_NODE_B,
6828 .num_ips = ctx->addresses_best_num,
6829 .ips = ctx->addresses_best,
6830 .apply_expected = false
6834 * unique,active vs. unique,tombstone with different ip(s), unchecked
6837 .line = __location__,
6838 .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL),
6842 .num_ips = ctx->addresses_best_num,
6843 .ips = ctx->addresses_best,
6844 .apply_expected = true
6850 .type = WREPL_TYPE_UNIQUE,
6851 .state = WREPL_STATE_TOMBSTONE,
6852 .node = WREPL_NODE_B,
6854 .num_ips = ARRAY_SIZE(addresses_B_1),
6855 .ips = addresses_B_1,
6856 .apply_expected = false
6860 * unique vs. group section
6863 * unique,active vs. group,active with same ip(s), release expected
6866 .line = __location__,
6867 .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL),
6871 .num_ips = ctx->addresses_best_num,
6872 .ips = ctx->addresses_best,
6873 .apply_expected = true
6877 .expect_release = true,
6880 .type = WREPL_TYPE_GROUP,
6881 .state = WREPL_STATE_ACTIVE,
6882 .node = WREPL_NODE_B,
6884 .num_ips = ctx->addresses_best_num,
6885 .ips = ctx->addresses_best,
6886 .apply_expected = true
6890 * unique,active vs. group,active with different ip(s), release expected
6893 .line = __location__,
6894 .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL),
6898 .num_ips = ctx->addresses_best_num,
6899 .ips = ctx->addresses_best,
6900 .apply_expected = true
6904 .expect_release = true,
6907 .type = WREPL_TYPE_GROUP,
6908 .state = WREPL_STATE_ACTIVE,
6909 .node = WREPL_NODE_B,
6911 .num_ips = ARRAY_SIZE(addresses_B_1),
6912 .ips = addresses_B_1,
6913 .apply_expected = true
6917 * unique,active vs. group,tombstone with same ip(s), unchecked
6920 .line = __location__,
6921 .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL),
6925 .num_ips = ctx->addresses_best_num,
6926 .ips = ctx->addresses_best,
6927 .apply_expected = true
6933 .type = WREPL_TYPE_GROUP,
6934 .state = WREPL_STATE_TOMBSTONE,
6935 .node = WREPL_NODE_B,
6937 .num_ips = ctx->addresses_best_num,
6938 .ips = ctx->addresses_best,
6939 .apply_expected = false
6943 * unique,active vs. group,tombstone with different ip(s), unchecked
6946 .line = __location__,
6947 .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL),
6951 .num_ips = ctx->addresses_best_num,
6952 .ips = ctx->addresses_best,
6953 .apply_expected = true
6959 .type = WREPL_TYPE_GROUP,
6960 .state = WREPL_STATE_TOMBSTONE,
6961 .node = WREPL_NODE_B,
6963 .num_ips = ARRAY_SIZE(addresses_B_1),
6964 .ips = addresses_B_1,
6965 .apply_expected = false
6969 * unique vs. special group section
6972 * unique,active vs. sgroup,active with same ip(s), release expected
6975 .line = __location__,
6976 .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL),
6980 .num_ips = ctx->addresses_best_num,
6981 .ips = ctx->addresses_best,
6982 .apply_expected = true
6986 .expect_release = true,
6989 .type = WREPL_TYPE_SGROUP,
6990 .state = WREPL_STATE_ACTIVE,
6991 .node = WREPL_NODE_B,
6993 .num_ips = ctx->addresses_best_num,
6994 .ips = ctx->addresses_best,
6995 .apply_expected = true
6999 * unique,active vs. group,active with different ip(s), release expected
7002 .line = __location__,
7003 .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL),
7007 .num_ips = ctx->addresses_best_num,
7008 .ips = ctx->addresses_best,
7009 .apply_expected = true
7013 .expect_release = true,
7016 .type = WREPL_TYPE_SGROUP,
7017 .state = WREPL_STATE_ACTIVE,
7018 .node = WREPL_NODE_B,
7020 .num_ips = ARRAY_SIZE(addresses_B_1),
7021 .ips = addresses_B_1,
7022 .apply_expected = true
7026 * unique,active vs. sgroup,tombstone with same ip(s), unchecked
7029 .line = __location__,
7030 .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL),
7034 .num_ips = ctx->addresses_best_num,
7035 .ips = ctx->addresses_best,
7036 .apply_expected = true
7042 .type = WREPL_TYPE_SGROUP,
7043 .state = WREPL_STATE_TOMBSTONE,
7044 .node = WREPL_NODE_B,
7046 .num_ips = ctx->addresses_best_num,
7047 .ips = ctx->addresses_best,
7048 .apply_expected = false
7052 * unique,active vs. sgroup,tombstone with different ip(s), unchecked
7055 .line = __location__,
7056 .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL),
7060 .num_ips = ctx->addresses_best_num,
7061 .ips = ctx->addresses_best,
7062 .apply_expected = true
7068 .type = WREPL_TYPE_SGROUP,
7069 .state = WREPL_STATE_TOMBSTONE,
7070 .node = WREPL_NODE_B,
7072 .num_ips = ARRAY_SIZE(addresses_B_1),
7073 .ips = addresses_B_1,
7074 .apply_expected = false
7078 * unique vs. multi homed section
7081 * unique,active vs. mhomed,active with same ip(s), unchecked
7084 .line = __location__,
7085 .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL),
7089 .num_ips = ctx->addresses_best_num,
7090 .ips = ctx->addresses_best,
7091 .apply_expected = true
7097 .type = WREPL_TYPE_MHOMED,
7098 .state = WREPL_STATE_ACTIVE,
7099 .node = WREPL_NODE_B,
7101 .num_ips = ctx->addresses_best_num,
7102 .ips = ctx->addresses_best,
7103 .apply_expected = true
7107 * unique,active vs. mhomed,active with superset ip(s), unchecked
7110 .line = __location__,
7111 .name = _NBT_NAME("_UA_MA_SP_U", 0x00, NULL),
7115 .num_ips = ctx->addresses_best_num,
7116 .ips = ctx->addresses_best,
7117 .apply_expected = true
7123 .type = WREPL_TYPE_MHOMED,
7124 .state = WREPL_STATE_ACTIVE,
7125 .node = WREPL_NODE_B,
7127 .num_ips = ctx->addresses_all_num,
7128 .ips = ctx->addresses_all,
7129 .apply_expected = true
7133 * unique,active vs. mhomed,active with different ip(s), positive response
7136 .line = __location__,
7137 .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL),
7141 .num_ips = ctx->addresses_best_num,
7142 .ips = ctx->addresses_best,
7143 .apply_expected = true
7150 .type = WREPL_TYPE_MHOMED,
7151 .state = WREPL_STATE_ACTIVE,
7152 .node = WREPL_NODE_B,
7154 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7155 .ips = addresses_B_3_4,
7156 .apply_expected = false
7160 * unique,active vs. mhomed,active with different ip(s), positive response other ips
7163 .line = __location__,
7164 .name = _NBT_NAME("_UA_MA_DI_O", 0x00, NULL),
7168 .num_ips = ctx->addresses_best_num,
7169 .ips = ctx->addresses_best,
7170 .apply_expected = true
7175 .num_ips = ARRAY_SIZE(addresses_A_3_4),
7176 .ips = addresses_A_3_4,
7179 .type = WREPL_TYPE_MHOMED,
7180 .state = WREPL_STATE_ACTIVE,
7181 .node = WREPL_NODE_B,
7183 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7184 .ips = addresses_B_3_4,
7185 .apply_expected = false
7189 * unique,active vs. mhomed,active with different ip(s), negative response
7192 .line = __location__,
7193 .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL),
7197 .num_ips = ctx->addresses_best_num,
7198 .ips = ctx->addresses_best,
7199 .apply_expected = true
7206 .type = WREPL_TYPE_MHOMED,
7207 .state = WREPL_STATE_ACTIVE,
7208 .node = WREPL_NODE_B,
7210 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7211 .ips = addresses_B_3_4,
7212 .apply_expected = true
7216 * unique,active vs. mhomed,tombstone with same ip(s), unchecked
7219 .line = __location__,
7220 .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL),
7224 .num_ips = ctx->addresses_best_num,
7225 .ips = ctx->addresses_best,
7226 .apply_expected = true
7232 .type = WREPL_TYPE_MHOMED,
7233 .state = WREPL_STATE_TOMBSTONE,
7234 .node = WREPL_NODE_B,
7236 .num_ips = ctx->addresses_best_num,
7237 .ips = ctx->addresses_best,
7238 .apply_expected = false
7242 * unique,active vs. mhomed,tombstone with different ip(s), unchecked
7245 .line = __location__,
7246 .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL),
7250 .num_ips = ctx->addresses_best_num,
7251 .ips = ctx->addresses_best,
7252 .apply_expected = true
7258 .type = WREPL_TYPE_MHOMED,
7259 .state = WREPL_STATE_TOMBSTONE,
7260 .node = WREPL_NODE_B,
7262 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7263 .ips = addresses_B_3_4,
7264 .apply_expected = false
7268 * normal group vs. unique section
7271 * group,active vs. unique,active with same ip(s), unchecked
7274 .line = __location__,
7275 .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL),
7277 .nb_flags = NBT_NM_GROUP,
7279 .num_ips = ctx->addresses_best_num,
7280 .ips = ctx->addresses_best,
7281 .apply_expected = true
7287 .type = WREPL_TYPE_UNIQUE,
7288 .state = WREPL_STATE_ACTIVE,
7289 .node = WREPL_NODE_B,
7291 .num_ips = ctx->addresses_best_num,
7292 .ips = ctx->addresses_best,
7293 .apply_expected = false
7297 * group,active vs. unique,active with different ip(s), unchecked
7300 .line = __location__,
7301 .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL),
7303 .nb_flags = NBT_NM_GROUP,
7305 .num_ips = ctx->addresses_best_num,
7306 .ips = ctx->addresses_best,
7307 .apply_expected = true
7313 .type = WREPL_TYPE_UNIQUE,
7314 .state = WREPL_STATE_ACTIVE,
7315 .node = WREPL_NODE_B,
7317 .num_ips = ARRAY_SIZE(addresses_B_1),
7318 .ips = addresses_B_1,
7319 .apply_expected = false
7323 * group,active vs. unique,tombstone with same ip(s), unchecked
7326 .line = __location__,
7327 .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL),
7329 .nb_flags = NBT_NM_GROUP,
7331 .num_ips = ctx->addresses_best_num,
7332 .ips = ctx->addresses_best,
7333 .apply_expected = true
7339 .type = WREPL_TYPE_UNIQUE,
7340 .state = WREPL_STATE_TOMBSTONE,
7341 .node = WREPL_NODE_B,
7343 .num_ips = ctx->addresses_best_num,
7344 .ips = ctx->addresses_best,
7345 .apply_expected = false
7349 * group,active vs. unique,tombstone with different ip(s), unchecked
7352 .line = __location__,
7353 .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL),
7355 .nb_flags = NBT_NM_GROUP,
7357 .num_ips = ctx->addresses_best_num,
7358 .ips = ctx->addresses_best,
7359 .apply_expected = true
7365 .type = WREPL_TYPE_UNIQUE,
7366 .state = WREPL_STATE_TOMBSTONE,
7367 .node = WREPL_NODE_B,
7369 .num_ips = ARRAY_SIZE(addresses_B_1),
7370 .ips = addresses_B_1,
7371 .apply_expected = false
7375 * normal group vs. normal group section
7378 * group,active vs. group,active with same ip(s), unchecked
7381 .line = __location__,
7382 .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL),
7384 .nb_flags = NBT_NM_GROUP,
7386 .num_ips = ctx->addresses_best_num,
7387 .ips = ctx->addresses_best,
7388 .apply_expected = true
7394 .type = WREPL_TYPE_GROUP,
7395 .state = WREPL_STATE_ACTIVE,
7396 .node = WREPL_NODE_B,
7398 .num_ips = ctx->addresses_best_num,
7399 .ips = ctx->addresses_best,
7400 .apply_expected = true
7404 * group,active vs. group,active with different ip(s), unchecked
7407 .line = __location__,
7408 .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL),
7410 .nb_flags = NBT_NM_GROUP,
7412 .num_ips = ctx->addresses_best_num,
7413 .ips = ctx->addresses_best,
7414 .apply_expected = true
7420 .type = WREPL_TYPE_GROUP,
7421 .state = WREPL_STATE_ACTIVE,
7422 .node = WREPL_NODE_B,
7424 .num_ips = ARRAY_SIZE(addresses_B_1),
7425 .ips = addresses_B_1,
7426 .apply_expected = true
7430 * group,active vs. group,tombstone with same ip(s), unchecked
7433 .line = __location__,
7434 .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL),
7436 .nb_flags = NBT_NM_GROUP,
7438 .num_ips = ctx->addresses_best_num,
7439 .ips = ctx->addresses_best,
7440 .apply_expected = true
7446 .type = WREPL_TYPE_GROUP,
7447 .state = WREPL_STATE_TOMBSTONE,
7448 .node = WREPL_NODE_B,
7450 .num_ips = ctx->addresses_best_num,
7451 .ips = ctx->addresses_best,
7452 .apply_expected = false
7456 * group,active vs. group,tombstone with different ip(s), unchecked
7459 .line = __location__,
7460 .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL),
7462 .nb_flags = NBT_NM_GROUP,
7464 .num_ips = ctx->addresses_best_num,
7465 .ips = ctx->addresses_best,
7466 .apply_expected = true
7472 .type = WREPL_TYPE_GROUP,
7473 .state = WREPL_STATE_TOMBSTONE,
7474 .node = WREPL_NODE_B,
7476 .num_ips = ARRAY_SIZE(addresses_B_1),
7477 .ips = addresses_B_1,
7478 .apply_expected = false
7482 * normal group vs. special group section
7485 * group,active vs. sgroup,active with same ip(s), unchecked
7488 .line = __location__,
7489 .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL),
7491 .nb_flags = NBT_NM_GROUP,
7493 .num_ips = ctx->addresses_best_num,
7494 .ips = ctx->addresses_best,
7495 .apply_expected = true
7501 .type = WREPL_TYPE_SGROUP,
7502 .state = WREPL_STATE_ACTIVE,
7503 .node = WREPL_NODE_B,
7505 .num_ips = ctx->addresses_best_num,
7506 .ips = ctx->addresses_best,
7507 .apply_expected = false
7511 * group,active vs. sgroup,active with different ip(s), unchecked
7514 .line = __location__,
7515 .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL),
7517 .nb_flags = NBT_NM_GROUP,
7519 .num_ips = ctx->addresses_best_num,
7520 .ips = ctx->addresses_best,
7521 .apply_expected = true
7527 .type = WREPL_TYPE_SGROUP,
7528 .state = WREPL_STATE_ACTIVE,
7529 .node = WREPL_NODE_B,
7531 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7532 .ips = addresses_B_3_4,
7533 .apply_expected = false
7537 * group,active vs. sgroup,tombstone with same ip(s), unchecked
7540 .line = __location__,
7541 .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL),
7543 .nb_flags = NBT_NM_GROUP,
7545 .num_ips = ctx->addresses_best_num,
7546 .ips = ctx->addresses_best,
7547 .apply_expected = true
7553 .type = WREPL_TYPE_SGROUP,
7554 .state = WREPL_STATE_TOMBSTONE,
7555 .node = WREPL_NODE_B,
7557 .num_ips = ctx->addresses_best_num,
7558 .ips = ctx->addresses_best,
7559 .apply_expected = false
7563 * group,active vs. sgroup,tombstone with different ip(s), unchecked
7566 .line = __location__,
7567 .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL),
7569 .nb_flags = NBT_NM_GROUP,
7571 .num_ips = ctx->addresses_best_num,
7572 .ips = ctx->addresses_best,
7573 .apply_expected = true
7579 .type = WREPL_TYPE_SGROUP,
7580 .state = WREPL_STATE_TOMBSTONE,
7581 .node = WREPL_NODE_B,
7583 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7584 .ips = addresses_B_3_4,
7585 .apply_expected = false
7589 * normal group vs. multi homed section
7592 * group,active vs. mhomed,active with same ip(s), unchecked
7595 .line = __location__,
7596 .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL),
7598 .nb_flags = NBT_NM_GROUP,
7600 .num_ips = ctx->addresses_best_num,
7601 .ips = ctx->addresses_best,
7602 .apply_expected = true
7608 .type = WREPL_TYPE_MHOMED,
7609 .state = WREPL_STATE_ACTIVE,
7610 .node = WREPL_NODE_B,
7612 .num_ips = ctx->addresses_best_num,
7613 .ips = ctx->addresses_best,
7614 .apply_expected = false
7618 * group,active vs. mhomed,active with different ip(s), unchecked
7621 .line = __location__,
7622 .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL),
7624 .nb_flags = NBT_NM_GROUP,
7626 .num_ips = ctx->addresses_best_num,
7627 .ips = ctx->addresses_best,
7628 .apply_expected = true
7634 .type = WREPL_TYPE_MHOMED,
7635 .state = WREPL_STATE_ACTIVE,
7636 .node = WREPL_NODE_B,
7638 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7639 .ips = addresses_B_3_4,
7640 .apply_expected = false
7644 * group,active vs. mhomed,tombstone with same ip(s), unchecked
7647 .line = __location__,
7648 .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL),
7650 .nb_flags = NBT_NM_GROUP,
7652 .num_ips = ctx->addresses_best_num,
7653 .ips = ctx->addresses_best,
7654 .apply_expected = true
7660 .type = WREPL_TYPE_MHOMED,
7661 .state = WREPL_STATE_TOMBSTONE,
7662 .node = WREPL_NODE_B,
7664 .num_ips = ctx->addresses_best_num,
7665 .ips = ctx->addresses_best,
7666 .apply_expected = false
7670 * group,active vs. mhomed,tombstone with different ip(s), unchecked
7673 .line = __location__,
7674 .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL),
7676 .nb_flags = NBT_NM_GROUP,
7678 .num_ips = ctx->addresses_best_num,
7679 .ips = ctx->addresses_best,
7680 .apply_expected = true
7686 .type = WREPL_TYPE_MHOMED,
7687 .state = WREPL_STATE_TOMBSTONE,
7688 .node = WREPL_NODE_B,
7690 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7691 .ips = addresses_B_3_4,
7692 .apply_expected = false
7696 * special group vs. unique section
7699 * sgroup,active vs. unique,active with same ip(s), unchecked
7702 .line = __location__,
7703 .name = _NBT_NAME("_SA_UA_SI_U", 0x1C, NULL),
7705 .nb_flags = NBT_NM_GROUP,
7707 .num_ips = ctx->addresses_best_num,
7708 .ips = ctx->addresses_best,
7709 .apply_expected = true
7715 .type = WREPL_TYPE_UNIQUE,
7716 .state = WREPL_STATE_ACTIVE,
7717 .node = WREPL_NODE_B,
7719 .num_ips = ctx->addresses_best_num,
7720 .ips = ctx->addresses_best,
7721 .apply_expected = false
7725 * sgroup,active vs. unique,active with different ip(s), unchecked
7728 .line = __location__,
7729 .name = _NBT_NAME("_SA_UA_DI_U", 0x1C, NULL),
7731 .nb_flags = NBT_NM_GROUP,
7733 .num_ips = ctx->addresses_best_num,
7734 .ips = ctx->addresses_best,
7735 .apply_expected = true
7741 .type = WREPL_TYPE_UNIQUE,
7742 .state = WREPL_STATE_ACTIVE,
7743 .node = WREPL_NODE_B,
7745 .num_ips = ARRAY_SIZE(addresses_B_1),
7746 .ips = addresses_B_1,
7747 .apply_expected = false
7751 * sgroup,active vs. unique,tombstone with same ip(s), unchecked
7754 .line = __location__,
7755 .name = _NBT_NAME("_SA_UT_SI_U", 0x1C, NULL),
7757 .nb_flags = NBT_NM_GROUP,
7759 .num_ips = ctx->addresses_best_num,
7760 .ips = ctx->addresses_best,
7761 .apply_expected = true
7767 .type = WREPL_TYPE_UNIQUE,
7768 .state = WREPL_STATE_TOMBSTONE,
7769 .node = WREPL_NODE_B,
7771 .num_ips = ctx->addresses_best_num,
7772 .ips = ctx->addresses_best,
7773 .apply_expected = false
7777 * sgroup,active vs. unique,tombstone with different ip(s), unchecked
7780 .line = __location__,
7781 .name = _NBT_NAME("_SA_UT_DI_U", 0x1C, NULL),
7783 .nb_flags = NBT_NM_GROUP,
7785 .num_ips = ctx->addresses_best_num,
7786 .ips = ctx->addresses_best,
7787 .apply_expected = true
7793 .type = WREPL_TYPE_UNIQUE,
7794 .state = WREPL_STATE_TOMBSTONE,
7795 .node = WREPL_NODE_B,
7797 .num_ips = ARRAY_SIZE(addresses_B_1),
7798 .ips = addresses_B_1,
7799 .apply_expected = false
7803 * special group vs. normal group section
7806 * sgroup,active vs. group,active with same ip(s), unchecked
7809 .line = __location__,
7810 .name = _NBT_NAME("_SA_GA_SI_U", 0x1C, NULL),
7812 .nb_flags = NBT_NM_GROUP,
7814 .num_ips = ctx->addresses_best_num,
7815 .ips = ctx->addresses_best,
7816 .apply_expected = true
7822 .type = WREPL_TYPE_GROUP,
7823 .state = WREPL_STATE_ACTIVE,
7824 .node = WREPL_NODE_B,
7826 .num_ips = ctx->addresses_best_num,
7827 .ips = ctx->addresses_best,
7828 .apply_expected = false
7832 * sgroup,active vs. group,active with different ip(s), unchecked
7835 .line = __location__,
7836 .name = _NBT_NAME("_SA_GA_DI_U", 0x1C, NULL),
7838 .nb_flags = NBT_NM_GROUP,
7840 .num_ips = ctx->addresses_best_num,
7841 .ips = ctx->addresses_best,
7842 .apply_expected = true
7848 .type = WREPL_TYPE_GROUP,
7849 .state = WREPL_STATE_ACTIVE,
7850 .node = WREPL_NODE_B,
7852 .num_ips = ARRAY_SIZE(addresses_B_1),
7853 .ips = addresses_B_1,
7854 .apply_expected = false
7858 * sgroup,active vs. group,tombstone with same ip(s), unchecked
7861 .line = __location__,
7862 .name = _NBT_NAME("_SA_GT_SI_U", 0x1C, NULL),
7864 .nb_flags = NBT_NM_GROUP,
7866 .num_ips = ctx->addresses_best_num,
7867 .ips = ctx->addresses_best,
7868 .apply_expected = true
7874 .type = WREPL_TYPE_GROUP,
7875 .state = WREPL_STATE_TOMBSTONE,
7876 .node = WREPL_NODE_B,
7878 .num_ips = ctx->addresses_best_num,
7879 .ips = ctx->addresses_best,
7880 .apply_expected = false
7884 * sgroup,active vs. group,tombstone with different ip(s), unchecked
7887 .line = __location__,
7888 .name = _NBT_NAME("_SA_GT_DI_U", 0x1C, NULL),
7890 .nb_flags = NBT_NM_GROUP,
7892 .num_ips = ctx->addresses_best_num,
7893 .ips = ctx->addresses_best,
7894 .apply_expected = true
7900 .type = WREPL_TYPE_GROUP,
7901 .state = WREPL_STATE_TOMBSTONE,
7902 .node = WREPL_NODE_B,
7904 .num_ips = ARRAY_SIZE(addresses_B_1),
7905 .ips = addresses_B_1,
7906 .apply_expected = false
7910 * special group vs. multi homed section
7913 * sgroup,active vs. mhomed,active with same ip(s), unchecked
7916 .line = __location__,
7917 .name = _NBT_NAME("_SA_MA_SI_U", 0x1C, NULL),
7919 .nb_flags = NBT_NM_GROUP,
7921 .num_ips = ctx->addresses_best_num,
7922 .ips = ctx->addresses_best,
7923 .apply_expected = true
7929 .type = WREPL_TYPE_MHOMED,
7930 .state = WREPL_STATE_ACTIVE,
7931 .node = WREPL_NODE_B,
7933 .num_ips = ctx->addresses_best_num,
7934 .ips = ctx->addresses_best,
7935 .apply_expected = false
7939 * sgroup,active vs. mhomed,active with different ip(s), unchecked
7942 .line = __location__,
7943 .name = _NBT_NAME("_SA_MA_DI_U", 0x1C, NULL),
7945 .nb_flags = NBT_NM_GROUP,
7947 .num_ips = ctx->addresses_best_num,
7948 .ips = ctx->addresses_best,
7949 .apply_expected = true
7955 .type = WREPL_TYPE_MHOMED,
7956 .state = WREPL_STATE_ACTIVE,
7957 .node = WREPL_NODE_B,
7959 .num_ips = ARRAY_SIZE(addresses_B_1),
7960 .ips = addresses_B_1,
7961 .apply_expected = false
7965 * sgroup,active vs. mhomed,tombstone with same ip(s), unchecked
7968 .line = __location__,
7969 .name = _NBT_NAME("_SA_MT_SI_U", 0x1C, NULL),
7971 .nb_flags = NBT_NM_GROUP,
7973 .num_ips = ctx->addresses_best_num,
7974 .ips = ctx->addresses_best,
7975 .apply_expected = true
7981 .type = WREPL_TYPE_MHOMED,
7982 .state = WREPL_STATE_TOMBSTONE,
7983 .node = WREPL_NODE_B,
7985 .num_ips = ctx->addresses_best_num,
7986 .ips = ctx->addresses_best,
7987 .apply_expected = false
7991 * sgroup,active vs. mhomed,tombstone with different ip(s), unchecked
7994 .line = __location__,
7995 .name = _NBT_NAME("_SA_MT_DI_U", 0x1C, NULL),
7997 .nb_flags = NBT_NM_GROUP,
7999 .num_ips = ctx->addresses_best_num,
8000 .ips = ctx->addresses_best,
8001 .apply_expected = true
8007 .type = WREPL_TYPE_MHOMED,
8008 .state = WREPL_STATE_TOMBSTONE,
8009 .node = WREPL_NODE_B,
8011 .num_ips = ARRAY_SIZE(addresses_B_1),
8012 .ips = addresses_B_1,
8013 .apply_expected = false
8017 * multi homed vs. unique section
8020 * mhomed,active vs. unique,active with same ip(s), unchecked
8023 .line = __location__,
8024 .name = _NBT_NAME("_MA_UA_SI_U", 0x00, NULL),
8028 .num_ips = ctx->addresses_best_num,
8029 .ips = ctx->addresses_best,
8030 .apply_expected = true
8036 .type = WREPL_TYPE_UNIQUE,
8037 .state = WREPL_STATE_ACTIVE,
8038 .node = WREPL_NODE_B,
8040 .num_ips = ctx->addresses_best_num,
8041 .ips = ctx->addresses_best,
8042 .apply_expected = true
8046 * mhomed,active vs. unique,active with different ip(s), positive response
8049 .line = __location__,
8050 .name = _NBT_NAME("_MA_UA_DI_P", 0x00, NULL),
8054 .num_ips = ctx->addresses_best_num,
8055 .ips = ctx->addresses_best,
8056 .apply_expected = true
8063 .type = WREPL_TYPE_UNIQUE,
8064 .state = WREPL_STATE_ACTIVE,
8065 .node = WREPL_NODE_B,
8067 .num_ips = ARRAY_SIZE(addresses_B_1),
8068 .ips = addresses_B_1,
8069 .apply_expected = false
8073 * mhomed,active vs. unique,active with different ip(s), positive response other ips
8076 .line = __location__,
8077 .name = _NBT_NAME("_MA_UA_DI_O", 0x00, NULL),
8081 .num_ips = ctx->addresses_best_num,
8082 .ips = ctx->addresses_best,
8083 .apply_expected = true
8088 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8089 .ips = addresses_A_3_4,
8092 .type = WREPL_TYPE_UNIQUE,
8093 .state = WREPL_STATE_ACTIVE,
8094 .node = WREPL_NODE_B,
8096 .num_ips = ARRAY_SIZE(addresses_B_1),
8097 .ips = addresses_B_1,
8098 .apply_expected = false
8102 * mhomed,active vs. unique,active with different ip(s), negative response
8105 .line = __location__,
8106 .name = _NBT_NAME("_MA_UA_DI_N", 0x00, NULL),
8110 .num_ips = ctx->addresses_best_num,
8111 .ips = ctx->addresses_best,
8112 .apply_expected = true
8119 .type = WREPL_TYPE_UNIQUE,
8120 .state = WREPL_STATE_ACTIVE,
8121 .node = WREPL_NODE_B,
8123 .num_ips = ARRAY_SIZE(addresses_B_1),
8124 .ips = addresses_B_1,
8125 .apply_expected = true
8129 * mhomed,active vs. unique,tombstone with same ip(s), unchecked
8132 .line = __location__,
8133 .name = _NBT_NAME("_MA_UT_SI_U", 0x00, NULL),
8137 .num_ips = ctx->addresses_best_num,
8138 .ips = ctx->addresses_best,
8139 .apply_expected = true
8145 .type = WREPL_TYPE_UNIQUE,
8146 .state = WREPL_STATE_TOMBSTONE,
8147 .node = WREPL_NODE_B,
8149 .num_ips = ctx->addresses_best_num,
8150 .ips = ctx->addresses_best,
8151 .apply_expected = false
8155 * mhomed,active vs. unique,tombstone with different ip(s), unchecked
8158 .line = __location__,
8159 .name = _NBT_NAME("_MA_UT_DI_U", 0x00, NULL),
8163 .num_ips = ctx->addresses_best_num,
8164 .ips = ctx->addresses_best,
8165 .apply_expected = true
8171 .type = WREPL_TYPE_UNIQUE,
8172 .state = WREPL_STATE_TOMBSTONE,
8173 .node = WREPL_NODE_B,
8175 .num_ips = ARRAY_SIZE(addresses_B_1),
8176 .ips = addresses_B_1,
8177 .apply_expected = false
8181 * multi homed vs. normal group section
8184 * mhomed,active vs. group,active with same ip(s), release expected
8187 .line = __location__,
8188 .name = _NBT_NAME("_MA_GA_SI_R", 0x00, NULL),
8192 .num_ips = ctx->addresses_best_num,
8193 .ips = ctx->addresses_best,
8194 .apply_expected = true
8198 .expect_release = true,
8201 .type = WREPL_TYPE_GROUP,
8202 .state = WREPL_STATE_ACTIVE,
8203 .node = WREPL_NODE_B,
8205 .num_ips = ctx->addresses_best_num,
8206 .ips = ctx->addresses_best,
8207 .apply_expected = true
8211 * mhomed,active vs. group,active with different ip(s), release expected
8214 .line = __location__,
8215 .name = _NBT_NAME("_MA_GA_DI_R", 0x00, NULL),
8219 .num_ips = ctx->addresses_best_num,
8220 .ips = ctx->addresses_best,
8221 .apply_expected = true
8225 .expect_release = true,
8228 .type = WREPL_TYPE_GROUP,
8229 .state = WREPL_STATE_ACTIVE,
8230 .node = WREPL_NODE_B,
8232 .num_ips = ARRAY_SIZE(addresses_B_1),
8233 .ips = addresses_B_1,
8234 .apply_expected = true
8238 * mhomed,active vs. group,tombstone with same ip(s), unchecked
8241 .line = __location__,
8242 .name = _NBT_NAME("_MA_GT_SI_U", 0x00, NULL),
8246 .num_ips = ctx->addresses_best_num,
8247 .ips = ctx->addresses_best,
8248 .apply_expected = true
8254 .type = WREPL_TYPE_GROUP,
8255 .state = WREPL_STATE_TOMBSTONE,
8256 .node = WREPL_NODE_B,
8258 .num_ips = ctx->addresses_best_num,
8259 .ips = ctx->addresses_best,
8260 .apply_expected = false
8264 * mhomed,active vs. group,tombstone with different ip(s), unchecked
8267 .line = __location__,
8268 .name = _NBT_NAME("_MA_GT_DI_U", 0x00, NULL),
8272 .num_ips = ctx->addresses_best_num,
8273 .ips = ctx->addresses_best,
8274 .apply_expected = true
8280 .type = WREPL_TYPE_GROUP,
8281 .state = WREPL_STATE_TOMBSTONE,
8282 .node = WREPL_NODE_B,
8284 .num_ips = ARRAY_SIZE(addresses_B_1),
8285 .ips = addresses_B_1,
8286 .apply_expected = false
8290 * multi homed vs. special group section
8293 * mhomed,active vs. sgroup,active with same ip(s), release expected
8296 .line = __location__,
8297 .name = _NBT_NAME("_MA_SA_SI_R", 0x00, NULL),
8301 .num_ips = ctx->addresses_best_num,
8302 .ips = ctx->addresses_best,
8303 .apply_expected = true
8307 .expect_release = true,
8310 .type = WREPL_TYPE_SGROUP,
8311 .state = WREPL_STATE_ACTIVE,
8312 .node = WREPL_NODE_B,
8314 .num_ips = ctx->addresses_best_num,
8315 .ips = ctx->addresses_best,
8316 .apply_expected = true
8320 * mhomed,active vs. group,active with different ip(s), release expected
8323 .line = __location__,
8324 .name = _NBT_NAME("_MA_SA_DI_R", 0x00, NULL),
8328 .num_ips = ctx->addresses_best_num,
8329 .ips = ctx->addresses_best,
8330 .apply_expected = true
8334 .expect_release = true,
8337 .type = WREPL_TYPE_SGROUP,
8338 .state = WREPL_STATE_ACTIVE,
8339 .node = WREPL_NODE_B,
8341 .num_ips = ARRAY_SIZE(addresses_B_1),
8342 .ips = addresses_B_1,
8343 .apply_expected = true
8347 * mhomed,active vs. sgroup,tombstone with same ip(s), unchecked
8350 .line = __location__,
8351 .name = _NBT_NAME("_MA_ST_SI_U", 0x00, NULL),
8355 .num_ips = ctx->addresses_best_num,
8356 .ips = ctx->addresses_best,
8357 .apply_expected = true
8363 .type = WREPL_TYPE_SGROUP,
8364 .state = WREPL_STATE_TOMBSTONE,
8365 .node = WREPL_NODE_B,
8367 .num_ips = ctx->addresses_best_num,
8368 .ips = ctx->addresses_best,
8369 .apply_expected = false
8373 * mhomed,active vs. sgroup,tombstone with different ip(s), unchecked
8376 .line = __location__,
8377 .name = _NBT_NAME("_MA_ST_DI_U", 0x00, NULL),
8381 .num_ips = ctx->addresses_best_num,
8382 .ips = ctx->addresses_best,
8383 .apply_expected = true
8389 .type = WREPL_TYPE_SGROUP,
8390 .state = WREPL_STATE_TOMBSTONE,
8391 .node = WREPL_NODE_B,
8393 .num_ips = ARRAY_SIZE(addresses_B_1),
8394 .ips = addresses_B_1,
8395 .apply_expected = false
8399 * multi homed vs. multi homed section
8402 * mhomed,active vs. mhomed,active with same ip(s), unchecked
8405 .line = __location__,
8406 .name = _NBT_NAME("_MA_MA_SI_U", 0x00, NULL),
8410 .num_ips = ctx->addresses_best_num,
8411 .ips = ctx->addresses_best,
8412 .apply_expected = true
8418 .type = WREPL_TYPE_MHOMED,
8419 .state = WREPL_STATE_ACTIVE,
8420 .node = WREPL_NODE_B,
8422 .num_ips = ctx->addresses_best_num,
8423 .ips = ctx->addresses_best,
8424 .apply_expected = true
8428 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8431 .line = __location__,
8432 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8436 .num_ips = ctx->addresses_best_num,
8437 .ips = ctx->addresses_best,
8438 .apply_expected = true
8444 .type = WREPL_TYPE_MHOMED,
8445 .state = WREPL_STATE_ACTIVE,
8446 .node = WREPL_NODE_B,
8448 .num_ips = ctx->addresses_all_num,
8449 .ips = ctx->addresses_all,
8450 .apply_expected = true
8454 * mhomed,active vs. mhomed,active with different ip(s), positive response
8457 .line = __location__,
8458 .name = _NBT_NAME("_MA_MA_DI_P", 0x00, NULL),
8462 .num_ips = ctx->addresses_best_num,
8463 .ips = ctx->addresses_best,
8464 .apply_expected = true
8471 .type = WREPL_TYPE_MHOMED,
8472 .state = WREPL_STATE_ACTIVE,
8473 .node = WREPL_NODE_B,
8475 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8476 .ips = addresses_B_3_4,
8477 .apply_expected = false
8481 * mhomed,active vs. mhomed,active with different ip(s), positive response other ips
8484 .line = __location__,
8485 .name = _NBT_NAME("_MA_MA_DI_O", 0x00, NULL),
8489 .num_ips = ctx->addresses_best_num,
8490 .ips = ctx->addresses_best,
8491 .apply_expected = true
8496 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8497 .ips = addresses_A_3_4,
8500 .type = WREPL_TYPE_MHOMED,
8501 .state = WREPL_STATE_ACTIVE,
8502 .node = WREPL_NODE_B,
8504 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8505 .ips = addresses_B_3_4,
8506 .apply_expected = false
8510 * mhomed,active vs. mhomed,active with different ip(s), negative response
8513 .line = __location__,
8514 .name = _NBT_NAME("_MA_MA_DI_N", 0x00, NULL),
8518 .num_ips = ctx->addresses_best_num,
8519 .ips = ctx->addresses_best,
8520 .apply_expected = true
8527 .type = WREPL_TYPE_MHOMED,
8528 .state = WREPL_STATE_ACTIVE,
8529 .node = WREPL_NODE_B,
8531 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8532 .ips = addresses_B_3_4,
8533 .apply_expected = true
8537 * mhomed,active vs. mhomed,tombstone with same ip(s), unchecked
8540 .line = __location__,
8541 .name = _NBT_NAME("_MA_MT_SI_U", 0x00, NULL),
8545 .num_ips = ctx->addresses_best_num,
8546 .ips = ctx->addresses_best,
8547 .apply_expected = true
8553 .type = WREPL_TYPE_MHOMED,
8554 .state = WREPL_STATE_TOMBSTONE,
8555 .node = WREPL_NODE_B,
8557 .num_ips = ctx->addresses_best_num,
8558 .ips = ctx->addresses_best,
8559 .apply_expected = false
8563 * mhomed,active vs. mhomed,tombstone with different ip(s), unchecked
8566 .line = __location__,
8567 .name = _NBT_NAME("_MA_MT_DI_U", 0x00, NULL),
8571 .num_ips = ctx->addresses_best_num,
8572 .ips = ctx->addresses_best,
8573 .apply_expected = true
8579 .type = WREPL_TYPE_MHOMED,
8580 .state = WREPL_STATE_TOMBSTONE,
8581 .node = WREPL_NODE_B,
8583 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8584 .ips = addresses_B_3_4,
8585 .apply_expected = false
8589 * some more multi homed test, including merging
8592 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8595 .line = __location__,
8596 .section= "Test Replica vs. owned active: some more MHOMED combinations",
8597 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8598 .comment= "C:MHOMED vs. B:ALL => B:ALL",
8599 .skip = (ctx->addresses_all_num < 3),
8603 .num_ips = ctx->addresses_mhomed_num,
8604 .ips = ctx->addresses_mhomed,
8605 .apply_expected = true
8611 .type = WREPL_TYPE_MHOMED,
8612 .state = WREPL_STATE_ACTIVE,
8613 .node = WREPL_NODE_B,
8615 .num_ips = ctx->addresses_all_num,
8616 .ips = ctx->addresses_all,
8617 .apply_expected = true
8621 * mhomed,active vs. mhomed,active with same ips, unchecked
8624 .line = __location__,
8625 .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL),
8626 .comment= "C:MHOMED vs. B:MHOMED => B:MHOMED",
8627 .skip = (ctx->addresses_mhomed_num < 2),
8631 .num_ips = ctx->addresses_mhomed_num,
8632 .ips = ctx->addresses_mhomed,
8633 .apply_expected = true
8639 .type = WREPL_TYPE_MHOMED,
8640 .state = WREPL_STATE_ACTIVE,
8641 .node = WREPL_NODE_B,
8643 .num_ips = ctx->addresses_mhomed_num,
8644 .ips = ctx->addresses_mhomed,
8645 .apply_expected = true
8649 * mhomed,active vs. mhomed,active with subset ip(s), positive response
8652 .line = __location__,
8653 .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL),
8654 .comment= "C:MHOMED vs. B:BEST (C:MHOMED) => B:MHOMED",
8655 .skip = (ctx->addresses_mhomed_num < 2),
8659 .num_ips = ctx->addresses_mhomed_num,
8660 .ips = ctx->addresses_mhomed,
8661 .apply_expected = true
8668 .type = WREPL_TYPE_MHOMED,
8669 .state = WREPL_STATE_ACTIVE,
8670 .node = WREPL_NODE_B,
8672 .num_ips = ctx->addresses_best_num,
8673 .ips = ctx->addresses_best,
8674 .mhomed_merge = true
8678 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with all addresses
8681 .line = __location__,
8682 .name = _NBT_NAME("_MA_MA_SB_A", 0x00, NULL),
8683 .comment= "C:MHOMED vs. B:BEST (C:ALL) => B:MHOMED",
8684 .skip = (ctx->addresses_all_num < 3),
8688 .num_ips = ctx->addresses_mhomed_num,
8689 .ips = ctx->addresses_mhomed,
8690 .apply_expected = true
8695 .num_ips = ctx->addresses_all_num,
8696 .ips = ctx->addresses_all,
8699 .type = WREPL_TYPE_MHOMED,
8700 .state = WREPL_STATE_ACTIVE,
8701 .node = WREPL_NODE_B,
8703 .num_ips = ctx->addresses_best_num,
8704 .ips = ctx->addresses_best,
8705 .mhomed_merge = true
8709 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with replicas addresses
8710 * TODO: check why the server sends a name release demand for one address?
8711 * the release demand has no effect to the database record...
8714 .line = __location__,
8715 .name = _NBT_NAME("_MA_MA_SB_PRA", 0x00, NULL),
8716 .comment= "C:MHOMED vs. B:BEST (C:BEST) => C:MHOMED",
8717 .skip = (ctx->addresses_all_num < 2),
8721 .num_ips = ctx->addresses_mhomed_num,
8722 .ips = ctx->addresses_mhomed,
8723 .apply_expected = true
8728 .num_ips = ctx->addresses_best_num,
8729 .ips = ctx->addresses_best,
8730 .late_release = true
8733 .type = WREPL_TYPE_MHOMED,
8734 .state = WREPL_STATE_ACTIVE,
8735 .node = WREPL_NODE_B,
8737 .num_ips = ctx->addresses_best_num,
8738 .ips = ctx->addresses_best,
8739 .apply_expected = false
8743 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with other addresses
8746 .line = __location__,
8747 .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL),
8748 .comment= "C:MHOMED vs. B:BEST (B:B_3_4) =>C:MHOMED",
8749 .skip = (ctx->addresses_all_num < 2),
8753 .num_ips = ctx->addresses_mhomed_num,
8754 .ips = ctx->addresses_mhomed,
8755 .apply_expected = true
8760 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8761 .ips = addresses_B_3_4,
8764 .type = WREPL_TYPE_MHOMED,
8765 .state = WREPL_STATE_ACTIVE,
8766 .node = WREPL_NODE_B,
8768 .num_ips = ctx->addresses_best_num,
8769 .ips = ctx->addresses_best,
8770 .apply_expected = false
8774 * mhomed,active vs. mhomed,active with subset ip(s), negative response
8777 .line = __location__,
8778 .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL),
8779 .comment= "C:MHOMED vs. B:BEST (NEGATIVE) => B:BEST",
8780 .skip = (ctx->addresses_mhomed_num < 2),
8784 .num_ips = ctx->addresses_mhomed_num,
8785 .ips = ctx->addresses_mhomed,
8786 .apply_expected = true
8793 .type = WREPL_TYPE_MHOMED,
8794 .state = WREPL_STATE_ACTIVE,
8795 .node = WREPL_NODE_B,
8797 .num_ips = ctx->addresses_best_num,
8798 .ips = ctx->addresses_best,
8799 .apply_expected = true
8803 * some more multi homed and unique test, including merging
8806 * mhomed,active vs. unique,active with subset ip(s), positive response
8809 .line = __location__,
8810 .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations",
8811 .name = _NBT_NAME("_MA_UA_SB_P", 0x00, NULL),
8812 .comment= "C:MHOMED vs. B:UNIQUE,BEST (C:MHOMED) => B:MHOMED",
8813 .skip = (ctx->addresses_all_num < 2),
8817 .num_ips = ctx->addresses_mhomed_num,
8818 .ips = ctx->addresses_mhomed,
8819 .apply_expected = true
8826 .type = WREPL_TYPE_UNIQUE,
8827 .state = WREPL_STATE_ACTIVE,
8828 .node = WREPL_NODE_B,
8830 .num_ips = ctx->addresses_best_num,
8831 .ips = ctx->addresses_best,
8832 .mhomed_merge = true
8836 * unique,active vs. unique,active with different ip(s), positive response, with replicas address
8837 * TODO: check why the server sends a name release demand for one address?
8838 * the release demand has no effect to the database record...
8841 .line = __location__,
8842 .name = _NBT_NAME("_UA_UA_DI_PRA", 0x00, NULL),
8843 .comment= "C:BEST vs. B:BEST2 (C:BEST2,LR:BEST2) => C:BEST",
8844 .skip = (ctx->addresses_all_num < 2),
8848 .num_ips = ctx->addresses_best_num,
8849 .ips = ctx->addresses_best,
8850 .apply_expected = true
8855 .num_ips = ctx->addresses_best2_num,
8856 .ips = ctx->addresses_best2,
8857 .late_release = true
8860 .type = WREPL_TYPE_UNIQUE,
8861 .state = WREPL_STATE_ACTIVE,
8862 .node = WREPL_NODE_B,
8864 .num_ips = ctx->addresses_best2_num,
8865 .ips = ctx->addresses_best2,
8866 .apply_expected = false,
8870 * unique,active vs. unique,active with different ip(s), positive response, with all addresses
8873 .line = __location__,
8874 .name = _NBT_NAME("_UA_UA_DI_A", 0x00, NULL),
8875 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
8876 .skip = (ctx->addresses_all_num < 3),
8880 .num_ips = ctx->addresses_best_num,
8881 .ips = ctx->addresses_best,
8882 .apply_expected = true
8887 .num_ips = ctx->addresses_all_num,
8888 .ips = ctx->addresses_all,
8891 .type = WREPL_TYPE_UNIQUE,
8892 .state = WREPL_STATE_ACTIVE,
8893 .node = WREPL_NODE_B,
8895 .num_ips = ctx->addresses_best2_num,
8896 .ips = ctx->addresses_best2,
8897 .mhomed_merge = true,
8901 * unique,active vs. mhomed,active with different ip(s), positive response, with all addresses
8904 .line = __location__,
8905 .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL),
8906 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
8907 .skip = (ctx->addresses_all_num < 3),
8911 .num_ips = ctx->addresses_best_num,
8912 .ips = ctx->addresses_best,
8913 .apply_expected = true
8918 .num_ips = ctx->addresses_all_num,
8919 .ips = ctx->addresses_all,
8922 .type = WREPL_TYPE_MHOMED,
8923 .state = WREPL_STATE_ACTIVE,
8924 .node = WREPL_NODE_B,
8926 .num_ips = ctx->addresses_best2_num,
8927 .ips = ctx->addresses_best2,
8928 .mhomed_merge = true,
8932 * special group vs. special group merging section
8935 * sgroup,active vs. sgroup,active with different ip(s)
8938 .line = __location__,
8939 .section= "Test Replica vs. owned active: SGROUP vs. SGROUP tests",
8940 .name = _NBT_NAME("_SA_SA_DI_U", 0x1C, NULL),
8941 .skip = (ctx->addresses_all_num < 3),
8943 .nb_flags = NBT_NM_GROUP,
8945 .num_ips = ctx->addresses_mhomed_num,
8946 .ips = ctx->addresses_mhomed,
8947 .apply_expected = true
8953 .type = WREPL_TYPE_SGROUP,
8954 .state = WREPL_STATE_ACTIVE,
8955 .node = WREPL_NODE_B,
8957 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8958 .ips = addresses_B_3_4,
8959 .sgroup_merge = true
8964 * sgroup,active vs. sgroup,active with same ip(s)
8967 .line = __location__,
8968 .name = _NBT_NAME("_SA_SA_SI_U", 0x1C, NULL),
8969 .skip = (ctx->addresses_all_num < 3),
8971 .nb_flags = NBT_NM_GROUP,
8973 .num_ips = ctx->addresses_mhomed_num,
8974 .ips = ctx->addresses_mhomed,
8975 .apply_expected = true
8981 .type = WREPL_TYPE_SGROUP,
8982 .state = WREPL_STATE_ACTIVE,
8983 .node = WREPL_NODE_B,
8985 .num_ips = ctx->addresses_mhomed_num,
8986 .ips = ctx->addresses_mhomed,
8987 .sgroup_merge = true
8991 * sgroup,active vs. sgroup,active with superset ip(s)
8994 .line = __location__,
8995 .name = _NBT_NAME("_SA_SA_SP_U", 0x1C, NULL),
8996 .skip = (ctx->addresses_all_num < 3),
8998 .nb_flags = NBT_NM_GROUP,
9000 .num_ips = ctx->addresses_mhomed_num,
9001 .ips = ctx->addresses_mhomed,
9002 .apply_expected = true
9008 .type = WREPL_TYPE_SGROUP,
9009 .state = WREPL_STATE_ACTIVE,
9010 .node = WREPL_NODE_B,
9012 .num_ips = ctx->addresses_all_num,
9013 .ips = ctx->addresses_all,
9014 .sgroup_merge = true
9018 * sgroup,active vs. sgroup,active with subset ip(s)
9021 .line = __location__,
9022 .name = _NBT_NAME("_SA_SA_SB_U", 0x1C, NULL),
9023 .skip = (ctx->addresses_all_num < 3),
9025 .nb_flags = NBT_NM_GROUP,
9027 .num_ips = ctx->addresses_mhomed_num,
9028 .ips = ctx->addresses_mhomed,
9029 .apply_expected = true
9035 .type = WREPL_TYPE_SGROUP,
9036 .state = WREPL_STATE_ACTIVE,
9037 .node = WREPL_NODE_B,
9039 .num_ips = ctx->addresses_best_num,
9040 .ips = ctx->addresses_best,
9041 .sgroup_merge = true
9045 * sgroup,active vs. sgroup,tombstone with different ip(s)
9048 .line = __location__,
9049 .name = _NBT_NAME("_SA_ST_DI_U", 0x1C, NULL),
9050 .skip = (ctx->addresses_all_num < 3),
9052 .nb_flags = NBT_NM_GROUP,
9054 .num_ips = ctx->addresses_mhomed_num,
9055 .ips = ctx->addresses_mhomed,
9056 .apply_expected = true
9062 .type = WREPL_TYPE_SGROUP,
9063 .state = WREPL_STATE_TOMBSTONE,
9064 .node = WREPL_NODE_B,
9066 .num_ips = ARRAY_SIZE(addresses_B_3_4),
9067 .ips = addresses_B_3_4,
9068 .apply_expected = false
9072 * sgroup,active vs. sgroup,tombstone with same ip(s)
9075 .line = __location__,
9076 .name = _NBT_NAME("_SA_ST_SI_U", 0x1C, NULL),
9077 .skip = (ctx->addresses_all_num < 3),
9079 .nb_flags = NBT_NM_GROUP,
9081 .num_ips = ctx->addresses_mhomed_num,
9082 .ips = ctx->addresses_mhomed,
9083 .apply_expected = true
9089 .type = WREPL_TYPE_SGROUP,
9090 .state = WREPL_STATE_TOMBSTONE,
9091 .node = WREPL_NODE_B,
9093 .num_ips = ctx->addresses_mhomed_num,
9094 .ips = ctx->addresses_mhomed,
9095 .apply_expected = false
9099 * sgroup,active vs. sgroup,tombstone with superset ip(s)
9102 .line = __location__,
9103 .name = _NBT_NAME("_SA_ST_SP_U", 0x1C, NULL),
9104 .skip = (ctx->addresses_all_num < 3),
9106 .nb_flags = NBT_NM_GROUP,
9108 .num_ips = ctx->addresses_mhomed_num,
9109 .ips = ctx->addresses_mhomed,
9110 .apply_expected = true
9116 .type = WREPL_TYPE_SGROUP,
9117 .state = WREPL_STATE_TOMBSTONE,
9118 .node = WREPL_NODE_B,
9120 .num_ips = ctx->addresses_all_num,
9121 .ips = ctx->addresses_all,
9122 .apply_expected = false
9126 * sgroup,active vs. sgroup,tombstone with subset ip(s)
9129 .line = __location__,
9130 .name = _NBT_NAME("_SA_ST_SB_U", 0x1C, NULL),
9131 .skip = (ctx->addresses_all_num < 3),
9133 .nb_flags = NBT_NM_GROUP,
9135 .num_ips = ctx->addresses_mhomed_num,
9136 .ips = ctx->addresses_mhomed,
9137 .apply_expected = true
9143 .type = WREPL_TYPE_SGROUP,
9144 .state = WREPL_STATE_TOMBSTONE,
9145 .node = WREPL_NODE_B,
9147 .num_ips = ctx->addresses_best_num,
9148 .ips = ctx->addresses_best,
9149 .apply_expected = false
9155 if (!ctx->nbtsock_srv) {
9156 torture_comment(tctx, "SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
9161 torture_comment(tctx, "Test Replica records vs. owned active records\n");
9163 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
9165 struct test_conflict_owned_active_vs_replica_struct record = records[i];
9166 uint32_t j, count = 1;
9169 if (records[i].wins.mhomed || records[i].name.type == 0x1C) {
9170 count = records[i].wins.num_ips;
9173 if (records[i].section) {
9174 torture_comment(tctx, "%s\n", records[i].section);
9177 if (records[i].skip) {
9178 torture_comment(tctx, "%s => SKIPPED\n", nbt_name_string(ctx, &records[i].name));
9182 if (records[i].replica.mhomed_merge) {
9183 action = "MHOMED_MERGE";
9184 } else if (records[i].replica.sgroup_merge) {
9185 action = "SGROUP_MERGE";
9186 } else if (records[i].replica.apply_expected) {
9189 action = "NOT REPLACE";
9192 torture_comment(tctx, "%s%s%s => %s\n",
9193 nbt_name_string(ctx, &records[i].name),
9194 (records[i].comment?": ":""),
9195 (records[i].comment?records[i].comment:""),
9198 /* Prepare for multi homed registration */
9199 ZERO_STRUCT(records[i].defend);
9200 records[i].defend.timeout = 10;
9201 records[i].defend.positive = true;
9202 nbt_set_incoming_handler(ctx->nbtsock_srv,
9203 test_conflict_owned_active_vs_replica_handler,
9205 if (ctx->nbtsock_srv2) {
9206 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9207 test_conflict_owned_active_vs_replica_handler,
9214 for (j=0; j < count; j++) {
9215 struct nbt_name_request *req;
9217 name_register->in.name = records[i].name;
9218 name_register->in.dest_addr = ctx->address;
9219 name_register->in.address = records[i].wins.ips[j].ip;
9220 name_register->in.nb_flags = records[i].wins.nb_flags;
9221 name_register->in.register_demand= false;
9222 name_register->in.broadcast = false;
9223 name_register->in.multi_homed = records[i].wins.mhomed;
9224 name_register->in.ttl = 300000;
9225 name_register->in.timeout = 70;
9226 name_register->in.retries = 0;
9228 req = nbt_name_register_send(ctx->nbtsock, name_register);
9230 /* push the request on the wire */
9231 event_loop_once(ctx->nbtsock->event_ctx);
9234 * if we register multiple addresses,
9235 * the server will do name queries to see if the old addresses
9238 if (records[i].wins.mhomed && j > 0) {
9239 end = timeval_current_ofs(records[i].defend.timeout,0);
9240 records[i].defend.ret = true;
9241 while (records[i].defend.timeout > 0) {
9242 event_loop_once(ctx->nbtsock_srv->event_ctx);
9243 if (timeval_expired(&end)) break;
9245 ret &= records[i].defend.ret;
9248 status = nbt_name_register_recv(req, ctx, name_register);
9249 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9250 torture_comment(tctx, "No response from %s for name register\n", ctx->address);
9253 if (!NT_STATUS_IS_OK(status)) {
9254 torture_comment(tctx, "Bad response from %s for name register - %s\n",
9255 ctx->address, nt_errstr(status));
9258 CHECK_VALUE(tctx, name_register->out.rcode, 0);
9259 CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address);
9260 CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type);
9261 CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name);
9262 CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope);
9263 CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[j].ip);
9266 /* Prepare for the current test */
9267 records[i].defend = record.defend;
9268 nbt_set_incoming_handler(ctx->nbtsock_srv,
9269 test_conflict_owned_active_vs_replica_handler,
9271 if (ctx->nbtsock_srv2) {
9272 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9273 test_conflict_owned_active_vs_replica_handler,
9280 wins_name->name = &records[i].name;
9281 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
9282 records[i].replica.state,
9283 records[i].replica.node,
9284 records[i].replica.is_static);
9285 wins_name->id = ++ctx->b.max_version;
9286 if (wins_name->flags & 2) {
9287 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
9288 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
9290 wins_name->addresses.ip = records[i].replica.ips[0].ip;
9292 wins_name->unknown = "255.255.255.255";
9294 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9297 * wait for the name query, which is handled in
9298 * test_conflict_owned_active_vs_replica_handler()
9300 end = timeval_current_ofs(records[i].defend.timeout,0);
9301 records[i].defend.ret = true;
9302 while (records[i].defend.timeout > 0) {
9303 event_loop_once(ctx->nbtsock_srv->event_ctx);
9304 if (timeval_expired(&end)) break;
9306 ret &= records[i].defend.ret;
9308 if (records[i].defend.late_release) {
9309 records[i].defend = record.defend;
9310 records[i].defend.expect_release = true;
9312 * wait for the name release demand, which is handled in
9313 * test_conflict_owned_active_vs_replica_handler()
9315 end = timeval_current_ofs(records[i].defend.timeout,0);
9316 records[i].defend.ret = true;
9317 while (records[i].defend.timeout > 0) {
9318 event_loop_once(ctx->nbtsock_srv->event_ctx);
9319 if (timeval_expired(&end)) break;
9321 ret &= records[i].defend.ret;
9324 if (records[i].replica.mhomed_merge) {
9325 ret &= test_wrepl_mhomed_merged(tctx, ctx, &ctx->c,
9326 records[i].wins.num_ips, records[i].wins.ips,
9328 records[i].replica.num_ips, records[i].replica.ips,
9330 } else if (records[i].replica.sgroup_merge) {
9331 ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL,
9333 records[i].wins.num_ips, records[i].wins.ips,
9335 records[i].replica.num_ips, records[i].replica.ips,
9338 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name,
9339 records[i].replica.apply_expected);
9342 if (records[i].replica.apply_expected ||
9343 records[i].replica.mhomed_merge) {
9344 wins_name->name = &records[i].name;
9345 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9346 WREPL_STATE_TOMBSTONE,
9347 WREPL_NODE_B, false);
9348 wins_name->id = ++ctx->b.max_version;
9349 wins_name->addresses.ip = addresses_B_1[0].ip;
9350 wins_name->unknown = "255.255.255.255";
9352 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9353 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9355 for (j=0; j < count; j++) {
9356 struct nbt_name_socket *nbtsock = ctx->nbtsock;
9358 if (ctx->myaddr2 && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2->addr) == 0) {
9359 nbtsock = ctx->nbtsock2;
9362 release->in.name = records[i].name;
9363 release->in.dest_addr = ctx->address;
9364 release->in.address = records[i].wins.ips[j].ip;
9365 release->in.nb_flags = records[i].wins.nb_flags;
9366 release->in.broadcast = false;
9367 release->in.timeout = 30;
9368 release->in.retries = 0;
9370 status = nbt_name_release(nbtsock, ctx, release);
9371 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9372 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
9375 if (!NT_STATUS_IS_OK(status)) {
9376 torture_comment(tctx, "Bad response from %s for name query - %s\n",
9377 ctx->address, nt_errstr(status));
9380 CHECK_VALUE(tctx, release->out.rcode, 0);
9383 if (records[i].replica.sgroup_merge) {
9384 /* clean up the SGROUP record */
9385 wins_name->name = &records[i].name;
9386 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9388 WREPL_NODE_B, false);
9389 wins_name->id = ++ctx->b.max_version;
9390 wins_name->addresses.addresses.num_ips = 0;
9391 wins_name->addresses.addresses.ips = NULL;
9392 wins_name->unknown = "255.255.255.255";
9393 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9395 /* take ownership of the SGROUP record */
9396 wins_name->name = &records[i].name;
9397 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9399 WREPL_NODE_B, false);
9400 wins_name->id = ++ctx->b.max_version;
9401 wins_name->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
9402 wins_name->addresses.addresses.ips = discard_const(addresses_B_1);
9403 wins_name->unknown = "255.255.255.255";
9404 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9405 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9407 /* overwrite the SGROUP record with unique,tombstone */
9408 wins_name->name = &records[i].name;
9409 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9410 WREPL_STATE_TOMBSTONE,
9411 WREPL_NODE_B, false);
9412 wins_name->id = ++ctx->b.max_version;
9413 wins_name->addresses.ip = addresses_A_1[0].ip;
9414 wins_name->unknown = "255.255.255.255";
9415 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9416 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9421 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
9429 #define _NBT_ASSERT(v, correct) do { \
9430 if ((v) != (correct)) { \
9431 printf("(%s) Incorrect value %s=%d - should be %s (%d)\n", \
9432 __location__, #v, v, #correct, correct); \
9437 #define _NBT_ASSERT_STRING(v, correct) do { \
9438 if ( ((!v) && (correct)) || \
9439 ((v) && (!correct)) || \
9440 ((v) && (correct) && strcmp(v,correct) != 0)) { \
9441 printf("(%s) Incorrect value %s=%s - should be %s\n", \
9442 __location__, #v, v, correct); \
9447 static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
9448 struct nbt_name_packet *req_packet,
9449 struct socket_address *src)
9451 struct nbt_name *name;
9452 struct nbt_name_packet *rep_packet;
9453 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9455 _NBT_ASSERT(req_packet->qdcount, 1);
9456 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9457 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9459 name = &req_packet->questions[0].name;
9461 _NBT_ASSERT(name->type, rec->name.type);
9462 _NBT_ASSERT_STRING(name->name, rec->name.name);
9463 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9465 _NBT_ASSERT(rec->defend.expect_release, false);
9467 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9468 if (rep_packet == NULL) return;
9470 rep_packet->name_trn_id = req_packet->name_trn_id;
9471 rep_packet->ancount = 1;
9473 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9474 if (rep_packet->answers == NULL) return;
9476 rep_packet->answers[0].name = *name;
9477 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9478 rep_packet->answers[0].ttl = 0;
9480 if (rec->defend.positive) {
9481 uint32_t i, num_ips;
9482 const struct wrepl_ip *ips;
9484 if (rec->defend.num_ips > 0) {
9485 num_ips = rec->defend.num_ips;
9486 ips = rec->defend.ips;
9488 num_ips = rec->wins.num_ips;
9489 ips = rec->wins.ips;
9492 /* send a positive reply */
9493 rep_packet->operation =
9496 NBT_FLAG_AUTHORITIVE |
9497 NBT_FLAG_RECURSION_DESIRED |
9498 NBT_FLAG_RECURSION_AVAIL;
9500 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9502 rep_packet->answers[0].rdata.netbios.length = num_ips*6;
9503 rep_packet->answers[0].rdata.netbios.addresses =
9504 talloc_array(rep_packet->answers, struct nbt_rdata_address, num_ips);
9505 if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return;
9507 for (i=0; i < num_ips; i++) {
9508 struct nbt_rdata_address *addr =
9509 &rep_packet->answers[0].rdata.netbios.addresses[i];
9510 addr->nb_flags = rec->wins.nb_flags;
9511 addr->ipaddr = ips[i].ip;
9513 DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
9514 nbt_name_string(rep_packet, name), src->addr, src->port));
9516 /* send a negative reply */
9517 rep_packet->operation =
9520 NBT_FLAG_AUTHORITIVE |
9523 rep_packet->answers[0].rr_type = NBT_QTYPE_NULL;
9525 ZERO_STRUCT(rep_packet->answers[0].rdata);
9527 DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
9528 nbt_name_string(rep_packet, name), src->addr, src->port));
9531 nbt_name_reply_send(nbtsock, src, rep_packet);
9532 talloc_free(rep_packet);
9534 /* make sure we push the reply to the wire */
9535 event_loop_once(nbtsock->event_ctx);
9538 rec->defend.timeout = 0;
9539 rec->defend.ret = true;
9542 static void test_conflict_owned_active_vs_replica_handler_release(
9543 struct nbt_name_socket *nbtsock,
9544 struct nbt_name_packet *req_packet,
9545 struct socket_address *src)
9547 struct nbt_name *name;
9548 struct nbt_name_packet *rep_packet;
9549 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9551 _NBT_ASSERT(req_packet->qdcount, 1);
9552 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9553 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9555 name = &req_packet->questions[0].name;
9557 _NBT_ASSERT(name->type, rec->name.type);
9558 _NBT_ASSERT_STRING(name->name, rec->name.name);
9559 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9561 _NBT_ASSERT(rec->defend.expect_release, true);
9563 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9564 if (rep_packet == NULL) return;
9566 rep_packet->name_trn_id = req_packet->name_trn_id;
9567 rep_packet->ancount = 1;
9568 rep_packet->operation =
9570 NBT_OPCODE_RELEASE |
9571 NBT_FLAG_AUTHORITIVE;
9573 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9574 if (rep_packet->answers == NULL) return;
9576 rep_packet->answers[0].name = *name;
9577 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9578 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9579 rep_packet->answers[0].ttl = req_packet->additional[0].ttl;
9580 rep_packet->answers[0].rdata = req_packet->additional[0].rdata;
9582 DEBUG(2,("Sending name release reply for %s to %s:%d\n",
9583 nbt_name_string(rep_packet, name), src->addr, src->port));
9585 nbt_name_reply_send(nbtsock, src, rep_packet);
9586 talloc_free(rep_packet);
9588 /* make sure we push the reply to the wire */
9589 event_loop_once(nbtsock->event_ctx);
9592 rec->defend.timeout = 0;
9593 rec->defend.ret = true;
9596 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
9597 struct nbt_name_packet *req_packet,
9598 struct socket_address *src)
9600 struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private;
9602 rec->defend.ret = false;
9604 switch (req_packet->operation & NBT_OPCODE) {
9605 case NBT_OPCODE_QUERY:
9606 test_conflict_owned_active_vs_replica_handler_query(nbtsock, req_packet, src);
9608 case NBT_OPCODE_RELEASE:
9609 test_conflict_owned_active_vs_replica_handler_release(nbtsock, req_packet, src);
9612 printf("%s: unexpected incoming packet\n", __location__);
9618 test WINS replication replica conflicts operations
9620 static bool torture_nbt_winsreplication_replica(struct torture_context *tctx)
9623 struct test_wrepl_conflict_conn *ctx;
9625 const char *address;
9626 struct nbt_name name;
9628 if (!torture_nbt_get_name(tctx, &name, &address))
9631 ctx = test_create_conflict_ctx(tctx, address);
9632 if (!ctx) return false;
9634 ret &= test_conflict_same_owner(tctx, ctx);
9635 ret &= test_conflict_different_owner(tctx, ctx);
9641 test WINS replication owned conflicts operations
9643 static bool torture_nbt_winsreplication_owned(struct torture_context *tctx)
9645 const char *address;
9646 struct nbt_name name;
9648 struct test_wrepl_conflict_conn *ctx;
9650 if (torture_setting_bool(tctx, "quick", false))
9652 "skip NBT-WINSREPLICATION-OWNED test in quick test mode\n");
9654 if (!torture_nbt_get_name(tctx, &name, &address))
9657 ctx = test_create_conflict_ctx(tctx, address);
9658 torture_assert(tctx, ctx != NULL, "Creating context failed");
9660 ret &= test_conflict_owned_released_vs_replica(tctx, ctx);
9661 ret &= test_conflict_owned_active_vs_replica(tctx, ctx);
9667 test simple WINS replication operations
9669 struct torture_suite *torture_nbt_winsreplication(void)
9671 struct torture_suite *suite = torture_suite_create(
9672 talloc_autofree_context(),
9674 struct torture_tcase *tcase;
9676 tcase = torture_suite_add_simple_test(suite, "assoc_ctx1",
9678 tcase->tests->dangerous = true;
9680 torture_suite_add_simple_test(suite, "assoc_ctx2",
9683 torture_suite_add_simple_test(suite, "wins_replication",
9684 test_wins_replication);
9686 torture_suite_add_simple_test(suite, "replica",
9687 torture_nbt_winsreplication_replica);
9689 torture_suite_add_simple_test(suite, "owned",
9690 torture_nbt_winsreplication_owned);