Debian Codegraph @

source4/torture/nbt/winsreplication.c

raw
1 /*
2 Unix SMB/CIFS implementation.
3
4 WINS replication testing
5
6 Copyright (C) Andrew Tridgell 2005
7 Copyright (C) Stefan Metzmacher 2005
8
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.
13
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.
18
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/>.
21 */
22
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 "libcli/nbt/libnbt.h"
31 #include "torture/torture.h"
32 #include "torture/nbt/proto.h"
33 #include "param/param.h"
34
35 #define CHECK_STATUS(tctx, status, correct) \
36 torture_assert_ntstatus_equal(tctx, status, correct, \
37 "Incorrect status")
38
39 #define CHECK_VALUE(tctx, v, correct) \
40 torture_assert(tctx, (v) == (correct), \
41 talloc_asprintf(tctx, "Incorrect value %s=%d - should be %d\n", \
42 #v, v, correct))
43
44 #define CHECK_VALUE_UINT64(tctx, v, correct) \
45 torture_assert(tctx, (v) == (correct), \
46 talloc_asprintf(tctx, "Incorrect value %s=%llu - should be %llu\n", \
47 #v, (long long)v, (long long)correct))
48
49 #define CHECK_VALUE_STRING(tctx, v, correct) \
50 torture_assert_str_equal(tctx, v, correct, "Invalid value")
51
52 #define _NBT_NAME(n,t,s) {\
53 .name = n,\
54 .type = t,\
55 .scope = s\
56 }
57
58 static const char *wrepl_name_type_string(enum wrepl_name_type type)
59 {
60 switch (type) {
61 case WREPL_TYPE_UNIQUE: return "UNIQUE";
62 case WREPL_TYPE_GROUP: return "GROUP";
63 case WREPL_TYPE_SGROUP: return "SGROUP";
64 case WREPL_TYPE_MHOMED: return "MHOMED";
65 }
66 return "UNKNOWN_TYPE";
67 }
68
69 static const char *wrepl_name_state_string(enum wrepl_name_state state)
70 {
71 switch (state) {
72 case WREPL_STATE_ACTIVE: return "ACTIVE";
73 case WREPL_STATE_RELEASED: return "RELEASED";
74 case WREPL_STATE_TOMBSTONE: return "TOMBSTONE";
75 case WREPL_STATE_RESERVED: return "RESERVED";
76 }
77 return "UNKNOWN_STATE";
78 }
79
80 /*
81 test how assoc_ctx's are only usable on the connection
82 they are created on.
83 */
84 static bool test_assoc_ctx1(struct torture_context *tctx)
85 {
86 bool ret = true;
87 struct tevent_req *subreq;
88 struct wrepl_socket *wrepl_socket1;
89 struct wrepl_associate associate1;
90 struct wrepl_socket *wrepl_socket2;
91 struct wrepl_associate associate2;
92 struct wrepl_packet packet;
93 struct wrepl_send_ctrl ctrl;
94 struct wrepl_packet *rep_packet;
95 struct wrepl_associate_stop assoc_stop;
96 NTSTATUS status;
97 struct nbt_name name;
98 const char *address;
99 bool ok;
100
101 if (!torture_nbt_get_name(tctx, &name, &address))
102 return false;
103
104 torture_comment(tctx, "Test if assoc_ctx is only valid on the connection it was created on\n");
105
106 wrepl_socket1 = wrepl_socket_init(tctx, tctx->ev);
107 wrepl_socket2 = wrepl_socket_init(tctx, tctx->ev);
108
109 torture_comment(tctx, "Setup 2 wrepl connections\n");
110 status = wrepl_connect(wrepl_socket1, wrepl_best_ip(tctx->lp_ctx, address), address);
111 CHECK_STATUS(tctx, status, NT_STATUS_OK);
112
113 status = wrepl_connect(wrepl_socket2, wrepl_best_ip(tctx->lp_ctx, address), address);
114 CHECK_STATUS(tctx, status, NT_STATUS_OK);
115
116 torture_comment(tctx, "Send a start association request (conn1)\n");
117 status = wrepl_associate(wrepl_socket1, &associate1);
118 CHECK_STATUS(tctx, status, NT_STATUS_OK);
119
120 torture_comment(tctx, "association context (conn1): 0x%x\n", associate1.out.assoc_ctx);
121
122 torture_comment(tctx, "Send a start association request (conn2)\n");
123 status = wrepl_associate(wrepl_socket2, &associate2);
124 CHECK_STATUS(tctx, status, NT_STATUS_OK);
125
126 torture_comment(tctx, "association context (conn2): 0x%x\n", associate2.out.assoc_ctx);
127
128 torture_comment(tctx, "Send a replication table query, with assoc 1 (conn2), the answer should be on conn1\n");
129 ZERO_STRUCT(packet);
130 packet.opcode = WREPL_OPCODE_BITS;
131 packet.assoc_ctx = associate1.out.assoc_ctx;
132 packet.mess_type = WREPL_REPLICATION;
133 packet.message.replication.command = WREPL_REPL_TABLE_QUERY;
134 ZERO_STRUCT(ctrl);
135 ctrl.send_only = true;
136 subreq = wrepl_request_send(tctx, tctx->ev, wrepl_socket2, &packet, &ctrl);
137 ok = tevent_req_poll(subreq, tctx->ev);
138 if (!ok) {
139 CHECK_STATUS(tctx, NT_STATUS_INTERNAL_ERROR, NT_STATUS_OK);
140 }
141 status = wrepl_request_recv(subreq, tctx, &rep_packet);
142 TALLOC_FREE(subreq);
143 CHECK_STATUS(tctx, status, NT_STATUS_OK);
144
145 torture_comment(tctx, "Send a association request (conn2), to make sure the last request was ignored\n");
146 status = wrepl_associate(wrepl_socket2, &associate2);
147 CHECK_STATUS(tctx, status, NT_STATUS_OK);
148
149 torture_comment(tctx, "Send a replication table query, with invalid assoc (conn1), receive answer from conn2\n");
150 ZERO_STRUCT(packet);
151 packet.opcode = WREPL_OPCODE_BITS;
152 packet.assoc_ctx = 0;
153 packet.mess_type = WREPL_REPLICATION;
154 packet.message.replication.command = WREPL_REPL_TABLE_QUERY;
155 status = wrepl_request(wrepl_socket1, tctx, &packet, &rep_packet);
156 CHECK_STATUS(tctx, status, NT_STATUS_OK);
157
158 torture_comment(tctx, "Send a association request (conn1), to make sure the last request was handled correct\n");
159 status = wrepl_associate(wrepl_socket1, &associate2);
160 CHECK_STATUS(tctx, status, NT_STATUS_OK);
161
162 assoc_stop.in.assoc_ctx = associate1.out.assoc_ctx;
163 assoc_stop.in.reason = 4;
164 torture_comment(tctx, "Send a association stop request (conn1), reason: %u\n", assoc_stop.in.reason);
165 status = wrepl_associate_stop(wrepl_socket1, &assoc_stop);
166 CHECK_STATUS(tctx, status, NT_STATUS_END_OF_FILE);
167
168 assoc_stop.in.assoc_ctx = associate2.out.assoc_ctx;
169 assoc_stop.in.reason = 0;
170 torture_comment(tctx, "Send a association stop request (conn2), reason: %u\n", assoc_stop.in.reason);
171 status = wrepl_associate_stop(wrepl_socket2, &assoc_stop);
172 CHECK_STATUS(tctx, status, NT_STATUS_OK);
173
174 torture_comment(tctx, "Close 2 wrepl connections\n");
175 talloc_free(wrepl_socket1);
176 talloc_free(wrepl_socket2);
177 return ret;
178 }
179
180 /*
181 test if we always get back the same assoc_ctx
182 */
183 static bool test_assoc_ctx2(struct torture_context *tctx)
184 {
185 struct wrepl_socket *wrepl_socket;
186 struct wrepl_associate associate;
187 uint32_t assoc_ctx1;
188 struct nbt_name name;
189 NTSTATUS status;
190 const char *address;
191
192 if (!torture_nbt_get_name(tctx, &name, &address))
193 return false;
194
195 torture_comment(tctx, "Test if we always get back the same assoc_ctx\n");
196
197 wrepl_socket = wrepl_socket_init(tctx, tctx->ev);
198
199 torture_comment(tctx, "Setup wrepl connections\n");
200 status = wrepl_connect(wrepl_socket, wrepl_best_ip(tctx->lp_ctx, address), address);
201 CHECK_STATUS(tctx, status, NT_STATUS_OK);
202
203 torture_comment(tctx, "Send 1st start association request\n");
204 status = wrepl_associate(wrepl_socket, &associate);
205 CHECK_STATUS(tctx, status, NT_STATUS_OK);
206 assoc_ctx1 = associate.out.assoc_ctx;
207 torture_comment(tctx, "1st association context: 0x%x\n", associate.out.assoc_ctx);
208
209 torture_comment(tctx, "Send 2nd start association request\n");
210 status = wrepl_associate(wrepl_socket, &associate);
211 torture_assert_ntstatus_ok(tctx, status, "2nd start association failed");
212 torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1,
213 "Different context returned");
214 torture_comment(tctx, "2nd association context: 0x%x\n", associate.out.assoc_ctx);
215
216 torture_comment(tctx, "Send 3rd start association request\n");
217 status = wrepl_associate(wrepl_socket, &associate);
218 torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1,
219 "Different context returned");
220 CHECK_STATUS(tctx, status, NT_STATUS_OK);
221 torture_comment(tctx, "3rd association context: 0x%x\n", associate.out.assoc_ctx);
222
223 torture_comment(tctx, "Close wrepl connections\n");
224 talloc_free(wrepl_socket);
225 return true;
226 }
227
228
229 /*
230 display a replication entry
231 */
232 static void display_entry(struct torture_context *tctx, struct wrepl_name *name)
233 {
234 int i;
235
236 torture_comment(tctx, "%s\n", nbt_name_string(tctx, &name->name));
237 torture_comment(tctx, "\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n",
238 name->type, name->state, name->node, name->is_static, (long long)name->version_id);
239 torture_comment(tctx, "\tRAW_FLAGS: 0x%08X OWNER: %-15s\n",
240 name->raw_flags, name->owner);
241 for (i=0;i<name->num_addresses;i++) {
242 torture_comment(tctx, "\tADDR: %-15s OWNER: %-15s\n",
243 name->addresses[i].address, name->addresses[i].owner);
244 }
245 }
246
247 /*
248 test a full replication dump from a WINS server
249 */
250 static bool test_wins_replication(struct torture_context *tctx)
251 {
252 struct wrepl_socket *wrepl_socket;
253 NTSTATUS status;
254 int i, j;
255 struct wrepl_associate associate;
256 struct wrepl_pull_table pull_table;
257 struct wrepl_pull_names pull_names;
258 struct nbt_name name;
259 const char *address;
260
261 if (!torture_nbt_get_name(tctx, &name, &address))
262 return false;
263
264 torture_comment(tctx, "Test one pull replication cycle\n");
265
266 wrepl_socket = wrepl_socket_init(tctx, tctx->ev);
267
268 torture_comment(tctx, "Setup wrepl connections\n");
269 status = wrepl_connect(wrepl_socket, wrepl_best_ip(tctx->lp_ctx, address), address);
270 CHECK_STATUS(tctx, status, NT_STATUS_OK);
271
272 torture_comment(tctx, "Send a start association request\n");
273
274 status = wrepl_associate(wrepl_socket, &associate);
275 CHECK_STATUS(tctx, status, NT_STATUS_OK);
276
277 torture_comment(tctx, "association context: 0x%x\n", associate.out.assoc_ctx);
278
279 torture_comment(tctx, "Send a replication table query\n");
280 pull_table.in.assoc_ctx = associate.out.assoc_ctx;
281
282 status = wrepl_pull_table(wrepl_socket, tctx, &pull_table);
283 if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) {
284 struct wrepl_associate_stop assoc_stop;
285
286 assoc_stop.in.assoc_ctx = associate.out.assoc_ctx;
287 assoc_stop.in.reason = 0;
288
289 wrepl_associate_stop(wrepl_socket, &assoc_stop);
290
291 torture_fail(tctx, "We are not a valid pull partner for the server");
292 }
293 CHECK_STATUS(tctx, status, NT_STATUS_OK);
294
295 torture_comment(tctx, "Found %d replication partners\n", pull_table.out.num_partners);
296
297 for (i=0;i<pull_table.out.num_partners;i++) {
298 struct wrepl_wins_owner *partner = &pull_table.out.partners[i];
299 torture_comment(tctx, "%s max_version=%6llu min_version=%6llu type=%d\n",
300 partner->address,
301 (long long)partner->max_version,
302 (long long)partner->min_version,
303 partner->type);
304
305 pull_names.in.assoc_ctx = associate.out.assoc_ctx;
306 pull_names.in.partner = *partner;
307
308 status = wrepl_pull_names(wrepl_socket, tctx, &pull_names);
309 CHECK_STATUS(tctx, status, NT_STATUS_OK);
310
311 torture_comment(tctx, "Received %d names\n", pull_names.out.num_names);
312
313 for (j=0;j<pull_names.out.num_names;j++) {
314 display_entry(tctx, &pull_names.out.names[j]);
315 }
316 }
317
318 torture_comment(tctx, "Close wrepl connections\n");
319 talloc_free(wrepl_socket);
320 return true;
321 }
322
323 struct test_wrepl_conflict_conn {
324 const char *address;
325 struct wrepl_socket *pull;
326 uint32_t pull_assoc;
327
328 #define TEST_OWNER_A_ADDRESS "127.65.65.1"
329 #define TEST_ADDRESS_A_PREFIX "127.0.65"
330 #define TEST_OWNER_B_ADDRESS "127.66.66.1"
331 #define TEST_ADDRESS_B_PREFIX "127.0.66"
332 #define TEST_OWNER_X_ADDRESS "127.88.88.1"
333 #define TEST_ADDRESS_X_PREFIX "127.0.88"
334
335 struct wrepl_wins_owner a, b, c, x;
336
337 struct socket_address *myaddr;
338 struct socket_address *myaddr2;
339 struct nbt_name_socket *nbtsock;
340 struct nbt_name_socket *nbtsock2;
341
342 struct nbt_name_socket *nbtsock_srv;
343 struct nbt_name_socket *nbtsock_srv2;
344
345 uint32_t addresses_best_num;
346 struct wrepl_ip *addresses_best;
347
348 uint32_t addresses_best2_num;
349 struct wrepl_ip *addresses_best2;
350
351 uint32_t addresses_all_num;
352 struct wrepl_ip *addresses_all;
353
354 uint32_t addresses_mhomed_num;
355 struct wrepl_ip *addresses_mhomed;
356 };
357
358 static const struct wrepl_ip addresses_A_1[] = {
359 {
360 .owner = TEST_OWNER_A_ADDRESS,
361 .ip = TEST_ADDRESS_A_PREFIX".1"
362 }
363 };
364 static const struct wrepl_ip addresses_A_2[] = {
365 {
366 .owner = TEST_OWNER_A_ADDRESS,
367 .ip = TEST_ADDRESS_A_PREFIX".2"
368 }
369 };
370 static const struct wrepl_ip addresses_A_3_4[] = {
371 {
372 .owner = TEST_OWNER_A_ADDRESS,
373 .ip = TEST_ADDRESS_A_PREFIX".3"
374 },
375 {
376 .owner = TEST_OWNER_A_ADDRESS,
377 .ip = TEST_ADDRESS_A_PREFIX".4"
378 }
379 };
380 static const struct wrepl_ip addresses_A_3_4_X_3_4[] = {
381 {
382 .owner = TEST_OWNER_A_ADDRESS,
383 .ip = TEST_ADDRESS_A_PREFIX".3"
384 },
385 {
386 .owner = TEST_OWNER_A_ADDRESS,
387 .ip = TEST_ADDRESS_A_PREFIX".4"
388 },
389 {
390 .owner = TEST_OWNER_X_ADDRESS,
391 .ip = TEST_ADDRESS_X_PREFIX".3"
392 },
393 {
394 .owner = TEST_OWNER_X_ADDRESS,
395 .ip = TEST_ADDRESS_X_PREFIX".4"
396 }
397 };
398 static const struct wrepl_ip addresses_A_3_4_B_3_4[] = {
399 {
400 .owner = TEST_OWNER_A_ADDRESS,
401 .ip = TEST_ADDRESS_A_PREFIX".3"
402 },
403 {
404 .owner = TEST_OWNER_A_ADDRESS,
405 .ip = TEST_ADDRESS_A_PREFIX".4"
406 },
407 {
408 .owner = TEST_OWNER_B_ADDRESS,
409 .ip = TEST_ADDRESS_B_PREFIX".3"
410 },
411 {
412 .owner = TEST_OWNER_B_ADDRESS,
413 .ip = TEST_ADDRESS_B_PREFIX".4"
414 }
415 };
416 static const struct wrepl_ip addresses_A_3_4_OWNER_B[] = {
417 {
418 .owner = TEST_OWNER_B_ADDRESS,
419 .ip = TEST_ADDRESS_A_PREFIX".3"
420 },
421 {
422 .owner = TEST_OWNER_B_ADDRESS,
423 .ip = TEST_ADDRESS_A_PREFIX".4"
424 }
425 };
426 static const struct wrepl_ip addresses_A_3_4_X_3_4_OWNER_B[] = {
427 {
428 .owner = TEST_OWNER_B_ADDRESS,
429 .ip = TEST_ADDRESS_A_PREFIX".3"
430 },
431 {
432 .owner = TEST_OWNER_B_ADDRESS,
433 .ip = TEST_ADDRESS_A_PREFIX".4"
434 },
435 {
436 .owner = TEST_OWNER_B_ADDRESS,
437 .ip = TEST_ADDRESS_X_PREFIX".3"
438 },
439 {
440 .owner = TEST_OWNER_B_ADDRESS,
441 .ip = TEST_ADDRESS_X_PREFIX".4"
442 }
443 };
444 /*
445 static const struct wrepl_ip addresses_A_3_4_X_1_2[] = {
446 {
447 .owner = TEST_OWNER_A_ADDRESS,
448 .ip = TEST_ADDRESS_A_PREFIX".3"
449 },
450 {
451 .owner = TEST_OWNER_A_ADDRESS,
452 .ip = TEST_ADDRESS_A_PREFIX".4"
453 },
454 {
455 .owner = TEST_OWNER_X_ADDRESS,
456 .ip = TEST_ADDRESS_X_PREFIX".1"
457 },
458 {
459 .owner = TEST_OWNER_X_ADDRESS,
460 .ip = TEST_ADDRESS_X_PREFIX".2"
461 }
462 };
463 */
464 static const struct wrepl_ip addresses_B_1[] = {
465 {
466 .owner = TEST_OWNER_B_ADDRESS,
467 .ip = TEST_ADDRESS_B_PREFIX".1"
468 }
469 };
470 /*
471 static const struct wrepl_ip addresses_B_2[] = {
472 {
473 .owner = TEST_OWNER_B_ADDRESS,
474 .ip = TEST_ADDRESS_B_PREFIX".2"
475 }
476 };
477 */
478 static const struct wrepl_ip addresses_B_3_4[] = {
479 {
480 .owner = TEST_OWNER_B_ADDRESS,
481 .ip = TEST_ADDRESS_B_PREFIX".3"
482 },
483 {
484 .owner = TEST_OWNER_B_ADDRESS,
485 .ip = TEST_ADDRESS_B_PREFIX".4"
486 }
487 };
488 static const struct wrepl_ip addresses_B_3_4_X_3_4[] = {
489 {
490 .owner = TEST_OWNER_B_ADDRESS,
491 .ip = TEST_ADDRESS_B_PREFIX".3"
492 },
493 {
494 .owner = TEST_OWNER_B_ADDRESS,
495 .ip = TEST_ADDRESS_B_PREFIX".4"
496 },
497 {
498 .owner = TEST_OWNER_X_ADDRESS,
499 .ip = TEST_ADDRESS_X_PREFIX".3"
500 },
501 {
502 .owner = TEST_OWNER_X_ADDRESS,
503 .ip = TEST_ADDRESS_X_PREFIX".4"
504 }
505 };
506 static const struct wrepl_ip addresses_B_3_4_X_1_2[] = {
507 {
508 .owner = TEST_OWNER_B_ADDRESS,
509 .ip = TEST_ADDRESS_B_PREFIX".3"
510 },
511 {
512 .owner = TEST_OWNER_B_ADDRESS,
513 .ip = TEST_ADDRESS_B_PREFIX".4"
514 },
515 {
516 .owner = TEST_OWNER_X_ADDRESS,
517 .ip = TEST_ADDRESS_X_PREFIX".1"
518 },
519 {
520 .owner = TEST_OWNER_X_ADDRESS,
521 .ip = TEST_ADDRESS_X_PREFIX".2"
522 }
523 };
524
525 /*
526 static const struct wrepl_ip addresses_X_1_2[] = {
527 {
528 .owner = TEST_OWNER_X_ADDRESS,
529 .ip = TEST_ADDRESS_X_PREFIX".1"
530 },
531 {
532 .owner = TEST_OWNER_X_ADDRESS,
533 .ip = TEST_ADDRESS_X_PREFIX".2"
534 }
535 };
536 */
537
538 static const struct wrepl_ip addresses_X_3_4[] = {
539 {
540 .owner = TEST_OWNER_X_ADDRESS,
541 .ip = TEST_ADDRESS_X_PREFIX".3"
542 },
543 {
544 .owner = TEST_OWNER_X_ADDRESS,
545 .ip = TEST_ADDRESS_X_PREFIX".4"
546 }
547 };
548
549 static struct test_wrepl_conflict_conn *test_create_conflict_ctx(
550 struct torture_context *tctx, const char *address)
551 {
552 struct test_wrepl_conflict_conn *ctx;
553 struct wrepl_associate associate;
554 struct wrepl_pull_table pull_table;
555 struct socket_address *nbt_srv_addr;
556 NTSTATUS status;
557 uint32_t i;
558 uint32_t num_ifaces;
559 struct interface *ifaces;
560
561 ctx = talloc_zero(tctx, struct test_wrepl_conflict_conn);
562 if (!ctx) return NULL;
563
564 ctx->address = address;
565 ctx->pull = wrepl_socket_init(ctx, tctx->ev);
566 if (!ctx->pull) return NULL;
567
568 torture_comment(tctx, "Setup wrepl conflict pull connection\n");
569 status = wrepl_connect(ctx->pull, wrepl_best_ip(tctx->lp_ctx, ctx->address), ctx->address);
570 if (!NT_STATUS_IS_OK(status)) return NULL;
571
572 status = wrepl_associate(ctx->pull, &associate);
573 if (!NT_STATUS_IS_OK(status)) return NULL;
574
575 ctx->pull_assoc = associate.out.assoc_ctx;
576
577 ctx->a.address = TEST_OWNER_A_ADDRESS;
578 ctx->a.max_version = 0;
579 ctx->a.min_version = 0;
580 ctx->a.type = 1;
581
582 ctx->b.address = TEST_OWNER_B_ADDRESS;
583 ctx->b.max_version = 0;
584 ctx->b.min_version = 0;
585 ctx->b.type = 1;
586
587 ctx->x.address = TEST_OWNER_X_ADDRESS;
588 ctx->x.max_version = 0;
589 ctx->x.min_version = 0;
590 ctx->x.type = 1;
591
592 ctx->c.address = address;
593 ctx->c.max_version = 0;
594 ctx->c.min_version = 0;
595 ctx->c.type = 1;
596
597 pull_table.in.assoc_ctx = ctx->pull_assoc;
598 status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table);
599 if (!NT_STATUS_IS_OK(status)) return NULL;
600
601 for (i=0; i < pull_table.out.num_partners; i++) {
602 if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) {
603 ctx->a.max_version = pull_table.out.partners[i].max_version;
604 ctx->a.min_version = pull_table.out.partners[i].min_version;
605 }
606 if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) {
607 ctx->b.max_version = pull_table.out.partners[i].max_version;
608 ctx->b.min_version = pull_table.out.partners[i].min_version;
609 }
610 if (strcmp(TEST_OWNER_X_ADDRESS,pull_table.out.partners[i].address)==0) {
611 ctx->x.max_version = pull_table.out.partners[i].max_version;
612 ctx->x.min_version = pull_table.out.partners[i].min_version;
613 }
614 if (strcmp(address,pull_table.out.partners[i].address)==0) {
615 ctx->c.max_version = pull_table.out.partners[i].max_version;
616 ctx->c.min_version = pull_table.out.partners[i].min_version;
617 }
618 }
619
620 talloc_free(pull_table.out.partners);
621
622 ctx->nbtsock = nbt_name_socket_init(ctx, tctx->ev);
623 if (!ctx->nbtsock) return NULL;
624
625 load_interface_list(tctx, tctx->lp_ctx, &ifaces);
626
627 ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_list_best_ip(ifaces, address), 0);
628 if (!ctx->myaddr) return NULL;
629
630 for (i = 0; i < iface_list_count(ifaces); i++) {
631 if (!iface_list_n_is_v4(ifaces, i)) continue;
632 if (strcmp(ctx->myaddr->addr, iface_list_n_ip(ifaces, i)) == 0) continue;
633 ctx->myaddr2 = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_list_n_ip(ifaces, i), 0);
634 if (!ctx->myaddr2) return NULL;
635 break;
636 }
637
638 status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0);
639 if (!NT_STATUS_IS_OK(status)) return NULL;
640
641 ctx->nbtsock_srv = nbt_name_socket_init(ctx, tctx->ev);
642 if (!ctx->nbtsock_srv) return NULL;
643
644 /* Make a port 137 version of ctx->myaddr */
645 nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lpcfg_nbt_port(tctx->lp_ctx));
646 if (!nbt_srv_addr) return NULL;
647
648 /* And if possible, bind to it. This won't work unless we are root or in socketwrapper */
649 status = socket_listen(ctx->nbtsock_srv->sock, nbt_srv_addr, 0, 0);
650 talloc_free(nbt_srv_addr);
651 if (!NT_STATUS_IS_OK(status)) {
652 /* this isn't fatal */
653 talloc_free(ctx->nbtsock_srv);
654 ctx->nbtsock_srv = NULL;
655 }
656
657 if (ctx->myaddr2 && ctx->nbtsock_srv) {
658 ctx->nbtsock2 = nbt_name_socket_init(ctx, tctx->ev);
659 if (!ctx->nbtsock2) return NULL;
660
661 status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0);
662 if (!NT_STATUS_IS_OK(status)) return NULL;
663
664 ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx);
665 if (!ctx->nbtsock_srv2) return NULL;
666
667 /* Make a port 137 version of ctx->myaddr2 */
668 nbt_srv_addr = socket_address_from_strings(tctx,
669 ctx->nbtsock_srv->sock->backend_name,
670 ctx->myaddr2->addr,
671 lpcfg_nbt_port(tctx->lp_ctx));
672 if (!nbt_srv_addr) return NULL;
673
674 /* And if possible, bind to it. This won't work unless we are root or in socketwrapper */
675 status = socket_listen(ctx->nbtsock_srv2->sock, ctx->myaddr2, 0, 0);
676 talloc_free(nbt_srv_addr);
677 if (!NT_STATUS_IS_OK(status)) {
678 /* this isn't fatal */
679 talloc_free(ctx->nbtsock_srv2);
680 ctx->nbtsock_srv2 = NULL;
681 }
682 }
683
684 ctx->addresses_best_num = 1;
685 ctx->addresses_best = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best_num);
686 if (!ctx->addresses_best) return NULL;
687 ctx->addresses_best[0].owner = ctx->b.address;
688 ctx->addresses_best[0].ip = ctx->myaddr->addr;
689
690
691 num_ifaces = iface_list_count(ifaces);
692 ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, num_ifaces);
693 ctx->addresses_all_num = 0;
694 if (!ctx->addresses_all) return NULL;
695 for (i=0; i < num_ifaces; i++) {
696 if (!iface_list_n_is_v4(ifaces, i)) continue;
697 ctx->addresses_all[i].owner = ctx->b.address;
698 ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_list_n_ip(ifaces, i));
699 ctx->addresses_all_num++;
700 if (!ctx->addresses_all[i].ip) return NULL;
701 }
702
703 if (ctx->nbtsock_srv2) {
704 ctx->addresses_best2_num = 1;
705 ctx->addresses_best2 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best2_num);
706 if (!ctx->addresses_best2) return NULL;
707 ctx->addresses_best2[0].owner = ctx->b.address;
708 ctx->addresses_best2[0].ip = ctx->myaddr2->addr;
709
710 ctx->addresses_mhomed_num = 2;
711 ctx->addresses_mhomed = talloc_array(ctx, struct wrepl_ip, ctx->addresses_mhomed_num);
712 if (!ctx->addresses_mhomed) return NULL;
713 ctx->addresses_mhomed[0].owner = ctx->b.address;
714 ctx->addresses_mhomed[0].ip = ctx->myaddr->addr;
715 ctx->addresses_mhomed[1].owner = ctx->b.address;
716 ctx->addresses_mhomed[1].ip = ctx->myaddr2->addr;
717 }
718
719 return ctx;
720 }
721
722 static bool test_wrepl_update_one(struct torture_context *tctx,
723 struct test_wrepl_conflict_conn *ctx,
724 const struct wrepl_wins_owner *owner,
725 const struct wrepl_wins_name *name)
726 {
727 struct wrepl_socket *wrepl_socket;
728 struct wrepl_associate associate;
729 struct wrepl_packet update_packet, repl_send;
730 struct wrepl_table *update;
731 struct wrepl_wins_owner wrepl_wins_owners[1];
732 struct wrepl_packet *repl_recv;
733 struct wrepl_send_reply *send_reply;
734 struct wrepl_wins_name wrepl_wins_names[1];
735 uint32_t assoc_ctx;
736 NTSTATUS status;
737
738 wrepl_socket = wrepl_socket_init(ctx, tctx->ev);
739
740 status = wrepl_connect(wrepl_socket, wrepl_best_ip(tctx->lp_ctx, ctx->address), ctx->address);
741 CHECK_STATUS(tctx, status, NT_STATUS_OK);
742
743 status = wrepl_associate(wrepl_socket, &associate);
744 CHECK_STATUS(tctx, status, NT_STATUS_OK);
745 assoc_ctx = associate.out.assoc_ctx;
746
747 /* now send a WREPL_REPL_UPDATE message */
748 ZERO_STRUCT(update_packet);
749 update_packet.opcode = WREPL_OPCODE_BITS;
750 update_packet.assoc_ctx = assoc_ctx;
751 update_packet.mess_type = WREPL_REPLICATION;
752 update_packet.message.replication.command = WREPL_REPL_UPDATE;
753 update = &update_packet.message.replication.info.table;
754
755 update->partner_count = ARRAY_SIZE(wrepl_wins_owners);
756 update->partners = wrepl_wins_owners;
757 update->initiator = "0.0.0.0";
758
759 wrepl_wins_owners[0] = *owner;
760
761 status = wrepl_request(wrepl_socket, wrepl_socket,
762 &update_packet, &repl_recv);
763 CHECK_STATUS(tctx, status, NT_STATUS_OK);
764 CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_REPLICATION);
765 CHECK_VALUE(tctx, repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST);
766
767 ZERO_STRUCT(repl_send);
768 repl_send.opcode = WREPL_OPCODE_BITS;
769 repl_send.assoc_ctx = assoc_ctx;
770 repl_send.mess_type = WREPL_REPLICATION;
771 repl_send.message.replication.command = WREPL_REPL_SEND_REPLY;
772 send_reply = &repl_send.message.replication.info.reply;
773
774 send_reply->num_names = ARRAY_SIZE(wrepl_wins_names);
775 send_reply->names = wrepl_wins_names;
776
777 wrepl_wins_names[0] = *name;
778
779 status = wrepl_request(wrepl_socket, wrepl_socket,
780 &repl_send, &repl_recv);
781 CHECK_STATUS(tctx, status, NT_STATUS_OK);
782 CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_STOP_ASSOCIATION);
783 CHECK_VALUE(tctx, repl_recv->message.stop.reason, 0);
784
785 talloc_free(wrepl_socket);
786 return true;
787 }
788
789 static bool test_wrepl_is_applied(struct torture_context *tctx,
790 struct test_wrepl_conflict_conn *ctx,
791 const struct wrepl_wins_owner *owner,
792 const struct wrepl_wins_name *name,
793 bool expected)
794 {
795 NTSTATUS status;
796 struct wrepl_pull_names pull_names;
797 struct wrepl_name *names;
798
799 pull_names.in.assoc_ctx = ctx->pull_assoc;
800 pull_names.in.partner = *owner;
801 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
802
803 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
804 CHECK_STATUS(tctx, status, NT_STATUS_OK);
805 torture_assert(tctx, pull_names.out.num_names == (expected?1:0),
806 talloc_asprintf(tctx, "Invalid number of records returned - expected %d got %d", expected, pull_names.out.num_names));
807
808 names = pull_names.out.names;
809
810 if (expected) {
811 uint32_t flags = WREPL_NAME_FLAGS(names[0].type,
812 names[0].state,
813 names[0].node,
814 names[0].is_static);
815 char *expected_scope = NULL;
816 CHECK_VALUE(tctx, names[0].name.type, name->name->type);
817 CHECK_VALUE_STRING(tctx, names[0].name.name, name->name->name);
818
819 if (names[0].name.scope) {
820 expected_scope = talloc_strndup(tctx,
821 name->name->scope,
822 237);
823 }
824 CHECK_VALUE_STRING(tctx, names[0].name.scope, expected_scope);
825 CHECK_VALUE(tctx, flags, name->flags);
826 CHECK_VALUE_UINT64(tctx, names[0].version_id, name->id);
827
828 if (flags & 2) {
829 CHECK_VALUE(tctx, names[0].num_addresses,
830 name->addresses.addresses.num_ips);
831 } else {
832 CHECK_VALUE(tctx, names[0].num_addresses, 1);
833 CHECK_VALUE_STRING(tctx, names[0].addresses[0].address,
834 name->addresses.ip);
835 }
836 }
837 talloc_free(pull_names.out.names);
838 return true;
839 }
840
841 static bool test_wrepl_mhomed_merged(struct torture_context *tctx,
842 struct test_wrepl_conflict_conn *ctx,
843 const struct wrepl_wins_owner *owner1,
844 uint32_t num_ips1, const struct wrepl_ip *ips1,
845 const struct wrepl_wins_owner *owner2,
846 uint32_t num_ips2, const struct wrepl_ip *ips2,
847 const struct wrepl_wins_name *name2)
848 {
849 NTSTATUS status;
850 struct wrepl_pull_names pull_names;
851 struct wrepl_name *names;
852 uint32_t flags;
853 uint32_t i, j;
854 uint32_t num_ips = num_ips1 + num_ips2;
855
856 for (i = 0; i < num_ips2; i++) {
857 for (j = 0; j < num_ips1; j++) {
858 if (strcmp(ips2[i].ip,ips1[j].ip) == 0) {
859 num_ips--;
860 break;
861 }
862 }
863 }
864
865 pull_names.in.assoc_ctx = ctx->pull_assoc;
866 pull_names.in.partner = *owner2;
867 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
868
869 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
870 CHECK_STATUS(tctx, status, NT_STATUS_OK);
871 CHECK_VALUE(tctx, pull_names.out.num_names, 1);
872
873 names = pull_names.out.names;
874
875 flags = WREPL_NAME_FLAGS(names[0].type,
876 names[0].state,
877 names[0].node,
878 names[0].is_static);
879 CHECK_VALUE(tctx, names[0].name.type, name2->name->type);
880 CHECK_VALUE_STRING(tctx, names[0].name.name, name2->name->name);
881 CHECK_VALUE_STRING(tctx, names[0].name.scope, name2->name->scope);
882 CHECK_VALUE(tctx, flags, name2->flags | WREPL_TYPE_MHOMED);
883 CHECK_VALUE_UINT64(tctx, names[0].version_id, name2->id);
884
885 CHECK_VALUE(tctx, names[0].num_addresses, num_ips);
886
887 for (i = 0; i < names[0].num_addresses; i++) {
888 const char *addr = names[0].addresses[i].address;
889 const char *owner = names[0].addresses[i].owner;
890 bool found = false;
891
892 for (j = 0; j < num_ips2; j++) {
893 if (strcmp(addr, ips2[j].ip) == 0) {
894 found = true;
895 CHECK_VALUE_STRING(tctx, owner, owner2->address);
896 break;
897 }
898 }
899
900 if (found) continue;
901
902 for (j = 0; j < num_ips1; j++) {
903 if (strcmp(addr, ips1[j].ip) == 0) {
904 found = true;
905 CHECK_VALUE_STRING(tctx, owner, owner1->address);
906 break;
907 }
908 }
909
910 if (found) continue;
911
912 CHECK_VALUE_STRING(tctx, addr, "not found in address list");
913 }
914 talloc_free(pull_names.out.names);
915 return true;
916 }
917
918 static bool test_wrepl_sgroup_merged(struct torture_context *tctx,
919 struct test_wrepl_conflict_conn *ctx,
920 struct wrepl_wins_owner *merge_owner,
921 struct wrepl_wins_owner *owner1,
922 uint32_t num_ips1, const struct wrepl_ip *ips1,
923 struct wrepl_wins_owner *owner2,
924 uint32_t num_ips2, const struct wrepl_ip *ips2,
925 const struct wrepl_wins_name *name2)
926 {
927 NTSTATUS status;
928 struct wrepl_pull_names pull_names;
929 struct wrepl_name *names;
930 struct wrepl_name *name = NULL;
931 uint32_t flags;
932 uint32_t i, j;
933 uint32_t num_ips = num_ips1 + num_ips2;
934
935 if (!merge_owner) {
936 merge_owner = &ctx->c;
937 }
938
939 for (i = 0; i < num_ips1; i++) {
940 if (owner1 != &ctx->c && strcmp(ips1[i].owner,owner2->address) == 0) {
941 num_ips--;
942 continue;
943 }
944 for (j = 0; j < num_ips2; j++) {
945 if (strcmp(ips1[i].ip,ips2[j].ip) == 0) {
946 num_ips--;
947 break;
948 }
949 }
950 }
951
952
953 pull_names.in.assoc_ctx = ctx->pull_assoc;
954 pull_names.in.partner = *merge_owner;
955 pull_names.in.partner.min_version = pull_names.in.partner.max_version;
956 pull_names.in.partner.max_version = 0;
957
958 status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names);
959 CHECK_STATUS(tctx, status, NT_STATUS_OK);
960
961 names = pull_names.out.names;
962
963 for (i = 0; i < pull_names.out.num_names; i++) {
964 if (names[i].name.type != name2->name->type) continue;
965 if (!names[i].name.name) continue;
966 if (strcmp(names[i].name.name, name2->name->name) != 0) continue;
967 if (names[i].name.scope) continue;
968
969 name = &names[i];
970 }
971
972 if (pull_names.out.num_names > 0) {
973 merge_owner->max_version = names[pull_names.out.num_names-1].version_id;
974 }
975
976 if (!name) {
977 torture_comment(tctx, "%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name));
978 return false;
979 }
980
981 flags = WREPL_NAME_FLAGS(name->type,
982 name->state,
983 name->node,
984 name->is_static);
985 CHECK_VALUE(tctx, name->name.type, name2->name->type);
986 CHECK_VALUE_STRING(tctx, name->name.name, name2->name->name);
987 CHECK_VALUE_STRING(tctx, name->name.scope, name2->name->scope);
988 CHECK_VALUE(tctx, flags, name2->flags);
989
990 CHECK_VALUE(tctx, name->num_addresses, num_ips);
991
992 for (i = 0; i < name->num_addresses; i++) {
993 const char *addr = name->addresses[i].address;
994 const char *owner = name->addresses[i].owner;
995 bool found = false;
996
997 for (j = 0; j < num_ips2; j++) {
998 if (strcmp(addr, ips2[j].ip) == 0) {
999 found = true;
1000 CHECK_VALUE_STRING(tctx, owner, ips2[j].owner);
1001 break;
1002 }
1003 }
1004
1005 if (found) continue;
1006
1007 for (j = 0; j < num_ips1; j++) {
1008 if (strcmp(addr, ips1[j].ip) == 0) {
1009 found = true;
1010 if (owner1 == &ctx->c) {
1011 CHECK_VALUE_STRING(tctx, owner, owner1->address);
1012 } else {
1013 CHECK_VALUE_STRING(tctx, owner, ips1[j].owner);
1014 }
1015 break;
1016 }
1017 }
1018
1019 if (found) continue;
1020
1021 CHECK_VALUE_STRING(tctx, addr, "not found in address list");
1022 }
1023 talloc_free(pull_names.out.names);
1024 return true;
1025 }
1026
1027 static char *test_nbt_winsrepl_scope_string(TALLOC_CTX *mem_ctx, uint8_t count)
1028 {
1029 char *res;
1030 uint8_t i;
1031
1032 res = talloc_array(mem_ctx, char, count+1);
1033 if (res == NULL) {
1034 return NULL;
1035 }
1036
1037 for (i=0; i < count; i++) {
1038 res[i] = '0' + (i%10);
1039 }
1040
1041 res[count] = '\0';
1042
1043 talloc_set_name_const(res, res);
1044
1045 return res;
1046 }
1047
1048 static bool test_conflict_same_owner(struct torture_context *tctx,
1049 struct test_wrepl_conflict_conn *ctx)
1050 {
1051 bool ret = true;
1052 struct wrepl_wins_name wins_name1;
1053 struct wrepl_wins_name wins_name2;
1054 struct wrepl_wins_name *wins_name_tmp;
1055 struct wrepl_wins_name *wins_name_last;
1056 struct wrepl_wins_name *wins_name_cur;
1057 uint32_t i,j;
1058 struct nbt_name names[] = {
1059 _NBT_NAME("_SAME_OWNER_A", 0x00, NULL),
1060 _NBT_NAME("_SAME_OWNER_A", 0x00,
1061 test_nbt_winsrepl_scope_string(tctx, 1)),
1062 _NBT_NAME("_SAME_OWNER_A", 0x00,
1063 test_nbt_winsrepl_scope_string(tctx, 2)),
1064 _NBT_NAME("_SAME_OWNER_A", 0x00,
1065 test_nbt_winsrepl_scope_string(tctx, 3)),
1066 _NBT_NAME("_SAME_OWNER_A", 0x00,
1067 test_nbt_winsrepl_scope_string(tctx, 4)),
1068 _NBT_NAME("_SAME_OWNER_A", 0x00,
1069 test_nbt_winsrepl_scope_string(tctx, 5)),
1070 _NBT_NAME("_SAME_OWNER_A", 0x00,
1071 test_nbt_winsrepl_scope_string(tctx, 6)),
1072 _NBT_NAME("_SAME_OWNER_A", 0x00,
1073 test_nbt_winsrepl_scope_string(tctx, 7)),
1074 _NBT_NAME("_SAME_OWNER_A", 0x00,
1075 test_nbt_winsrepl_scope_string(tctx, 8)),
1076 _NBT_NAME("_SAME_OWNER_A", 0x00,
1077 test_nbt_winsrepl_scope_string(tctx, 9)),
1078 _NBT_NAME("_SAME_OWNER_A", 0x00,
1079 test_nbt_winsrepl_scope_string(tctx, 237)),
1080 _NBT_NAME("_SAME_OWNER_A", 0x00,
1081 test_nbt_winsrepl_scope_string(tctx, 238)),
1082 _NBT_NAME("_SAME_OWNER_A", 0x1C, NULL),
1083 };
1084 struct {
1085 enum wrepl_name_type type;
1086 enum wrepl_name_state state;
1087 enum wrepl_name_node node;
1088 bool is_static;
1089 uint32_t num_ips;
1090 const struct wrepl_ip *ips;
1091 } records[] = {
1092 {
1093 .type = WREPL_TYPE_GROUP,
1094 .state = WREPL_STATE_ACTIVE,
1095 .node = WREPL_NODE_B,
1096 .is_static = false,
1097 .num_ips = ARRAY_SIZE(addresses_A_1),
1098 .ips = addresses_A_1,
1099 },{
1100 .type = WREPL_TYPE_UNIQUE,
1101 .state = WREPL_STATE_ACTIVE,
1102 .node = WREPL_NODE_B,
1103 .is_static = false,
1104 .num_ips = ARRAY_SIZE(addresses_A_1),
1105 .ips = addresses_A_1,
1106 },{
1107 .type = WREPL_TYPE_UNIQUE,
1108 .state = WREPL_STATE_ACTIVE,
1109 .node = WREPL_NODE_B,
1110 .is_static = false,
1111 .num_ips = ARRAY_SIZE(addresses_A_2),
1112 .ips = addresses_A_2,
1113 },{
1114 .type = WREPL_TYPE_UNIQUE,
1115 .state = WREPL_STATE_ACTIVE,
1116 .node = WREPL_NODE_B,
1117 .is_static = true,
1118 .num_ips = ARRAY_SIZE(addresses_A_1),
1119 .ips = addresses_A_1,
1120 },{
1121 .type = WREPL_TYPE_UNIQUE,
1122 .state = WREPL_STATE_ACTIVE,
1123 .node = WREPL_NODE_B,
1124 .is_static = false,
1125 .num_ips = ARRAY_SIZE(addresses_A_2),
1126 .ips = addresses_A_2,
1127 },{
1128 .type = WREPL_TYPE_SGROUP,
1129 .state = WREPL_STATE_TOMBSTONE,
1130 .node = WREPL_NODE_B,
1131 .is_static = false,
1132 .num_ips = ARRAY_SIZE(addresses_A_2),
1133 .ips = addresses_A_2,
1134 },{
1135 .type = WREPL_TYPE_MHOMED,
1136 .state = WREPL_STATE_TOMBSTONE,
1137 .node = WREPL_NODE_B,
1138 .is_static = false,
1139 .num_ips = ARRAY_SIZE(addresses_A_1),
1140 .ips = addresses_A_1,
1141 },{
1142 .type = WREPL_TYPE_MHOMED,
1143 .state = WREPL_STATE_RELEASED,
1144 .node = WREPL_NODE_B,
1145 .is_static = false,
1146 .num_ips = ARRAY_SIZE(addresses_A_2),
1147 .ips = addresses_A_2,
1148 },{
1149 .type = WREPL_TYPE_SGROUP,
1150 .state = WREPL_STATE_ACTIVE,
1151 .node = WREPL_NODE_B,
1152 .is_static = false,
1153 .num_ips = ARRAY_SIZE(addresses_A_1),
1154 .ips = addresses_A_1,
1155 },{
1156 .type = WREPL_TYPE_SGROUP,
1157 .state = WREPL_STATE_ACTIVE,
1158 .node = WREPL_NODE_B,
1159 .is_static = false,
1160 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1161 .ips = addresses_A_3_4,
1162 },{
1163 .type = WREPL_TYPE_SGROUP,
1164 .state = WREPL_STATE_TOMBSTONE,
1165 .node = WREPL_NODE_B,
1166 .is_static = false,
1167 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1168 .ips = addresses_B_3_4,
1169 },{
1170 /* the last one should always be a unique,tombstone record! */
1171 .type = WREPL_TYPE_UNIQUE,
1172 .state = WREPL_STATE_TOMBSTONE,
1173 .node = WREPL_NODE_B,
1174 .is_static = false,
1175 .num_ips = ARRAY_SIZE(addresses_A_1),
1176 .ips = addresses_A_1,
1177 }
1178 };
1179
1180 wins_name_tmp = NULL;
1181 wins_name_last = &wins_name2;
1182 wins_name_cur = &wins_name1;
1183
1184 for (j=0; ret && j < ARRAY_SIZE(names); j++) {
1185 torture_comment(tctx, "Test Replica Conflicts with same owner[%s] for %s\n",
1186 nbt_name_string(ctx, &names[j]), ctx->a.address);
1187
1188 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
1189 wins_name_tmp = wins_name_last;
1190 wins_name_last = wins_name_cur;
1191 wins_name_cur = wins_name_tmp;
1192
1193 if (i > 0) {
1194 torture_comment(tctx, "%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n",
1195 wrepl_name_type_string(records[i-1].type),
1196 wrepl_name_state_string(records[i-1].state),
1197 (records[i-1].is_static?",static":""),
1198 wrepl_name_type_string(records[i].type),
1199 wrepl_name_state_string(records[i].state),
1200 (records[i].is_static?",static":""),
1201 (records[i-1].ips==records[i].ips?"same":"different"),
1202 "REPLACE");
1203 }
1204
1205 wins_name_cur->name = &names[j];
1206 wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type,
1207 records[i].state,
1208 records[i].node,
1209 records[i].is_static);
1210 wins_name_cur->id = ++ctx->a.max_version;
1211 if (wins_name_cur->flags & 2) {
1212 wins_name_cur->addresses.addresses.num_ips = records[i].num_ips;
1213 wins_name_cur->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
1214 records[i].ips);
1215 } else {
1216 wins_name_cur->addresses.ip = records[i].ips[0].ip;
1217 }
1218 wins_name_cur->unknown = "255.255.255.255";
1219
1220 ret &= test_wrepl_update_one(tctx, ctx, &ctx->a,wins_name_cur);
1221 if (records[i].state == WREPL_STATE_RELEASED) {
1222 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_last, false);
1223 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, false);
1224 } else {
1225 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, true);
1226 }
1227
1228 /* the first one is a cleanup run */
1229 if (!ret && i == 0) ret = true;
1230
1231 if (!ret) {
1232 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, __location__);
1233 return ret;
1234 }
1235 }
1236 }
1237 return ret;
1238 }
1239
1240 static bool test_conflict_different_owner(struct torture_context *tctx,
1241 struct test_wrepl_conflict_conn *ctx)
1242 {
1243 bool ret = true;
1244 struct wrepl_wins_name wins_name1 = {
1245 .flags = 0,
1246 };
1247 struct wrepl_wins_name wins_name2 = {
1248 .flags = 0,
1249 };
1250 struct wrepl_wins_name *wins_name_r1;
1251 struct wrepl_wins_name *wins_name_r2;
1252 uint32_t i;
1253 struct {
1254 const char *line; /* just better debugging */
1255 struct nbt_name name;
1256 const char *comment;
1257 bool extra; /* not the worst case, this is an extra test */
1258 bool cleanup;
1259 struct {
1260 struct wrepl_wins_owner *owner;
1261 enum wrepl_name_type type;
1262 enum wrepl_name_state state;
1263 enum wrepl_name_node node;
1264 bool is_static;
1265 uint32_t num_ips;
1266 const struct wrepl_ip *ips;
1267 bool apply_expected;
1268 bool sgroup_merge;
1269 struct wrepl_wins_owner *merge_owner;
1270 bool sgroup_cleanup;
1271 } r1, r2;
1272 } records[] = {
1273 /*
1274 * NOTE: the first record and the last applied one
1275 * needs to be from the same owner,
1276 * to not conflict in the next smbtorture run!!!
1277 */
1278 {
1279 .line = __location__,
1280 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1281 .cleanup= true,
1282 .r1 = {
1283 .owner = &ctx->b,
1284 .type = WREPL_TYPE_UNIQUE,
1285 .state = WREPL_STATE_TOMBSTONE,
1286 .node = WREPL_NODE_B,
1287 .is_static = false,
1288 .num_ips = ARRAY_SIZE(addresses_B_1),
1289 .ips = addresses_B_1,
1290 .apply_expected = true /* ignored */
1291 },
1292 .r2 = {
1293 .owner = &ctx->a,
1294 .type = WREPL_TYPE_UNIQUE,
1295 .state = WREPL_STATE_TOMBSTONE,
1296 .node = WREPL_NODE_B,
1297 .is_static = false,
1298 .num_ips = ARRAY_SIZE(addresses_A_1),
1299 .ips = addresses_A_1,
1300 .apply_expected = true /* ignored */
1301 }
1302 },
1303
1304 /*
1305 * unique vs unique section
1306 */
1307 /*
1308 * unique,active vs. unique,active
1309 * => should be replaced
1310 */
1311 {
1312 .line = __location__,
1313 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1314 .r1 = {
1315 .owner = &ctx->a,
1316 .type = WREPL_TYPE_UNIQUE,
1317 .state = WREPL_STATE_ACTIVE,
1318 .node = WREPL_NODE_B,
1319 .is_static = false,
1320 .num_ips = ARRAY_SIZE(addresses_A_1),
1321 .ips = addresses_A_1,
1322 .apply_expected = true
1323 },
1324 .r2 = {
1325 .owner = &ctx->b,
1326 .type = WREPL_TYPE_UNIQUE,
1327 .state = WREPL_STATE_ACTIVE,
1328 .node = WREPL_NODE_B,
1329 .is_static = false,
1330 .num_ips = ARRAY_SIZE(addresses_B_1),
1331 .ips = addresses_B_1,
1332 .apply_expected = true
1333 }
1334 },
1335
1336 /*
1337 * unique,active vs. unique,tombstone
1338 * => should NOT be replaced
1339 */
1340 {
1341 .line = __location__,
1342 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1343 .r1 = {
1344 .owner = &ctx->b,
1345 .type = WREPL_TYPE_UNIQUE,
1346 .state = WREPL_STATE_ACTIVE,
1347 .node = WREPL_NODE_B,
1348 .is_static = false,
1349 .num_ips = ARRAY_SIZE(addresses_B_1),
1350 .ips = addresses_B_1,
1351 .apply_expected = true
1352 },
1353 .r2 = {
1354 .owner = &ctx->a,
1355 .type = WREPL_TYPE_UNIQUE,
1356 .state = WREPL_STATE_TOMBSTONE,
1357 .node = WREPL_NODE_B,
1358 .is_static = false,
1359 .num_ips = ARRAY_SIZE(addresses_B_1),
1360 .ips = addresses_B_1,
1361 .apply_expected = false
1362 }
1363 },
1364
1365 /*
1366 * unique,released vs. unique,active
1367 * => should be replaced
1368 */
1369 {
1370 .line = __location__,
1371 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1372 .r1 = {
1373 .owner = &ctx->b,
1374 .type = WREPL_TYPE_UNIQUE,
1375 .state = WREPL_STATE_RELEASED,
1376 .node = WREPL_NODE_B,
1377 .is_static = false,
1378 .num_ips = ARRAY_SIZE(addresses_B_1),
1379 .ips = addresses_B_1,
1380 .apply_expected = false
1381 },
1382 .r2 = {
1383 .owner = &ctx->a,
1384 .type = WREPL_TYPE_UNIQUE,
1385 .state = WREPL_STATE_ACTIVE,
1386 .node = WREPL_NODE_B,
1387 .is_static = false,
1388 .num_ips = ARRAY_SIZE(addresses_A_1),
1389 .ips = addresses_A_1,
1390 .apply_expected = true
1391 }
1392 },
1393
1394 /*
1395 * unique,released vs. unique,tombstone
1396 * => should be replaced
1397 */
1398 {
1399 .line = __location__,
1400 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1401 .r1 = {
1402 .owner = &ctx->a,
1403 .type = WREPL_TYPE_UNIQUE,
1404 .state = WREPL_STATE_RELEASED,
1405 .node = WREPL_NODE_B,
1406 .is_static = false,
1407 .num_ips = ARRAY_SIZE(addresses_A_1),
1408 .ips = addresses_A_1,
1409 .apply_expected = false
1410 },
1411 .r2 = {
1412 .owner = &ctx->b,
1413 .type = WREPL_TYPE_UNIQUE,
1414 .state = WREPL_STATE_TOMBSTONE,
1415 .node = WREPL_NODE_B,
1416 .is_static = false,
1417 .num_ips = ARRAY_SIZE(addresses_B_1),
1418 .ips = addresses_B_1,
1419 .apply_expected = true
1420 }
1421 },
1422
1423 /*
1424 * unique,tombstone vs. unique,active
1425 * => should be replaced
1426 */
1427 {
1428 .line = __location__,
1429 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1430 .r1 = {
1431 .owner = &ctx->b,
1432 .type = WREPL_TYPE_UNIQUE,
1433 .state = WREPL_STATE_TOMBSTONE,
1434 .node = WREPL_NODE_B,
1435 .is_static = false,
1436 .num_ips = ARRAY_SIZE(addresses_B_1),
1437 .ips = addresses_B_1,
1438 .apply_expected = true
1439 },
1440 .r2 = {
1441 .owner = &ctx->a,
1442 .type = WREPL_TYPE_UNIQUE,
1443 .state = WREPL_STATE_ACTIVE,
1444 .node = WREPL_NODE_B,
1445 .is_static = false,
1446 .num_ips = ARRAY_SIZE(addresses_A_1),
1447 .ips = addresses_A_1,
1448 .apply_expected = true
1449 }
1450 },
1451
1452 /*
1453 * unique,tombstone vs. unique,tombstone
1454 * => should be replaced
1455 */
1456 {
1457 .line = __location__,
1458 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1459 .r1 = {
1460 .owner = &ctx->a,
1461 .type = WREPL_TYPE_UNIQUE,
1462 .state = WREPL_STATE_TOMBSTONE,
1463 .node = WREPL_NODE_B,
1464 .is_static = false,
1465 .num_ips = ARRAY_SIZE(addresses_A_1),
1466 .ips = addresses_A_1,
1467 .apply_expected = true
1468 },
1469 .r2 = {
1470 .owner = &ctx->b,
1471 .type = WREPL_TYPE_UNIQUE,
1472 .state = WREPL_STATE_TOMBSTONE,
1473 .node = WREPL_NODE_B,
1474 .is_static = false,
1475 .num_ips = ARRAY_SIZE(addresses_B_1),
1476 .ips = addresses_B_1,
1477 .apply_expected = true
1478 }
1479 },
1480
1481
1482 /*
1483 * unique vs normal groups section,
1484 */
1485 /*
1486 * unique,active vs. group,active
1487 * => should be replaced
1488 */
1489 {
1490 .line = __location__,
1491 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1492 .r1 = {
1493 .owner = &ctx->b,
1494 .type = WREPL_TYPE_UNIQUE,
1495 .state = WREPL_STATE_ACTIVE,
1496 .node = WREPL_NODE_B,
1497 .is_static = false,
1498 .num_ips = ARRAY_SIZE(addresses_B_1),
1499 .ips = addresses_B_1,
1500 .apply_expected = true
1501 },
1502 .r2 = {
1503 .owner = &ctx->a,
1504 .type = WREPL_TYPE_GROUP,
1505 .state = WREPL_STATE_ACTIVE,
1506 .node = WREPL_NODE_B,
1507 .is_static = false,
1508 .num_ips = ARRAY_SIZE(addresses_A_1),
1509 .ips = addresses_A_1,
1510 .apply_expected = true
1511 }
1512 },
1513
1514 /*
1515 * unique,active vs. group,tombstone
1516 * => should NOT be replaced
1517 */
1518 {
1519 .line = __location__,
1520 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1521 .r1 = {
1522 .owner = &ctx->a,
1523 .type = WREPL_TYPE_UNIQUE,
1524 .state = WREPL_STATE_ACTIVE,
1525 .node = WREPL_NODE_B,
1526 .is_static = false,
1527 .num_ips = ARRAY_SIZE(addresses_A_1),
1528 .ips = addresses_A_1,
1529 .apply_expected = true
1530 },
1531 .r2 = {
1532 .owner = &ctx->b,
1533 .type = WREPL_TYPE_GROUP,
1534 .state = WREPL_STATE_TOMBSTONE,
1535 .node = WREPL_NODE_B,
1536 .is_static = false,
1537 .num_ips = ARRAY_SIZE(addresses_A_1),
1538 .ips = addresses_A_1,
1539 .apply_expected = false
1540 }
1541 },
1542
1543 /*
1544 * unique,released vs. group,active
1545 * => should be replaced
1546 */
1547 {
1548 .line = __location__,
1549 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1550 .r1 = {
1551 .owner = &ctx->a,
1552 .type = WREPL_TYPE_UNIQUE,
1553 .state = WREPL_STATE_RELEASED,
1554 .node = WREPL_NODE_B,
1555 .is_static = false,
1556 .num_ips = ARRAY_SIZE(addresses_A_1),
1557 .ips = addresses_A_1,
1558 .apply_expected = false
1559 },
1560 .r2 = {
1561 .owner = &ctx->b,
1562 .type = WREPL_TYPE_GROUP,
1563 .state = WREPL_STATE_ACTIVE,
1564 .node = WREPL_NODE_B,
1565 .is_static = false,
1566 .num_ips = ARRAY_SIZE(addresses_B_1),
1567 .ips = addresses_B_1,
1568 .apply_expected = true
1569 }
1570 },
1571
1572 /*
1573 * unique,released vs. group,tombstone
1574 * => should be replaced
1575 */
1576 {
1577 .line = __location__,
1578 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1579 .r1 = {
1580 .owner = &ctx->b,
1581 .type = WREPL_TYPE_UNIQUE,
1582 .state = WREPL_STATE_RELEASED,
1583 .node = WREPL_NODE_B,
1584 .is_static = false,
1585 .num_ips = ARRAY_SIZE(addresses_B_1),
1586 .ips = addresses_B_1,
1587 .apply_expected = false
1588 },
1589 .r2 = {
1590 .owner = &ctx->a,
1591 .type = WREPL_TYPE_GROUP,
1592 .state = WREPL_STATE_TOMBSTONE,
1593 .node = WREPL_NODE_B,
1594 .is_static = false,
1595 .num_ips = ARRAY_SIZE(addresses_A_1),
1596 .ips = addresses_A_1,
1597 .apply_expected = true
1598 }
1599 },
1600
1601 /*
1602 * unique,tombstone vs. group,active
1603 * => should be replaced
1604 */
1605 {
1606 .line = __location__,
1607 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1608 .r1 = {
1609 .owner = &ctx->a,
1610 .type = WREPL_TYPE_UNIQUE,
1611 .state = WREPL_STATE_TOMBSTONE,
1612 .node = WREPL_NODE_B,
1613 .is_static = false,
1614 .num_ips = ARRAY_SIZE(addresses_A_1),
1615 .ips = addresses_A_1,
1616 .apply_expected = true
1617 },
1618 .r2 = {
1619 .owner = &ctx->b,
1620 .type = WREPL_TYPE_GROUP,
1621 .state = WREPL_STATE_ACTIVE,
1622 .node = WREPL_NODE_B,
1623 .is_static = false,
1624 .num_ips = ARRAY_SIZE(addresses_B_1),
1625 .ips = addresses_B_1,
1626 .apply_expected = true
1627 }
1628 },
1629
1630 /*
1631 * unique,tombstone vs. group,tombstone
1632 * => should be replaced
1633 */
1634 {
1635 .line = __location__,
1636 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1637 .r1 = {
1638 .owner = &ctx->b,
1639 .type = WREPL_TYPE_UNIQUE,
1640 .state = WREPL_STATE_TOMBSTONE,
1641 .node = WREPL_NODE_B,
1642 .is_static = false,
1643 .num_ips = ARRAY_SIZE(addresses_B_1),
1644 .ips = addresses_B_1,
1645 .apply_expected = true
1646 },
1647 .r2 = {
1648 .owner = &ctx->a,
1649 .type = WREPL_TYPE_GROUP,
1650 .state = WREPL_STATE_TOMBSTONE,
1651 .node = WREPL_NODE_B,
1652 .is_static = false,
1653 .num_ips = ARRAY_SIZE(addresses_A_1),
1654 .ips = addresses_A_1,
1655 .apply_expected = true
1656 }
1657 },
1658
1659 /*
1660 * unique vs special groups section,
1661 */
1662 /*
1663 * unique,active vs. sgroup,active
1664 * => should NOT be replaced
1665 */
1666 {
1667 .line = __location__,
1668 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1669 .r1 = {
1670 .owner = &ctx->a,
1671 .type = WREPL_TYPE_UNIQUE,
1672 .state = WREPL_STATE_ACTIVE,
1673 .node = WREPL_NODE_B,
1674 .is_static = false,
1675 .num_ips = ARRAY_SIZE(addresses_A_1),
1676 .ips = addresses_A_1,
1677 .apply_expected = true
1678 },
1679 .r2 = {
1680 .owner = &ctx->b,
1681 .type = WREPL_TYPE_SGROUP,
1682 .state = WREPL_STATE_ACTIVE,
1683 .node = WREPL_NODE_B,
1684 .is_static = false,
1685 .num_ips = ARRAY_SIZE(addresses_A_1),
1686 .ips = addresses_A_1,
1687 .apply_expected = false
1688 }
1689 },
1690
1691 /*
1692 * unique,active vs. sgroup,tombstone
1693 * => should NOT be replaced
1694 */
1695 {
1696 .line = __location__,
1697 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1698 .r1 = {
1699 .owner = &ctx->a,
1700 .type = WREPL_TYPE_UNIQUE,
1701 .state = WREPL_STATE_ACTIVE,
1702 .node = WREPL_NODE_B,
1703 .is_static = false,
1704 .num_ips = ARRAY_SIZE(addresses_A_1),
1705 .ips = addresses_A_1,
1706 .apply_expected = true
1707 },
1708 .r2 = {
1709 .owner = &ctx->b,
1710 .type = WREPL_TYPE_SGROUP,
1711 .state = WREPL_STATE_TOMBSTONE,
1712 .node = WREPL_NODE_B,
1713 .is_static = false,
1714 .num_ips = ARRAY_SIZE(addresses_A_1),
1715 .ips = addresses_A_1,
1716 .apply_expected = false
1717 }
1718 },
1719
1720 /*
1721 * unique,released vs. sgroup,active
1722 * => should be replaced
1723 */
1724 {
1725 .line = __location__,
1726 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1727 .r1 = {
1728 .owner = &ctx->a,
1729 .type = WREPL_TYPE_UNIQUE,
1730 .state = WREPL_STATE_RELEASED,
1731 .node = WREPL_NODE_B,
1732 .is_static = false,
1733 .num_ips = ARRAY_SIZE(addresses_A_1),
1734 .ips = addresses_A_1,
1735 .apply_expected = false
1736 },
1737 .r2 = {
1738 .owner = &ctx->b,
1739 .type = WREPL_TYPE_SGROUP,
1740 .state = WREPL_STATE_ACTIVE,
1741 .node = WREPL_NODE_B,
1742 .is_static = false,
1743 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1744 .ips = addresses_B_3_4,
1745 .apply_expected = true
1746 }
1747 },
1748
1749 /*
1750 * unique,released vs. sgroup,tombstone
1751 * => should be replaced
1752 */
1753 {
1754 .line = __location__,
1755 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1756 .r1 = {
1757 .owner = &ctx->b,
1758 .type = WREPL_TYPE_UNIQUE,
1759 .state = WREPL_STATE_RELEASED,
1760 .node = WREPL_NODE_B,
1761 .is_static = false,
1762 .num_ips = ARRAY_SIZE(addresses_B_1),
1763 .ips = addresses_B_1,
1764 .apply_expected = false
1765 },
1766 .r2 = {
1767 .owner = &ctx->a,
1768 .type = WREPL_TYPE_SGROUP,
1769 .state = WREPL_STATE_TOMBSTONE,
1770 .node = WREPL_NODE_B,
1771 .is_static = false,
1772 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1773 .ips = addresses_A_3_4,
1774 .apply_expected = true
1775 }
1776 },
1777
1778 /*
1779 * unique,tombstone vs. sgroup,active
1780 * => should be replaced
1781 */
1782 {
1783 .line = __location__,
1784 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1785 .r1 = {
1786 .owner = &ctx->a,
1787 .type = WREPL_TYPE_UNIQUE,
1788 .state = WREPL_STATE_TOMBSTONE,
1789 .node = WREPL_NODE_B,
1790 .is_static = false,
1791 .num_ips = ARRAY_SIZE(addresses_A_1),
1792 .ips = addresses_A_1,
1793 .apply_expected = true
1794 },
1795 .r2 = {
1796 .owner = &ctx->b,
1797 .type = WREPL_TYPE_SGROUP,
1798 .state = WREPL_STATE_ACTIVE,
1799 .node = WREPL_NODE_B,
1800 .is_static = false,
1801 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1802 .ips = addresses_B_3_4,
1803 .apply_expected = true
1804 }
1805 },
1806
1807 /*
1808 * unique,tombstone vs. sgroup,tombstone
1809 * => should be replaced
1810 */
1811 {
1812 .line = __location__,
1813 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1814 .r1 = {
1815 .owner = &ctx->b,
1816 .type = WREPL_TYPE_UNIQUE,
1817 .state = WREPL_STATE_TOMBSTONE,
1818 .node = WREPL_NODE_B,
1819 .is_static = false,
1820 .num_ips = ARRAY_SIZE(addresses_B_1),
1821 .ips = addresses_B_1,
1822 .apply_expected = true
1823 },
1824 .r2 = {
1825 .owner = &ctx->a,
1826 .type = WREPL_TYPE_SGROUP,
1827 .state = WREPL_STATE_TOMBSTONE,
1828 .node = WREPL_NODE_B,
1829 .is_static = false,
1830 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1831 .ips = addresses_A_3_4,
1832 .apply_expected = true
1833 }
1834 },
1835
1836 /*
1837 * unique vs multi homed section,
1838 */
1839 /*
1840 * unique,active vs. mhomed,active
1841 * => should be replaced
1842 */
1843 {
1844 .line = __location__,
1845 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1846 .r1 = {
1847 .owner = &ctx->a,
1848 .type = WREPL_TYPE_UNIQUE,
1849 .state = WREPL_STATE_ACTIVE,
1850 .node = WREPL_NODE_B,
1851 .is_static = false,
1852 .num_ips = ARRAY_SIZE(addresses_A_1),
1853 .ips = addresses_A_1,
1854 .apply_expected = true
1855 },
1856 .r2 = {
1857 .owner = &ctx->b,
1858 .type = WREPL_TYPE_MHOMED,
1859 .state = WREPL_STATE_ACTIVE,
1860 .node = WREPL_NODE_B,
1861 .is_static = false,
1862 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1863 .ips = addresses_B_3_4,
1864 .apply_expected = true
1865 }
1866 },
1867
1868 /*
1869 * unique,active vs. mhomed,tombstone
1870 * => should NOT be replaced
1871 */
1872 {
1873 .line = __location__,
1874 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1875 .r1 = {
1876 .owner = &ctx->b,
1877 .type = WREPL_TYPE_UNIQUE,
1878 .state = WREPL_STATE_ACTIVE,
1879 .node = WREPL_NODE_B,
1880 .is_static = false,
1881 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1882 .ips = addresses_B_3_4,
1883 .apply_expected = true
1884 },
1885 .r2 = {
1886 .owner = &ctx->a,
1887 .type = WREPL_TYPE_MHOMED,
1888 .state = WREPL_STATE_TOMBSTONE,
1889 .node = WREPL_NODE_B,
1890 .is_static = false,
1891 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1892 .ips = addresses_B_3_4,
1893 .apply_expected = false
1894 }
1895 },
1896
1897 /*
1898 * unique,released vs. mhomed,active
1899 * => should be replaced
1900 */
1901 {
1902 .line = __location__,
1903 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1904 .r1 = {
1905 .owner = &ctx->b,
1906 .type = WREPL_TYPE_UNIQUE,
1907 .state = WREPL_STATE_RELEASED,
1908 .node = WREPL_NODE_B,
1909 .is_static = false,
1910 .num_ips = ARRAY_SIZE(addresses_B_1),
1911 .ips = addresses_B_1,
1912 .apply_expected = false
1913 },
1914 .r2 = {
1915 .owner = &ctx->a,
1916 .type = WREPL_TYPE_MHOMED,
1917 .state = WREPL_STATE_ACTIVE,
1918 .node = WREPL_NODE_B,
1919 .is_static = false,
1920 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1921 .ips = addresses_A_3_4,
1922 .apply_expected = true
1923 }
1924 },
1925
1926 /*
1927 * unique,released vs. mhomed,tombstone
1928 * => should be replaced
1929 */
1930 {
1931 .line = __location__,
1932 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1933 .r1 = {
1934 .owner = &ctx->a,
1935 .type = WREPL_TYPE_UNIQUE,
1936 .state = WREPL_STATE_RELEASED,
1937 .node = WREPL_NODE_B,
1938 .is_static = false,
1939 .num_ips = ARRAY_SIZE(addresses_A_1),
1940 .ips = addresses_A_1,
1941 .apply_expected = false
1942 },
1943 .r2 = {
1944 .owner = &ctx->b,
1945 .type = WREPL_TYPE_MHOMED,
1946 .state = WREPL_STATE_TOMBSTONE,
1947 .node = WREPL_NODE_B,
1948 .is_static = false,
1949 .num_ips = ARRAY_SIZE(addresses_B_3_4),
1950 .ips = addresses_B_3_4,
1951 .apply_expected = true
1952 }
1953 },
1954
1955 /*
1956 * unique,tombstone vs. mhomed,active
1957 * => should be replaced
1958 */
1959 {
1960 .line = __location__,
1961 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1962 .r1 = {
1963 .owner = &ctx->b,
1964 .type = WREPL_TYPE_UNIQUE,
1965 .state = WREPL_STATE_TOMBSTONE,
1966 .node = WREPL_NODE_B,
1967 .is_static = false,
1968 .num_ips = ARRAY_SIZE(addresses_B_1),
1969 .ips = addresses_B_1,
1970 .apply_expected = true
1971 },
1972 .r2 = {
1973 .owner = &ctx->a,
1974 .type = WREPL_TYPE_MHOMED,
1975 .state = WREPL_STATE_ACTIVE,
1976 .node = WREPL_NODE_B,
1977 .is_static = false,
1978 .num_ips = ARRAY_SIZE(addresses_A_3_4),
1979 .ips = addresses_A_3_4,
1980 .apply_expected = true
1981 }
1982 },
1983
1984 /*
1985 * unique,tombstone vs. mhomed,tombstone
1986 * => should be replaced
1987 */
1988 {
1989 .line = __location__,
1990 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
1991 .r1 = {
1992 .owner = &ctx->a,
1993 .type = WREPL_TYPE_UNIQUE,
1994 .state = WREPL_STATE_TOMBSTONE,
1995 .node = WREPL_NODE_B,
1996 .is_static = false,
1997 .num_ips = ARRAY_SIZE(addresses_A_1),
1998 .ips = addresses_A_1,
1999 .apply_expected = true
2000 },
2001 .r2 = {
2002 .owner = &ctx->b,
2003 .type = WREPL_TYPE_MHOMED,
2004 .state = WREPL_STATE_TOMBSTONE,
2005 .node = WREPL_NODE_B,
2006 .is_static = false,
2007 .num_ips = ARRAY_SIZE(addresses_B_3_4),
2008 .ips = addresses_B_3_4,
2009 .apply_expected = true
2010 }
2011 },
2012
2013 /*
2014 * normal groups vs unique section,
2015 */
2016 /*
2017 * group,active vs. unique,active
2018 * => should NOT be replaced
2019 */
2020 {
2021 .line = __location__,
2022 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2023 .r1 = {
2024 .owner = &ctx->a,
2025 .type = WREPL_TYPE_GROUP,
2026 .state = WREPL_STATE_ACTIVE,
2027 .node = WREPL_NODE_B,
2028 .is_static = false,
2029 .num_ips = ARRAY_SIZE(addresses_A_1),
2030 .ips = addresses_A_1,
2031 .apply_expected = true
2032 },
2033 .r2 = {
2034 .owner = &ctx->b,
2035 .type = WREPL_TYPE_UNIQUE,
2036 .state = WREPL_STATE_ACTIVE,
2037 .node = WREPL_NODE_B,
2038 .is_static = false,
2039 .num_ips = ARRAY_SIZE(addresses_A_1),
2040 .ips = addresses_A_1,
2041 .apply_expected = false
2042 }
2043 },
2044
2045 /*
2046 * group,active vs. unique,tombstone
2047 * => should NOT be replaced
2048 */
2049 {
2050 .line = __location__,
2051 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2052 .r1 = {
2053 .owner = &ctx->a,
2054 .type = WREPL_TYPE_GROUP,
2055 .state = WREPL_STATE_ACTIVE,
2056 .node = WREPL_NODE_B,
2057 .is_static = false,
2058 .num_ips = ARRAY_SIZE(addresses_A_1),
2059 .ips = addresses_A_1,
2060 .apply_expected = true
2061 },
2062 .r2 = {
2063 .owner = &ctx->b,
2064 .type = WREPL_TYPE_UNIQUE,
2065 .state = WREPL_STATE_TOMBSTONE,
2066 .node = WREPL_NODE_B,
2067 .is_static = false,
2068 .num_ips = ARRAY_SIZE(addresses_A_1),
2069 .ips = addresses_A_1,
2070 .apply_expected = false
2071 }
2072 },
2073
2074 /*
2075 * group,released vs. unique,active
2076 * => should NOT be replaced
2077 */
2078 {
2079 .line = __location__,
2080 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2081 .r1 = {
2082 .owner = &ctx->a,
2083 .type = WREPL_TYPE_GROUP,
2084 .state = WREPL_STATE_RELEASED,
2085 .node = WREPL_NODE_B,
2086 .is_static = false,
2087 .num_ips = ARRAY_SIZE(addresses_A_1),
2088 .ips = addresses_A_1,
2089 .apply_expected = false
2090 },
2091 .r2 = {
2092 .owner = &ctx->b,
2093 .type = WREPL_TYPE_UNIQUE,
2094 .state = WREPL_STATE_ACTIVE,
2095 .node = WREPL_NODE_B,
2096 .is_static = false,
2097 .num_ips = ARRAY_SIZE(addresses_A_1),
2098 .ips = addresses_A_1,
2099 .apply_expected = false
2100 }
2101 },
2102
2103 /*
2104 * group,released vs. unique,tombstone
2105 * => should NOT be replaced
2106 */
2107 {
2108 .line = __location__,
2109 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2110 .r1 = {
2111 .owner = &ctx->a,
2112 .type = WREPL_TYPE_GROUP,
2113 .state = WREPL_STATE_RELEASED,
2114 .node = WREPL_NODE_B,
2115 .is_static = false,
2116 .num_ips = ARRAY_SIZE(addresses_A_1),
2117 .ips = addresses_A_1,
2118 .apply_expected = false
2119 },
2120 .r2 = {
2121 .owner = &ctx->b,
2122 .type = WREPL_TYPE_UNIQUE,
2123 .state = WREPL_STATE_TOMBSTONE,
2124 .node = WREPL_NODE_B,
2125 .is_static = false,
2126 .num_ips = ARRAY_SIZE(addresses_A_1),
2127 .ips = addresses_A_1,
2128 .apply_expected = false
2129 }
2130 },
2131
2132 /*
2133 * group,tombstone vs. unique,active
2134 * => should NOT be replaced
2135 */
2136 {
2137 .line = __location__,
2138 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2139 .r1 = {
2140 .owner = &ctx->a,
2141 .type = WREPL_TYPE_GROUP,
2142 .state = WREPL_STATE_TOMBSTONE,
2143 .node = WREPL_NODE_B,
2144 .is_static = false,
2145 .num_ips = ARRAY_SIZE(addresses_A_1),
2146 .ips = addresses_A_1,
2147 .apply_expected = true
2148 },
2149 .r2 = {
2150 .owner = &ctx->b,
2151 .type = WREPL_TYPE_UNIQUE,
2152 .state = WREPL_STATE_ACTIVE,
2153 .node = WREPL_NODE_B,
2154 .is_static = false,
2155 .num_ips = ARRAY_SIZE(addresses_A_1),
2156 .ips = addresses_A_1,
2157 .apply_expected = false
2158 }
2159 },
2160
2161 /*
2162 * group,tombstone vs. unique,tombstone
2163 * => should NOT be replaced
2164 */
2165 {
2166 .line = __location__,
2167 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2168 .r1 = {
2169 .owner = &ctx->a,
2170 .type = WREPL_TYPE_GROUP,
2171 .state = WREPL_STATE_TOMBSTONE,
2172 .node = WREPL_NODE_B,
2173 .is_static = false,
2174 .num_ips = ARRAY_SIZE(addresses_A_1),
2175 .ips = addresses_A_1,
2176 .apply_expected = true
2177 },
2178 .r2 = {
2179 .owner = &ctx->b,
2180 .type = WREPL_TYPE_UNIQUE,
2181 .state = WREPL_STATE_TOMBSTONE,
2182 .node = WREPL_NODE_B,
2183 .is_static = false,
2184 .num_ips = ARRAY_SIZE(addresses_A_1),
2185 .ips = addresses_A_1,
2186 .apply_expected = false
2187 }
2188 },
2189
2190 /*
2191 * normal groups vs normal groups section,
2192 */
2193 /*
2194 * group,active vs. group,active
2195 * => should NOT be replaced
2196 */
2197 {
2198 .line = __location__,
2199 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2200 .r1 = {
2201 .owner = &ctx->a,
2202 .type = WREPL_TYPE_GROUP,
2203 .state = WREPL_STATE_ACTIVE,
2204 .node = WREPL_NODE_B,
2205 .is_static = false,
2206 .num_ips = ARRAY_SIZE(addresses_A_1),
2207 .ips = addresses_A_1,
2208 .apply_expected = true
2209 },
2210 .r2 = {
2211 .owner = &ctx->b,
2212 .type = WREPL_TYPE_GROUP,
2213 .state = WREPL_STATE_ACTIVE,
2214 .node = WREPL_NODE_B,
2215 .is_static = false,
2216 .num_ips = ARRAY_SIZE(addresses_A_1),
2217 .ips = addresses_A_1,
2218 .apply_expected = false
2219 }
2220 },
2221
2222 /*
2223 * group,active vs. group,tombstone
2224 * => should NOT be replaced
2225 */
2226 {
2227 .line = __location__,
2228 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2229 .r1 = {
2230 .owner = &ctx->a,
2231 .type = WREPL_TYPE_GROUP,
2232 .state = WREPL_STATE_ACTIVE,
2233 .node = WREPL_NODE_B,
2234 .is_static = false,
2235 .num_ips = ARRAY_SIZE(addresses_A_1),
2236 .ips = addresses_A_1,
2237 .apply_expected = true
2238 },
2239 .r2 = {
2240 .owner = &ctx->b,
2241 .type = WREPL_TYPE_GROUP,
2242 .state = WREPL_STATE_TOMBSTONE,
2243 .node = WREPL_NODE_B,
2244 .is_static = false,
2245 .num_ips = ARRAY_SIZE(addresses_A_1),
2246 .ips = addresses_A_1,
2247 .apply_expected = false
2248 }
2249 },
2250
2251 /*
2252 * group,released vs. group,active
2253 * => should be replaced
2254 */
2255 {
2256 .line = __location__,
2257 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2258 .r1 = {
2259 .owner = &ctx->a,
2260 .type = WREPL_TYPE_GROUP,
2261 .state = WREPL_STATE_RELEASED,
2262 .node = WREPL_NODE_B,
2263 .is_static = false,
2264 .num_ips = ARRAY_SIZE(addresses_A_1),
2265 .ips = addresses_A_1,
2266 .apply_expected = false
2267 },
2268 .r2 = {
2269 .owner = &ctx->b,
2270 .type = WREPL_TYPE_GROUP,
2271 .state = WREPL_STATE_ACTIVE,
2272 .node = WREPL_NODE_B,
2273 .is_static = false,
2274 .num_ips = ARRAY_SIZE(addresses_B_1),
2275 .ips = addresses_B_1,
2276 .apply_expected = true
2277 }
2278 },
2279
2280 /*
2281 * group,released vs. group,tombstone
2282 * => should be replaced
2283 */
2284 {
2285 .line = __location__,
2286 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2287 .r1 = {
2288 .owner = &ctx->a,
2289 .type = WREPL_TYPE_GROUP,
2290 .state = WREPL_STATE_RELEASED,
2291 .node = WREPL_NODE_B,
2292 .is_static = false,
2293 .num_ips = ARRAY_SIZE(addresses_A_1),
2294 .ips = addresses_A_1,
2295 .apply_expected = false
2296 },
2297 .r2 = {
2298 .owner = &ctx->b,
2299 .type = WREPL_TYPE_GROUP,
2300 .state = WREPL_STATE_TOMBSTONE,
2301 .node = WREPL_NODE_B,
2302 .is_static = false,
2303 .num_ips = ARRAY_SIZE(addresses_B_1),
2304 .ips = addresses_B_1,
2305 .apply_expected = true
2306 }
2307 },
2308
2309 /*
2310 * group,tombstone vs. group,active
2311 * => should be replaced
2312 */
2313 {
2314 .line = __location__,
2315 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2316 .r1 = {
2317 .owner = &ctx->b,
2318 .type = WREPL_TYPE_GROUP,
2319 .state = WREPL_STATE_TOMBSTONE,
2320 .node = WREPL_NODE_B,
2321 .is_static = false,
2322 .num_ips = ARRAY_SIZE(addresses_B_1),
2323 .ips = addresses_B_1,
2324 .apply_expected = true
2325 },
2326 .r2 = {
2327 .owner = &ctx->a,
2328 .type = WREPL_TYPE_GROUP,
2329 .state = WREPL_STATE_ACTIVE,
2330 .node = WREPL_NODE_B,
2331 .is_static = false,
2332 .num_ips = ARRAY_SIZE(addresses_A_1),
2333 .ips = addresses_A_1,
2334 .apply_expected = true
2335 }
2336 },
2337
2338 /*
2339 * group,tombstone vs. group,tombstone
2340 * => should be replaced
2341 */
2342 {
2343 .line = __location__,
2344 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2345 .r1 = {
2346 .owner = &ctx->a,
2347 .type = WREPL_TYPE_GROUP,
2348 .state = WREPL_STATE_TOMBSTONE,
2349 .node = WREPL_NODE_B,
2350 .is_static = false,
2351 .num_ips = ARRAY_SIZE(addresses_A_1),
2352 .ips = addresses_A_1,
2353 .apply_expected = true
2354 },
2355 .r2 = {
2356 .owner = &ctx->b,
2357 .type = WREPL_TYPE_GROUP,
2358 .state = WREPL_STATE_TOMBSTONE,
2359 .node = WREPL_NODE_B,
2360 .is_static = false,
2361 .num_ips = ARRAY_SIZE(addresses_B_1),
2362 .ips = addresses_B_1,
2363 .apply_expected = true
2364 }
2365 },
2366
2367 /*
2368 * normal groups vs special groups section,
2369 */
2370 /*
2371 * group,active vs. sgroup,active
2372 * => should NOT be replaced
2373 */
2374 {
2375 .line = __location__,
2376 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2377 .r1 = {
2378 .owner = &ctx->b,
2379 .type = WREPL_TYPE_GROUP,
2380 .state = WREPL_STATE_ACTIVE,
2381 .node = WREPL_NODE_B,
2382 .is_static = false,
2383 .num_ips = ARRAY_SIZE(addresses_B_1),
2384 .ips = addresses_B_1,
2385 .apply_expected = true
2386 },
2387 .r2 = {
2388 .owner = &ctx->a,
2389 .type = WREPL_TYPE_SGROUP,
2390 .state = WREPL_STATE_ACTIVE,
2391 .node = WREPL_NODE_B,
2392 .is_static = false,
2393 .num_ips = ARRAY_SIZE(addresses_B_1),
2394 .ips = addresses_B_1,
2395 .apply_expected = false
2396 }
2397 },
2398
2399 /*
2400 * group,active vs. sgroup,tombstone
2401 * => should NOT be replaced
2402 */
2403 {
2404 .line = __location__,
2405 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2406 .r1 = {
2407 .owner = &ctx->b,
2408 .type = WREPL_TYPE_GROUP,
2409 .state = WREPL_STATE_ACTIVE,
2410 .node = WREPL_NODE_B,
2411 .is_static = false,
2412 .num_ips = ARRAY_SIZE(addresses_B_1),
2413 .ips = addresses_B_1,
2414 .apply_expected = true
2415 },
2416 .r2 = {
2417 .owner = &ctx->a,
2418 .type = WREPL_TYPE_SGROUP,
2419 .state = WREPL_STATE_TOMBSTONE,
2420 .node = WREPL_NODE_B,
2421 .is_static = false,
2422 .num_ips = ARRAY_SIZE(addresses_B_1),
2423 .ips = addresses_B_1,
2424 .apply_expected = false
2425 }
2426 },
2427
2428 /*
2429 * group,released vs. sgroup,active
2430 * => should be replaced
2431 */
2432 {
2433 .line = __location__,
2434 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2435 .r1 = {
2436 .owner = &ctx->a,
2437 .type = WREPL_TYPE_GROUP,
2438 .state = WREPL_STATE_RELEASED,
2439 .node = WREPL_NODE_B,
2440 .is_static = false,
2441 .num_ips = ARRAY_SIZE(addresses_A_1),
2442 .ips = addresses_A_1,
2443 .apply_expected = false
2444 },
2445 .r2 = {
2446 .owner = &ctx->b,
2447 .type = WREPL_TYPE_SGROUP,
2448 .state = WREPL_STATE_ACTIVE,
2449 .node = WREPL_NODE_B,
2450 .is_static = false,
2451 .num_ips = ARRAY_SIZE(addresses_B_1),
2452 .ips = addresses_B_1,
2453 .apply_expected = true
2454 }
2455 },
2456
2457 /*
2458 * group,released vs. sgroup,tombstone
2459 * => should NOT be replaced
2460 */
2461 {
2462 .line = __location__,
2463 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2464 .r1 = {
2465 .owner = &ctx->b,
2466 .type = WREPL_TYPE_GROUP,
2467 .state = WREPL_STATE_RELEASED,
2468 .node = WREPL_NODE_B,
2469 .is_static = false,
2470 .num_ips = ARRAY_SIZE(addresses_B_1),
2471 .ips = addresses_B_1,
2472 .apply_expected = false
2473 },
2474 .r2 = {
2475 .owner = &ctx->a,
2476 .type = WREPL_TYPE_SGROUP,
2477 .state = WREPL_STATE_TOMBSTONE,
2478 .node = WREPL_NODE_B,
2479 .is_static = false,
2480 .num_ips = ARRAY_SIZE(addresses_B_1),
2481 .ips = addresses_B_1,
2482 .apply_expected = false
2483 }
2484 },
2485
2486 /*
2487 * group,tombstone vs. sgroup,active
2488 * => should be replaced
2489 */
2490 {
2491 .line = __location__,
2492 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2493 .r1 = {
2494 .owner = &ctx->b,
2495 .type = WREPL_TYPE_GROUP,
2496 .state = WREPL_STATE_TOMBSTONE,
2497 .node = WREPL_NODE_B,
2498 .is_static = false,
2499 .num_ips = ARRAY_SIZE(addresses_B_1),
2500 .ips = addresses_B_1,
2501 .apply_expected = true
2502 },
2503 .r2 = {
2504 .owner = &ctx->a,
2505 .type = WREPL_TYPE_SGROUP,
2506 .state = WREPL_STATE_ACTIVE,
2507 .node = WREPL_NODE_B,
2508 .is_static = false,
2509 .num_ips = ARRAY_SIZE(addresses_A_1),
2510 .ips = addresses_A_1,
2511 .apply_expected = true
2512 }
2513 },
2514
2515 /*
2516 * group,tombstone vs. sgroup,tombstone
2517 * => should be replaced
2518 */
2519 {
2520 .line = __location__,
2521 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2522 .r1 = {
2523 .owner = &ctx->a,
2524 .type = WREPL_TYPE_GROUP,
2525 .state = WREPL_STATE_TOMBSTONE,
2526 .node = WREPL_NODE_B,
2527 .is_static = false,
2528 .num_ips = ARRAY_SIZE(addresses_A_1),
2529 .ips = addresses_A_1,
2530 .apply_expected = true
2531 },
2532 .r2 = {
2533 .owner = &ctx->b,
2534 .type = WREPL_TYPE_SGROUP,
2535 .state = WREPL_STATE_TOMBSTONE,
2536 .node = WREPL_NODE_B,
2537 .is_static = false,
2538 .num_ips = ARRAY_SIZE(addresses_B_1),
2539 .ips = addresses_B_1,
2540 .apply_expected = true
2541 }
2542 },
2543
2544 /*
2545 * normal groups vs multi homed section,
2546 */
2547 /*
2548 * group,active vs. mhomed,active
2549 * => should NOT be replaced
2550 */
2551 {
2552 .line = __location__,
2553 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2554 .r1 = {
2555 .owner = &ctx->b,
2556 .type = WREPL_TYPE_GROUP,
2557 .state = WREPL_STATE_ACTIVE,
2558 .node = WREPL_NODE_B,
2559 .is_static = false,
2560 .num_ips = ARRAY_SIZE(addresses_B_1),
2561 .ips = addresses_B_1,
2562 .apply_expected = true
2563 },
2564 .r2 = {
2565 .owner = &ctx->a,
2566 .type = WREPL_TYPE_MHOMED,
2567 .state = WREPL_STATE_ACTIVE,
2568 .node = WREPL_NODE_B,
2569 .is_static = false,
2570 .num_ips = ARRAY_SIZE(addresses_B_1),
2571 .ips = addresses_B_1,
2572 .apply_expected = false
2573 }
2574 },
2575
2576 /*
2577 * group,active vs. mhomed,tombstone
2578 * => should NOT be replaced
2579 */
2580 {
2581 .line = __location__,
2582 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2583 .r1 = {
2584 .owner = &ctx->b,
2585 .type = WREPL_TYPE_GROUP,
2586 .state = WREPL_STATE_ACTIVE,
2587 .node = WREPL_NODE_B,
2588 .is_static = false,
2589 .num_ips = ARRAY_SIZE(addresses_B_1),
2590 .ips = addresses_B_1,
2591 .apply_expected = true
2592 },
2593 .r2 = {
2594 .owner = &ctx->a,
2595 .type = WREPL_TYPE_MHOMED,
2596 .state = WREPL_STATE_TOMBSTONE,
2597 .node = WREPL_NODE_B,
2598 .is_static = false,
2599 .num_ips = ARRAY_SIZE(addresses_B_1),
2600 .ips = addresses_B_1,
2601 .apply_expected = false
2602 }
2603 },
2604
2605 /*
2606 * group,released vs. mhomed,active
2607 * => should NOT be replaced
2608 */
2609 {
2610 .line = __location__,
2611 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2612 .r1 = {
2613 .owner = &ctx->b,
2614 .type = WREPL_TYPE_GROUP,
2615 .state = WREPL_STATE_RELEASED,
2616 .node = WREPL_NODE_B,
2617 .is_static = false,
2618 .num_ips = ARRAY_SIZE(addresses_B_1),
2619 .ips = addresses_B_1,
2620 .apply_expected = false
2621 },
2622 .r2 = {
2623 .owner = &ctx->a,
2624 .type = WREPL_TYPE_MHOMED,
2625 .state = WREPL_STATE_ACTIVE,
2626 .node = WREPL_NODE_B,
2627 .is_static = false,
2628 .num_ips = ARRAY_SIZE(addresses_B_1),
2629 .ips = addresses_B_1,
2630 .apply_expected = false
2631 }
2632 },
2633
2634 /*
2635 * group,released vs. mhomed,tombstone
2636 * => should NOT be replaced
2637 */
2638 {
2639 .line = __location__,
2640 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2641 .r1 = {
2642 .owner = &ctx->b,
2643 .type = WREPL_TYPE_GROUP,
2644 .state = WREPL_STATE_RELEASED,
2645 .node = WREPL_NODE_B,
2646 .is_static = false,
2647 .num_ips = ARRAY_SIZE(addresses_B_1),
2648 .ips = addresses_B_1,
2649 .apply_expected = false
2650 },
2651 .r2 = {
2652 .owner = &ctx->a,
2653 .type = WREPL_TYPE_MHOMED,
2654 .state = WREPL_STATE_TOMBSTONE,
2655 .node = WREPL_NODE_B,
2656 .is_static = false,
2657 .num_ips = ARRAY_SIZE(addresses_B_1),
2658 .ips = addresses_B_1,
2659 .apply_expected = false
2660 }
2661 },
2662
2663 /*
2664 * group,tombstone vs. mhomed,active
2665 * => should be replaced
2666 */
2667 {
2668 .line = __location__,
2669 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2670 .r1 = {
2671 .owner = &ctx->b,
2672 .type = WREPL_TYPE_GROUP,
2673 .state = WREPL_STATE_TOMBSTONE,
2674 .node = WREPL_NODE_B,
2675 .is_static = false,
2676 .num_ips = ARRAY_SIZE(addresses_B_1),
2677 .ips = addresses_B_1,
2678 .apply_expected = true
2679 },
2680 .r2 = {
2681 .owner = &ctx->a,
2682 .type = WREPL_TYPE_MHOMED,
2683 .state = WREPL_STATE_ACTIVE,
2684 .node = WREPL_NODE_B,
2685 .is_static = false,
2686 .num_ips = ARRAY_SIZE(addresses_A_1),
2687 .ips = addresses_A_1,
2688 .apply_expected = true
2689 }
2690 },
2691
2692 /*
2693 * group,tombstone vs. mhomed,tombstone
2694 * => should be replaced
2695 */
2696 {
2697 .line = __location__,
2698 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2699 .r1 = {
2700 .owner = &ctx->a,
2701 .type = WREPL_TYPE_GROUP,
2702 .state = WREPL_STATE_TOMBSTONE,
2703 .node = WREPL_NODE_B,
2704 .is_static = false,
2705 .num_ips = ARRAY_SIZE(addresses_A_1),
2706 .ips = addresses_A_1,
2707 .apply_expected = true
2708 },
2709 .r2 = {
2710 .owner = &ctx->b,
2711 .type = WREPL_TYPE_MHOMED,
2712 .state = WREPL_STATE_TOMBSTONE,
2713 .node = WREPL_NODE_B,
2714 .is_static = false,
2715 .num_ips = ARRAY_SIZE(addresses_B_1),
2716 .ips = addresses_B_1,
2717 .apply_expected = true
2718 }
2719 },
2720
2721 /*
2722 * special groups vs unique section,
2723 */
2724 /*
2725 * sgroup,active vs. unique,active
2726 * => should NOT be replaced
2727 */
2728 {
2729 .line = __location__,
2730 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2731 .r1 = {
2732 .owner = &ctx->b,
2733 .type = WREPL_TYPE_SGROUP,
2734 .state = WREPL_STATE_ACTIVE,
2735 .node = WREPL_NODE_B,
2736 .is_static = false,
2737 .num_ips = ARRAY_SIZE(addresses_B_1),
2738 .ips = addresses_B_1,
2739 .apply_expected = true
2740 },
2741 .r2 = {
2742 .owner = &ctx->a,
2743 .type = WREPL_TYPE_UNIQUE,
2744 .state = WREPL_STATE_ACTIVE,
2745 .node = WREPL_NODE_B,
2746 .is_static = false,
2747 .num_ips = ARRAY_SIZE(addresses_B_1),
2748 .ips = addresses_B_1,
2749 .apply_expected = false
2750 }
2751 },
2752
2753 /*
2754 * sgroup,active vs. unique,tombstone
2755 * => should NOT be replaced
2756 */
2757 {
2758 .line = __location__,
2759 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2760 .r1 = {
2761 .owner = &ctx->b,
2762 .type = WREPL_TYPE_SGROUP,
2763 .state = WREPL_STATE_ACTIVE,
2764 .node = WREPL_NODE_B,
2765 .is_static = false,
2766 .num_ips = ARRAY_SIZE(addresses_B_1),
2767 .ips = addresses_B_1,
2768 .apply_expected = true
2769 },
2770 .r2 = {
2771 .owner = &ctx->a,
2772 .type = WREPL_TYPE_UNIQUE,
2773 .state = WREPL_STATE_TOMBSTONE,
2774 .node = WREPL_NODE_B,
2775 .is_static = false,
2776 .num_ips = ARRAY_SIZE(addresses_B_1),
2777 .ips = addresses_B_1,
2778 .apply_expected = false
2779 }
2780 },
2781
2782 /*
2783 * sgroup,released vs. unique,active
2784 * => should be replaced
2785 */
2786 {
2787 .line = __location__,
2788 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2789 .r1 = {
2790 .owner = &ctx->b,
2791 .type = WREPL_TYPE_SGROUP,
2792 .state = WREPL_STATE_RELEASED,
2793 .node = WREPL_NODE_B,
2794 .is_static = false,
2795 .num_ips = ARRAY_SIZE(addresses_B_1),
2796 .ips = addresses_B_1,
2797 .apply_expected = false
2798 },
2799 .r2 = {
2800 .owner = &ctx->a,
2801 .type = WREPL_TYPE_UNIQUE,
2802 .state = WREPL_STATE_ACTIVE,
2803 .node = WREPL_NODE_B,
2804 .is_static = false,
2805 .num_ips = ARRAY_SIZE(addresses_A_1),
2806 .ips = addresses_A_1,
2807 .apply_expected = true
2808 }
2809 },
2810
2811 /*
2812 * sgroup,released vs. unique,tombstone
2813 * => should be replaced
2814 */
2815 {
2816 .line = __location__,
2817 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2818 .r1 = {
2819 .owner = &ctx->a,
2820 .type = WREPL_TYPE_SGROUP,
2821 .state = WREPL_STATE_RELEASED,
2822 .node = WREPL_NODE_B,
2823 .is_static = false,
2824 .num_ips = ARRAY_SIZE(addresses_A_1),
2825 .ips = addresses_A_1,
2826 .apply_expected = false
2827 },
2828 .r2 = {
2829 .owner = &ctx->b,
2830 .type = WREPL_TYPE_UNIQUE,
2831 .state = WREPL_STATE_TOMBSTONE,
2832 .node = WREPL_NODE_B,
2833 .is_static = false,
2834 .num_ips = ARRAY_SIZE(addresses_B_1),
2835 .ips = addresses_B_1,
2836 .apply_expected = true
2837 }
2838 },
2839
2840 /*
2841 * sgroup,tombstone vs. unique,active
2842 * => should be replaced
2843 */
2844 {
2845 .line = __location__,
2846 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2847 .r1 = {
2848 .owner = &ctx->a,
2849 .type = WREPL_TYPE_SGROUP,
2850 .state = WREPL_STATE_TOMBSTONE,
2851 .node = WREPL_NODE_B,
2852 .is_static = false,
2853 .num_ips = ARRAY_SIZE(addresses_A_1),
2854 .ips = addresses_A_1,
2855 .apply_expected = true
2856 },
2857 .r2 = {
2858 .owner = &ctx->b,
2859 .type = WREPL_TYPE_UNIQUE,
2860 .state = WREPL_STATE_ACTIVE,
2861 .node = WREPL_NODE_B,
2862 .is_static = false,
2863 .num_ips = ARRAY_SIZE(addresses_B_1),
2864 .ips = addresses_B_1,
2865 .apply_expected = true
2866 }
2867 },
2868
2869 /*
2870 * sgroup,tombstone vs. unique,tombstone
2871 * => should be replaced
2872 */
2873 {
2874 .line = __location__,
2875 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2876 .r1 = {
2877 .owner = &ctx->b,
2878 .type = WREPL_TYPE_SGROUP,
2879 .state = WREPL_STATE_TOMBSTONE,
2880 .node = WREPL_NODE_B,
2881 .is_static = false,
2882 .num_ips = ARRAY_SIZE(addresses_B_1),
2883 .ips = addresses_B_1,
2884 .apply_expected = true
2885 },
2886 .r2 = {
2887 .owner = &ctx->a,
2888 .type = WREPL_TYPE_UNIQUE,
2889 .state = WREPL_STATE_TOMBSTONE,
2890 .node = WREPL_NODE_B,
2891 .is_static = false,
2892 .num_ips = ARRAY_SIZE(addresses_A_1),
2893 .ips = addresses_A_1,
2894 .apply_expected = true
2895 }
2896 },
2897
2898 /*
2899 * special groups vs normal group section,
2900 */
2901 /*
2902 * sgroup,active vs. group,active
2903 * => should NOT be replaced
2904 */
2905 {
2906 .line = __location__,
2907 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2908 .r1 = {
2909 .owner = &ctx->a,
2910 .type = WREPL_TYPE_SGROUP,
2911 .state = WREPL_STATE_ACTIVE,
2912 .node = WREPL_NODE_B,
2913 .is_static = false,
2914 .num_ips = ARRAY_SIZE(addresses_A_1),
2915 .ips = addresses_A_1,
2916 .apply_expected = true
2917 },
2918 .r2 = {
2919 .owner = &ctx->b,
2920 .type = WREPL_TYPE_GROUP,
2921 .state = WREPL_STATE_ACTIVE,
2922 .node = WREPL_NODE_B,
2923 .is_static = false,
2924 .num_ips = ARRAY_SIZE(addresses_A_1),
2925 .ips = addresses_A_1,
2926 .apply_expected = false
2927 }
2928 },
2929
2930 /*
2931 * sgroup,active vs. group,tombstone
2932 * => should NOT be replaced
2933 */
2934 {
2935 .line = __location__,
2936 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2937 .r1 = {
2938 .owner = &ctx->a,
2939 .type = WREPL_TYPE_SGROUP,
2940 .state = WREPL_STATE_ACTIVE,
2941 .node = WREPL_NODE_B,
2942 .is_static = false,
2943 .num_ips = ARRAY_SIZE(addresses_A_1),
2944 .ips = addresses_A_1,
2945 .apply_expected = true
2946 },
2947 .r2 = {
2948 .owner = &ctx->b,
2949 .type = WREPL_TYPE_GROUP,
2950 .state = WREPL_STATE_TOMBSTONE,
2951 .node = WREPL_NODE_B,
2952 .is_static = false,
2953 .num_ips = ARRAY_SIZE(addresses_A_1),
2954 .ips = addresses_A_1,
2955 .apply_expected = false
2956 }
2957 },
2958
2959 /*
2960 * sgroup,released vs. group,active
2961 * => should be replaced
2962 */
2963 {
2964 .line = __location__,
2965 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2966 .r1 = {
2967 .owner = &ctx->a,
2968 .type = WREPL_TYPE_SGROUP,
2969 .state = WREPL_STATE_RELEASED,
2970 .node = WREPL_NODE_B,
2971 .is_static = false,
2972 .num_ips = ARRAY_SIZE(addresses_A_1),
2973 .ips = addresses_A_1,
2974 .apply_expected = false
2975 },
2976 .r2 = {
2977 .owner = &ctx->b,
2978 .type = WREPL_TYPE_GROUP,
2979 .state = WREPL_STATE_ACTIVE,
2980 .node = WREPL_NODE_B,
2981 .is_static = false,
2982 .num_ips = ARRAY_SIZE(addresses_B_1),
2983 .ips = addresses_B_1,
2984 .apply_expected = true
2985 }
2986 },
2987
2988 /*
2989 * sgroup,released vs. group,tombstone
2990 * => should be replaced
2991 */
2992 {
2993 .line = __location__,
2994 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
2995 .r1 = {
2996 .owner = &ctx->b,
2997 .type = WREPL_TYPE_SGROUP,
2998 .state = WREPL_STATE_RELEASED,
2999 .node = WREPL_NODE_B,
3000 .is_static = false,
3001 .num_ips = ARRAY_SIZE(addresses_B_1),
3002 .ips = addresses_B_1,
3003 .apply_expected = false
3004 },
3005 .r2 = {
3006 .owner = &ctx->a,
3007 .type = WREPL_TYPE_GROUP,
3008 .state = WREPL_STATE_TOMBSTONE,
3009 .node = WREPL_NODE_B,
3010 .is_static = false,
3011 .num_ips = ARRAY_SIZE(addresses_A_1),
3012 .ips = addresses_A_1,
3013 .apply_expected = true
3014 }
3015 },
3016
3017 /*
3018 * sgroup,tombstone vs. group,active
3019 * => should NOT be replaced
3020 */
3021 {
3022 .line = __location__,
3023 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3024 .r1 = {
3025 .owner = &ctx->a,
3026 .type = WREPL_TYPE_SGROUP,
3027 .state = WREPL_STATE_TOMBSTONE,
3028 .node = WREPL_NODE_B,
3029 .is_static = false,
3030 .num_ips = ARRAY_SIZE(addresses_A_1),
3031 .ips = addresses_A_1,
3032 .apply_expected = true
3033 },
3034 .r2 = {
3035 .owner = &ctx->b,
3036 .type = WREPL_TYPE_GROUP,
3037 .state = WREPL_STATE_ACTIVE,
3038 .node = WREPL_NODE_B,
3039 .is_static = false,
3040 .num_ips = ARRAY_SIZE(addresses_B_1),
3041 .ips = addresses_B_1,
3042 .apply_expected = true
3043 }
3044 },
3045
3046 /*
3047 * sgroup,tombstone vs. group,tombstone
3048 * => should NOT be replaced
3049 */
3050 {
3051 .line = __location__,
3052 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3053 .r1 = {
3054 .owner = &ctx->b,
3055 .type = WREPL_TYPE_SGROUP,
3056 .state = WREPL_STATE_TOMBSTONE,
3057 .node = WREPL_NODE_B,
3058 .is_static = false,
3059 .num_ips = ARRAY_SIZE(addresses_B_1),
3060 .ips = addresses_B_1,
3061 .apply_expected = true
3062 },
3063 .r2 = {
3064 .owner = &ctx->a,
3065 .type = WREPL_TYPE_GROUP,
3066 .state = WREPL_STATE_TOMBSTONE,
3067 .node = WREPL_NODE_B,
3068 .is_static = false,
3069 .num_ips = ARRAY_SIZE(addresses_A_1),
3070 .ips = addresses_A_1,
3071 .apply_expected = true
3072 }
3073 },
3074
3075 /*
3076 * special groups (not active) vs special group section,
3077 */
3078 /*
3079 * sgroup,released vs. sgroup,active
3080 * => should be replaced
3081 */
3082 {
3083 .line = __location__,
3084 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3085 .r1 = {
3086 .owner = &ctx->a,
3087 .type = WREPL_TYPE_SGROUP,
3088 .state = WREPL_STATE_RELEASED,
3089 .node = WREPL_NODE_B,
3090 .is_static = false,
3091 .num_ips = ARRAY_SIZE(addresses_A_1),
3092 .ips = addresses_A_1,
3093 .apply_expected = false
3094 },
3095 .r2 = {
3096 .owner = &ctx->b,
3097 .type = WREPL_TYPE_SGROUP,
3098 .state = WREPL_STATE_ACTIVE,
3099 .node = WREPL_NODE_B,
3100 .is_static = false,
3101 .num_ips = ARRAY_SIZE(addresses_B_1),
3102 .ips = addresses_B_1,
3103 .apply_expected = true
3104 }
3105 },
3106
3107 /*
3108 * sgroup,released vs. sgroup,tombstone
3109 * => should be replaced
3110 */
3111 {
3112 .line = __location__,
3113 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3114 .r1 = {
3115 .owner = &ctx->b,
3116 .type = WREPL_TYPE_SGROUP,
3117 .state = WREPL_STATE_RELEASED,
3118 .node = WREPL_NODE_B,
3119 .is_static = false,
3120 .num_ips = ARRAY_SIZE(addresses_B_1),
3121 .ips = addresses_B_1,
3122 .apply_expected = false
3123 },
3124 .r2 = {
3125 .owner = &ctx->a,
3126 .type = WREPL_TYPE_SGROUP,
3127 .state = WREPL_STATE_TOMBSTONE,
3128 .node = WREPL_NODE_B,
3129 .is_static = false,
3130 .num_ips = ARRAY_SIZE(addresses_A_1),
3131 .ips = addresses_A_1,
3132 .apply_expected = true
3133 }
3134 },
3135
3136 /*
3137 * sgroup,tombstone vs. sgroup,active
3138 * => should NOT be replaced
3139 */
3140 {
3141 .line = __location__,
3142 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3143 .r1 = {
3144 .owner = &ctx->a,
3145 .type = WREPL_TYPE_SGROUP,
3146 .state = WREPL_STATE_TOMBSTONE,
3147 .node = WREPL_NODE_B,
3148 .is_static = false,
3149 .num_ips = ARRAY_SIZE(addresses_A_1),
3150 .ips = addresses_A_1,
3151 .apply_expected = true
3152 },
3153 .r2 = {
3154 .owner = &ctx->b,
3155 .type = WREPL_TYPE_SGROUP,
3156 .state = WREPL_STATE_ACTIVE,
3157 .node = WREPL_NODE_B,
3158 .is_static = false,
3159 .num_ips = ARRAY_SIZE(addresses_B_1),
3160 .ips = addresses_B_1,
3161 .apply_expected = true
3162 }
3163 },
3164
3165 /*
3166 * sgroup,tombstone vs. sgroup,tombstone
3167 * => should NOT be replaced
3168 */
3169 {
3170 .line = __location__,
3171 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3172 .r1 = {
3173 .owner = &ctx->b,
3174 .type = WREPL_TYPE_SGROUP,
3175 .state = WREPL_STATE_TOMBSTONE,
3176 .node = WREPL_NODE_B,
3177 .is_static = false,
3178 .num_ips = ARRAY_SIZE(addresses_B_1),
3179 .ips = addresses_B_1,
3180 .apply_expected = true
3181 },
3182 .r2 = {
3183 .owner = &ctx->a,
3184 .type = WREPL_TYPE_SGROUP,
3185 .state = WREPL_STATE_TOMBSTONE,
3186 .node = WREPL_NODE_B,
3187 .is_static = false,
3188 .num_ips = ARRAY_SIZE(addresses_A_1),
3189 .ips = addresses_A_1,
3190 .apply_expected = true
3191 }
3192 },
3193
3194 /*
3195 * special groups vs multi homed section,
3196 */
3197 /*
3198 * sgroup,active vs. mhomed,active
3199 * => should NOT be replaced
3200 */
3201 {
3202 .line = __location__,
3203 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3204 .r1 = {
3205 .owner = &ctx->a,
3206 .type = WREPL_TYPE_SGROUP,
3207 .state = WREPL_STATE_ACTIVE,
3208 .node = WREPL_NODE_B,
3209 .is_static = false,
3210 .num_ips = ARRAY_SIZE(addresses_A_1),
3211 .ips = addresses_A_1,
3212 .apply_expected = true
3213 },
3214 .r2 = {
3215 .owner = &ctx->b,
3216 .type = WREPL_TYPE_MHOMED,
3217 .state = WREPL_STATE_ACTIVE,
3218 .node = WREPL_NODE_B,
3219 .is_static = false,
3220 .num_ips = ARRAY_SIZE(addresses_A_1),
3221 .ips = addresses_A_1,
3222 .apply_expected = false
3223 }
3224 },
3225
3226 /*
3227 * sgroup,active vs. mhomed,tombstone
3228 * => should NOT be replaced
3229 */
3230 {
3231 .line = __location__,
3232 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3233 .r1 = {
3234 .owner = &ctx->a,
3235 .type = WREPL_TYPE_SGROUP,
3236 .state = WREPL_STATE_ACTIVE,
3237 .node = WREPL_NODE_B,
3238 .is_static = false,
3239 .num_ips = ARRAY_SIZE(addresses_A_1),
3240 .ips = addresses_A_1,
3241 .apply_expected = true
3242 },
3243 .r2 = {
3244 .owner = &ctx->b,
3245 .type = WREPL_TYPE_MHOMED,
3246 .state = WREPL_STATE_TOMBSTONE,
3247 .node = WREPL_NODE_B,
3248 .is_static = false,
3249 .num_ips = ARRAY_SIZE(addresses_A_1),
3250 .ips = addresses_A_1,
3251 .apply_expected = false
3252 }
3253 },
3254
3255 /*
3256 * sgroup,released vs. mhomed,active
3257 * => should be replaced
3258 */
3259 {
3260 .line = __location__,
3261 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3262 .r1 = {
3263 .owner = &ctx->a,
3264 .type = WREPL_TYPE_SGROUP,
3265 .state = WREPL_STATE_RELEASED,
3266 .node = WREPL_NODE_B,
3267 .is_static = false,
3268 .num_ips = ARRAY_SIZE(addresses_A_1),
3269 .ips = addresses_A_1,
3270 .apply_expected = false
3271 },
3272 .r2 = {
3273 .owner = &ctx->b,
3274 .type = WREPL_TYPE_MHOMED,
3275 .state = WREPL_STATE_ACTIVE,
3276 .node = WREPL_NODE_B,
3277 .is_static = false,
3278 .num_ips = ARRAY_SIZE(addresses_B_1),
3279 .ips = addresses_B_1,
3280 .apply_expected = true
3281 }
3282 },
3283
3284 /*
3285 * sgroup,released vs. mhomed,tombstone
3286 * => should be replaced
3287 */
3288 {
3289 .line = __location__,
3290 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3291 .r1 = {
3292 .owner = &ctx->b,
3293 .type = WREPL_TYPE_SGROUP,
3294 .state = WREPL_STATE_RELEASED,
3295 .node = WREPL_NODE_B,
3296 .is_static = false,
3297 .num_ips = ARRAY_SIZE(addresses_B_1),
3298 .ips = addresses_B_1,
3299 .apply_expected = false
3300 },
3301 .r2 = {
3302 .owner = &ctx->a,
3303 .type = WREPL_TYPE_MHOMED,
3304 .state = WREPL_STATE_TOMBSTONE,
3305 .node = WREPL_NODE_B,
3306 .is_static = false,
3307 .num_ips = ARRAY_SIZE(addresses_A_1),
3308 .ips = addresses_A_1,
3309 .apply_expected = true
3310 }
3311 },
3312
3313 /*
3314 * sgroup,tombstone vs. mhomed,active
3315 * => should be replaced
3316 */
3317 {
3318 .line = __location__,
3319 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3320 .r1 = {
3321 .owner = &ctx->a,
3322 .type = WREPL_TYPE_SGROUP,
3323 .state = WREPL_STATE_TOMBSTONE,
3324 .node = WREPL_NODE_B,
3325 .is_static = false,
3326 .num_ips = ARRAY_SIZE(addresses_A_1),
3327 .ips = addresses_A_1,
3328 .apply_expected = true
3329 },
3330 .r2 = {
3331 .owner = &ctx->b,
3332 .type = WREPL_TYPE_MHOMED,
3333 .state = WREPL_STATE_ACTIVE,
3334 .node = WREPL_NODE_B,
3335 .is_static = false,
3336 .num_ips = ARRAY_SIZE(addresses_B_1),
3337 .ips = addresses_B_1,
3338 .apply_expected = true
3339 }
3340 },
3341
3342 /*
3343 * sgroup,tombstone vs. mhomed,tombstone
3344 * => should be replaced
3345 */
3346 {
3347 .line = __location__,
3348 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3349 .r1 = {
3350 .owner = &ctx->b,
3351 .type = WREPL_TYPE_SGROUP,
3352 .state = WREPL_STATE_TOMBSTONE,
3353 .node = WREPL_NODE_B,
3354 .is_static = false,
3355 .num_ips = ARRAY_SIZE(addresses_B_1),
3356 .ips = addresses_B_1,
3357 .apply_expected = true
3358 },
3359 .r2 = {
3360 .owner = &ctx->a,
3361 .type = WREPL_TYPE_MHOMED,
3362 .state = WREPL_STATE_TOMBSTONE,
3363 .node = WREPL_NODE_B,
3364 .is_static = false,
3365 .num_ips = ARRAY_SIZE(addresses_A_1),
3366 .ips = addresses_A_1,
3367 .apply_expected = true
3368 }
3369 },
3370
3371 /*
3372 * multi homed vs. unique section,
3373 */
3374 /*
3375 * mhomed,active vs. unique,active
3376 * => should be replaced
3377 */
3378 {
3379 .line = __location__,
3380 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3381 .r1 = {
3382 .owner = &ctx->a,
3383 .type = WREPL_TYPE_MHOMED,
3384 .state = WREPL_STATE_ACTIVE,
3385 .node = WREPL_NODE_B,
3386 .is_static = false,
3387 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3388 .ips = addresses_A_3_4,
3389 .apply_expected = true
3390 },
3391 .r2 = {
3392 .owner = &ctx->b,
3393 .type = WREPL_TYPE_UNIQUE,
3394 .state = WREPL_STATE_ACTIVE,
3395 .node = WREPL_NODE_B,
3396 .is_static = false,
3397 .num_ips = ARRAY_SIZE(addresses_B_1),
3398 .ips = addresses_B_1,
3399 .apply_expected = true
3400 }
3401 },
3402
3403 /*
3404 * mhomed,active vs. unique,tombstone
3405 * => should NOT be replaced
3406 */
3407 {
3408 .line = __location__,
3409 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3410 .r1 = {
3411 .owner = &ctx->b,
3412 .type = WREPL_TYPE_MHOMED,
3413 .state = WREPL_STATE_ACTIVE,
3414 .node = WREPL_NODE_B,
3415 .is_static = false,
3416 .num_ips = ARRAY_SIZE(addresses_B_1),
3417 .ips = addresses_B_1,
3418 .apply_expected = true
3419 },
3420 .r2 = {
3421 .owner = &ctx->a,
3422 .type = WREPL_TYPE_UNIQUE,
3423 .state = WREPL_STATE_TOMBSTONE,
3424 .node = WREPL_NODE_B,
3425 .is_static = false,
3426 .num_ips = ARRAY_SIZE(addresses_B_1),
3427 .ips = addresses_B_1,
3428 .apply_expected = false
3429 }
3430 },
3431
3432 /*
3433 * mhomed,released vs. unique,active
3434 * => should be replaced
3435 */
3436 {
3437 .line = __location__,
3438 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3439 .r1 = {
3440 .owner = &ctx->a,
3441 .type = WREPL_TYPE_MHOMED,
3442 .state = WREPL_STATE_RELEASED,
3443 .node = WREPL_NODE_B,
3444 .is_static = false,
3445 .num_ips = ARRAY_SIZE(addresses_A_1),
3446 .ips = addresses_A_1,
3447 .apply_expected = false
3448 },
3449 .r2 = {
3450 .owner = &ctx->b,
3451 .type = WREPL_TYPE_UNIQUE,
3452 .state = WREPL_STATE_ACTIVE,
3453 .node = WREPL_NODE_B,
3454 .is_static = false,
3455 .num_ips = ARRAY_SIZE(addresses_B_1),
3456 .ips = addresses_B_1,
3457 .apply_expected = true
3458 }
3459 },
3460
3461 /*
3462 * mhomed,released vs. uinique,tombstone
3463 * => should be replaced
3464 */
3465 {
3466 .line = __location__,
3467 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3468 .r1 = {
3469 .owner = &ctx->b,
3470 .type = WREPL_TYPE_MHOMED,
3471 .state = WREPL_STATE_RELEASED,
3472 .node = WREPL_NODE_B,
3473 .is_static = false,
3474 .num_ips = ARRAY_SIZE(addresses_B_1),
3475 .ips = addresses_B_1,
3476 .apply_expected = false
3477 },
3478 .r2 = {
3479 .owner = &ctx->a,
3480 .type = WREPL_TYPE_UNIQUE,
3481 .state = WREPL_STATE_TOMBSTONE,
3482 .node = WREPL_NODE_B,
3483 .is_static = false,
3484 .num_ips = ARRAY_SIZE(addresses_A_1),
3485 .ips = addresses_A_1,
3486 .apply_expected = true
3487 }
3488 },
3489
3490 /*
3491 * mhomed,tombstone vs. unique,active
3492 * => should be replaced
3493 */
3494 {
3495 .line = __location__,
3496 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3497 .r1 = {
3498 .owner = &ctx->a,
3499 .type = WREPL_TYPE_MHOMED,
3500 .state = WREPL_STATE_TOMBSTONE,
3501 .node = WREPL_NODE_B,
3502 .is_static = false,
3503 .num_ips = ARRAY_SIZE(addresses_A_1),
3504 .ips = addresses_A_1,
3505 .apply_expected = true
3506 },
3507 .r2 = {
3508 .owner = &ctx->b,
3509 .type = WREPL_TYPE_UNIQUE,
3510 .state = WREPL_STATE_ACTIVE,
3511 .node = WREPL_NODE_B,
3512 .is_static = false,
3513 .num_ips = ARRAY_SIZE(addresses_B_1),
3514 .ips = addresses_B_1,
3515 .apply_expected = true
3516 }
3517 },
3518
3519 /*
3520 * mhomed,tombstone vs. uinique,tombstone
3521 * => should be replaced
3522 */
3523 {
3524 .line = __location__,
3525 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3526 .r1 = {
3527 .owner = &ctx->b,
3528 .type = WREPL_TYPE_MHOMED,
3529 .state = WREPL_STATE_TOMBSTONE,
3530 .node = WREPL_NODE_B,
3531 .is_static = false,
3532 .num_ips = ARRAY_SIZE(addresses_B_1),
3533 .ips = addresses_B_1,
3534 .apply_expected = true
3535 },
3536 .r2 = {
3537 .owner = &ctx->a,
3538 .type = WREPL_TYPE_UNIQUE,
3539 .state = WREPL_STATE_TOMBSTONE,
3540 .node = WREPL_NODE_B,
3541 .is_static = false,
3542 .num_ips = ARRAY_SIZE(addresses_A_1),
3543 .ips = addresses_A_1,
3544 .apply_expected = true
3545 }
3546 },
3547
3548 /*
3549 * multi homed vs. normal group section,
3550 */
3551 /*
3552 * mhomed,active vs. group,active
3553 * => should be replaced
3554 */
3555 {
3556 .line = __location__,
3557 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3558 .r1 = {
3559 .owner = &ctx->a,
3560 .type = WREPL_TYPE_MHOMED,
3561 .state = WREPL_STATE_ACTIVE,
3562 .node = WREPL_NODE_B,
3563 .is_static = false,
3564 .num_ips = ARRAY_SIZE(addresses_A_1),
3565 .ips = addresses_A_1,
3566 .apply_expected = true
3567 },
3568 .r2 = {
3569 .owner = &ctx->b,
3570 .type = WREPL_TYPE_GROUP,
3571 .state = WREPL_STATE_ACTIVE,
3572 .node = WREPL_NODE_B,
3573 .is_static = false,
3574 .num_ips = ARRAY_SIZE(addresses_B_1),
3575 .ips = addresses_B_1,
3576 .apply_expected = true
3577 }
3578 },
3579
3580 /*
3581 * mhomed,active vs. group,tombstone
3582 * => should NOT be replaced
3583 */
3584 {
3585 .line = __location__,
3586 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3587 .r1 = {
3588 .owner = &ctx->b,
3589 .type = WREPL_TYPE_MHOMED,
3590 .state = WREPL_STATE_ACTIVE,
3591 .node = WREPL_NODE_B,
3592 .is_static = false,
3593 .num_ips = ARRAY_SIZE(addresses_B_1),
3594 .ips = addresses_B_1,
3595 .apply_expected = true
3596 },
3597 .r2 = {
3598 .owner = &ctx->a,
3599 .type = WREPL_TYPE_GROUP,
3600 .state = WREPL_STATE_TOMBSTONE,
3601 .node = WREPL_NODE_B,
3602 .is_static = false,
3603 .num_ips = ARRAY_SIZE(addresses_B_1),
3604 .ips = addresses_B_1,
3605 .apply_expected = false
3606 }
3607 },
3608
3609 /*
3610 * mhomed,released vs. group,active
3611 * => should be replaced
3612 */
3613 {
3614 .line = __location__,
3615 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3616 .r1 = {
3617 .owner = &ctx->b,
3618 .type = WREPL_TYPE_MHOMED,
3619 .state = WREPL_STATE_RELEASED,
3620 .node = WREPL_NODE_B,
3621 .is_static = false,
3622 .num_ips = ARRAY_SIZE(addresses_B_1),
3623 .ips = addresses_B_1,
3624 .apply_expected = false
3625 },
3626 .r2 = {
3627 .owner = &ctx->a,
3628 .type = WREPL_TYPE_GROUP,
3629 .state = WREPL_STATE_ACTIVE,
3630 .node = WREPL_NODE_B,
3631 .is_static = false,
3632 .num_ips = ARRAY_SIZE(addresses_A_1),
3633 .ips = addresses_A_1,
3634 .apply_expected = true
3635 }
3636 },
3637
3638 /*
3639 * mhomed,released vs. group,tombstone
3640 * => should be replaced
3641 */
3642 {
3643 .line = __location__,
3644 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3645 .r1 = {
3646 .owner = &ctx->a,
3647 .type = WREPL_TYPE_MHOMED,
3648 .state = WREPL_STATE_RELEASED,
3649 .node = WREPL_NODE_B,
3650 .is_static = false,
3651 .num_ips = ARRAY_SIZE(addresses_A_1),
3652 .ips = addresses_A_1,
3653 .apply_expected = false
3654 },
3655 .r2 = {
3656 .owner = &ctx->b,
3657 .type = WREPL_TYPE_GROUP,
3658 .state = WREPL_STATE_TOMBSTONE,
3659 .node = WREPL_NODE_B,
3660 .is_static = false,
3661 .num_ips = ARRAY_SIZE(addresses_B_1),
3662 .ips = addresses_B_1,
3663 .apply_expected = true
3664 }
3665 },
3666
3667 /*
3668 * mhomed,tombstone vs. group,active
3669 * => should be replaced
3670 */
3671 {
3672 .line = __location__,
3673 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3674 .r1 = {
3675 .owner = &ctx->b,
3676 .type = WREPL_TYPE_MHOMED,
3677 .state = WREPL_STATE_TOMBSTONE,
3678 .node = WREPL_NODE_B,
3679 .is_static = false,
3680 .num_ips = ARRAY_SIZE(addresses_B_1),
3681 .ips = addresses_B_1,
3682 .apply_expected = true
3683 },
3684 .r2 = {
3685 .owner = &ctx->a,
3686 .type = WREPL_TYPE_GROUP,
3687 .state = WREPL_STATE_ACTIVE,
3688 .node = WREPL_NODE_B,
3689 .is_static = false,
3690 .num_ips = ARRAY_SIZE(addresses_A_1),
3691 .ips = addresses_A_1,
3692 .apply_expected = true
3693 }
3694 },
3695
3696 /*
3697 * mhomed,tombstone vs. group,tombstone
3698 * => should be replaced
3699 */
3700 {
3701 .line = __location__,
3702 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3703 .r1 = {
3704 .owner = &ctx->a,
3705 .type = WREPL_TYPE_MHOMED,
3706 .state = WREPL_STATE_TOMBSTONE,
3707 .node = WREPL_NODE_B,
3708 .is_static = false,
3709 .num_ips = ARRAY_SIZE(addresses_A_1),
3710 .ips = addresses_A_1,
3711 .apply_expected = true
3712 },
3713 .r2 = {
3714 .owner = &ctx->b,
3715 .type = WREPL_TYPE_GROUP,
3716 .state = WREPL_STATE_TOMBSTONE,
3717 .node = WREPL_NODE_B,
3718 .is_static = false,
3719 .num_ips = ARRAY_SIZE(addresses_B_1),
3720 .ips = addresses_B_1,
3721 .apply_expected = true
3722 }
3723 },
3724
3725 /*
3726 * multi homed vs. special group section,
3727 */
3728 /*
3729 * mhomed,active vs. sgroup,active
3730 * => should NOT be replaced
3731 */
3732 {
3733 .line = __location__,
3734 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3735 .r1 = {
3736 .owner = &ctx->a,
3737 .type = WREPL_TYPE_MHOMED,
3738 .state = WREPL_STATE_ACTIVE,
3739 .node = WREPL_NODE_B,
3740 .is_static = false,
3741 .num_ips = ARRAY_SIZE(addresses_A_1),
3742 .ips = addresses_A_1,
3743 .apply_expected = true
3744 },
3745 .r2 = {
3746 .owner = &ctx->b,
3747 .type = WREPL_TYPE_SGROUP,
3748 .state = WREPL_STATE_ACTIVE,
3749 .node = WREPL_NODE_B,
3750 .is_static = false,
3751 .num_ips = ARRAY_SIZE(addresses_A_1),
3752 .ips = addresses_A_1,
3753 .apply_expected = false
3754 }
3755 },
3756
3757 /*
3758 * mhomed,active vs. sgroup,tombstone
3759 * => should NOT be replaced
3760 */
3761 {
3762 .line = __location__,
3763 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3764 .r1 = {
3765 .owner = &ctx->a,
3766 .type = WREPL_TYPE_MHOMED,
3767 .state = WREPL_STATE_ACTIVE,
3768 .node = WREPL_NODE_B,
3769 .is_static = false,
3770 .num_ips = ARRAY_SIZE(addresses_A_1),
3771 .ips = addresses_A_1,
3772 .apply_expected = true
3773 },
3774 .r2 = {
3775 .owner = &ctx->b,
3776 .type = WREPL_TYPE_SGROUP,
3777 .state = WREPL_STATE_TOMBSTONE,
3778 .node = WREPL_NODE_B,
3779 .is_static = false,
3780 .num_ips = ARRAY_SIZE(addresses_A_1),
3781 .ips = addresses_A_1,
3782 .apply_expected = false
3783 }
3784 },
3785
3786 /*
3787 * mhomed,released vs. sgroup,active
3788 * => should be replaced
3789 */
3790 {
3791 .line = __location__,
3792 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3793 .r1 = {
3794 .owner = &ctx->a,
3795 .type = WREPL_TYPE_MHOMED,
3796 .state = WREPL_STATE_RELEASED,
3797 .node = WREPL_NODE_B,
3798 .is_static = false,
3799 .num_ips = ARRAY_SIZE(addresses_A_1),
3800 .ips = addresses_A_1,
3801 .apply_expected = false
3802 },
3803 .r2 = {
3804 .owner = &ctx->b,
3805 .type = WREPL_TYPE_SGROUP,
3806 .state = WREPL_STATE_ACTIVE,
3807 .node = WREPL_NODE_B,
3808 .is_static = false,
3809 .num_ips = ARRAY_SIZE(addresses_B_1),
3810 .ips = addresses_B_1,
3811 .apply_expected = true
3812 }
3813 },
3814
3815 /*
3816 * mhomed,released vs. sgroup,tombstone
3817 * => should be replaced
3818 */
3819 {
3820 .line = __location__,
3821 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3822 .r1 = {
3823 .owner = &ctx->b,
3824 .type = WREPL_TYPE_MHOMED,
3825 .state = WREPL_STATE_RELEASED,
3826 .node = WREPL_NODE_B,
3827 .is_static = false,
3828 .num_ips = ARRAY_SIZE(addresses_B_1),
3829 .ips = addresses_B_1,
3830 .apply_expected = false
3831 },
3832 .r2 = {
3833 .owner = &ctx->a,
3834 .type = WREPL_TYPE_SGROUP,
3835 .state = WREPL_STATE_TOMBSTONE,
3836 .node = WREPL_NODE_B,
3837 .is_static = false,
3838 .num_ips = ARRAY_SIZE(addresses_A_1),
3839 .ips = addresses_A_1,
3840 .apply_expected = true
3841 }
3842 },
3843
3844 /*
3845 * mhomed,tombstone vs. sgroup,active
3846 * => should be replaced
3847 */
3848 {
3849 .line = __location__,
3850 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3851 .r1 = {
3852 .owner = &ctx->a,
3853 .type = WREPL_TYPE_MHOMED,
3854 .state = WREPL_STATE_TOMBSTONE,
3855 .node = WREPL_NODE_B,
3856 .is_static = false,
3857 .num_ips = ARRAY_SIZE(addresses_A_1),
3858 .ips = addresses_A_1,
3859 .apply_expected = true
3860 },
3861 .r2 = {
3862 .owner = &ctx->b,
3863 .type = WREPL_TYPE_SGROUP,
3864 .state = WREPL_STATE_ACTIVE,
3865 .node = WREPL_NODE_B,
3866 .is_static = false,
3867 .num_ips = ARRAY_SIZE(addresses_B_1),
3868 .ips = addresses_B_1,
3869 .apply_expected = true
3870 }
3871 },
3872
3873 /*
3874 * mhomed,tombstone vs. sgroup,tombstone
3875 * => should be replaced
3876 */
3877 {
3878 .line = __location__,
3879 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3880 .r1 = {
3881 .owner = &ctx->b,
3882 .type = WREPL_TYPE_MHOMED,
3883 .state = WREPL_STATE_TOMBSTONE,
3884 .node = WREPL_NODE_B,
3885 .is_static = false,
3886 .num_ips = ARRAY_SIZE(addresses_B_1),
3887 .ips = addresses_B_1,
3888 .apply_expected = true
3889 },
3890 .r2 = {
3891 .owner = &ctx->a,
3892 .type = WREPL_TYPE_SGROUP,
3893 .state = WREPL_STATE_TOMBSTONE,
3894 .node = WREPL_NODE_B,
3895 .is_static = false,
3896 .num_ips = ARRAY_SIZE(addresses_A_1),
3897 .ips = addresses_A_1,
3898 .apply_expected = true
3899 }
3900 },
3901
3902 /*
3903 * multi homed vs. mlti homed section,
3904 */
3905 /*
3906 * mhomed,active vs. mhomed,active
3907 * => should be replaced
3908 */
3909 {
3910 .line = __location__,
3911 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3912 .r1 = {
3913 .owner = &ctx->a,
3914 .type = WREPL_TYPE_MHOMED,
3915 .state = WREPL_STATE_ACTIVE,
3916 .node = WREPL_NODE_B,
3917 .is_static = false,
3918 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3919 .ips = addresses_A_3_4,
3920 .apply_expected = true
3921 },
3922 .r2 = {
3923 .owner = &ctx->b,
3924 .type = WREPL_TYPE_MHOMED,
3925 .state = WREPL_STATE_ACTIVE,
3926 .node = WREPL_NODE_B,
3927 .is_static = false,
3928 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3929 .ips = addresses_B_3_4,
3930 .apply_expected = true
3931 }
3932 },
3933
3934 /*
3935 * mhomed,active vs. mhomed,tombstone
3936 * => should NOT be replaced
3937 */
3938 {
3939 .line = __location__,
3940 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3941 .r1 = {
3942 .owner = &ctx->b,
3943 .type = WREPL_TYPE_MHOMED,
3944 .state = WREPL_STATE_ACTIVE,
3945 .node = WREPL_NODE_B,
3946 .is_static = false,
3947 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3948 .ips = addresses_B_3_4,
3949 .apply_expected = true
3950 },
3951 .r2 = {
3952 .owner = &ctx->a,
3953 .type = WREPL_TYPE_MHOMED,
3954 .state = WREPL_STATE_TOMBSTONE,
3955 .node = WREPL_NODE_B,
3956 .is_static = false,
3957 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3958 .ips = addresses_B_3_4,
3959 .apply_expected = false
3960 }
3961 },
3962
3963 /*
3964 * mhomed,released vs. mhomed,active
3965 * => should be replaced
3966 */
3967 {
3968 .line = __location__,
3969 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3970 .r1 = {
3971 .owner = &ctx->b,
3972 .type = WREPL_TYPE_MHOMED,
3973 .state = WREPL_STATE_RELEASED,
3974 .node = WREPL_NODE_B,
3975 .is_static = false,
3976 .num_ips = ARRAY_SIZE(addresses_B_3_4),
3977 .ips = addresses_B_3_4,
3978 .apply_expected = false
3979 },
3980 .r2 = {
3981 .owner = &ctx->a,
3982 .type = WREPL_TYPE_MHOMED,
3983 .state = WREPL_STATE_ACTIVE,
3984 .node = WREPL_NODE_B,
3985 .is_static = false,
3986 .num_ips = ARRAY_SIZE(addresses_A_3_4),
3987 .ips = addresses_A_3_4,
3988 .apply_expected = true
3989 }
3990 },
3991
3992 /*
3993 * mhomed,released vs. mhomed,tombstone
3994 * => should be replaced
3995 */
3996 {
3997 .line = __location__,
3998 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
3999 .r1 = {
4000 .owner = &ctx->a,
4001 .type = WREPL_TYPE_MHOMED,
4002 .state = WREPL_STATE_RELEASED,
4003 .node = WREPL_NODE_B,
4004 .is_static = false,
4005 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4006 .ips = addresses_A_3_4,
4007 .apply_expected = false
4008 },
4009 .r2 = {
4010 .owner = &ctx->b,
4011 .type = WREPL_TYPE_MHOMED,
4012 .state = WREPL_STATE_TOMBSTONE,
4013 .node = WREPL_NODE_B,
4014 .is_static = false,
4015 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4016 .ips = addresses_B_3_4,
4017 .apply_expected = true
4018 }
4019 },
4020
4021 /*
4022 * mhomed,tombstone vs. mhomed,active
4023 * => should be replaced
4024 */
4025 {
4026 .line = __location__,
4027 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4028 .r1 = {
4029 .owner = &ctx->b,
4030 .type = WREPL_TYPE_MHOMED,
4031 .state = WREPL_STATE_TOMBSTONE,
4032 .node = WREPL_NODE_B,
4033 .is_static = false,
4034 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4035 .ips = addresses_B_3_4,
4036 .apply_expected = true
4037 },
4038 .r2 = {
4039 .owner = &ctx->a,
4040 .type = WREPL_TYPE_MHOMED,
4041 .state = WREPL_STATE_ACTIVE,
4042 .node = WREPL_NODE_B,
4043 .is_static = false,
4044 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4045 .ips = addresses_A_3_4,
4046 .apply_expected = true
4047 }
4048 },
4049
4050 /*
4051 * mhomed,tombstone vs. mhomed,tombstone
4052 * => should be replaced
4053 */
4054 {
4055 .line = __location__,
4056 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4057 .r1 = {
4058 .owner = &ctx->a,
4059 .type = WREPL_TYPE_MHOMED,
4060 .state = WREPL_STATE_TOMBSTONE,
4061 .node = WREPL_NODE_B,
4062 .is_static = false,
4063 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4064 .ips = addresses_A_3_4,
4065 .apply_expected = true
4066 },
4067 .r2 = {
4068 .owner = &ctx->b,
4069 .type = WREPL_TYPE_MHOMED,
4070 .state = WREPL_STATE_TOMBSTONE,
4071 .node = WREPL_NODE_B,
4072 .is_static = false,
4073 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4074 .ips = addresses_B_3_4,
4075 .apply_expected = true
4076 }
4077 },
4078 {
4079 .line = __location__,
4080 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4081 .cleanup= true,
4082 .r1 = {
4083 .owner = &ctx->b,
4084 .type = WREPL_TYPE_UNIQUE,
4085 .state = WREPL_STATE_TOMBSTONE,
4086 .node = WREPL_NODE_B,
4087 .is_static = false,
4088 .num_ips = ARRAY_SIZE(addresses_B_1),
4089 .ips = addresses_B_1,
4090 .apply_expected = true,
4091 },
4092 .r2 = {
4093 .owner = &ctx->a,
4094 .type = WREPL_TYPE_UNIQUE,
4095 .state = WREPL_STATE_TOMBSTONE,
4096 .node = WREPL_NODE_B,
4097 .is_static = false,
4098 .num_ips = ARRAY_SIZE(addresses_A_1),
4099 .ips = addresses_A_1,
4100 .apply_expected = true,
4101 }
4102 },
4103 /*
4104 * special group vs special group section,
4105 */
4106 /*
4107 * sgroup,active vs. sgroup,active same addresses
4108 * => should be NOT replaced
4109 */
4110 {
4111 .line = __location__,
4112 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4113 .comment= "A:A_3_4 vs. B:A_3_4",
4114 .extra = true,
4115 .r1 = {
4116 .owner = &ctx->a,
4117 .type = WREPL_TYPE_SGROUP,
4118 .state = WREPL_STATE_ACTIVE,
4119 .node = WREPL_NODE_B,
4120 .is_static = false,
4121 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4122 .ips = addresses_A_3_4,
4123 .apply_expected = true
4124 },
4125 .r2 = {
4126 .owner = &ctx->b,
4127 .type = WREPL_TYPE_SGROUP,
4128 .state = WREPL_STATE_ACTIVE,
4129 .node = WREPL_NODE_B,
4130 .is_static = false,
4131 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4132 .ips = addresses_A_3_4,
4133 .apply_expected = false,
4134 .sgroup_cleanup = true
4135 }
4136 },
4137 /*
4138 * sgroup,active vs. sgroup,active same addresses
4139 * => should be NOT replaced
4140 */
4141 {
4142 .line = __location__,
4143 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4144 .comment= "A:A_3_4 vs. B:NULL",
4145 .extra = true,
4146 .r1 = {
4147 .owner = &ctx->a,
4148 .type = WREPL_TYPE_SGROUP,
4149 .state = WREPL_STATE_ACTIVE,
4150 .node = WREPL_NODE_B,
4151 .is_static = false,
4152 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4153 .ips = addresses_A_3_4,
4154 .apply_expected = true
4155 },
4156 .r2 = {
4157 .owner = &ctx->b,
4158 .type = WREPL_TYPE_SGROUP,
4159 .state = WREPL_STATE_ACTIVE,
4160 .node = WREPL_NODE_B,
4161 .is_static = false,
4162 .num_ips = 0,
4163 .ips = NULL,
4164 .apply_expected = false,
4165 .sgroup_cleanup = true
4166 }
4167 },
4168 /*
4169 * sgroup,active vs. sgroup,active subset addresses, special case...
4170 * => should NOT be replaced
4171 */
4172 {
4173 .line = __location__,
4174 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4175 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4",
4176 .extra = true,
4177 .r1 = {
4178 .owner = &ctx->a,
4179 .type = WREPL_TYPE_SGROUP,
4180 .state = WREPL_STATE_ACTIVE,
4181 .node = WREPL_NODE_B,
4182 .is_static = false,
4183 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4184 .ips = addresses_A_3_4_X_3_4,
4185 .apply_expected = true,
4186 },
4187 .r2 = {
4188 .owner = &ctx->b,
4189 .type = WREPL_TYPE_SGROUP,
4190 .state = WREPL_STATE_ACTIVE,
4191 .node = WREPL_NODE_B,
4192 .is_static = false,
4193 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4194 .ips = addresses_A_3_4,
4195 .apply_expected = false,
4196 }
4197 },
4198 {
4199 .line = __location__,
4200 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4201 .cleanup= true,
4202 .r1 = {
4203 .owner = &ctx->a,
4204 .type = WREPL_TYPE_SGROUP,
4205 .state = WREPL_STATE_ACTIVE,
4206 .node = WREPL_NODE_B,
4207 .is_static = false,
4208 .num_ips = 0,
4209 .ips = NULL,
4210 .apply_expected = false,
4211 },
4212 .r2 = {
4213 .owner = &ctx->x,
4214 .type = WREPL_TYPE_SGROUP,
4215 .state = WREPL_STATE_ACTIVE,
4216 .node = WREPL_NODE_B,
4217 .is_static = false,
4218 .num_ips = 0,
4219 .ips = NULL,
4220 .apply_expected = false,
4221 }
4222 },
4223 /*
4224 * sgroup,active vs. sgroup,active different addresses, but owner changed
4225 * => should be replaced
4226 */
4227 {
4228 .line = __location__,
4229 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4230 .comment= "A:B_3_4 vs. B:A_3_4",
4231 .extra = true,
4232 .r1 = {
4233 .owner = &ctx->a,
4234 .type = WREPL_TYPE_SGROUP,
4235 .state = WREPL_STATE_ACTIVE,
4236 .node = WREPL_NODE_B,
4237 .is_static = false,
4238 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4239 .ips = addresses_B_3_4,
4240 .apply_expected = true,
4241 },
4242 .r2 = {
4243 .owner = &ctx->b,
4244 .type = WREPL_TYPE_SGROUP,
4245 .state = WREPL_STATE_ACTIVE,
4246 .node = WREPL_NODE_B,
4247 .is_static = false,
4248 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4249 .ips = addresses_A_3_4,
4250 .apply_expected = true,
4251 .sgroup_cleanup = true
4252 }
4253 },
4254 /*
4255 * sgroup,active vs. sgroup,active different addresses, but owner changed
4256 * => should be replaced
4257 */
4258 {
4259 .line = __location__,
4260 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4261 .comment= "A:A_3_4 vs. B:A_3_4_OWNER_B",
4262 .extra = true,
4263 .r1 = {
4264 .owner = &ctx->a,
4265 .type = WREPL_TYPE_SGROUP,
4266 .state = WREPL_STATE_ACTIVE,
4267 .node = WREPL_NODE_B,
4268 .is_static = false,
4269 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4270 .ips = addresses_A_3_4,
4271 .apply_expected = true,
4272 },
4273 .r2 = {
4274 .owner = &ctx->b,
4275 .type = WREPL_TYPE_SGROUP,
4276 .state = WREPL_STATE_ACTIVE,
4277 .node = WREPL_NODE_B,
4278 .is_static = false,
4279 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4280 .ips = addresses_A_3_4_OWNER_B,
4281 .apply_expected = true,
4282 .sgroup_cleanup = true
4283 }
4284 },
4285 /*
4286 * sgroup,active vs. sgroup,active different addresses, but owner changed
4287 * => should be replaced
4288 */
4289 {
4290 .line = __location__,
4291 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4292 .comment= "A:A_3_4_OWNER_B vs. B:A_3_4",
4293 .extra = true,
4294 .r1 = {
4295 .owner = &ctx->a,
4296 .type = WREPL_TYPE_SGROUP,
4297 .state = WREPL_STATE_ACTIVE,
4298 .node = WREPL_NODE_B,
4299 .is_static = false,
4300 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4301 .ips = addresses_A_3_4_OWNER_B,
4302 .apply_expected = true,
4303 },
4304 .r2 = {
4305 .owner = &ctx->b,
4306 .type = WREPL_TYPE_SGROUP,
4307 .state = WREPL_STATE_ACTIVE,
4308 .node = WREPL_NODE_B,
4309 .is_static = false,
4310 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4311 .ips = addresses_A_3_4,
4312 .apply_expected = true,
4313 .sgroup_cleanup = true
4314 }
4315 },
4316 /*
4317 * sgroup,active vs. sgroup,active different addresses
4318 * => should be merged
4319 */
4320 {
4321 .line = __location__,
4322 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4323 .comment= "A:A_3_4 vs. B:B_3_4 => C:A_3_4_B_3_4",
4324 .extra = true,
4325 .r1 = {
4326 .owner = &ctx->a,
4327 .type = WREPL_TYPE_SGROUP,
4328 .state = WREPL_STATE_ACTIVE,
4329 .node = WREPL_NODE_B,
4330 .is_static = false,
4331 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4332 .ips = addresses_A_3_4,
4333 .apply_expected = true,
4334 },
4335 .r2 = {
4336 .owner = &ctx->b,
4337 .type = WREPL_TYPE_SGROUP,
4338 .state = WREPL_STATE_ACTIVE,
4339 .node = WREPL_NODE_B,
4340 .is_static = false,
4341 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4342 .ips = addresses_B_3_4,
4343 .sgroup_merge = true,
4344 .sgroup_cleanup = true,
4345 }
4346 },
4347 /*
4348 * sgroup,active vs. sgroup,active different addresses, special case...
4349 * => should be merged
4350 */
4351 {
4352 .line = __location__,
4353 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4354 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4_X_3_4",
4355 .extra = true,
4356 .r1 = {
4357 .owner = &ctx->a,
4358 .type = WREPL_TYPE_SGROUP,
4359 .state = WREPL_STATE_ACTIVE,
4360 .node = WREPL_NODE_B,
4361 .is_static = false,
4362 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4363 .ips = addresses_B_3_4_X_3_4,
4364 .apply_expected = true,
4365 },
4366 .r2 = {
4367 .owner = &ctx->b,
4368 .type = WREPL_TYPE_SGROUP,
4369 .state = WREPL_STATE_ACTIVE,
4370 .node = WREPL_NODE_B,
4371 .is_static = false,
4372 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4373 .ips = addresses_A_3_4,
4374 .sgroup_merge = true,
4375 .merge_owner = &ctx->b,
4376 .sgroup_cleanup = false
4377 }
4378 },
4379 {
4380 .line = __location__,
4381 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4382 .cleanup= true,
4383 .r1 = {
4384 .owner = &ctx->b,
4385 .type = WREPL_TYPE_SGROUP,
4386 .state = WREPL_STATE_ACTIVE,
4387 .node = WREPL_NODE_B,
4388 .is_static = false,
4389 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4_OWNER_B),
4390 .ips = addresses_A_3_4_X_3_4_OWNER_B,
4391 .apply_expected = true,
4392 },
4393 .r2 = {
4394 .owner = &ctx->b,
4395 .type = WREPL_TYPE_SGROUP,
4396 .state = WREPL_STATE_ACTIVE,
4397 .node = WREPL_NODE_B,
4398 .is_static = false,
4399 .num_ips = 0,
4400 .ips = NULL,
4401 .apply_expected = false,
4402 }
4403 },
4404 /*
4405 * sgroup,active vs. sgroup,active different addresses, special case...
4406 * => should be merged
4407 */
4408 {
4409 .line = __location__,
4410 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4411 .comment= "A:X_3_4 vs. B:A_3_4 => C:A_3_4_X_3_4",
4412 .extra = true,
4413 .r1 = {
4414 .owner = &ctx->a,
4415 .type = WREPL_TYPE_SGROUP,
4416 .state = WREPL_STATE_ACTIVE,
4417 .node = WREPL_NODE_B,
4418 .is_static = false,
4419 .num_ips = ARRAY_SIZE(addresses_X_3_4),
4420 .ips = addresses_X_3_4,
4421 .apply_expected = true,
4422 },
4423 .r2 = {
4424 .owner = &ctx->b,
4425 .type = WREPL_TYPE_SGROUP,
4426 .state = WREPL_STATE_ACTIVE,
4427 .node = WREPL_NODE_B,
4428 .is_static = false,
4429 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4430 .ips = addresses_A_3_4,
4431 .sgroup_merge = true,
4432 .sgroup_cleanup = false
4433 }
4434 },
4435 {
4436 .line = __location__,
4437 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4438 .cleanup= true,
4439 .r1 = {
4440 .owner = &ctx->a,
4441 .type = WREPL_TYPE_SGROUP,
4442 .state = WREPL_STATE_ACTIVE,
4443 .node = WREPL_NODE_B,
4444 .is_static = false,
4445 .num_ips = 0,
4446 .ips = NULL,
4447 .apply_expected = false,
4448 },
4449 .r2 = {
4450 .owner = &ctx->x,
4451 .type = WREPL_TYPE_SGROUP,
4452 .state = WREPL_STATE_ACTIVE,
4453 .node = WREPL_NODE_B,
4454 .is_static = false,
4455 .num_ips = 0,
4456 .ips = NULL,
4457 .apply_expected = false,
4458 }
4459 },
4460 /*
4461 * sgroup,active vs. sgroup,active different addresses, special case...
4462 * => should be merged
4463 */
4464 {
4465 .line = __location__,
4466 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4467 .comment= "A:A_3_4_X_3_4 vs. B:A_3_4_OWNER_B => B:A_3_4_OWNER_B_X_3_4",
4468 .extra = true,
4469 .r1 = {
4470 .owner = &ctx->a,
4471 .type = WREPL_TYPE_SGROUP,
4472 .state = WREPL_STATE_ACTIVE,
4473 .node = WREPL_NODE_B,
4474 .is_static = false,
4475 .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4),
4476 .ips = addresses_A_3_4_X_3_4,
4477 .apply_expected = true,
4478 },
4479 .r2 = {
4480 .owner = &ctx->b,
4481 .type = WREPL_TYPE_SGROUP,
4482 .state = WREPL_STATE_ACTIVE,
4483 .node = WREPL_NODE_B,
4484 .is_static = false,
4485 .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B),
4486 .ips = addresses_A_3_4_OWNER_B,
4487 .sgroup_merge = true,
4488 .merge_owner = &ctx->b,
4489 }
4490 },
4491 {
4492 .line = __location__,
4493 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4494 .cleanup= true,
4495 .r1 = {
4496 .owner = &ctx->b,
4497 .type = WREPL_TYPE_SGROUP,
4498 .state = WREPL_STATE_ACTIVE,
4499 .node = WREPL_NODE_B,
4500 .is_static = false,
4501 .num_ips = 0,
4502 .ips = NULL,
4503 .apply_expected = false,
4504 },
4505 .r2 = {
4506 .owner = &ctx->x,
4507 .type = WREPL_TYPE_SGROUP,
4508 .state = WREPL_STATE_ACTIVE,
4509 .node = WREPL_NODE_B,
4510 .is_static = false,
4511 .num_ips = 0,
4512 .ips = NULL,
4513 .apply_expected = false,
4514 }
4515 },
4516 /*
4517 * sgroup,active vs. sgroup,active partly different addresses, special case...
4518 * => should be merged
4519 */
4520 {
4521 .line = __location__,
4522 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4523 .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",
4524 .extra = true,
4525 .r1 = {
4526 .owner = &ctx->a,
4527 .type = WREPL_TYPE_SGROUP,
4528 .state = WREPL_STATE_ACTIVE,
4529 .node = WREPL_NODE_B,
4530 .is_static = false,
4531 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4532 .ips = addresses_B_3_4_X_3_4,
4533 .apply_expected = true,
4534 },
4535 .r2 = {
4536 .owner = &ctx->b,
4537 .type = WREPL_TYPE_SGROUP,
4538 .state = WREPL_STATE_ACTIVE,
4539 .node = WREPL_NODE_B,
4540 .is_static = false,
4541 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_1_2),
4542 .ips = addresses_B_3_4_X_1_2,
4543 .sgroup_merge = true,
4544 .sgroup_cleanup = false
4545 }
4546 },
4547 {
4548 .line = __location__,
4549 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4550 .cleanup= true,
4551 .r1 = {
4552 .owner = &ctx->b,
4553 .type = WREPL_TYPE_SGROUP,
4554 .state = WREPL_STATE_ACTIVE,
4555 .node = WREPL_NODE_B,
4556 .is_static = false,
4557 .num_ips = 0,
4558 .ips = NULL,
4559 .apply_expected = false,
4560 },
4561 .r2 = {
4562 .owner = &ctx->x,
4563 .type = WREPL_TYPE_SGROUP,
4564 .state = WREPL_STATE_ACTIVE,
4565 .node = WREPL_NODE_B,
4566 .is_static = false,
4567 .num_ips = 0,
4568 .ips = NULL,
4569 .apply_expected = false,
4570 }
4571 },
4572 /*
4573 * sgroup,active vs. sgroup,active different addresses, special case...
4574 * => should be merged
4575 */
4576 {
4577 .line = __location__,
4578 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4579 .comment= "A:A_3_4_B_3_4 vs. B:NULL => B:A_3_4",
4580 .extra = true,
4581 .r1 = {
4582 .owner = &ctx->a,
4583 .type = WREPL_TYPE_SGROUP,
4584 .state = WREPL_STATE_ACTIVE,
4585 .node = WREPL_NODE_B,
4586 .is_static = false,
4587 .num_ips = ARRAY_SIZE(addresses_A_3_4_B_3_4),
4588 .ips = addresses_A_3_4_B_3_4,
4589 .apply_expected = true,
4590 },
4591 .r2 = {
4592 .owner = &ctx->b,
4593 .type = WREPL_TYPE_SGROUP,
4594 .state = WREPL_STATE_ACTIVE,
4595 .node = WREPL_NODE_B,
4596 .is_static = false,
4597 .num_ips = 0,
4598 .ips = NULL,
4599 .sgroup_merge = true,
4600 .merge_owner = &ctx->b,
4601 .sgroup_cleanup = true
4602 }
4603 },
4604 {
4605 .line = __location__,
4606 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4607 .cleanup= true,
4608 .r1 = {
4609 .owner = &ctx->a,
4610 .type = WREPL_TYPE_SGROUP,
4611 .state = WREPL_STATE_ACTIVE,
4612 .node = WREPL_NODE_B,
4613 .is_static = false,
4614 .num_ips = 0,
4615 .ips = NULL,
4616 .apply_expected = false,
4617 },
4618 .r2 = {
4619 .owner = &ctx->a,
4620 .type = WREPL_TYPE_UNIQUE,
4621 .state = WREPL_STATE_TOMBSTONE,
4622 .node = WREPL_NODE_B,
4623 .is_static = false,
4624 .num_ips = ARRAY_SIZE(addresses_A_1),
4625 .ips = addresses_A_1,
4626 .apply_expected = true,
4627 }
4628 },
4629 /*
4630 * sgroup,active vs. sgroup,active different addresses, special case...
4631 * => should be merged
4632 */
4633 {
4634 .line = __location__,
4635 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4636 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:X_3_4",
4637 .extra = true,
4638 .r1 = {
4639 .owner = &ctx->a,
4640 .type = WREPL_TYPE_SGROUP,
4641 .state = WREPL_STATE_ACTIVE,
4642 .node = WREPL_NODE_B,
4643 .is_static = false,
4644 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4645 .ips = addresses_B_3_4_X_3_4,
4646 .apply_expected = true,
4647 },
4648 .r2 = {
4649 .owner = &ctx->b,
4650 .type = WREPL_TYPE_SGROUP,
4651 .state = WREPL_STATE_ACTIVE,
4652 .node = WREPL_NODE_B,
4653 .is_static = false,
4654 .num_ips = 0,
4655 .ips = NULL,
4656 .sgroup_merge = true,
4657 .merge_owner = &ctx->b,
4658 .sgroup_cleanup = true
4659 }
4660 },
4661 {
4662 .line = __location__,
4663 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4664 .cleanup= true,
4665 .r1 = {
4666 .owner = &ctx->x,
4667 .type = WREPL_TYPE_SGROUP,
4668 .state = WREPL_STATE_ACTIVE,
4669 .node = WREPL_NODE_B,
4670 .is_static = false,
4671 .num_ips = 0,
4672 .ips = NULL,
4673 .apply_expected = false,
4674 },
4675 .r2 = {
4676 .owner = &ctx->x,
4677 .type = WREPL_TYPE_UNIQUE,
4678 .state = WREPL_STATE_TOMBSTONE,
4679 .node = WREPL_NODE_B,
4680 .is_static = false,
4681 .num_ips = ARRAY_SIZE(addresses_A_1),
4682 .ips = addresses_A_1,
4683 .apply_expected = true,
4684 }
4685 },
4686
4687 /*
4688 * sgroup,active vs. sgroup,tombstone different no addresses, special
4689 * => should be replaced
4690 */
4691 {
4692 .line = __location__,
4693 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4694 .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:NULL",
4695 .extra = true,
4696 .r1 = {
4697 .owner = &ctx->a,
4698 .type = WREPL_TYPE_SGROUP,
4699 .state = WREPL_STATE_ACTIVE,
4700 .node = WREPL_NODE_B,
4701 .is_static = false,
4702 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4703 .ips = addresses_B_3_4_X_3_4,
4704 .apply_expected = true,
4705 },
4706 .r2 = {
4707 .owner = &ctx->b,
4708 .type = WREPL_TYPE_SGROUP,
4709 .state = WREPL_STATE_TOMBSTONE,
4710 .node = WREPL_NODE_B,
4711 .is_static = false,
4712 .num_ips = 0,
4713 .ips = NULL,
4714 .apply_expected = true,
4715 }
4716 },
4717 /*
4718 * sgroup,active vs. sgroup,tombstone different addresses
4719 * => should be replaced
4720 */
4721 {
4722 .line = __location__,
4723 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4724 .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4",
4725 .extra = true,
4726 .r1 = {
4727 .owner = &ctx->a,
4728 .type = WREPL_TYPE_SGROUP,
4729 .state = WREPL_STATE_ACTIVE,
4730 .node = WREPL_NODE_B,
4731 .is_static = false,
4732 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4733 .ips = addresses_B_3_4_X_3_4,
4734 .apply_expected = true,
4735 },
4736 .r2 = {
4737 .owner = &ctx->b,
4738 .type = WREPL_TYPE_SGROUP,
4739 .state = WREPL_STATE_TOMBSTONE,
4740 .node = WREPL_NODE_B,
4741 .is_static = false,
4742 .num_ips = ARRAY_SIZE(addresses_A_3_4),
4743 .ips = addresses_A_3_4,
4744 .apply_expected = true,
4745 }
4746 },
4747 /*
4748 * sgroup,active vs. sgroup,tombstone subset addresses
4749 * => should be replaced
4750 */
4751 {
4752 .line = __location__,
4753 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4754 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4 => B:B_3_4",
4755 .extra = true,
4756 .r1 = {
4757 .owner = &ctx->a,
4758 .type = WREPL_TYPE_SGROUP,
4759 .state = WREPL_STATE_ACTIVE,
4760 .node = WREPL_NODE_B,
4761 .is_static = false,
4762 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4763 .ips = addresses_B_3_4_X_3_4,
4764 .apply_expected = true,
4765 },
4766 .r2 = {
4767 .owner = &ctx->b,
4768 .type = WREPL_TYPE_SGROUP,
4769 .state = WREPL_STATE_TOMBSTONE,
4770 .node = WREPL_NODE_B,
4771 .is_static = false,
4772 .num_ips = ARRAY_SIZE(addresses_B_3_4),
4773 .ips = addresses_B_3_4,
4774 .apply_expected = true,
4775 }
4776 },
4777 /*
4778 * sgroup,active vs. sgroup,active same addresses
4779 * => should be replaced
4780 */
4781 {
4782 .line = __location__,
4783 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4784 .comment= "A:B_3_4_X_3_4 vs. B:B_3_4_X_3_4 => B:B_3_4_X_3_4",
4785 .extra = true,
4786 .r1 = {
4787 .owner = &ctx->a,
4788 .type = WREPL_TYPE_SGROUP,
4789 .state = WREPL_STATE_ACTIVE,
4790 .node = WREPL_NODE_B,
4791 .is_static = false,
4792 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4793 .ips = addresses_B_3_4_X_3_4,
4794 .apply_expected = true,
4795 },
4796 .r2 = {
4797 .owner = &ctx->b,
4798 .type = WREPL_TYPE_SGROUP,
4799 .state = WREPL_STATE_TOMBSTONE,
4800 .node = WREPL_NODE_B,
4801 .is_static = false,
4802 .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4),
4803 .ips = addresses_B_3_4_X_3_4,
4804 .apply_expected = true,
4805 }
4806 },
4807
4808 /*
4809 * This should be the last record in this array,
4810 * we need to make sure the we leave a tombstoned unique entry
4811 * owned by OWNER_A
4812 */
4813 {
4814 .line = __location__,
4815 .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL),
4816 .cleanup= true,
4817 .r1 = {
4818 .owner = &ctx->a,
4819 .type = WREPL_TYPE_UNIQUE,
4820 .state = WREPL_STATE_TOMBSTONE,
4821 .node = WREPL_NODE_B,
4822 .is_static = false,
4823 .num_ips = ARRAY_SIZE(addresses_A_1),
4824 .ips = addresses_A_1,
4825 .apply_expected = true
4826 },
4827 .r2 = {
4828 .owner = &ctx->a,
4829 .type = WREPL_TYPE_UNIQUE,
4830 .state = WREPL_STATE_TOMBSTONE,
4831 .node = WREPL_NODE_B,
4832 .is_static = false,
4833 .num_ips = ARRAY_SIZE(addresses_A_1),
4834 .ips = addresses_A_1,
4835 .apply_expected = true
4836 }
4837 }}; /* do not add entries here, this should be the last record! */
4838
4839 wins_name_r1 = &wins_name1;
4840 wins_name_r2 = &wins_name2;
4841
4842 torture_comment(tctx, "Test Replica Conflicts with different owners\n");
4843
4844 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
4845
4846 if (!records[i].extra && !records[i].cleanup) {
4847 /* we should test the worst cases */
4848 if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) {
4849 torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n",
4850 __location__, i, records[i].line);
4851 return false;
4852 } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) {
4853 torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n",
4854 __location__, i, records[i].line);
4855 return false;
4856 }
4857 }
4858
4859 if (!records[i].cleanup) {
4860 const char *expected;
4861 const char *ips;
4862
4863 if (records[i].r2.sgroup_merge) {
4864 expected = "SGROUP_MERGE";
4865 } else if (records[i].r2.apply_expected) {
4866 expected = "REPLACE";
4867 } else {
4868 expected = "NOT REPLACE";
4869 }
4870
4871 if (!records[i].r1.ips && !records[i].r2.ips) {
4872 ips = "with no ip(s)";
4873 } else if (records[i].r1.ips==records[i].r2.ips) {
4874 ips = "with same ip(s)";
4875 } else {
4876 ips = "with different ip(s)";
4877 }
4878
4879 torture_comment(tctx, "%s,%s%s vs. %s,%s%s %s => %s\n",
4880 wrepl_name_type_string(records[i].r1.type),
4881 wrepl_name_state_string(records[i].r1.state),
4882 (records[i].r1.is_static?",static":""),
4883 wrepl_name_type_string(records[i].r2.type),
4884 wrepl_name_state_string(records[i].r2.state),
4885 (records[i].r2.is_static?",static":""),
4886 (records[i].comment?records[i].comment:ips),
4887 expected);
4888 }
4889
4890 /*
4891 * Setup R1
4892 */
4893 wins_name_r1->name = &records[i].name;
4894 wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type,
4895 records[i].r1.state,
4896 records[i].r1.node,
4897 records[i].r1.is_static);
4898 wins_name_r1->id = ++records[i].r1.owner->max_version;
4899 if (wins_name_r1->flags & 2) {
4900 wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips;
4901 wins_name_r1->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
4902 records[i].r1.ips);
4903 } else {
4904 wins_name_r1->addresses.ip = records[i].r1.ips[0].ip;
4905 }
4906 wins_name_r1->unknown = "255.255.255.255";
4907
4908 /* now apply R1 */
4909 ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1);
4910 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4911 wins_name_r1, records[i].r1.apply_expected);
4912
4913 /*
4914 * Setup R2
4915 */
4916 wins_name_r2->name = &records[i].name;
4917 wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type,
4918 records[i].r2.state,
4919 records[i].r2.node,
4920 records[i].r2.is_static);
4921 wins_name_r2->id = ++records[i].r2.owner->max_version;
4922 if (wins_name_r2->flags & 2) {
4923 wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips;
4924 wins_name_r2->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
4925 records[i].r2.ips);
4926 } else {
4927 wins_name_r2->addresses.ip = records[i].r2.ips[0].ip;
4928 }
4929 wins_name_r2->unknown = "255.255.255.255";
4930
4931 /* now apply R2 */
4932 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4933 if (records[i].r1.state == WREPL_STATE_RELEASED) {
4934 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4935 wins_name_r1, false);
4936 } else if (records[i].r2.sgroup_merge) {
4937 ret &= test_wrepl_sgroup_merged(tctx, ctx, records[i].r2.merge_owner,
4938 records[i].r1.owner,
4939 records[i].r1.num_ips, records[i].r1.ips,
4940 records[i].r2.owner,
4941 records[i].r2.num_ips, records[i].r2.ips,
4942 wins_name_r2);
4943 } else if (records[i].r1.owner != records[i].r2.owner) {
4944 bool _expected;
4945 _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected);
4946 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner,
4947 wins_name_r1, _expected);
4948 }
4949 if (records[i].r2.state == WREPL_STATE_RELEASED) {
4950 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner,
4951 wins_name_r2, false);
4952 } else if (!records[i].r2.sgroup_merge) {
4953 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner,
4954 wins_name_r2, records[i].r2.apply_expected);
4955 }
4956
4957 if (records[i].r2.sgroup_cleanup) {
4958 if (!ret) {
4959 torture_comment(tctx, "failed before sgroup_cleanup record[%u]: %s\n", i, records[i].line);
4960 return ret;
4961 }
4962
4963 /* clean up the SGROUP record */
4964 wins_name_r1->name = &records[i].name;
4965 wins_name_r1->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4966 WREPL_STATE_ACTIVE,
4967 WREPL_NODE_B, false);
4968 wins_name_r1->id = ++records[i].r1.owner->max_version;
4969 wins_name_r1->addresses.addresses.num_ips = 0;
4970 wins_name_r1->addresses.addresses.ips = NULL;
4971 wins_name_r1->unknown = "255.255.255.255";
4972 ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1);
4973
4974 /* here we test how names from an owner are deleted */
4975 if (records[i].r2.sgroup_merge && records[i].r2.num_ips) {
4976 ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL,
4977 records[i].r2.owner,
4978 records[i].r2.num_ips, records[i].r2.ips,
4979 records[i].r1.owner,
4980 0, NULL,
4981 wins_name_r2);
4982 }
4983
4984 /* clean up the SGROUP record */
4985 wins_name_r2->name = &records[i].name;
4986 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4987 WREPL_STATE_ACTIVE,
4988 WREPL_NODE_B, false);
4989 wins_name_r2->id = ++records[i].r2.owner->max_version;
4990 wins_name_r2->addresses.addresses.num_ips = 0;
4991 wins_name_r2->addresses.addresses.ips = NULL;
4992 wins_name_r2->unknown = "255.255.255.255";
4993 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
4994
4995 /* take ownership of the SGROUP record */
4996 wins_name_r2->name = &records[i].name;
4997 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
4998 WREPL_STATE_ACTIVE,
4999 WREPL_NODE_B, false);
5000 wins_name_r2->id = ++records[i].r2.owner->max_version;
5001 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
5002 wins_name_r2->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
5003 addresses_B_1);
5004 wins_name_r2->unknown = "255.255.255.255";
5005 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
5006 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true);
5007
5008 /* overwrite the SGROUP record with unique,tombstone */
5009 wins_name_r2->name = &records[i].name;
5010 wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
5011 WREPL_STATE_TOMBSTONE,
5012 WREPL_NODE_B, false);
5013 wins_name_r2->id = ++records[i].r2.owner->max_version;
5014 wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
5015 wins_name_r2->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
5016 addresses_B_1);
5017 wins_name_r2->unknown = "255.255.255.255";
5018 ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2);
5019 ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true);
5020
5021 if (!ret) {
5022 torture_comment(tctx, "failed in sgroup_cleanup record[%u]: %s\n", i, records[i].line);
5023 return ret;
5024 }
5025 }
5026
5027 /* the first one is a cleanup run */
5028 if (!ret && i == 0) ret = true;
5029
5030 if (!ret) {
5031 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
5032 return ret;
5033 }
5034 }
5035
5036 return ret;
5037 }
5038
5039 static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx,
5040 struct test_wrepl_conflict_conn *ctx)
5041 {
5042 bool ret = true;
5043 NTSTATUS status;
5044 struct wrepl_wins_name wins_name_ = {
5045 .flags = 0,
5046 };
5047 struct wrepl_wins_name *wins_name = &wins_name_;
5048 struct nbt_name_register name_register_;
5049 struct nbt_name_register *name_register = &name_register_;
5050 struct nbt_name_release release_;
5051 struct nbt_name_release *release = &release_;
5052 uint32_t i;
5053 struct {
5054 const char *line; /* just better debugging */
5055 struct nbt_name name;
5056 struct {
5057 uint32_t nb_flags;
5058 bool mhomed;
5059 uint32_t num_ips;
5060 const struct wrepl_ip *ips;
5061 bool apply_expected;
5062 } wins;
5063 struct {
5064 enum wrepl_name_type type;
5065 enum wrepl_name_state state;
5066 enum wrepl_name_node node;
5067 bool is_static;
5068 uint32_t num_ips;
5069 const struct wrepl_ip *ips;
5070 bool apply_expected;
5071 } replica;
5072 } records[] = {
5073 /*
5074 * unique vs. unique section
5075 */
5076 /*
5077 * unique,released vs. unique,active with same ip(s)
5078 */
5079 {
5080 .line = __location__,
5081 .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL),
5082 .wins = {
5083 .nb_flags = 0,
5084 .mhomed = false,
5085 .num_ips = ctx->addresses_best_num,
5086 .ips = ctx->addresses_best,
5087 .apply_expected = true
5088 },
5089 .replica= {
5090 .type = WREPL_TYPE_UNIQUE,
5091 .state = WREPL_STATE_ACTIVE,
5092 .node = WREPL_NODE_B,
5093 .is_static = false,
5094 .num_ips = ctx->addresses_best_num,
5095 .ips = ctx->addresses_best,
5096 .apply_expected = true
5097 },
5098 },
5099 /*
5100 * unique,released vs. unique,active with different ip(s)
5101 */
5102 {
5103 .line = __location__,
5104 .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL),
5105 .wins = {
5106 .nb_flags = 0,
5107 .mhomed = false,
5108 .num_ips = ctx->addresses_best_num,
5109 .ips = ctx->addresses_best,
5110 .apply_expected = true
5111 },
5112 .replica= {
5113 .type = WREPL_TYPE_UNIQUE,
5114 .state = WREPL_STATE_ACTIVE,
5115 .node = WREPL_NODE_B,
5116 .is_static = false,
5117 .num_ips = ARRAY_SIZE(addresses_B_1),
5118 .ips = addresses_B_1,
5119 .apply_expected = true
5120 },
5121 },
5122 /*
5123 * unique,released vs. unique,tombstone with same ip(s)
5124 */
5125 {
5126 .line = __location__,
5127 .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL),
5128 .wins = {
5129 .nb_flags = 0,
5130 .mhomed = false,
5131 .num_ips = ctx->addresses_best_num,
5132 .ips = ctx->addresses_best,
5133 .apply_expected = true
5134 },
5135 .replica= {
5136 .type = WREPL_TYPE_UNIQUE,
5137 .state = WREPL_STATE_TOMBSTONE,
5138 .node = WREPL_NODE_B,
5139 .is_static = false,
5140 .num_ips = ctx->addresses_best_num,
5141 .ips = ctx->addresses_best,
5142 .apply_expected = true
5143 },
5144 },
5145 /*
5146 * unique,released vs. unique,tombstone with different ip(s)
5147 */
5148 {
5149 .line = __location__,
5150 .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL),
5151 .wins = {
5152 .nb_flags = 0,
5153 .mhomed = false,
5154 .num_ips = ctx->addresses_best_num,
5155 .ips = ctx->addresses_best,
5156 .apply_expected = true
5157 },
5158 .replica= {
5159 .type = WREPL_TYPE_UNIQUE,
5160 .state = WREPL_STATE_TOMBSTONE,
5161 .node = WREPL_NODE_B,
5162 .is_static = false,
5163 .num_ips = ARRAY_SIZE(addresses_B_1),
5164 .ips = addresses_B_1,
5165 .apply_expected = true
5166 },
5167 },
5168 /*
5169 * unique vs. group section
5170 */
5171 /*
5172 * unique,released vs. group,active with same ip(s)
5173 */
5174 {
5175 .line = __location__,
5176 .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL),
5177 .wins = {
5178 .nb_flags = 0,
5179 .mhomed = false,
5180 .num_ips = ctx->addresses_best_num,
5181 .ips = ctx->addresses_best,
5182 .apply_expected = true
5183 },
5184 .replica= {
5185 .type = WREPL_TYPE_GROUP,
5186 .state = WREPL_STATE_ACTIVE,
5187 .node = WREPL_NODE_B,
5188 .is_static = false,
5189 .num_ips = ctx->addresses_best_num,
5190 .ips = ctx->addresses_best,
5191 .apply_expected = true
5192 },
5193 },
5194 /*
5195 * unique,released vs. group,active with different ip(s)
5196 */
5197 {
5198 .line = __location__,
5199 .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL),
5200 .wins = {
5201 .nb_flags = 0,
5202 .mhomed = false,
5203 .num_ips = ctx->addresses_best_num,
5204 .ips = ctx->addresses_best,
5205 .apply_expected = true
5206 },
5207 .replica= {
5208 .type = WREPL_TYPE_GROUP,
5209 .state = WREPL_STATE_ACTIVE,
5210 .node = WREPL_NODE_B,
5211 .is_static = false,
5212 .num_ips = ARRAY_SIZE(addresses_B_1),
5213 .ips = addresses_B_1,
5214 .apply_expected = true
5215 },
5216 },
5217 /*
5218 * unique,released vs. group,tombstone with same ip(s)
5219 */
5220 {
5221 .line = __location__,
5222 .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL),
5223 .wins = {
5224 .nb_flags = 0,
5225 .mhomed = false,
5226 .num_ips = ctx->addresses_best_num,
5227 .ips = ctx->addresses_best,
5228 .apply_expected = true
5229 },
5230 .replica= {
5231 .type = WREPL_TYPE_GROUP,
5232 .state = WREPL_STATE_TOMBSTONE,
5233 .node = WREPL_NODE_B,
5234 .is_static = false,
5235 .num_ips = ctx->addresses_best_num,
5236 .ips = ctx->addresses_best,
5237 .apply_expected = true
5238 },
5239 },
5240 /*
5241 * unique,released vs. group,tombstone with different ip(s)
5242 */
5243 {
5244 .line = __location__,
5245 .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL),
5246 .wins = {
5247 .nb_flags = 0,
5248 .mhomed = false,
5249 .num_ips = ctx->addresses_best_num,
5250 .ips = ctx->addresses_best,
5251 .apply_expected = true
5252 },
5253 .replica= {
5254 .type = WREPL_TYPE_GROUP,
5255 .state = WREPL_STATE_TOMBSTONE,
5256 .node = WREPL_NODE_B,
5257 .is_static = false,
5258 .num_ips = ARRAY_SIZE(addresses_B_1),
5259 .ips = addresses_B_1,
5260 .apply_expected = true
5261 },
5262 },
5263 /*
5264 * unique vs. special group section
5265 */
5266 /*
5267 * unique,released vs. sgroup,active with same ip(s)
5268 */
5269 {
5270 .line = __location__,
5271 .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL),
5272 .wins = {
5273 .nb_flags = 0,
5274 .mhomed = false,
5275 .num_ips = ctx->addresses_best_num,
5276 .ips = ctx->addresses_best,
5277 .apply_expected = true
5278 },
5279 .replica= {
5280 .type = WREPL_TYPE_SGROUP,
5281 .state = WREPL_STATE_ACTIVE,
5282 .node = WREPL_NODE_B,
5283 .is_static = false,
5284 .num_ips = ctx->addresses_best_num,
5285 .ips = ctx->addresses_best,
5286 .apply_expected = true
5287 },
5288 },
5289 /*
5290 * unique,released vs. sgroup,active with different ip(s)
5291 */
5292 {
5293 .line = __location__,
5294 .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL),
5295 .wins = {
5296 .nb_flags = 0,
5297 .mhomed = false,
5298 .num_ips = ctx->addresses_best_num,
5299 .ips = ctx->addresses_best,
5300 .apply_expected = true
5301 },
5302 .replica= {
5303 .type = WREPL_TYPE_SGROUP,
5304 .state = WREPL_STATE_ACTIVE,
5305 .node = WREPL_NODE_B,
5306 .is_static = false,
5307 .num_ips = ARRAY_SIZE(addresses_B_1),
5308 .ips = addresses_B_1,
5309 .apply_expected = true
5310 },
5311 },
5312 /*
5313 * unique,released vs. sgroup,tombstone with same ip(s)
5314 */
5315 {
5316 .line = __location__,
5317 .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL),
5318 .wins = {
5319 .nb_flags = 0,
5320 .mhomed = false,
5321 .num_ips = ctx->addresses_best_num,
5322 .ips = ctx->addresses_best,
5323 .apply_expected = true
5324 },
5325 .replica= {
5326 .type = WREPL_TYPE_SGROUP,
5327 .state = WREPL_STATE_TOMBSTONE,
5328 .node = WREPL_NODE_B,
5329 .is_static = false,
5330 .num_ips = ctx->addresses_best_num,
5331 .ips = ctx->addresses_best,
5332 .apply_expected = true
5333 },
5334 },
5335 /*
5336 * unique,released vs. sgroup,tombstone with different ip(s)
5337 */
5338 {
5339 .line = __location__,
5340 .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL),
5341 .wins = {
5342 .nb_flags = 0,
5343 .mhomed = false,
5344 .num_ips = ctx->addresses_best_num,
5345 .ips = ctx->addresses_best,
5346 .apply_expected = true
5347 },
5348 .replica= {
5349 .type = WREPL_TYPE_SGROUP,
5350 .state = WREPL_STATE_TOMBSTONE,
5351 .node = WREPL_NODE_B,
5352 .is_static = false,
5353 .num_ips = ARRAY_SIZE(addresses_B_1),
5354 .ips = addresses_B_1,
5355 .apply_expected = true
5356 },
5357 },
5358 /*
5359 * unique vs. multi homed section
5360 */
5361 /*
5362 * unique,released vs. mhomed,active with same ip(s)
5363 */
5364 {
5365 .line = __location__,
5366 .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL),
5367 .wins = {
5368 .nb_flags = 0,
5369 .mhomed = false,
5370 .num_ips = ctx->addresses_best_num,
5371 .ips = ctx->addresses_best,
5372 .apply_expected = true
5373 },
5374 .replica= {
5375 .type = WREPL_TYPE_MHOMED,
5376 .state = WREPL_STATE_ACTIVE,
5377 .node = WREPL_NODE_B,
5378 .is_static = false,
5379 .num_ips = ctx->addresses_best_num,
5380 .ips = ctx->addresses_best,
5381 .apply_expected = true
5382 },
5383 },
5384 /*
5385 * unique,released vs. mhomed,active with different ip(s)
5386 */
5387 {
5388 .line = __location__,
5389 .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL),
5390 .wins = {
5391 .nb_flags = 0,
5392 .mhomed = false,
5393 .num_ips = ctx->addresses_best_num,
5394 .ips = ctx->addresses_best,
5395 .apply_expected = true
5396 },
5397 .replica= {
5398 .type = WREPL_TYPE_MHOMED,
5399 .state = WREPL_STATE_ACTIVE,
5400 .node = WREPL_NODE_B,
5401 .is_static = false,
5402 .num_ips = ARRAY_SIZE(addresses_B_1),
5403 .ips = addresses_B_1,
5404 .apply_expected = true
5405 },
5406 },
5407 /*
5408 * unique,released vs. mhomed,tombstone with same ip(s)
5409 */
5410 {
5411 .line = __location__,
5412 .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL),
5413 .wins = {
5414 .nb_flags = 0,
5415 .mhomed = false,
5416 .num_ips = ctx->addresses_best_num,
5417 .ips = ctx->addresses_best,
5418 .apply_expected = true
5419 },
5420 .replica= {
5421 .type = WREPL_TYPE_MHOMED,
5422 .state = WREPL_STATE_TOMBSTONE,
5423 .node = WREPL_NODE_B,
5424 .is_static = false,
5425 .num_ips = ctx->addresses_best_num,
5426 .ips = ctx->addresses_best,
5427 .apply_expected = true
5428 },
5429 },
5430 /*
5431 * unique,released vs. mhomed,tombstone with different ip(s)
5432 */
5433 {
5434 .line = __location__,
5435 .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL),
5436 .wins = {
5437 .nb_flags = 0,
5438 .mhomed = false,
5439 .num_ips = ctx->addresses_best_num,
5440 .ips = ctx->addresses_best,
5441 .apply_expected = true
5442 },
5443 .replica= {
5444 .type = WREPL_TYPE_MHOMED,
5445 .state = WREPL_STATE_TOMBSTONE,
5446 .node = WREPL_NODE_B,
5447 .is_static = false,
5448 .num_ips = ARRAY_SIZE(addresses_B_1),
5449 .ips = addresses_B_1,
5450 .apply_expected = true
5451 },
5452 },
5453 /*
5454 * group vs. unique section
5455 */
5456 /*
5457 * group,released vs. unique,active with same ip(s)
5458 */
5459 {
5460 .line = __location__,
5461 .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL),
5462 .wins = {
5463 .nb_flags = NBT_NM_GROUP,
5464 .mhomed = false,
5465 .num_ips = ctx->addresses_best_num,
5466 .ips = ctx->addresses_best,
5467 .apply_expected = true
5468 },
5469 .replica= {
5470 .type = WREPL_TYPE_UNIQUE,
5471 .state = WREPL_STATE_ACTIVE,
5472 .node = WREPL_NODE_B,
5473 .is_static = false,
5474 .num_ips = ctx->addresses_best_num,
5475 .ips = ctx->addresses_best,
5476 .apply_expected = false
5477 },
5478 },
5479 /*
5480 * group,released vs. unique,active with different ip(s)
5481 */
5482 {
5483 .line = __location__,
5484 .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL),
5485 .wins = {
5486 .nb_flags = NBT_NM_GROUP,
5487 .mhomed = false,
5488 .num_ips = ctx->addresses_best_num,
5489 .ips = ctx->addresses_best,
5490 .apply_expected = true
5491 },
5492 .replica= {
5493 .type = WREPL_TYPE_UNIQUE,
5494 .state = WREPL_STATE_ACTIVE,
5495 .node = WREPL_NODE_B,
5496 .is_static = false,
5497 .num_ips = ARRAY_SIZE(addresses_B_1),
5498 .ips = addresses_B_1,
5499 .apply_expected = false
5500 },
5501 },
5502 /*
5503 * group,released vs. unique,tombstone with same ip(s)
5504 */
5505 {
5506 .line = __location__,
5507 .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL),
5508 .wins = {
5509 .nb_flags = NBT_NM_GROUP,
5510 .mhomed = false,
5511 .num_ips = ctx->addresses_best_num,
5512 .ips = ctx->addresses_best,
5513 .apply_expected = true
5514 },
5515 .replica= {
5516 .type = WREPL_TYPE_UNIQUE,
5517 .state = WREPL_STATE_TOMBSTONE,
5518 .node = WREPL_NODE_B,
5519 .is_static = false,
5520 .num_ips = ctx->addresses_best_num,
5521 .ips = ctx->addresses_best,
5522 .apply_expected = false
5523 },
5524 },
5525 /*
5526 * group,released vs. unique,tombstone with different ip(s)
5527 */
5528 {
5529 .line = __location__,
5530 .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL),
5531 .wins = {
5532 .nb_flags = NBT_NM_GROUP,
5533 .mhomed = false,
5534 .num_ips = ctx->addresses_best_num,
5535 .ips = ctx->addresses_best,
5536 .apply_expected = true
5537 },
5538 .replica= {
5539 .type = WREPL_TYPE_UNIQUE,
5540 .state = WREPL_STATE_TOMBSTONE,
5541 .node = WREPL_NODE_B,
5542 .is_static = false,
5543 .num_ips = ARRAY_SIZE(addresses_B_1),
5544 .ips = addresses_B_1,
5545 .apply_expected = false
5546 },
5547 },
5548 /*
5549 * group vs. group section
5550 */
5551 /*
5552 * group,released vs. group,active with same ip(s)
5553 */
5554 {
5555 .line = __location__,
5556 .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL),
5557 .wins = {
5558 .nb_flags = NBT_NM_GROUP,
5559 .mhomed = false,
5560 .num_ips = ctx->addresses_best_num,
5561 .ips = ctx->addresses_best,
5562 .apply_expected = true
5563 },
5564 .replica= {
5565 .type = WREPL_TYPE_GROUP,
5566 .state = WREPL_STATE_ACTIVE,
5567 .node = WREPL_NODE_B,
5568 .is_static = false,
5569 .num_ips = ctx->addresses_best_num,
5570 .ips = ctx->addresses_best,
5571 .apply_expected = true
5572 },
5573 },
5574 /*
5575 * group,released vs. group,active with different ip(s)
5576 */
5577 {
5578 .line = __location__,
5579 .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL),
5580 .wins = {
5581 .nb_flags = NBT_NM_GROUP,
5582 .mhomed = false,
5583 .num_ips = ctx->addresses_best_num,
5584 .ips = ctx->addresses_best,
5585 .apply_expected = true
5586 },
5587 .replica= {
5588 .type = WREPL_TYPE_GROUP,
5589 .state = WREPL_STATE_ACTIVE,
5590 .node = WREPL_NODE_B,
5591 .is_static = false,
5592 .num_ips = ARRAY_SIZE(addresses_B_1),
5593 .ips = addresses_B_1,
5594 .apply_expected = true
5595 },
5596 },
5597 /*
5598 * group,released vs. group,tombstone with same ip(s)
5599 */
5600 {
5601 .line = __location__,
5602 .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL),
5603 .wins = {
5604 .nb_flags = NBT_NM_GROUP,
5605 .mhomed = false,
5606 .num_ips = ctx->addresses_best_num,
5607 .ips = ctx->addresses_best,
5608 .apply_expected = true
5609 },
5610 .replica= {
5611 .type = WREPL_TYPE_GROUP,
5612 .state = WREPL_STATE_TOMBSTONE,
5613 .node = WREPL_NODE_B,
5614 .is_static = false,
5615 .num_ips = ctx->addresses_best_num,
5616 .ips = ctx->addresses_best,
5617 .apply_expected = true
5618 },
5619 },
5620 /*
5621 * group,released vs. group,tombstone with different ip(s)
5622 */
5623 {
5624 .line = __location__,
5625 .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL),
5626 .wins = {
5627 .nb_flags = NBT_NM_GROUP,
5628 .mhomed = false,
5629 .num_ips = ctx->addresses_best_num,
5630 .ips = ctx->addresses_best,
5631 .apply_expected = true
5632 },
5633 .replica= {
5634 .type = WREPL_TYPE_GROUP,
5635 .state = WREPL_STATE_TOMBSTONE,
5636 .node = WREPL_NODE_B,
5637 .is_static = false,
5638 .num_ips = ARRAY_SIZE(addresses_B_1),
5639 .ips = addresses_B_1,
5640 .apply_expected = true
5641 },
5642 },
5643 /*
5644 * group vs. special group section
5645 */
5646 /*
5647 * group,released vs. sgroup,active with same ip(s)
5648 */
5649 {
5650 .line = __location__,
5651 .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL),
5652 .wins = {
5653 .nb_flags = NBT_NM_GROUP,
5654 .mhomed = false,
5655 .num_ips = ctx->addresses_best_num,
5656 .ips = ctx->addresses_best,
5657 .apply_expected = true
5658 },
5659 .replica= {
5660 .type = WREPL_TYPE_SGROUP,
5661 .state = WREPL_STATE_ACTIVE,
5662 .node = WREPL_NODE_B,
5663 .is_static = false,
5664 .num_ips = ctx->addresses_best_num,
5665 .ips = ctx->addresses_best,
5666 .apply_expected = false
5667 },
5668 },
5669 /*
5670 * group,released vs. sgroup,active with different ip(s)
5671 */
5672 {
5673 .line = __location__,
5674 .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL),
5675 .wins = {
5676 .nb_flags = NBT_NM_GROUP,
5677 .mhomed = false,
5678 .num_ips = ctx->addresses_best_num,
5679 .ips = ctx->addresses_best,
5680 .apply_expected = true
5681 },
5682 .replica= {
5683 .type = WREPL_TYPE_SGROUP,
5684 .state = WREPL_STATE_ACTIVE,
5685 .node = WREPL_NODE_B,
5686 .is_static = false,
5687 .num_ips = ARRAY_SIZE(addresses_B_1),
5688 .ips = addresses_B_1,
5689 .apply_expected = false
5690 },
5691 },
5692 /*
5693 * group,released vs. sgroup,tombstone with same ip(s)
5694 */
5695 {
5696 .line = __location__,
5697 .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL),
5698 .wins = {
5699 .nb_flags = NBT_NM_GROUP,
5700 .mhomed = false,
5701 .num_ips = ctx->addresses_best_num,
5702 .ips = ctx->addresses_best,
5703 .apply_expected = true
5704 },
5705 .replica= {
5706 .type = WREPL_TYPE_SGROUP,
5707 .state = WREPL_STATE_TOMBSTONE,
5708 .node = WREPL_NODE_B,
5709 .is_static = false,
5710 .num_ips = ctx->addresses_best_num,
5711 .ips = ctx->addresses_best,
5712 .apply_expected = false
5713 },
5714 },
5715 /*
5716 * group,released vs. sgroup,tombstone with different ip(s)
5717 */
5718 {
5719 .line = __location__,
5720 .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL),
5721 .wins = {
5722 .nb_flags = NBT_NM_GROUP,
5723 .mhomed = false,
5724 .num_ips = ctx->addresses_best_num,
5725 .ips = ctx->addresses_best,
5726 .apply_expected = true
5727 },
5728 .replica= {
5729 .type = WREPL_TYPE_SGROUP,
5730 .state = WREPL_STATE_TOMBSTONE,
5731 .node = WREPL_NODE_B,
5732 .is_static = false,
5733 .num_ips = ARRAY_SIZE(addresses_B_1),
5734 .ips = addresses_B_1,
5735 .apply_expected = false
5736 },
5737 },
5738 /*
5739 * group vs. multi homed section
5740 */
5741 /*
5742 * group,released vs. mhomed,active with same ip(s)
5743 */
5744 {
5745 .line = __location__,
5746 .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL),
5747 .wins = {
5748 .nb_flags = NBT_NM_GROUP,
5749 .mhomed = false,
5750 .num_ips = ctx->addresses_best_num,
5751 .ips = ctx->addresses_best,
5752 .apply_expected = true
5753 },
5754 .replica= {
5755 .type = WREPL_TYPE_MHOMED,
5756 .state = WREPL_STATE_ACTIVE,
5757 .node = WREPL_NODE_B,
5758 .is_static = false,
5759 .num_ips = ctx->addresses_best_num,
5760 .ips = ctx->addresses_best,
5761 .apply_expected = false
5762 },
5763 },
5764 /*
5765 * group,released vs. mhomed,active with different ip(s)
5766 */
5767 {
5768 .line = __location__,
5769 .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL),
5770 .wins = {
5771 .nb_flags = NBT_NM_GROUP,
5772 .mhomed = false,
5773 .num_ips = ctx->addresses_best_num,
5774 .ips = ctx->addresses_best,
5775 .apply_expected = true
5776 },
5777 .replica= {
5778 .type = WREPL_TYPE_MHOMED,
5779 .state = WREPL_STATE_ACTIVE,
5780 .node = WREPL_NODE_B,
5781 .is_static = false,
5782 .num_ips = ARRAY_SIZE(addresses_B_1),
5783 .ips = addresses_B_1,
5784 .apply_expected = false
5785 },
5786 },
5787 /*
5788 * group,released vs. mhomed,tombstone with same ip(s)
5789 */
5790 {
5791 .line = __location__,
5792 .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL),
5793 .wins = {
5794 .nb_flags = NBT_NM_GROUP,
5795 .mhomed = false,
5796 .num_ips = ctx->addresses_best_num,
5797 .ips = ctx->addresses_best,
5798 .apply_expected = true
5799 },
5800 .replica= {
5801 .type = WREPL_TYPE_MHOMED,
5802 .state = WREPL_STATE_TOMBSTONE,
5803 .node = WREPL_NODE_B,
5804 .is_static = false,
5805 .num_ips = ctx->addresses_best_num,
5806 .ips = ctx->addresses_best,
5807 .apply_expected = false
5808 },
5809 },
5810 /*
5811 * group,released vs. mhomed,tombstone with different ip(s)
5812 */
5813 {
5814 .line = __location__,
5815 .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL),
5816 .wins = {
5817 .nb_flags = NBT_NM_GROUP,
5818 .mhomed = false,
5819 .num_ips = ctx->addresses_best_num,
5820 .ips = ctx->addresses_best,
5821 .apply_expected = true
5822 },
5823 .replica= {
5824 .type = WREPL_TYPE_MHOMED,
5825 .state = WREPL_STATE_TOMBSTONE,
5826 .node = WREPL_NODE_B,
5827 .is_static = false,
5828 .num_ips = ARRAY_SIZE(addresses_B_1),
5829 .ips = addresses_B_1,
5830 .apply_expected = false
5831 },
5832 },
5833 /*
5834 * special group vs. unique section
5835 */
5836 /*
5837 * sgroup,released vs. unique,active with same ip(s)
5838 */
5839 {
5840 .line = __location__,
5841 .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL),
5842 .wins = {
5843 .nb_flags = NBT_NM_GROUP,
5844 .mhomed = false,
5845 .num_ips = ctx->addresses_best_num,
5846 .ips = ctx->addresses_best,
5847 .apply_expected = true
5848 },
5849 .replica= {
5850 .type = WREPL_TYPE_UNIQUE,
5851 .state = WREPL_STATE_ACTIVE,
5852 .node = WREPL_NODE_B,
5853 .is_static = false,
5854 .num_ips = ctx->addresses_best_num,
5855 .ips = ctx->addresses_best,
5856 .apply_expected = true
5857 },
5858 },
5859 /*
5860 * sgroup,released vs. unique,active with different ip(s)
5861 */
5862 {
5863 .line = __location__,
5864 .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL),
5865 .wins = {
5866 .nb_flags = NBT_NM_GROUP,
5867 .mhomed = false,
5868 .num_ips = ctx->addresses_best_num,
5869 .ips = ctx->addresses_best,
5870 .apply_expected = true
5871 },
5872 .replica= {
5873 .type = WREPL_TYPE_UNIQUE,
5874 .state = WREPL_STATE_ACTIVE,
5875 .node = WREPL_NODE_B,
5876 .is_static = false,
5877 .num_ips = ARRAY_SIZE(addresses_B_1),
5878 .ips = addresses_B_1,
5879 .apply_expected = true
5880 },
5881 },
5882 /*
5883 * sgroup,released vs. unique,tombstone with same ip(s)
5884 */
5885 {
5886 .line = __location__,
5887 .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL),
5888 .wins = {
5889 .nb_flags = NBT_NM_GROUP,
5890 .mhomed = false,
5891 .num_ips = ctx->addresses_best_num,
5892 .ips = ctx->addresses_best,
5893 .apply_expected = true
5894 },
5895 .replica= {
5896 .type = WREPL_TYPE_UNIQUE,
5897 .state = WREPL_STATE_TOMBSTONE,
5898 .node = WREPL_NODE_B,
5899 .is_static = false,
5900 .num_ips = ctx->addresses_best_num,
5901 .ips = ctx->addresses_best,
5902 .apply_expected = true
5903 },
5904 },
5905 /*
5906 * sgroup,released vs. unique,tombstone with different ip(s)
5907 */
5908 {
5909 .line = __location__,
5910 .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL),
5911 .wins = {
5912 .nb_flags = NBT_NM_GROUP,
5913 .mhomed = false,
5914 .num_ips = ctx->addresses_best_num,
5915 .ips = ctx->addresses_best,
5916 .apply_expected = true
5917 },
5918 .replica= {
5919 .type = WREPL_TYPE_UNIQUE,
5920 .state = WREPL_STATE_TOMBSTONE,
5921 .node = WREPL_NODE_B,
5922 .is_static = false,
5923 .num_ips = ARRAY_SIZE(addresses_B_1),
5924 .ips = addresses_B_1,
5925 .apply_expected = true
5926 },
5927 },
5928 /*
5929 * special group vs. group section
5930 */
5931 /*
5932 * sgroup,released vs. group,active with same ip(s)
5933 */
5934 {
5935 .line = __location__,
5936 .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL),
5937 .wins = {
5938 .nb_flags = NBT_NM_GROUP,
5939 .mhomed = false,
5940 .num_ips = ctx->addresses_best_num,
5941 .ips = ctx->addresses_best,
5942 .apply_expected = true
5943 },
5944 .replica= {
5945 .type = WREPL_TYPE_GROUP,
5946 .state = WREPL_STATE_ACTIVE,
5947 .node = WREPL_NODE_B,
5948 .is_static = false,
5949 .num_ips = ctx->addresses_best_num,
5950 .ips = ctx->addresses_best,
5951 .apply_expected = true
5952 },
5953 },
5954 /*
5955 * sgroup,released vs. group,active with different ip(s)
5956 */
5957 {
5958 .line = __location__,
5959 .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL),
5960 .wins = {
5961 .nb_flags = NBT_NM_GROUP,
5962 .mhomed = false,
5963 .num_ips = ctx->addresses_best_num,
5964 .ips = ctx->addresses_best,
5965 .apply_expected = true
5966 },
5967 .replica= {
5968 .type = WREPL_TYPE_GROUP,
5969 .state = WREPL_STATE_ACTIVE,
5970 .node = WREPL_NODE_B,
5971 .is_static = false,
5972 .num_ips = ARRAY_SIZE(addresses_B_1),
5973 .ips = addresses_B_1,
5974 .apply_expected = true
5975 },
5976 },
5977 /*
5978 * sgroup,released vs. group,tombstone with same ip(s)
5979 */
5980 {
5981 .line = __location__,
5982 .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL),
5983 .wins = {
5984 .nb_flags = NBT_NM_GROUP,
5985 .mhomed = false,
5986 .num_ips = ctx->addresses_best_num,
5987 .ips = ctx->addresses_best,
5988 .apply_expected = true
5989 },
5990 .replica= {
5991 .type = WREPL_TYPE_GROUP,
5992 .state = WREPL_STATE_TOMBSTONE,
5993 .node = WREPL_NODE_B,
5994 .is_static = false,
5995 .num_ips = ctx->addresses_best_num,
5996 .ips = ctx->addresses_best,
5997 .apply_expected = true
5998 },
5999 },
6000 /*
6001 * sgroup,released vs. group,tombstone with different ip(s)
6002 */
6003 {
6004 .line = __location__,
6005 .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL),
6006 .wins = {
6007 .nb_flags = NBT_NM_GROUP,
6008 .mhomed = false,
6009 .num_ips = ctx->addresses_best_num,
6010 .ips = ctx->addresses_best,
6011 .apply_expected = true
6012 },
6013 .replica= {
6014 .type = WREPL_TYPE_GROUP,
6015 .state = WREPL_STATE_TOMBSTONE,
6016 .node = WREPL_NODE_B,
6017 .is_static = false,
6018 .num_ips = ARRAY_SIZE(addresses_B_1),
6019 .ips = addresses_B_1,
6020 .apply_expected = true
6021 },
6022 },
6023 /*
6024 * special group vs. special group section
6025 */
6026 /*
6027 * sgroup,released vs. sgroup,active with same ip(s)
6028 */
6029 {
6030 .line = __location__,
6031 .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL),
6032 .wins = {
6033 .nb_flags = NBT_NM_GROUP,
6034 .mhomed = false,
6035 .num_ips = ctx->addresses_best_num,
6036 .ips = ctx->addresses_best,
6037 .apply_expected = true
6038 },
6039 .replica= {
6040 .type = WREPL_TYPE_SGROUP,
6041 .state = WREPL_STATE_ACTIVE,
6042 .node = WREPL_NODE_B,
6043 .is_static = false,
6044 .num_ips = ctx->addresses_best_num,
6045 .ips = ctx->addresses_best,
6046 .apply_expected = true
6047 },
6048 },
6049 /*
6050 * sgroup,released vs. sgroup,active with different ip(s)
6051 */
6052 {
6053 .line = __location__,
6054 .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL),
6055 .wins = {
6056 .nb_flags = NBT_NM_GROUP,
6057 .mhomed = false,
6058 .num_ips = ctx->addresses_best_num,
6059 .ips = ctx->addresses_best,
6060 .apply_expected = true
6061 },
6062 .replica= {
6063 .type = WREPL_TYPE_SGROUP,
6064 .state = WREPL_STATE_ACTIVE,
6065 .node = WREPL_NODE_B,
6066 .is_static = false,
6067 .num_ips = ARRAY_SIZE(addresses_B_1),
6068 .ips = addresses_B_1,
6069 .apply_expected = true
6070 },
6071 },
6072 /*
6073 * sgroup,released vs. sgroup,tombstone with same ip(s)
6074 */
6075 {
6076 .line = __location__,
6077 .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL),
6078 .wins = {
6079 .nb_flags = NBT_NM_GROUP,
6080 .mhomed = false,
6081 .num_ips = ctx->addresses_best_num,
6082 .ips = ctx->addresses_best,
6083 .apply_expected = true
6084 },
6085 .replica= {
6086 .type = WREPL_TYPE_SGROUP,
6087 .state = WREPL_STATE_TOMBSTONE,
6088 .node = WREPL_NODE_B,
6089 .is_static = false,
6090 .num_ips = ctx->addresses_best_num,
6091 .ips = ctx->addresses_best,
6092 .apply_expected = true
6093 },
6094 },
6095 /*
6096 * sgroup,released vs. sgroup,tombstone with different ip(s)
6097 */
6098 {
6099 .line = __location__,
6100 .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL),
6101 .wins = {
6102 .nb_flags = NBT_NM_GROUP,
6103 .mhomed = false,
6104 .num_ips = ctx->addresses_best_num,
6105 .ips = ctx->addresses_best,
6106 .apply_expected = true
6107 },
6108 .replica= {
6109 .type = WREPL_TYPE_SGROUP,
6110 .state = WREPL_STATE_TOMBSTONE,
6111 .node = WREPL_NODE_B,
6112 .is_static = false,
6113 .num_ips = ARRAY_SIZE(addresses_B_1),
6114 .ips = addresses_B_1,
6115 .apply_expected = true
6116 },
6117 },
6118 /*
6119 * special group vs. multi homed section
6120 */
6121 /*
6122 * sgroup,released vs. mhomed,active with same ip(s)
6123 */
6124 {
6125 .line = __location__,
6126 .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL),
6127 .wins = {
6128 .nb_flags = NBT_NM_GROUP,
6129 .mhomed = false,
6130 .num_ips = ctx->addresses_best_num,
6131 .ips = ctx->addresses_best,
6132 .apply_expected = true
6133 },
6134 .replica= {
6135 .type = WREPL_TYPE_MHOMED,
6136 .state = WREPL_STATE_ACTIVE,
6137 .node = WREPL_NODE_B,
6138 .is_static = false,
6139 .num_ips = ctx->addresses_best_num,
6140 .ips = ctx->addresses_best,
6141 .apply_expected = true
6142 },
6143 },
6144 /*
6145 * sgroup,released vs. mhomed,active with different ip(s)
6146 */
6147 {
6148 .line = __location__,
6149 .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL),
6150 .wins = {
6151 .nb_flags = NBT_NM_GROUP,
6152 .mhomed = false,
6153 .num_ips = ctx->addresses_best_num,
6154 .ips = ctx->addresses_best,
6155 .apply_expected = true
6156 },
6157 .replica= {
6158 .type = WREPL_TYPE_MHOMED,
6159 .state = WREPL_STATE_ACTIVE,
6160 .node = WREPL_NODE_B,
6161 .is_static = false,
6162 .num_ips = ARRAY_SIZE(addresses_B_1),
6163 .ips = addresses_B_1,
6164 .apply_expected = true
6165 },
6166 },
6167 /*
6168 * sgroup,released vs. mhomed,tombstone with same ip(s)
6169 */
6170 {
6171 .line = __location__,
6172 .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL),
6173 .wins = {
6174 .nb_flags = NBT_NM_GROUP,
6175 .mhomed = false,
6176 .num_ips = ctx->addresses_best_num,
6177 .ips = ctx->addresses_best,
6178 .apply_expected = true
6179 },
6180 .replica= {
6181 .type = WREPL_TYPE_MHOMED,
6182 .state = WREPL_STATE_TOMBSTONE,
6183 .node = WREPL_NODE_B,
6184 .is_static = false,
6185 .num_ips = ctx->addresses_best_num,
6186 .ips = ctx->addresses_best,
6187 .apply_expected = true
6188 },
6189 },
6190 /*
6191 * sgroup,released vs. mhomed,tombstone with different ip(s)
6192 */
6193 {
6194 .line = __location__,
6195 .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL),
6196 .wins = {
6197 .nb_flags = NBT_NM_GROUP,
6198 .mhomed = false,
6199 .num_ips = ctx->addresses_best_num,
6200 .ips = ctx->addresses_best,
6201 .apply_expected = true
6202 },
6203 .replica= {
6204 .type = WREPL_TYPE_MHOMED,
6205 .state = WREPL_STATE_TOMBSTONE,
6206 .node = WREPL_NODE_B,
6207 .is_static = false,
6208 .num_ips = ARRAY_SIZE(addresses_B_1),
6209 .ips = addresses_B_1,
6210 .apply_expected = true
6211 },
6212 },
6213 /*
6214 * multi homed vs. unique section
6215 */
6216 /*
6217 * mhomed,released vs. unique,active with same ip(s)
6218 */
6219 {
6220 .line = __location__,
6221 .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL),
6222 .wins = {
6223 .nb_flags = 0,
6224 .mhomed = true,
6225 .num_ips = ctx->addresses_best_num,
6226 .ips = ctx->addresses_best,
6227 .apply_expected = true
6228 },
6229 .replica= {
6230 .type = WREPL_TYPE_UNIQUE,
6231 .state = WREPL_STATE_ACTIVE,
6232 .node = WREPL_NODE_B,
6233 .is_static = false,
6234 .num_ips = ctx->addresses_best_num,
6235 .ips = ctx->addresses_best,
6236 .apply_expected = true
6237 },
6238 },
6239 /*
6240 * mhomed,released vs. unique,active with different ip(s)
6241 */
6242 {
6243 .line = __location__,
6244 .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL),
6245 .wins = {
6246 .nb_flags = 0,
6247 .mhomed = true,
6248 .num_ips = ctx->addresses_best_num,
6249 .ips = ctx->addresses_best,
6250 .apply_expected = true
6251 },
6252 .replica= {
6253 .type = WREPL_TYPE_UNIQUE,
6254 .state = WREPL_STATE_ACTIVE,
6255 .node = WREPL_NODE_B,
6256 .is_static = false,
6257 .num_ips = ARRAY_SIZE(addresses_B_1),
6258 .ips = addresses_B_1,
6259 .apply_expected = true
6260 },
6261 },
6262 /*
6263 * mhomed,released vs. unique,tombstone with same ip(s)
6264 */
6265 {
6266 .line = __location__,
6267 .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL),
6268 .wins = {
6269 .nb_flags = 0,
6270 .mhomed = true,
6271 .num_ips = ctx->addresses_best_num,
6272 .ips = ctx->addresses_best,
6273 .apply_expected = true
6274 },
6275 .replica= {
6276 .type = WREPL_TYPE_UNIQUE,
6277 .state = WREPL_STATE_TOMBSTONE,
6278 .node = WREPL_NODE_B,
6279 .is_static = false,
6280 .num_ips = ctx->addresses_best_num,
6281 .ips = ctx->addresses_best,
6282 .apply_expected = true
6283 },
6284 },
6285 /*
6286 * mhomed,released vs. unique,tombstone with different ip(s)
6287 */
6288 {
6289 .line = __location__,
6290 .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL),
6291 .wins = {
6292 .nb_flags = 0,
6293 .mhomed = true,
6294 .num_ips = ctx->addresses_best_num,
6295 .ips = ctx->addresses_best,
6296 .apply_expected = true
6297 },
6298 .replica= {
6299 .type = WREPL_TYPE_UNIQUE,
6300 .state = WREPL_STATE_TOMBSTONE,
6301 .node = WREPL_NODE_B,
6302 .is_static = false,
6303 .num_ips = ARRAY_SIZE(addresses_B_1),
6304 .ips = addresses_B_1,
6305 .apply_expected = true
6306 },
6307 },
6308 /*
6309 * multi homed vs. group section
6310 */
6311 /*
6312 * mhomed,released vs. group,active with same ip(s)
6313 */
6314 {
6315 .line = __location__,
6316 .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL),
6317 .wins = {
6318 .nb_flags = 0,
6319 .mhomed = true,
6320 .num_ips = ctx->addresses_best_num,
6321 .ips = ctx->addresses_best,
6322 .apply_expected = true
6323 },
6324 .replica= {
6325 .type = WREPL_TYPE_GROUP,
6326 .state = WREPL_STATE_ACTIVE,
6327 .node = WREPL_NODE_B,
6328 .is_static = false,
6329 .num_ips = ctx->addresses_best_num,
6330 .ips = ctx->addresses_best,
6331 .apply_expected = true
6332 },
6333 },
6334 /*
6335 * mhomed,released vs. group,active with different ip(s)
6336 */
6337 {
6338 .line = __location__,
6339 .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL),
6340 .wins = {
6341 .nb_flags = 0,
6342 .mhomed = true,
6343 .num_ips = ctx->addresses_best_num,
6344 .ips = ctx->addresses_best,
6345 .apply_expected = true
6346 },
6347 .replica= {
6348 .type = WREPL_TYPE_GROUP,
6349 .state = WREPL_STATE_ACTIVE,
6350 .node = WREPL_NODE_B,
6351 .is_static = false,
6352 .num_ips = ARRAY_SIZE(addresses_B_1),
6353 .ips = addresses_B_1,
6354 .apply_expected = true
6355 },
6356 },
6357 /*
6358 * mhomed,released vs. group,tombstone with same ip(s)
6359 */
6360 {
6361 .line = __location__,
6362 .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL),
6363 .wins = {
6364 .nb_flags = 0,
6365 .mhomed = true,
6366 .num_ips = ctx->addresses_best_num,
6367 .ips = ctx->addresses_best,
6368 .apply_expected = true
6369 },
6370 .replica= {
6371 .type = WREPL_TYPE_GROUP,
6372 .state = WREPL_STATE_TOMBSTONE,
6373 .node = WREPL_NODE_B,
6374 .is_static = false,
6375 .num_ips = ctx->addresses_best_num,
6376 .ips = ctx->addresses_best,
6377 .apply_expected = true
6378 },
6379 },
6380 /*
6381 * mhomed,released vs. group,tombstone with different ip(s)
6382 */
6383 {
6384 .line = __location__,
6385 .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL),
6386 .wins = {
6387 .nb_flags = 0,
6388 .mhomed = true,
6389 .num_ips = ctx->addresses_best_num,
6390 .ips = ctx->addresses_best,
6391 .apply_expected = true
6392 },
6393 .replica= {
6394 .type = WREPL_TYPE_GROUP,
6395 .state = WREPL_STATE_TOMBSTONE,
6396 .node = WREPL_NODE_B,
6397 .is_static = false,
6398 .num_ips = ARRAY_SIZE(addresses_B_1),
6399 .ips = addresses_B_1,
6400 .apply_expected = true
6401 },
6402 },
6403 /*
6404 * multi homed vs. special group section
6405 */
6406 /*
6407 * mhomed,released vs. sgroup,active with same ip(s)
6408 */
6409 {
6410 .line = __location__,
6411 .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL),
6412 .wins = {
6413 .nb_flags = 0,
6414 .mhomed = true,
6415 .num_ips = ctx->addresses_best_num,
6416 .ips = ctx->addresses_best,
6417 .apply_expected = true
6418 },
6419 .replica= {
6420 .type = WREPL_TYPE_SGROUP,
6421 .state = WREPL_STATE_ACTIVE,
6422 .node = WREPL_NODE_B,
6423 .is_static = false,
6424 .num_ips = ctx->addresses_best_num,
6425 .ips = ctx->addresses_best,
6426 .apply_expected = true
6427 },
6428 },
6429 /*
6430 * mhomed,released vs. sgroup,active with different ip(s)
6431 */
6432 {
6433 .line = __location__,
6434 .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL),
6435 .wins = {
6436 .nb_flags = 0,
6437 .mhomed = true,
6438 .num_ips = ctx->addresses_best_num,
6439 .ips = ctx->addresses_best,
6440 .apply_expected = true
6441 },
6442 .replica= {
6443 .type = WREPL_TYPE_SGROUP,
6444 .state = WREPL_STATE_ACTIVE,
6445 .node = WREPL_NODE_B,
6446 .is_static = false,
6447 .num_ips = ARRAY_SIZE(addresses_B_1),
6448 .ips = addresses_B_1,
6449 .apply_expected = true
6450 },
6451 },
6452 /*
6453 * mhomed,released vs. sgroup,tombstone with same ip(s)
6454 */
6455 {
6456 .line = __location__,
6457 .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL),
6458 .wins = {
6459 .nb_flags = 0,
6460 .mhomed = true,
6461 .num_ips = ctx->addresses_best_num,
6462 .ips = ctx->addresses_best,
6463 .apply_expected = true
6464 },
6465 .replica= {
6466 .type = WREPL_TYPE_SGROUP,
6467 .state = WREPL_STATE_TOMBSTONE,
6468 .node = WREPL_NODE_B,
6469 .is_static = false,
6470 .num_ips = ctx->addresses_best_num,
6471 .ips = ctx->addresses_best,
6472 .apply_expected = true
6473 },
6474 },
6475 /*
6476 * mhomed,released vs. sgroup,tombstone with different ip(s)
6477 */
6478 {
6479 .line = __location__,
6480 .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL),
6481 .wins = {
6482 .nb_flags = 0,
6483 .mhomed = true,
6484 .num_ips = ctx->addresses_best_num,
6485 .ips = ctx->addresses_best,
6486 .apply_expected = true
6487 },
6488 .replica= {
6489 .type = WREPL_TYPE_SGROUP,
6490 .state = WREPL_STATE_TOMBSTONE,
6491 .node = WREPL_NODE_B,
6492 .is_static = false,
6493 .num_ips = ARRAY_SIZE(addresses_B_1),
6494 .ips = addresses_B_1,
6495 .apply_expected = true
6496 },
6497 },
6498 /*
6499 * multi homed vs. multi homed section
6500 */
6501 /*
6502 * mhomed,released vs. mhomed,active with same ip(s)
6503 */
6504 {
6505 .line = __location__,
6506 .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL),
6507 .wins = {
6508 .nb_flags = 0,
6509 .mhomed = true,
6510 .num_ips = ctx->addresses_best_num,
6511 .ips = ctx->addresses_best,
6512 .apply_expected = true
6513 },
6514 .replica= {
6515 .type = WREPL_TYPE_MHOMED,
6516 .state = WREPL_STATE_ACTIVE,
6517 .node = WREPL_NODE_B,
6518 .is_static = false,
6519 .num_ips = ctx->addresses_best_num,
6520 .ips = ctx->addresses_best,
6521 .apply_expected = true
6522 },
6523 },
6524 /*
6525 * mhomed,released vs. mhomed,active with different ip(s)
6526 */
6527 {
6528 .line = __location__,
6529 .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL),
6530 .wins = {
6531 .nb_flags = 0,
6532 .mhomed = true,
6533 .num_ips = ctx->addresses_best_num,
6534 .ips = ctx->addresses_best,
6535 .apply_expected = true
6536 },
6537 .replica= {
6538 .type = WREPL_TYPE_MHOMED,
6539 .state = WREPL_STATE_ACTIVE,
6540 .node = WREPL_NODE_B,
6541 .is_static = false,
6542 .num_ips = ARRAY_SIZE(addresses_B_1),
6543 .ips = addresses_B_1,
6544 .apply_expected = true
6545 },
6546 },
6547 /*
6548 * mhomed,released vs. mhomed,tombstone with same ip(s)
6549 */
6550 {
6551 .line = __location__,
6552 .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL),
6553 .wins = {
6554 .nb_flags = 0,
6555 .mhomed = true,
6556 .num_ips = ctx->addresses_best_num,
6557 .ips = ctx->addresses_best,
6558 .apply_expected = true
6559 },
6560 .replica= {
6561 .type = WREPL_TYPE_MHOMED,
6562 .state = WREPL_STATE_TOMBSTONE,
6563 .node = WREPL_NODE_B,
6564 .is_static = false,
6565 .num_ips = ctx->addresses_best_num,
6566 .ips = ctx->addresses_best,
6567 .apply_expected = true
6568 },
6569 },
6570 /*
6571 * mhomed,released vs. mhomed,tombstone with different ip(s)
6572 */
6573 {
6574 .line = __location__,
6575 .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL),
6576 .wins = {
6577 .nb_flags = 0,
6578 .mhomed = true,
6579 .num_ips = ctx->addresses_best_num,
6580 .ips = ctx->addresses_best,
6581 .apply_expected = true
6582 },
6583 .replica= {
6584 .type = WREPL_TYPE_MHOMED,
6585 .state = WREPL_STATE_TOMBSTONE,
6586 .node = WREPL_NODE_B,
6587 .is_static = false,
6588 .num_ips = ARRAY_SIZE(addresses_B_1),
6589 .ips = addresses_B_1,
6590 .apply_expected = true
6591 },
6592 },
6593 };
6594
6595 torture_comment(tctx, "Test Replica records vs. owned released records\n");
6596
6597 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
6598 torture_comment(tctx, "%s => %s\n", nbt_name_string(ctx, &records[i].name),
6599 (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE"));
6600
6601 /*
6602 * Setup Register
6603 */
6604 name_register->in.name = records[i].name;
6605 name_register->in.dest_addr = ctx->address;
6606 name_register->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
6607 name_register->in.address = records[i].wins.ips[0].ip;
6608 name_register->in.nb_flags = records[i].wins.nb_flags;
6609 name_register->in.register_demand= false;
6610 name_register->in.broadcast = false;
6611 name_register->in.multi_homed = records[i].wins.mhomed;
6612 name_register->in.ttl = 300000;
6613 name_register->in.timeout = 70;
6614 name_register->in.retries = 0;
6615
6616 status = nbt_name_register(ctx->nbtsock, ctx, name_register);
6617 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6618 torture_comment(tctx, "No response from %s for name register\n", ctx->address);
6619 ret = false;
6620 }
6621 if (!NT_STATUS_IS_OK(status)) {
6622 torture_comment(tctx, "Bad response from %s for name register - %s\n",
6623 ctx->address, nt_errstr(status));
6624 ret = false;
6625 }
6626 CHECK_VALUE(tctx, name_register->out.rcode, 0);
6627 CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address);
6628 CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type);
6629 CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name);
6630 CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope);
6631 CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[0].ip);
6632
6633 /* release the record */
6634 release->in.name = records[i].name;
6635 release->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
6636 release->in.dest_addr = ctx->address;
6637 release->in.address = records[i].wins.ips[0].ip;
6638 release->in.nb_flags = records[i].wins.nb_flags;
6639 release->in.broadcast = false;
6640 release->in.timeout = 30;
6641 release->in.retries = 0;
6642
6643 status = nbt_name_release(ctx->nbtsock, ctx, release);
6644 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6645 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
6646 return false;
6647 }
6648 if (!NT_STATUS_IS_OK(status)) {
6649 torture_comment(tctx, "Bad response from %s for name query - %s\n",
6650 ctx->address, nt_errstr(status));
6651 return false;
6652 }
6653 CHECK_VALUE(tctx, release->out.rcode, 0);
6654
6655 /*
6656 * Setup Replica
6657 */
6658 wins_name->name = &records[i].name;
6659 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
6660 records[i].replica.state,
6661 records[i].replica.node,
6662 records[i].replica.is_static);
6663 wins_name->id = ++ctx->b.max_version;
6664 if (wins_name->flags & 2) {
6665 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
6666 wins_name->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
6667 records[i].replica.ips);
6668 } else {
6669 wins_name->addresses.ip = records[i].replica.ips[0].ip;
6670 }
6671 wins_name->unknown = "255.255.255.255";
6672
6673 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
6674 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name,
6675 records[i].replica.apply_expected);
6676
6677 if (records[i].replica.apply_expected) {
6678 wins_name->name = &records[i].name;
6679 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
6680 WREPL_STATE_TOMBSTONE,
6681 WREPL_NODE_B, false);
6682 wins_name->id = ++ctx->b.max_version;
6683 wins_name->addresses.ip = addresses_B_1[0].ip;
6684 wins_name->unknown = "255.255.255.255";
6685
6686 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
6687 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
6688 } else {
6689 release->in.name = records[i].name;
6690 release->in.dest_addr = ctx->address;
6691 release->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
6692 release->in.address = records[i].wins.ips[0].ip;
6693 release->in.nb_flags = records[i].wins.nb_flags;
6694 release->in.broadcast = false;
6695 release->in.timeout = 30;
6696 release->in.retries = 0;
6697
6698 status = nbt_name_release(ctx->nbtsock, ctx, release);
6699 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
6700 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
6701 return false;
6702 }
6703 if (!NT_STATUS_IS_OK(status)) {
6704 torture_comment(tctx, "Bad response from %s for name query - %s\n",
6705 ctx->address, nt_errstr(status));
6706 return false;
6707 }
6708 CHECK_VALUE(tctx, release->out.rcode, 0);
6709 }
6710 if (!ret) {
6711 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
6712 return ret;
6713 }
6714 }
6715
6716 return ret;
6717 }
6718
6719 struct test_conflict_owned_active_vs_replica_struct {
6720 struct torture_context *tctx;
6721 const char *line; /* just better debugging */
6722 const char *section; /* just better debugging */
6723 struct nbt_name name;
6724 const char *comment;
6725 bool skip;
6726 struct {
6727 uint32_t nb_flags;
6728 bool mhomed;
6729 uint32_t num_ips;
6730 const struct wrepl_ip *ips;
6731 bool apply_expected;
6732 } wins;
6733 struct {
6734 uint32_t timeout;
6735 bool positive;
6736 bool expect_release;
6737 bool late_release;
6738 bool ret;
6739 /* when num_ips == 0, then .wins.ips are used */
6740 uint32_t num_ips;
6741 const struct wrepl_ip *ips;
6742 } defend;
6743 struct {
6744 enum wrepl_name_type type;
6745 enum wrepl_name_state state;
6746 enum wrepl_name_node node;
6747 bool is_static;
6748 uint32_t num_ips;
6749 const struct wrepl_ip *ips;
6750 bool apply_expected;
6751 bool mhomed_merge;
6752 bool sgroup_merge;
6753 } replica;
6754 };
6755
6756 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
6757 struct nbt_name_packet *req_packet,
6758 struct socket_address *src);
6759
6760 static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx,
6761 struct test_wrepl_conflict_conn *ctx)
6762 {
6763 bool ret = true;
6764 NTSTATUS status;
6765 struct wrepl_wins_name wins_name_ = {
6766 .flags = 0,
6767 };
6768 struct wrepl_wins_name *wins_name = &wins_name_;
6769 struct nbt_name_register name_register_;
6770 struct nbt_name_register *name_register = &name_register_;
6771 struct nbt_name_release release_;
6772 struct nbt_name_release *release = &release_;
6773 uint32_t i;
6774 struct test_conflict_owned_active_vs_replica_struct records[] = {
6775 /*
6776 * unique vs. unique section
6777 */
6778 /*
6779 * unique,active vs. unique,active with same ip(s), unchecked
6780 */
6781 {
6782 .tctx = tctx,
6783 .line = __location__,
6784 .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL),
6785 .wins = {
6786 .nb_flags = 0,
6787 .mhomed = false,
6788 .num_ips = ctx->addresses_best_num,
6789 .ips = ctx->addresses_best,
6790 .apply_expected = true
6791 },
6792 .defend = {
6793 .timeout = 0,
6794 },
6795 .replica= {
6796 .type = WREPL_TYPE_UNIQUE,
6797 .state = WREPL_STATE_ACTIVE,
6798 .node = WREPL_NODE_B,
6799 .is_static = false,
6800 .num_ips = ctx->addresses_best_num,
6801 .ips = ctx->addresses_best,
6802 .apply_expected = true
6803 },
6804 },
6805 /*
6806 * unique,active vs. unique,active with different ip(s), positive response
6807 */
6808 {
6809 .tctx = tctx,
6810 .line = __location__,
6811 .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL),
6812 .wins = {
6813 .nb_flags = 0,
6814 .mhomed = false,
6815 .num_ips = ctx->addresses_best_num,
6816 .ips = ctx->addresses_best,
6817 .apply_expected = true
6818 },
6819 .defend = {
6820 .timeout = 10,
6821 .positive = true,
6822 },
6823 .replica= {
6824 .type = WREPL_TYPE_UNIQUE,
6825 .state = WREPL_STATE_ACTIVE,
6826 .node = WREPL_NODE_B,
6827 .is_static = false,
6828 .num_ips = ARRAY_SIZE(addresses_B_1),
6829 .ips = addresses_B_1,
6830 .apply_expected = false
6831 },
6832 },
6833 /*
6834 * unique,active vs. unique,active with different ip(s), positive response other ips
6835 */
6836 {
6837 .tctx = tctx,
6838 .line = __location__,
6839 .name = _NBT_NAME("_UA_UA_DI_O", 0x00, NULL),
6840 .wins = {
6841 .nb_flags = 0,
6842 .mhomed = false,
6843 .num_ips = ctx->addresses_best_num,
6844 .ips = ctx->addresses_best,
6845 .apply_expected = true
6846 },
6847 .defend = {
6848 .timeout = 10,
6849 .positive = true,
6850 .num_ips = ARRAY_SIZE(addresses_A_3_4),
6851 .ips = addresses_A_3_4,
6852 },
6853 .replica= {
6854 .type = WREPL_TYPE_UNIQUE,
6855 .state = WREPL_STATE_ACTIVE,
6856 .node = WREPL_NODE_B,
6857 .is_static = false,
6858 .num_ips = ARRAY_SIZE(addresses_B_1),
6859 .ips = addresses_B_1,
6860 .apply_expected = false
6861 },
6862 },
6863 /*
6864 * unique,active vs. unique,active with different ip(s), negative response
6865 */
6866 {
6867 .tctx = tctx,
6868 .line = __location__,
6869 .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL),
6870 .wins = {
6871 .nb_flags = 0,
6872 .mhomed = false,
6873 .num_ips = ctx->addresses_best_num,
6874 .ips = ctx->addresses_best,
6875 .apply_expected = true
6876 },
6877 .defend = {
6878 .timeout = 10,
6879 .positive = false,
6880 },
6881 .replica= {
6882 .type = WREPL_TYPE_UNIQUE,
6883 .state = WREPL_STATE_ACTIVE,
6884 .node = WREPL_NODE_B,
6885 .is_static = false,
6886 .num_ips = ARRAY_SIZE(addresses_B_1),
6887 .ips = addresses_B_1,
6888 .apply_expected = true
6889 },
6890 },
6891 /*
6892 * unique,active vs. unique,tombstone with same ip(s), unchecked
6893 */
6894 {
6895 .tctx = tctx,
6896 .line = __location__,
6897 .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL),
6898 .wins = {
6899 .nb_flags = 0,
6900 .mhomed = false,
6901 .num_ips = ctx->addresses_best_num,
6902 .ips = ctx->addresses_best,
6903 .apply_expected = true
6904 },
6905 .defend = {
6906 .timeout = 0,
6907 },
6908 .replica= {
6909 .type = WREPL_TYPE_UNIQUE,
6910 .state = WREPL_STATE_TOMBSTONE,
6911 .node = WREPL_NODE_B,
6912 .is_static = false,
6913 .num_ips = ctx->addresses_best_num,
6914 .ips = ctx->addresses_best,
6915 .apply_expected = false
6916 },
6917 },
6918 /*
6919 * unique,active vs. unique,tombstone with different ip(s), unchecked
6920 */
6921 {
6922 .tctx = tctx,
6923 .line = __location__,
6924 .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL),
6925 .wins = {
6926 .nb_flags = 0,
6927 .mhomed = false,
6928 .num_ips = ctx->addresses_best_num,
6929 .ips = ctx->addresses_best,
6930 .apply_expected = true
6931 },
6932 .defend = {
6933 .timeout = 0,
6934 },
6935 .replica= {
6936 .type = WREPL_TYPE_UNIQUE,
6937 .state = WREPL_STATE_TOMBSTONE,
6938 .node = WREPL_NODE_B,
6939 .is_static = false,
6940 .num_ips = ARRAY_SIZE(addresses_B_1),
6941 .ips = addresses_B_1,
6942 .apply_expected = false
6943 },
6944 },
6945 /*
6946 * unique vs. group section
6947 */
6948 /*
6949 * unique,active vs. group,active with same ip(s), release expected
6950 */
6951 {
6952 .tctx = tctx,
6953 .line = __location__,
6954 .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL),
6955 .wins = {
6956 .nb_flags = 0,
6957 .mhomed = false,
6958 .num_ips = ctx->addresses_best_num,
6959 .ips = ctx->addresses_best,
6960 .apply_expected = true
6961 },
6962 .defend = {
6963 .timeout = 10,
6964 .expect_release = true,
6965 },
6966 .replica= {
6967 .type = WREPL_TYPE_GROUP,
6968 .state = WREPL_STATE_ACTIVE,
6969 .node = WREPL_NODE_B,
6970 .is_static = false,
6971 .num_ips = ctx->addresses_best_num,
6972 .ips = ctx->addresses_best,
6973 .apply_expected = true
6974 },
6975 },
6976 /*
6977 * unique,active vs. group,active with different ip(s), release expected
6978 */
6979 {
6980 .tctx = tctx,
6981 .line = __location__,
6982 .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL),
6983 .wins = {
6984 .nb_flags = 0,
6985 .mhomed = false,
6986 .num_ips = ctx->addresses_best_num,
6987 .ips = ctx->addresses_best,
6988 .apply_expected = true
6989 },
6990 .defend = {
6991 .timeout = 10,
6992 .expect_release = true,
6993 },
6994 .replica= {
6995 .type = WREPL_TYPE_GROUP,
6996 .state = WREPL_STATE_ACTIVE,
6997 .node = WREPL_NODE_B,
6998 .is_static = false,
6999 .num_ips = ARRAY_SIZE(addresses_B_1),
7000 .ips = addresses_B_1,
7001 .apply_expected = true
7002 },
7003 },
7004 /*
7005 * unique,active vs. group,tombstone with same ip(s), unchecked
7006 */
7007 {
7008 .tctx = tctx,
7009 .line = __location__,
7010 .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL),
7011 .wins = {
7012 .nb_flags = 0,
7013 .mhomed = false,
7014 .num_ips = ctx->addresses_best_num,
7015 .ips = ctx->addresses_best,
7016 .apply_expected = true
7017 },
7018 .defend = {
7019 .timeout = 0,
7020 },
7021 .replica= {
7022 .type = WREPL_TYPE_GROUP,
7023 .state = WREPL_STATE_TOMBSTONE,
7024 .node = WREPL_NODE_B,
7025 .is_static = false,
7026 .num_ips = ctx->addresses_best_num,
7027 .ips = ctx->addresses_best,
7028 .apply_expected = false
7029 },
7030 },
7031 /*
7032 * unique,active vs. group,tombstone with different ip(s), unchecked
7033 */
7034 {
7035 .tctx = tctx,
7036 .line = __location__,
7037 .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL),
7038 .wins = {
7039 .nb_flags = 0,
7040 .mhomed = false,
7041 .num_ips = ctx->addresses_best_num,
7042 .ips = ctx->addresses_best,
7043 .apply_expected = true
7044 },
7045 .defend = {
7046 .timeout = 0,
7047 },
7048 .replica= {
7049 .type = WREPL_TYPE_GROUP,
7050 .state = WREPL_STATE_TOMBSTONE,
7051 .node = WREPL_NODE_B,
7052 .is_static = false,
7053 .num_ips = ARRAY_SIZE(addresses_B_1),
7054 .ips = addresses_B_1,
7055 .apply_expected = false
7056 },
7057 },
7058 /*
7059 * unique vs. special group section
7060 */
7061 /*
7062 * unique,active vs. sgroup,active with same ip(s), release expected
7063 */
7064 {
7065 .tctx = tctx,
7066 .line = __location__,
7067 .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL),
7068 .wins = {
7069 .nb_flags = 0,
7070 .mhomed = false,
7071 .num_ips = ctx->addresses_best_num,
7072 .ips = ctx->addresses_best,
7073 .apply_expected = true
7074 },
7075 .defend = {
7076 .timeout = 10,
7077 .expect_release = true,
7078 },
7079 .replica= {
7080 .type = WREPL_TYPE_SGROUP,
7081 .state = WREPL_STATE_ACTIVE,
7082 .node = WREPL_NODE_B,
7083 .is_static = false,
7084 .num_ips = ctx->addresses_best_num,
7085 .ips = ctx->addresses_best,
7086 .apply_expected = true
7087 },
7088 },
7089 /*
7090 * unique,active vs. group,active with different ip(s), release expected
7091 */
7092 {
7093 .tctx = tctx,
7094 .line = __location__,
7095 .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL),
7096 .wins = {
7097 .nb_flags = 0,
7098 .mhomed = false,
7099 .num_ips = ctx->addresses_best_num,
7100 .ips = ctx->addresses_best,
7101 .apply_expected = true
7102 },
7103 .defend = {
7104 .timeout = 10,
7105 .expect_release = true,
7106 },
7107 .replica= {
7108 .type = WREPL_TYPE_SGROUP,
7109 .state = WREPL_STATE_ACTIVE,
7110 .node = WREPL_NODE_B,
7111 .is_static = false,
7112 .num_ips = ARRAY_SIZE(addresses_B_1),
7113 .ips = addresses_B_1,
7114 .apply_expected = true
7115 },
7116 },
7117 /*
7118 * unique,active vs. sgroup,tombstone with same ip(s), unchecked
7119 */
7120 {
7121 .tctx = tctx,
7122 .line = __location__,
7123 .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL),
7124 .wins = {
7125 .nb_flags = 0,
7126 .mhomed = false,
7127 .num_ips = ctx->addresses_best_num,
7128 .ips = ctx->addresses_best,
7129 .apply_expected = true
7130 },
7131 .defend = {
7132 .timeout = 0,
7133 },
7134 .replica= {
7135 .type = WREPL_TYPE_SGROUP,
7136 .state = WREPL_STATE_TOMBSTONE,
7137 .node = WREPL_NODE_B,
7138 .is_static = false,
7139 .num_ips = ctx->addresses_best_num,
7140 .ips = ctx->addresses_best,
7141 .apply_expected = false
7142 },
7143 },
7144 /*
7145 * unique,active vs. sgroup,tombstone with different ip(s), unchecked
7146 */
7147 {
7148 .tctx = tctx,
7149 .line = __location__,
7150 .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL),
7151 .wins = {
7152 .nb_flags = 0,
7153 .mhomed = false,
7154 .num_ips = ctx->addresses_best_num,
7155 .ips = ctx->addresses_best,
7156 .apply_expected = true
7157 },
7158 .defend = {
7159 .timeout = 0,
7160 },
7161 .replica= {
7162 .type = WREPL_TYPE_SGROUP,
7163 .state = WREPL_STATE_TOMBSTONE,
7164 .node = WREPL_NODE_B,
7165 .is_static = false,
7166 .num_ips = ARRAY_SIZE(addresses_B_1),
7167 .ips = addresses_B_1,
7168 .apply_expected = false
7169 },
7170 },
7171 /*
7172 * unique vs. multi homed section
7173 */
7174 /*
7175 * unique,active vs. mhomed,active with same ip(s), unchecked
7176 */
7177 {
7178 .tctx = tctx,
7179 .line = __location__,
7180 .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL),
7181 .wins = {
7182 .nb_flags = 0,
7183 .mhomed = false,
7184 .num_ips = ctx->addresses_best_num,
7185 .ips = ctx->addresses_best,
7186 .apply_expected = true
7187 },
7188 .defend = {
7189 .timeout = 0,
7190 },
7191 .replica= {
7192 .type = WREPL_TYPE_MHOMED,
7193 .state = WREPL_STATE_ACTIVE,
7194 .node = WREPL_NODE_B,
7195 .is_static = false,
7196 .num_ips = ctx->addresses_best_num,
7197 .ips = ctx->addresses_best,
7198 .apply_expected = true
7199 },
7200 },
7201 /*
7202 * unique,active vs. mhomed,active with superset ip(s), unchecked
7203 */
7204 {
7205 .tctx = tctx,
7206 .line = __location__,
7207 .name = _NBT_NAME("_UA_MA_SP_U", 0x00, NULL),
7208 .wins = {
7209 .nb_flags = 0,
7210 .mhomed = false,
7211 .num_ips = ctx->addresses_best_num,
7212 .ips = ctx->addresses_best,
7213 .apply_expected = true
7214 },
7215 .defend = {
7216 .timeout = 0,
7217 },
7218 .replica= {
7219 .type = WREPL_TYPE_MHOMED,
7220 .state = WREPL_STATE_ACTIVE,
7221 .node = WREPL_NODE_B,
7222 .is_static = false,
7223 .num_ips = ctx->addresses_all_num,
7224 .ips = ctx->addresses_all,
7225 .apply_expected = true
7226 },
7227 },
7228 /*
7229 * unique,active vs. mhomed,active with different ip(s), positive response
7230 */
7231 {
7232 .tctx = tctx,
7233 .line = __location__,
7234 .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL),
7235 .wins = {
7236 .nb_flags = 0,
7237 .mhomed = false,
7238 .num_ips = ctx->addresses_best_num,
7239 .ips = ctx->addresses_best,
7240 .apply_expected = true
7241 },
7242 .defend = {
7243 .timeout = 10,
7244 .positive = true,
7245 },
7246 .replica= {
7247 .type = WREPL_TYPE_MHOMED,
7248 .state = WREPL_STATE_ACTIVE,
7249 .node = WREPL_NODE_B,
7250 .is_static = false,
7251 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7252 .ips = addresses_B_3_4,
7253 .apply_expected = false
7254 },
7255 },
7256 /*
7257 * unique,active vs. mhomed,active with different ip(s), positive response other ips
7258 */
7259 {
7260 .tctx = tctx,
7261 .line = __location__,
7262 .name = _NBT_NAME("_UA_MA_DI_O", 0x00, NULL),
7263 .wins = {
7264 .nb_flags = 0,
7265 .mhomed = false,
7266 .num_ips = ctx->addresses_best_num,
7267 .ips = ctx->addresses_best,
7268 .apply_expected = true
7269 },
7270 .defend = {
7271 .timeout = 10,
7272 .positive = true,
7273 .num_ips = ARRAY_SIZE(addresses_A_3_4),
7274 .ips = addresses_A_3_4,
7275 },
7276 .replica= {
7277 .type = WREPL_TYPE_MHOMED,
7278 .state = WREPL_STATE_ACTIVE,
7279 .node = WREPL_NODE_B,
7280 .is_static = false,
7281 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7282 .ips = addresses_B_3_4,
7283 .apply_expected = false
7284 },
7285 },
7286 /*
7287 * unique,active vs. mhomed,active with different ip(s), negative response
7288 */
7289 {
7290 .tctx = tctx,
7291 .line = __location__,
7292 .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL),
7293 .wins = {
7294 .nb_flags = 0,
7295 .mhomed = false,
7296 .num_ips = ctx->addresses_best_num,
7297 .ips = ctx->addresses_best,
7298 .apply_expected = true
7299 },
7300 .defend = {
7301 .timeout = 10,
7302 .positive = false,
7303 },
7304 .replica= {
7305 .type = WREPL_TYPE_MHOMED,
7306 .state = WREPL_STATE_ACTIVE,
7307 .node = WREPL_NODE_B,
7308 .is_static = false,
7309 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7310 .ips = addresses_B_3_4,
7311 .apply_expected = true
7312 },
7313 },
7314 /*
7315 * unique,active vs. mhomed,tombstone with same ip(s), unchecked
7316 */
7317 {
7318 .tctx = tctx,
7319 .line = __location__,
7320 .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL),
7321 .wins = {
7322 .nb_flags = 0,
7323 .mhomed = false,
7324 .num_ips = ctx->addresses_best_num,
7325 .ips = ctx->addresses_best,
7326 .apply_expected = true
7327 },
7328 .defend = {
7329 .timeout = 0,
7330 },
7331 .replica= {
7332 .type = WREPL_TYPE_MHOMED,
7333 .state = WREPL_STATE_TOMBSTONE,
7334 .node = WREPL_NODE_B,
7335 .is_static = false,
7336 .num_ips = ctx->addresses_best_num,
7337 .ips = ctx->addresses_best,
7338 .apply_expected = false
7339 },
7340 },
7341 /*
7342 * unique,active vs. mhomed,tombstone with different ip(s), unchecked
7343 */
7344 {
7345 .tctx = tctx,
7346 .line = __location__,
7347 .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL),
7348 .wins = {
7349 .nb_flags = 0,
7350 .mhomed = false,
7351 .num_ips = ctx->addresses_best_num,
7352 .ips = ctx->addresses_best,
7353 .apply_expected = true
7354 },
7355 .defend = {
7356 .timeout = 0,
7357 },
7358 .replica= {
7359 .type = WREPL_TYPE_MHOMED,
7360 .state = WREPL_STATE_TOMBSTONE,
7361 .node = WREPL_NODE_B,
7362 .is_static = false,
7363 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7364 .ips = addresses_B_3_4,
7365 .apply_expected = false
7366 },
7367 },
7368 /*
7369 * normal group vs. unique section
7370 */
7371 /*
7372 * group,active vs. unique,active with same ip(s), unchecked
7373 */
7374 {
7375 .tctx = tctx,
7376 .line = __location__,
7377 .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL),
7378 .wins = {
7379 .nb_flags = NBT_NM_GROUP,
7380 .mhomed = false,
7381 .num_ips = ctx->addresses_best_num,
7382 .ips = ctx->addresses_best,
7383 .apply_expected = true
7384 },
7385 .defend = {
7386 .timeout = 0,
7387 },
7388 .replica= {
7389 .type = WREPL_TYPE_UNIQUE,
7390 .state = WREPL_STATE_ACTIVE,
7391 .node = WREPL_NODE_B,
7392 .is_static = false,
7393 .num_ips = ctx->addresses_best_num,
7394 .ips = ctx->addresses_best,
7395 .apply_expected = false
7396 },
7397 },
7398 /*
7399 * group,active vs. unique,active with different ip(s), unchecked
7400 */
7401 {
7402 .tctx = tctx,
7403 .line = __location__,
7404 .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL),
7405 .wins = {
7406 .nb_flags = NBT_NM_GROUP,
7407 .mhomed = false,
7408 .num_ips = ctx->addresses_best_num,
7409 .ips = ctx->addresses_best,
7410 .apply_expected = true
7411 },
7412 .defend = {
7413 .timeout = 0,
7414 },
7415 .replica= {
7416 .type = WREPL_TYPE_UNIQUE,
7417 .state = WREPL_STATE_ACTIVE,
7418 .node = WREPL_NODE_B,
7419 .is_static = false,
7420 .num_ips = ARRAY_SIZE(addresses_B_1),
7421 .ips = addresses_B_1,
7422 .apply_expected = false
7423 },
7424 },
7425 /*
7426 * group,active vs. unique,tombstone with same ip(s), unchecked
7427 */
7428 {
7429 .tctx = tctx,
7430 .line = __location__,
7431 .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL),
7432 .wins = {
7433 .nb_flags = NBT_NM_GROUP,
7434 .mhomed = false,
7435 .num_ips = ctx->addresses_best_num,
7436 .ips = ctx->addresses_best,
7437 .apply_expected = true
7438 },
7439 .defend = {
7440 .timeout = 0,
7441 },
7442 .replica= {
7443 .type = WREPL_TYPE_UNIQUE,
7444 .state = WREPL_STATE_TOMBSTONE,
7445 .node = WREPL_NODE_B,
7446 .is_static = false,
7447 .num_ips = ctx->addresses_best_num,
7448 .ips = ctx->addresses_best,
7449 .apply_expected = false
7450 },
7451 },
7452 /*
7453 * group,active vs. unique,tombstone with different ip(s), unchecked
7454 */
7455 {
7456 .tctx = tctx,
7457 .line = __location__,
7458 .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL),
7459 .wins = {
7460 .nb_flags = NBT_NM_GROUP,
7461 .mhomed = false,
7462 .num_ips = ctx->addresses_best_num,
7463 .ips = ctx->addresses_best,
7464 .apply_expected = true
7465 },
7466 .defend = {
7467 .timeout = 0,
7468 },
7469 .replica= {
7470 .type = WREPL_TYPE_UNIQUE,
7471 .state = WREPL_STATE_TOMBSTONE,
7472 .node = WREPL_NODE_B,
7473 .is_static = false,
7474 .num_ips = ARRAY_SIZE(addresses_B_1),
7475 .ips = addresses_B_1,
7476 .apply_expected = false
7477 },
7478 },
7479 /*
7480 * normal group vs. normal group section
7481 */
7482 /*
7483 * group,active vs. group,active with same ip(s), unchecked
7484 */
7485 {
7486 .tctx = tctx,
7487 .line = __location__,
7488 .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL),
7489 .wins = {
7490 .nb_flags = NBT_NM_GROUP,
7491 .mhomed = false,
7492 .num_ips = ctx->addresses_best_num,
7493 .ips = ctx->addresses_best,
7494 .apply_expected = true
7495 },
7496 .defend = {
7497 .timeout = 0,
7498 },
7499 .replica= {
7500 .type = WREPL_TYPE_GROUP,
7501 .state = WREPL_STATE_ACTIVE,
7502 .node = WREPL_NODE_B,
7503 .is_static = false,
7504 .num_ips = ctx->addresses_best_num,
7505 .ips = ctx->addresses_best,
7506 .apply_expected = true
7507 },
7508 },
7509 /*
7510 * group,active vs. group,active with different ip(s), unchecked
7511 */
7512 {
7513 .tctx = tctx,
7514 .line = __location__,
7515 .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL),
7516 .wins = {
7517 .nb_flags = NBT_NM_GROUP,
7518 .mhomed = false,
7519 .num_ips = ctx->addresses_best_num,
7520 .ips = ctx->addresses_best,
7521 .apply_expected = true
7522 },
7523 .defend = {
7524 .timeout = 0,
7525 },
7526 .replica= {
7527 .type = WREPL_TYPE_GROUP,
7528 .state = WREPL_STATE_ACTIVE,
7529 .node = WREPL_NODE_B,
7530 .is_static = false,
7531 .num_ips = ARRAY_SIZE(addresses_B_1),
7532 .ips = addresses_B_1,
7533 .apply_expected = true
7534 },
7535 },
7536 /*
7537 * group,active vs. group,tombstone with same ip(s), unchecked
7538 */
7539 {
7540 .tctx = tctx,
7541 .line = __location__,
7542 .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL),
7543 .wins = {
7544 .nb_flags = NBT_NM_GROUP,
7545 .mhomed = false,
7546 .num_ips = ctx->addresses_best_num,
7547 .ips = ctx->addresses_best,
7548 .apply_expected = true
7549 },
7550 .defend = {
7551 .timeout = 0,
7552 },
7553 .replica= {
7554 .type = WREPL_TYPE_GROUP,
7555 .state = WREPL_STATE_TOMBSTONE,
7556 .node = WREPL_NODE_B,
7557 .is_static = false,
7558 .num_ips = ctx->addresses_best_num,
7559 .ips = ctx->addresses_best,
7560 .apply_expected = false
7561 },
7562 },
7563 /*
7564 * group,active vs. group,tombstone with different ip(s), unchecked
7565 */
7566 {
7567 .tctx = tctx,
7568 .line = __location__,
7569 .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL),
7570 .wins = {
7571 .nb_flags = NBT_NM_GROUP,
7572 .mhomed = false,
7573 .num_ips = ctx->addresses_best_num,
7574 .ips = ctx->addresses_best,
7575 .apply_expected = true
7576 },
7577 .defend = {
7578 .timeout = 0,
7579 },
7580 .replica= {
7581 .type = WREPL_TYPE_GROUP,
7582 .state = WREPL_STATE_TOMBSTONE,
7583 .node = WREPL_NODE_B,
7584 .is_static = false,
7585 .num_ips = ARRAY_SIZE(addresses_B_1),
7586 .ips = addresses_B_1,
7587 .apply_expected = false
7588 },
7589 },
7590 /*
7591 * normal group vs. special group section
7592 */
7593 /*
7594 * group,active vs. sgroup,active with same ip(s), unchecked
7595 */
7596 {
7597 .tctx = tctx,
7598 .line = __location__,
7599 .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL),
7600 .wins = {
7601 .nb_flags = NBT_NM_GROUP,
7602 .mhomed = false,
7603 .num_ips = ctx->addresses_best_num,
7604 .ips = ctx->addresses_best,
7605 .apply_expected = true
7606 },
7607 .defend = {
7608 .timeout = 0,
7609 },
7610 .replica= {
7611 .type = WREPL_TYPE_SGROUP,
7612 .state = WREPL_STATE_ACTIVE,
7613 .node = WREPL_NODE_B,
7614 .is_static = false,
7615 .num_ips = ctx->addresses_best_num,
7616 .ips = ctx->addresses_best,
7617 .apply_expected = false
7618 },
7619 },
7620 /*
7621 * group,active vs. sgroup,active with different ip(s), unchecked
7622 */
7623 {
7624 .tctx = tctx,
7625 .line = __location__,
7626 .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL),
7627 .wins = {
7628 .nb_flags = NBT_NM_GROUP,
7629 .mhomed = false,
7630 .num_ips = ctx->addresses_best_num,
7631 .ips = ctx->addresses_best,
7632 .apply_expected = true
7633 },
7634 .defend = {
7635 .timeout = 0,
7636 },
7637 .replica= {
7638 .type = WREPL_TYPE_SGROUP,
7639 .state = WREPL_STATE_ACTIVE,
7640 .node = WREPL_NODE_B,
7641 .is_static = false,
7642 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7643 .ips = addresses_B_3_4,
7644 .apply_expected = false
7645 },
7646 },
7647 /*
7648 * group,active vs. sgroup,tombstone with same ip(s), unchecked
7649 */
7650 {
7651 .tctx = tctx,
7652 .line = __location__,
7653 .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL),
7654 .wins = {
7655 .nb_flags = NBT_NM_GROUP,
7656 .mhomed = false,
7657 .num_ips = ctx->addresses_best_num,
7658 .ips = ctx->addresses_best,
7659 .apply_expected = true
7660 },
7661 .defend = {
7662 .timeout = 0,
7663 },
7664 .replica= {
7665 .type = WREPL_TYPE_SGROUP,
7666 .state = WREPL_STATE_TOMBSTONE,
7667 .node = WREPL_NODE_B,
7668 .is_static = false,
7669 .num_ips = ctx->addresses_best_num,
7670 .ips = ctx->addresses_best,
7671 .apply_expected = false
7672 },
7673 },
7674 /*
7675 * group,active vs. sgroup,tombstone with different ip(s), unchecked
7676 */
7677 {
7678 .tctx = tctx,
7679 .line = __location__,
7680 .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL),
7681 .wins = {
7682 .nb_flags = NBT_NM_GROUP,
7683 .mhomed = false,
7684 .num_ips = ctx->addresses_best_num,
7685 .ips = ctx->addresses_best,
7686 .apply_expected = true
7687 },
7688 .defend = {
7689 .timeout = 0,
7690 },
7691 .replica= {
7692 .type = WREPL_TYPE_SGROUP,
7693 .state = WREPL_STATE_TOMBSTONE,
7694 .node = WREPL_NODE_B,
7695 .is_static = false,
7696 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7697 .ips = addresses_B_3_4,
7698 .apply_expected = false
7699 },
7700 },
7701 /*
7702 * normal group vs. multi homed section
7703 */
7704 /*
7705 * group,active vs. mhomed,active with same ip(s), unchecked
7706 */
7707 {
7708 .tctx = tctx,
7709 .line = __location__,
7710 .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL),
7711 .wins = {
7712 .nb_flags = NBT_NM_GROUP,
7713 .mhomed = false,
7714 .num_ips = ctx->addresses_best_num,
7715 .ips = ctx->addresses_best,
7716 .apply_expected = true
7717 },
7718 .defend = {
7719 .timeout = 0,
7720 },
7721 .replica= {
7722 .type = WREPL_TYPE_MHOMED,
7723 .state = WREPL_STATE_ACTIVE,
7724 .node = WREPL_NODE_B,
7725 .is_static = false,
7726 .num_ips = ctx->addresses_best_num,
7727 .ips = ctx->addresses_best,
7728 .apply_expected = false
7729 },
7730 },
7731 /*
7732 * group,active vs. mhomed,active with different ip(s), unchecked
7733 */
7734 {
7735 .tctx = tctx,
7736 .line = __location__,
7737 .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL),
7738 .wins = {
7739 .nb_flags = NBT_NM_GROUP,
7740 .mhomed = false,
7741 .num_ips = ctx->addresses_best_num,
7742 .ips = ctx->addresses_best,
7743 .apply_expected = true
7744 },
7745 .defend = {
7746 .timeout = 0,
7747 },
7748 .replica= {
7749 .type = WREPL_TYPE_MHOMED,
7750 .state = WREPL_STATE_ACTIVE,
7751 .node = WREPL_NODE_B,
7752 .is_static = false,
7753 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7754 .ips = addresses_B_3_4,
7755 .apply_expected = false
7756 },
7757 },
7758 /*
7759 * group,active vs. mhomed,tombstone with same ip(s), unchecked
7760 */
7761 {
7762 .tctx = tctx,
7763 .line = __location__,
7764 .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL),
7765 .wins = {
7766 .nb_flags = NBT_NM_GROUP,
7767 .mhomed = false,
7768 .num_ips = ctx->addresses_best_num,
7769 .ips = ctx->addresses_best,
7770 .apply_expected = true
7771 },
7772 .defend = {
7773 .timeout = 0,
7774 },
7775 .replica= {
7776 .type = WREPL_TYPE_MHOMED,
7777 .state = WREPL_STATE_TOMBSTONE,
7778 .node = WREPL_NODE_B,
7779 .is_static = false,
7780 .num_ips = ctx->addresses_best_num,
7781 .ips = ctx->addresses_best,
7782 .apply_expected = false
7783 },
7784 },
7785 /*
7786 * group,active vs. mhomed,tombstone with different ip(s), unchecked
7787 */
7788 {
7789 .tctx = tctx,
7790 .line = __location__,
7791 .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL),
7792 .wins = {
7793 .nb_flags = NBT_NM_GROUP,
7794 .mhomed = false,
7795 .num_ips = ctx->addresses_best_num,
7796 .ips = ctx->addresses_best,
7797 .apply_expected = true
7798 },
7799 .defend = {
7800 .timeout = 0,
7801 },
7802 .replica= {
7803 .type = WREPL_TYPE_MHOMED,
7804 .state = WREPL_STATE_TOMBSTONE,
7805 .node = WREPL_NODE_B,
7806 .is_static = false,
7807 .num_ips = ARRAY_SIZE(addresses_B_3_4),
7808 .ips = addresses_B_3_4,
7809 .apply_expected = false
7810 },
7811 },
7812 /*
7813 * special group vs. unique section
7814 */
7815 /*
7816 * sgroup,active vs. unique,active with same ip(s), unchecked
7817 */
7818 {
7819 .tctx = tctx,
7820 .line = __location__,
7821 .name = _NBT_NAME("_SA_UA_SI_U", 0x1C, NULL),
7822 .wins = {
7823 .nb_flags = NBT_NM_GROUP,
7824 .mhomed = false,
7825 .num_ips = ctx->addresses_best_num,
7826 .ips = ctx->addresses_best,
7827 .apply_expected = true
7828 },
7829 .defend = {
7830 .timeout = 0,
7831 },
7832 .replica= {
7833 .type = WREPL_TYPE_UNIQUE,
7834 .state = WREPL_STATE_ACTIVE,
7835 .node = WREPL_NODE_B,
7836 .is_static = false,
7837 .num_ips = ctx->addresses_best_num,
7838 .ips = ctx->addresses_best,
7839 .apply_expected = false
7840 },
7841 },
7842 /*
7843 * sgroup,active vs. unique,active with different ip(s), unchecked
7844 */
7845 {
7846 .tctx = tctx,
7847 .line = __location__,
7848 .name = _NBT_NAME("_SA_UA_DI_U", 0x1C, NULL),
7849 .wins = {
7850 .nb_flags = NBT_NM_GROUP,
7851 .mhomed = false,
7852 .num_ips = ctx->addresses_best_num,
7853 .ips = ctx->addresses_best,
7854 .apply_expected = true
7855 },
7856 .defend = {
7857 .timeout = 0,
7858 },
7859 .replica= {
7860 .type = WREPL_TYPE_UNIQUE,
7861 .state = WREPL_STATE_ACTIVE,
7862 .node = WREPL_NODE_B,
7863 .is_static = false,
7864 .num_ips = ARRAY_SIZE(addresses_B_1),
7865 .ips = addresses_B_1,
7866 .apply_expected = false
7867 },
7868 },
7869 /*
7870 * sgroup,active vs. unique,tombstone with same ip(s), unchecked
7871 */
7872 {
7873 .tctx = tctx,
7874 .line = __location__,
7875 .name = _NBT_NAME("_SA_UT_SI_U", 0x1C, NULL),
7876 .wins = {
7877 .nb_flags = NBT_NM_GROUP,
7878 .mhomed = false,
7879 .num_ips = ctx->addresses_best_num,
7880 .ips = ctx->addresses_best,
7881 .apply_expected = true
7882 },
7883 .defend = {
7884 .timeout = 0,
7885 },
7886 .replica= {
7887 .type = WREPL_TYPE_UNIQUE,
7888 .state = WREPL_STATE_TOMBSTONE,
7889 .node = WREPL_NODE_B,
7890 .is_static = false,
7891 .num_ips = ctx->addresses_best_num,
7892 .ips = ctx->addresses_best,
7893 .apply_expected = false
7894 },
7895 },
7896 /*
7897 * sgroup,active vs. unique,tombstone with different ip(s), unchecked
7898 */
7899 {
7900 .tctx = tctx,
7901 .line = __location__,
7902 .name = _NBT_NAME("_SA_UT_DI_U", 0x1C, NULL),
7903 .wins = {
7904 .nb_flags = NBT_NM_GROUP,
7905 .mhomed = false,
7906 .num_ips = ctx->addresses_best_num,
7907 .ips = ctx->addresses_best,
7908 .apply_expected = true
7909 },
7910 .defend = {
7911 .timeout = 0,
7912 },
7913 .replica= {
7914 .type = WREPL_TYPE_UNIQUE,
7915 .state = WREPL_STATE_TOMBSTONE,
7916 .node = WREPL_NODE_B,
7917 .is_static = false,
7918 .num_ips = ARRAY_SIZE(addresses_B_1),
7919 .ips = addresses_B_1,
7920 .apply_expected = false
7921 },
7922 },
7923 /*
7924 * special group vs. normal group section
7925 */
7926 /*
7927 * sgroup,active vs. group,active with same ip(s), unchecked
7928 */
7929 {
7930 .tctx = tctx,
7931 .line = __location__,
7932 .name = _NBT_NAME("_SA_GA_SI_U", 0x1C, NULL),
7933 .wins = {
7934 .nb_flags = NBT_NM_GROUP,
7935 .mhomed = false,
7936 .num_ips = ctx->addresses_best_num,
7937 .ips = ctx->addresses_best,
7938 .apply_expected = true
7939 },
7940 .defend = {
7941 .timeout = 0,
7942 },
7943 .replica= {
7944 .type = WREPL_TYPE_GROUP,
7945 .state = WREPL_STATE_ACTIVE,
7946 .node = WREPL_NODE_B,
7947 .is_static = false,
7948 .num_ips = ctx->addresses_best_num,
7949 .ips = ctx->addresses_best,
7950 .apply_expected = false
7951 },
7952 },
7953 /*
7954 * sgroup,active vs. group,active with different ip(s), unchecked
7955 */
7956 {
7957 .tctx = tctx,
7958 .line = __location__,
7959 .name = _NBT_NAME("_SA_GA_DI_U", 0x1C, NULL),
7960 .wins = {
7961 .nb_flags = NBT_NM_GROUP,
7962 .mhomed = false,
7963 .num_ips = ctx->addresses_best_num,
7964 .ips = ctx->addresses_best,
7965 .apply_expected = true
7966 },
7967 .defend = {
7968 .timeout = 0,
7969 },
7970 .replica= {
7971 .type = WREPL_TYPE_GROUP,
7972 .state = WREPL_STATE_ACTIVE,
7973 .node = WREPL_NODE_B,
7974 .is_static = false,
7975 .num_ips = ARRAY_SIZE(addresses_B_1),
7976 .ips = addresses_B_1,
7977 .apply_expected = false
7978 },
7979 },
7980 /*
7981 * sgroup,active vs. group,tombstone with same ip(s), unchecked
7982 */
7983 {
7984 .tctx = tctx,
7985 .line = __location__,
7986 .name = _NBT_NAME("_SA_GT_SI_U", 0x1C, NULL),
7987 .wins = {
7988 .nb_flags = NBT_NM_GROUP,
7989 .mhomed = false,
7990 .num_ips = ctx->addresses_best_num,
7991 .ips = ctx->addresses_best,
7992 .apply_expected = true
7993 },
7994 .defend = {
7995 .timeout = 0,
7996 },
7997 .replica= {
7998 .type = WREPL_TYPE_GROUP,
7999 .state = WREPL_STATE_TOMBSTONE,
8000 .node = WREPL_NODE_B,
8001 .is_static = false,
8002 .num_ips = ctx->addresses_best_num,
8003 .ips = ctx->addresses_best,
8004 .apply_expected = false
8005 },
8006 },
8007 /*
8008 * sgroup,active vs. group,tombstone with different ip(s), unchecked
8009 */
8010 {
8011 .tctx = tctx,
8012 .line = __location__,
8013 .name = _NBT_NAME("_SA_GT_DI_U", 0x1C, NULL),
8014 .wins = {
8015 .nb_flags = NBT_NM_GROUP,
8016 .mhomed = false,
8017 .num_ips = ctx->addresses_best_num,
8018 .ips = ctx->addresses_best,
8019 .apply_expected = true
8020 },
8021 .defend = {
8022 .timeout = 0,
8023 },
8024 .replica= {
8025 .type = WREPL_TYPE_GROUP,
8026 .state = WREPL_STATE_TOMBSTONE,
8027 .node = WREPL_NODE_B,
8028 .is_static = false,
8029 .num_ips = ARRAY_SIZE(addresses_B_1),
8030 .ips = addresses_B_1,
8031 .apply_expected = false
8032 },
8033 },
8034 /*
8035 * special group vs. multi homed section
8036 */
8037 /*
8038 * sgroup,active vs. mhomed,active with same ip(s), unchecked
8039 */
8040 {
8041 .tctx = tctx,
8042 .line = __location__,
8043 .name = _NBT_NAME("_SA_MA_SI_U", 0x1C, NULL),
8044 .wins = {
8045 .nb_flags = NBT_NM_GROUP,
8046 .mhomed = false,
8047 .num_ips = ctx->addresses_best_num,
8048 .ips = ctx->addresses_best,
8049 .apply_expected = true
8050 },
8051 .defend = {
8052 .timeout = 0,
8053 },
8054 .replica= {
8055 .type = WREPL_TYPE_MHOMED,
8056 .state = WREPL_STATE_ACTIVE,
8057 .node = WREPL_NODE_B,
8058 .is_static = false,
8059 .num_ips = ctx->addresses_best_num,
8060 .ips = ctx->addresses_best,
8061 .apply_expected = false
8062 },
8063 },
8064 /*
8065 * sgroup,active vs. mhomed,active with different ip(s), unchecked
8066 */
8067 {
8068 .tctx = tctx,
8069 .line = __location__,
8070 .name = _NBT_NAME("_SA_MA_DI_U", 0x1C, NULL),
8071 .wins = {
8072 .nb_flags = NBT_NM_GROUP,
8073 .mhomed = false,
8074 .num_ips = ctx->addresses_best_num,
8075 .ips = ctx->addresses_best,
8076 .apply_expected = true
8077 },
8078 .defend = {
8079 .timeout = 0,
8080 },
8081 .replica= {
8082 .type = WREPL_TYPE_MHOMED,
8083 .state = WREPL_STATE_ACTIVE,
8084 .node = WREPL_NODE_B,
8085 .is_static = false,
8086 .num_ips = ARRAY_SIZE(addresses_B_1),
8087 .ips = addresses_B_1,
8088 .apply_expected = false
8089 },
8090 },
8091 /*
8092 * sgroup,active vs. mhomed,tombstone with same ip(s), unchecked
8093 */
8094 {
8095 .tctx = tctx,
8096 .line = __location__,
8097 .name = _NBT_NAME("_SA_MT_SI_U", 0x1C, NULL),
8098 .wins = {
8099 .nb_flags = NBT_NM_GROUP,
8100 .mhomed = false,
8101 .num_ips = ctx->addresses_best_num,
8102 .ips = ctx->addresses_best,
8103 .apply_expected = true
8104 },
8105 .defend = {
8106 .timeout = 0,
8107 },
8108 .replica= {
8109 .type = WREPL_TYPE_MHOMED,
8110 .state = WREPL_STATE_TOMBSTONE,
8111 .node = WREPL_NODE_B,
8112 .is_static = false,
8113 .num_ips = ctx->addresses_best_num,
8114 .ips = ctx->addresses_best,
8115 .apply_expected = false
8116 },
8117 },
8118 /*
8119 * sgroup,active vs. mhomed,tombstone with different ip(s), unchecked
8120 */
8121 {
8122 .tctx = tctx,
8123 .line = __location__,
8124 .name = _NBT_NAME("_SA_MT_DI_U", 0x1C, NULL),
8125 .wins = {
8126 .nb_flags = NBT_NM_GROUP,
8127 .mhomed = false,
8128 .num_ips = ctx->addresses_best_num,
8129 .ips = ctx->addresses_best,
8130 .apply_expected = true
8131 },
8132 .defend = {
8133 .timeout = 0,
8134 },
8135 .replica= {
8136 .type = WREPL_TYPE_MHOMED,
8137 .state = WREPL_STATE_TOMBSTONE,
8138 .node = WREPL_NODE_B,
8139 .is_static = false,
8140 .num_ips = ARRAY_SIZE(addresses_B_1),
8141 .ips = addresses_B_1,
8142 .apply_expected = false
8143 },
8144 },
8145 /*
8146 * multi homed vs. unique section
8147 */
8148 /*
8149 * mhomed,active vs. unique,active with same ip(s), unchecked
8150 */
8151 {
8152 .tctx = tctx,
8153 .line = __location__,
8154 .name = _NBT_NAME("_MA_UA_SI_U", 0x00, NULL),
8155 .wins = {
8156 .nb_flags = 0,
8157 .mhomed = true,
8158 .num_ips = ctx->addresses_best_num,
8159 .ips = ctx->addresses_best,
8160 .apply_expected = true
8161 },
8162 .defend = {
8163 .timeout = 0,
8164 },
8165 .replica= {
8166 .type = WREPL_TYPE_UNIQUE,
8167 .state = WREPL_STATE_ACTIVE,
8168 .node = WREPL_NODE_B,
8169 .is_static = false,
8170 .num_ips = ctx->addresses_best_num,
8171 .ips = ctx->addresses_best,
8172 .apply_expected = true
8173 },
8174 },
8175 /*
8176 * mhomed,active vs. unique,active with different ip(s), positive response
8177 */
8178 {
8179 .tctx = tctx,
8180 .line = __location__,
8181 .name = _NBT_NAME("_MA_UA_DI_P", 0x00, NULL),
8182 .wins = {
8183 .nb_flags = 0,
8184 .mhomed = true,
8185 .num_ips = ctx->addresses_best_num,
8186 .ips = ctx->addresses_best,
8187 .apply_expected = true
8188 },
8189 .defend = {
8190 .timeout = 10,
8191 .positive = true,
8192 },
8193 .replica= {
8194 .type = WREPL_TYPE_UNIQUE,
8195 .state = WREPL_STATE_ACTIVE,
8196 .node = WREPL_NODE_B,
8197 .is_static = false,
8198 .num_ips = ARRAY_SIZE(addresses_B_1),
8199 .ips = addresses_B_1,
8200 .apply_expected = false
8201 },
8202 },
8203 /*
8204 * mhomed,active vs. unique,active with different ip(s), positive response other ips
8205 */
8206 {
8207 .tctx = tctx,
8208 .line = __location__,
8209 .name = _NBT_NAME("_MA_UA_DI_O", 0x00, NULL),
8210 .wins = {
8211 .nb_flags = 0,
8212 .mhomed = true,
8213 .num_ips = ctx->addresses_best_num,
8214 .ips = ctx->addresses_best,
8215 .apply_expected = true
8216 },
8217 .defend = {
8218 .timeout = 10,
8219 .positive = true,
8220 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8221 .ips = addresses_A_3_4,
8222 },
8223 .replica= {
8224 .type = WREPL_TYPE_UNIQUE,
8225 .state = WREPL_STATE_ACTIVE,
8226 .node = WREPL_NODE_B,
8227 .is_static = false,
8228 .num_ips = ARRAY_SIZE(addresses_B_1),
8229 .ips = addresses_B_1,
8230 .apply_expected = false
8231 },
8232 },
8233 /*
8234 * mhomed,active vs. unique,active with different ip(s), negative response
8235 */
8236 {
8237 .tctx = tctx,
8238 .line = __location__,
8239 .name = _NBT_NAME("_MA_UA_DI_N", 0x00, NULL),
8240 .wins = {
8241 .nb_flags = 0,
8242 .mhomed = true,
8243 .num_ips = ctx->addresses_best_num,
8244 .ips = ctx->addresses_best,
8245 .apply_expected = true
8246 },
8247 .defend = {
8248 .timeout = 10,
8249 .positive = false,
8250 },
8251 .replica= {
8252 .type = WREPL_TYPE_UNIQUE,
8253 .state = WREPL_STATE_ACTIVE,
8254 .node = WREPL_NODE_B,
8255 .is_static = false,
8256 .num_ips = ARRAY_SIZE(addresses_B_1),
8257 .ips = addresses_B_1,
8258 .apply_expected = true
8259 },
8260 },
8261 /*
8262 * mhomed,active vs. unique,tombstone with same ip(s), unchecked
8263 */
8264 {
8265 .tctx = tctx,
8266 .line = __location__,
8267 .name = _NBT_NAME("_MA_UT_SI_U", 0x00, NULL),
8268 .wins = {
8269 .nb_flags = 0,
8270 .mhomed = true,
8271 .num_ips = ctx->addresses_best_num,
8272 .ips = ctx->addresses_best,
8273 .apply_expected = true
8274 },
8275 .defend = {
8276 .timeout = 0,
8277 },
8278 .replica= {
8279 .type = WREPL_TYPE_UNIQUE,
8280 .state = WREPL_STATE_TOMBSTONE,
8281 .node = WREPL_NODE_B,
8282 .is_static = false,
8283 .num_ips = ctx->addresses_best_num,
8284 .ips = ctx->addresses_best,
8285 .apply_expected = false
8286 },
8287 },
8288 /*
8289 * mhomed,active vs. unique,tombstone with different ip(s), unchecked
8290 */
8291 {
8292 .tctx = tctx,
8293 .line = __location__,
8294 .name = _NBT_NAME("_MA_UT_DI_U", 0x00, NULL),
8295 .wins = {
8296 .nb_flags = 0,
8297 .mhomed = true,
8298 .num_ips = ctx->addresses_best_num,
8299 .ips = ctx->addresses_best,
8300 .apply_expected = true
8301 },
8302 .defend = {
8303 .timeout = 0,
8304 },
8305 .replica= {
8306 .type = WREPL_TYPE_UNIQUE,
8307 .state = WREPL_STATE_TOMBSTONE,
8308 .node = WREPL_NODE_B,
8309 .is_static = false,
8310 .num_ips = ARRAY_SIZE(addresses_B_1),
8311 .ips = addresses_B_1,
8312 .apply_expected = false
8313 },
8314 },
8315 /*
8316 * multi homed vs. normal group section
8317 */
8318 /*
8319 * mhomed,active vs. group,active with same ip(s), release expected
8320 */
8321 {
8322 .tctx = tctx,
8323 .line = __location__,
8324 .name = _NBT_NAME("_MA_GA_SI_R", 0x00, NULL),
8325 .wins = {
8326 .nb_flags = 0,
8327 .mhomed = true,
8328 .num_ips = ctx->addresses_best_num,
8329 .ips = ctx->addresses_best,
8330 .apply_expected = true
8331 },
8332 .defend = {
8333 .timeout = 10,
8334 .expect_release = true,
8335 },
8336 .replica= {
8337 .type = WREPL_TYPE_GROUP,
8338 .state = WREPL_STATE_ACTIVE,
8339 .node = WREPL_NODE_B,
8340 .is_static = false,
8341 .num_ips = ctx->addresses_best_num,
8342 .ips = ctx->addresses_best,
8343 .apply_expected = true
8344 },
8345 },
8346 /*
8347 * mhomed,active vs. group,active with different ip(s), release expected
8348 */
8349 {
8350 .tctx = tctx,
8351 .line = __location__,
8352 .name = _NBT_NAME("_MA_GA_DI_R", 0x00, NULL),
8353 .wins = {
8354 .nb_flags = 0,
8355 .mhomed = true,
8356 .num_ips = ctx->addresses_best_num,
8357 .ips = ctx->addresses_best,
8358 .apply_expected = true
8359 },
8360 .defend = {
8361 .timeout = 10,
8362 .expect_release = true,
8363 },
8364 .replica= {
8365 .type = WREPL_TYPE_GROUP,
8366 .state = WREPL_STATE_ACTIVE,
8367 .node = WREPL_NODE_B,
8368 .is_static = false,
8369 .num_ips = ARRAY_SIZE(addresses_B_1),
8370 .ips = addresses_B_1,
8371 .apply_expected = true
8372 },
8373 },
8374 /*
8375 * mhomed,active vs. group,tombstone with same ip(s), unchecked
8376 */
8377 {
8378 .tctx = tctx,
8379 .line = __location__,
8380 .name = _NBT_NAME("_MA_GT_SI_U", 0x00, NULL),
8381 .wins = {
8382 .nb_flags = 0,
8383 .mhomed = true,
8384 .num_ips = ctx->addresses_best_num,
8385 .ips = ctx->addresses_best,
8386 .apply_expected = true
8387 },
8388 .defend = {
8389 .timeout = 0,
8390 },
8391 .replica= {
8392 .type = WREPL_TYPE_GROUP,
8393 .state = WREPL_STATE_TOMBSTONE,
8394 .node = WREPL_NODE_B,
8395 .is_static = false,
8396 .num_ips = ctx->addresses_best_num,
8397 .ips = ctx->addresses_best,
8398 .apply_expected = false
8399 },
8400 },
8401 /*
8402 * mhomed,active vs. group,tombstone with different ip(s), unchecked
8403 */
8404 {
8405 .tctx = tctx,
8406 .line = __location__,
8407 .name = _NBT_NAME("_MA_GT_DI_U", 0x00, NULL),
8408 .wins = {
8409 .nb_flags = 0,
8410 .mhomed = true,
8411 .num_ips = ctx->addresses_best_num,
8412 .ips = ctx->addresses_best,
8413 .apply_expected = true
8414 },
8415 .defend = {
8416 .timeout = 0,
8417 },
8418 .replica= {
8419 .type = WREPL_TYPE_GROUP,
8420 .state = WREPL_STATE_TOMBSTONE,
8421 .node = WREPL_NODE_B,
8422 .is_static = false,
8423 .num_ips = ARRAY_SIZE(addresses_B_1),
8424 .ips = addresses_B_1,
8425 .apply_expected = false
8426 },
8427 },
8428 /*
8429 * multi homed vs. special group section
8430 */
8431 /*
8432 * mhomed,active vs. sgroup,active with same ip(s), release expected
8433 */
8434 {
8435 .tctx = tctx,
8436 .line = __location__,
8437 .name = _NBT_NAME("_MA_SA_SI_R", 0x00, NULL),
8438 .wins = {
8439 .nb_flags = 0,
8440 .mhomed = true,
8441 .num_ips = ctx->addresses_best_num,
8442 .ips = ctx->addresses_best,
8443 .apply_expected = true
8444 },
8445 .defend = {
8446 .timeout = 10,
8447 .expect_release = true,
8448 },
8449 .replica= {
8450 .type = WREPL_TYPE_SGROUP,
8451 .state = WREPL_STATE_ACTIVE,
8452 .node = WREPL_NODE_B,
8453 .is_static = false,
8454 .num_ips = ctx->addresses_best_num,
8455 .ips = ctx->addresses_best,
8456 .apply_expected = true
8457 },
8458 },
8459 /*
8460 * mhomed,active vs. group,active with different ip(s), release expected
8461 */
8462 {
8463 .tctx = tctx,
8464 .line = __location__,
8465 .name = _NBT_NAME("_MA_SA_DI_R", 0x00, NULL),
8466 .wins = {
8467 .nb_flags = 0,
8468 .mhomed = true,
8469 .num_ips = ctx->addresses_best_num,
8470 .ips = ctx->addresses_best,
8471 .apply_expected = true
8472 },
8473 .defend = {
8474 .timeout = 10,
8475 .expect_release = true,
8476 },
8477 .replica= {
8478 .type = WREPL_TYPE_SGROUP,
8479 .state = WREPL_STATE_ACTIVE,
8480 .node = WREPL_NODE_B,
8481 .is_static = false,
8482 .num_ips = ARRAY_SIZE(addresses_B_1),
8483 .ips = addresses_B_1,
8484 .apply_expected = true
8485 },
8486 },
8487 /*
8488 * mhomed,active vs. sgroup,tombstone with same ip(s), unchecked
8489 */
8490 {
8491 .tctx = tctx,
8492 .line = __location__,
8493 .name = _NBT_NAME("_MA_ST_SI_U", 0x00, NULL),
8494 .wins = {
8495 .nb_flags = 0,
8496 .mhomed = true,
8497 .num_ips = ctx->addresses_best_num,
8498 .ips = ctx->addresses_best,
8499 .apply_expected = true
8500 },
8501 .defend = {
8502 .timeout = 0,
8503 },
8504 .replica= {
8505 .type = WREPL_TYPE_SGROUP,
8506 .state = WREPL_STATE_TOMBSTONE,
8507 .node = WREPL_NODE_B,
8508 .is_static = false,
8509 .num_ips = ctx->addresses_best_num,
8510 .ips = ctx->addresses_best,
8511 .apply_expected = false
8512 },
8513 },
8514 /*
8515 * mhomed,active vs. sgroup,tombstone with different ip(s), unchecked
8516 */
8517 {
8518 .tctx = tctx,
8519 .line = __location__,
8520 .name = _NBT_NAME("_MA_ST_DI_U", 0x00, NULL),
8521 .wins = {
8522 .nb_flags = 0,
8523 .mhomed = true,
8524 .num_ips = ctx->addresses_best_num,
8525 .ips = ctx->addresses_best,
8526 .apply_expected = true
8527 },
8528 .defend = {
8529 .timeout = 0,
8530 },
8531 .replica= {
8532 .type = WREPL_TYPE_SGROUP,
8533 .state = WREPL_STATE_TOMBSTONE,
8534 .node = WREPL_NODE_B,
8535 .is_static = false,
8536 .num_ips = ARRAY_SIZE(addresses_B_1),
8537 .ips = addresses_B_1,
8538 .apply_expected = false
8539 },
8540 },
8541 /*
8542 * multi homed vs. multi homed section
8543 */
8544 /*
8545 * mhomed,active vs. mhomed,active with same ip(s), unchecked
8546 */
8547 {
8548 .tctx = tctx,
8549 .line = __location__,
8550 .name = _NBT_NAME("_MA_MA_SI_U", 0x00, NULL),
8551 .wins = {
8552 .nb_flags = 0,
8553 .mhomed = true,
8554 .num_ips = ctx->addresses_best_num,
8555 .ips = ctx->addresses_best,
8556 .apply_expected = true
8557 },
8558 .defend = {
8559 .timeout = 0,
8560 },
8561 .replica= {
8562 .type = WREPL_TYPE_MHOMED,
8563 .state = WREPL_STATE_ACTIVE,
8564 .node = WREPL_NODE_B,
8565 .is_static = false,
8566 .num_ips = ctx->addresses_best_num,
8567 .ips = ctx->addresses_best,
8568 .apply_expected = true
8569 },
8570 },
8571 /*
8572 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8573 */
8574 {
8575 .tctx = tctx,
8576 .line = __location__,
8577 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8578 .wins = {
8579 .nb_flags = 0,
8580 .mhomed = true,
8581 .num_ips = ctx->addresses_best_num,
8582 .ips = ctx->addresses_best,
8583 .apply_expected = true
8584 },
8585 .defend = {
8586 .timeout = 0,
8587 },
8588 .replica= {
8589 .type = WREPL_TYPE_MHOMED,
8590 .state = WREPL_STATE_ACTIVE,
8591 .node = WREPL_NODE_B,
8592 .is_static = false,
8593 .num_ips = ctx->addresses_all_num,
8594 .ips = ctx->addresses_all,
8595 .apply_expected = true
8596 },
8597 },
8598 /*
8599 * mhomed,active vs. mhomed,active with different ip(s), positive response
8600 */
8601 {
8602 .tctx = tctx,
8603 .line = __location__,
8604 .name = _NBT_NAME("_MA_MA_DI_P", 0x00, NULL),
8605 .wins = {
8606 .nb_flags = 0,
8607 .mhomed = true,
8608 .num_ips = ctx->addresses_best_num,
8609 .ips = ctx->addresses_best,
8610 .apply_expected = true
8611 },
8612 .defend = {
8613 .timeout = 10,
8614 .positive = true,
8615 },
8616 .replica= {
8617 .type = WREPL_TYPE_MHOMED,
8618 .state = WREPL_STATE_ACTIVE,
8619 .node = WREPL_NODE_B,
8620 .is_static = false,
8621 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8622 .ips = addresses_B_3_4,
8623 .apply_expected = false
8624 },
8625 },
8626 /*
8627 * mhomed,active vs. mhomed,active with different ip(s), positive response other ips
8628 */
8629 {
8630 .tctx = tctx,
8631 .line = __location__,
8632 .name = _NBT_NAME("_MA_MA_DI_O", 0x00, NULL),
8633 .wins = {
8634 .nb_flags = 0,
8635 .mhomed = true,
8636 .num_ips = ctx->addresses_best_num,
8637 .ips = ctx->addresses_best,
8638 .apply_expected = true
8639 },
8640 .defend = {
8641 .timeout = 10,
8642 .positive = true,
8643 .num_ips = ARRAY_SIZE(addresses_A_3_4),
8644 .ips = addresses_A_3_4,
8645 },
8646 .replica= {
8647 .type = WREPL_TYPE_MHOMED,
8648 .state = WREPL_STATE_ACTIVE,
8649 .node = WREPL_NODE_B,
8650 .is_static = false,
8651 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8652 .ips = addresses_B_3_4,
8653 .apply_expected = false
8654 },
8655 },
8656 /*
8657 * mhomed,active vs. mhomed,active with different ip(s), negative response
8658 */
8659 {
8660 .tctx = tctx,
8661 .line = __location__,
8662 .name = _NBT_NAME("_MA_MA_DI_N", 0x00, NULL),
8663 .wins = {
8664 .nb_flags = 0,
8665 .mhomed = true,
8666 .num_ips = ctx->addresses_best_num,
8667 .ips = ctx->addresses_best,
8668 .apply_expected = true
8669 },
8670 .defend = {
8671 .timeout = 10,
8672 .positive = false,
8673 },
8674 .replica= {
8675 .type = WREPL_TYPE_MHOMED,
8676 .state = WREPL_STATE_ACTIVE,
8677 .node = WREPL_NODE_B,
8678 .is_static = false,
8679 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8680 .ips = addresses_B_3_4,
8681 .apply_expected = true
8682 },
8683 },
8684 /*
8685 * mhomed,active vs. mhomed,tombstone with same ip(s), unchecked
8686 */
8687 {
8688 .tctx = tctx,
8689 .line = __location__,
8690 .name = _NBT_NAME("_MA_MT_SI_U", 0x00, NULL),
8691 .wins = {
8692 .nb_flags = 0,
8693 .mhomed = true,
8694 .num_ips = ctx->addresses_best_num,
8695 .ips = ctx->addresses_best,
8696 .apply_expected = true
8697 },
8698 .defend = {
8699 .timeout = 0,
8700 },
8701 .replica= {
8702 .type = WREPL_TYPE_MHOMED,
8703 .state = WREPL_STATE_TOMBSTONE,
8704 .node = WREPL_NODE_B,
8705 .is_static = false,
8706 .num_ips = ctx->addresses_best_num,
8707 .ips = ctx->addresses_best,
8708 .apply_expected = false
8709 },
8710 },
8711 /*
8712 * mhomed,active vs. mhomed,tombstone with different ip(s), unchecked
8713 */
8714 {
8715 .tctx = tctx,
8716 .line = __location__,
8717 .name = _NBT_NAME("_MA_MT_DI_U", 0x00, NULL),
8718 .wins = {
8719 .nb_flags = 0,
8720 .mhomed = true,
8721 .num_ips = ctx->addresses_best_num,
8722 .ips = ctx->addresses_best,
8723 .apply_expected = true
8724 },
8725 .defend = {
8726 .timeout = 0,
8727 },
8728 .replica= {
8729 .type = WREPL_TYPE_MHOMED,
8730 .state = WREPL_STATE_TOMBSTONE,
8731 .node = WREPL_NODE_B,
8732 .is_static = false,
8733 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8734 .ips = addresses_B_3_4,
8735 .apply_expected = false
8736 },
8737 },
8738 /*
8739 * some more multi homed test, including merging
8740 */
8741 /*
8742 * mhomed,active vs. mhomed,active with superset ip(s), unchecked
8743 */
8744 {
8745 .tctx = tctx,
8746 .line = __location__,
8747 .section= "Test Replica vs. owned active: some more MHOMED combinations",
8748 .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL),
8749 .comment= "C:MHOMED vs. B:ALL => B:ALL",
8750 .skip = (ctx->addresses_all_num < 3),
8751 .wins = {
8752 .nb_flags = 0,
8753 .mhomed = true,
8754 .num_ips = ctx->addresses_mhomed_num,
8755 .ips = ctx->addresses_mhomed,
8756 .apply_expected = true
8757 },
8758 .defend = {
8759 .timeout = 0,
8760 },
8761 .replica= {
8762 .type = WREPL_TYPE_MHOMED,
8763 .state = WREPL_STATE_ACTIVE,
8764 .node = WREPL_NODE_B,
8765 .is_static = false,
8766 .num_ips = ctx->addresses_all_num,
8767 .ips = ctx->addresses_all,
8768 .apply_expected = true
8769 },
8770 },
8771 /*
8772 * mhomed,active vs. mhomed,active with same ips, unchecked
8773 */
8774 {
8775 .tctx = tctx,
8776 .line = __location__,
8777 .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL),
8778 .comment= "C:MHOMED vs. B:MHOMED => B:MHOMED",
8779 .skip = (ctx->addresses_mhomed_num < 2),
8780 .wins = {
8781 .nb_flags = 0,
8782 .mhomed = true,
8783 .num_ips = ctx->addresses_mhomed_num,
8784 .ips = ctx->addresses_mhomed,
8785 .apply_expected = true
8786 },
8787 .defend = {
8788 .timeout = 0,
8789 },
8790 .replica= {
8791 .type = WREPL_TYPE_MHOMED,
8792 .state = WREPL_STATE_ACTIVE,
8793 .node = WREPL_NODE_B,
8794 .is_static = false,
8795 .num_ips = ctx->addresses_mhomed_num,
8796 .ips = ctx->addresses_mhomed,
8797 .apply_expected = true
8798 },
8799 },
8800 /*
8801 * mhomed,active vs. mhomed,active with subset ip(s), positive response
8802 */
8803 {
8804 .tctx = tctx,
8805 .line = __location__,
8806 .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL),
8807 .comment= "C:MHOMED vs. B:BEST (C:MHOMED) => B:MHOMED",
8808 .skip = (ctx->addresses_mhomed_num < 2),
8809 .wins = {
8810 .nb_flags = 0,
8811 .mhomed = true,
8812 .num_ips = ctx->addresses_mhomed_num,
8813 .ips = ctx->addresses_mhomed,
8814 .apply_expected = true
8815 },
8816 .defend = {
8817 .timeout = 10,
8818 .positive = true
8819 },
8820 .replica= {
8821 .type = WREPL_TYPE_MHOMED,
8822 .state = WREPL_STATE_ACTIVE,
8823 .node = WREPL_NODE_B,
8824 .is_static = false,
8825 .num_ips = ctx->addresses_best_num,
8826 .ips = ctx->addresses_best,
8827 .mhomed_merge = true
8828 },
8829 },
8830 /*
8831 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with all addresses
8832 */
8833 {
8834 .tctx = tctx,
8835 .line = __location__,
8836 .name = _NBT_NAME("_MA_MA_SB_A", 0x00, NULL),
8837 .comment= "C:MHOMED vs. B:BEST (C:ALL) => B:MHOMED",
8838 .skip = (ctx->addresses_all_num < 3),
8839 .wins = {
8840 .nb_flags = 0,
8841 .mhomed = true,
8842 .num_ips = ctx->addresses_mhomed_num,
8843 .ips = ctx->addresses_mhomed,
8844 .apply_expected = true
8845 },
8846 .defend = {
8847 .timeout = 10,
8848 .positive = true,
8849 .num_ips = ctx->addresses_all_num,
8850 .ips = ctx->addresses_all,
8851 },
8852 .replica= {
8853 .type = WREPL_TYPE_MHOMED,
8854 .state = WREPL_STATE_ACTIVE,
8855 .node = WREPL_NODE_B,
8856 .is_static = false,
8857 .num_ips = ctx->addresses_best_num,
8858 .ips = ctx->addresses_best,
8859 .mhomed_merge = true
8860 },
8861 },
8862 /*
8863 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with replicas addresses
8864 * TODO: check why the server sends a name release demand for one address?
8865 * the release demand has no effect to the database record...
8866 */
8867 {
8868 .tctx = tctx,
8869 .line = __location__,
8870 .name = _NBT_NAME("_MA_MA_SB_PRA", 0x00, NULL),
8871 .comment= "C:MHOMED vs. B:BEST (C:BEST) => C:MHOMED",
8872 .skip = (ctx->addresses_all_num < 2),
8873 .wins = {
8874 .nb_flags = 0,
8875 .mhomed = true,
8876 .num_ips = ctx->addresses_mhomed_num,
8877 .ips = ctx->addresses_mhomed,
8878 .apply_expected = true
8879 },
8880 .defend = {
8881 .timeout = 10,
8882 .positive = true,
8883 .num_ips = ctx->addresses_best_num,
8884 .ips = ctx->addresses_best,
8885 .late_release = true
8886 },
8887 .replica= {
8888 .type = WREPL_TYPE_MHOMED,
8889 .state = WREPL_STATE_ACTIVE,
8890 .node = WREPL_NODE_B,
8891 .is_static = false,
8892 .num_ips = ctx->addresses_best_num,
8893 .ips = ctx->addresses_best,
8894 .apply_expected = false
8895 },
8896 },
8897 /*
8898 * mhomed,active vs. mhomed,active with subset ip(s), positive response, with other addresses
8899 */
8900 {
8901 .tctx = tctx,
8902 .line = __location__,
8903 .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL),
8904 .comment= "C:MHOMED vs. B:BEST (B:B_3_4) =>C:MHOMED",
8905 .skip = (ctx->addresses_all_num < 2),
8906 .wins = {
8907 .nb_flags = 0,
8908 .mhomed = true,
8909 .num_ips = ctx->addresses_mhomed_num,
8910 .ips = ctx->addresses_mhomed,
8911 .apply_expected = true
8912 },
8913 .defend = {
8914 .timeout = 10,
8915 .positive = true,
8916 .num_ips = ARRAY_SIZE(addresses_B_3_4),
8917 .ips = addresses_B_3_4,
8918 },
8919 .replica= {
8920 .type = WREPL_TYPE_MHOMED,
8921 .state = WREPL_STATE_ACTIVE,
8922 .node = WREPL_NODE_B,
8923 .is_static = false,
8924 .num_ips = ctx->addresses_best_num,
8925 .ips = ctx->addresses_best,
8926 .apply_expected = false
8927 },
8928 },
8929 /*
8930 * mhomed,active vs. mhomed,active with subset ip(s), negative response
8931 */
8932 {
8933 .tctx = tctx,
8934 .line = __location__,
8935 .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL),
8936 .comment= "C:MHOMED vs. B:BEST (NEGATIVE) => B:BEST",
8937 .skip = (ctx->addresses_mhomed_num < 2),
8938 .wins = {
8939 .nb_flags = 0,
8940 .mhomed = true,
8941 .num_ips = ctx->addresses_mhomed_num,
8942 .ips = ctx->addresses_mhomed,
8943 .apply_expected = true
8944 },
8945 .defend = {
8946 .timeout = 10,
8947 .positive = false
8948 },
8949 .replica= {
8950 .type = WREPL_TYPE_MHOMED,
8951 .state = WREPL_STATE_ACTIVE,
8952 .node = WREPL_NODE_B,
8953 .is_static = false,
8954 .num_ips = ctx->addresses_best_num,
8955 .ips = ctx->addresses_best,
8956 .apply_expected = true
8957 },
8958 },
8959 /*
8960 * some more multi homed and unique test, including merging
8961 */
8962 /*
8963 * mhomed,active vs. unique,active with subset ip(s), positive response
8964 */
8965 {
8966 .tctx = tctx,
8967 .line = __location__,
8968 .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations",
8969 .name = _NBT_NAME("_MA_UA_SB_P", 0x00, NULL),
8970 .comment= "C:MHOMED vs. B:UNIQUE,BEST (C:MHOMED) => B:MHOMED",
8971 .skip = (ctx->addresses_all_num < 2),
8972 .wins = {
8973 .nb_flags = 0,
8974 .mhomed = true,
8975 .num_ips = ctx->addresses_mhomed_num,
8976 .ips = ctx->addresses_mhomed,
8977 .apply_expected = true
8978 },
8979 .defend = {
8980 .timeout = 10,
8981 .positive = true,
8982 },
8983 .replica= {
8984 .type = WREPL_TYPE_UNIQUE,
8985 .state = WREPL_STATE_ACTIVE,
8986 .node = WREPL_NODE_B,
8987 .is_static = false,
8988 .num_ips = ctx->addresses_best_num,
8989 .ips = ctx->addresses_best,
8990 .mhomed_merge = true
8991 },
8992 },
8993 /*
8994 * unique,active vs. unique,active with different ip(s), positive response, with replicas address
8995 * TODO: check why the server sends a name release demand for one address?
8996 * the release demand has no effect to the database record...
8997 */
8998 {
8999 .tctx = tctx,
9000 .line = __location__,
9001 .name = _NBT_NAME("_UA_UA_DI_PRA", 0x00, NULL),
9002 .comment= "C:BEST vs. B:BEST2 (C:BEST2,LR:BEST2) => C:BEST",
9003 .skip = (ctx->addresses_all_num < 2),
9004 .wins = {
9005 .nb_flags = 0,
9006 .mhomed = false,
9007 .num_ips = ctx->addresses_best_num,
9008 .ips = ctx->addresses_best,
9009 .apply_expected = true
9010 },
9011 .defend = {
9012 .timeout = 10,
9013 .positive = true,
9014 .num_ips = ctx->addresses_best2_num,
9015 .ips = ctx->addresses_best2,
9016 .late_release = true
9017 },
9018 .replica= {
9019 .type = WREPL_TYPE_UNIQUE,
9020 .state = WREPL_STATE_ACTIVE,
9021 .node = WREPL_NODE_B,
9022 .is_static = false,
9023 .num_ips = ctx->addresses_best2_num,
9024 .ips = ctx->addresses_best2,
9025 .apply_expected = false,
9026 },
9027 },
9028 /*
9029 * unique,active vs. unique,active with different ip(s), positive response, with all addresses
9030 */
9031 {
9032 .tctx = tctx,
9033 .line = __location__,
9034 .name = _NBT_NAME("_UA_UA_DI_A", 0x00, NULL),
9035 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
9036 .skip = (ctx->addresses_all_num < 3),
9037 .wins = {
9038 .nb_flags = 0,
9039 .mhomed = false,
9040 .num_ips = ctx->addresses_best_num,
9041 .ips = ctx->addresses_best,
9042 .apply_expected = true
9043 },
9044 .defend = {
9045 .timeout = 10,
9046 .positive = true,
9047 .num_ips = ctx->addresses_all_num,
9048 .ips = ctx->addresses_all,
9049 },
9050 .replica= {
9051 .type = WREPL_TYPE_UNIQUE,
9052 .state = WREPL_STATE_ACTIVE,
9053 .node = WREPL_NODE_B,
9054 .is_static = false,
9055 .num_ips = ctx->addresses_best2_num,
9056 .ips = ctx->addresses_best2,
9057 .mhomed_merge = true,
9058 },
9059 },
9060 /*
9061 * unique,active vs. mhomed,active with different ip(s), positive response, with all addresses
9062 */
9063 {
9064 .tctx = tctx,
9065 .line = __location__,
9066 .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL),
9067 .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED",
9068 .skip = (ctx->addresses_all_num < 3),
9069 .wins = {
9070 .nb_flags = 0,
9071 .mhomed = false,
9072 .num_ips = ctx->addresses_best_num,
9073 .ips = ctx->addresses_best,
9074 .apply_expected = true
9075 },
9076 .defend = {
9077 .timeout = 10,
9078 .positive = true,
9079 .num_ips = ctx->addresses_all_num,
9080 .ips = ctx->addresses_all,
9081 },
9082 .replica= {
9083 .type = WREPL_TYPE_MHOMED,
9084 .state = WREPL_STATE_ACTIVE,
9085 .node = WREPL_NODE_B,
9086 .is_static = false,
9087 .num_ips = ctx->addresses_best2_num,
9088 .ips = ctx->addresses_best2,
9089 .mhomed_merge = true,
9090 },
9091 },
9092 /*
9093 * special group vs. special group merging section
9094 */
9095 /*
9096 * sgroup,active vs. sgroup,active with different ip(s)
9097 */
9098 {
9099 .tctx = tctx,
9100 .line = __location__,
9101 .section= "Test Replica vs. owned active: SGROUP vs. SGROUP tests",
9102 .name = _NBT_NAME("_SA_SA_DI_U", 0x1C, NULL),
9103 .skip = (ctx->addresses_all_num < 3),
9104 .wins = {
9105 .nb_flags = NBT_NM_GROUP,
9106 .mhomed = false,
9107 .num_ips = ctx->addresses_mhomed_num,
9108 .ips = ctx->addresses_mhomed,
9109 .apply_expected = true
9110 },
9111 .defend = {
9112 .timeout = 0,
9113 },
9114 .replica= {
9115 .type = WREPL_TYPE_SGROUP,
9116 .state = WREPL_STATE_ACTIVE,
9117 .node = WREPL_NODE_B,
9118 .is_static = false,
9119 .num_ips = ARRAY_SIZE(addresses_B_3_4),
9120 .ips = addresses_B_3_4,
9121 .sgroup_merge = true
9122 },
9123 },
9124 /*
9125 * sgroup,active vs. sgroup,active with same ip(s)
9126 */
9127 {
9128 .tctx = tctx,
9129 .line = __location__,
9130 .name = _NBT_NAME("_SA_SA_SI_U", 0x1C, NULL),
9131 .skip = (ctx->addresses_all_num < 3),
9132 .wins = {
9133 .nb_flags = NBT_NM_GROUP,
9134 .mhomed = false,
9135 .num_ips = ctx->addresses_mhomed_num,
9136 .ips = ctx->addresses_mhomed,
9137 .apply_expected = true
9138 },
9139 .defend = {
9140 .timeout = 0,
9141 },
9142 .replica= {
9143 .type = WREPL_TYPE_SGROUP,
9144 .state = WREPL_STATE_ACTIVE,
9145 .node = WREPL_NODE_B,
9146 .is_static = false,
9147 .num_ips = ctx->addresses_mhomed_num,
9148 .ips = ctx->addresses_mhomed,
9149 .sgroup_merge = true
9150 },
9151 },
9152 /*
9153 * sgroup,active vs. sgroup,active with superset ip(s)
9154 */
9155 {
9156 .tctx = tctx,
9157 .line = __location__,
9158 .name = _NBT_NAME("_SA_SA_SP_U", 0x1C, NULL),
9159 .skip = (ctx->addresses_all_num < 3),
9160 .wins = {
9161 .nb_flags = NBT_NM_GROUP,
9162 .mhomed = false,
9163 .num_ips = ctx->addresses_mhomed_num,
9164 .ips = ctx->addresses_mhomed,
9165 .apply_expected = true
9166 },
9167 .defend = {
9168 .timeout = 0,
9169 },
9170 .replica= {
9171 .type = WREPL_TYPE_SGROUP,
9172 .state = WREPL_STATE_ACTIVE,
9173 .node = WREPL_NODE_B,
9174 .is_static = false,
9175 .num_ips = ctx->addresses_all_num,
9176 .ips = ctx->addresses_all,
9177 .sgroup_merge = true
9178 },
9179 },
9180 /*
9181 * sgroup,active vs. sgroup,active with subset ip(s)
9182 */
9183 {
9184 .tctx = tctx,
9185 .line = __location__,
9186 .name = _NBT_NAME("_SA_SA_SB_U", 0x1C, NULL),
9187 .skip = (ctx->addresses_all_num < 3),
9188 .wins = {
9189 .nb_flags = NBT_NM_GROUP,
9190 .mhomed = false,
9191 .num_ips = ctx->addresses_mhomed_num,
9192 .ips = ctx->addresses_mhomed,
9193 .apply_expected = true
9194 },
9195 .defend = {
9196 .timeout = 0,
9197 },
9198 .replica= {
9199 .type = WREPL_TYPE_SGROUP,
9200 .state = WREPL_STATE_ACTIVE,
9201 .node = WREPL_NODE_B,
9202 .is_static = false,
9203 .num_ips = ctx->addresses_best_num,
9204 .ips = ctx->addresses_best,
9205 .sgroup_merge = true
9206 },
9207 },
9208 /*
9209 * sgroup,active vs. sgroup,tombstone with different ip(s)
9210 */
9211 {
9212 .tctx = tctx,
9213 .line = __location__,
9214 .name = _NBT_NAME("_SA_ST_DI_U", 0x1C, NULL),
9215 .skip = (ctx->addresses_all_num < 3),
9216 .wins = {
9217 .nb_flags = NBT_NM_GROUP,
9218 .mhomed = false,
9219 .num_ips = ctx->addresses_mhomed_num,
9220 .ips = ctx->addresses_mhomed,
9221 .apply_expected = true
9222 },
9223 .defend = {
9224 .timeout = 0,
9225 },
9226 .replica= {
9227 .type = WREPL_TYPE_SGROUP,
9228 .state = WREPL_STATE_TOMBSTONE,
9229 .node = WREPL_NODE_B,
9230 .is_static = false,
9231 .num_ips = ARRAY_SIZE(addresses_B_3_4),
9232 .ips = addresses_B_3_4,
9233 .apply_expected = false
9234 },
9235 },
9236 /*
9237 * sgroup,active vs. sgroup,tombstone with same ip(s)
9238 */
9239 {
9240 .tctx = tctx,
9241 .line = __location__,
9242 .name = _NBT_NAME("_SA_ST_SI_U", 0x1C, NULL),
9243 .skip = (ctx->addresses_all_num < 3),
9244 .wins = {
9245 .nb_flags = NBT_NM_GROUP,
9246 .mhomed = false,
9247 .num_ips = ctx->addresses_mhomed_num,
9248 .ips = ctx->addresses_mhomed,
9249 .apply_expected = true
9250 },
9251 .defend = {
9252 .timeout = 0,
9253 },
9254 .replica= {
9255 .type = WREPL_TYPE_SGROUP,
9256 .state = WREPL_STATE_TOMBSTONE,
9257 .node = WREPL_NODE_B,
9258 .is_static = false,
9259 .num_ips = ctx->addresses_mhomed_num,
9260 .ips = ctx->addresses_mhomed,
9261 .apply_expected = false
9262 },
9263 },
9264 /*
9265 * sgroup,active vs. sgroup,tombstone with superset ip(s)
9266 */
9267 {
9268 .tctx = tctx,
9269 .line = __location__,
9270 .name = _NBT_NAME("_SA_ST_SP_U", 0x1C, NULL),
9271 .skip = (ctx->addresses_all_num < 3),
9272 .wins = {
9273 .nb_flags = NBT_NM_GROUP,
9274 .mhomed = false,
9275 .num_ips = ctx->addresses_mhomed_num,
9276 .ips = ctx->addresses_mhomed,
9277 .apply_expected = true
9278 },
9279 .defend = {
9280 .timeout = 0,
9281 },
9282 .replica= {
9283 .type = WREPL_TYPE_SGROUP,
9284 .state = WREPL_STATE_TOMBSTONE,
9285 .node = WREPL_NODE_B,
9286 .is_static = false,
9287 .num_ips = ctx->addresses_all_num,
9288 .ips = ctx->addresses_all,
9289 .apply_expected = false
9290 },
9291 },
9292 /*
9293 * sgroup,active vs. sgroup,tombstone with subset ip(s)
9294 */
9295 {
9296 .tctx = tctx,
9297 .line = __location__,
9298 .name = _NBT_NAME("_SA_ST_SB_U", 0x1C, NULL),
9299 .skip = (ctx->addresses_all_num < 3),
9300 .wins = {
9301 .nb_flags = NBT_NM_GROUP,
9302 .mhomed = false,
9303 .num_ips = ctx->addresses_mhomed_num,
9304 .ips = ctx->addresses_mhomed,
9305 .apply_expected = true
9306 },
9307 .defend = {
9308 .timeout = 0,
9309 },
9310 .replica= {
9311 .type = WREPL_TYPE_SGROUP,
9312 .state = WREPL_STATE_TOMBSTONE,
9313 .node = WREPL_NODE_B,
9314 .is_static = false,
9315 .num_ips = ctx->addresses_best_num,
9316 .ips = ctx->addresses_best,
9317 .apply_expected = false
9318 },
9319 },
9320 };
9321
9322 if (!ctx->nbtsock_srv) {
9323 torture_comment(tctx, "SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
9324 lpcfg_nbt_port(tctx->lp_ctx));
9325 return true;
9326 }
9327
9328 torture_comment(tctx, "Test Replica records vs. owned active records\n");
9329
9330 for(i=0; ret && i < ARRAY_SIZE(records); i++) {
9331 struct timeval end;
9332 struct test_conflict_owned_active_vs_replica_struct record = records[i];
9333 uint32_t j, count = 1;
9334 const char *action;
9335
9336 if (records[i].wins.mhomed || records[i].name.type == 0x1C) {
9337 count = records[i].wins.num_ips;
9338 }
9339
9340 if (records[i].section) {
9341 torture_comment(tctx, "%s\n", records[i].section);
9342 }
9343
9344 if (records[i].skip) {
9345 torture_comment(tctx, "%s => SKIPPED\n", nbt_name_string(ctx, &records[i].name));
9346 continue;
9347 }
9348
9349 if (records[i].replica.mhomed_merge) {
9350 action = "MHOMED_MERGE";
9351 } else if (records[i].replica.sgroup_merge) {
9352 action = "SGROUP_MERGE";
9353 } else if (records[i].replica.apply_expected) {
9354 action = "REPLACE";
9355 } else {
9356 action = "NOT REPLACE";
9357 }
9358
9359 torture_comment(tctx, "%s%s%s => %s\n",
9360 nbt_name_string(ctx, &records[i].name),
9361 (records[i].comment?": ":""),
9362 (records[i].comment?records[i].comment:""),
9363 action);
9364
9365 /* Prepare for multi homed registration */
9366 ZERO_STRUCT(records[i].defend);
9367 records[i].defend.timeout = 10;
9368 records[i].defend.positive = true;
9369 nbt_set_incoming_handler(ctx->nbtsock_srv,
9370 test_conflict_owned_active_vs_replica_handler,
9371 &records[i]);
9372 if (ctx->nbtsock_srv2) {
9373 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9374 test_conflict_owned_active_vs_replica_handler,
9375 &records[i]);
9376 }
9377
9378 /*
9379 * Setup Register
9380 */
9381 for (j=0; j < count; j++) {
9382 struct nbt_name_request *req;
9383
9384 name_register->in.name = records[i].name;
9385 name_register->in.dest_addr = ctx->address;
9386 name_register->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
9387 name_register->in.address = records[i].wins.ips[j].ip;
9388 name_register->in.nb_flags = records[i].wins.nb_flags;
9389 name_register->in.register_demand= false;
9390 name_register->in.broadcast = false;
9391 name_register->in.multi_homed = records[i].wins.mhomed;
9392 name_register->in.ttl = 300000;
9393 name_register->in.timeout = 70;
9394 name_register->in.retries = 0;
9395
9396 req = nbt_name_register_send(ctx->nbtsock, name_register);
9397
9398 /* push the request on the wire */
9399 tevent_loop_once(ctx->nbtsock->event_ctx);
9400
9401 /*
9402 * if we register multiple addresses,
9403 * the server will do name queries to see if the old addresses
9404 * are still alive
9405 */
9406 if (records[i].wins.mhomed && j > 0) {
9407 end = timeval_current_ofs(records[i].defend.timeout,0);
9408 records[i].defend.ret = true;
9409 while (records[i].defend.timeout > 0) {
9410 tevent_loop_once(ctx->nbtsock_srv->event_ctx);
9411 if (timeval_expired(&end)) break;
9412 }
9413 ret &= records[i].defend.ret;
9414 }
9415
9416 status = nbt_name_register_recv(req, ctx, name_register);
9417 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9418 torture_comment(tctx, "No response from %s for name register\n", ctx->address);
9419 ret = false;
9420 }
9421 if (!NT_STATUS_IS_OK(status)) {
9422 torture_comment(tctx, "Bad response from %s for name register - %s\n",
9423 ctx->address, nt_errstr(status));
9424 ret = false;
9425 }
9426 CHECK_VALUE(tctx, name_register->out.rcode, 0);
9427 CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address);
9428 CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type);
9429 CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name);
9430 CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope);
9431 CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[j].ip);
9432 }
9433
9434 /* Prepare for the current test */
9435 records[i].defend = record.defend;
9436 nbt_set_incoming_handler(ctx->nbtsock_srv,
9437 test_conflict_owned_active_vs_replica_handler,
9438 &records[i]);
9439 if (ctx->nbtsock_srv2) {
9440 nbt_set_incoming_handler(ctx->nbtsock_srv2,
9441 test_conflict_owned_active_vs_replica_handler,
9442 &records[i]);
9443 }
9444
9445 /*
9446 * Setup Replica
9447 */
9448 wins_name->name = &records[i].name;
9449 wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type,
9450 records[i].replica.state,
9451 records[i].replica.node,
9452 records[i].replica.is_static);
9453 wins_name->id = ++ctx->b.max_version;
9454 if (wins_name->flags & 2) {
9455 wins_name->addresses.addresses.num_ips = records[i].replica.num_ips;
9456 wins_name->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
9457 records[i].replica.ips);
9458 } else {
9459 wins_name->addresses.ip = records[i].replica.ips[0].ip;
9460 }
9461 wins_name->unknown = "255.255.255.255";
9462
9463 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9464
9465 /*
9466 * wait for the name query, which is handled in
9467 * test_conflict_owned_active_vs_replica_handler()
9468 */
9469 end = timeval_current_ofs(records[i].defend.timeout,0);
9470 records[i].defend.ret = true;
9471 while (records[i].defend.timeout > 0) {
9472 tevent_loop_once(ctx->nbtsock_srv->event_ctx);
9473 if (timeval_expired(&end)) break;
9474 }
9475 ret &= records[i].defend.ret;
9476
9477 if (records[i].defend.late_release) {
9478 records[i].defend = record.defend;
9479 records[i].defend.expect_release = true;
9480 /*
9481 * wait for the name release demand, which is handled in
9482 * test_conflict_owned_active_vs_replica_handler()
9483 */
9484 end = timeval_current_ofs(records[i].defend.timeout,0);
9485 records[i].defend.ret = true;
9486 while (records[i].defend.timeout > 0) {
9487 tevent_loop_once(ctx->nbtsock_srv->event_ctx);
9488 if (timeval_expired(&end)) break;
9489 }
9490 ret &= records[i].defend.ret;
9491 }
9492
9493 if (records[i].replica.mhomed_merge) {
9494 ret &= test_wrepl_mhomed_merged(tctx, ctx, &ctx->c,
9495 records[i].wins.num_ips, records[i].wins.ips,
9496 &ctx->b,
9497 records[i].replica.num_ips, records[i].replica.ips,
9498 wins_name);
9499 } else if (records[i].replica.sgroup_merge) {
9500 ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL,
9501 &ctx->c,
9502 records[i].wins.num_ips, records[i].wins.ips,
9503 &ctx->b,
9504 records[i].replica.num_ips, records[i].replica.ips,
9505 wins_name);
9506 } else {
9507 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name,
9508 records[i].replica.apply_expected);
9509 }
9510
9511 if (records[i].replica.apply_expected ||
9512 records[i].replica.mhomed_merge) {
9513 wins_name->name = &records[i].name;
9514 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9515 WREPL_STATE_TOMBSTONE,
9516 WREPL_NODE_B, false);
9517 wins_name->id = ++ctx->b.max_version;
9518 wins_name->addresses.ip = addresses_B_1[0].ip;
9519 wins_name->unknown = "255.255.255.255";
9520
9521 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9522 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9523 } else {
9524 for (j=0; j < count; j++) {
9525 struct nbt_name_socket *nbtsock = ctx->nbtsock;
9526
9527 if (ctx->myaddr2 && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2->addr) == 0) {
9528 nbtsock = ctx->nbtsock2;
9529 }
9530
9531 release->in.name = records[i].name;
9532 release->in.dest_addr = ctx->address;
9533 release->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
9534 release->in.address = records[i].wins.ips[j].ip;
9535 release->in.nb_flags = records[i].wins.nb_flags;
9536 release->in.broadcast = false;
9537 release->in.timeout = 30;
9538 release->in.retries = 0;
9539
9540 status = nbt_name_release(nbtsock, ctx, release);
9541 if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
9542 torture_comment(tctx, "No response from %s for name release\n", ctx->address);
9543 return false;
9544 }
9545 if (!NT_STATUS_IS_OK(status)) {
9546 torture_comment(tctx, "Bad response from %s for name query - %s\n",
9547 ctx->address, nt_errstr(status));
9548 return false;
9549 }
9550 CHECK_VALUE(tctx, release->out.rcode, 0);
9551 }
9552
9553 if (records[i].replica.sgroup_merge) {
9554 /* clean up the SGROUP record */
9555 wins_name->name = &records[i].name;
9556 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9557 WREPL_STATE_ACTIVE,
9558 WREPL_NODE_B, false);
9559 wins_name->id = ++ctx->b.max_version;
9560 wins_name->addresses.addresses.num_ips = 0;
9561 wins_name->addresses.addresses.ips = NULL;
9562 wins_name->unknown = "255.255.255.255";
9563 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9564
9565 /* take ownership of the SGROUP record */
9566 wins_name->name = &records[i].name;
9567 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP,
9568 WREPL_STATE_ACTIVE,
9569 WREPL_NODE_B, false);
9570 wins_name->id = ++ctx->b.max_version;
9571 wins_name->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1);
9572 wins_name->addresses.addresses.ips = discard_const_p(struct wrepl_ip,
9573 addresses_B_1);
9574 wins_name->unknown = "255.255.255.255";
9575 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9576 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9577
9578 /* overwrite the SGROUP record with unique,tombstone */
9579 wins_name->name = &records[i].name;
9580 wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE,
9581 WREPL_STATE_TOMBSTONE,
9582 WREPL_NODE_B, false);
9583 wins_name->id = ++ctx->b.max_version;
9584 wins_name->addresses.ip = addresses_A_1[0].ip;
9585 wins_name->unknown = "255.255.255.255";
9586 ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
9587 ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
9588 }
9589 }
9590
9591 if (!ret) {
9592 torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line);
9593 return ret;
9594 }
9595 }
9596
9597 return ret;
9598 }
9599
9600 #define __NBT_LABEL_CAT1__(a,b) a##b
9601 #define __NBT_LABEL_CAT2__(a,b) __NBT_LABEL_CAT1__(a,b)
9602 #define _NBT_LABEL __NBT_LABEL_CAT2__(_label_, __LINE__)
9603
9604 #define _NBT_ASSERT(v, correct) do { \
9605 bool _ret = true; \
9606 torture_assert_int_equal_goto(rec->tctx, v, correct, \
9607 _ret, _NBT_LABEL, "Invalid int value"); \
9608 _NBT_LABEL: \
9609 if (!_ret) { \
9610 return; \
9611 } \
9612 } while (0)
9613
9614 #define _NBT_ASSERT_STRING(v, correct) do { \
9615 bool _ret = true; \
9616 torture_assert_str_equal_goto(rec->tctx, v, correct, \
9617 _ret, _NBT_LABEL, "Invalid string value"); \
9618 _NBT_LABEL: \
9619 if (!_ret) { \
9620 return; \
9621 } \
9622 } while (0)
9623
9624 static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock,
9625 struct nbt_name_packet *req_packet,
9626 struct socket_address *src)
9627 {
9628 struct nbt_name *name;
9629 struct nbt_name_packet *rep_packet;
9630 struct test_conflict_owned_active_vs_replica_struct *rec =
9631 (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
9632
9633 _NBT_ASSERT(req_packet->qdcount, 1);
9634 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9635 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9636
9637 name = &req_packet->questions[0].name;
9638
9639 _NBT_ASSERT_STRING(name->name, rec->name.name);
9640 _NBT_ASSERT(name->type, rec->name.type);
9641 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9642
9643 _NBT_ASSERT(rec->defend.expect_release, false);
9644
9645 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9646 if (rep_packet == NULL) return;
9647
9648 rep_packet->name_trn_id = req_packet->name_trn_id;
9649 rep_packet->ancount = 1;
9650
9651 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9652 if (rep_packet->answers == NULL) return;
9653
9654 rep_packet->answers[0].name = *name;
9655 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9656 rep_packet->answers[0].ttl = 0;
9657
9658 if (rec->defend.positive) {
9659 uint32_t i, num_ips;
9660 const struct wrepl_ip *ips;
9661
9662 if (rec->defend.num_ips > 0) {
9663 num_ips = rec->defend.num_ips;
9664 ips = rec->defend.ips;
9665 } else {
9666 num_ips = rec->wins.num_ips;
9667 ips = rec->wins.ips;
9668 }
9669
9670 /* send a positive reply */
9671 rep_packet->operation =
9672 NBT_FLAG_REPLY |
9673 NBT_OPCODE_QUERY |
9674 NBT_FLAG_AUTHORITATIVE |
9675 NBT_FLAG_RECURSION_DESIRED |
9676 NBT_FLAG_RECURSION_AVAIL;
9677
9678 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9679
9680 rep_packet->answers[0].rdata.netbios.length = num_ips*6;
9681 rep_packet->answers[0].rdata.netbios.addresses =
9682 talloc_array(rep_packet->answers, struct nbt_rdata_address, num_ips);
9683 if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return;
9684
9685 for (i=0; i < num_ips; i++) {
9686 struct nbt_rdata_address *addr =
9687 &rep_packet->answers[0].rdata.netbios.addresses[i];
9688 addr->nb_flags = rec->wins.nb_flags;
9689 addr->ipaddr = ips[i].ip;
9690 }
9691 DEBUG(2,("Sending positive name query reply for %s to %s:%d\n",
9692 nbt_name_string(rep_packet, name), src->addr, src->port));
9693 } else {
9694 /* send a negative reply */
9695 rep_packet->operation =
9696 NBT_FLAG_REPLY |
9697 NBT_OPCODE_QUERY |
9698 NBT_FLAG_AUTHORITATIVE |
9699 NBT_RCODE_NAM;
9700
9701 rep_packet->answers[0].rr_type = NBT_QTYPE_NULL;
9702
9703 ZERO_STRUCT(rep_packet->answers[0].rdata);
9704
9705 DEBUG(2,("Sending negative name query reply for %s to %s:%d\n",
9706 nbt_name_string(rep_packet, name), src->addr, src->port));
9707 }
9708
9709 nbt_name_reply_send(nbtsock, src, rep_packet);
9710 talloc_free(rep_packet);
9711
9712 /* make sure we push the reply to the wire */
9713 while (nbtsock->send_queue) {
9714 tevent_loop_once(nbtsock->event_ctx);
9715 }
9716 smb_msleep(1000);
9717
9718 rec->defend.timeout = 0;
9719 rec->defend.ret = true;
9720 }
9721
9722 static void test_conflict_owned_active_vs_replica_handler_release(
9723 struct nbt_name_socket *nbtsock,
9724 struct nbt_name_packet *req_packet,
9725 struct socket_address *src)
9726 {
9727 struct nbt_name *name;
9728 struct nbt_name_packet *rep_packet;
9729 struct test_conflict_owned_active_vs_replica_struct *rec =
9730 (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
9731
9732 _NBT_ASSERT(req_packet->qdcount, 1);
9733 _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
9734 _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP);
9735
9736 name = &req_packet->questions[0].name;
9737
9738 _NBT_ASSERT_STRING(name->name, rec->name.name);
9739 _NBT_ASSERT(name->type, rec->name.type);
9740 _NBT_ASSERT_STRING(name->scope, rec->name.scope);
9741
9742 _NBT_ASSERT(rec->defend.expect_release, true);
9743
9744 rep_packet = talloc_zero(nbtsock, struct nbt_name_packet);
9745 if (rep_packet == NULL) return;
9746
9747 rep_packet->name_trn_id = req_packet->name_trn_id;
9748 rep_packet->ancount = 1;
9749 rep_packet->operation =
9750 NBT_FLAG_REPLY |
9751 NBT_OPCODE_RELEASE |
9752 NBT_FLAG_AUTHORITATIVE;
9753
9754 rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1);
9755 if (rep_packet->answers == NULL) return;
9756
9757 rep_packet->answers[0].name = *name;
9758 rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS;
9759 rep_packet->answers[0].rr_class = NBT_QCLASS_IP;
9760 rep_packet->answers[0].ttl = req_packet->additional[0].ttl;
9761 rep_packet->answers[0].rdata = req_packet->additional[0].rdata;
9762
9763 DEBUG(2,("Sending name release reply for %s to %s:%d\n",
9764 nbt_name_string(rep_packet, name), src->addr, src->port));
9765
9766 nbt_name_reply_send(nbtsock, src, rep_packet);
9767 talloc_free(rep_packet);
9768
9769 /* make sure we push the reply to the wire */
9770 while (nbtsock->send_queue) {
9771 tevent_loop_once(nbtsock->event_ctx);
9772 }
9773 smb_msleep(1000);
9774
9775 rec->defend.timeout = 0;
9776 rec->defend.ret = true;
9777 }
9778
9779 static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock,
9780 struct nbt_name_packet *req_packet,
9781 struct socket_address *src)
9782 {
9783 struct test_conflict_owned_active_vs_replica_struct *rec =
9784 (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
9785 struct nbt_name *name = &req_packet->questions[0].name;
9786
9787 if (req_packet->operation & NBT_FLAG_BROADCAST) {
9788 torture_comment(rec->tctx,
9789 "%s: incoming packet name[%s] flags[0x%08X] from[%s]\n",
9790 __location__,
9791 nbt_name_string(rec->tctx, name),
9792 req_packet->operation,
9793 src->addr);
9794 return;
9795 }
9796
9797 rec->defend.ret = false;
9798
9799 switch (req_packet->operation & NBT_OPCODE) {
9800 case NBT_OPCODE_QUERY:
9801 test_conflict_owned_active_vs_replica_handler_query(nbtsock, req_packet, src);
9802 break;
9803 case NBT_OPCODE_RELEASE:
9804 test_conflict_owned_active_vs_replica_handler_release(nbtsock, req_packet, src);
9805 break;
9806 default:
9807 torture_comment(rec->tctx,
9808 "%s: unexpected packet name[%s] flags[0x%08X] from[%s]\n",
9809 __location__,
9810 nbt_name_string(rec->tctx, name),
9811 req_packet->operation,
9812 src->addr);
9813 _NBT_ASSERT((req_packet->operation & NBT_OPCODE), NBT_OPCODE_QUERY);
9814 break;
9815 }
9816 }
9817
9818 /*
9819 test WINS replication replica conflicts operations
9820 */
9821 static bool torture_nbt_winsreplication_replica(struct torture_context *tctx)
9822 {
9823 bool ret = true;
9824 struct test_wrepl_conflict_conn *ctx;
9825
9826 const char *address;
9827 struct nbt_name name;
9828
9829 if (!torture_nbt_get_name(tctx, &name, &address))
9830 return false;
9831
9832 ctx = test_create_conflict_ctx(tctx, address);
9833 if (!ctx) return false;
9834
9835 ret &= test_conflict_same_owner(tctx, ctx);
9836 ret &= test_conflict_different_owner(tctx, ctx);
9837
9838 return ret;
9839 }
9840
9841 /*
9842 test WINS replication owned conflicts operations
9843 */
9844 static bool torture_nbt_winsreplication_owned(struct torture_context *tctx)
9845 {
9846 const char *address;
9847 struct nbt_name name;
9848 bool ret = true;
9849 struct test_wrepl_conflict_conn *ctx;
9850
9851 if (torture_setting_bool(tctx, "quick", false))
9852 torture_skip(tctx,
9853 "skip NBT-WINSREPLICATION-OWNED test in quick test mode\n");
9854
9855 if (!torture_nbt_get_name(tctx, &name, &address))
9856 return false;
9857
9858 ctx = test_create_conflict_ctx(tctx, address);
9859 torture_assert(tctx, ctx != NULL, "Creating context failed");
9860
9861 ret &= test_conflict_owned_released_vs_replica(tctx, ctx);
9862 ret &= test_conflict_owned_active_vs_replica(tctx, ctx);
9863
9864 return ret;
9865 }
9866
9867 /*
9868 test simple WINS replication operations
9869 */
9870 struct torture_suite *torture_nbt_winsreplication(TALLOC_CTX *mem_ctx)
9871 {
9872 struct torture_suite *suite = torture_suite_create(
9873 mem_ctx, "winsreplication");
9874 struct torture_tcase *tcase;
9875
9876 tcase = torture_suite_add_simple_test(suite, "assoc_ctx1",
9877 test_assoc_ctx1);
9878 tcase->tests->dangerous = true;
9879
9880 torture_suite_add_simple_test(suite, "assoc_ctx2", test_assoc_ctx2);
9881
9882 torture_suite_add_simple_test(suite, "wins_replication",
9883 test_wins_replication);
9884
9885 torture_suite_add_simple_test(suite, "replica",
9886 torture_nbt_winsreplication_replica);
9887
9888 torture_suite_add_simple_test(suite, "owned",
9889 torture_nbt_winsreplication_owned);
9890
9891 return suite;
9892 }