s4:NBT-WINSREPLICATION: use an array of nbt_names to loop over different names
[Samba/bb.git] / source4 / torture / nbt / winsreplication.c
blob6d75aac80efd5811e457f1d21e629849c0378956
1 /*
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/>.
23 #include "includes.h"
24 #include "libcli/wrepl/winsrepl.h"
25 #include "lib/events/events.h"
26 #include "lib/socket/socket.h"
27 #include "system/network.h"
28 #include "lib/socket/netif.h"
29 #include "librpc/gen_ndr/ndr_nbt.h"
30 #include "torture/torture.h"
31 #include "torture/nbt/proto.h"
32 #include "param/param.h"
34 #define CHECK_STATUS(tctx, status, correct) \
35 torture_assert_ntstatus_equal(tctx, status, correct, \
36 "Incorrect status")
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", \
41 #v, v, correct))
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) {\
52 .name = n,\
53 .type = t,\
54 .scope = s\
57 static const char *wrepl_name_type_string(enum wrepl_name_type type)
59 switch (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)
70 switch (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
81 they are created on.
83 static bool test_assoc_ctx1(struct torture_context *tctx)
85 bool ret = true;
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;
96 NTSTATUS status;
97 struct nbt_name name;
98 const char *address;
100 if (!torture_nbt_get_name(tctx, &name, &address))
101 return false;
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, tctx->ev, lp_iconv_convenience(tctx->lp_ctx));
106 wrepl_socket2 = wrepl_socket_init(tctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx));
108 torture_comment(tctx, "Setup 2 wrepl connections\n");
109 status = wrepl_connect(wrepl_socket1, wrepl_best_ip(tctx->lp_ctx, address), address);
110 CHECK_STATUS(tctx, status, NT_STATUS_OK);
112 status = wrepl_connect(wrepl_socket2, wrepl_best_ip(tctx->lp_ctx, address), 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");
128 ZERO_STRUCT(packet);
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;
133 ZERO_STRUCT(ctrl);
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);
168 return ret;
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;
178 uint32_t assoc_ctx1;
179 struct nbt_name name;
180 NTSTATUS status;
181 const char *address;
183 if (!torture_nbt_get_name(tctx, &name, &address))
184 return false;
186 torture_comment(tctx, "Test if we always get back the same assoc_ctx\n");
188 wrepl_socket = wrepl_socket_init(tctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx));
190 torture_comment(tctx, "Setup wrepl connections\n");
191 status = wrepl_connect(wrepl_socket, wrepl_best_ip(tctx->lp_ctx, address), 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);
216 return true;
221 display a replication entry
223 static void display_entry(struct torture_context *tctx, struct wrepl_name *name)
225 int i;
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;
244 NTSTATUS status;
245 int i, j;
246 struct wrepl_associate associate;
247 struct wrepl_pull_table pull_table;
248 struct wrepl_pull_names pull_names;
249 struct nbt_name name;
250 const char *address;
252 if (!torture_nbt_get_name(tctx, &name, &address))
253 return false;
255 torture_comment(tctx, "Test one pull replication cycle\n");
257 wrepl_socket = wrepl_socket_init(tctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx));
259 torture_comment(tctx, "Setup wrepl connections\n");
260 status = wrepl_connect(wrepl_socket, wrepl_best_ip(tctx->lp_ctx, address), 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;
278 ZERO_STRUCT(packet);
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);
285 talloc_free(req);
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",
296 partner->address,
297 (long long)partner->max_version,
298 (long long)partner->min_version,
299 partner->type);
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);
316 return true;
319 struct test_wrepl_conflict_conn {
320 const char *address;
321 struct wrepl_socket *pull;
322 uint32_t pull_assoc;
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(
541 struct torture_context *tctx, const char *address)
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;
547 NTSTATUS status;
548 uint32_t i;
549 struct interface *ifaces;
551 ctx = talloc_zero(tctx, struct test_wrepl_conflict_conn);
552 if (!ctx) return NULL;
554 ctx->address = address;
555 ctx->pull = wrepl_socket_init(ctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx));
556 if (!ctx->pull) return NULL;
558 torture_comment(tctx, "Setup wrepl conflict pull connection\n");
559 status = wrepl_connect(ctx->pull, wrepl_best_ip(tctx->lp_ctx, ctx->address), ctx->address);
560 if (!NT_STATUS_IS_OK(status)) return NULL;
562 status = wrepl_associate(ctx->pull, &associate);
563 if (!NT_STATUS_IS_OK(status)) return NULL;
565 ctx->pull_assoc = associate.out.assoc_ctx;
567 ctx->a.address = TEST_OWNER_A_ADDRESS;
568 ctx->a.max_version = 0;
569 ctx->a.min_version = 0;
570 ctx->a.type = 1;
572 ctx->b.address = TEST_OWNER_B_ADDRESS;
573 ctx->b.max_version = 0;
574 ctx->b.min_version = 0;
575 ctx->b.type = 1;
577 ctx->x.address = TEST_OWNER_X_ADDRESS;
578 ctx->x.max_version = 0;
579 ctx->x.min_version = 0;
580 ctx->x.type = 1;
582 ctx->c.address = address;
583 ctx->c.max_version = 0;
584 ctx->c.min_version = 0;
585 ctx->c.type = 1;
587 pull_table.in.assoc_ctx = ctx->pull_assoc;
588 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
589 if (!NT_STATUS_IS_OK(status)) return NULL;
591 for (i=0; i < pull_table.out.num_partners; i++) {
592 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
593 ctx->a.max_version = pull_table.out.partners[i].max_version;
594 ctx->a.min_version = pull_table.out.partners[i].min_version;
596 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
597 ctx->b.max_version = pull_table.out.partners[i].max_version;
598 ctx->b.min_version = pull_table.out.partners[i].min_version;
600 if (strcmp(TEST_OWNER_X_ADDRESS,pull_table.out.partners[i].address)==0) {
601 ctx->x.max_version = pull_table.out.partners[i].max_version;
602 ctx->x.min_version = pull_table.out.partners[i].min_version;
604 if (strcmp(address,pull_table.out.partners[i].address)==0) {
605 ctx->c.max_version = pull_table.out.partners[i].max_version;
606 ctx->c.min_version = pull_table.out.partners[i].min_version;
610 talloc_free(pull_table.out.partners);
612 ctx->nbtsock = nbt_name_socket_init(ctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx));
613 if (!ctx->nbtsock) return NULL;
615 load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
617 ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_best_ip(ifaces, address), 0);
618 if (!ctx->myaddr) return NULL;
620 for (i = 0; i < iface_count(ifaces); i++) {
621 if (strcmp(ctx->myaddr->addr, iface_n_ip(ifaces, i)) == 0) continue;
622 ctx->myaddr2 = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_n_ip(ifaces, i), 0);
623 if (!ctx->myaddr2) return NULL;
624 break;
627 status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0);
628 if (!NT_STATUS_IS_OK(status)) return NULL;
630 ctx->nbtsock_srv = nbt_name_socket_init(ctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx));
631 if (!ctx->nbtsock_srv) return NULL;
633 /* Make a port 137 version of ctx->myaddr */
634 nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lp_nbt_port(tctx->lp_ctx));
635 if (!nbt_srv_addr) return NULL;
637 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
638 status = socket_listen(ctx->nbtsock_srv->sock, nbt_srv_addr, 0, 0);
639 talloc_free(nbt_srv_addr);
640 if (!NT_STATUS_IS_OK(status)) {
641 /* this isn't fatal */
642 talloc_free(ctx->nbtsock_srv);
643 ctx->nbtsock_srv = NULL;
646 if (ctx->myaddr2 && ctx->nbtsock_srv) {
647 ctx->nbtsock2 = nbt_name_socket_init(ctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx));
648 if (!ctx->nbtsock2) return NULL;
650 status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0);
651 if (!NT_STATUS_IS_OK(status)) return NULL;
653 ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx, lp_iconv_convenience(tctx->lp_ctx));
654 if (!ctx->nbtsock_srv2) return NULL;
656 /* Make a port 137 version of ctx->myaddr2 */
657 nbt_srv_addr = socket_address_from_strings(tctx,
658 ctx->nbtsock_srv->sock->backend_name,
659 ctx->myaddr2->addr,
660 lp_nbt_port(tctx->lp_ctx));
661 if (!nbt_srv_addr) return NULL;
663 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
664 status = socket_listen(ctx->nbtsock_srv2->sock, ctx->myaddr2, 0, 0);
665 talloc_free(nbt_srv_addr);
666 if (!NT_STATUS_IS_OK(status)) {
667 /* this isn't fatal */
668 talloc_free(ctx->nbtsock_srv2);
669 ctx->nbtsock_srv2 = NULL;
673 ctx->addresses_best_num = 1;
674 ctx->addresses_best = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best_num);
675 if (!ctx->addresses_best) return NULL;
676 ctx->addresses_best[0].owner = ctx->b.address;
677 ctx->addresses_best[0].ip = ctx->myaddr->addr;
679 ctx->addresses_all_num = iface_count(ifaces);
680 ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num);
681 if (!ctx->addresses_all) return NULL;
682 for (i=0; i < ctx->addresses_all_num; i++) {
683 ctx->addresses_all[i].owner = ctx->b.address;
684 ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(ifaces, i));
685 if (!ctx->addresses_all[i].ip) return NULL;
688 if (ctx->nbtsock_srv2) {
689 ctx->addresses_best2_num = 1;
690 ctx->addresses_best2 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best2_num);
691 if (!ctx->addresses_best2) return NULL;
692 ctx->addresses_best2[0].owner = ctx->b.address;
693 ctx->addresses_best2[0].ip = ctx->myaddr2->addr;
695 ctx->addresses_mhomed_num = 2;
696 ctx->addresses_mhomed = talloc_array(ctx, struct wrepl_ip, ctx->addresses_mhomed_num);
697 if (!ctx->addresses_mhomed) return NULL;
698 ctx->addresses_mhomed[0].owner = ctx->b.address;
699 ctx->addresses_mhomed[0].ip = ctx->myaddr->addr;
700 ctx->addresses_mhomed[1].owner = ctx->b.address;
701 ctx->addresses_mhomed[1].ip = ctx->myaddr2->addr;
704 return ctx;
707 static bool test_wrepl_update_one(struct torture_context *tctx,
708 struct test_wrepl_conflict_conn *ctx,
709 const struct wrepl_wins_owner *owner,
710 const struct wrepl_wins_name *name)
712 struct wrepl_socket *wrepl_socket;
713 struct wrepl_associate associate;
714 struct wrepl_packet update_packet, repl_send;
715 struct wrepl_table *update;
716 struct wrepl_wins_owner wrepl_wins_owners[1];
717 struct wrepl_packet *repl_recv;
718 struct wrepl_wins_owner *send_request;
719 struct wrepl_send_reply *send_reply;
720 struct wrepl_wins_name wrepl_wins_names[1];
721 uint32_t assoc_ctx;
722 NTSTATUS status;
724 wrepl_socket = wrepl_socket_init(ctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx));
726 status = wrepl_connect(wrepl_socket, wrepl_best_ip(tctx->lp_ctx, ctx->address), ctx->address);
727 CHECK_STATUS(tctx, status, NT_STATUS_OK);
729 status = wrepl_associate(wrepl_socket, &associate);
730 CHECK_STATUS(tctx, status, NT_STATUS_OK);
731 assoc_ctx = associate.out.assoc_ctx;
733 /* now send a WREPL_REPL_UPDATE message */
734 ZERO_STRUCT(update_packet);
735 update_packet.opcode = WREPL_OPCODE_BITS;
736 update_packet.assoc_ctx = assoc_ctx;
737 update_packet.mess_type = WREPL_REPLICATION;
738 update_packet.message.replication.command = WREPL_REPL_UPDATE;
739 update = &update_packet.message.replication.info.table;
741 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
742 update->partners = wrepl_wins_owners;
743 update->initiator = "0.0.0.0";
745 wrepl_wins_owners[0] = *owner;
747 status = wrepl_request(wrepl_socket, wrepl_socket,
748 &update_packet, &repl_recv);
749 CHECK_STATUS(tctx, status, NT_STATUS_OK);
750 CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_REPLICATION);
751 CHECK_VALUE(tctx, repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
752 send_request = &repl_recv->message.replication.info.owner;
754 ZERO_STRUCT(repl_send);
755 repl_send.opcode = WREPL_OPCODE_BITS;
756 repl_send.assoc_ctx = assoc_ctx;
757 repl_send.mess_type = WREPL_REPLICATION;
758 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
759 send_reply = &repl_send.message.replication.info.reply;
761 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
762 send_reply->names = wrepl_wins_names;
764 wrepl_wins_names[0] = *name;
766 status = wrepl_request(wrepl_socket, wrepl_socket,
767 &repl_send, &repl_recv);
768 CHECK_STATUS(tctx, status, NT_STATUS_OK);
769 CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
770 CHECK_VALUE(tctx, repl_recv->message.stop.reason, 0);
772 talloc_free(wrepl_socket);
773 return true;
776 static bool test_wrepl_is_applied(struct torture_context *tctx,
777 struct test_wrepl_conflict_conn *ctx,
778 const struct wrepl_wins_owner *owner,
779 const struct wrepl_wins_name *name,
780 bool expected)
782 NTSTATUS status;
783 struct wrepl_pull_names pull_names;
784 struct wrepl_name *names;
786 pull_names.in.assoc_ctx = ctx->pull_assoc;
787 pull_names.in.partner = *owner;
788 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
790 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
791 CHECK_STATUS(tctx, status, NT_STATUS_OK);
792 torture_assert(tctx, pull_names.out.num_names == (expected?1:0),
793 talloc_asprintf(tctx, "Invalid number of records returned - expected %d got %d", expected, pull_names.out.num_names));
795 names = pull_names.out.names;
797 if (expected) {
798 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
799 names[0].state,
800 names[0].node,
801 names[0].is_static);
802 CHECK_VALUE(tctx, names[0].name.type, name->name->type);
803 CHECK_VALUE_STRING(tctx, names[0].name.name, name->name->name);
804 CHECK_VALUE_STRING(tctx, names[0].name.scope, name->name->scope);
805 CHECK_VALUE(tctx, flags, name->flags);
806 CHECK_VALUE_UINT64(tctx, names[0].version_id, name->id);
808 if (flags & 2) {
809 CHECK_VALUE(tctx, names[0].num_addresses,
810 name->addresses.addresses.num_ips);
811 } else {
812 CHECK_VALUE(tctx, names[0].num_addresses, 1);
813 CHECK_VALUE_STRING(tctx, names[0].addresses[0].address,
814 name->addresses.ip);
817 talloc_free(pull_names.out.names);
818 return true;
821 static bool test_wrepl_mhomed_merged(struct torture_context *tctx,
822 struct test_wrepl_conflict_conn *ctx,
823 const struct wrepl_wins_owner *owner1,
824 uint32_t num_ips1, const struct wrepl_ip *ips1,
825 const struct wrepl_wins_owner *owner2,
826 uint32_t num_ips2, const struct wrepl_ip *ips2,
827 const struct wrepl_wins_name *name2)
829 NTSTATUS status;
830 struct wrepl_pull_names pull_names;
831 struct wrepl_name *names;
832 uint32_t flags;
833 uint32_t i, j;
834 uint32_t num_ips = num_ips1 + num_ips2;
836 for (i = 0; i < num_ips2; i++) {
837 for (j = 0; j < num_ips1; j++) {
838 if (strcmp(ips2[i].ip,ips1[j].ip) == 0) {
839 num_ips--;
840 break;
845 pull_names.in.assoc_ctx = ctx->pull_assoc;
846 pull_names.in.partner = *owner2;
847 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
849 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
850 CHECK_STATUS(tctx, status, NT_STATUS_OK);
851 CHECK_VALUE(tctx, pull_names.out.num_names, 1);
853 names = pull_names.out.names;
855 flags = WREPL_NAME_FLAGS(names[0].type,
856 names[0].state,
857 names[0].node,
858 names[0].is_static);
859 CHECK_VALUE(tctx, names[0].name.type, name2->name->type);
860 CHECK_VALUE_STRING(tctx, names[0].name.name, name2->name->name);
861 CHECK_VALUE_STRING(tctx, names[0].name.scope, name2->name->scope);
862 CHECK_VALUE(tctx, flags, name2->flags | WREPL_TYPE_MHOMED);
863 CHECK_VALUE_UINT64(tctx, names[0].version_id, name2->id);
865 CHECK_VALUE(tctx, names[0].num_addresses, num_ips);
867 for (i = 0; i < names[0].num_addresses; i++) {
868 const char *addr = names[0].addresses[i].address;
869 const char *owner = names[0].addresses[i].owner;
870 bool found = false;
872 for (j = 0; j < num_ips2; j++) {
873 if (strcmp(addr, ips2[j].ip) == 0) {
874 found = true;
875 CHECK_VALUE_STRING(tctx, owner, owner2->address);
876 break;
880 if (found) continue;
882 for (j = 0; j < num_ips1; j++) {
883 if (strcmp(addr, ips1[j].ip) == 0) {
884 found = true;
885 CHECK_VALUE_STRING(tctx, owner, owner1->address);
886 break;
890 if (found) continue;
892 CHECK_VALUE_STRING(tctx, addr, "not found in address list");
894 talloc_free(pull_names.out.names);
895 return true;
898 static bool test_wrepl_sgroup_merged(struct torture_context *tctx,
899 struct test_wrepl_conflict_conn *ctx,
900 struct wrepl_wins_owner *merge_owner,
901 struct wrepl_wins_owner *owner1,
902 uint32_t num_ips1, const struct wrepl_ip *ips1,
903 struct wrepl_wins_owner *owner2,
904 uint32_t num_ips2, const struct wrepl_ip *ips2,
905 const struct wrepl_wins_name *name2)
907 NTSTATUS status;
908 struct wrepl_pull_names pull_names;
909 struct wrepl_name *names;
910 struct wrepl_name *name = NULL;
911 uint32_t flags;
912 uint32_t i, j;
913 uint32_t num_ips = num_ips1 + num_ips2;
915 if (!merge_owner) {
916 merge_owner = &ctx->c;
919 for (i = 0; i < num_ips1; i++) {
920 if (owner1 != &ctx->c && strcmp(ips1[i].owner,owner2->address) == 0) {
921 num_ips--;
922 continue;
924 for (j = 0; j < num_ips2; j++) {
925 if (strcmp(ips1[i].ip,ips2[j].ip) == 0) {
926 num_ips--;
927 break;
933 pull_names.in.assoc_ctx = ctx->pull_assoc;
934 pull_names.in.partner = *merge_owner;
935 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
936 pull_names.in.partner.max_version = 0;
938 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
939 CHECK_STATUS(tctx, status, NT_STATUS_OK);
941 names = pull_names.out.names;
943 for (i = 0; i < pull_names.out.num_names; i++) {
944 if (names[i].name.type != name2->name->type) continue;
945 if (!names[i].name.name) continue;
946 if (strcmp(names[i].name.name, name2->name->name) != 0) continue;
947 if (names[i].name.scope) continue;
949 name = &names[i];
952 if (pull_names.out.num_names > 0) {
953 merge_owner->max_version = names[pull_names.out.num_names-1].version_id;
956 if (!name) {
957 torture_comment(tctx, "%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name));
958 return false;
961 flags = WREPL_NAME_FLAGS(name->type,
962 name->state,
963 name->node,
964 name->is_static);
965 CHECK_VALUE(tctx, name->name.type, name2->name->type);
966 CHECK_VALUE_STRING(tctx, name->name.name, name2->name->name);
967 CHECK_VALUE_STRING(tctx, name->name.scope, name2->name->scope);
968 CHECK_VALUE(tctx, flags, name2->flags);
970 CHECK_VALUE(tctx, name->num_addresses, num_ips);
972 for (i = 0; i < name->num_addresses; i++) {
973 const char *addr = name->addresses[i].address;
974 const char *owner = name->addresses[i].owner;
975 bool found = false;
977 for (j = 0; j < num_ips2; j++) {
978 if (strcmp(addr, ips2[j].ip) == 0) {
979 found = true;
980 CHECK_VALUE_STRING(tctx, owner, ips2[j].owner);
981 break;
985 if (found) continue;
987 for (j = 0; j < num_ips1; j++) {
988 if (strcmp(addr, ips1[j].ip) == 0) {
989 found = true;
990 if (owner1 == &ctx->c) {
991 CHECK_VALUE_STRING(tctx, owner, owner1->address);
992 } else {
993 CHECK_VALUE_STRING(tctx, owner, ips1[j].owner);
995 break;
999 if (found) continue;
1001 CHECK_VALUE_STRING(tctx, addr, "not found in address list");
1003 talloc_free(pull_names.out.names);
1004 return true;
1007 static bool test_conflict_same_owner(struct torture_context *tctx,
1008 struct test_wrepl_conflict_conn *ctx)
1010 static bool ret = true;
1011 struct wrepl_wins_name wins_name1;
1012 struct wrepl_wins_name wins_name2;
1013 struct wrepl_wins_name *wins_name_tmp;
1014 struct wrepl_wins_name *wins_name_last;
1015 struct wrepl_wins_name *wins_name_cur;
1016 uint32_t i,j;
1017 struct nbt_name names[] = {
1018 _NBT_NAME("_SAME_OWNER_A", 0x00, NULL),
1019 _NBT_NAME("_SAME_OWNER_A", 0x1C, NULL),
1021 struct {
1022 enum wrepl_name_type type;
1023 enum wrepl_name_state state;
1024 enum wrepl_name_node node;
1025 bool is_static;
1026 uint32_t num_ips;
1027 const struct wrepl_ip *ips;
1028 } records[] = {
1030 .type = WREPL_TYPE_GROUP,
1031 .state = WREPL_STATE_ACTIVE,
1032 .node = WREPL_NODE_B,
1033 .is_static = false,
1034 .num_ips = ARRAY_SIZE(addresses_A_1),
1035 .ips = addresses_A_1,
1037 .type = WREPL_TYPE_UNIQUE,
1038 .state = WREPL_STATE_ACTIVE,
1039 .node = WREPL_NODE_B,
1040 .is_static = false,
1041 .num_ips = ARRAY_SIZE(addresses_A_1),
1042 .ips = addresses_A_1,
1044 .type = WREPL_TYPE_UNIQUE,
1045 .state = WREPL_STATE_ACTIVE,
1046 .node = WREPL_NODE_B,
1047 .is_static = false,
1048 .num_ips = ARRAY_SIZE(addresses_A_2),
1049 .ips = addresses_A_2,
1051 .type = WREPL_TYPE_UNIQUE,
1052 .state = WREPL_STATE_ACTIVE,
1053 .node = WREPL_NODE_B,
1054 .is_static = true,
1055 .num_ips = ARRAY_SIZE(addresses_A_1),
1056 .ips = addresses_A_1,
1058 .type = WREPL_TYPE_UNIQUE,
1059 .state = WREPL_STATE_ACTIVE,
1060 .node = WREPL_NODE_B,
1061 .is_static = false,
1062 .num_ips = ARRAY_SIZE(addresses_A_2),
1063 .ips = addresses_A_2,
1065 .type = WREPL_TYPE_SGROUP,
1066 .state = WREPL_STATE_TOMBSTONE,
1067 .node = WREPL_NODE_B,
1068 .is_static = false,
1069 .num_ips = ARRAY_SIZE(addresses_A_2),
1070 .ips = addresses_A_2,
1072 .type = WREPL_TYPE_MHOMED,
1073 .state = WREPL_STATE_TOMBSTONE,
1074 .node = WREPL_NODE_B,
1075 .is_static = false,
1076 .num_ips = ARRAY_SIZE(addresses_A_1),
1077 .ips = addresses_A_1,
1079 .type = WREPL_TYPE_MHOMED,
1080 .state = WREPL_STATE_RELEASED,
1081 .node = WREPL_NODE_B,
1082 .is_static = false,
1083 .num_ips = ARRAY_SIZE(addresses_A_2),
1084 .ips = addresses_A_2,
1086 .type = WREPL_TYPE_SGROUP,
1087 .state = WREPL_STATE_ACTIVE,
1088 .node = WREPL_NODE_B,
1089 .is_static = false,
1090 .num_ips = ARRAY_SIZE(addresses_A_1),
1091 .ips = addresses_A_1,
1093 .type = WREPL_TYPE_SGROUP,
1094 .state = WREPL_STATE_ACTIVE,
1095 .node = WREPL_NODE_B,
1096 .is_static = false,
1097 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1098 .ips = addresses_A_3_4,
1100 .type = WREPL_TYPE_SGROUP,
1101 .state = WREPL_STATE_TOMBSTONE,
1102 .node = WREPL_NODE_B,
1103 .is_static = false,
1104 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1105 .ips = addresses_B_3_4,
1107 /* the last one should always be a unique,tomstone record! */
1108 .type = WREPL_TYPE_UNIQUE,
1109 .state = WREPL_STATE_TOMBSTONE,
1110 .node = WREPL_NODE_B,
1111 .is_static = false,
1112 .num_ips = ARRAY_SIZE(addresses_A_1),
1113 .ips = addresses_A_1,
1117 wins_name_tmp = NULL;
1118 wins_name_last = &wins_name2;
1119 wins_name_cur = &wins_name1;
1121 for (j=0; ret && j < ARRAY_SIZE(names); j++) {
1122 torture_comment(tctx, "Test Replica Conflicts with same owner[%s] for %s\n",
1123 nbt_name_string(ctx, &names[j]), ctx->a.address);
1125 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
1126 wins_name_tmp = wins_name_last;
1127 wins_name_last = wins_name_cur;
1128 wins_name_cur = wins_name_tmp;
1130 if (i > 0) {
1131 torture_comment(tctx, "%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
1132 wrepl_name_type_string(records[i-1].type),
1133 wrepl_name_state_string(records[i-1].state),
1134 (records[i-1].is_static?",static":""),
1135 wrepl_name_type_string(records[i].type),
1136 wrepl_name_state_string(records[i].state),
1137 (records[i].is_static?",static":""),
1138 (records[i-1].ips==records[i].ips?"same":"different"),
1139 "REPLACE");
1142 wins_name_cur->name = &names[j];
1143 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
1144 records[i].state,
1145 records[i].node,
1146 records[i].is_static);
1147 wins_name_cur->id = ++ctx->a.max_version;
1148 if (wins_name_cur->flags & 2) {
1149 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
1150 wins_name_cur->addresses.addresses.ips = discard_const(records[i].ips);
1151 } else {
1152 wins_name_cur->addresses.ip = records[i].ips[0].ip;
1154 wins_name_cur->unknown = "255.255.255.255";
1156 ret &= test_wrepl_update_one(tctx, ctx, &ctx->a,wins_name_cur);
1157 if (records[i].state == WREPL_STATE_RELEASED) {
1158 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_last, false);
1159 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, false);
1160 } else {
1161 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, true);
1164 /* the first one is a cleanup run */
1165 if (!ret && i == 0) ret = true;
1167 if (!ret) {
1168 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, __location__);
1169 return ret;
1173 return ret;
1176 static bool test_conflict_different_owner(struct torture_context *tctx,
1177 struct test_wrepl_conflict_conn *ctx)
1179 bool ret = true;
1180 struct wrepl_wins_name wins_name1;
1181 struct wrepl_wins_name wins_name2;
1182 struct wrepl_wins_name *wins_name_r1;
1183 struct wrepl_wins_name *wins_name_r2;
1184 uint32_t i;
1185 struct {
1186 const char *line; /* just better debugging */
1187 struct nbt_name name;
1188 const char *comment;
1189 bool extra; /* not the worst case, this is an extra test */
1190 bool cleanup;
1191 struct {
1192 struct wrepl_wins_owner *owner;
1193 enum wrepl_name_type type;
1194 enum wrepl_name_state state;
1195 enum wrepl_name_node node;
1196 bool is_static;
1197 uint32_t num_ips;
1198 const struct wrepl_ip *ips;
1199 bool apply_expected;
1200 bool sgroup_merge;
1201 struct wrepl_wins_owner *merge_owner;
1202 bool sgroup_cleanup;
1203 } r1, r2;
1204 } records[] = {
1206 * NOTE: the first record and the last applied one
1207 * needs to be from the same owner,
1208 * to not conflict in the next smbtorture run!!!
1211 .line = __location__,
1212 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1213 .cleanup= true,
1214 .r1 = {
1215 .owner = &ctx->b,
1216 .type = WREPL_TYPE_UNIQUE,
1217 .state = WREPL_STATE_TOMBSTONE,
1218 .node = WREPL_NODE_B,
1219 .is_static = false,
1220 .num_ips = ARRAY_SIZE(addresses_B_1),
1221 .ips = addresses_B_1,
1222 .apply_expected = true /* ignored */
1224 .r2 = {
1225 .owner = &ctx->a,
1226 .type = WREPL_TYPE_UNIQUE,
1227 .state = WREPL_STATE_TOMBSTONE,
1228 .node = WREPL_NODE_B,
1229 .is_static = false,
1230 .num_ips = ARRAY_SIZE(addresses_A_1),
1231 .ips = addresses_A_1,
1232 .apply_expected = true /* ignored */
1237 * unique vs unique section
1240 * unique,active vs. unique,active
1241 * => should be replaced
1244 .line = __location__,
1245 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1246 .r1 = {
1247 .owner = &ctx->a,
1248 .type = WREPL_TYPE_UNIQUE,
1249 .state = WREPL_STATE_ACTIVE,
1250 .node = WREPL_NODE_B,
1251 .is_static = false,
1252 .num_ips = ARRAY_SIZE(addresses_A_1),
1253 .ips = addresses_A_1,
1254 .apply_expected = true
1256 .r2 = {
1257 .owner = &ctx->b,
1258 .type = WREPL_TYPE_UNIQUE,
1259 .state = WREPL_STATE_ACTIVE,
1260 .node = WREPL_NODE_B,
1261 .is_static = false,
1262 .num_ips = ARRAY_SIZE(addresses_B_1),
1263 .ips = addresses_B_1,
1264 .apply_expected = true
1269 * unique,active vs. unique,tombstone
1270 * => should NOT be replaced
1273 .line = __location__,
1274 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1275 .r1 = {
1276 .owner = &ctx->b,
1277 .type = WREPL_TYPE_UNIQUE,
1278 .state = WREPL_STATE_ACTIVE,
1279 .node = WREPL_NODE_B,
1280 .is_static = false,
1281 .num_ips = ARRAY_SIZE(addresses_B_1),
1282 .ips = addresses_B_1,
1283 .apply_expected = true
1285 .r2 = {
1286 .owner = &ctx->a,
1287 .type = WREPL_TYPE_UNIQUE,
1288 .state = WREPL_STATE_TOMBSTONE,
1289 .node = WREPL_NODE_B,
1290 .is_static = false,
1291 .num_ips = ARRAY_SIZE(addresses_B_1),
1292 .ips = addresses_B_1,
1293 .apply_expected = false
1298 * unique,released vs. unique,active
1299 * => should be replaced
1302 .line = __location__,
1303 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1304 .r1 = {
1305 .owner = &ctx->b,
1306 .type = WREPL_TYPE_UNIQUE,
1307 .state = WREPL_STATE_RELEASED,
1308 .node = WREPL_NODE_B,
1309 .is_static = false,
1310 .num_ips = ARRAY_SIZE(addresses_B_1),
1311 .ips = addresses_B_1,
1312 .apply_expected = false
1314 .r2 = {
1315 .owner = &ctx->a,
1316 .type = WREPL_TYPE_UNIQUE,
1317 .state = WREPL_STATE_ACTIVE,
1318 .node = WREPL_NODE_B,
1319 .is_static = false,
1320 .num_ips = ARRAY_SIZE(addresses_A_1),
1321 .ips = addresses_A_1,
1322 .apply_expected = true
1327 * unique,released vs. unique,tombstone
1328 * => should be replaced
1331 .line = __location__,
1332 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1333 .r1 = {
1334 .owner = &ctx->a,
1335 .type = WREPL_TYPE_UNIQUE,
1336 .state = WREPL_STATE_RELEASED,
1337 .node = WREPL_NODE_B,
1338 .is_static = false,
1339 .num_ips = ARRAY_SIZE(addresses_A_1),
1340 .ips = addresses_A_1,
1341 .apply_expected = false
1343 .r2 = {
1344 .owner = &ctx->b,
1345 .type = WREPL_TYPE_UNIQUE,
1346 .state = WREPL_STATE_TOMBSTONE,
1347 .node = WREPL_NODE_B,
1348 .is_static = false,
1349 .num_ips = ARRAY_SIZE(addresses_B_1),
1350 .ips = addresses_B_1,
1351 .apply_expected = true
1356 * unique,tombstone vs. unique,active
1357 * => should be replaced
1360 .line = __location__,
1361 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1362 .r1 = {
1363 .owner = &ctx->b,
1364 .type = WREPL_TYPE_UNIQUE,
1365 .state = WREPL_STATE_TOMBSTONE,
1366 .node = WREPL_NODE_B,
1367 .is_static = false,
1368 .num_ips = ARRAY_SIZE(addresses_B_1),
1369 .ips = addresses_B_1,
1370 .apply_expected = true
1372 .r2 = {
1373 .owner = &ctx->a,
1374 .type = WREPL_TYPE_UNIQUE,
1375 .state = WREPL_STATE_ACTIVE,
1376 .node = WREPL_NODE_B,
1377 .is_static = false,
1378 .num_ips = ARRAY_SIZE(addresses_A_1),
1379 .ips = addresses_A_1,
1380 .apply_expected = true
1385 * unique,tombstone vs. unique,tombstone
1386 * => should be replaced
1389 .line = __location__,
1390 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1391 .r1 = {
1392 .owner = &ctx->a,
1393 .type = WREPL_TYPE_UNIQUE,
1394 .state = WREPL_STATE_TOMBSTONE,
1395 .node = WREPL_NODE_B,
1396 .is_static = false,
1397 .num_ips = ARRAY_SIZE(addresses_A_1),
1398 .ips = addresses_A_1,
1399 .apply_expected = true
1401 .r2 = {
1402 .owner = &ctx->b,
1403 .type = WREPL_TYPE_UNIQUE,
1404 .state = WREPL_STATE_TOMBSTONE,
1405 .node = WREPL_NODE_B,
1406 .is_static = false,
1407 .num_ips = ARRAY_SIZE(addresses_B_1),
1408 .ips = addresses_B_1,
1409 .apply_expected = true
1415 * unique vs normal groups section,
1418 * unique,active vs. group,active
1419 * => should be replaced
1422 .line = __location__,
1423 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1424 .r1 = {
1425 .owner = &ctx->b,
1426 .type = WREPL_TYPE_UNIQUE,
1427 .state = WREPL_STATE_ACTIVE,
1428 .node = WREPL_NODE_B,
1429 .is_static = false,
1430 .num_ips = ARRAY_SIZE(addresses_B_1),
1431 .ips = addresses_B_1,
1432 .apply_expected = true
1434 .r2 = {
1435 .owner = &ctx->a,
1436 .type = WREPL_TYPE_GROUP,
1437 .state = WREPL_STATE_ACTIVE,
1438 .node = WREPL_NODE_B,
1439 .is_static = false,
1440 .num_ips = ARRAY_SIZE(addresses_A_1),
1441 .ips = addresses_A_1,
1442 .apply_expected = true
1447 * unique,active vs. group,tombstone
1448 * => should NOT be replaced
1451 .line = __location__,
1452 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1453 .r1 = {
1454 .owner = &ctx->a,
1455 .type = WREPL_TYPE_UNIQUE,
1456 .state = WREPL_STATE_ACTIVE,
1457 .node = WREPL_NODE_B,
1458 .is_static = false,
1459 .num_ips = ARRAY_SIZE(addresses_A_1),
1460 .ips = addresses_A_1,
1461 .apply_expected = true
1463 .r2 = {
1464 .owner = &ctx->b,
1465 .type = WREPL_TYPE_GROUP,
1466 .state = WREPL_STATE_TOMBSTONE,
1467 .node = WREPL_NODE_B,
1468 .is_static = false,
1469 .num_ips = ARRAY_SIZE(addresses_A_1),
1470 .ips = addresses_A_1,
1471 .apply_expected = false
1476 * unique,released vs. group,active
1477 * => should be replaced
1480 .line = __location__,
1481 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1482 .r1 = {
1483 .owner = &ctx->a,
1484 .type = WREPL_TYPE_UNIQUE,
1485 .state = WREPL_STATE_RELEASED,
1486 .node = WREPL_NODE_B,
1487 .is_static = false,
1488 .num_ips = ARRAY_SIZE(addresses_A_1),
1489 .ips = addresses_A_1,
1490 .apply_expected = false
1492 .r2 = {
1493 .owner = &ctx->b,
1494 .type = WREPL_TYPE_GROUP,
1495 .state = WREPL_STATE_ACTIVE,
1496 .node = WREPL_NODE_B,
1497 .is_static = false,
1498 .num_ips = ARRAY_SIZE(addresses_B_1),
1499 .ips = addresses_B_1,
1500 .apply_expected = true
1505 * unique,released vs. group,tombstone
1506 * => should be replaced
1509 .line = __location__,
1510 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1511 .r1 = {
1512 .owner = &ctx->b,
1513 .type = WREPL_TYPE_UNIQUE,
1514 .state = WREPL_STATE_RELEASED,
1515 .node = WREPL_NODE_B,
1516 .is_static = false,
1517 .num_ips = ARRAY_SIZE(addresses_B_1),
1518 .ips = addresses_B_1,
1519 .apply_expected = false
1521 .r2 = {
1522 .owner = &ctx->a,
1523 .type = WREPL_TYPE_GROUP,
1524 .state = WREPL_STATE_TOMBSTONE,
1525 .node = WREPL_NODE_B,
1526 .is_static = false,
1527 .num_ips = ARRAY_SIZE(addresses_A_1),
1528 .ips = addresses_A_1,
1529 .apply_expected = true
1534 * unique,tombstone vs. group,active
1535 * => should be replaced
1538 .line = __location__,
1539 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1540 .r1 = {
1541 .owner = &ctx->a,
1542 .type = WREPL_TYPE_UNIQUE,
1543 .state = WREPL_STATE_TOMBSTONE,
1544 .node = WREPL_NODE_B,
1545 .is_static = false,
1546 .num_ips = ARRAY_SIZE(addresses_A_1),
1547 .ips = addresses_A_1,
1548 .apply_expected = true
1550 .r2 = {
1551 .owner = &ctx->b,
1552 .type = WREPL_TYPE_GROUP,
1553 .state = WREPL_STATE_ACTIVE,
1554 .node = WREPL_NODE_B,
1555 .is_static = false,
1556 .num_ips = ARRAY_SIZE(addresses_B_1),
1557 .ips = addresses_B_1,
1558 .apply_expected = true
1563 * unique,tombstone vs. group,tombstone
1564 * => should be replaced
1567 .line = __location__,
1568 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1569 .r1 = {
1570 .owner = &ctx->b,
1571 .type = WREPL_TYPE_UNIQUE,
1572 .state = WREPL_STATE_TOMBSTONE,
1573 .node = WREPL_NODE_B,
1574 .is_static = false,
1575 .num_ips = ARRAY_SIZE(addresses_B_1),
1576 .ips = addresses_B_1,
1577 .apply_expected = true
1579 .r2 = {
1580 .owner = &ctx->a,
1581 .type = WREPL_TYPE_GROUP,
1582 .state = WREPL_STATE_TOMBSTONE,
1583 .node = WREPL_NODE_B,
1584 .is_static = false,
1585 .num_ips = ARRAY_SIZE(addresses_A_1),
1586 .ips = addresses_A_1,
1587 .apply_expected = true
1592 * unique vs special groups section,
1595 * unique,active vs. sgroup,active
1596 * => should NOT be replaced
1599 .line = __location__,
1600 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1601 .r1 = {
1602 .owner = &ctx->a,
1603 .type = WREPL_TYPE_UNIQUE,
1604 .state = WREPL_STATE_ACTIVE,
1605 .node = WREPL_NODE_B,
1606 .is_static = false,
1607 .num_ips = ARRAY_SIZE(addresses_A_1),
1608 .ips = addresses_A_1,
1609 .apply_expected = true
1611 .r2 = {
1612 .owner = &ctx->b,
1613 .type = WREPL_TYPE_SGROUP,
1614 .state = WREPL_STATE_ACTIVE,
1615 .node = WREPL_NODE_B,
1616 .is_static = false,
1617 .num_ips = ARRAY_SIZE(addresses_A_1),
1618 .ips = addresses_A_1,
1619 .apply_expected = false
1624 * unique,active vs. sgroup,tombstone
1625 * => should NOT be replaced
1628 .line = __location__,
1629 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1630 .r1 = {
1631 .owner = &ctx->a,
1632 .type = WREPL_TYPE_UNIQUE,
1633 .state = WREPL_STATE_ACTIVE,
1634 .node = WREPL_NODE_B,
1635 .is_static = false,
1636 .num_ips = ARRAY_SIZE(addresses_A_1),
1637 .ips = addresses_A_1,
1638 .apply_expected = true
1640 .r2 = {
1641 .owner = &ctx->b,
1642 .type = WREPL_TYPE_SGROUP,
1643 .state = WREPL_STATE_TOMBSTONE,
1644 .node = WREPL_NODE_B,
1645 .is_static = false,
1646 .num_ips = ARRAY_SIZE(addresses_A_1),
1647 .ips = addresses_A_1,
1648 .apply_expected = false
1653 * unique,released vs. sgroup,active
1654 * => should be replaced
1657 .line = __location__,
1658 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1659 .r1 = {
1660 .owner = &ctx->a,
1661 .type = WREPL_TYPE_UNIQUE,
1662 .state = WREPL_STATE_RELEASED,
1663 .node = WREPL_NODE_B,
1664 .is_static = false,
1665 .num_ips = ARRAY_SIZE(addresses_A_1),
1666 .ips = addresses_A_1,
1667 .apply_expected = false
1669 .r2 = {
1670 .owner = &ctx->b,
1671 .type = WREPL_TYPE_SGROUP,
1672 .state = WREPL_STATE_ACTIVE,
1673 .node = WREPL_NODE_B,
1674 .is_static = false,
1675 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1676 .ips = addresses_B_3_4,
1677 .apply_expected = true
1682 * unique,released vs. sgroup,tombstone
1683 * => should be replaced
1686 .line = __location__,
1687 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1688 .r1 = {
1689 .owner = &ctx->b,
1690 .type = WREPL_TYPE_UNIQUE,
1691 .state = WREPL_STATE_RELEASED,
1692 .node = WREPL_NODE_B,
1693 .is_static = false,
1694 .num_ips = ARRAY_SIZE(addresses_B_1),
1695 .ips = addresses_B_1,
1696 .apply_expected = false
1698 .r2 = {
1699 .owner = &ctx->a,
1700 .type = WREPL_TYPE_SGROUP,
1701 .state = WREPL_STATE_TOMBSTONE,
1702 .node = WREPL_NODE_B,
1703 .is_static = false,
1704 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1705 .ips = addresses_A_3_4,
1706 .apply_expected = true
1711 * unique,tombstone vs. sgroup,active
1712 * => should be replaced
1715 .line = __location__,
1716 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1717 .r1 = {
1718 .owner = &ctx->a,
1719 .type = WREPL_TYPE_UNIQUE,
1720 .state = WREPL_STATE_TOMBSTONE,
1721 .node = WREPL_NODE_B,
1722 .is_static = false,
1723 .num_ips = ARRAY_SIZE(addresses_A_1),
1724 .ips = addresses_A_1,
1725 .apply_expected = true
1727 .r2 = {
1728 .owner = &ctx->b,
1729 .type = WREPL_TYPE_SGROUP,
1730 .state = WREPL_STATE_ACTIVE,
1731 .node = WREPL_NODE_B,
1732 .is_static = false,
1733 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1734 .ips = addresses_B_3_4,
1735 .apply_expected = true
1740 * unique,tombstone vs. sgroup,tombstone
1741 * => should be replaced
1744 .line = __location__,
1745 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1746 .r1 = {
1747 .owner = &ctx->b,
1748 .type = WREPL_TYPE_UNIQUE,
1749 .state = WREPL_STATE_TOMBSTONE,
1750 .node = WREPL_NODE_B,
1751 .is_static = false,
1752 .num_ips = ARRAY_SIZE(addresses_B_1),
1753 .ips = addresses_B_1,
1754 .apply_expected = true
1756 .r2 = {
1757 .owner = &ctx->a,
1758 .type = WREPL_TYPE_SGROUP,
1759 .state = WREPL_STATE_TOMBSTONE,
1760 .node = WREPL_NODE_B,
1761 .is_static = false,
1762 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1763 .ips = addresses_A_3_4,
1764 .apply_expected = true
1769 * unique vs multi homed section,
1772 * unique,active vs. mhomed,active
1773 * => should be replaced
1776 .line = __location__,
1777 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1778 .r1 = {
1779 .owner = &ctx->a,
1780 .type = WREPL_TYPE_UNIQUE,
1781 .state = WREPL_STATE_ACTIVE,
1782 .node = WREPL_NODE_B,
1783 .is_static = false,
1784 .num_ips = ARRAY_SIZE(addresses_A_1),
1785 .ips = addresses_A_1,
1786 .apply_expected = true
1788 .r2 = {
1789 .owner = &ctx->b,
1790 .type = WREPL_TYPE_MHOMED,
1791 .state = WREPL_STATE_ACTIVE,
1792 .node = WREPL_NODE_B,
1793 .is_static = false,
1794 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1795 .ips = addresses_B_3_4,
1796 .apply_expected = true
1801 * unique,active vs. mhomed,tombstone
1802 * => should NOT be replaced
1805 .line = __location__,
1806 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1807 .r1 = {
1808 .owner = &ctx->b,
1809 .type = WREPL_TYPE_UNIQUE,
1810 .state = WREPL_STATE_ACTIVE,
1811 .node = WREPL_NODE_B,
1812 .is_static = false,
1813 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1814 .ips = addresses_B_3_4,
1815 .apply_expected = true
1817 .r2 = {
1818 .owner = &ctx->a,
1819 .type = WREPL_TYPE_MHOMED,
1820 .state = WREPL_STATE_TOMBSTONE,
1821 .node = WREPL_NODE_B,
1822 .is_static = false,
1823 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1824 .ips = addresses_B_3_4,
1825 .apply_expected = false
1830 * unique,released vs. mhomed,active
1831 * => should be replaced
1834 .line = __location__,
1835 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1836 .r1 = {
1837 .owner = &ctx->b,
1838 .type = WREPL_TYPE_UNIQUE,
1839 .state = WREPL_STATE_RELEASED,
1840 .node = WREPL_NODE_B,
1841 .is_static = false,
1842 .num_ips = ARRAY_SIZE(addresses_B_1),
1843 .ips = addresses_B_1,
1844 .apply_expected = false
1846 .r2 = {
1847 .owner = &ctx->a,
1848 .type = WREPL_TYPE_MHOMED,
1849 .state = WREPL_STATE_ACTIVE,
1850 .node = WREPL_NODE_B,
1851 .is_static = false,
1852 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1853 .ips = addresses_A_3_4,
1854 .apply_expected = true
1859 * unique,released vs. mhomed,tombstone
1860 * => should be replaced
1863 .line = __location__,
1864 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1865 .r1 = {
1866 .owner = &ctx->a,
1867 .type = WREPL_TYPE_UNIQUE,
1868 .state = WREPL_STATE_RELEASED,
1869 .node = WREPL_NODE_B,
1870 .is_static = false,
1871 .num_ips = ARRAY_SIZE(addresses_A_1),
1872 .ips = addresses_A_1,
1873 .apply_expected = false
1875 .r2 = {
1876 .owner = &ctx->b,
1877 .type = WREPL_TYPE_MHOMED,
1878 .state = WREPL_STATE_TOMBSTONE,
1879 .node = WREPL_NODE_B,
1880 .is_static = false,
1881 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1882 .ips = addresses_B_3_4,
1883 .apply_expected = true
1888 * unique,tombstone vs. mhomed,active
1889 * => should be replaced
1892 .line = __location__,
1893 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1894 .r1 = {
1895 .owner = &ctx->b,
1896 .type = WREPL_TYPE_UNIQUE,
1897 .state = WREPL_STATE_TOMBSTONE,
1898 .node = WREPL_NODE_B,
1899 .is_static = false,
1900 .num_ips = ARRAY_SIZE(addresses_B_1),
1901 .ips = addresses_B_1,
1902 .apply_expected = true
1904 .r2 = {
1905 .owner = &ctx->a,
1906 .type = WREPL_TYPE_MHOMED,
1907 .state = WREPL_STATE_ACTIVE,
1908 .node = WREPL_NODE_B,
1909 .is_static = false,
1910 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1911 .ips = addresses_A_3_4,
1912 .apply_expected = true
1917 * unique,tombstone vs. mhomed,tombstone
1918 * => should be replaced
1921 .line = __location__,
1922 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1923 .r1 = {
1924 .owner = &ctx->a,
1925 .type = WREPL_TYPE_UNIQUE,
1926 .state = WREPL_STATE_TOMBSTONE,
1927 .node = WREPL_NODE_B,
1928 .is_static = false,
1929 .num_ips = ARRAY_SIZE(addresses_A_1),
1930 .ips = addresses_A_1,
1931 .apply_expected = true
1933 .r2 = {
1934 .owner = &ctx->b,
1935 .type = WREPL_TYPE_MHOMED,
1936 .state = WREPL_STATE_TOMBSTONE,
1937 .node = WREPL_NODE_B,
1938 .is_static = false,
1939 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1940 .ips = addresses_B_3_4,
1941 .apply_expected = true
1946 * normal groups vs unique section,
1949 * group,active vs. unique,active
1950 * => should NOT be replaced
1953 .line = __location__,
1954 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1955 .r1 = {
1956 .owner = &ctx->a,
1957 .type = WREPL_TYPE_GROUP,
1958 .state = WREPL_STATE_ACTIVE,
1959 .node = WREPL_NODE_B,
1960 .is_static = false,
1961 .num_ips = ARRAY_SIZE(addresses_A_1),
1962 .ips = addresses_A_1,
1963 .apply_expected = true
1965 .r2 = {
1966 .owner = &ctx->b,
1967 .type = WREPL_TYPE_UNIQUE,
1968 .state = WREPL_STATE_ACTIVE,
1969 .node = WREPL_NODE_B,
1970 .is_static = false,
1971 .num_ips = ARRAY_SIZE(addresses_A_1),
1972 .ips = addresses_A_1,
1973 .apply_expected = false
1978 * group,active vs. unique,tombstone
1979 * => should NOT be replaced
1982 .line = __location__,
1983 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1984 .r1 = {
1985 .owner = &ctx->a,
1986 .type = WREPL_TYPE_GROUP,
1987 .state = WREPL_STATE_ACTIVE,
1988 .node = WREPL_NODE_B,
1989 .is_static = false,
1990 .num_ips = ARRAY_SIZE(addresses_A_1),
1991 .ips = addresses_A_1,
1992 .apply_expected = true
1994 .r2 = {
1995 .owner = &ctx->b,
1996 .type = WREPL_TYPE_UNIQUE,
1997 .state = WREPL_STATE_TOMBSTONE,
1998 .node = WREPL_NODE_B,
1999 .is_static = false,
2000 .num_ips = ARRAY_SIZE(addresses_A_1),
2001 .ips = addresses_A_1,
2002 .apply_expected = false
2007 * group,released vs. unique,active
2008 * => should NOT be replaced
2011 .line = __location__,
2012 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2013 .r1 = {
2014 .owner = &ctx->a,
2015 .type = WREPL_TYPE_GROUP,
2016 .state = WREPL_STATE_RELEASED,
2017 .node = WREPL_NODE_B,
2018 .is_static = false,
2019 .num_ips = ARRAY_SIZE(addresses_A_1),
2020 .ips = addresses_A_1,
2021 .apply_expected = false
2023 .r2 = {
2024 .owner = &ctx->b,
2025 .type = WREPL_TYPE_UNIQUE,
2026 .state = WREPL_STATE_ACTIVE,
2027 .node = WREPL_NODE_B,
2028 .is_static = false,
2029 .num_ips = ARRAY_SIZE(addresses_A_1),
2030 .ips = addresses_A_1,
2031 .apply_expected = false
2036 * group,released vs. unique,tombstone
2037 * => should NOT be replaced
2040 .line = __location__,
2041 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2042 .r1 = {
2043 .owner = &ctx->a,
2044 .type = WREPL_TYPE_GROUP,
2045 .state = WREPL_STATE_RELEASED,
2046 .node = WREPL_NODE_B,
2047 .is_static = false,
2048 .num_ips = ARRAY_SIZE(addresses_A_1),
2049 .ips = addresses_A_1,
2050 .apply_expected = false
2052 .r2 = {
2053 .owner = &ctx->b,
2054 .type = WREPL_TYPE_UNIQUE,
2055 .state = WREPL_STATE_TOMBSTONE,
2056 .node = WREPL_NODE_B,
2057 .is_static = false,
2058 .num_ips = ARRAY_SIZE(addresses_A_1),
2059 .ips = addresses_A_1,
2060 .apply_expected = false
2065 * group,tombstone vs. unique,active
2066 * => should NOT be replaced
2069 .line = __location__,
2070 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2071 .r1 = {
2072 .owner = &ctx->a,
2073 .type = WREPL_TYPE_GROUP,
2074 .state = WREPL_STATE_TOMBSTONE,
2075 .node = WREPL_NODE_B,
2076 .is_static = false,
2077 .num_ips = ARRAY_SIZE(addresses_A_1),
2078 .ips = addresses_A_1,
2079 .apply_expected = true
2081 .r2 = {
2082 .owner = &ctx->b,
2083 .type = WREPL_TYPE_UNIQUE,
2084 .state = WREPL_STATE_ACTIVE,
2085 .node = WREPL_NODE_B,
2086 .is_static = false,
2087 .num_ips = ARRAY_SIZE(addresses_A_1),
2088 .ips = addresses_A_1,
2089 .apply_expected = false
2094 * group,tombstone vs. unique,tombstone
2095 * => should NOT be replaced
2098 .line = __location__,
2099 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2100 .r1 = {
2101 .owner = &ctx->a,
2102 .type = WREPL_TYPE_GROUP,
2103 .state = WREPL_STATE_TOMBSTONE,
2104 .node = WREPL_NODE_B,
2105 .is_static = false,
2106 .num_ips = ARRAY_SIZE(addresses_A_1),
2107 .ips = addresses_A_1,
2108 .apply_expected = true
2110 .r2 = {
2111 .owner = &ctx->b,
2112 .type = WREPL_TYPE_UNIQUE,
2113 .state = WREPL_STATE_TOMBSTONE,
2114 .node = WREPL_NODE_B,
2115 .is_static = false,
2116 .num_ips = ARRAY_SIZE(addresses_A_1),
2117 .ips = addresses_A_1,
2118 .apply_expected = false
2123 * normal groups vs normal groups section,
2126 * group,active vs. group,active
2127 * => should NOT be replaced
2130 .line = __location__,
2131 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2132 .r1 = {
2133 .owner = &ctx->a,
2134 .type = WREPL_TYPE_GROUP,
2135 .state = WREPL_STATE_ACTIVE,
2136 .node = WREPL_NODE_B,
2137 .is_static = false,
2138 .num_ips = ARRAY_SIZE(addresses_A_1),
2139 .ips = addresses_A_1,
2140 .apply_expected = true
2142 .r2 = {
2143 .owner = &ctx->b,
2144 .type = WREPL_TYPE_GROUP,
2145 .state = WREPL_STATE_ACTIVE,
2146 .node = WREPL_NODE_B,
2147 .is_static = false,
2148 .num_ips = ARRAY_SIZE(addresses_A_1),
2149 .ips = addresses_A_1,
2150 .apply_expected = false
2155 * group,active vs. group,tombstone
2156 * => should NOT be replaced
2159 .line = __location__,
2160 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2161 .r1 = {
2162 .owner = &ctx->a,
2163 .type = WREPL_TYPE_GROUP,
2164 .state = WREPL_STATE_ACTIVE,
2165 .node = WREPL_NODE_B,
2166 .is_static = false,
2167 .num_ips = ARRAY_SIZE(addresses_A_1),
2168 .ips = addresses_A_1,
2169 .apply_expected = true
2171 .r2 = {
2172 .owner = &ctx->b,
2173 .type = WREPL_TYPE_GROUP,
2174 .state = WREPL_STATE_TOMBSTONE,
2175 .node = WREPL_NODE_B,
2176 .is_static = false,
2177 .num_ips = ARRAY_SIZE(addresses_A_1),
2178 .ips = addresses_A_1,
2179 .apply_expected = false
2184 * group,released vs. group,active
2185 * => should be replaced
2188 .line = __location__,
2189 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2190 .r1 = {
2191 .owner = &ctx->a,
2192 .type = WREPL_TYPE_GROUP,
2193 .state = WREPL_STATE_RELEASED,
2194 .node = WREPL_NODE_B,
2195 .is_static = false,
2196 .num_ips = ARRAY_SIZE(addresses_A_1),
2197 .ips = addresses_A_1,
2198 .apply_expected = false
2200 .r2 = {
2201 .owner = &ctx->b,
2202 .type = WREPL_TYPE_GROUP,
2203 .state = WREPL_STATE_ACTIVE,
2204 .node = WREPL_NODE_B,
2205 .is_static = false,
2206 .num_ips = ARRAY_SIZE(addresses_B_1),
2207 .ips = addresses_B_1,
2208 .apply_expected = true
2213 * group,released vs. group,tombstone
2214 * => should be replaced
2217 .line = __location__,
2218 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2219 .r1 = {
2220 .owner = &ctx->a,
2221 .type = WREPL_TYPE_GROUP,
2222 .state = WREPL_STATE_RELEASED,
2223 .node = WREPL_NODE_B,
2224 .is_static = false,
2225 .num_ips = ARRAY_SIZE(addresses_A_1),
2226 .ips = addresses_A_1,
2227 .apply_expected = false
2229 .r2 = {
2230 .owner = &ctx->b,
2231 .type = WREPL_TYPE_GROUP,
2232 .state = WREPL_STATE_TOMBSTONE,
2233 .node = WREPL_NODE_B,
2234 .is_static = false,
2235 .num_ips = ARRAY_SIZE(addresses_B_1),
2236 .ips = addresses_B_1,
2237 .apply_expected = true
2242 * group,tombstone vs. group,active
2243 * => should be replaced
2246 .line = __location__,
2247 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2248 .r1 = {
2249 .owner = &ctx->b,
2250 .type = WREPL_TYPE_GROUP,
2251 .state = WREPL_STATE_TOMBSTONE,
2252 .node = WREPL_NODE_B,
2253 .is_static = false,
2254 .num_ips = ARRAY_SIZE(addresses_B_1),
2255 .ips = addresses_B_1,
2256 .apply_expected = true
2258 .r2 = {
2259 .owner = &ctx->a,
2260 .type = WREPL_TYPE_GROUP,
2261 .state = WREPL_STATE_ACTIVE,
2262 .node = WREPL_NODE_B,
2263 .is_static = false,
2264 .num_ips = ARRAY_SIZE(addresses_A_1),
2265 .ips = addresses_A_1,
2266 .apply_expected = true
2271 * group,tombstone vs. group,tombstone
2272 * => should be replaced
2275 .line = __location__,
2276 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2277 .r1 = {
2278 .owner = &ctx->a,
2279 .type = WREPL_TYPE_GROUP,
2280 .state = WREPL_STATE_TOMBSTONE,
2281 .node = WREPL_NODE_B,
2282 .is_static = false,
2283 .num_ips = ARRAY_SIZE(addresses_A_1),
2284 .ips = addresses_A_1,
2285 .apply_expected = true
2287 .r2 = {
2288 .owner = &ctx->b,
2289 .type = WREPL_TYPE_GROUP,
2290 .state = WREPL_STATE_TOMBSTONE,
2291 .node = WREPL_NODE_B,
2292 .is_static = false,
2293 .num_ips = ARRAY_SIZE(addresses_B_1),
2294 .ips = addresses_B_1,
2295 .apply_expected = true
2300 * normal groups vs special groups section,
2303 * group,active vs. sgroup,active
2304 * => should NOT be replaced
2307 .line = __location__,
2308 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2309 .r1 = {
2310 .owner = &ctx->b,
2311 .type = WREPL_TYPE_GROUP,
2312 .state = WREPL_STATE_ACTIVE,
2313 .node = WREPL_NODE_B,
2314 .is_static = false,
2315 .num_ips = ARRAY_SIZE(addresses_B_1),
2316 .ips = addresses_B_1,
2317 .apply_expected = true
2319 .r2 = {
2320 .owner = &ctx->a,
2321 .type = WREPL_TYPE_SGROUP,
2322 .state = WREPL_STATE_ACTIVE,
2323 .node = WREPL_NODE_B,
2324 .is_static = false,
2325 .num_ips = ARRAY_SIZE(addresses_B_1),
2326 .ips = addresses_B_1,
2327 .apply_expected = false
2332 * group,active vs. sgroup,tombstone
2333 * => should NOT be replaced
2336 .line = __location__,
2337 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2338 .r1 = {
2339 .owner = &ctx->b,
2340 .type = WREPL_TYPE_GROUP,
2341 .state = WREPL_STATE_ACTIVE,
2342 .node = WREPL_NODE_B,
2343 .is_static = false,
2344 .num_ips = ARRAY_SIZE(addresses_B_1),
2345 .ips = addresses_B_1,
2346 .apply_expected = true
2348 .r2 = {
2349 .owner = &ctx->a,
2350 .type = WREPL_TYPE_SGROUP,
2351 .state = WREPL_STATE_TOMBSTONE,
2352 .node = WREPL_NODE_B,
2353 .is_static = false,
2354 .num_ips = ARRAY_SIZE(addresses_B_1),
2355 .ips = addresses_B_1,
2356 .apply_expected = false
2361 * group,released vs. sgroup,active
2362 * => should be replaced
2365 .line = __location__,
2366 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2367 .r1 = {
2368 .owner = &ctx->a,
2369 .type = WREPL_TYPE_GROUP,
2370 .state = WREPL_STATE_RELEASED,
2371 .node = WREPL_NODE_B,
2372 .is_static = false,
2373 .num_ips = ARRAY_SIZE(addresses_A_1),
2374 .ips = addresses_A_1,
2375 .apply_expected = false
2377 .r2 = {
2378 .owner = &ctx->b,
2379 .type = WREPL_TYPE_SGROUP,
2380 .state = WREPL_STATE_ACTIVE,
2381 .node = WREPL_NODE_B,
2382 .is_static = false,
2383 .num_ips = ARRAY_SIZE(addresses_B_1),
2384 .ips = addresses_B_1,
2385 .apply_expected = true
2390 * group,released vs. sgroup,tombstone
2391 * => should NOT be replaced
2394 .line = __location__,
2395 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2396 .r1 = {
2397 .owner = &ctx->b,
2398 .type = WREPL_TYPE_GROUP,
2399 .state = WREPL_STATE_RELEASED,
2400 .node = WREPL_NODE_B,
2401 .is_static = false,
2402 .num_ips = ARRAY_SIZE(addresses_B_1),
2403 .ips = addresses_B_1,
2404 .apply_expected = false
2406 .r2 = {
2407 .owner = &ctx->a,
2408 .type = WREPL_TYPE_SGROUP,
2409 .state = WREPL_STATE_TOMBSTONE,
2410 .node = WREPL_NODE_B,
2411 .is_static = false,
2412 .num_ips = ARRAY_SIZE(addresses_B_1),
2413 .ips = addresses_B_1,
2414 .apply_expected = false
2419 * group,tombstone vs. sgroup,active
2420 * => should be replaced
2423 .line = __location__,
2424 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2425 .r1 = {
2426 .owner = &ctx->b,
2427 .type = WREPL_TYPE_GROUP,
2428 .state = WREPL_STATE_TOMBSTONE,
2429 .node = WREPL_NODE_B,
2430 .is_static = false,
2431 .num_ips = ARRAY_SIZE(addresses_B_1),
2432 .ips = addresses_B_1,
2433 .apply_expected = true
2435 .r2 = {
2436 .owner = &ctx->a,
2437 .type = WREPL_TYPE_SGROUP,
2438 .state = WREPL_STATE_ACTIVE,
2439 .node = WREPL_NODE_B,
2440 .is_static = false,
2441 .num_ips = ARRAY_SIZE(addresses_A_1),
2442 .ips = addresses_A_1,
2443 .apply_expected = true
2448 * group,tombstone vs. sgroup,tombstone
2449 * => should be replaced
2452 .line = __location__,
2453 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2454 .r1 = {
2455 .owner = &ctx->a,
2456 .type = WREPL_TYPE_GROUP,
2457 .state = WREPL_STATE_TOMBSTONE,
2458 .node = WREPL_NODE_B,
2459 .is_static = false,
2460 .num_ips = ARRAY_SIZE(addresses_A_1),
2461 .ips = addresses_A_1,
2462 .apply_expected = true
2464 .r2 = {
2465 .owner = &ctx->b,
2466 .type = WREPL_TYPE_SGROUP,
2467 .state = WREPL_STATE_TOMBSTONE,
2468 .node = WREPL_NODE_B,
2469 .is_static = false,
2470 .num_ips = ARRAY_SIZE(addresses_B_1),
2471 .ips = addresses_B_1,
2472 .apply_expected = true
2477 * normal groups vs multi homed section,
2480 * group,active vs. mhomed,active
2481 * => should NOT be replaced
2484 .line = __location__,
2485 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2486 .r1 = {
2487 .owner = &ctx->b,
2488 .type = WREPL_TYPE_GROUP,
2489 .state = WREPL_STATE_ACTIVE,
2490 .node = WREPL_NODE_B,
2491 .is_static = false,
2492 .num_ips = ARRAY_SIZE(addresses_B_1),
2493 .ips = addresses_B_1,
2494 .apply_expected = true
2496 .r2 = {
2497 .owner = &ctx->a,
2498 .type = WREPL_TYPE_MHOMED,
2499 .state = WREPL_STATE_ACTIVE,
2500 .node = WREPL_NODE_B,
2501 .is_static = false,
2502 .num_ips = ARRAY_SIZE(addresses_B_1),
2503 .ips = addresses_B_1,
2504 .apply_expected = false
2509 * group,active vs. mhomed,tombstone
2510 * => should NOT be replaced
2513 .line = __location__,
2514 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2515 .r1 = {
2516 .owner = &ctx->b,
2517 .type = WREPL_TYPE_GROUP,
2518 .state = WREPL_STATE_ACTIVE,
2519 .node = WREPL_NODE_B,
2520 .is_static = false,
2521 .num_ips = ARRAY_SIZE(addresses_B_1),
2522 .ips = addresses_B_1,
2523 .apply_expected = true
2525 .r2 = {
2526 .owner = &ctx->a,
2527 .type = WREPL_TYPE_MHOMED,
2528 .state = WREPL_STATE_TOMBSTONE,
2529 .node = WREPL_NODE_B,
2530 .is_static = false,
2531 .num_ips = ARRAY_SIZE(addresses_B_1),
2532 .ips = addresses_B_1,
2533 .apply_expected = false
2538 * group,released vs. mhomed,active
2539 * => should NOT be replaced
2542 .line = __location__,
2543 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2544 .r1 = {
2545 .owner = &ctx->b,
2546 .type = WREPL_TYPE_GROUP,
2547 .state = WREPL_STATE_RELEASED,
2548 .node = WREPL_NODE_B,
2549 .is_static = false,
2550 .num_ips = ARRAY_SIZE(addresses_B_1),
2551 .ips = addresses_B_1,
2552 .apply_expected = false
2554 .r2 = {
2555 .owner = &ctx->a,
2556 .type = WREPL_TYPE_MHOMED,
2557 .state = WREPL_STATE_ACTIVE,
2558 .node = WREPL_NODE_B,
2559 .is_static = false,
2560 .num_ips = ARRAY_SIZE(addresses_B_1),
2561 .ips = addresses_B_1,
2562 .apply_expected = false
2567 * group,released vs. mhomed,tombstone
2568 * => should NOT be replaced
2571 .line = __location__,
2572 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2573 .r1 = {
2574 .owner = &ctx->b,
2575 .type = WREPL_TYPE_GROUP,
2576 .state = WREPL_STATE_RELEASED,
2577 .node = WREPL_NODE_B,
2578 .is_static = false,
2579 .num_ips = ARRAY_SIZE(addresses_B_1),
2580 .ips = addresses_B_1,
2581 .apply_expected = false
2583 .r2 = {
2584 .owner = &ctx->a,
2585 .type = WREPL_TYPE_MHOMED,
2586 .state = WREPL_STATE_TOMBSTONE,
2587 .node = WREPL_NODE_B,
2588 .is_static = false,
2589 .num_ips = ARRAY_SIZE(addresses_B_1),
2590 .ips = addresses_B_1,
2591 .apply_expected = false
2596 * group,tombstone vs. mhomed,active
2597 * => should be replaced
2600 .line = __location__,
2601 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2602 .r1 = {
2603 .owner = &ctx->b,
2604 .type = WREPL_TYPE_GROUP,
2605 .state = WREPL_STATE_TOMBSTONE,
2606 .node = WREPL_NODE_B,
2607 .is_static = false,
2608 .num_ips = ARRAY_SIZE(addresses_B_1),
2609 .ips = addresses_B_1,
2610 .apply_expected = true
2612 .r2 = {
2613 .owner = &ctx->a,
2614 .type = WREPL_TYPE_MHOMED,
2615 .state = WREPL_STATE_ACTIVE,
2616 .node = WREPL_NODE_B,
2617 .is_static = false,
2618 .num_ips = ARRAY_SIZE(addresses_A_1),
2619 .ips = addresses_A_1,
2620 .apply_expected = true
2625 * group,tombstone vs. mhomed,tombstone
2626 * => should be replaced
2629 .line = __location__,
2630 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2631 .r1 = {
2632 .owner = &ctx->a,
2633 .type = WREPL_TYPE_GROUP,
2634 .state = WREPL_STATE_TOMBSTONE,
2635 .node = WREPL_NODE_B,
2636 .is_static = false,
2637 .num_ips = ARRAY_SIZE(addresses_A_1),
2638 .ips = addresses_A_1,
2639 .apply_expected = true
2641 .r2 = {
2642 .owner = &ctx->b,
2643 .type = WREPL_TYPE_MHOMED,
2644 .state = WREPL_STATE_TOMBSTONE,
2645 .node = WREPL_NODE_B,
2646 .is_static = false,
2647 .num_ips = ARRAY_SIZE(addresses_B_1),
2648 .ips = addresses_B_1,
2649 .apply_expected = true
2654 * special groups vs unique section,
2657 * sgroup,active vs. unique,active
2658 * => should NOT be replaced
2661 .line = __location__,
2662 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2663 .r1 = {
2664 .owner = &ctx->b,
2665 .type = WREPL_TYPE_SGROUP,
2666 .state = WREPL_STATE_ACTIVE,
2667 .node = WREPL_NODE_B,
2668 .is_static = false,
2669 .num_ips = ARRAY_SIZE(addresses_B_1),
2670 .ips = addresses_B_1,
2671 .apply_expected = true
2673 .r2 = {
2674 .owner = &ctx->a,
2675 .type = WREPL_TYPE_UNIQUE,
2676 .state = WREPL_STATE_ACTIVE,
2677 .node = WREPL_NODE_B,
2678 .is_static = false,
2679 .num_ips = ARRAY_SIZE(addresses_B_1),
2680 .ips = addresses_B_1,
2681 .apply_expected = false
2686 * sgroup,active vs. unique,tombstone
2687 * => should NOT be replaced
2690 .line = __location__,
2691 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2692 .r1 = {
2693 .owner = &ctx->b,
2694 .type = WREPL_TYPE_SGROUP,
2695 .state = WREPL_STATE_ACTIVE,
2696 .node = WREPL_NODE_B,
2697 .is_static = false,
2698 .num_ips = ARRAY_SIZE(addresses_B_1),
2699 .ips = addresses_B_1,
2700 .apply_expected = true
2702 .r2 = {
2703 .owner = &ctx->a,
2704 .type = WREPL_TYPE_UNIQUE,
2705 .state = WREPL_STATE_TOMBSTONE,
2706 .node = WREPL_NODE_B,
2707 .is_static = false,
2708 .num_ips = ARRAY_SIZE(addresses_B_1),
2709 .ips = addresses_B_1,
2710 .apply_expected = false
2715 * sgroup,released vs. unique,active
2716 * => should be replaced
2719 .line = __location__,
2720 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2721 .r1 = {
2722 .owner = &ctx->b,
2723 .type = WREPL_TYPE_SGROUP,
2724 .state = WREPL_STATE_RELEASED,
2725 .node = WREPL_NODE_B,
2726 .is_static = false,
2727 .num_ips = ARRAY_SIZE(addresses_B_1),
2728 .ips = addresses_B_1,
2729 .apply_expected = false
2731 .r2 = {
2732 .owner = &ctx->a,
2733 .type = WREPL_TYPE_UNIQUE,
2734 .state = WREPL_STATE_ACTIVE,
2735 .node = WREPL_NODE_B,
2736 .is_static = false,
2737 .num_ips = ARRAY_SIZE(addresses_A_1),
2738 .ips = addresses_A_1,
2739 .apply_expected = true
2744 * sgroup,released vs. unique,tombstone
2745 * => should be replaced
2748 .line = __location__,
2749 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2750 .r1 = {
2751 .owner = &ctx->a,
2752 .type = WREPL_TYPE_SGROUP,
2753 .state = WREPL_STATE_RELEASED,
2754 .node = WREPL_NODE_B,
2755 .is_static = false,
2756 .num_ips = ARRAY_SIZE(addresses_A_1),
2757 .ips = addresses_A_1,
2758 .apply_expected = false
2760 .r2 = {
2761 .owner = &ctx->b,
2762 .type = WREPL_TYPE_UNIQUE,
2763 .state = WREPL_STATE_TOMBSTONE,
2764 .node = WREPL_NODE_B,
2765 .is_static = false,
2766 .num_ips = ARRAY_SIZE(addresses_B_1),
2767 .ips = addresses_B_1,
2768 .apply_expected = true
2773 * sgroup,tombstone vs. unique,active
2774 * => should be replaced
2777 .line = __location__,
2778 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2779 .r1 = {
2780 .owner = &ctx->a,
2781 .type = WREPL_TYPE_SGROUP,
2782 .state = WREPL_STATE_TOMBSTONE,
2783 .node = WREPL_NODE_B,
2784 .is_static = false,
2785 .num_ips = ARRAY_SIZE(addresses_A_1),
2786 .ips = addresses_A_1,
2787 .apply_expected = true
2789 .r2 = {
2790 .owner = &ctx->b,
2791 .type = WREPL_TYPE_UNIQUE,
2792 .state = WREPL_STATE_ACTIVE,
2793 .node = WREPL_NODE_B,
2794 .is_static = false,
2795 .num_ips = ARRAY_SIZE(addresses_B_1),
2796 .ips = addresses_B_1,
2797 .apply_expected = true
2802 * sgroup,tombstone vs. unique,tombstone
2803 * => should be replaced
2806 .line = __location__,
2807 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2808 .r1 = {
2809 .owner = &ctx->b,
2810 .type = WREPL_TYPE_SGROUP,
2811 .state = WREPL_STATE_TOMBSTONE,
2812 .node = WREPL_NODE_B,
2813 .is_static = false,
2814 .num_ips = ARRAY_SIZE(addresses_B_1),
2815 .ips = addresses_B_1,
2816 .apply_expected = true
2818 .r2 = {
2819 .owner = &ctx->a,
2820 .type = WREPL_TYPE_UNIQUE,
2821 .state = WREPL_STATE_TOMBSTONE,
2822 .node = WREPL_NODE_B,
2823 .is_static = false,
2824 .num_ips = ARRAY_SIZE(addresses_A_1),
2825 .ips = addresses_A_1,
2826 .apply_expected = true
2831 * special groups vs normal group section,
2834 * sgroup,active vs. group,active
2835 * => should NOT be replaced
2838 .line = __location__,
2839 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2840 .r1 = {
2841 .owner = &ctx->a,
2842 .type = WREPL_TYPE_SGROUP,
2843 .state = WREPL_STATE_ACTIVE,
2844 .node = WREPL_NODE_B,
2845 .is_static = false,
2846 .num_ips = ARRAY_SIZE(addresses_A_1),
2847 .ips = addresses_A_1,
2848 .apply_expected = true
2850 .r2 = {
2851 .owner = &ctx->b,
2852 .type = WREPL_TYPE_GROUP,
2853 .state = WREPL_STATE_ACTIVE,
2854 .node = WREPL_NODE_B,
2855 .is_static = false,
2856 .num_ips = ARRAY_SIZE(addresses_A_1),
2857 .ips = addresses_A_1,
2858 .apply_expected = false
2863 * sgroup,active vs. group,tombstone
2864 * => should NOT be replaced
2867 .line = __location__,
2868 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2869 .r1 = {
2870 .owner = &ctx->a,
2871 .type = WREPL_TYPE_SGROUP,
2872 .state = WREPL_STATE_ACTIVE,
2873 .node = WREPL_NODE_B,
2874 .is_static = false,
2875 .num_ips = ARRAY_SIZE(addresses_A_1),
2876 .ips = addresses_A_1,
2877 .apply_expected = true
2879 .r2 = {
2880 .owner = &ctx->b,
2881 .type = WREPL_TYPE_GROUP,
2882 .state = WREPL_STATE_TOMBSTONE,
2883 .node = WREPL_NODE_B,
2884 .is_static = false,
2885 .num_ips = ARRAY_SIZE(addresses_A_1),
2886 .ips = addresses_A_1,
2887 .apply_expected = false
2892 * sgroup,released vs. group,active
2893 * => should be replaced
2896 .line = __location__,
2897 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2898 .r1 = {
2899 .owner = &ctx->a,
2900 .type = WREPL_TYPE_SGROUP,
2901 .state = WREPL_STATE_RELEASED,
2902 .node = WREPL_NODE_B,
2903 .is_static = false,
2904 .num_ips = ARRAY_SIZE(addresses_A_1),
2905 .ips = addresses_A_1,
2906 .apply_expected = false
2908 .r2 = {
2909 .owner = &ctx->b,
2910 .type = WREPL_TYPE_GROUP,
2911 .state = WREPL_STATE_ACTIVE,
2912 .node = WREPL_NODE_B,
2913 .is_static = false,
2914 .num_ips = ARRAY_SIZE(addresses_B_1),
2915 .ips = addresses_B_1,
2916 .apply_expected = true
2921 * sgroup,released vs. group,tombstone
2922 * => should be replaced
2925 .line = __location__,
2926 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2927 .r1 = {
2928 .owner = &ctx->b,
2929 .type = WREPL_TYPE_SGROUP,
2930 .state = WREPL_STATE_RELEASED,
2931 .node = WREPL_NODE_B,
2932 .is_static = false,
2933 .num_ips = ARRAY_SIZE(addresses_B_1),
2934 .ips = addresses_B_1,
2935 .apply_expected = false
2937 .r2 = {
2938 .owner = &ctx->a,
2939 .type = WREPL_TYPE_GROUP,
2940 .state = WREPL_STATE_TOMBSTONE,
2941 .node = WREPL_NODE_B,
2942 .is_static = false,
2943 .num_ips = ARRAY_SIZE(addresses_A_1),
2944 .ips = addresses_A_1,
2945 .apply_expected = true
2950 * sgroup,tombstone vs. group,active
2951 * => should NOT be replaced
2954 .line = __location__,
2955 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2956 .r1 = {
2957 .owner = &ctx->a,
2958 .type = WREPL_TYPE_SGROUP,
2959 .state = WREPL_STATE_TOMBSTONE,
2960 .node = WREPL_NODE_B,
2961 .is_static = false,
2962 .num_ips = ARRAY_SIZE(addresses_A_1),
2963 .ips = addresses_A_1,
2964 .apply_expected = true
2966 .r2 = {
2967 .owner = &ctx->b,
2968 .type = WREPL_TYPE_GROUP,
2969 .state = WREPL_STATE_ACTIVE,
2970 .node = WREPL_NODE_B,
2971 .is_static = false,
2972 .num_ips = ARRAY_SIZE(addresses_B_1),
2973 .ips = addresses_B_1,
2974 .apply_expected = true
2979 * sgroup,tombstone vs. group,tombstone
2980 * => should NOT be replaced
2983 .line = __location__,
2984 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2985 .r1 = {
2986 .owner = &ctx->b,
2987 .type = WREPL_TYPE_SGROUP,
2988 .state = WREPL_STATE_TOMBSTONE,
2989 .node = WREPL_NODE_B,
2990 .is_static = false,
2991 .num_ips = ARRAY_SIZE(addresses_B_1),
2992 .ips = addresses_B_1,
2993 .apply_expected = true
2995 .r2 = {
2996 .owner = &ctx->a,
2997 .type = WREPL_TYPE_GROUP,
2998 .state = WREPL_STATE_TOMBSTONE,
2999 .node = WREPL_NODE_B,
3000 .is_static = false,
3001 .num_ips = ARRAY_SIZE(addresses_A_1),
3002 .ips = addresses_A_1,
3003 .apply_expected = true
3008 * special groups (not active) vs special group section,
3011 * sgroup,released vs. sgroup,active
3012 * => should be replaced
3015 .line = __location__,
3016 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3017 .r1 = {
3018 .owner = &ctx->a,
3019 .type = WREPL_TYPE_SGROUP,
3020 .state = WREPL_STATE_RELEASED,
3021 .node = WREPL_NODE_B,
3022 .is_static = false,
3023 .num_ips = ARRAY_SIZE(addresses_A_1),
3024 .ips = addresses_A_1,
3025 .apply_expected = false
3027 .r2 = {
3028 .owner = &ctx->b,
3029 .type = WREPL_TYPE_SGROUP,
3030 .state = WREPL_STATE_ACTIVE,
3031 .node = WREPL_NODE_B,
3032 .is_static = false,
3033 .num_ips = ARRAY_SIZE(addresses_B_1),
3034 .ips = addresses_B_1,
3035 .apply_expected = true
3040 * sgroup,released vs. sgroup,tombstone
3041 * => should be replaced
3044 .line = __location__,
3045 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3046 .r1 = {
3047 .owner = &ctx->b,
3048 .type = WREPL_TYPE_SGROUP,
3049 .state = WREPL_STATE_RELEASED,
3050 .node = WREPL_NODE_B,
3051 .is_static = false,
3052 .num_ips = ARRAY_SIZE(addresses_B_1),
3053 .ips = addresses_B_1,
3054 .apply_expected = false
3056 .r2 = {
3057 .owner = &ctx->a,
3058 .type = WREPL_TYPE_SGROUP,
3059 .state = WREPL_STATE_TOMBSTONE,
3060 .node = WREPL_NODE_B,
3061 .is_static = false,
3062 .num_ips = ARRAY_SIZE(addresses_A_1),
3063 .ips = addresses_A_1,
3064 .apply_expected = true
3069 * sgroup,tombstone vs. sgroup,active
3070 * => should NOT be replaced
3073 .line = __location__,
3074 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3075 .r1 = {
3076 .owner = &ctx->a,
3077 .type = WREPL_TYPE_SGROUP,
3078 .state = WREPL_STATE_TOMBSTONE,
3079 .node = WREPL_NODE_B,
3080 .is_static = false,
3081 .num_ips = ARRAY_SIZE(addresses_A_1),
3082 .ips = addresses_A_1,
3083 .apply_expected = true
3085 .r2 = {
3086 .owner = &ctx->b,
3087 .type = WREPL_TYPE_SGROUP,
3088 .state = WREPL_STATE_ACTIVE,
3089 .node = WREPL_NODE_B,
3090 .is_static = false,
3091 .num_ips = ARRAY_SIZE(addresses_B_1),
3092 .ips = addresses_B_1,
3093 .apply_expected = true
3098 * sgroup,tombstone vs. sgroup,tombstone
3099 * => should NOT be replaced
3102 .line = __location__,
3103 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3104 .r1 = {
3105 .owner = &ctx->b,
3106 .type = WREPL_TYPE_SGROUP,
3107 .state = WREPL_STATE_TOMBSTONE,
3108 .node = WREPL_NODE_B,
3109 .is_static = false,
3110 .num_ips = ARRAY_SIZE(addresses_B_1),
3111 .ips = addresses_B_1,
3112 .apply_expected = true
3114 .r2 = {
3115 .owner = &ctx->a,
3116 .type = WREPL_TYPE_SGROUP,
3117 .state = WREPL_STATE_TOMBSTONE,
3118 .node = WREPL_NODE_B,
3119 .is_static = false,
3120 .num_ips = ARRAY_SIZE(addresses_A_1),
3121 .ips = addresses_A_1,
3122 .apply_expected = true
3127 * special groups vs multi homed section,
3130 * sgroup,active vs. mhomed,active
3131 * => should NOT be replaced
3134 .line = __location__,
3135 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3136 .r1 = {
3137 .owner = &ctx->a,
3138 .type = WREPL_TYPE_SGROUP,
3139 .state = WREPL_STATE_ACTIVE,
3140 .node = WREPL_NODE_B,
3141 .is_static = false,
3142 .num_ips = ARRAY_SIZE(addresses_A_1),
3143 .ips = addresses_A_1,
3144 .apply_expected = true
3146 .r2 = {
3147 .owner = &ctx->b,
3148 .type = WREPL_TYPE_MHOMED,
3149 .state = WREPL_STATE_ACTIVE,
3150 .node = WREPL_NODE_B,
3151 .is_static = false,
3152 .num_ips = ARRAY_SIZE(addresses_A_1),
3153 .ips = addresses_A_1,
3154 .apply_expected = false
3159 * sgroup,active vs. mhomed,tombstone
3160 * => should NOT be replaced
3163 .line = __location__,
3164 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3165 .r1 = {
3166 .owner = &ctx->a,
3167 .type = WREPL_TYPE_SGROUP,
3168 .state = WREPL_STATE_ACTIVE,
3169 .node = WREPL_NODE_B,
3170 .is_static = false,
3171 .num_ips = ARRAY_SIZE(addresses_A_1),
3172 .ips = addresses_A_1,
3173 .apply_expected = true
3175 .r2 = {
3176 .owner = &ctx->b,
3177 .type = WREPL_TYPE_MHOMED,
3178 .state = WREPL_STATE_TOMBSTONE,
3179 .node = WREPL_NODE_B,
3180 .is_static = false,
3181 .num_ips = ARRAY_SIZE(addresses_A_1),
3182 .ips = addresses_A_1,
3183 .apply_expected = false
3188 * sgroup,released vs. mhomed,active
3189 * => should be replaced
3192 .line = __location__,
3193 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3194 .r1 = {
3195 .owner = &ctx->a,
3196 .type = WREPL_TYPE_SGROUP,
3197 .state = WREPL_STATE_RELEASED,
3198 .node = WREPL_NODE_B,
3199 .is_static = false,
3200 .num_ips = ARRAY_SIZE(addresses_A_1),
3201 .ips = addresses_A_1,
3202 .apply_expected = false
3204 .r2 = {
3205 .owner = &ctx->b,
3206 .type = WREPL_TYPE_MHOMED,
3207 .state = WREPL_STATE_ACTIVE,
3208 .node = WREPL_NODE_B,
3209 .is_static = false,
3210 .num_ips = ARRAY_SIZE(addresses_B_1),
3211 .ips = addresses_B_1,
3212 .apply_expected = true
3217 * sgroup,released vs. mhomed,tombstone
3218 * => should be replaced
3221 .line = __location__,
3222 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3223 .r1 = {
3224 .owner = &ctx->b,
3225 .type = WREPL_TYPE_SGROUP,
3226 .state = WREPL_STATE_RELEASED,
3227 .node = WREPL_NODE_B,
3228 .is_static = false,
3229 .num_ips = ARRAY_SIZE(addresses_B_1),
3230 .ips = addresses_B_1,
3231 .apply_expected = false
3233 .r2 = {
3234 .owner = &ctx->a,
3235 .type = WREPL_TYPE_MHOMED,
3236 .state = WREPL_STATE_TOMBSTONE,
3237 .node = WREPL_NODE_B,
3238 .is_static = false,
3239 .num_ips = ARRAY_SIZE(addresses_A_1),
3240 .ips = addresses_A_1,
3241 .apply_expected = true
3246 * sgroup,tombstone vs. mhomed,active
3247 * => should be replaced
3250 .line = __location__,
3251 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3252 .r1 = {
3253 .owner = &ctx->a,
3254 .type = WREPL_TYPE_SGROUP,
3255 .state = WREPL_STATE_TOMBSTONE,
3256 .node = WREPL_NODE_B,
3257 .is_static = false,
3258 .num_ips = ARRAY_SIZE(addresses_A_1),
3259 .ips = addresses_A_1,
3260 .apply_expected = true
3262 .r2 = {
3263 .owner = &ctx->b,
3264 .type = WREPL_TYPE_MHOMED,
3265 .state = WREPL_STATE_ACTIVE,
3266 .node = WREPL_NODE_B,
3267 .is_static = false,
3268 .num_ips = ARRAY_SIZE(addresses_B_1),
3269 .ips = addresses_B_1,
3270 .apply_expected = true
3275 * sgroup,tombstone vs. mhomed,tombstone
3276 * => should be replaced
3279 .line = __location__,
3280 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3281 .r1 = {
3282 .owner = &ctx->b,
3283 .type = WREPL_TYPE_SGROUP,
3284 .state = WREPL_STATE_TOMBSTONE,
3285 .node = WREPL_NODE_B,
3286 .is_static = false,
3287 .num_ips = ARRAY_SIZE(addresses_B_1),
3288 .ips = addresses_B_1,
3289 .apply_expected = true
3291 .r2 = {
3292 .owner = &ctx->a,
3293 .type = WREPL_TYPE_MHOMED,
3294 .state = WREPL_STATE_TOMBSTONE,
3295 .node = WREPL_NODE_B,
3296 .is_static = false,
3297 .num_ips = ARRAY_SIZE(addresses_A_1),
3298 .ips = addresses_A_1,
3299 .apply_expected = true
3304 * multi homed vs. unique section,
3307 * mhomed,active vs. unique,active
3308 * => should be replaced
3311 .line = __location__,
3312 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3313 .r1 = {
3314 .owner = &ctx->a,
3315 .type = WREPL_TYPE_MHOMED,
3316 .state = WREPL_STATE_ACTIVE,
3317 .node = WREPL_NODE_B,
3318 .is_static = false,
3319 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3320 .ips = addresses_A_3_4,
3321 .apply_expected = true
3323 .r2 = {
3324 .owner = &ctx->b,
3325 .type = WREPL_TYPE_UNIQUE,
3326 .state = WREPL_STATE_ACTIVE,
3327 .node = WREPL_NODE_B,
3328 .is_static = false,
3329 .num_ips = ARRAY_SIZE(addresses_B_1),
3330 .ips = addresses_B_1,
3331 .apply_expected = true
3336 * mhomed,active vs. unique,tombstone
3337 * => should NOT be replaced
3340 .line = __location__,
3341 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3342 .r1 = {
3343 .owner = &ctx->b,
3344 .type = WREPL_TYPE_MHOMED,
3345 .state = WREPL_STATE_ACTIVE,
3346 .node = WREPL_NODE_B,
3347 .is_static = false,
3348 .num_ips = ARRAY_SIZE(addresses_B_1),
3349 .ips = addresses_B_1,
3350 .apply_expected = true
3352 .r2 = {
3353 .owner = &ctx->a,
3354 .type = WREPL_TYPE_UNIQUE,
3355 .state = WREPL_STATE_TOMBSTONE,
3356 .node = WREPL_NODE_B,
3357 .is_static = false,
3358 .num_ips = ARRAY_SIZE(addresses_B_1),
3359 .ips = addresses_B_1,
3360 .apply_expected = false
3365 * mhomed,released vs. unique,active
3366 * => should be replaced
3369 .line = __location__,
3370 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3371 .r1 = {
3372 .owner = &ctx->a,
3373 .type = WREPL_TYPE_MHOMED,
3374 .state = WREPL_STATE_RELEASED,
3375 .node = WREPL_NODE_B,
3376 .is_static = false,
3377 .num_ips = ARRAY_SIZE(addresses_A_1),
3378 .ips = addresses_A_1,
3379 .apply_expected = false
3381 .r2 = {
3382 .owner = &ctx->b,
3383 .type = WREPL_TYPE_UNIQUE,
3384 .state = WREPL_STATE_ACTIVE,
3385 .node = WREPL_NODE_B,
3386 .is_static = false,
3387 .num_ips = ARRAY_SIZE(addresses_B_1),
3388 .ips = addresses_B_1,
3389 .apply_expected = true
3394 * mhomed,released vs. uinique,tombstone
3395 * => should be replaced
3398 .line = __location__,
3399 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3400 .r1 = {
3401 .owner = &ctx->b,
3402 .type = WREPL_TYPE_MHOMED,
3403 .state = WREPL_STATE_RELEASED,
3404 .node = WREPL_NODE_B,
3405 .is_static = false,
3406 .num_ips = ARRAY_SIZE(addresses_B_1),
3407 .ips = addresses_B_1,
3408 .apply_expected = false
3410 .r2 = {
3411 .owner = &ctx->a,
3412 .type = WREPL_TYPE_UNIQUE,
3413 .state = WREPL_STATE_TOMBSTONE,
3414 .node = WREPL_NODE_B,
3415 .is_static = false,
3416 .num_ips = ARRAY_SIZE(addresses_A_1),
3417 .ips = addresses_A_1,
3418 .apply_expected = true
3423 * mhomed,tombstone vs. unique,active
3424 * => should be replaced
3427 .line = __location__,
3428 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3429 .r1 = {
3430 .owner = &ctx->a,
3431 .type = WREPL_TYPE_MHOMED,
3432 .state = WREPL_STATE_TOMBSTONE,
3433 .node = WREPL_NODE_B,
3434 .is_static = false,
3435 .num_ips = ARRAY_SIZE(addresses_A_1),
3436 .ips = addresses_A_1,
3437 .apply_expected = true
3439 .r2 = {
3440 .owner = &ctx->b,
3441 .type = WREPL_TYPE_UNIQUE,
3442 .state = WREPL_STATE_ACTIVE,
3443 .node = WREPL_NODE_B,
3444 .is_static = false,
3445 .num_ips = ARRAY_SIZE(addresses_B_1),
3446 .ips = addresses_B_1,
3447 .apply_expected = true
3452 * mhomed,tombstone vs. uinique,tombstone
3453 * => should be replaced
3456 .line = __location__,
3457 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3458 .r1 = {
3459 .owner = &ctx->b,
3460 .type = WREPL_TYPE_MHOMED,
3461 .state = WREPL_STATE_TOMBSTONE,
3462 .node = WREPL_NODE_B,
3463 .is_static = false,
3464 .num_ips = ARRAY_SIZE(addresses_B_1),
3465 .ips = addresses_B_1,
3466 .apply_expected = true
3468 .r2 = {
3469 .owner = &ctx->a,
3470 .type = WREPL_TYPE_UNIQUE,
3471 .state = WREPL_STATE_TOMBSTONE,
3472 .node = WREPL_NODE_B,
3473 .is_static = false,
3474 .num_ips = ARRAY_SIZE(addresses_A_1),
3475 .ips = addresses_A_1,
3476 .apply_expected = true
3481 * multi homed vs. normal group section,
3484 * mhomed,active vs. group,active
3485 * => should be replaced
3488 .line = __location__,
3489 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3490 .r1 = {
3491 .owner = &ctx->a,
3492 .type = WREPL_TYPE_MHOMED,
3493 .state = WREPL_STATE_ACTIVE,
3494 .node = WREPL_NODE_B,
3495 .is_static = false,
3496 .num_ips = ARRAY_SIZE(addresses_A_1),
3497 .ips = addresses_A_1,
3498 .apply_expected = true
3500 .r2 = {
3501 .owner = &ctx->b,
3502 .type = WREPL_TYPE_GROUP,
3503 .state = WREPL_STATE_ACTIVE,
3504 .node = WREPL_NODE_B,
3505 .is_static = false,
3506 .num_ips = ARRAY_SIZE(addresses_B_1),
3507 .ips = addresses_B_1,
3508 .apply_expected = true
3513 * mhomed,active vs. group,tombstone
3514 * => should NOT be replaced
3517 .line = __location__,
3518 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3519 .r1 = {
3520 .owner = &ctx->b,
3521 .type = WREPL_TYPE_MHOMED,
3522 .state = WREPL_STATE_ACTIVE,
3523 .node = WREPL_NODE_B,
3524 .is_static = false,
3525 .num_ips = ARRAY_SIZE(addresses_B_1),
3526 .ips = addresses_B_1,
3527 .apply_expected = true
3529 .r2 = {
3530 .owner = &ctx->a,
3531 .type = WREPL_TYPE_GROUP,
3532 .state = WREPL_STATE_TOMBSTONE,
3533 .node = WREPL_NODE_B,
3534 .is_static = false,
3535 .num_ips = ARRAY_SIZE(addresses_B_1),
3536 .ips = addresses_B_1,
3537 .apply_expected = false
3542 * mhomed,released vs. group,active
3543 * => should be replaced
3546 .line = __location__,
3547 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3548 .r1 = {
3549 .owner = &ctx->b,
3550 .type = WREPL_TYPE_MHOMED,
3551 .state = WREPL_STATE_RELEASED,
3552 .node = WREPL_NODE_B,
3553 .is_static = false,
3554 .num_ips = ARRAY_SIZE(addresses_B_1),
3555 .ips = addresses_B_1,
3556 .apply_expected = false
3558 .r2 = {
3559 .owner = &ctx->a,
3560 .type = WREPL_TYPE_GROUP,
3561 .state = WREPL_STATE_ACTIVE,
3562 .node = WREPL_NODE_B,
3563 .is_static = false,
3564 .num_ips = ARRAY_SIZE(addresses_A_1),
3565 .ips = addresses_A_1,
3566 .apply_expected = true
3571 * mhomed,released vs. group,tombstone
3572 * => should be replaced
3575 .line = __location__,
3576 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3577 .r1 = {
3578 .owner = &ctx->a,
3579 .type = WREPL_TYPE_MHOMED,
3580 .state = WREPL_STATE_RELEASED,
3581 .node = WREPL_NODE_B,
3582 .is_static = false,
3583 .num_ips = ARRAY_SIZE(addresses_A_1),
3584 .ips = addresses_A_1,
3585 .apply_expected = false
3587 .r2 = {
3588 .owner = &ctx->b,
3589 .type = WREPL_TYPE_GROUP,
3590 .state = WREPL_STATE_TOMBSTONE,
3591 .node = WREPL_NODE_B,
3592 .is_static = false,
3593 .num_ips = ARRAY_SIZE(addresses_B_1),
3594 .ips = addresses_B_1,
3595 .apply_expected = true
3600 * mhomed,tombstone vs. group,active
3601 * => should be replaced
3604 .line = __location__,
3605 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3606 .r1 = {
3607 .owner = &ctx->b,
3608 .type = WREPL_TYPE_MHOMED,
3609 .state = WREPL_STATE_TOMBSTONE,
3610 .node = WREPL_NODE_B,
3611 .is_static = false,
3612 .num_ips = ARRAY_SIZE(addresses_B_1),
3613 .ips = addresses_B_1,
3614 .apply_expected = true
3616 .r2 = {
3617 .owner = &ctx->a,
3618 .type = WREPL_TYPE_GROUP,
3619 .state = WREPL_STATE_ACTIVE,
3620 .node = WREPL_NODE_B,
3621 .is_static = false,
3622 .num_ips = ARRAY_SIZE(addresses_A_1),
3623 .ips = addresses_A_1,
3624 .apply_expected = true
3629 * mhomed,tombstone vs. group,tombstone
3630 * => should be replaced
3633 .line = __location__,
3634 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3635 .r1 = {
3636 .owner = &ctx->a,
3637 .type = WREPL_TYPE_MHOMED,
3638 .state = WREPL_STATE_TOMBSTONE,
3639 .node = WREPL_NODE_B,
3640 .is_static = false,
3641 .num_ips = ARRAY_SIZE(addresses_A_1),
3642 .ips = addresses_A_1,
3643 .apply_expected = true
3645 .r2 = {
3646 .owner = &ctx->b,
3647 .type = WREPL_TYPE_GROUP,
3648 .state = WREPL_STATE_TOMBSTONE,
3649 .node = WREPL_NODE_B,
3650 .is_static = false,
3651 .num_ips = ARRAY_SIZE(addresses_B_1),
3652 .ips = addresses_B_1,
3653 .apply_expected = true
3658 * multi homed vs. special group section,
3661 * mhomed,active vs. sgroup,active
3662 * => should NOT be replaced
3665 .line = __location__,
3666 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3667 .r1 = {
3668 .owner = &ctx->a,
3669 .type = WREPL_TYPE_MHOMED,
3670 .state = WREPL_STATE_ACTIVE,
3671 .node = WREPL_NODE_B,
3672 .is_static = false,
3673 .num_ips = ARRAY_SIZE(addresses_A_1),
3674 .ips = addresses_A_1,
3675 .apply_expected = true
3677 .r2 = {
3678 .owner = &ctx->b,
3679 .type = WREPL_TYPE_SGROUP,
3680 .state = WREPL_STATE_ACTIVE,
3681 .node = WREPL_NODE_B,
3682 .is_static = false,
3683 .num_ips = ARRAY_SIZE(addresses_A_1),
3684 .ips = addresses_A_1,
3685 .apply_expected = false
3690 * mhomed,active vs. sgroup,tombstone
3691 * => should NOT be replaced
3694 .line = __location__,
3695 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3696 .r1 = {
3697 .owner = &ctx->a,
3698 .type = WREPL_TYPE_MHOMED,
3699 .state = WREPL_STATE_ACTIVE,
3700 .node = WREPL_NODE_B,
3701 .is_static = false,
3702 .num_ips = ARRAY_SIZE(addresses_A_1),
3703 .ips = addresses_A_1,
3704 .apply_expected = true
3706 .r2 = {
3707 .owner = &ctx->b,
3708 .type = WREPL_TYPE_SGROUP,
3709 .state = WREPL_STATE_TOMBSTONE,
3710 .node = WREPL_NODE_B,
3711 .is_static = false,
3712 .num_ips = ARRAY_SIZE(addresses_A_1),
3713 .ips = addresses_A_1,
3714 .apply_expected = false
3719 * mhomed,released vs. sgroup,active
3720 * => should be replaced
3723 .line = __location__,
3724 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3725 .r1 = {
3726 .owner = &ctx->a,
3727 .type = WREPL_TYPE_MHOMED,
3728 .state = WREPL_STATE_RELEASED,
3729 .node = WREPL_NODE_B,
3730 .is_static = false,
3731 .num_ips = ARRAY_SIZE(addresses_A_1),
3732 .ips = addresses_A_1,
3733 .apply_expected = false
3735 .r2 = {
3736 .owner = &ctx->b,
3737 .type = WREPL_TYPE_SGROUP,
3738 .state = WREPL_STATE_ACTIVE,
3739 .node = WREPL_NODE_B,
3740 .is_static = false,
3741 .num_ips = ARRAY_SIZE(addresses_B_1),
3742 .ips = addresses_B_1,
3743 .apply_expected = true
3748 * mhomed,released vs. sgroup,tombstone
3749 * => should be replaced
3752 .line = __location__,
3753 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3754 .r1 = {
3755 .owner = &ctx->b,
3756 .type = WREPL_TYPE_MHOMED,
3757 .state = WREPL_STATE_RELEASED,
3758 .node = WREPL_NODE_B,
3759 .is_static = false,
3760 .num_ips = ARRAY_SIZE(addresses_B_1),
3761 .ips = addresses_B_1,
3762 .apply_expected = false
3764 .r2 = {
3765 .owner = &ctx->a,
3766 .type = WREPL_TYPE_SGROUP,
3767 .state = WREPL_STATE_TOMBSTONE,
3768 .node = WREPL_NODE_B,
3769 .is_static = false,
3770 .num_ips = ARRAY_SIZE(addresses_A_1),
3771 .ips = addresses_A_1,
3772 .apply_expected = true
3777 * mhomed,tombstone vs. sgroup,active
3778 * => should be replaced
3781 .line = __location__,
3782 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3783 .r1 = {
3784 .owner = &ctx->a,
3785 .type = WREPL_TYPE_MHOMED,
3786 .state = WREPL_STATE_TOMBSTONE,
3787 .node = WREPL_NODE_B,
3788 .is_static = false,
3789 .num_ips = ARRAY_SIZE(addresses_A_1),
3790 .ips = addresses_A_1,
3791 .apply_expected = true
3793 .r2 = {
3794 .owner = &ctx->b,
3795 .type = WREPL_TYPE_SGROUP,
3796 .state = WREPL_STATE_ACTIVE,
3797 .node = WREPL_NODE_B,
3798 .is_static = false,
3799 .num_ips = ARRAY_SIZE(addresses_B_1),
3800 .ips = addresses_B_1,
3801 .apply_expected = true
3806 * mhomed,tombstone vs. sgroup,tombstone
3807 * => should be replaced
3810 .line = __location__,
3811 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3812 .r1 = {
3813 .owner = &ctx->b,
3814 .type = WREPL_TYPE_MHOMED,
3815 .state = WREPL_STATE_TOMBSTONE,
3816 .node = WREPL_NODE_B,
3817 .is_static = false,
3818 .num_ips = ARRAY_SIZE(addresses_B_1),
3819 .ips = addresses_B_1,
3820 .apply_expected = true
3822 .r2 = {
3823 .owner = &ctx->a,
3824 .type = WREPL_TYPE_SGROUP,
3825 .state = WREPL_STATE_TOMBSTONE,
3826 .node = WREPL_NODE_B,
3827 .is_static = false,
3828 .num_ips = ARRAY_SIZE(addresses_A_1),
3829 .ips = addresses_A_1,
3830 .apply_expected = true
3835 * multi homed vs. mlti homed section,
3838 * mhomed,active vs. mhomed,active
3839 * => should be replaced
3842 .line = __location__,
3843 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3844 .r1 = {
3845 .owner = &ctx->a,
3846 .type = WREPL_TYPE_MHOMED,
3847 .state = WREPL_STATE_ACTIVE,
3848 .node = WREPL_NODE_B,
3849 .is_static = false,
3850 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3851 .ips = addresses_A_3_4,
3852 .apply_expected = true
3854 .r2 = {
3855 .owner = &ctx->b,
3856 .type = WREPL_TYPE_MHOMED,
3857 .state = WREPL_STATE_ACTIVE,
3858 .node = WREPL_NODE_B,
3859 .is_static = false,
3860 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3861 .ips = addresses_B_3_4,
3862 .apply_expected = true
3867 * mhomed,active vs. mhomed,tombstone
3868 * => should NOT be replaced
3871 .line = __location__,
3872 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3873 .r1 = {
3874 .owner = &ctx->b,
3875 .type = WREPL_TYPE_MHOMED,
3876 .state = WREPL_STATE_ACTIVE,
3877 .node = WREPL_NODE_B,
3878 .is_static = false,
3879 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3880 .ips = addresses_B_3_4,
3881 .apply_expected = true
3883 .r2 = {
3884 .owner = &ctx->a,
3885 .type = WREPL_TYPE_MHOMED,
3886 .state = WREPL_STATE_TOMBSTONE,
3887 .node = WREPL_NODE_B,
3888 .is_static = false,
3889 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3890 .ips = addresses_B_3_4,
3891 .apply_expected = false
3896 * mhomed,released vs. mhomed,active
3897 * => should be replaced
3900 .line = __location__,
3901 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3902 .r1 = {
3903 .owner = &ctx->b,
3904 .type = WREPL_TYPE_MHOMED,
3905 .state = WREPL_STATE_RELEASED,
3906 .node = WREPL_NODE_B,
3907 .is_static = false,
3908 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3909 .ips = addresses_B_3_4,
3910 .apply_expected = false
3912 .r2 = {
3913 .owner = &ctx->a,
3914 .type = WREPL_TYPE_MHOMED,
3915 .state = WREPL_STATE_ACTIVE,
3916 .node = WREPL_NODE_B,
3917 .is_static = false,
3918 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3919 .ips = addresses_A_3_4,
3920 .apply_expected = true
3925 * mhomed,released vs. mhomed,tombstone
3926 * => should be replaced
3929 .line = __location__,
3930 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3931 .r1 = {
3932 .owner = &ctx->a,
3933 .type = WREPL_TYPE_MHOMED,
3934 .state = WREPL_STATE_RELEASED,
3935 .node = WREPL_NODE_B,
3936 .is_static = false,
3937 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3938 .ips = addresses_A_3_4,
3939 .apply_expected = false
3941 .r2 = {
3942 .owner = &ctx->b,
3943 .type = WREPL_TYPE_MHOMED,
3944 .state = WREPL_STATE_TOMBSTONE,
3945 .node = WREPL_NODE_B,
3946 .is_static = false,
3947 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3948 .ips = addresses_B_3_4,
3949 .apply_expected = true
3954 * mhomed,tombstone vs. mhomed,active
3955 * => should be replaced
3958 .line = __location__,
3959 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3960 .r1 = {
3961 .owner = &ctx->b,
3962 .type = WREPL_TYPE_MHOMED,
3963 .state = WREPL_STATE_TOMBSTONE,
3964 .node = WREPL_NODE_B,
3965 .is_static = false,
3966 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3967 .ips = addresses_B_3_4,
3968 .apply_expected = true
3970 .r2 = {
3971 .owner = &ctx->a,
3972 .type = WREPL_TYPE_MHOMED,
3973 .state = WREPL_STATE_ACTIVE,
3974 .node = WREPL_NODE_B,
3975 .is_static = false,
3976 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3977 .ips = addresses_A_3_4,
3978 .apply_expected = true
3983 * mhomed,tombstone vs. mhomed,tombstone
3984 * => should be replaced
3987 .line = __location__,
3988 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3989 .r1 = {
3990 .owner = &ctx->a,
3991 .type = WREPL_TYPE_MHOMED,
3992 .state = WREPL_STATE_TOMBSTONE,
3993 .node = WREPL_NODE_B,
3994 .is_static = false,
3995 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3996 .ips = addresses_A_3_4,
3997 .apply_expected = true
3999 .r2 = {
4000 .owner = &ctx->b,
4001 .type = WREPL_TYPE_MHOMED,
4002 .state = WREPL_STATE_TOMBSTONE,
4003 .node = WREPL_NODE_B,
4004 .is_static = false,
4005 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4006 .ips = addresses_B_3_4,
4007 .apply_expected = true
4011 .line = __location__,
4012 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4013 .cleanup= true,
4014 .r1 = {
4015 .owner = &ctx->b,
4016 .type = WREPL_TYPE_UNIQUE,
4017 .state = WREPL_STATE_TOMBSTONE,
4018 .node = WREPL_NODE_B,
4019 .is_static = false,
4020 .num_ips = ARRAY_SIZE(addresses_B_1),
4021 .ips = addresses_B_1,
4022 .apply_expected = true,
4024 .r2 = {
4025 .owner = &ctx->a,
4026 .type = WREPL_TYPE_UNIQUE,
4027 .state = WREPL_STATE_TOMBSTONE,
4028 .node = WREPL_NODE_B,
4029 .is_static = false,
4030 .num_ips = ARRAY_SIZE(addresses_A_1),
4031 .ips = addresses_A_1,
4032 .apply_expected = true,
4036 * special group vs special group section,
4039 * sgroup,active vs. sgroup,active same addresses
4040 * => should be NOT replaced
4043 .line = __location__,
4044 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4045 .comment= "A:A_3_4 vs. B:A_3_4",
4046 .extra = true,
4047 .r1 = {
4048 .owner = &ctx->a,
4049 .type = WREPL_TYPE_SGROUP,
4050 .state = WREPL_STATE_ACTIVE,
4051 .node = WREPL_NODE_B,
4052 .is_static = false,
4053 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4054 .ips = addresses_A_3_4,
4055 .apply_expected = true
4057 .r2 = {
4058 .owner = &ctx->b,
4059 .type = WREPL_TYPE_SGROUP,
4060 .state = WREPL_STATE_ACTIVE,
4061 .node = WREPL_NODE_B,
4062 .is_static = false,
4063 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4064 .ips = addresses_A_3_4,
4065 .apply_expected = false,
4066 .sgroup_cleanup = true
4070 * sgroup,active vs. sgroup,active same addresses
4071 * => should be NOT replaced
4074 .line = __location__,
4075 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4076 .comment= "A:A_3_4 vs. B:NULL",
4077 .extra = true,
4078 .r1 = {
4079 .owner = &ctx->a,
4080 .type = WREPL_TYPE_SGROUP,
4081 .state = WREPL_STATE_ACTIVE,
4082 .node = WREPL_NODE_B,
4083 .is_static = false,
4084 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4085 .ips = addresses_A_3_4,
4086 .apply_expected = true
4088 .r2 = {
4089 .owner = &ctx->b,
4090 .type = WREPL_TYPE_SGROUP,
4091 .state = WREPL_STATE_ACTIVE,
4092 .node = WREPL_NODE_B,
4093 .is_static = false,
4094 .num_ips = 0,
4095 .ips = NULL,
4096 .apply_expected = false,
4097 .sgroup_cleanup = true
4101 * sgroup,active vs. sgroup,active subset addresses, special case...
4102 * => should NOT be replaced
4105 .line = __location__,
4106 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4107 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4",
4108 .extra = true,
4109 .r1 = {
4110 .owner = &ctx->a,
4111 .type = WREPL_TYPE_SGROUP,
4112 .state = WREPL_STATE_ACTIVE,
4113 .node = WREPL_NODE_B,
4114 .is_static = false,
4115 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4116 .ips = addresses_A_3_4_X_3_4,
4117 .apply_expected = true,
4119 .r2 = {
4120 .owner = &ctx->b,
4121 .type = WREPL_TYPE_SGROUP,
4122 .state = WREPL_STATE_ACTIVE,
4123 .node = WREPL_NODE_B,
4124 .is_static = false,
4125 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4126 .ips = addresses_A_3_4,
4127 .apply_expected = false,
4131 .line = __location__,
4132 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4133 .cleanup= true,
4134 .r1 = {
4135 .owner = &ctx->a,
4136 .type = WREPL_TYPE_SGROUP,
4137 .state = WREPL_STATE_ACTIVE,
4138 .node = WREPL_NODE_B,
4139 .is_static = false,
4140 .num_ips = 0,
4141 .ips = NULL,
4142 .apply_expected = false,
4144 .r2 = {
4145 .owner = &ctx->x,
4146 .type = WREPL_TYPE_SGROUP,
4147 .state = WREPL_STATE_ACTIVE,
4148 .node = WREPL_NODE_B,
4149 .is_static = false,
4150 .num_ips = 0,
4151 .ips = NULL,
4152 .apply_expected = false,
4156 * sgroup,active vs. sgroup,active different addresses, but owner changed
4157 * => should be replaced
4160 .line = __location__,
4161 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4162 .comment= "A:B_3_4 vs. B:A_3_4",
4163 .extra = true,
4164 .r1 = {
4165 .owner = &ctx->a,
4166 .type = WREPL_TYPE_SGROUP,
4167 .state = WREPL_STATE_ACTIVE,
4168 .node = WREPL_NODE_B,
4169 .is_static = false,
4170 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4171 .ips = addresses_B_3_4,
4172 .apply_expected = true,
4174 .r2 = {
4175 .owner = &ctx->b,
4176 .type = WREPL_TYPE_SGROUP,
4177 .state = WREPL_STATE_ACTIVE,
4178 .node = WREPL_NODE_B,
4179 .is_static = false,
4180 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4181 .ips = addresses_A_3_4,
4182 .apply_expected = true,
4183 .sgroup_cleanup = true
4187 * sgroup,active vs. sgroup,active different addresses, but owner changed
4188 * => should be replaced
4191 .line = __location__,
4192 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4193 .comment= "A:A_3_4 vs. B:A_3_4_OWNER_B",
4194 .extra = true,
4195 .r1 = {
4196 .owner = &ctx->a,
4197 .type = WREPL_TYPE_SGROUP,
4198 .state = WREPL_STATE_ACTIVE,
4199 .node = WREPL_NODE_B,
4200 .is_static = false,
4201 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4202 .ips = addresses_A_3_4,
4203 .apply_expected = true,
4205 .r2 = {
4206 .owner = &ctx->b,
4207 .type = WREPL_TYPE_SGROUP,
4208 .state = WREPL_STATE_ACTIVE,
4209 .node = WREPL_NODE_B,
4210 .is_static = false,
4211 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4212 .ips = addresses_A_3_4_OWNER_B,
4213 .apply_expected = true,
4214 .sgroup_cleanup = true
4218 * sgroup,active vs. sgroup,active different addresses, but owner changed
4219 * => should be replaced
4222 .line = __location__,
4223 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4224 .comment= "A:A_3_4_OWNER_B vs. B:A_3_4",
4225 .extra = true,
4226 .r1 = {
4227 .owner = &ctx->a,
4228 .type = WREPL_TYPE_SGROUP,
4229 .state = WREPL_STATE_ACTIVE,
4230 .node = WREPL_NODE_B,
4231 .is_static = false,
4232 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4233 .ips = addresses_A_3_4_OWNER_B,
4234 .apply_expected = true,
4236 .r2 = {
4237 .owner = &ctx->b,
4238 .type = WREPL_TYPE_SGROUP,
4239 .state = WREPL_STATE_ACTIVE,
4240 .node = WREPL_NODE_B,
4241 .is_static = false,
4242 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4243 .ips = addresses_A_3_4,
4244 .apply_expected = true,
4245 .sgroup_cleanup = true
4249 * sgroup,active vs. sgroup,active different addresses
4250 * => should be merged
4253 .line = __location__,
4254 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4255 .comment= "A:A_3_4 vs. B:B_3_4 => C:A_3_4_B_3_4",
4256 .extra = true,
4257 .r1 = {
4258 .owner = &ctx->a,
4259 .type = WREPL_TYPE_SGROUP,
4260 .state = WREPL_STATE_ACTIVE,
4261 .node = WREPL_NODE_B,
4262 .is_static = false,
4263 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4264 .ips = addresses_A_3_4,
4265 .apply_expected = true,
4267 .r2 = {
4268 .owner = &ctx->b,
4269 .type = WREPL_TYPE_SGROUP,
4270 .state = WREPL_STATE_ACTIVE,
4271 .node = WREPL_NODE_B,
4272 .is_static = false,
4273 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4274 .ips = addresses_B_3_4,
4275 .sgroup_merge = true,
4276 .sgroup_cleanup = true,
4280 * sgroup,active vs. sgroup,active different addresses, special case...
4281 * => should be merged
4284 .line = __location__,
4285 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4286 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4_X_3_4",
4287 .extra = true,
4288 .r1 = {
4289 .owner = &ctx->a,
4290 .type = WREPL_TYPE_SGROUP,
4291 .state = WREPL_STATE_ACTIVE,
4292 .node = WREPL_NODE_B,
4293 .is_static = false,
4294 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4295 .ips = addresses_B_3_4_X_3_4,
4296 .apply_expected = true,
4298 .r2 = {
4299 .owner = &ctx->b,
4300 .type = WREPL_TYPE_SGROUP,
4301 .state = WREPL_STATE_ACTIVE,
4302 .node = WREPL_NODE_B,
4303 .is_static = false,
4304 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4305 .ips = addresses_A_3_4,
4306 .sgroup_merge = true,
4307 .merge_owner = &ctx->b,
4308 .sgroup_cleanup = false
4312 .line = __location__,
4313 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4314 .cleanup= true,
4315 .r1 = {
4316 .owner = &ctx->b,
4317 .type = WREPL_TYPE_SGROUP,
4318 .state = WREPL_STATE_ACTIVE,
4319 .node = WREPL_NODE_B,
4320 .is_static = false,
4321 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4_OWNER_B),
4322 .ips = addresses_A_3_4_X_3_4_OWNER_B,
4323 .apply_expected = true,
4325 .r2 = {
4326 .owner = &ctx->b,
4327 .type = WREPL_TYPE_SGROUP,
4328 .state = WREPL_STATE_ACTIVE,
4329 .node = WREPL_NODE_B,
4330 .is_static = false,
4331 .num_ips = 0,
4332 .ips = NULL,
4333 .apply_expected = false,
4337 * sgroup,active vs. sgroup,active different addresses, special case...
4338 * => should be merged
4341 .line = __location__,
4342 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4343 .comment= "A:X_3_4 vs. B:A_3_4 => C:A_3_4_X_3_4",
4344 .extra = true,
4345 .r1 = {
4346 .owner = &ctx->a,
4347 .type = WREPL_TYPE_SGROUP,
4348 .state = WREPL_STATE_ACTIVE,
4349 .node = WREPL_NODE_B,
4350 .is_static = false,
4351 .num_ips = ARRAY_SIZE(addresses_X_3_4),
4352 .ips = addresses_X_3_4,
4353 .apply_expected = true,
4355 .r2 = {
4356 .owner = &ctx->b,
4357 .type = WREPL_TYPE_SGROUP,
4358 .state = WREPL_STATE_ACTIVE,
4359 .node = WREPL_NODE_B,
4360 .is_static = false,
4361 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4362 .ips = addresses_A_3_4,
4363 .sgroup_merge = true,
4364 .sgroup_cleanup = false
4368 .line = __location__,
4369 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4370 .cleanup= true,
4371 .r1 = {
4372 .owner = &ctx->a,
4373 .type = WREPL_TYPE_SGROUP,
4374 .state = WREPL_STATE_ACTIVE,
4375 .node = WREPL_NODE_B,
4376 .is_static = false,
4377 .num_ips = 0,
4378 .ips = NULL,
4379 .apply_expected = false,
4381 .r2 = {
4382 .owner = &ctx->x,
4383 .type = WREPL_TYPE_SGROUP,
4384 .state = WREPL_STATE_ACTIVE,
4385 .node = WREPL_NODE_B,
4386 .is_static = false,
4387 .num_ips = 0,
4388 .ips = NULL,
4389 .apply_expected = false,
4393 * sgroup,active vs. sgroup,active different addresses, special case...
4394 * => should be merged
4397 .line = __location__,
4398 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4399 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4_OWNER_B => B:A_3_4_OWNER_B_X_3_4",
4400 .extra = true,
4401 .r1 = {
4402 .owner = &ctx->a,
4403 .type = WREPL_TYPE_SGROUP,
4404 .state = WREPL_STATE_ACTIVE,
4405 .node = WREPL_NODE_B,
4406 .is_static = false,
4407 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4408 .ips = addresses_A_3_4_X_3_4,
4409 .apply_expected = true,
4411 .r2 = {
4412 .owner = &ctx->b,
4413 .type = WREPL_TYPE_SGROUP,
4414 .state = WREPL_STATE_ACTIVE,
4415 .node = WREPL_NODE_B,
4416 .is_static = false,
4417 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4418 .ips = addresses_A_3_4_OWNER_B,
4419 .sgroup_merge = true,
4420 .merge_owner = &ctx->b,
4424 .line = __location__,
4425 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4426 .cleanup= true,
4427 .r1 = {
4428 .owner = &ctx->b,
4429 .type = WREPL_TYPE_SGROUP,
4430 .state = WREPL_STATE_ACTIVE,
4431 .node = WREPL_NODE_B,
4432 .is_static = false,
4433 .num_ips = 0,
4434 .ips = NULL,
4435 .apply_expected = false,
4437 .r2 = {
4438 .owner = &ctx->x,
4439 .type = WREPL_TYPE_SGROUP,
4440 .state = WREPL_STATE_ACTIVE,
4441 .node = WREPL_NODE_B,
4442 .is_static = false,
4443 .num_ips = 0,
4444 .ips = NULL,
4445 .apply_expected = false,
4449 * sgroup,active vs. sgroup,active partly different addresses, special case...
4450 * => should be merged
4453 .line = __location__,
4454 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4455 .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",
4456 .extra = true,
4457 .r1 = {
4458 .owner = &ctx->a,
4459 .type = WREPL_TYPE_SGROUP,
4460 .state = WREPL_STATE_ACTIVE,
4461 .node = WREPL_NODE_B,
4462 .is_static = false,
4463 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4464 .ips = addresses_B_3_4_X_3_4,
4465 .apply_expected = true,
4467 .r2 = {
4468 .owner = &ctx->b,
4469 .type = WREPL_TYPE_SGROUP,
4470 .state = WREPL_STATE_ACTIVE,
4471 .node = WREPL_NODE_B,
4472 .is_static = false,
4473 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_1_2),
4474 .ips = addresses_B_3_4_X_1_2,
4475 .sgroup_merge = true,
4476 .sgroup_cleanup = false
4480 .line = __location__,
4481 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4482 .cleanup= true,
4483 .r1 = {
4484 .owner = &ctx->b,
4485 .type = WREPL_TYPE_SGROUP,
4486 .state = WREPL_STATE_ACTIVE,
4487 .node = WREPL_NODE_B,
4488 .is_static = false,
4489 .num_ips = 0,
4490 .ips = NULL,
4491 .apply_expected = false,
4493 .r2 = {
4494 .owner = &ctx->x,
4495 .type = WREPL_TYPE_SGROUP,
4496 .state = WREPL_STATE_ACTIVE,
4497 .node = WREPL_NODE_B,
4498 .is_static = false,
4499 .num_ips = 0,
4500 .ips = NULL,
4501 .apply_expected = false,
4505 * sgroup,active vs. sgroup,active different addresses, special case...
4506 * => should be merged
4509 .line = __location__,
4510 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4511 .comment= "A:A_3_4_B_3_4 vs. B:NULL => B:A_3_4",
4512 .extra = true,
4513 .r1 = {
4514 .owner = &ctx->a,
4515 .type = WREPL_TYPE_SGROUP,
4516 .state = WREPL_STATE_ACTIVE,
4517 .node = WREPL_NODE_B,
4518 .is_static = false,
4519 .num_ips = ARRAY_SIZE(addresses_A_3_4_B_3_4),
4520 .ips = addresses_A_3_4_B_3_4,
4521 .apply_expected = true,
4523 .r2 = {
4524 .owner = &ctx->b,
4525 .type = WREPL_TYPE_SGROUP,
4526 .state = WREPL_STATE_ACTIVE,
4527 .node = WREPL_NODE_B,
4528 .is_static = false,
4529 .num_ips = 0,
4530 .ips = NULL,
4531 .sgroup_merge = true,
4532 .merge_owner = &ctx->b,
4533 .sgroup_cleanup = true
4537 .line = __location__,
4538 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4539 .cleanup= true,
4540 .r1 = {
4541 .owner = &ctx->a,
4542 .type = WREPL_TYPE_SGROUP,
4543 .state = WREPL_STATE_ACTIVE,
4544 .node = WREPL_NODE_B,
4545 .is_static = false,
4546 .num_ips = 0,
4547 .ips = NULL,
4548 .apply_expected = false,
4550 .r2 = {
4551 .owner = &ctx->a,
4552 .type = WREPL_TYPE_UNIQUE,
4553 .state = WREPL_STATE_TOMBSTONE,
4554 .node = WREPL_NODE_B,
4555 .is_static = false,
4556 .num_ips = ARRAY_SIZE(addresses_A_1),
4557 .ips = addresses_A_1,
4558 .apply_expected = true,
4562 * sgroup,active vs. sgroup,active different addresses, special case...
4563 * => should be merged
4566 .line = __location__,
4567 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4568 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:X_3_4",
4569 .extra = true,
4570 .r1 = {
4571 .owner = &ctx->a,
4572 .type = WREPL_TYPE_SGROUP,
4573 .state = WREPL_STATE_ACTIVE,
4574 .node = WREPL_NODE_B,
4575 .is_static = false,
4576 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4577 .ips = addresses_B_3_4_X_3_4,
4578 .apply_expected = true,
4580 .r2 = {
4581 .owner = &ctx->b,
4582 .type = WREPL_TYPE_SGROUP,
4583 .state = WREPL_STATE_ACTIVE,
4584 .node = WREPL_NODE_B,
4585 .is_static = false,
4586 .num_ips = 0,
4587 .ips = NULL,
4588 .sgroup_merge = true,
4589 .merge_owner = &ctx->b,
4590 .sgroup_cleanup = true
4594 .line = __location__,
4595 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4596 .cleanup= true,
4597 .r1 = {
4598 .owner = &ctx->x,
4599 .type = WREPL_TYPE_SGROUP,
4600 .state = WREPL_STATE_ACTIVE,
4601 .node = WREPL_NODE_B,
4602 .is_static = false,
4603 .num_ips = 0,
4604 .ips = NULL,
4605 .apply_expected = false,
4607 .r2 = {
4608 .owner = &ctx->x,
4609 .type = WREPL_TYPE_UNIQUE,
4610 .state = WREPL_STATE_TOMBSTONE,
4611 .node = WREPL_NODE_B,
4612 .is_static = false,
4613 .num_ips = ARRAY_SIZE(addresses_A_1),
4614 .ips = addresses_A_1,
4615 .apply_expected = true,
4620 * sgroup,active vs. sgroup,tombstone different no addresses, special
4621 * => should be replaced
4624 .line = __location__,
4625 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4626 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:NULL",
4627 .extra = true,
4628 .r1 = {
4629 .owner = &ctx->a,
4630 .type = WREPL_TYPE_SGROUP,
4631 .state = WREPL_STATE_ACTIVE,
4632 .node = WREPL_NODE_B,
4633 .is_static = false,
4634 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4635 .ips = addresses_B_3_4_X_3_4,
4636 .apply_expected = true,
4638 .r2 = {
4639 .owner = &ctx->b,
4640 .type = WREPL_TYPE_SGROUP,
4641 .state = WREPL_STATE_TOMBSTONE,
4642 .node = WREPL_NODE_B,
4643 .is_static = false,
4644 .num_ips = 0,
4645 .ips = NULL,
4646 .apply_expected = true,
4650 * sgroup,active vs. sgroup,tombstone different addresses
4651 * => should be replaced
4654 .line = __location__,
4655 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4656 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4",
4657 .extra = true,
4658 .r1 = {
4659 .owner = &ctx->a,
4660 .type = WREPL_TYPE_SGROUP,
4661 .state = WREPL_STATE_ACTIVE,
4662 .node = WREPL_NODE_B,
4663 .is_static = false,
4664 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4665 .ips = addresses_B_3_4_X_3_4,
4666 .apply_expected = true,
4668 .r2 = {
4669 .owner = &ctx->b,
4670 .type = WREPL_TYPE_SGROUP,
4671 .state = WREPL_STATE_TOMBSTONE,
4672 .node = WREPL_NODE_B,
4673 .is_static = false,
4674 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4675 .ips = addresses_A_3_4,
4676 .apply_expected = true,
4680 * sgroup,active vs. sgroup,tombstone subset addresses
4681 * => should be replaced
4684 .line = __location__,
4685 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4686 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4 => B:B_3_4",
4687 .extra = true,
4688 .r1 = {
4689 .owner = &ctx->a,
4690 .type = WREPL_TYPE_SGROUP,
4691 .state = WREPL_STATE_ACTIVE,
4692 .node = WREPL_NODE_B,
4693 .is_static = false,
4694 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4695 .ips = addresses_B_3_4_X_3_4,
4696 .apply_expected = true,
4698 .r2 = {
4699 .owner = &ctx->b,
4700 .type = WREPL_TYPE_SGROUP,
4701 .state = WREPL_STATE_TOMBSTONE,
4702 .node = WREPL_NODE_B,
4703 .is_static = false,
4704 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4705 .ips = addresses_B_3_4,
4706 .apply_expected = true,
4710 * sgroup,active vs. sgroup,active same addresses
4711 * => should be replaced
4714 .line = __location__,
4715 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4716 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4_X_3_4 => B:B_3_4_X_3_4",
4717 .extra = true,
4718 .r1 = {
4719 .owner = &ctx->a,
4720 .type = WREPL_TYPE_SGROUP,
4721 .state = WREPL_STATE_ACTIVE,
4722 .node = WREPL_NODE_B,
4723 .is_static = false,
4724 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4725 .ips = addresses_B_3_4_X_3_4,
4726 .apply_expected = true,
4728 .r2 = {
4729 .owner = &ctx->b,
4730 .type = WREPL_TYPE_SGROUP,
4731 .state = WREPL_STATE_TOMBSTONE,
4732 .node = WREPL_NODE_B,
4733 .is_static = false,
4734 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4735 .ips = addresses_B_3_4_X_3_4,
4736 .apply_expected = true,
4741 * This should be the last record in this array,
4742 * we need to make sure the we leave a tombstoned unique entry
4743 * owned by OWNER_A
4746 .line = __location__,
4747 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4748 .cleanup= true,
4749 .r1 = {
4750 .owner = &ctx->a,
4751 .type = WREPL_TYPE_UNIQUE,
4752 .state = WREPL_STATE_TOMBSTONE,
4753 .node = WREPL_NODE_B,
4754 .is_static = false,
4755 .num_ips = ARRAY_SIZE(addresses_A_1),
4756 .ips = addresses_A_1,
4757 .apply_expected = true
4759 .r2 = {
4760 .owner = &ctx->a,
4761 .type = WREPL_TYPE_UNIQUE,
4762 .state = WREPL_STATE_TOMBSTONE,
4763 .node = WREPL_NODE_B,
4764 .is_static = false,
4765 .num_ips = ARRAY_SIZE(addresses_A_1),
4766 .ips = addresses_A_1,
4767 .apply_expected = true
4769 }}; /* do not add entries here, this should be the last record! */
4771 wins_name_r1 = &wins_name1;
4772 wins_name_r2 = &wins_name2;
4774 torture_comment(tctx, "Test Replica Conflicts with different owners\n");
4776 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
4778 if (!records[i].extra && !records[i].cleanup) {
4779 /* we should test the worst cases */
4780 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
4781 torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n",
4782 __location__, i, records[i].line);
4783 return false;
4784 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
4785 torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n",
4786 __location__, i, records[i].line);
4787 return false;
4791 if (!records[i].cleanup) {
4792 const char *expected;
4793 const char *ips;
4795 if (records[i].r2.sgroup_merge) {
4796 expected = "SGROUP_MERGE";
4797 } else if (records[i].r2.apply_expected) {
4798 expected = "REPLACE";
4799 } else {
4800 expected = "NOT REPLACE";
4803 if (!records[i].r1.ips && !records[i].r2.ips) {
4804 ips = "with no ip(s)";
4805 } else if (records[i].r1.ips==records[i].r2.ips) {
4806 ips = "with same ip(s)";
4807 } else {
4808 ips = "with different ip(s)";
4811 torture_comment(tctx, "%s,%s%s vs. %s,%s%s %s => %s\n",
4812 wrepl_name_type_string(records[i].r1.type),
4813 wrepl_name_state_string(records[i].r1.state),
4814 (records[i].r1.is_static?",static":""),
4815 wrepl_name_type_string(records[i].r2.type),
4816 wrepl_name_state_string(records[i].r2.state),
4817 (records[i].r2.is_static?",static":""),
4818 (records[i].comment?records[i].comment:ips),
4819 expected);
4823 * Setup R1
4825 wins_name_r1->name = &records[i].name;
4826 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
4827 records[i].r1.state,
4828 records[i].r1.node,
4829 records[i].r1.is_static);
4830 wins_name_r1->id = ++records[i].r1.owner->max_version;
4831 if (wins_name_r1->flags & 2) {
4832 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
4833 wins_name_r1->addresses.addresses.ips = discard_const(records[i].r1.ips);
4834 } else {
4835 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
4837 wins_name_r1->unknown = "255.255.255.255";
4839 /* now apply R1 */
4840 ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1);
4841 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4842 wins_name_r1, records[i].r1.apply_expected);
4845 * Setup R2
4847 wins_name_r2->name = &records[i].name;
4848 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
4849 records[i].r2.state,
4850 records[i].r2.node,
4851 records[i].r2.is_static);
4852 wins_name_r2->id = ++records[i].r2.owner->max_version;
4853 if (wins_name_r2->flags & 2) {
4854 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
4855 wins_name_r2->addresses.addresses.ips = discard_const(records[i].r2.ips);
4856 } else {
4857 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
4859 wins_name_r2->unknown = "255.255.255.255";
4861 /* now apply R2 */
4862 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4863 if (records[i].r1.state == WREPL_STATE_RELEASED) {
4864 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4865 wins_name_r1, false);
4866 } else if (records[i].r2.sgroup_merge) {
4867 ret &= test_wrepl_sgroup_merged(tctx, ctx, records[i].r2.merge_owner,
4868 records[i].r1.owner,
4869 records[i].r1.num_ips, records[i].r1.ips,
4870 records[i].r2.owner,
4871 records[i].r2.num_ips, records[i].r2.ips,
4872 wins_name_r2);
4873 } else if (records[i].r1.owner != records[i].r2.owner) {
4874 bool _expected;
4875 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
4876 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4877 wins_name_r1, _expected);
4879 if (records[i].r2.state == WREPL_STATE_RELEASED) {
4880 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner,
4881 wins_name_r2, false);
4882 } else if (!records[i].r2.sgroup_merge) {
4883 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner,
4884 wins_name_r2, records[i].r2.apply_expected);
4887 if (records[i].r2.sgroup_cleanup) {
4888 if (!ret) {
4889 torture_comment(tctx, "failed before sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4890 return ret;
4893 /* clean up the SGROUP record */
4894 wins_name_r1->name = &records[i].name;
4895 wins_name_r1->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4896 WREPL_STATE_ACTIVE,
4897 WREPL_NODE_B, false);
4898 wins_name_r1->id = ++records[i].r1.owner->max_version;
4899 wins_name_r1->addresses.addresses.num_ips = 0;
4900 wins_name_r1->addresses.addresses.ips = NULL;
4901 wins_name_r1->unknown = "255.255.255.255";
4902 ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1);
4904 /* here we test how names from an owner are deleted */
4905 if (records[i].r2.sgroup_merge && records[i].r2.num_ips) {
4906 ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL,
4907 records[i].r2.owner,
4908 records[i].r2.num_ips, records[i].r2.ips,
4909 records[i].r1.owner,
4910 0, NULL,
4911 wins_name_r2);
4914 /* clean up the SGROUP record */
4915 wins_name_r2->name = &records[i].name;
4916 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4917 WREPL_STATE_ACTIVE,
4918 WREPL_NODE_B, false);
4919 wins_name_r2->id = ++records[i].r2.owner->max_version;
4920 wins_name_r2->addresses.addresses.num_ips = 0;
4921 wins_name_r2->addresses.addresses.ips = NULL;
4922 wins_name_r2->unknown = "255.255.255.255";
4923 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4925 /* take ownership of the SGROUP record */
4926 wins_name_r2->name = &records[i].name;
4927 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4928 WREPL_STATE_ACTIVE,
4929 WREPL_NODE_B, false);
4930 wins_name_r2->id = ++records[i].r2.owner->max_version;
4931 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4932 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4933 wins_name_r2->unknown = "255.255.255.255";
4934 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4935 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true);
4937 /* overwrite the SGROUP record with unique,tombstone */
4938 wins_name_r2->name = &records[i].name;
4939 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4940 WREPL_STATE_TOMBSTONE,
4941 WREPL_NODE_B, false);
4942 wins_name_r2->id = ++records[i].r2.owner->max_version;
4943 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4944 wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1);
4945 wins_name_r2->unknown = "255.255.255.255";
4946 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4947 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true);
4949 if (!ret) {
4950 torture_comment(tctx, "failed in sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4951 return ret;
4955 /* the first one is a cleanup run */
4956 if (!ret && i == 0) ret = true;
4958 if (!ret) {
4959 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
4960 return ret;
4964 return ret;
4967 static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx,
4968 struct test_wrepl_conflict_conn *ctx)
4970 bool ret = true;
4971 NTSTATUS status;
4972 struct wrepl_wins_name wins_name_;
4973 struct wrepl_wins_name *wins_name = &wins_name_;
4974 struct nbt_name_register name_register_;
4975 struct nbt_name_register *name_register = &name_register_;
4976 struct nbt_name_release release_;
4977 struct nbt_name_release *release = &release_;
4978 uint32_t i;
4979 struct {
4980 const char *line; /* just better debugging */
4981 struct nbt_name name;
4982 struct {
4983 uint32_t nb_flags;
4984 bool mhomed;
4985 uint32_t num_ips;
4986 const struct wrepl_ip *ips;
4987 bool apply_expected;
4988 } wins;
4989 struct {
4990 enum wrepl_name_type type;
4991 enum wrepl_name_state state;
4992 enum wrepl_name_node node;
4993 bool is_static;
4994 uint32_t num_ips;
4995 const struct wrepl_ip *ips;
4996 bool apply_expected;
4997 } replica;
4998 } records[] = {
5000 * unique vs. unique section
5003 * unique,released vs. unique,active with same ip(s)
5006 .line = __location__,
5007 .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL),
5008 .wins = {
5009 .nb_flags = 0,
5010 .mhomed = false,
5011 .num_ips = ctx->addresses_best_num,
5012 .ips = ctx->addresses_best,
5013 .apply_expected = true
5015 .replica= {
5016 .type = WREPL_TYPE_UNIQUE,
5017 .state = WREPL_STATE_ACTIVE,
5018 .node = WREPL_NODE_B,
5019 .is_static = false,
5020 .num_ips = ctx->addresses_best_num,
5021 .ips = ctx->addresses_best,
5022 .apply_expected = true
5026 * unique,released vs. unique,active with different ip(s)
5029 .line = __location__,
5030 .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL),
5031 .wins = {
5032 .nb_flags = 0,
5033 .mhomed = false,
5034 .num_ips = ctx->addresses_best_num,
5035 .ips = ctx->addresses_best,
5036 .apply_expected = true
5038 .replica= {
5039 .type = WREPL_TYPE_UNIQUE,
5040 .state = WREPL_STATE_ACTIVE,
5041 .node = WREPL_NODE_B,
5042 .is_static = false,
5043 .num_ips = ARRAY_SIZE(addresses_B_1),
5044 .ips = addresses_B_1,
5045 .apply_expected = true
5049 * unique,released vs. unique,tombstone with same ip(s)
5052 .line = __location__,
5053 .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL),
5054 .wins = {
5055 .nb_flags = 0,
5056 .mhomed = false,
5057 .num_ips = ctx->addresses_best_num,
5058 .ips = ctx->addresses_best,
5059 .apply_expected = true
5061 .replica= {
5062 .type = WREPL_TYPE_UNIQUE,
5063 .state = WREPL_STATE_TOMBSTONE,
5064 .node = WREPL_NODE_B,
5065 .is_static = false,
5066 .num_ips = ctx->addresses_best_num,
5067 .ips = ctx->addresses_best,
5068 .apply_expected = true
5072 * unique,released vs. unique,tombstone with different ip(s)
5075 .line = __location__,
5076 .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL),
5077 .wins = {
5078 .nb_flags = 0,
5079 .mhomed = false,
5080 .num_ips = ctx->addresses_best_num,
5081 .ips = ctx->addresses_best,
5082 .apply_expected = true
5084 .replica= {
5085 .type = WREPL_TYPE_UNIQUE,
5086 .state = WREPL_STATE_TOMBSTONE,
5087 .node = WREPL_NODE_B,
5088 .is_static = false,
5089 .num_ips = ARRAY_SIZE(addresses_B_1),
5090 .ips = addresses_B_1,
5091 .apply_expected = true
5095 * unique vs. group section
5098 * unique,released vs. group,active with same ip(s)
5101 .line = __location__,
5102 .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL),
5103 .wins = {
5104 .nb_flags = 0,
5105 .mhomed = false,
5106 .num_ips = ctx->addresses_best_num,
5107 .ips = ctx->addresses_best,
5108 .apply_expected = true
5110 .replica= {
5111 .type = WREPL_TYPE_GROUP,
5112 .state = WREPL_STATE_ACTIVE,
5113 .node = WREPL_NODE_B,
5114 .is_static = false,
5115 .num_ips = ctx->addresses_best_num,
5116 .ips = ctx->addresses_best,
5117 .apply_expected = true
5121 * unique,released vs. group,active with different ip(s)
5124 .line = __location__,
5125 .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL),
5126 .wins = {
5127 .nb_flags = 0,
5128 .mhomed = false,
5129 .num_ips = ctx->addresses_best_num,
5130 .ips = ctx->addresses_best,
5131 .apply_expected = true
5133 .replica= {
5134 .type = WREPL_TYPE_GROUP,
5135 .state = WREPL_STATE_ACTIVE,
5136 .node = WREPL_NODE_B,
5137 .is_static = false,
5138 .num_ips = ARRAY_SIZE(addresses_B_1),
5139 .ips = addresses_B_1,
5140 .apply_expected = true
5144 * unique,released vs. group,tombstone with same ip(s)
5147 .line = __location__,
5148 .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL),
5149 .wins = {
5150 .nb_flags = 0,
5151 .mhomed = false,
5152 .num_ips = ctx->addresses_best_num,
5153 .ips = ctx->addresses_best,
5154 .apply_expected = true
5156 .replica= {
5157 .type = WREPL_TYPE_GROUP,
5158 .state = WREPL_STATE_TOMBSTONE,
5159 .node = WREPL_NODE_B,
5160 .is_static = false,
5161 .num_ips = ctx->addresses_best_num,
5162 .ips = ctx->addresses_best,
5163 .apply_expected = true
5167 * unique,released vs. group,tombstone with different ip(s)
5170 .line = __location__,
5171 .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL),
5172 .wins = {
5173 .nb_flags = 0,
5174 .mhomed = false,
5175 .num_ips = ctx->addresses_best_num,
5176 .ips = ctx->addresses_best,
5177 .apply_expected = true
5179 .replica= {
5180 .type = WREPL_TYPE_GROUP,
5181 .state = WREPL_STATE_TOMBSTONE,
5182 .node = WREPL_NODE_B,
5183 .is_static = false,
5184 .num_ips = ARRAY_SIZE(addresses_B_1),
5185 .ips = addresses_B_1,
5186 .apply_expected = true
5190 * unique vs. special group section
5193 * unique,released vs. sgroup,active with same ip(s)
5196 .line = __location__,
5197 .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL),
5198 .wins = {
5199 .nb_flags = 0,
5200 .mhomed = false,
5201 .num_ips = ctx->addresses_best_num,
5202 .ips = ctx->addresses_best,
5203 .apply_expected = true
5205 .replica= {
5206 .type = WREPL_TYPE_SGROUP,
5207 .state = WREPL_STATE_ACTIVE,
5208 .node = WREPL_NODE_B,
5209 .is_static = false,
5210 .num_ips = ctx->addresses_best_num,
5211 .ips = ctx->addresses_best,
5212 .apply_expected = true
5216 * unique,released vs. sgroup,active with different ip(s)
5219 .line = __location__,
5220 .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL),
5221 .wins = {
5222 .nb_flags = 0,
5223 .mhomed = false,
5224 .num_ips = ctx->addresses_best_num,
5225 .ips = ctx->addresses_best,
5226 .apply_expected = true
5228 .replica= {
5229 .type = WREPL_TYPE_SGROUP,
5230 .state = WREPL_STATE_ACTIVE,
5231 .node = WREPL_NODE_B,
5232 .is_static = false,
5233 .num_ips = ARRAY_SIZE(addresses_B_1),
5234 .ips = addresses_B_1,
5235 .apply_expected = true
5239 * unique,released vs. sgroup,tombstone with same ip(s)
5242 .line = __location__,
5243 .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL),
5244 .wins = {
5245 .nb_flags = 0,
5246 .mhomed = false,
5247 .num_ips = ctx->addresses_best_num,
5248 .ips = ctx->addresses_best,
5249 .apply_expected = true
5251 .replica= {
5252 .type = WREPL_TYPE_SGROUP,
5253 .state = WREPL_STATE_TOMBSTONE,
5254 .node = WREPL_NODE_B,
5255 .is_static = false,
5256 .num_ips = ctx->addresses_best_num,
5257 .ips = ctx->addresses_best,
5258 .apply_expected = true
5262 * unique,released vs. sgroup,tombstone with different ip(s)
5265 .line = __location__,
5266 .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL),
5267 .wins = {
5268 .nb_flags = 0,
5269 .mhomed = false,
5270 .num_ips = ctx->addresses_best_num,
5271 .ips = ctx->addresses_best,
5272 .apply_expected = true
5274 .replica= {
5275 .type = WREPL_TYPE_SGROUP,
5276 .state = WREPL_STATE_TOMBSTONE,
5277 .node = WREPL_NODE_B,
5278 .is_static = false,
5279 .num_ips = ARRAY_SIZE(addresses_B_1),
5280 .ips = addresses_B_1,
5281 .apply_expected = true
5285 * unique vs. multi homed section
5288 * unique,released vs. mhomed,active with same ip(s)
5291 .line = __location__,
5292 .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL),
5293 .wins = {
5294 .nb_flags = 0,
5295 .mhomed = false,
5296 .num_ips = ctx->addresses_best_num,
5297 .ips = ctx->addresses_best,
5298 .apply_expected = true
5300 .replica= {
5301 .type = WREPL_TYPE_MHOMED,
5302 .state = WREPL_STATE_ACTIVE,
5303 .node = WREPL_NODE_B,
5304 .is_static = false,
5305 .num_ips = ctx->addresses_best_num,
5306 .ips = ctx->addresses_best,
5307 .apply_expected = true
5311 * unique,released vs. mhomed,active with different ip(s)
5314 .line = __location__,
5315 .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL),
5316 .wins = {
5317 .nb_flags = 0,
5318 .mhomed = false,
5319 .num_ips = ctx->addresses_best_num,
5320 .ips = ctx->addresses_best,
5321 .apply_expected = true
5323 .replica= {
5324 .type = WREPL_TYPE_MHOMED,
5325 .state = WREPL_STATE_ACTIVE,
5326 .node = WREPL_NODE_B,
5327 .is_static = false,
5328 .num_ips = ARRAY_SIZE(addresses_B_1),
5329 .ips = addresses_B_1,
5330 .apply_expected = true
5334 * unique,released vs. mhomed,tombstone with same ip(s)
5337 .line = __location__,
5338 .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL),
5339 .wins = {
5340 .nb_flags = 0,
5341 .mhomed = false,
5342 .num_ips = ctx->addresses_best_num,
5343 .ips = ctx->addresses_best,
5344 .apply_expected = true
5346 .replica= {
5347 .type = WREPL_TYPE_MHOMED,
5348 .state = WREPL_STATE_TOMBSTONE,
5349 .node = WREPL_NODE_B,
5350 .is_static = false,
5351 .num_ips = ctx->addresses_best_num,
5352 .ips = ctx->addresses_best,
5353 .apply_expected = true
5357 * unique,released vs. mhomed,tombstone with different ip(s)
5360 .line = __location__,
5361 .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL),
5362 .wins = {
5363 .nb_flags = 0,
5364 .mhomed = false,
5365 .num_ips = ctx->addresses_best_num,
5366 .ips = ctx->addresses_best,
5367 .apply_expected = true
5369 .replica= {
5370 .type = WREPL_TYPE_MHOMED,
5371 .state = WREPL_STATE_TOMBSTONE,
5372 .node = WREPL_NODE_B,
5373 .is_static = false,
5374 .num_ips = ARRAY_SIZE(addresses_B_1),
5375 .ips = addresses_B_1,
5376 .apply_expected = true
5380 * group vs. unique section
5383 * group,released vs. unique,active with same ip(s)
5386 .line = __location__,
5387 .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL),
5388 .wins = {
5389 .nb_flags = NBT_NM_GROUP,
5390 .mhomed = false,
5391 .num_ips = ctx->addresses_best_num,
5392 .ips = ctx->addresses_best,
5393 .apply_expected = true
5395 .replica= {
5396 .type = WREPL_TYPE_UNIQUE,
5397 .state = WREPL_STATE_ACTIVE,
5398 .node = WREPL_NODE_B,
5399 .is_static = false,
5400 .num_ips = ctx->addresses_best_num,
5401 .ips = ctx->addresses_best,
5402 .apply_expected = false
5406 * group,released vs. unique,active with different ip(s)
5409 .line = __location__,
5410 .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL),
5411 .wins = {
5412 .nb_flags = NBT_NM_GROUP,
5413 .mhomed = false,
5414 .num_ips = ctx->addresses_best_num,
5415 .ips = ctx->addresses_best,
5416 .apply_expected = true
5418 .replica= {
5419 .type = WREPL_TYPE_UNIQUE,
5420 .state = WREPL_STATE_ACTIVE,
5421 .node = WREPL_NODE_B,
5422 .is_static = false,
5423 .num_ips = ARRAY_SIZE(addresses_B_1),
5424 .ips = addresses_B_1,
5425 .apply_expected = false
5429 * group,released vs. unique,tombstone with same ip(s)
5432 .line = __location__,
5433 .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL),
5434 .wins = {
5435 .nb_flags = NBT_NM_GROUP,
5436 .mhomed = false,
5437 .num_ips = ctx->addresses_best_num,
5438 .ips = ctx->addresses_best,
5439 .apply_expected = true
5441 .replica= {
5442 .type = WREPL_TYPE_UNIQUE,
5443 .state = WREPL_STATE_TOMBSTONE,
5444 .node = WREPL_NODE_B,
5445 .is_static = false,
5446 .num_ips = ctx->addresses_best_num,
5447 .ips = ctx->addresses_best,
5448 .apply_expected = false
5452 * group,released vs. unique,tombstone with different ip(s)
5455 .line = __location__,
5456 .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL),
5457 .wins = {
5458 .nb_flags = NBT_NM_GROUP,
5459 .mhomed = false,
5460 .num_ips = ctx->addresses_best_num,
5461 .ips = ctx->addresses_best,
5462 .apply_expected = true
5464 .replica= {
5465 .type = WREPL_TYPE_UNIQUE,
5466 .state = WREPL_STATE_TOMBSTONE,
5467 .node = WREPL_NODE_B,
5468 .is_static = false,
5469 .num_ips = ARRAY_SIZE(addresses_B_1),
5470 .ips = addresses_B_1,
5471 .apply_expected = false
5475 * group vs. group section
5478 * group,released vs. group,active with same ip(s)
5481 .line = __location__,
5482 .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL),
5483 .wins = {
5484 .nb_flags = NBT_NM_GROUP,
5485 .mhomed = false,
5486 .num_ips = ctx->addresses_best_num,
5487 .ips = ctx->addresses_best,
5488 .apply_expected = true
5490 .replica= {
5491 .type = WREPL_TYPE_GROUP,
5492 .state = WREPL_STATE_ACTIVE,
5493 .node = WREPL_NODE_B,
5494 .is_static = false,
5495 .num_ips = ctx->addresses_best_num,
5496 .ips = ctx->addresses_best,
5497 .apply_expected = true
5501 * group,released vs. group,active with different ip(s)
5504 .line = __location__,
5505 .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL),
5506 .wins = {
5507 .nb_flags = NBT_NM_GROUP,
5508 .mhomed = false,
5509 .num_ips = ctx->addresses_best_num,
5510 .ips = ctx->addresses_best,
5511 .apply_expected = true
5513 .replica= {
5514 .type = WREPL_TYPE_GROUP,
5515 .state = WREPL_STATE_ACTIVE,
5516 .node = WREPL_NODE_B,
5517 .is_static = false,
5518 .num_ips = ARRAY_SIZE(addresses_B_1),
5519 .ips = addresses_B_1,
5520 .apply_expected = true
5524 * group,released vs. group,tombstone with same ip(s)
5527 .line = __location__,
5528 .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL),
5529 .wins = {
5530 .nb_flags = NBT_NM_GROUP,
5531 .mhomed = false,
5532 .num_ips = ctx->addresses_best_num,
5533 .ips = ctx->addresses_best,
5534 .apply_expected = true
5536 .replica= {
5537 .type = WREPL_TYPE_GROUP,
5538 .state = WREPL_STATE_TOMBSTONE,
5539 .node = WREPL_NODE_B,
5540 .is_static = false,
5541 .num_ips = ctx->addresses_best_num,
5542 .ips = ctx->addresses_best,
5543 .apply_expected = true
5547 * group,released vs. group,tombstone with different ip(s)
5550 .line = __location__,
5551 .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL),
5552 .wins = {
5553 .nb_flags = NBT_NM_GROUP,
5554 .mhomed = false,
5555 .num_ips = ctx->addresses_best_num,
5556 .ips = ctx->addresses_best,
5557 .apply_expected = true
5559 .replica= {
5560 .type = WREPL_TYPE_GROUP,
5561 .state = WREPL_STATE_TOMBSTONE,
5562 .node = WREPL_NODE_B,
5563 .is_static = false,
5564 .num_ips = ARRAY_SIZE(addresses_B_1),
5565 .ips = addresses_B_1,
5566 .apply_expected = true
5570 * group vs. special group section
5573 * group,released vs. sgroup,active with same ip(s)
5576 .line = __location__,
5577 .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL),
5578 .wins = {
5579 .nb_flags = NBT_NM_GROUP,
5580 .mhomed = false,
5581 .num_ips = ctx->addresses_best_num,
5582 .ips = ctx->addresses_best,
5583 .apply_expected = true
5585 .replica= {
5586 .type = WREPL_TYPE_SGROUP,
5587 .state = WREPL_STATE_ACTIVE,
5588 .node = WREPL_NODE_B,
5589 .is_static = false,
5590 .num_ips = ctx->addresses_best_num,
5591 .ips = ctx->addresses_best,
5592 .apply_expected = false
5596 * group,released vs. sgroup,active with different ip(s)
5599 .line = __location__,
5600 .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL),
5601 .wins = {
5602 .nb_flags = NBT_NM_GROUP,
5603 .mhomed = false,
5604 .num_ips = ctx->addresses_best_num,
5605 .ips = ctx->addresses_best,
5606 .apply_expected = true
5608 .replica= {
5609 .type = WREPL_TYPE_SGROUP,
5610 .state = WREPL_STATE_ACTIVE,
5611 .node = WREPL_NODE_B,
5612 .is_static = false,
5613 .num_ips = ARRAY_SIZE(addresses_B_1),
5614 .ips = addresses_B_1,
5615 .apply_expected = false
5619 * group,released vs. sgroup,tombstone with same ip(s)
5622 .line = __location__,
5623 .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL),
5624 .wins = {
5625 .nb_flags = NBT_NM_GROUP,
5626 .mhomed = false,
5627 .num_ips = ctx->addresses_best_num,
5628 .ips = ctx->addresses_best,
5629 .apply_expected = true
5631 .replica= {
5632 .type = WREPL_TYPE_SGROUP,
5633 .state = WREPL_STATE_TOMBSTONE,
5634 .node = WREPL_NODE_B,
5635 .is_static = false,
5636 .num_ips = ctx->addresses_best_num,
5637 .ips = ctx->addresses_best,
5638 .apply_expected = false
5642 * group,released vs. sgroup,tombstone with different ip(s)
5645 .line = __location__,
5646 .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL),
5647 .wins = {
5648 .nb_flags = NBT_NM_GROUP,
5649 .mhomed = false,
5650 .num_ips = ctx->addresses_best_num,
5651 .ips = ctx->addresses_best,
5652 .apply_expected = true
5654 .replica= {
5655 .type = WREPL_TYPE_SGROUP,
5656 .state = WREPL_STATE_TOMBSTONE,
5657 .node = WREPL_NODE_B,
5658 .is_static = false,
5659 .num_ips = ARRAY_SIZE(addresses_B_1),
5660 .ips = addresses_B_1,
5661 .apply_expected = false
5665 * group vs. multi homed section
5668 * group,released vs. mhomed,active with same ip(s)
5671 .line = __location__,
5672 .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL),
5673 .wins = {
5674 .nb_flags = NBT_NM_GROUP,
5675 .mhomed = false,
5676 .num_ips = ctx->addresses_best_num,
5677 .ips = ctx->addresses_best,
5678 .apply_expected = true
5680 .replica= {
5681 .type = WREPL_TYPE_MHOMED,
5682 .state = WREPL_STATE_ACTIVE,
5683 .node = WREPL_NODE_B,
5684 .is_static = false,
5685 .num_ips = ctx->addresses_best_num,
5686 .ips = ctx->addresses_best,
5687 .apply_expected = false
5691 * group,released vs. mhomed,active with different ip(s)
5694 .line = __location__,
5695 .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL),
5696 .wins = {
5697 .nb_flags = NBT_NM_GROUP,
5698 .mhomed = false,
5699 .num_ips = ctx->addresses_best_num,
5700 .ips = ctx->addresses_best,
5701 .apply_expected = true
5703 .replica= {
5704 .type = WREPL_TYPE_MHOMED,
5705 .state = WREPL_STATE_ACTIVE,
5706 .node = WREPL_NODE_B,
5707 .is_static = false,
5708 .num_ips = ARRAY_SIZE(addresses_B_1),
5709 .ips = addresses_B_1,
5710 .apply_expected = false
5714 * group,released vs. mhomed,tombstone with same ip(s)
5717 .line = __location__,
5718 .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL),
5719 .wins = {
5720 .nb_flags = NBT_NM_GROUP,
5721 .mhomed = false,
5722 .num_ips = ctx->addresses_best_num,
5723 .ips = ctx->addresses_best,
5724 .apply_expected = true
5726 .replica= {
5727 .type = WREPL_TYPE_MHOMED,
5728 .state = WREPL_STATE_TOMBSTONE,
5729 .node = WREPL_NODE_B,
5730 .is_static = false,
5731 .num_ips = ctx->addresses_best_num,
5732 .ips = ctx->addresses_best,
5733 .apply_expected = false
5737 * group,released vs. mhomed,tombstone with different ip(s)
5740 .line = __location__,
5741 .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL),
5742 .wins = {
5743 .nb_flags = NBT_NM_GROUP,
5744 .mhomed = false,
5745 .num_ips = ctx->addresses_best_num,
5746 .ips = ctx->addresses_best,
5747 .apply_expected = true
5749 .replica= {
5750 .type = WREPL_TYPE_MHOMED,
5751 .state = WREPL_STATE_TOMBSTONE,
5752 .node = WREPL_NODE_B,
5753 .is_static = false,
5754 .num_ips = ARRAY_SIZE(addresses_B_1),
5755 .ips = addresses_B_1,
5756 .apply_expected = false
5760 * special group vs. unique section
5763 * sgroup,released vs. unique,active with same ip(s)
5766 .line = __location__,
5767 .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL),
5768 .wins = {
5769 .nb_flags = NBT_NM_GROUP,
5770 .mhomed = false,
5771 .num_ips = ctx->addresses_best_num,
5772 .ips = ctx->addresses_best,
5773 .apply_expected = true
5775 .replica= {
5776 .type = WREPL_TYPE_UNIQUE,
5777 .state = WREPL_STATE_ACTIVE,
5778 .node = WREPL_NODE_B,
5779 .is_static = false,
5780 .num_ips = ctx->addresses_best_num,
5781 .ips = ctx->addresses_best,
5782 .apply_expected = true
5786 * sgroup,released vs. unique,active with different ip(s)
5789 .line = __location__,
5790 .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL),
5791 .wins = {
5792 .nb_flags = NBT_NM_GROUP,
5793 .mhomed = false,
5794 .num_ips = ctx->addresses_best_num,
5795 .ips = ctx->addresses_best,
5796 .apply_expected = true
5798 .replica= {
5799 .type = WREPL_TYPE_UNIQUE,
5800 .state = WREPL_STATE_ACTIVE,
5801 .node = WREPL_NODE_B,
5802 .is_static = false,
5803 .num_ips = ARRAY_SIZE(addresses_B_1),
5804 .ips = addresses_B_1,
5805 .apply_expected = true
5809 * sgroup,released vs. unique,tombstone with same ip(s)
5812 .line = __location__,
5813 .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL),
5814 .wins = {
5815 .nb_flags = NBT_NM_GROUP,
5816 .mhomed = false,
5817 .num_ips = ctx->addresses_best_num,
5818 .ips = ctx->addresses_best,
5819 .apply_expected = true
5821 .replica= {
5822 .type = WREPL_TYPE_UNIQUE,
5823 .state = WREPL_STATE_TOMBSTONE,
5824 .node = WREPL_NODE_B,
5825 .is_static = false,
5826 .num_ips = ctx->addresses_best_num,
5827 .ips = ctx->addresses_best,
5828 .apply_expected = true
5832 * sgroup,released vs. unique,tombstone with different ip(s)
5835 .line = __location__,
5836 .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL),
5837 .wins = {
5838 .nb_flags = NBT_NM_GROUP,
5839 .mhomed = false,
5840 .num_ips = ctx->addresses_best_num,
5841 .ips = ctx->addresses_best,
5842 .apply_expected = true
5844 .replica= {
5845 .type = WREPL_TYPE_UNIQUE,
5846 .state = WREPL_STATE_TOMBSTONE,
5847 .node = WREPL_NODE_B,
5848 .is_static = false,
5849 .num_ips = ARRAY_SIZE(addresses_B_1),
5850 .ips = addresses_B_1,
5851 .apply_expected = true
5855 * special group vs. group section
5858 * sgroup,released vs. group,active with same ip(s)
5861 .line = __location__,
5862 .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL),
5863 .wins = {
5864 .nb_flags = NBT_NM_GROUP,
5865 .mhomed = false,
5866 .num_ips = ctx->addresses_best_num,
5867 .ips = ctx->addresses_best,
5868 .apply_expected = true
5870 .replica= {
5871 .type = WREPL_TYPE_GROUP,
5872 .state = WREPL_STATE_ACTIVE,
5873 .node = WREPL_NODE_B,
5874 .is_static = false,
5875 .num_ips = ctx->addresses_best_num,
5876 .ips = ctx->addresses_best,
5877 .apply_expected = true
5881 * sgroup,released vs. group,active with different ip(s)
5884 .line = __location__,
5885 .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL),
5886 .wins = {
5887 .nb_flags = NBT_NM_GROUP,
5888 .mhomed = false,
5889 .num_ips = ctx->addresses_best_num,
5890 .ips = ctx->addresses_best,
5891 .apply_expected = true
5893 .replica= {
5894 .type = WREPL_TYPE_GROUP,
5895 .state = WREPL_STATE_ACTIVE,
5896 .node = WREPL_NODE_B,
5897 .is_static = false,
5898 .num_ips = ARRAY_SIZE(addresses_B_1),
5899 .ips = addresses_B_1,
5900 .apply_expected = true
5904 * sgroup,released vs. group,tombstone with same ip(s)
5907 .line = __location__,
5908 .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL),
5909 .wins = {
5910 .nb_flags = NBT_NM_GROUP,
5911 .mhomed = false,
5912 .num_ips = ctx->addresses_best_num,
5913 .ips = ctx->addresses_best,
5914 .apply_expected = true
5916 .replica= {
5917 .type = WREPL_TYPE_GROUP,
5918 .state = WREPL_STATE_TOMBSTONE,
5919 .node = WREPL_NODE_B,
5920 .is_static = false,
5921 .num_ips = ctx->addresses_best_num,
5922 .ips = ctx->addresses_best,
5923 .apply_expected = true
5927 * sgroup,released vs. group,tombstone with different ip(s)
5930 .line = __location__,
5931 .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL),
5932 .wins = {
5933 .nb_flags = NBT_NM_GROUP,
5934 .mhomed = false,
5935 .num_ips = ctx->addresses_best_num,
5936 .ips = ctx->addresses_best,
5937 .apply_expected = true
5939 .replica= {
5940 .type = WREPL_TYPE_GROUP,
5941 .state = WREPL_STATE_TOMBSTONE,
5942 .node = WREPL_NODE_B,
5943 .is_static = false,
5944 .num_ips = ARRAY_SIZE(addresses_B_1),
5945 .ips = addresses_B_1,
5946 .apply_expected = true
5950 * special group vs. special group section
5953 * sgroup,released vs. sgroup,active with same ip(s)
5956 .line = __location__,
5957 .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL),
5958 .wins = {
5959 .nb_flags = NBT_NM_GROUP,
5960 .mhomed = false,
5961 .num_ips = ctx->addresses_best_num,
5962 .ips = ctx->addresses_best,
5963 .apply_expected = true
5965 .replica= {
5966 .type = WREPL_TYPE_SGROUP,
5967 .state = WREPL_STATE_ACTIVE,
5968 .node = WREPL_NODE_B,
5969 .is_static = false,
5970 .num_ips = ctx->addresses_best_num,
5971 .ips = ctx->addresses_best,
5972 .apply_expected = true
5976 * sgroup,released vs. sgroup,active with different ip(s)
5979 .line = __location__,
5980 .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL),
5981 .wins = {
5982 .nb_flags = NBT_NM_GROUP,
5983 .mhomed = false,
5984 .num_ips = ctx->addresses_best_num,
5985 .ips = ctx->addresses_best,
5986 .apply_expected = true
5988 .replica= {
5989 .type = WREPL_TYPE_SGROUP,
5990 .state = WREPL_STATE_ACTIVE,
5991 .node = WREPL_NODE_B,
5992 .is_static = false,
5993 .num_ips = ARRAY_SIZE(addresses_B_1),
5994 .ips = addresses_B_1,
5995 .apply_expected = true
5999 * sgroup,released vs. sgroup,tombstone with same ip(s)
6002 .line = __location__,
6003 .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL),
6004 .wins = {
6005 .nb_flags = NBT_NM_GROUP,
6006 .mhomed = false,
6007 .num_ips = ctx->addresses_best_num,
6008 .ips = ctx->addresses_best,
6009 .apply_expected = true
6011 .replica= {
6012 .type = WREPL_TYPE_SGROUP,
6013 .state = WREPL_STATE_TOMBSTONE,
6014 .node = WREPL_NODE_B,
6015 .is_static = false,
6016 .num_ips = ctx->addresses_best_num,
6017 .ips = ctx->addresses_best,
6018 .apply_expected = true
6022 * sgroup,released vs. sgroup,tombstone with different ip(s)
6025 .line = __location__,
6026 .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL),
6027 .wins = {
6028 .nb_flags = NBT_NM_GROUP,
6029 .mhomed = false,
6030 .num_ips = ctx->addresses_best_num,
6031 .ips = ctx->addresses_best,
6032 .apply_expected = true
6034 .replica= {
6035 .type = WREPL_TYPE_SGROUP,
6036 .state = WREPL_STATE_TOMBSTONE,
6037 .node = WREPL_NODE_B,
6038 .is_static = false,
6039 .num_ips = ARRAY_SIZE(addresses_B_1),
6040 .ips = addresses_B_1,
6041 .apply_expected = true
6045 * special group vs. multi homed section
6048 * sgroup,released vs. mhomed,active with same ip(s)
6051 .line = __location__,
6052 .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL),
6053 .wins = {
6054 .nb_flags = NBT_NM_GROUP,
6055 .mhomed = false,
6056 .num_ips = ctx->addresses_best_num,
6057 .ips = ctx->addresses_best,
6058 .apply_expected = true
6060 .replica= {
6061 .type = WREPL_TYPE_MHOMED,
6062 .state = WREPL_STATE_ACTIVE,
6063 .node = WREPL_NODE_B,
6064 .is_static = false,
6065 .num_ips = ctx->addresses_best_num,
6066 .ips = ctx->addresses_best,
6067 .apply_expected = true
6071 * sgroup,released vs. mhomed,active with different ip(s)
6074 .line = __location__,
6075 .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL),
6076 .wins = {
6077 .nb_flags = NBT_NM_GROUP,
6078 .mhomed = false,
6079 .num_ips = ctx->addresses_best_num,
6080 .ips = ctx->addresses_best,
6081 .apply_expected = true
6083 .replica= {
6084 .type = WREPL_TYPE_MHOMED,
6085 .state = WREPL_STATE_ACTIVE,
6086 .node = WREPL_NODE_B,
6087 .is_static = false,
6088 .num_ips = ARRAY_SIZE(addresses_B_1),
6089 .ips = addresses_B_1,
6090 .apply_expected = true
6094 * sgroup,released vs. mhomed,tombstone with same ip(s)
6097 .line = __location__,
6098 .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL),
6099 .wins = {
6100 .nb_flags = NBT_NM_GROUP,
6101 .mhomed = false,
6102 .num_ips = ctx->addresses_best_num,
6103 .ips = ctx->addresses_best,
6104 .apply_expected = true
6106 .replica= {
6107 .type = WREPL_TYPE_MHOMED,
6108 .state = WREPL_STATE_TOMBSTONE,
6109 .node = WREPL_NODE_B,
6110 .is_static = false,
6111 .num_ips = ctx->addresses_best_num,
6112 .ips = ctx->addresses_best,
6113 .apply_expected = true
6117 * sgroup,released vs. mhomed,tombstone with different ip(s)
6120 .line = __location__,
6121 .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL),
6122 .wins = {
6123 .nb_flags = NBT_NM_GROUP,
6124 .mhomed = false,
6125 .num_ips = ctx->addresses_best_num,
6126 .ips = ctx->addresses_best,
6127 .apply_expected = true
6129 .replica= {
6130 .type = WREPL_TYPE_MHOMED,
6131 .state = WREPL_STATE_TOMBSTONE,
6132 .node = WREPL_NODE_B,
6133 .is_static = false,
6134 .num_ips = ARRAY_SIZE(addresses_B_1),
6135 .ips = addresses_B_1,
6136 .apply_expected = true
6140 * multi homed vs. unique section
6143 * mhomed,released vs. unique,active with same ip(s)
6146 .line = __location__,
6147 .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL),
6148 .wins = {
6149 .nb_flags = 0,
6150 .mhomed = true,
6151 .num_ips = ctx->addresses_best_num,
6152 .ips = ctx->addresses_best,
6153 .apply_expected = true
6155 .replica= {
6156 .type = WREPL_TYPE_UNIQUE,
6157 .state = WREPL_STATE_ACTIVE,
6158 .node = WREPL_NODE_B,
6159 .is_static = false,
6160 .num_ips = ctx->addresses_best_num,
6161 .ips = ctx->addresses_best,
6162 .apply_expected = true
6166 * mhomed,released vs. unique,active with different ip(s)
6169 .line = __location__,
6170 .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL),
6171 .wins = {
6172 .nb_flags = 0,
6173 .mhomed = true,
6174 .num_ips = ctx->addresses_best_num,
6175 .ips = ctx->addresses_best,
6176 .apply_expected = true
6178 .replica= {
6179 .type = WREPL_TYPE_UNIQUE,
6180 .state = WREPL_STATE_ACTIVE,
6181 .node = WREPL_NODE_B,
6182 .is_static = false,
6183 .num_ips = ARRAY_SIZE(addresses_B_1),
6184 .ips = addresses_B_1,
6185 .apply_expected = true
6189 * mhomed,released vs. unique,tombstone with same ip(s)
6192 .line = __location__,
6193 .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL),
6194 .wins = {
6195 .nb_flags = 0,
6196 .mhomed = true,
6197 .num_ips = ctx->addresses_best_num,
6198 .ips = ctx->addresses_best,
6199 .apply_expected = true
6201 .replica= {
6202 .type = WREPL_TYPE_UNIQUE,
6203 .state = WREPL_STATE_TOMBSTONE,
6204 .node = WREPL_NODE_B,
6205 .is_static = false,
6206 .num_ips = ctx->addresses_best_num,
6207 .ips = ctx->addresses_best,
6208 .apply_expected = true
6212 * mhomed,released vs. unique,tombstone with different ip(s)
6215 .line = __location__,
6216 .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL),
6217 .wins = {
6218 .nb_flags = 0,
6219 .mhomed = true,
6220 .num_ips = ctx->addresses_best_num,
6221 .ips = ctx->addresses_best,
6222 .apply_expected = true
6224 .replica= {
6225 .type = WREPL_TYPE_UNIQUE,
6226 .state = WREPL_STATE_TOMBSTONE,
6227 .node = WREPL_NODE_B,
6228 .is_static = false,
6229 .num_ips = ARRAY_SIZE(addresses_B_1),
6230 .ips = addresses_B_1,
6231 .apply_expected = true
6235 * multi homed vs. group section
6238 * mhomed,released vs. group,active with same ip(s)
6241 .line = __location__,
6242 .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL),
6243 .wins = {
6244 .nb_flags = 0,
6245 .mhomed = true,
6246 .num_ips = ctx->addresses_best_num,
6247 .ips = ctx->addresses_best,
6248 .apply_expected = true
6250 .replica= {
6251 .type = WREPL_TYPE_GROUP,
6252 .state = WREPL_STATE_ACTIVE,
6253 .node = WREPL_NODE_B,
6254 .is_static = false,
6255 .num_ips = ctx->addresses_best_num,
6256 .ips = ctx->addresses_best,
6257 .apply_expected = true
6261 * mhomed,released vs. group,active with different ip(s)
6264 .line = __location__,
6265 .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL),
6266 .wins = {
6267 .nb_flags = 0,
6268 .mhomed = true,
6269 .num_ips = ctx->addresses_best_num,
6270 .ips = ctx->addresses_best,
6271 .apply_expected = true
6273 .replica= {
6274 .type = WREPL_TYPE_GROUP,
6275 .state = WREPL_STATE_ACTIVE,
6276 .node = WREPL_NODE_B,
6277 .is_static = false,
6278 .num_ips = ARRAY_SIZE(addresses_B_1),
6279 .ips = addresses_B_1,
6280 .apply_expected = true
6284 * mhomed,released vs. group,tombstone with same ip(s)
6287 .line = __location__,
6288 .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL),
6289 .wins = {
6290 .nb_flags = 0,
6291 .mhomed = true,
6292 .num_ips = ctx->addresses_best_num,
6293 .ips = ctx->addresses_best,
6294 .apply_expected = true
6296 .replica= {
6297 .type = WREPL_TYPE_GROUP,
6298 .state = WREPL_STATE_TOMBSTONE,
6299 .node = WREPL_NODE_B,
6300 .is_static = false,
6301 .num_ips = ctx->addresses_best_num,
6302 .ips = ctx->addresses_best,
6303 .apply_expected = true
6307 * mhomed,released vs. group,tombstone with different ip(s)
6310 .line = __location__,
6311 .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL),
6312 .wins = {
6313 .nb_flags = 0,
6314 .mhomed = true,
6315 .num_ips = ctx->addresses_best_num,
6316 .ips = ctx->addresses_best,
6317 .apply_expected = true
6319 .replica= {
6320 .type = WREPL_TYPE_GROUP,
6321 .state = WREPL_STATE_TOMBSTONE,
6322 .node = WREPL_NODE_B,
6323 .is_static = false,
6324 .num_ips = ARRAY_SIZE(addresses_B_1),
6325 .ips = addresses_B_1,
6326 .apply_expected = true
6330 * multi homed vs. special group section
6333 * mhomed,released vs. sgroup,active with same ip(s)
6336 .line = __location__,
6337 .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL),
6338 .wins = {
6339 .nb_flags = 0,
6340 .mhomed = true,
6341 .num_ips = ctx->addresses_best_num,
6342 .ips = ctx->addresses_best,
6343 .apply_expected = true
6345 .replica= {
6346 .type = WREPL_TYPE_SGROUP,
6347 .state = WREPL_STATE_ACTIVE,
6348 .node = WREPL_NODE_B,
6349 .is_static = false,
6350 .num_ips = ctx->addresses_best_num,
6351 .ips = ctx->addresses_best,
6352 .apply_expected = true
6356 * mhomed,released vs. sgroup,active with different ip(s)
6359 .line = __location__,
6360 .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL),
6361 .wins = {
6362 .nb_flags = 0,
6363 .mhomed = true,
6364 .num_ips = ctx->addresses_best_num,
6365 .ips = ctx->addresses_best,
6366 .apply_expected = true
6368 .replica= {
6369 .type = WREPL_TYPE_SGROUP,
6370 .state = WREPL_STATE_ACTIVE,
6371 .node = WREPL_NODE_B,
6372 .is_static = false,
6373 .num_ips = ARRAY_SIZE(addresses_B_1),
6374 .ips = addresses_B_1,
6375 .apply_expected = true
6379 * mhomed,released vs. sgroup,tombstone with same ip(s)
6382 .line = __location__,
6383 .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL),
6384 .wins = {
6385 .nb_flags = 0,
6386 .mhomed = true,
6387 .num_ips = ctx->addresses_best_num,
6388 .ips = ctx->addresses_best,
6389 .apply_expected = true
6391 .replica= {
6392 .type = WREPL_TYPE_SGROUP,
6393 .state = WREPL_STATE_TOMBSTONE,
6394 .node = WREPL_NODE_B,
6395 .is_static = false,
6396 .num_ips = ctx->addresses_best_num,
6397 .ips = ctx->addresses_best,
6398 .apply_expected = true
6402 * mhomed,released vs. sgroup,tombstone with different ip(s)
6405 .line = __location__,
6406 .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL),
6407 .wins = {
6408 .nb_flags = 0,
6409 .mhomed = true,
6410 .num_ips = ctx->addresses_best_num,
6411 .ips = ctx->addresses_best,
6412 .apply_expected = true
6414 .replica= {
6415 .type = WREPL_TYPE_SGROUP,
6416 .state = WREPL_STATE_TOMBSTONE,
6417 .node = WREPL_NODE_B,
6418 .is_static = false,
6419 .num_ips = ARRAY_SIZE(addresses_B_1),
6420 .ips = addresses_B_1,
6421 .apply_expected = true
6425 * multi homed vs. multi homed section
6428 * mhomed,released vs. mhomed,active with same ip(s)
6431 .line = __location__,
6432 .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL),
6433 .wins = {
6434 .nb_flags = 0,
6435 .mhomed = true,
6436 .num_ips = ctx->addresses_best_num,
6437 .ips = ctx->addresses_best,
6438 .apply_expected = true
6440 .replica= {
6441 .type = WREPL_TYPE_MHOMED,
6442 .state = WREPL_STATE_ACTIVE,
6443 .node = WREPL_NODE_B,
6444 .is_static = false,
6445 .num_ips = ctx->addresses_best_num,
6446 .ips = ctx->addresses_best,
6447 .apply_expected = true
6451 * mhomed,released vs. mhomed,active with different ip(s)
6454 .line = __location__,
6455 .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL),
6456 .wins = {
6457 .nb_flags = 0,
6458 .mhomed = true,
6459 .num_ips = ctx->addresses_best_num,
6460 .ips = ctx->addresses_best,
6461 .apply_expected = true
6463 .replica= {
6464 .type = WREPL_TYPE_MHOMED,
6465 .state = WREPL_STATE_ACTIVE,
6466 .node = WREPL_NODE_B,
6467 .is_static = false,
6468 .num_ips = ARRAY_SIZE(addresses_B_1),
6469 .ips = addresses_B_1,
6470 .apply_expected = true
6474 * mhomed,released vs. mhomed,tombstone with same ip(s)
6477 .line = __location__,
6478 .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL),
6479 .wins = {
6480 .nb_flags = 0,
6481 .mhomed = true,
6482 .num_ips = ctx->addresses_best_num,
6483 .ips = ctx->addresses_best,
6484 .apply_expected = true
6486 .replica= {
6487 .type = WREPL_TYPE_MHOMED,
6488 .state = WREPL_STATE_TOMBSTONE,
6489 .node = WREPL_NODE_B,
6490 .is_static = false,
6491 .num_ips = ctx->addresses_best_num,
6492 .ips = ctx->addresses_best,
6493 .apply_expected = true
6497 * mhomed,released vs. mhomed,tombstone with different ip(s)
6500 .line = __location__,
6501 .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL),
6502 .wins = {
6503 .nb_flags = 0,
6504 .mhomed = true,
6505 .num_ips = ctx->addresses_best_num,
6506 .ips = ctx->addresses_best,
6507 .apply_expected = true
6509 .replica= {
6510 .type = WREPL_TYPE_MHOMED,
6511 .state = WREPL_STATE_TOMBSTONE,
6512 .node = WREPL_NODE_B,
6513 .is_static = false,
6514 .num_ips = ARRAY_SIZE(addresses_B_1),
6515 .ips = addresses_B_1,
6516 .apply_expected = true
6521 torture_comment(tctx, "Test Replica records vs. owned released records\n");
6523 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
6524 torture_comment(tctx, "%s => %s\n", nbt_name_string(ctx, &records[i].name),
6525 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
6528 * Setup Register
6530 name_register->in.name = records[i].name;
6531 name_register->in.dest_addr = ctx->address;
6532 name_register->in.dest_port = lp_nbt_port(tctx->lp_ctx);
6533 name_register->in.address = records[i].wins.ips[0].ip;
6534 name_register->in.nb_flags = records[i].wins.nb_flags;
6535 name_register->in.register_demand= false;
6536 name_register->in.broadcast = false;
6537 name_register->in.multi_homed = records[i].wins.mhomed;
6538 name_register->in.ttl = 300000;
6539 name_register->in.timeout = 70;
6540 name_register->in.retries = 0;
6542 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
6543 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6544 torture_comment(tctx, "No response from %s for name register\n", ctx->address);
6545 ret = false;
6547 if (!NT_STATUS_IS_OK(status)) {
6548 torture_comment(tctx, "Bad response from %s for name register - %s\n",
6549 ctx->address, nt_errstr(status));
6550 ret = false;
6552 CHECK_VALUE(tctx, name_register->out.rcode, 0);
6553 CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address);
6554 CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type);
6555 CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name);
6556 CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope);
6557 CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[0].ip);
6559 /* release the record */
6560 release->in.name = records[i].name;
6561 release->in.dest_port = lp_nbt_port(tctx->lp_ctx);
6562 release->in.dest_addr = ctx->address;
6563 release->in.address = records[i].wins.ips[0].ip;
6564 release->in.nb_flags = records[i].wins.nb_flags;
6565 release->in.broadcast = false;
6566 release->in.timeout = 30;
6567 release->in.retries = 0;
6569 status = nbt_name_release(ctx->nbtsock, ctx, release);
6570 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6571 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
6572 return false;
6574 if (!NT_STATUS_IS_OK(status)) {
6575 torture_comment(tctx, "Bad response from %s for name query - %s\n",
6576 ctx->address, nt_errstr(status));
6577 return false;
6579 CHECK_VALUE(tctx, release->out.rcode, 0);
6582 * Setup Replica
6584 wins_name->name = &records[i].name;
6585 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
6586 records[i].replica.state,
6587 records[i].replica.node,
6588 records[i].replica.is_static);
6589 wins_name->id = ++ctx->b.max_version;
6590 if (wins_name->flags & 2) {
6591 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
6592 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
6593 } else {
6594 wins_name->addresses.ip = records[i].replica.ips[0].ip;
6596 wins_name->unknown = "255.255.255.255";
6598 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
6599 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name,
6600 records[i].replica.apply_expected);
6602 if (records[i].replica.apply_expected) {
6603 wins_name->name = &records[i].name;
6604 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
6605 WREPL_STATE_TOMBSTONE,
6606 WREPL_NODE_B, false);
6607 wins_name->id = ++ctx->b.max_version;
6608 wins_name->addresses.ip = addresses_B_1[0].ip;
6609 wins_name->unknown = "255.255.255.255";
6611 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
6612 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
6613 } else {
6614 release->in.name = records[i].name;
6615 release->in.dest_addr = ctx->address;
6616 release->in.dest_port = lp_nbt_port(tctx->lp_ctx);
6617 release->in.address = records[i].wins.ips[0].ip;
6618 release->in.nb_flags = records[i].wins.nb_flags;
6619 release->in.broadcast = false;
6620 release->in.timeout = 30;
6621 release->in.retries = 0;
6623 status = nbt_name_release(ctx->nbtsock, ctx, release);
6624 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6625 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
6626 return false;
6628 if (!NT_STATUS_IS_OK(status)) {
6629 torture_comment(tctx, "Bad response from %s for name query - %s\n",
6630 ctx->address, nt_errstr(status));
6631 return false;
6633 CHECK_VALUE(tctx, release->out.rcode, 0);
6635 if (!ret) {
6636 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
6637 return ret;
6641 return ret;
6644 struct test_conflict_owned_active_vs_replica_struct {
6645 const char *line; /* just better debugging */
6646 const char *section; /* just better debugging */
6647 struct nbt_name name;
6648 const char *comment;
6649 bool skip;
6650 struct {
6651 uint32_t nb_flags;
6652 bool mhomed;
6653 uint32_t num_ips;
6654 const struct wrepl_ip *ips;
6655 bool apply_expected;
6656 } wins;
6657 struct {
6658 uint32_t timeout;
6659 bool positive;
6660 bool expect_release;
6661 bool late_release;
6662 bool ret;
6663 /* when num_ips == 0, then .wins.ips are used */
6664 uint32_t num_ips;
6665 const struct wrepl_ip *ips;
6666 } defend;
6667 struct {
6668 enum wrepl_name_type type;
6669 enum wrepl_name_state state;
6670 enum wrepl_name_node node;
6671 bool is_static;
6672 uint32_t num_ips;
6673 const struct wrepl_ip *ips;
6674 bool apply_expected;
6675 bool mhomed_merge;
6676 bool sgroup_merge;
6677 } replica;
6680 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
6681 struct nbt_name_packet *req_packet,
6682 struct socket_address *src);
6684 static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx,
6685 struct test_wrepl_conflict_conn *ctx)
6687 bool ret = true;
6688 NTSTATUS status;
6689 struct wrepl_wins_name wins_name_;
6690 struct wrepl_wins_name *wins_name = &wins_name_;
6691 struct nbt_name_register name_register_;
6692 struct nbt_name_register *name_register = &name_register_;
6693 struct nbt_name_release release_;
6694 struct nbt_name_release *release = &release_;
6695 uint32_t i;
6696 struct test_conflict_owned_active_vs_replica_struct records[] = {
6698 * unique vs. unique section
6701 * unique,active vs. unique,active with same ip(s), unchecked
6704 .line = __location__,
6705 .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL),
6706 .wins = {
6707 .nb_flags = 0,
6708 .mhomed = false,
6709 .num_ips = ctx->addresses_best_num,
6710 .ips = ctx->addresses_best,
6711 .apply_expected = true
6713 .defend = {
6714 .timeout = 0,
6716 .replica= {
6717 .type = WREPL_TYPE_UNIQUE,
6718 .state = WREPL_STATE_ACTIVE,
6719 .node = WREPL_NODE_B,
6720 .is_static = false,
6721 .num_ips = ctx->addresses_best_num,
6722 .ips = ctx->addresses_best,
6723 .apply_expected = true
6727 * unique,active vs. unique,active with different ip(s), positive response
6730 .line = __location__,
6731 .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL),
6732 .wins = {
6733 .nb_flags = 0,
6734 .mhomed = false,
6735 .num_ips = ctx->addresses_best_num,
6736 .ips = ctx->addresses_best,
6737 .apply_expected = true
6739 .defend = {
6740 .timeout = 10,
6741 .positive = true,
6743 .replica= {
6744 .type = WREPL_TYPE_UNIQUE,
6745 .state = WREPL_STATE_ACTIVE,
6746 .node = WREPL_NODE_B,
6747 .is_static = false,
6748 .num_ips = ARRAY_SIZE(addresses_B_1),
6749 .ips = addresses_B_1,
6750 .apply_expected = false
6754 * unique,active vs. unique,active with different ip(s), positive response other ips
6757 .line = __location__,
6758 .name = _NBT_NAME("_UA_UA_DI_O", 0x00, NULL),
6759 .wins = {
6760 .nb_flags = 0,
6761 .mhomed = false,
6762 .num_ips = ctx->addresses_best_num,
6763 .ips = ctx->addresses_best,
6764 .apply_expected = true
6766 .defend = {
6767 .timeout = 10,
6768 .positive = true,
6769 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6770 .ips = addresses_A_3_4,
6772 .replica= {
6773 .type = WREPL_TYPE_UNIQUE,
6774 .state = WREPL_STATE_ACTIVE,
6775 .node = WREPL_NODE_B,
6776 .is_static = false,
6777 .num_ips = ARRAY_SIZE(addresses_B_1),
6778 .ips = addresses_B_1,
6779 .apply_expected = false
6783 * unique,active vs. unique,active with different ip(s), negative response
6786 .line = __location__,
6787 .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL),
6788 .wins = {
6789 .nb_flags = 0,
6790 .mhomed = false,
6791 .num_ips = ctx->addresses_best_num,
6792 .ips = ctx->addresses_best,
6793 .apply_expected = true
6795 .defend = {
6796 .timeout = 10,
6797 .positive = false,
6799 .replica= {
6800 .type = WREPL_TYPE_UNIQUE,
6801 .state = WREPL_STATE_ACTIVE,
6802 .node = WREPL_NODE_B,
6803 .is_static = false,
6804 .num_ips = ARRAY_SIZE(addresses_B_1),
6805 .ips = addresses_B_1,
6806 .apply_expected = true
6810 * unique,active vs. unique,tombstone with same ip(s), unchecked
6813 .line = __location__,
6814 .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL),
6815 .wins = {
6816 .nb_flags = 0,
6817 .mhomed = false,
6818 .num_ips = ctx->addresses_best_num,
6819 .ips = ctx->addresses_best,
6820 .apply_expected = true
6822 .defend = {
6823 .timeout = 0,
6825 .replica= {
6826 .type = WREPL_TYPE_UNIQUE,
6827 .state = WREPL_STATE_TOMBSTONE,
6828 .node = WREPL_NODE_B,
6829 .is_static = false,
6830 .num_ips = ctx->addresses_best_num,
6831 .ips = ctx->addresses_best,
6832 .apply_expected = false
6836 * unique,active vs. unique,tombstone with different ip(s), unchecked
6839 .line = __location__,
6840 .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL),
6841 .wins = {
6842 .nb_flags = 0,
6843 .mhomed = false,
6844 .num_ips = ctx->addresses_best_num,
6845 .ips = ctx->addresses_best,
6846 .apply_expected = true
6848 .defend = {
6849 .timeout = 0,
6851 .replica= {
6852 .type = WREPL_TYPE_UNIQUE,
6853 .state = WREPL_STATE_TOMBSTONE,
6854 .node = WREPL_NODE_B,
6855 .is_static = false,
6856 .num_ips = ARRAY_SIZE(addresses_B_1),
6857 .ips = addresses_B_1,
6858 .apply_expected = false
6862 * unique vs. group section
6865 * unique,active vs. group,active with same ip(s), release expected
6868 .line = __location__,
6869 .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL),
6870 .wins = {
6871 .nb_flags = 0,
6872 .mhomed = false,
6873 .num_ips = ctx->addresses_best_num,
6874 .ips = ctx->addresses_best,
6875 .apply_expected = true
6877 .defend = {
6878 .timeout = 10,
6879 .expect_release = true,
6881 .replica= {
6882 .type = WREPL_TYPE_GROUP,
6883 .state = WREPL_STATE_ACTIVE,
6884 .node = WREPL_NODE_B,
6885 .is_static = false,
6886 .num_ips = ctx->addresses_best_num,
6887 .ips = ctx->addresses_best,
6888 .apply_expected = true
6892 * unique,active vs. group,active with different ip(s), release expected
6895 .line = __location__,
6896 .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL),
6897 .wins = {
6898 .nb_flags = 0,
6899 .mhomed = false,
6900 .num_ips = ctx->addresses_best_num,
6901 .ips = ctx->addresses_best,
6902 .apply_expected = true
6904 .defend = {
6905 .timeout = 10,
6906 .expect_release = true,
6908 .replica= {
6909 .type = WREPL_TYPE_GROUP,
6910 .state = WREPL_STATE_ACTIVE,
6911 .node = WREPL_NODE_B,
6912 .is_static = false,
6913 .num_ips = ARRAY_SIZE(addresses_B_1),
6914 .ips = addresses_B_1,
6915 .apply_expected = true
6919 * unique,active vs. group,tombstone with same ip(s), unchecked
6922 .line = __location__,
6923 .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL),
6924 .wins = {
6925 .nb_flags = 0,
6926 .mhomed = false,
6927 .num_ips = ctx->addresses_best_num,
6928 .ips = ctx->addresses_best,
6929 .apply_expected = true
6931 .defend = {
6932 .timeout = 0,
6934 .replica= {
6935 .type = WREPL_TYPE_GROUP,
6936 .state = WREPL_STATE_TOMBSTONE,
6937 .node = WREPL_NODE_B,
6938 .is_static = false,
6939 .num_ips = ctx->addresses_best_num,
6940 .ips = ctx->addresses_best,
6941 .apply_expected = false
6945 * unique,active vs. group,tombstone with different ip(s), unchecked
6948 .line = __location__,
6949 .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL),
6950 .wins = {
6951 .nb_flags = 0,
6952 .mhomed = false,
6953 .num_ips = ctx->addresses_best_num,
6954 .ips = ctx->addresses_best,
6955 .apply_expected = true
6957 .defend = {
6958 .timeout = 0,
6960 .replica= {
6961 .type = WREPL_TYPE_GROUP,
6962 .state = WREPL_STATE_TOMBSTONE,
6963 .node = WREPL_NODE_B,
6964 .is_static = false,
6965 .num_ips = ARRAY_SIZE(addresses_B_1),
6966 .ips = addresses_B_1,
6967 .apply_expected = false
6971 * unique vs. special group section
6974 * unique,active vs. sgroup,active with same ip(s), release expected
6977 .line = __location__,
6978 .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL),
6979 .wins = {
6980 .nb_flags = 0,
6981 .mhomed = false,
6982 .num_ips = ctx->addresses_best_num,
6983 .ips = ctx->addresses_best,
6984 .apply_expected = true
6986 .defend = {
6987 .timeout = 10,
6988 .expect_release = true,
6990 .replica= {
6991 .type = WREPL_TYPE_SGROUP,
6992 .state = WREPL_STATE_ACTIVE,
6993 .node = WREPL_NODE_B,
6994 .is_static = false,
6995 .num_ips = ctx->addresses_best_num,
6996 .ips = ctx->addresses_best,
6997 .apply_expected = true
7001 * unique,active vs. group,active with different ip(s), release expected
7004 .line = __location__,
7005 .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL),
7006 .wins = {
7007 .nb_flags = 0,
7008 .mhomed = false,
7009 .num_ips = ctx->addresses_best_num,
7010 .ips = ctx->addresses_best,
7011 .apply_expected = true
7013 .defend = {
7014 .timeout = 10,
7015 .expect_release = true,
7017 .replica= {
7018 .type = WREPL_TYPE_SGROUP,
7019 .state = WREPL_STATE_ACTIVE,
7020 .node = WREPL_NODE_B,
7021 .is_static = false,
7022 .num_ips = ARRAY_SIZE(addresses_B_1),
7023 .ips = addresses_B_1,
7024 .apply_expected = true
7028 * unique,active vs. sgroup,tombstone with same ip(s), unchecked
7031 .line = __location__,
7032 .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL),
7033 .wins = {
7034 .nb_flags = 0,
7035 .mhomed = false,
7036 .num_ips = ctx->addresses_best_num,
7037 .ips = ctx->addresses_best,
7038 .apply_expected = true
7040 .defend = {
7041 .timeout = 0,
7043 .replica= {
7044 .type = WREPL_TYPE_SGROUP,
7045 .state = WREPL_STATE_TOMBSTONE,
7046 .node = WREPL_NODE_B,
7047 .is_static = false,
7048 .num_ips = ctx->addresses_best_num,
7049 .ips = ctx->addresses_best,
7050 .apply_expected = false
7054 * unique,active vs. sgroup,tombstone with different ip(s), unchecked
7057 .line = __location__,
7058 .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL),
7059 .wins = {
7060 .nb_flags = 0,
7061 .mhomed = false,
7062 .num_ips = ctx->addresses_best_num,
7063 .ips = ctx->addresses_best,
7064 .apply_expected = true
7066 .defend = {
7067 .timeout = 0,
7069 .replica= {
7070 .type = WREPL_TYPE_SGROUP,
7071 .state = WREPL_STATE_TOMBSTONE,
7072 .node = WREPL_NODE_B,
7073 .is_static = false,
7074 .num_ips = ARRAY_SIZE(addresses_B_1),
7075 .ips = addresses_B_1,
7076 .apply_expected = false
7080 * unique vs. multi homed section
7083 * unique,active vs. mhomed,active with same ip(s), unchecked
7086 .line = __location__,
7087 .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL),
7088 .wins = {
7089 .nb_flags = 0,
7090 .mhomed = false,
7091 .num_ips = ctx->addresses_best_num,
7092 .ips = ctx->addresses_best,
7093 .apply_expected = true
7095 .defend = {
7096 .timeout = 0,
7098 .replica= {
7099 .type = WREPL_TYPE_MHOMED,
7100 .state = WREPL_STATE_ACTIVE,
7101 .node = WREPL_NODE_B,
7102 .is_static = false,
7103 .num_ips = ctx->addresses_best_num,
7104 .ips = ctx->addresses_best,
7105 .apply_expected = true
7109 * unique,active vs. mhomed,active with superset ip(s), unchecked
7112 .line = __location__,
7113 .name = _NBT_NAME("_UA_MA_SP_U", 0x00, NULL),
7114 .wins = {
7115 .nb_flags = 0,
7116 .mhomed = false,
7117 .num_ips = ctx->addresses_best_num,
7118 .ips = ctx->addresses_best,
7119 .apply_expected = true
7121 .defend = {
7122 .timeout = 0,
7124 .replica= {
7125 .type = WREPL_TYPE_MHOMED,
7126 .state = WREPL_STATE_ACTIVE,
7127 .node = WREPL_NODE_B,
7128 .is_static = false,
7129 .num_ips = ctx->addresses_all_num,
7130 .ips = ctx->addresses_all,
7131 .apply_expected = true
7135 * unique,active vs. mhomed,active with different ip(s), positive response
7138 .line = __location__,
7139 .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL),
7140 .wins = {
7141 .nb_flags = 0,
7142 .mhomed = false,
7143 .num_ips = ctx->addresses_best_num,
7144 .ips = ctx->addresses_best,
7145 .apply_expected = true
7147 .defend = {
7148 .timeout = 10,
7149 .positive = true,
7151 .replica= {
7152 .type = WREPL_TYPE_MHOMED,
7153 .state = WREPL_STATE_ACTIVE,
7154 .node = WREPL_NODE_B,
7155 .is_static = false,
7156 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7157 .ips = addresses_B_3_4,
7158 .apply_expected = false
7162 * unique,active vs. mhomed,active with different ip(s), positive response other ips
7165 .line = __location__,
7166 .name = _NBT_NAME("_UA_MA_DI_O", 0x00, NULL),
7167 .wins = {
7168 .nb_flags = 0,
7169 .mhomed = false,
7170 .num_ips = ctx->addresses_best_num,
7171 .ips = ctx->addresses_best,
7172 .apply_expected = true
7174 .defend = {
7175 .timeout = 10,
7176 .positive = true,
7177 .num_ips = ARRAY_SIZE(addresses_A_3_4),
7178 .ips = addresses_A_3_4,
7180 .replica= {
7181 .type = WREPL_TYPE_MHOMED,
7182 .state = WREPL_STATE_ACTIVE,
7183 .node = WREPL_NODE_B,
7184 .is_static = false,
7185 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7186 .ips = addresses_B_3_4,
7187 .apply_expected = false
7191 * unique,active vs. mhomed,active with different ip(s), negative response
7194 .line = __location__,
7195 .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL),
7196 .wins = {
7197 .nb_flags = 0,
7198 .mhomed = false,
7199 .num_ips = ctx->addresses_best_num,
7200 .ips = ctx->addresses_best,
7201 .apply_expected = true
7203 .defend = {
7204 .timeout = 10,
7205 .positive = false,
7207 .replica= {
7208 .type = WREPL_TYPE_MHOMED,
7209 .state = WREPL_STATE_ACTIVE,
7210 .node = WREPL_NODE_B,
7211 .is_static = false,
7212 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7213 .ips = addresses_B_3_4,
7214 .apply_expected = true
7218 * unique,active vs. mhomed,tombstone with same ip(s), unchecked
7221 .line = __location__,
7222 .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL),
7223 .wins = {
7224 .nb_flags = 0,
7225 .mhomed = false,
7226 .num_ips = ctx->addresses_best_num,
7227 .ips = ctx->addresses_best,
7228 .apply_expected = true
7230 .defend = {
7231 .timeout = 0,
7233 .replica= {
7234 .type = WREPL_TYPE_MHOMED,
7235 .state = WREPL_STATE_TOMBSTONE,
7236 .node = WREPL_NODE_B,
7237 .is_static = false,
7238 .num_ips = ctx->addresses_best_num,
7239 .ips = ctx->addresses_best,
7240 .apply_expected = false
7244 * unique,active vs. mhomed,tombstone with different ip(s), unchecked
7247 .line = __location__,
7248 .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL),
7249 .wins = {
7250 .nb_flags = 0,
7251 .mhomed = false,
7252 .num_ips = ctx->addresses_best_num,
7253 .ips = ctx->addresses_best,
7254 .apply_expected = true
7256 .defend = {
7257 .timeout = 0,
7259 .replica= {
7260 .type = WREPL_TYPE_MHOMED,
7261 .state = WREPL_STATE_TOMBSTONE,
7262 .node = WREPL_NODE_B,
7263 .is_static = false,
7264 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7265 .ips = addresses_B_3_4,
7266 .apply_expected = false
7270 * normal group vs. unique section
7273 * group,active vs. unique,active with same ip(s), unchecked
7276 .line = __location__,
7277 .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL),
7278 .wins = {
7279 .nb_flags = NBT_NM_GROUP,
7280 .mhomed = false,
7281 .num_ips = ctx->addresses_best_num,
7282 .ips = ctx->addresses_best,
7283 .apply_expected = true
7285 .defend = {
7286 .timeout = 0,
7288 .replica= {
7289 .type = WREPL_TYPE_UNIQUE,
7290 .state = WREPL_STATE_ACTIVE,
7291 .node = WREPL_NODE_B,
7292 .is_static = false,
7293 .num_ips = ctx->addresses_best_num,
7294 .ips = ctx->addresses_best,
7295 .apply_expected = false
7299 * group,active vs. unique,active with different ip(s), unchecked
7302 .line = __location__,
7303 .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL),
7304 .wins = {
7305 .nb_flags = NBT_NM_GROUP,
7306 .mhomed = false,
7307 .num_ips = ctx->addresses_best_num,
7308 .ips = ctx->addresses_best,
7309 .apply_expected = true
7311 .defend = {
7312 .timeout = 0,
7314 .replica= {
7315 .type = WREPL_TYPE_UNIQUE,
7316 .state = WREPL_STATE_ACTIVE,
7317 .node = WREPL_NODE_B,
7318 .is_static = false,
7319 .num_ips = ARRAY_SIZE(addresses_B_1),
7320 .ips = addresses_B_1,
7321 .apply_expected = false
7325 * group,active vs. unique,tombstone with same ip(s), unchecked
7328 .line = __location__,
7329 .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL),
7330 .wins = {
7331 .nb_flags = NBT_NM_GROUP,
7332 .mhomed = false,
7333 .num_ips = ctx->addresses_best_num,
7334 .ips = ctx->addresses_best,
7335 .apply_expected = true
7337 .defend = {
7338 .timeout = 0,
7340 .replica= {
7341 .type = WREPL_TYPE_UNIQUE,
7342 .state = WREPL_STATE_TOMBSTONE,
7343 .node = WREPL_NODE_B,
7344 .is_static = false,
7345 .num_ips = ctx->addresses_best_num,
7346 .ips = ctx->addresses_best,
7347 .apply_expected = false
7351 * group,active vs. unique,tombstone with different ip(s), unchecked
7354 .line = __location__,
7355 .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL),
7356 .wins = {
7357 .nb_flags = NBT_NM_GROUP,
7358 .mhomed = false,
7359 .num_ips = ctx->addresses_best_num,
7360 .ips = ctx->addresses_best,
7361 .apply_expected = true
7363 .defend = {
7364 .timeout = 0,
7366 .replica= {
7367 .type = WREPL_TYPE_UNIQUE,
7368 .state = WREPL_STATE_TOMBSTONE,
7369 .node = WREPL_NODE_B,
7370 .is_static = false,
7371 .num_ips = ARRAY_SIZE(addresses_B_1),
7372 .ips = addresses_B_1,
7373 .apply_expected = false
7377 * normal group vs. normal group section
7380 * group,active vs. group,active with same ip(s), unchecked
7383 .line = __location__,
7384 .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL),
7385 .wins = {
7386 .nb_flags = NBT_NM_GROUP,
7387 .mhomed = false,
7388 .num_ips = ctx->addresses_best_num,
7389 .ips = ctx->addresses_best,
7390 .apply_expected = true
7392 .defend = {
7393 .timeout = 0,
7395 .replica= {
7396 .type = WREPL_TYPE_GROUP,
7397 .state = WREPL_STATE_ACTIVE,
7398 .node = WREPL_NODE_B,
7399 .is_static = false,
7400 .num_ips = ctx->addresses_best_num,
7401 .ips = ctx->addresses_best,
7402 .apply_expected = true
7406 * group,active vs. group,active with different ip(s), unchecked
7409 .line = __location__,
7410 .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL),
7411 .wins = {
7412 .nb_flags = NBT_NM_GROUP,
7413 .mhomed = false,
7414 .num_ips = ctx->addresses_best_num,
7415 .ips = ctx->addresses_best,
7416 .apply_expected = true
7418 .defend = {
7419 .timeout = 0,
7421 .replica= {
7422 .type = WREPL_TYPE_GROUP,
7423 .state = WREPL_STATE_ACTIVE,
7424 .node = WREPL_NODE_B,
7425 .is_static = false,
7426 .num_ips = ARRAY_SIZE(addresses_B_1),
7427 .ips = addresses_B_1,
7428 .apply_expected = true
7432 * group,active vs. group,tombstone with same ip(s), unchecked
7435 .line = __location__,
7436 .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL),
7437 .wins = {
7438 .nb_flags = NBT_NM_GROUP,
7439 .mhomed = false,
7440 .num_ips = ctx->addresses_best_num,
7441 .ips = ctx->addresses_best,
7442 .apply_expected = true
7444 .defend = {
7445 .timeout = 0,
7447 .replica= {
7448 .type = WREPL_TYPE_GROUP,
7449 .state = WREPL_STATE_TOMBSTONE,
7450 .node = WREPL_NODE_B,
7451 .is_static = false,
7452 .num_ips = ctx->addresses_best_num,
7453 .ips = ctx->addresses_best,
7454 .apply_expected = false
7458 * group,active vs. group,tombstone with different ip(s), unchecked
7461 .line = __location__,
7462 .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL),
7463 .wins = {
7464 .nb_flags = NBT_NM_GROUP,
7465 .mhomed = false,
7466 .num_ips = ctx->addresses_best_num,
7467 .ips = ctx->addresses_best,
7468 .apply_expected = true
7470 .defend = {
7471 .timeout = 0,
7473 .replica= {
7474 .type = WREPL_TYPE_GROUP,
7475 .state = WREPL_STATE_TOMBSTONE,
7476 .node = WREPL_NODE_B,
7477 .is_static = false,
7478 .num_ips = ARRAY_SIZE(addresses_B_1),
7479 .ips = addresses_B_1,
7480 .apply_expected = false
7484 * normal group vs. special group section
7487 * group,active vs. sgroup,active with same ip(s), unchecked
7490 .line = __location__,
7491 .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL),
7492 .wins = {
7493 .nb_flags = NBT_NM_GROUP,
7494 .mhomed = false,
7495 .num_ips = ctx->addresses_best_num,
7496 .ips = ctx->addresses_best,
7497 .apply_expected = true
7499 .defend = {
7500 .timeout = 0,
7502 .replica= {
7503 .type = WREPL_TYPE_SGROUP,
7504 .state = WREPL_STATE_ACTIVE,
7505 .node = WREPL_NODE_B,
7506 .is_static = false,
7507 .num_ips = ctx->addresses_best_num,
7508 .ips = ctx->addresses_best,
7509 .apply_expected = false
7513 * group,active vs. sgroup,active with different ip(s), unchecked
7516 .line = __location__,
7517 .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL),
7518 .wins = {
7519 .nb_flags = NBT_NM_GROUP,
7520 .mhomed = false,
7521 .num_ips = ctx->addresses_best_num,
7522 .ips = ctx->addresses_best,
7523 .apply_expected = true
7525 .defend = {
7526 .timeout = 0,
7528 .replica= {
7529 .type = WREPL_TYPE_SGROUP,
7530 .state = WREPL_STATE_ACTIVE,
7531 .node = WREPL_NODE_B,
7532 .is_static = false,
7533 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7534 .ips = addresses_B_3_4,
7535 .apply_expected = false
7539 * group,active vs. sgroup,tombstone with same ip(s), unchecked
7542 .line = __location__,
7543 .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL),
7544 .wins = {
7545 .nb_flags = NBT_NM_GROUP,
7546 .mhomed = false,
7547 .num_ips = ctx->addresses_best_num,
7548 .ips = ctx->addresses_best,
7549 .apply_expected = true
7551 .defend = {
7552 .timeout = 0,
7554 .replica= {
7555 .type = WREPL_TYPE_SGROUP,
7556 .state = WREPL_STATE_TOMBSTONE,
7557 .node = WREPL_NODE_B,
7558 .is_static = false,
7559 .num_ips = ctx->addresses_best_num,
7560 .ips = ctx->addresses_best,
7561 .apply_expected = false
7565 * group,active vs. sgroup,tombstone with different ip(s), unchecked
7568 .line = __location__,
7569 .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL),
7570 .wins = {
7571 .nb_flags = NBT_NM_GROUP,
7572 .mhomed = false,
7573 .num_ips = ctx->addresses_best_num,
7574 .ips = ctx->addresses_best,
7575 .apply_expected = true
7577 .defend = {
7578 .timeout = 0,
7580 .replica= {
7581 .type = WREPL_TYPE_SGROUP,
7582 .state = WREPL_STATE_TOMBSTONE,
7583 .node = WREPL_NODE_B,
7584 .is_static = false,
7585 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7586 .ips = addresses_B_3_4,
7587 .apply_expected = false
7591 * normal group vs. multi homed section
7594 * group,active vs. mhomed,active with same ip(s), unchecked
7597 .line = __location__,
7598 .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL),
7599 .wins = {
7600 .nb_flags = NBT_NM_GROUP,
7601 .mhomed = false,
7602 .num_ips = ctx->addresses_best_num,
7603 .ips = ctx->addresses_best,
7604 .apply_expected = true
7606 .defend = {
7607 .timeout = 0,
7609 .replica= {
7610 .type = WREPL_TYPE_MHOMED,
7611 .state = WREPL_STATE_ACTIVE,
7612 .node = WREPL_NODE_B,
7613 .is_static = false,
7614 .num_ips = ctx->addresses_best_num,
7615 .ips = ctx->addresses_best,
7616 .apply_expected = false
7620 * group,active vs. mhomed,active with different ip(s), unchecked
7623 .line = __location__,
7624 .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL),
7625 .wins = {
7626 .nb_flags = NBT_NM_GROUP,
7627 .mhomed = false,
7628 .num_ips = ctx->addresses_best_num,
7629 .ips = ctx->addresses_best,
7630 .apply_expected = true
7632 .defend = {
7633 .timeout = 0,
7635 .replica= {
7636 .type = WREPL_TYPE_MHOMED,
7637 .state = WREPL_STATE_ACTIVE,
7638 .node = WREPL_NODE_B,
7639 .is_static = false,
7640 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7641 .ips = addresses_B_3_4,
7642 .apply_expected = false
7646 * group,active vs. mhomed,tombstone with same ip(s), unchecked
7649 .line = __location__,
7650 .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL),
7651 .wins = {
7652 .nb_flags = NBT_NM_GROUP,
7653 .mhomed = false,
7654 .num_ips = ctx->addresses_best_num,
7655 .ips = ctx->addresses_best,
7656 .apply_expected = true
7658 .defend = {
7659 .timeout = 0,
7661 .replica= {
7662 .type = WREPL_TYPE_MHOMED,
7663 .state = WREPL_STATE_TOMBSTONE,
7664 .node = WREPL_NODE_B,
7665 .is_static = false,
7666 .num_ips = ctx->addresses_best_num,
7667 .ips = ctx->addresses_best,
7668 .apply_expected = false
7672 * group,active vs. mhomed,tombstone with different ip(s), unchecked
7675 .line = __location__,
7676 .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL),
7677 .wins = {
7678 .nb_flags = NBT_NM_GROUP,
7679 .mhomed = false,
7680 .num_ips = ctx->addresses_best_num,
7681 .ips = ctx->addresses_best,
7682 .apply_expected = true
7684 .defend = {
7685 .timeout = 0,
7687 .replica= {
7688 .type = WREPL_TYPE_MHOMED,
7689 .state = WREPL_STATE_TOMBSTONE,
7690 .node = WREPL_NODE_B,
7691 .is_static = false,
7692 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7693 .ips = addresses_B_3_4,
7694 .apply_expected = false
7698 * special group vs. unique section
7701 * sgroup,active vs. unique,active with same ip(s), unchecked
7704 .line = __location__,
7705 .name = _NBT_NAME("_SA_UA_SI_U", 0x1C, NULL),
7706 .wins = {
7707 .nb_flags = NBT_NM_GROUP,
7708 .mhomed = false,
7709 .num_ips = ctx->addresses_best_num,
7710 .ips = ctx->addresses_best,
7711 .apply_expected = true
7713 .defend = {
7714 .timeout = 0,
7716 .replica= {
7717 .type = WREPL_TYPE_UNIQUE,
7718 .state = WREPL_STATE_ACTIVE,
7719 .node = WREPL_NODE_B,
7720 .is_static = false,
7721 .num_ips = ctx->addresses_best_num,
7722 .ips = ctx->addresses_best,
7723 .apply_expected = false
7727 * sgroup,active vs. unique,active with different ip(s), unchecked
7730 .line = __location__,
7731 .name = _NBT_NAME("_SA_UA_DI_U", 0x1C, NULL),
7732 .wins = {
7733 .nb_flags = NBT_NM_GROUP,
7734 .mhomed = false,
7735 .num_ips = ctx->addresses_best_num,
7736 .ips = ctx->addresses_best,
7737 .apply_expected = true
7739 .defend = {
7740 .timeout = 0,
7742 .replica= {
7743 .type = WREPL_TYPE_UNIQUE,
7744 .state = WREPL_STATE_ACTIVE,
7745 .node = WREPL_NODE_B,
7746 .is_static = false,
7747 .num_ips = ARRAY_SIZE(addresses_B_1),
7748 .ips = addresses_B_1,
7749 .apply_expected = false
7753 * sgroup,active vs. unique,tombstone with same ip(s), unchecked
7756 .line = __location__,
7757 .name = _NBT_NAME("_SA_UT_SI_U", 0x1C, NULL),
7758 .wins = {
7759 .nb_flags = NBT_NM_GROUP,
7760 .mhomed = false,
7761 .num_ips = ctx->addresses_best_num,
7762 .ips = ctx->addresses_best,
7763 .apply_expected = true
7765 .defend = {
7766 .timeout = 0,
7768 .replica= {
7769 .type = WREPL_TYPE_UNIQUE,
7770 .state = WREPL_STATE_TOMBSTONE,
7771 .node = WREPL_NODE_B,
7772 .is_static = false,
7773 .num_ips = ctx->addresses_best_num,
7774 .ips = ctx->addresses_best,
7775 .apply_expected = false
7779 * sgroup,active vs. unique,tombstone with different ip(s), unchecked
7782 .line = __location__,
7783 .name = _NBT_NAME("_SA_UT_DI_U", 0x1C, NULL),
7784 .wins = {
7785 .nb_flags = NBT_NM_GROUP,
7786 .mhomed = false,
7787 .num_ips = ctx->addresses_best_num,
7788 .ips = ctx->addresses_best,
7789 .apply_expected = true
7791 .defend = {
7792 .timeout = 0,
7794 .replica= {
7795 .type = WREPL_TYPE_UNIQUE,
7796 .state = WREPL_STATE_TOMBSTONE,
7797 .node = WREPL_NODE_B,
7798 .is_static = false,
7799 .num_ips = ARRAY_SIZE(addresses_B_1),
7800 .ips = addresses_B_1,
7801 .apply_expected = false
7805 * special group vs. normal group section
7808 * sgroup,active vs. group,active with same ip(s), unchecked
7811 .line = __location__,
7812 .name = _NBT_NAME("_SA_GA_SI_U", 0x1C, NULL),
7813 .wins = {
7814 .nb_flags = NBT_NM_GROUP,
7815 .mhomed = false,
7816 .num_ips = ctx->addresses_best_num,
7817 .ips = ctx->addresses_best,
7818 .apply_expected = true
7820 .defend = {
7821 .timeout = 0,
7823 .replica= {
7824 .type = WREPL_TYPE_GROUP,
7825 .state = WREPL_STATE_ACTIVE,
7826 .node = WREPL_NODE_B,
7827 .is_static = false,
7828 .num_ips = ctx->addresses_best_num,
7829 .ips = ctx->addresses_best,
7830 .apply_expected = false
7834 * sgroup,active vs. group,active with different ip(s), unchecked
7837 .line = __location__,
7838 .name = _NBT_NAME("_SA_GA_DI_U", 0x1C, NULL),
7839 .wins = {
7840 .nb_flags = NBT_NM_GROUP,
7841 .mhomed = false,
7842 .num_ips = ctx->addresses_best_num,
7843 .ips = ctx->addresses_best,
7844 .apply_expected = true
7846 .defend = {
7847 .timeout = 0,
7849 .replica= {
7850 .type = WREPL_TYPE_GROUP,
7851 .state = WREPL_STATE_ACTIVE,
7852 .node = WREPL_NODE_B,
7853 .is_static = false,
7854 .num_ips = ARRAY_SIZE(addresses_B_1),
7855 .ips = addresses_B_1,
7856 .apply_expected = false
7860 * sgroup,active vs. group,tombstone with same ip(s), unchecked
7863 .line = __location__,
7864 .name = _NBT_NAME("_SA_GT_SI_U", 0x1C, NULL),
7865 .wins = {
7866 .nb_flags = NBT_NM_GROUP,
7867 .mhomed = false,
7868 .num_ips = ctx->addresses_best_num,
7869 .ips = ctx->addresses_best,
7870 .apply_expected = true
7872 .defend = {
7873 .timeout = 0,
7875 .replica= {
7876 .type = WREPL_TYPE_GROUP,
7877 .state = WREPL_STATE_TOMBSTONE,
7878 .node = WREPL_NODE_B,
7879 .is_static = false,
7880 .num_ips = ctx->addresses_best_num,
7881 .ips = ctx->addresses_best,
7882 .apply_expected = false
7886 * sgroup,active vs. group,tombstone with different ip(s), unchecked
7889 .line = __location__,
7890 .name = _NBT_NAME("_SA_GT_DI_U", 0x1C, NULL),
7891 .wins = {
7892 .nb_flags = NBT_NM_GROUP,
7893 .mhomed = false,
7894 .num_ips = ctx->addresses_best_num,
7895 .ips = ctx->addresses_best,
7896 .apply_expected = true
7898 .defend = {
7899 .timeout = 0,
7901 .replica= {
7902 .type = WREPL_TYPE_GROUP,
7903 .state = WREPL_STATE_TOMBSTONE,
7904 .node = WREPL_NODE_B,
7905 .is_static = false,
7906 .num_ips = ARRAY_SIZE(addresses_B_1),
7907 .ips = addresses_B_1,
7908 .apply_expected = false
7912 * special group vs. multi homed section
7915 * sgroup,active vs. mhomed,active with same ip(s), unchecked
7918 .line = __location__,
7919 .name = _NBT_NAME("_SA_MA_SI_U", 0x1C, NULL),
7920 .wins = {
7921 .nb_flags = NBT_NM_GROUP,
7922 .mhomed = false,
7923 .num_ips = ctx->addresses_best_num,
7924 .ips = ctx->addresses_best,
7925 .apply_expected = true
7927 .defend = {
7928 .timeout = 0,
7930 .replica= {
7931 .type = WREPL_TYPE_MHOMED,
7932 .state = WREPL_STATE_ACTIVE,
7933 .node = WREPL_NODE_B,
7934 .is_static = false,
7935 .num_ips = ctx->addresses_best_num,
7936 .ips = ctx->addresses_best,
7937 .apply_expected = false
7941 * sgroup,active vs. mhomed,active with different ip(s), unchecked
7944 .line = __location__,
7945 .name = _NBT_NAME("_SA_MA_DI_U", 0x1C, NULL),
7946 .wins = {
7947 .nb_flags = NBT_NM_GROUP,
7948 .mhomed = false,
7949 .num_ips = ctx->addresses_best_num,
7950 .ips = ctx->addresses_best,
7951 .apply_expected = true
7953 .defend = {
7954 .timeout = 0,
7956 .replica= {
7957 .type = WREPL_TYPE_MHOMED,
7958 .state = WREPL_STATE_ACTIVE,
7959 .node = WREPL_NODE_B,
7960 .is_static = false,
7961 .num_ips = ARRAY_SIZE(addresses_B_1),
7962 .ips = addresses_B_1,
7963 .apply_expected = false
7967 * sgroup,active vs. mhomed,tombstone with same ip(s), unchecked
7970 .line = __location__,
7971 .name = _NBT_NAME("_SA_MT_SI_U", 0x1C, NULL),
7972 .wins = {
7973 .nb_flags = NBT_NM_GROUP,
7974 .mhomed = false,
7975 .num_ips = ctx->addresses_best_num,
7976 .ips = ctx->addresses_best,
7977 .apply_expected = true
7979 .defend = {
7980 .timeout = 0,
7982 .replica= {
7983 .type = WREPL_TYPE_MHOMED,
7984 .state = WREPL_STATE_TOMBSTONE,
7985 .node = WREPL_NODE_B,
7986 .is_static = false,
7987 .num_ips = ctx->addresses_best_num,
7988 .ips = ctx->addresses_best,
7989 .apply_expected = false
7993 * sgroup,active vs. mhomed,tombstone with different ip(s), unchecked
7996 .line = __location__,
7997 .name = _NBT_NAME("_SA_MT_DI_U", 0x1C, NULL),
7998 .wins = {
7999 .nb_flags = NBT_NM_GROUP,
8000 .mhomed = false,
8001 .num_ips = ctx->addresses_best_num,
8002 .ips = ctx->addresses_best,
8003 .apply_expected = true
8005 .defend = {
8006 .timeout = 0,
8008 .replica= {
8009 .type = WREPL_TYPE_MHOMED,
8010 .state = WREPL_STATE_TOMBSTONE,
8011 .node = WREPL_NODE_B,
8012 .is_static = false,
8013 .num_ips = ARRAY_SIZE(addresses_B_1),
8014 .ips = addresses_B_1,
8015 .apply_expected = false
8019 * multi homed vs. unique section
8022 * mhomed,active vs. unique,active with same ip(s), unchecked
8025 .line = __location__,
8026 .name = _NBT_NAME("_MA_UA_SI_U", 0x00, NULL),
8027 .wins = {
8028 .nb_flags = 0,
8029 .mhomed = true,
8030 .num_ips = ctx->addresses_best_num,
8031 .ips = ctx->addresses_best,
8032 .apply_expected = true
8034 .defend = {
8035 .timeout = 0,
8037 .replica= {
8038 .type = WREPL_TYPE_UNIQUE,
8039 .state = WREPL_STATE_ACTIVE,
8040 .node = WREPL_NODE_B,
8041 .is_static = false,
8042 .num_ips = ctx->addresses_best_num,
8043 .ips = ctx->addresses_best,
8044 .apply_expected = true
8048 * mhomed,active vs. unique,active with different ip(s), positive response
8051 .line = __location__,
8052 .name = _NBT_NAME("_MA_UA_DI_P", 0x00, NULL),
8053 .wins = {
8054 .nb_flags = 0,
8055 .mhomed = true,
8056 .num_ips = ctx->addresses_best_num,
8057 .ips = ctx->addresses_best,
8058 .apply_expected = true
8060 .defend = {
8061 .timeout = 10,
8062 .positive = true,
8064 .replica= {
8065 .type = WREPL_TYPE_UNIQUE,
8066 .state = WREPL_STATE_ACTIVE,
8067 .node = WREPL_NODE_B,
8068 .is_static = false,
8069 .num_ips = ARRAY_SIZE(addresses_B_1),
8070 .ips = addresses_B_1,
8071 .apply_expected = false
8075 * mhomed,active vs. unique,active with different ip(s), positive response other ips
8078 .line = __location__,
8079 .name = _NBT_NAME("_MA_UA_DI_O", 0x00, NULL),
8080 .wins = {
8081 .nb_flags = 0,
8082 .mhomed = true,
8083 .num_ips = ctx->addresses_best_num,
8084 .ips = ctx->addresses_best,
8085 .apply_expected = true
8087 .defend = {
8088 .timeout = 10,
8089 .positive = true,
8090 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8091 .ips = addresses_A_3_4,
8093 .replica= {
8094 .type = WREPL_TYPE_UNIQUE,
8095 .state = WREPL_STATE_ACTIVE,
8096 .node = WREPL_NODE_B,
8097 .is_static = false,
8098 .num_ips = ARRAY_SIZE(addresses_B_1),
8099 .ips = addresses_B_1,
8100 .apply_expected = false
8104 * mhomed,active vs. unique,active with different ip(s), negative response
8107 .line = __location__,
8108 .name = _NBT_NAME("_MA_UA_DI_N", 0x00, NULL),
8109 .wins = {
8110 .nb_flags = 0,
8111 .mhomed = true,
8112 .num_ips = ctx->addresses_best_num,
8113 .ips = ctx->addresses_best,
8114 .apply_expected = true
8116 .defend = {
8117 .timeout = 10,
8118 .positive = false,
8120 .replica= {
8121 .type = WREPL_TYPE_UNIQUE,
8122 .state = WREPL_STATE_ACTIVE,
8123 .node = WREPL_NODE_B,
8124 .is_static = false,
8125 .num_ips = ARRAY_SIZE(addresses_B_1),
8126 .ips = addresses_B_1,
8127 .apply_expected = true
8131 * mhomed,active vs. unique,tombstone with same ip(s), unchecked
8134 .line = __location__,
8135 .name = _NBT_NAME("_MA_UT_SI_U", 0x00, NULL),
8136 .wins = {
8137 .nb_flags = 0,
8138 .mhomed = true,
8139 .num_ips = ctx->addresses_best_num,
8140 .ips = ctx->addresses_best,
8141 .apply_expected = true
8143 .defend = {
8144 .timeout = 0,
8146 .replica= {
8147 .type = WREPL_TYPE_UNIQUE,
8148 .state = WREPL_STATE_TOMBSTONE,
8149 .node = WREPL_NODE_B,
8150 .is_static = false,
8151 .num_ips = ctx->addresses_best_num,
8152 .ips = ctx->addresses_best,
8153 .apply_expected = false
8157 * mhomed,active vs. unique,tombstone with different ip(s), unchecked
8160 .line = __location__,
8161 .name = _NBT_NAME("_MA_UT_DI_U", 0x00, NULL),
8162 .wins = {
8163 .nb_flags = 0,
8164 .mhomed = true,
8165 .num_ips = ctx->addresses_best_num,
8166 .ips = ctx->addresses_best,
8167 .apply_expected = true
8169 .defend = {
8170 .timeout = 0,
8172 .replica= {
8173 .type = WREPL_TYPE_UNIQUE,
8174 .state = WREPL_STATE_TOMBSTONE,
8175 .node = WREPL_NODE_B,
8176 .is_static = false,
8177 .num_ips = ARRAY_SIZE(addresses_B_1),
8178 .ips = addresses_B_1,
8179 .apply_expected = false
8183 * multi homed vs. normal group section
8186 * mhomed,active vs. group,active with same ip(s), release expected
8189 .line = __location__,
8190 .name = _NBT_NAME("_MA_GA_SI_R", 0x00, NULL),
8191 .wins = {
8192 .nb_flags = 0,
8193 .mhomed = true,
8194 .num_ips = ctx->addresses_best_num,
8195 .ips = ctx->addresses_best,
8196 .apply_expected = true
8198 .defend = {
8199 .timeout = 10,
8200 .expect_release = true,
8202 .replica= {
8203 .type = WREPL_TYPE_GROUP,
8204 .state = WREPL_STATE_ACTIVE,
8205 .node = WREPL_NODE_B,
8206 .is_static = false,
8207 .num_ips = ctx->addresses_best_num,
8208 .ips = ctx->addresses_best,
8209 .apply_expected = true
8213 * mhomed,active vs. group,active with different ip(s), release expected
8216 .line = __location__,
8217 .name = _NBT_NAME("_MA_GA_DI_R", 0x00, NULL),
8218 .wins = {
8219 .nb_flags = 0,
8220 .mhomed = true,
8221 .num_ips = ctx->addresses_best_num,
8222 .ips = ctx->addresses_best,
8223 .apply_expected = true
8225 .defend = {
8226 .timeout = 10,
8227 .expect_release = true,
8229 .replica= {
8230 .type = WREPL_TYPE_GROUP,
8231 .state = WREPL_STATE_ACTIVE,
8232 .node = WREPL_NODE_B,
8233 .is_static = false,
8234 .num_ips = ARRAY_SIZE(addresses_B_1),
8235 .ips = addresses_B_1,
8236 .apply_expected = true
8240 * mhomed,active vs. group,tombstone with same ip(s), unchecked
8243 .line = __location__,
8244 .name = _NBT_NAME("_MA_GT_SI_U", 0x00, NULL),
8245 .wins = {
8246 .nb_flags = 0,
8247 .mhomed = true,
8248 .num_ips = ctx->addresses_best_num,
8249 .ips = ctx->addresses_best,
8250 .apply_expected = true
8252 .defend = {
8253 .timeout = 0,
8255 .replica= {
8256 .type = WREPL_TYPE_GROUP,
8257 .state = WREPL_STATE_TOMBSTONE,
8258 .node = WREPL_NODE_B,
8259 .is_static = false,
8260 .num_ips = ctx->addresses_best_num,
8261 .ips = ctx->addresses_best,
8262 .apply_expected = false
8266 * mhomed,active vs. group,tombstone with different ip(s), unchecked
8269 .line = __location__,
8270 .name = _NBT_NAME("_MA_GT_DI_U", 0x00, NULL),
8271 .wins = {
8272 .nb_flags = 0,
8273 .mhomed = true,
8274 .num_ips = ctx->addresses_best_num,
8275 .ips = ctx->addresses_best,
8276 .apply_expected = true
8278 .defend = {
8279 .timeout = 0,
8281 .replica= {
8282 .type = WREPL_TYPE_GROUP,
8283 .state = WREPL_STATE_TOMBSTONE,
8284 .node = WREPL_NODE_B,
8285 .is_static = false,
8286 .num_ips = ARRAY_SIZE(addresses_B_1),
8287 .ips = addresses_B_1,
8288 .apply_expected = false
8292 * multi homed vs. special group section
8295 * mhomed,active vs. sgroup,active with same ip(s), release expected
8298 .line = __location__,
8299 .name = _NBT_NAME("_MA_SA_SI_R", 0x00, NULL),
8300 .wins = {
8301 .nb_flags = 0,
8302 .mhomed = true,
8303 .num_ips = ctx->addresses_best_num,
8304 .ips = ctx->addresses_best,
8305 .apply_expected = true
8307 .defend = {
8308 .timeout = 10,
8309 .expect_release = true,
8311 .replica= {
8312 .type = WREPL_TYPE_SGROUP,
8313 .state = WREPL_STATE_ACTIVE,
8314 .node = WREPL_NODE_B,
8315 .is_static = false,
8316 .num_ips = ctx->addresses_best_num,
8317 .ips = ctx->addresses_best,
8318 .apply_expected = true
8322 * mhomed,active vs. group,active with different ip(s), release expected
8325 .line = __location__,
8326 .name = _NBT_NAME("_MA_SA_DI_R", 0x00, NULL),
8327 .wins = {
8328 .nb_flags = 0,
8329 .mhomed = true,
8330 .num_ips = ctx->addresses_best_num,
8331 .ips = ctx->addresses_best,
8332 .apply_expected = true
8334 .defend = {
8335 .timeout = 10,
8336 .expect_release = true,
8338 .replica= {
8339 .type = WREPL_TYPE_SGROUP,
8340 .state = WREPL_STATE_ACTIVE,
8341 .node = WREPL_NODE_B,
8342 .is_static = false,
8343 .num_ips = ARRAY_SIZE(addresses_B_1),
8344 .ips = addresses_B_1,
8345 .apply_expected = true
8349 * mhomed,active vs. sgroup,tombstone with same ip(s), unchecked
8352 .line = __location__,
8353 .name = _NBT_NAME("_MA_ST_SI_U", 0x00, NULL),
8354 .wins = {
8355 .nb_flags = 0,
8356 .mhomed = true,
8357 .num_ips = ctx->addresses_best_num,
8358 .ips = ctx->addresses_best,
8359 .apply_expected = true
8361 .defend = {
8362 .timeout = 0,
8364 .replica= {
8365 .type = WREPL_TYPE_SGROUP,
8366 .state = WREPL_STATE_TOMBSTONE,
8367 .node = WREPL_NODE_B,
8368 .is_static = false,
8369 .num_ips = ctx->addresses_best_num,
8370 .ips = ctx->addresses_best,
8371 .apply_expected = false
8375 * mhomed,active vs. sgroup,tombstone with different ip(s), unchecked
8378 .line = __location__,
8379 .name = _NBT_NAME("_MA_ST_DI_U", 0x00, NULL),
8380 .wins = {
8381 .nb_flags = 0,
8382 .mhomed = true,
8383 .num_ips = ctx->addresses_best_num,
8384 .ips = ctx->addresses_best,
8385 .apply_expected = true
8387 .defend = {
8388 .timeout = 0,
8390 .replica= {
8391 .type = WREPL_TYPE_SGROUP,
8392 .state = WREPL_STATE_TOMBSTONE,
8393 .node = WREPL_NODE_B,
8394 .is_static = false,
8395 .num_ips = ARRAY_SIZE(addresses_B_1),
8396 .ips = addresses_B_1,
8397 .apply_expected = false
8401 * multi homed vs. multi homed section
8404 * mhomed,active vs. mhomed,active with same ip(s), unchecked
8407 .line = __location__,
8408 .name = _NBT_NAME("_MA_MA_SI_U", 0x00, NULL),
8409 .wins = {
8410 .nb_flags = 0,
8411 .mhomed = true,
8412 .num_ips = ctx->addresses_best_num,
8413 .ips = ctx->addresses_best,
8414 .apply_expected = true
8416 .defend = {
8417 .timeout = 0,
8419 .replica= {
8420 .type = WREPL_TYPE_MHOMED,
8421 .state = WREPL_STATE_ACTIVE,
8422 .node = WREPL_NODE_B,
8423 .is_static = false,
8424 .num_ips = ctx->addresses_best_num,
8425 .ips = ctx->addresses_best,
8426 .apply_expected = true
8430 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8433 .line = __location__,
8434 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8435 .wins = {
8436 .nb_flags = 0,
8437 .mhomed = true,
8438 .num_ips = ctx->addresses_best_num,
8439 .ips = ctx->addresses_best,
8440 .apply_expected = true
8442 .defend = {
8443 .timeout = 0,
8445 .replica= {
8446 .type = WREPL_TYPE_MHOMED,
8447 .state = WREPL_STATE_ACTIVE,
8448 .node = WREPL_NODE_B,
8449 .is_static = false,
8450 .num_ips = ctx->addresses_all_num,
8451 .ips = ctx->addresses_all,
8452 .apply_expected = true
8456 * mhomed,active vs. mhomed,active with different ip(s), positive response
8459 .line = __location__,
8460 .name = _NBT_NAME("_MA_MA_DI_P", 0x00, NULL),
8461 .wins = {
8462 .nb_flags = 0,
8463 .mhomed = true,
8464 .num_ips = ctx->addresses_best_num,
8465 .ips = ctx->addresses_best,
8466 .apply_expected = true
8468 .defend = {
8469 .timeout = 10,
8470 .positive = true,
8472 .replica= {
8473 .type = WREPL_TYPE_MHOMED,
8474 .state = WREPL_STATE_ACTIVE,
8475 .node = WREPL_NODE_B,
8476 .is_static = false,
8477 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8478 .ips = addresses_B_3_4,
8479 .apply_expected = false
8483 * mhomed,active vs. mhomed,active with different ip(s), positive response other ips
8486 .line = __location__,
8487 .name = _NBT_NAME("_MA_MA_DI_O", 0x00, NULL),
8488 .wins = {
8489 .nb_flags = 0,
8490 .mhomed = true,
8491 .num_ips = ctx->addresses_best_num,
8492 .ips = ctx->addresses_best,
8493 .apply_expected = true
8495 .defend = {
8496 .timeout = 10,
8497 .positive = true,
8498 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8499 .ips = addresses_A_3_4,
8501 .replica= {
8502 .type = WREPL_TYPE_MHOMED,
8503 .state = WREPL_STATE_ACTIVE,
8504 .node = WREPL_NODE_B,
8505 .is_static = false,
8506 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8507 .ips = addresses_B_3_4,
8508 .apply_expected = false
8512 * mhomed,active vs. mhomed,active with different ip(s), negative response
8515 .line = __location__,
8516 .name = _NBT_NAME("_MA_MA_DI_N", 0x00, NULL),
8517 .wins = {
8518 .nb_flags = 0,
8519 .mhomed = true,
8520 .num_ips = ctx->addresses_best_num,
8521 .ips = ctx->addresses_best,
8522 .apply_expected = true
8524 .defend = {
8525 .timeout = 10,
8526 .positive = false,
8528 .replica= {
8529 .type = WREPL_TYPE_MHOMED,
8530 .state = WREPL_STATE_ACTIVE,
8531 .node = WREPL_NODE_B,
8532 .is_static = false,
8533 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8534 .ips = addresses_B_3_4,
8535 .apply_expected = true
8539 * mhomed,active vs. mhomed,tombstone with same ip(s), unchecked
8542 .line = __location__,
8543 .name = _NBT_NAME("_MA_MT_SI_U", 0x00, NULL),
8544 .wins = {
8545 .nb_flags = 0,
8546 .mhomed = true,
8547 .num_ips = ctx->addresses_best_num,
8548 .ips = ctx->addresses_best,
8549 .apply_expected = true
8551 .defend = {
8552 .timeout = 0,
8554 .replica= {
8555 .type = WREPL_TYPE_MHOMED,
8556 .state = WREPL_STATE_TOMBSTONE,
8557 .node = WREPL_NODE_B,
8558 .is_static = false,
8559 .num_ips = ctx->addresses_best_num,
8560 .ips = ctx->addresses_best,
8561 .apply_expected = false
8565 * mhomed,active vs. mhomed,tombstone with different ip(s), unchecked
8568 .line = __location__,
8569 .name = _NBT_NAME("_MA_MT_DI_U", 0x00, NULL),
8570 .wins = {
8571 .nb_flags = 0,
8572 .mhomed = true,
8573 .num_ips = ctx->addresses_best_num,
8574 .ips = ctx->addresses_best,
8575 .apply_expected = true
8577 .defend = {
8578 .timeout = 0,
8580 .replica= {
8581 .type = WREPL_TYPE_MHOMED,
8582 .state = WREPL_STATE_TOMBSTONE,
8583 .node = WREPL_NODE_B,
8584 .is_static = false,
8585 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8586 .ips = addresses_B_3_4,
8587 .apply_expected = false
8591 * some more multi homed test, including merging
8594 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8597 .line = __location__,
8598 .section= "Test Replica vs. owned active: some more MHOMED combinations",
8599 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8600 .comment= "C:MHOMED vs. B:ALL => B:ALL",
8601 .skip = (ctx->addresses_all_num < 3),
8602 .wins = {
8603 .nb_flags = 0,
8604 .mhomed = true,
8605 .num_ips = ctx->addresses_mhomed_num,
8606 .ips = ctx->addresses_mhomed,
8607 .apply_expected = true
8609 .defend = {
8610 .timeout = 0,
8612 .replica= {
8613 .type = WREPL_TYPE_MHOMED,
8614 .state = WREPL_STATE_ACTIVE,
8615 .node = WREPL_NODE_B,
8616 .is_static = false,
8617 .num_ips = ctx->addresses_all_num,
8618 .ips = ctx->addresses_all,
8619 .apply_expected = true
8623 * mhomed,active vs. mhomed,active with same ips, unchecked
8626 .line = __location__,
8627 .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL),
8628 .comment= "C:MHOMED vs. B:MHOMED => B:MHOMED",
8629 .skip = (ctx->addresses_mhomed_num < 2),
8630 .wins = {
8631 .nb_flags = 0,
8632 .mhomed = true,
8633 .num_ips = ctx->addresses_mhomed_num,
8634 .ips = ctx->addresses_mhomed,
8635 .apply_expected = true
8637 .defend = {
8638 .timeout = 0,
8640 .replica= {
8641 .type = WREPL_TYPE_MHOMED,
8642 .state = WREPL_STATE_ACTIVE,
8643 .node = WREPL_NODE_B,
8644 .is_static = false,
8645 .num_ips = ctx->addresses_mhomed_num,
8646 .ips = ctx->addresses_mhomed,
8647 .apply_expected = true
8651 * mhomed,active vs. mhomed,active with subset ip(s), positive response
8654 .line = __location__,
8655 .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL),
8656 .comment= "C:MHOMED vs. B:BEST (C:MHOMED) => B:MHOMED",
8657 .skip = (ctx->addresses_mhomed_num < 2),
8658 .wins = {
8659 .nb_flags = 0,
8660 .mhomed = true,
8661 .num_ips = ctx->addresses_mhomed_num,
8662 .ips = ctx->addresses_mhomed,
8663 .apply_expected = true
8665 .defend = {
8666 .timeout = 10,
8667 .positive = true
8669 .replica= {
8670 .type = WREPL_TYPE_MHOMED,
8671 .state = WREPL_STATE_ACTIVE,
8672 .node = WREPL_NODE_B,
8673 .is_static = false,
8674 .num_ips = ctx->addresses_best_num,
8675 .ips = ctx->addresses_best,
8676 .mhomed_merge = true
8680 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with all addresses
8683 .line = __location__,
8684 .name = _NBT_NAME("_MA_MA_SB_A", 0x00, NULL),
8685 .comment= "C:MHOMED vs. B:BEST (C:ALL) => B:MHOMED",
8686 .skip = (ctx->addresses_all_num < 3),
8687 .wins = {
8688 .nb_flags = 0,
8689 .mhomed = true,
8690 .num_ips = ctx->addresses_mhomed_num,
8691 .ips = ctx->addresses_mhomed,
8692 .apply_expected = true
8694 .defend = {
8695 .timeout = 10,
8696 .positive = true,
8697 .num_ips = ctx->addresses_all_num,
8698 .ips = ctx->addresses_all,
8700 .replica= {
8701 .type = WREPL_TYPE_MHOMED,
8702 .state = WREPL_STATE_ACTIVE,
8703 .node = WREPL_NODE_B,
8704 .is_static = false,
8705 .num_ips = ctx->addresses_best_num,
8706 .ips = ctx->addresses_best,
8707 .mhomed_merge = true
8711 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with replicas addresses
8712 * TODO: check why the server sends a name release demand for one address?
8713 * the release demand has no effect to the database record...
8716 .line = __location__,
8717 .name = _NBT_NAME("_MA_MA_SB_PRA", 0x00, NULL),
8718 .comment= "C:MHOMED vs. B:BEST (C:BEST) => C:MHOMED",
8719 .skip = (ctx->addresses_all_num < 2),
8720 .wins = {
8721 .nb_flags = 0,
8722 .mhomed = true,
8723 .num_ips = ctx->addresses_mhomed_num,
8724 .ips = ctx->addresses_mhomed,
8725 .apply_expected = true
8727 .defend = {
8728 .timeout = 10,
8729 .positive = true,
8730 .num_ips = ctx->addresses_best_num,
8731 .ips = ctx->addresses_best,
8732 .late_release = true
8734 .replica= {
8735 .type = WREPL_TYPE_MHOMED,
8736 .state = WREPL_STATE_ACTIVE,
8737 .node = WREPL_NODE_B,
8738 .is_static = false,
8739 .num_ips = ctx->addresses_best_num,
8740 .ips = ctx->addresses_best,
8741 .apply_expected = false
8745 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with other addresses
8748 .line = __location__,
8749 .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL),
8750 .comment= "C:MHOMED vs. B:BEST (B:B_3_4) =>C:MHOMED",
8751 .skip = (ctx->addresses_all_num < 2),
8752 .wins = {
8753 .nb_flags = 0,
8754 .mhomed = true,
8755 .num_ips = ctx->addresses_mhomed_num,
8756 .ips = ctx->addresses_mhomed,
8757 .apply_expected = true
8759 .defend = {
8760 .timeout = 10,
8761 .positive = true,
8762 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8763 .ips = addresses_B_3_4,
8765 .replica= {
8766 .type = WREPL_TYPE_MHOMED,
8767 .state = WREPL_STATE_ACTIVE,
8768 .node = WREPL_NODE_B,
8769 .is_static = false,
8770 .num_ips = ctx->addresses_best_num,
8771 .ips = ctx->addresses_best,
8772 .apply_expected = false
8776 * mhomed,active vs. mhomed,active with subset ip(s), negative response
8779 .line = __location__,
8780 .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL),
8781 .comment= "C:MHOMED vs. B:BEST (NEGATIVE) => B:BEST",
8782 .skip = (ctx->addresses_mhomed_num < 2),
8783 .wins = {
8784 .nb_flags = 0,
8785 .mhomed = true,
8786 .num_ips = ctx->addresses_mhomed_num,
8787 .ips = ctx->addresses_mhomed,
8788 .apply_expected = true
8790 .defend = {
8791 .timeout = 10,
8792 .positive = false
8794 .replica= {
8795 .type = WREPL_TYPE_MHOMED,
8796 .state = WREPL_STATE_ACTIVE,
8797 .node = WREPL_NODE_B,
8798 .is_static = false,
8799 .num_ips = ctx->addresses_best_num,
8800 .ips = ctx->addresses_best,
8801 .apply_expected = true
8805 * some more multi homed and unique test, including merging
8808 * mhomed,active vs. unique,active with subset ip(s), positive response
8811 .line = __location__,
8812 .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations",
8813 .name = _NBT_NAME("_MA_UA_SB_P", 0x00, NULL),
8814 .comment= "C:MHOMED vs. B:UNIQUE,BEST (C:MHOMED) => B:MHOMED",
8815 .skip = (ctx->addresses_all_num < 2),
8816 .wins = {
8817 .nb_flags = 0,
8818 .mhomed = true,
8819 .num_ips = ctx->addresses_mhomed_num,
8820 .ips = ctx->addresses_mhomed,
8821 .apply_expected = true
8823 .defend = {
8824 .timeout = 10,
8825 .positive = true,
8827 .replica= {
8828 .type = WREPL_TYPE_UNIQUE,
8829 .state = WREPL_STATE_ACTIVE,
8830 .node = WREPL_NODE_B,
8831 .is_static = false,
8832 .num_ips = ctx->addresses_best_num,
8833 .ips = ctx->addresses_best,
8834 .mhomed_merge = true
8838 * unique,active vs. unique,active with different ip(s), positive response, with replicas address
8839 * TODO: check why the server sends a name release demand for one address?
8840 * the release demand has no effect to the database record...
8843 .line = __location__,
8844 .name = _NBT_NAME("_UA_UA_DI_PRA", 0x00, NULL),
8845 .comment= "C:BEST vs. B:BEST2 (C:BEST2,LR:BEST2) => C:BEST",
8846 .skip = (ctx->addresses_all_num < 2),
8847 .wins = {
8848 .nb_flags = 0,
8849 .mhomed = false,
8850 .num_ips = ctx->addresses_best_num,
8851 .ips = ctx->addresses_best,
8852 .apply_expected = true
8854 .defend = {
8855 .timeout = 10,
8856 .positive = true,
8857 .num_ips = ctx->addresses_best2_num,
8858 .ips = ctx->addresses_best2,
8859 .late_release = true
8861 .replica= {
8862 .type = WREPL_TYPE_UNIQUE,
8863 .state = WREPL_STATE_ACTIVE,
8864 .node = WREPL_NODE_B,
8865 .is_static = false,
8866 .num_ips = ctx->addresses_best2_num,
8867 .ips = ctx->addresses_best2,
8868 .apply_expected = false,
8872 * unique,active vs. unique,active with different ip(s), positive response, with all addresses
8875 .line = __location__,
8876 .name = _NBT_NAME("_UA_UA_DI_A", 0x00, NULL),
8877 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
8878 .skip = (ctx->addresses_all_num < 3),
8879 .wins = {
8880 .nb_flags = 0,
8881 .mhomed = false,
8882 .num_ips = ctx->addresses_best_num,
8883 .ips = ctx->addresses_best,
8884 .apply_expected = true
8886 .defend = {
8887 .timeout = 10,
8888 .positive = true,
8889 .num_ips = ctx->addresses_all_num,
8890 .ips = ctx->addresses_all,
8892 .replica= {
8893 .type = WREPL_TYPE_UNIQUE,
8894 .state = WREPL_STATE_ACTIVE,
8895 .node = WREPL_NODE_B,
8896 .is_static = false,
8897 .num_ips = ctx->addresses_best2_num,
8898 .ips = ctx->addresses_best2,
8899 .mhomed_merge = true,
8903 * unique,active vs. mhomed,active with different ip(s), positive response, with all addresses
8906 .line = __location__,
8907 .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL),
8908 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
8909 .skip = (ctx->addresses_all_num < 3),
8910 .wins = {
8911 .nb_flags = 0,
8912 .mhomed = false,
8913 .num_ips = ctx->addresses_best_num,
8914 .ips = ctx->addresses_best,
8915 .apply_expected = true
8917 .defend = {
8918 .timeout = 10,
8919 .positive = true,
8920 .num_ips = ctx->addresses_all_num,
8921 .ips = ctx->addresses_all,
8923 .replica= {
8924 .type = WREPL_TYPE_MHOMED,
8925 .state = WREPL_STATE_ACTIVE,
8926 .node = WREPL_NODE_B,
8927 .is_static = false,
8928 .num_ips = ctx->addresses_best2_num,
8929 .ips = ctx->addresses_best2,
8930 .mhomed_merge = true,
8934 * special group vs. special group merging section
8937 * sgroup,active vs. sgroup,active with different ip(s)
8940 .line = __location__,
8941 .section= "Test Replica vs. owned active: SGROUP vs. SGROUP tests",
8942 .name = _NBT_NAME("_SA_SA_DI_U", 0x1C, NULL),
8943 .skip = (ctx->addresses_all_num < 3),
8944 .wins = {
8945 .nb_flags = NBT_NM_GROUP,
8946 .mhomed = false,
8947 .num_ips = ctx->addresses_mhomed_num,
8948 .ips = ctx->addresses_mhomed,
8949 .apply_expected = true
8951 .defend = {
8952 .timeout = 0,
8954 .replica= {
8955 .type = WREPL_TYPE_SGROUP,
8956 .state = WREPL_STATE_ACTIVE,
8957 .node = WREPL_NODE_B,
8958 .is_static = false,
8959 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8960 .ips = addresses_B_3_4,
8961 .sgroup_merge = true
8965 * sgroup,active vs. sgroup,active with same ip(s)
8968 .line = __location__,
8969 .name = _NBT_NAME("_SA_SA_SI_U", 0x1C, NULL),
8970 .skip = (ctx->addresses_all_num < 3),
8971 .wins = {
8972 .nb_flags = NBT_NM_GROUP,
8973 .mhomed = false,
8974 .num_ips = ctx->addresses_mhomed_num,
8975 .ips = ctx->addresses_mhomed,
8976 .apply_expected = true
8978 .defend = {
8979 .timeout = 0,
8981 .replica= {
8982 .type = WREPL_TYPE_SGROUP,
8983 .state = WREPL_STATE_ACTIVE,
8984 .node = WREPL_NODE_B,
8985 .is_static = false,
8986 .num_ips = ctx->addresses_mhomed_num,
8987 .ips = ctx->addresses_mhomed,
8988 .sgroup_merge = true
8992 * sgroup,active vs. sgroup,active with superset ip(s)
8995 .line = __location__,
8996 .name = _NBT_NAME("_SA_SA_SP_U", 0x1C, NULL),
8997 .skip = (ctx->addresses_all_num < 3),
8998 .wins = {
8999 .nb_flags = NBT_NM_GROUP,
9000 .mhomed = false,
9001 .num_ips = ctx->addresses_mhomed_num,
9002 .ips = ctx->addresses_mhomed,
9003 .apply_expected = true
9005 .defend = {
9006 .timeout = 0,
9008 .replica= {
9009 .type = WREPL_TYPE_SGROUP,
9010 .state = WREPL_STATE_ACTIVE,
9011 .node = WREPL_NODE_B,
9012 .is_static = false,
9013 .num_ips = ctx->addresses_all_num,
9014 .ips = ctx->addresses_all,
9015 .sgroup_merge = true
9019 * sgroup,active vs. sgroup,active with subset ip(s)
9022 .line = __location__,
9023 .name = _NBT_NAME("_SA_SA_SB_U", 0x1C, NULL),
9024 .skip = (ctx->addresses_all_num < 3),
9025 .wins = {
9026 .nb_flags = NBT_NM_GROUP,
9027 .mhomed = false,
9028 .num_ips = ctx->addresses_mhomed_num,
9029 .ips = ctx->addresses_mhomed,
9030 .apply_expected = true
9032 .defend = {
9033 .timeout = 0,
9035 .replica= {
9036 .type = WREPL_TYPE_SGROUP,
9037 .state = WREPL_STATE_ACTIVE,
9038 .node = WREPL_NODE_B,
9039 .is_static = false,
9040 .num_ips = ctx->addresses_best_num,
9041 .ips = ctx->addresses_best,
9042 .sgroup_merge = true
9046 * sgroup,active vs. sgroup,tombstone with different ip(s)
9049 .line = __location__,
9050 .name = _NBT_NAME("_SA_ST_DI_U", 0x1C, NULL),
9051 .skip = (ctx->addresses_all_num < 3),
9052 .wins = {
9053 .nb_flags = NBT_NM_GROUP,
9054 .mhomed = false,
9055 .num_ips = ctx->addresses_mhomed_num,
9056 .ips = ctx->addresses_mhomed,
9057 .apply_expected = true
9059 .defend = {
9060 .timeout = 0,
9062 .replica= {
9063 .type = WREPL_TYPE_SGROUP,
9064 .state = WREPL_STATE_TOMBSTONE,
9065 .node = WREPL_NODE_B,
9066 .is_static = false,
9067 .num_ips = ARRAY_SIZE(addresses_B_3_4),
9068 .ips = addresses_B_3_4,
9069 .apply_expected = false
9073 * sgroup,active vs. sgroup,tombstone with same ip(s)
9076 .line = __location__,
9077 .name = _NBT_NAME("_SA_ST_SI_U", 0x1C, NULL),
9078 .skip = (ctx->addresses_all_num < 3),
9079 .wins = {
9080 .nb_flags = NBT_NM_GROUP,
9081 .mhomed = false,
9082 .num_ips = ctx->addresses_mhomed_num,
9083 .ips = ctx->addresses_mhomed,
9084 .apply_expected = true
9086 .defend = {
9087 .timeout = 0,
9089 .replica= {
9090 .type = WREPL_TYPE_SGROUP,
9091 .state = WREPL_STATE_TOMBSTONE,
9092 .node = WREPL_NODE_B,
9093 .is_static = false,
9094 .num_ips = ctx->addresses_mhomed_num,
9095 .ips = ctx->addresses_mhomed,
9096 .apply_expected = false
9100 * sgroup,active vs. sgroup,tombstone with superset ip(s)
9103 .line = __location__,
9104 .name = _NBT_NAME("_SA_ST_SP_U", 0x1C, NULL),
9105 .skip = (ctx->addresses_all_num < 3),
9106 .wins = {
9107 .nb_flags = NBT_NM_GROUP,
9108 .mhomed = false,
9109 .num_ips = ctx->addresses_mhomed_num,
9110 .ips = ctx->addresses_mhomed,
9111 .apply_expected = true
9113 .defend = {
9114 .timeout = 0,
9116 .replica= {
9117 .type = WREPL_TYPE_SGROUP,
9118 .state = WREPL_STATE_TOMBSTONE,
9119 .node = WREPL_NODE_B,
9120 .is_static = false,
9121 .num_ips = ctx->addresses_all_num,
9122 .ips = ctx->addresses_all,
9123 .apply_expected = false
9127 * sgroup,active vs. sgroup,tombstone with subset ip(s)
9130 .line = __location__,
9131 .name = _NBT_NAME("_SA_ST_SB_U", 0x1C, NULL),
9132 .skip = (ctx->addresses_all_num < 3),
9133 .wins = {
9134 .nb_flags = NBT_NM_GROUP,
9135 .mhomed = false,
9136 .num_ips = ctx->addresses_mhomed_num,
9137 .ips = ctx->addresses_mhomed,
9138 .apply_expected = true
9140 .defend = {
9141 .timeout = 0,
9143 .replica= {
9144 .type = WREPL_TYPE_SGROUP,
9145 .state = WREPL_STATE_TOMBSTONE,
9146 .node = WREPL_NODE_B,
9147 .is_static = false,
9148 .num_ips = ctx->addresses_best_num,
9149 .ips = ctx->addresses_best,
9150 .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",
9157 lp_nbt_port(tctx->lp_ctx));
9158 return true;
9161 torture_comment(tctx, "Test Replica records vs. owned active records\n");
9163 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
9164 struct timeval end;
9165 struct test_conflict_owned_active_vs_replica_struct record = records[i];
9166 uint32_t j, count = 1;
9167 const char *action;
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));
9179 continue;
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) {
9187 action = "REPLACE";
9188 } else {
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:""),
9196 action);
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,
9204 &records[i]);
9205 if (ctx->nbtsock_srv2) {
9206 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9207 test_conflict_owned_active_vs_replica_handler,
9208 &records[i]);
9212 * Setup Register
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.dest_port = lp_nbt_port(tctx->lp_ctx);
9220 name_register->in.address = records[i].wins.ips[j].ip;
9221 name_register->in.nb_flags = records[i].wins.nb_flags;
9222 name_register->in.register_demand= false;
9223 name_register->in.broadcast = false;
9224 name_register->in.multi_homed = records[i].wins.mhomed;
9225 name_register->in.ttl = 300000;
9226 name_register->in.timeout = 70;
9227 name_register->in.retries = 0;
9229 req = nbt_name_register_send(ctx->nbtsock, name_register);
9231 /* push the request on the wire */
9232 event_loop_once(ctx->nbtsock->event_ctx);
9235 * if we register multiple addresses,
9236 * the server will do name queries to see if the old addresses
9237 * are still alive
9239 if (records[i].wins.mhomed && j > 0) {
9240 end = timeval_current_ofs(records[i].defend.timeout,0);
9241 records[i].defend.ret = true;
9242 while (records[i].defend.timeout > 0) {
9243 event_loop_once(ctx->nbtsock_srv->event_ctx);
9244 if (timeval_expired(&end)) break;
9246 ret &= records[i].defend.ret;
9249 status = nbt_name_register_recv(req, ctx, name_register);
9250 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9251 torture_comment(tctx, "No response from %s for name register\n", ctx->address);
9252 ret = false;
9254 if (!NT_STATUS_IS_OK(status)) {
9255 torture_comment(tctx, "Bad response from %s for name register - %s\n",
9256 ctx->address, nt_errstr(status));
9257 ret = false;
9259 CHECK_VALUE(tctx, name_register->out.rcode, 0);
9260 CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address);
9261 CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type);
9262 CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name);
9263 CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope);
9264 CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[j].ip);
9267 /* Prepare for the current test */
9268 records[i].defend = record.defend;
9269 nbt_set_incoming_handler(ctx->nbtsock_srv,
9270 test_conflict_owned_active_vs_replica_handler,
9271 &records[i]);
9272 if (ctx->nbtsock_srv2) {
9273 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9274 test_conflict_owned_active_vs_replica_handler,
9275 &records[i]);
9279 * Setup Replica
9281 wins_name->name = &records[i].name;
9282 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
9283 records[i].replica.state,
9284 records[i].replica.node,
9285 records[i].replica.is_static);
9286 wins_name->id = ++ctx->b.max_version;
9287 if (wins_name->flags & 2) {
9288 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
9289 wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips);
9290 } else {
9291 wins_name->addresses.ip = records[i].replica.ips[0].ip;
9293 wins_name->unknown = "255.255.255.255";
9295 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9298 * wait for the name query, which is handled in
9299 * test_conflict_owned_active_vs_replica_handler()
9301 end = timeval_current_ofs(records[i].defend.timeout,0);
9302 records[i].defend.ret = true;
9303 while (records[i].defend.timeout > 0) {
9304 event_loop_once(ctx->nbtsock_srv->event_ctx);
9305 if (timeval_expired(&end)) break;
9307 ret &= records[i].defend.ret;
9309 if (records[i].defend.late_release) {
9310 records[i].defend = record.defend;
9311 records[i].defend.expect_release = true;
9313 * wait for the name release demand, which is handled in
9314 * test_conflict_owned_active_vs_replica_handler()
9316 end = timeval_current_ofs(records[i].defend.timeout,0);
9317 records[i].defend.ret = true;
9318 while (records[i].defend.timeout > 0) {
9319 event_loop_once(ctx->nbtsock_srv->event_ctx);
9320 if (timeval_expired(&end)) break;
9322 ret &= records[i].defend.ret;
9325 if (records[i].replica.mhomed_merge) {
9326 ret &= test_wrepl_mhomed_merged(tctx, ctx, &ctx->c,
9327 records[i].wins.num_ips, records[i].wins.ips,
9328 &ctx->b,
9329 records[i].replica.num_ips, records[i].replica.ips,
9330 wins_name);
9331 } else if (records[i].replica.sgroup_merge) {
9332 ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL,
9333 &ctx->c,
9334 records[i].wins.num_ips, records[i].wins.ips,
9335 &ctx->b,
9336 records[i].replica.num_ips, records[i].replica.ips,
9337 wins_name);
9338 } else {
9339 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name,
9340 records[i].replica.apply_expected);
9343 if (records[i].replica.apply_expected ||
9344 records[i].replica.mhomed_merge) {
9345 wins_name->name = &records[i].name;
9346 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9347 WREPL_STATE_TOMBSTONE,
9348 WREPL_NODE_B, false);
9349 wins_name->id = ++ctx->b.max_version;
9350 wins_name->addresses.ip = addresses_B_1[0].ip;
9351 wins_name->unknown = "255.255.255.255";
9353 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9354 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9355 } else {
9356 for (j=0; j < count; j++) {
9357 struct nbt_name_socket *nbtsock = ctx->nbtsock;
9359 if (ctx->myaddr2 && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2->addr) == 0) {
9360 nbtsock = ctx->nbtsock2;
9363 release->in.name = records[i].name;
9364 release->in.dest_addr = ctx->address;
9365 release->in.dest_port = lp_nbt_port(tctx->lp_ctx);
9366 release->in.address = records[i].wins.ips[j].ip;
9367 release->in.nb_flags = records[i].wins.nb_flags;
9368 release->in.broadcast = false;
9369 release->in.timeout = 30;
9370 release->in.retries = 0;
9372 status = nbt_name_release(nbtsock, ctx, release);
9373 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9374 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
9375 return false;
9377 if (!NT_STATUS_IS_OK(status)) {
9378 torture_comment(tctx, "Bad response from %s for name query - %s\n",
9379 ctx->address, nt_errstr(status));
9380 return false;
9382 CHECK_VALUE(tctx, release->out.rcode, 0);
9385 if (records[i].replica.sgroup_merge) {
9386 /* clean up the SGROUP record */
9387 wins_name->name = &records[i].name;
9388 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9389 WREPL_STATE_ACTIVE,
9390 WREPL_NODE_B, false);
9391 wins_name->id = ++ctx->b.max_version;
9392 wins_name->addresses.addresses.num_ips = 0;
9393 wins_name->addresses.addresses.ips = NULL;
9394 wins_name->unknown = "255.255.255.255";
9395 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9397 /* take ownership of the SGROUP record */
9398 wins_name->name = &records[i].name;
9399 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9400 WREPL_STATE_ACTIVE,
9401 WREPL_NODE_B, false);
9402 wins_name->id = ++ctx->b.max_version;
9403 wins_name->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
9404 wins_name->addresses.addresses.ips = discard_const(addresses_B_1);
9405 wins_name->unknown = "255.255.255.255";
9406 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9407 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9409 /* overwrite the SGROUP record with unique,tombstone */
9410 wins_name->name = &records[i].name;
9411 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9412 WREPL_STATE_TOMBSTONE,
9413 WREPL_NODE_B, false);
9414 wins_name->id = ++ctx->b.max_version;
9415 wins_name->addresses.ip = addresses_A_1[0].ip;
9416 wins_name->unknown = "255.255.255.255";
9417 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9418 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9422 if (!ret) {
9423 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
9424 return ret;
9428 return ret;
9431 #define _NBT_ASSERT(v, correct) do { \
9432 if ((v) != (correct)) { \
9433 printf("(%s) Incorrect value %s=%d - should be %s (%d)\n", \
9434 __location__, #v, v, #correct, correct); \
9435 return; \
9437 } while (0)
9439 #define _NBT_ASSERT_STRING(v, correct) do { \
9440 if ( ((!v) && (correct)) || \
9441 ((v) && (!correct)) || \
9442 ((v) && (correct) && strcmp(v,correct) != 0)) { \
9443 printf("(%s) Incorrect value %s=%s - should be %s\n", \
9444 __location__, #v, v, correct); \
9445 return; \
9447 } while (0)
9449 static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
9450 struct nbt_name_packet *req_packet,
9451 struct socket_address *src)
9453 struct nbt_name *name;
9454 struct nbt_name_packet *rep_packet;
9455 struct test_conflict_owned_active_vs_replica_struct *rec =
9456 (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
9458 _NBT_ASSERT(req_packet->qdcount, 1);
9459 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9460 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9462 name = &req_packet->questions[0].name;
9464 _NBT_ASSERT(name->type, rec->name.type);
9465 _NBT_ASSERT_STRING(name->name, rec->name.name);
9466 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9468 _NBT_ASSERT(rec->defend.expect_release, false);
9470 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9471 if (rep_packet == NULL) return;
9473 rep_packet->name_trn_id = req_packet->name_trn_id;
9474 rep_packet->ancount = 1;
9476 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9477 if (rep_packet->answers == NULL) return;
9479 rep_packet->answers[0].name = *name;
9480 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9481 rep_packet->answers[0].ttl = 0;
9483 if (rec->defend.positive) {
9484 uint32_t i, num_ips;
9485 const struct wrepl_ip *ips;
9487 if (rec->defend.num_ips > 0) {
9488 num_ips = rec->defend.num_ips;
9489 ips = rec->defend.ips;
9490 } else {
9491 num_ips = rec->wins.num_ips;
9492 ips = rec->wins.ips;
9495 /* send a positive reply */
9496 rep_packet->operation =
9497 NBT_FLAG_REPLY |
9498 NBT_OPCODE_QUERY |
9499 NBT_FLAG_AUTHORITIVE |
9500 NBT_FLAG_RECURSION_DESIRED |
9501 NBT_FLAG_RECURSION_AVAIL;
9503 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9505 rep_packet->answers[0].rdata.netbios.length = num_ips*6;
9506 rep_packet->answers[0].rdata.netbios.addresses =
9507 talloc_array(rep_packet->answers, struct nbt_rdata_address, num_ips);
9508 if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return;
9510 for (i=0; i < num_ips; i++) {
9511 struct nbt_rdata_address *addr =
9512 &rep_packet->answers[0].rdata.netbios.addresses[i];
9513 addr->nb_flags = rec->wins.nb_flags;
9514 addr->ipaddr = ips[i].ip;
9516 DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
9517 nbt_name_string(rep_packet, name), src->addr, src->port));
9518 } else {
9519 /* send a negative reply */
9520 rep_packet->operation =
9521 NBT_FLAG_REPLY |
9522 NBT_OPCODE_QUERY |
9523 NBT_FLAG_AUTHORITIVE |
9524 NBT_RCODE_NAM;
9526 rep_packet->answers[0].rr_type = NBT_QTYPE_NULL;
9528 ZERO_STRUCT(rep_packet->answers[0].rdata);
9530 DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
9531 nbt_name_string(rep_packet, name), src->addr, src->port));
9534 nbt_name_reply_send(nbtsock, src, rep_packet);
9535 talloc_free(rep_packet);
9537 /* make sure we push the reply to the wire */
9538 while (nbtsock->send_queue) {
9539 event_loop_once(nbtsock->event_ctx);
9541 msleep(1000);
9543 rec->defend.timeout = 0;
9544 rec->defend.ret = true;
9547 static void test_conflict_owned_active_vs_replica_handler_release(
9548 struct nbt_name_socket *nbtsock,
9549 struct nbt_name_packet *req_packet,
9550 struct socket_address *src)
9552 struct nbt_name *name;
9553 struct nbt_name_packet *rep_packet;
9554 struct test_conflict_owned_active_vs_replica_struct *rec =
9555 (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
9557 _NBT_ASSERT(req_packet->qdcount, 1);
9558 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9559 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9561 name = &req_packet->questions[0].name;
9563 _NBT_ASSERT(name->type, rec->name.type);
9564 _NBT_ASSERT_STRING(name->name, rec->name.name);
9565 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9567 _NBT_ASSERT(rec->defend.expect_release, true);
9569 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9570 if (rep_packet == NULL) return;
9572 rep_packet->name_trn_id = req_packet->name_trn_id;
9573 rep_packet->ancount = 1;
9574 rep_packet->operation =
9575 NBT_FLAG_REPLY |
9576 NBT_OPCODE_RELEASE |
9577 NBT_FLAG_AUTHORITIVE;
9579 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9580 if (rep_packet->answers == NULL) return;
9582 rep_packet->answers[0].name = *name;
9583 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9584 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9585 rep_packet->answers[0].ttl = req_packet->additional[0].ttl;
9586 rep_packet->answers[0].rdata = req_packet->additional[0].rdata;
9588 DEBUG(2,("Sending name release reply for %s to %s:%d\n",
9589 nbt_name_string(rep_packet, name), src->addr, src->port));
9591 nbt_name_reply_send(nbtsock, src, rep_packet);
9592 talloc_free(rep_packet);
9594 /* make sure we push the reply to the wire */
9595 while (nbtsock->send_queue) {
9596 event_loop_once(nbtsock->event_ctx);
9598 msleep(1000);
9600 rec->defend.timeout = 0;
9601 rec->defend.ret = true;
9604 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
9605 struct nbt_name_packet *req_packet,
9606 struct socket_address *src)
9608 struct test_conflict_owned_active_vs_replica_struct *rec =
9609 (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
9611 rec->defend.ret = false;
9613 switch (req_packet->operation & NBT_OPCODE) {
9614 case NBT_OPCODE_QUERY:
9615 test_conflict_owned_active_vs_replica_handler_query(nbtsock, req_packet, src);
9616 break;
9617 case NBT_OPCODE_RELEASE:
9618 test_conflict_owned_active_vs_replica_handler_release(nbtsock, req_packet, src);
9619 break;
9620 default:
9621 printf("%s: unexpected incoming packet\n", __location__);
9622 return;
9627 test WINS replication replica conflicts operations
9629 static bool torture_nbt_winsreplication_replica(struct torture_context *tctx)
9631 bool ret = true;
9632 struct test_wrepl_conflict_conn *ctx;
9634 const char *address;
9635 struct nbt_name name;
9637 if (!torture_nbt_get_name(tctx, &name, &address))
9638 return false;
9640 ctx = test_create_conflict_ctx(tctx, address);
9641 if (!ctx) return false;
9643 ret &= test_conflict_same_owner(tctx, ctx);
9644 ret &= test_conflict_different_owner(tctx, ctx);
9646 return ret;
9650 test WINS replication owned conflicts operations
9652 static bool torture_nbt_winsreplication_owned(struct torture_context *tctx)
9654 const char *address;
9655 struct nbt_name name;
9656 bool ret = true;
9657 struct test_wrepl_conflict_conn *ctx;
9659 if (torture_setting_bool(tctx, "quick", false))
9660 torture_skip(tctx,
9661 "skip NBT-WINSREPLICATION-OWNED test in quick test mode\n");
9663 if (!torture_nbt_get_name(tctx, &name, &address))
9664 return false;
9666 ctx = test_create_conflict_ctx(tctx, address);
9667 torture_assert(tctx, ctx != NULL, "Creating context failed");
9669 ret &= test_conflict_owned_released_vs_replica(tctx, ctx);
9670 ret &= test_conflict_owned_active_vs_replica(tctx, ctx);
9672 return ret;
9676 test simple WINS replication operations
9678 struct torture_suite *torture_nbt_winsreplication(TALLOC_CTX *mem_ctx)
9680 struct torture_suite *suite = torture_suite_create(
9681 mem_ctx, "WINSREPLICATION");
9682 struct torture_tcase *tcase;
9684 tcase = torture_suite_add_simple_test(suite, "assoc_ctx1",
9685 test_assoc_ctx1);
9686 tcase->tests->dangerous = true;
9688 torture_suite_add_simple_test(suite, "assoc_ctx2",
9689 test_assoc_ctx2);
9691 torture_suite_add_simple_test(suite, "wins_replication",
9692 test_wins_replication);
9694 torture_suite_add_simple_test(suite, "replica",
9695 torture_nbt_winsreplication_replica);
9697 torture_suite_add_simple_test(suite, "owned",
9698 torture_nbt_winsreplication_owned);
9700 return suite;