s4:torture/nbt/winsreplication: ignore incoming broadcast messages
[Samba/gebeck_regimport.git] / source4 / torture / nbt / winsreplication.c
blobe30bfdd852fae2d4b669c9a2f9f86c24851583c2
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 tevent_req *subreq;
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_packet packet;
92 struct wrepl_send_ctrl ctrl;
93 struct wrepl_packet *rep_packet;
94 struct wrepl_associate_stop assoc_stop;
95 NTSTATUS status;
96 struct nbt_name name;
97 const char *address;
98 bool ok;
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);
106 wrepl_socket2 = wrepl_socket_init(tctx, tctx->ev);
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 subreq = wrepl_request_send(tctx, tctx->ev, wrepl_socket2, &packet, &ctrl);
136 ok = tevent_req_poll(subreq, tctx->ev);
137 if (!ok) {
138 CHECK_STATUS(tctx, NT_STATUS_INTERNAL_ERROR, NT_STATUS_OK);
140 status = wrepl_request_recv(subreq, tctx, &rep_packet);
141 TALLOC_FREE(subreq);
142 CHECK_STATUS(tctx, status, NT_STATUS_OK);
144 torture_comment(tctx, "Send a association request (conn2), to make sure the last request was ignored\n");
145 status = wrepl_associate(wrepl_socket2, &associate2);
146 CHECK_STATUS(tctx, status, NT_STATUS_OK);
148 torture_comment(tctx, "Send a replication table query, with invalid assoc (conn1), receive answer from conn2\n");
149 ZERO_STRUCT(packet);
150 packet.opcode = WREPL_OPCODE_BITS;
151 packet.assoc_ctx = 0;
152 packet.mess_type = WREPL_REPLICATION;
153 packet.message.replication.command = WREPL_REPL_TABLE_QUERY;
154 status = wrepl_request(wrepl_socket1, tctx, &packet, &rep_packet);
155 CHECK_STATUS(tctx, status, NT_STATUS_OK);
157 torture_comment(tctx, "Send a association request (conn1), to make sure the last request was handled correct\n");
158 status = wrepl_associate(wrepl_socket1, &associate2);
159 CHECK_STATUS(tctx, status, NT_STATUS_OK);
161 assoc_stop.in.assoc_ctx = associate1.out.assoc_ctx;
162 assoc_stop.in.reason = 4;
163 torture_comment(tctx, "Send a association stop request (conn1), reson: %u\n", assoc_stop.in.reason);
164 status = wrepl_associate_stop(wrepl_socket1, &assoc_stop);
165 CHECK_STATUS(tctx, status, NT_STATUS_END_OF_FILE);
167 assoc_stop.in.assoc_ctx = associate2.out.assoc_ctx;
168 assoc_stop.in.reason = 0;
169 torture_comment(tctx, "Send a association stop request (conn2), reson: %u\n", assoc_stop.in.reason);
170 status = wrepl_associate_stop(wrepl_socket2, &assoc_stop);
171 CHECK_STATUS(tctx, status, NT_STATUS_OK);
173 torture_comment(tctx, "Close 2 wrepl connections\n");
174 talloc_free(wrepl_socket1);
175 talloc_free(wrepl_socket2);
176 return ret;
180 test if we always get back the same assoc_ctx
182 static bool test_assoc_ctx2(struct torture_context *tctx)
184 struct wrepl_socket *wrepl_socket;
185 struct wrepl_associate associate;
186 uint32_t assoc_ctx1;
187 struct nbt_name name;
188 NTSTATUS status;
189 const char *address;
191 if (!torture_nbt_get_name(tctx, &name, &address))
192 return false;
194 torture_comment(tctx, "Test if we always get back the same assoc_ctx\n");
196 wrepl_socket = wrepl_socket_init(tctx, tctx->ev);
198 torture_comment(tctx, "Setup wrepl connections\n");
199 status = wrepl_connect(wrepl_socket, wrepl_best_ip(tctx->lp_ctx, address), address);
200 CHECK_STATUS(tctx, status, NT_STATUS_OK);
202 torture_comment(tctx, "Send 1st start association request\n");
203 status = wrepl_associate(wrepl_socket, &associate);
204 CHECK_STATUS(tctx, status, NT_STATUS_OK);
205 assoc_ctx1 = associate.out.assoc_ctx;
206 torture_comment(tctx, "1st association context: 0x%x\n", associate.out.assoc_ctx);
208 torture_comment(tctx, "Send 2nd start association request\n");
209 status = wrepl_associate(wrepl_socket, &associate);
210 torture_assert_ntstatus_ok(tctx, status, "2nd start association failed");
211 torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1,
212 "Different context returned");
213 torture_comment(tctx, "2nd association context: 0x%x\n", associate.out.assoc_ctx);
215 torture_comment(tctx, "Send 3rd start association request\n");
216 status = wrepl_associate(wrepl_socket, &associate);
217 torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1,
218 "Different context returned");
219 CHECK_STATUS(tctx, status, NT_STATUS_OK);
220 torture_comment(tctx, "3rd association context: 0x%x\n", associate.out.assoc_ctx);
222 torture_comment(tctx, "Close wrepl connections\n");
223 talloc_free(wrepl_socket);
224 return true;
229 display a replication entry
231 static void display_entry(struct torture_context *tctx, struct wrepl_name *name)
233 int i;
235 torture_comment(tctx, "%s\n", nbt_name_string(tctx, &name->name));
236 torture_comment(tctx, "\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n",
237 name->type, name->state, name->node, name->is_static, (long long)name->version_id);
238 torture_comment(tctx, "\tRAW_FLAGS: 0x%08X OWNER: %-15s\n",
239 name->raw_flags, name->owner);
240 for (i=0;i<name->num_addresses;i++) {
241 torture_comment(tctx, "\tADDR: %-15s OWNER: %-15s\n",
242 name->addresses[i].address, name->addresses[i].owner);
247 test a full replication dump from a WINS server
249 static bool test_wins_replication(struct torture_context *tctx)
251 struct wrepl_socket *wrepl_socket;
252 NTSTATUS status;
253 int i, j;
254 struct wrepl_associate associate;
255 struct wrepl_pull_table pull_table;
256 struct wrepl_pull_names pull_names;
257 struct nbt_name name;
258 const char *address;
260 if (!torture_nbt_get_name(tctx, &name, &address))
261 return false;
263 torture_comment(tctx, "Test one pull replication cycle\n");
265 wrepl_socket = wrepl_socket_init(tctx, tctx->ev);
267 torture_comment(tctx, "Setup wrepl connections\n");
268 status = wrepl_connect(wrepl_socket, wrepl_best_ip(tctx->lp_ctx, address), address);
269 CHECK_STATUS(tctx, status, NT_STATUS_OK);
271 torture_comment(tctx, "Send a start association request\n");
273 status = wrepl_associate(wrepl_socket, &associate);
274 CHECK_STATUS(tctx, status, NT_STATUS_OK);
276 torture_comment(tctx, "association context: 0x%x\n", associate.out.assoc_ctx);
278 torture_comment(tctx, "Send a replication table query\n");
279 pull_table.in.assoc_ctx = associate.out.assoc_ctx;
281 status = wrepl_pull_table(wrepl_socket, tctx, &pull_table);
282 if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) {
283 struct wrepl_associate_stop assoc_stop;
285 assoc_stop.in.assoc_ctx = associate.out.assoc_ctx;
286 assoc_stop.in.reason = 0;
288 wrepl_associate_stop(wrepl_socket, &assoc_stop);
290 torture_fail(tctx, "We are not a valid pull partner for the server");
292 CHECK_STATUS(tctx, status, NT_STATUS_OK);
294 torture_comment(tctx, "Found %d replication partners\n", pull_table.out.num_partners);
296 for (i=0;i<pull_table.out.num_partners;i++) {
297 struct wrepl_wins_owner *partner = &pull_table.out.partners[i];
298 torture_comment(tctx, "%s max_version=%6llu min_version=%6llu type=%d\n",
299 partner->address,
300 (long long)partner->max_version,
301 (long long)partner->min_version,
302 partner->type);
304 pull_names.in.assoc_ctx = associate.out.assoc_ctx;
305 pull_names.in.partner = *partner;
307 status = wrepl_pull_names(wrepl_socket, tctx, &pull_names);
308 CHECK_STATUS(tctx, status, NT_STATUS_OK);
310 torture_comment(tctx, "Received %d names\n", pull_names.out.num_names);
312 for (j=0;j<pull_names.out.num_names;j++) {
313 display_entry(tctx, &pull_names.out.names[j]);
317 torture_comment(tctx, "Close wrepl connections\n");
318 talloc_free(wrepl_socket);
319 return true;
322 struct test_wrepl_conflict_conn {
323 const char *address;
324 struct wrepl_socket *pull;
325 uint32_t pull_assoc;
327 #define TEST_OWNER_A_ADDRESS "127.65.65.1"
328 #define TEST_ADDRESS_A_PREFIX "127.0.65"
329 #define TEST_OWNER_B_ADDRESS "127.66.66.1"
330 #define TEST_ADDRESS_B_PREFIX "127.0.66"
331 #define TEST_OWNER_X_ADDRESS "127.88.88.1"
332 #define TEST_ADDRESS_X_PREFIX "127.0.88"
334 struct wrepl_wins_owner a, b, c, x;
336 struct socket_address *myaddr;
337 struct socket_address *myaddr2;
338 struct nbt_name_socket *nbtsock;
339 struct nbt_name_socket *nbtsock2;
341 struct nbt_name_socket *nbtsock_srv;
342 struct nbt_name_socket *nbtsock_srv2;
344 uint32_t addresses_best_num;
345 struct wrepl_ip *addresses_best;
347 uint32_t addresses_best2_num;
348 struct wrepl_ip *addresses_best2;
350 uint32_t addresses_all_num;
351 struct wrepl_ip *addresses_all;
353 uint32_t addresses_mhomed_num;
354 struct wrepl_ip *addresses_mhomed;
357 static const struct wrepl_ip addresses_A_1[] = {
359 .owner = TEST_OWNER_A_ADDRESS,
360 .ip = TEST_ADDRESS_A_PREFIX".1"
363 static const struct wrepl_ip addresses_A_2[] = {
365 .owner = TEST_OWNER_A_ADDRESS,
366 .ip = TEST_ADDRESS_A_PREFIX".2"
369 static const struct wrepl_ip addresses_A_3_4[] = {
371 .owner = TEST_OWNER_A_ADDRESS,
372 .ip = TEST_ADDRESS_A_PREFIX".3"
375 .owner = TEST_OWNER_A_ADDRESS,
376 .ip = TEST_ADDRESS_A_PREFIX".4"
379 static const struct wrepl_ip addresses_A_3_4_X_3_4[] = {
381 .owner = TEST_OWNER_A_ADDRESS,
382 .ip = TEST_ADDRESS_A_PREFIX".3"
385 .owner = TEST_OWNER_A_ADDRESS,
386 .ip = TEST_ADDRESS_A_PREFIX".4"
389 .owner = TEST_OWNER_X_ADDRESS,
390 .ip = TEST_ADDRESS_X_PREFIX".3"
393 .owner = TEST_OWNER_X_ADDRESS,
394 .ip = TEST_ADDRESS_X_PREFIX".4"
397 static const struct wrepl_ip addresses_A_3_4_B_3_4[] = {
399 .owner = TEST_OWNER_A_ADDRESS,
400 .ip = TEST_ADDRESS_A_PREFIX".3"
403 .owner = TEST_OWNER_A_ADDRESS,
404 .ip = TEST_ADDRESS_A_PREFIX".4"
407 .owner = TEST_OWNER_B_ADDRESS,
408 .ip = TEST_ADDRESS_B_PREFIX".3"
411 .owner = TEST_OWNER_B_ADDRESS,
412 .ip = TEST_ADDRESS_B_PREFIX".4"
415 static const struct wrepl_ip addresses_A_3_4_OWNER_B[] = {
417 .owner = TEST_OWNER_B_ADDRESS,
418 .ip = TEST_ADDRESS_A_PREFIX".3"
421 .owner = TEST_OWNER_B_ADDRESS,
422 .ip = TEST_ADDRESS_A_PREFIX".4"
425 static const struct wrepl_ip addresses_A_3_4_X_3_4_OWNER_B[] = {
427 .owner = TEST_OWNER_B_ADDRESS,
428 .ip = TEST_ADDRESS_A_PREFIX".3"
431 .owner = TEST_OWNER_B_ADDRESS,
432 .ip = TEST_ADDRESS_A_PREFIX".4"
435 .owner = TEST_OWNER_B_ADDRESS,
436 .ip = TEST_ADDRESS_X_PREFIX".3"
439 .owner = TEST_OWNER_B_ADDRESS,
440 .ip = TEST_ADDRESS_X_PREFIX".4"
444 static const struct wrepl_ip addresses_A_3_4_X_1_2[] = {
446 .owner = TEST_OWNER_A_ADDRESS,
447 .ip = TEST_ADDRESS_A_PREFIX".3"
450 .owner = TEST_OWNER_A_ADDRESS,
451 .ip = TEST_ADDRESS_A_PREFIX".4"
454 .owner = TEST_OWNER_X_ADDRESS,
455 .ip = TEST_ADDRESS_X_PREFIX".1"
458 .owner = TEST_OWNER_X_ADDRESS,
459 .ip = TEST_ADDRESS_X_PREFIX".2"
463 static const struct wrepl_ip addresses_B_1[] = {
465 .owner = TEST_OWNER_B_ADDRESS,
466 .ip = TEST_ADDRESS_B_PREFIX".1"
469 static const struct wrepl_ip addresses_B_2[] = {
471 .owner = TEST_OWNER_B_ADDRESS,
472 .ip = TEST_ADDRESS_B_PREFIX".2"
475 static const struct wrepl_ip addresses_B_3_4[] = {
477 .owner = TEST_OWNER_B_ADDRESS,
478 .ip = TEST_ADDRESS_B_PREFIX".3"
481 .owner = TEST_OWNER_B_ADDRESS,
482 .ip = TEST_ADDRESS_B_PREFIX".4"
485 static const struct wrepl_ip addresses_B_3_4_X_3_4[] = {
487 .owner = TEST_OWNER_B_ADDRESS,
488 .ip = TEST_ADDRESS_B_PREFIX".3"
491 .owner = TEST_OWNER_B_ADDRESS,
492 .ip = TEST_ADDRESS_B_PREFIX".4"
495 .owner = TEST_OWNER_X_ADDRESS,
496 .ip = TEST_ADDRESS_X_PREFIX".3"
499 .owner = TEST_OWNER_X_ADDRESS,
500 .ip = TEST_ADDRESS_X_PREFIX".4"
503 static const struct wrepl_ip addresses_B_3_4_X_1_2[] = {
505 .owner = TEST_OWNER_B_ADDRESS,
506 .ip = TEST_ADDRESS_B_PREFIX".3"
509 .owner = TEST_OWNER_B_ADDRESS,
510 .ip = TEST_ADDRESS_B_PREFIX".4"
513 .owner = TEST_OWNER_X_ADDRESS,
514 .ip = TEST_ADDRESS_X_PREFIX".1"
517 .owner = TEST_OWNER_X_ADDRESS,
518 .ip = TEST_ADDRESS_X_PREFIX".2"
522 static const struct wrepl_ip addresses_X_1_2[] = {
524 .owner = TEST_OWNER_X_ADDRESS,
525 .ip = TEST_ADDRESS_X_PREFIX".1"
528 .owner = TEST_OWNER_X_ADDRESS,
529 .ip = TEST_ADDRESS_X_PREFIX".2"
532 static const struct wrepl_ip addresses_X_3_4[] = {
534 .owner = TEST_OWNER_X_ADDRESS,
535 .ip = TEST_ADDRESS_X_PREFIX".3"
538 .owner = TEST_OWNER_X_ADDRESS,
539 .ip = TEST_ADDRESS_X_PREFIX".4"
543 static struct test_wrepl_conflict_conn *test_create_conflict_ctx(
544 struct torture_context *tctx, const char *address)
546 struct test_wrepl_conflict_conn *ctx;
547 struct wrepl_associate associate;
548 struct wrepl_pull_table pull_table;
549 struct socket_address *nbt_srv_addr;
550 NTSTATUS status;
551 uint32_t i;
552 struct interface *ifaces;
554 ctx = talloc_zero(tctx, struct test_wrepl_conflict_conn);
555 if (!ctx) return NULL;
557 ctx->address = address;
558 ctx->pull = wrepl_socket_init(ctx, tctx->ev);
559 if (!ctx->pull) return NULL;
561 torture_comment(tctx, "Setup wrepl conflict pull connection\n");
562 status = wrepl_connect(ctx->pull, wrepl_best_ip(tctx->lp_ctx, ctx->address), ctx->address);
563 if (!NT_STATUS_IS_OK(status)) return NULL;
565 status = wrepl_associate(ctx->pull, &associate);
566 if (!NT_STATUS_IS_OK(status)) return NULL;
568 ctx->pull_assoc = associate.out.assoc_ctx;
570 ctx->a.address = TEST_OWNER_A_ADDRESS;
571 ctx->a.max_version = 0;
572 ctx->a.min_version = 0;
573 ctx->a.type = 1;
575 ctx->b.address = TEST_OWNER_B_ADDRESS;
576 ctx->b.max_version = 0;
577 ctx->b.min_version = 0;
578 ctx->b.type = 1;
580 ctx->x.address = TEST_OWNER_X_ADDRESS;
581 ctx->x.max_version = 0;
582 ctx->x.min_version = 0;
583 ctx->x.type = 1;
585 ctx->c.address = address;
586 ctx->c.max_version = 0;
587 ctx->c.min_version = 0;
588 ctx->c.type = 1;
590 pull_table.in.assoc_ctx = ctx->pull_assoc;
591 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
592 if (!NT_STATUS_IS_OK(status)) return NULL;
594 for (i=0; i < pull_table.out.num_partners; i++) {
595 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
596 ctx->a.max_version = pull_table.out.partners[i].max_version;
597 ctx->a.min_version = pull_table.out.partners[i].min_version;
599 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
600 ctx->b.max_version = pull_table.out.partners[i].max_version;
601 ctx->b.min_version = pull_table.out.partners[i].min_version;
603 if (strcmp(TEST_OWNER_X_ADDRESS,pull_table.out.partners[i].address)==0) {
604 ctx->x.max_version = pull_table.out.partners[i].max_version;
605 ctx->x.min_version = pull_table.out.partners[i].min_version;
607 if (strcmp(address,pull_table.out.partners[i].address)==0) {
608 ctx->c.max_version = pull_table.out.partners[i].max_version;
609 ctx->c.min_version = pull_table.out.partners[i].min_version;
613 talloc_free(pull_table.out.partners);
615 ctx->nbtsock = nbt_name_socket_init(ctx, tctx->ev);
616 if (!ctx->nbtsock) return NULL;
618 load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
620 ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_best_ip(ifaces, address), 0);
621 if (!ctx->myaddr) return NULL;
623 for (i = 0; i < iface_count(ifaces); i++) {
624 if (strcmp(ctx->myaddr->addr, iface_n_ip(ifaces, i)) == 0) continue;
625 ctx->myaddr2 = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_n_ip(ifaces, i), 0);
626 if (!ctx->myaddr2) return NULL;
627 break;
630 status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0);
631 if (!NT_STATUS_IS_OK(status)) return NULL;
633 ctx->nbtsock_srv = nbt_name_socket_init(ctx, tctx->ev);
634 if (!ctx->nbtsock_srv) return NULL;
636 /* Make a port 137 version of ctx->myaddr */
637 nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lpcfg_nbt_port(tctx->lp_ctx));
638 if (!nbt_srv_addr) return NULL;
640 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
641 status = socket_listen(ctx->nbtsock_srv->sock, nbt_srv_addr, 0, 0);
642 talloc_free(nbt_srv_addr);
643 if (!NT_STATUS_IS_OK(status)) {
644 /* this isn't fatal */
645 talloc_free(ctx->nbtsock_srv);
646 ctx->nbtsock_srv = NULL;
649 if (ctx->myaddr2 && ctx->nbtsock_srv) {
650 ctx->nbtsock2 = nbt_name_socket_init(ctx, tctx->ev);
651 if (!ctx->nbtsock2) return NULL;
653 status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0);
654 if (!NT_STATUS_IS_OK(status)) return NULL;
656 ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx);
657 if (!ctx->nbtsock_srv2) return NULL;
659 /* Make a port 137 version of ctx->myaddr2 */
660 nbt_srv_addr = socket_address_from_strings(tctx,
661 ctx->nbtsock_srv->sock->backend_name,
662 ctx->myaddr2->addr,
663 lpcfg_nbt_port(tctx->lp_ctx));
664 if (!nbt_srv_addr) return NULL;
666 /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
667 status = socket_listen(ctx->nbtsock_srv2->sock, ctx->myaddr2, 0, 0);
668 talloc_free(nbt_srv_addr);
669 if (!NT_STATUS_IS_OK(status)) {
670 /* this isn't fatal */
671 talloc_free(ctx->nbtsock_srv2);
672 ctx->nbtsock_srv2 = NULL;
676 ctx->addresses_best_num = 1;
677 ctx->addresses_best = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best_num);
678 if (!ctx->addresses_best) return NULL;
679 ctx->addresses_best[0].owner = ctx->b.address;
680 ctx->addresses_best[0].ip = ctx->myaddr->addr;
682 ctx->addresses_all_num = iface_count(ifaces);
683 ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num);
684 if (!ctx->addresses_all) return NULL;
685 for (i=0; i < ctx->addresses_all_num; i++) {
686 ctx->addresses_all[i].owner = ctx->b.address;
687 ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(ifaces, i));
688 if (!ctx->addresses_all[i].ip) return NULL;
691 if (ctx->nbtsock_srv2) {
692 ctx->addresses_best2_num = 1;
693 ctx->addresses_best2 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best2_num);
694 if (!ctx->addresses_best2) return NULL;
695 ctx->addresses_best2[0].owner = ctx->b.address;
696 ctx->addresses_best2[0].ip = ctx->myaddr2->addr;
698 ctx->addresses_mhomed_num = 2;
699 ctx->addresses_mhomed = talloc_array(ctx, struct wrepl_ip, ctx->addresses_mhomed_num);
700 if (!ctx->addresses_mhomed) return NULL;
701 ctx->addresses_mhomed[0].owner = ctx->b.address;
702 ctx->addresses_mhomed[0].ip = ctx->myaddr->addr;
703 ctx->addresses_mhomed[1].owner = ctx->b.address;
704 ctx->addresses_mhomed[1].ip = ctx->myaddr2->addr;
707 return ctx;
710 static bool test_wrepl_update_one(struct torture_context *tctx,
711 struct test_wrepl_conflict_conn *ctx,
712 const struct wrepl_wins_owner *owner,
713 const struct wrepl_wins_name *name)
715 struct wrepl_socket *wrepl_socket;
716 struct wrepl_associate associate;
717 struct wrepl_packet update_packet, repl_send;
718 struct wrepl_table *update;
719 struct wrepl_wins_owner wrepl_wins_owners[1];
720 struct wrepl_packet *repl_recv;
721 struct wrepl_wins_owner *send_request;
722 struct wrepl_send_reply *send_reply;
723 struct wrepl_wins_name wrepl_wins_names[1];
724 uint32_t assoc_ctx;
725 NTSTATUS status;
727 wrepl_socket = wrepl_socket_init(ctx, tctx->ev);
729 status = wrepl_connect(wrepl_socket, wrepl_best_ip(tctx->lp_ctx, ctx->address), ctx->address);
730 CHECK_STATUS(tctx, status, NT_STATUS_OK);
732 status = wrepl_associate(wrepl_socket, &associate);
733 CHECK_STATUS(tctx, status, NT_STATUS_OK);
734 assoc_ctx = associate.out.assoc_ctx;
736 /* now send a WREPL_REPL_UPDATE message */
737 ZERO_STRUCT(update_packet);
738 update_packet.opcode = WREPL_OPCODE_BITS;
739 update_packet.assoc_ctx = assoc_ctx;
740 update_packet.mess_type = WREPL_REPLICATION;
741 update_packet.message.replication.command = WREPL_REPL_UPDATE;
742 update = &update_packet.message.replication.info.table;
744 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
745 update->partners = wrepl_wins_owners;
746 update->initiator = "0.0.0.0";
748 wrepl_wins_owners[0] = *owner;
750 status = wrepl_request(wrepl_socket, wrepl_socket,
751 &update_packet, &repl_recv);
752 CHECK_STATUS(tctx, status, NT_STATUS_OK);
753 CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_REPLICATION);
754 CHECK_VALUE(tctx, repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
755 send_request = &repl_recv->message.replication.info.owner;
757 ZERO_STRUCT(repl_send);
758 repl_send.opcode = WREPL_OPCODE_BITS;
759 repl_send.assoc_ctx = assoc_ctx;
760 repl_send.mess_type = WREPL_REPLICATION;
761 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
762 send_reply = &repl_send.message.replication.info.reply;
764 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
765 send_reply->names = wrepl_wins_names;
767 wrepl_wins_names[0] = *name;
769 status = wrepl_request(wrepl_socket, wrepl_socket,
770 &repl_send, &repl_recv);
771 CHECK_STATUS(tctx, status, NT_STATUS_OK);
772 CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
773 CHECK_VALUE(tctx, repl_recv->message.stop.reason, 0);
775 talloc_free(wrepl_socket);
776 return true;
779 static bool test_wrepl_is_applied(struct torture_context *tctx,
780 struct test_wrepl_conflict_conn *ctx,
781 const struct wrepl_wins_owner *owner,
782 const struct wrepl_wins_name *name,
783 bool expected)
785 NTSTATUS status;
786 struct wrepl_pull_names pull_names;
787 struct wrepl_name *names;
789 pull_names.in.assoc_ctx = ctx->pull_assoc;
790 pull_names.in.partner = *owner;
791 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
793 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
794 CHECK_STATUS(tctx, status, NT_STATUS_OK);
795 torture_assert(tctx, pull_names.out.num_names == (expected?1:0),
796 talloc_asprintf(tctx, "Invalid number of records returned - expected %d got %d", expected, pull_names.out.num_names));
798 names = pull_names.out.names;
800 if (expected) {
801 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
802 names[0].state,
803 names[0].node,
804 names[0].is_static);
805 char *expected_scope = NULL;
806 CHECK_VALUE(tctx, names[0].name.type, name->name->type);
807 CHECK_VALUE_STRING(tctx, names[0].name.name, name->name->name);
809 if (names[0].name.scope) {
810 expected_scope = talloc_strndup(tctx,
811 name->name->scope,
812 237);
814 CHECK_VALUE_STRING(tctx, names[0].name.scope, expected_scope);
815 CHECK_VALUE(tctx, flags, name->flags);
816 CHECK_VALUE_UINT64(tctx, names[0].version_id, name->id);
818 if (flags & 2) {
819 CHECK_VALUE(tctx, names[0].num_addresses,
820 name->addresses.addresses.num_ips);
821 } else {
822 CHECK_VALUE(tctx, names[0].num_addresses, 1);
823 CHECK_VALUE_STRING(tctx, names[0].addresses[0].address,
824 name->addresses.ip);
827 talloc_free(pull_names.out.names);
828 return true;
831 static bool test_wrepl_mhomed_merged(struct torture_context *tctx,
832 struct test_wrepl_conflict_conn *ctx,
833 const struct wrepl_wins_owner *owner1,
834 uint32_t num_ips1, const struct wrepl_ip *ips1,
835 const struct wrepl_wins_owner *owner2,
836 uint32_t num_ips2, const struct wrepl_ip *ips2,
837 const struct wrepl_wins_name *name2)
839 NTSTATUS status;
840 struct wrepl_pull_names pull_names;
841 struct wrepl_name *names;
842 uint32_t flags;
843 uint32_t i, j;
844 uint32_t num_ips = num_ips1 + num_ips2;
846 for (i = 0; i < num_ips2; i++) {
847 for (j = 0; j < num_ips1; j++) {
848 if (strcmp(ips2[i].ip,ips1[j].ip) == 0) {
849 num_ips--;
850 break;
855 pull_names.in.assoc_ctx = ctx->pull_assoc;
856 pull_names.in.partner = *owner2;
857 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
859 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
860 CHECK_STATUS(tctx, status, NT_STATUS_OK);
861 CHECK_VALUE(tctx, pull_names.out.num_names, 1);
863 names = pull_names.out.names;
865 flags = WREPL_NAME_FLAGS(names[0].type,
866 names[0].state,
867 names[0].node,
868 names[0].is_static);
869 CHECK_VALUE(tctx, names[0].name.type, name2->name->type);
870 CHECK_VALUE_STRING(tctx, names[0].name.name, name2->name->name);
871 CHECK_VALUE_STRING(tctx, names[0].name.scope, name2->name->scope);
872 CHECK_VALUE(tctx, flags, name2->flags | WREPL_TYPE_MHOMED);
873 CHECK_VALUE_UINT64(tctx, names[0].version_id, name2->id);
875 CHECK_VALUE(tctx, names[0].num_addresses, num_ips);
877 for (i = 0; i < names[0].num_addresses; i++) {
878 const char *addr = names[0].addresses[i].address;
879 const char *owner = names[0].addresses[i].owner;
880 bool found = false;
882 for (j = 0; j < num_ips2; j++) {
883 if (strcmp(addr, ips2[j].ip) == 0) {
884 found = true;
885 CHECK_VALUE_STRING(tctx, owner, owner2->address);
886 break;
890 if (found) continue;
892 for (j = 0; j < num_ips1; j++) {
893 if (strcmp(addr, ips1[j].ip) == 0) {
894 found = true;
895 CHECK_VALUE_STRING(tctx, owner, owner1->address);
896 break;
900 if (found) continue;
902 CHECK_VALUE_STRING(tctx, addr, "not found in address list");
904 talloc_free(pull_names.out.names);
905 return true;
908 static bool test_wrepl_sgroup_merged(struct torture_context *tctx,
909 struct test_wrepl_conflict_conn *ctx,
910 struct wrepl_wins_owner *merge_owner,
911 struct wrepl_wins_owner *owner1,
912 uint32_t num_ips1, const struct wrepl_ip *ips1,
913 struct wrepl_wins_owner *owner2,
914 uint32_t num_ips2, const struct wrepl_ip *ips2,
915 const struct wrepl_wins_name *name2)
917 NTSTATUS status;
918 struct wrepl_pull_names pull_names;
919 struct wrepl_name *names;
920 struct wrepl_name *name = NULL;
921 uint32_t flags;
922 uint32_t i, j;
923 uint32_t num_ips = num_ips1 + num_ips2;
925 if (!merge_owner) {
926 merge_owner = &ctx->c;
929 for (i = 0; i < num_ips1; i++) {
930 if (owner1 != &ctx->c && strcmp(ips1[i].owner,owner2->address) == 0) {
931 num_ips--;
932 continue;
934 for (j = 0; j < num_ips2; j++) {
935 if (strcmp(ips1[i].ip,ips2[j].ip) == 0) {
936 num_ips--;
937 break;
943 pull_names.in.assoc_ctx = ctx->pull_assoc;
944 pull_names.in.partner = *merge_owner;
945 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
946 pull_names.in.partner.max_version = 0;
948 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
949 CHECK_STATUS(tctx, status, NT_STATUS_OK);
951 names = pull_names.out.names;
953 for (i = 0; i < pull_names.out.num_names; i++) {
954 if (names[i].name.type != name2->name->type) continue;
955 if (!names[i].name.name) continue;
956 if (strcmp(names[i].name.name, name2->name->name) != 0) continue;
957 if (names[i].name.scope) continue;
959 name = &names[i];
962 if (pull_names.out.num_names > 0) {
963 merge_owner->max_version = names[pull_names.out.num_names-1].version_id;
966 if (!name) {
967 torture_comment(tctx, "%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name));
968 return false;
971 flags = WREPL_NAME_FLAGS(name->type,
972 name->state,
973 name->node,
974 name->is_static);
975 CHECK_VALUE(tctx, name->name.type, name2->name->type);
976 CHECK_VALUE_STRING(tctx, name->name.name, name2->name->name);
977 CHECK_VALUE_STRING(tctx, name->name.scope, name2->name->scope);
978 CHECK_VALUE(tctx, flags, name2->flags);
980 CHECK_VALUE(tctx, name->num_addresses, num_ips);
982 for (i = 0; i < name->num_addresses; i++) {
983 const char *addr = name->addresses[i].address;
984 const char *owner = name->addresses[i].owner;
985 bool found = false;
987 for (j = 0; j < num_ips2; j++) {
988 if (strcmp(addr, ips2[j].ip) == 0) {
989 found = true;
990 CHECK_VALUE_STRING(tctx, owner, ips2[j].owner);
991 break;
995 if (found) continue;
997 for (j = 0; j < num_ips1; j++) {
998 if (strcmp(addr, ips1[j].ip) == 0) {
999 found = true;
1000 if (owner1 == &ctx->c) {
1001 CHECK_VALUE_STRING(tctx, owner, owner1->address);
1002 } else {
1003 CHECK_VALUE_STRING(tctx, owner, ips1[j].owner);
1005 break;
1009 if (found) continue;
1011 CHECK_VALUE_STRING(tctx, addr, "not found in address list");
1013 talloc_free(pull_names.out.names);
1014 return true;
1017 static char *test_nbt_winsrepl_scope_string(TALLOC_CTX *mem_ctx, uint8_t count)
1019 char *res;
1020 uint8_t i;
1022 res = talloc_array(mem_ctx, char, count+1);
1023 if (res == NULL) {
1024 return NULL;
1027 for (i=0; i < count; i++) {
1028 res[i] = '0' + (i%10);
1031 res[count] = '\0';
1033 talloc_set_name_const(res, res);
1035 return res;
1038 static bool test_conflict_same_owner(struct torture_context *tctx,
1039 struct test_wrepl_conflict_conn *ctx)
1041 bool ret = true;
1042 struct wrepl_wins_name wins_name1;
1043 struct wrepl_wins_name wins_name2;
1044 struct wrepl_wins_name *wins_name_tmp;
1045 struct wrepl_wins_name *wins_name_last;
1046 struct wrepl_wins_name *wins_name_cur;
1047 uint32_t i,j;
1048 struct nbt_name names[] = {
1049 _NBT_NAME("_SAME_OWNER_A", 0x00, NULL),
1050 _NBT_NAME("_SAME_OWNER_A", 0x00,
1051 test_nbt_winsrepl_scope_string(tctx, 1)),
1052 _NBT_NAME("_SAME_OWNER_A", 0x00,
1053 test_nbt_winsrepl_scope_string(tctx, 2)),
1054 _NBT_NAME("_SAME_OWNER_A", 0x00,
1055 test_nbt_winsrepl_scope_string(tctx, 3)),
1056 _NBT_NAME("_SAME_OWNER_A", 0x00,
1057 test_nbt_winsrepl_scope_string(tctx, 4)),
1058 _NBT_NAME("_SAME_OWNER_A", 0x00,
1059 test_nbt_winsrepl_scope_string(tctx, 5)),
1060 _NBT_NAME("_SAME_OWNER_A", 0x00,
1061 test_nbt_winsrepl_scope_string(tctx, 6)),
1062 _NBT_NAME("_SAME_OWNER_A", 0x00,
1063 test_nbt_winsrepl_scope_string(tctx, 7)),
1064 _NBT_NAME("_SAME_OWNER_A", 0x00,
1065 test_nbt_winsrepl_scope_string(tctx, 8)),
1066 _NBT_NAME("_SAME_OWNER_A", 0x00,
1067 test_nbt_winsrepl_scope_string(tctx, 9)),
1068 _NBT_NAME("_SAME_OWNER_A", 0x00,
1069 test_nbt_winsrepl_scope_string(tctx, 237)),
1070 _NBT_NAME("_SAME_OWNER_A", 0x00,
1071 test_nbt_winsrepl_scope_string(tctx, 238)),
1072 _NBT_NAME("_SAME_OWNER_A", 0x1C, NULL),
1074 struct {
1075 enum wrepl_name_type type;
1076 enum wrepl_name_state state;
1077 enum wrepl_name_node node;
1078 bool is_static;
1079 uint32_t num_ips;
1080 const struct wrepl_ip *ips;
1081 } records[] = {
1083 .type = WREPL_TYPE_GROUP,
1084 .state = WREPL_STATE_ACTIVE,
1085 .node = WREPL_NODE_B,
1086 .is_static = false,
1087 .num_ips = ARRAY_SIZE(addresses_A_1),
1088 .ips = addresses_A_1,
1090 .type = WREPL_TYPE_UNIQUE,
1091 .state = WREPL_STATE_ACTIVE,
1092 .node = WREPL_NODE_B,
1093 .is_static = false,
1094 .num_ips = ARRAY_SIZE(addresses_A_1),
1095 .ips = addresses_A_1,
1097 .type = WREPL_TYPE_UNIQUE,
1098 .state = WREPL_STATE_ACTIVE,
1099 .node = WREPL_NODE_B,
1100 .is_static = false,
1101 .num_ips = ARRAY_SIZE(addresses_A_2),
1102 .ips = addresses_A_2,
1104 .type = WREPL_TYPE_UNIQUE,
1105 .state = WREPL_STATE_ACTIVE,
1106 .node = WREPL_NODE_B,
1107 .is_static = true,
1108 .num_ips = ARRAY_SIZE(addresses_A_1),
1109 .ips = addresses_A_1,
1111 .type = WREPL_TYPE_UNIQUE,
1112 .state = WREPL_STATE_ACTIVE,
1113 .node = WREPL_NODE_B,
1114 .is_static = false,
1115 .num_ips = ARRAY_SIZE(addresses_A_2),
1116 .ips = addresses_A_2,
1118 .type = WREPL_TYPE_SGROUP,
1119 .state = WREPL_STATE_TOMBSTONE,
1120 .node = WREPL_NODE_B,
1121 .is_static = false,
1122 .num_ips = ARRAY_SIZE(addresses_A_2),
1123 .ips = addresses_A_2,
1125 .type = WREPL_TYPE_MHOMED,
1126 .state = WREPL_STATE_TOMBSTONE,
1127 .node = WREPL_NODE_B,
1128 .is_static = false,
1129 .num_ips = ARRAY_SIZE(addresses_A_1),
1130 .ips = addresses_A_1,
1132 .type = WREPL_TYPE_MHOMED,
1133 .state = WREPL_STATE_RELEASED,
1134 .node = WREPL_NODE_B,
1135 .is_static = false,
1136 .num_ips = ARRAY_SIZE(addresses_A_2),
1137 .ips = addresses_A_2,
1139 .type = WREPL_TYPE_SGROUP,
1140 .state = WREPL_STATE_ACTIVE,
1141 .node = WREPL_NODE_B,
1142 .is_static = false,
1143 .num_ips = ARRAY_SIZE(addresses_A_1),
1144 .ips = addresses_A_1,
1146 .type = WREPL_TYPE_SGROUP,
1147 .state = WREPL_STATE_ACTIVE,
1148 .node = WREPL_NODE_B,
1149 .is_static = false,
1150 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1151 .ips = addresses_A_3_4,
1153 .type = WREPL_TYPE_SGROUP,
1154 .state = WREPL_STATE_TOMBSTONE,
1155 .node = WREPL_NODE_B,
1156 .is_static = false,
1157 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1158 .ips = addresses_B_3_4,
1160 /* the last one should always be a unique,tomstone record! */
1161 .type = WREPL_TYPE_UNIQUE,
1162 .state = WREPL_STATE_TOMBSTONE,
1163 .node = WREPL_NODE_B,
1164 .is_static = false,
1165 .num_ips = ARRAY_SIZE(addresses_A_1),
1166 .ips = addresses_A_1,
1170 wins_name_tmp = NULL;
1171 wins_name_last = &wins_name2;
1172 wins_name_cur = &wins_name1;
1174 for (j=0; ret && j < ARRAY_SIZE(names); j++) {
1175 torture_comment(tctx, "Test Replica Conflicts with same owner[%s] for %s\n",
1176 nbt_name_string(ctx, &names[j]), ctx->a.address);
1178 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
1179 wins_name_tmp = wins_name_last;
1180 wins_name_last = wins_name_cur;
1181 wins_name_cur = wins_name_tmp;
1183 if (i > 0) {
1184 torture_comment(tctx, "%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
1185 wrepl_name_type_string(records[i-1].type),
1186 wrepl_name_state_string(records[i-1].state),
1187 (records[i-1].is_static?",static":""),
1188 wrepl_name_type_string(records[i].type),
1189 wrepl_name_state_string(records[i].state),
1190 (records[i].is_static?",static":""),
1191 (records[i-1].ips==records[i].ips?"same":"different"),
1192 "REPLACE");
1195 wins_name_cur->name = &names[j];
1196 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
1197 records[i].state,
1198 records[i].node,
1199 records[i].is_static);
1200 wins_name_cur->id = ++ctx->a.max_version;
1201 if (wins_name_cur->flags & 2) {
1202 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
1203 wins_name_cur->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
1204 records[i].ips);
1205 } else {
1206 wins_name_cur->addresses.ip = records[i].ips[0].ip;
1208 wins_name_cur->unknown = "255.255.255.255";
1210 ret &= test_wrepl_update_one(tctx, ctx, &ctx->a,wins_name_cur);
1211 if (records[i].state == WREPL_STATE_RELEASED) {
1212 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_last, false);
1213 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, false);
1214 } else {
1215 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, true);
1218 /* the first one is a cleanup run */
1219 if (!ret && i == 0) ret = true;
1221 if (!ret) {
1222 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, __location__);
1223 return ret;
1227 return ret;
1230 static bool test_conflict_different_owner(struct torture_context *tctx,
1231 struct test_wrepl_conflict_conn *ctx)
1233 bool ret = true;
1234 struct wrepl_wins_name wins_name1;
1235 struct wrepl_wins_name wins_name2;
1236 struct wrepl_wins_name *wins_name_r1;
1237 struct wrepl_wins_name *wins_name_r2;
1238 uint32_t i;
1239 struct {
1240 const char *line; /* just better debugging */
1241 struct nbt_name name;
1242 const char *comment;
1243 bool extra; /* not the worst case, this is an extra test */
1244 bool cleanup;
1245 struct {
1246 struct wrepl_wins_owner *owner;
1247 enum wrepl_name_type type;
1248 enum wrepl_name_state state;
1249 enum wrepl_name_node node;
1250 bool is_static;
1251 uint32_t num_ips;
1252 const struct wrepl_ip *ips;
1253 bool apply_expected;
1254 bool sgroup_merge;
1255 struct wrepl_wins_owner *merge_owner;
1256 bool sgroup_cleanup;
1257 } r1, r2;
1258 } records[] = {
1260 * NOTE: the first record and the last applied one
1261 * needs to be from the same owner,
1262 * to not conflict in the next smbtorture run!!!
1265 .line = __location__,
1266 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1267 .cleanup= true,
1268 .r1 = {
1269 .owner = &ctx->b,
1270 .type = WREPL_TYPE_UNIQUE,
1271 .state = WREPL_STATE_TOMBSTONE,
1272 .node = WREPL_NODE_B,
1273 .is_static = false,
1274 .num_ips = ARRAY_SIZE(addresses_B_1),
1275 .ips = addresses_B_1,
1276 .apply_expected = true /* ignored */
1278 .r2 = {
1279 .owner = &ctx->a,
1280 .type = WREPL_TYPE_UNIQUE,
1281 .state = WREPL_STATE_TOMBSTONE,
1282 .node = WREPL_NODE_B,
1283 .is_static = false,
1284 .num_ips = ARRAY_SIZE(addresses_A_1),
1285 .ips = addresses_A_1,
1286 .apply_expected = true /* ignored */
1291 * unique vs unique section
1294 * unique,active vs. unique,active
1295 * => should be replaced
1298 .line = __location__,
1299 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1300 .r1 = {
1301 .owner = &ctx->a,
1302 .type = WREPL_TYPE_UNIQUE,
1303 .state = WREPL_STATE_ACTIVE,
1304 .node = WREPL_NODE_B,
1305 .is_static = false,
1306 .num_ips = ARRAY_SIZE(addresses_A_1),
1307 .ips = addresses_A_1,
1308 .apply_expected = true
1310 .r2 = {
1311 .owner = &ctx->b,
1312 .type = WREPL_TYPE_UNIQUE,
1313 .state = WREPL_STATE_ACTIVE,
1314 .node = WREPL_NODE_B,
1315 .is_static = false,
1316 .num_ips = ARRAY_SIZE(addresses_B_1),
1317 .ips = addresses_B_1,
1318 .apply_expected = true
1323 * unique,active vs. unique,tombstone
1324 * => should NOT be replaced
1327 .line = __location__,
1328 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1329 .r1 = {
1330 .owner = &ctx->b,
1331 .type = WREPL_TYPE_UNIQUE,
1332 .state = WREPL_STATE_ACTIVE,
1333 .node = WREPL_NODE_B,
1334 .is_static = false,
1335 .num_ips = ARRAY_SIZE(addresses_B_1),
1336 .ips = addresses_B_1,
1337 .apply_expected = true
1339 .r2 = {
1340 .owner = &ctx->a,
1341 .type = WREPL_TYPE_UNIQUE,
1342 .state = WREPL_STATE_TOMBSTONE,
1343 .node = WREPL_NODE_B,
1344 .is_static = false,
1345 .num_ips = ARRAY_SIZE(addresses_B_1),
1346 .ips = addresses_B_1,
1347 .apply_expected = false
1352 * unique,released vs. unique,active
1353 * => should be replaced
1356 .line = __location__,
1357 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1358 .r1 = {
1359 .owner = &ctx->b,
1360 .type = WREPL_TYPE_UNIQUE,
1361 .state = WREPL_STATE_RELEASED,
1362 .node = WREPL_NODE_B,
1363 .is_static = false,
1364 .num_ips = ARRAY_SIZE(addresses_B_1),
1365 .ips = addresses_B_1,
1366 .apply_expected = false
1368 .r2 = {
1369 .owner = &ctx->a,
1370 .type = WREPL_TYPE_UNIQUE,
1371 .state = WREPL_STATE_ACTIVE,
1372 .node = WREPL_NODE_B,
1373 .is_static = false,
1374 .num_ips = ARRAY_SIZE(addresses_A_1),
1375 .ips = addresses_A_1,
1376 .apply_expected = true
1381 * unique,released vs. unique,tombstone
1382 * => should be replaced
1385 .line = __location__,
1386 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1387 .r1 = {
1388 .owner = &ctx->a,
1389 .type = WREPL_TYPE_UNIQUE,
1390 .state = WREPL_STATE_RELEASED,
1391 .node = WREPL_NODE_B,
1392 .is_static = false,
1393 .num_ips = ARRAY_SIZE(addresses_A_1),
1394 .ips = addresses_A_1,
1395 .apply_expected = false
1397 .r2 = {
1398 .owner = &ctx->b,
1399 .type = WREPL_TYPE_UNIQUE,
1400 .state = WREPL_STATE_TOMBSTONE,
1401 .node = WREPL_NODE_B,
1402 .is_static = false,
1403 .num_ips = ARRAY_SIZE(addresses_B_1),
1404 .ips = addresses_B_1,
1405 .apply_expected = true
1410 * unique,tombstone vs. unique,active
1411 * => should be replaced
1414 .line = __location__,
1415 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1416 .r1 = {
1417 .owner = &ctx->b,
1418 .type = WREPL_TYPE_UNIQUE,
1419 .state = WREPL_STATE_TOMBSTONE,
1420 .node = WREPL_NODE_B,
1421 .is_static = false,
1422 .num_ips = ARRAY_SIZE(addresses_B_1),
1423 .ips = addresses_B_1,
1424 .apply_expected = true
1426 .r2 = {
1427 .owner = &ctx->a,
1428 .type = WREPL_TYPE_UNIQUE,
1429 .state = WREPL_STATE_ACTIVE,
1430 .node = WREPL_NODE_B,
1431 .is_static = false,
1432 .num_ips = ARRAY_SIZE(addresses_A_1),
1433 .ips = addresses_A_1,
1434 .apply_expected = true
1439 * unique,tombstone vs. unique,tombstone
1440 * => should be replaced
1443 .line = __location__,
1444 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1445 .r1 = {
1446 .owner = &ctx->a,
1447 .type = WREPL_TYPE_UNIQUE,
1448 .state = WREPL_STATE_TOMBSTONE,
1449 .node = WREPL_NODE_B,
1450 .is_static = false,
1451 .num_ips = ARRAY_SIZE(addresses_A_1),
1452 .ips = addresses_A_1,
1453 .apply_expected = true
1455 .r2 = {
1456 .owner = &ctx->b,
1457 .type = WREPL_TYPE_UNIQUE,
1458 .state = WREPL_STATE_TOMBSTONE,
1459 .node = WREPL_NODE_B,
1460 .is_static = false,
1461 .num_ips = ARRAY_SIZE(addresses_B_1),
1462 .ips = addresses_B_1,
1463 .apply_expected = true
1469 * unique vs normal groups section,
1472 * unique,active vs. group,active
1473 * => should be replaced
1476 .line = __location__,
1477 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1478 .r1 = {
1479 .owner = &ctx->b,
1480 .type = WREPL_TYPE_UNIQUE,
1481 .state = WREPL_STATE_ACTIVE,
1482 .node = WREPL_NODE_B,
1483 .is_static = false,
1484 .num_ips = ARRAY_SIZE(addresses_B_1),
1485 .ips = addresses_B_1,
1486 .apply_expected = true
1488 .r2 = {
1489 .owner = &ctx->a,
1490 .type = WREPL_TYPE_GROUP,
1491 .state = WREPL_STATE_ACTIVE,
1492 .node = WREPL_NODE_B,
1493 .is_static = false,
1494 .num_ips = ARRAY_SIZE(addresses_A_1),
1495 .ips = addresses_A_1,
1496 .apply_expected = true
1501 * unique,active vs. group,tombstone
1502 * => should NOT be replaced
1505 .line = __location__,
1506 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1507 .r1 = {
1508 .owner = &ctx->a,
1509 .type = WREPL_TYPE_UNIQUE,
1510 .state = WREPL_STATE_ACTIVE,
1511 .node = WREPL_NODE_B,
1512 .is_static = false,
1513 .num_ips = ARRAY_SIZE(addresses_A_1),
1514 .ips = addresses_A_1,
1515 .apply_expected = true
1517 .r2 = {
1518 .owner = &ctx->b,
1519 .type = WREPL_TYPE_GROUP,
1520 .state = WREPL_STATE_TOMBSTONE,
1521 .node = WREPL_NODE_B,
1522 .is_static = false,
1523 .num_ips = ARRAY_SIZE(addresses_A_1),
1524 .ips = addresses_A_1,
1525 .apply_expected = false
1530 * unique,released vs. group,active
1531 * => should be replaced
1534 .line = __location__,
1535 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1536 .r1 = {
1537 .owner = &ctx->a,
1538 .type = WREPL_TYPE_UNIQUE,
1539 .state = WREPL_STATE_RELEASED,
1540 .node = WREPL_NODE_B,
1541 .is_static = false,
1542 .num_ips = ARRAY_SIZE(addresses_A_1),
1543 .ips = addresses_A_1,
1544 .apply_expected = false
1546 .r2 = {
1547 .owner = &ctx->b,
1548 .type = WREPL_TYPE_GROUP,
1549 .state = WREPL_STATE_ACTIVE,
1550 .node = WREPL_NODE_B,
1551 .is_static = false,
1552 .num_ips = ARRAY_SIZE(addresses_B_1),
1553 .ips = addresses_B_1,
1554 .apply_expected = true
1559 * unique,released vs. group,tombstone
1560 * => should be replaced
1563 .line = __location__,
1564 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1565 .r1 = {
1566 .owner = &ctx->b,
1567 .type = WREPL_TYPE_UNIQUE,
1568 .state = WREPL_STATE_RELEASED,
1569 .node = WREPL_NODE_B,
1570 .is_static = false,
1571 .num_ips = ARRAY_SIZE(addresses_B_1),
1572 .ips = addresses_B_1,
1573 .apply_expected = false
1575 .r2 = {
1576 .owner = &ctx->a,
1577 .type = WREPL_TYPE_GROUP,
1578 .state = WREPL_STATE_TOMBSTONE,
1579 .node = WREPL_NODE_B,
1580 .is_static = false,
1581 .num_ips = ARRAY_SIZE(addresses_A_1),
1582 .ips = addresses_A_1,
1583 .apply_expected = true
1588 * unique,tombstone vs. group,active
1589 * => should be replaced
1592 .line = __location__,
1593 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1594 .r1 = {
1595 .owner = &ctx->a,
1596 .type = WREPL_TYPE_UNIQUE,
1597 .state = WREPL_STATE_TOMBSTONE,
1598 .node = WREPL_NODE_B,
1599 .is_static = false,
1600 .num_ips = ARRAY_SIZE(addresses_A_1),
1601 .ips = addresses_A_1,
1602 .apply_expected = true
1604 .r2 = {
1605 .owner = &ctx->b,
1606 .type = WREPL_TYPE_GROUP,
1607 .state = WREPL_STATE_ACTIVE,
1608 .node = WREPL_NODE_B,
1609 .is_static = false,
1610 .num_ips = ARRAY_SIZE(addresses_B_1),
1611 .ips = addresses_B_1,
1612 .apply_expected = true
1617 * unique,tombstone vs. group,tombstone
1618 * => should be replaced
1621 .line = __location__,
1622 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1623 .r1 = {
1624 .owner = &ctx->b,
1625 .type = WREPL_TYPE_UNIQUE,
1626 .state = WREPL_STATE_TOMBSTONE,
1627 .node = WREPL_NODE_B,
1628 .is_static = false,
1629 .num_ips = ARRAY_SIZE(addresses_B_1),
1630 .ips = addresses_B_1,
1631 .apply_expected = true
1633 .r2 = {
1634 .owner = &ctx->a,
1635 .type = WREPL_TYPE_GROUP,
1636 .state = WREPL_STATE_TOMBSTONE,
1637 .node = WREPL_NODE_B,
1638 .is_static = false,
1639 .num_ips = ARRAY_SIZE(addresses_A_1),
1640 .ips = addresses_A_1,
1641 .apply_expected = true
1646 * unique vs special groups section,
1649 * unique,active vs. sgroup,active
1650 * => should NOT be replaced
1653 .line = __location__,
1654 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1655 .r1 = {
1656 .owner = &ctx->a,
1657 .type = WREPL_TYPE_UNIQUE,
1658 .state = WREPL_STATE_ACTIVE,
1659 .node = WREPL_NODE_B,
1660 .is_static = false,
1661 .num_ips = ARRAY_SIZE(addresses_A_1),
1662 .ips = addresses_A_1,
1663 .apply_expected = true
1665 .r2 = {
1666 .owner = &ctx->b,
1667 .type = WREPL_TYPE_SGROUP,
1668 .state = WREPL_STATE_ACTIVE,
1669 .node = WREPL_NODE_B,
1670 .is_static = false,
1671 .num_ips = ARRAY_SIZE(addresses_A_1),
1672 .ips = addresses_A_1,
1673 .apply_expected = false
1678 * unique,active vs. sgroup,tombstone
1679 * => should NOT be replaced
1682 .line = __location__,
1683 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1684 .r1 = {
1685 .owner = &ctx->a,
1686 .type = WREPL_TYPE_UNIQUE,
1687 .state = WREPL_STATE_ACTIVE,
1688 .node = WREPL_NODE_B,
1689 .is_static = false,
1690 .num_ips = ARRAY_SIZE(addresses_A_1),
1691 .ips = addresses_A_1,
1692 .apply_expected = true
1694 .r2 = {
1695 .owner = &ctx->b,
1696 .type = WREPL_TYPE_SGROUP,
1697 .state = WREPL_STATE_TOMBSTONE,
1698 .node = WREPL_NODE_B,
1699 .is_static = false,
1700 .num_ips = ARRAY_SIZE(addresses_A_1),
1701 .ips = addresses_A_1,
1702 .apply_expected = false
1707 * unique,released vs. sgroup,active
1708 * => should be replaced
1711 .line = __location__,
1712 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1713 .r1 = {
1714 .owner = &ctx->a,
1715 .type = WREPL_TYPE_UNIQUE,
1716 .state = WREPL_STATE_RELEASED,
1717 .node = WREPL_NODE_B,
1718 .is_static = false,
1719 .num_ips = ARRAY_SIZE(addresses_A_1),
1720 .ips = addresses_A_1,
1721 .apply_expected = false
1723 .r2 = {
1724 .owner = &ctx->b,
1725 .type = WREPL_TYPE_SGROUP,
1726 .state = WREPL_STATE_ACTIVE,
1727 .node = WREPL_NODE_B,
1728 .is_static = false,
1729 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1730 .ips = addresses_B_3_4,
1731 .apply_expected = true
1736 * unique,released vs. sgroup,tombstone
1737 * => should be replaced
1740 .line = __location__,
1741 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1742 .r1 = {
1743 .owner = &ctx->b,
1744 .type = WREPL_TYPE_UNIQUE,
1745 .state = WREPL_STATE_RELEASED,
1746 .node = WREPL_NODE_B,
1747 .is_static = false,
1748 .num_ips = ARRAY_SIZE(addresses_B_1),
1749 .ips = addresses_B_1,
1750 .apply_expected = false
1752 .r2 = {
1753 .owner = &ctx->a,
1754 .type = WREPL_TYPE_SGROUP,
1755 .state = WREPL_STATE_TOMBSTONE,
1756 .node = WREPL_NODE_B,
1757 .is_static = false,
1758 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1759 .ips = addresses_A_3_4,
1760 .apply_expected = true
1765 * unique,tombstone vs. sgroup,active
1766 * => should be replaced
1769 .line = __location__,
1770 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1771 .r1 = {
1772 .owner = &ctx->a,
1773 .type = WREPL_TYPE_UNIQUE,
1774 .state = WREPL_STATE_TOMBSTONE,
1775 .node = WREPL_NODE_B,
1776 .is_static = false,
1777 .num_ips = ARRAY_SIZE(addresses_A_1),
1778 .ips = addresses_A_1,
1779 .apply_expected = true
1781 .r2 = {
1782 .owner = &ctx->b,
1783 .type = WREPL_TYPE_SGROUP,
1784 .state = WREPL_STATE_ACTIVE,
1785 .node = WREPL_NODE_B,
1786 .is_static = false,
1787 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1788 .ips = addresses_B_3_4,
1789 .apply_expected = true
1794 * unique,tombstone vs. sgroup,tombstone
1795 * => should be replaced
1798 .line = __location__,
1799 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1800 .r1 = {
1801 .owner = &ctx->b,
1802 .type = WREPL_TYPE_UNIQUE,
1803 .state = WREPL_STATE_TOMBSTONE,
1804 .node = WREPL_NODE_B,
1805 .is_static = false,
1806 .num_ips = ARRAY_SIZE(addresses_B_1),
1807 .ips = addresses_B_1,
1808 .apply_expected = true
1810 .r2 = {
1811 .owner = &ctx->a,
1812 .type = WREPL_TYPE_SGROUP,
1813 .state = WREPL_STATE_TOMBSTONE,
1814 .node = WREPL_NODE_B,
1815 .is_static = false,
1816 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1817 .ips = addresses_A_3_4,
1818 .apply_expected = true
1823 * unique vs multi homed section,
1826 * unique,active vs. mhomed,active
1827 * => should be replaced
1830 .line = __location__,
1831 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1832 .r1 = {
1833 .owner = &ctx->a,
1834 .type = WREPL_TYPE_UNIQUE,
1835 .state = WREPL_STATE_ACTIVE,
1836 .node = WREPL_NODE_B,
1837 .is_static = false,
1838 .num_ips = ARRAY_SIZE(addresses_A_1),
1839 .ips = addresses_A_1,
1840 .apply_expected = true
1842 .r2 = {
1843 .owner = &ctx->b,
1844 .type = WREPL_TYPE_MHOMED,
1845 .state = WREPL_STATE_ACTIVE,
1846 .node = WREPL_NODE_B,
1847 .is_static = false,
1848 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1849 .ips = addresses_B_3_4,
1850 .apply_expected = true
1855 * unique,active vs. mhomed,tombstone
1856 * => should NOT be replaced
1859 .line = __location__,
1860 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1861 .r1 = {
1862 .owner = &ctx->b,
1863 .type = WREPL_TYPE_UNIQUE,
1864 .state = WREPL_STATE_ACTIVE,
1865 .node = WREPL_NODE_B,
1866 .is_static = false,
1867 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1868 .ips = addresses_B_3_4,
1869 .apply_expected = true
1871 .r2 = {
1872 .owner = &ctx->a,
1873 .type = WREPL_TYPE_MHOMED,
1874 .state = WREPL_STATE_TOMBSTONE,
1875 .node = WREPL_NODE_B,
1876 .is_static = false,
1877 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1878 .ips = addresses_B_3_4,
1879 .apply_expected = false
1884 * unique,released vs. mhomed,active
1885 * => should be replaced
1888 .line = __location__,
1889 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1890 .r1 = {
1891 .owner = &ctx->b,
1892 .type = WREPL_TYPE_UNIQUE,
1893 .state = WREPL_STATE_RELEASED,
1894 .node = WREPL_NODE_B,
1895 .is_static = false,
1896 .num_ips = ARRAY_SIZE(addresses_B_1),
1897 .ips = addresses_B_1,
1898 .apply_expected = false
1900 .r2 = {
1901 .owner = &ctx->a,
1902 .type = WREPL_TYPE_MHOMED,
1903 .state = WREPL_STATE_ACTIVE,
1904 .node = WREPL_NODE_B,
1905 .is_static = false,
1906 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1907 .ips = addresses_A_3_4,
1908 .apply_expected = true
1913 * unique,released vs. mhomed,tombstone
1914 * => should be replaced
1917 .line = __location__,
1918 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1919 .r1 = {
1920 .owner = &ctx->a,
1921 .type = WREPL_TYPE_UNIQUE,
1922 .state = WREPL_STATE_RELEASED,
1923 .node = WREPL_NODE_B,
1924 .is_static = false,
1925 .num_ips = ARRAY_SIZE(addresses_A_1),
1926 .ips = addresses_A_1,
1927 .apply_expected = false
1929 .r2 = {
1930 .owner = &ctx->b,
1931 .type = WREPL_TYPE_MHOMED,
1932 .state = WREPL_STATE_TOMBSTONE,
1933 .node = WREPL_NODE_B,
1934 .is_static = false,
1935 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1936 .ips = addresses_B_3_4,
1937 .apply_expected = true
1942 * unique,tombstone vs. mhomed,active
1943 * => should be replaced
1946 .line = __location__,
1947 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1948 .r1 = {
1949 .owner = &ctx->b,
1950 .type = WREPL_TYPE_UNIQUE,
1951 .state = WREPL_STATE_TOMBSTONE,
1952 .node = WREPL_NODE_B,
1953 .is_static = false,
1954 .num_ips = ARRAY_SIZE(addresses_B_1),
1955 .ips = addresses_B_1,
1956 .apply_expected = true
1958 .r2 = {
1959 .owner = &ctx->a,
1960 .type = WREPL_TYPE_MHOMED,
1961 .state = WREPL_STATE_ACTIVE,
1962 .node = WREPL_NODE_B,
1963 .is_static = false,
1964 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1965 .ips = addresses_A_3_4,
1966 .apply_expected = true
1971 * unique,tombstone vs. mhomed,tombstone
1972 * => should be replaced
1975 .line = __location__,
1976 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1977 .r1 = {
1978 .owner = &ctx->a,
1979 .type = WREPL_TYPE_UNIQUE,
1980 .state = WREPL_STATE_TOMBSTONE,
1981 .node = WREPL_NODE_B,
1982 .is_static = false,
1983 .num_ips = ARRAY_SIZE(addresses_A_1),
1984 .ips = addresses_A_1,
1985 .apply_expected = true
1987 .r2 = {
1988 .owner = &ctx->b,
1989 .type = WREPL_TYPE_MHOMED,
1990 .state = WREPL_STATE_TOMBSTONE,
1991 .node = WREPL_NODE_B,
1992 .is_static = false,
1993 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1994 .ips = addresses_B_3_4,
1995 .apply_expected = true
2000 * normal groups vs unique section,
2003 * group,active vs. unique,active
2004 * => should NOT be replaced
2007 .line = __location__,
2008 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2009 .r1 = {
2010 .owner = &ctx->a,
2011 .type = WREPL_TYPE_GROUP,
2012 .state = WREPL_STATE_ACTIVE,
2013 .node = WREPL_NODE_B,
2014 .is_static = false,
2015 .num_ips = ARRAY_SIZE(addresses_A_1),
2016 .ips = addresses_A_1,
2017 .apply_expected = true
2019 .r2 = {
2020 .owner = &ctx->b,
2021 .type = WREPL_TYPE_UNIQUE,
2022 .state = WREPL_STATE_ACTIVE,
2023 .node = WREPL_NODE_B,
2024 .is_static = false,
2025 .num_ips = ARRAY_SIZE(addresses_A_1),
2026 .ips = addresses_A_1,
2027 .apply_expected = false
2032 * group,active vs. unique,tombstone
2033 * => should NOT be replaced
2036 .line = __location__,
2037 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2038 .r1 = {
2039 .owner = &ctx->a,
2040 .type = WREPL_TYPE_GROUP,
2041 .state = WREPL_STATE_ACTIVE,
2042 .node = WREPL_NODE_B,
2043 .is_static = false,
2044 .num_ips = ARRAY_SIZE(addresses_A_1),
2045 .ips = addresses_A_1,
2046 .apply_expected = true
2048 .r2 = {
2049 .owner = &ctx->b,
2050 .type = WREPL_TYPE_UNIQUE,
2051 .state = WREPL_STATE_TOMBSTONE,
2052 .node = WREPL_NODE_B,
2053 .is_static = false,
2054 .num_ips = ARRAY_SIZE(addresses_A_1),
2055 .ips = addresses_A_1,
2056 .apply_expected = false
2061 * group,released vs. unique,active
2062 * => should NOT be replaced
2065 .line = __location__,
2066 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2067 .r1 = {
2068 .owner = &ctx->a,
2069 .type = WREPL_TYPE_GROUP,
2070 .state = WREPL_STATE_RELEASED,
2071 .node = WREPL_NODE_B,
2072 .is_static = false,
2073 .num_ips = ARRAY_SIZE(addresses_A_1),
2074 .ips = addresses_A_1,
2075 .apply_expected = false
2077 .r2 = {
2078 .owner = &ctx->b,
2079 .type = WREPL_TYPE_UNIQUE,
2080 .state = WREPL_STATE_ACTIVE,
2081 .node = WREPL_NODE_B,
2082 .is_static = false,
2083 .num_ips = ARRAY_SIZE(addresses_A_1),
2084 .ips = addresses_A_1,
2085 .apply_expected = false
2090 * group,released vs. unique,tombstone
2091 * => should NOT be replaced
2094 .line = __location__,
2095 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2096 .r1 = {
2097 .owner = &ctx->a,
2098 .type = WREPL_TYPE_GROUP,
2099 .state = WREPL_STATE_RELEASED,
2100 .node = WREPL_NODE_B,
2101 .is_static = false,
2102 .num_ips = ARRAY_SIZE(addresses_A_1),
2103 .ips = addresses_A_1,
2104 .apply_expected = false
2106 .r2 = {
2107 .owner = &ctx->b,
2108 .type = WREPL_TYPE_UNIQUE,
2109 .state = WREPL_STATE_TOMBSTONE,
2110 .node = WREPL_NODE_B,
2111 .is_static = false,
2112 .num_ips = ARRAY_SIZE(addresses_A_1),
2113 .ips = addresses_A_1,
2114 .apply_expected = false
2119 * group,tombstone vs. unique,active
2120 * => should NOT be replaced
2123 .line = __location__,
2124 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2125 .r1 = {
2126 .owner = &ctx->a,
2127 .type = WREPL_TYPE_GROUP,
2128 .state = WREPL_STATE_TOMBSTONE,
2129 .node = WREPL_NODE_B,
2130 .is_static = false,
2131 .num_ips = ARRAY_SIZE(addresses_A_1),
2132 .ips = addresses_A_1,
2133 .apply_expected = true
2135 .r2 = {
2136 .owner = &ctx->b,
2137 .type = WREPL_TYPE_UNIQUE,
2138 .state = WREPL_STATE_ACTIVE,
2139 .node = WREPL_NODE_B,
2140 .is_static = false,
2141 .num_ips = ARRAY_SIZE(addresses_A_1),
2142 .ips = addresses_A_1,
2143 .apply_expected = false
2148 * group,tombstone vs. unique,tombstone
2149 * => should NOT be replaced
2152 .line = __location__,
2153 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2154 .r1 = {
2155 .owner = &ctx->a,
2156 .type = WREPL_TYPE_GROUP,
2157 .state = WREPL_STATE_TOMBSTONE,
2158 .node = WREPL_NODE_B,
2159 .is_static = false,
2160 .num_ips = ARRAY_SIZE(addresses_A_1),
2161 .ips = addresses_A_1,
2162 .apply_expected = true
2164 .r2 = {
2165 .owner = &ctx->b,
2166 .type = WREPL_TYPE_UNIQUE,
2167 .state = WREPL_STATE_TOMBSTONE,
2168 .node = WREPL_NODE_B,
2169 .is_static = false,
2170 .num_ips = ARRAY_SIZE(addresses_A_1),
2171 .ips = addresses_A_1,
2172 .apply_expected = false
2177 * normal groups vs normal groups section,
2180 * group,active vs. group,active
2181 * => should NOT be replaced
2184 .line = __location__,
2185 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2186 .r1 = {
2187 .owner = &ctx->a,
2188 .type = WREPL_TYPE_GROUP,
2189 .state = WREPL_STATE_ACTIVE,
2190 .node = WREPL_NODE_B,
2191 .is_static = false,
2192 .num_ips = ARRAY_SIZE(addresses_A_1),
2193 .ips = addresses_A_1,
2194 .apply_expected = true
2196 .r2 = {
2197 .owner = &ctx->b,
2198 .type = WREPL_TYPE_GROUP,
2199 .state = WREPL_STATE_ACTIVE,
2200 .node = WREPL_NODE_B,
2201 .is_static = false,
2202 .num_ips = ARRAY_SIZE(addresses_A_1),
2203 .ips = addresses_A_1,
2204 .apply_expected = false
2209 * group,active vs. group,tombstone
2210 * => should NOT be replaced
2213 .line = __location__,
2214 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2215 .r1 = {
2216 .owner = &ctx->a,
2217 .type = WREPL_TYPE_GROUP,
2218 .state = WREPL_STATE_ACTIVE,
2219 .node = WREPL_NODE_B,
2220 .is_static = false,
2221 .num_ips = ARRAY_SIZE(addresses_A_1),
2222 .ips = addresses_A_1,
2223 .apply_expected = true
2225 .r2 = {
2226 .owner = &ctx->b,
2227 .type = WREPL_TYPE_GROUP,
2228 .state = WREPL_STATE_TOMBSTONE,
2229 .node = WREPL_NODE_B,
2230 .is_static = false,
2231 .num_ips = ARRAY_SIZE(addresses_A_1),
2232 .ips = addresses_A_1,
2233 .apply_expected = false
2238 * group,released vs. group,active
2239 * => should be replaced
2242 .line = __location__,
2243 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2244 .r1 = {
2245 .owner = &ctx->a,
2246 .type = WREPL_TYPE_GROUP,
2247 .state = WREPL_STATE_RELEASED,
2248 .node = WREPL_NODE_B,
2249 .is_static = false,
2250 .num_ips = ARRAY_SIZE(addresses_A_1),
2251 .ips = addresses_A_1,
2252 .apply_expected = false
2254 .r2 = {
2255 .owner = &ctx->b,
2256 .type = WREPL_TYPE_GROUP,
2257 .state = WREPL_STATE_ACTIVE,
2258 .node = WREPL_NODE_B,
2259 .is_static = false,
2260 .num_ips = ARRAY_SIZE(addresses_B_1),
2261 .ips = addresses_B_1,
2262 .apply_expected = true
2267 * group,released vs. group,tombstone
2268 * => should be replaced
2271 .line = __location__,
2272 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2273 .r1 = {
2274 .owner = &ctx->a,
2275 .type = WREPL_TYPE_GROUP,
2276 .state = WREPL_STATE_RELEASED,
2277 .node = WREPL_NODE_B,
2278 .is_static = false,
2279 .num_ips = ARRAY_SIZE(addresses_A_1),
2280 .ips = addresses_A_1,
2281 .apply_expected = false
2283 .r2 = {
2284 .owner = &ctx->b,
2285 .type = WREPL_TYPE_GROUP,
2286 .state = WREPL_STATE_TOMBSTONE,
2287 .node = WREPL_NODE_B,
2288 .is_static = false,
2289 .num_ips = ARRAY_SIZE(addresses_B_1),
2290 .ips = addresses_B_1,
2291 .apply_expected = true
2296 * group,tombstone vs. group,active
2297 * => should be replaced
2300 .line = __location__,
2301 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2302 .r1 = {
2303 .owner = &ctx->b,
2304 .type = WREPL_TYPE_GROUP,
2305 .state = WREPL_STATE_TOMBSTONE,
2306 .node = WREPL_NODE_B,
2307 .is_static = false,
2308 .num_ips = ARRAY_SIZE(addresses_B_1),
2309 .ips = addresses_B_1,
2310 .apply_expected = true
2312 .r2 = {
2313 .owner = &ctx->a,
2314 .type = WREPL_TYPE_GROUP,
2315 .state = WREPL_STATE_ACTIVE,
2316 .node = WREPL_NODE_B,
2317 .is_static = false,
2318 .num_ips = ARRAY_SIZE(addresses_A_1),
2319 .ips = addresses_A_1,
2320 .apply_expected = true
2325 * group,tombstone vs. group,tombstone
2326 * => should be replaced
2329 .line = __location__,
2330 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2331 .r1 = {
2332 .owner = &ctx->a,
2333 .type = WREPL_TYPE_GROUP,
2334 .state = WREPL_STATE_TOMBSTONE,
2335 .node = WREPL_NODE_B,
2336 .is_static = false,
2337 .num_ips = ARRAY_SIZE(addresses_A_1),
2338 .ips = addresses_A_1,
2339 .apply_expected = true
2341 .r2 = {
2342 .owner = &ctx->b,
2343 .type = WREPL_TYPE_GROUP,
2344 .state = WREPL_STATE_TOMBSTONE,
2345 .node = WREPL_NODE_B,
2346 .is_static = false,
2347 .num_ips = ARRAY_SIZE(addresses_B_1),
2348 .ips = addresses_B_1,
2349 .apply_expected = true
2354 * normal groups vs special groups section,
2357 * group,active vs. sgroup,active
2358 * => should NOT be replaced
2361 .line = __location__,
2362 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2363 .r1 = {
2364 .owner = &ctx->b,
2365 .type = WREPL_TYPE_GROUP,
2366 .state = WREPL_STATE_ACTIVE,
2367 .node = WREPL_NODE_B,
2368 .is_static = false,
2369 .num_ips = ARRAY_SIZE(addresses_B_1),
2370 .ips = addresses_B_1,
2371 .apply_expected = true
2373 .r2 = {
2374 .owner = &ctx->a,
2375 .type = WREPL_TYPE_SGROUP,
2376 .state = WREPL_STATE_ACTIVE,
2377 .node = WREPL_NODE_B,
2378 .is_static = false,
2379 .num_ips = ARRAY_SIZE(addresses_B_1),
2380 .ips = addresses_B_1,
2381 .apply_expected = false
2386 * group,active vs. sgroup,tombstone
2387 * => should NOT be replaced
2390 .line = __location__,
2391 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2392 .r1 = {
2393 .owner = &ctx->b,
2394 .type = WREPL_TYPE_GROUP,
2395 .state = WREPL_STATE_ACTIVE,
2396 .node = WREPL_NODE_B,
2397 .is_static = false,
2398 .num_ips = ARRAY_SIZE(addresses_B_1),
2399 .ips = addresses_B_1,
2400 .apply_expected = true
2402 .r2 = {
2403 .owner = &ctx->a,
2404 .type = WREPL_TYPE_SGROUP,
2405 .state = WREPL_STATE_TOMBSTONE,
2406 .node = WREPL_NODE_B,
2407 .is_static = false,
2408 .num_ips = ARRAY_SIZE(addresses_B_1),
2409 .ips = addresses_B_1,
2410 .apply_expected = false
2415 * group,released vs. sgroup,active
2416 * => should be replaced
2419 .line = __location__,
2420 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2421 .r1 = {
2422 .owner = &ctx->a,
2423 .type = WREPL_TYPE_GROUP,
2424 .state = WREPL_STATE_RELEASED,
2425 .node = WREPL_NODE_B,
2426 .is_static = false,
2427 .num_ips = ARRAY_SIZE(addresses_A_1),
2428 .ips = addresses_A_1,
2429 .apply_expected = false
2431 .r2 = {
2432 .owner = &ctx->b,
2433 .type = WREPL_TYPE_SGROUP,
2434 .state = WREPL_STATE_ACTIVE,
2435 .node = WREPL_NODE_B,
2436 .is_static = false,
2437 .num_ips = ARRAY_SIZE(addresses_B_1),
2438 .ips = addresses_B_1,
2439 .apply_expected = true
2444 * group,released vs. sgroup,tombstone
2445 * => should NOT be replaced
2448 .line = __location__,
2449 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2450 .r1 = {
2451 .owner = &ctx->b,
2452 .type = WREPL_TYPE_GROUP,
2453 .state = WREPL_STATE_RELEASED,
2454 .node = WREPL_NODE_B,
2455 .is_static = false,
2456 .num_ips = ARRAY_SIZE(addresses_B_1),
2457 .ips = addresses_B_1,
2458 .apply_expected = false
2460 .r2 = {
2461 .owner = &ctx->a,
2462 .type = WREPL_TYPE_SGROUP,
2463 .state = WREPL_STATE_TOMBSTONE,
2464 .node = WREPL_NODE_B,
2465 .is_static = false,
2466 .num_ips = ARRAY_SIZE(addresses_B_1),
2467 .ips = addresses_B_1,
2468 .apply_expected = false
2473 * group,tombstone vs. sgroup,active
2474 * => should be replaced
2477 .line = __location__,
2478 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2479 .r1 = {
2480 .owner = &ctx->b,
2481 .type = WREPL_TYPE_GROUP,
2482 .state = WREPL_STATE_TOMBSTONE,
2483 .node = WREPL_NODE_B,
2484 .is_static = false,
2485 .num_ips = ARRAY_SIZE(addresses_B_1),
2486 .ips = addresses_B_1,
2487 .apply_expected = true
2489 .r2 = {
2490 .owner = &ctx->a,
2491 .type = WREPL_TYPE_SGROUP,
2492 .state = WREPL_STATE_ACTIVE,
2493 .node = WREPL_NODE_B,
2494 .is_static = false,
2495 .num_ips = ARRAY_SIZE(addresses_A_1),
2496 .ips = addresses_A_1,
2497 .apply_expected = true
2502 * group,tombstone vs. sgroup,tombstone
2503 * => should be replaced
2506 .line = __location__,
2507 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2508 .r1 = {
2509 .owner = &ctx->a,
2510 .type = WREPL_TYPE_GROUP,
2511 .state = WREPL_STATE_TOMBSTONE,
2512 .node = WREPL_NODE_B,
2513 .is_static = false,
2514 .num_ips = ARRAY_SIZE(addresses_A_1),
2515 .ips = addresses_A_1,
2516 .apply_expected = true
2518 .r2 = {
2519 .owner = &ctx->b,
2520 .type = WREPL_TYPE_SGROUP,
2521 .state = WREPL_STATE_TOMBSTONE,
2522 .node = WREPL_NODE_B,
2523 .is_static = false,
2524 .num_ips = ARRAY_SIZE(addresses_B_1),
2525 .ips = addresses_B_1,
2526 .apply_expected = true
2531 * normal groups vs multi homed section,
2534 * group,active vs. mhomed,active
2535 * => should NOT be replaced
2538 .line = __location__,
2539 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2540 .r1 = {
2541 .owner = &ctx->b,
2542 .type = WREPL_TYPE_GROUP,
2543 .state = WREPL_STATE_ACTIVE,
2544 .node = WREPL_NODE_B,
2545 .is_static = false,
2546 .num_ips = ARRAY_SIZE(addresses_B_1),
2547 .ips = addresses_B_1,
2548 .apply_expected = true
2550 .r2 = {
2551 .owner = &ctx->a,
2552 .type = WREPL_TYPE_MHOMED,
2553 .state = WREPL_STATE_ACTIVE,
2554 .node = WREPL_NODE_B,
2555 .is_static = false,
2556 .num_ips = ARRAY_SIZE(addresses_B_1),
2557 .ips = addresses_B_1,
2558 .apply_expected = false
2563 * group,active vs. mhomed,tombstone
2564 * => should NOT be replaced
2567 .line = __location__,
2568 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2569 .r1 = {
2570 .owner = &ctx->b,
2571 .type = WREPL_TYPE_GROUP,
2572 .state = WREPL_STATE_ACTIVE,
2573 .node = WREPL_NODE_B,
2574 .is_static = false,
2575 .num_ips = ARRAY_SIZE(addresses_B_1),
2576 .ips = addresses_B_1,
2577 .apply_expected = true
2579 .r2 = {
2580 .owner = &ctx->a,
2581 .type = WREPL_TYPE_MHOMED,
2582 .state = WREPL_STATE_TOMBSTONE,
2583 .node = WREPL_NODE_B,
2584 .is_static = false,
2585 .num_ips = ARRAY_SIZE(addresses_B_1),
2586 .ips = addresses_B_1,
2587 .apply_expected = false
2592 * group,released vs. mhomed,active
2593 * => should NOT be replaced
2596 .line = __location__,
2597 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2598 .r1 = {
2599 .owner = &ctx->b,
2600 .type = WREPL_TYPE_GROUP,
2601 .state = WREPL_STATE_RELEASED,
2602 .node = WREPL_NODE_B,
2603 .is_static = false,
2604 .num_ips = ARRAY_SIZE(addresses_B_1),
2605 .ips = addresses_B_1,
2606 .apply_expected = false
2608 .r2 = {
2609 .owner = &ctx->a,
2610 .type = WREPL_TYPE_MHOMED,
2611 .state = WREPL_STATE_ACTIVE,
2612 .node = WREPL_NODE_B,
2613 .is_static = false,
2614 .num_ips = ARRAY_SIZE(addresses_B_1),
2615 .ips = addresses_B_1,
2616 .apply_expected = false
2621 * group,released vs. mhomed,tombstone
2622 * => should NOT be replaced
2625 .line = __location__,
2626 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2627 .r1 = {
2628 .owner = &ctx->b,
2629 .type = WREPL_TYPE_GROUP,
2630 .state = WREPL_STATE_RELEASED,
2631 .node = WREPL_NODE_B,
2632 .is_static = false,
2633 .num_ips = ARRAY_SIZE(addresses_B_1),
2634 .ips = addresses_B_1,
2635 .apply_expected = false
2637 .r2 = {
2638 .owner = &ctx->a,
2639 .type = WREPL_TYPE_MHOMED,
2640 .state = WREPL_STATE_TOMBSTONE,
2641 .node = WREPL_NODE_B,
2642 .is_static = false,
2643 .num_ips = ARRAY_SIZE(addresses_B_1),
2644 .ips = addresses_B_1,
2645 .apply_expected = false
2650 * group,tombstone vs. mhomed,active
2651 * => should be replaced
2654 .line = __location__,
2655 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2656 .r1 = {
2657 .owner = &ctx->b,
2658 .type = WREPL_TYPE_GROUP,
2659 .state = WREPL_STATE_TOMBSTONE,
2660 .node = WREPL_NODE_B,
2661 .is_static = false,
2662 .num_ips = ARRAY_SIZE(addresses_B_1),
2663 .ips = addresses_B_1,
2664 .apply_expected = true
2666 .r2 = {
2667 .owner = &ctx->a,
2668 .type = WREPL_TYPE_MHOMED,
2669 .state = WREPL_STATE_ACTIVE,
2670 .node = WREPL_NODE_B,
2671 .is_static = false,
2672 .num_ips = ARRAY_SIZE(addresses_A_1),
2673 .ips = addresses_A_1,
2674 .apply_expected = true
2679 * group,tombstone vs. mhomed,tombstone
2680 * => should be replaced
2683 .line = __location__,
2684 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2685 .r1 = {
2686 .owner = &ctx->a,
2687 .type = WREPL_TYPE_GROUP,
2688 .state = WREPL_STATE_TOMBSTONE,
2689 .node = WREPL_NODE_B,
2690 .is_static = false,
2691 .num_ips = ARRAY_SIZE(addresses_A_1),
2692 .ips = addresses_A_1,
2693 .apply_expected = true
2695 .r2 = {
2696 .owner = &ctx->b,
2697 .type = WREPL_TYPE_MHOMED,
2698 .state = WREPL_STATE_TOMBSTONE,
2699 .node = WREPL_NODE_B,
2700 .is_static = false,
2701 .num_ips = ARRAY_SIZE(addresses_B_1),
2702 .ips = addresses_B_1,
2703 .apply_expected = true
2708 * special groups vs unique section,
2711 * sgroup,active vs. unique,active
2712 * => should NOT be replaced
2715 .line = __location__,
2716 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2717 .r1 = {
2718 .owner = &ctx->b,
2719 .type = WREPL_TYPE_SGROUP,
2720 .state = WREPL_STATE_ACTIVE,
2721 .node = WREPL_NODE_B,
2722 .is_static = false,
2723 .num_ips = ARRAY_SIZE(addresses_B_1),
2724 .ips = addresses_B_1,
2725 .apply_expected = true
2727 .r2 = {
2728 .owner = &ctx->a,
2729 .type = WREPL_TYPE_UNIQUE,
2730 .state = WREPL_STATE_ACTIVE,
2731 .node = WREPL_NODE_B,
2732 .is_static = false,
2733 .num_ips = ARRAY_SIZE(addresses_B_1),
2734 .ips = addresses_B_1,
2735 .apply_expected = false
2740 * sgroup,active vs. unique,tombstone
2741 * => should NOT be replaced
2744 .line = __location__,
2745 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2746 .r1 = {
2747 .owner = &ctx->b,
2748 .type = WREPL_TYPE_SGROUP,
2749 .state = WREPL_STATE_ACTIVE,
2750 .node = WREPL_NODE_B,
2751 .is_static = false,
2752 .num_ips = ARRAY_SIZE(addresses_B_1),
2753 .ips = addresses_B_1,
2754 .apply_expected = true
2756 .r2 = {
2757 .owner = &ctx->a,
2758 .type = WREPL_TYPE_UNIQUE,
2759 .state = WREPL_STATE_TOMBSTONE,
2760 .node = WREPL_NODE_B,
2761 .is_static = false,
2762 .num_ips = ARRAY_SIZE(addresses_B_1),
2763 .ips = addresses_B_1,
2764 .apply_expected = false
2769 * sgroup,released vs. unique,active
2770 * => should be replaced
2773 .line = __location__,
2774 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2775 .r1 = {
2776 .owner = &ctx->b,
2777 .type = WREPL_TYPE_SGROUP,
2778 .state = WREPL_STATE_RELEASED,
2779 .node = WREPL_NODE_B,
2780 .is_static = false,
2781 .num_ips = ARRAY_SIZE(addresses_B_1),
2782 .ips = addresses_B_1,
2783 .apply_expected = false
2785 .r2 = {
2786 .owner = &ctx->a,
2787 .type = WREPL_TYPE_UNIQUE,
2788 .state = WREPL_STATE_ACTIVE,
2789 .node = WREPL_NODE_B,
2790 .is_static = false,
2791 .num_ips = ARRAY_SIZE(addresses_A_1),
2792 .ips = addresses_A_1,
2793 .apply_expected = true
2798 * sgroup,released vs. unique,tombstone
2799 * => should be replaced
2802 .line = __location__,
2803 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2804 .r1 = {
2805 .owner = &ctx->a,
2806 .type = WREPL_TYPE_SGROUP,
2807 .state = WREPL_STATE_RELEASED,
2808 .node = WREPL_NODE_B,
2809 .is_static = false,
2810 .num_ips = ARRAY_SIZE(addresses_A_1),
2811 .ips = addresses_A_1,
2812 .apply_expected = false
2814 .r2 = {
2815 .owner = &ctx->b,
2816 .type = WREPL_TYPE_UNIQUE,
2817 .state = WREPL_STATE_TOMBSTONE,
2818 .node = WREPL_NODE_B,
2819 .is_static = false,
2820 .num_ips = ARRAY_SIZE(addresses_B_1),
2821 .ips = addresses_B_1,
2822 .apply_expected = true
2827 * sgroup,tombstone vs. unique,active
2828 * => should be replaced
2831 .line = __location__,
2832 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2833 .r1 = {
2834 .owner = &ctx->a,
2835 .type = WREPL_TYPE_SGROUP,
2836 .state = WREPL_STATE_TOMBSTONE,
2837 .node = WREPL_NODE_B,
2838 .is_static = false,
2839 .num_ips = ARRAY_SIZE(addresses_A_1),
2840 .ips = addresses_A_1,
2841 .apply_expected = true
2843 .r2 = {
2844 .owner = &ctx->b,
2845 .type = WREPL_TYPE_UNIQUE,
2846 .state = WREPL_STATE_ACTIVE,
2847 .node = WREPL_NODE_B,
2848 .is_static = false,
2849 .num_ips = ARRAY_SIZE(addresses_B_1),
2850 .ips = addresses_B_1,
2851 .apply_expected = true
2856 * sgroup,tombstone vs. unique,tombstone
2857 * => should be replaced
2860 .line = __location__,
2861 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2862 .r1 = {
2863 .owner = &ctx->b,
2864 .type = WREPL_TYPE_SGROUP,
2865 .state = WREPL_STATE_TOMBSTONE,
2866 .node = WREPL_NODE_B,
2867 .is_static = false,
2868 .num_ips = ARRAY_SIZE(addresses_B_1),
2869 .ips = addresses_B_1,
2870 .apply_expected = true
2872 .r2 = {
2873 .owner = &ctx->a,
2874 .type = WREPL_TYPE_UNIQUE,
2875 .state = WREPL_STATE_TOMBSTONE,
2876 .node = WREPL_NODE_B,
2877 .is_static = false,
2878 .num_ips = ARRAY_SIZE(addresses_A_1),
2879 .ips = addresses_A_1,
2880 .apply_expected = true
2885 * special groups vs normal group section,
2888 * sgroup,active vs. group,active
2889 * => should NOT be replaced
2892 .line = __location__,
2893 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2894 .r1 = {
2895 .owner = &ctx->a,
2896 .type = WREPL_TYPE_SGROUP,
2897 .state = WREPL_STATE_ACTIVE,
2898 .node = WREPL_NODE_B,
2899 .is_static = false,
2900 .num_ips = ARRAY_SIZE(addresses_A_1),
2901 .ips = addresses_A_1,
2902 .apply_expected = true
2904 .r2 = {
2905 .owner = &ctx->b,
2906 .type = WREPL_TYPE_GROUP,
2907 .state = WREPL_STATE_ACTIVE,
2908 .node = WREPL_NODE_B,
2909 .is_static = false,
2910 .num_ips = ARRAY_SIZE(addresses_A_1),
2911 .ips = addresses_A_1,
2912 .apply_expected = false
2917 * sgroup,active vs. group,tombstone
2918 * => should NOT be replaced
2921 .line = __location__,
2922 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2923 .r1 = {
2924 .owner = &ctx->a,
2925 .type = WREPL_TYPE_SGROUP,
2926 .state = WREPL_STATE_ACTIVE,
2927 .node = WREPL_NODE_B,
2928 .is_static = false,
2929 .num_ips = ARRAY_SIZE(addresses_A_1),
2930 .ips = addresses_A_1,
2931 .apply_expected = true
2933 .r2 = {
2934 .owner = &ctx->b,
2935 .type = WREPL_TYPE_GROUP,
2936 .state = WREPL_STATE_TOMBSTONE,
2937 .node = WREPL_NODE_B,
2938 .is_static = false,
2939 .num_ips = ARRAY_SIZE(addresses_A_1),
2940 .ips = addresses_A_1,
2941 .apply_expected = false
2946 * sgroup,released vs. group,active
2947 * => should be replaced
2950 .line = __location__,
2951 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2952 .r1 = {
2953 .owner = &ctx->a,
2954 .type = WREPL_TYPE_SGROUP,
2955 .state = WREPL_STATE_RELEASED,
2956 .node = WREPL_NODE_B,
2957 .is_static = false,
2958 .num_ips = ARRAY_SIZE(addresses_A_1),
2959 .ips = addresses_A_1,
2960 .apply_expected = false
2962 .r2 = {
2963 .owner = &ctx->b,
2964 .type = WREPL_TYPE_GROUP,
2965 .state = WREPL_STATE_ACTIVE,
2966 .node = WREPL_NODE_B,
2967 .is_static = false,
2968 .num_ips = ARRAY_SIZE(addresses_B_1),
2969 .ips = addresses_B_1,
2970 .apply_expected = true
2975 * sgroup,released vs. group,tombstone
2976 * => should be replaced
2979 .line = __location__,
2980 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2981 .r1 = {
2982 .owner = &ctx->b,
2983 .type = WREPL_TYPE_SGROUP,
2984 .state = WREPL_STATE_RELEASED,
2985 .node = WREPL_NODE_B,
2986 .is_static = false,
2987 .num_ips = ARRAY_SIZE(addresses_B_1),
2988 .ips = addresses_B_1,
2989 .apply_expected = false
2991 .r2 = {
2992 .owner = &ctx->a,
2993 .type = WREPL_TYPE_GROUP,
2994 .state = WREPL_STATE_TOMBSTONE,
2995 .node = WREPL_NODE_B,
2996 .is_static = false,
2997 .num_ips = ARRAY_SIZE(addresses_A_1),
2998 .ips = addresses_A_1,
2999 .apply_expected = true
3004 * sgroup,tombstone vs. group,active
3005 * => should NOT be replaced
3008 .line = __location__,
3009 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3010 .r1 = {
3011 .owner = &ctx->a,
3012 .type = WREPL_TYPE_SGROUP,
3013 .state = WREPL_STATE_TOMBSTONE,
3014 .node = WREPL_NODE_B,
3015 .is_static = false,
3016 .num_ips = ARRAY_SIZE(addresses_A_1),
3017 .ips = addresses_A_1,
3018 .apply_expected = true
3020 .r2 = {
3021 .owner = &ctx->b,
3022 .type = WREPL_TYPE_GROUP,
3023 .state = WREPL_STATE_ACTIVE,
3024 .node = WREPL_NODE_B,
3025 .is_static = false,
3026 .num_ips = ARRAY_SIZE(addresses_B_1),
3027 .ips = addresses_B_1,
3028 .apply_expected = true
3033 * sgroup,tombstone vs. group,tombstone
3034 * => should NOT be replaced
3037 .line = __location__,
3038 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3039 .r1 = {
3040 .owner = &ctx->b,
3041 .type = WREPL_TYPE_SGROUP,
3042 .state = WREPL_STATE_TOMBSTONE,
3043 .node = WREPL_NODE_B,
3044 .is_static = false,
3045 .num_ips = ARRAY_SIZE(addresses_B_1),
3046 .ips = addresses_B_1,
3047 .apply_expected = true
3049 .r2 = {
3050 .owner = &ctx->a,
3051 .type = WREPL_TYPE_GROUP,
3052 .state = WREPL_STATE_TOMBSTONE,
3053 .node = WREPL_NODE_B,
3054 .is_static = false,
3055 .num_ips = ARRAY_SIZE(addresses_A_1),
3056 .ips = addresses_A_1,
3057 .apply_expected = true
3062 * special groups (not active) vs special group section,
3065 * sgroup,released vs. sgroup,active
3066 * => should be replaced
3069 .line = __location__,
3070 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3071 .r1 = {
3072 .owner = &ctx->a,
3073 .type = WREPL_TYPE_SGROUP,
3074 .state = WREPL_STATE_RELEASED,
3075 .node = WREPL_NODE_B,
3076 .is_static = false,
3077 .num_ips = ARRAY_SIZE(addresses_A_1),
3078 .ips = addresses_A_1,
3079 .apply_expected = false
3081 .r2 = {
3082 .owner = &ctx->b,
3083 .type = WREPL_TYPE_SGROUP,
3084 .state = WREPL_STATE_ACTIVE,
3085 .node = WREPL_NODE_B,
3086 .is_static = false,
3087 .num_ips = ARRAY_SIZE(addresses_B_1),
3088 .ips = addresses_B_1,
3089 .apply_expected = true
3094 * sgroup,released vs. sgroup,tombstone
3095 * => should be replaced
3098 .line = __location__,
3099 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3100 .r1 = {
3101 .owner = &ctx->b,
3102 .type = WREPL_TYPE_SGROUP,
3103 .state = WREPL_STATE_RELEASED,
3104 .node = WREPL_NODE_B,
3105 .is_static = false,
3106 .num_ips = ARRAY_SIZE(addresses_B_1),
3107 .ips = addresses_B_1,
3108 .apply_expected = false
3110 .r2 = {
3111 .owner = &ctx->a,
3112 .type = WREPL_TYPE_SGROUP,
3113 .state = WREPL_STATE_TOMBSTONE,
3114 .node = WREPL_NODE_B,
3115 .is_static = false,
3116 .num_ips = ARRAY_SIZE(addresses_A_1),
3117 .ips = addresses_A_1,
3118 .apply_expected = true
3123 * sgroup,tombstone vs. sgroup,active
3124 * => should NOT be replaced
3127 .line = __location__,
3128 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3129 .r1 = {
3130 .owner = &ctx->a,
3131 .type = WREPL_TYPE_SGROUP,
3132 .state = WREPL_STATE_TOMBSTONE,
3133 .node = WREPL_NODE_B,
3134 .is_static = false,
3135 .num_ips = ARRAY_SIZE(addresses_A_1),
3136 .ips = addresses_A_1,
3137 .apply_expected = true
3139 .r2 = {
3140 .owner = &ctx->b,
3141 .type = WREPL_TYPE_SGROUP,
3142 .state = WREPL_STATE_ACTIVE,
3143 .node = WREPL_NODE_B,
3144 .is_static = false,
3145 .num_ips = ARRAY_SIZE(addresses_B_1),
3146 .ips = addresses_B_1,
3147 .apply_expected = true
3152 * sgroup,tombstone vs. sgroup,tombstone
3153 * => should NOT be replaced
3156 .line = __location__,
3157 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3158 .r1 = {
3159 .owner = &ctx->b,
3160 .type = WREPL_TYPE_SGROUP,
3161 .state = WREPL_STATE_TOMBSTONE,
3162 .node = WREPL_NODE_B,
3163 .is_static = false,
3164 .num_ips = ARRAY_SIZE(addresses_B_1),
3165 .ips = addresses_B_1,
3166 .apply_expected = true
3168 .r2 = {
3169 .owner = &ctx->a,
3170 .type = WREPL_TYPE_SGROUP,
3171 .state = WREPL_STATE_TOMBSTONE,
3172 .node = WREPL_NODE_B,
3173 .is_static = false,
3174 .num_ips = ARRAY_SIZE(addresses_A_1),
3175 .ips = addresses_A_1,
3176 .apply_expected = true
3181 * special groups vs multi homed section,
3184 * sgroup,active vs. mhomed,active
3185 * => should NOT be replaced
3188 .line = __location__,
3189 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3190 .r1 = {
3191 .owner = &ctx->a,
3192 .type = WREPL_TYPE_SGROUP,
3193 .state = WREPL_STATE_ACTIVE,
3194 .node = WREPL_NODE_B,
3195 .is_static = false,
3196 .num_ips = ARRAY_SIZE(addresses_A_1),
3197 .ips = addresses_A_1,
3198 .apply_expected = true
3200 .r2 = {
3201 .owner = &ctx->b,
3202 .type = WREPL_TYPE_MHOMED,
3203 .state = WREPL_STATE_ACTIVE,
3204 .node = WREPL_NODE_B,
3205 .is_static = false,
3206 .num_ips = ARRAY_SIZE(addresses_A_1),
3207 .ips = addresses_A_1,
3208 .apply_expected = false
3213 * sgroup,active vs. mhomed,tombstone
3214 * => should NOT be replaced
3217 .line = __location__,
3218 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3219 .r1 = {
3220 .owner = &ctx->a,
3221 .type = WREPL_TYPE_SGROUP,
3222 .state = WREPL_STATE_ACTIVE,
3223 .node = WREPL_NODE_B,
3224 .is_static = false,
3225 .num_ips = ARRAY_SIZE(addresses_A_1),
3226 .ips = addresses_A_1,
3227 .apply_expected = true
3229 .r2 = {
3230 .owner = &ctx->b,
3231 .type = WREPL_TYPE_MHOMED,
3232 .state = WREPL_STATE_TOMBSTONE,
3233 .node = WREPL_NODE_B,
3234 .is_static = false,
3235 .num_ips = ARRAY_SIZE(addresses_A_1),
3236 .ips = addresses_A_1,
3237 .apply_expected = false
3242 * sgroup,released vs. mhomed,active
3243 * => should be replaced
3246 .line = __location__,
3247 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3248 .r1 = {
3249 .owner = &ctx->a,
3250 .type = WREPL_TYPE_SGROUP,
3251 .state = WREPL_STATE_RELEASED,
3252 .node = WREPL_NODE_B,
3253 .is_static = false,
3254 .num_ips = ARRAY_SIZE(addresses_A_1),
3255 .ips = addresses_A_1,
3256 .apply_expected = false
3258 .r2 = {
3259 .owner = &ctx->b,
3260 .type = WREPL_TYPE_MHOMED,
3261 .state = WREPL_STATE_ACTIVE,
3262 .node = WREPL_NODE_B,
3263 .is_static = false,
3264 .num_ips = ARRAY_SIZE(addresses_B_1),
3265 .ips = addresses_B_1,
3266 .apply_expected = true
3271 * sgroup,released vs. mhomed,tombstone
3272 * => should be replaced
3275 .line = __location__,
3276 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3277 .r1 = {
3278 .owner = &ctx->b,
3279 .type = WREPL_TYPE_SGROUP,
3280 .state = WREPL_STATE_RELEASED,
3281 .node = WREPL_NODE_B,
3282 .is_static = false,
3283 .num_ips = ARRAY_SIZE(addresses_B_1),
3284 .ips = addresses_B_1,
3285 .apply_expected = false
3287 .r2 = {
3288 .owner = &ctx->a,
3289 .type = WREPL_TYPE_MHOMED,
3290 .state = WREPL_STATE_TOMBSTONE,
3291 .node = WREPL_NODE_B,
3292 .is_static = false,
3293 .num_ips = ARRAY_SIZE(addresses_A_1),
3294 .ips = addresses_A_1,
3295 .apply_expected = true
3300 * sgroup,tombstone vs. mhomed,active
3301 * => should be replaced
3304 .line = __location__,
3305 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3306 .r1 = {
3307 .owner = &ctx->a,
3308 .type = WREPL_TYPE_SGROUP,
3309 .state = WREPL_STATE_TOMBSTONE,
3310 .node = WREPL_NODE_B,
3311 .is_static = false,
3312 .num_ips = ARRAY_SIZE(addresses_A_1),
3313 .ips = addresses_A_1,
3314 .apply_expected = true
3316 .r2 = {
3317 .owner = &ctx->b,
3318 .type = WREPL_TYPE_MHOMED,
3319 .state = WREPL_STATE_ACTIVE,
3320 .node = WREPL_NODE_B,
3321 .is_static = false,
3322 .num_ips = ARRAY_SIZE(addresses_B_1),
3323 .ips = addresses_B_1,
3324 .apply_expected = true
3329 * sgroup,tombstone vs. mhomed,tombstone
3330 * => should be replaced
3333 .line = __location__,
3334 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3335 .r1 = {
3336 .owner = &ctx->b,
3337 .type = WREPL_TYPE_SGROUP,
3338 .state = WREPL_STATE_TOMBSTONE,
3339 .node = WREPL_NODE_B,
3340 .is_static = false,
3341 .num_ips = ARRAY_SIZE(addresses_B_1),
3342 .ips = addresses_B_1,
3343 .apply_expected = true
3345 .r2 = {
3346 .owner = &ctx->a,
3347 .type = WREPL_TYPE_MHOMED,
3348 .state = WREPL_STATE_TOMBSTONE,
3349 .node = WREPL_NODE_B,
3350 .is_static = false,
3351 .num_ips = ARRAY_SIZE(addresses_A_1),
3352 .ips = addresses_A_1,
3353 .apply_expected = true
3358 * multi homed vs. unique section,
3361 * mhomed,active vs. unique,active
3362 * => should be replaced
3365 .line = __location__,
3366 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3367 .r1 = {
3368 .owner = &ctx->a,
3369 .type = WREPL_TYPE_MHOMED,
3370 .state = WREPL_STATE_ACTIVE,
3371 .node = WREPL_NODE_B,
3372 .is_static = false,
3373 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3374 .ips = addresses_A_3_4,
3375 .apply_expected = true
3377 .r2 = {
3378 .owner = &ctx->b,
3379 .type = WREPL_TYPE_UNIQUE,
3380 .state = WREPL_STATE_ACTIVE,
3381 .node = WREPL_NODE_B,
3382 .is_static = false,
3383 .num_ips = ARRAY_SIZE(addresses_B_1),
3384 .ips = addresses_B_1,
3385 .apply_expected = true
3390 * mhomed,active vs. unique,tombstone
3391 * => should NOT be replaced
3394 .line = __location__,
3395 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3396 .r1 = {
3397 .owner = &ctx->b,
3398 .type = WREPL_TYPE_MHOMED,
3399 .state = WREPL_STATE_ACTIVE,
3400 .node = WREPL_NODE_B,
3401 .is_static = false,
3402 .num_ips = ARRAY_SIZE(addresses_B_1),
3403 .ips = addresses_B_1,
3404 .apply_expected = true
3406 .r2 = {
3407 .owner = &ctx->a,
3408 .type = WREPL_TYPE_UNIQUE,
3409 .state = WREPL_STATE_TOMBSTONE,
3410 .node = WREPL_NODE_B,
3411 .is_static = false,
3412 .num_ips = ARRAY_SIZE(addresses_B_1),
3413 .ips = addresses_B_1,
3414 .apply_expected = false
3419 * mhomed,released vs. unique,active
3420 * => should be replaced
3423 .line = __location__,
3424 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3425 .r1 = {
3426 .owner = &ctx->a,
3427 .type = WREPL_TYPE_MHOMED,
3428 .state = WREPL_STATE_RELEASED,
3429 .node = WREPL_NODE_B,
3430 .is_static = false,
3431 .num_ips = ARRAY_SIZE(addresses_A_1),
3432 .ips = addresses_A_1,
3433 .apply_expected = false
3435 .r2 = {
3436 .owner = &ctx->b,
3437 .type = WREPL_TYPE_UNIQUE,
3438 .state = WREPL_STATE_ACTIVE,
3439 .node = WREPL_NODE_B,
3440 .is_static = false,
3441 .num_ips = ARRAY_SIZE(addresses_B_1),
3442 .ips = addresses_B_1,
3443 .apply_expected = true
3448 * mhomed,released vs. uinique,tombstone
3449 * => should be replaced
3452 .line = __location__,
3453 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3454 .r1 = {
3455 .owner = &ctx->b,
3456 .type = WREPL_TYPE_MHOMED,
3457 .state = WREPL_STATE_RELEASED,
3458 .node = WREPL_NODE_B,
3459 .is_static = false,
3460 .num_ips = ARRAY_SIZE(addresses_B_1),
3461 .ips = addresses_B_1,
3462 .apply_expected = false
3464 .r2 = {
3465 .owner = &ctx->a,
3466 .type = WREPL_TYPE_UNIQUE,
3467 .state = WREPL_STATE_TOMBSTONE,
3468 .node = WREPL_NODE_B,
3469 .is_static = false,
3470 .num_ips = ARRAY_SIZE(addresses_A_1),
3471 .ips = addresses_A_1,
3472 .apply_expected = true
3477 * mhomed,tombstone vs. unique,active
3478 * => should be replaced
3481 .line = __location__,
3482 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3483 .r1 = {
3484 .owner = &ctx->a,
3485 .type = WREPL_TYPE_MHOMED,
3486 .state = WREPL_STATE_TOMBSTONE,
3487 .node = WREPL_NODE_B,
3488 .is_static = false,
3489 .num_ips = ARRAY_SIZE(addresses_A_1),
3490 .ips = addresses_A_1,
3491 .apply_expected = true
3493 .r2 = {
3494 .owner = &ctx->b,
3495 .type = WREPL_TYPE_UNIQUE,
3496 .state = WREPL_STATE_ACTIVE,
3497 .node = WREPL_NODE_B,
3498 .is_static = false,
3499 .num_ips = ARRAY_SIZE(addresses_B_1),
3500 .ips = addresses_B_1,
3501 .apply_expected = true
3506 * mhomed,tombstone vs. uinique,tombstone
3507 * => should be replaced
3510 .line = __location__,
3511 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3512 .r1 = {
3513 .owner = &ctx->b,
3514 .type = WREPL_TYPE_MHOMED,
3515 .state = WREPL_STATE_TOMBSTONE,
3516 .node = WREPL_NODE_B,
3517 .is_static = false,
3518 .num_ips = ARRAY_SIZE(addresses_B_1),
3519 .ips = addresses_B_1,
3520 .apply_expected = true
3522 .r2 = {
3523 .owner = &ctx->a,
3524 .type = WREPL_TYPE_UNIQUE,
3525 .state = WREPL_STATE_TOMBSTONE,
3526 .node = WREPL_NODE_B,
3527 .is_static = false,
3528 .num_ips = ARRAY_SIZE(addresses_A_1),
3529 .ips = addresses_A_1,
3530 .apply_expected = true
3535 * multi homed vs. normal group section,
3538 * mhomed,active vs. group,active
3539 * => should be replaced
3542 .line = __location__,
3543 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3544 .r1 = {
3545 .owner = &ctx->a,
3546 .type = WREPL_TYPE_MHOMED,
3547 .state = WREPL_STATE_ACTIVE,
3548 .node = WREPL_NODE_B,
3549 .is_static = false,
3550 .num_ips = ARRAY_SIZE(addresses_A_1),
3551 .ips = addresses_A_1,
3552 .apply_expected = true
3554 .r2 = {
3555 .owner = &ctx->b,
3556 .type = WREPL_TYPE_GROUP,
3557 .state = WREPL_STATE_ACTIVE,
3558 .node = WREPL_NODE_B,
3559 .is_static = false,
3560 .num_ips = ARRAY_SIZE(addresses_B_1),
3561 .ips = addresses_B_1,
3562 .apply_expected = true
3567 * mhomed,active vs. group,tombstone
3568 * => should NOT be replaced
3571 .line = __location__,
3572 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3573 .r1 = {
3574 .owner = &ctx->b,
3575 .type = WREPL_TYPE_MHOMED,
3576 .state = WREPL_STATE_ACTIVE,
3577 .node = WREPL_NODE_B,
3578 .is_static = false,
3579 .num_ips = ARRAY_SIZE(addresses_B_1),
3580 .ips = addresses_B_1,
3581 .apply_expected = true
3583 .r2 = {
3584 .owner = &ctx->a,
3585 .type = WREPL_TYPE_GROUP,
3586 .state = WREPL_STATE_TOMBSTONE,
3587 .node = WREPL_NODE_B,
3588 .is_static = false,
3589 .num_ips = ARRAY_SIZE(addresses_B_1),
3590 .ips = addresses_B_1,
3591 .apply_expected = false
3596 * mhomed,released vs. group,active
3597 * => should be replaced
3600 .line = __location__,
3601 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3602 .r1 = {
3603 .owner = &ctx->b,
3604 .type = WREPL_TYPE_MHOMED,
3605 .state = WREPL_STATE_RELEASED,
3606 .node = WREPL_NODE_B,
3607 .is_static = false,
3608 .num_ips = ARRAY_SIZE(addresses_B_1),
3609 .ips = addresses_B_1,
3610 .apply_expected = false
3612 .r2 = {
3613 .owner = &ctx->a,
3614 .type = WREPL_TYPE_GROUP,
3615 .state = WREPL_STATE_ACTIVE,
3616 .node = WREPL_NODE_B,
3617 .is_static = false,
3618 .num_ips = ARRAY_SIZE(addresses_A_1),
3619 .ips = addresses_A_1,
3620 .apply_expected = true
3625 * mhomed,released vs. group,tombstone
3626 * => should be replaced
3629 .line = __location__,
3630 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3631 .r1 = {
3632 .owner = &ctx->a,
3633 .type = WREPL_TYPE_MHOMED,
3634 .state = WREPL_STATE_RELEASED,
3635 .node = WREPL_NODE_B,
3636 .is_static = false,
3637 .num_ips = ARRAY_SIZE(addresses_A_1),
3638 .ips = addresses_A_1,
3639 .apply_expected = false
3641 .r2 = {
3642 .owner = &ctx->b,
3643 .type = WREPL_TYPE_GROUP,
3644 .state = WREPL_STATE_TOMBSTONE,
3645 .node = WREPL_NODE_B,
3646 .is_static = false,
3647 .num_ips = ARRAY_SIZE(addresses_B_1),
3648 .ips = addresses_B_1,
3649 .apply_expected = true
3654 * mhomed,tombstone vs. group,active
3655 * => should be replaced
3658 .line = __location__,
3659 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3660 .r1 = {
3661 .owner = &ctx->b,
3662 .type = WREPL_TYPE_MHOMED,
3663 .state = WREPL_STATE_TOMBSTONE,
3664 .node = WREPL_NODE_B,
3665 .is_static = false,
3666 .num_ips = ARRAY_SIZE(addresses_B_1),
3667 .ips = addresses_B_1,
3668 .apply_expected = true
3670 .r2 = {
3671 .owner = &ctx->a,
3672 .type = WREPL_TYPE_GROUP,
3673 .state = WREPL_STATE_ACTIVE,
3674 .node = WREPL_NODE_B,
3675 .is_static = false,
3676 .num_ips = ARRAY_SIZE(addresses_A_1),
3677 .ips = addresses_A_1,
3678 .apply_expected = true
3683 * mhomed,tombstone vs. group,tombstone
3684 * => should be replaced
3687 .line = __location__,
3688 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3689 .r1 = {
3690 .owner = &ctx->a,
3691 .type = WREPL_TYPE_MHOMED,
3692 .state = WREPL_STATE_TOMBSTONE,
3693 .node = WREPL_NODE_B,
3694 .is_static = false,
3695 .num_ips = ARRAY_SIZE(addresses_A_1),
3696 .ips = addresses_A_1,
3697 .apply_expected = true
3699 .r2 = {
3700 .owner = &ctx->b,
3701 .type = WREPL_TYPE_GROUP,
3702 .state = WREPL_STATE_TOMBSTONE,
3703 .node = WREPL_NODE_B,
3704 .is_static = false,
3705 .num_ips = ARRAY_SIZE(addresses_B_1),
3706 .ips = addresses_B_1,
3707 .apply_expected = true
3712 * multi homed vs. special group section,
3715 * mhomed,active vs. sgroup,active
3716 * => should NOT be replaced
3719 .line = __location__,
3720 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3721 .r1 = {
3722 .owner = &ctx->a,
3723 .type = WREPL_TYPE_MHOMED,
3724 .state = WREPL_STATE_ACTIVE,
3725 .node = WREPL_NODE_B,
3726 .is_static = false,
3727 .num_ips = ARRAY_SIZE(addresses_A_1),
3728 .ips = addresses_A_1,
3729 .apply_expected = true
3731 .r2 = {
3732 .owner = &ctx->b,
3733 .type = WREPL_TYPE_SGROUP,
3734 .state = WREPL_STATE_ACTIVE,
3735 .node = WREPL_NODE_B,
3736 .is_static = false,
3737 .num_ips = ARRAY_SIZE(addresses_A_1),
3738 .ips = addresses_A_1,
3739 .apply_expected = false
3744 * mhomed,active vs. sgroup,tombstone
3745 * => should NOT be replaced
3748 .line = __location__,
3749 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3750 .r1 = {
3751 .owner = &ctx->a,
3752 .type = WREPL_TYPE_MHOMED,
3753 .state = WREPL_STATE_ACTIVE,
3754 .node = WREPL_NODE_B,
3755 .is_static = false,
3756 .num_ips = ARRAY_SIZE(addresses_A_1),
3757 .ips = addresses_A_1,
3758 .apply_expected = true
3760 .r2 = {
3761 .owner = &ctx->b,
3762 .type = WREPL_TYPE_SGROUP,
3763 .state = WREPL_STATE_TOMBSTONE,
3764 .node = WREPL_NODE_B,
3765 .is_static = false,
3766 .num_ips = ARRAY_SIZE(addresses_A_1),
3767 .ips = addresses_A_1,
3768 .apply_expected = false
3773 * mhomed,released vs. sgroup,active
3774 * => should be replaced
3777 .line = __location__,
3778 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3779 .r1 = {
3780 .owner = &ctx->a,
3781 .type = WREPL_TYPE_MHOMED,
3782 .state = WREPL_STATE_RELEASED,
3783 .node = WREPL_NODE_B,
3784 .is_static = false,
3785 .num_ips = ARRAY_SIZE(addresses_A_1),
3786 .ips = addresses_A_1,
3787 .apply_expected = false
3789 .r2 = {
3790 .owner = &ctx->b,
3791 .type = WREPL_TYPE_SGROUP,
3792 .state = WREPL_STATE_ACTIVE,
3793 .node = WREPL_NODE_B,
3794 .is_static = false,
3795 .num_ips = ARRAY_SIZE(addresses_B_1),
3796 .ips = addresses_B_1,
3797 .apply_expected = true
3802 * mhomed,released vs. sgroup,tombstone
3803 * => should be replaced
3806 .line = __location__,
3807 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3808 .r1 = {
3809 .owner = &ctx->b,
3810 .type = WREPL_TYPE_MHOMED,
3811 .state = WREPL_STATE_RELEASED,
3812 .node = WREPL_NODE_B,
3813 .is_static = false,
3814 .num_ips = ARRAY_SIZE(addresses_B_1),
3815 .ips = addresses_B_1,
3816 .apply_expected = false
3818 .r2 = {
3819 .owner = &ctx->a,
3820 .type = WREPL_TYPE_SGROUP,
3821 .state = WREPL_STATE_TOMBSTONE,
3822 .node = WREPL_NODE_B,
3823 .is_static = false,
3824 .num_ips = ARRAY_SIZE(addresses_A_1),
3825 .ips = addresses_A_1,
3826 .apply_expected = true
3831 * mhomed,tombstone vs. sgroup,active
3832 * => should be replaced
3835 .line = __location__,
3836 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3837 .r1 = {
3838 .owner = &ctx->a,
3839 .type = WREPL_TYPE_MHOMED,
3840 .state = WREPL_STATE_TOMBSTONE,
3841 .node = WREPL_NODE_B,
3842 .is_static = false,
3843 .num_ips = ARRAY_SIZE(addresses_A_1),
3844 .ips = addresses_A_1,
3845 .apply_expected = true
3847 .r2 = {
3848 .owner = &ctx->b,
3849 .type = WREPL_TYPE_SGROUP,
3850 .state = WREPL_STATE_ACTIVE,
3851 .node = WREPL_NODE_B,
3852 .is_static = false,
3853 .num_ips = ARRAY_SIZE(addresses_B_1),
3854 .ips = addresses_B_1,
3855 .apply_expected = true
3860 * mhomed,tombstone vs. sgroup,tombstone
3861 * => should be replaced
3864 .line = __location__,
3865 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3866 .r1 = {
3867 .owner = &ctx->b,
3868 .type = WREPL_TYPE_MHOMED,
3869 .state = WREPL_STATE_TOMBSTONE,
3870 .node = WREPL_NODE_B,
3871 .is_static = false,
3872 .num_ips = ARRAY_SIZE(addresses_B_1),
3873 .ips = addresses_B_1,
3874 .apply_expected = true
3876 .r2 = {
3877 .owner = &ctx->a,
3878 .type = WREPL_TYPE_SGROUP,
3879 .state = WREPL_STATE_TOMBSTONE,
3880 .node = WREPL_NODE_B,
3881 .is_static = false,
3882 .num_ips = ARRAY_SIZE(addresses_A_1),
3883 .ips = addresses_A_1,
3884 .apply_expected = true
3889 * multi homed vs. mlti homed section,
3892 * mhomed,active vs. mhomed,active
3893 * => should be replaced
3896 .line = __location__,
3897 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3898 .r1 = {
3899 .owner = &ctx->a,
3900 .type = WREPL_TYPE_MHOMED,
3901 .state = WREPL_STATE_ACTIVE,
3902 .node = WREPL_NODE_B,
3903 .is_static = false,
3904 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3905 .ips = addresses_A_3_4,
3906 .apply_expected = true
3908 .r2 = {
3909 .owner = &ctx->b,
3910 .type = WREPL_TYPE_MHOMED,
3911 .state = WREPL_STATE_ACTIVE,
3912 .node = WREPL_NODE_B,
3913 .is_static = false,
3914 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3915 .ips = addresses_B_3_4,
3916 .apply_expected = true
3921 * mhomed,active vs. mhomed,tombstone
3922 * => should NOT be replaced
3925 .line = __location__,
3926 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3927 .r1 = {
3928 .owner = &ctx->b,
3929 .type = WREPL_TYPE_MHOMED,
3930 .state = WREPL_STATE_ACTIVE,
3931 .node = WREPL_NODE_B,
3932 .is_static = false,
3933 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3934 .ips = addresses_B_3_4,
3935 .apply_expected = true
3937 .r2 = {
3938 .owner = &ctx->a,
3939 .type = WREPL_TYPE_MHOMED,
3940 .state = WREPL_STATE_TOMBSTONE,
3941 .node = WREPL_NODE_B,
3942 .is_static = false,
3943 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3944 .ips = addresses_B_3_4,
3945 .apply_expected = false
3950 * mhomed,released vs. mhomed,active
3951 * => should be replaced
3954 .line = __location__,
3955 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3956 .r1 = {
3957 .owner = &ctx->b,
3958 .type = WREPL_TYPE_MHOMED,
3959 .state = WREPL_STATE_RELEASED,
3960 .node = WREPL_NODE_B,
3961 .is_static = false,
3962 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3963 .ips = addresses_B_3_4,
3964 .apply_expected = false
3966 .r2 = {
3967 .owner = &ctx->a,
3968 .type = WREPL_TYPE_MHOMED,
3969 .state = WREPL_STATE_ACTIVE,
3970 .node = WREPL_NODE_B,
3971 .is_static = false,
3972 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3973 .ips = addresses_A_3_4,
3974 .apply_expected = true
3979 * mhomed,released vs. mhomed,tombstone
3980 * => should be replaced
3983 .line = __location__,
3984 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3985 .r1 = {
3986 .owner = &ctx->a,
3987 .type = WREPL_TYPE_MHOMED,
3988 .state = WREPL_STATE_RELEASED,
3989 .node = WREPL_NODE_B,
3990 .is_static = false,
3991 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3992 .ips = addresses_A_3_4,
3993 .apply_expected = false
3995 .r2 = {
3996 .owner = &ctx->b,
3997 .type = WREPL_TYPE_MHOMED,
3998 .state = WREPL_STATE_TOMBSTONE,
3999 .node = WREPL_NODE_B,
4000 .is_static = false,
4001 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4002 .ips = addresses_B_3_4,
4003 .apply_expected = true
4008 * mhomed,tombstone vs. mhomed,active
4009 * => should be replaced
4012 .line = __location__,
4013 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4014 .r1 = {
4015 .owner = &ctx->b,
4016 .type = WREPL_TYPE_MHOMED,
4017 .state = WREPL_STATE_TOMBSTONE,
4018 .node = WREPL_NODE_B,
4019 .is_static = false,
4020 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4021 .ips = addresses_B_3_4,
4022 .apply_expected = true
4024 .r2 = {
4025 .owner = &ctx->a,
4026 .type = WREPL_TYPE_MHOMED,
4027 .state = WREPL_STATE_ACTIVE,
4028 .node = WREPL_NODE_B,
4029 .is_static = false,
4030 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4031 .ips = addresses_A_3_4,
4032 .apply_expected = true
4037 * mhomed,tombstone vs. mhomed,tombstone
4038 * => should be replaced
4041 .line = __location__,
4042 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4043 .r1 = {
4044 .owner = &ctx->a,
4045 .type = WREPL_TYPE_MHOMED,
4046 .state = WREPL_STATE_TOMBSTONE,
4047 .node = WREPL_NODE_B,
4048 .is_static = false,
4049 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4050 .ips = addresses_A_3_4,
4051 .apply_expected = true
4053 .r2 = {
4054 .owner = &ctx->b,
4055 .type = WREPL_TYPE_MHOMED,
4056 .state = WREPL_STATE_TOMBSTONE,
4057 .node = WREPL_NODE_B,
4058 .is_static = false,
4059 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4060 .ips = addresses_B_3_4,
4061 .apply_expected = true
4065 .line = __location__,
4066 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4067 .cleanup= true,
4068 .r1 = {
4069 .owner = &ctx->b,
4070 .type = WREPL_TYPE_UNIQUE,
4071 .state = WREPL_STATE_TOMBSTONE,
4072 .node = WREPL_NODE_B,
4073 .is_static = false,
4074 .num_ips = ARRAY_SIZE(addresses_B_1),
4075 .ips = addresses_B_1,
4076 .apply_expected = true,
4078 .r2 = {
4079 .owner = &ctx->a,
4080 .type = WREPL_TYPE_UNIQUE,
4081 .state = WREPL_STATE_TOMBSTONE,
4082 .node = WREPL_NODE_B,
4083 .is_static = false,
4084 .num_ips = ARRAY_SIZE(addresses_A_1),
4085 .ips = addresses_A_1,
4086 .apply_expected = true,
4090 * special group vs special group section,
4093 * sgroup,active vs. sgroup,active same addresses
4094 * => should be NOT replaced
4097 .line = __location__,
4098 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4099 .comment= "A:A_3_4 vs. B:A_3_4",
4100 .extra = true,
4101 .r1 = {
4102 .owner = &ctx->a,
4103 .type = WREPL_TYPE_SGROUP,
4104 .state = WREPL_STATE_ACTIVE,
4105 .node = WREPL_NODE_B,
4106 .is_static = false,
4107 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4108 .ips = addresses_A_3_4,
4109 .apply_expected = true
4111 .r2 = {
4112 .owner = &ctx->b,
4113 .type = WREPL_TYPE_SGROUP,
4114 .state = WREPL_STATE_ACTIVE,
4115 .node = WREPL_NODE_B,
4116 .is_static = false,
4117 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4118 .ips = addresses_A_3_4,
4119 .apply_expected = false,
4120 .sgroup_cleanup = true
4124 * sgroup,active vs. sgroup,active same addresses
4125 * => should be NOT replaced
4128 .line = __location__,
4129 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4130 .comment= "A:A_3_4 vs. B:NULL",
4131 .extra = true,
4132 .r1 = {
4133 .owner = &ctx->a,
4134 .type = WREPL_TYPE_SGROUP,
4135 .state = WREPL_STATE_ACTIVE,
4136 .node = WREPL_NODE_B,
4137 .is_static = false,
4138 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4139 .ips = addresses_A_3_4,
4140 .apply_expected = true
4142 .r2 = {
4143 .owner = &ctx->b,
4144 .type = WREPL_TYPE_SGROUP,
4145 .state = WREPL_STATE_ACTIVE,
4146 .node = WREPL_NODE_B,
4147 .is_static = false,
4148 .num_ips = 0,
4149 .ips = NULL,
4150 .apply_expected = false,
4151 .sgroup_cleanup = true
4155 * sgroup,active vs. sgroup,active subset addresses, special case...
4156 * => should NOT be replaced
4159 .line = __location__,
4160 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4161 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4",
4162 .extra = true,
4163 .r1 = {
4164 .owner = &ctx->a,
4165 .type = WREPL_TYPE_SGROUP,
4166 .state = WREPL_STATE_ACTIVE,
4167 .node = WREPL_NODE_B,
4168 .is_static = false,
4169 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4170 .ips = addresses_A_3_4_X_3_4,
4171 .apply_expected = true,
4173 .r2 = {
4174 .owner = &ctx->b,
4175 .type = WREPL_TYPE_SGROUP,
4176 .state = WREPL_STATE_ACTIVE,
4177 .node = WREPL_NODE_B,
4178 .is_static = false,
4179 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4180 .ips = addresses_A_3_4,
4181 .apply_expected = false,
4185 .line = __location__,
4186 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4187 .cleanup= true,
4188 .r1 = {
4189 .owner = &ctx->a,
4190 .type = WREPL_TYPE_SGROUP,
4191 .state = WREPL_STATE_ACTIVE,
4192 .node = WREPL_NODE_B,
4193 .is_static = false,
4194 .num_ips = 0,
4195 .ips = NULL,
4196 .apply_expected = false,
4198 .r2 = {
4199 .owner = &ctx->x,
4200 .type = WREPL_TYPE_SGROUP,
4201 .state = WREPL_STATE_ACTIVE,
4202 .node = WREPL_NODE_B,
4203 .is_static = false,
4204 .num_ips = 0,
4205 .ips = NULL,
4206 .apply_expected = false,
4210 * sgroup,active vs. sgroup,active different addresses, but owner changed
4211 * => should be replaced
4214 .line = __location__,
4215 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4216 .comment= "A:B_3_4 vs. B:A_3_4",
4217 .extra = true,
4218 .r1 = {
4219 .owner = &ctx->a,
4220 .type = WREPL_TYPE_SGROUP,
4221 .state = WREPL_STATE_ACTIVE,
4222 .node = WREPL_NODE_B,
4223 .is_static = false,
4224 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4225 .ips = addresses_B_3_4,
4226 .apply_expected = true,
4228 .r2 = {
4229 .owner = &ctx->b,
4230 .type = WREPL_TYPE_SGROUP,
4231 .state = WREPL_STATE_ACTIVE,
4232 .node = WREPL_NODE_B,
4233 .is_static = false,
4234 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4235 .ips = addresses_A_3_4,
4236 .apply_expected = true,
4237 .sgroup_cleanup = true
4241 * sgroup,active vs. sgroup,active different addresses, but owner changed
4242 * => should be replaced
4245 .line = __location__,
4246 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4247 .comment= "A:A_3_4 vs. B:A_3_4_OWNER_B",
4248 .extra = true,
4249 .r1 = {
4250 .owner = &ctx->a,
4251 .type = WREPL_TYPE_SGROUP,
4252 .state = WREPL_STATE_ACTIVE,
4253 .node = WREPL_NODE_B,
4254 .is_static = false,
4255 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4256 .ips = addresses_A_3_4,
4257 .apply_expected = true,
4259 .r2 = {
4260 .owner = &ctx->b,
4261 .type = WREPL_TYPE_SGROUP,
4262 .state = WREPL_STATE_ACTIVE,
4263 .node = WREPL_NODE_B,
4264 .is_static = false,
4265 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4266 .ips = addresses_A_3_4_OWNER_B,
4267 .apply_expected = true,
4268 .sgroup_cleanup = true
4272 * sgroup,active vs. sgroup,active different addresses, but owner changed
4273 * => should be replaced
4276 .line = __location__,
4277 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4278 .comment= "A:A_3_4_OWNER_B vs. B:A_3_4",
4279 .extra = true,
4280 .r1 = {
4281 .owner = &ctx->a,
4282 .type = WREPL_TYPE_SGROUP,
4283 .state = WREPL_STATE_ACTIVE,
4284 .node = WREPL_NODE_B,
4285 .is_static = false,
4286 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4287 .ips = addresses_A_3_4_OWNER_B,
4288 .apply_expected = true,
4290 .r2 = {
4291 .owner = &ctx->b,
4292 .type = WREPL_TYPE_SGROUP,
4293 .state = WREPL_STATE_ACTIVE,
4294 .node = WREPL_NODE_B,
4295 .is_static = false,
4296 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4297 .ips = addresses_A_3_4,
4298 .apply_expected = true,
4299 .sgroup_cleanup = true
4303 * sgroup,active vs. sgroup,active different addresses
4304 * => should be merged
4307 .line = __location__,
4308 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4309 .comment= "A:A_3_4 vs. B:B_3_4 => C:A_3_4_B_3_4",
4310 .extra = true,
4311 .r1 = {
4312 .owner = &ctx->a,
4313 .type = WREPL_TYPE_SGROUP,
4314 .state = WREPL_STATE_ACTIVE,
4315 .node = WREPL_NODE_B,
4316 .is_static = false,
4317 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4318 .ips = addresses_A_3_4,
4319 .apply_expected = true,
4321 .r2 = {
4322 .owner = &ctx->b,
4323 .type = WREPL_TYPE_SGROUP,
4324 .state = WREPL_STATE_ACTIVE,
4325 .node = WREPL_NODE_B,
4326 .is_static = false,
4327 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4328 .ips = addresses_B_3_4,
4329 .sgroup_merge = true,
4330 .sgroup_cleanup = true,
4334 * sgroup,active vs. sgroup,active different addresses, special case...
4335 * => should be merged
4338 .line = __location__,
4339 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4340 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4_X_3_4",
4341 .extra = true,
4342 .r1 = {
4343 .owner = &ctx->a,
4344 .type = WREPL_TYPE_SGROUP,
4345 .state = WREPL_STATE_ACTIVE,
4346 .node = WREPL_NODE_B,
4347 .is_static = false,
4348 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4349 .ips = addresses_B_3_4_X_3_4,
4350 .apply_expected = true,
4352 .r2 = {
4353 .owner = &ctx->b,
4354 .type = WREPL_TYPE_SGROUP,
4355 .state = WREPL_STATE_ACTIVE,
4356 .node = WREPL_NODE_B,
4357 .is_static = false,
4358 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4359 .ips = addresses_A_3_4,
4360 .sgroup_merge = true,
4361 .merge_owner = &ctx->b,
4362 .sgroup_cleanup = false
4366 .line = __location__,
4367 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4368 .cleanup= true,
4369 .r1 = {
4370 .owner = &ctx->b,
4371 .type = WREPL_TYPE_SGROUP,
4372 .state = WREPL_STATE_ACTIVE,
4373 .node = WREPL_NODE_B,
4374 .is_static = false,
4375 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4_OWNER_B),
4376 .ips = addresses_A_3_4_X_3_4_OWNER_B,
4377 .apply_expected = true,
4379 .r2 = {
4380 .owner = &ctx->b,
4381 .type = WREPL_TYPE_SGROUP,
4382 .state = WREPL_STATE_ACTIVE,
4383 .node = WREPL_NODE_B,
4384 .is_static = false,
4385 .num_ips = 0,
4386 .ips = NULL,
4387 .apply_expected = false,
4391 * sgroup,active vs. sgroup,active different addresses, special case...
4392 * => should be merged
4395 .line = __location__,
4396 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4397 .comment= "A:X_3_4 vs. B:A_3_4 => C:A_3_4_X_3_4",
4398 .extra = true,
4399 .r1 = {
4400 .owner = &ctx->a,
4401 .type = WREPL_TYPE_SGROUP,
4402 .state = WREPL_STATE_ACTIVE,
4403 .node = WREPL_NODE_B,
4404 .is_static = false,
4405 .num_ips = ARRAY_SIZE(addresses_X_3_4),
4406 .ips = addresses_X_3_4,
4407 .apply_expected = true,
4409 .r2 = {
4410 .owner = &ctx->b,
4411 .type = WREPL_TYPE_SGROUP,
4412 .state = WREPL_STATE_ACTIVE,
4413 .node = WREPL_NODE_B,
4414 .is_static = false,
4415 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4416 .ips = addresses_A_3_4,
4417 .sgroup_merge = true,
4418 .sgroup_cleanup = false
4422 .line = __location__,
4423 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4424 .cleanup= true,
4425 .r1 = {
4426 .owner = &ctx->a,
4427 .type = WREPL_TYPE_SGROUP,
4428 .state = WREPL_STATE_ACTIVE,
4429 .node = WREPL_NODE_B,
4430 .is_static = false,
4431 .num_ips = 0,
4432 .ips = NULL,
4433 .apply_expected = false,
4435 .r2 = {
4436 .owner = &ctx->x,
4437 .type = WREPL_TYPE_SGROUP,
4438 .state = WREPL_STATE_ACTIVE,
4439 .node = WREPL_NODE_B,
4440 .is_static = false,
4441 .num_ips = 0,
4442 .ips = NULL,
4443 .apply_expected = false,
4447 * sgroup,active vs. sgroup,active different addresses, special case...
4448 * => should be merged
4451 .line = __location__,
4452 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4453 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4_OWNER_B => B:A_3_4_OWNER_B_X_3_4",
4454 .extra = true,
4455 .r1 = {
4456 .owner = &ctx->a,
4457 .type = WREPL_TYPE_SGROUP,
4458 .state = WREPL_STATE_ACTIVE,
4459 .node = WREPL_NODE_B,
4460 .is_static = false,
4461 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4462 .ips = addresses_A_3_4_X_3_4,
4463 .apply_expected = true,
4465 .r2 = {
4466 .owner = &ctx->b,
4467 .type = WREPL_TYPE_SGROUP,
4468 .state = WREPL_STATE_ACTIVE,
4469 .node = WREPL_NODE_B,
4470 .is_static = false,
4471 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4472 .ips = addresses_A_3_4_OWNER_B,
4473 .sgroup_merge = true,
4474 .merge_owner = &ctx->b,
4478 .line = __location__,
4479 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4480 .cleanup= true,
4481 .r1 = {
4482 .owner = &ctx->b,
4483 .type = WREPL_TYPE_SGROUP,
4484 .state = WREPL_STATE_ACTIVE,
4485 .node = WREPL_NODE_B,
4486 .is_static = false,
4487 .num_ips = 0,
4488 .ips = NULL,
4489 .apply_expected = false,
4491 .r2 = {
4492 .owner = &ctx->x,
4493 .type = WREPL_TYPE_SGROUP,
4494 .state = WREPL_STATE_ACTIVE,
4495 .node = WREPL_NODE_B,
4496 .is_static = false,
4497 .num_ips = 0,
4498 .ips = NULL,
4499 .apply_expected = false,
4503 * sgroup,active vs. sgroup,active partly different addresses, special case...
4504 * => should be merged
4507 .line = __location__,
4508 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4509 .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",
4510 .extra = true,
4511 .r1 = {
4512 .owner = &ctx->a,
4513 .type = WREPL_TYPE_SGROUP,
4514 .state = WREPL_STATE_ACTIVE,
4515 .node = WREPL_NODE_B,
4516 .is_static = false,
4517 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4518 .ips = addresses_B_3_4_X_3_4,
4519 .apply_expected = true,
4521 .r2 = {
4522 .owner = &ctx->b,
4523 .type = WREPL_TYPE_SGROUP,
4524 .state = WREPL_STATE_ACTIVE,
4525 .node = WREPL_NODE_B,
4526 .is_static = false,
4527 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_1_2),
4528 .ips = addresses_B_3_4_X_1_2,
4529 .sgroup_merge = true,
4530 .sgroup_cleanup = false
4534 .line = __location__,
4535 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4536 .cleanup= true,
4537 .r1 = {
4538 .owner = &ctx->b,
4539 .type = WREPL_TYPE_SGROUP,
4540 .state = WREPL_STATE_ACTIVE,
4541 .node = WREPL_NODE_B,
4542 .is_static = false,
4543 .num_ips = 0,
4544 .ips = NULL,
4545 .apply_expected = false,
4547 .r2 = {
4548 .owner = &ctx->x,
4549 .type = WREPL_TYPE_SGROUP,
4550 .state = WREPL_STATE_ACTIVE,
4551 .node = WREPL_NODE_B,
4552 .is_static = false,
4553 .num_ips = 0,
4554 .ips = NULL,
4555 .apply_expected = false,
4559 * sgroup,active vs. sgroup,active different addresses, special case...
4560 * => should be merged
4563 .line = __location__,
4564 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4565 .comment= "A:A_3_4_B_3_4 vs. B:NULL => B:A_3_4",
4566 .extra = true,
4567 .r1 = {
4568 .owner = &ctx->a,
4569 .type = WREPL_TYPE_SGROUP,
4570 .state = WREPL_STATE_ACTIVE,
4571 .node = WREPL_NODE_B,
4572 .is_static = false,
4573 .num_ips = ARRAY_SIZE(addresses_A_3_4_B_3_4),
4574 .ips = addresses_A_3_4_B_3_4,
4575 .apply_expected = true,
4577 .r2 = {
4578 .owner = &ctx->b,
4579 .type = WREPL_TYPE_SGROUP,
4580 .state = WREPL_STATE_ACTIVE,
4581 .node = WREPL_NODE_B,
4582 .is_static = false,
4583 .num_ips = 0,
4584 .ips = NULL,
4585 .sgroup_merge = true,
4586 .merge_owner = &ctx->b,
4587 .sgroup_cleanup = true
4591 .line = __location__,
4592 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4593 .cleanup= true,
4594 .r1 = {
4595 .owner = &ctx->a,
4596 .type = WREPL_TYPE_SGROUP,
4597 .state = WREPL_STATE_ACTIVE,
4598 .node = WREPL_NODE_B,
4599 .is_static = false,
4600 .num_ips = 0,
4601 .ips = NULL,
4602 .apply_expected = false,
4604 .r2 = {
4605 .owner = &ctx->a,
4606 .type = WREPL_TYPE_UNIQUE,
4607 .state = WREPL_STATE_TOMBSTONE,
4608 .node = WREPL_NODE_B,
4609 .is_static = false,
4610 .num_ips = ARRAY_SIZE(addresses_A_1),
4611 .ips = addresses_A_1,
4612 .apply_expected = true,
4616 * sgroup,active vs. sgroup,active different addresses, special case...
4617 * => should be merged
4620 .line = __location__,
4621 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4622 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:X_3_4",
4623 .extra = true,
4624 .r1 = {
4625 .owner = &ctx->a,
4626 .type = WREPL_TYPE_SGROUP,
4627 .state = WREPL_STATE_ACTIVE,
4628 .node = WREPL_NODE_B,
4629 .is_static = false,
4630 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4631 .ips = addresses_B_3_4_X_3_4,
4632 .apply_expected = true,
4634 .r2 = {
4635 .owner = &ctx->b,
4636 .type = WREPL_TYPE_SGROUP,
4637 .state = WREPL_STATE_ACTIVE,
4638 .node = WREPL_NODE_B,
4639 .is_static = false,
4640 .num_ips = 0,
4641 .ips = NULL,
4642 .sgroup_merge = true,
4643 .merge_owner = &ctx->b,
4644 .sgroup_cleanup = true
4648 .line = __location__,
4649 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4650 .cleanup= true,
4651 .r1 = {
4652 .owner = &ctx->x,
4653 .type = WREPL_TYPE_SGROUP,
4654 .state = WREPL_STATE_ACTIVE,
4655 .node = WREPL_NODE_B,
4656 .is_static = false,
4657 .num_ips = 0,
4658 .ips = NULL,
4659 .apply_expected = false,
4661 .r2 = {
4662 .owner = &ctx->x,
4663 .type = WREPL_TYPE_UNIQUE,
4664 .state = WREPL_STATE_TOMBSTONE,
4665 .node = WREPL_NODE_B,
4666 .is_static = false,
4667 .num_ips = ARRAY_SIZE(addresses_A_1),
4668 .ips = addresses_A_1,
4669 .apply_expected = true,
4674 * sgroup,active vs. sgroup,tombstone different no addresses, special
4675 * => should be replaced
4678 .line = __location__,
4679 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4680 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:NULL",
4681 .extra = true,
4682 .r1 = {
4683 .owner = &ctx->a,
4684 .type = WREPL_TYPE_SGROUP,
4685 .state = WREPL_STATE_ACTIVE,
4686 .node = WREPL_NODE_B,
4687 .is_static = false,
4688 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4689 .ips = addresses_B_3_4_X_3_4,
4690 .apply_expected = true,
4692 .r2 = {
4693 .owner = &ctx->b,
4694 .type = WREPL_TYPE_SGROUP,
4695 .state = WREPL_STATE_TOMBSTONE,
4696 .node = WREPL_NODE_B,
4697 .is_static = false,
4698 .num_ips = 0,
4699 .ips = NULL,
4700 .apply_expected = true,
4704 * sgroup,active vs. sgroup,tombstone different addresses
4705 * => should be replaced
4708 .line = __location__,
4709 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4710 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4",
4711 .extra = true,
4712 .r1 = {
4713 .owner = &ctx->a,
4714 .type = WREPL_TYPE_SGROUP,
4715 .state = WREPL_STATE_ACTIVE,
4716 .node = WREPL_NODE_B,
4717 .is_static = false,
4718 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4719 .ips = addresses_B_3_4_X_3_4,
4720 .apply_expected = true,
4722 .r2 = {
4723 .owner = &ctx->b,
4724 .type = WREPL_TYPE_SGROUP,
4725 .state = WREPL_STATE_TOMBSTONE,
4726 .node = WREPL_NODE_B,
4727 .is_static = false,
4728 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4729 .ips = addresses_A_3_4,
4730 .apply_expected = true,
4734 * sgroup,active vs. sgroup,tombstone subset addresses
4735 * => should be replaced
4738 .line = __location__,
4739 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4740 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4 => B:B_3_4",
4741 .extra = true,
4742 .r1 = {
4743 .owner = &ctx->a,
4744 .type = WREPL_TYPE_SGROUP,
4745 .state = WREPL_STATE_ACTIVE,
4746 .node = WREPL_NODE_B,
4747 .is_static = false,
4748 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4749 .ips = addresses_B_3_4_X_3_4,
4750 .apply_expected = true,
4752 .r2 = {
4753 .owner = &ctx->b,
4754 .type = WREPL_TYPE_SGROUP,
4755 .state = WREPL_STATE_TOMBSTONE,
4756 .node = WREPL_NODE_B,
4757 .is_static = false,
4758 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4759 .ips = addresses_B_3_4,
4760 .apply_expected = true,
4764 * sgroup,active vs. sgroup,active same addresses
4765 * => should be replaced
4768 .line = __location__,
4769 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4770 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4_X_3_4 => B:B_3_4_X_3_4",
4771 .extra = true,
4772 .r1 = {
4773 .owner = &ctx->a,
4774 .type = WREPL_TYPE_SGROUP,
4775 .state = WREPL_STATE_ACTIVE,
4776 .node = WREPL_NODE_B,
4777 .is_static = false,
4778 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4779 .ips = addresses_B_3_4_X_3_4,
4780 .apply_expected = true,
4782 .r2 = {
4783 .owner = &ctx->b,
4784 .type = WREPL_TYPE_SGROUP,
4785 .state = WREPL_STATE_TOMBSTONE,
4786 .node = WREPL_NODE_B,
4787 .is_static = false,
4788 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4789 .ips = addresses_B_3_4_X_3_4,
4790 .apply_expected = true,
4795 * This should be the last record in this array,
4796 * we need to make sure the we leave a tombstoned unique entry
4797 * owned by OWNER_A
4800 .line = __location__,
4801 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4802 .cleanup= true,
4803 .r1 = {
4804 .owner = &ctx->a,
4805 .type = WREPL_TYPE_UNIQUE,
4806 .state = WREPL_STATE_TOMBSTONE,
4807 .node = WREPL_NODE_B,
4808 .is_static = false,
4809 .num_ips = ARRAY_SIZE(addresses_A_1),
4810 .ips = addresses_A_1,
4811 .apply_expected = true
4813 .r2 = {
4814 .owner = &ctx->a,
4815 .type = WREPL_TYPE_UNIQUE,
4816 .state = WREPL_STATE_TOMBSTONE,
4817 .node = WREPL_NODE_B,
4818 .is_static = false,
4819 .num_ips = ARRAY_SIZE(addresses_A_1),
4820 .ips = addresses_A_1,
4821 .apply_expected = true
4823 }}; /* do not add entries here, this should be the last record! */
4825 wins_name_r1 = &wins_name1;
4826 wins_name_r2 = &wins_name2;
4828 torture_comment(tctx, "Test Replica Conflicts with different owners\n");
4830 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
4832 if (!records[i].extra && !records[i].cleanup) {
4833 /* we should test the worst cases */
4834 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
4835 torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n",
4836 __location__, i, records[i].line);
4837 return false;
4838 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
4839 torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n",
4840 __location__, i, records[i].line);
4841 return false;
4845 if (!records[i].cleanup) {
4846 const char *expected;
4847 const char *ips;
4849 if (records[i].r2.sgroup_merge) {
4850 expected = "SGROUP_MERGE";
4851 } else if (records[i].r2.apply_expected) {
4852 expected = "REPLACE";
4853 } else {
4854 expected = "NOT REPLACE";
4857 if (!records[i].r1.ips && !records[i].r2.ips) {
4858 ips = "with no ip(s)";
4859 } else if (records[i].r1.ips==records[i].r2.ips) {
4860 ips = "with same ip(s)";
4861 } else {
4862 ips = "with different ip(s)";
4865 torture_comment(tctx, "%s,%s%s vs. %s,%s%s %s => %s\n",
4866 wrepl_name_type_string(records[i].r1.type),
4867 wrepl_name_state_string(records[i].r1.state),
4868 (records[i].r1.is_static?",static":""),
4869 wrepl_name_type_string(records[i].r2.type),
4870 wrepl_name_state_string(records[i].r2.state),
4871 (records[i].r2.is_static?",static":""),
4872 (records[i].comment?records[i].comment:ips),
4873 expected);
4877 * Setup R1
4879 wins_name_r1->name = &records[i].name;
4880 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
4881 records[i].r1.state,
4882 records[i].r1.node,
4883 records[i].r1.is_static);
4884 wins_name_r1->id = ++records[i].r1.owner->max_version;
4885 if (wins_name_r1->flags & 2) {
4886 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
4887 wins_name_r1->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
4888 records[i].r1.ips);
4889 } else {
4890 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
4892 wins_name_r1->unknown = "255.255.255.255";
4894 /* now apply R1 */
4895 ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1);
4896 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4897 wins_name_r1, records[i].r1.apply_expected);
4900 * Setup R2
4902 wins_name_r2->name = &records[i].name;
4903 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
4904 records[i].r2.state,
4905 records[i].r2.node,
4906 records[i].r2.is_static);
4907 wins_name_r2->id = ++records[i].r2.owner->max_version;
4908 if (wins_name_r2->flags & 2) {
4909 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
4910 wins_name_r2->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
4911 records[i].r2.ips);
4912 } else {
4913 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
4915 wins_name_r2->unknown = "255.255.255.255";
4917 /* now apply R2 */
4918 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4919 if (records[i].r1.state == WREPL_STATE_RELEASED) {
4920 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4921 wins_name_r1, false);
4922 } else if (records[i].r2.sgroup_merge) {
4923 ret &= test_wrepl_sgroup_merged(tctx, ctx, records[i].r2.merge_owner,
4924 records[i].r1.owner,
4925 records[i].r1.num_ips, records[i].r1.ips,
4926 records[i].r2.owner,
4927 records[i].r2.num_ips, records[i].r2.ips,
4928 wins_name_r2);
4929 } else if (records[i].r1.owner != records[i].r2.owner) {
4930 bool _expected;
4931 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
4932 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4933 wins_name_r1, _expected);
4935 if (records[i].r2.state == WREPL_STATE_RELEASED) {
4936 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner,
4937 wins_name_r2, false);
4938 } else if (!records[i].r2.sgroup_merge) {
4939 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner,
4940 wins_name_r2, records[i].r2.apply_expected);
4943 if (records[i].r2.sgroup_cleanup) {
4944 if (!ret) {
4945 torture_comment(tctx, "failed before sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4946 return ret;
4949 /* clean up the SGROUP record */
4950 wins_name_r1->name = &records[i].name;
4951 wins_name_r1->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4952 WREPL_STATE_ACTIVE,
4953 WREPL_NODE_B, false);
4954 wins_name_r1->id = ++records[i].r1.owner->max_version;
4955 wins_name_r1->addresses.addresses.num_ips = 0;
4956 wins_name_r1->addresses.addresses.ips = NULL;
4957 wins_name_r1->unknown = "255.255.255.255";
4958 ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1);
4960 /* here we test how names from an owner are deleted */
4961 if (records[i].r2.sgroup_merge && records[i].r2.num_ips) {
4962 ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL,
4963 records[i].r2.owner,
4964 records[i].r2.num_ips, records[i].r2.ips,
4965 records[i].r1.owner,
4966 0, NULL,
4967 wins_name_r2);
4970 /* clean up the SGROUP record */
4971 wins_name_r2->name = &records[i].name;
4972 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4973 WREPL_STATE_ACTIVE,
4974 WREPL_NODE_B, false);
4975 wins_name_r2->id = ++records[i].r2.owner->max_version;
4976 wins_name_r2->addresses.addresses.num_ips = 0;
4977 wins_name_r2->addresses.addresses.ips = NULL;
4978 wins_name_r2->unknown = "255.255.255.255";
4979 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4981 /* take ownership of the SGROUP record */
4982 wins_name_r2->name = &records[i].name;
4983 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4984 WREPL_STATE_ACTIVE,
4985 WREPL_NODE_B, false);
4986 wins_name_r2->id = ++records[i].r2.owner->max_version;
4987 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
4988 wins_name_r2->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
4989 addresses_B_1);
4990 wins_name_r2->unknown = "255.255.255.255";
4991 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4992 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true);
4994 /* overwrite the SGROUP record with unique,tombstone */
4995 wins_name_r2->name = &records[i].name;
4996 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4997 WREPL_STATE_TOMBSTONE,
4998 WREPL_NODE_B, false);
4999 wins_name_r2->id = ++records[i].r2.owner->max_version;
5000 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
5001 wins_name_r2->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
5002 addresses_B_1);
5003 wins_name_r2->unknown = "255.255.255.255";
5004 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
5005 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true);
5007 if (!ret) {
5008 torture_comment(tctx, "failed in sgroup_cleanup record[%u]: %s\n", i, records[i].line);
5009 return ret;
5013 /* the first one is a cleanup run */
5014 if (!ret && i == 0) ret = true;
5016 if (!ret) {
5017 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
5018 return ret;
5022 return ret;
5025 static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx,
5026 struct test_wrepl_conflict_conn *ctx)
5028 bool ret = true;
5029 NTSTATUS status;
5030 struct wrepl_wins_name wins_name_;
5031 struct wrepl_wins_name *wins_name = &wins_name_;
5032 struct nbt_name_register name_register_;
5033 struct nbt_name_register *name_register = &name_register_;
5034 struct nbt_name_release release_;
5035 struct nbt_name_release *release = &release_;
5036 uint32_t i;
5037 struct {
5038 const char *line; /* just better debugging */
5039 struct nbt_name name;
5040 struct {
5041 uint32_t nb_flags;
5042 bool mhomed;
5043 uint32_t num_ips;
5044 const struct wrepl_ip *ips;
5045 bool apply_expected;
5046 } wins;
5047 struct {
5048 enum wrepl_name_type type;
5049 enum wrepl_name_state state;
5050 enum wrepl_name_node node;
5051 bool is_static;
5052 uint32_t num_ips;
5053 const struct wrepl_ip *ips;
5054 bool apply_expected;
5055 } replica;
5056 } records[] = {
5058 * unique vs. unique section
5061 * unique,released vs. unique,active with same ip(s)
5064 .line = __location__,
5065 .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL),
5066 .wins = {
5067 .nb_flags = 0,
5068 .mhomed = false,
5069 .num_ips = ctx->addresses_best_num,
5070 .ips = ctx->addresses_best,
5071 .apply_expected = true
5073 .replica= {
5074 .type = WREPL_TYPE_UNIQUE,
5075 .state = WREPL_STATE_ACTIVE,
5076 .node = WREPL_NODE_B,
5077 .is_static = false,
5078 .num_ips = ctx->addresses_best_num,
5079 .ips = ctx->addresses_best,
5080 .apply_expected = true
5084 * unique,released vs. unique,active with different ip(s)
5087 .line = __location__,
5088 .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL),
5089 .wins = {
5090 .nb_flags = 0,
5091 .mhomed = false,
5092 .num_ips = ctx->addresses_best_num,
5093 .ips = ctx->addresses_best,
5094 .apply_expected = true
5096 .replica= {
5097 .type = WREPL_TYPE_UNIQUE,
5098 .state = WREPL_STATE_ACTIVE,
5099 .node = WREPL_NODE_B,
5100 .is_static = false,
5101 .num_ips = ARRAY_SIZE(addresses_B_1),
5102 .ips = addresses_B_1,
5103 .apply_expected = true
5107 * unique,released vs. unique,tombstone with same ip(s)
5110 .line = __location__,
5111 .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL),
5112 .wins = {
5113 .nb_flags = 0,
5114 .mhomed = false,
5115 .num_ips = ctx->addresses_best_num,
5116 .ips = ctx->addresses_best,
5117 .apply_expected = true
5119 .replica= {
5120 .type = WREPL_TYPE_UNIQUE,
5121 .state = WREPL_STATE_TOMBSTONE,
5122 .node = WREPL_NODE_B,
5123 .is_static = false,
5124 .num_ips = ctx->addresses_best_num,
5125 .ips = ctx->addresses_best,
5126 .apply_expected = true
5130 * unique,released vs. unique,tombstone with different ip(s)
5133 .line = __location__,
5134 .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL),
5135 .wins = {
5136 .nb_flags = 0,
5137 .mhomed = false,
5138 .num_ips = ctx->addresses_best_num,
5139 .ips = ctx->addresses_best,
5140 .apply_expected = true
5142 .replica= {
5143 .type = WREPL_TYPE_UNIQUE,
5144 .state = WREPL_STATE_TOMBSTONE,
5145 .node = WREPL_NODE_B,
5146 .is_static = false,
5147 .num_ips = ARRAY_SIZE(addresses_B_1),
5148 .ips = addresses_B_1,
5149 .apply_expected = true
5153 * unique vs. group section
5156 * unique,released vs. group,active with same ip(s)
5159 .line = __location__,
5160 .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL),
5161 .wins = {
5162 .nb_flags = 0,
5163 .mhomed = false,
5164 .num_ips = ctx->addresses_best_num,
5165 .ips = ctx->addresses_best,
5166 .apply_expected = true
5168 .replica= {
5169 .type = WREPL_TYPE_GROUP,
5170 .state = WREPL_STATE_ACTIVE,
5171 .node = WREPL_NODE_B,
5172 .is_static = false,
5173 .num_ips = ctx->addresses_best_num,
5174 .ips = ctx->addresses_best,
5175 .apply_expected = true
5179 * unique,released vs. group,active with different ip(s)
5182 .line = __location__,
5183 .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL),
5184 .wins = {
5185 .nb_flags = 0,
5186 .mhomed = false,
5187 .num_ips = ctx->addresses_best_num,
5188 .ips = ctx->addresses_best,
5189 .apply_expected = true
5191 .replica= {
5192 .type = WREPL_TYPE_GROUP,
5193 .state = WREPL_STATE_ACTIVE,
5194 .node = WREPL_NODE_B,
5195 .is_static = false,
5196 .num_ips = ARRAY_SIZE(addresses_B_1),
5197 .ips = addresses_B_1,
5198 .apply_expected = true
5202 * unique,released vs. group,tombstone with same ip(s)
5205 .line = __location__,
5206 .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL),
5207 .wins = {
5208 .nb_flags = 0,
5209 .mhomed = false,
5210 .num_ips = ctx->addresses_best_num,
5211 .ips = ctx->addresses_best,
5212 .apply_expected = true
5214 .replica= {
5215 .type = WREPL_TYPE_GROUP,
5216 .state = WREPL_STATE_TOMBSTONE,
5217 .node = WREPL_NODE_B,
5218 .is_static = false,
5219 .num_ips = ctx->addresses_best_num,
5220 .ips = ctx->addresses_best,
5221 .apply_expected = true
5225 * unique,released vs. group,tombstone with different ip(s)
5228 .line = __location__,
5229 .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL),
5230 .wins = {
5231 .nb_flags = 0,
5232 .mhomed = false,
5233 .num_ips = ctx->addresses_best_num,
5234 .ips = ctx->addresses_best,
5235 .apply_expected = true
5237 .replica= {
5238 .type = WREPL_TYPE_GROUP,
5239 .state = WREPL_STATE_TOMBSTONE,
5240 .node = WREPL_NODE_B,
5241 .is_static = false,
5242 .num_ips = ARRAY_SIZE(addresses_B_1),
5243 .ips = addresses_B_1,
5244 .apply_expected = true
5248 * unique vs. special group section
5251 * unique,released vs. sgroup,active with same ip(s)
5254 .line = __location__,
5255 .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL),
5256 .wins = {
5257 .nb_flags = 0,
5258 .mhomed = false,
5259 .num_ips = ctx->addresses_best_num,
5260 .ips = ctx->addresses_best,
5261 .apply_expected = true
5263 .replica= {
5264 .type = WREPL_TYPE_SGROUP,
5265 .state = WREPL_STATE_ACTIVE,
5266 .node = WREPL_NODE_B,
5267 .is_static = false,
5268 .num_ips = ctx->addresses_best_num,
5269 .ips = ctx->addresses_best,
5270 .apply_expected = true
5274 * unique,released vs. sgroup,active with different ip(s)
5277 .line = __location__,
5278 .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL),
5279 .wins = {
5280 .nb_flags = 0,
5281 .mhomed = false,
5282 .num_ips = ctx->addresses_best_num,
5283 .ips = ctx->addresses_best,
5284 .apply_expected = true
5286 .replica= {
5287 .type = WREPL_TYPE_SGROUP,
5288 .state = WREPL_STATE_ACTIVE,
5289 .node = WREPL_NODE_B,
5290 .is_static = false,
5291 .num_ips = ARRAY_SIZE(addresses_B_1),
5292 .ips = addresses_B_1,
5293 .apply_expected = true
5297 * unique,released vs. sgroup,tombstone with same ip(s)
5300 .line = __location__,
5301 .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL),
5302 .wins = {
5303 .nb_flags = 0,
5304 .mhomed = false,
5305 .num_ips = ctx->addresses_best_num,
5306 .ips = ctx->addresses_best,
5307 .apply_expected = true
5309 .replica= {
5310 .type = WREPL_TYPE_SGROUP,
5311 .state = WREPL_STATE_TOMBSTONE,
5312 .node = WREPL_NODE_B,
5313 .is_static = false,
5314 .num_ips = ctx->addresses_best_num,
5315 .ips = ctx->addresses_best,
5316 .apply_expected = true
5320 * unique,released vs. sgroup,tombstone with different ip(s)
5323 .line = __location__,
5324 .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL),
5325 .wins = {
5326 .nb_flags = 0,
5327 .mhomed = false,
5328 .num_ips = ctx->addresses_best_num,
5329 .ips = ctx->addresses_best,
5330 .apply_expected = true
5332 .replica= {
5333 .type = WREPL_TYPE_SGROUP,
5334 .state = WREPL_STATE_TOMBSTONE,
5335 .node = WREPL_NODE_B,
5336 .is_static = false,
5337 .num_ips = ARRAY_SIZE(addresses_B_1),
5338 .ips = addresses_B_1,
5339 .apply_expected = true
5343 * unique vs. multi homed section
5346 * unique,released vs. mhomed,active with same ip(s)
5349 .line = __location__,
5350 .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL),
5351 .wins = {
5352 .nb_flags = 0,
5353 .mhomed = false,
5354 .num_ips = ctx->addresses_best_num,
5355 .ips = ctx->addresses_best,
5356 .apply_expected = true
5358 .replica= {
5359 .type = WREPL_TYPE_MHOMED,
5360 .state = WREPL_STATE_ACTIVE,
5361 .node = WREPL_NODE_B,
5362 .is_static = false,
5363 .num_ips = ctx->addresses_best_num,
5364 .ips = ctx->addresses_best,
5365 .apply_expected = true
5369 * unique,released vs. mhomed,active with different ip(s)
5372 .line = __location__,
5373 .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL),
5374 .wins = {
5375 .nb_flags = 0,
5376 .mhomed = false,
5377 .num_ips = ctx->addresses_best_num,
5378 .ips = ctx->addresses_best,
5379 .apply_expected = true
5381 .replica= {
5382 .type = WREPL_TYPE_MHOMED,
5383 .state = WREPL_STATE_ACTIVE,
5384 .node = WREPL_NODE_B,
5385 .is_static = false,
5386 .num_ips = ARRAY_SIZE(addresses_B_1),
5387 .ips = addresses_B_1,
5388 .apply_expected = true
5392 * unique,released vs. mhomed,tombstone with same ip(s)
5395 .line = __location__,
5396 .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL),
5397 .wins = {
5398 .nb_flags = 0,
5399 .mhomed = false,
5400 .num_ips = ctx->addresses_best_num,
5401 .ips = ctx->addresses_best,
5402 .apply_expected = true
5404 .replica= {
5405 .type = WREPL_TYPE_MHOMED,
5406 .state = WREPL_STATE_TOMBSTONE,
5407 .node = WREPL_NODE_B,
5408 .is_static = false,
5409 .num_ips = ctx->addresses_best_num,
5410 .ips = ctx->addresses_best,
5411 .apply_expected = true
5415 * unique,released vs. mhomed,tombstone with different ip(s)
5418 .line = __location__,
5419 .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL),
5420 .wins = {
5421 .nb_flags = 0,
5422 .mhomed = false,
5423 .num_ips = ctx->addresses_best_num,
5424 .ips = ctx->addresses_best,
5425 .apply_expected = true
5427 .replica= {
5428 .type = WREPL_TYPE_MHOMED,
5429 .state = WREPL_STATE_TOMBSTONE,
5430 .node = WREPL_NODE_B,
5431 .is_static = false,
5432 .num_ips = ARRAY_SIZE(addresses_B_1),
5433 .ips = addresses_B_1,
5434 .apply_expected = true
5438 * group vs. unique section
5441 * group,released vs. unique,active with same ip(s)
5444 .line = __location__,
5445 .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL),
5446 .wins = {
5447 .nb_flags = NBT_NM_GROUP,
5448 .mhomed = false,
5449 .num_ips = ctx->addresses_best_num,
5450 .ips = ctx->addresses_best,
5451 .apply_expected = true
5453 .replica= {
5454 .type = WREPL_TYPE_UNIQUE,
5455 .state = WREPL_STATE_ACTIVE,
5456 .node = WREPL_NODE_B,
5457 .is_static = false,
5458 .num_ips = ctx->addresses_best_num,
5459 .ips = ctx->addresses_best,
5460 .apply_expected = false
5464 * group,released vs. unique,active with different ip(s)
5467 .line = __location__,
5468 .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL),
5469 .wins = {
5470 .nb_flags = NBT_NM_GROUP,
5471 .mhomed = false,
5472 .num_ips = ctx->addresses_best_num,
5473 .ips = ctx->addresses_best,
5474 .apply_expected = true
5476 .replica= {
5477 .type = WREPL_TYPE_UNIQUE,
5478 .state = WREPL_STATE_ACTIVE,
5479 .node = WREPL_NODE_B,
5480 .is_static = false,
5481 .num_ips = ARRAY_SIZE(addresses_B_1),
5482 .ips = addresses_B_1,
5483 .apply_expected = false
5487 * group,released vs. unique,tombstone with same ip(s)
5490 .line = __location__,
5491 .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL),
5492 .wins = {
5493 .nb_flags = NBT_NM_GROUP,
5494 .mhomed = false,
5495 .num_ips = ctx->addresses_best_num,
5496 .ips = ctx->addresses_best,
5497 .apply_expected = true
5499 .replica= {
5500 .type = WREPL_TYPE_UNIQUE,
5501 .state = WREPL_STATE_TOMBSTONE,
5502 .node = WREPL_NODE_B,
5503 .is_static = false,
5504 .num_ips = ctx->addresses_best_num,
5505 .ips = ctx->addresses_best,
5506 .apply_expected = false
5510 * group,released vs. unique,tombstone with different ip(s)
5513 .line = __location__,
5514 .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL),
5515 .wins = {
5516 .nb_flags = NBT_NM_GROUP,
5517 .mhomed = false,
5518 .num_ips = ctx->addresses_best_num,
5519 .ips = ctx->addresses_best,
5520 .apply_expected = true
5522 .replica= {
5523 .type = WREPL_TYPE_UNIQUE,
5524 .state = WREPL_STATE_TOMBSTONE,
5525 .node = WREPL_NODE_B,
5526 .is_static = false,
5527 .num_ips = ARRAY_SIZE(addresses_B_1),
5528 .ips = addresses_B_1,
5529 .apply_expected = false
5533 * group vs. group section
5536 * group,released vs. group,active with same ip(s)
5539 .line = __location__,
5540 .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL),
5541 .wins = {
5542 .nb_flags = NBT_NM_GROUP,
5543 .mhomed = false,
5544 .num_ips = ctx->addresses_best_num,
5545 .ips = ctx->addresses_best,
5546 .apply_expected = true
5548 .replica= {
5549 .type = WREPL_TYPE_GROUP,
5550 .state = WREPL_STATE_ACTIVE,
5551 .node = WREPL_NODE_B,
5552 .is_static = false,
5553 .num_ips = ctx->addresses_best_num,
5554 .ips = ctx->addresses_best,
5555 .apply_expected = true
5559 * group,released vs. group,active with different ip(s)
5562 .line = __location__,
5563 .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL),
5564 .wins = {
5565 .nb_flags = NBT_NM_GROUP,
5566 .mhomed = false,
5567 .num_ips = ctx->addresses_best_num,
5568 .ips = ctx->addresses_best,
5569 .apply_expected = true
5571 .replica= {
5572 .type = WREPL_TYPE_GROUP,
5573 .state = WREPL_STATE_ACTIVE,
5574 .node = WREPL_NODE_B,
5575 .is_static = false,
5576 .num_ips = ARRAY_SIZE(addresses_B_1),
5577 .ips = addresses_B_1,
5578 .apply_expected = true
5582 * group,released vs. group,tombstone with same ip(s)
5585 .line = __location__,
5586 .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL),
5587 .wins = {
5588 .nb_flags = NBT_NM_GROUP,
5589 .mhomed = false,
5590 .num_ips = ctx->addresses_best_num,
5591 .ips = ctx->addresses_best,
5592 .apply_expected = true
5594 .replica= {
5595 .type = WREPL_TYPE_GROUP,
5596 .state = WREPL_STATE_TOMBSTONE,
5597 .node = WREPL_NODE_B,
5598 .is_static = false,
5599 .num_ips = ctx->addresses_best_num,
5600 .ips = ctx->addresses_best,
5601 .apply_expected = true
5605 * group,released vs. group,tombstone with different ip(s)
5608 .line = __location__,
5609 .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL),
5610 .wins = {
5611 .nb_flags = NBT_NM_GROUP,
5612 .mhomed = false,
5613 .num_ips = ctx->addresses_best_num,
5614 .ips = ctx->addresses_best,
5615 .apply_expected = true
5617 .replica= {
5618 .type = WREPL_TYPE_GROUP,
5619 .state = WREPL_STATE_TOMBSTONE,
5620 .node = WREPL_NODE_B,
5621 .is_static = false,
5622 .num_ips = ARRAY_SIZE(addresses_B_1),
5623 .ips = addresses_B_1,
5624 .apply_expected = true
5628 * group vs. special group section
5631 * group,released vs. sgroup,active with same ip(s)
5634 .line = __location__,
5635 .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL),
5636 .wins = {
5637 .nb_flags = NBT_NM_GROUP,
5638 .mhomed = false,
5639 .num_ips = ctx->addresses_best_num,
5640 .ips = ctx->addresses_best,
5641 .apply_expected = true
5643 .replica= {
5644 .type = WREPL_TYPE_SGROUP,
5645 .state = WREPL_STATE_ACTIVE,
5646 .node = WREPL_NODE_B,
5647 .is_static = false,
5648 .num_ips = ctx->addresses_best_num,
5649 .ips = ctx->addresses_best,
5650 .apply_expected = false
5654 * group,released vs. sgroup,active with different ip(s)
5657 .line = __location__,
5658 .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL),
5659 .wins = {
5660 .nb_flags = NBT_NM_GROUP,
5661 .mhomed = false,
5662 .num_ips = ctx->addresses_best_num,
5663 .ips = ctx->addresses_best,
5664 .apply_expected = true
5666 .replica= {
5667 .type = WREPL_TYPE_SGROUP,
5668 .state = WREPL_STATE_ACTIVE,
5669 .node = WREPL_NODE_B,
5670 .is_static = false,
5671 .num_ips = ARRAY_SIZE(addresses_B_1),
5672 .ips = addresses_B_1,
5673 .apply_expected = false
5677 * group,released vs. sgroup,tombstone with same ip(s)
5680 .line = __location__,
5681 .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL),
5682 .wins = {
5683 .nb_flags = NBT_NM_GROUP,
5684 .mhomed = false,
5685 .num_ips = ctx->addresses_best_num,
5686 .ips = ctx->addresses_best,
5687 .apply_expected = true
5689 .replica= {
5690 .type = WREPL_TYPE_SGROUP,
5691 .state = WREPL_STATE_TOMBSTONE,
5692 .node = WREPL_NODE_B,
5693 .is_static = false,
5694 .num_ips = ctx->addresses_best_num,
5695 .ips = ctx->addresses_best,
5696 .apply_expected = false
5700 * group,released vs. sgroup,tombstone with different ip(s)
5703 .line = __location__,
5704 .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL),
5705 .wins = {
5706 .nb_flags = NBT_NM_GROUP,
5707 .mhomed = false,
5708 .num_ips = ctx->addresses_best_num,
5709 .ips = ctx->addresses_best,
5710 .apply_expected = true
5712 .replica= {
5713 .type = WREPL_TYPE_SGROUP,
5714 .state = WREPL_STATE_TOMBSTONE,
5715 .node = WREPL_NODE_B,
5716 .is_static = false,
5717 .num_ips = ARRAY_SIZE(addresses_B_1),
5718 .ips = addresses_B_1,
5719 .apply_expected = false
5723 * group vs. multi homed section
5726 * group,released vs. mhomed,active with same ip(s)
5729 .line = __location__,
5730 .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL),
5731 .wins = {
5732 .nb_flags = NBT_NM_GROUP,
5733 .mhomed = false,
5734 .num_ips = ctx->addresses_best_num,
5735 .ips = ctx->addresses_best,
5736 .apply_expected = true
5738 .replica= {
5739 .type = WREPL_TYPE_MHOMED,
5740 .state = WREPL_STATE_ACTIVE,
5741 .node = WREPL_NODE_B,
5742 .is_static = false,
5743 .num_ips = ctx->addresses_best_num,
5744 .ips = ctx->addresses_best,
5745 .apply_expected = false
5749 * group,released vs. mhomed,active with different ip(s)
5752 .line = __location__,
5753 .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL),
5754 .wins = {
5755 .nb_flags = NBT_NM_GROUP,
5756 .mhomed = false,
5757 .num_ips = ctx->addresses_best_num,
5758 .ips = ctx->addresses_best,
5759 .apply_expected = true
5761 .replica= {
5762 .type = WREPL_TYPE_MHOMED,
5763 .state = WREPL_STATE_ACTIVE,
5764 .node = WREPL_NODE_B,
5765 .is_static = false,
5766 .num_ips = ARRAY_SIZE(addresses_B_1),
5767 .ips = addresses_B_1,
5768 .apply_expected = false
5772 * group,released vs. mhomed,tombstone with same ip(s)
5775 .line = __location__,
5776 .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL),
5777 .wins = {
5778 .nb_flags = NBT_NM_GROUP,
5779 .mhomed = false,
5780 .num_ips = ctx->addresses_best_num,
5781 .ips = ctx->addresses_best,
5782 .apply_expected = true
5784 .replica= {
5785 .type = WREPL_TYPE_MHOMED,
5786 .state = WREPL_STATE_TOMBSTONE,
5787 .node = WREPL_NODE_B,
5788 .is_static = false,
5789 .num_ips = ctx->addresses_best_num,
5790 .ips = ctx->addresses_best,
5791 .apply_expected = false
5795 * group,released vs. mhomed,tombstone with different ip(s)
5798 .line = __location__,
5799 .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL),
5800 .wins = {
5801 .nb_flags = NBT_NM_GROUP,
5802 .mhomed = false,
5803 .num_ips = ctx->addresses_best_num,
5804 .ips = ctx->addresses_best,
5805 .apply_expected = true
5807 .replica= {
5808 .type = WREPL_TYPE_MHOMED,
5809 .state = WREPL_STATE_TOMBSTONE,
5810 .node = WREPL_NODE_B,
5811 .is_static = false,
5812 .num_ips = ARRAY_SIZE(addresses_B_1),
5813 .ips = addresses_B_1,
5814 .apply_expected = false
5818 * special group vs. unique section
5821 * sgroup,released vs. unique,active with same ip(s)
5824 .line = __location__,
5825 .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL),
5826 .wins = {
5827 .nb_flags = NBT_NM_GROUP,
5828 .mhomed = false,
5829 .num_ips = ctx->addresses_best_num,
5830 .ips = ctx->addresses_best,
5831 .apply_expected = true
5833 .replica= {
5834 .type = WREPL_TYPE_UNIQUE,
5835 .state = WREPL_STATE_ACTIVE,
5836 .node = WREPL_NODE_B,
5837 .is_static = false,
5838 .num_ips = ctx->addresses_best_num,
5839 .ips = ctx->addresses_best,
5840 .apply_expected = true
5844 * sgroup,released vs. unique,active with different ip(s)
5847 .line = __location__,
5848 .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL),
5849 .wins = {
5850 .nb_flags = NBT_NM_GROUP,
5851 .mhomed = false,
5852 .num_ips = ctx->addresses_best_num,
5853 .ips = ctx->addresses_best,
5854 .apply_expected = true
5856 .replica= {
5857 .type = WREPL_TYPE_UNIQUE,
5858 .state = WREPL_STATE_ACTIVE,
5859 .node = WREPL_NODE_B,
5860 .is_static = false,
5861 .num_ips = ARRAY_SIZE(addresses_B_1),
5862 .ips = addresses_B_1,
5863 .apply_expected = true
5867 * sgroup,released vs. unique,tombstone with same ip(s)
5870 .line = __location__,
5871 .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL),
5872 .wins = {
5873 .nb_flags = NBT_NM_GROUP,
5874 .mhomed = false,
5875 .num_ips = ctx->addresses_best_num,
5876 .ips = ctx->addresses_best,
5877 .apply_expected = true
5879 .replica= {
5880 .type = WREPL_TYPE_UNIQUE,
5881 .state = WREPL_STATE_TOMBSTONE,
5882 .node = WREPL_NODE_B,
5883 .is_static = false,
5884 .num_ips = ctx->addresses_best_num,
5885 .ips = ctx->addresses_best,
5886 .apply_expected = true
5890 * sgroup,released vs. unique,tombstone with different ip(s)
5893 .line = __location__,
5894 .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL),
5895 .wins = {
5896 .nb_flags = NBT_NM_GROUP,
5897 .mhomed = false,
5898 .num_ips = ctx->addresses_best_num,
5899 .ips = ctx->addresses_best,
5900 .apply_expected = true
5902 .replica= {
5903 .type = WREPL_TYPE_UNIQUE,
5904 .state = WREPL_STATE_TOMBSTONE,
5905 .node = WREPL_NODE_B,
5906 .is_static = false,
5907 .num_ips = ARRAY_SIZE(addresses_B_1),
5908 .ips = addresses_B_1,
5909 .apply_expected = true
5913 * special group vs. group section
5916 * sgroup,released vs. group,active with same ip(s)
5919 .line = __location__,
5920 .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL),
5921 .wins = {
5922 .nb_flags = NBT_NM_GROUP,
5923 .mhomed = false,
5924 .num_ips = ctx->addresses_best_num,
5925 .ips = ctx->addresses_best,
5926 .apply_expected = true
5928 .replica= {
5929 .type = WREPL_TYPE_GROUP,
5930 .state = WREPL_STATE_ACTIVE,
5931 .node = WREPL_NODE_B,
5932 .is_static = false,
5933 .num_ips = ctx->addresses_best_num,
5934 .ips = ctx->addresses_best,
5935 .apply_expected = true
5939 * sgroup,released vs. group,active with different ip(s)
5942 .line = __location__,
5943 .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL),
5944 .wins = {
5945 .nb_flags = NBT_NM_GROUP,
5946 .mhomed = false,
5947 .num_ips = ctx->addresses_best_num,
5948 .ips = ctx->addresses_best,
5949 .apply_expected = true
5951 .replica= {
5952 .type = WREPL_TYPE_GROUP,
5953 .state = WREPL_STATE_ACTIVE,
5954 .node = WREPL_NODE_B,
5955 .is_static = false,
5956 .num_ips = ARRAY_SIZE(addresses_B_1),
5957 .ips = addresses_B_1,
5958 .apply_expected = true
5962 * sgroup,released vs. group,tombstone with same ip(s)
5965 .line = __location__,
5966 .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL),
5967 .wins = {
5968 .nb_flags = NBT_NM_GROUP,
5969 .mhomed = false,
5970 .num_ips = ctx->addresses_best_num,
5971 .ips = ctx->addresses_best,
5972 .apply_expected = true
5974 .replica= {
5975 .type = WREPL_TYPE_GROUP,
5976 .state = WREPL_STATE_TOMBSTONE,
5977 .node = WREPL_NODE_B,
5978 .is_static = false,
5979 .num_ips = ctx->addresses_best_num,
5980 .ips = ctx->addresses_best,
5981 .apply_expected = true
5985 * sgroup,released vs. group,tombstone with different ip(s)
5988 .line = __location__,
5989 .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL),
5990 .wins = {
5991 .nb_flags = NBT_NM_GROUP,
5992 .mhomed = false,
5993 .num_ips = ctx->addresses_best_num,
5994 .ips = ctx->addresses_best,
5995 .apply_expected = true
5997 .replica= {
5998 .type = WREPL_TYPE_GROUP,
5999 .state = WREPL_STATE_TOMBSTONE,
6000 .node = WREPL_NODE_B,
6001 .is_static = false,
6002 .num_ips = ARRAY_SIZE(addresses_B_1),
6003 .ips = addresses_B_1,
6004 .apply_expected = true
6008 * special group vs. special group section
6011 * sgroup,released vs. sgroup,active with same ip(s)
6014 .line = __location__,
6015 .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL),
6016 .wins = {
6017 .nb_flags = NBT_NM_GROUP,
6018 .mhomed = false,
6019 .num_ips = ctx->addresses_best_num,
6020 .ips = ctx->addresses_best,
6021 .apply_expected = true
6023 .replica= {
6024 .type = WREPL_TYPE_SGROUP,
6025 .state = WREPL_STATE_ACTIVE,
6026 .node = WREPL_NODE_B,
6027 .is_static = false,
6028 .num_ips = ctx->addresses_best_num,
6029 .ips = ctx->addresses_best,
6030 .apply_expected = true
6034 * sgroup,released vs. sgroup,active with different ip(s)
6037 .line = __location__,
6038 .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL),
6039 .wins = {
6040 .nb_flags = NBT_NM_GROUP,
6041 .mhomed = false,
6042 .num_ips = ctx->addresses_best_num,
6043 .ips = ctx->addresses_best,
6044 .apply_expected = true
6046 .replica= {
6047 .type = WREPL_TYPE_SGROUP,
6048 .state = WREPL_STATE_ACTIVE,
6049 .node = WREPL_NODE_B,
6050 .is_static = false,
6051 .num_ips = ARRAY_SIZE(addresses_B_1),
6052 .ips = addresses_B_1,
6053 .apply_expected = true
6057 * sgroup,released vs. sgroup,tombstone with same ip(s)
6060 .line = __location__,
6061 .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL),
6062 .wins = {
6063 .nb_flags = NBT_NM_GROUP,
6064 .mhomed = false,
6065 .num_ips = ctx->addresses_best_num,
6066 .ips = ctx->addresses_best,
6067 .apply_expected = true
6069 .replica= {
6070 .type = WREPL_TYPE_SGROUP,
6071 .state = WREPL_STATE_TOMBSTONE,
6072 .node = WREPL_NODE_B,
6073 .is_static = false,
6074 .num_ips = ctx->addresses_best_num,
6075 .ips = ctx->addresses_best,
6076 .apply_expected = true
6080 * sgroup,released vs. sgroup,tombstone with different ip(s)
6083 .line = __location__,
6084 .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL),
6085 .wins = {
6086 .nb_flags = NBT_NM_GROUP,
6087 .mhomed = false,
6088 .num_ips = ctx->addresses_best_num,
6089 .ips = ctx->addresses_best,
6090 .apply_expected = true
6092 .replica= {
6093 .type = WREPL_TYPE_SGROUP,
6094 .state = WREPL_STATE_TOMBSTONE,
6095 .node = WREPL_NODE_B,
6096 .is_static = false,
6097 .num_ips = ARRAY_SIZE(addresses_B_1),
6098 .ips = addresses_B_1,
6099 .apply_expected = true
6103 * special group vs. multi homed section
6106 * sgroup,released vs. mhomed,active with same ip(s)
6109 .line = __location__,
6110 .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL),
6111 .wins = {
6112 .nb_flags = NBT_NM_GROUP,
6113 .mhomed = false,
6114 .num_ips = ctx->addresses_best_num,
6115 .ips = ctx->addresses_best,
6116 .apply_expected = true
6118 .replica= {
6119 .type = WREPL_TYPE_MHOMED,
6120 .state = WREPL_STATE_ACTIVE,
6121 .node = WREPL_NODE_B,
6122 .is_static = false,
6123 .num_ips = ctx->addresses_best_num,
6124 .ips = ctx->addresses_best,
6125 .apply_expected = true
6129 * sgroup,released vs. mhomed,active with different ip(s)
6132 .line = __location__,
6133 .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL),
6134 .wins = {
6135 .nb_flags = NBT_NM_GROUP,
6136 .mhomed = false,
6137 .num_ips = ctx->addresses_best_num,
6138 .ips = ctx->addresses_best,
6139 .apply_expected = true
6141 .replica= {
6142 .type = WREPL_TYPE_MHOMED,
6143 .state = WREPL_STATE_ACTIVE,
6144 .node = WREPL_NODE_B,
6145 .is_static = false,
6146 .num_ips = ARRAY_SIZE(addresses_B_1),
6147 .ips = addresses_B_1,
6148 .apply_expected = true
6152 * sgroup,released vs. mhomed,tombstone with same ip(s)
6155 .line = __location__,
6156 .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL),
6157 .wins = {
6158 .nb_flags = NBT_NM_GROUP,
6159 .mhomed = false,
6160 .num_ips = ctx->addresses_best_num,
6161 .ips = ctx->addresses_best,
6162 .apply_expected = true
6164 .replica= {
6165 .type = WREPL_TYPE_MHOMED,
6166 .state = WREPL_STATE_TOMBSTONE,
6167 .node = WREPL_NODE_B,
6168 .is_static = false,
6169 .num_ips = ctx->addresses_best_num,
6170 .ips = ctx->addresses_best,
6171 .apply_expected = true
6175 * sgroup,released vs. mhomed,tombstone with different ip(s)
6178 .line = __location__,
6179 .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL),
6180 .wins = {
6181 .nb_flags = NBT_NM_GROUP,
6182 .mhomed = false,
6183 .num_ips = ctx->addresses_best_num,
6184 .ips = ctx->addresses_best,
6185 .apply_expected = true
6187 .replica= {
6188 .type = WREPL_TYPE_MHOMED,
6189 .state = WREPL_STATE_TOMBSTONE,
6190 .node = WREPL_NODE_B,
6191 .is_static = false,
6192 .num_ips = ARRAY_SIZE(addresses_B_1),
6193 .ips = addresses_B_1,
6194 .apply_expected = true
6198 * multi homed vs. unique section
6201 * mhomed,released vs. unique,active with same ip(s)
6204 .line = __location__,
6205 .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL),
6206 .wins = {
6207 .nb_flags = 0,
6208 .mhomed = true,
6209 .num_ips = ctx->addresses_best_num,
6210 .ips = ctx->addresses_best,
6211 .apply_expected = true
6213 .replica= {
6214 .type = WREPL_TYPE_UNIQUE,
6215 .state = WREPL_STATE_ACTIVE,
6216 .node = WREPL_NODE_B,
6217 .is_static = false,
6218 .num_ips = ctx->addresses_best_num,
6219 .ips = ctx->addresses_best,
6220 .apply_expected = true
6224 * mhomed,released vs. unique,active with different ip(s)
6227 .line = __location__,
6228 .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL),
6229 .wins = {
6230 .nb_flags = 0,
6231 .mhomed = true,
6232 .num_ips = ctx->addresses_best_num,
6233 .ips = ctx->addresses_best,
6234 .apply_expected = true
6236 .replica= {
6237 .type = WREPL_TYPE_UNIQUE,
6238 .state = WREPL_STATE_ACTIVE,
6239 .node = WREPL_NODE_B,
6240 .is_static = false,
6241 .num_ips = ARRAY_SIZE(addresses_B_1),
6242 .ips = addresses_B_1,
6243 .apply_expected = true
6247 * mhomed,released vs. unique,tombstone with same ip(s)
6250 .line = __location__,
6251 .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL),
6252 .wins = {
6253 .nb_flags = 0,
6254 .mhomed = true,
6255 .num_ips = ctx->addresses_best_num,
6256 .ips = ctx->addresses_best,
6257 .apply_expected = true
6259 .replica= {
6260 .type = WREPL_TYPE_UNIQUE,
6261 .state = WREPL_STATE_TOMBSTONE,
6262 .node = WREPL_NODE_B,
6263 .is_static = false,
6264 .num_ips = ctx->addresses_best_num,
6265 .ips = ctx->addresses_best,
6266 .apply_expected = true
6270 * mhomed,released vs. unique,tombstone with different ip(s)
6273 .line = __location__,
6274 .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL),
6275 .wins = {
6276 .nb_flags = 0,
6277 .mhomed = true,
6278 .num_ips = ctx->addresses_best_num,
6279 .ips = ctx->addresses_best,
6280 .apply_expected = true
6282 .replica= {
6283 .type = WREPL_TYPE_UNIQUE,
6284 .state = WREPL_STATE_TOMBSTONE,
6285 .node = WREPL_NODE_B,
6286 .is_static = false,
6287 .num_ips = ARRAY_SIZE(addresses_B_1),
6288 .ips = addresses_B_1,
6289 .apply_expected = true
6293 * multi homed vs. group section
6296 * mhomed,released vs. group,active with same ip(s)
6299 .line = __location__,
6300 .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL),
6301 .wins = {
6302 .nb_flags = 0,
6303 .mhomed = true,
6304 .num_ips = ctx->addresses_best_num,
6305 .ips = ctx->addresses_best,
6306 .apply_expected = true
6308 .replica= {
6309 .type = WREPL_TYPE_GROUP,
6310 .state = WREPL_STATE_ACTIVE,
6311 .node = WREPL_NODE_B,
6312 .is_static = false,
6313 .num_ips = ctx->addresses_best_num,
6314 .ips = ctx->addresses_best,
6315 .apply_expected = true
6319 * mhomed,released vs. group,active with different ip(s)
6322 .line = __location__,
6323 .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL),
6324 .wins = {
6325 .nb_flags = 0,
6326 .mhomed = true,
6327 .num_ips = ctx->addresses_best_num,
6328 .ips = ctx->addresses_best,
6329 .apply_expected = true
6331 .replica= {
6332 .type = WREPL_TYPE_GROUP,
6333 .state = WREPL_STATE_ACTIVE,
6334 .node = WREPL_NODE_B,
6335 .is_static = false,
6336 .num_ips = ARRAY_SIZE(addresses_B_1),
6337 .ips = addresses_B_1,
6338 .apply_expected = true
6342 * mhomed,released vs. group,tombstone with same ip(s)
6345 .line = __location__,
6346 .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL),
6347 .wins = {
6348 .nb_flags = 0,
6349 .mhomed = true,
6350 .num_ips = ctx->addresses_best_num,
6351 .ips = ctx->addresses_best,
6352 .apply_expected = true
6354 .replica= {
6355 .type = WREPL_TYPE_GROUP,
6356 .state = WREPL_STATE_TOMBSTONE,
6357 .node = WREPL_NODE_B,
6358 .is_static = false,
6359 .num_ips = ctx->addresses_best_num,
6360 .ips = ctx->addresses_best,
6361 .apply_expected = true
6365 * mhomed,released vs. group,tombstone with different ip(s)
6368 .line = __location__,
6369 .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL),
6370 .wins = {
6371 .nb_flags = 0,
6372 .mhomed = true,
6373 .num_ips = ctx->addresses_best_num,
6374 .ips = ctx->addresses_best,
6375 .apply_expected = true
6377 .replica= {
6378 .type = WREPL_TYPE_GROUP,
6379 .state = WREPL_STATE_TOMBSTONE,
6380 .node = WREPL_NODE_B,
6381 .is_static = false,
6382 .num_ips = ARRAY_SIZE(addresses_B_1),
6383 .ips = addresses_B_1,
6384 .apply_expected = true
6388 * multi homed vs. special group section
6391 * mhomed,released vs. sgroup,active with same ip(s)
6394 .line = __location__,
6395 .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL),
6396 .wins = {
6397 .nb_flags = 0,
6398 .mhomed = true,
6399 .num_ips = ctx->addresses_best_num,
6400 .ips = ctx->addresses_best,
6401 .apply_expected = true
6403 .replica= {
6404 .type = WREPL_TYPE_SGROUP,
6405 .state = WREPL_STATE_ACTIVE,
6406 .node = WREPL_NODE_B,
6407 .is_static = false,
6408 .num_ips = ctx->addresses_best_num,
6409 .ips = ctx->addresses_best,
6410 .apply_expected = true
6414 * mhomed,released vs. sgroup,active with different ip(s)
6417 .line = __location__,
6418 .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL),
6419 .wins = {
6420 .nb_flags = 0,
6421 .mhomed = true,
6422 .num_ips = ctx->addresses_best_num,
6423 .ips = ctx->addresses_best,
6424 .apply_expected = true
6426 .replica= {
6427 .type = WREPL_TYPE_SGROUP,
6428 .state = WREPL_STATE_ACTIVE,
6429 .node = WREPL_NODE_B,
6430 .is_static = false,
6431 .num_ips = ARRAY_SIZE(addresses_B_1),
6432 .ips = addresses_B_1,
6433 .apply_expected = true
6437 * mhomed,released vs. sgroup,tombstone with same ip(s)
6440 .line = __location__,
6441 .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL),
6442 .wins = {
6443 .nb_flags = 0,
6444 .mhomed = true,
6445 .num_ips = ctx->addresses_best_num,
6446 .ips = ctx->addresses_best,
6447 .apply_expected = true
6449 .replica= {
6450 .type = WREPL_TYPE_SGROUP,
6451 .state = WREPL_STATE_TOMBSTONE,
6452 .node = WREPL_NODE_B,
6453 .is_static = false,
6454 .num_ips = ctx->addresses_best_num,
6455 .ips = ctx->addresses_best,
6456 .apply_expected = true
6460 * mhomed,released vs. sgroup,tombstone with different ip(s)
6463 .line = __location__,
6464 .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL),
6465 .wins = {
6466 .nb_flags = 0,
6467 .mhomed = true,
6468 .num_ips = ctx->addresses_best_num,
6469 .ips = ctx->addresses_best,
6470 .apply_expected = true
6472 .replica= {
6473 .type = WREPL_TYPE_SGROUP,
6474 .state = WREPL_STATE_TOMBSTONE,
6475 .node = WREPL_NODE_B,
6476 .is_static = false,
6477 .num_ips = ARRAY_SIZE(addresses_B_1),
6478 .ips = addresses_B_1,
6479 .apply_expected = true
6483 * multi homed vs. multi homed section
6486 * mhomed,released vs. mhomed,active with same ip(s)
6489 .line = __location__,
6490 .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL),
6491 .wins = {
6492 .nb_flags = 0,
6493 .mhomed = true,
6494 .num_ips = ctx->addresses_best_num,
6495 .ips = ctx->addresses_best,
6496 .apply_expected = true
6498 .replica= {
6499 .type = WREPL_TYPE_MHOMED,
6500 .state = WREPL_STATE_ACTIVE,
6501 .node = WREPL_NODE_B,
6502 .is_static = false,
6503 .num_ips = ctx->addresses_best_num,
6504 .ips = ctx->addresses_best,
6505 .apply_expected = true
6509 * mhomed,released vs. mhomed,active with different ip(s)
6512 .line = __location__,
6513 .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL),
6514 .wins = {
6515 .nb_flags = 0,
6516 .mhomed = true,
6517 .num_ips = ctx->addresses_best_num,
6518 .ips = ctx->addresses_best,
6519 .apply_expected = true
6521 .replica= {
6522 .type = WREPL_TYPE_MHOMED,
6523 .state = WREPL_STATE_ACTIVE,
6524 .node = WREPL_NODE_B,
6525 .is_static = false,
6526 .num_ips = ARRAY_SIZE(addresses_B_1),
6527 .ips = addresses_B_1,
6528 .apply_expected = true
6532 * mhomed,released vs. mhomed,tombstone with same ip(s)
6535 .line = __location__,
6536 .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL),
6537 .wins = {
6538 .nb_flags = 0,
6539 .mhomed = true,
6540 .num_ips = ctx->addresses_best_num,
6541 .ips = ctx->addresses_best,
6542 .apply_expected = true
6544 .replica= {
6545 .type = WREPL_TYPE_MHOMED,
6546 .state = WREPL_STATE_TOMBSTONE,
6547 .node = WREPL_NODE_B,
6548 .is_static = false,
6549 .num_ips = ctx->addresses_best_num,
6550 .ips = ctx->addresses_best,
6551 .apply_expected = true
6555 * mhomed,released vs. mhomed,tombstone with different ip(s)
6558 .line = __location__,
6559 .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL),
6560 .wins = {
6561 .nb_flags = 0,
6562 .mhomed = true,
6563 .num_ips = ctx->addresses_best_num,
6564 .ips = ctx->addresses_best,
6565 .apply_expected = true
6567 .replica= {
6568 .type = WREPL_TYPE_MHOMED,
6569 .state = WREPL_STATE_TOMBSTONE,
6570 .node = WREPL_NODE_B,
6571 .is_static = false,
6572 .num_ips = ARRAY_SIZE(addresses_B_1),
6573 .ips = addresses_B_1,
6574 .apply_expected = true
6579 torture_comment(tctx, "Test Replica records vs. owned released records\n");
6581 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
6582 torture_comment(tctx, "%s => %s\n", nbt_name_string(ctx, &records[i].name),
6583 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
6586 * Setup Register
6588 name_register->in.name = records[i].name;
6589 name_register->in.dest_addr = ctx->address;
6590 name_register->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
6591 name_register->in.address = records[i].wins.ips[0].ip;
6592 name_register->in.nb_flags = records[i].wins.nb_flags;
6593 name_register->in.register_demand= false;
6594 name_register->in.broadcast = false;
6595 name_register->in.multi_homed = records[i].wins.mhomed;
6596 name_register->in.ttl = 300000;
6597 name_register->in.timeout = 70;
6598 name_register->in.retries = 0;
6600 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
6601 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6602 torture_comment(tctx, "No response from %s for name register\n", ctx->address);
6603 ret = false;
6605 if (!NT_STATUS_IS_OK(status)) {
6606 torture_comment(tctx, "Bad response from %s for name register - %s\n",
6607 ctx->address, nt_errstr(status));
6608 ret = false;
6610 CHECK_VALUE(tctx, name_register->out.rcode, 0);
6611 CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address);
6612 CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type);
6613 CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name);
6614 CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope);
6615 CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[0].ip);
6617 /* release the record */
6618 release->in.name = records[i].name;
6619 release->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
6620 release->in.dest_addr = ctx->address;
6621 release->in.address = records[i].wins.ips[0].ip;
6622 release->in.nb_flags = records[i].wins.nb_flags;
6623 release->in.broadcast = false;
6624 release->in.timeout = 30;
6625 release->in.retries = 0;
6627 status = nbt_name_release(ctx->nbtsock, ctx, release);
6628 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6629 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
6630 return false;
6632 if (!NT_STATUS_IS_OK(status)) {
6633 torture_comment(tctx, "Bad response from %s for name query - %s\n",
6634 ctx->address, nt_errstr(status));
6635 return false;
6637 CHECK_VALUE(tctx, release->out.rcode, 0);
6640 * Setup Replica
6642 wins_name->name = &records[i].name;
6643 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
6644 records[i].replica.state,
6645 records[i].replica.node,
6646 records[i].replica.is_static);
6647 wins_name->id = ++ctx->b.max_version;
6648 if (wins_name->flags & 2) {
6649 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
6650 wins_name->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
6651 records[i].replica.ips);
6652 } else {
6653 wins_name->addresses.ip = records[i].replica.ips[0].ip;
6655 wins_name->unknown = "255.255.255.255";
6657 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
6658 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name,
6659 records[i].replica.apply_expected);
6661 if (records[i].replica.apply_expected) {
6662 wins_name->name = &records[i].name;
6663 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
6664 WREPL_STATE_TOMBSTONE,
6665 WREPL_NODE_B, false);
6666 wins_name->id = ++ctx->b.max_version;
6667 wins_name->addresses.ip = addresses_B_1[0].ip;
6668 wins_name->unknown = "255.255.255.255";
6670 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
6671 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
6672 } else {
6673 release->in.name = records[i].name;
6674 release->in.dest_addr = ctx->address;
6675 release->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
6676 release->in.address = records[i].wins.ips[0].ip;
6677 release->in.nb_flags = records[i].wins.nb_flags;
6678 release->in.broadcast = false;
6679 release->in.timeout = 30;
6680 release->in.retries = 0;
6682 status = nbt_name_release(ctx->nbtsock, ctx, release);
6683 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6684 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
6685 return false;
6687 if (!NT_STATUS_IS_OK(status)) {
6688 torture_comment(tctx, "Bad response from %s for name query - %s\n",
6689 ctx->address, nt_errstr(status));
6690 return false;
6692 CHECK_VALUE(tctx, release->out.rcode, 0);
6694 if (!ret) {
6695 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
6696 return ret;
6700 return ret;
6703 struct test_conflict_owned_active_vs_replica_struct {
6704 struct torture_context *tctx;
6705 const char *line; /* just better debugging */
6706 const char *section; /* just better debugging */
6707 struct nbt_name name;
6708 const char *comment;
6709 bool skip;
6710 struct {
6711 uint32_t nb_flags;
6712 bool mhomed;
6713 uint32_t num_ips;
6714 const struct wrepl_ip *ips;
6715 bool apply_expected;
6716 } wins;
6717 struct {
6718 uint32_t timeout;
6719 bool positive;
6720 bool expect_release;
6721 bool late_release;
6722 bool ret;
6723 /* when num_ips == 0, then .wins.ips are used */
6724 uint32_t num_ips;
6725 const struct wrepl_ip *ips;
6726 } defend;
6727 struct {
6728 enum wrepl_name_type type;
6729 enum wrepl_name_state state;
6730 enum wrepl_name_node node;
6731 bool is_static;
6732 uint32_t num_ips;
6733 const struct wrepl_ip *ips;
6734 bool apply_expected;
6735 bool mhomed_merge;
6736 bool sgroup_merge;
6737 } replica;
6740 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
6741 struct nbt_name_packet *req_packet,
6742 struct socket_address *src);
6744 static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx,
6745 struct test_wrepl_conflict_conn *ctx)
6747 bool ret = true;
6748 NTSTATUS status;
6749 struct wrepl_wins_name wins_name_;
6750 struct wrepl_wins_name *wins_name = &wins_name_;
6751 struct nbt_name_register name_register_;
6752 struct nbt_name_register *name_register = &name_register_;
6753 struct nbt_name_release release_;
6754 struct nbt_name_release *release = &release_;
6755 uint32_t i;
6756 struct test_conflict_owned_active_vs_replica_struct records[] = {
6758 * unique vs. unique section
6761 * unique,active vs. unique,active with same ip(s), unchecked
6764 .tctx = tctx,
6765 .line = __location__,
6766 .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL),
6767 .wins = {
6768 .nb_flags = 0,
6769 .mhomed = false,
6770 .num_ips = ctx->addresses_best_num,
6771 .ips = ctx->addresses_best,
6772 .apply_expected = true
6774 .defend = {
6775 .timeout = 0,
6777 .replica= {
6778 .type = WREPL_TYPE_UNIQUE,
6779 .state = WREPL_STATE_ACTIVE,
6780 .node = WREPL_NODE_B,
6781 .is_static = false,
6782 .num_ips = ctx->addresses_best_num,
6783 .ips = ctx->addresses_best,
6784 .apply_expected = true
6788 * unique,active vs. unique,active with different ip(s), positive response
6791 .tctx = tctx,
6792 .line = __location__,
6793 .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL),
6794 .wins = {
6795 .nb_flags = 0,
6796 .mhomed = false,
6797 .num_ips = ctx->addresses_best_num,
6798 .ips = ctx->addresses_best,
6799 .apply_expected = true
6801 .defend = {
6802 .timeout = 10,
6803 .positive = true,
6805 .replica= {
6806 .type = WREPL_TYPE_UNIQUE,
6807 .state = WREPL_STATE_ACTIVE,
6808 .node = WREPL_NODE_B,
6809 .is_static = false,
6810 .num_ips = ARRAY_SIZE(addresses_B_1),
6811 .ips = addresses_B_1,
6812 .apply_expected = false
6816 * unique,active vs. unique,active with different ip(s), positive response other ips
6819 .tctx = tctx,
6820 .line = __location__,
6821 .name = _NBT_NAME("_UA_UA_DI_O", 0x00, NULL),
6822 .wins = {
6823 .nb_flags = 0,
6824 .mhomed = false,
6825 .num_ips = ctx->addresses_best_num,
6826 .ips = ctx->addresses_best,
6827 .apply_expected = true
6829 .defend = {
6830 .timeout = 10,
6831 .positive = true,
6832 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6833 .ips = addresses_A_3_4,
6835 .replica= {
6836 .type = WREPL_TYPE_UNIQUE,
6837 .state = WREPL_STATE_ACTIVE,
6838 .node = WREPL_NODE_B,
6839 .is_static = false,
6840 .num_ips = ARRAY_SIZE(addresses_B_1),
6841 .ips = addresses_B_1,
6842 .apply_expected = false
6846 * unique,active vs. unique,active with different ip(s), negative response
6849 .tctx = tctx,
6850 .line = __location__,
6851 .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL),
6852 .wins = {
6853 .nb_flags = 0,
6854 .mhomed = false,
6855 .num_ips = ctx->addresses_best_num,
6856 .ips = ctx->addresses_best,
6857 .apply_expected = true
6859 .defend = {
6860 .timeout = 10,
6861 .positive = false,
6863 .replica= {
6864 .type = WREPL_TYPE_UNIQUE,
6865 .state = WREPL_STATE_ACTIVE,
6866 .node = WREPL_NODE_B,
6867 .is_static = false,
6868 .num_ips = ARRAY_SIZE(addresses_B_1),
6869 .ips = addresses_B_1,
6870 .apply_expected = true
6874 * unique,active vs. unique,tombstone with same ip(s), unchecked
6877 .tctx = tctx,
6878 .line = __location__,
6879 .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL),
6880 .wins = {
6881 .nb_flags = 0,
6882 .mhomed = false,
6883 .num_ips = ctx->addresses_best_num,
6884 .ips = ctx->addresses_best,
6885 .apply_expected = true
6887 .defend = {
6888 .timeout = 0,
6890 .replica= {
6891 .type = WREPL_TYPE_UNIQUE,
6892 .state = WREPL_STATE_TOMBSTONE,
6893 .node = WREPL_NODE_B,
6894 .is_static = false,
6895 .num_ips = ctx->addresses_best_num,
6896 .ips = ctx->addresses_best,
6897 .apply_expected = false
6901 * unique,active vs. unique,tombstone with different ip(s), unchecked
6904 .tctx = tctx,
6905 .line = __location__,
6906 .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL),
6907 .wins = {
6908 .nb_flags = 0,
6909 .mhomed = false,
6910 .num_ips = ctx->addresses_best_num,
6911 .ips = ctx->addresses_best,
6912 .apply_expected = true
6914 .defend = {
6915 .timeout = 0,
6917 .replica= {
6918 .type = WREPL_TYPE_UNIQUE,
6919 .state = WREPL_STATE_TOMBSTONE,
6920 .node = WREPL_NODE_B,
6921 .is_static = false,
6922 .num_ips = ARRAY_SIZE(addresses_B_1),
6923 .ips = addresses_B_1,
6924 .apply_expected = false
6928 * unique vs. group section
6931 * unique,active vs. group,active with same ip(s), release expected
6934 .tctx = tctx,
6935 .line = __location__,
6936 .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL),
6937 .wins = {
6938 .nb_flags = 0,
6939 .mhomed = false,
6940 .num_ips = ctx->addresses_best_num,
6941 .ips = ctx->addresses_best,
6942 .apply_expected = true
6944 .defend = {
6945 .timeout = 10,
6946 .expect_release = true,
6948 .replica= {
6949 .type = WREPL_TYPE_GROUP,
6950 .state = WREPL_STATE_ACTIVE,
6951 .node = WREPL_NODE_B,
6952 .is_static = false,
6953 .num_ips = ctx->addresses_best_num,
6954 .ips = ctx->addresses_best,
6955 .apply_expected = true
6959 * unique,active vs. group,active with different ip(s), release expected
6962 .tctx = tctx,
6963 .line = __location__,
6964 .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL),
6965 .wins = {
6966 .nb_flags = 0,
6967 .mhomed = false,
6968 .num_ips = ctx->addresses_best_num,
6969 .ips = ctx->addresses_best,
6970 .apply_expected = true
6972 .defend = {
6973 .timeout = 10,
6974 .expect_release = true,
6976 .replica= {
6977 .type = WREPL_TYPE_GROUP,
6978 .state = WREPL_STATE_ACTIVE,
6979 .node = WREPL_NODE_B,
6980 .is_static = false,
6981 .num_ips = ARRAY_SIZE(addresses_B_1),
6982 .ips = addresses_B_1,
6983 .apply_expected = true
6987 * unique,active vs. group,tombstone with same ip(s), unchecked
6990 .tctx = tctx,
6991 .line = __location__,
6992 .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL),
6993 .wins = {
6994 .nb_flags = 0,
6995 .mhomed = false,
6996 .num_ips = ctx->addresses_best_num,
6997 .ips = ctx->addresses_best,
6998 .apply_expected = true
7000 .defend = {
7001 .timeout = 0,
7003 .replica= {
7004 .type = WREPL_TYPE_GROUP,
7005 .state = WREPL_STATE_TOMBSTONE,
7006 .node = WREPL_NODE_B,
7007 .is_static = false,
7008 .num_ips = ctx->addresses_best_num,
7009 .ips = ctx->addresses_best,
7010 .apply_expected = false
7014 * unique,active vs. group,tombstone with different ip(s), unchecked
7017 .tctx = tctx,
7018 .line = __location__,
7019 .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL),
7020 .wins = {
7021 .nb_flags = 0,
7022 .mhomed = false,
7023 .num_ips = ctx->addresses_best_num,
7024 .ips = ctx->addresses_best,
7025 .apply_expected = true
7027 .defend = {
7028 .timeout = 0,
7030 .replica= {
7031 .type = WREPL_TYPE_GROUP,
7032 .state = WREPL_STATE_TOMBSTONE,
7033 .node = WREPL_NODE_B,
7034 .is_static = false,
7035 .num_ips = ARRAY_SIZE(addresses_B_1),
7036 .ips = addresses_B_1,
7037 .apply_expected = false
7041 * unique vs. special group section
7044 * unique,active vs. sgroup,active with same ip(s), release expected
7047 .tctx = tctx,
7048 .line = __location__,
7049 .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL),
7050 .wins = {
7051 .nb_flags = 0,
7052 .mhomed = false,
7053 .num_ips = ctx->addresses_best_num,
7054 .ips = ctx->addresses_best,
7055 .apply_expected = true
7057 .defend = {
7058 .timeout = 10,
7059 .expect_release = true,
7061 .replica= {
7062 .type = WREPL_TYPE_SGROUP,
7063 .state = WREPL_STATE_ACTIVE,
7064 .node = WREPL_NODE_B,
7065 .is_static = false,
7066 .num_ips = ctx->addresses_best_num,
7067 .ips = ctx->addresses_best,
7068 .apply_expected = true
7072 * unique,active vs. group,active with different ip(s), release expected
7075 .tctx = tctx,
7076 .line = __location__,
7077 .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL),
7078 .wins = {
7079 .nb_flags = 0,
7080 .mhomed = false,
7081 .num_ips = ctx->addresses_best_num,
7082 .ips = ctx->addresses_best,
7083 .apply_expected = true
7085 .defend = {
7086 .timeout = 10,
7087 .expect_release = true,
7089 .replica= {
7090 .type = WREPL_TYPE_SGROUP,
7091 .state = WREPL_STATE_ACTIVE,
7092 .node = WREPL_NODE_B,
7093 .is_static = false,
7094 .num_ips = ARRAY_SIZE(addresses_B_1),
7095 .ips = addresses_B_1,
7096 .apply_expected = true
7100 * unique,active vs. sgroup,tombstone with same ip(s), unchecked
7103 .tctx = tctx,
7104 .line = __location__,
7105 .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL),
7106 .wins = {
7107 .nb_flags = 0,
7108 .mhomed = false,
7109 .num_ips = ctx->addresses_best_num,
7110 .ips = ctx->addresses_best,
7111 .apply_expected = true
7113 .defend = {
7114 .timeout = 0,
7116 .replica= {
7117 .type = WREPL_TYPE_SGROUP,
7118 .state = WREPL_STATE_TOMBSTONE,
7119 .node = WREPL_NODE_B,
7120 .is_static = false,
7121 .num_ips = ctx->addresses_best_num,
7122 .ips = ctx->addresses_best,
7123 .apply_expected = false
7127 * unique,active vs. sgroup,tombstone with different ip(s), unchecked
7130 .tctx = tctx,
7131 .line = __location__,
7132 .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL),
7133 .wins = {
7134 .nb_flags = 0,
7135 .mhomed = false,
7136 .num_ips = ctx->addresses_best_num,
7137 .ips = ctx->addresses_best,
7138 .apply_expected = true
7140 .defend = {
7141 .timeout = 0,
7143 .replica= {
7144 .type = WREPL_TYPE_SGROUP,
7145 .state = WREPL_STATE_TOMBSTONE,
7146 .node = WREPL_NODE_B,
7147 .is_static = false,
7148 .num_ips = ARRAY_SIZE(addresses_B_1),
7149 .ips = addresses_B_1,
7150 .apply_expected = false
7154 * unique vs. multi homed section
7157 * unique,active vs. mhomed,active with same ip(s), unchecked
7160 .tctx = tctx,
7161 .line = __location__,
7162 .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL),
7163 .wins = {
7164 .nb_flags = 0,
7165 .mhomed = false,
7166 .num_ips = ctx->addresses_best_num,
7167 .ips = ctx->addresses_best,
7168 .apply_expected = true
7170 .defend = {
7171 .timeout = 0,
7173 .replica= {
7174 .type = WREPL_TYPE_MHOMED,
7175 .state = WREPL_STATE_ACTIVE,
7176 .node = WREPL_NODE_B,
7177 .is_static = false,
7178 .num_ips = ctx->addresses_best_num,
7179 .ips = ctx->addresses_best,
7180 .apply_expected = true
7184 * unique,active vs. mhomed,active with superset ip(s), unchecked
7187 .tctx = tctx,
7188 .line = __location__,
7189 .name = _NBT_NAME("_UA_MA_SP_U", 0x00, NULL),
7190 .wins = {
7191 .nb_flags = 0,
7192 .mhomed = false,
7193 .num_ips = ctx->addresses_best_num,
7194 .ips = ctx->addresses_best,
7195 .apply_expected = true
7197 .defend = {
7198 .timeout = 0,
7200 .replica= {
7201 .type = WREPL_TYPE_MHOMED,
7202 .state = WREPL_STATE_ACTIVE,
7203 .node = WREPL_NODE_B,
7204 .is_static = false,
7205 .num_ips = ctx->addresses_all_num,
7206 .ips = ctx->addresses_all,
7207 .apply_expected = true
7211 * unique,active vs. mhomed,active with different ip(s), positive response
7214 .tctx = tctx,
7215 .line = __location__,
7216 .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL),
7217 .wins = {
7218 .nb_flags = 0,
7219 .mhomed = false,
7220 .num_ips = ctx->addresses_best_num,
7221 .ips = ctx->addresses_best,
7222 .apply_expected = true
7224 .defend = {
7225 .timeout = 10,
7226 .positive = true,
7228 .replica= {
7229 .type = WREPL_TYPE_MHOMED,
7230 .state = WREPL_STATE_ACTIVE,
7231 .node = WREPL_NODE_B,
7232 .is_static = false,
7233 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7234 .ips = addresses_B_3_4,
7235 .apply_expected = false
7239 * unique,active vs. mhomed,active with different ip(s), positive response other ips
7242 .tctx = tctx,
7243 .line = __location__,
7244 .name = _NBT_NAME("_UA_MA_DI_O", 0x00, NULL),
7245 .wins = {
7246 .nb_flags = 0,
7247 .mhomed = false,
7248 .num_ips = ctx->addresses_best_num,
7249 .ips = ctx->addresses_best,
7250 .apply_expected = true
7252 .defend = {
7253 .timeout = 10,
7254 .positive = true,
7255 .num_ips = ARRAY_SIZE(addresses_A_3_4),
7256 .ips = addresses_A_3_4,
7258 .replica= {
7259 .type = WREPL_TYPE_MHOMED,
7260 .state = WREPL_STATE_ACTIVE,
7261 .node = WREPL_NODE_B,
7262 .is_static = false,
7263 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7264 .ips = addresses_B_3_4,
7265 .apply_expected = false
7269 * unique,active vs. mhomed,active with different ip(s), negative response
7272 .tctx = tctx,
7273 .line = __location__,
7274 .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL),
7275 .wins = {
7276 .nb_flags = 0,
7277 .mhomed = false,
7278 .num_ips = ctx->addresses_best_num,
7279 .ips = ctx->addresses_best,
7280 .apply_expected = true
7282 .defend = {
7283 .timeout = 10,
7284 .positive = false,
7286 .replica= {
7287 .type = WREPL_TYPE_MHOMED,
7288 .state = WREPL_STATE_ACTIVE,
7289 .node = WREPL_NODE_B,
7290 .is_static = false,
7291 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7292 .ips = addresses_B_3_4,
7293 .apply_expected = true
7297 * unique,active vs. mhomed,tombstone with same ip(s), unchecked
7300 .tctx = tctx,
7301 .line = __location__,
7302 .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL),
7303 .wins = {
7304 .nb_flags = 0,
7305 .mhomed = false,
7306 .num_ips = ctx->addresses_best_num,
7307 .ips = ctx->addresses_best,
7308 .apply_expected = true
7310 .defend = {
7311 .timeout = 0,
7313 .replica= {
7314 .type = WREPL_TYPE_MHOMED,
7315 .state = WREPL_STATE_TOMBSTONE,
7316 .node = WREPL_NODE_B,
7317 .is_static = false,
7318 .num_ips = ctx->addresses_best_num,
7319 .ips = ctx->addresses_best,
7320 .apply_expected = false
7324 * unique,active vs. mhomed,tombstone with different ip(s), unchecked
7327 .tctx = tctx,
7328 .line = __location__,
7329 .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL),
7330 .wins = {
7331 .nb_flags = 0,
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_MHOMED,
7342 .state = WREPL_STATE_TOMBSTONE,
7343 .node = WREPL_NODE_B,
7344 .is_static = false,
7345 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7346 .ips = addresses_B_3_4,
7347 .apply_expected = false
7351 * normal group vs. unique section
7354 * group,active vs. unique,active with same ip(s), unchecked
7357 .tctx = tctx,
7358 .line = __location__,
7359 .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL),
7360 .wins = {
7361 .nb_flags = NBT_NM_GROUP,
7362 .mhomed = false,
7363 .num_ips = ctx->addresses_best_num,
7364 .ips = ctx->addresses_best,
7365 .apply_expected = true
7367 .defend = {
7368 .timeout = 0,
7370 .replica= {
7371 .type = WREPL_TYPE_UNIQUE,
7372 .state = WREPL_STATE_ACTIVE,
7373 .node = WREPL_NODE_B,
7374 .is_static = false,
7375 .num_ips = ctx->addresses_best_num,
7376 .ips = ctx->addresses_best,
7377 .apply_expected = false
7381 * group,active vs. unique,active with different ip(s), unchecked
7384 .tctx = tctx,
7385 .line = __location__,
7386 .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL),
7387 .wins = {
7388 .nb_flags = NBT_NM_GROUP,
7389 .mhomed = false,
7390 .num_ips = ctx->addresses_best_num,
7391 .ips = ctx->addresses_best,
7392 .apply_expected = true
7394 .defend = {
7395 .timeout = 0,
7397 .replica= {
7398 .type = WREPL_TYPE_UNIQUE,
7399 .state = WREPL_STATE_ACTIVE,
7400 .node = WREPL_NODE_B,
7401 .is_static = false,
7402 .num_ips = ARRAY_SIZE(addresses_B_1),
7403 .ips = addresses_B_1,
7404 .apply_expected = false
7408 * group,active vs. unique,tombstone with same ip(s), unchecked
7411 .tctx = tctx,
7412 .line = __location__,
7413 .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL),
7414 .wins = {
7415 .nb_flags = NBT_NM_GROUP,
7416 .mhomed = false,
7417 .num_ips = ctx->addresses_best_num,
7418 .ips = ctx->addresses_best,
7419 .apply_expected = true
7421 .defend = {
7422 .timeout = 0,
7424 .replica= {
7425 .type = WREPL_TYPE_UNIQUE,
7426 .state = WREPL_STATE_TOMBSTONE,
7427 .node = WREPL_NODE_B,
7428 .is_static = false,
7429 .num_ips = ctx->addresses_best_num,
7430 .ips = ctx->addresses_best,
7431 .apply_expected = false
7435 * group,active vs. unique,tombstone with different ip(s), unchecked
7438 .tctx = tctx,
7439 .line = __location__,
7440 .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL),
7441 .wins = {
7442 .nb_flags = NBT_NM_GROUP,
7443 .mhomed = false,
7444 .num_ips = ctx->addresses_best_num,
7445 .ips = ctx->addresses_best,
7446 .apply_expected = true
7448 .defend = {
7449 .timeout = 0,
7451 .replica= {
7452 .type = WREPL_TYPE_UNIQUE,
7453 .state = WREPL_STATE_TOMBSTONE,
7454 .node = WREPL_NODE_B,
7455 .is_static = false,
7456 .num_ips = ARRAY_SIZE(addresses_B_1),
7457 .ips = addresses_B_1,
7458 .apply_expected = false
7462 * normal group vs. normal group section
7465 * group,active vs. group,active with same ip(s), unchecked
7468 .tctx = tctx,
7469 .line = __location__,
7470 .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL),
7471 .wins = {
7472 .nb_flags = NBT_NM_GROUP,
7473 .mhomed = false,
7474 .num_ips = ctx->addresses_best_num,
7475 .ips = ctx->addresses_best,
7476 .apply_expected = true
7478 .defend = {
7479 .timeout = 0,
7481 .replica= {
7482 .type = WREPL_TYPE_GROUP,
7483 .state = WREPL_STATE_ACTIVE,
7484 .node = WREPL_NODE_B,
7485 .is_static = false,
7486 .num_ips = ctx->addresses_best_num,
7487 .ips = ctx->addresses_best,
7488 .apply_expected = true
7492 * group,active vs. group,active with different ip(s), unchecked
7495 .tctx = tctx,
7496 .line = __location__,
7497 .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL),
7498 .wins = {
7499 .nb_flags = NBT_NM_GROUP,
7500 .mhomed = false,
7501 .num_ips = ctx->addresses_best_num,
7502 .ips = ctx->addresses_best,
7503 .apply_expected = true
7505 .defend = {
7506 .timeout = 0,
7508 .replica= {
7509 .type = WREPL_TYPE_GROUP,
7510 .state = WREPL_STATE_ACTIVE,
7511 .node = WREPL_NODE_B,
7512 .is_static = false,
7513 .num_ips = ARRAY_SIZE(addresses_B_1),
7514 .ips = addresses_B_1,
7515 .apply_expected = true
7519 * group,active vs. group,tombstone with same ip(s), unchecked
7522 .tctx = tctx,
7523 .line = __location__,
7524 .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL),
7525 .wins = {
7526 .nb_flags = NBT_NM_GROUP,
7527 .mhomed = false,
7528 .num_ips = ctx->addresses_best_num,
7529 .ips = ctx->addresses_best,
7530 .apply_expected = true
7532 .defend = {
7533 .timeout = 0,
7535 .replica= {
7536 .type = WREPL_TYPE_GROUP,
7537 .state = WREPL_STATE_TOMBSTONE,
7538 .node = WREPL_NODE_B,
7539 .is_static = false,
7540 .num_ips = ctx->addresses_best_num,
7541 .ips = ctx->addresses_best,
7542 .apply_expected = false
7546 * group,active vs. group,tombstone with different ip(s), unchecked
7549 .tctx = tctx,
7550 .line = __location__,
7551 .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL),
7552 .wins = {
7553 .nb_flags = NBT_NM_GROUP,
7554 .mhomed = false,
7555 .num_ips = ctx->addresses_best_num,
7556 .ips = ctx->addresses_best,
7557 .apply_expected = true
7559 .defend = {
7560 .timeout = 0,
7562 .replica= {
7563 .type = WREPL_TYPE_GROUP,
7564 .state = WREPL_STATE_TOMBSTONE,
7565 .node = WREPL_NODE_B,
7566 .is_static = false,
7567 .num_ips = ARRAY_SIZE(addresses_B_1),
7568 .ips = addresses_B_1,
7569 .apply_expected = false
7573 * normal group vs. special group section
7576 * group,active vs. sgroup,active with same ip(s), unchecked
7579 .tctx = tctx,
7580 .line = __location__,
7581 .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL),
7582 .wins = {
7583 .nb_flags = NBT_NM_GROUP,
7584 .mhomed = false,
7585 .num_ips = ctx->addresses_best_num,
7586 .ips = ctx->addresses_best,
7587 .apply_expected = true
7589 .defend = {
7590 .timeout = 0,
7592 .replica= {
7593 .type = WREPL_TYPE_SGROUP,
7594 .state = WREPL_STATE_ACTIVE,
7595 .node = WREPL_NODE_B,
7596 .is_static = false,
7597 .num_ips = ctx->addresses_best_num,
7598 .ips = ctx->addresses_best,
7599 .apply_expected = false
7603 * group,active vs. sgroup,active with different ip(s), unchecked
7606 .tctx = tctx,
7607 .line = __location__,
7608 .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL),
7609 .wins = {
7610 .nb_flags = NBT_NM_GROUP,
7611 .mhomed = false,
7612 .num_ips = ctx->addresses_best_num,
7613 .ips = ctx->addresses_best,
7614 .apply_expected = true
7616 .defend = {
7617 .timeout = 0,
7619 .replica= {
7620 .type = WREPL_TYPE_SGROUP,
7621 .state = WREPL_STATE_ACTIVE,
7622 .node = WREPL_NODE_B,
7623 .is_static = false,
7624 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7625 .ips = addresses_B_3_4,
7626 .apply_expected = false
7630 * group,active vs. sgroup,tombstone with same ip(s), unchecked
7633 .tctx = tctx,
7634 .line = __location__,
7635 .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL),
7636 .wins = {
7637 .nb_flags = NBT_NM_GROUP,
7638 .mhomed = false,
7639 .num_ips = ctx->addresses_best_num,
7640 .ips = ctx->addresses_best,
7641 .apply_expected = true
7643 .defend = {
7644 .timeout = 0,
7646 .replica= {
7647 .type = WREPL_TYPE_SGROUP,
7648 .state = WREPL_STATE_TOMBSTONE,
7649 .node = WREPL_NODE_B,
7650 .is_static = false,
7651 .num_ips = ctx->addresses_best_num,
7652 .ips = ctx->addresses_best,
7653 .apply_expected = false
7657 * group,active vs. sgroup,tombstone with different ip(s), unchecked
7660 .tctx = tctx,
7661 .line = __location__,
7662 .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL),
7663 .wins = {
7664 .nb_flags = NBT_NM_GROUP,
7665 .mhomed = false,
7666 .num_ips = ctx->addresses_best_num,
7667 .ips = ctx->addresses_best,
7668 .apply_expected = true
7670 .defend = {
7671 .timeout = 0,
7673 .replica= {
7674 .type = WREPL_TYPE_SGROUP,
7675 .state = WREPL_STATE_TOMBSTONE,
7676 .node = WREPL_NODE_B,
7677 .is_static = false,
7678 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7679 .ips = addresses_B_3_4,
7680 .apply_expected = false
7684 * normal group vs. multi homed section
7687 * group,active vs. mhomed,active with same ip(s), unchecked
7690 .tctx = tctx,
7691 .line = __location__,
7692 .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL),
7693 .wins = {
7694 .nb_flags = NBT_NM_GROUP,
7695 .mhomed = false,
7696 .num_ips = ctx->addresses_best_num,
7697 .ips = ctx->addresses_best,
7698 .apply_expected = true
7700 .defend = {
7701 .timeout = 0,
7703 .replica= {
7704 .type = WREPL_TYPE_MHOMED,
7705 .state = WREPL_STATE_ACTIVE,
7706 .node = WREPL_NODE_B,
7707 .is_static = false,
7708 .num_ips = ctx->addresses_best_num,
7709 .ips = ctx->addresses_best,
7710 .apply_expected = false
7714 * group,active vs. mhomed,active with different ip(s), unchecked
7717 .tctx = tctx,
7718 .line = __location__,
7719 .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL),
7720 .wins = {
7721 .nb_flags = NBT_NM_GROUP,
7722 .mhomed = false,
7723 .num_ips = ctx->addresses_best_num,
7724 .ips = ctx->addresses_best,
7725 .apply_expected = true
7727 .defend = {
7728 .timeout = 0,
7730 .replica= {
7731 .type = WREPL_TYPE_MHOMED,
7732 .state = WREPL_STATE_ACTIVE,
7733 .node = WREPL_NODE_B,
7734 .is_static = false,
7735 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7736 .ips = addresses_B_3_4,
7737 .apply_expected = false
7741 * group,active vs. mhomed,tombstone with same ip(s), unchecked
7744 .tctx = tctx,
7745 .line = __location__,
7746 .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL),
7747 .wins = {
7748 .nb_flags = NBT_NM_GROUP,
7749 .mhomed = false,
7750 .num_ips = ctx->addresses_best_num,
7751 .ips = ctx->addresses_best,
7752 .apply_expected = true
7754 .defend = {
7755 .timeout = 0,
7757 .replica= {
7758 .type = WREPL_TYPE_MHOMED,
7759 .state = WREPL_STATE_TOMBSTONE,
7760 .node = WREPL_NODE_B,
7761 .is_static = false,
7762 .num_ips = ctx->addresses_best_num,
7763 .ips = ctx->addresses_best,
7764 .apply_expected = false
7768 * group,active vs. mhomed,tombstone with different ip(s), unchecked
7771 .tctx = tctx,
7772 .line = __location__,
7773 .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL),
7774 .wins = {
7775 .nb_flags = NBT_NM_GROUP,
7776 .mhomed = false,
7777 .num_ips = ctx->addresses_best_num,
7778 .ips = ctx->addresses_best,
7779 .apply_expected = true
7781 .defend = {
7782 .timeout = 0,
7784 .replica= {
7785 .type = WREPL_TYPE_MHOMED,
7786 .state = WREPL_STATE_TOMBSTONE,
7787 .node = WREPL_NODE_B,
7788 .is_static = false,
7789 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7790 .ips = addresses_B_3_4,
7791 .apply_expected = false
7795 * special group vs. unique section
7798 * sgroup,active vs. unique,active with same ip(s), unchecked
7801 .tctx = tctx,
7802 .line = __location__,
7803 .name = _NBT_NAME("_SA_UA_SI_U", 0x1C, NULL),
7804 .wins = {
7805 .nb_flags = NBT_NM_GROUP,
7806 .mhomed = false,
7807 .num_ips = ctx->addresses_best_num,
7808 .ips = ctx->addresses_best,
7809 .apply_expected = true
7811 .defend = {
7812 .timeout = 0,
7814 .replica= {
7815 .type = WREPL_TYPE_UNIQUE,
7816 .state = WREPL_STATE_ACTIVE,
7817 .node = WREPL_NODE_B,
7818 .is_static = false,
7819 .num_ips = ctx->addresses_best_num,
7820 .ips = ctx->addresses_best,
7821 .apply_expected = false
7825 * sgroup,active vs. unique,active with different ip(s), unchecked
7828 .tctx = tctx,
7829 .line = __location__,
7830 .name = _NBT_NAME("_SA_UA_DI_U", 0x1C, NULL),
7831 .wins = {
7832 .nb_flags = NBT_NM_GROUP,
7833 .mhomed = false,
7834 .num_ips = ctx->addresses_best_num,
7835 .ips = ctx->addresses_best,
7836 .apply_expected = true
7838 .defend = {
7839 .timeout = 0,
7841 .replica= {
7842 .type = WREPL_TYPE_UNIQUE,
7843 .state = WREPL_STATE_ACTIVE,
7844 .node = WREPL_NODE_B,
7845 .is_static = false,
7846 .num_ips = ARRAY_SIZE(addresses_B_1),
7847 .ips = addresses_B_1,
7848 .apply_expected = false
7852 * sgroup,active vs. unique,tombstone with same ip(s), unchecked
7855 .tctx = tctx,
7856 .line = __location__,
7857 .name = _NBT_NAME("_SA_UT_SI_U", 0x1C, NULL),
7858 .wins = {
7859 .nb_flags = NBT_NM_GROUP,
7860 .mhomed = false,
7861 .num_ips = ctx->addresses_best_num,
7862 .ips = ctx->addresses_best,
7863 .apply_expected = true
7865 .defend = {
7866 .timeout = 0,
7868 .replica= {
7869 .type = WREPL_TYPE_UNIQUE,
7870 .state = WREPL_STATE_TOMBSTONE,
7871 .node = WREPL_NODE_B,
7872 .is_static = false,
7873 .num_ips = ctx->addresses_best_num,
7874 .ips = ctx->addresses_best,
7875 .apply_expected = false
7879 * sgroup,active vs. unique,tombstone with different ip(s), unchecked
7882 .tctx = tctx,
7883 .line = __location__,
7884 .name = _NBT_NAME("_SA_UT_DI_U", 0x1C, NULL),
7885 .wins = {
7886 .nb_flags = NBT_NM_GROUP,
7887 .mhomed = false,
7888 .num_ips = ctx->addresses_best_num,
7889 .ips = ctx->addresses_best,
7890 .apply_expected = true
7892 .defend = {
7893 .timeout = 0,
7895 .replica= {
7896 .type = WREPL_TYPE_UNIQUE,
7897 .state = WREPL_STATE_TOMBSTONE,
7898 .node = WREPL_NODE_B,
7899 .is_static = false,
7900 .num_ips = ARRAY_SIZE(addresses_B_1),
7901 .ips = addresses_B_1,
7902 .apply_expected = false
7906 * special group vs. normal group section
7909 * sgroup,active vs. group,active with same ip(s), unchecked
7912 .tctx = tctx,
7913 .line = __location__,
7914 .name = _NBT_NAME("_SA_GA_SI_U", 0x1C, NULL),
7915 .wins = {
7916 .nb_flags = NBT_NM_GROUP,
7917 .mhomed = false,
7918 .num_ips = ctx->addresses_best_num,
7919 .ips = ctx->addresses_best,
7920 .apply_expected = true
7922 .defend = {
7923 .timeout = 0,
7925 .replica= {
7926 .type = WREPL_TYPE_GROUP,
7927 .state = WREPL_STATE_ACTIVE,
7928 .node = WREPL_NODE_B,
7929 .is_static = false,
7930 .num_ips = ctx->addresses_best_num,
7931 .ips = ctx->addresses_best,
7932 .apply_expected = false
7936 * sgroup,active vs. group,active with different ip(s), unchecked
7939 .tctx = tctx,
7940 .line = __location__,
7941 .name = _NBT_NAME("_SA_GA_DI_U", 0x1C, NULL),
7942 .wins = {
7943 .nb_flags = NBT_NM_GROUP,
7944 .mhomed = false,
7945 .num_ips = ctx->addresses_best_num,
7946 .ips = ctx->addresses_best,
7947 .apply_expected = true
7949 .defend = {
7950 .timeout = 0,
7952 .replica= {
7953 .type = WREPL_TYPE_GROUP,
7954 .state = WREPL_STATE_ACTIVE,
7955 .node = WREPL_NODE_B,
7956 .is_static = false,
7957 .num_ips = ARRAY_SIZE(addresses_B_1),
7958 .ips = addresses_B_1,
7959 .apply_expected = false
7963 * sgroup,active vs. group,tombstone with same ip(s), unchecked
7966 .tctx = tctx,
7967 .line = __location__,
7968 .name = _NBT_NAME("_SA_GT_SI_U", 0x1C, NULL),
7969 .wins = {
7970 .nb_flags = NBT_NM_GROUP,
7971 .mhomed = false,
7972 .num_ips = ctx->addresses_best_num,
7973 .ips = ctx->addresses_best,
7974 .apply_expected = true
7976 .defend = {
7977 .timeout = 0,
7979 .replica= {
7980 .type = WREPL_TYPE_GROUP,
7981 .state = WREPL_STATE_TOMBSTONE,
7982 .node = WREPL_NODE_B,
7983 .is_static = false,
7984 .num_ips = ctx->addresses_best_num,
7985 .ips = ctx->addresses_best,
7986 .apply_expected = false
7990 * sgroup,active vs. group,tombstone with different ip(s), unchecked
7993 .tctx = tctx,
7994 .line = __location__,
7995 .name = _NBT_NAME("_SA_GT_DI_U", 0x1C, NULL),
7996 .wins = {
7997 .nb_flags = NBT_NM_GROUP,
7998 .mhomed = false,
7999 .num_ips = ctx->addresses_best_num,
8000 .ips = ctx->addresses_best,
8001 .apply_expected = true
8003 .defend = {
8004 .timeout = 0,
8006 .replica= {
8007 .type = WREPL_TYPE_GROUP,
8008 .state = WREPL_STATE_TOMBSTONE,
8009 .node = WREPL_NODE_B,
8010 .is_static = false,
8011 .num_ips = ARRAY_SIZE(addresses_B_1),
8012 .ips = addresses_B_1,
8013 .apply_expected = false
8017 * special group vs. multi homed section
8020 * sgroup,active vs. mhomed,active with same ip(s), unchecked
8023 .tctx = tctx,
8024 .line = __location__,
8025 .name = _NBT_NAME("_SA_MA_SI_U", 0x1C, NULL),
8026 .wins = {
8027 .nb_flags = NBT_NM_GROUP,
8028 .mhomed = false,
8029 .num_ips = ctx->addresses_best_num,
8030 .ips = ctx->addresses_best,
8031 .apply_expected = true
8033 .defend = {
8034 .timeout = 0,
8036 .replica= {
8037 .type = WREPL_TYPE_MHOMED,
8038 .state = WREPL_STATE_ACTIVE,
8039 .node = WREPL_NODE_B,
8040 .is_static = false,
8041 .num_ips = ctx->addresses_best_num,
8042 .ips = ctx->addresses_best,
8043 .apply_expected = false
8047 * sgroup,active vs. mhomed,active with different ip(s), unchecked
8050 .tctx = tctx,
8051 .line = __location__,
8052 .name = _NBT_NAME("_SA_MA_DI_U", 0x1C, NULL),
8053 .wins = {
8054 .nb_flags = NBT_NM_GROUP,
8055 .mhomed = false,
8056 .num_ips = ctx->addresses_best_num,
8057 .ips = ctx->addresses_best,
8058 .apply_expected = true
8060 .defend = {
8061 .timeout = 0,
8063 .replica= {
8064 .type = WREPL_TYPE_MHOMED,
8065 .state = WREPL_STATE_ACTIVE,
8066 .node = WREPL_NODE_B,
8067 .is_static = false,
8068 .num_ips = ARRAY_SIZE(addresses_B_1),
8069 .ips = addresses_B_1,
8070 .apply_expected = false
8074 * sgroup,active vs. mhomed,tombstone with same ip(s), unchecked
8077 .tctx = tctx,
8078 .line = __location__,
8079 .name = _NBT_NAME("_SA_MT_SI_U", 0x1C, NULL),
8080 .wins = {
8081 .nb_flags = NBT_NM_GROUP,
8082 .mhomed = false,
8083 .num_ips = ctx->addresses_best_num,
8084 .ips = ctx->addresses_best,
8085 .apply_expected = true
8087 .defend = {
8088 .timeout = 0,
8090 .replica= {
8091 .type = WREPL_TYPE_MHOMED,
8092 .state = WREPL_STATE_TOMBSTONE,
8093 .node = WREPL_NODE_B,
8094 .is_static = false,
8095 .num_ips = ctx->addresses_best_num,
8096 .ips = ctx->addresses_best,
8097 .apply_expected = false
8101 * sgroup,active vs. mhomed,tombstone with different ip(s), unchecked
8104 .tctx = tctx,
8105 .line = __location__,
8106 .name = _NBT_NAME("_SA_MT_DI_U", 0x1C, NULL),
8107 .wins = {
8108 .nb_flags = NBT_NM_GROUP,
8109 .mhomed = false,
8110 .num_ips = ctx->addresses_best_num,
8111 .ips = ctx->addresses_best,
8112 .apply_expected = true
8114 .defend = {
8115 .timeout = 0,
8117 .replica= {
8118 .type = WREPL_TYPE_MHOMED,
8119 .state = WREPL_STATE_TOMBSTONE,
8120 .node = WREPL_NODE_B,
8121 .is_static = false,
8122 .num_ips = ARRAY_SIZE(addresses_B_1),
8123 .ips = addresses_B_1,
8124 .apply_expected = false
8128 * multi homed vs. unique section
8131 * mhomed,active vs. unique,active with same ip(s), unchecked
8134 .tctx = tctx,
8135 .line = __location__,
8136 .name = _NBT_NAME("_MA_UA_SI_U", 0x00, NULL),
8137 .wins = {
8138 .nb_flags = 0,
8139 .mhomed = true,
8140 .num_ips = ctx->addresses_best_num,
8141 .ips = ctx->addresses_best,
8142 .apply_expected = true
8144 .defend = {
8145 .timeout = 0,
8147 .replica= {
8148 .type = WREPL_TYPE_UNIQUE,
8149 .state = WREPL_STATE_ACTIVE,
8150 .node = WREPL_NODE_B,
8151 .is_static = false,
8152 .num_ips = ctx->addresses_best_num,
8153 .ips = ctx->addresses_best,
8154 .apply_expected = true
8158 * mhomed,active vs. unique,active with different ip(s), positive response
8161 .tctx = tctx,
8162 .line = __location__,
8163 .name = _NBT_NAME("_MA_UA_DI_P", 0x00, NULL),
8164 .wins = {
8165 .nb_flags = 0,
8166 .mhomed = true,
8167 .num_ips = ctx->addresses_best_num,
8168 .ips = ctx->addresses_best,
8169 .apply_expected = true
8171 .defend = {
8172 .timeout = 10,
8173 .positive = true,
8175 .replica= {
8176 .type = WREPL_TYPE_UNIQUE,
8177 .state = WREPL_STATE_ACTIVE,
8178 .node = WREPL_NODE_B,
8179 .is_static = false,
8180 .num_ips = ARRAY_SIZE(addresses_B_1),
8181 .ips = addresses_B_1,
8182 .apply_expected = false
8186 * mhomed,active vs. unique,active with different ip(s), positive response other ips
8189 .tctx = tctx,
8190 .line = __location__,
8191 .name = _NBT_NAME("_MA_UA_DI_O", 0x00, NULL),
8192 .wins = {
8193 .nb_flags = 0,
8194 .mhomed = true,
8195 .num_ips = ctx->addresses_best_num,
8196 .ips = ctx->addresses_best,
8197 .apply_expected = true
8199 .defend = {
8200 .timeout = 10,
8201 .positive = true,
8202 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8203 .ips = addresses_A_3_4,
8205 .replica= {
8206 .type = WREPL_TYPE_UNIQUE,
8207 .state = WREPL_STATE_ACTIVE,
8208 .node = WREPL_NODE_B,
8209 .is_static = false,
8210 .num_ips = ARRAY_SIZE(addresses_B_1),
8211 .ips = addresses_B_1,
8212 .apply_expected = false
8216 * mhomed,active vs. unique,active with different ip(s), negative response
8219 .tctx = tctx,
8220 .line = __location__,
8221 .name = _NBT_NAME("_MA_UA_DI_N", 0x00, NULL),
8222 .wins = {
8223 .nb_flags = 0,
8224 .mhomed = true,
8225 .num_ips = ctx->addresses_best_num,
8226 .ips = ctx->addresses_best,
8227 .apply_expected = true
8229 .defend = {
8230 .timeout = 10,
8231 .positive = false,
8233 .replica= {
8234 .type = WREPL_TYPE_UNIQUE,
8235 .state = WREPL_STATE_ACTIVE,
8236 .node = WREPL_NODE_B,
8237 .is_static = false,
8238 .num_ips = ARRAY_SIZE(addresses_B_1),
8239 .ips = addresses_B_1,
8240 .apply_expected = true
8244 * mhomed,active vs. unique,tombstone with same ip(s), unchecked
8247 .tctx = tctx,
8248 .line = __location__,
8249 .name = _NBT_NAME("_MA_UT_SI_U", 0x00, NULL),
8250 .wins = {
8251 .nb_flags = 0,
8252 .mhomed = true,
8253 .num_ips = ctx->addresses_best_num,
8254 .ips = ctx->addresses_best,
8255 .apply_expected = true
8257 .defend = {
8258 .timeout = 0,
8260 .replica= {
8261 .type = WREPL_TYPE_UNIQUE,
8262 .state = WREPL_STATE_TOMBSTONE,
8263 .node = WREPL_NODE_B,
8264 .is_static = false,
8265 .num_ips = ctx->addresses_best_num,
8266 .ips = ctx->addresses_best,
8267 .apply_expected = false
8271 * mhomed,active vs. unique,tombstone with different ip(s), unchecked
8274 .tctx = tctx,
8275 .line = __location__,
8276 .name = _NBT_NAME("_MA_UT_DI_U", 0x00, NULL),
8277 .wins = {
8278 .nb_flags = 0,
8279 .mhomed = true,
8280 .num_ips = ctx->addresses_best_num,
8281 .ips = ctx->addresses_best,
8282 .apply_expected = true
8284 .defend = {
8285 .timeout = 0,
8287 .replica= {
8288 .type = WREPL_TYPE_UNIQUE,
8289 .state = WREPL_STATE_TOMBSTONE,
8290 .node = WREPL_NODE_B,
8291 .is_static = false,
8292 .num_ips = ARRAY_SIZE(addresses_B_1),
8293 .ips = addresses_B_1,
8294 .apply_expected = false
8298 * multi homed vs. normal group section
8301 * mhomed,active vs. group,active with same ip(s), release expected
8304 .tctx = tctx,
8305 .line = __location__,
8306 .name = _NBT_NAME("_MA_GA_SI_R", 0x00, NULL),
8307 .wins = {
8308 .nb_flags = 0,
8309 .mhomed = true,
8310 .num_ips = ctx->addresses_best_num,
8311 .ips = ctx->addresses_best,
8312 .apply_expected = true
8314 .defend = {
8315 .timeout = 10,
8316 .expect_release = true,
8318 .replica= {
8319 .type = WREPL_TYPE_GROUP,
8320 .state = WREPL_STATE_ACTIVE,
8321 .node = WREPL_NODE_B,
8322 .is_static = false,
8323 .num_ips = ctx->addresses_best_num,
8324 .ips = ctx->addresses_best,
8325 .apply_expected = true
8329 * mhomed,active vs. group,active with different ip(s), release expected
8332 .tctx = tctx,
8333 .line = __location__,
8334 .name = _NBT_NAME("_MA_GA_DI_R", 0x00, NULL),
8335 .wins = {
8336 .nb_flags = 0,
8337 .mhomed = true,
8338 .num_ips = ctx->addresses_best_num,
8339 .ips = ctx->addresses_best,
8340 .apply_expected = true
8342 .defend = {
8343 .timeout = 10,
8344 .expect_release = true,
8346 .replica= {
8347 .type = WREPL_TYPE_GROUP,
8348 .state = WREPL_STATE_ACTIVE,
8349 .node = WREPL_NODE_B,
8350 .is_static = false,
8351 .num_ips = ARRAY_SIZE(addresses_B_1),
8352 .ips = addresses_B_1,
8353 .apply_expected = true
8357 * mhomed,active vs. group,tombstone with same ip(s), unchecked
8360 .tctx = tctx,
8361 .line = __location__,
8362 .name = _NBT_NAME("_MA_GT_SI_U", 0x00, NULL),
8363 .wins = {
8364 .nb_flags = 0,
8365 .mhomed = true,
8366 .num_ips = ctx->addresses_best_num,
8367 .ips = ctx->addresses_best,
8368 .apply_expected = true
8370 .defend = {
8371 .timeout = 0,
8373 .replica= {
8374 .type = WREPL_TYPE_GROUP,
8375 .state = WREPL_STATE_TOMBSTONE,
8376 .node = WREPL_NODE_B,
8377 .is_static = false,
8378 .num_ips = ctx->addresses_best_num,
8379 .ips = ctx->addresses_best,
8380 .apply_expected = false
8384 * mhomed,active vs. group,tombstone with different ip(s), unchecked
8387 .tctx = tctx,
8388 .line = __location__,
8389 .name = _NBT_NAME("_MA_GT_DI_U", 0x00, NULL),
8390 .wins = {
8391 .nb_flags = 0,
8392 .mhomed = true,
8393 .num_ips = ctx->addresses_best_num,
8394 .ips = ctx->addresses_best,
8395 .apply_expected = true
8397 .defend = {
8398 .timeout = 0,
8400 .replica= {
8401 .type = WREPL_TYPE_GROUP,
8402 .state = WREPL_STATE_TOMBSTONE,
8403 .node = WREPL_NODE_B,
8404 .is_static = false,
8405 .num_ips = ARRAY_SIZE(addresses_B_1),
8406 .ips = addresses_B_1,
8407 .apply_expected = false
8411 * multi homed vs. special group section
8414 * mhomed,active vs. sgroup,active with same ip(s), release expected
8417 .tctx = tctx,
8418 .line = __location__,
8419 .name = _NBT_NAME("_MA_SA_SI_R", 0x00, NULL),
8420 .wins = {
8421 .nb_flags = 0,
8422 .mhomed = true,
8423 .num_ips = ctx->addresses_best_num,
8424 .ips = ctx->addresses_best,
8425 .apply_expected = true
8427 .defend = {
8428 .timeout = 10,
8429 .expect_release = true,
8431 .replica= {
8432 .type = WREPL_TYPE_SGROUP,
8433 .state = WREPL_STATE_ACTIVE,
8434 .node = WREPL_NODE_B,
8435 .is_static = false,
8436 .num_ips = ctx->addresses_best_num,
8437 .ips = ctx->addresses_best,
8438 .apply_expected = true
8442 * mhomed,active vs. group,active with different ip(s), release expected
8445 .tctx = tctx,
8446 .line = __location__,
8447 .name = _NBT_NAME("_MA_SA_DI_R", 0x00, NULL),
8448 .wins = {
8449 .nb_flags = 0,
8450 .mhomed = true,
8451 .num_ips = ctx->addresses_best_num,
8452 .ips = ctx->addresses_best,
8453 .apply_expected = true
8455 .defend = {
8456 .timeout = 10,
8457 .expect_release = true,
8459 .replica= {
8460 .type = WREPL_TYPE_SGROUP,
8461 .state = WREPL_STATE_ACTIVE,
8462 .node = WREPL_NODE_B,
8463 .is_static = false,
8464 .num_ips = ARRAY_SIZE(addresses_B_1),
8465 .ips = addresses_B_1,
8466 .apply_expected = true
8470 * mhomed,active vs. sgroup,tombstone with same ip(s), unchecked
8473 .tctx = tctx,
8474 .line = __location__,
8475 .name = _NBT_NAME("_MA_ST_SI_U", 0x00, NULL),
8476 .wins = {
8477 .nb_flags = 0,
8478 .mhomed = true,
8479 .num_ips = ctx->addresses_best_num,
8480 .ips = ctx->addresses_best,
8481 .apply_expected = true
8483 .defend = {
8484 .timeout = 0,
8486 .replica= {
8487 .type = WREPL_TYPE_SGROUP,
8488 .state = WREPL_STATE_TOMBSTONE,
8489 .node = WREPL_NODE_B,
8490 .is_static = false,
8491 .num_ips = ctx->addresses_best_num,
8492 .ips = ctx->addresses_best,
8493 .apply_expected = false
8497 * mhomed,active vs. sgroup,tombstone with different ip(s), unchecked
8500 .tctx = tctx,
8501 .line = __location__,
8502 .name = _NBT_NAME("_MA_ST_DI_U", 0x00, NULL),
8503 .wins = {
8504 .nb_flags = 0,
8505 .mhomed = true,
8506 .num_ips = ctx->addresses_best_num,
8507 .ips = ctx->addresses_best,
8508 .apply_expected = true
8510 .defend = {
8511 .timeout = 0,
8513 .replica= {
8514 .type = WREPL_TYPE_SGROUP,
8515 .state = WREPL_STATE_TOMBSTONE,
8516 .node = WREPL_NODE_B,
8517 .is_static = false,
8518 .num_ips = ARRAY_SIZE(addresses_B_1),
8519 .ips = addresses_B_1,
8520 .apply_expected = false
8524 * multi homed vs. multi homed section
8527 * mhomed,active vs. mhomed,active with same ip(s), unchecked
8530 .tctx = tctx,
8531 .line = __location__,
8532 .name = _NBT_NAME("_MA_MA_SI_U", 0x00, NULL),
8533 .wins = {
8534 .nb_flags = 0,
8535 .mhomed = true,
8536 .num_ips = ctx->addresses_best_num,
8537 .ips = ctx->addresses_best,
8538 .apply_expected = true
8540 .defend = {
8541 .timeout = 0,
8543 .replica= {
8544 .type = WREPL_TYPE_MHOMED,
8545 .state = WREPL_STATE_ACTIVE,
8546 .node = WREPL_NODE_B,
8547 .is_static = false,
8548 .num_ips = ctx->addresses_best_num,
8549 .ips = ctx->addresses_best,
8550 .apply_expected = true
8554 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8557 .tctx = tctx,
8558 .line = __location__,
8559 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8560 .wins = {
8561 .nb_flags = 0,
8562 .mhomed = true,
8563 .num_ips = ctx->addresses_best_num,
8564 .ips = ctx->addresses_best,
8565 .apply_expected = true
8567 .defend = {
8568 .timeout = 0,
8570 .replica= {
8571 .type = WREPL_TYPE_MHOMED,
8572 .state = WREPL_STATE_ACTIVE,
8573 .node = WREPL_NODE_B,
8574 .is_static = false,
8575 .num_ips = ctx->addresses_all_num,
8576 .ips = ctx->addresses_all,
8577 .apply_expected = true
8581 * mhomed,active vs. mhomed,active with different ip(s), positive response
8584 .tctx = tctx,
8585 .line = __location__,
8586 .name = _NBT_NAME("_MA_MA_DI_P", 0x00, NULL),
8587 .wins = {
8588 .nb_flags = 0,
8589 .mhomed = true,
8590 .num_ips = ctx->addresses_best_num,
8591 .ips = ctx->addresses_best,
8592 .apply_expected = true
8594 .defend = {
8595 .timeout = 10,
8596 .positive = true,
8598 .replica= {
8599 .type = WREPL_TYPE_MHOMED,
8600 .state = WREPL_STATE_ACTIVE,
8601 .node = WREPL_NODE_B,
8602 .is_static = false,
8603 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8604 .ips = addresses_B_3_4,
8605 .apply_expected = false
8609 * mhomed,active vs. mhomed,active with different ip(s), positive response other ips
8612 .tctx = tctx,
8613 .line = __location__,
8614 .name = _NBT_NAME("_MA_MA_DI_O", 0x00, NULL),
8615 .wins = {
8616 .nb_flags = 0,
8617 .mhomed = true,
8618 .num_ips = ctx->addresses_best_num,
8619 .ips = ctx->addresses_best,
8620 .apply_expected = true
8622 .defend = {
8623 .timeout = 10,
8624 .positive = true,
8625 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8626 .ips = addresses_A_3_4,
8628 .replica= {
8629 .type = WREPL_TYPE_MHOMED,
8630 .state = WREPL_STATE_ACTIVE,
8631 .node = WREPL_NODE_B,
8632 .is_static = false,
8633 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8634 .ips = addresses_B_3_4,
8635 .apply_expected = false
8639 * mhomed,active vs. mhomed,active with different ip(s), negative response
8642 .tctx = tctx,
8643 .line = __location__,
8644 .name = _NBT_NAME("_MA_MA_DI_N", 0x00, NULL),
8645 .wins = {
8646 .nb_flags = 0,
8647 .mhomed = true,
8648 .num_ips = ctx->addresses_best_num,
8649 .ips = ctx->addresses_best,
8650 .apply_expected = true
8652 .defend = {
8653 .timeout = 10,
8654 .positive = false,
8656 .replica= {
8657 .type = WREPL_TYPE_MHOMED,
8658 .state = WREPL_STATE_ACTIVE,
8659 .node = WREPL_NODE_B,
8660 .is_static = false,
8661 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8662 .ips = addresses_B_3_4,
8663 .apply_expected = true
8667 * mhomed,active vs. mhomed,tombstone with same ip(s), unchecked
8670 .tctx = tctx,
8671 .line = __location__,
8672 .name = _NBT_NAME("_MA_MT_SI_U", 0x00, NULL),
8673 .wins = {
8674 .nb_flags = 0,
8675 .mhomed = true,
8676 .num_ips = ctx->addresses_best_num,
8677 .ips = ctx->addresses_best,
8678 .apply_expected = true
8680 .defend = {
8681 .timeout = 0,
8683 .replica= {
8684 .type = WREPL_TYPE_MHOMED,
8685 .state = WREPL_STATE_TOMBSTONE,
8686 .node = WREPL_NODE_B,
8687 .is_static = false,
8688 .num_ips = ctx->addresses_best_num,
8689 .ips = ctx->addresses_best,
8690 .apply_expected = false
8694 * mhomed,active vs. mhomed,tombstone with different ip(s), unchecked
8697 .tctx = tctx,
8698 .line = __location__,
8699 .name = _NBT_NAME("_MA_MT_DI_U", 0x00, NULL),
8700 .wins = {
8701 .nb_flags = 0,
8702 .mhomed = true,
8703 .num_ips = ctx->addresses_best_num,
8704 .ips = ctx->addresses_best,
8705 .apply_expected = true
8707 .defend = {
8708 .timeout = 0,
8710 .replica= {
8711 .type = WREPL_TYPE_MHOMED,
8712 .state = WREPL_STATE_TOMBSTONE,
8713 .node = WREPL_NODE_B,
8714 .is_static = false,
8715 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8716 .ips = addresses_B_3_4,
8717 .apply_expected = false
8721 * some more multi homed test, including merging
8724 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8727 .tctx = tctx,
8728 .line = __location__,
8729 .section= "Test Replica vs. owned active: some more MHOMED combinations",
8730 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8731 .comment= "C:MHOMED vs. B:ALL => B:ALL",
8732 .skip = (ctx->addresses_all_num < 3),
8733 .wins = {
8734 .nb_flags = 0,
8735 .mhomed = true,
8736 .num_ips = ctx->addresses_mhomed_num,
8737 .ips = ctx->addresses_mhomed,
8738 .apply_expected = true
8740 .defend = {
8741 .timeout = 0,
8743 .replica= {
8744 .type = WREPL_TYPE_MHOMED,
8745 .state = WREPL_STATE_ACTIVE,
8746 .node = WREPL_NODE_B,
8747 .is_static = false,
8748 .num_ips = ctx->addresses_all_num,
8749 .ips = ctx->addresses_all,
8750 .apply_expected = true
8754 * mhomed,active vs. mhomed,active with same ips, unchecked
8757 .tctx = tctx,
8758 .line = __location__,
8759 .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL),
8760 .comment= "C:MHOMED vs. B:MHOMED => B:MHOMED",
8761 .skip = (ctx->addresses_mhomed_num < 2),
8762 .wins = {
8763 .nb_flags = 0,
8764 .mhomed = true,
8765 .num_ips = ctx->addresses_mhomed_num,
8766 .ips = ctx->addresses_mhomed,
8767 .apply_expected = true
8769 .defend = {
8770 .timeout = 0,
8772 .replica= {
8773 .type = WREPL_TYPE_MHOMED,
8774 .state = WREPL_STATE_ACTIVE,
8775 .node = WREPL_NODE_B,
8776 .is_static = false,
8777 .num_ips = ctx->addresses_mhomed_num,
8778 .ips = ctx->addresses_mhomed,
8779 .apply_expected = true
8783 * mhomed,active vs. mhomed,active with subset ip(s), positive response
8786 .tctx = tctx,
8787 .line = __location__,
8788 .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL),
8789 .comment= "C:MHOMED vs. B:BEST (C:MHOMED) => B:MHOMED",
8790 .skip = (ctx->addresses_mhomed_num < 2),
8791 .wins = {
8792 .nb_flags = 0,
8793 .mhomed = true,
8794 .num_ips = ctx->addresses_mhomed_num,
8795 .ips = ctx->addresses_mhomed,
8796 .apply_expected = true
8798 .defend = {
8799 .timeout = 10,
8800 .positive = true
8802 .replica= {
8803 .type = WREPL_TYPE_MHOMED,
8804 .state = WREPL_STATE_ACTIVE,
8805 .node = WREPL_NODE_B,
8806 .is_static = false,
8807 .num_ips = ctx->addresses_best_num,
8808 .ips = ctx->addresses_best,
8809 .mhomed_merge = true
8813 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with all addresses
8816 .tctx = tctx,
8817 .line = __location__,
8818 .name = _NBT_NAME("_MA_MA_SB_A", 0x00, NULL),
8819 .comment= "C:MHOMED vs. B:BEST (C:ALL) => B:MHOMED",
8820 .skip = (ctx->addresses_all_num < 3),
8821 .wins = {
8822 .nb_flags = 0,
8823 .mhomed = true,
8824 .num_ips = ctx->addresses_mhomed_num,
8825 .ips = ctx->addresses_mhomed,
8826 .apply_expected = true
8828 .defend = {
8829 .timeout = 10,
8830 .positive = true,
8831 .num_ips = ctx->addresses_all_num,
8832 .ips = ctx->addresses_all,
8834 .replica= {
8835 .type = WREPL_TYPE_MHOMED,
8836 .state = WREPL_STATE_ACTIVE,
8837 .node = WREPL_NODE_B,
8838 .is_static = false,
8839 .num_ips = ctx->addresses_best_num,
8840 .ips = ctx->addresses_best,
8841 .mhomed_merge = true
8845 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with replicas addresses
8846 * TODO: check why the server sends a name release demand for one address?
8847 * the release demand has no effect to the database record...
8850 .tctx = tctx,
8851 .line = __location__,
8852 .name = _NBT_NAME("_MA_MA_SB_PRA", 0x00, NULL),
8853 .comment= "C:MHOMED vs. B:BEST (C:BEST) => C:MHOMED",
8854 .skip = (ctx->addresses_all_num < 2),
8855 .wins = {
8856 .nb_flags = 0,
8857 .mhomed = true,
8858 .num_ips = ctx->addresses_mhomed_num,
8859 .ips = ctx->addresses_mhomed,
8860 .apply_expected = true
8862 .defend = {
8863 .timeout = 10,
8864 .positive = true,
8865 .num_ips = ctx->addresses_best_num,
8866 .ips = ctx->addresses_best,
8867 .late_release = true
8869 .replica= {
8870 .type = WREPL_TYPE_MHOMED,
8871 .state = WREPL_STATE_ACTIVE,
8872 .node = WREPL_NODE_B,
8873 .is_static = false,
8874 .num_ips = ctx->addresses_best_num,
8875 .ips = ctx->addresses_best,
8876 .apply_expected = false
8880 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with other addresses
8883 .tctx = tctx,
8884 .line = __location__,
8885 .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL),
8886 .comment= "C:MHOMED vs. B:BEST (B:B_3_4) =>C:MHOMED",
8887 .skip = (ctx->addresses_all_num < 2),
8888 .wins = {
8889 .nb_flags = 0,
8890 .mhomed = true,
8891 .num_ips = ctx->addresses_mhomed_num,
8892 .ips = ctx->addresses_mhomed,
8893 .apply_expected = true
8895 .defend = {
8896 .timeout = 10,
8897 .positive = true,
8898 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8899 .ips = addresses_B_3_4,
8901 .replica= {
8902 .type = WREPL_TYPE_MHOMED,
8903 .state = WREPL_STATE_ACTIVE,
8904 .node = WREPL_NODE_B,
8905 .is_static = false,
8906 .num_ips = ctx->addresses_best_num,
8907 .ips = ctx->addresses_best,
8908 .apply_expected = false
8912 * mhomed,active vs. mhomed,active with subset ip(s), negative response
8915 .tctx = tctx,
8916 .line = __location__,
8917 .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL),
8918 .comment= "C:MHOMED vs. B:BEST (NEGATIVE) => B:BEST",
8919 .skip = (ctx->addresses_mhomed_num < 2),
8920 .wins = {
8921 .nb_flags = 0,
8922 .mhomed = true,
8923 .num_ips = ctx->addresses_mhomed_num,
8924 .ips = ctx->addresses_mhomed,
8925 .apply_expected = true
8927 .defend = {
8928 .timeout = 10,
8929 .positive = false
8931 .replica= {
8932 .type = WREPL_TYPE_MHOMED,
8933 .state = WREPL_STATE_ACTIVE,
8934 .node = WREPL_NODE_B,
8935 .is_static = false,
8936 .num_ips = ctx->addresses_best_num,
8937 .ips = ctx->addresses_best,
8938 .apply_expected = true
8942 * some more multi homed and unique test, including merging
8945 * mhomed,active vs. unique,active with subset ip(s), positive response
8948 .tctx = tctx,
8949 .line = __location__,
8950 .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations",
8951 .name = _NBT_NAME("_MA_UA_SB_P", 0x00, NULL),
8952 .comment= "C:MHOMED vs. B:UNIQUE,BEST (C:MHOMED) => B:MHOMED",
8953 .skip = (ctx->addresses_all_num < 2),
8954 .wins = {
8955 .nb_flags = 0,
8956 .mhomed = true,
8957 .num_ips = ctx->addresses_mhomed_num,
8958 .ips = ctx->addresses_mhomed,
8959 .apply_expected = true
8961 .defend = {
8962 .timeout = 10,
8963 .positive = true,
8965 .replica= {
8966 .type = WREPL_TYPE_UNIQUE,
8967 .state = WREPL_STATE_ACTIVE,
8968 .node = WREPL_NODE_B,
8969 .is_static = false,
8970 .num_ips = ctx->addresses_best_num,
8971 .ips = ctx->addresses_best,
8972 .mhomed_merge = true
8976 * unique,active vs. unique,active with different ip(s), positive response, with replicas address
8977 * TODO: check why the server sends a name release demand for one address?
8978 * the release demand has no effect to the database record...
8981 .tctx = tctx,
8982 .line = __location__,
8983 .name = _NBT_NAME("_UA_UA_DI_PRA", 0x00, NULL),
8984 .comment= "C:BEST vs. B:BEST2 (C:BEST2,LR:BEST2) => C:BEST",
8985 .skip = (ctx->addresses_all_num < 2),
8986 .wins = {
8987 .nb_flags = 0,
8988 .mhomed = false,
8989 .num_ips = ctx->addresses_best_num,
8990 .ips = ctx->addresses_best,
8991 .apply_expected = true
8993 .defend = {
8994 .timeout = 10,
8995 .positive = true,
8996 .num_ips = ctx->addresses_best2_num,
8997 .ips = ctx->addresses_best2,
8998 .late_release = true
9000 .replica= {
9001 .type = WREPL_TYPE_UNIQUE,
9002 .state = WREPL_STATE_ACTIVE,
9003 .node = WREPL_NODE_B,
9004 .is_static = false,
9005 .num_ips = ctx->addresses_best2_num,
9006 .ips = ctx->addresses_best2,
9007 .apply_expected = false,
9011 * unique,active vs. unique,active with different ip(s), positive response, with all addresses
9014 .tctx = tctx,
9015 .line = __location__,
9016 .name = _NBT_NAME("_UA_UA_DI_A", 0x00, NULL),
9017 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
9018 .skip = (ctx->addresses_all_num < 3),
9019 .wins = {
9020 .nb_flags = 0,
9021 .mhomed = false,
9022 .num_ips = ctx->addresses_best_num,
9023 .ips = ctx->addresses_best,
9024 .apply_expected = true
9026 .defend = {
9027 .timeout = 10,
9028 .positive = true,
9029 .num_ips = ctx->addresses_all_num,
9030 .ips = ctx->addresses_all,
9032 .replica= {
9033 .type = WREPL_TYPE_UNIQUE,
9034 .state = WREPL_STATE_ACTIVE,
9035 .node = WREPL_NODE_B,
9036 .is_static = false,
9037 .num_ips = ctx->addresses_best2_num,
9038 .ips = ctx->addresses_best2,
9039 .mhomed_merge = true,
9043 * unique,active vs. mhomed,active with different ip(s), positive response, with all addresses
9046 .tctx = tctx,
9047 .line = __location__,
9048 .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL),
9049 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
9050 .skip = (ctx->addresses_all_num < 3),
9051 .wins = {
9052 .nb_flags = 0,
9053 .mhomed = false,
9054 .num_ips = ctx->addresses_best_num,
9055 .ips = ctx->addresses_best,
9056 .apply_expected = true
9058 .defend = {
9059 .timeout = 10,
9060 .positive = true,
9061 .num_ips = ctx->addresses_all_num,
9062 .ips = ctx->addresses_all,
9064 .replica= {
9065 .type = WREPL_TYPE_MHOMED,
9066 .state = WREPL_STATE_ACTIVE,
9067 .node = WREPL_NODE_B,
9068 .is_static = false,
9069 .num_ips = ctx->addresses_best2_num,
9070 .ips = ctx->addresses_best2,
9071 .mhomed_merge = true,
9075 * special group vs. special group merging section
9078 * sgroup,active vs. sgroup,active with different ip(s)
9081 .tctx = tctx,
9082 .line = __location__,
9083 .section= "Test Replica vs. owned active: SGROUP vs. SGROUP tests",
9084 .name = _NBT_NAME("_SA_SA_DI_U", 0x1C, NULL),
9085 .skip = (ctx->addresses_all_num < 3),
9086 .wins = {
9087 .nb_flags = NBT_NM_GROUP,
9088 .mhomed = false,
9089 .num_ips = ctx->addresses_mhomed_num,
9090 .ips = ctx->addresses_mhomed,
9091 .apply_expected = true
9093 .defend = {
9094 .timeout = 0,
9096 .replica= {
9097 .type = WREPL_TYPE_SGROUP,
9098 .state = WREPL_STATE_ACTIVE,
9099 .node = WREPL_NODE_B,
9100 .is_static = false,
9101 .num_ips = ARRAY_SIZE(addresses_B_3_4),
9102 .ips = addresses_B_3_4,
9103 .sgroup_merge = true
9107 * sgroup,active vs. sgroup,active with same ip(s)
9110 .tctx = tctx,
9111 .line = __location__,
9112 .name = _NBT_NAME("_SA_SA_SI_U", 0x1C, NULL),
9113 .skip = (ctx->addresses_all_num < 3),
9114 .wins = {
9115 .nb_flags = NBT_NM_GROUP,
9116 .mhomed = false,
9117 .num_ips = ctx->addresses_mhomed_num,
9118 .ips = ctx->addresses_mhomed,
9119 .apply_expected = true
9121 .defend = {
9122 .timeout = 0,
9124 .replica= {
9125 .type = WREPL_TYPE_SGROUP,
9126 .state = WREPL_STATE_ACTIVE,
9127 .node = WREPL_NODE_B,
9128 .is_static = false,
9129 .num_ips = ctx->addresses_mhomed_num,
9130 .ips = ctx->addresses_mhomed,
9131 .sgroup_merge = true
9135 * sgroup,active vs. sgroup,active with superset ip(s)
9138 .tctx = tctx,
9139 .line = __location__,
9140 .name = _NBT_NAME("_SA_SA_SP_U", 0x1C, NULL),
9141 .skip = (ctx->addresses_all_num < 3),
9142 .wins = {
9143 .nb_flags = NBT_NM_GROUP,
9144 .mhomed = false,
9145 .num_ips = ctx->addresses_mhomed_num,
9146 .ips = ctx->addresses_mhomed,
9147 .apply_expected = true
9149 .defend = {
9150 .timeout = 0,
9152 .replica= {
9153 .type = WREPL_TYPE_SGROUP,
9154 .state = WREPL_STATE_ACTIVE,
9155 .node = WREPL_NODE_B,
9156 .is_static = false,
9157 .num_ips = ctx->addresses_all_num,
9158 .ips = ctx->addresses_all,
9159 .sgroup_merge = true
9163 * sgroup,active vs. sgroup,active with subset ip(s)
9166 .tctx = tctx,
9167 .line = __location__,
9168 .name = _NBT_NAME("_SA_SA_SB_U", 0x1C, NULL),
9169 .skip = (ctx->addresses_all_num < 3),
9170 .wins = {
9171 .nb_flags = NBT_NM_GROUP,
9172 .mhomed = false,
9173 .num_ips = ctx->addresses_mhomed_num,
9174 .ips = ctx->addresses_mhomed,
9175 .apply_expected = true
9177 .defend = {
9178 .timeout = 0,
9180 .replica= {
9181 .type = WREPL_TYPE_SGROUP,
9182 .state = WREPL_STATE_ACTIVE,
9183 .node = WREPL_NODE_B,
9184 .is_static = false,
9185 .num_ips = ctx->addresses_best_num,
9186 .ips = ctx->addresses_best,
9187 .sgroup_merge = true
9191 * sgroup,active vs. sgroup,tombstone with different ip(s)
9194 .tctx = tctx,
9195 .line = __location__,
9196 .name = _NBT_NAME("_SA_ST_DI_U", 0x1C, NULL),
9197 .skip = (ctx->addresses_all_num < 3),
9198 .wins = {
9199 .nb_flags = NBT_NM_GROUP,
9200 .mhomed = false,
9201 .num_ips = ctx->addresses_mhomed_num,
9202 .ips = ctx->addresses_mhomed,
9203 .apply_expected = true
9205 .defend = {
9206 .timeout = 0,
9208 .replica= {
9209 .type = WREPL_TYPE_SGROUP,
9210 .state = WREPL_STATE_TOMBSTONE,
9211 .node = WREPL_NODE_B,
9212 .is_static = false,
9213 .num_ips = ARRAY_SIZE(addresses_B_3_4),
9214 .ips = addresses_B_3_4,
9215 .apply_expected = false
9219 * sgroup,active vs. sgroup,tombstone with same ip(s)
9222 .tctx = tctx,
9223 .line = __location__,
9224 .name = _NBT_NAME("_SA_ST_SI_U", 0x1C, NULL),
9225 .skip = (ctx->addresses_all_num < 3),
9226 .wins = {
9227 .nb_flags = NBT_NM_GROUP,
9228 .mhomed = false,
9229 .num_ips = ctx->addresses_mhomed_num,
9230 .ips = ctx->addresses_mhomed,
9231 .apply_expected = true
9233 .defend = {
9234 .timeout = 0,
9236 .replica= {
9237 .type = WREPL_TYPE_SGROUP,
9238 .state = WREPL_STATE_TOMBSTONE,
9239 .node = WREPL_NODE_B,
9240 .is_static = false,
9241 .num_ips = ctx->addresses_mhomed_num,
9242 .ips = ctx->addresses_mhomed,
9243 .apply_expected = false
9247 * sgroup,active vs. sgroup,tombstone with superset ip(s)
9250 .tctx = tctx,
9251 .line = __location__,
9252 .name = _NBT_NAME("_SA_ST_SP_U", 0x1C, NULL),
9253 .skip = (ctx->addresses_all_num < 3),
9254 .wins = {
9255 .nb_flags = NBT_NM_GROUP,
9256 .mhomed = false,
9257 .num_ips = ctx->addresses_mhomed_num,
9258 .ips = ctx->addresses_mhomed,
9259 .apply_expected = true
9261 .defend = {
9262 .timeout = 0,
9264 .replica= {
9265 .type = WREPL_TYPE_SGROUP,
9266 .state = WREPL_STATE_TOMBSTONE,
9267 .node = WREPL_NODE_B,
9268 .is_static = false,
9269 .num_ips = ctx->addresses_all_num,
9270 .ips = ctx->addresses_all,
9271 .apply_expected = false
9275 * sgroup,active vs. sgroup,tombstone with subset ip(s)
9278 .tctx = tctx,
9279 .line = __location__,
9280 .name = _NBT_NAME("_SA_ST_SB_U", 0x1C, NULL),
9281 .skip = (ctx->addresses_all_num < 3),
9282 .wins = {
9283 .nb_flags = NBT_NM_GROUP,
9284 .mhomed = false,
9285 .num_ips = ctx->addresses_mhomed_num,
9286 .ips = ctx->addresses_mhomed,
9287 .apply_expected = true
9289 .defend = {
9290 .timeout = 0,
9292 .replica= {
9293 .type = WREPL_TYPE_SGROUP,
9294 .state = WREPL_STATE_TOMBSTONE,
9295 .node = WREPL_NODE_B,
9296 .is_static = false,
9297 .num_ips = ctx->addresses_best_num,
9298 .ips = ctx->addresses_best,
9299 .apply_expected = false
9304 if (!ctx->nbtsock_srv) {
9305 torture_comment(tctx, "SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
9306 lpcfg_nbt_port(tctx->lp_ctx));
9307 return true;
9310 torture_comment(tctx, "Test Replica records vs. owned active records\n");
9312 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
9313 struct timeval end;
9314 struct test_conflict_owned_active_vs_replica_struct record = records[i];
9315 uint32_t j, count = 1;
9316 const char *action;
9318 if (records[i].wins.mhomed || records[i].name.type == 0x1C) {
9319 count = records[i].wins.num_ips;
9322 if (records[i].section) {
9323 torture_comment(tctx, "%s\n", records[i].section);
9326 if (records[i].skip) {
9327 torture_comment(tctx, "%s => SKIPPED\n", nbt_name_string(ctx, &records[i].name));
9328 continue;
9331 if (records[i].replica.mhomed_merge) {
9332 action = "MHOMED_MERGE";
9333 } else if (records[i].replica.sgroup_merge) {
9334 action = "SGROUP_MERGE";
9335 } else if (records[i].replica.apply_expected) {
9336 action = "REPLACE";
9337 } else {
9338 action = "NOT REPLACE";
9341 torture_comment(tctx, "%s%s%s => %s\n",
9342 nbt_name_string(ctx, &records[i].name),
9343 (records[i].comment?": ":""),
9344 (records[i].comment?records[i].comment:""),
9345 action);
9347 /* Prepare for multi homed registration */
9348 ZERO_STRUCT(records[i].defend);
9349 records[i].defend.timeout = 10;
9350 records[i].defend.positive = true;
9351 nbt_set_incoming_handler(ctx->nbtsock_srv,
9352 test_conflict_owned_active_vs_replica_handler,
9353 &records[i]);
9354 if (ctx->nbtsock_srv2) {
9355 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9356 test_conflict_owned_active_vs_replica_handler,
9357 &records[i]);
9361 * Setup Register
9363 for (j=0; j < count; j++) {
9364 struct nbt_name_request *req;
9366 name_register->in.name = records[i].name;
9367 name_register->in.dest_addr = ctx->address;
9368 name_register->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
9369 name_register->in.address = records[i].wins.ips[j].ip;
9370 name_register->in.nb_flags = records[i].wins.nb_flags;
9371 name_register->in.register_demand= false;
9372 name_register->in.broadcast = false;
9373 name_register->in.multi_homed = records[i].wins.mhomed;
9374 name_register->in.ttl = 300000;
9375 name_register->in.timeout = 70;
9376 name_register->in.retries = 0;
9378 req = nbt_name_register_send(ctx->nbtsock, name_register);
9380 /* push the request on the wire */
9381 event_loop_once(ctx->nbtsock->event_ctx);
9384 * if we register multiple addresses,
9385 * the server will do name queries to see if the old addresses
9386 * are still alive
9388 if (records[i].wins.mhomed && j > 0) {
9389 end = timeval_current_ofs(records[i].defend.timeout,0);
9390 records[i].defend.ret = true;
9391 while (records[i].defend.timeout > 0) {
9392 event_loop_once(ctx->nbtsock_srv->event_ctx);
9393 if (timeval_expired(&end)) break;
9395 ret &= records[i].defend.ret;
9398 status = nbt_name_register_recv(req, ctx, name_register);
9399 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9400 torture_comment(tctx, "No response from %s for name register\n", ctx->address);
9401 ret = false;
9403 if (!NT_STATUS_IS_OK(status)) {
9404 torture_comment(tctx, "Bad response from %s for name register - %s\n",
9405 ctx->address, nt_errstr(status));
9406 ret = false;
9408 CHECK_VALUE(tctx, name_register->out.rcode, 0);
9409 CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address);
9410 CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type);
9411 CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name);
9412 CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope);
9413 CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[j].ip);
9416 /* Prepare for the current test */
9417 records[i].defend = record.defend;
9418 nbt_set_incoming_handler(ctx->nbtsock_srv,
9419 test_conflict_owned_active_vs_replica_handler,
9420 &records[i]);
9421 if (ctx->nbtsock_srv2) {
9422 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9423 test_conflict_owned_active_vs_replica_handler,
9424 &records[i]);
9428 * Setup Replica
9430 wins_name->name = &records[i].name;
9431 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
9432 records[i].replica.state,
9433 records[i].replica.node,
9434 records[i].replica.is_static);
9435 wins_name->id = ++ctx->b.max_version;
9436 if (wins_name->flags & 2) {
9437 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
9438 wins_name->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
9439 records[i].replica.ips);
9440 } else {
9441 wins_name->addresses.ip = records[i].replica.ips[0].ip;
9443 wins_name->unknown = "255.255.255.255";
9445 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9448 * wait for the name query, which is handled in
9449 * test_conflict_owned_active_vs_replica_handler()
9451 end = timeval_current_ofs(records[i].defend.timeout,0);
9452 records[i].defend.ret = true;
9453 while (records[i].defend.timeout > 0) {
9454 event_loop_once(ctx->nbtsock_srv->event_ctx);
9455 if (timeval_expired(&end)) break;
9457 ret &= records[i].defend.ret;
9459 if (records[i].defend.late_release) {
9460 records[i].defend = record.defend;
9461 records[i].defend.expect_release = true;
9463 * wait for the name release demand, which is handled in
9464 * test_conflict_owned_active_vs_replica_handler()
9466 end = timeval_current_ofs(records[i].defend.timeout,0);
9467 records[i].defend.ret = true;
9468 while (records[i].defend.timeout > 0) {
9469 event_loop_once(ctx->nbtsock_srv->event_ctx);
9470 if (timeval_expired(&end)) break;
9472 ret &= records[i].defend.ret;
9475 if (records[i].replica.mhomed_merge) {
9476 ret &= test_wrepl_mhomed_merged(tctx, ctx, &ctx->c,
9477 records[i].wins.num_ips, records[i].wins.ips,
9478 &ctx->b,
9479 records[i].replica.num_ips, records[i].replica.ips,
9480 wins_name);
9481 } else if (records[i].replica.sgroup_merge) {
9482 ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL,
9483 &ctx->c,
9484 records[i].wins.num_ips, records[i].wins.ips,
9485 &ctx->b,
9486 records[i].replica.num_ips, records[i].replica.ips,
9487 wins_name);
9488 } else {
9489 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name,
9490 records[i].replica.apply_expected);
9493 if (records[i].replica.apply_expected ||
9494 records[i].replica.mhomed_merge) {
9495 wins_name->name = &records[i].name;
9496 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9497 WREPL_STATE_TOMBSTONE,
9498 WREPL_NODE_B, false);
9499 wins_name->id = ++ctx->b.max_version;
9500 wins_name->addresses.ip = addresses_B_1[0].ip;
9501 wins_name->unknown = "255.255.255.255";
9503 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9504 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9505 } else {
9506 for (j=0; j < count; j++) {
9507 struct nbt_name_socket *nbtsock = ctx->nbtsock;
9509 if (ctx->myaddr2 && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2->addr) == 0) {
9510 nbtsock = ctx->nbtsock2;
9513 release->in.name = records[i].name;
9514 release->in.dest_addr = ctx->address;
9515 release->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
9516 release->in.address = records[i].wins.ips[j].ip;
9517 release->in.nb_flags = records[i].wins.nb_flags;
9518 release->in.broadcast = false;
9519 release->in.timeout = 30;
9520 release->in.retries = 0;
9522 status = nbt_name_release(nbtsock, ctx, release);
9523 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9524 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
9525 return false;
9527 if (!NT_STATUS_IS_OK(status)) {
9528 torture_comment(tctx, "Bad response from %s for name query - %s\n",
9529 ctx->address, nt_errstr(status));
9530 return false;
9532 CHECK_VALUE(tctx, release->out.rcode, 0);
9535 if (records[i].replica.sgroup_merge) {
9536 /* clean up the SGROUP record */
9537 wins_name->name = &records[i].name;
9538 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9539 WREPL_STATE_ACTIVE,
9540 WREPL_NODE_B, false);
9541 wins_name->id = ++ctx->b.max_version;
9542 wins_name->addresses.addresses.num_ips = 0;
9543 wins_name->addresses.addresses.ips = NULL;
9544 wins_name->unknown = "255.255.255.255";
9545 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9547 /* take ownership of the SGROUP record */
9548 wins_name->name = &records[i].name;
9549 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9550 WREPL_STATE_ACTIVE,
9551 WREPL_NODE_B, false);
9552 wins_name->id = ++ctx->b.max_version;
9553 wins_name->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
9554 wins_name->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
9555 addresses_B_1);
9556 wins_name->unknown = "255.255.255.255";
9557 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9558 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9560 /* overwrite the SGROUP record with unique,tombstone */
9561 wins_name->name = &records[i].name;
9562 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9563 WREPL_STATE_TOMBSTONE,
9564 WREPL_NODE_B, false);
9565 wins_name->id = ++ctx->b.max_version;
9566 wins_name->addresses.ip = addresses_A_1[0].ip;
9567 wins_name->unknown = "255.255.255.255";
9568 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9569 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9573 if (!ret) {
9574 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
9575 return ret;
9579 return ret;
9582 #define __NBT_LABEL_CAT1__(a,b) a##b
9583 #define __NBT_LABEL_CAT2__(a,b) __NBT_LABEL_CAT1__(a,b)
9584 #define _NBT_LABEL __NBT_LABEL_CAT2__(_label_, __LINE__)
9586 #define _NBT_ASSERT(v, correct) do { \
9587 bool _ret = true; \
9588 torture_assert_int_equal_goto(rec->tctx, v, correct, \
9589 _ret, _NBT_LABEL, "Invalid int value"); \
9590 _NBT_LABEL: \
9591 if (!_ret) { \
9592 return; \
9594 } while (0)
9596 #define _NBT_ASSERT_STRING(v, correct) do { \
9597 bool _ret = true; \
9598 torture_assert_str_equal_goto(rec->tctx, v, correct, \
9599 _ret, _NBT_LABEL, "Invalid string value"); \
9600 _NBT_LABEL: \
9601 if (!_ret) { \
9602 return; \
9604 } while (0)
9606 static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
9607 struct nbt_name_packet *req_packet,
9608 struct socket_address *src)
9610 struct nbt_name *name;
9611 struct nbt_name_packet *rep_packet;
9612 struct test_conflict_owned_active_vs_replica_struct *rec =
9613 (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
9615 _NBT_ASSERT(req_packet->qdcount, 1);
9616 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9617 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9619 name = &req_packet->questions[0].name;
9621 _NBT_ASSERT_STRING(name->name, rec->name.name);
9622 _NBT_ASSERT(name->type, rec->name.type);
9623 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9625 _NBT_ASSERT(rec->defend.expect_release, false);
9627 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9628 if (rep_packet == NULL) return;
9630 rep_packet->name_trn_id = req_packet->name_trn_id;
9631 rep_packet->ancount = 1;
9633 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9634 if (rep_packet->answers == NULL) return;
9636 rep_packet->answers[0].name = *name;
9637 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9638 rep_packet->answers[0].ttl = 0;
9640 if (rec->defend.positive) {
9641 uint32_t i, num_ips;
9642 const struct wrepl_ip *ips;
9644 if (rec->defend.num_ips > 0) {
9645 num_ips = rec->defend.num_ips;
9646 ips = rec->defend.ips;
9647 } else {
9648 num_ips = rec->wins.num_ips;
9649 ips = rec->wins.ips;
9652 /* send a positive reply */
9653 rep_packet->operation =
9654 NBT_FLAG_REPLY |
9655 NBT_OPCODE_QUERY |
9656 NBT_FLAG_AUTHORITATIVE |
9657 NBT_FLAG_RECURSION_DESIRED |
9658 NBT_FLAG_RECURSION_AVAIL;
9660 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9662 rep_packet->answers[0].rdata.netbios.length = num_ips*6;
9663 rep_packet->answers[0].rdata.netbios.addresses =
9664 talloc_array(rep_packet->answers, struct nbt_rdata_address, num_ips);
9665 if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return;
9667 for (i=0; i < num_ips; i++) {
9668 struct nbt_rdata_address *addr =
9669 &rep_packet->answers[0].rdata.netbios.addresses[i];
9670 addr->nb_flags = rec->wins.nb_flags;
9671 addr->ipaddr = ips[i].ip;
9673 DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
9674 nbt_name_string(rep_packet, name), src->addr, src->port));
9675 } else {
9676 /* send a negative reply */
9677 rep_packet->operation =
9678 NBT_FLAG_REPLY |
9679 NBT_OPCODE_QUERY |
9680 NBT_FLAG_AUTHORITATIVE |
9681 NBT_RCODE_NAM;
9683 rep_packet->answers[0].rr_type = NBT_QTYPE_NULL;
9685 ZERO_STRUCT(rep_packet->answers[0].rdata);
9687 DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
9688 nbt_name_string(rep_packet, name), src->addr, src->port));
9691 nbt_name_reply_send(nbtsock, src, rep_packet);
9692 talloc_free(rep_packet);
9694 /* make sure we push the reply to the wire */
9695 while (nbtsock->send_queue) {
9696 event_loop_once(nbtsock->event_ctx);
9698 smb_msleep(1000);
9700 rec->defend.timeout = 0;
9701 rec->defend.ret = true;
9704 static void test_conflict_owned_active_vs_replica_handler_release(
9705 struct nbt_name_socket *nbtsock,
9706 struct nbt_name_packet *req_packet,
9707 struct socket_address *src)
9709 struct nbt_name *name;
9710 struct nbt_name_packet *rep_packet;
9711 struct test_conflict_owned_active_vs_replica_struct *rec =
9712 (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
9714 _NBT_ASSERT(req_packet->qdcount, 1);
9715 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9716 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9718 name = &req_packet->questions[0].name;
9720 _NBT_ASSERT_STRING(name->name, rec->name.name);
9721 _NBT_ASSERT(name->type, rec->name.type);
9722 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9724 _NBT_ASSERT(rec->defend.expect_release, true);
9726 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9727 if (rep_packet == NULL) return;
9729 rep_packet->name_trn_id = req_packet->name_trn_id;
9730 rep_packet->ancount = 1;
9731 rep_packet->operation =
9732 NBT_FLAG_REPLY |
9733 NBT_OPCODE_RELEASE |
9734 NBT_FLAG_AUTHORITATIVE;
9736 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9737 if (rep_packet->answers == NULL) return;
9739 rep_packet->answers[0].name = *name;
9740 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9741 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9742 rep_packet->answers[0].ttl = req_packet->additional[0].ttl;
9743 rep_packet->answers[0].rdata = req_packet->additional[0].rdata;
9745 DEBUG(2,("Sending name release reply for %s to %s:%d\n",
9746 nbt_name_string(rep_packet, name), src->addr, src->port));
9748 nbt_name_reply_send(nbtsock, src, rep_packet);
9749 talloc_free(rep_packet);
9751 /* make sure we push the reply to the wire */
9752 while (nbtsock->send_queue) {
9753 event_loop_once(nbtsock->event_ctx);
9755 smb_msleep(1000);
9757 rec->defend.timeout = 0;
9758 rec->defend.ret = true;
9761 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
9762 struct nbt_name_packet *req_packet,
9763 struct socket_address *src)
9765 struct test_conflict_owned_active_vs_replica_struct *rec =
9766 (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
9767 struct nbt_name *name = &req_packet->questions[0].name;
9769 if (req_packet->operation & NBT_FLAG_BROADCAST) {
9770 torture_comment(rec->tctx,
9771 "%s: incoming packet name[%s] flags[0x%08X] from[%s]\n",
9772 __location__,
9773 nbt_name_string(rec->tctx, name),
9774 req_packet->operation,
9775 src->addr);
9776 return;
9779 rec->defend.ret = false;
9781 switch (req_packet->operation & NBT_OPCODE) {
9782 case NBT_OPCODE_QUERY:
9783 test_conflict_owned_active_vs_replica_handler_query(nbtsock, req_packet, src);
9784 break;
9785 case NBT_OPCODE_RELEASE:
9786 test_conflict_owned_active_vs_replica_handler_release(nbtsock, req_packet, src);
9787 break;
9788 default:
9789 torture_comment(rec->tctx,
9790 "%s: unexpected packet name[%s] flags[0x%08X] from[%s]\n",
9791 __location__,
9792 nbt_name_string(rec->tctx, name),
9793 req_packet->operation,
9794 src->addr);
9795 _NBT_ASSERT((req_packet->operation & NBT_OPCODE), NBT_OPCODE_QUERY);
9796 break;
9801 test WINS replication replica conflicts operations
9803 static bool torture_nbt_winsreplication_replica(struct torture_context *tctx)
9805 bool ret = true;
9806 struct test_wrepl_conflict_conn *ctx;
9808 const char *address;
9809 struct nbt_name name;
9811 if (!torture_nbt_get_name(tctx, &name, &address))
9812 return false;
9814 ctx = test_create_conflict_ctx(tctx, address);
9815 if (!ctx) return false;
9817 ret &= test_conflict_same_owner(tctx, ctx);
9818 ret &= test_conflict_different_owner(tctx, ctx);
9820 return ret;
9824 test WINS replication owned conflicts operations
9826 static bool torture_nbt_winsreplication_owned(struct torture_context *tctx)
9828 const char *address;
9829 struct nbt_name name;
9830 bool ret = true;
9831 struct test_wrepl_conflict_conn *ctx;
9833 if (torture_setting_bool(tctx, "quick", false))
9834 torture_skip(tctx,
9835 "skip NBT-WINSREPLICATION-OWNED test in quick test mode\n");
9837 if (!torture_nbt_get_name(tctx, &name, &address))
9838 return false;
9840 ctx = test_create_conflict_ctx(tctx, address);
9841 torture_assert(tctx, ctx != NULL, "Creating context failed");
9843 ret &= test_conflict_owned_released_vs_replica(tctx, ctx);
9844 ret &= test_conflict_owned_active_vs_replica(tctx, ctx);
9846 return ret;
9850 test simple WINS replication operations
9852 struct torture_suite *torture_nbt_winsreplication(TALLOC_CTX *mem_ctx)
9854 struct torture_suite *suite = torture_suite_create(
9855 mem_ctx, "winsreplication");
9856 struct torture_tcase *tcase;
9858 tcase = torture_suite_add_simple_test(suite, "assoc_ctx1",
9859 test_assoc_ctx1);
9860 tcase->tests->dangerous = true;
9862 torture_suite_add_simple_test(suite, "assoc_ctx2", test_assoc_ctx2);
9864 torture_suite_add_simple_test(suite, "wins_replication",
9865 test_wins_replication);
9867 torture_suite_add_simple_test(suite, "replica",
9868 torture_nbt_winsreplication_replica);
9870 torture_suite_add_simple_test(suite, "owned",
9871 torture_nbt_winsreplication_owned);
9873 return suite;