From 14bd4b81846318f2dd9a6a29018481299bd07450 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 16 Feb 2005 10:04:52 +0000 Subject: r5415: added a NBT-WINSREPLICATION torture test. It asks the server for the list of partners, and for each partner dumps the complete list of names (This used to be commit dacf5f166a0d5a7bc1d96e730748811c9f47bba6) --- source4/torture/nbt/winsreplication.c | 199 ++++++++++++++++++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 source4/torture/nbt/winsreplication.c (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c new file mode 100644 index 0000000000..f7e120d226 --- /dev/null +++ b/source4/torture/nbt/winsreplication.c @@ -0,0 +1,199 @@ +/* + Unix SMB/CIFS implementation. + + WINS replication testing + + Copyright (C) Andrew Tridgell 2005 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" +#include "libcli/nbt/libnbt.h" +#include "libcli/wins/winsrepl.h" + +#define CHECK_STATUS(status, correct) do { \ + if (!NT_STATUS_EQUAL(status, correct)) { \ + printf("(%s) Incorrect status %s - should be %s\n", \ + __location__, nt_errstr(status), nt_errstr(correct)); \ + ret = False; \ + goto done; \ + }} while (0) + +#define CHECK_VALUE(v, correct) do { \ + if ((v) != (correct)) { \ + printf("(%s) Incorrect value %s=%d - should be %d\n", \ + __location__, #v, v, correct); \ + ret = False; \ + goto done; \ + }} while (0) + +/* + extract a nbt_name from a name buffer +*/ +static struct nbt_name *wrepl_extract_name(TALLOC_CTX *mem_ctx, + uint8_t *name, uint32_t len) +{ + struct nbt_name *ret = talloc_zero(mem_ctx, struct nbt_name); + + /* oh wow, what a nasty bug in windows ... */ + if (name[0] == 0x1b && len >= 16) { + name[0] = name[15]; + name[15] = 0x1b; + } + + if (ret == NULL) return NULL; + if (len < 17) { + ret->name = talloc_strndup(ret, name, len); + } else { + char *s = talloc_strndup(ret, name, 15); + trim_string(s, NULL, " "); + ret->name = s; + ret->type = name[15]; + if (len > 18) { + ret->scope = talloc_strndup(ret, name+17, len-17); + } + } + return ret; +} + +/* + display a replication entry +*/ +static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_wins_name *wname) +{ + struct nbt_name *name = wrepl_extract_name(mem_ctx, + wname->name, + wname->name_len); + int i; + printf("%s\n", nbt_name_string(mem_ctx, name)); + if (wname->flags & 2) { + for (i=0;iaddresses.addresses.num_ips;i++) { + printf("\t%s %s\n", + wname->addresses.addresses.ips[i].owner, + wname->addresses.addresses.ips[i].ip); + } + } else { + printf("\t%s %s\n", + wname->addresses.address.owner, + wname->addresses.address.ip); + } +} + +/* + test a full replication dump from a WINS server +*/ +static BOOL nbt_test_wins_replication(TALLOC_CTX *mem_ctx, const char *address) +{ + BOOL ret = True; + struct wrepl_socket *wrepl_socket; + NTSTATUS status; + struct wrepl_packet request, *reply; + int i, j; + struct wrepl_table *table; + + wrepl_socket = wrepl_socket_init(mem_ctx, NULL); + + status = wrepl_connect(wrepl_socket, address); + CHECK_STATUS(status, NT_STATUS_OK); + + printf("Send a start association request\n"); + + ZERO_STRUCT(request); + request.opcode = WREPL_OPCODE_BITS; + request.mess_type = WREPL_START_ASSOCIATION; + request.message.start.minor_version = 2; + request.message.start.major_version = 5; + request.padding = data_blob_talloc_zero(mem_ctx, 0); + + status = wrepl_request(wrepl_socket, mem_ctx, &request, &reply); + CHECK_STATUS(status, NT_STATUS_OK); + CHECK_VALUE(reply->mess_type, WREPL_START_ASSOCIATION_REPLY); + + request.assoc_ctx = reply->message.start_reply.assoc_ctx; + printf("association context: 0x%x\n", request.assoc_ctx); + + printf("Send a replication table query\n"); + request.mess_type = WREPL_REPLICATION; + request.message.replication.command = WREPL_REPL_TABLE_QUERY; + + status = wrepl_request(wrepl_socket, mem_ctx, &request, &reply); + CHECK_STATUS(status, NT_STATUS_OK); + CHECK_VALUE(reply->mess_type, WREPL_REPLICATION); + CHECK_VALUE(reply->message.replication.command, WREPL_REPL_TABLE_REPLY); + + table = &reply->message.replication.info.table; + + printf("Found %d replication partners\n", table->partner_count); + + for (i=0;ipartner_count;i++) { + printf("%s max_version=%6llu min_version=%6llu type=%d\n", + table->partners[i].address, + table->partners[i].max_version, + table->partners[i].min_version, + table->partners[i].type); + + request.message.replication.command = WREPL_REPL_SEND_REQUEST; + request.message.replication.info.owner = table->partners[i]; + + status = wrepl_request(wrepl_socket, mem_ctx, &request, &reply); + CHECK_STATUS(status, NT_STATUS_OK); + CHECK_VALUE(reply->mess_type, WREPL_REPLICATION); + CHECK_VALUE(reply->message.replication.command, WREPL_REPL_SEND_REPLY); + + printf("Received %d names\n", + reply->message.replication.info.reply.num_names); + + for (j=0;jmessage.replication.info.reply.num_names;j++) { + display_entry(mem_ctx, + &reply->message.replication.info.reply.names[j]); + } + } + +done: + talloc_free(wrepl_socket); + return ret; +} + +/* + test WINS replication operations +*/ +BOOL torture_nbt_winsreplication(void) +{ + const char *address; + struct nbt_name name; + TALLOC_CTX *mem_ctx = talloc_new(NULL); + NTSTATUS status; + BOOL ret = True; + + name.name = lp_parm_string(-1, "torture", "host"); + name.type = NBT_NAME_SERVER; + name.scope = NULL; + + /* do an initial name resolution to find its IP */ + status = resolve_name(&name, mem_ctx, &address); + if (!NT_STATUS_IS_OK(status)) { + printf("Failed to resolve %s - %s\n", + name.name, nt_errstr(status)); + talloc_free(mem_ctx); + return False; + } + + ret &= nbt_test_wins_replication(mem_ctx, address); + + talloc_free(mem_ctx); + + return ret; +} -- cgit From 97dcee677e4fda03bed2ace3151e329e340ca313 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 16 Feb 2005 10:10:47 +0000 Subject: r5416: nicer output when trying to replicate with a server that hasn't been setup as a partner (This used to be commit b94301b357801767e65e19be5d9464c58ecf621e) --- source4/torture/nbt/winsreplication.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index f7e120d226..f3446b8e8b 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -131,6 +131,12 @@ static BOOL nbt_test_wins_replication(TALLOC_CTX *mem_ctx, const char *address) status = wrepl_request(wrepl_socket, mem_ctx, &request, &reply); CHECK_STATUS(status, NT_STATUS_OK); + if (reply->mess_type == WREPL_STOP_ASSOCIATION) { + printf("server refused table query - reason %d\n", + reply->message.stop.reason); + ret = False; + goto done; + } CHECK_VALUE(reply->mess_type, WREPL_REPLICATION); CHECK_VALUE(reply->message.replication.command, WREPL_REPL_TABLE_REPLY); -- cgit From 42d6a4c4f0d87e8e1bdd1e3152e592822bf95337 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 18 Feb 2005 23:13:51 +0000 Subject: r5451: - added separate wrepl_associate(), wrepl_pull_table() and wrepl_pull_names() functions, with reasonable parameters, so callers don't need to deal directly with wins replication packet structures - converted the NBT-WINSREPLICATION torture test to use the new APIs (This used to be commit cec1672662b7e5b1bdf843e9dee317aa4b03f719) --- source4/torture/nbt/winsreplication.c | 114 ++++++++-------------------------- 1 file changed, 27 insertions(+), 87 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index f3446b8e8b..5ba6003b78 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -40,55 +40,17 @@ goto done; \ }} while (0) -/* - extract a nbt_name from a name buffer -*/ -static struct nbt_name *wrepl_extract_name(TALLOC_CTX *mem_ctx, - uint8_t *name, uint32_t len) -{ - struct nbt_name *ret = talloc_zero(mem_ctx, struct nbt_name); - - /* oh wow, what a nasty bug in windows ... */ - if (name[0] == 0x1b && len >= 16) { - name[0] = name[15]; - name[15] = 0x1b; - } - - if (ret == NULL) return NULL; - if (len < 17) { - ret->name = talloc_strndup(ret, name, len); - } else { - char *s = talloc_strndup(ret, name, 15); - trim_string(s, NULL, " "); - ret->name = s; - ret->type = name[15]; - if (len > 18) { - ret->scope = talloc_strndup(ret, name+17, len-17); - } - } - return ret; -} - /* display a replication entry */ -static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_wins_name *wname) +static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_name *name) { - struct nbt_name *name = wrepl_extract_name(mem_ctx, - wname->name, - wname->name_len); int i; - printf("%s\n", nbt_name_string(mem_ctx, name)); - if (wname->flags & 2) { - for (i=0;iaddresses.addresses.num_ips;i++) { - printf("\t%s %s\n", - wname->addresses.addresses.ips[i].owner, - wname->addresses.addresses.ips[i].ip); - } - } else { + + printf("%s\n", nbt_name_string(mem_ctx, &name->name)); + for (i=0;inum_addresses;i++) { printf("\t%s %s\n", - wname->addresses.address.owner, - wname->addresses.address.ip); + name->addresses[i].owner, name->addresses[i].address); } } @@ -100,9 +62,10 @@ static BOOL nbt_test_wins_replication(TALLOC_CTX *mem_ctx, const char *address) BOOL ret = True; struct wrepl_socket *wrepl_socket; NTSTATUS status; - struct wrepl_packet request, *reply; int i, j; - struct wrepl_table *table; + struct wrepl_associate associate; + struct wrepl_pull_table pull_table; + struct wrepl_pull_names pull_names; wrepl_socket = wrepl_socket_init(mem_ctx, NULL); @@ -111,60 +74,37 @@ static BOOL nbt_test_wins_replication(TALLOC_CTX *mem_ctx, const char *address) printf("Send a start association request\n"); - ZERO_STRUCT(request); - request.opcode = WREPL_OPCODE_BITS; - request.mess_type = WREPL_START_ASSOCIATION; - request.message.start.minor_version = 2; - request.message.start.major_version = 5; - request.padding = data_blob_talloc_zero(mem_ctx, 0); - - status = wrepl_request(wrepl_socket, mem_ctx, &request, &reply); + status = wrepl_associate(wrepl_socket, &associate); CHECK_STATUS(status, NT_STATUS_OK); - CHECK_VALUE(reply->mess_type, WREPL_START_ASSOCIATION_REPLY); - request.assoc_ctx = reply->message.start_reply.assoc_ctx; - printf("association context: 0x%x\n", request.assoc_ctx); + printf("association context: 0x%x\n", associate.out.assoc_ctx); printf("Send a replication table query\n"); - request.mess_type = WREPL_REPLICATION; - request.message.replication.command = WREPL_REPL_TABLE_QUERY; + pull_table.in.assoc_ctx = associate.out.assoc_ctx; - status = wrepl_request(wrepl_socket, mem_ctx, &request, &reply); + status = wrepl_pull_table(wrepl_socket, mem_ctx, &pull_table); CHECK_STATUS(status, NT_STATUS_OK); - if (reply->mess_type == WREPL_STOP_ASSOCIATION) { - printf("server refused table query - reason %d\n", - reply->message.stop.reason); - ret = False; - goto done; - } - CHECK_VALUE(reply->mess_type, WREPL_REPLICATION); - CHECK_VALUE(reply->message.replication.command, WREPL_REPL_TABLE_REPLY); - - table = &reply->message.replication.info.table; - printf("Found %d replication partners\n", table->partner_count); + printf("Found %d replication partners\n", pull_table.out.num_partners); - for (i=0;ipartner_count;i++) { + for (i=0;ipartners[i].address, - table->partners[i].max_version, - table->partners[i].min_version, - table->partners[i].type); - - request.message.replication.command = WREPL_REPL_SEND_REQUEST; - request.message.replication.info.owner = table->partners[i]; - - status = wrepl_request(wrepl_socket, mem_ctx, &request, &reply); + partner->address, + partner->max_version, + partner->min_version, + partner->type); + + pull_names.in.assoc_ctx = associate.out.assoc_ctx; + pull_names.in.partner = *partner; + + status = wrepl_pull_names(wrepl_socket, mem_ctx, &pull_names); CHECK_STATUS(status, NT_STATUS_OK); - CHECK_VALUE(reply->mess_type, WREPL_REPLICATION); - CHECK_VALUE(reply->message.replication.command, WREPL_REPL_SEND_REPLY); - printf("Received %d names\n", - reply->message.replication.info.reply.num_names); + printf("Received %d names\n", pull_names.out.num_names); - for (j=0;jmessage.replication.info.reply.num_names;j++) { - display_entry(mem_ctx, - &reply->message.replication.info.reply.names[j]); + for (j=0;j Date: Sun, 22 May 2005 10:23:01 +0000 Subject: r6933: Add a couple of helper functions for creating nbt names. (This used to be commit b896daf11c3efb1b3ca939575da9dab82b395777) --- source4/torture/nbt/winsreplication.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 5ba6003b78..4e91deb84a 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -124,9 +124,7 @@ BOOL torture_nbt_winsreplication(void) NTSTATUS status; BOOL ret = True; - name.name = lp_parm_string(-1, "torture", "host"); - name.type = NBT_NAME_SERVER; - name.scope = NULL; + make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host")); /* do an initial name resolution to find its IP */ status = resolve_name(&name, mem_ctx, &address); -- cgit From c98c6aa5611f26ab591c50fcded1fc55e81a0d07 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 28 Aug 2005 02:37:14 +0000 Subject: r9702: r9680@blu: tridge | 2005-08-27 18:45:08 +1000 - fixed ncacn_ip_tcp to use the generic async name resolution methods, so NBT names now work (as requested several times by abartlet!) - changed resolve_name() to take an event_context, so it doesn't cause the whole process to block - cleaned up the talloc_find_parent_bytype() calls to go via a cleaner event_context_find() call (This used to be commit b3d491b210a8b889a25efcb273e70fefbd01b7f7) --- source4/torture/nbt/winsreplication.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 4e91deb84a..add34d4fa0 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -127,7 +127,7 @@ BOOL torture_nbt_winsreplication(void) make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host")); /* do an initial name resolution to find its IP */ - status = resolve_name(&name, mem_ctx, &address); + status = resolve_name(&name, mem_ctx, &address, NULL); if (!NT_STATUS_IS_OK(status)) { printf("Failed to resolve %s - %s\n", name.name, nt_errstr(status)); -- cgit From 63ef3c7fdc74e025c5547c391cf61a14ab68dd48 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 9 Sep 2005 16:00:02 +0000 Subject: r10113: rename libcli/wins to libcli/wrepl metze (This used to be commit d8b84112bb40605b07a77ab5f7a44ac1807ccc59) --- source4/torture/nbt/winsreplication.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index add34d4fa0..1cf78f215c 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -22,7 +22,7 @@ #include "includes.h" #include "libcli/nbt/libnbt.h" -#include "libcli/wins/winsrepl.h" +#include "libcli/wrepl/winsrepl.h" #define CHECK_STATUS(status, correct) do { \ if (!NT_STATUS_EQUAL(status, correct)) { \ -- cgit From 5c7de96d2c9e2985c750c69d3b73eb9e30037d07 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 12 Sep 2005 10:06:22 +0000 Subject: r10164: - add first assoc_ctx test - handle the case where we're no valid pull partner of the tested server metze (This used to be commit d2e62dc205dd450ce57b9566c29e82878eb8471b) --- source4/torture/nbt/winsreplication.c | 82 ++++++++++++++++++++++++++++++++++- 1 file changed, 80 insertions(+), 2 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 1cf78f215c..c60419a534 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -40,6 +40,61 @@ goto done; \ }} while (0) +/* + test how assoc_ctx's are only usable on the connection + they are created on. +*/ +static BOOL test_assoc_ctx1(TALLOC_CTX *mem_ctx, const char *address) +{ + BOOL ret = True; + struct wrepl_request *req; + struct wrepl_socket *wrepl_socket1; + struct wrepl_associate associate1; + struct wrepl_socket *wrepl_socket2; + struct wrepl_associate associate2; + struct wrepl_pull_table pull_table; + NTSTATUS status; + + printf("Test if assoc_ctx is only valid on the conection it was created on\n"); + + wrepl_socket1 = wrepl_socket_init(mem_ctx, NULL); + wrepl_socket2 = wrepl_socket_init(mem_ctx, NULL); + + printf("Setup 2 wrepl connections\n"); + status = wrepl_connect(wrepl_socket1, address); + CHECK_STATUS(status, NT_STATUS_OK); + + status = wrepl_connect(wrepl_socket2, address); + CHECK_STATUS(status, NT_STATUS_OK); + + printf("Send a start association request (conn1)\n"); + status = wrepl_associate(wrepl_socket1, &associate1); + CHECK_STATUS(status, NT_STATUS_OK); + + printf("association context (conn1): 0x%x\n", associate1.out.assoc_ctx); + + printf("Send a start association request (conn2)\n"); + status = wrepl_associate(wrepl_socket2, &associate2); + CHECK_STATUS(status, NT_STATUS_OK); + + printf("association context (conn2): 0x%x\n", associate2.out.assoc_ctx); + + printf("Send a replication table query, with assoc 1 (conn2), should be ignored\n"); + pull_table.in.assoc_ctx = associate1.out.assoc_ctx; + req = wrepl_pull_table_send(wrepl_socket2, &pull_table); + talloc_free(req); + + printf("Send a association request (conn2), to make sure the last request was ignored\n"); + status = wrepl_associate(wrepl_socket2, &associate2); + CHECK_STATUS(status, NT_STATUS_OK); + +done: + printf("Close 2 wrepl connections\n"); + talloc_free(wrepl_socket1); + talloc_free(wrepl_socket2); + return ret; +} + /* display a replication entry */ @@ -57,7 +112,7 @@ static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_name *name) /* test a full replication dump from a WINS server */ -static BOOL nbt_test_wins_replication(TALLOC_CTX *mem_ctx, const char *address) +static BOOL test_wins_replication(TALLOC_CTX *mem_ctx, const char *address) { BOOL ret = True; struct wrepl_socket *wrepl_socket; @@ -67,8 +122,11 @@ static BOOL nbt_test_wins_replication(TALLOC_CTX *mem_ctx, const char *address) struct wrepl_pull_table pull_table; struct wrepl_pull_names pull_names; + printf("Test one pull replication cycle\n"); + wrepl_socket = wrepl_socket_init(mem_ctx, NULL); + printf("Setup wrepl connections\n"); status = wrepl_connect(wrepl_socket, address); CHECK_STATUS(status, NT_STATUS_OK); @@ -83,6 +141,23 @@ static BOOL nbt_test_wins_replication(TALLOC_CTX *mem_ctx, const char *address) pull_table.in.assoc_ctx = associate.out.assoc_ctx; status = wrepl_pull_table(wrepl_socket, mem_ctx, &pull_table); + if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) { + struct wrepl_packet packet; + struct wrepl_request *req; + + printf("We are not a valid pull partner for the server\n"); + + ZERO_STRUCT(packet); + packet.opcode = WREPL_OPCODE_BITS; + packet.assoc_ctx = associate.out.assoc_ctx; + packet.mess_type = WREPL_STOP_ASSOCIATION; + packet.message.stop.reason = 0; + + req = wrepl_request_send(wrepl_socket, &packet); + talloc_free(req); + ret = False; + goto done; + } CHECK_STATUS(status, NT_STATUS_OK); printf("Found %d replication partners\n", pull_table.out.num_partners); @@ -109,6 +184,7 @@ static BOOL nbt_test_wins_replication(TALLOC_CTX *mem_ctx, const char *address) } done: + printf("Close wrepl connections\n"); talloc_free(wrepl_socket); return ret; } @@ -135,7 +211,9 @@ BOOL torture_nbt_winsreplication(void) return False; } - ret &= nbt_test_wins_replication(mem_ctx, address); + ret &= test_assoc_ctx1(mem_ctx, address); + + ret &= test_wins_replication(mem_ctx, address); talloc_free(mem_ctx); -- cgit From 76277d1813b4c86f30f785a416c16360c86600d7 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 12 Sep 2005 11:42:48 +0000 Subject: r10167: add a test to check if we always get the same assoc_ctx, on one connection. metze (This used to be commit 589541b7402506422e8a85a857ea48910b24f2d6) --- source4/torture/nbt/winsreplication.c | 49 +++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index c60419a534..914e0b52eb 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -95,6 +95,50 @@ done: return ret; } +/* + test if we always get back the same assoc_ctx +*/ +static BOOL test_assoc_ctx2(TALLOC_CTX *mem_ctx, const char *address) +{ + BOOL ret = True; + struct wrepl_socket *wrepl_socket; + struct wrepl_associate associate; + uint32_t assoc_ctx1; + NTSTATUS status; + + printf("Test if we always get back the same assoc_ctx\n"); + + wrepl_socket = wrepl_socket_init(mem_ctx, NULL); + + printf("Setup wrepl connections\n"); + status = wrepl_connect(wrepl_socket, address); + CHECK_STATUS(status, NT_STATUS_OK); + + + printf("Send 1st start association request\n"); + status = wrepl_associate(wrepl_socket, &associate); + CHECK_STATUS(status, NT_STATUS_OK); + assoc_ctx1 = associate.out.assoc_ctx; + printf("1st association context: 0x%x\n", associate.out.assoc_ctx); + + printf("Send 2nd start association request\n"); + status = wrepl_associate(wrepl_socket, &associate); + CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1); + CHECK_STATUS(status, NT_STATUS_OK); + printf("2nd association context: 0x%x\n", associate.out.assoc_ctx); + + printf("Send 3rd start association request\n"); + status = wrepl_associate(wrepl_socket, &associate); + CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1); + CHECK_STATUS(status, NT_STATUS_OK); + printf("3rd association context: 0x%x\n", associate.out.assoc_ctx); + +done: + printf("Close wrepl connections\n"); + talloc_free(wrepl_socket); + return ret; +} + /* display a replication entry */ @@ -145,8 +189,6 @@ static BOOL test_wins_replication(TALLOC_CTX *mem_ctx, const char *address) struct wrepl_packet packet; struct wrepl_request *req; - printf("We are not a valid pull partner for the server\n"); - ZERO_STRUCT(packet); packet.opcode = WREPL_OPCODE_BITS; packet.assoc_ctx = associate.out.assoc_ctx; @@ -155,6 +197,8 @@ static BOOL test_wins_replication(TALLOC_CTX *mem_ctx, const char *address) req = wrepl_request_send(wrepl_socket, &packet); talloc_free(req); + + printf("failed - We are not a valid pull partner for the server\n"); ret = False; goto done; } @@ -212,6 +256,7 @@ BOOL torture_nbt_winsreplication(void) } ret &= test_assoc_ctx1(mem_ctx, address); + ret &= test_assoc_ctx2(mem_ctx, address); ret &= test_wins_replication(mem_ctx, address); -- cgit From f7c5e5a3987ea773203f6052e9cac34ae8992131 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 28 Sep 2005 09:58:58 +0000 Subject: r10569: add all info that we have to wrepl_name, as we need it for replication :-) metze (This used to be commit bfd548ca10134d5a17b87a0507917721aa251223) --- source4/torture/nbt/winsreplication.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 914e0b52eb..cd60e12499 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -147,9 +147,12 @@ static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_name *name) int i; printf("%s\n", nbt_name_string(mem_ctx, &name->name)); + printf("\tFLAGS: 0x%08X G_FLAG: 0x%08X VERSION_ID: %llu\n", + name->flags, name->group_flag, name->version_id); + printf("\tOWNER: %-15s\n", name->owner); for (i=0;inum_addresses;i++) { - printf("\t%s %s\n", - name->addresses[i].owner, name->addresses[i].address); + printf("\tADDR: %-15s OWNER: %-15s\n", + name->addresses[i].address, name->addresses[i].owner); } } -- cgit From 08f16292a0cfab57c484661c1f05e1a49ec06942 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 29 Sep 2005 14:00:07 +0000 Subject: r10608: - fix hierachical memory handling in ndr_pull_nbt_name - add wrepl_nbt_name scalar type and do the pull/push in the ndr layer instead of the caller - give the flags and group_flag in the wrepl_name a meaning metze (This used to be commit b98efc2905e1147eb97111b46a877bdb9d8dd154) --- source4/torture/nbt/winsreplication.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index cd60e12499..d3ec5e84d6 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -147,9 +147,10 @@ static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_name *name) int i; printf("%s\n", nbt_name_string(mem_ctx, &name->name)); - printf("\tFLAGS: 0x%08X G_FLAG: 0x%08X VERSION_ID: %llu\n", - name->flags, name->group_flag, name->version_id); - printf("\tOWNER: %-15s\n", name->owner); + printf("\tTYPE:%u STATE:%u NODE:0x%04X STATIC:%u VERSION_ID: %llu\n", + name->type, name->state, name->node, name->is_static, name->version_id); + printf("\tRAW_FLAGS:0x%08X OWNER: %-15s\n", + name->raw_flags, name->owner); for (i=0;inum_addresses;i++) { printf("\tADDR: %-15s OWNER: %-15s\n", name->addresses[i].address, name->addresses[i].owner); -- cgit From c2d7914428f73d1826dffa893418fa286a5e9ab8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 29 Sep 2005 22:06:24 +0000 Subject: r10627: - use a wrepl specific enum for the node type - the unknown flag 0x10 seems to mean that this name was localy registered on this currently asked server, that flag is not present in replica records metze (This used to be commit ba3685c41dc934692bd653f4fe9c0ee451146c40) --- source4/torture/nbt/winsreplication.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index d3ec5e84d6..68961ab180 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -147,9 +147,9 @@ static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_name *name) int i; printf("%s\n", nbt_name_string(mem_ctx, &name->name)); - printf("\tTYPE:%u STATE:%u NODE:0x%04X STATIC:%u VERSION_ID: %llu\n", + printf("\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n", name->type, name->state, name->node, name->is_static, name->version_id); - printf("\tRAW_FLAGS:0x%08X OWNER: %-15s\n", + printf("\tRAW_FLAGS: 0x%08X OWNER: %-15s\n", name->raw_flags, name->owner); for (i=0;inum_addresses;i++) { printf("\tADDR: %-15s OWNER: %-15s\n", -- cgit From 6799fde75d1ccf93171874fd33f9e89e4472fd81 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 6 Oct 2005 14:38:07 +0000 Subject: r10766: - make it possible to mark a wrepl_request as send only, used for WREPL_REPL_INFORM* messsages - make it possible to close the connection after a request was send used for WREPL_ASSOCIATION_STOP - fix the torture test that tests the assoc context handling between connections, you can issue a request and get the reply on another connection, I think we should not implement that in our server code, as I think it's a security hole, you can cause a windows server to send the replies to someone another client, that doesn't wait for data, and as there're no massage_id in the protocol the client would be confused by a replies that doesn't belong to a query metze (This used to be commit dfc95de8fa7ded8ea92cafe58cf86efcc7920156) --- source4/torture/nbt/winsreplication.c | 40 +++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 7 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 68961ab180..e72ba9c8d6 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -53,18 +53,20 @@ static BOOL test_assoc_ctx1(TALLOC_CTX *mem_ctx, const char *address) struct wrepl_socket *wrepl_socket2; struct wrepl_associate associate2; struct wrepl_pull_table pull_table; + struct wrepl_packet *rep_packet; + struct wrepl_associate_stop assoc_stop; NTSTATUS status; printf("Test if assoc_ctx is only valid on the conection it was created on\n"); wrepl_socket1 = wrepl_socket_init(mem_ctx, NULL); wrepl_socket2 = wrepl_socket_init(mem_ctx, NULL); - + printf("Setup 2 wrepl connections\n"); - status = wrepl_connect(wrepl_socket1, address); + status = wrepl_connect(wrepl_socket1, NULL, address); CHECK_STATUS(status, NT_STATUS_OK); - status = wrepl_connect(wrepl_socket2, address); + status = wrepl_connect(wrepl_socket2, NULL, address); CHECK_STATUS(status, NT_STATUS_OK); printf("Send a start association request (conn1)\n"); @@ -79,15 +81,39 @@ static BOOL test_assoc_ctx1(TALLOC_CTX *mem_ctx, const char *address) printf("association context (conn2): 0x%x\n", associate2.out.assoc_ctx); - printf("Send a replication table query, with assoc 1 (conn2), should be ignored\n"); + printf("Send a replication table query, with assoc 1 (conn2), the anwser should be on conn1\n"); pull_table.in.assoc_ctx = associate1.out.assoc_ctx; req = wrepl_pull_table_send(wrepl_socket2, &pull_table); - talloc_free(req); + req->send_only = True; + status = wrepl_request_recv(req, mem_ctx, &rep_packet); + CHECK_STATUS(status, NT_STATUS_OK); printf("Send a association request (conn2), to make sure the last request was ignored\n"); status = wrepl_associate(wrepl_socket2, &associate2); CHECK_STATUS(status, NT_STATUS_OK); + printf("Send a replication table query, with invalid assoc (conn1), receive answer from conn2\n"); + pull_table.in.assoc_ctx = 0; + req = wrepl_pull_table_send(wrepl_socket1, &pull_table); + status = wrepl_request_recv(req, mem_ctx, &rep_packet); + CHECK_STATUS(status, NT_STATUS_OK); + + printf("Send a association request (conn1), to make sure the last request was handled correct\n"); + status = wrepl_associate(wrepl_socket1, &associate2); + CHECK_STATUS(status, NT_STATUS_OK); + + assoc_stop.in.assoc_ctx = associate1.out.assoc_ctx; + assoc_stop.in.reason = 4; + printf("Send a association stop request (conn1), reson: %u\n", assoc_stop.in.reason); + status = wrepl_associate_stop(wrepl_socket1, &assoc_stop); + CHECK_STATUS(status, NT_STATUS_END_OF_FILE); + + assoc_stop.in.assoc_ctx = associate2.out.assoc_ctx; + assoc_stop.in.reason = 0; + printf("Send a association stop request (conn2), reson: %u\n", assoc_stop.in.reason); + status = wrepl_associate_stop(wrepl_socket2, &assoc_stop); + CHECK_STATUS(status, NT_STATUS_OK); + done: printf("Close 2 wrepl connections\n"); talloc_free(wrepl_socket1); @@ -111,7 +137,7 @@ static BOOL test_assoc_ctx2(TALLOC_CTX *mem_ctx, const char *address) wrepl_socket = wrepl_socket_init(mem_ctx, NULL); printf("Setup wrepl connections\n"); - status = wrepl_connect(wrepl_socket, address); + status = wrepl_connect(wrepl_socket, NULL, address); CHECK_STATUS(status, NT_STATUS_OK); @@ -175,7 +201,7 @@ static BOOL test_wins_replication(TALLOC_CTX *mem_ctx, const char *address) wrepl_socket = wrepl_socket_init(mem_ctx, NULL); printf("Setup wrepl connections\n"); - status = wrepl_connect(wrepl_socket, address); + status = wrepl_connect(wrepl_socket, NULL, address); CHECK_STATUS(status, NT_STATUS_OK); printf("Send a start association request\n"); -- cgit From 3158f35256100e7d101f9ef445f8c5bd8166b46b Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 13 Oct 2005 16:27:05 +0000 Subject: r10965: - only run the cross connection assoc test when running with -X this sometimes crashes the windows server - add the first replication conflict tests we now test that replica records are always overwritten when the owner is the same metze (This used to be commit f93353ac41441e0ca7b31c82318005438cd00ce5) --- source4/torture/nbt/winsreplication.c | 289 +++++++++++++++++++++++++++++++++- 1 file changed, 288 insertions(+), 1 deletion(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index e72ba9c8d6..e822624f7f 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -57,6 +57,11 @@ static BOOL test_assoc_ctx1(TALLOC_CTX *mem_ctx, const char *address) struct wrepl_associate_stop assoc_stop; NTSTATUS status; + if (!lp_parm_bool(-1, "torture", "dangerous", False)) { + printf("winsrepl: cross connection assoc_ctx usage disabled - enable dangerous tests to use\n"); + return True; + } + printf("Test if assoc_ctx is only valid on the conection it was created on\n"); wrepl_socket1 = wrepl_socket_init(mem_ctx, NULL); @@ -165,6 +170,283 @@ done: return ret; } +struct test_wrepl_conflict_conn { + const char *address; + struct wrepl_socket *pull; + uint32_t pull_assoc; + +#define TEST_OWNER_A_ADDRESS "127.65.65.1" +#define TEST_ADDRESS_A_PREFIX "127.0.65" +#define TEST_OWNER_B_ADDRESS "127.66.66.1" +#define TEST_ADDRESS_B_PREFIX "127.0.66" + + struct wrepl_wins_owner a, b; +}; + +static const struct wrepl_ip addresses_A_1[] = { + { + .owner = TEST_OWNER_A_ADDRESS, + .ip = TEST_ADDRESS_A_PREFIX".1" + } +}; +static const struct wrepl_ip addresses_A_2[] = { + { + .owner = TEST_OWNER_A_ADDRESS, + .ip = TEST_ADDRESS_A_PREFIX".2" + } +}; + +static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem_ctx, + const char *address) +{ + struct test_wrepl_conflict_conn *ctx; + struct wrepl_associate associate; + struct wrepl_pull_table pull_table; + NTSTATUS status; + uint32_t i; + + ctx = talloc_zero(mem_ctx, struct test_wrepl_conflict_conn); + if (!ctx) return NULL; + + ctx->address = address; + ctx->pull = wrepl_socket_init(ctx, NULL); + if (!ctx->pull) return NULL; + + printf("Setup wrepl conflict pull connection\n"); + status = wrepl_connect(ctx->pull, NULL, ctx->address); + if (!NT_STATUS_IS_OK(status)) return NULL; + + status = wrepl_associate(ctx->pull, &associate); + if (!NT_STATUS_IS_OK(status)) return NULL; + + ctx->pull_assoc = associate.out.assoc_ctx; + + ctx->a.address = TEST_OWNER_A_ADDRESS; + ctx->a.max_version = 0; + ctx->a.min_version = 0; + ctx->a.type = 1; + + ctx->b.address = TEST_OWNER_B_ADDRESS; + ctx->b.max_version = 0; + ctx->b.min_version = 0; + ctx->b.type = 1; + + pull_table.in.assoc_ctx = ctx->pull_assoc; + status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table); + if (!NT_STATUS_IS_OK(status)) return NULL; + + for (i=0; i < pull_table.out.num_partners; i++) { + if (strcmp(TEST_OWNER_A_ADDRESS,pull_table.out.partners[i].address)==0) { + ctx->a.max_version = pull_table.out.partners[i].max_version; + ctx->a.min_version = pull_table.out.partners[i].min_version; + } + if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) { + ctx->b.max_version = pull_table.out.partners[i].max_version; + ctx->b.min_version = pull_table.out.partners[i].min_version; + } + } + + talloc_free(pull_table.out.partners); + + return ctx; +} + +static BOOL test_wrepl_update_one_A(struct test_wrepl_conflict_conn *ctx, + const struct wrepl_wins_name *name) +{ + BOOL ret = True; + struct wrepl_socket *wrepl_socket; + struct wrepl_associate associate; + struct wrepl_packet update_packet, repl_send; + struct wrepl_table *update; + struct wrepl_wins_owner wrepl_wins_owners[1]; + struct wrepl_packet *repl_recv; + struct wrepl_wins_owner *send_request; + struct wrepl_send_reply *send_reply; + struct wrepl_wins_name wrepl_wins_names[1]; + uint32_t assoc_ctx; + NTSTATUS status; + + wrepl_socket = wrepl_socket_init(ctx, NULL); + + status = wrepl_connect(wrepl_socket, NULL, ctx->address); + CHECK_STATUS(status, NT_STATUS_OK); + + status = wrepl_associate(wrepl_socket, &associate); + CHECK_STATUS(status, NT_STATUS_OK); + assoc_ctx = associate.out.assoc_ctx; + + /* now send a WREPL_REPL_UPDATE message */ + ZERO_STRUCT(update_packet); + update_packet.opcode = WREPL_OPCODE_BITS; + update_packet.assoc_ctx = assoc_ctx; + update_packet.mess_type = WREPL_REPLICATION; + update_packet.message.replication.command = WREPL_REPL_UPDATE; + update = &update_packet.message.replication.info.table; + + update->partner_count = ARRAY_SIZE(wrepl_wins_owners); + update->partners = wrepl_wins_owners; + update->initiator = "0.0.0.0"; + + wrepl_wins_owners[0] = ctx->a; + + status = wrepl_request(wrepl_socket, wrepl_socket, + &update_packet, &repl_recv); + CHECK_STATUS(status, NT_STATUS_OK); + CHECK_VALUE(repl_recv->mess_type, WREPL_REPLICATION); + CHECK_VALUE(repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST); + send_request = &repl_recv->message.replication.info.owner; + + ZERO_STRUCT(repl_send); + repl_send.opcode = WREPL_OPCODE_BITS; + repl_send.assoc_ctx = assoc_ctx; + repl_send.mess_type = WREPL_REPLICATION; + repl_send.message.replication.command = WREPL_REPL_SEND_REPLY; + send_reply = &repl_send.message.replication.info.reply; + + send_reply->num_names = ARRAY_SIZE(wrepl_wins_names); + send_reply->names = wrepl_wins_names; + + wrepl_wins_names[0] = *name; + + status = wrepl_request(wrepl_socket, wrepl_socket, + &repl_send, &repl_recv); + CHECK_STATUS(status, NT_STATUS_OK); + CHECK_VALUE(repl_recv->mess_type, WREPL_STOP_ASSOCIATION); + CHECK_VALUE(repl_recv->message.stop.reason, 0); + +done: + talloc_free(wrepl_socket); + return ret; +} + +static BOOL test_wrepl_is_applied_A(struct test_wrepl_conflict_conn *ctx, + const struct wrepl_wins_name *name) +{ + BOOL ret = True; + NTSTATUS status; + struct wrepl_pull_names pull_names; + + ctx->a.min_version = ctx->a.max_version; + + pull_names.in.assoc_ctx = ctx->pull_assoc; + pull_names.in.partner = ctx->a; + + status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names); + CHECK_STATUS(status, NT_STATUS_OK); + CHECK_VALUE(pull_names.out.num_names, 1); + +done: + talloc_free(pull_names.out.names); + return ret; +} + +static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx) +{ + BOOL ret = True; + struct nbt_name name; + struct wrepl_wins_name wins_name1; + struct wrepl_wins_name wins_name2; + struct wrepl_wins_name *wins_name_tmp; + struct wrepl_wins_name *wins_name_last; + struct wrepl_wins_name *wins_name_cur; + uint32_t i,j; + uint8_t types[] = { 0x00, 0x1C }; + struct { + enum wrepl_name_type type; + enum wrepl_name_state state; + enum wrepl_name_node node; + BOOL is_static; + uint32_t num_ips; + const struct wrepl_ip *ips; + } records[] = { + { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + },{ + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + },{ + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_2), + .ips = addresses_A_2, + },{ + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_2), + .ips = addresses_A_2, + },{ + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + },{ + /* the last one should always be a tomstone record! */ + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + } + }; + + if (!ctx) return False; + + name.name = "_SAME_OWNER_A"; + name.type = 0; + name.scope = NULL; + + wins_name_tmp = NULL; + wins_name_last = &wins_name2; + wins_name_cur = &wins_name1; + + for (j=0; ret && j < ARRAY_SIZE(types); j++) { + name.type = types[j]; + printf("Test Replica Conflicts with same owner[%s] for %s\n", + nbt_name_string(ctx, &name), ctx->a.address); + + for(i=0; ret && i < ARRAY_SIZE(records); i++) { + wins_name_tmp = wins_name_last; + wins_name_last = wins_name_cur; + wins_name_cur = wins_name_tmp; + + wins_name_cur->name = &name; + wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type, + records[i].state, + records[i].node, + records[i].is_static); + wins_name_cur->id = ++ctx->a.max_version; + if (wins_name_cur->flags & 2) { + wins_name_cur->addresses.addresses.num_ips = records[i].num_ips; + wins_name_cur->addresses.addresses.ips = discard_const(records[i].ips); + } else { + wins_name_cur->addresses.ip = records[i].ips[0].ip; + } + wins_name_cur->unknown = "255.255.255.255"; + + ret &= test_wrepl_update_one_A(ctx, wins_name_cur); + ret &= test_wrepl_is_applied_A(ctx, wins_name_cur); + } + } + return ret; +} + /* display a replication entry */ @@ -273,7 +555,8 @@ BOOL torture_nbt_winsreplication(void) TALLOC_CTX *mem_ctx = talloc_new(NULL); NTSTATUS status; BOOL ret = True; - + struct test_wrepl_conflict_conn *ctx; + make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host")); /* do an initial name resolution to find its IP */ @@ -290,6 +573,10 @@ BOOL torture_nbt_winsreplication(void) ret &= test_wins_replication(mem_ctx, address); + ctx = test_create_conflict_ctx(mem_ctx, address); + + ret &= test_conflict_same_owner(ctx); + talloc_free(mem_ctx); return ret; -- cgit From a53bec24c186dd9851a3639e90bfd219a7068f6d Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 13 Oct 2005 16:38:52 +0000 Subject: r10967: move the function in the order they are used metze (This used to be commit 6f44ae5a6950cee5722758030df862b0f919f43b) --- source4/torture/nbt/winsreplication.c | 197 +++++++++++++++++----------------- 1 file changed, 99 insertions(+), 98 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index e822624f7f..eb9f7038b0 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -170,6 +170,105 @@ done: return ret; } + +/* + display a replication entry +*/ +static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_name *name) +{ + int i; + + printf("%s\n", nbt_name_string(mem_ctx, &name->name)); + printf("\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n", + name->type, name->state, name->node, name->is_static, name->version_id); + printf("\tRAW_FLAGS: 0x%08X OWNER: %-15s\n", + name->raw_flags, name->owner); + for (i=0;inum_addresses;i++) { + printf("\tADDR: %-15s OWNER: %-15s\n", + name->addresses[i].address, name->addresses[i].owner); + } +} + +/* + test a full replication dump from a WINS server +*/ +static BOOL test_wins_replication(TALLOC_CTX *mem_ctx, const char *address) +{ + BOOL ret = True; + struct wrepl_socket *wrepl_socket; + NTSTATUS status; + int i, j; + struct wrepl_associate associate; + struct wrepl_pull_table pull_table; + struct wrepl_pull_names pull_names; + + printf("Test one pull replication cycle\n"); + + wrepl_socket = wrepl_socket_init(mem_ctx, NULL); + + printf("Setup wrepl connections\n"); + status = wrepl_connect(wrepl_socket, NULL, address); + CHECK_STATUS(status, NT_STATUS_OK); + + printf("Send a start association request\n"); + + status = wrepl_associate(wrepl_socket, &associate); + CHECK_STATUS(status, NT_STATUS_OK); + + printf("association context: 0x%x\n", associate.out.assoc_ctx); + + printf("Send a replication table query\n"); + pull_table.in.assoc_ctx = associate.out.assoc_ctx; + + status = wrepl_pull_table(wrepl_socket, mem_ctx, &pull_table); + if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) { + struct wrepl_packet packet; + struct wrepl_request *req; + + ZERO_STRUCT(packet); + packet.opcode = WREPL_OPCODE_BITS; + packet.assoc_ctx = associate.out.assoc_ctx; + packet.mess_type = WREPL_STOP_ASSOCIATION; + packet.message.stop.reason = 0; + + req = wrepl_request_send(wrepl_socket, &packet); + talloc_free(req); + + printf("failed - We are not a valid pull partner for the server\n"); + ret = False; + goto done; + } + CHECK_STATUS(status, NT_STATUS_OK); + + printf("Found %d replication partners\n", pull_table.out.num_partners); + + for (i=0;iaddress, + partner->max_version, + partner->min_version, + partner->type); + + pull_names.in.assoc_ctx = associate.out.assoc_ctx; + pull_names.in.partner = *partner; + + status = wrepl_pull_names(wrepl_socket, mem_ctx, &pull_names); + CHECK_STATUS(status, NT_STATUS_OK); + + printf("Received %d names\n", pull_names.out.num_names); + + for (j=0;jname)); - printf("\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n", - name->type, name->state, name->node, name->is_static, name->version_id); - printf("\tRAW_FLAGS: 0x%08X OWNER: %-15s\n", - name->raw_flags, name->owner); - for (i=0;inum_addresses;i++) { - printf("\tADDR: %-15s OWNER: %-15s\n", - name->addresses[i].address, name->addresses[i].owner); - } -} - -/* - test a full replication dump from a WINS server -*/ -static BOOL test_wins_replication(TALLOC_CTX *mem_ctx, const char *address) -{ - BOOL ret = True; - struct wrepl_socket *wrepl_socket; - NTSTATUS status; - int i, j; - struct wrepl_associate associate; - struct wrepl_pull_table pull_table; - struct wrepl_pull_names pull_names; - - printf("Test one pull replication cycle\n"); - - wrepl_socket = wrepl_socket_init(mem_ctx, NULL); - - printf("Setup wrepl connections\n"); - status = wrepl_connect(wrepl_socket, NULL, address); - CHECK_STATUS(status, NT_STATUS_OK); - - printf("Send a start association request\n"); - - status = wrepl_associate(wrepl_socket, &associate); - CHECK_STATUS(status, NT_STATUS_OK); - - printf("association context: 0x%x\n", associate.out.assoc_ctx); - - printf("Send a replication table query\n"); - pull_table.in.assoc_ctx = associate.out.assoc_ctx; - - status = wrepl_pull_table(wrepl_socket, mem_ctx, &pull_table); - if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) { - struct wrepl_packet packet; - struct wrepl_request *req; - - ZERO_STRUCT(packet); - packet.opcode = WREPL_OPCODE_BITS; - packet.assoc_ctx = associate.out.assoc_ctx; - packet.mess_type = WREPL_STOP_ASSOCIATION; - packet.message.stop.reason = 0; - - req = wrepl_request_send(wrepl_socket, &packet); - talloc_free(req); - - printf("failed - We are not a valid pull partner for the server\n"); - ret = False; - goto done; - } - CHECK_STATUS(status, NT_STATUS_OK); - - printf("Found %d replication partners\n", pull_table.out.num_partners); - - for (i=0;iaddress, - partner->max_version, - partner->min_version, - partner->type); - - pull_names.in.assoc_ctx = associate.out.assoc_ctx; - pull_names.in.partner = *partner; - - status = wrepl_pull_names(wrepl_socket, mem_ctx, &pull_names); - CHECK_STATUS(status, NT_STATUS_OK); - - printf("Received %d names\n", pull_names.out.num_names); - - for (j=0;j Date: Thu, 13 Oct 2005 18:24:30 +0000 Subject: r10971: - test static records with the same owner too - test with different owners, and all combinations of unique records metze (This used to be commit 8df80c5649467be6cb4dd532974a083173a5a920) --- source4/torture/nbt/winsreplication.c | 400 +++++++++++++++++++++++++++++++++- 1 file changed, 388 insertions(+), 12 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index eb9f7038b0..87c7b13e85 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -40,6 +40,12 @@ goto done; \ }} while (0) +#define _NBT_NAME(n,t,s) {\ + .name = n,\ + .type = t,\ + .scope = s\ +} + /* test how assoc_ctx's are only usable on the connection they are created on. @@ -295,6 +301,19 @@ static const struct wrepl_ip addresses_A_2[] = { } }; +static const struct wrepl_ip addresses_B_1[] = { + { + .owner = TEST_OWNER_B_ADDRESS, + .ip = TEST_ADDRESS_B_PREFIX".1" + } +}; +static const struct wrepl_ip addresses_B_2[] = { + { + .owner = TEST_OWNER_B_ADDRESS, + .ip = TEST_ADDRESS_B_PREFIX".2" + } +}; + static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem_ctx, const char *address) { @@ -350,8 +369,9 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem return ctx; } -static BOOL test_wrepl_update_one_A(struct test_wrepl_conflict_conn *ctx, - const struct wrepl_wins_name *name) +static BOOL test_wrepl_update_one(struct test_wrepl_conflict_conn *ctx, + const struct wrepl_wins_owner *owner, + const struct wrepl_wins_name *name) { BOOL ret = True; struct wrepl_socket *wrepl_socket; @@ -387,7 +407,7 @@ static BOOL test_wrepl_update_one_A(struct test_wrepl_conflict_conn *ctx, update->partners = wrepl_wins_owners; update->initiator = "0.0.0.0"; - wrepl_wins_owners[0] = ctx->a; + wrepl_wins_owners[0] = *owner; status = wrepl_request(wrepl_socket, wrepl_socket, &update_packet, &repl_recv); @@ -419,21 +439,22 @@ done: return ret; } -static BOOL test_wrepl_is_applied_A(struct test_wrepl_conflict_conn *ctx, - const struct wrepl_wins_name *name) +static BOOL test_wrepl_is_applied(struct test_wrepl_conflict_conn *ctx, + const struct wrepl_wins_owner *owner, + const struct wrepl_wins_name *name, + BOOL expected) { BOOL ret = True; NTSTATUS status; struct wrepl_pull_names pull_names; - ctx->a.min_version = ctx->a.max_version; - pull_names.in.assoc_ctx = ctx->pull_assoc; - pull_names.in.partner = ctx->a; + pull_names.in.partner = *owner; + pull_names.in.partner.min_version = pull_names.in.partner.max_version; status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names); CHECK_STATUS(status, NT_STATUS_OK); - CHECK_VALUE(pull_names.out.num_names, 1); + CHECK_VALUE(pull_names.out.num_names, (expected?1:0)); done: talloc_free(pull_names.out.names); @@ -481,6 +502,20 @@ static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx) .num_ips = ARRAY_SIZE(addresses_A_2), .ips = addresses_A_2, },{ + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = True, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + },{ + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_2), + .ips = addresses_A_2, + },{ .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, @@ -495,7 +530,7 @@ static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx) .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, },{ - /* the last one should always be a tomstone record! */ + /* the last one should always be a unique,tomstone record! */ .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, @@ -539,13 +574,353 @@ static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx) } wins_name_cur->unknown = "255.255.255.255"; - ret &= test_wrepl_update_one_A(ctx, wins_name_cur); - ret &= test_wrepl_is_applied_A(ctx, wins_name_cur); + ret &= test_wrepl_update_one(ctx, &ctx->a,wins_name_cur); + ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, True); } } return ret; } +static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) +{ + BOOL ret = True; + struct wrepl_wins_name wins_name1; + struct wrepl_wins_name wins_name2; + struct wrepl_wins_name *wins_name_r1; + struct wrepl_wins_name *wins_name_r2; + uint32_t i; + struct { + struct nbt_name name; + struct { + struct wrepl_wins_owner *owner; + enum wrepl_name_type type; + enum wrepl_name_state state; + enum wrepl_name_node node; + BOOL is_static; + uint32_t num_ips; + const struct wrepl_ip *ips; + BOOL apply_expected; + } r1, r2; + } records[] = { + /* + * NOTE: the first record and the last applied one + * needs to be from the same owner, + * to not conflict in the next smbtorture run!!! + */ + + /* + * unique,active vs. unique,active the same ip + * => should be replaced + */ + { + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + + /* + * unique,active vs. unique,tombstone the same ips + * => should NOT be replaced + */ + { + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + } + }, + + /* + * unique,tombstone vs. unique,active the same ips + * => should NOT be replaced + */ + { + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * unique,tombstone vs. unique,tombstone the same ips + * => should be replaced + */ + { + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + + /* + * unique,active vs. unique,active the different ips + * => should be replaced + */ + { + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * unique,active vs. unique,tombstone the different ips + * => should NOT be replaced + */ + { + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + } + }, + + /* + * unique,tombstone vs. unique,active the different ips + * => should be replaced + */ + { + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + + /* + * unique,tombstone vs. unique,tombstone the different ips + * => should be replaced + */ + { + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * This should be the last record in this array, + * we need to make sure the we leave a tombstoned unique entry + * owned by OWNER_A + */ + { + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }}; /* do not add entries here, this should be the last record! */ + + if (!ctx) return False; + + wins_name_r1 = &wins_name1; + wins_name_r2 = &wins_name2; + + for(i=0; ret && i < ARRAY_SIZE(records); i++) { + + /* + * Setup R1 + */ + wins_name_r1->name = &records[i].name; + wins_name_r1->flags = WREPL_NAME_FLAGS(records[i].r1.type, + records[i].r1.state, + records[i].r1.node, + records[i].r1.is_static); + wins_name_r1->id = ++records[i].r1.owner->max_version; + if (wins_name_r1->flags & 2) { + wins_name_r1->addresses.addresses.num_ips = records[i].r1.num_ips; + wins_name_r1->addresses.addresses.ips = discard_const(records[i].r1.ips); + } else { + wins_name_r1->addresses.ip = records[i].r1.ips[0].ip; + } + wins_name_r1->unknown = "255.255.255.255"; + + /* now apply R1 */ + ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1); + ret &= test_wrepl_is_applied(ctx, records[i].r1.owner, + wins_name_r1, records[i].r1.apply_expected); + + /* + * Setup R2 + */ + wins_name_r2->name = &records[i].name; + wins_name_r2->flags = WREPL_NAME_FLAGS(records[i].r2.type, + records[i].r2.state, + records[i].r2.node, + records[i].r2.is_static); + wins_name_r2->id = ++records[i].r2.owner->max_version; + if (wins_name_r2->flags & 2) { + wins_name_r2->addresses.addresses.num_ips = records[i].r2.num_ips; + wins_name_r2->addresses.addresses.ips = discard_const(records[i].r2.ips); + } else { + wins_name_r2->addresses.ip = records[i].r2.ips[0].ip; + } + wins_name_r2->unknown = "255.255.255.255"; + + /* now apply R2 */ + ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2); + ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, + wins_name_r2, records[i].r2.apply_expected); + + if (!ret) { + printf("%s: failed with index: %u\n", __location__, i); + return ret; + } + } + + return ret; +} + /* test WINS replication operations */ @@ -577,6 +952,7 @@ BOOL torture_nbt_winsreplication(void) ctx = test_create_conflict_ctx(mem_ctx, address); ret &= test_conflict_same_owner(ctx); + ret &= test_conflict_different_owner(ctx); talloc_free(mem_ctx); -- cgit From 9dff4c464af4cbe0a031690cf3ad3134669faeb5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 13 Oct 2005 18:58:30 +0000 Subject: r10973: - make debugging a bit easier - add unique vs. normal group section in replica vs replica conflict testing metze (This used to be commit b94be6b1191aa18642b334dc1fe1529d977d6c57) --- source4/torture/nbt/winsreplication.c | 278 +++++++++++++++++++++++++++++++++- 1 file changed, 277 insertions(+), 1 deletion(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 87c7b13e85..351dc4dc5c 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -590,6 +590,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) struct wrepl_wins_name *wins_name_r2; uint32_t i; struct { + const char *line; /* just better debugging */ struct nbt_name name; struct { struct wrepl_wins_owner *owner; @@ -607,12 +608,40 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) * needs to be from the same owner, * to not conflict in the next smbtorture run!!! */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True /* ignored */ + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True /* ignored */ + } + }, +/* + * unique vs unique section + */ /* * unique,active vs. unique,active the same ip * => should be replaced */ { + .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .r1 = { .owner = &ctx->a, @@ -641,6 +670,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) * => should NOT be replaced */ { + .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .r1 = { .owner = &ctx->b, @@ -669,6 +699,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) * => should NOT be replaced */ { + .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .r1 = { .owner = &ctx->b, @@ -697,6 +728,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) * => should be replaced */ { + .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .r1 = { .owner = &ctx->a, @@ -725,6 +757,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) * => should be replaced */ { + .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .r1 = { .owner = &ctx->a, @@ -753,6 +786,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) * => should NOT be replaced */ { + .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .r1 = { .owner = &ctx->b, @@ -781,6 +815,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) * => should be replaced */ { + .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .r1 = { .owner = &ctx->b, @@ -809,13 +844,192 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) * => should be replaced */ { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + +/* + * unique vs normal groups section, + * TODO: group,released! + */ + /* + * unique,active vs. group,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + + /* + * unique,active vs. group,tombstone + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + } + }, + + /* + * unique,tombstone vs. group,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * unique,tombstone vs. group,tombstone + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + + /* + * group,active vs. unique,active + * => should NOT be replaced + */ + { + .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .r1 = { .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + } + }, + + /* + * group,active vs. unique,tombstone + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, .apply_expected = True @@ -828,7 +1042,65 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .is_static = False, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, + .apply_expected = False + } + }, + + /* + * group,tombstone vs. unique,active + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + } + }, + + /* + * group,tombstone vs. unique,tombstone + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False } }, @@ -838,6 +1110,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) * owned by OWNER_A */ { + .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .r1 = { .owner = &ctx->a, @@ -912,8 +1185,11 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, records[i].r2.apply_expected); + /* the first one is a cleanup run */ + if (!ret && i == 0) ret = True; + if (!ret) { - printf("%s: failed with index: %u\n", __location__, i); + printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line); return ret; } } -- cgit From 00ef27d754cbb8022f46a0b3d1b5210c4ec7d805 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 14 Oct 2005 11:18:01 +0000 Subject: r10993: - make us able to check released records, we can only do that by finding out the old record was gone - add more printf(), so -d 10 isn't needed any more metze (This used to be commit afe5d2ab8522671607faafc3de895e4ff915dab4) --- source4/torture/nbt/winsreplication.c | 297 +++++++++++++++++++++++++++++++++- 1 file changed, 293 insertions(+), 4 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 351dc4dc5c..56f7588ac2 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -46,6 +46,28 @@ .scope = s\ } +static const char *wrepl_name_type_string(enum wrepl_name_type type) +{ + switch (type) { + case WREPL_TYPE_UNIQUE: return "UNIQUE"; + case WREPL_TYPE_GROUP: return "GROUP"; + case WREPL_TYPE_SGROUP: return "SGROUP"; + case WREPL_TYPE_MHOMED: return "MHOMED"; + } + return "UNKNOWN_TYPE"; +} + +static const char *wrepl_name_state_string(enum wrepl_name_state state) +{ + switch (state) { + case WREPL_STATE_ACTIVE: return "ACTIVE"; + case WREPL_STATE_RELEASED: return "RELEASED"; + case WREPL_STATE_TOMBSTONE: return "TOMBSTONE"; + case WREPL_STATE_RESERVED: return "RESERVED"; + } + return "UNKNOWN_STATE"; +} + /* test how assoc_ctx's are only usable on the connection they are created on. @@ -530,6 +552,20 @@ static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx) .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, },{ + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_2), + .ips = addresses_A_2, + },{ + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + },{ /* the last one should always be a unique,tomstone record! */ .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, @@ -560,6 +596,18 @@ static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx) wins_name_last = wins_name_cur; wins_name_cur = wins_name_tmp; + if (i > 0) { + printf("%s,%s%s vs, %s,%s%s with %s ip(s) => %s\n", + wrepl_name_type_string(records[i-1].type), + wrepl_name_state_string(records[i-1].state), + (records[i-1].is_static?",static":""), + wrepl_name_type_string(records[i].type), + wrepl_name_state_string(records[i].state), + (records[i].is_static?",static":""), + (records[i-1].ips==records[i].ips?"same":"different"), + "REPLACE"); + } + wins_name_cur->name = &name; wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type, records[i].state, @@ -575,7 +623,20 @@ static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx) wins_name_cur->unknown = "255.255.255.255"; ret &= test_wrepl_update_one(ctx, &ctx->a,wins_name_cur); - ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, True); + if (records[i].state == WREPL_STATE_RELEASED) { + ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_last, False); + ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, False); + } else { + ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, True); + } + + /* the first one is a cleanup run */ + if (!ret && i == 0) ret = True; + + if (!ret) { + printf("conflict handled wrong or record[%u]: %s\n", i, __location__); + return ret; + } } } return ret; @@ -902,7 +963,36 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) }, /* - * unique,active vs. group,tombstone + * unique,active vs. group,tombstone same ip + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + } + }, + + /* + * unique,active vs. group,tombstone different ip * => should NOT be replaced */ { @@ -930,6 +1020,35 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, + /* + * unique,active vs. group,released + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + } + }, + /* * unique,tombstone vs. group,active * => should be replaced @@ -988,6 +1107,93 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, + /* + * unique,tombstone vs. group,released + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * unique,released vs. group,released + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + + /* + * unique,released vs. group,released + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + /* * group,active vs. unique,active * => should NOT be replaced @@ -1046,6 +1252,64 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, + /* + * group,released vs. unique,active + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + } + }, + + /* + * group,released vs. unique,tombstone + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + } + }, + /* * group,tombstone vs. unique,active * => should NOT be replaced @@ -1139,8 +1403,22 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) wins_name_r1 = &wins_name1; wins_name_r2 = &wins_name2; + printf("Test Replica Conflicts with different owners\n"); + for(i=0; ret && i < ARRAY_SIZE(records); i++) { + if (i > 0) { + printf("%s,%s%s vs, %s,%s%s with %s ip(s) => %s\n", + wrepl_name_type_string(records[i].r1.type), + wrepl_name_state_string(records[i].r1.state), + (records[i].r1.is_static?",static":""), + wrepl_name_type_string(records[i].r2.type), + wrepl_name_state_string(records[i].r2.state), + (records[i].r2.is_static?",static":""), + (records[i].r1.ips==records[i].r2.ips?"same":"different"), + (records[i].r2.apply_expected?"REPLACE":"NOT REPLACE")); + } + /* * Setup R1 */ @@ -1182,8 +1460,19 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) /* now apply R2 */ ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2); - ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, - wins_name_r2, records[i].r2.apply_expected); + if (records[i].r2.apply_expected && + (records[i].r1.state == WREPL_STATE_RELEASED || + records[i].r2.state == WREPL_STATE_RELEASED)) { + ret &= test_wrepl_is_applied(ctx, records[i].r1.owner, + wins_name_r1, False); + } + if (records[i].r2.state == WREPL_STATE_RELEASED) { + ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, + wins_name_r2, False); + } else { + ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, + wins_name_r2, records[i].r2.apply_expected); + } /* the first one is a cleanup run */ if (!ret && i == 0) ret = True; -- cgit From 0b0c38d899db75e6954af2618e7f063dbfc09fd6 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 14 Oct 2005 12:01:22 +0000 Subject: r10995: fix released vs. released metze (This used to be commit 573c2df2badbba12fb4d909e7ad4edf6678c7851) --- source4/torture/nbt/winsreplication.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 56f7588ac2..dec1a21ca3 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -1139,6 +1139,9 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) /* * unique,released vs. group,released * => should be replaced + * + * here we need a 2nd round to make sure + * released vs. released is handled correct */ { .line = __location__, @@ -1164,32 +1167,27 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .apply_expected = True } }, - - /* - * unique,released vs. group,released - * => should be replaced - */ { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .r1 = { - .owner = &ctx->a, + .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_RELEASED, + .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = False /* this should conflict with the group.released above */ }, .r2 = { - .owner = &ctx->b, + .owner = &ctx->a, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, .apply_expected = True } }, -- cgit From f8a3335cb427320770a0164b0a4e6bf33ba893af Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 15 Oct 2005 12:30:08 +0000 Subject: r11091: add a NBT-WINSREPLICATION-QUICK test that passed the current samba4 server metze (This used to be commit 772467c8d487578b3541ffd1b1e07516097d1325) --- source4/torture/nbt/winsreplication.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index dec1a21ca3..62a4b9f9ba 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -1484,6 +1484,36 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) return ret; } +/* + test WINS replication operations +*/ +BOOL torture_nbt_winsreplication_quick(void) +{ + const char *address; + struct nbt_name name; + TALLOC_CTX *mem_ctx = talloc_new(NULL); + NTSTATUS status; + BOOL ret = True; + + make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host")); + + /* do an initial name resolution to find its IP */ + status = resolve_name(&name, mem_ctx, &address, NULL); + if (!NT_STATUS_IS_OK(status)) { + printf("Failed to resolve %s - %s\n", + name.name, nt_errstr(status)); + talloc_free(mem_ctx); + return False; + } + + ret &= test_assoc_ctx1(mem_ctx, address); + ret &= test_assoc_ctx2(mem_ctx, address); + + talloc_free(mem_ctx); + + return ret; +} + /* test WINS replication operations */ -- cgit From 91366a1c96f18f6911e0b143de6df6a9490470d4 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 17 Oct 2005 10:55:50 +0000 Subject: r11108: - always test the old and new record - check that the record is the same as what we pushed to the server (we need to verify the ip-addresses later too...) metze (This used to be commit f59e90299d1060a3c61ee24bdf4a2a13aac1bccf) --- source4/torture/nbt/winsreplication.c | 39 ++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 62a4b9f9ba..befec50c96 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -40,6 +40,24 @@ goto done; \ }} while (0) +#define CHECK_VALUE_UINT64(v, correct) do { \ + if ((v) != (correct)) { \ + printf("(%s) Incorrect value %s=%llu - should be %llu\n", \ + __location__, #v, v, correct); \ + ret = False; \ + goto done; \ + }} while (0) + +#define CHECK_VALUE_STRING(v, correct) do { \ + if ( ((!v) && (correct)) || \ + ((v) && (!correct)) || \ + ((v) && (correct) && strcmp(v,correct) != 0)) { \ + printf("(%s) Incorrect value %s='%s' - should be '%s'\n", \ + __location__, #v, v, correct); \ + ret = False; \ + goto done; \ + }} while (0) + #define _NBT_NAME(n,t,s) {\ .name = n,\ .type = t,\ @@ -469,6 +487,7 @@ static BOOL test_wrepl_is_applied(struct test_wrepl_conflict_conn *ctx, BOOL ret = True; NTSTATUS status; struct wrepl_pull_names pull_names; + struct wrepl_name *names; pull_names.in.assoc_ctx = ctx->pull_assoc; pull_names.in.partner = *owner; @@ -478,6 +497,19 @@ static BOOL test_wrepl_is_applied(struct test_wrepl_conflict_conn *ctx, CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(pull_names.out.num_names, (expected?1:0)); + names = pull_names.out.names; + + if (expected) { + uint32_t flags = WREPL_NAME_FLAGS(names[0].type, + names[0].state, + names[0].node, + names[0].is_static); + CHECK_VALUE(names[0].name.type, name->name->type); + CHECK_VALUE_STRING(names[0].name.name, name->name->name); + CHECK_VALUE_STRING(names[0].name.scope, name->name->scope); + CHECK_VALUE(flags, name->flags); + CHECK_VALUE_UINT64(names[0].version_id, name->id); + } done: talloc_free(pull_names.out.names); return ret; @@ -1458,11 +1490,12 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) /* now apply R2 */ ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2); - if (records[i].r2.apply_expected && - (records[i].r1.state == WREPL_STATE_RELEASED || - records[i].r2.state == WREPL_STATE_RELEASED)) { + if (records[i].r1.state == WREPL_STATE_RELEASED) { ret &= test_wrepl_is_applied(ctx, records[i].r1.owner, wins_name_r1, False); + } else if (records[i].r1.owner != records[i].r2.owner) { + ret &= test_wrepl_is_applied(ctx, records[i].r1.owner, + wins_name_r1, !records[i].r2.apply_expected); } if (records[i].r2.state == WREPL_STATE_RELEASED) { ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, -- cgit From e7238b9306ac3854054ba5f1ef89e7a56bae2633 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 17 Oct 2005 12:40:45 +0000 Subject: r11115: add unique vs special group section metze (This used to be commit 980e1a39eb039ebef3ca750eaf67bb87fd6f6980) --- source4/torture/nbt/winsreplication.c | 145 +++++++++++++++++++++++++++++++++- 1 file changed, 143 insertions(+), 2 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index befec50c96..f4272ccc13 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -340,6 +340,16 @@ static const struct wrepl_ip addresses_A_2[] = { .ip = TEST_ADDRESS_A_PREFIX".2" } }; +static const struct wrepl_ip addresses_A_3_4[] = { + { + .owner = TEST_OWNER_A_ADDRESS, + .ip = TEST_ADDRESS_A_PREFIX".3" + }, + { + .owner = TEST_OWNER_A_ADDRESS, + .ip = TEST_ADDRESS_A_PREFIX".4" + } +}; static const struct wrepl_ip addresses_B_1[] = { { @@ -353,6 +363,16 @@ static const struct wrepl_ip addresses_B_2[] = { .ip = TEST_ADDRESS_B_PREFIX".2" } }; +static const struct wrepl_ip addresses_B_3_4[] = { + { + .owner = TEST_OWNER_B_ADDRESS, + .ip = TEST_ADDRESS_B_PREFIX".3" + }, + { + .owner = TEST_OWNER_B_ADDRESS, + .ip = TEST_ADDRESS_B_PREFIX".4" + } +}; static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem_ctx, const char *address) @@ -963,7 +983,6 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) /* * unique vs normal groups section, - * TODO: group,released! */ /* * unique,active vs. group,active @@ -1224,6 +1243,128 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, +/* + * unique vs special groups section, + */ + /* + * unique,active vs. sgroup,active + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = False + } + }, + + /* + * unique,active vs. sgroup,tombstone + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = False + } + }, + + /* + * unique,tombstone vs. sgroup,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = True + } + }, + + /* + * unique,tombstone vs. sgroup,tombstone + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .apply_expected = True + } + }, + +/* + * normal groups vs unique section, + */ /* * group,active vs. unique,active * => should NOT be replaced @@ -1244,7 +1385,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_TOMBSTONE, + .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, .num_ips = ARRAY_SIZE(addresses_B_1), -- cgit From 80cd8936fa1699833a6c40a1de3108486b157b1d Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 17 Oct 2005 13:17:42 +0000 Subject: r11116: - don't display cleanup updates - add unique vs. multi homed section metze (This used to be commit 7f8c26cd33a5dffd672d0995cf227177bc21a20e) --- source4/torture/nbt/winsreplication.c | 159 +++++++++++++++++++++++++++++++++- 1 file changed, 156 insertions(+), 3 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index f4272ccc13..bb4ba8976e 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -649,7 +649,7 @@ static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx) wins_name_cur = wins_name_tmp; if (i > 0) { - printf("%s,%s%s vs, %s,%s%s with %s ip(s) => %s\n", + printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n", wrepl_name_type_string(records[i-1].type), wrepl_name_state_string(records[i-1].state), (records[i-1].is_static?",static":""), @@ -705,6 +705,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) struct { const char *line; /* just better debugging */ struct nbt_name name; + BOOL cleanup; struct { struct wrepl_wins_owner *owner; enum wrepl_name_type type; @@ -724,6 +725,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .cleanup= True, .r1 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, @@ -1221,6 +1223,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .cleanup= True, .r1 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, @@ -1362,6 +1365,155 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, + +/* + * unique vs multi homed section, + */ + /* + * unique,active vs. mhomed,active with different ips + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = True + } + }, + + /* + * unique,active vs. mhomed,tombstone with different ips + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .apply_expected = False + } + }, + + /* + * unique,active vs. mhomed,tombstone with same ips + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = False + } + }, + + /* + * unique,tombstone vs. mhomed,active with different ips + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .apply_expected = True + } + }, + + /* + * unique,tombstone vs. mhomed,tombstone with different ips + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = True + } + }, + /* * normal groups vs unique section, */ @@ -1547,6 +1699,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .cleanup= True, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, @@ -1578,8 +1731,8 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) for(i=0; ret && i < ARRAY_SIZE(records); i++) { - if (i > 0) { - printf("%s,%s%s vs, %s,%s%s with %s ip(s) => %s\n", + if (!records[i].cleanup) { + printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n", wrepl_name_type_string(records[i].r1.type), wrepl_name_state_string(records[i].r1.state), (records[i].r1.is_static?",static":""), -- cgit From 70be12593ab69849b4c26f93e0064b5b4f844c42 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 17 Oct 2005 14:12:54 +0000 Subject: r11117: add a normal group vs. normal group section metze (This used to be commit 9a7689c745e9fa9f40c46fa041a502967fd93ccc) --- source4/torture/nbt/winsreplication.c | 233 +++++++++++++++++++++++++++++++++- 1 file changed, 232 insertions(+), 1 deletion(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index bb4ba8976e..bb85cc0790 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -1691,6 +1691,237 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, +/* + * normal groups vs normal groups section, + */ + /* + * group,active vs. group,active + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + } + }, + + /* + * group,active vs. group,tombstone + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + } + }, + + /* + * group,released vs. group,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * group,released vs. group,released + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .cleanup= True, + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + + /* + * group,released vs. group,tombstone + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * group,tombstone vs. group,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + + /* + * group,tombstone vs. group,tombstone + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + /* * This should be the last record in this array, * we need to make sure the we leave a tombstoned unique entry @@ -1701,7 +1932,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .cleanup= True, .r1 = { - .owner = &ctx->a, + .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, -- cgit From c4927c843d463f832f8fa49578c86c801e21f499 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 17 Oct 2005 14:32:16 +0000 Subject: r11119: add normal group vs. special group section metze (This used to be commit 13703b5c35e4473d0ab6b595f41f4cc35c18f81e) --- source4/torture/nbt/winsreplication.c | 233 +++++++++++++++++++++++++++++++++- 1 file changed, 232 insertions(+), 1 deletion(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index bb85cc0790..b454ece493 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -1783,7 +1783,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) /* * group,released vs. group,released - * => should NOT be replaced + * => should be replaced */ { .line = __location__, @@ -1922,6 +1922,237 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, +/* + * normal groups vs special groups section, + */ + /* + * group,active vs. sgroup,active + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + } + }, + + /* + * group,active vs. sgroup,tombstone + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + } + }, + + /* + * group,released vs. sgroup,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * group,released vs. sgroup,released + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + } + }, + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .cleanup= True, + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * group,released vs. sgroup,tombstone + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + } + }, + + /* + * group,tombstone vs. sgroup,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + + /* + * group,tombstone vs. sgroup,tombstone + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + /* * This should be the last record in this array, * we need to make sure the we leave a tombstoned unique entry -- cgit From 2038e9a698400ef808bf0d31f3aa185e4e08eafa Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 17 Oct 2005 15:12:03 +0000 Subject: r11121: - add normal groups vs. multihomed section - make sure we test the worst case, so that we don't need to test everything... - same ip(s) => not replace - different ip(s) => replace metze (This used to be commit 4a22ce09b4cad7bb3d60e45f25fb19c36efb8dec) --- source4/torture/nbt/winsreplication.c | 300 +++++++++++++++++++++++++++++++--- 1 file changed, 276 insertions(+), 24 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index b454ece493..8b2885335a 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -705,6 +705,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) struct { const char *line; /* just better debugging */ struct nbt_name name; + BOOL extra; /* not the worst case, this is an extra test */ BOOL cleanup; struct { struct wrepl_wins_owner *owner; @@ -758,6 +759,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .extra = True, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, @@ -787,6 +789,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .extra = True, .r1 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, @@ -816,6 +819,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .extra = True, .r1 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, @@ -845,6 +849,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .extra = True, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, @@ -903,6 +908,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .extra = True, .r1 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, @@ -1051,6 +1057,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .extra = True, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, @@ -1096,8 +1103,8 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, .apply_expected = False } }, @@ -1272,8 +1279,8 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_3_4), - .ips = addresses_B_3_4, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, .apply_expected = False } }, @@ -1301,8 +1308,8 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_3_4), - .ips = addresses_B_3_4, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, .apply_expected = False } }, @@ -1405,6 +1412,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .extra = True, .r1 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, @@ -1540,8 +1548,8 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, .apply_expected = False } }, @@ -1569,8 +1577,8 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, .apply_expected = False } }, @@ -1598,8 +1606,8 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, .apply_expected = False } }, @@ -1627,8 +1635,8 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, .apply_expected = False } }, @@ -1656,8 +1664,8 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, .apply_expected = False } }, @@ -1685,8 +1693,8 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, .apply_expected = False } }, @@ -1895,7 +1903,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) /* * group,tombstone vs. group,tombstone - * => should NOT be replaced + * => should be replaced */ { .line = __location__, @@ -2035,8 +2043,8 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_A_1), - .ips = addresses_A_1, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, .apply_expected = False } }, @@ -2089,8 +2097,8 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_A_1), - .ips = addresses_A_1, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, .apply_expected = False } }, @@ -2126,7 +2134,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) /* * group,tombstone vs. sgroup,tombstone - * => should NOT be replaced + * => should be replaced */ { .line = __location__, @@ -2153,6 +2161,237 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, +/* + * normal groups vs multi homed section, + */ + /* + * group,active vs. mhomed,active + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + } + }, + + /* + * group,active vs. mhomed,tombstone + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + } + }, + + /* + * group,released vs. mhomed,active + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + } + }, + + /* + * group,released vs. mhomed,released + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + } + }, + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .cleanup= True, + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * group,released vs. mhomed,tombstone + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + } + }, + + /* + * group,tombstone vs. mhomed,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + + /* + * group,tombstone vs. mhomed,tombstone + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + /* * This should be the last record in this array, * we need to make sure the we leave a tombstoned unique entry @@ -2192,6 +2431,19 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) printf("Test Replica Conflicts with different owners\n"); for(i=0; ret && i < ARRAY_SIZE(records); i++) { + + if (!records[i].extra && !records[i].cleanup) { + /* we should test the worst cases */ + if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) { + printf("(%s) Programmer error, invalid record[%u]: %s\n", + __location__, i, records[i].line); + return False; + } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) { + printf("(%s) Programmer error, invalid record[%u]: %s\n", + __location__, i, records[i].line); + return False; + } + } if (!records[i].cleanup) { printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n", -- cgit From 4a8bdae155cd65212ba4d5ee26d82650c93f8b90 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 18 Oct 2005 14:18:58 +0000 Subject: r11142: - add special group vs. unique section metze (This used to be commit ba1727623675def77d4bf3a9bf643f80c7e168c2) --- source4/torture/nbt/winsreplication.c | 179 +++++++++++++++++++++++++++++++++- 1 file changed, 178 insertions(+), 1 deletion(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 8b2885335a..b47aae84ee 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -2392,6 +2392,183 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, +/* + * special groups vs unique section, + */ + /* + * sgroup,active vs. unique,active + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + } + }, + + /* + * sgroup,active vs. unique,tombstone + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + } + }, + + /* + * sgroup,released vs. unique,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + + /* + * sgroup,released vs. unique,tombstone + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * sgroup,tombstone vs. unique,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * sgroup,tombstone vs. unique,tombstone + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + /* * This should be the last record in this array, * we need to make sure the we leave a tombstoned unique entry @@ -2402,7 +2579,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .cleanup= True, .r1 = { - .owner = &ctx->b, + .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, -- cgit From abe4ee3d432305312aa02377a92efcf66eb16431 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 18 Oct 2005 14:48:12 +0000 Subject: r11144: - add special group vs. normal group section metze (This used to be commit 03a8ff89d0f40eed3a8e0f94d2e756d9c648b564) --- source4/torture/nbt/winsreplication.c | 177 ++++++++++++++++++++++++++++++++++ 1 file changed, 177 insertions(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index b47aae84ee..3cdd84e5f1 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -2569,6 +2569,183 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, +/* + * special groups vs normal group section, + */ + /* + * sgroup,active vs. group,active + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + } + }, + + /* + * sgroup,active vs. group,tombstone + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + } + }, + + /* + * sgroup,released vs. group,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * sgroup,released vs. group,tombstone + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + + /* + * sgroup,tombstone vs. group,active + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * sgroup,tombstone vs. group,tombstone + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + /* * This should be the last record in this array, * we need to make sure the we leave a tombstoned unique entry -- cgit From 64b0c02e8b374e1fef5e580e622b976879a63b9a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 18 Oct 2005 14:58:51 +0000 Subject: r11146: make sure we get the expected amount of addresses metze (This used to be commit 9903a47151a96177e835ba45450ad12a2e969ee2) --- source4/torture/nbt/winsreplication.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 3cdd84e5f1..c771fc52ee 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -529,6 +529,15 @@ static BOOL test_wrepl_is_applied(struct test_wrepl_conflict_conn *ctx, CHECK_VALUE_STRING(names[0].name.scope, name->name->scope); CHECK_VALUE(flags, name->flags); CHECK_VALUE_UINT64(names[0].version_id, name->id); + + if (flags & 2) { + CHECK_VALUE(names[0].num_addresses, + name->addresses.addresses.num_ips); + } else { + CHECK_VALUE(names[0].num_addresses, 1); + CHECK_VALUE_STRING(names[0].addresses[0].address, + name->addresses.ip); + } } done: talloc_free(pull_names.out.names); -- cgit From 8c8c40ecaa161c3dcba237f0c008cb793c604460 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 19 Oct 2005 06:13:53 +0000 Subject: r11172: - start with special group vs. special group testing metze (This used to be commit ba2c100be6eb1d352df762d213fc197f11f69da5) --- source4/torture/nbt/winsreplication.c | 147 +++++++++++++++++++++++++++++++++- 1 file changed, 143 insertions(+), 4 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index c771fc52ee..012c07c748 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -325,7 +325,7 @@ struct test_wrepl_conflict_conn { #define TEST_OWNER_B_ADDRESS "127.66.66.1" #define TEST_ADDRESS_B_PREFIX "127.0.66" - struct wrepl_wins_owner a, b; + struct wrepl_wins_owner a, b, c; }; static const struct wrepl_ip addresses_A_1[] = { @@ -409,6 +409,11 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem ctx->b.min_version = 0; ctx->b.type = 1; + ctx->c.address = address; + ctx->c.max_version = 0; + ctx->c.min_version = 0; + ctx->c.type = 1; + pull_table.in.assoc_ctx = ctx->pull_assoc; status = wrepl_pull_table(ctx->pull, ctx->pull, &pull_table); if (!NT_STATUS_IS_OK(status)) return NULL; @@ -420,7 +425,11 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem } if (strcmp(TEST_OWNER_B_ADDRESS,pull_table.out.partners[i].address)==0) { ctx->b.max_version = pull_table.out.partners[i].max_version; - ctx->b.min_version = pull_table.out.partners[i].min_version; + ctx->b.min_version = pull_table.out.partners[i].min_version; + } + if (strcmp(address,pull_table.out.partners[i].address)==0) { + ctx->c.max_version = pull_table.out.partners[i].max_version; + ctx->c.min_version = pull_table.out.partners[i].min_version; } } @@ -544,6 +553,46 @@ done: return ret; } +static BOOL test_wrepl_is_merged(struct test_wrepl_conflict_conn *ctx, + const struct wrepl_wins_name *name1, + const struct wrepl_wins_name *name2) +{ + return True; +#if 0 + BOOL ret = True; + NTSTATUS status; + struct wrepl_pull_names pull_names; + struct wrepl_name *names; + uint32_t num_ips; + + pull_names.in.assoc_ctx = ctx->pull_assoc; + pull_names.in.partner = ctx->c; + pull_names.in.partner.min_version = ctx->c.max_version-1; + + status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names); + CHECK_STATUS(status, NT_STATUS_OK); + CHECK_VALUE(pull_names.out.num_names, 1); + + names = pull_names.out.names; + + num_ips = name1->addresses.addresses.num_ips + name2->addresses.addresses.num_ips; + + CHECK_VALUE(names[0].name.type, name1->name->type); + CHECK_VALUE_STRING(names[0].name.name, name1->name->name); + CHECK_VALUE_STRING(names[0].name.scope, name1->name->scope); + CHECK_VALUE(names[0].type, WREPL_TYPE_SGROUP); + CHECK_VALUE(names[0].state, (num_ips>0?WREPL_STATE_ACTIVE:WREPL_STATE_RELEASED)); + CHECK_VALUE_UINT64(names[0].version_id, ctx->c.max_version); + + CHECK_VALUE(names[0].num_addresses, + name1->addresses.addresses.num_ips+ + name2->addresses.addresses.num_ips); +done: + talloc_free(pull_names.out.names); + return ret; +#endif +} + static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx) { BOOL ret = True; @@ -725,6 +774,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) uint32_t num_ips; const struct wrepl_ip *ips; BOOL apply_expected; + BOOL merge_expected; } r1, r2; } records[] = { /* @@ -2755,6 +2805,91 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, +/* + * special group vs special group section, + */ + /* + * sgroup,active vs. sgroup,active + * => should be merged + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER_SG", 0x00, NULL), + .extra = True, + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .apply_expected = True, + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = False, + .merge_expected = True + } + }, + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER_SG", 0x00, NULL), + .cleanup= True, + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = 0, + .ips = NULL, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = 0, + .ips = NULL, + .apply_expected = False, + .merge_expected = False + } + }, + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER_SG", 0x00, NULL), + .cleanup= True, + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + /* * This should be the last record in this array, * we need to make sure the we leave a tombstoned unique entry @@ -2864,14 +2999,18 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) if (records[i].r1.state == WREPL_STATE_RELEASED) { ret &= test_wrepl_is_applied(ctx, records[i].r1.owner, wins_name_r1, False); + } else if (records[i].r2.merge_expected) { + ret &= test_wrepl_is_merged(ctx, wins_name_r1, wins_name_r2); } else if (records[i].r1.owner != records[i].r2.owner) { + BOOL _expected; + _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected); ret &= test_wrepl_is_applied(ctx, records[i].r1.owner, - wins_name_r1, !records[i].r2.apply_expected); + wins_name_r1, _expected); } if (records[i].r2.state == WREPL_STATE_RELEASED) { ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, False); - } else { + } else if (!records[i].r2.merge_expected) { ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, records[i].r2.apply_expected); } -- cgit From 4c242c96e0dbd45f740c1efb36d9565767a38285 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 19 Oct 2005 06:30:05 +0000 Subject: r11173: print out the correct messages metze (This used to be commit d8e7e914bf29f7ae0b7cc1f47ea9f8cca210d8df) --- source4/torture/nbt/winsreplication.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 012c07c748..a99099c780 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -2944,6 +2944,25 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } if (!records[i].cleanup) { + const char *expected; + const char *ips; + + if (records[i].r2.merge_expected) { + expected = "MERGE"; + } else if (records[i].r2.apply_expected) { + expected = "REPLACE"; + } else { + expected = "NOT REPLACE"; + } + + if (!records[i].r1.ips && !records[i].r2.ips) { + ips = "no"; + } else if (records[i].r1.ips==records[i].r2.ips) { + ips = "same"; + } else { + ips = "different"; + } + printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n", wrepl_name_type_string(records[i].r1.type), wrepl_name_state_string(records[i].r1.state), @@ -2951,8 +2970,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) wrepl_name_type_string(records[i].r2.type), wrepl_name_state_string(records[i].r2.state), (records[i].r2.is_static?",static":""), - (records[i].r1.ips==records[i].r2.ips?"same":"different"), - (records[i].r2.apply_expected?"REPLACE":"NOT REPLACE")); + ips, expected); } /* -- cgit From 3464d409af8e9f83c7c6edffbc62b9e542d450bf Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 19 Oct 2005 07:00:31 +0000 Subject: r11174: - add special group vs. multi homed section - disable special group vs. special group, I need to look closer at this, as I'm getting strange timeouts randomly, so the server might be doing some challegnes while doing the merging of special group records, witch reaches timeouts metze (This used to be commit 7479760cbf5fe818c31b7795dc43b413800a63bd) --- source4/torture/nbt/winsreplication.c | 180 +++++++++++++++++++++++++++++++++- 1 file changed, 179 insertions(+), 1 deletion(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index a99099c780..ce6f0c70cf 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -2805,6 +2805,184 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, +/* + * special groups vs multi homed section, + */ + /* + * sgroup,active vs. mhomed,active + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + } + }, + + /* + * sgroup,active vs. mhomed,tombstone + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + } + }, + + /* + * sgroup,released vs. mhomed,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * sgroup,released vs. mhomed,tombstone + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + + /* + * sgroup,tombstone vs. mhomed,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * sgroup,tombstone vs. mhomed,tombstone + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + +#if 0 /* * special group vs special group section, */ @@ -2889,7 +3067,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .apply_expected = True } }, - +#endif /* * This should be the last record in this array, * we need to make sure the we leave a tombstoned unique entry -- cgit From 9334501ccb80ce57947b3f76559bf5969998d482 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 19 Oct 2005 07:12:26 +0000 Subject: r11175: - add multi homed vs. normal group section metze (This used to be commit 891416b79eeec3d6c9391181f86b104b887774a2) --- source4/torture/nbt/winsreplication.c | 179 +++++++++++++++++++++++++++++++++- 1 file changed, 178 insertions(+), 1 deletion(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index ce6f0c70cf..ec9d690ba3 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -2982,6 +2982,183 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, +/* + * multi homed vs. normal group section, + */ + /* + * mhomed,active vs. group,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * mhomed,active vs. group,tombstone + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + } + }, + + /* + * mhomed,released vs. group,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + + /* + * mhomed,released vs. group,tombstone + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * mhomed,tombstone vs. group,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + + /* + * mhomed,tombstone vs. group,tombstone + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + #if 0 /* * special group vs special group section, @@ -3078,7 +3255,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .cleanup= True, .r1 = { - .owner = &ctx->a, + .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, -- cgit From 4043d03ef06abefc400914aa1200975dd39f5298 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 19 Oct 2005 07:24:36 +0000 Subject: r11176: - add multi homed vs. special group section metze (This used to be commit 62ddca0e1f3d7484b32df7f5a56eca4761289c00) --- source4/torture/nbt/winsreplication.c | 180 +++++++++++++++++++++++++++++++++- 1 file changed, 179 insertions(+), 1 deletion(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index ec9d690ba3..a987890e07 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -3159,6 +3159,184 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, +/* + * multi homed vs. special group section, + */ + /* + * mhomed,active vs. sgroup,active + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + } + }, + + /* + * mhomed,active vs. group,tombstone + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + } + }, + + /* + * mhomed,released vs. sgroup,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * mhomed,released vs. group,tombstone + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + + /* + * mhomed,tombstone vs. sgroup,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * mhomed,tombstone vs. group,tombstone + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + + #if 0 /* * special group vs special group section, @@ -3255,7 +3433,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .cleanup= True, .r1 = { - .owner = &ctx->b, + .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, -- cgit From e8118ad3b0505534d68ccbef7a2cff54a9705ebb Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 19 Oct 2005 07:47:29 +0000 Subject: r11177: move unique vs * and normal group vs * into this form ACTIVE vs ACTIVE ACTIVE vs TOMBSTONE RELEASED vs ACTIVE RELEASED vs TOMBSTONE TOMBSTONE vs ACTIVE TOMBSTONE vs TOMBSTONE as it seems that is all we need to test, and w2k3 only decides between ACTIVE and NON-ACTIVE (REALEASED or TOMBSTONE) when it gets new replica objects also I have removed all the extra test, we only test the worst cases now, and this will make the algorithms more clear when you look at the output of the NBT-WINSREPLICATION torture test metze (This used to be commit 7545e4e7160864f5feedd35cf90507e47d7cf469) --- source4/torture/nbt/winsreplication.c | 451 +++++++++------------------------- 1 file changed, 113 insertions(+), 338 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index a987890e07..6e47861c6c 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -812,13 +812,12 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) * unique vs unique section */ /* - * unique,active vs. unique,active the same ip + * unique,active vs. unique,active * => should be replaced */ { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .extra = True, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, @@ -835,14 +834,14 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_A_1), - .ips = addresses_A_1, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, .apply_expected = True } }, /* - * unique,active vs. unique,tombstone the same ips + * unique,active vs. unique,tombstone * => should NOT be replaced */ { @@ -865,29 +864,28 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, .apply_expected = False } }, /* - * unique,tombstone vs. unique,active the same ips - * => should NOT be replaced + * unique,released vs. unique,active + * => should be replaced */ { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .extra = True, .r1 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_TOMBSTONE, + .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, .is_static = False, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = False }, .r2 = { .owner = &ctx->a, @@ -895,36 +893,6 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, - .apply_expected = True - } - }, - - /* - * unique,tombstone vs. unique,tombstone the same ips - * => should be replaced - */ - { - .line = __location__, - .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .extra = True, - .r1 = { - .owner = &ctx->a, - .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_TOMBSTONE, - .node = WREPL_NODE_B, - .is_static = False, - .num_ips = ARRAY_SIZE(addresses_A_1), - .ips = addresses_A_1, - .apply_expected = True - }, - .r2 = { - .owner = &ctx->b, - .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_TOMBSTONE, - .node = WREPL_NODE_B, - .is_static = False, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, .apply_expected = True @@ -932,7 +900,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) }, /* - * unique,active vs. unique,active the different ips + * unique,released vs. unique,tombstone * => should be replaced */ { @@ -941,57 +909,27 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_ACTIVE, + .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, .is_static = False, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = False }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_ACTIVE, - .node = WREPL_NODE_B, - .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, - .apply_expected = True - } - }, - - /* - * unique,active vs. unique,tombstone the different ips - * => should NOT be replaced - */ - { - .line = __location__, - .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .extra = True, - .r1 = { - .owner = &ctx->b, - .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_ACTIVE, + .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, .apply_expected = True - }, - .r2 = { - .owner = &ctx->a, - .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_TOMBSTONE, - .node = WREPL_NODE_B, - .is_static = False, - .num_ips = ARRAY_SIZE(addresses_A_1), - .ips = addresses_A_1, - .apply_expected = False } }, /* - * unique,tombstone vs. unique,active the different ips + * unique,tombstone vs. unique,active * => should be replaced */ { @@ -1020,7 +958,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) }, /* - * unique,tombstone vs. unique,tombstone the different ips + * unique,tombstone vs. unique,tombstone * => should be replaced */ { @@ -1048,6 +986,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, + /* * unique vs normal groups section, */ @@ -1081,7 +1020,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) }, /* - * unique,active vs. group,tombstone same ip + * unique,active vs. group,tombstone * => should NOT be replaced */ { @@ -1110,61 +1049,60 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) }, /* - * unique,active vs. group,tombstone different ip - * => should NOT be replaced + * unique,released vs. group,active + * => should be replaced */ { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .extra = True, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_ACTIVE, + .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, .is_static = False, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = False }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_GROUP, - .state = WREPL_STATE_TOMBSTONE, + .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = True } }, /* - * unique,active vs. group,released - * => should NOT be replaced + * unique,released vs. group,tombstone + * => should be replaced */ { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .r1 = { - .owner = &ctx->a, + .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_ACTIVE, + .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_A_1), - .ips = addresses_A_1, - .apply_expected = True + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False }, .r2 = { - .owner = &ctx->b, + .owner = &ctx->a, .type = WREPL_TYPE_GROUP, - .state = WREPL_STATE_RELEASED, + .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = True } }, @@ -1226,9 +1164,12 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, +/* + * unique vs special groups section, + */ /* - * unique,tombstone vs. group,released - * => should be replaced + * unique,active vs. sgroup,active + * => should NOT be replaced */ { .line = __location__, @@ -1236,7 +1177,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_TOMBSTONE, + .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, .num_ips = ARRAY_SIZE(addresses_A_1), @@ -1245,79 +1186,48 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) }, .r2 = { .owner = &ctx->b, - .type = WREPL_TYPE_GROUP, - .state = WREPL_STATE_RELEASED, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, - .apply_expected = True + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False } }, /* - * unique,released vs. group,released - * => should be replaced - * - * here we need a 2nd round to make sure - * released vs. released is handled correct + * unique,active vs. sgroup,tombstone + * => should NOT be replaced */ { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .r1 = { - .owner = &ctx->b, - .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_RELEASED, - .node = WREPL_NODE_B, - .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, - .apply_expected = False - }, - .r2 = { .owner = &ctx->a, - .type = WREPL_TYPE_GROUP, - .state = WREPL_STATE_RELEASED, - .node = WREPL_NODE_B, - .is_static = False, - .num_ips = ARRAY_SIZE(addresses_A_1), - .ips = addresses_A_1, - .apply_expected = True - } - }, - { - .line = __location__, - .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .cleanup= True, - .r1 = { - .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_TOMBSTONE, + .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False /* this should conflict with the group.released above */ + .apply_expected = True }, .r2 = { - .owner = &ctx->a, - .type = WREPL_TYPE_GROUP, + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = False } }, -/* - * unique vs special groups section, - */ /* - * unique,active vs. sgroup,active - * => should NOT be replaced + * unique,released vs. sgroup,active + * => should be replaced */ { .line = __location__, @@ -1325,12 +1235,12 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_ACTIVE, + .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, .is_static = False, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = False }, .r2 = { .owner = &ctx->b, @@ -1338,38 +1248,38 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_A_1), - .ips = addresses_A_1, - .apply_expected = False + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = True } }, /* - * unique,active vs. sgroup,tombstone - * => should NOT be replaced + * unique,released vs. sgroup,tombstone + * => should be replaced */ { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .r1 = { - .owner = &ctx->a, + .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_ACTIVE, + .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_A_1), - .ips = addresses_A_1, - .apply_expected = True + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False }, .r2 = { - .owner = &ctx->b, + .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_A_1), - .ips = addresses_A_1, - .apply_expected = False + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .apply_expected = True } }, @@ -1431,12 +1341,11 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, - /* * unique vs multi homed section, */ /* - * unique,active vs. mhomed,active with different ips + * unique,active vs. mhomed,active * => should be replaced */ { @@ -1465,21 +1374,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) }, /* - * unique,active vs. mhomed,tombstone with different ips + * unique,active vs. mhomed,tombstone * => should NOT be replaced */ { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .extra = True, .r1 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, .apply_expected = True }, .r2 = { @@ -1488,15 +1396,15 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_A_3_4), - .ips = addresses_A_3_4, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, .apply_expected = False } }, /* - * unique,active vs. mhomed,tombstone with same ips - * => should NOT be replaced + * unique,released vs. mhomed,active + * => should be replaced */ { .line = __location__, @@ -1504,27 +1412,56 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .r1 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_3_4), - .ips = addresses_B_3_4, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, .apply_expected = True + } + }, + + /* + * unique,released vs. mhomed,tombstone + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False }, .r2 = { - .owner = &ctx->a, + .owner = &ctx->b, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = False + .apply_expected = True } }, /* - * unique,tombstone vs. mhomed,active with different ips + * unique,tombstone vs. mhomed,active * => should be replaced */ { @@ -1553,7 +1490,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) }, /* - * unique,tombstone vs. mhomed,tombstone with different ips + * unique,tombstone vs. mhomed,tombstone * => should be replaced */ { @@ -1848,60 +1785,6 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, - /* - * group,released vs. group,released - * => should be replaced - */ - { - .line = __location__, - .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .r1 = { - .owner = &ctx->b, - .type = WREPL_TYPE_GROUP, - .state = WREPL_STATE_RELEASED, - .node = WREPL_NODE_B, - .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, - .apply_expected = False - }, - .r2 = { - .owner = &ctx->a, - .type = WREPL_TYPE_GROUP, - .state = WREPL_STATE_RELEASED, - .node = WREPL_NODE_B, - .is_static = False, - .num_ips = ARRAY_SIZE(addresses_A_1), - .ips = addresses_A_1, - .apply_expected = True - } - }, - { - .line = __location__, - .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .cleanup= True, - .r1 = { - .owner = &ctx->b, - .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_TOMBSTONE, - .node = WREPL_NODE_B, - .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, - .apply_expected = False - }, - .r2 = { - .owner = &ctx->a, - .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_TOMBSTONE, - .node = WREPL_NODE_B, - .is_static = False, - .num_ips = ARRAY_SIZE(addresses_A_1), - .ips = addresses_A_1, - .apply_expected = True - } - }, - /* * group,released vs. group,tombstone * => should be replaced @@ -2079,60 +1962,6 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, - /* - * group,released vs. sgroup,released - * => should NOT be replaced - */ - { - .line = __location__, - .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .r1 = { - .owner = &ctx->b, - .type = WREPL_TYPE_GROUP, - .state = WREPL_STATE_RELEASED, - .node = WREPL_NODE_B, - .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, - .apply_expected = False - }, - .r2 = { - .owner = &ctx->a, - .type = WREPL_TYPE_SGROUP, - .state = WREPL_STATE_RELEASED, - .node = WREPL_NODE_B, - .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, - .apply_expected = False - } - }, - { - .line = __location__, - .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .cleanup= True, - .r1 = { - .owner = &ctx->a, - .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_TOMBSTONE, - .node = WREPL_NODE_B, - .is_static = False, - .num_ips = ARRAY_SIZE(addresses_A_1), - .ips = addresses_A_1, - .apply_expected = False - }, - .r2 = { - .owner = &ctx->b, - .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_TOMBSTONE, - .node = WREPL_NODE_B, - .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, - .apply_expected = True - } - }, - /* * group,released vs. sgroup,tombstone * => should NOT be replaced @@ -2310,60 +2139,6 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, - /* - * group,released vs. mhomed,released - * => should NOT be replaced - */ - { - .line = __location__, - .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .r1 = { - .owner = &ctx->b, - .type = WREPL_TYPE_GROUP, - .state = WREPL_STATE_RELEASED, - .node = WREPL_NODE_B, - .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, - .apply_expected = False - }, - .r2 = { - .owner = &ctx->a, - .type = WREPL_TYPE_MHOMED, - .state = WREPL_STATE_RELEASED, - .node = WREPL_NODE_B, - .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, - .apply_expected = False - } - }, - { - .line = __location__, - .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .cleanup= True, - .r1 = { - .owner = &ctx->a, - .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_TOMBSTONE, - .node = WREPL_NODE_B, - .is_static = False, - .num_ips = ARRAY_SIZE(addresses_A_1), - .ips = addresses_A_1, - .apply_expected = False - }, - .r2 = { - .owner = &ctx->b, - .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_TOMBSTONE, - .node = WREPL_NODE_B, - .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, - .apply_expected = True - } - }, - /* * group,released vs. mhomed,tombstone * => should NOT be replaced -- cgit From 7e3d377b1d72badc7b2338245aef3a51a152f35c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 19 Oct 2005 16:25:58 +0000 Subject: r11186: - get rid of some .extra = True cases - add multihomed vs unique section - update conflict handling for the above case metze (This used to be commit c043e56efd3d72cdd5b17c78512e12285c87f221) --- source4/torture/nbt/winsreplication.c | 188 ++++++++++++++++++++++++++++++++-- 1 file changed, 182 insertions(+), 6 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 6e47861c6c..ee8f7e7883 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -847,7 +847,6 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .extra = True, .r1 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, @@ -864,8 +863,8 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_A_1), - .ips = addresses_A_1, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, .apply_expected = False } }, @@ -2757,6 +2756,183 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, +/* + * multi homed vs. unique section, + */ + /* + * mhomed,active vs. unique,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * mhomed,active vs. unique,tombstone + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + } + }, + + /* + * mhomed,released vs. unique,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * mhomed,released vs. uinique,tombstone + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + + /* + * mhomed,tombstone vs. unique,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * mhomed,tombstone vs. uinique,tombstone + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + /* * multi homed vs. normal group section, */ @@ -2967,7 +3143,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) }, /* - * mhomed,active vs. group,tombstone + * mhomed,active vs. sgroup,tombstone * => should NOT be replaced */ { @@ -3025,7 +3201,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) }, /* - * mhomed,released vs. group,tombstone + * mhomed,released vs. sgroup,tombstone * => should be replaced */ { @@ -3083,7 +3259,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) }, /* - * mhomed,tombstone vs. group,tombstone + * mhomed,tombstone vs. sgroup,tombstone * => should be replaced */ { -- cgit From 47c0c176e95998db7303950fb6bf46a0e65e40d3 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 19 Oct 2005 16:52:50 +0000 Subject: r11188: - add multi homed vs. multi homed section metze (This used to be commit 838323e58fe4e748a17100c4cd13788059dd12c6) --- source4/torture/nbt/winsreplication.c | 178 +++++++++++++++++++++++++++++++++- 1 file changed, 177 insertions(+), 1 deletion(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index ee8f7e7883..257a786f2a 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -3287,6 +3287,182 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, +/* + * multi homed vs. mlti homed section, + */ + /* + * mhomed,active vs. mhomed,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = True + } + }, + + /* + * mhomed,active vs. mhomed,tombstone + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = False + } + }, + + /* + * mhomed,released vs. mhomed,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .apply_expected = True + } + }, + + /* + * mhomed,released vs. mhomed,tombstone + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = True + } + }, + + /* + * mhomed,tombstone vs. mhomed,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .apply_expected = True + } + }, + + /* + * mhomed,tombstone vs. mhomed,tombstone + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = True + } + }, #if 0 /* @@ -3384,7 +3560,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .cleanup= True, .r1 = { - .owner = &ctx->a, + .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, -- cgit From bc43d1b6f02937a694bfd4c75cee61e3da08fc45 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 19 Oct 2005 17:48:55 +0000 Subject: r11189: add some more special group vs. special group tests, to make sure that replicas from the same owner are blinding overwritten in all cases metze (This used to be commit 466baf737aedf240ff372ab8e8c708299102d1fa) --- source4/torture/nbt/winsreplication.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 257a786f2a..d3bd609096 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -676,6 +676,20 @@ static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx) .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, },{ + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + },{ + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + },{ /* the last one should always be a unique,tomstone record! */ .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, -- cgit From 2d1aa2954b8061c1fccb8fb9f7b8bd64a21e8210 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 23 Oct 2005 14:18:03 +0000 Subject: r11265: add a bunch of owned vs. replica conflict tests metze (This used to be commit c8d3c2f1a1231de49bca1a72e696a833366a0493) --- source4/torture/nbt/winsreplication.c | 1414 +++++++++++++++++++++++++++++++++ 1 file changed, 1414 insertions(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index d3bd609096..3e48b8ccd2 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -23,6 +23,7 @@ #include "includes.h" #include "libcli/nbt/libnbt.h" #include "libcli/wrepl/winsrepl.h" +#include "lib/socket/socket.h" #define CHECK_STATUS(status, correct) do { \ if (!NT_STATUS_EQUAL(status, correct)) { \ @@ -326,6 +327,13 @@ struct test_wrepl_conflict_conn { #define TEST_ADDRESS_B_PREFIX "127.0.66" struct wrepl_wins_owner a, b, c; + + const char *myaddr; + struct nbt_name_socket *nbtsock; + BOOL nbt_root_port; + + uint32_t addresses_1_num; + struct wrepl_ip *addresses_1; }; static const struct wrepl_ip addresses_A_1[] = { @@ -435,6 +443,26 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem talloc_free(pull_table.out.partners); + ctx->nbtsock = nbt_name_socket_init(ctx, NULL); + if (!ctx->nbtsock) return NULL; + + ctx->myaddr = talloc_strdup(mem_ctx, iface_best_ip(address)); + if (!ctx->myaddr) return NULL; + + status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, lp_nbt_port(), 0, 0); + if (!NT_STATUS_IS_OK(status)) { + status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0, 0); + if (!NT_STATUS_IS_OK(status)) return NULL; + } else { + ctx->nbt_root_port = True; + } + + ctx->addresses_1_num = 1; + ctx->addresses_1 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_1_num); + if (!ctx->addresses_1) return NULL; + ctx->addresses_1[0].owner = ctx->c.address; + ctx->addresses_1[0].ip = ctx->myaddr; + return ctx; } @@ -508,6 +536,80 @@ done: return ret; } +#if 0 +static BOOL test_wrepl_update_two(struct test_wrepl_conflict_conn *ctx, + const struct wrepl_wins_owner *owner, + const struct wrepl_wins_name *name1, + const struct wrepl_wins_name *name2) +{ + BOOL ret = True; + struct wrepl_socket *wrepl_socket; + struct wrepl_associate associate; + struct wrepl_packet update_packet, repl_send; + struct wrepl_table *update; + struct wrepl_wins_owner wrepl_wins_owners[1]; + struct wrepl_packet *repl_recv; + struct wrepl_wins_owner *send_request; + struct wrepl_send_reply *send_reply; + struct wrepl_wins_name wrepl_wins_names[2]; + uint32_t assoc_ctx; + NTSTATUS status; + + wrepl_socket = wrepl_socket_init(ctx, NULL); + + status = wrepl_connect(wrepl_socket, NULL, ctx->address); + CHECK_STATUS(status, NT_STATUS_OK); + + status = wrepl_associate(wrepl_socket, &associate); + CHECK_STATUS(status, NT_STATUS_OK); + assoc_ctx = associate.out.assoc_ctx; + + /* now send a WREPL_REPL_UPDATE message */ + ZERO_STRUCT(update_packet); + update_packet.opcode = WREPL_OPCODE_BITS; + update_packet.assoc_ctx = assoc_ctx; + update_packet.mess_type = WREPL_REPLICATION; + update_packet.message.replication.command = WREPL_REPL_UPDATE; + update = &update_packet.message.replication.info.table; + + update->partner_count = ARRAY_SIZE(wrepl_wins_owners); + update->partners = wrepl_wins_owners; + update->initiator = "0.0.0.0"; + + wrepl_wins_owners[0] = *owner; + + status = wrepl_request(wrepl_socket, wrepl_socket, + &update_packet, &repl_recv); + CHECK_STATUS(status, NT_STATUS_OK); + CHECK_VALUE(repl_recv->mess_type, WREPL_REPLICATION); + CHECK_VALUE(repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST); + send_request = &repl_recv->message.replication.info.owner; + + ZERO_STRUCT(repl_send); + repl_send.opcode = WREPL_OPCODE_BITS; + repl_send.assoc_ctx = assoc_ctx; + repl_send.mess_type = WREPL_REPLICATION; + repl_send.message.replication.command = WREPL_REPL_SEND_REPLY; + send_reply = &repl_send.message.replication.info.reply; + + send_reply->num_names = ARRAY_SIZE(wrepl_wins_names); + send_reply->names = wrepl_wins_names; + + wrepl_wins_names[0] = *name1; + wrepl_wins_names[1] = *name2; + + status = wrepl_request(wrepl_socket, wrepl_socket, + &repl_send, &repl_recv); + CHECK_STATUS(status, NT_STATUS_OK); + CHECK_VALUE(repl_recv->mess_type, WREPL_STOP_ASSOCIATION); + CHECK_VALUE(repl_recv->message.stop.reason, 0); + +done: + talloc_free(wrepl_socket); + return ret; +} +#endif + static BOOL test_wrepl_is_applied(struct test_wrepl_conflict_conn *ctx, const struct wrepl_wins_owner *owner, const struct wrepl_wins_name *name, @@ -3719,6 +3821,1317 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) return ret; } + +static BOOL test_conflict_owned_vs_replica(struct test_wrepl_conflict_conn *ctx) +{ + BOOL ret = True; + NTSTATUS status; + struct wrepl_wins_name wins_name_; + struct wrepl_wins_name *wins_name = &wins_name_; + struct nbt_name_register name_register_; + struct nbt_name_register *name_register = &name_register_; + struct nbt_name_release release_; + struct nbt_name_release *release = &release_; + uint32_t i; + struct { + const char *line; /* just better debugging */ + struct nbt_name name; + struct { + uint32_t nb_flags; + BOOL mhomed; + uint32_t num_ips; + const struct wrepl_ip *ips; + BOOL release; + BOOL apply_expected; + } wins; + struct { + enum wrepl_name_type type; + enum wrepl_name_state state; + enum wrepl_name_node node; + BOOL is_static; + uint32_t num_ips; + const struct wrepl_ip *ips; + BOOL apply_expected; + } replica; + } records[] = { + /* + * unique,released vs. unique,active with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * unique,released vs. unique,active with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * unique,released vs. unique,tombstone with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * unique,released vs. unique,tombstone with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * unique,released vs. group,active with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * unique,released vs. group,active with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * unique,released vs. group,tombstone with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * unique,released vs. group,tombstone with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * unique,released vs. sgroup,active with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * unique,released vs. sgroup,active with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * unique,released vs. sgroup,tombstone with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * unique,released vs. sgroup,tombstone with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * unique,released vs. mhomed,active with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * unique,released vs. mhomed,active with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * unique,released vs. mhomed,tombstone with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * unique,released vs. mhomed,tombstone with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * group,released vs. unique,active with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * group,released vs. unique,active with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, + /* + * group,released vs. unique,tombstone with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * group,released vs. unique,tombstone with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, + /* + * group,released vs. group,active with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * group,released vs. group,active with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * group,released vs. group,tombstone with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * group,released vs. group,tombstone with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * group,released vs. sgroup,active with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * group,released vs. sgroup,active with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, + /* + * group,released vs. sgroup,tombstone with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * group,released vs. sgroup,tombstone with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, + /* + * group,released vs. mhomed,active with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * group,released vs. mhomed,active with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, + /* + * group,released vs. mhomed,tombstone with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * group,released vs. mhomed,tombstone with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, + /* + * sgroup,released vs. unique,active with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * sgroup,released vs. unique,active with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * sgroup,released vs. unique,tombstone with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * sgroup,released vs. unique,tombstone with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * sgroup,released vs. group,active with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * sgroup,released vs. group,active with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * sgroup,released vs. group,tombstone with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * sgroup,released vs. group,tombstone with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * sgroup,released vs. sgroup,active with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * sgroup,released vs. sgroup,active with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * sgroup,released vs. sgroup,tombstone with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * sgroup,released vs. sgroup,tombstone with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * sgroup,released vs. mhomed,active with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * sgroup,released vs. mhomed,active with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * sgroup,released vs. mhomed,tombstone with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * sgroup,released vs. mhomed,tombstone with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + }; + + if (!ctx) return False; + + printf("Test Replica records vs. owned records\n"); + + for(i=0; ret && i < ARRAY_SIZE(records); i++) { + printf("%s => %s\n", nbt_name_string(ctx, &records[i].name), + (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE")); + + /* + * Setup Register + */ + name_register->in.name = records[i].name; + name_register->in.dest_addr = ctx->address; + name_register->in.address = records[i].wins.ips[0].ip; + name_register->in.nb_flags = records[i].wins.nb_flags; + name_register->in.register_demand= False; + name_register->in.broadcast = False; + name_register->in.multi_homed = records[i].wins.mhomed; + name_register->in.ttl = 300000; + name_register->in.timeout = 70; + name_register->in.retries = 0; + + status = nbt_name_register(ctx->nbtsock, ctx, name_register); + if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { + printf("No response from %s for name register\n", ctx->address); + ret = False; + } + if (!NT_STATUS_IS_OK(status)) { + printf("Bad response from %s for name register - %s\n", + ctx->address, nt_errstr(status)); + ret = False; + } + CHECK_VALUE(name_register->out.rcode, 0); + CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address); + CHECK_VALUE(name_register->out.name.type, records[i].name.type); + CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name); + CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope); + CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[0].ip); + + if (records[i].wins.release) { + release->in.name = records[i].name; + release->in.dest_addr = ctx->address; + release->in.address = records[i].wins.ips[0].ip; + release->in.nb_flags = records[i].wins.nb_flags; + release->in.broadcast = False; + release->in.timeout = 30; + release->in.retries = 0; + + status = nbt_name_release(ctx->nbtsock, ctx, release); + if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { + printf("No response from %s for name release\n", ctx->address); + return False; + } + if (!NT_STATUS_IS_OK(status)) { + printf("Bad response from %s for name query - %s\n", + ctx->address, nt_errstr(status)); + return False; + } + CHECK_VALUE(release->out.rcode, 0); + } + + /* + * Setup Replica + */ + wins_name->name = &records[i].name; + wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type, + records[i].replica.state, + records[i].replica.node, + records[i].replica.is_static); + wins_name->id = ++ctx->b.max_version; + if (wins_name->flags & 2) { + wins_name->addresses.addresses.num_ips = records[i].replica.num_ips; + wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips); + } else { + wins_name->addresses.ip = records[i].replica.ips[0].ip; + } + wins_name->unknown = "255.255.255.255"; + + ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name); + ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, + records[i].replica.apply_expected); + + if (records[i].replica.apply_expected) { + wins_name->name = &records[i].name; + wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE, + WREPL_STATE_TOMBSTONE, + WREPL_NODE_B, False); + wins_name->id = ++ctx->b.max_version; + wins_name->addresses.ip = addresses_B_1[0].ip; + wins_name->unknown = "255.255.255.255"; + + ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name); + ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True); + } else { + release->in.name = records[i].name; + release->in.dest_addr = ctx->address; + release->in.address = records[i].wins.ips[0].ip; + release->in.nb_flags = records[i].wins.nb_flags; + release->in.broadcast = False; + release->in.timeout = 30; + release->in.retries = 0; + + status = nbt_name_release(ctx->nbtsock, ctx, release); + if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { + printf("No response from %s for name release\n", ctx->address); + return False; + } + if (!NT_STATUS_IS_OK(status)) { + printf("Bad response from %s for name query - %s\n", + ctx->address, nt_errstr(status)); + return False; + } + CHECK_VALUE(release->out.rcode, 0); + } +done: + if (!ret) { + printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line); + return ret; + } + } + + return ret; +} + /* test WINS replication operations */ @@ -3781,6 +5194,7 @@ BOOL torture_nbt_winsreplication(void) ret &= test_conflict_same_owner(ctx); ret &= test_conflict_different_owner(ctx); + ret &= test_conflict_owned_vs_replica(ctx); talloc_free(mem_ctx); -- cgit From 7ec41c942458d85fc439d3608115428d15257544 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 27 Oct 2005 13:11:33 +0000 Subject: r11330: - split up owned,active vs replica and owned,released vs. replica - complete owned,released tests metze (This used to be commit ba82ffb261d5ef59216cec75fb617b4d7022aaee) --- source4/torture/nbt/winsreplication.c | 903 +++++++++++++++++++++++++++++----- 1 file changed, 775 insertions(+), 128 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 3e48b8ccd2..0dd74aa258 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -3821,8 +3821,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) return ret; } - -static BOOL test_conflict_owned_vs_replica(struct test_wrepl_conflict_conn *ctx) +static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_conn *ctx) { BOOL ret = True; NTSTATUS status; @@ -5006,131 +5005,778 @@ static BOOL test_conflict_owned_vs_replica(struct test_wrepl_conflict_conn *ctx) .apply_expected = True }, }, - }; - - if (!ctx) return False; - - printf("Test Replica records vs. owned records\n"); - - for(i=0; ret && i < ARRAY_SIZE(records); i++) { - printf("%s => %s\n", nbt_name_string(ctx, &records[i].name), - (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE")); - - /* - * Setup Register - */ - name_register->in.name = records[i].name; - name_register->in.dest_addr = ctx->address; - name_register->in.address = records[i].wins.ips[0].ip; - name_register->in.nb_flags = records[i].wins.nb_flags; - name_register->in.register_demand= False; - name_register->in.broadcast = False; - name_register->in.multi_homed = records[i].wins.mhomed; - name_register->in.ttl = 300000; - name_register->in.timeout = 70; - name_register->in.retries = 0; - - status = nbt_name_register(ctx->nbtsock, ctx, name_register); - if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { - printf("No response from %s for name register\n", ctx->address); - ret = False; - } - if (!NT_STATUS_IS_OK(status)) { - printf("Bad response from %s for name register - %s\n", - ctx->address, nt_errstr(status)); - ret = False; - } - CHECK_VALUE(name_register->out.rcode, 0); - CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address); - CHECK_VALUE(name_register->out.name.type, records[i].name.type); - CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name); - CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope); - CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[0].ip); - - if (records[i].wins.release) { - release->in.name = records[i].name; - release->in.dest_addr = ctx->address; - release->in.address = records[i].wins.ips[0].ip; - release->in.nb_flags = records[i].wins.nb_flags; - release->in.broadcast = False; - release->in.timeout = 30; - release->in.retries = 0; - - status = nbt_name_release(ctx->nbtsock, ctx, release); - if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { - printf("No response from %s for name release\n", ctx->address); - return False; - } - if (!NT_STATUS_IS_OK(status)) { - printf("Bad response from %s for name query - %s\n", - ctx->address, nt_errstr(status)); - return False; - } - CHECK_VALUE(release->out.rcode, 0); - } - - /* - * Setup Replica - */ - wins_name->name = &records[i].name; - wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type, - records[i].replica.state, - records[i].replica.node, - records[i].replica.is_static); - wins_name->id = ++ctx->b.max_version; - if (wins_name->flags & 2) { - wins_name->addresses.addresses.num_ips = records[i].replica.num_ips; - wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips); - } else { - wins_name->addresses.ip = records[i].replica.ips[0].ip; - } - wins_name->unknown = "255.255.255.255"; - - ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name); - ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, - records[i].replica.apply_expected); - - if (records[i].replica.apply_expected) { - wins_name->name = &records[i].name; - wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE, - WREPL_STATE_TOMBSTONE, - WREPL_NODE_B, False); - wins_name->id = ++ctx->b.max_version; - wins_name->addresses.ip = addresses_B_1[0].ip; - wins_name->unknown = "255.255.255.255"; - - ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name); - ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True); - } else { - release->in.name = records[i].name; - release->in.dest_addr = ctx->address; - release->in.address = records[i].wins.ips[0].ip; - release->in.nb_flags = records[i].wins.nb_flags; - release->in.broadcast = False; - release->in.timeout = 30; - release->in.retries = 0; - - status = nbt_name_release(ctx->nbtsock, ctx, release); - if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { - printf("No response from %s for name release\n", ctx->address); - return False; - } - if (!NT_STATUS_IS_OK(status)) { - printf("Bad response from %s for name query - %s\n", - ctx->address, nt_errstr(status)); - return False; - } - CHECK_VALUE(release->out.rcode, 0); - } -done: - if (!ret) { - printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line); - return ret; - } - } - - return ret; -} + /* + * mhomed,released vs. unique,active with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * mhomed,released vs. unique,active with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * mhomed,released vs. unique,tombstone with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * mhomed,released vs. unique,tombstone with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * mhomed,released vs. group,active with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * mhomed,released vs. group,active with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * mhomed,released vs. group,tombstone with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * mhomed,released vs. group,tombstone with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * mhomed,released vs. sgroup,active with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * mhomed,released vs. sgroup,active with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * mhomed,released vs. sgroup,tombstone with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * mhomed,released vs. sgroup,tombstone with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * mhomed,released vs. mhomed,active with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * mhomed,released vs. mhomed,active with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * mhomed,released vs. mhomed,tombstone with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * mhomed,released vs. mhomed,tombstone with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = True, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + }; + + if (!ctx) return False; + + printf("Test Replica records vs. owned released records\n"); + + for(i=0; ret && i < ARRAY_SIZE(records); i++) { + printf("%s => %s\n", nbt_name_string(ctx, &records[i].name), + (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE")); + + /* + * Setup Register + */ + name_register->in.name = records[i].name; + name_register->in.dest_addr = ctx->address; + name_register->in.address = records[i].wins.ips[0].ip; + name_register->in.nb_flags = records[i].wins.nb_flags; + name_register->in.register_demand= False; + name_register->in.broadcast = False; + name_register->in.multi_homed = records[i].wins.mhomed; + name_register->in.ttl = 300000; + name_register->in.timeout = 70; + name_register->in.retries = 0; + + status = nbt_name_register(ctx->nbtsock, ctx, name_register); + if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { + printf("No response from %s for name register\n", ctx->address); + ret = False; + } + if (!NT_STATUS_IS_OK(status)) { + printf("Bad response from %s for name register - %s\n", + ctx->address, nt_errstr(status)); + ret = False; + } + CHECK_VALUE(name_register->out.rcode, 0); + CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address); + CHECK_VALUE(name_register->out.name.type, records[i].name.type); + CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name); + CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope); + CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[0].ip); + + if (records[i].wins.release) { + release->in.name = records[i].name; + release->in.dest_addr = ctx->address; + release->in.address = records[i].wins.ips[0].ip; + release->in.nb_flags = records[i].wins.nb_flags; + release->in.broadcast = False; + release->in.timeout = 30; + release->in.retries = 0; + + status = nbt_name_release(ctx->nbtsock, ctx, release); + if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { + printf("No response from %s for name release\n", ctx->address); + return False; + } + if (!NT_STATUS_IS_OK(status)) { + printf("Bad response from %s for name query - %s\n", + ctx->address, nt_errstr(status)); + return False; + } + CHECK_VALUE(release->out.rcode, 0); + } + + /* + * Setup Replica + */ + wins_name->name = &records[i].name; + wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type, + records[i].replica.state, + records[i].replica.node, + records[i].replica.is_static); + wins_name->id = ++ctx->b.max_version; + if (wins_name->flags & 2) { + wins_name->addresses.addresses.num_ips = records[i].replica.num_ips; + wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips); + } else { + wins_name->addresses.ip = records[i].replica.ips[0].ip; + } + wins_name->unknown = "255.255.255.255"; + + ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name); + ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, + records[i].replica.apply_expected); + + if (records[i].replica.apply_expected) { + wins_name->name = &records[i].name; + wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE, + WREPL_STATE_TOMBSTONE, + WREPL_NODE_B, False); + wins_name->id = ++ctx->b.max_version; + wins_name->addresses.ip = addresses_B_1[0].ip; + wins_name->unknown = "255.255.255.255"; + + ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name); + ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True); + } else { + release->in.name = records[i].name; + release->in.dest_addr = ctx->address; + release->in.address = records[i].wins.ips[0].ip; + release->in.nb_flags = records[i].wins.nb_flags; + release->in.broadcast = False; + release->in.timeout = 30; + release->in.retries = 0; + + status = nbt_name_release(ctx->nbtsock, ctx, release); + if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { + printf("No response from %s for name release\n", ctx->address); + return False; + } + if (!NT_STATUS_IS_OK(status)) { + printf("Bad response from %s for name query - %s\n", + ctx->address, nt_errstr(status)); + return False; + } + CHECK_VALUE(release->out.rcode, 0); + } +done: + if (!ret) { + printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line); + return ret; + } + } + + return ret; +} + +static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_conn *ctx) +{ + BOOL ret = True; + NTSTATUS status; + struct wrepl_wins_name wins_name_; + struct wrepl_wins_name *wins_name = &wins_name_; + struct nbt_name_register name_register_; + struct nbt_name_register *name_register = &name_register_; + struct nbt_name_release release_; + struct nbt_name_release *release = &release_; + uint32_t i; + struct { + const char *line; /* just better debugging */ + struct nbt_name name; + struct { + uint32_t nb_flags; + BOOL mhomed; + uint32_t num_ips; + const struct wrepl_ip *ips; + BOOL release; + BOOL apply_expected; + } wins; + struct { + enum wrepl_name_type type; + enum wrepl_name_state state; + enum wrepl_name_node node; + BOOL is_static; + uint32_t num_ips; + const struct wrepl_ip *ips; + BOOL apply_expected; + } replica; + } records[] = { +#if 0 + /* + * unique,active vs. unique,active with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_UA_SI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = False, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * unique,active vs. unique,active with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_UA_DI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = False, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * unique,active vs. unique,tombstone with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_UT_SI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = False, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * unique,active vs. unique,tombstone with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_UT_DI", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .release = False, + .apply_expected = True + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, +#endif + }; + + if (!ctx) return False; + + if (!ctx->nbt_root_port) { + printf("SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n", + lp_nbt_port()); + return True; + } + + printf("Test Replica records vs. owned active records\n"); + + for(i=0; ret && i < ARRAY_SIZE(records); i++) { + printf("%s => %s\n", nbt_name_string(ctx, &records[i].name), + (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE")); + + /* + * Setup Register + */ + name_register->in.name = records[i].name; + name_register->in.dest_addr = ctx->address; + name_register->in.address = records[i].wins.ips[0].ip; + name_register->in.nb_flags = records[i].wins.nb_flags; + name_register->in.register_demand= False; + name_register->in.broadcast = False; + name_register->in.multi_homed = records[i].wins.mhomed; + name_register->in.ttl = 300000; + name_register->in.timeout = 70; + name_register->in.retries = 0; + + status = nbt_name_register(ctx->nbtsock, ctx, name_register); + if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { + printf("No response from %s for name register\n", ctx->address); + ret = False; + } + if (!NT_STATUS_IS_OK(status)) { + printf("Bad response from %s for name register - %s\n", + ctx->address, nt_errstr(status)); + ret = False; + } + CHECK_VALUE(name_register->out.rcode, 0); + CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address); + CHECK_VALUE(name_register->out.name.type, records[i].name.type); + CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name); + CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope); + CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[0].ip); + + if (records[i].wins.release) { + release->in.name = records[i].name; + release->in.dest_addr = ctx->address; + release->in.address = records[i].wins.ips[0].ip; + release->in.nb_flags = records[i].wins.nb_flags; + release->in.broadcast = False; + release->in.timeout = 30; + release->in.retries = 0; + + status = nbt_name_release(ctx->nbtsock, ctx, release); + if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { + printf("No response from %s for name release\n", ctx->address); + return False; + } + if (!NT_STATUS_IS_OK(status)) { + printf("Bad response from %s for name query - %s\n", + ctx->address, nt_errstr(status)); + return False; + } + CHECK_VALUE(release->out.rcode, 0); + } + + /* + * Setup Replica + */ + wins_name->name = &records[i].name; + wins_name->flags = WREPL_NAME_FLAGS(records[i].replica.type, + records[i].replica.state, + records[i].replica.node, + records[i].replica.is_static); + wins_name->id = ++ctx->b.max_version; + if (wins_name->flags & 2) { + wins_name->addresses.addresses.num_ips = records[i].replica.num_ips; + wins_name->addresses.addresses.ips = discard_const(records[i].replica.ips); + } else { + wins_name->addresses.ip = records[i].replica.ips[0].ip; + } + wins_name->unknown = "255.255.255.255"; + + ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name); + ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, + records[i].replica.apply_expected); + + if (records[i].replica.apply_expected) { + wins_name->name = &records[i].name; + wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE, + WREPL_STATE_TOMBSTONE, + WREPL_NODE_B, False); + wins_name->id = ++ctx->b.max_version; + wins_name->addresses.ip = addresses_B_1[0].ip; + wins_name->unknown = "255.255.255.255"; + + ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name); + ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True); + } else { + release->in.name = records[i].name; + release->in.dest_addr = ctx->address; + release->in.address = records[i].wins.ips[0].ip; + release->in.nb_flags = records[i].wins.nb_flags; + release->in.broadcast = False; + release->in.timeout = 30; + release->in.retries = 0; + + status = nbt_name_release(ctx->nbtsock, ctx, release); + if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { + printf("No response from %s for name release\n", ctx->address); + return False; + } + if (!NT_STATUS_IS_OK(status)) { + printf("Bad response from %s for name query - %s\n", + ctx->address, nt_errstr(status)); + return False; + } + CHECK_VALUE(release->out.rcode, 0); + } +done: + if (!ret) { + printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line); + return ret; + } + } + + return ret; +} + /* test WINS replication operations @@ -5194,7 +5840,8 @@ BOOL torture_nbt_winsreplication(void) ret &= test_conflict_same_owner(ctx); ret &= test_conflict_different_owner(ctx); - ret &= test_conflict_owned_vs_replica(ctx); + ret &= test_conflict_owned_released_vs_replica(ctx); + ret &= test_conflict_owned_active_vs_replica(ctx); talloc_free(mem_ctx); -- cgit From 7675309bd717a1dd3a48069bc1e4b6c9a7603c69 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 31 Oct 2005 10:14:05 +0000 Subject: r11415: - create a seperate nbt socket for handling incoming packets - remove useless .release attribute, we have seperate tests for this now - add first owned,active vs. replica test, including handling incoming name queries from the server metze (This used to be commit 7843b6c5c84b7543fd30242e0d5c8414b56fd383) --- source4/torture/nbt/winsreplication.c | 385 +++++++++++++++++++++------------- 1 file changed, 234 insertions(+), 151 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 0dd74aa258..916733d3e8 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -23,7 +23,9 @@ #include "includes.h" #include "libcli/nbt/libnbt.h" #include "libcli/wrepl/winsrepl.h" +#include "lib/events/events.h" #include "lib/socket/socket.h" +#include "system/time.h" #define CHECK_STATUS(status, correct) do { \ if (!NT_STATUS_EQUAL(status, correct)) { \ @@ -330,7 +332,8 @@ struct test_wrepl_conflict_conn { const char *myaddr; struct nbt_name_socket *nbtsock; - BOOL nbt_root_port; + + struct nbt_name_socket *nbtsock_srv; uint32_t addresses_1_num; struct wrepl_ip *addresses_1; @@ -443,18 +446,22 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem talloc_free(pull_table.out.partners); + ctx->myaddr = talloc_strdup(mem_ctx, iface_best_ip(address)); + if (!ctx->myaddr) return NULL; + ctx->nbtsock = nbt_name_socket_init(ctx, NULL); if (!ctx->nbtsock) return NULL; - ctx->myaddr = talloc_strdup(mem_ctx, iface_best_ip(address)); - if (!ctx->myaddr) return NULL; + status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0, 0); + if (!NT_STATUS_IS_OK(status)) return NULL; - status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, lp_nbt_port(), 0, 0); + ctx->nbtsock_srv = nbt_name_socket_init(ctx, NULL); + if (!ctx->nbtsock_srv) return NULL; + + status = socket_listen(ctx->nbtsock_srv->sock, ctx->myaddr, lp_nbt_port(), 0, 0); if (!NT_STATUS_IS_OK(status)) { - status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0, 0); - if (!NT_STATUS_IS_OK(status)) return NULL; - } else { - ctx->nbt_root_port = True; + talloc_free(ctx->nbtsock_srv); + ctx->nbtsock_srv = NULL; } ctx->addresses_1_num = 1; @@ -3840,7 +3847,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c BOOL mhomed; uint32_t num_ips; const struct wrepl_ip *ips; - BOOL release; BOOL apply_expected; } wins; struct { @@ -3864,7 +3870,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -3888,7 +3893,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -3912,7 +3916,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -3936,7 +3939,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -3960,7 +3962,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -3984,7 +3985,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4008,7 +4008,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4032,7 +4031,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4056,7 +4054,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4080,7 +4077,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4104,7 +4100,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4128,7 +4123,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4152,7 +4146,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4176,7 +4169,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4200,7 +4192,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4224,7 +4215,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4248,7 +4238,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4272,7 +4261,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4296,7 +4284,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4320,7 +4307,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4344,7 +4330,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4368,7 +4353,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4392,7 +4376,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4416,7 +4399,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4440,7 +4422,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4464,7 +4445,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4488,7 +4468,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4512,7 +4491,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4536,7 +4514,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4560,7 +4537,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4584,7 +4560,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4608,7 +4583,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4632,7 +4606,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4656,7 +4629,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4680,7 +4652,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4704,7 +4675,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4728,7 +4698,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4752,7 +4721,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4776,7 +4744,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4800,7 +4767,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4824,7 +4790,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4848,7 +4813,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4872,7 +4836,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4896,7 +4859,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4920,7 +4882,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4944,7 +4905,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4968,7 +4928,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -4992,7 +4951,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -5016,7 +4974,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = True, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -5040,7 +4997,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = True, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -5064,7 +5020,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = True, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -5088,7 +5043,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = True, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -5112,7 +5066,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = True, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -5136,7 +5089,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = True, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -5160,7 +5112,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = True, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -5184,7 +5135,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = True, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -5208,7 +5158,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = True, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -5232,7 +5181,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = True, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -5256,7 +5204,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = True, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -5280,7 +5227,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = True, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -5304,7 +5250,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = True, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -5328,7 +5273,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = True, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -5352,7 +5296,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = True, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -5376,7 +5319,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .mhomed = True, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = True, .apply_expected = True }, .replica= { @@ -5430,27 +5372,26 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope); CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[0].ip); - if (records[i].wins.release) { - release->in.name = records[i].name; - release->in.dest_addr = ctx->address; - release->in.address = records[i].wins.ips[0].ip; - release->in.nb_flags = records[i].wins.nb_flags; - release->in.broadcast = False; - release->in.timeout = 30; - release->in.retries = 0; + /* release the record */ + release->in.name = records[i].name; + release->in.dest_addr = ctx->address; + release->in.address = records[i].wins.ips[0].ip; + release->in.nb_flags = records[i].wins.nb_flags; + release->in.broadcast = False; + release->in.timeout = 30; + release->in.retries = 0; - status = nbt_name_release(ctx->nbtsock, ctx, release); - if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { - printf("No response from %s for name release\n", ctx->address); - return False; - } - if (!NT_STATUS_IS_OK(status)) { - printf("Bad response from %s for name query - %s\n", - ctx->address, nt_errstr(status)); - return False; - } - CHECK_VALUE(release->out.rcode, 0); + status = nbt_name_release(ctx->nbtsock, ctx, release); + if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { + printf("No response from %s for name release\n", ctx->address); + return False; } + if (!NT_STATUS_IS_OK(status)) { + printf("Bad response from %s for name query - %s\n", + ctx->address, nt_errstr(status)); + return False; + } + CHECK_VALUE(release->out.rcode, 0); /* * Setup Replica @@ -5515,6 +5456,35 @@ done: return ret; } +struct test_conflict_owned_active_vs_replica_struct { + const char *line; /* just better debugging */ + struct nbt_name name; + struct { + uint32_t nb_flags; + BOOL mhomed; + uint32_t num_ips; + const struct wrepl_ip *ips; + BOOL apply_expected; + } wins; + struct { + uint32_t timeout; + BOOL positive; + } defend; + struct { + enum wrepl_name_type type; + enum wrepl_name_state state; + enum wrepl_name_node node; + BOOL is_static; + uint32_t num_ips; + const struct wrepl_ip *ips; + BOOL apply_expected; + } replica; +}; + +static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock, + struct nbt_name_packet *req_packet, + const struct nbt_peer_socket *src); + static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_conn *ctx) { BOOL ret = True; @@ -5526,42 +5496,23 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con struct nbt_name_release release_; struct nbt_name_release *release = &release_; uint32_t i; - struct { - const char *line; /* just better debugging */ - struct nbt_name name; - struct { - uint32_t nb_flags; - BOOL mhomed; - uint32_t num_ips; - const struct wrepl_ip *ips; - BOOL release; - BOOL apply_expected; - } wins; - struct { - enum wrepl_name_type type; - enum wrepl_name_state state; - enum wrepl_name_node node; - BOOL is_static; - uint32_t num_ips; - const struct wrepl_ip *ips; - BOOL apply_expected; - } replica; - } records[] = { -#if 0 + struct test_conflict_owned_active_vs_replica_struct records[] = { /* - * unique,active vs. unique,active with same ip(s) + * unique,active vs. unique,active with same ip(s), unchecked */ { .line = __location__, - .name = _NBT_NAME("_UA_UA_SI", 0x00, NULL), + .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL), .wins = { .nb_flags = 0, .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = False, .apply_expected = True }, + .defend = { + .timeout = 0, + }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, @@ -5573,19 +5524,49 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con }, }, /* - * unique,active vs. unique,active with different ip(s) + * unique,active vs. unique,active with different ip(s), positive response + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .positive = True, + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, + /* + * unique,active vs. unique,active with different ip(s), negative response */ { .line = __location__, - .name = _NBT_NAME("_UA_UA_DI", 0x00, NULL), + .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL), .wins = { .nb_flags = 0, .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = False, .apply_expected = True }, + .defend = { + .timeout = 10, + .positive = False, + }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, @@ -5597,19 +5578,21 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con }, }, /* - * unique,active vs. unique,tombstone with same ip(s) + * unique,active vs. unique,tombstone with same ip(s), unchecked */ { .line = __location__, - .name = _NBT_NAME("_UA_UT_SI", 0x00, NULL), + .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL), .wins = { .nb_flags = 0, .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = False, .apply_expected = True }, + .defend = { + .timeout = 0, + }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, @@ -5621,19 +5604,21 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con }, }, /* - * unique,active vs. unique,tombstone with different ip(s) + * unique,active vs. unique,tombstone with different ip(s), unchecked */ { .line = __location__, - .name = _NBT_NAME("_UA_UT_DI", 0x00, NULL), + .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL), .wins = { .nb_flags = 0, .mhomed = False, .num_ips = ctx->addresses_1_num, .ips = ctx->addresses_1, - .release = False, .apply_expected = True }, + .defend = { + .timeout = 0, + }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, @@ -5641,15 +5626,14 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .is_static = False, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = False }, }, -#endif }; if (!ctx) return False; - if (!ctx->nbt_root_port) { + if (!ctx->nbtsock_srv) { printf("SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n", lp_nbt_port()); return True; @@ -5658,9 +5642,16 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con printf("Test Replica records vs. owned active records\n"); for(i=0; ret && i < ARRAY_SIZE(records); i++) { + struct timeval end; + printf("%s => %s\n", nbt_name_string(ctx, &records[i].name), (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE")); + /* Prepare for the current test */ + nbt_set_incoming_handler(ctx->nbtsock_srv, + test_conflict_owned_active_vs_replica_handler, + &records[i]); + /* * Setup Register */ @@ -5692,28 +5683,6 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope); CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[0].ip); - if (records[i].wins.release) { - release->in.name = records[i].name; - release->in.dest_addr = ctx->address; - release->in.address = records[i].wins.ips[0].ip; - release->in.nb_flags = records[i].wins.nb_flags; - release->in.broadcast = False; - release->in.timeout = 30; - release->in.retries = 0; - - status = nbt_name_release(ctx->nbtsock, ctx, release); - if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { - printf("No response from %s for name release\n", ctx->address); - return False; - } - if (!NT_STATUS_IS_OK(status)) { - printf("Bad response from %s for name query - %s\n", - ctx->address, nt_errstr(status)); - return False; - } - CHECK_VALUE(release->out.rcode, 0); - } - /* * Setup Replica */ @@ -5732,6 +5701,17 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con wins_name->unknown = "255.255.255.255"; ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name); + + /* + * wait for the name query, which is handled in + * test_conflict_owned_active_vs_replica_handler() + */ + end = timeval_current_ofs(records[i].defend.timeout,0); + while (records[i].defend.timeout > 0) { + event_loop_once(ctx->nbtsock_srv->event_ctx); + if (timeval_expired(&end)) break; + } + ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, records[i].replica.apply_expected); @@ -5777,6 +5757,109 @@ done: return ret; } +static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock, + struct nbt_name_packet *req_packet, + const struct nbt_peer_socket *src) +{ + struct nbt_name *name; + struct nbt_name_packet *rep_packet; + struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private; + + switch (req_packet->operation & NBT_OPCODE) { + case NBT_OPCODE_QUERY: + break; + default: + printf("%s: unexpected incoming packet\n", __location__); + return; + } + +#define _NBT_ASSERT(v, correct) do { \ + if ((v) != (correct)) { \ + printf("(%s) Incorrect value %s=%d - should be %s (%d)\n", \ + __location__, #v, v, #correct, correct); \ + return; \ + } \ +} while (0) + + _NBT_ASSERT(req_packet->qdcount, 1); + _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS); + _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP); + + name = &req_packet->questions[0].name; + +#define _NBT_ASSERT_STRING(v, correct) do { \ + if ( ((!v) && (correct)) || \ + ((v) && (!correct)) || \ + ((v) && (correct) && strcmp(v,correct) != 0)) { \ + printf("(%s) Incorrect value %s=%s - should be %s\n", \ + __location__, #v, v, correct); \ + return; \ + } \ +} while (0) + + _NBT_ASSERT(name->type, rec->name.type); + _NBT_ASSERT_STRING(name->name, rec->name.name); + _NBT_ASSERT_STRING(name->scope, rec->name.scope); + + rep_packet = talloc_zero(nbtsock, struct nbt_name_packet); + if (rep_packet == NULL) return; + + rep_packet->name_trn_id = req_packet->name_trn_id; + rep_packet->ancount = 1; + + rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1); + if (rep_packet->answers == NULL) return; + + rep_packet->answers[0].name = *name; + rep_packet->answers[0].rr_type = NBT_QTYPE_NULL; + rep_packet->answers[0].rr_class = NBT_QCLASS_IP; + rep_packet->answers[0].ttl = 0; + + if (rec->defend.positive) { + uint32_t i; + + /* send a positive reply */ + rep_packet->operation = + NBT_FLAG_REPLY | + NBT_OPCODE_QUERY | + NBT_FLAG_AUTHORITIVE | + NBT_FLAG_RECURSION_DESIRED | + NBT_FLAG_RECURSION_AVAIL; + + rep_packet->answers[0].rdata.netbios.length = rec->wins.num_ips*6; + rep_packet->answers[0].rdata.netbios.addresses = + talloc_array(rep_packet->answers, struct nbt_rdata_address, rec->wins.num_ips); + if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return; + + for (i=0; i < rec->wins.num_ips; i++) { + struct nbt_rdata_address *addr = + &rep_packet->answers[0].rdata.netbios.addresses[i]; + addr->nb_flags = rec->wins.nb_flags; + addr->ipaddr = rec->wins.ips[i].ip; + } + DEBUG(2,("Sending positive name query reply for %s to %s:%d\n", + nbt_name_string(rep_packet, name), src->addr, src->port)); + } else { + /* send a negative reply */ + rep_packet->operation = + NBT_FLAG_REPLY | + NBT_OPCODE_QUERY | + NBT_FLAG_AUTHORITIVE | + NBT_RCODE_NAM; + ZERO_STRUCT(rep_packet->answers[0].rdata); + + DEBUG(2,("Sending negative name query reply for %s to %s:%d\n", + nbt_name_string(rep_packet, name), src->addr, src->port)); + } + + nbt_name_reply_send(nbtsock, src, rep_packet); + talloc_free(rep_packet); + + /* make sure we push the reply to the wire */ + event_loop_once(nbtsock->event_ctx); + + rec->defend.timeout = 0; +} /* test WINS replication operations -- cgit From 4400cf2c31da8771ee29972ae095ebab732f594f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 31 Oct 2005 11:05:48 +0000 Subject: r11416: add some more comments metze (This used to be commit dccaceee182066e15e7a4fd9a5f3f0b2e2beda19) --- source4/torture/nbt/winsreplication.c | 51 +++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 916733d3e8..43546305eb 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -3859,6 +3859,9 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c BOOL apply_expected; } replica; } records[] = { +/* + * unique vs. unique section + */ /* * unique,released vs. unique,active with same ip(s) */ @@ -3951,6 +3954,9 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .apply_expected = True }, }, +/* + * unique vs. group section + */ /* * unique,released vs. group,active with same ip(s) */ @@ -4043,6 +4049,9 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .apply_expected = True }, }, +/* + * unique vs. special group section + */ /* * unique,released vs. sgroup,active with same ip(s) */ @@ -4135,6 +4144,9 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .apply_expected = True }, }, +/* + * unique vs. multi homed section + */ /* * unique,released vs. mhomed,active with same ip(s) */ @@ -4227,6 +4239,9 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .apply_expected = True }, }, +/* + * group vs. unique section + */ /* * group,released vs. unique,active with same ip(s) */ @@ -4319,6 +4334,9 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .apply_expected = False }, }, +/* + * group vs. group section + */ /* * group,released vs. group,active with same ip(s) */ @@ -4411,6 +4429,9 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .apply_expected = True }, }, +/* + * group vs. special group section + */ /* * group,released vs. sgroup,active with same ip(s) */ @@ -4503,6 +4524,9 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .apply_expected = False }, }, +/* + * group vs. multi homed section + */ /* * group,released vs. mhomed,active with same ip(s) */ @@ -4595,6 +4619,9 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .apply_expected = False }, }, +/* + * special group vs. unique section + */ /* * sgroup,released vs. unique,active with same ip(s) */ @@ -4687,6 +4714,9 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .apply_expected = True }, }, +/* + * special group vs. group section + */ /* * sgroup,released vs. group,active with same ip(s) */ @@ -4779,6 +4809,9 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .apply_expected = True }, }, +/* + * special group vs. special group section + */ /* * sgroup,released vs. sgroup,active with same ip(s) */ @@ -4871,6 +4904,9 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .apply_expected = True }, }, +/* + * special group vs. multi homed section + */ /* * sgroup,released vs. mhomed,active with same ip(s) */ @@ -4963,6 +4999,9 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .apply_expected = True }, }, +/* + * multi homed vs. unique section + */ /* * mhomed,released vs. unique,active with same ip(s) */ @@ -5055,6 +5094,9 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .apply_expected = True }, }, +/* + * multi homed vs. group section + */ /* * mhomed,released vs. group,active with same ip(s) */ @@ -5147,6 +5189,9 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .apply_expected = True }, }, +/* + * multi homed vs. special group section + */ /* * mhomed,released vs. sgroup,active with same ip(s) */ @@ -5239,6 +5284,9 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .apply_expected = True }, }, +/* + * multi homed vs. multi homed section + */ /* * mhomed,released vs. mhomed,active with same ip(s) */ @@ -5497,6 +5545,9 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con struct nbt_name_release *release = &release_; uint32_t i; struct test_conflict_owned_active_vs_replica_struct records[] = { +/* + * unique vs. unique section + */ /* * unique,active vs. unique,active with same ip(s), unchecked */ -- cgit From bc5e112f5b2e84f20aaf26cc02ac91c1d5c3dc9b Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 31 Oct 2005 13:20:47 +0000 Subject: r11418: - add unique,owned,active vs. normal group section - we handle incoming release demands for that metze (This used to be commit 1db4d8e456895d18a864fa740ec0d8198226cba0) --- source4/torture/nbt/winsreplication.c | 234 ++++++++++++++++++++++++++++++---- 1 file changed, 210 insertions(+), 24 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 43546305eb..3a41033a67 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -5517,6 +5517,8 @@ struct test_conflict_owned_active_vs_replica_struct { struct { uint32_t timeout; BOOL positive; + BOOL expect_release; + BOOL ret; } defend; struct { enum wrepl_name_type type; @@ -5680,6 +5682,115 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .apply_expected = False }, }, +/* + * unique vs. group section + */ + /* + * unique,active vs. group,active with same ip(s), release expected + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .expect_release = True, + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * unique,active vs. group,active with different ip(s), release expected + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .expect_release = True, + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * unique,active vs. group,tombstone with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * unique,active vs. group,tombstone with different ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, }; if (!ctx) return False; @@ -5758,10 +5869,12 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con * test_conflict_owned_active_vs_replica_handler() */ end = timeval_current_ofs(records[i].defend.timeout,0); + records[i].defend.ret = True; while (records[i].defend.timeout > 0) { event_loop_once(ctx->nbtsock_srv->event_ctx); if (timeval_expired(&end)) break; } + ret &= records[i].defend.ret; ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, records[i].replica.apply_expected); @@ -5798,6 +5911,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con } CHECK_VALUE(release->out.rcode, 0); } + done: if (!ret) { printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line); @@ -5808,22 +5922,6 @@ done: return ret; } -static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock, - struct nbt_name_packet *req_packet, - const struct nbt_peer_socket *src) -{ - struct nbt_name *name; - struct nbt_name_packet *rep_packet; - struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private; - - switch (req_packet->operation & NBT_OPCODE) { - case NBT_OPCODE_QUERY: - break; - default: - printf("%s: unexpected incoming packet\n", __location__); - return; - } - #define _NBT_ASSERT(v, correct) do { \ if ((v) != (correct)) { \ printf("(%s) Incorrect value %s=%d - should be %s (%d)\n", \ @@ -5832,12 +5930,6 @@ static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket } \ } while (0) - _NBT_ASSERT(req_packet->qdcount, 1); - _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS); - _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP); - - name = &req_packet->questions[0].name; - #define _NBT_ASSERT_STRING(v, correct) do { \ if ( ((!v) && (correct)) || \ ((v) && (!correct)) || \ @@ -5848,10 +5940,26 @@ static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket } \ } while (0) +static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock, + struct nbt_name_packet *req_packet, + const struct nbt_peer_socket *src) +{ + struct nbt_name *name; + struct nbt_name_packet *rep_packet; + struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private; + + _NBT_ASSERT(req_packet->qdcount, 1); + _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS); + _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP); + + name = &req_packet->questions[0].name; + _NBT_ASSERT(name->type, rec->name.type); _NBT_ASSERT_STRING(name->name, rec->name.name); _NBT_ASSERT_STRING(name->scope, rec->name.scope); + _NBT_ASSERT(rec->defend.expect_release, False); + rep_packet = talloc_zero(nbtsock, struct nbt_name_packet); if (rep_packet == NULL) return; @@ -5862,7 +5970,6 @@ static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket if (rep_packet->answers == NULL) return; rep_packet->answers[0].name = *name; - rep_packet->answers[0].rr_type = NBT_QTYPE_NULL; rep_packet->answers[0].rr_class = NBT_QCLASS_IP; rep_packet->answers[0].ttl = 0; @@ -5877,6 +5984,8 @@ static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket NBT_FLAG_RECURSION_DESIRED | NBT_FLAG_RECURSION_AVAIL; + rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS; + rep_packet->answers[0].rdata.netbios.length = rec->wins.num_ips*6; rep_packet->answers[0].rdata.netbios.addresses = talloc_array(rep_packet->answers, struct nbt_rdata_address, rec->wins.num_ips); @@ -5897,6 +6006,9 @@ static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket NBT_OPCODE_QUERY | NBT_FLAG_AUTHORITIVE | NBT_RCODE_NAM; + + rep_packet->answers[0].rr_type = NBT_QTYPE_NULL; + ZERO_STRUCT(rep_packet->answers[0].rdata); DEBUG(2,("Sending negative name query reply for %s to %s:%d\n", @@ -5909,7 +6021,81 @@ static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket /* make sure we push the reply to the wire */ event_loop_once(nbtsock->event_ctx); - rec->defend.timeout = 0; + rec->defend.timeout = 0; + rec->defend.ret = True; +} + +static void test_conflict_owned_active_vs_replica_handler_release(struct nbt_name_socket *nbtsock, + struct nbt_name_packet *req_packet, + const struct nbt_peer_socket *src) +{ + struct nbt_name *name; + struct nbt_name_packet *rep_packet; + struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private; + + _NBT_ASSERT(req_packet->qdcount, 1); + _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS); + _NBT_ASSERT(req_packet->questions[0].question_class, NBT_QCLASS_IP); + + name = &req_packet->questions[0].name; + + _NBT_ASSERT(name->type, rec->name.type); + _NBT_ASSERT_STRING(name->name, rec->name.name); + _NBT_ASSERT_STRING(name->scope, rec->name.scope); + + _NBT_ASSERT(rec->defend.expect_release, True); + + rep_packet = talloc_zero(nbtsock, struct nbt_name_packet); + if (rep_packet == NULL) return; + + rep_packet->name_trn_id = req_packet->name_trn_id; + rep_packet->ancount = 1; + rep_packet->operation = + NBT_FLAG_REPLY | + NBT_OPCODE_RELEASE | + NBT_FLAG_AUTHORITIVE; + + rep_packet->answers = talloc_array(rep_packet, struct nbt_res_rec, 1); + if (rep_packet->answers == NULL) return; + + rep_packet->answers[0].name = *name; + rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS; + rep_packet->answers[0].rr_class = NBT_QCLASS_IP; + rep_packet->answers[0].ttl = req_packet->additional[0].ttl; + rep_packet->answers[0].rdata = req_packet->additional[0].rdata; + + DEBUG(2,("Sending name release reply for %s to %s:%d\n", + nbt_name_string(rep_packet, name), src->addr, src->port)); + + nbt_name_reply_send(nbtsock, src, rep_packet); + talloc_free(rep_packet); + + /* make sure we push the reply to the wire */ + event_loop_once(nbtsock->event_ctx); + + rec->defend.timeout = 0; + rec->defend.ret = True; +} + +static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock, + struct nbt_name_packet *req_packet, + const struct nbt_peer_socket *src) +{ + struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private; + + rec->defend.ret = False; + + switch (req_packet->operation & NBT_OPCODE) { + case NBT_OPCODE_QUERY: + test_conflict_owned_active_vs_replica_handler_query(nbtsock, req_packet, src); + break; + case NBT_OPCODE_RELEASE: + test_conflict_owned_active_vs_replica_handler_release(nbtsock, req_packet, src); + break; + default: + printf("%s: unexpected incoming packet\n", __location__); + return; + } } /* -- cgit From f07cb3f35fd154b016ea5c38f9a3aff4c60181b9 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 31 Oct 2005 18:19:43 +0000 Subject: r11419: add owned,unique,active vs. special group replica section metze (This used to be commit 061e2e67daeb920b2613564814738adc56c58017) --- source4/torture/nbt/winsreplication.c | 109 ++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 3a41033a67..d984ca4a80 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -5791,6 +5791,115 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .apply_expected = False }, }, +/* + * unique vs. special group section + */ + /* + * unique,active vs. sgroup,active with same ip(s), release expected + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .expect_release = True, + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * unique,active vs. group,active with different ip(s), release expected + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .expect_release = True, + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * unique,active vs. sgroup,tombstone with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * unique,active vs. sgroup,tombstone with different ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, }; if (!ctx) return False; -- cgit From e173352f1b44dd2c3f6ed1bd692c862cb4cfdf57 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 31 Oct 2005 21:51:53 +0000 Subject: r11425: add owned,active,unique vs. multi homed section metze (This used to be commit a70cf6f87b975861bb7af4080c56f146faf3369d) --- source4/torture/nbt/winsreplication.c | 135 ++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index d984ca4a80..e5238b2d73 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -5900,6 +5900,141 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .apply_expected = False }, }, +/* + * unique vs. multi homed section + */ + /* + * unique,active vs. mhomed,active with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * unique,active vs. mhomed,active with different ip(s), positive response + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .positive = True, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, + /* + * unique,active vs. mhomed,active with different ip(s), negative response + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .positive = False, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * unique,active vs. mhomed,tombstone with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * unique,active vs. mhomed,tombstone with different ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, }; if (!ctx) return False; -- cgit From 18a98ecd7a7ae0a6df0a1f8d29e5e560de90b8b9 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 31 Oct 2005 22:25:29 +0000 Subject: r11426: add owned,active,normalgroup vs. * replica sections metze (This used to be commit 70166bb2a9085e08915fc0f560e660b7edd0c2b3) --- source4/torture/nbt/winsreplication.c | 428 ++++++++++++++++++++++++++++++++++ 1 file changed, 428 insertions(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index e5238b2d73..1a72a18116 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -6035,6 +6035,434 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .apply_expected = False }, }, +/* + * normal group vs. unique section + */ + /* + * group,active vs. unique,active with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * group,active vs. unique,active with different ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, + /* + * group,active vs. unique,tombstone with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * group,active vs. unique,tombstone with different ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, +/* + * normal group vs. normal group section + */ + /* + * group,active vs. group,active with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + }, + /* + * group,active vs. group,active with different ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * group,active vs. group,tombstone with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * group,active vs. group,tombstone with different ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, +/* + * normal group vs. special group section + */ + /* + * group,active vs. sgroup,active with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * group,active vs. sgroup,active with different ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = False + }, + }, + /* + * group,active vs. sgroup,tombstone with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * group,active vs. sgroup,tombstone with different ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = False + }, + }, +/* + * normal group vs. multi homed section + */ + /* + * group,active vs. mhomed,active with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * group,active vs. mhomed,active with different ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = False + }, + }, + /* + * group,active vs. mhomed,tombstone with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * group,active vs. mhomed,tombstone with different ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = False + }, + }, }; if (!ctx) return False; -- cgit From 187b7a9e538e52f88db35a32f9ec8afcac7152a8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 31 Oct 2005 22:48:58 +0000 Subject: r11429: - add owned,active,sgroup vs. unique, group and mhomed replica special group vs. special group will be done later metze (This used to be commit 25a35c697795ff802d735cfd3e6c11ea73d92126) --- source4/torture/nbt/winsreplication.c | 321 ++++++++++++++++++++++++++++++++++ 1 file changed, 321 insertions(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 1a72a18116..fb09c50f65 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -6463,6 +6463,327 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .apply_expected = False }, }, +/* + * special group vs. unique section + */ + /* + * sgroup,active vs. unique,active with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_SA_UA_SI_U", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * sgroup,active vs. unique,active with different ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_SA_UA_DI_U", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, + /* + * sgroup,active vs. unique,tombstone with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_SA_UT_SI_U", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * sgroup,active vs. unique,tombstone with different ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_SA_UT_DI_U", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, +/* + * special group vs. normal group section + */ + /* + * sgroup,active vs. group,active with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_SA_GA_SI_U", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * sgroup,active vs. group,active with different ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_SA_GA_DI_U", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, + /* + * sgroup,active vs. group,tombstone with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_SA_GT_SI_U", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * sgroup,active vs. group,tombstone with different ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_SA_GT_DI_U", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, +/* + * special group vs. multi homed section + */ + /* + * sgroup,active vs. mhomed,active with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_SA_MA_SI_U", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * sgroup,active vs. mhomed,active with different ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_SA_MA_DI_U", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, + /* + * sgroup,active vs. mhomed,tombstone with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_SA_MT_SI_U", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = False + }, + }, + /* + * sgroup,active vs. mhomed,tombstone with different ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_SA_MT_DI_U", 0x1C, NULL), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_1_num, + .ips = ctx->addresses_1, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, }; if (!ctx) return False; -- cgit From 580cfbb23ad22c401c7810c43179616fc34f1ce5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 2 Nov 2005 15:56:24 +0000 Subject: r11478: add owned,active,multi homed vs. * section metze (This used to be commit 0231926e0a017bb65a900867a6dee7ca52d7ffe9) --- source4/torture/nbt/winsreplication.c | 1234 ++++++++++++++++++++++++--------- 1 file changed, 893 insertions(+), 341 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index fb09c50f65..b04dee8df0 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -335,8 +335,11 @@ struct test_wrepl_conflict_conn { struct nbt_name_socket *nbtsock_srv; - uint32_t addresses_1_num; - struct wrepl_ip *addresses_1; + uint32_t addresses_best_num; + struct wrepl_ip *addresses_best; + + uint32_t addresses_all_num; + struct wrepl_ip *addresses_all; }; static const struct wrepl_ip addresses_A_1[] = { @@ -464,11 +467,20 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem ctx->nbtsock_srv = NULL; } - ctx->addresses_1_num = 1; - ctx->addresses_1 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_1_num); - if (!ctx->addresses_1) return NULL; - ctx->addresses_1[0].owner = ctx->c.address; - ctx->addresses_1[0].ip = ctx->myaddr; + ctx->addresses_best_num = 1; + ctx->addresses_best = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best_num); + if (!ctx->addresses_best) return NULL; + ctx->addresses_best[0].owner = ctx->c.address; + ctx->addresses_best[0].ip = ctx->myaddr; + + ctx->addresses_all_num = iface_count(); + ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num); + if (!ctx->addresses_all) return NULL; + for (i=0; i < ctx->addresses_all_num; i++) { + ctx->addresses_all[i].owner = ctx->c.address; + ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(i)); + if (!ctx->addresses_all[i].ip) return NULL; + } return ctx; } @@ -3871,8 +3883,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -3880,8 +3892,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -3894,8 +3906,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -3917,8 +3929,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -3926,8 +3938,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -3940,8 +3952,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -3966,8 +3978,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -3975,8 +3987,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -3989,8 +4001,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4012,8 +4024,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4021,8 +4033,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -4035,8 +4047,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4061,8 +4073,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4070,8 +4082,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -4084,8 +4096,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4107,8 +4119,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4116,8 +4128,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -4130,8 +4142,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4156,8 +4168,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4165,8 +4177,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -4179,8 +4191,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4202,8 +4214,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4211,8 +4223,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -4225,8 +4237,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4251,8 +4263,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4260,8 +4272,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -4274,8 +4286,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4297,8 +4309,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4306,8 +4318,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -4320,8 +4332,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4346,8 +4358,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4355,8 +4367,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -4369,8 +4381,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4392,8 +4404,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4401,8 +4413,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -4415,8 +4427,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4441,8 +4453,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4450,8 +4462,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -4464,8 +4476,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4487,8 +4499,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4496,8 +4508,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -4510,8 +4522,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4536,8 +4548,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4545,8 +4557,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -4559,8 +4571,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4582,8 +4594,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4591,8 +4603,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -4605,8 +4617,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4631,8 +4643,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4640,8 +4652,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -4654,8 +4666,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4677,8 +4689,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4686,8 +4698,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -4700,8 +4712,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4726,8 +4738,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4735,8 +4747,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -4749,8 +4761,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4772,8 +4784,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4781,8 +4793,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -4795,8 +4807,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4821,8 +4833,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4830,8 +4842,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -4844,8 +4856,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4867,8 +4879,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4876,8 +4888,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -4890,8 +4902,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4916,8 +4928,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4925,8 +4937,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -4939,8 +4951,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4962,8 +4974,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -4971,8 +4983,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -4985,8 +4997,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -5011,8 +5023,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = True, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -5020,8 +5032,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -5034,8 +5046,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = True, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -5057,8 +5069,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = True, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -5066,8 +5078,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -5080,8 +5092,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = True, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -5106,8 +5118,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = True, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -5115,8 +5127,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -5129,8 +5141,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = True, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -5152,8 +5164,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = True, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -5161,8 +5173,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -5175,8 +5187,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = True, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -5201,8 +5213,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = True, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -5210,8 +5222,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -5224,8 +5236,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = True, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -5247,8 +5259,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = True, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -5256,8 +5268,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -5270,8 +5282,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = True, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -5296,8 +5308,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = True, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -5305,8 +5317,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -5319,8 +5331,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = True, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -5342,8 +5354,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = True, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -5351,8 +5363,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -5365,8 +5377,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .wins = { .nb_flags = 0, .mhomed = True, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .replica= { @@ -5559,8 +5571,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -5571,8 +5583,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -5585,8 +5597,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -5612,8 +5624,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -5639,8 +5651,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -5651,8 +5663,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -5665,8 +5677,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -5694,8 +5706,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -5707,8 +5719,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -5721,8 +5733,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -5748,8 +5760,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -5760,8 +5772,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -5774,8 +5786,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -5803,8 +5815,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -5816,8 +5828,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -5830,8 +5842,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -5857,8 +5869,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -5869,8 +5881,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -5883,8 +5895,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -5912,8 +5924,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -5924,8 +5936,34 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + }, + /* + * unique,active vs. mhomed,active with superset ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_MA_SP_U", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_all_num, + .ips = ctx->addresses_all, .apply_expected = True }, }, @@ -5938,8 +5976,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -5951,8 +5989,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, .apply_expected = False }, }, @@ -5965,8 +6003,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -5978,8 +6016,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, .apply_expected = True }, }, @@ -5992,8 +6030,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6004,8 +6042,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -6018,8 +6056,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = 0, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6030,8 +6068,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, .apply_expected = False }, }, @@ -6047,8 +6085,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6059,8 +6097,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -6073,8 +6111,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6099,8 +6137,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6111,8 +6149,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -6125,8 +6163,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6154,8 +6192,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6166,8 +6204,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, }, @@ -6180,8 +6218,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6206,8 +6244,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6218,8 +6256,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -6232,8 +6270,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6261,8 +6299,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6273,8 +6311,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -6287,8 +6325,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6313,8 +6351,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6325,8 +6363,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -6339,8 +6377,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6368,8 +6406,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6380,8 +6418,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -6394,8 +6432,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6420,8 +6458,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6432,8 +6470,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -6446,8 +6484,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6475,8 +6513,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6487,8 +6525,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -6501,8 +6539,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6527,8 +6565,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6539,8 +6577,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -6553,8 +6591,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6582,8 +6620,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6594,8 +6632,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -6608,8 +6646,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6634,8 +6672,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6646,8 +6684,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -6660,8 +6698,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6689,8 +6727,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6701,8 +6739,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -6715,8 +6753,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6741,8 +6779,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6753,8 +6791,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = False }, }, @@ -6767,8 +6805,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .wins = { .nb_flags = NBT_NM_GROUP, .mhomed = False, - .num_ips = ctx->addresses_1_num, - .ips = ctx->addresses_1, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, .apply_expected = True }, .defend = { @@ -6784,6 +6822,520 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .apply_expected = False }, }, +/* + * multi homed vs. unique section + */ + /* + * mhomed,active vs. unique,active with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_UA_SI_U", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + }, + /* + * mhomed,active vs. unique,active with different ip(s), positive response + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_UA_DI_P", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .positive = True, + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, + /* + * mhomed,active vs. unique,active with different ip(s), negative response + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_UA_DI_N", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .positive = False, + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * mhomed,active vs. unique,tombstone with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_UT_SI_U", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = False + }, + }, + /* + * mhomed,active vs. unique,tombstone with different ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_UT_DI_U", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, +/* + * multi homed vs. normal group section + */ + /* + * mhomed,active vs. group,active with same ip(s), release expected + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_GA_SI_R", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .expect_release = True, + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + }, + /* + * mhomed,active vs. group,active with different ip(s), release expected + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_GA_DI_R", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .expect_release = True, + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * mhomed,active vs. group,tombstone with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_GT_SI_U", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = False + }, + }, + /* + * mhomed,active vs. group,tombstone with different ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_GT_DI_U", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_GROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, +/* + * multi homed vs. special group section + */ + /* + * mhomed,active vs. sgroup,active with same ip(s), release expected + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_SA_SI_R", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .expect_release = True, + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + }, + /* + * mhomed,active vs. group,active with different ip(s), release expected + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_SA_DI_R", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .expect_release = True, + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + }, + /* + * mhomed,active vs. sgroup,tombstone with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_ST_SI_U", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = False + }, + }, + /* + * mhomed,active vs. sgroup,tombstone with different ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_ST_DI_U", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, +/* + * multi homed vs. multi homed section + */ + /* + * mhomed,active vs. mhomed,active with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_MA_SI_U", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + }, + /* + * mhomed,active vs. mhomed,active with superset ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_all_num, + .ips = ctx->addresses_all, + .apply_expected = True + }, + }, + /* + * mhomed,active vs. mhomed,active with different ip(s), positive response + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_MA_DI_P", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .positive = True, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, + /* + * mhomed,active vs. mhomed,active with different ip(s), negative response + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_MA_DI_N", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .positive = False, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = True + }, + }, + /* + * mhomed,active vs. mhomed,tombstone with same ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_MT_SI_U", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = False + }, + }, + /* + * mhomed,active vs. mhomed,tombstone with different ip(s), unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_MT_DI_U", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = False + }, + }, }; if (!ctx) return False; -- cgit From 36729384f3139fa5cb42799b257df0b8525c5e0d Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 2 Nov 2005 17:15:17 +0000 Subject: r11480: demonstrate the only the positive name query response cares, not the addresses that are returned in it metze (This used to be commit 82e19d68086e795d68cd11eda21448f695aac0a3) --- source4/torture/nbt/winsreplication.c | 142 ++++++++++++++++++++++++++++++++-- 1 file changed, 135 insertions(+), 7 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index b04dee8df0..d66be53f5f 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -5531,6 +5531,9 @@ struct test_conflict_owned_active_vs_replica_struct { BOOL positive; BOOL expect_release; BOOL ret; + /* when num_ips == 0, then .wins.ips are used */ + uint32_t num_ips; + const struct wrepl_ip *ips; } defend; struct { enum wrepl_name_type type; @@ -5615,6 +5618,35 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .apply_expected = False }, }, + /* + * unique,active vs. unique,active with different ip(s), positive response other ips + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_UA_DI_O", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .positive = True, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, /* * unique,active vs. unique,active with different ip(s), negative response */ @@ -5994,6 +6026,35 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .apply_expected = False }, }, + /* + * unique,active vs. mhomed,active with different ip(s), positive response other ips + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_MA_DI_O", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .positive = True, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = False + }, + }, /* * unique,active vs. mhomed,active with different ip(s), negative response */ @@ -6878,6 +6939,35 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .apply_expected = False }, }, + /* + * mhomed,active vs. unique,active with different ip(s), positive response other ips + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_UA_DI_O", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .positive = True, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + }, /* * mhomed,active vs. unique,active with different ip(s), negative response */ @@ -7252,8 +7342,37 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_1), - .ips = addresses_B_1, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = False + }, + }, + /* + * mhomed,active vs. mhomed,active with different ip(s), positive response other ips + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_MA_DI_O", 0x00, NULL), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .positive = True, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, .apply_expected = False }, }, @@ -7519,7 +7638,16 @@ static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_ rep_packet->answers[0].ttl = 0; if (rec->defend.positive) { - uint32_t i; + uint32_t i, num_ips; + const struct wrepl_ip *ips; + + if (rec->defend.num_ips > 0) { + num_ips = rec->defend.num_ips; + ips = rec->defend.ips; + } else { + num_ips = rec->wins.num_ips; + ips = rec->wins.ips; + } /* send a positive reply */ rep_packet->operation = @@ -7531,16 +7659,16 @@ static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_ rep_packet->answers[0].rr_type = NBT_QTYPE_NETBIOS; - rep_packet->answers[0].rdata.netbios.length = rec->wins.num_ips*6; + rep_packet->answers[0].rdata.netbios.length = num_ips*6; rep_packet->answers[0].rdata.netbios.addresses = - talloc_array(rep_packet->answers, struct nbt_rdata_address, rec->wins.num_ips); + talloc_array(rep_packet->answers, struct nbt_rdata_address, num_ips); if (rep_packet->answers[0].rdata.netbios.addresses == NULL) return; - for (i=0; i < rec->wins.num_ips; i++) { + for (i=0; i < num_ips; i++) { struct nbt_rdata_address *addr = &rep_packet->answers[0].rdata.netbios.addresses[i]; addr->nb_flags = rec->wins.nb_flags; - addr->ipaddr = rec->wins.ips[i].ip; + addr->ipaddr = ips[i].ip; } DEBUG(2,("Sending positive name query reply for %s to %s:%d\n", nbt_name_string(rep_packet, name), src->addr, src->port)); -- cgit From b69e508381a20304b7809a975830696e1a652a7b Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 3 Nov 2005 13:13:45 +0000 Subject: r11484: test some multi homed record merging metze (This used to be commit 630f571934c1119dc3156a1e4b909fc6d5ae95fc) --- source4/torture/nbt/winsreplication.c | 613 +++++++++++++++++++++++++++++++--- 1 file changed, 563 insertions(+), 50 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index d66be53f5f..94053408eb 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -331,15 +331,24 @@ struct test_wrepl_conflict_conn { struct wrepl_wins_owner a, b, c; const char *myaddr; + const char *myaddr2; struct nbt_name_socket *nbtsock; + struct nbt_name_socket *nbtsock2; struct nbt_name_socket *nbtsock_srv; + struct nbt_name_socket *nbtsock_srv2; uint32_t addresses_best_num; struct wrepl_ip *addresses_best; + uint32_t addresses_best2_num; + struct wrepl_ip *addresses_best2; + uint32_t addresses_all_num; struct wrepl_ip *addresses_all; + + uint32_t addresses_mhomed_num; + struct wrepl_ip *addresses_mhomed; }; static const struct wrepl_ip addresses_A_1[] = { @@ -452,6 +461,13 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem ctx->myaddr = talloc_strdup(mem_ctx, iface_best_ip(address)); if (!ctx->myaddr) return NULL; + for (i = 0; i < iface_count(); i++) { + if (strcmp(ctx->myaddr, iface_n_ip(i)) == 0) continue; + ctx->myaddr2 = talloc_strdup(mem_ctx, iface_n_ip(i)); + if (!ctx->myaddr2) return NULL; + break; + } + ctx->nbtsock = nbt_name_socket_init(ctx, NULL); if (!ctx->nbtsock) return NULL; @@ -467,21 +483,54 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem ctx->nbtsock_srv = NULL; } + if (ctx->myaddr2) { + ctx->nbtsock2 = nbt_name_socket_init(ctx, NULL); + if (!ctx->nbtsock2) return NULL; + + status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0, 0); + if (!NT_STATUS_IS_OK(status)) return NULL; + + ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx); + if (!ctx->nbtsock_srv2) return NULL; + + status = socket_listen(ctx->nbtsock_srv2->sock, ctx->myaddr2, lp_nbt_port(), 0, 0); + if (!NT_STATUS_IS_OK(status)) { + talloc_free(ctx->nbtsock_srv2); + ctx->nbtsock_srv2 = NULL; + } + } + ctx->addresses_best_num = 1; ctx->addresses_best = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best_num); if (!ctx->addresses_best) return NULL; - ctx->addresses_best[0].owner = ctx->c.address; + ctx->addresses_best[0].owner = ctx->b.address; ctx->addresses_best[0].ip = ctx->myaddr; ctx->addresses_all_num = iface_count(); ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num); if (!ctx->addresses_all) return NULL; for (i=0; i < ctx->addresses_all_num; i++) { - ctx->addresses_all[i].owner = ctx->c.address; + ctx->addresses_all[i].owner = ctx->b.address; ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(i)); if (!ctx->addresses_all[i].ip) return NULL; } + if (ctx->nbtsock_srv2) { + ctx->addresses_best2_num = 1; + ctx->addresses_best2 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best2_num); + if (!ctx->addresses_best2) return NULL; + ctx->addresses_best2[0].owner = ctx->b.address; + ctx->addresses_best2[0].ip = ctx->myaddr2; + + ctx->addresses_mhomed_num = 2; + ctx->addresses_mhomed = talloc_array(ctx, struct wrepl_ip, ctx->addresses_mhomed_num); + if (!ctx->addresses_mhomed) return NULL; + ctx->addresses_mhomed[0].owner = ctx->b.address; + ctx->addresses_mhomed[0].ip = ctx->myaddr; + ctx->addresses_mhomed[1].owner = ctx->b.address; + ctx->addresses_mhomed[1].ip = ctx->myaddr2; + } + return ctx; } @@ -674,6 +723,84 @@ done: return ret; } +static BOOL test_wrepl_mhomed_merged(struct test_wrepl_conflict_conn *ctx, + const struct wrepl_wins_owner *owner1, + uint32_t num_ips1, const struct wrepl_ip *ips1, + const struct wrepl_wins_owner *owner2, + uint32_t num_ips2, const struct wrepl_ip *ips2, + const struct wrepl_wins_name *name2) +{ + BOOL ret = True; + NTSTATUS status; + struct wrepl_pull_names pull_names; + struct wrepl_name *names; + uint32_t flags; + uint32_t i, j; + uint32_t num_ips = num_ips1 + num_ips2; + + for (i = 0; i < num_ips2; i++) { + for (j = 0; j < num_ips1; j++) { + if (strcmp(ips2[i].ip,ips1[j].ip) == 0) { + num_ips--; + break; + } + } + } + + pull_names.in.assoc_ctx = ctx->pull_assoc; + pull_names.in.partner = *owner2; + pull_names.in.partner.min_version = pull_names.in.partner.max_version; + + status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names); + CHECK_STATUS(status, NT_STATUS_OK); + CHECK_VALUE(pull_names.out.num_names, 1); + + names = pull_names.out.names; + + flags = WREPL_NAME_FLAGS(names[0].type, + names[0].state, + names[0].node, + names[0].is_static); + CHECK_VALUE(names[0].name.type, name2->name->type); + CHECK_VALUE_STRING(names[0].name.name, name2->name->name); + CHECK_VALUE_STRING(names[0].name.scope, name2->name->scope); + CHECK_VALUE(flags, name2->flags | WREPL_TYPE_MHOMED); + CHECK_VALUE_UINT64(names[0].version_id, name2->id); + + CHECK_VALUE(names[0].num_addresses, num_ips); + + for (i = 0; i < names[0].num_addresses; i++) { + const char *addr = names[0].addresses[i].address; + const char *owner = names[0].addresses[i].owner; + BOOL found = False; + + for (j = 0; j < num_ips2; j++) { + if (strcmp(addr, ips2[j].ip) == 0) { + found = True; + CHECK_VALUE_STRING(owner, owner2->address); + break; + } + } + + if (found) continue; + + for (j = 0; j < num_ips1; j++) { + if (strcmp(addr, ips1[j].ip) == 0) { + found = True; + CHECK_VALUE_STRING(owner, owner1->address); + break; + } + } + + if (found) continue; + + CHECK_VALUE_STRING(addr, "not found in address list"); + } +done: + talloc_free(pull_names.out.names); + return ret; +} + static BOOL test_wrepl_is_merged(struct test_wrepl_conflict_conn *ctx, const struct wrepl_wins_name *name1, const struct wrepl_wins_name *name2) @@ -5518,7 +5645,9 @@ done: struct test_conflict_owned_active_vs_replica_struct { const char *line; /* just better debugging */ + const char *section; /* just better debugging */ struct nbt_name name; + BOOL skip; struct { uint32_t nb_flags; BOOL mhomed; @@ -5543,6 +5672,7 @@ struct test_conflict_owned_active_vs_replica_struct { uint32_t num_ips; const struct wrepl_ip *ips; BOOL apply_expected; + BOOL mhomed_merge; } replica; }; @@ -7455,6 +7585,306 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .apply_expected = False }, }, +/* + * some more multi homed test, including merging + */ + /* + * mhomed,active vs. mhomed,active with superset ip(s), unchecked + */ + { + .line = __location__, + .section= "Test Replica vs. owned active: some more MHOMED combinations", + .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL), + .skip = (ctx->addresses_all_num < 3), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_mhomed_num, + .ips = ctx->addresses_mhomed, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_all_num, + .ips = ctx->addresses_all, + .apply_expected = True + }, + }, + /* + * mhomed,active vs. mhomed,active with same ips, unchecked + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL), + .skip = (ctx->addresses_mhomed_num != 2), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_mhomed_num, + .ips = ctx->addresses_mhomed, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_mhomed_num, + .ips = ctx->addresses_mhomed, + .apply_expected = True + }, + }, + /* + * mhomed,active vs. mhomed,active with subset ip(s), positive response + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL), + .skip = (ctx->addresses_mhomed_num != 2), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_mhomed_num, + .ips = ctx->addresses_mhomed, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .positive = True + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .mhomed_merge = True + }, + }, + /* + * mhomed,active vs. mhomed,active with subset ip(s), positive response, with all addresses + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_MA_SB_A", 0x00, NULL), + .skip = (ctx->addresses_all_num < 3), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_mhomed_num, + .ips = ctx->addresses_mhomed, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .positive = True, + .num_ips = ctx->addresses_all_num, + .ips = ctx->addresses_all, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .mhomed_merge = True + }, + }, + /* + * mhomed,active vs. mhomed,active with subset ip(s), positive response, with replicas addresses + * TODO: here we got a release demand for the replica address from the server after doing + * a positive response with the replicas addresses + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_MA_SB_C", 0x00, NULL), + .skip = (True /*ctx->addresses_all_num < 3*/), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_mhomed_num, + .ips = ctx->addresses_mhomed, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .positive = True, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = False + }, + }, + /* + * mhomed,active vs. mhomed,active with subset ip(s), positive response, with other addresses + * TODO: here the record is not applied and the old record becomes released + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL), + + .skip = (True /*ctx->addresses_all_num < 3*/), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_mhomed_num, + .ips = ctx->addresses_mhomed, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .positive = True, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = False + }, + }, + /* + * mhomed,active vs. mhomed,active with subset ip(s), negative response + */ + { + .line = __location__, + .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL), + .skip = (ctx->addresses_mhomed_num != 2), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_mhomed_num, + .ips = ctx->addresses_mhomed, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .positive = False + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + }, +/* + * some more multi homed and unique test, including merging + */ + /* + * mhomed,active vs. unique,active with subset ip(s), positive response + */ + { + .line = __location__, + .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations", + .name = _NBT_NAME("_MA_UA_SB_A", 0x00, NULL), + .skip = (ctx->addresses_all_num < 3), + .wins = { + .nb_flags = 0, + .mhomed = True, + .num_ips = ctx->addresses_mhomed_num, + .ips = ctx->addresses_mhomed, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .positive = True, + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .mhomed_merge = True + }, + }, + /* + * unique,active vs. unique,active with different ip(s), positive response, with all addresses + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_UA_DI_A", 0x00, NULL), + .skip = (ctx->addresses_all_num < 3), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .positive = True, + .num_ips = ctx->addresses_all_num, + .ips = ctx->addresses_all, + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_best2_num, + .ips = ctx->addresses_best2, + .mhomed_merge = True, + }, + }, + /* + * unique,active vs. mhomed,active with different ip(s), positive response, with all addresses + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL), + .skip = (ctx->addresses_all_num < 3), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .positive = True, + .num_ips = ctx->addresses_all_num, + .ips = ctx->addresses_all, + }, + .replica= { + .type = WREPL_TYPE_MHOMED, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_best2_num, + .ips = ctx->addresses_best2, + .mhomed_merge = True, + }, + }, }; if (!ctx) return False; @@ -7469,45 +7899,111 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con for(i=0; ret && i < ARRAY_SIZE(records); i++) { struct timeval end; + struct test_conflict_owned_active_vs_replica_struct record = records[i]; + uint32_t j, count = 1; + const char *action; - printf("%s => %s\n", nbt_name_string(ctx, &records[i].name), - (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE")); + if (records[i].wins.mhomed) { + count = records[i].wins.num_ips; + } - /* Prepare for the current test */ + if (records[i].section) { + printf("%s\n", records[i].section); + } + + if (records[i].skip) { + printf("%s => SKIPPED\n", nbt_name_string(ctx, &records[i].name)); + continue; + } + + if (records[i].replica.mhomed_merge) { + action = "MHOMED_MERGE"; + } else if (records[i].replica.apply_expected) { + action = "REPLACE"; + } else { + action = "NOT REPLACE"; + } + + printf("%s => %s\n", nbt_name_string(ctx, &records[i].name), action); + + /* Prepare for multi homed registration */ + ZERO_STRUCT(records[i].defend); + records[i].defend.timeout = 10; + records[i].defend.positive = True; nbt_set_incoming_handler(ctx->nbtsock_srv, test_conflict_owned_active_vs_replica_handler, &records[i]); + if (ctx->nbtsock_srv2) { + nbt_set_incoming_handler(ctx->nbtsock_srv2, + test_conflict_owned_active_vs_replica_handler, + &records[i]); + } /* * Setup Register */ - name_register->in.name = records[i].name; - name_register->in.dest_addr = ctx->address; - name_register->in.address = records[i].wins.ips[0].ip; - name_register->in.nb_flags = records[i].wins.nb_flags; - name_register->in.register_demand= False; - name_register->in.broadcast = False; - name_register->in.multi_homed = records[i].wins.mhomed; - name_register->in.ttl = 300000; - name_register->in.timeout = 70; - name_register->in.retries = 0; + for (j=0; j < count; j++) { + struct nbt_name_request *req; + + name_register->in.name = records[i].name; + name_register->in.dest_addr = ctx->address; + name_register->in.address = records[i].wins.ips[j].ip; + name_register->in.nb_flags = records[i].wins.nb_flags; + name_register->in.register_demand= False; + name_register->in.broadcast = False; + name_register->in.multi_homed = records[i].wins.mhomed; + name_register->in.ttl = 300000; + name_register->in.timeout = 70; + name_register->in.retries = 0; + + req = nbt_name_register_send(ctx->nbtsock, name_register); + + /* push the request on the wire */ + event_loop_once(ctx->nbtsock->event_ctx); + + /* + * if we register multiple addresses, + * the server will do name queries to see if the old addresses + * are still alive + */ + if (j > 0) { + end = timeval_current_ofs(records[i].defend.timeout,0); + records[i].defend.ret = True; + while (records[i].defend.timeout > 0) { + event_loop_once(ctx->nbtsock_srv->event_ctx); + if (timeval_expired(&end)) break; + } + ret &= records[i].defend.ret; + } - status = nbt_name_register(ctx->nbtsock, ctx, name_register); - if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { - printf("No response from %s for name register\n", ctx->address); - ret = False; + status = nbt_name_register_recv(req, ctx, name_register); + if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { + printf("No response from %s for name register\n", ctx->address); + ret = False; + } + if (!NT_STATUS_IS_OK(status)) { + printf("Bad response from %s for name register - %s\n", + ctx->address, nt_errstr(status)); + ret = False; + } + CHECK_VALUE(name_register->out.rcode, 0); + CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address); + CHECK_VALUE(name_register->out.name.type, records[i].name.type); + CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name); + CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope); + CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[j].ip); } - if (!NT_STATUS_IS_OK(status)) { - printf("Bad response from %s for name register - %s\n", - ctx->address, nt_errstr(status)); - ret = False; + + /* Prepare for the current test */ + records[i].defend = record.defend; + nbt_set_incoming_handler(ctx->nbtsock_srv, + test_conflict_owned_active_vs_replica_handler, + &records[i]); + if (ctx->nbtsock_srv2) { + nbt_set_incoming_handler(ctx->nbtsock_srv2, + test_conflict_owned_active_vs_replica_handler, + &records[i]); } - CHECK_VALUE(name_register->out.rcode, 0); - CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address); - CHECK_VALUE(name_register->out.name.type, records[i].name.type); - CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name); - CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope); - CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[0].ip); /* * Setup Replica @@ -7540,10 +8036,19 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con } ret &= records[i].defend.ret; - ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, - records[i].replica.apply_expected); + if (records[i].replica.mhomed_merge) { + ret &= test_wrepl_mhomed_merged(ctx, &ctx->c, + records[i].wins.num_ips, records[i].wins.ips, + &ctx->b, + records[i].replica.num_ips, records[i].replica.ips, + wins_name); + } else { + ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, + records[i].replica.apply_expected); + } - if (records[i].replica.apply_expected) { + if (records[i].replica.apply_expected || + records[i].replica.mhomed_merge) { wins_name->name = &records[i].name; wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE, WREPL_STATE_TOMBSTONE, @@ -7555,25 +8060,33 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name); ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True); } else { - release->in.name = records[i].name; - release->in.dest_addr = ctx->address; - release->in.address = records[i].wins.ips[0].ip; - release->in.nb_flags = records[i].wins.nb_flags; - release->in.broadcast = False; - release->in.timeout = 30; - release->in.retries = 0; - - status = nbt_name_release(ctx->nbtsock, ctx, release); - if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { - printf("No response from %s for name release\n", ctx->address); - return False; + for (j=0; j < count; j++) { + struct nbt_name_socket *nbtsock = ctx->nbtsock; + + if (ctx->myaddr && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2) == 0) { + nbtsock = ctx->nbtsock2; + } + + release->in.name = records[i].name; + release->in.dest_addr = ctx->address; + release->in.address = records[i].wins.ips[j].ip; + release->in.nb_flags = records[i].wins.nb_flags; + release->in.broadcast = False; + release->in.timeout = 30; + release->in.retries = 0; + + status = nbt_name_release(nbtsock, ctx, release); + if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { + printf("No response from %s for name release\n", ctx->address); + return False; + } + if (!NT_STATUS_IS_OK(status)) { + printf("Bad response from %s for name query - %s\n", + ctx->address, nt_errstr(status)); + return False; + } + CHECK_VALUE(release->out.rcode, 0); } - if (!NT_STATUS_IS_OK(status)) { - printf("Bad response from %s for name query - %s\n", - ctx->address, nt_errstr(status)); - return False; - } - CHECK_VALUE(release->out.rcode, 0); } done: -- cgit From 0a4de40a0b0a054e8b825621c6a78e67ad20ea51 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 3 Nov 2005 19:12:36 +0000 Subject: r11488: handle the stupid name release demand a windows there send... metze (This used to be commit 1b62959a3dd11fface6642e5843224752e188b4a) --- source4/torture/nbt/winsreplication.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 94053408eb..8ef1cf5c15 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -5659,6 +5659,7 @@ struct test_conflict_owned_active_vs_replica_struct { uint32_t timeout; BOOL positive; BOOL expect_release; + BOOL late_release; BOOL ret; /* when num_ips == 0, then .wins.ips are used */ uint32_t num_ips; @@ -7703,13 +7704,13 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con }, /* * mhomed,active vs. mhomed,active with subset ip(s), positive response, with replicas addresses - * TODO: here we got a release demand for the replica address from the server after doing - * a positive response with the replicas addresses + * TODO: check why the server sends a name release demand for one address? + * the release demand has no effect to the database record... */ { .line = __location__, .name = _NBT_NAME("_MA_MA_SB_C", 0x00, NULL), - .skip = (True /*ctx->addresses_all_num < 3*/), + .skip = (ctx->addresses_all_num < 3), .wins = { .nb_flags = 0, .mhomed = True, @@ -7722,6 +7723,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .positive = True, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, + .late_release = True }, .replica= { .type = WREPL_TYPE_MHOMED, @@ -7735,13 +7737,12 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con }, /* * mhomed,active vs. mhomed,active with subset ip(s), positive response, with other addresses - * TODO: here the record is not applied and the old record becomes released */ { .line = __location__, .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL), - .skip = (True /*ctx->addresses_all_num < 3*/), + .skip = (ctx->addresses_all_num < 3), .wins = { .nb_flags = 0, .mhomed = True, @@ -8036,6 +8037,22 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con } ret &= records[i].defend.ret; + if (records[i].defend.late_release) { + records[i].defend = record.defend; + records[i].defend.expect_release = True; + /* + * wait for the name release demand, which is handled in + * test_conflict_owned_active_vs_replica_handler() + */ + end = timeval_current_ofs(records[i].defend.timeout,0); + records[i].defend.ret = True; + while (records[i].defend.timeout > 0) { + event_loop_once(ctx->nbtsock_srv->event_ctx); + if (timeval_expired(&end)) break; + } + ret &= records[i].defend.ret; + } + if (records[i].replica.mhomed_merge) { ret &= test_wrepl_mhomed_merged(ctx, &ctx->c, records[i].wins.num_ips, records[i].wins.ips, -- cgit From 4f78115d6df2ed1e9d8197b045e721bfe0453b45 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 3 Nov 2005 19:22:01 +0000 Subject: r11489: add the one replication cycle test to NBT-WINSREPLICATION-QUICK metze (This used to be commit fc53eab2f1bdae471ee68c4b67f57b1eb0821f61) --- source4/torture/nbt/winsreplication.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 8ef1cf5c15..4af01ac1c9 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -8326,6 +8326,8 @@ BOOL torture_nbt_winsreplication_quick(void) ret &= test_assoc_ctx1(mem_ctx, address); ret &= test_assoc_ctx2(mem_ctx, address); + ret &= test_wins_replication(mem_ctx, address); + talloc_free(mem_ctx); return ret; -- cgit From 087577e47b5c8800494b867ef191b228b7eb64f8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 11 Nov 2005 08:02:50 +0000 Subject: r11672: - add support for special group merge tests - add owned,sgroup,active vs. replica,sgroup,active test metze (This used to be commit 938853dc5078a0d647d41177375ec8d35d61628b) --- source4/torture/nbt/winsreplication.c | 172 +++++++++++++++++++++++++++++++++- 1 file changed, 170 insertions(+), 2 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 4af01ac1c9..eb09909184 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -801,6 +801,98 @@ done: return ret; } +static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx, + const struct wrepl_wins_owner *owner1, + uint32_t num_ips1, const struct wrepl_ip *ips1, + const struct wrepl_wins_owner *owner2, + uint32_t num_ips2, const struct wrepl_ip *ips2, + const struct wrepl_wins_name *name2) +{ + BOOL ret = True; + NTSTATUS status; + struct wrepl_pull_names pull_names; + struct wrepl_name *names; + struct wrepl_name *name = NULL; + uint32_t flags; + uint32_t i, j; + uint32_t num_ips = num_ips1 + num_ips2; + + for (i = 0; i < num_ips2; i++) { + for (j = 0; j < num_ips1; j++) { + if (strcmp(ips2[i].ip,ips1[j].ip) == 0) { + num_ips--; + break; + } + } + } + + pull_names.in.assoc_ctx = ctx->pull_assoc; + pull_names.in.partner = *owner1; + pull_names.in.partner.min_version = pull_names.in.partner.max_version; + pull_names.in.partner.max_version = 0; + + status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names); + CHECK_STATUS(status, NT_STATUS_OK); + + names = pull_names.out.names; + + for (i = 0; i < pull_names.out.num_names; i++) { + if (names[i].name.type != name2->name->type) continue; + if (!names[i].name.name) continue; + if (strcmp(names[i].name.name, name2->name->name) != 0) continue; + if (names[i].name.scope) continue; + + name = &names[i]; + } + + if (!name) { + printf("%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name)); + return False; + } + + flags = WREPL_NAME_FLAGS(name->type, + name->state, + name->node, + name->is_static); + CHECK_VALUE(name->name.type, name2->name->type); + CHECK_VALUE_STRING(name->name.name, name2->name->name); + CHECK_VALUE_STRING(name->name.scope, name2->name->scope); + CHECK_VALUE(flags, name2->flags); + + CHECK_VALUE(name->num_addresses, num_ips); + + for (i = 0; i < name->num_addresses; i++) { + const char *addr = name->addresses[i].address; + const char *owner = name->addresses[i].owner; + BOOL found = False; + + for (j = 0; j < num_ips2; j++) { + if (strcmp(addr, ips2[j].ip) == 0) { + found = True; + CHECK_VALUE_STRING(owner, owner2->address); + break; + } + } + + if (found) continue; + + for (j = 0; j < num_ips1; j++) { + if (strcmp(addr, ips1[j].ip) == 0) { + found = True; + CHECK_VALUE_STRING(owner, owner1->address); + break; + } + } + + if (found) continue; + + CHECK_VALUE_STRING(addr, "not found in address list"); + } +done: + talloc_free(pull_names.out.names); + return ret; +} + static BOOL test_wrepl_is_merged(struct test_wrepl_conflict_conn *ctx, const struct wrepl_wins_name *name1, const struct wrepl_wins_name *name2) @@ -5674,6 +5766,7 @@ struct test_conflict_owned_active_vs_replica_struct { const struct wrepl_ip *ips; BOOL apply_expected; BOOL mhomed_merge; + BOOL sgroup_merge; } replica; }; @@ -7886,6 +7979,37 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .mhomed_merge = True, }, }, +/* + * special group vs. special group merging section + */ + /* + * sgroup,active vs. sgroup,active with same ip(s) + */ + { + .line = __location__, + .section= "Test Replica vs. owned active: SGROUP vs. SGROUP tests", + .name = _NBT_NAME("_SA_SA_DI_U", 0x1C, NULL), + .skip = (ctx->addresses_all_num < 3), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_mhomed_num, + .ips = ctx->addresses_mhomed, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .sgroup_merge = True + }, + }, }; if (!ctx) return False; @@ -7904,7 +8028,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con uint32_t j, count = 1; const char *action; - if (records[i].wins.mhomed) { + if (records[i].wins.mhomed || records[i].name.type == 0x1C) { count = records[i].wins.num_ips; } @@ -7919,6 +8043,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con if (records[i].replica.mhomed_merge) { action = "MHOMED_MERGE"; + } else if (records[i].replica.sgroup_merge) { + action = "SGROUP_MERGE"; } else if (records[i].replica.apply_expected) { action = "REPLACE"; } else { @@ -7967,7 +8093,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con * the server will do name queries to see if the old addresses * are still alive */ - if (j > 0) { + if (records[i].wins.mhomed && j > 0) { end = timeval_current_ofs(records[i].defend.timeout,0); records[i].defend.ret = True; while (records[i].defend.timeout > 0) { @@ -8059,6 +8185,12 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con &ctx->b, records[i].replica.num_ips, records[i].replica.ips, wins_name); + } else if (records[i].replica.sgroup_merge) { + ret &= test_wrepl_sgroup_merged(ctx, &ctx->c, + records[i].wins.num_ips, records[i].wins.ips, + &ctx->b, + records[i].replica.num_ips, records[i].replica.ips, + wins_name); } else { ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, records[i].replica.apply_expected); @@ -8104,6 +8236,42 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con } CHECK_VALUE(release->out.rcode, 0); } + + if (records[i].replica.sgroup_merge) { + /* clean up the SGROUP record */ + wins_name->name = &records[i].name; + wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP, + WREPL_STATE_ACTIVE, + WREPL_NODE_B, False); + wins_name->id = ++ctx->b.max_version; + wins_name->addresses.addresses.num_ips = 0; + wins_name->addresses.addresses.ips = NULL; + wins_name->unknown = "255.255.255.255"; + ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name); + + /* take ownership of the SGROUP record */ + wins_name->name = &records[i].name; + wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP, + WREPL_STATE_ACTIVE, + WREPL_NODE_B, False); + wins_name->id = ++ctx->b.max_version; + wins_name->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1); + wins_name->addresses.addresses.ips = discard_const(addresses_B_1); + wins_name->unknown = "255.255.255.255"; + ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name); + ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True); + + /* overwrite the SGROUP record with unique,tombstone */ + wins_name->name = &records[i].name; + wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE, + WREPL_STATE_TOMBSTONE, + WREPL_NODE_B, False); + wins_name->id = ++ctx->b.max_version; + wins_name->addresses.ip = addresses_A_1[0].ip; + wins_name->unknown = "255.255.255.255"; + ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name); + ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True); + } } done: -- cgit From 6c4be5073de177668d8c8fc05de625d3c9125268 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 11 Nov 2005 08:56:38 +0000 Subject: r11673: - update the max_version of the owner when we get some records in the sgroup_merge test, so that we don't see old records as new ones - finish the owned,sgroup,active vs. sgroup * section metze (This used to be commit 534e34a1a1c822e72bf863e8acc396168b849b93) --- source4/torture/nbt/winsreplication.c | 199 +++++++++++++++++++++++++++++++++- 1 file changed, 196 insertions(+), 3 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index eb09909184..9f4cc8af75 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -802,9 +802,9 @@ done: } static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx, - const struct wrepl_wins_owner *owner1, + struct wrepl_wins_owner *owner1, uint32_t num_ips1, const struct wrepl_ip *ips1, - const struct wrepl_wins_owner *owner2, + struct wrepl_wins_owner *owner2, uint32_t num_ips2, const struct wrepl_ip *ips2, const struct wrepl_wins_name *name2) { @@ -845,6 +845,10 @@ static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx, name = &names[i]; } + if (pull_names.out.num_names > 0 ) { + owner1->max_version = names[pull_names.out.num_names-1].version_id; + } + if (!name) { printf("%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name)); return False; @@ -7983,7 +7987,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con * special group vs. special group merging section */ /* - * sgroup,active vs. sgroup,active with same ip(s) + * sgroup,active vs. sgroup,active with different ip(s) */ { .line = __location__, @@ -8010,6 +8014,195 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .sgroup_merge = True }, }, + /* + * sgroup,active vs. sgroup,active with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SA_SA_SI_U", 0x1C, NULL), + .skip = (ctx->addresses_all_num < 3), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_mhomed_num, + .ips = ctx->addresses_mhomed, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_mhomed_num, + .ips = ctx->addresses_mhomed, + .sgroup_merge = True + }, + }, + /* + * sgroup,active vs. sgroup,active with superset ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SA_SA_SP_U", 0x1C, NULL), + .skip = (ctx->addresses_all_num < 3), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_mhomed_num, + .ips = ctx->addresses_mhomed, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_all_num, + .ips = ctx->addresses_all, + .sgroup_merge = True + }, + }, + /* + * sgroup,active vs. sgroup,active with subset ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SA_SA_SB_U", 0x1C, NULL), + .skip = (ctx->addresses_all_num < 3), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_mhomed_num, + .ips = ctx->addresses_mhomed, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .sgroup_merge = True + }, + }, + /* + * sgroup,active vs. sgroup,tombstone with different ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SA_ST_DI_U", 0x1C, NULL), + .skip = (ctx->addresses_all_num < 3), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_mhomed_num, + .ips = ctx->addresses_mhomed, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = False + }, + }, + /* + * sgroup,active vs. sgroup,tombstone with same ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SA_ST_SI_U", 0x1C, NULL), + .skip = (ctx->addresses_all_num < 3), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_mhomed_num, + .ips = ctx->addresses_mhomed, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_mhomed_num, + .ips = ctx->addresses_mhomed, + .apply_expected = False + }, + }, + /* + * sgroup,active vs. sgroup,tombstone with superset ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SA_ST_SP_U", 0x1C, NULL), + .skip = (ctx->addresses_all_num < 3), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_mhomed_num, + .ips = ctx->addresses_mhomed, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_all_num, + .ips = ctx->addresses_all, + .apply_expected = False + }, + }, + /* + * sgroup,active vs. sgroup,tombstone with subset ip(s) + */ + { + .line = __location__, + .name = _NBT_NAME("_SA_ST_SB_U", 0x1C, NULL), + .skip = (ctx->addresses_all_num < 3), + .wins = { + .nb_flags = NBT_NM_GROUP, + .mhomed = False, + .num_ips = ctx->addresses_mhomed_num, + .ips = ctx->addresses_mhomed, + .apply_expected = True + }, + .defend = { + .timeout = 0, + }, + .replica= { + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = False + }, + }, }; if (!ctx) return False; -- cgit From 006da4c52add1e448eb3f72896ca37d644294a24 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 11 Nov 2005 11:44:17 +0000 Subject: r11678: - add suport for sgroup,replica vs. sgroup,replica tests - add some sgroup,replica vs. sgroup,replica tests metze (This used to be commit 7a1b41452448fbb18170a7ca75c69f31cd7d89a8) --- source4/torture/nbt/winsreplication.c | 272 ++++++++++++++-------------------- 1 file changed, 114 insertions(+), 158 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 9f4cc8af75..617df5fa46 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -604,80 +604,6 @@ done: return ret; } -#if 0 -static BOOL test_wrepl_update_two(struct test_wrepl_conflict_conn *ctx, - const struct wrepl_wins_owner *owner, - const struct wrepl_wins_name *name1, - const struct wrepl_wins_name *name2) -{ - BOOL ret = True; - struct wrepl_socket *wrepl_socket; - struct wrepl_associate associate; - struct wrepl_packet update_packet, repl_send; - struct wrepl_table *update; - struct wrepl_wins_owner wrepl_wins_owners[1]; - struct wrepl_packet *repl_recv; - struct wrepl_wins_owner *send_request; - struct wrepl_send_reply *send_reply; - struct wrepl_wins_name wrepl_wins_names[2]; - uint32_t assoc_ctx; - NTSTATUS status; - - wrepl_socket = wrepl_socket_init(ctx, NULL); - - status = wrepl_connect(wrepl_socket, NULL, ctx->address); - CHECK_STATUS(status, NT_STATUS_OK); - - status = wrepl_associate(wrepl_socket, &associate); - CHECK_STATUS(status, NT_STATUS_OK); - assoc_ctx = associate.out.assoc_ctx; - - /* now send a WREPL_REPL_UPDATE message */ - ZERO_STRUCT(update_packet); - update_packet.opcode = WREPL_OPCODE_BITS; - update_packet.assoc_ctx = assoc_ctx; - update_packet.mess_type = WREPL_REPLICATION; - update_packet.message.replication.command = WREPL_REPL_UPDATE; - update = &update_packet.message.replication.info.table; - - update->partner_count = ARRAY_SIZE(wrepl_wins_owners); - update->partners = wrepl_wins_owners; - update->initiator = "0.0.0.0"; - - wrepl_wins_owners[0] = *owner; - - status = wrepl_request(wrepl_socket, wrepl_socket, - &update_packet, &repl_recv); - CHECK_STATUS(status, NT_STATUS_OK); - CHECK_VALUE(repl_recv->mess_type, WREPL_REPLICATION); - CHECK_VALUE(repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST); - send_request = &repl_recv->message.replication.info.owner; - - ZERO_STRUCT(repl_send); - repl_send.opcode = WREPL_OPCODE_BITS; - repl_send.assoc_ctx = assoc_ctx; - repl_send.mess_type = WREPL_REPLICATION; - repl_send.message.replication.command = WREPL_REPL_SEND_REPLY; - send_reply = &repl_send.message.replication.info.reply; - - send_reply->num_names = ARRAY_SIZE(wrepl_wins_names); - send_reply->names = wrepl_wins_names; - - wrepl_wins_names[0] = *name1; - wrepl_wins_names[1] = *name2; - - status = wrepl_request(wrepl_socket, wrepl_socket, - &repl_send, &repl_recv); - CHECK_STATUS(status, NT_STATUS_OK); - CHECK_VALUE(repl_recv->mess_type, WREPL_STOP_ASSOCIATION); - CHECK_VALUE(repl_recv->message.stop.reason, 0); - -done: - talloc_free(wrepl_socket); - return ret; -} -#endif - static BOOL test_wrepl_is_applied(struct test_wrepl_conflict_conn *ctx, const struct wrepl_wins_owner *owner, const struct wrepl_wins_name *name, @@ -827,7 +753,7 @@ static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx, } pull_names.in.assoc_ctx = ctx->pull_assoc; - pull_names.in.partner = *owner1; + pull_names.in.partner = ctx->c; pull_names.in.partner.min_version = pull_names.in.partner.max_version; pull_names.in.partner.max_version = 0; @@ -845,8 +771,8 @@ static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx, name = &names[i]; } - if (pull_names.out.num_names > 0 ) { - owner1->max_version = names[pull_names.out.num_names-1].version_id; + if (pull_names.out.num_names > 0) { + ctx->c.max_version = names[pull_names.out.num_names-1].version_id; } if (!name) { @@ -897,46 +823,6 @@ done: return ret; } -static BOOL test_wrepl_is_merged(struct test_wrepl_conflict_conn *ctx, - const struct wrepl_wins_name *name1, - const struct wrepl_wins_name *name2) -{ - return True; -#if 0 - BOOL ret = True; - NTSTATUS status; - struct wrepl_pull_names pull_names; - struct wrepl_name *names; - uint32_t num_ips; - - pull_names.in.assoc_ctx = ctx->pull_assoc; - pull_names.in.partner = ctx->c; - pull_names.in.partner.min_version = ctx->c.max_version-1; - - status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names); - CHECK_STATUS(status, NT_STATUS_OK); - CHECK_VALUE(pull_names.out.num_names, 1); - - names = pull_names.out.names; - - num_ips = name1->addresses.addresses.num_ips + name2->addresses.addresses.num_ips; - - CHECK_VALUE(names[0].name.type, name1->name->type); - CHECK_VALUE_STRING(names[0].name.name, name1->name->name); - CHECK_VALUE_STRING(names[0].name.scope, name1->name->scope); - CHECK_VALUE(names[0].type, WREPL_TYPE_SGROUP); - CHECK_VALUE(names[0].state, (num_ips>0?WREPL_STATE_ACTIVE:WREPL_STATE_RELEASED)); - CHECK_VALUE_UINT64(names[0].version_id, ctx->c.max_version); - - CHECK_VALUE(names[0].num_addresses, - name1->addresses.addresses.num_ips+ - name2->addresses.addresses.num_ips); -done: - talloc_free(pull_names.out.names); - return ret; -#endif -} - static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx) { BOOL ret = True; @@ -1132,7 +1018,8 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) uint32_t num_ips; const struct wrepl_ip *ips; BOOL apply_expected; - BOOL merge_expected; + BOOL sgroup_merge; + BOOL sgroup_cleanup; } r1, r2; } records[] = { /* @@ -3821,54 +3708,55 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .apply_expected = True } }, - -#if 0 /* * special group vs special group section, */ /* - * sgroup,active vs. sgroup,active + * sgroup,active vs. sgroup,active different addresses * => should be merged */ { .line = __location__, - .name = _NBT_NAME("_DIFF_OWNER_SG", 0x00, NULL), + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .extra = True, .r1 = { - .owner = &ctx->a, + .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_A_3_4), - .ips = addresses_A_3_4, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, .apply_expected = True, }, .r2 = { - .owner = &ctx->b, + .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_3_4), - .ips = addresses_B_3_4, - .apply_expected = False, - .merge_expected = True + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .sgroup_merge = True } }, + /* + * sgroup,active vs. sgroup,active different addresses, but owner changed + * => should be merged + */ { .line = __location__, - .name = _NBT_NAME("_DIFF_OWNER_SG", 0x00, NULL), - .cleanup= True, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .extra = True, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = 0, - .ips = NULL, - .apply_expected = False + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = True, }, .r2 = { .owner = &ctx->b, @@ -3876,38 +3764,42 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = 0, - .ips = NULL, - .apply_expected = False, - .merge_expected = False + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .apply_expected = True, + .sgroup_cleanup = True } }, + /* + * sgroup,active vs. sgroup,active same addresses + * => should be NOT replaced + */ { .line = __location__, - .name = _NBT_NAME("_DIFF_OWNER_SG", 0x00, NULL), - .cleanup= True, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .extra = True, .r1 = { - .owner = &ctx->a, + .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_A_1), - .ips = addresses_A_1, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, .apply_expected = True }, .r2 = { .owner = &ctx->a, - .type = WREPL_TYPE_UNIQUE, - .state = WREPL_STATE_TOMBSTONE, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_A_1), - .ips = addresses_A_1, - .apply_expected = True + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = False, + .sgroup_cleanup = True } }, -#endif /* * This should be the last record in this array, * we need to make sure the we leave a tombstoned unique entry @@ -3918,7 +3810,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .cleanup= True, .r1 = { - .owner = &ctx->b, + .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, @@ -3965,8 +3857,8 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) const char *expected; const char *ips; - if (records[i].r2.merge_expected) { - expected = "MERGE"; + if (records[i].r2.sgroup_merge) { + expected = "SGROUP_MERGE"; } else if (records[i].r2.apply_expected) { expected = "REPLACE"; } else { @@ -4035,8 +3927,13 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) if (records[i].r1.state == WREPL_STATE_RELEASED) { ret &= test_wrepl_is_applied(ctx, records[i].r1.owner, wins_name_r1, False); - } else if (records[i].r2.merge_expected) { - ret &= test_wrepl_is_merged(ctx, wins_name_r1, wins_name_r2); + } else if (records[i].r2.sgroup_merge) { + ret &= test_wrepl_sgroup_merged(ctx, + records[i].r1.owner, + records[i].r1.num_ips, records[i].r1.ips, + records[i].r2.owner, + records[i].r2.num_ips, records[i].r2.ips, + wins_name_r2); } else if (records[i].r1.owner != records[i].r2.owner) { BOOL _expected; _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected); @@ -4046,11 +3943,69 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) if (records[i].r2.state == WREPL_STATE_RELEASED) { ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, False); - } else if (!records[i].r2.merge_expected) { + } else if (!records[i].r2.sgroup_merge) { ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, records[i].r2.apply_expected); } + if (records[i].r2.sgroup_cleanup || records[i].r2.sgroup_merge) { + /* clean up the SGROUP record */ + wins_name_r1->name = &records[i].name; + wins_name_r1->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP, + WREPL_STATE_ACTIVE, + WREPL_NODE_B, False); + wins_name_r1->id = ++records[i].r1.owner->max_version; + wins_name_r1->addresses.addresses.num_ips = 0; + wins_name_r1->addresses.addresses.ips = NULL; + wins_name_r1->unknown = "255.255.255.255"; + ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1); + + /* here we test how names from an owner are deleted */ + if (records[i].r2.sgroup_merge && records[i].r2.num_ips) { + ret &= test_wrepl_sgroup_merged(ctx, + records[i].r2.owner, + records[i].r2.num_ips, records[i].r2.ips, + records[i].r1.owner, + 0, NULL, + wins_name_r2); + } + + /* clean up the SGROUP record */ + wins_name_r2->name = &records[i].name; + wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP, + WREPL_STATE_ACTIVE, + WREPL_NODE_B, False); + wins_name_r2->id = ++records[i].r2.owner->max_version; + wins_name_r2->addresses.addresses.num_ips = 0; + wins_name_r2->addresses.addresses.ips = NULL; + wins_name_r2->unknown = "255.255.255.255"; + ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2); + + /* take ownership of the SGROUP record */ + wins_name_r2->name = &records[i].name; + wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP, + WREPL_STATE_ACTIVE, + WREPL_NODE_B, False); + wins_name_r2->id = ++records[i].r2.owner->max_version; + wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1); + wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1); + wins_name_r2->unknown = "255.255.255.255"; + ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2); + ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, True); + + /* overwrite the SGROUP record with unique,tombstone */ + wins_name_r2->name = &records[i].name; + wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP, + WREPL_STATE_TOMBSTONE, + WREPL_NODE_B, False); + wins_name_r2->id = ++records[i].r2.owner->max_version; + wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1); + wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1); + wins_name_r2->unknown = "255.255.255.255"; + ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2); + ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, True); + } + /* the first one is a cleanup run */ if (!ret && i == 0) ret = True; @@ -8379,9 +8334,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con records[i].replica.num_ips, records[i].replica.ips, wins_name); } else if (records[i].replica.sgroup_merge) { - ret &= test_wrepl_sgroup_merged(ctx, &ctx->c, + ret &= test_wrepl_sgroup_merged(ctx, + &ctx->c, records[i].wins.num_ips, records[i].wins.ips, - &ctx->b, + &ctx->b, records[i].replica.num_ips, records[i].replica.ips, wins_name); } else { -- cgit From 70a01587b918718ddcbc11d4a7412c53211f04b8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 18 Nov 2005 11:40:03 +0000 Subject: r11779: fix crash bug metze (This used to be commit b35e43a67b7b9ccb25c8f4ed62b8415e82aaf1c7) --- source4/torture/nbt/winsreplication.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 617df5fa46..032983bcd1 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -8361,7 +8361,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con for (j=0; j < count; j++) { struct nbt_name_socket *nbtsock = ctx->nbtsock; - if (ctx->myaddr && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2) == 0) { + if (ctx->myaddr2 && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2) == 0) { nbtsock = ctx->nbtsock2; } -- cgit From bd69407be6b858aec9b2955914d210efc1a77194 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 19 Nov 2005 10:40:31 +0000 Subject: r11802: - add copyright - fix crash bug when running as non root - add extra comments in the output metze (This used to be commit ffc3cd73474722d60a781fb758105f665e73c0ca) --- source4/torture/nbt/winsreplication.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 032983bcd1..3619309ce3 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -3,7 +3,8 @@ WINS replication testing - Copyright (C) Andrew Tridgell 2005 + Copyright (C) Andrew Tridgell 2005 + Copyright (C) Stefan Metzmacher 2005 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -483,7 +484,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem ctx->nbtsock_srv = NULL; } - if (ctx->myaddr2) { + if (ctx->myaddr2 && ctx->nbtsock_srv) { ctx->nbtsock2 = nbt_name_socket_init(ctx, NULL); if (!ctx->nbtsock2) return NULL; @@ -1007,6 +1008,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) struct { const char *line; /* just better debugging */ struct nbt_name name; + const char *comment; BOOL extra; /* not the worst case, this is an extra test */ BOOL cleanup; struct { @@ -3747,6 +3749,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .comment= "but owner changed", .extra = True, .r1 = { .owner = &ctx->a, @@ -3873,14 +3876,17 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) ips = "different"; } - printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n", + printf("%s,%s%s vs. %s,%s%s with %s ip(s)%s%s => %s\n", wrepl_name_type_string(records[i].r1.type), wrepl_name_state_string(records[i].r1.state), (records[i].r1.is_static?",static":""), wrepl_name_type_string(records[i].r2.type), wrepl_name_state_string(records[i].r2.state), (records[i].r2.is_static?",static":""), - ips, expected); + ips, + (records[i].comment?" ":""), + (records[i].comment?records[i].comment:""), + expected); } /* -- cgit From 91ec46b7037dcdbd8054810715247d16be5bddc5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 21 Nov 2005 12:05:46 +0000 Subject: r11827: add more sgroup vs sgroup tests metze (This used to be commit 28a065064ef4ed60eb7d260ba02d939cfaba0bb9) --- source4/torture/nbt/winsreplication.c | 564 ++++++++++++++++++++++++++++++++-- 1 file changed, 531 insertions(+), 33 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 3619309ce3..b7a154491e 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -328,8 +328,10 @@ struct test_wrepl_conflict_conn { #define TEST_ADDRESS_A_PREFIX "127.0.65" #define TEST_OWNER_B_ADDRESS "127.66.66.1" #define TEST_ADDRESS_B_PREFIX "127.0.66" +#define TEST_OWNER_X_ADDRESS "127.88.88.1" +#define TEST_ADDRESS_X_PREFIX "127.0.88" - struct wrepl_wins_owner a, b, c; + struct wrepl_wins_owner a, b, c, x; const char *myaddr; const char *myaddr2; @@ -374,6 +376,71 @@ static const struct wrepl_ip addresses_A_3_4[] = { .ip = TEST_ADDRESS_A_PREFIX".4" } }; +static const struct wrepl_ip addresses_A_3_4_X_3_4[] = { + { + .owner = TEST_OWNER_A_ADDRESS, + .ip = TEST_ADDRESS_A_PREFIX".3" + }, + { + .owner = TEST_OWNER_A_ADDRESS, + .ip = TEST_ADDRESS_A_PREFIX".4" + }, + { + .owner = TEST_OWNER_X_ADDRESS, + .ip = TEST_ADDRESS_X_PREFIX".3" + }, + { + .owner = TEST_OWNER_X_ADDRESS, + .ip = TEST_ADDRESS_X_PREFIX".4" + } +}; +static const struct wrepl_ip addresses_A_3_4_OWNER_B[] = { + { + .owner = TEST_OWNER_B_ADDRESS, + .ip = TEST_ADDRESS_A_PREFIX".3" + }, + { + .owner = TEST_OWNER_B_ADDRESS, + .ip = TEST_ADDRESS_A_PREFIX".4" + } +}; +static const struct wrepl_ip addresses_A_3_4_X_3_4_OWNER_B[] = { + { + .owner = TEST_OWNER_B_ADDRESS, + .ip = TEST_ADDRESS_A_PREFIX".3" + }, + { + .owner = TEST_OWNER_B_ADDRESS, + .ip = TEST_ADDRESS_A_PREFIX".4" + }, + { + .owner = TEST_OWNER_B_ADDRESS, + .ip = TEST_ADDRESS_X_PREFIX".3" + }, + { + .owner = TEST_OWNER_B_ADDRESS, + .ip = TEST_ADDRESS_X_PREFIX".4" + } +}; + +static const struct wrepl_ip addresses_A_3_4_X_1_2[] = { + { + .owner = TEST_OWNER_A_ADDRESS, + .ip = TEST_ADDRESS_A_PREFIX".3" + }, + { + .owner = TEST_OWNER_A_ADDRESS, + .ip = TEST_ADDRESS_A_PREFIX".4" + }, + { + .owner = TEST_OWNER_X_ADDRESS, + .ip = TEST_ADDRESS_X_PREFIX".1" + }, + { + .owner = TEST_OWNER_X_ADDRESS, + .ip = TEST_ADDRESS_X_PREFIX".2" + } +}; static const struct wrepl_ip addresses_B_1[] = { { @@ -397,6 +464,42 @@ static const struct wrepl_ip addresses_B_3_4[] = { .ip = TEST_ADDRESS_B_PREFIX".4" } }; +static const struct wrepl_ip addresses_B_3_4_X_3_4[] = { + { + .owner = TEST_OWNER_B_ADDRESS, + .ip = TEST_ADDRESS_B_PREFIX".3" + }, + { + .owner = TEST_OWNER_B_ADDRESS, + .ip = TEST_ADDRESS_B_PREFIX".4" + }, + { + .owner = TEST_OWNER_X_ADDRESS, + .ip = TEST_ADDRESS_X_PREFIX".3" + }, + { + .owner = TEST_OWNER_X_ADDRESS, + .ip = TEST_ADDRESS_X_PREFIX".4" + } +}; +static const struct wrepl_ip addresses_B_3_4_X_1_2[] = { + { + .owner = TEST_OWNER_B_ADDRESS, + .ip = TEST_ADDRESS_B_PREFIX".3" + }, + { + .owner = TEST_OWNER_B_ADDRESS, + .ip = TEST_ADDRESS_B_PREFIX".4" + }, + { + .owner = TEST_OWNER_X_ADDRESS, + .ip = TEST_ADDRESS_X_PREFIX".1" + }, + { + .owner = TEST_OWNER_X_ADDRESS, + .ip = TEST_ADDRESS_X_PREFIX".2" + } +}; static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem_ctx, const char *address) @@ -433,6 +536,11 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem ctx->b.min_version = 0; ctx->b.type = 1; + ctx->x.address = TEST_OWNER_X_ADDRESS; + ctx->x.max_version = 0; + ctx->x.min_version = 0; + ctx->x.type = 1; + ctx->c.address = address; ctx->c.max_version = 0; ctx->c.min_version = 0; @@ -451,6 +559,10 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem ctx->b.max_version = pull_table.out.partners[i].max_version; ctx->b.min_version = pull_table.out.partners[i].min_version; } + if (strcmp(TEST_OWNER_X_ADDRESS,pull_table.out.partners[i].address)==0) { + ctx->x.max_version = pull_table.out.partners[i].max_version; + ctx->x.min_version = pull_table.out.partners[i].min_version; + } if (strcmp(address,pull_table.out.partners[i].address)==0) { ctx->c.max_version = pull_table.out.partners[i].max_version; ctx->c.min_version = pull_table.out.partners[i].min_version; @@ -729,6 +841,7 @@ done: } static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx, + struct wrepl_wins_owner *merge_owner, struct wrepl_wins_owner *owner1, uint32_t num_ips1, const struct wrepl_ip *ips1, struct wrepl_wins_owner *owner2, @@ -744,17 +857,26 @@ static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx, uint32_t i, j; uint32_t num_ips = num_ips1 + num_ips2; - for (i = 0; i < num_ips2; i++) { - for (j = 0; j < num_ips1; j++) { - if (strcmp(ips2[i].ip,ips1[j].ip) == 0) { + if (!merge_owner) { + merge_owner = &ctx->c; + } + + for (i = 0; i < num_ips1; i++) { + if (owner1 != &ctx->c && strcmp(ips1[i].owner,owner2->address) == 0) { + num_ips--; + continue; + } + for (j = 0; j < num_ips2; j++) { + if (strcmp(ips1[i].ip,ips2[j].ip) == 0) { num_ips--; break; } - } + } } + pull_names.in.assoc_ctx = ctx->pull_assoc; - pull_names.in.partner = ctx->c; + pull_names.in.partner = *merge_owner; pull_names.in.partner.min_version = pull_names.in.partner.max_version; pull_names.in.partner.max_version = 0; @@ -773,7 +895,7 @@ static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx, } if (pull_names.out.num_names > 0) { - ctx->c.max_version = names[pull_names.out.num_names-1].version_id; + merge_owner->max_version = names[pull_names.out.num_names-1].version_id; } if (!name) { @@ -800,7 +922,7 @@ static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx, for (j = 0; j < num_ips2; j++) { if (strcmp(addr, ips2[j].ip) == 0) { found = True; - CHECK_VALUE_STRING(owner, owner2->address); + CHECK_VALUE_STRING(owner, ips2[j].owner); break; } } @@ -810,7 +932,11 @@ static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx, for (j = 0; j < num_ips1; j++) { if (strcmp(addr, ips1[j].ip) == 0) { found = True; - CHECK_VALUE_STRING(owner, owner1->address); + if (owner1 == &ctx->c) { + CHECK_VALUE_STRING(owner, owner1->address); + } else { + CHECK_VALUE_STRING(owner, ips1[j].owner); + } break; } } @@ -1021,9 +1147,11 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) const struct wrepl_ip *ips; BOOL apply_expected; BOOL sgroup_merge; + struct wrepl_wins_owner *merge_owner; BOOL sgroup_cleanup; - } r1, r2; + } r1, r2, result; } records[] = { +#if 1 /* * NOTE: the first record and the last applied one * needs to be from the same owner, @@ -3710,6 +3838,32 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .apply_expected = True } }, + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .cleanup= True, + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True, + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True, + } + }, +#endif /* * special group vs special group section, */ @@ -3720,8 +3874,19 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .comment= "A:A_3_4 vs. B:B_3_4 => C:A_3_4_B_3_4", .extra = True, .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .apply_expected = True, + }, + .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, @@ -3729,27 +3894,49 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .is_static = False, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = True, + .sgroup_merge = True, + .sgroup_cleanup = True, + } + }, + /* + * sgroup,active vs. sgroup,active same addresses + * => should be NOT replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .comment= "A:A_3_4 vs. B:A_3_4", + .extra = True, + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .apply_expected = True }, .r2 = { - .owner = &ctx->a, + .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .sgroup_merge = True + .apply_expected = False, + .sgroup_cleanup = True } }, /* * sgroup,active vs. sgroup,active different addresses, but owner changed - * => should be merged + * => should be replaced */ { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .comment= "but owner changed", + .comment= "A:B_3_4 vs. B:A_3_4", .extra = True, .r1 = { .owner = &ctx->a, @@ -3774,35 +3961,348 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, /* - * sgroup,active vs. sgroup,active same addresses - * => should be NOT replaced + * sgroup,active vs. sgroup,active different addresses, but owner changed + * => should be replaced */ { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .comment= "A:A_3_4 vs. B:A_3_4_OWNER_B", .extra = True, .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .apply_expected = True, + }, + .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_3_4), - .ips = addresses_B_3_4, - .apply_expected = True + .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B), + .ips = addresses_A_3_4_OWNER_B, + .apply_expected = True, + .sgroup_cleanup = True + } + }, + /* + * sgroup,active vs. sgroup,active different addresses, but owner changed + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .comment= "A:A_3_4_OWNER_B vs. B:A_3_4", + .extra = True, + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B), + .ips = addresses_A_3_4_OWNER_B, + .apply_expected = True, }, .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .apply_expected = True, + .sgroup_cleanup = True + } + }, + /* + * sgroup,active vs. sgroup,active different addresses, special case... + * => should be merged + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:X_3_4", + .extra = True, + .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_3_4), - .ips = addresses_B_3_4, + .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4), + .ips = addresses_B_3_4_X_3_4, + .apply_expected = True, + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .sgroup_merge = True, + .merge_owner = &ctx->b, + .sgroup_cleanup = False + } + }, + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .cleanup= True, + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4_OWNER_B), + .ips = addresses_A_3_4_X_3_4_OWNER_B, + .apply_expected = True, + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = 0, + .ips = NULL, + .apply_expected = False, + } + }, + /* + * sgroup,active vs. sgroup,active subset addresses, special case... + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .comment= "A:A_3_4_X_3_4 vs. B:A_3_4", + .extra = True, + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4), + .ips = addresses_A_3_4_X_3_4, + .apply_expected = True, + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .apply_expected = False, + } + }, + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .cleanup= True, + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = 0, + .ips = NULL, + .apply_expected = False, + }, + .r2 = { + .owner = &ctx->x, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = 0, + .ips = NULL, + .apply_expected = False, + } + }, + /* + * sgroup,active vs. sgroup,active different addresses, special case... + * => should be merged + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .comment= "A:A_3_4_X_3_4 vs. B:A_3_4_OWNER_B => B:A_3_4_OWNER_B_X_3_4", + .extra = True, + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4), + .ips = addresses_A_3_4_X_3_4, + .apply_expected = True, + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B), + .ips = addresses_A_3_4_OWNER_B, + .sgroup_merge = True, + .merge_owner = &ctx->b, + } + }, + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .cleanup= True, + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = 0, + .ips = NULL, + .apply_expected = False, + }, + .r2 = { + .owner = &ctx->x, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = 0, + .ips = NULL, + .apply_expected = False, + } + }, + /* + * sgroup,active vs. sgroup,active partly different addresses, special case... + * => should be merged + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .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", + .extra = True, + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4), + .ips = addresses_B_3_4_X_3_4, + .apply_expected = True, + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4_X_1_2), + .ips = addresses_B_3_4_X_1_2, + .sgroup_merge = True, + .sgroup_cleanup = False + } + }, + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .cleanup= True, + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = 0, + .ips = NULL, .apply_expected = False, + }, + .r2 = { + .owner = &ctx->x, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = 0, + .ips = NULL, + .apply_expected = False, + } + }, + /* + * sgroup,active vs. sgroup,active different addresses, special case... + * => should be merged + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:X_3_4", + .extra = True, + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4), + .ips = addresses_B_3_4_X_3_4, + .apply_expected = True, + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = 0, + .ips = NULL, + .sgroup_merge = True, + .merge_owner = &ctx->b, .sgroup_cleanup = True } }, + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .cleanup= True, + .r1 = { + .owner = &ctx->x, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = 0, + .ips = NULL, + .apply_expected = False, + }, + .r2 = { + .owner = &ctx->x, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True, + } + }, /* * This should be the last record in this array, * we need to make sure the we leave a tombstoned unique entry @@ -3869,23 +4369,21 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } if (!records[i].r1.ips && !records[i].r2.ips) { - ips = "no"; + ips = "with no ip(s)"; } else if (records[i].r1.ips==records[i].r2.ips) { - ips = "same"; + ips = "with same ip(s)"; } else { - ips = "different"; + ips = "with different ip(s)"; } - printf("%s,%s%s vs. %s,%s%s with %s ip(s)%s%s => %s\n", + printf("%s,%s%s vs. %s,%s%s %s => %s\n", wrepl_name_type_string(records[i].r1.type), wrepl_name_state_string(records[i].r1.state), (records[i].r1.is_static?",static":""), wrepl_name_type_string(records[i].r2.type), wrepl_name_state_string(records[i].r2.state), (records[i].r2.is_static?",static":""), - ips, - (records[i].comment?" ":""), - (records[i].comment?records[i].comment:""), + (records[i].comment?records[i].comment:ips), expected); } @@ -3934,7 +4432,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) ret &= test_wrepl_is_applied(ctx, records[i].r1.owner, wins_name_r1, False); } else if (records[i].r2.sgroup_merge) { - ret &= test_wrepl_sgroup_merged(ctx, + ret &= test_wrepl_sgroup_merged(ctx, records[i].r2.merge_owner, records[i].r1.owner, records[i].r1.num_ips, records[i].r1.ips, records[i].r2.owner, @@ -3954,7 +4452,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) wins_name_r2, records[i].r2.apply_expected); } - if (records[i].r2.sgroup_cleanup || records[i].r2.sgroup_merge) { + if (records[i].r2.sgroup_cleanup) { /* clean up the SGROUP record */ wins_name_r1->name = &records[i].name; wins_name_r1->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP, @@ -3968,7 +4466,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) /* here we test how names from an owner are deleted */ if (records[i].r2.sgroup_merge && records[i].r2.num_ips) { - ret &= test_wrepl_sgroup_merged(ctx, + ret &= test_wrepl_sgroup_merged(ctx, NULL, records[i].r2.owner, records[i].r2.num_ips, records[i].r2.ips, records[i].r1.owner, @@ -8340,7 +8838,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con records[i].replica.num_ips, records[i].replica.ips, wins_name); } else if (records[i].replica.sgroup_merge) { - ret &= test_wrepl_sgroup_merged(ctx, + ret &= test_wrepl_sgroup_merged(ctx, NULL, &ctx->c, records[i].wins.num_ips, records[i].wins.ips, &ctx->b, -- cgit From 309645e00293e5964721db10e6c3eb3bb7d250f2 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 21 Nov 2005 12:21:52 +0000 Subject: r11829: remove unused #if 1 metze (This used to be commit 80f2e50387eedecfe661f0e48e7287017a34a508) --- source4/torture/nbt/winsreplication.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index b7a154491e..66e1416afe 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -1151,7 +1151,6 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) BOOL sgroup_cleanup; } r1, r2, result; } records[] = { -#if 1 /* * NOTE: the first record and the last applied one * needs to be from the same owner, @@ -3863,7 +3862,6 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .apply_expected = True, } }, -#endif /* * special group vs special group section, */ -- cgit From 363ce0b0168f19f9a57966c2ebee610e63f249c9 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 21 Nov 2005 14:14:58 +0000 Subject: r11831: add some SGROUP not active vs. SGROUP any tests metze (This used to be commit be622259ab1976abb800f55d5d8d329359e082db) --- source4/torture/nbt/winsreplication.c | 119 ++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 66e1416afe..8ba9c74394 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -2953,6 +2953,125 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, +/* + * special groups (not active) vs special group section, + */ + /* + * sgroup,released vs. sgroup,active + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * sgroup,released vs. sgroup,tombstone + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_RELEASED, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = False + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + + /* + * sgroup,tombstone vs. sgroup,active + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + } + }, + + /* + * sgroup,tombstone vs. sgroup,tombstone + * => should NOT be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .r1 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_1), + .ips = addresses_B_1, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True + } + }, + /* * special groups vs multi homed section, */ -- cgit From 31d070637b646c4eb65341891cbdf3e0f0142538 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 23 Nov 2005 12:30:57 +0000 Subject: r11882: - use some better names - we now pass the same_owner tests so test them with make test metze (This used to be commit 579ebb874e40c66dc45c5468bfa0658c7fabcc61) --- source4/torture/nbt/winsreplication.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 8ba9c74394..2aace9fd97 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -8382,7 +8382,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con */ { .line = __location__, - .name = _NBT_NAME("_MA_MA_SB_C", 0x00, NULL), + .name = _NBT_NAME("_MA_MA_SB_PRA", 0x00, NULL), .skip = (ctx->addresses_all_num < 3), .wins = { .nb_flags = 0, @@ -8476,7 +8476,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con { .line = __location__, .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations", - .name = _NBT_NAME("_MA_UA_SB_A", 0x00, NULL), + .name = _NBT_NAME("_MA_UA_SB_P", 0x00, NULL), .skip = (ctx->addresses_all_num < 3), .wins = { .nb_flags = 0, @@ -9249,6 +9249,7 @@ BOOL torture_nbt_winsreplication_quick(void) TALLOC_CTX *mem_ctx = talloc_new(NULL); NTSTATUS status; BOOL ret = True; + struct test_wrepl_conflict_conn *ctx; make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host")); @@ -9266,6 +9267,10 @@ BOOL torture_nbt_winsreplication_quick(void) ret &= test_wins_replication(mem_ctx, address); + ctx = test_create_conflict_ctx(mem_ctx, address); + + ret &= test_conflict_same_owner(ctx); + talloc_free(mem_ctx); return ret; -- cgit From 4d4afa8d6d8359f8c07611ddbde722948cf349a8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 24 Nov 2005 09:22:38 +0000 Subject: r11887: reorder some tests metze (This used to be commit a4277c6b2626f043ec2c2f4d0da245f78ef02f95) --- source4/torture/nbt/winsreplication.c | 121 +++++++++++++++++++++++++++------- 1 file changed, 99 insertions(+), 22 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 2aace9fd97..8667b9d351 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -501,6 +501,27 @@ static const struct wrepl_ip addresses_B_3_4_X_1_2[] = { } }; +static const struct wrepl_ip addresses_X_1_2[] = { + { + .owner = TEST_OWNER_X_ADDRESS, + .ip = TEST_ADDRESS_X_PREFIX".1" + }, + { + .owner = TEST_OWNER_X_ADDRESS, + .ip = TEST_ADDRESS_X_PREFIX".2" + } +}; +static const struct wrepl_ip addresses_X_3_4[] = { + { + .owner = TEST_OWNER_X_ADDRESS, + .ip = TEST_ADDRESS_X_PREFIX".3" + }, + { + .owner = TEST_OWNER_X_ADDRESS, + .ip = TEST_ADDRESS_X_PREFIX".4" + } +}; + static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem_ctx, const char *address) { @@ -3985,13 +4006,13 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) * special group vs special group section, */ /* - * sgroup,active vs. sgroup,active different addresses - * => should be merged + * sgroup,active vs. sgroup,active same addresses + * => should be NOT replaced */ { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .comment= "A:A_3_4 vs. B:B_3_4 => C:A_3_4_B_3_4", + .comment= "A:A_3_4 vs. B:A_3_4", .extra = True, .r1 = { .owner = &ctx->a, @@ -4001,7 +4022,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .is_static = False, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .apply_expected = True, + .apply_expected = True }, .r2 = { .owner = &ctx->b, @@ -4009,20 +4030,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_B_3_4), - .ips = addresses_B_3_4, - .sgroup_merge = True, - .sgroup_cleanup = True, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .apply_expected = False, + .sgroup_cleanup = True } }, /* - * sgroup,active vs. sgroup,active same addresses - * => should be NOT replaced + * sgroup,active vs. sgroup,active subset addresses, special case... + * => should NOT be replaced */ { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .comment= "A:A_3_4 vs. B:A_3_4", + .comment= "A:A_3_4_X_3_4 vs. B:A_3_4", .extra = True, .r1 = { .owner = &ctx->a, @@ -4030,9 +4051,9 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_A_3_4), - .ips = addresses_A_3_4, - .apply_expected = True + .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4), + .ips = addresses_A_3_4_X_3_4, + .apply_expected = True, }, .r2 = { .owner = &ctx->b, @@ -4042,8 +4063,32 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .is_static = False, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, + .apply_expected = False, + } + }, + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .cleanup= True, + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = 0, + .ips = NULL, + .apply_expected = False, + }, + .r2 = { + .owner = &ctx->x, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = 0, + .ips = NULL, .apply_expected = False, - .sgroup_cleanup = True } }, /* @@ -4139,6 +4184,37 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .sgroup_cleanup = True } }, + /* + * sgroup,active vs. sgroup,active different addresses + * => should be merged + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .comment= "A:A_3_4 vs. B:B_3_4 => C:A_3_4_B_3_4", + .extra = True, + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .apply_expected = True, + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .sgroup_merge = True, + .sgroup_cleanup = True, + } + }, /* * sgroup,active vs. sgroup,active different addresses, special case... * => should be merged @@ -4146,7 +4222,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:X_3_4", + .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4_X_3_4", .extra = True, .r1 = { .owner = &ctx->a, @@ -4197,13 +4273,13 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }, /* - * sgroup,active vs. sgroup,active subset addresses, special case... - * => should NOT be replaced + * sgroup,active vs. sgroup,active different addresses, special case... + * => should be merged */ { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .comment= "A:A_3_4_X_3_4 vs. B:A_3_4", + .comment= "A:X_3_4 vs. B:A_3_4 => C:A_3_4_X_3_4", .extra = True, .r1 = { .owner = &ctx->a, @@ -4211,8 +4287,8 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, .is_static = False, - .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4), - .ips = addresses_A_3_4_X_3_4, + .num_ips = ARRAY_SIZE(addresses_X_3_4), + .ips = addresses_X_3_4, .apply_expected = True, }, .r2 = { @@ -4223,7 +4299,8 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .is_static = False, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .apply_expected = False, + .sgroup_merge = True, + .sgroup_cleanup = False } }, { -- cgit From 6aff2946e1892586b20e543a6cd101c89829bc11 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 25 Nov 2005 10:11:01 +0000 Subject: r11897: add 2 more sgroup vs. sgroup tests with the replica having no addresses metze (This used to be commit 22b8d5014af181aa755ecc5389d9e4bd32d02cab) --- source4/torture/nbt/winsreplication.c | 108 +++++++++++++++++++++++++++++++++- 1 file changed, 107 insertions(+), 1 deletion(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 8667b9d351..1fd68cadb8 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -394,6 +394,24 @@ static const struct wrepl_ip addresses_A_3_4_X_3_4[] = { .ip = TEST_ADDRESS_X_PREFIX".4" } }; +static const struct wrepl_ip addresses_A_3_4_B_3_4[] = { + { + .owner = TEST_OWNER_A_ADDRESS, + .ip = TEST_ADDRESS_A_PREFIX".3" + }, + { + .owner = TEST_OWNER_A_ADDRESS, + .ip = TEST_ADDRESS_A_PREFIX".4" + }, + { + .owner = TEST_OWNER_B_ADDRESS, + .ip = TEST_ADDRESS_B_PREFIX".3" + }, + { + .owner = TEST_OWNER_B_ADDRESS, + .ip = TEST_ADDRESS_B_PREFIX".4" + } +}; static const struct wrepl_ip addresses_A_3_4_OWNER_B[] = { { .owner = TEST_OWNER_B_ADDRESS, @@ -4036,6 +4054,37 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .sgroup_cleanup = True } }, + /* + * sgroup,active vs. sgroup,active same addresses + * => should be NOT replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .comment= "A:A_3_4 vs. B:NULL", + .extra = True, + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .apply_expected = True + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = 0, + .ips = NULL, + .apply_expected = False, + .sgroup_cleanup = True + } + }, /* * sgroup,active vs. sgroup,active subset addresses, special case... * => should NOT be replaced @@ -4440,6 +4489,63 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .apply_expected = False, } }, + /* + * sgroup,active vs. sgroup,active different addresses, special case... + * => should be merged + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .comment= "A:A_3_4_B_3_4 vs. B:NULL => B:A_3_4", + .extra = True, + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4_B_3_4), + .ips = addresses_A_3_4_B_3_4, + .apply_expected = True, + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = 0, + .ips = NULL, + .sgroup_merge = True, + .merge_owner = &ctx->b, + .sgroup_cleanup = True + } + }, + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .cleanup= True, + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = 0, + .ips = NULL, + .apply_expected = False, + }, + .r2 = { + .owner = &ctx->a, + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_1), + .ips = addresses_A_1, + .apply_expected = True, + } + }, /* * sgroup,active vs. sgroup,active different addresses, special case... * => should be merged @@ -4536,7 +4642,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) printf("Test Replica Conflicts with different owners\n"); for(i=0; ret && i < ARRAY_SIZE(records); i++) { - + if (!records[i].extra && !records[i].cleanup) { /* we should test the worst cases */ if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) { -- cgit From 7746a144cd148a32604e768f878acff65c55a897 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 25 Nov 2005 10:44:03 +0000 Subject: r11899: add some usefull debug messages metze (This used to be commit 8b9447e8c1be58bd299d464d5d1f15d32c438374) --- source4/torture/nbt/winsreplication.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 1fd68cadb8..823a4b3332 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -4753,6 +4753,11 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } if (records[i].r2.sgroup_cleanup) { + if (!ret) { + printf("failed before sgroup_cleanup record[%u]: %s\n", i, records[i].line); + return ret; + } + /* clean up the SGROUP record */ wins_name_r1->name = &records[i].name; wins_name_r1->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP, @@ -4808,6 +4813,11 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) wins_name_r2->unknown = "255.255.255.255"; ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2); ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, True); + + if (!ret) { + printf("failed in sgroup_cleanup record[%u]: %s\n", i, records[i].line); + return ret; + } } /* the first one is a cleanup run */ -- cgit From 97e19e9716e73e98cdcfd7a9a209a7a24add05fb Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 25 Nov 2005 13:44:16 +0000 Subject: r11911: as we pass the owned_released vs. replica test now, run it with make test metze (This used to be commit d34580ec70dca145ea7911be718ad1fc13297a20) --- source4/torture/nbt/winsreplication.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 823a4b3332..87b2c26211 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -9463,6 +9463,7 @@ BOOL torture_nbt_winsreplication_quick(void) ctx = test_create_conflict_ctx(mem_ctx, address); ret &= test_conflict_same_owner(ctx); + ret &= test_conflict_owned_released_vs_replica(ctx); talloc_free(mem_ctx); -- cgit From 03d301ead5f702872b8cb948b8cd01b0fa0db5f7 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 30 Nov 2005 02:08:15 +0000 Subject: r11967: Fix more 64-bit warnings. (This used to be commit 9c4436a124f874ae240feaf590141d48c33a635f) --- source4/torture/nbt/winsreplication.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 87b2c26211..4f18e3492b 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -47,7 +47,7 @@ #define CHECK_VALUE_UINT64(v, correct) do { \ if ((v) != (correct)) { \ printf("(%s) Incorrect value %s=%llu - should be %llu\n", \ - __location__, #v, v, correct); \ + __location__, #v, (long long)v, (long long)correct); \ ret = False; \ goto done; \ }} while (0) @@ -230,7 +230,7 @@ static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_name *name) printf("%s\n", nbt_name_string(mem_ctx, &name->name)); printf("\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n", - name->type, name->state, name->node, name->is_static, name->version_id); + name->type, name->state, name->node, name->is_static, (long long)name->version_id); printf("\tRAW_FLAGS: 0x%08X OWNER: %-15s\n", name->raw_flags, name->owner); for (i=0;inum_addresses;i++) { @@ -296,8 +296,8 @@ static BOOL test_wins_replication(TALLOC_CTX *mem_ctx, const char *address) struct wrepl_wins_owner *partner = &pull_table.out.partners[i]; printf("%s max_version=%6llu min_version=%6llu type=%d\n", partner->address, - partner->max_version, - partner->min_version, + (long long)partner->max_version, + (long long)partner->min_version, partner->type); pull_names.in.assoc_ctx = associate.out.assoc_ctx; -- cgit From 84033c20f0efbe772c8085d4a1eb7d9a9f534a90 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 2 Dec 2005 15:51:39 +0000 Subject: r12024: do some extra sleeping to give the server the chance to handle our reply metze (This used to be commit 144bde91b3ccbf40494b3f235a2f2699e32f9ad8) --- source4/torture/nbt/winsreplication.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 4f18e3492b..3963f0adb0 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -9354,6 +9354,7 @@ static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_ /* make sure we push the reply to the wire */ event_loop_once(nbtsock->event_ctx); + msleep(25); rec->defend.timeout = 0; rec->defend.ret = True; @@ -9406,6 +9407,7 @@ static void test_conflict_owned_active_vs_replica_handler_release(struct nbt_nam /* make sure we push the reply to the wire */ event_loop_once(nbtsock->event_ctx); + msleep(25); rec->defend.timeout = 0; rec->defend.ret = True; -- cgit From dbeb44eeda74cd33757eadcafaa78c78319ba8cb Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 5 Dec 2005 07:56:22 +0000 Subject: r12066: - add a unique,active,owner vs. unique,active,replica tests where we respond with the replicas address to the challenge - fix some skip checks metze (This used to be commit a37aaa93cb25c559b27f4c1a7c48285d4223b9aa) --- source4/torture/nbt/winsreplication.c | 45 ++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 6 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 3963f0adb0..fe3df13581 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -8489,7 +8489,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con { .line = __location__, .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL), - .skip = (ctx->addresses_mhomed_num != 2), + .skip = (ctx->addresses_mhomed_num < 2), .wins = { .nb_flags = 0, .mhomed = True, @@ -8516,7 +8516,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con { .line = __location__, .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL), - .skip = (ctx->addresses_mhomed_num != 2), + .skip = (ctx->addresses_mhomed_num < 2), .wins = { .nb_flags = 0, .mhomed = True, @@ -8576,7 +8576,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con { .line = __location__, .name = _NBT_NAME("_MA_MA_SB_PRA", 0x00, NULL), - .skip = (ctx->addresses_all_num < 3), + .skip = (ctx->addresses_all_num < 2), .wins = { .nb_flags = 0, .mhomed = True, @@ -8608,7 +8608,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .line = __location__, .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL), - .skip = (ctx->addresses_all_num < 3), + .skip = (ctx->addresses_all_num < 2), .wins = { .nb_flags = 0, .mhomed = True, @@ -8638,7 +8638,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con { .line = __location__, .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL), - .skip = (ctx->addresses_mhomed_num != 2), + .skip = (ctx->addresses_mhomed_num < 2), .wins = { .nb_flags = 0, .mhomed = True, @@ -8670,7 +8670,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .line = __location__, .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations", .name = _NBT_NAME("_MA_UA_SB_P", 0x00, NULL), - .skip = (ctx->addresses_all_num < 3), + .skip = (ctx->addresses_all_num < 2), .wins = { .nb_flags = 0, .mhomed = True, @@ -8692,6 +8692,39 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .mhomed_merge = True }, }, + /* + * unique,active vs. unique,active with different ip(s), positive response, with replicas address + * TODO: check why the server sends a name release demand for one address? + * the release demand has no effect to the database record... + */ + { + .line = __location__, + .name = _NBT_NAME("_UA_UA_DI_PRA", 0x00, NULL), + .skip = (ctx->addresses_all_num < 2), + .wins = { + .nb_flags = 0, + .mhomed = False, + .num_ips = ctx->addresses_best_num, + .ips = ctx->addresses_best, + .apply_expected = True + }, + .defend = { + .timeout = 10, + .positive = True, + .num_ips = ctx->addresses_best2_num, + .ips = ctx->addresses_best2, + .late_release = True + }, + .replica= { + .type = WREPL_TYPE_UNIQUE, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ctx->addresses_best2_num, + .ips = ctx->addresses_best2, + .apply_expected = False, + }, + }, /* * unique,active vs. unique,active with different ip(s), positive response, with all addresses */ -- cgit From 7ab5c74a9898091f81df8a93092f4165506ccade Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 5 Dec 2005 10:03:10 +0000 Subject: r12067: print out some more details metze (This used to be commit 8207969a5727e54877752be5168931f609591be1) --- source4/torture/nbt/winsreplication.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index fe3df13581..6bf25146fe 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -6512,6 +6512,7 @@ struct test_conflict_owned_active_vs_replica_struct { const char *line; /* just better debugging */ const char *section; /* just better debugging */ struct nbt_name name; + const char *comment; BOOL skip; struct { uint32_t nb_flags; @@ -8462,6 +8463,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .line = __location__, .section= "Test Replica vs. owned active: some more MHOMED combinations", .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL), + .comment= "C:MHOMED vs. B:ALL => B:ALL", .skip = (ctx->addresses_all_num < 3), .wins = { .nb_flags = 0, @@ -8489,6 +8491,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con { .line = __location__, .name = _NBT_NAME("_MA_MA_SM_U", 0x00, NULL), + .comment= "C:MHOMED vs. B:MHOMED => B:MHOMED", .skip = (ctx->addresses_mhomed_num < 2), .wins = { .nb_flags = 0, @@ -8516,6 +8519,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con { .line = __location__, .name = _NBT_NAME("_MA_MA_SB_P", 0x00, NULL), + .comment= "C:MHOMED vs. B:BEST (C:MHOMED) => B:MHOMED", .skip = (ctx->addresses_mhomed_num < 2), .wins = { .nb_flags = 0, @@ -8544,6 +8548,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con { .line = __location__, .name = _NBT_NAME("_MA_MA_SB_A", 0x00, NULL), + .comment= "C:MHOMED vs. B:BEST (C:ALL) => B:MHOMED", .skip = (ctx->addresses_all_num < 3), .wins = { .nb_flags = 0, @@ -8576,6 +8581,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con { .line = __location__, .name = _NBT_NAME("_MA_MA_SB_PRA", 0x00, NULL), + .comment= "C:MHOMED vs. B:BEST (C:BEST) => C:MHOMED", .skip = (ctx->addresses_all_num < 2), .wins = { .nb_flags = 0, @@ -8607,7 +8613,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con { .line = __location__, .name = _NBT_NAME("_MA_MA_SB_O", 0x00, NULL), - + .comment= "C:MHOMED vs. B:BEST (B:B_3_4) =>C:MHOMED", .skip = (ctx->addresses_all_num < 2), .wins = { .nb_flags = 0, @@ -8638,6 +8644,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con { .line = __location__, .name = _NBT_NAME("_MA_MA_SB_N", 0x00, NULL), + .comment= "C:MHOMED vs. B:BEST (NEGATIVE) => B:BEST", .skip = (ctx->addresses_mhomed_num < 2), .wins = { .nb_flags = 0, @@ -8670,6 +8677,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .line = __location__, .section= "Test Replica vs. owned active: some more UNIQUE,MHOMED combinations", .name = _NBT_NAME("_MA_UA_SB_P", 0x00, NULL), + .comment= "C:MHOMED vs. B:UNIQUE,BEST (C:MHOMED) => B:MHOMED", .skip = (ctx->addresses_all_num < 2), .wins = { .nb_flags = 0, @@ -8700,6 +8708,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con { .line = __location__, .name = _NBT_NAME("_UA_UA_DI_PRA", 0x00, NULL), + .comment= "C:BEST vs. B:BEST2 (C:BEST2,LR:BEST2) => C:BEST", .skip = (ctx->addresses_all_num < 2), .wins = { .nb_flags = 0, @@ -8731,6 +8740,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con { .line = __location__, .name = _NBT_NAME("_UA_UA_DI_A", 0x00, NULL), + .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED", .skip = (ctx->addresses_all_num < 3), .wins = { .nb_flags = 0, @@ -8761,6 +8771,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con { .line = __location__, .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL), + .comment= "C:BEST vs. B:BEST (C:ALL) => B:MHOMED", .skip = (ctx->addresses_all_num < 3), .wins = { .nb_flags = 0, @@ -9046,7 +9057,11 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con action = "NOT REPLACE"; } - printf("%s => %s\n", nbt_name_string(ctx, &records[i].name), action); + printf("%s%s%s => %s\n", + nbt_name_string(ctx, &records[i].name), + (records[i].comment?": ":""), + (records[i].comment?records[i].comment:""), + action); /* Prepare for multi homed registration */ ZERO_STRUCT(records[i].defend); -- cgit From bf6ac478483b90c72d78168e4b721ab5efa2a3ab Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 5 Dec 2005 10:15:56 +0000 Subject: r12068: a better fix to prevent crashing, on errors metze (This used to be commit 7b20f8e66d55774877ec1441175fb707856c6609) --- source4/torture/nbt/winsreplication.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 6bf25146fe..4ca9ed77cd 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -1096,8 +1096,6 @@ static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx) } }; - if (!ctx) return False; - name.name = "_SAME_OWNER_A"; name.type = 0; name.scope = NULL; @@ -4634,8 +4632,6 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) } }}; /* do not add entries here, this should be the last record! */ - if (!ctx) return False; - wins_name_r1 = &wins_name1; wins_name_r2 = &wins_name2; @@ -6385,8 +6381,6 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c }, }; - if (!ctx) return False; - printf("Test Replica records vs. owned released records\n"); for(i=0; ret && i < ARRAY_SIZE(records); i++) { @@ -9018,8 +9012,6 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con }, }; - if (!ctx) return False; - if (!ctx->nbtsock_srv) { printf("SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n", lp_nbt_port()); @@ -9511,6 +9503,7 @@ BOOL torture_nbt_winsreplication_quick(void) ret &= test_wins_replication(mem_ctx, address); ctx = test_create_conflict_ctx(mem_ctx, address); + if (!ctx) return False; ret &= test_conflict_same_owner(ctx); ret &= test_conflict_owned_released_vs_replica(ctx); @@ -9549,6 +9542,7 @@ BOOL torture_nbt_winsreplication(void) ret &= test_wins_replication(mem_ctx, address); ctx = test_create_conflict_ctx(mem_ctx, address); + if (!ctx) return False; ret &= test_conflict_same_owner(ctx); ret &= test_conflict_different_owner(ctx); -- cgit From 9286235cf8117bbde7e4c53fbc91373d0c3f4039 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 5 Dec 2005 10:24:07 +0000 Subject: r12069: fix typo metze (This used to be commit 3c442ccb594d1a781e42f2268a3582578ae82d76) --- source4/torture/nbt/winsreplication.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 4ca9ed77cd..7ab53c9679 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -8765,7 +8765,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con { .line = __location__, .name = _NBT_NAME("_UA_MA_DI_A", 0x00, NULL), - .comment= "C:BEST vs. B:BEST (C:ALL) => B:MHOMED", + .comment= "C:BEST vs. B:BEST2 (C:ALL) => B:MHOMED", .skip = (ctx->addresses_all_num < 3), .wins = { .nb_flags = 0, -- cgit From 37cc5873e068716401ff0146842d00cdb1d935c4 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 5 Dec 2005 15:47:15 +0000 Subject: r12075: remove NBT-WINSREPLICATION-QUICK test, as we now pass the NBT-WINSREPLICATION test metze (This used to be commit 224dab45ab8de9fd4288c473b141541614cde422) --- source4/torture/nbt/winsreplication.c | 39 ----------------------------------- 1 file changed, 39 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 7ab53c9679..3767722e35 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -9474,45 +9474,6 @@ static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket } } -/* - test WINS replication operations -*/ -BOOL torture_nbt_winsreplication_quick(void) -{ - const char *address; - struct nbt_name name; - TALLOC_CTX *mem_ctx = talloc_new(NULL); - NTSTATUS status; - BOOL ret = True; - struct test_wrepl_conflict_conn *ctx; - - make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host")); - - /* do an initial name resolution to find its IP */ - status = resolve_name(&name, mem_ctx, &address, NULL); - if (!NT_STATUS_IS_OK(status)) { - printf("Failed to resolve %s - %s\n", - name.name, nt_errstr(status)); - talloc_free(mem_ctx); - return False; - } - - ret &= test_assoc_ctx1(mem_ctx, address); - ret &= test_assoc_ctx2(mem_ctx, address); - - ret &= test_wins_replication(mem_ctx, address); - - ctx = test_create_conflict_ctx(mem_ctx, address); - if (!ctx) return False; - - ret &= test_conflict_same_owner(ctx); - ret &= test_conflict_owned_released_vs_replica(ctx); - - talloc_free(mem_ctx); - - return ret; -} - /* test WINS replication operations */ -- cgit From 36acd6e79c8cb881b9c333313402d993a6d0f511 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 12 Dec 2005 21:31:42 +0000 Subject: r12200: - move the the winsreplication client and server code to the packet_context system - this needs to be in one big patch, because of the merging code, that changes client in server connections and the other way around - use socket_connect_send/_recv() in the client code metze (This used to be commit f0105b7fcdc3032d22444a1973927fff2dd9a06f) --- source4/torture/nbt/winsreplication.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 3767722e35..578fff1c5a 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -103,6 +103,8 @@ static BOOL test_assoc_ctx1(TALLOC_CTX *mem_ctx, const char *address) struct wrepl_socket *wrepl_socket2; struct wrepl_associate associate2; struct wrepl_pull_table pull_table; + struct wrepl_packet packet; + struct wrepl_send_ctrl ctrl; struct wrepl_packet *rep_packet; struct wrepl_associate_stop assoc_stop; NTSTATUS status; @@ -137,9 +139,14 @@ static BOOL test_assoc_ctx1(TALLOC_CTX *mem_ctx, const char *address) printf("association context (conn2): 0x%x\n", associate2.out.assoc_ctx); printf("Send a replication table query, with assoc 1 (conn2), the anwser should be on conn1\n"); - pull_table.in.assoc_ctx = associate1.out.assoc_ctx; - req = wrepl_pull_table_send(wrepl_socket2, &pull_table); - req->send_only = True; + ZERO_STRUCT(packet); + packet.opcode = WREPL_OPCODE_BITS; + packet.assoc_ctx = associate1.out.assoc_ctx; + packet.mess_type = WREPL_REPLICATION; + packet.message.replication.command = WREPL_REPL_TABLE_QUERY; + ZERO_STRUCT(ctrl); + ctrl.send_only = True; + req = wrepl_request_send(wrepl_socket2, &packet, &ctrl); status = wrepl_request_recv(req, mem_ctx, &rep_packet); CHECK_STATUS(status, NT_STATUS_OK); @@ -281,7 +288,7 @@ static BOOL test_wins_replication(TALLOC_CTX *mem_ctx, const char *address) packet.mess_type = WREPL_STOP_ASSOCIATION; packet.message.stop.reason = 0; - req = wrepl_request_send(wrepl_socket, &packet); + req = wrepl_request_send(wrepl_socket, &packet, NULL); talloc_free(req); printf("failed - We are not a valid pull partner for the server\n"); -- cgit From d8c4862d8cb4ab0c87e35f0aa6a91731f55d718b Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 13 Dec 2005 17:39:24 +0000 Subject: r12211: remove unused element metze (This used to be commit 1c0586868083455780aec38f638277b313dcfa1a) --- source4/torture/nbt/winsreplication.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 578fff1c5a..2f024878d6 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -1193,7 +1193,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) BOOL sgroup_merge; struct wrepl_wins_owner *merge_owner; BOOL sgroup_cleanup; - } r1, r2, result; + } r1, r2; } records[] = { /* * NOTE: the first record and the last applied one -- cgit From d4de4c2d210d2e8c9b5aedf70695594809ad6a0b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 30 Dec 2005 13:16:54 +0000 Subject: r12608: Remove some unused #include lines. (This used to be commit 70e7449318aa0e9d2639c76730a7d1683b2f4981) --- source4/torture/nbt/winsreplication.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 2f024878d6..f7f9665a6d 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -22,11 +22,9 @@ */ #include "includes.h" -#include "libcli/nbt/libnbt.h" #include "libcli/wrepl/winsrepl.h" #include "lib/events/events.h" #include "lib/socket/socket.h" -#include "system/time.h" #define CHECK_STATUS(status, correct) do { \ if (!NT_STATUS_EQUAL(status, correct)) { \ -- cgit From f55ea8bb3dca868e21663cd90eaea7a35cd7886c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 9 Jan 2006 22:12:53 +0000 Subject: r12804: This patch reworks the Samba4 sockets layer to use a socket_address structure that is more generic than just 'IP/port'. It now passes make test, and has been reviewed and updated by metze. (Thankyou *very* much). This passes 'make test' as well as kerberos use (not currently in the testsuite). The original purpose of this patch was to have Samba able to pass a socket address stucture from the BSD layer into the kerberos routines and back again. It also removes nbt_peer_addr, which was being used for a similar purpose. It is a large change, but worthwhile I feel. Andrew Bartlett (This used to be commit 88198c4881d8620a37086f80e4da5a5b71c5bbb2) --- source4/torture/nbt/winsreplication.c | 59 ++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 21 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index f7f9665a6d..a6089fc2db 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -338,8 +338,8 @@ struct test_wrepl_conflict_conn { struct wrepl_wins_owner a, b, c, x; - const char *myaddr; - const char *myaddr2; + struct socket_address *myaddr; + struct socket_address *myaddr2; struct nbt_name_socket *nbtsock; struct nbt_name_socket *nbtsock2; @@ -551,6 +551,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem struct test_wrepl_conflict_conn *ctx; struct wrepl_associate associate; struct wrepl_pull_table pull_table; + struct socket_address *nbt_srv_addr; NTSTATUS status; uint32_t i; @@ -615,27 +616,34 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem talloc_free(pull_table.out.partners); - ctx->myaddr = talloc_strdup(mem_ctx, iface_best_ip(address)); + ctx->nbtsock = nbt_name_socket_init(ctx, NULL); + if (!ctx->nbtsock) return NULL; + + ctx->myaddr = socket_address_from_strings(mem_ctx, ctx->nbtsock->sock->backend_name, iface_best_ip(address), 0); if (!ctx->myaddr) return NULL; for (i = 0; i < iface_count(); i++) { - if (strcmp(ctx->myaddr, iface_n_ip(i)) == 0) continue; - ctx->myaddr2 = talloc_strdup(mem_ctx, iface_n_ip(i)); + if (strcmp(ctx->myaddr->addr, iface_n_ip(i)) == 0) continue; + ctx->myaddr2 = socket_address_from_strings(mem_ctx, ctx->nbtsock->sock->backend_name, iface_n_ip(i), 0); if (!ctx->myaddr2) return NULL; break; } - ctx->nbtsock = nbt_name_socket_init(ctx, NULL); - if (!ctx->nbtsock) return NULL; - - status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0, 0); + status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0); if (!NT_STATUS_IS_OK(status)) return NULL; ctx->nbtsock_srv = nbt_name_socket_init(ctx, NULL); if (!ctx->nbtsock_srv) return NULL; - status = socket_listen(ctx->nbtsock_srv->sock, ctx->myaddr, lp_nbt_port(), 0, 0); + /* Make a port 137 version of ctx->myaddr */ + nbt_srv_addr = socket_address_from_strings(mem_ctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lp_nbt_port()); + if (!nbt_srv_addr) return NULL; + + /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */ + status = socket_listen(ctx->nbtsock_srv->sock, nbt_srv_addr, 0, 0); + talloc_free(nbt_srv_addr); if (!NT_STATUS_IS_OK(status)) { + /* this isn't fatal */ talloc_free(ctx->nbtsock_srv); ctx->nbtsock_srv = NULL; } @@ -644,14 +652,23 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem ctx->nbtsock2 = nbt_name_socket_init(ctx, NULL); if (!ctx->nbtsock2) return NULL; - status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0, 0); + status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0); if (!NT_STATUS_IS_OK(status)) return NULL; ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx); if (!ctx->nbtsock_srv2) return NULL; - status = socket_listen(ctx->nbtsock_srv2->sock, ctx->myaddr2, lp_nbt_port(), 0, 0); + /* Make a port 137 version of ctx->myaddr2 */ + nbt_srv_addr = socket_address_from_strings(mem_ctx, + ctx->nbtsock_srv->sock->backend_name, + ctx->myaddr2->addr, lp_nbt_port()); + if (!nbt_srv_addr) return NULL; + + /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */ + status = socket_listen(ctx->nbtsock_srv2->sock, ctx->myaddr2, 0, 0); + talloc_free(nbt_srv_addr); if (!NT_STATUS_IS_OK(status)) { + /* this isn't fatal */ talloc_free(ctx->nbtsock_srv2); ctx->nbtsock_srv2 = NULL; } @@ -661,7 +678,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem ctx->addresses_best = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best_num); if (!ctx->addresses_best) return NULL; ctx->addresses_best[0].owner = ctx->b.address; - ctx->addresses_best[0].ip = ctx->myaddr; + ctx->addresses_best[0].ip = ctx->myaddr->addr; ctx->addresses_all_num = iface_count(); ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num); @@ -677,15 +694,15 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem ctx->addresses_best2 = talloc_array(ctx, struct wrepl_ip, ctx->addresses_best2_num); if (!ctx->addresses_best2) return NULL; ctx->addresses_best2[0].owner = ctx->b.address; - ctx->addresses_best2[0].ip = ctx->myaddr2; + ctx->addresses_best2[0].ip = ctx->myaddr2->addr; ctx->addresses_mhomed_num = 2; ctx->addresses_mhomed = talloc_array(ctx, struct wrepl_ip, ctx->addresses_mhomed_num); if (!ctx->addresses_mhomed) return NULL; ctx->addresses_mhomed[0].owner = ctx->b.address; - ctx->addresses_mhomed[0].ip = ctx->myaddr; + ctx->addresses_mhomed[0].ip = ctx->myaddr->addr; ctx->addresses_mhomed[1].owner = ctx->b.address; - ctx->addresses_mhomed[1].ip = ctx->myaddr2; + ctx->addresses_mhomed[1].ip = ctx->myaddr2->addr; } return ctx; @@ -6545,7 +6562,7 @@ struct test_conflict_owned_active_vs_replica_struct { static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock, struct nbt_name_packet *req_packet, - const struct nbt_peer_socket *src); + struct socket_address *src); static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_conn *ctx) { @@ -9220,7 +9237,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con for (j=0; j < count; j++) { struct nbt_name_socket *nbtsock = ctx->nbtsock; - if (ctx->myaddr2 && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2) == 0) { + if (ctx->myaddr2 && strcmp(records[i].wins.ips[j].ip, ctx->myaddr2->addr) == 0) { nbtsock = ctx->nbtsock2; } @@ -9312,7 +9329,7 @@ done: static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_socket *nbtsock, struct nbt_name_packet *req_packet, - const struct nbt_peer_socket *src) + struct socket_address *src) { struct nbt_name *name; struct nbt_name_packet *rep_packet; @@ -9407,7 +9424,7 @@ static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_ static void test_conflict_owned_active_vs_replica_handler_release(struct nbt_name_socket *nbtsock, struct nbt_name_packet *req_packet, - const struct nbt_peer_socket *src) + struct socket_address *src) { struct nbt_name *name; struct nbt_name_packet *rep_packet; @@ -9460,7 +9477,7 @@ static void test_conflict_owned_active_vs_replica_handler_release(struct nbt_nam static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock, struct nbt_name_packet *req_packet, - const struct nbt_peer_socket *src) + struct socket_address *src) { struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private; -- cgit From e1622519d3d219d3828c71cda55e87eb36041d43 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 13 Jan 2006 16:44:32 +0000 Subject: r12907: skip some tests for make quicktest in NBT-WINSREPLICATION metze (This used to be commit b206c5e87c791ac8f2ecf5b7ef6b2622ad735f54) --- source4/torture/nbt/winsreplication.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index a6089fc2db..5b8aa0119a 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -9524,6 +9524,8 @@ BOOL torture_nbt_winsreplication(void) ret &= test_wins_replication(mem_ctx, address); + if (lp_parm_bool(-1, "torture", "quick", False)) goto done; + ctx = test_create_conflict_ctx(mem_ctx, address); if (!ctx) return False; @@ -9532,6 +9534,7 @@ BOOL torture_nbt_winsreplication(void) ret &= test_conflict_owned_released_vs_replica(ctx); ret &= test_conflict_owned_active_vs_replica(ctx); +done: talloc_free(mem_ctx); return ret; -- cgit From 63bbc2aea6edf51fb4c2dd678b780b2ade9542ce Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 19 Jan 2006 13:01:12 +0000 Subject: r13035: active,special group replicas are overwritten by tombstone,special group replicas metze (This used to be commit cf669e4b2a4dcfb080cbb01a108797acad802f36) --- source4/torture/nbt/winsreplication.c | 122 ++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 5b8aa0119a..cf6f3d4ed7 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -4623,6 +4623,128 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .apply_expected = True, } }, + + /* + * sgroup,active vs. sgroup,tombstone different no addresses, special + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:NULL", + .extra = True, + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4), + .ips = addresses_B_3_4_X_3_4, + .apply_expected = True, + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = 0, + .ips = NULL, + .apply_expected = True, + } + }, + /* + * sgroup,active vs. sgroup,tombstone different addresses + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4", + .extra = True, + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4), + .ips = addresses_B_3_4_X_3_4, + .apply_expected = True, + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_A_3_4), + .ips = addresses_A_3_4, + .apply_expected = True, + } + }, + /* + * sgroup,active vs. sgroup,tombstone subset addresses + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .comment= "A:B_3_4_X_3_4 vs. B:B_3_4 => B:B_3_4", + .extra = True, + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4), + .ips = addresses_B_3_4_X_3_4, + .apply_expected = True, + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4), + .ips = addresses_B_3_4, + .apply_expected = True, + } + }, + /* + * sgroup,active vs. sgroup,active same addresses + * => should be replaced + */ + { + .line = __location__, + .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), + .comment= "A:B_3_4_X_3_4 vs. B:B_3_4_X_3_4 => B:B_3_4_X_3_4", + .extra = True, + .r1 = { + .owner = &ctx->a, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_ACTIVE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4), + .ips = addresses_B_3_4_X_3_4, + .apply_expected = True, + }, + .r2 = { + .owner = &ctx->b, + .type = WREPL_TYPE_SGROUP, + .state = WREPL_STATE_TOMBSTONE, + .node = WREPL_NODE_B, + .is_static = False, + .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4), + .ips = addresses_B_3_4_X_3_4, + .apply_expected = True, + } + }, + /* * This should be the last record in this array, * we need to make sure the we leave a tombstoned unique entry -- cgit From f2f3e1801b54e6ead595d66ea7c798fc2df22a0a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 22 Feb 2006 12:10:29 +0000 Subject: r13627: split the NBT-WINSREPLICATION tests into multiple tests metze (This used to be commit ae559920e1d227e4e787fe34d908a965b922b284) --- source4/torture/nbt/winsreplication.c | 67 ++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 4 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index cf6f3d4ed7..b53c55ca08 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -9619,16 +9619,15 @@ static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket } /* - test WINS replication operations + test simple WINS replication operations */ -BOOL torture_nbt_winsreplication(void) +BOOL torture_nbt_winsreplication_simple(void) { const char *address; struct nbt_name name; TALLOC_CTX *mem_ctx = talloc_new(NULL); NTSTATUS status; BOOL ret = True; - struct test_wrepl_conflict_conn *ctx; make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host")); @@ -9646,13 +9645,73 @@ BOOL torture_nbt_winsreplication(void) ret &= test_wins_replication(mem_ctx, address); - if (lp_parm_bool(-1, "torture", "quick", False)) goto done; +done: + talloc_free(mem_ctx); + + return ret; +} + +/* + test WINS replication replica conflicts operations +*/ +BOOL torture_nbt_winsreplication_replica(void) +{ + const char *address; + struct nbt_name name; + TALLOC_CTX *mem_ctx = talloc_new(NULL); + NTSTATUS status; + BOOL ret = True; + struct test_wrepl_conflict_conn *ctx; + + make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host")); + + /* do an initial name resolution to find its IP */ + status = resolve_name(&name, mem_ctx, &address, NULL); + if (!NT_STATUS_IS_OK(status)) { + printf("Failed to resolve %s - %s\n", + name.name, nt_errstr(status)); + talloc_free(mem_ctx); + return False; + } ctx = test_create_conflict_ctx(mem_ctx, address); if (!ctx) return False; ret &= test_conflict_same_owner(ctx); ret &= test_conflict_different_owner(ctx); + +done: + talloc_free(mem_ctx); + + return ret; +} + +/* + test WINS replication owned conflicts operations +*/ +BOOL torture_nbt_winsreplication_owned(void) +{ + const char *address; + struct nbt_name name; + TALLOC_CTX *mem_ctx = talloc_new(NULL); + NTSTATUS status; + BOOL ret = True; + struct test_wrepl_conflict_conn *ctx; + + make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host")); + + /* do an initial name resolution to find its IP */ + status = resolve_name(&name, mem_ctx, &address, NULL); + if (!NT_STATUS_IS_OK(status)) { + printf("Failed to resolve %s - %s\n", + name.name, nt_errstr(status)); + talloc_free(mem_ctx); + return False; + } + + ctx = test_create_conflict_ctx(mem_ctx, address); + if (!ctx) return False; + ret &= test_conflict_owned_released_vs_replica(ctx); ret &= test_conflict_owned_active_vs_replica(ctx); -- cgit From 4ac2be99588b48b0652a524bf12fb1aa9c3f5fbb Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 7 Mar 2006 11:07:23 +0000 Subject: r13924: Split more prototypes out of include/proto.h + initial work on header file dependencies (This used to be commit 122835876748a3eaf5e8d31ad1abddab9acb8781) --- source4/torture/nbt/winsreplication.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index b53c55ca08..25056f7b9c 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -25,6 +25,9 @@ #include "libcli/wrepl/winsrepl.h" #include "lib/events/events.h" #include "lib/socket/socket.h" +#include "libcli/resolve/resolve.h" +#include "system/network.h" +#include "netif/netif.h" #define CHECK_STATUS(status, correct) do { \ if (!NT_STATUS_EQUAL(status, correct)) { \ -- cgit From 0b18c8f863101cfe9722aafe12a161afc9aa3a48 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 13 Mar 2006 14:35:45 +0000 Subject: r14318: fix warnings metze (This used to be commit c99c057354f1815e8ef39f7a22a98c24f7807968) --- source4/torture/nbt/winsreplication.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 25056f7b9c..d7011cb8c9 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -9648,7 +9648,6 @@ BOOL torture_nbt_winsreplication_simple(void) ret &= test_wins_replication(mem_ctx, address); -done: talloc_free(mem_ctx); return ret; @@ -9683,7 +9682,6 @@ BOOL torture_nbt_winsreplication_replica(void) ret &= test_conflict_same_owner(ctx); ret &= test_conflict_different_owner(ctx); -done: talloc_free(mem_ctx); return ret; @@ -9718,7 +9716,6 @@ BOOL torture_nbt_winsreplication_owned(void) ret &= test_conflict_owned_released_vs_replica(ctx); ret &= test_conflict_owned_active_vs_replica(ctx); -done: talloc_free(mem_ctx); return ret; -- cgit From d2d9c0f25be91ec6baa719217ca01904f8f381a6 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 13 Mar 2006 15:03:51 +0000 Subject: r14319: this is a test to see if this help to run NBT-WINSREPLICATION-OWNED on more systems on the buildfarm successful... metze (This used to be commit 0507203c35207b494638b3d0dfb0c2ab420ba9e2) --- source4/torture/nbt/winsreplication.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index d7011cb8c9..ca1bd720d8 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -9541,7 +9541,7 @@ static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_ /* make sure we push the reply to the wire */ event_loop_once(nbtsock->event_ctx); - msleep(25); + msleep(250); rec->defend.timeout = 0; rec->defend.ret = True; @@ -9594,7 +9594,7 @@ static void test_conflict_owned_active_vs_replica_handler_release(struct nbt_nam /* make sure we push the reply to the wire */ event_loop_once(nbtsock->event_ctx); - msleep(25); + msleep(250); rec->defend.timeout = 0; rec->defend.ret = True; -- cgit From 22244f0e9bcbdc52a0410861adb822197a583257 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 15 Mar 2006 11:40:43 +0000 Subject: r14441: try to get more hosts on the build farm pass the NBT-WINSREPLICATION-OWNED test metze (This used to be commit 7fa5ae8cce16f22d8959519a67ba4894ddbb6b9d) --- source4/torture/nbt/winsreplication.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index ca1bd720d8..2ac9d1cfb3 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -9541,7 +9541,7 @@ static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_ /* make sure we push the reply to the wire */ event_loop_once(nbtsock->event_ctx); - msleep(250); + msleep(500); rec->defend.timeout = 0; rec->defend.ret = True; @@ -9594,7 +9594,7 @@ static void test_conflict_owned_active_vs_replica_handler_release(struct nbt_nam /* make sure we push the reply to the wire */ event_loop_once(nbtsock->event_ctx); - msleep(250); + msleep(500); rec->defend.timeout = 0; rec->defend.ret = True; -- cgit From 8528016978b084213ef53d66e1b6e831b1a01acc Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 16 Mar 2006 00:23:11 +0000 Subject: r14464: Don't include ndr_BASENAME.h files unless strictly required, instead try to include just the BASENAME.h files (containing only structs) (This used to be commit 3dd477ca5147f28a962b8437e2611a8222d706bd) --- source4/torture/nbt/winsreplication.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 2ac9d1cfb3..07c4865bdf 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -28,6 +28,7 @@ #include "libcli/resolve/resolve.h" #include "system/network.h" #include "netif/netif.h" +#include "librpc/gen_ndr/ndr_nbt.h" #define CHECK_STATUS(status, correct) do { \ if (!NT_STATUS_EQUAL(status, correct)) { \ -- cgit From 909b111f587705a45f63540b39968f1af58a9b5d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 25 Mar 2006 16:01:28 +0000 Subject: r14720: Add torture_context argument to all torture tests (This used to be commit 3c7a5ce29108dd82210dc3e1f00414f545949e1d) --- source4/torture/nbt/winsreplication.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 07c4865bdf..8b0dabca23 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -29,6 +29,7 @@ #include "system/network.h" #include "netif/netif.h" #include "librpc/gen_ndr/ndr_nbt.h" +#include "torture/torture.h" #define CHECK_STATUS(status, correct) do { \ if (!NT_STATUS_EQUAL(status, correct)) { \ @@ -9625,7 +9626,7 @@ static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket /* test simple WINS replication operations */ -BOOL torture_nbt_winsreplication_simple(void) +BOOL torture_nbt_winsreplication_simple(struct torture_context *torture) { const char *address; struct nbt_name name; @@ -9657,7 +9658,7 @@ BOOL torture_nbt_winsreplication_simple(void) /* test WINS replication replica conflicts operations */ -BOOL torture_nbt_winsreplication_replica(void) +BOOL torture_nbt_winsreplication_replica(struct torture_context *torture) { const char *address; struct nbt_name name; @@ -9691,7 +9692,7 @@ BOOL torture_nbt_winsreplication_replica(void) /* test WINS replication owned conflicts operations */ -BOOL torture_nbt_winsreplication_owned(void) +BOOL torture_nbt_winsreplication_owned(struct torture_context *torture) { const char *address; struct nbt_name name; -- cgit From 7a9076cba2de14b4cd82207efb81950639a2f266 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 25 Apr 2006 23:46:41 +0000 Subject: r15259: try to find the place that causes trouble on some build farm host on the NBT-WINSREPLICATION-OWNED test metze (This used to be commit 72ae0dbaab0602d025852bfc41e06e204ff21681) --- source4/torture/nbt/winsreplication.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 8b0dabca23..e66d840e4d 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -9543,7 +9543,7 @@ static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_ /* make sure we push the reply to the wire */ event_loop_once(nbtsock->event_ctx); - msleep(500); + msleep(1000); rec->defend.timeout = 0; rec->defend.ret = True; @@ -9596,7 +9596,7 @@ static void test_conflict_owned_active_vs_replica_handler_release(struct nbt_nam /* make sure we push the reply to the wire */ event_loop_once(nbtsock->event_ctx); - msleep(500); + msleep(1000); rec->defend.timeout = 0; rec->defend.ret = True; -- cgit From a2eca9174c7803732658a1e6f7e8ed873c4fb6fd Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 17 Aug 2006 13:37:04 +0000 Subject: r17586: merge lib/netif into lib/socket and use -lnsl -lsocket on the configure check for the interfaces. should fix the build on some old sun boxes metze (This used to be commit f20e251bfd9f1eb7ce5c00739631b1625a2aa467) --- source4/torture/nbt/winsreplication.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index e66d840e4d..fe0d0784e1 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -27,7 +27,7 @@ #include "lib/socket/socket.h" #include "libcli/resolve/resolve.h" #include "system/network.h" -#include "netif/netif.h" +#include "lib/socket/netif.h" #include "librpc/gen_ndr/ndr_nbt.h" #include "torture/torture.h" -- cgit From 8773e743c518578584d07d35ffdafdd598af88b0 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 16 Oct 2006 13:06:41 +0000 Subject: r19339: Merge my 4.0-unittest branch. This adds an API for more fine-grained output in the testsuite rather than just True or False for a set of tests. The aim is to use this for: * known failure lists (run all tests and detect tests that started working or started failing). This would allow us to get rid of the RPC-SAMBA3-* tests * nicer torture output * simplification of the testsuite system * compatibility with other unit testing systems * easier usage of smbtorture (being able to run one test and automatically set up the environment for that) This is still a work-in-progress; expect more updates over the next couple of days. (This used to be commit 0eb6097305776325c75081356309115f445a7218) --- source4/torture/nbt/winsreplication.c | 3131 ++++++++++++++++----------------- 1 file changed, 1547 insertions(+), 1584 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index fe0d0784e1..0639155f00 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -30,40 +30,24 @@ #include "lib/socket/netif.h" #include "librpc/gen_ndr/ndr_nbt.h" #include "torture/torture.h" +#include "torture/nbt/proto.h" -#define CHECK_STATUS(status, correct) do { \ - if (!NT_STATUS_EQUAL(status, correct)) { \ - printf("(%s) Incorrect status %s - should be %s\n", \ - __location__, nt_errstr(status), nt_errstr(correct)); \ - ret = False; \ - goto done; \ - }} while (0) +#define CHECK_STATUS(tctx, status, correct) \ + torture_assert_ntstatus_equal(tctx, status, correct, \ + "Incorrect status") -#define CHECK_VALUE(v, correct) do { \ - if ((v) != (correct)) { \ - printf("(%s) Incorrect value %s=%d - should be %d\n", \ - __location__, #v, v, correct); \ - ret = False; \ - goto done; \ - }} while (0) +#define CHECK_VALUE(tctx, v, correct) \ + torture_assert(tctx, (v) == (correct), \ + talloc_asprintf(tctx, "Incorrect value %s=%d - should be %d", \ + #v, v, correct)) -#define CHECK_VALUE_UINT64(v, correct) do { \ - if ((v) != (correct)) { \ - printf("(%s) Incorrect value %s=%llu - should be %llu\n", \ - __location__, #v, (long long)v, (long long)correct); \ - ret = False; \ - goto done; \ - }} while (0) +#define CHECK_VALUE_UINT64(tctx, v, correct) \ + torture_assert(tctx, (v) == (correct), \ + talloc_asprintf(tctx, "Incorrect value %s=%llu - should be %llu", \ + #v, (long long)v, (long long)correct)) -#define CHECK_VALUE_STRING(v, correct) do { \ - if ( ((!v) && (correct)) || \ - ((v) && (!correct)) || \ - ((v) && (correct) && strcmp(v,correct) != 0)) { \ - printf("(%s) Incorrect value %s='%s' - should be '%s'\n", \ - __location__, #v, v, correct); \ - ret = False; \ - goto done; \ - }} while (0) +#define CHECK_VALUE_STRING(tctx, v, correct) \ + torture_assert_str_equal(tctx, v, correct, "Invalid value") #define _NBT_NAME(n,t,s) {\ .name = n,\ @@ -97,9 +81,9 @@ static const char *wrepl_name_state_string(enum wrepl_name_state state) test how assoc_ctx's are only usable on the connection they are created on. */ -static BOOL test_assoc_ctx1(TALLOC_CTX *mem_ctx, const char *address) +static bool test_assoc_ctx1(struct torture_context *tctx) { - BOOL ret = True; + bool ret = true; struct wrepl_request *req; struct wrepl_socket *wrepl_socket1; struct wrepl_associate associate1; @@ -111,76 +95,79 @@ static BOOL test_assoc_ctx1(TALLOC_CTX *mem_ctx, const char *address) struct wrepl_packet *rep_packet; struct wrepl_associate_stop assoc_stop; NTSTATUS status; + struct nbt_name name; + const char *address; - if (!lp_parm_bool(-1, "torture", "dangerous", False)) { - printf("winsrepl: cross connection assoc_ctx usage disabled - enable dangerous tests to use\n"); - return True; + if (!torture_setting_bool(tctx, "dangerous", false)) { + torture_skip(tctx, "winsrepl: cross connection assoc_ctx usage disabled - enable dangerous tests to use"); } - printf("Test if assoc_ctx is only valid on the conection it was created on\n"); + if (!torture_nbt_get_name(tctx, &name, &address)) + return false; + + torture_comment(tctx, "Test if assoc_ctx is only valid on the conection it was created on\n"); - wrepl_socket1 = wrepl_socket_init(mem_ctx, NULL); - wrepl_socket2 = wrepl_socket_init(mem_ctx, NULL); + wrepl_socket1 = wrepl_socket_init(tctx, NULL); + wrepl_socket2 = wrepl_socket_init(tctx, NULL); - printf("Setup 2 wrepl connections\n"); + torture_comment(tctx, "Setup 2 wrepl connections\n"); status = wrepl_connect(wrepl_socket1, NULL, address); - CHECK_STATUS(status, NT_STATUS_OK); + CHECK_STATUS(tctx, status, NT_STATUS_OK); status = wrepl_connect(wrepl_socket2, NULL, address); - CHECK_STATUS(status, NT_STATUS_OK); + CHECK_STATUS(tctx, status, NT_STATUS_OK); - printf("Send a start association request (conn1)\n"); + torture_comment(tctx, "Send a start association request (conn1)\n"); status = wrepl_associate(wrepl_socket1, &associate1); - CHECK_STATUS(status, NT_STATUS_OK); + CHECK_STATUS(tctx, status, NT_STATUS_OK); - printf("association context (conn1): 0x%x\n", associate1.out.assoc_ctx); + torture_comment(tctx, "association context (conn1): 0x%x\n", associate1.out.assoc_ctx); - printf("Send a start association request (conn2)\n"); + torture_comment(tctx, "Send a start association request (conn2)\n"); status = wrepl_associate(wrepl_socket2, &associate2); - CHECK_STATUS(status, NT_STATUS_OK); + CHECK_STATUS(tctx, status, NT_STATUS_OK); - printf("association context (conn2): 0x%x\n", associate2.out.assoc_ctx); + torture_comment(tctx, "association context (conn2): 0x%x\n", associate2.out.assoc_ctx); - printf("Send a replication table query, with assoc 1 (conn2), the anwser should be on conn1\n"); + torture_comment(tctx, "Send a replication table query, with assoc 1 (conn2), the anwser should be on conn1\n"); ZERO_STRUCT(packet); packet.opcode = WREPL_OPCODE_BITS; packet.assoc_ctx = associate1.out.assoc_ctx; packet.mess_type = WREPL_REPLICATION; packet.message.replication.command = WREPL_REPL_TABLE_QUERY; ZERO_STRUCT(ctrl); - ctrl.send_only = True; + ctrl.send_only = true; req = wrepl_request_send(wrepl_socket2, &packet, &ctrl); - status = wrepl_request_recv(req, mem_ctx, &rep_packet); - CHECK_STATUS(status, NT_STATUS_OK); + status = wrepl_request_recv(req, tctx, &rep_packet); + CHECK_STATUS(tctx, status, NT_STATUS_OK); - printf("Send a association request (conn2), to make sure the last request was ignored\n"); + torture_comment(tctx, "Send a association request (conn2), to make sure the last request was ignored\n"); status = wrepl_associate(wrepl_socket2, &associate2); - CHECK_STATUS(status, NT_STATUS_OK); + CHECK_STATUS(tctx, status, NT_STATUS_OK); - printf("Send a replication table query, with invalid assoc (conn1), receive answer from conn2\n"); + torture_comment(tctx, "Send a replication table query, with invalid assoc (conn1), receive answer from conn2\n"); pull_table.in.assoc_ctx = 0; req = wrepl_pull_table_send(wrepl_socket1, &pull_table); - status = wrepl_request_recv(req, mem_ctx, &rep_packet); - CHECK_STATUS(status, NT_STATUS_OK); + status = wrepl_request_recv(req, tctx, &rep_packet); + CHECK_STATUS(tctx, status, NT_STATUS_OK); - printf("Send a association request (conn1), to make sure the last request was handled correct\n"); + torture_comment(tctx, "Send a association request (conn1), to make sure the last request was handled correct\n"); status = wrepl_associate(wrepl_socket1, &associate2); - CHECK_STATUS(status, NT_STATUS_OK); + CHECK_STATUS(tctx, status, NT_STATUS_OK); assoc_stop.in.assoc_ctx = associate1.out.assoc_ctx; assoc_stop.in.reason = 4; - printf("Send a association stop request (conn1), reson: %u\n", assoc_stop.in.reason); + torture_comment(tctx, "Send a association stop request (conn1), reson: %u\n", assoc_stop.in.reason); status = wrepl_associate_stop(wrepl_socket1, &assoc_stop); - CHECK_STATUS(status, NT_STATUS_END_OF_FILE); + CHECK_STATUS(tctx, status, NT_STATUS_END_OF_FILE); assoc_stop.in.assoc_ctx = associate2.out.assoc_ctx; assoc_stop.in.reason = 0; - printf("Send a association stop request (conn2), reson: %u\n", assoc_stop.in.reason); + torture_comment(tctx, "Send a association stop request (conn2), reson: %u\n", assoc_stop.in.reason); status = wrepl_associate_stop(wrepl_socket2, &assoc_stop); - CHECK_STATUS(status, NT_STATUS_OK); + CHECK_STATUS(tctx, status, NT_STATUS_OK); -done: - printf("Close 2 wrepl connections\n"); + torture_comment(tctx, "Close 2 wrepl connections\n"); talloc_free(wrepl_socket1); talloc_free(wrepl_socket2); return ret; @@ -189,62 +176,66 @@ done: /* test if we always get back the same assoc_ctx */ -static BOOL test_assoc_ctx2(TALLOC_CTX *mem_ctx, const char *address) +static bool test_assoc_ctx2(struct torture_context *tctx) { - BOOL ret = True; struct wrepl_socket *wrepl_socket; struct wrepl_associate associate; uint32_t assoc_ctx1; + struct nbt_name name; NTSTATUS status; + const char *address; + + if (!torture_nbt_get_name(tctx, &name, &address)) + return false; - printf("Test if we always get back the same assoc_ctx\n"); + torture_comment(tctx, "Test if we always get back the same assoc_ctx\n"); - wrepl_socket = wrepl_socket_init(mem_ctx, NULL); + wrepl_socket = wrepl_socket_init(tctx, NULL); - printf("Setup wrepl connections\n"); + torture_comment(tctx, "Setup wrepl connections\n"); status = wrepl_connect(wrepl_socket, NULL, address); - CHECK_STATUS(status, NT_STATUS_OK); + CHECK_STATUS(tctx, status, NT_STATUS_OK); - - printf("Send 1st start association request\n"); + torture_comment(tctx, "Send 1st start association request\n"); status = wrepl_associate(wrepl_socket, &associate); - CHECK_STATUS(status, NT_STATUS_OK); + CHECK_STATUS(tctx, status, NT_STATUS_OK); assoc_ctx1 = associate.out.assoc_ctx; - printf("1st association context: 0x%x\n", associate.out.assoc_ctx); + torture_comment(tctx, "1st association context: 0x%x\n", associate.out.assoc_ctx); - printf("Send 2nd start association request\n"); + torture_comment(tctx, "Send 2nd start association request\n"); status = wrepl_associate(wrepl_socket, &associate); - CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1); - CHECK_STATUS(status, NT_STATUS_OK); - printf("2nd association context: 0x%x\n", associate.out.assoc_ctx); + torture_assert_ntstatus_ok(tctx, status, "2nd start association failed"); + torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1, + "Different context returned"); + torture_comment(tctx, "2nd association context: 0x%x\n", associate.out.assoc_ctx); - printf("Send 3rd start association request\n"); + torture_comment(tctx, "Send 3rd start association request\n"); status = wrepl_associate(wrepl_socket, &associate); - CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1); - CHECK_STATUS(status, NT_STATUS_OK); - printf("3rd association context: 0x%x\n", associate.out.assoc_ctx); + torture_assert(tctx, associate.out.assoc_ctx == assoc_ctx1, + "Different context returned"); + CHECK_STATUS(tctx, status, NT_STATUS_OK); + torture_comment(tctx, "3rd association context: 0x%x\n", associate.out.assoc_ctx); -done: - printf("Close wrepl connections\n"); + torture_comment(tctx, "Close wrepl connections\n"); talloc_free(wrepl_socket); - return ret; + return true; } /* display a replication entry */ -static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_name *name) +static void display_entry(TALLOC_CTX *tctx, struct wrepl_name *name) { int i; - printf("%s\n", nbt_name_string(mem_ctx, &name->name)); - printf("\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n", + torture_comment(tctx, "%s\n", nbt_name_string(tctx, &name->name)); + torture_comment(tctx, "\tTYPE:%u STATE:%u NODE:%u STATIC:%u VERSION_ID: %llu\n", name->type, name->state, name->node, name->is_static, (long long)name->version_id); - printf("\tRAW_FLAGS: 0x%08X OWNER: %-15s\n", + torture_comment(tctx, "\tRAW_FLAGS: 0x%08X OWNER: %-15s\n", name->raw_flags, name->owner); for (i=0;inum_addresses;i++) { - printf("\tADDR: %-15s OWNER: %-15s\n", + torture_comment(tctx, "\tADDR: %-15s OWNER: %-15s\n", name->addresses[i].address, name->addresses[i].owner); } } @@ -252,35 +243,39 @@ static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_name *name) /* test a full replication dump from a WINS server */ -static BOOL test_wins_replication(TALLOC_CTX *mem_ctx, const char *address) +static bool test_wins_replication(struct torture_context *tctx) { - BOOL ret = True; struct wrepl_socket *wrepl_socket; NTSTATUS status; int i, j; struct wrepl_associate associate; struct wrepl_pull_table pull_table; struct wrepl_pull_names pull_names; + struct nbt_name name; + const char *address; - printf("Test one pull replication cycle\n"); + if (!torture_nbt_get_name(tctx, &name, &address)) + return false; - wrepl_socket = wrepl_socket_init(mem_ctx, NULL); + torture_comment(tctx, "Test one pull replication cycle\n"); + + wrepl_socket = wrepl_socket_init(tctx, NULL); - printf("Setup wrepl connections\n"); + torture_comment(tctx, "Setup wrepl connections\n"); status = wrepl_connect(wrepl_socket, NULL, address); - CHECK_STATUS(status, NT_STATUS_OK); + CHECK_STATUS(tctx, status, NT_STATUS_OK); - printf("Send a start association request\n"); + torture_comment(tctx, "Send a start association request\n"); status = wrepl_associate(wrepl_socket, &associate); - CHECK_STATUS(status, NT_STATUS_OK); + CHECK_STATUS(tctx, status, NT_STATUS_OK); - printf("association context: 0x%x\n", associate.out.assoc_ctx); + torture_comment(tctx, "association context: 0x%x\n", associate.out.assoc_ctx); - printf("Send a replication table query\n"); + torture_comment(tctx, "Send a replication table query\n"); pull_table.in.assoc_ctx = associate.out.assoc_ctx; - status = wrepl_pull_table(wrepl_socket, mem_ctx, &pull_table); + status = wrepl_pull_table(wrepl_socket, tctx, &pull_table); if (NT_STATUS_EQUAL(NT_STATUS_NETWORK_ACCESS_DENIED,status)) { struct wrepl_packet packet; struct wrepl_request *req; @@ -294,17 +289,15 @@ static BOOL test_wins_replication(TALLOC_CTX *mem_ctx, const char *address) req = wrepl_request_send(wrepl_socket, &packet, NULL); talloc_free(req); - printf("failed - We are not a valid pull partner for the server\n"); - ret = False; - goto done; + torture_fail(tctx, "We are not a valid pull partner for the server"); } - CHECK_STATUS(status, NT_STATUS_OK); + CHECK_STATUS(tctx, status, NT_STATUS_OK); - printf("Found %d replication partners\n", pull_table.out.num_partners); + torture_comment(tctx, "Found %d replication partners\n", pull_table.out.num_partners); for (i=0;iaddress, (long long)partner->max_version, (long long)partner->min_version, @@ -313,20 +306,19 @@ static BOOL test_wins_replication(TALLOC_CTX *mem_ctx, const char *address) pull_names.in.assoc_ctx = associate.out.assoc_ctx; pull_names.in.partner = *partner; - status = wrepl_pull_names(wrepl_socket, mem_ctx, &pull_names); - CHECK_STATUS(status, NT_STATUS_OK); + status = wrepl_pull_names(wrepl_socket, tctx, &pull_names); + CHECK_STATUS(tctx, status, NT_STATUS_OK); - printf("Received %d names\n", pull_names.out.num_names); + torture_comment(tctx, "Received %d names\n", pull_names.out.num_names); for (j=0;jaddress = address; ctx->pull = wrepl_socket_init(ctx, NULL); if (!ctx->pull) return NULL; - printf("Setup wrepl conflict pull connection\n"); + torture_comment(tctx, "Setup wrepl conflict pull connection\n"); status = wrepl_connect(ctx->pull, NULL, ctx->address); if (!NT_STATUS_IS_OK(status)) return NULL; @@ -624,12 +616,12 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem ctx->nbtsock = nbt_name_socket_init(ctx, NULL); if (!ctx->nbtsock) return NULL; - ctx->myaddr = socket_address_from_strings(mem_ctx, ctx->nbtsock->sock->backend_name, iface_best_ip(address), 0); + ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_best_ip(address), 0); if (!ctx->myaddr) return NULL; for (i = 0; i < iface_count(); i++) { if (strcmp(ctx->myaddr->addr, iface_n_ip(i)) == 0) continue; - ctx->myaddr2 = socket_address_from_strings(mem_ctx, ctx->nbtsock->sock->backend_name, iface_n_ip(i), 0); + ctx->myaddr2 = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_n_ip(i), 0); if (!ctx->myaddr2) return NULL; break; } @@ -641,7 +633,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem if (!ctx->nbtsock_srv) return NULL; /* Make a port 137 version of ctx->myaddr */ - nbt_srv_addr = socket_address_from_strings(mem_ctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lp_nbt_port()); + nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lp_nbt_port()); if (!nbt_srv_addr) return NULL; /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */ @@ -664,7 +656,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem if (!ctx->nbtsock_srv2) return NULL; /* Make a port 137 version of ctx->myaddr2 */ - nbt_srv_addr = socket_address_from_strings(mem_ctx, + nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr2->addr, lp_nbt_port()); if (!nbt_srv_addr) return NULL; @@ -713,11 +705,11 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *mem return ctx; } -static BOOL test_wrepl_update_one(struct test_wrepl_conflict_conn *ctx, +static bool test_wrepl_update_one(struct torture_context *tctx, + struct test_wrepl_conflict_conn *ctx, const struct wrepl_wins_owner *owner, const struct wrepl_wins_name *name) { - BOOL ret = True; struct wrepl_socket *wrepl_socket; struct wrepl_associate associate; struct wrepl_packet update_packet, repl_send; @@ -733,10 +725,10 @@ static BOOL test_wrepl_update_one(struct test_wrepl_conflict_conn *ctx, wrepl_socket = wrepl_socket_init(ctx, NULL); status = wrepl_connect(wrepl_socket, NULL, ctx->address); - CHECK_STATUS(status, NT_STATUS_OK); + CHECK_STATUS(tctx, status, NT_STATUS_OK); status = wrepl_associate(wrepl_socket, &associate); - CHECK_STATUS(status, NT_STATUS_OK); + CHECK_STATUS(tctx, status, NT_STATUS_OK); assoc_ctx = associate.out.assoc_ctx; /* now send a WREPL_REPL_UPDATE message */ @@ -755,9 +747,9 @@ static BOOL test_wrepl_update_one(struct test_wrepl_conflict_conn *ctx, status = wrepl_request(wrepl_socket, wrepl_socket, &update_packet, &repl_recv); - CHECK_STATUS(status, NT_STATUS_OK); - CHECK_VALUE(repl_recv->mess_type, WREPL_REPLICATION); - CHECK_VALUE(repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST); + CHECK_STATUS(tctx, status, NT_STATUS_OK); + CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_REPLICATION); + CHECK_VALUE(tctx, repl_recv->message.replication.command, WREPL_REPL_SEND_REQUEST); send_request = &repl_recv->message.replication.info.owner; ZERO_STRUCT(repl_send); @@ -774,21 +766,20 @@ static BOOL test_wrepl_update_one(struct test_wrepl_conflict_conn *ctx, status = wrepl_request(wrepl_socket, wrepl_socket, &repl_send, &repl_recv); - CHECK_STATUS(status, NT_STATUS_OK); - CHECK_VALUE(repl_recv->mess_type, WREPL_STOP_ASSOCIATION); - CHECK_VALUE(repl_recv->message.stop.reason, 0); + CHECK_STATUS(tctx, status, NT_STATUS_OK); + CHECK_VALUE(tctx, repl_recv->mess_type, WREPL_STOP_ASSOCIATION); + CHECK_VALUE(tctx, repl_recv->message.stop.reason, 0); -done: talloc_free(wrepl_socket); - return ret; + return true; } -static BOOL test_wrepl_is_applied(struct test_wrepl_conflict_conn *ctx, +static bool test_wrepl_is_applied(struct torture_context *tctx, + struct test_wrepl_conflict_conn *ctx, const struct wrepl_wins_owner *owner, const struct wrepl_wins_name *name, - BOOL expected) + bool expected) { - BOOL ret = True; NTSTATUS status; struct wrepl_pull_names pull_names; struct wrepl_name *names; @@ -798,8 +789,9 @@ static BOOL test_wrepl_is_applied(struct test_wrepl_conflict_conn *ctx, pull_names.in.partner.min_version = pull_names.in.partner.max_version; status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names); - CHECK_STATUS(status, NT_STATUS_OK); - CHECK_VALUE(pull_names.out.num_names, (expected?1:0)); + CHECK_STATUS(tctx, status, NT_STATUS_OK); + torture_assert(tctx, pull_names.out.num_names == (expected?1:0), + "Invalid number of records returned"); names = pull_names.out.names; @@ -808,34 +800,33 @@ static BOOL test_wrepl_is_applied(struct test_wrepl_conflict_conn *ctx, names[0].state, names[0].node, names[0].is_static); - CHECK_VALUE(names[0].name.type, name->name->type); - CHECK_VALUE_STRING(names[0].name.name, name->name->name); - CHECK_VALUE_STRING(names[0].name.scope, name->name->scope); - CHECK_VALUE(flags, name->flags); - CHECK_VALUE_UINT64(names[0].version_id, name->id); + CHECK_VALUE(tctx, names[0].name.type, name->name->type); + CHECK_VALUE_STRING(tctx, names[0].name.name, name->name->name); + CHECK_VALUE_STRING(tctx, names[0].name.scope, name->name->scope); + CHECK_VALUE(tctx, flags, name->flags); + CHECK_VALUE_UINT64(tctx, names[0].version_id, name->id); if (flags & 2) { - CHECK_VALUE(names[0].num_addresses, + CHECK_VALUE(tctx, names[0].num_addresses, name->addresses.addresses.num_ips); } else { - CHECK_VALUE(names[0].num_addresses, 1); - CHECK_VALUE_STRING(names[0].addresses[0].address, + CHECK_VALUE(tctx, names[0].num_addresses, 1); + CHECK_VALUE_STRING(tctx, names[0].addresses[0].address, name->addresses.ip); } } -done: talloc_free(pull_names.out.names); - return ret; + return true; } -static BOOL test_wrepl_mhomed_merged(struct test_wrepl_conflict_conn *ctx, +static bool test_wrepl_mhomed_merged(struct torture_context *tctx, + struct test_wrepl_conflict_conn *ctx, const struct wrepl_wins_owner *owner1, uint32_t num_ips1, const struct wrepl_ip *ips1, const struct wrepl_wins_owner *owner2, uint32_t num_ips2, const struct wrepl_ip *ips2, const struct wrepl_wins_name *name2) { - BOOL ret = True; NTSTATUS status; struct wrepl_pull_names pull_names; struct wrepl_name *names; @@ -857,8 +848,8 @@ static BOOL test_wrepl_mhomed_merged(struct test_wrepl_conflict_conn *ctx, pull_names.in.partner.min_version = pull_names.in.partner.max_version; status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names); - CHECK_STATUS(status, NT_STATUS_OK); - CHECK_VALUE(pull_names.out.num_names, 1); + CHECK_STATUS(tctx, status, NT_STATUS_OK); + CHECK_VALUE(tctx, pull_names.out.num_names, 1); names = pull_names.out.names; @@ -866,23 +857,23 @@ static BOOL test_wrepl_mhomed_merged(struct test_wrepl_conflict_conn *ctx, names[0].state, names[0].node, names[0].is_static); - CHECK_VALUE(names[0].name.type, name2->name->type); - CHECK_VALUE_STRING(names[0].name.name, name2->name->name); - CHECK_VALUE_STRING(names[0].name.scope, name2->name->scope); - CHECK_VALUE(flags, name2->flags | WREPL_TYPE_MHOMED); - CHECK_VALUE_UINT64(names[0].version_id, name2->id); + CHECK_VALUE(tctx, names[0].name.type, name2->name->type); + CHECK_VALUE_STRING(tctx, names[0].name.name, name2->name->name); + CHECK_VALUE_STRING(tctx, names[0].name.scope, name2->name->scope); + CHECK_VALUE(tctx, flags, name2->flags | WREPL_TYPE_MHOMED); + CHECK_VALUE_UINT64(tctx, names[0].version_id, name2->id); - CHECK_VALUE(names[0].num_addresses, num_ips); + CHECK_VALUE(tctx, names[0].num_addresses, num_ips); for (i = 0; i < names[0].num_addresses; i++) { const char *addr = names[0].addresses[i].address; const char *owner = names[0].addresses[i].owner; - BOOL found = False; + bool found = false; for (j = 0; j < num_ips2; j++) { if (strcmp(addr, ips2[j].ip) == 0) { - found = True; - CHECK_VALUE_STRING(owner, owner2->address); + found = true; + CHECK_VALUE_STRING(tctx, owner, owner2->address); break; } } @@ -891,22 +882,22 @@ static BOOL test_wrepl_mhomed_merged(struct test_wrepl_conflict_conn *ctx, for (j = 0; j < num_ips1; j++) { if (strcmp(addr, ips1[j].ip) == 0) { - found = True; - CHECK_VALUE_STRING(owner, owner1->address); + found = true; + CHECK_VALUE_STRING(tctx, owner, owner1->address); break; } } if (found) continue; - CHECK_VALUE_STRING(addr, "not found in address list"); + CHECK_VALUE_STRING(tctx, addr, "not found in address list"); } -done: talloc_free(pull_names.out.names); - return ret; + return true; } -static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx, +static bool test_wrepl_sgroup_merged(struct torture_context *tctx, + struct test_wrepl_conflict_conn *ctx, struct wrepl_wins_owner *merge_owner, struct wrepl_wins_owner *owner1, uint32_t num_ips1, const struct wrepl_ip *ips1, @@ -914,7 +905,6 @@ static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx, uint32_t num_ips2, const struct wrepl_ip *ips2, const struct wrepl_wins_name *name2) { - BOOL ret = True; NTSTATUS status; struct wrepl_pull_names pull_names; struct wrepl_name *names; @@ -947,7 +937,7 @@ static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx, pull_names.in.partner.max_version = 0; status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names); - CHECK_STATUS(status, NT_STATUS_OK); + CHECK_STATUS(tctx, status, NT_STATUS_OK); names = pull_names.out.names; @@ -965,30 +955,30 @@ static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx, } if (!name) { - printf("%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name)); - return False; + torture_comment(tctx, "%s: Name '%s' not found\n", __location__, nbt_name_string(ctx, name2->name)); + return false; } flags = WREPL_NAME_FLAGS(name->type, name->state, name->node, name->is_static); - CHECK_VALUE(name->name.type, name2->name->type); - CHECK_VALUE_STRING(name->name.name, name2->name->name); - CHECK_VALUE_STRING(name->name.scope, name2->name->scope); - CHECK_VALUE(flags, name2->flags); + CHECK_VALUE(tctx, name->name.type, name2->name->type); + CHECK_VALUE_STRING(tctx, name->name.name, name2->name->name); + CHECK_VALUE_STRING(tctx, name->name.scope, name2->name->scope); + CHECK_VALUE(tctx, flags, name2->flags); - CHECK_VALUE(name->num_addresses, num_ips); + CHECK_VALUE(tctx, name->num_addresses, num_ips); for (i = 0; i < name->num_addresses; i++) { const char *addr = name->addresses[i].address; const char *owner = name->addresses[i].owner; - BOOL found = False; + bool found = false; for (j = 0; j < num_ips2; j++) { if (strcmp(addr, ips2[j].ip) == 0) { - found = True; - CHECK_VALUE_STRING(owner, ips2[j].owner); + found = true; + CHECK_VALUE_STRING(tctx, owner, ips2[j].owner); break; } } @@ -997,11 +987,11 @@ static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx, for (j = 0; j < num_ips1; j++) { if (strcmp(addr, ips1[j].ip) == 0) { - found = True; + found = true; if (owner1 == &ctx->c) { - CHECK_VALUE_STRING(owner, owner1->address); + CHECK_VALUE_STRING(tctx, owner, owner1->address); } else { - CHECK_VALUE_STRING(owner, ips1[j].owner); + CHECK_VALUE_STRING(tctx, owner, ips1[j].owner); } break; } @@ -1009,16 +999,16 @@ static BOOL test_wrepl_sgroup_merged(struct test_wrepl_conflict_conn *ctx, if (found) continue; - CHECK_VALUE_STRING(addr, "not found in address list"); + CHECK_VALUE_STRING(tctx, addr, "not found in address list"); } -done: talloc_free(pull_names.out.names); - return ret; + return true; } -static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx) +static bool test_conflict_same_owner(struct torture_context *tctx, + struct test_wrepl_conflict_conn *ctx) { - BOOL ret = True; + static bool ret = true; struct nbt_name name; struct wrepl_wins_name wins_name1; struct wrepl_wins_name wins_name2; @@ -1031,7 +1021,7 @@ static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx) enum wrepl_name_type type; enum wrepl_name_state state; enum wrepl_name_node node; - BOOL is_static; + bool is_static; uint32_t num_ips; const struct wrepl_ip *ips; } records[] = { @@ -1039,77 +1029,77 @@ static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, },{ .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, },{ .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_2), .ips = addresses_A_2, },{ .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = True, + .is_static = true, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, },{ .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_2), .ips = addresses_A_2, },{ .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_2), .ips = addresses_A_2, },{ .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, },{ .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_2), .ips = addresses_A_2, },{ .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, },{ .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, },{ .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, },{ @@ -1117,7 +1107,7 @@ static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, } @@ -1133,7 +1123,7 @@ static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx) for (j=0; ret && j < ARRAY_SIZE(types); j++) { name.type = types[j]; - printf("Test Replica Conflicts with same owner[%s] for %s\n", + torture_comment(tctx, "Test Replica Conflicts with same owner[%s] for %s\n", nbt_name_string(ctx, &name), ctx->a.address); for(i=0; ret && i < ARRAY_SIZE(records); i++) { @@ -1142,7 +1132,7 @@ static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx) wins_name_cur = wins_name_tmp; if (i > 0) { - printf("%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n", + torture_comment(tctx, "%s,%s%s vs. %s,%s%s with %s ip(s) => %s\n", wrepl_name_type_string(records[i-1].type), wrepl_name_state_string(records[i-1].state), (records[i-1].is_static?",static":""), @@ -1167,19 +1157,19 @@ static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx) } wins_name_cur->unknown = "255.255.255.255"; - ret &= test_wrepl_update_one(ctx, &ctx->a,wins_name_cur); + ret &= test_wrepl_update_one(tctx, ctx, &ctx->a,wins_name_cur); if (records[i].state == WREPL_STATE_RELEASED) { - ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_last, False); - ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, False); + ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_last, false); + ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, false); } else { - ret &= test_wrepl_is_applied(ctx, &ctx->a, wins_name_cur, True); + ret &= test_wrepl_is_applied(tctx, ctx, &ctx->a, wins_name_cur, true); } /* the first one is a cleanup run */ - if (!ret && i == 0) ret = True; + if (!ret && i == 0) ret = true; if (!ret) { - printf("conflict handled wrong or record[%u]: %s\n", i, __location__); + torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, __location__); return ret; } } @@ -1187,9 +1177,10 @@ static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx) return ret; } -static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) +static bool test_conflict_different_owner(struct torture_context *tctx, + struct test_wrepl_conflict_conn *ctx) { - BOOL ret = True; + bool ret = true; struct wrepl_wins_name wins_name1; struct wrepl_wins_name wins_name2; struct wrepl_wins_name *wins_name_r1; @@ -1199,20 +1190,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) const char *line; /* just better debugging */ struct nbt_name name; const char *comment; - BOOL extra; /* not the worst case, this is an extra test */ - BOOL cleanup; + bool extra; /* not the worst case, this is an extra test */ + bool cleanup; struct { struct wrepl_wins_owner *owner; enum wrepl_name_type type; enum wrepl_name_state state; enum wrepl_name_node node; - BOOL is_static; + bool is_static; uint32_t num_ips; const struct wrepl_ip *ips; - BOOL apply_expected; - BOOL sgroup_merge; + bool apply_expected; + bool sgroup_merge; struct wrepl_wins_owner *merge_owner; - BOOL sgroup_cleanup; + bool sgroup_cleanup; } r1, r2; } records[] = { /* @@ -1223,26 +1214,26 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .cleanup= True, + .cleanup= true, .r1 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True /* ignored */ + .apply_expected = true /* ignored */ }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True /* ignored */ + .apply_expected = true /* ignored */ } }, @@ -1261,20 +1252,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -1290,20 +1281,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false } }, @@ -1319,20 +1310,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -1348,20 +1339,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -1377,20 +1368,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -1406,20 +1397,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -1439,20 +1430,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -1468,20 +1459,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false } }, @@ -1497,20 +1488,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -1526,20 +1517,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -1555,20 +1546,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -1584,20 +1575,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -1616,20 +1607,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false } }, @@ -1645,20 +1636,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false } }, @@ -1674,20 +1665,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = True + .apply_expected = true } }, @@ -1703,20 +1694,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .apply_expected = True + .apply_expected = true } }, @@ -1732,20 +1723,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = True + .apply_expected = true } }, @@ -1761,20 +1752,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .apply_expected = True + .apply_expected = true } }, @@ -1793,20 +1784,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = True + .apply_expected = true } }, @@ -1822,20 +1813,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = False + .apply_expected = false } }, @@ -1851,20 +1842,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .apply_expected = True + .apply_expected = true } }, @@ -1880,20 +1871,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = True + .apply_expected = true } }, @@ -1909,20 +1900,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .apply_expected = True + .apply_expected = true } }, @@ -1938,20 +1929,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = True + .apply_expected = true } }, @@ -1970,20 +1961,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false } }, @@ -1999,20 +1990,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false } }, @@ -2028,20 +2019,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false } }, @@ -2057,20 +2048,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false } }, @@ -2086,20 +2077,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false } }, @@ -2115,20 +2106,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false } }, @@ -2147,20 +2138,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false } }, @@ -2176,20 +2167,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false } }, @@ -2205,20 +2196,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -2234,20 +2225,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -2263,20 +2254,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -2292,20 +2283,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -2324,20 +2315,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false } }, @@ -2353,20 +2344,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false } }, @@ -2382,20 +2373,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -2411,20 +2402,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false } }, @@ -2440,20 +2431,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -2469,20 +2460,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -2501,20 +2492,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false } }, @@ -2530,20 +2521,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false } }, @@ -2559,20 +2550,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false } }, @@ -2588,20 +2579,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false } }, @@ -2617,20 +2608,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -2646,20 +2637,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -2678,20 +2669,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false } }, @@ -2707,20 +2698,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false } }, @@ -2736,20 +2727,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -2765,20 +2756,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -2794,20 +2785,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -2823,20 +2814,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -2855,20 +2846,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false } }, @@ -2884,20 +2875,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false } }, @@ -2913,20 +2904,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -2942,20 +2933,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -2971,20 +2962,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -3000,20 +2991,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -3032,20 +3023,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -3061,20 +3052,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -3090,20 +3081,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -3119,20 +3110,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -3151,20 +3142,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false } }, @@ -3180,20 +3171,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false } }, @@ -3209,20 +3200,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -3238,20 +3229,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -3267,20 +3258,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -3296,20 +3287,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -3328,20 +3319,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -3357,20 +3348,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false } }, @@ -3386,20 +3377,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -3415,20 +3406,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -3444,20 +3435,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -3473,20 +3464,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -3505,20 +3496,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -3534,20 +3525,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false } }, @@ -3563,20 +3554,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -3592,20 +3583,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -3621,20 +3612,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -3650,20 +3641,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -3682,20 +3673,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false } }, @@ -3711,20 +3702,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false } }, @@ -3740,20 +3731,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -3769,20 +3760,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -3798,20 +3789,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true } }, @@ -3827,20 +3818,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }, @@ -3859,20 +3850,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = True + .apply_expected = true } }, @@ -3888,20 +3879,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = False + .apply_expected = false } }, @@ -3917,20 +3908,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .apply_expected = True + .apply_expected = true } }, @@ -3946,20 +3937,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_RELEASED, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .apply_expected = False + .apply_expected = false }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = True + .apply_expected = true } }, @@ -3975,20 +3966,20 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .apply_expected = True + .apply_expected = true } }, @@ -4004,45 +3995,45 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = True + .apply_expected = true } }, { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .cleanup= True, + .cleanup= true, .r1 = { .owner = &ctx->b, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True, + .apply_expected = true, }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True, + .apply_expected = true, } }, /* @@ -4056,27 +4047,27 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .comment= "A:A_3_4 vs. B:A_3_4", - .extra = True, + .extra = true, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .apply_expected = False, - .sgroup_cleanup = True + .apply_expected = false, + .sgroup_cleanup = true } }, /* @@ -4087,27 +4078,27 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .comment= "A:A_3_4 vs. B:NULL", - .extra = True, + .extra = true, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = 0, .ips = NULL, - .apply_expected = False, - .sgroup_cleanup = True + .apply_expected = false, + .sgroup_cleanup = true } }, /* @@ -4118,51 +4109,51 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .comment= "A:A_3_4_X_3_4 vs. B:A_3_4", - .extra = True, + .extra = true, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4), .ips = addresses_A_3_4_X_3_4, - .apply_expected = True, + .apply_expected = true, }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .apply_expected = False, + .apply_expected = false, } }, { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .cleanup= True, + .cleanup= true, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = 0, .ips = NULL, - .apply_expected = False, + .apply_expected = false, }, .r2 = { .owner = &ctx->x, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = 0, .ips = NULL, - .apply_expected = False, + .apply_expected = false, } }, /* @@ -4173,27 +4164,27 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .comment= "A:B_3_4 vs. B:A_3_4", - .extra = True, + .extra = true, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = True, + .apply_expected = true, }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .apply_expected = True, - .sgroup_cleanup = True + .apply_expected = true, + .sgroup_cleanup = true } }, /* @@ -4204,27 +4195,27 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .comment= "A:A_3_4 vs. B:A_3_4_OWNER_B", - .extra = True, + .extra = true, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .apply_expected = True, + .apply_expected = true, }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B), .ips = addresses_A_3_4_OWNER_B, - .apply_expected = True, - .sgroup_cleanup = True + .apply_expected = true, + .sgroup_cleanup = true } }, /* @@ -4235,27 +4226,27 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .comment= "A:A_3_4_OWNER_B vs. B:A_3_4", - .extra = True, + .extra = true, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B), .ips = addresses_A_3_4_OWNER_B, - .apply_expected = True, + .apply_expected = true, }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .apply_expected = True, - .sgroup_cleanup = True + .apply_expected = true, + .sgroup_cleanup = true } }, /* @@ -4266,27 +4257,27 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .comment= "A:A_3_4 vs. B:B_3_4 => C:A_3_4_B_3_4", - .extra = True, + .extra = true, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .apply_expected = True, + .apply_expected = true, }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .sgroup_merge = True, - .sgroup_cleanup = True, + .sgroup_merge = true, + .sgroup_cleanup = true, } }, /* @@ -4297,53 +4288,53 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4_X_3_4", - .extra = True, + .extra = true, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4), .ips = addresses_B_3_4_X_3_4, - .apply_expected = True, + .apply_expected = true, }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .sgroup_merge = True, + .sgroup_merge = true, .merge_owner = &ctx->b, - .sgroup_cleanup = False + .sgroup_cleanup = false } }, { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .cleanup= True, + .cleanup= true, .r1 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4_OWNER_B), .ips = addresses_A_3_4_X_3_4_OWNER_B, - .apply_expected = True, + .apply_expected = true, }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = 0, .ips = NULL, - .apply_expected = False, + .apply_expected = false, } }, /* @@ -4354,52 +4345,52 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .comment= "A:X_3_4 vs. B:A_3_4 => C:A_3_4_X_3_4", - .extra = True, + .extra = true, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_X_3_4), .ips = addresses_X_3_4, - .apply_expected = True, + .apply_expected = true, }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .sgroup_merge = True, - .sgroup_cleanup = False + .sgroup_merge = true, + .sgroup_cleanup = false } }, { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .cleanup= True, + .cleanup= true, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = 0, .ips = NULL, - .apply_expected = False, + .apply_expected = false, }, .r2 = { .owner = &ctx->x, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = 0, .ips = NULL, - .apply_expected = False, + .apply_expected = false, } }, /* @@ -4410,52 +4401,52 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .comment= "A:A_3_4_X_3_4 vs. B:A_3_4_OWNER_B => B:A_3_4_OWNER_B_X_3_4", - .extra = True, + .extra = true, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4_X_3_4), .ips = addresses_A_3_4_X_3_4, - .apply_expected = True, + .apply_expected = true, }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4_OWNER_B), .ips = addresses_A_3_4_OWNER_B, - .sgroup_merge = True, + .sgroup_merge = true, .merge_owner = &ctx->b, } }, { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .cleanup= True, + .cleanup= true, .r1 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = 0, .ips = NULL, - .apply_expected = False, + .apply_expected = false, }, .r2 = { .owner = &ctx->x, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = 0, .ips = NULL, - .apply_expected = False, + .apply_expected = false, } }, /* @@ -4466,52 +4457,52 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .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", - .extra = True, + .extra = true, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4), .ips = addresses_B_3_4_X_3_4, - .apply_expected = True, + .apply_expected = true, }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4_X_1_2), .ips = addresses_B_3_4_X_1_2, - .sgroup_merge = True, - .sgroup_cleanup = False + .sgroup_merge = true, + .sgroup_cleanup = false } }, { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .cleanup= True, + .cleanup= true, .r1 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = 0, .ips = NULL, - .apply_expected = False, + .apply_expected = false, }, .r2 = { .owner = &ctx->x, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = 0, .ips = NULL, - .apply_expected = False, + .apply_expected = false, } }, /* @@ -4522,53 +4513,53 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .comment= "A:A_3_4_B_3_4 vs. B:NULL => B:A_3_4", - .extra = True, + .extra = true, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4_B_3_4), .ips = addresses_A_3_4_B_3_4, - .apply_expected = True, + .apply_expected = true, }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = 0, .ips = NULL, - .sgroup_merge = True, + .sgroup_merge = true, .merge_owner = &ctx->b, - .sgroup_cleanup = True + .sgroup_cleanup = true } }, { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .cleanup= True, + .cleanup= true, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = 0, .ips = NULL, - .apply_expected = False, + .apply_expected = false, }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True, + .apply_expected = true, } }, /* @@ -4579,53 +4570,53 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:X_3_4", - .extra = True, + .extra = true, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4), .ips = addresses_B_3_4_X_3_4, - .apply_expected = True, + .apply_expected = true, }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = 0, .ips = NULL, - .sgroup_merge = True, + .sgroup_merge = true, .merge_owner = &ctx->b, - .sgroup_cleanup = True + .sgroup_cleanup = true } }, { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .cleanup= True, + .cleanup= true, .r1 = { .owner = &ctx->x, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = 0, .ips = NULL, - .apply_expected = False, + .apply_expected = false, }, .r2 = { .owner = &ctx->x, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True, + .apply_expected = true, } }, @@ -4637,26 +4628,26 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .comment= "A:B_3_4_X_3_4 vs. B:NULL => B:NULL", - .extra = True, + .extra = true, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4), .ips = addresses_B_3_4_X_3_4, - .apply_expected = True, + .apply_expected = true, }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = 0, .ips = NULL, - .apply_expected = True, + .apply_expected = true, } }, /* @@ -4667,26 +4658,26 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .comment= "A:B_3_4_X_3_4 vs. B:A_3_4 => B:A_3_4", - .extra = True, + .extra = true, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4), .ips = addresses_B_3_4_X_3_4, - .apply_expected = True, + .apply_expected = true, }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, - .apply_expected = True, + .apply_expected = true, } }, /* @@ -4697,26 +4688,26 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .comment= "A:B_3_4_X_3_4 vs. B:B_3_4 => B:B_3_4", - .extra = True, + .extra = true, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4), .ips = addresses_B_3_4_X_3_4, - .apply_expected = True, + .apply_expected = true, }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = True, + .apply_expected = true, } }, /* @@ -4727,26 +4718,26 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), .comment= "A:B_3_4_X_3_4 vs. B:B_3_4_X_3_4 => B:B_3_4_X_3_4", - .extra = True, + .extra = true, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4), .ips = addresses_B_3_4_X_3_4, - .apply_expected = True, + .apply_expected = true, }, .r2 = { .owner = &ctx->b, .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4_X_3_4), .ips = addresses_B_3_4_X_3_4, - .apply_expected = True, + .apply_expected = true, } }, @@ -4758,46 +4749,46 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) { .line = __location__, .name = _NBT_NAME("_DIFF_OWNER", 0x00, NULL), - .cleanup= True, + .cleanup= true, .r1 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true }, .r2 = { .owner = &ctx->a, .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_A_1), .ips = addresses_A_1, - .apply_expected = True + .apply_expected = true } }}; /* do not add entries here, this should be the last record! */ wins_name_r1 = &wins_name1; wins_name_r2 = &wins_name2; - printf("Test Replica Conflicts with different owners\n"); + torture_comment(tctx, "Test Replica Conflicts with different owners\n"); for(i=0; ret && i < ARRAY_SIZE(records); i++) { if (!records[i].extra && !records[i].cleanup) { /* we should test the worst cases */ if (records[i].r2.apply_expected && records[i].r1.ips==records[i].r2.ips) { - printf("(%s) Programmer error, invalid record[%u]: %s\n", + torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n", __location__, i, records[i].line); - return False; + return false; } else if (!records[i].r2.apply_expected && records[i].r1.ips!=records[i].r2.ips) { - printf("(%s) Programmer error, invalid record[%u]: %s\n", + torture_comment(tctx, "(%s) Programmer error, invalid record[%u]: %s\n", __location__, i, records[i].line); - return False; + return false; } } @@ -4821,7 +4812,7 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) ips = "with different ip(s)"; } - printf("%s,%s%s vs. %s,%s%s %s => %s\n", + torture_comment(tctx, "%s,%s%s vs. %s,%s%s %s => %s\n", wrepl_name_type_string(records[i].r1.type), wrepl_name_state_string(records[i].r1.state), (records[i].r1.is_static?",static":""), @@ -4850,8 +4841,8 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) wins_name_r1->unknown = "255.255.255.255"; /* now apply R1 */ - ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1); - ret &= test_wrepl_is_applied(ctx, records[i].r1.owner, + ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1); + ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner, wins_name_r1, records[i].r1.apply_expected); /* @@ -4872,34 +4863,34 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) wins_name_r2->unknown = "255.255.255.255"; /* now apply R2 */ - ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2); + ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2); if (records[i].r1.state == WREPL_STATE_RELEASED) { - ret &= test_wrepl_is_applied(ctx, records[i].r1.owner, - wins_name_r1, False); + ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner, + wins_name_r1, false); } else if (records[i].r2.sgroup_merge) { - ret &= test_wrepl_sgroup_merged(ctx, records[i].r2.merge_owner, + ret &= test_wrepl_sgroup_merged(tctx, ctx, records[i].r2.merge_owner, records[i].r1.owner, records[i].r1.num_ips, records[i].r1.ips, records[i].r2.owner, records[i].r2.num_ips, records[i].r2.ips, wins_name_r2); } else if (records[i].r1.owner != records[i].r2.owner) { - BOOL _expected; + bool _expected; _expected = (records[i].r1.apply_expected && !records[i].r2.apply_expected); - ret &= test_wrepl_is_applied(ctx, records[i].r1.owner, + ret &= test_wrepl_is_applied(tctx, ctx, records[i].r1.owner, wins_name_r1, _expected); } if (records[i].r2.state == WREPL_STATE_RELEASED) { - ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, - wins_name_r2, False); + ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, + wins_name_r2, false); } else if (!records[i].r2.sgroup_merge) { - ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, + ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, records[i].r2.apply_expected); } if (records[i].r2.sgroup_cleanup) { if (!ret) { - printf("failed before sgroup_cleanup record[%u]: %s\n", i, records[i].line); + torture_comment(tctx, "failed before sgroup_cleanup record[%u]: %s\n", i, records[i].line); return ret; } @@ -4907,16 +4898,16 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) wins_name_r1->name = &records[i].name; wins_name_r1->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP, WREPL_STATE_ACTIVE, - WREPL_NODE_B, False); + WREPL_NODE_B, false); wins_name_r1->id = ++records[i].r1.owner->max_version; wins_name_r1->addresses.addresses.num_ips = 0; wins_name_r1->addresses.addresses.ips = NULL; wins_name_r1->unknown = "255.255.255.255"; - ret &= test_wrepl_update_one(ctx, records[i].r1.owner, wins_name_r1); + ret &= test_wrepl_update_one(tctx, ctx, records[i].r1.owner, wins_name_r1); /* here we test how names from an owner are deleted */ if (records[i].r2.sgroup_merge && records[i].r2.num_ips) { - ret &= test_wrepl_sgroup_merged(ctx, NULL, + ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL, records[i].r2.owner, records[i].r2.num_ips, records[i].r2.ips, records[i].r1.owner, @@ -4928,48 +4919,48 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) wins_name_r2->name = &records[i].name; wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP, WREPL_STATE_ACTIVE, - WREPL_NODE_B, False); + WREPL_NODE_B, false); wins_name_r2->id = ++records[i].r2.owner->max_version; wins_name_r2->addresses.addresses.num_ips = 0; wins_name_r2->addresses.addresses.ips = NULL; wins_name_r2->unknown = "255.255.255.255"; - ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2); + ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2); /* take ownership of the SGROUP record */ wins_name_r2->name = &records[i].name; wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP, WREPL_STATE_ACTIVE, - WREPL_NODE_B, False); + WREPL_NODE_B, false); wins_name_r2->id = ++records[i].r2.owner->max_version; wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1); wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1); wins_name_r2->unknown = "255.255.255.255"; - ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2); - ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, True); + ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2); + ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true); /* overwrite the SGROUP record with unique,tombstone */ wins_name_r2->name = &records[i].name; wins_name_r2->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP, WREPL_STATE_TOMBSTONE, - WREPL_NODE_B, False); + WREPL_NODE_B, false); wins_name_r2->id = ++records[i].r2.owner->max_version; wins_name_r2->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1); wins_name_r2->addresses.addresses.ips = discard_const(addresses_B_1); wins_name_r2->unknown = "255.255.255.255"; - ret &= test_wrepl_update_one(ctx, records[i].r2.owner, wins_name_r2); - ret &= test_wrepl_is_applied(ctx, records[i].r2.owner, wins_name_r2, True); + ret &= test_wrepl_update_one(tctx, ctx, records[i].r2.owner, wins_name_r2); + ret &= test_wrepl_is_applied(tctx, ctx, records[i].r2.owner, wins_name_r2, true); if (!ret) { - printf("failed in sgroup_cleanup record[%u]: %s\n", i, records[i].line); + torture_comment(tctx, "failed in sgroup_cleanup record[%u]: %s\n", i, records[i].line); return ret; } } /* the first one is a cleanup run */ - if (!ret && i == 0) ret = True; + if (!ret && i == 0) ret = true; if (!ret) { - printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line); + torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line); return ret; } } @@ -4977,9 +4968,10 @@ static BOOL test_conflict_different_owner(struct test_wrepl_conflict_conn *ctx) return ret; } -static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_conn *ctx) +static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx, + struct test_wrepl_conflict_conn *ctx) { - BOOL ret = True; + bool ret = true; NTSTATUS status; struct wrepl_wins_name wins_name_; struct wrepl_wins_name *wins_name = &wins_name_; @@ -4993,19 +4985,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c struct nbt_name name; struct { uint32_t nb_flags; - BOOL mhomed; + bool mhomed; uint32_t num_ips; const struct wrepl_ip *ips; - BOOL apply_expected; + bool apply_expected; } wins; struct { enum wrepl_name_type type; enum wrepl_name_state state; enum wrepl_name_node node; - BOOL is_static; + bool is_static; uint32_t num_ips; const struct wrepl_ip *ips; - BOOL apply_expected; + bool apply_expected; } replica; } records[] = { /* @@ -5019,19 +5011,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_UR_UA_SI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5042,19 +5034,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_UR_UA_DI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5065,19 +5057,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_UR_UT_SI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5088,19 +5080,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_UR_UT_DI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5114,19 +5106,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_UR_GA_SI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5137,19 +5129,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_UR_GA_DI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5160,19 +5152,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_UR_GT_SI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5183,19 +5175,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_UR_GT_DI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5209,19 +5201,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_UR_SA_SI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5232,19 +5224,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_UR_SA_DI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5255,19 +5247,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_UR_ST_SI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5278,19 +5270,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_UR_ST_DI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5304,19 +5296,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_UR_MA_SI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5327,19 +5319,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_UR_MA_DI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5350,19 +5342,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_UR_MT_SI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5373,19 +5365,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_UR_MT_DI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5399,19 +5391,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_GR_UA_SI", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -5422,19 +5414,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_GR_UA_DI", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -5445,19 +5437,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_GR_UT_SI", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -5468,19 +5460,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_GR_UT_DI", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -5494,19 +5486,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_GR_GA_SI", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5517,19 +5509,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_GR_GA_DI", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5540,19 +5532,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_GR_GT_SI", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5563,19 +5555,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_GR_GT_DI", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5589,19 +5581,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_GR_SA_SI", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -5612,19 +5604,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_GR_SA_DI", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -5635,19 +5627,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_GR_ST_SI", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -5658,19 +5650,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_GR_ST_DI", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -5684,19 +5676,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_GR_MA_SI", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -5707,19 +5699,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_GR_MA_DI", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -5730,19 +5722,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_GR_MT_SI", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -5753,19 +5745,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_GR_MT_DI", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -5779,19 +5771,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_SR_UA_SI", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5802,19 +5794,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_SR_UA_DI", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5825,19 +5817,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_SR_UT_SI", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5848,19 +5840,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_SR_UT_DI", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5874,19 +5866,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_SR_GA_SI", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5897,19 +5889,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_SR_GA_DI", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5920,19 +5912,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_SR_GT_SI", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5943,19 +5935,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_SR_GT_DI", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5969,19 +5961,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_SR_SA_SI", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -5992,19 +5984,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_SR_SA_DI", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6015,19 +6007,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_SR_ST_SI", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6038,19 +6030,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_SR_ST_DI", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6064,19 +6056,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_SR_MA_SI", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6087,19 +6079,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_SR_MA_DI", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6110,19 +6102,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_SR_MT_SI", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6133,19 +6125,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_SR_MT_DI", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6159,19 +6151,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_MR_UA_SI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6182,19 +6174,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_MR_UA_DI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6205,19 +6197,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_MR_UT_SI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6228,19 +6220,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_MR_UT_DI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6254,19 +6246,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_MR_GA_SI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6277,19 +6269,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_MR_GA_DI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6300,19 +6292,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_MR_GT_SI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6323,19 +6315,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_MR_GT_DI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6349,19 +6341,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_MR_SA_SI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6372,19 +6364,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_MR_SA_DI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6395,19 +6387,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_MR_ST_SI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6418,19 +6410,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_MR_ST_DI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6444,19 +6436,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_MR_MA_SI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6467,19 +6459,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_MR_MA_DI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6490,19 +6482,19 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_MR_MT_SI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6513,27 +6505,27 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c .name = _NBT_NAME("_MR_MT_DI", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, }; - printf("Test Replica records vs. owned released records\n"); + torture_comment(tctx, "Test Replica records vs. owned released records\n"); for(i=0; ret && i < ARRAY_SIZE(records); i++) { - printf("%s => %s\n", nbt_name_string(ctx, &records[i].name), + torture_comment(tctx, "%s => %s\n", nbt_name_string(ctx, &records[i].name), (records[i].replica.apply_expected?"REPLACE":"NOT REPLACE")); /* @@ -6543,8 +6535,8 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c name_register->in.dest_addr = ctx->address; name_register->in.address = records[i].wins.ips[0].ip; name_register->in.nb_flags = records[i].wins.nb_flags; - name_register->in.register_demand= False; - name_register->in.broadcast = False; + name_register->in.register_demand= false; + name_register->in.broadcast = false; name_register->in.multi_homed = records[i].wins.mhomed; name_register->in.ttl = 300000; name_register->in.timeout = 70; @@ -6552,41 +6544,41 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c status = nbt_name_register(ctx->nbtsock, ctx, name_register); if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { - printf("No response from %s for name register\n", ctx->address); - ret = False; + torture_comment(tctx, "No response from %s for name register\n", ctx->address); + ret = false; } if (!NT_STATUS_IS_OK(status)) { - printf("Bad response from %s for name register - %s\n", + torture_comment(tctx, "Bad response from %s for name register - %s\n", ctx->address, nt_errstr(status)); - ret = False; + ret = false; } - CHECK_VALUE(name_register->out.rcode, 0); - CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address); - CHECK_VALUE(name_register->out.name.type, records[i].name.type); - CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name); - CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope); - CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[0].ip); + CHECK_VALUE(tctx, name_register->out.rcode, 0); + CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address); + CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type); + CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name); + CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope); + CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[0].ip); /* release the record */ release->in.name = records[i].name; release->in.dest_addr = ctx->address; release->in.address = records[i].wins.ips[0].ip; release->in.nb_flags = records[i].wins.nb_flags; - release->in.broadcast = False; + release->in.broadcast = false; release->in.timeout = 30; release->in.retries = 0; status = nbt_name_release(ctx->nbtsock, ctx, release); if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { - printf("No response from %s for name release\n", ctx->address); - return False; + torture_comment(tctx, "No response from %s for name release\n", ctx->address); + return false; } if (!NT_STATUS_IS_OK(status)) { - printf("Bad response from %s for name query - %s\n", + torture_comment(tctx, "Bad response from %s for name query - %s\n", ctx->address, nt_errstr(status)); - return False; + return false; } - CHECK_VALUE(release->out.rcode, 0); + CHECK_VALUE(tctx, release->out.rcode, 0); /* * Setup Replica @@ -6605,45 +6597,44 @@ static BOOL test_conflict_owned_released_vs_replica(struct test_wrepl_conflict_c } wins_name->unknown = "255.255.255.255"; - ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name); - ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, + ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name); + ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, records[i].replica.apply_expected); if (records[i].replica.apply_expected) { wins_name->name = &records[i].name; wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE, WREPL_STATE_TOMBSTONE, - WREPL_NODE_B, False); + WREPL_NODE_B, false); wins_name->id = ++ctx->b.max_version; wins_name->addresses.ip = addresses_B_1[0].ip; wins_name->unknown = "255.255.255.255"; - ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name); - ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True); + ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name); + ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true); } else { release->in.name = records[i].name; release->in.dest_addr = ctx->address; release->in.address = records[i].wins.ips[0].ip; release->in.nb_flags = records[i].wins.nb_flags; - release->in.broadcast = False; + release->in.broadcast = false; release->in.timeout = 30; release->in.retries = 0; status = nbt_name_release(ctx->nbtsock, ctx, release); if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { - printf("No response from %s for name release\n", ctx->address); - return False; + torture_comment(tctx, "No response from %s for name release\n", ctx->address); + return false; } if (!NT_STATUS_IS_OK(status)) { - printf("Bad response from %s for name query - %s\n", + torture_comment(tctx, "Bad response from %s for name query - %s\n", ctx->address, nt_errstr(status)); - return False; + return false; } - CHECK_VALUE(release->out.rcode, 0); + CHECK_VALUE(tctx, release->out.rcode, 0); } -done: if (!ret) { - printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line); + torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line); return ret; } } @@ -6656,20 +6647,20 @@ struct test_conflict_owned_active_vs_replica_struct { const char *section; /* just better debugging */ struct nbt_name name; const char *comment; - BOOL skip; + bool skip; struct { uint32_t nb_flags; - BOOL mhomed; + bool mhomed; uint32_t num_ips; const struct wrepl_ip *ips; - BOOL apply_expected; + bool apply_expected; } wins; struct { uint32_t timeout; - BOOL positive; - BOOL expect_release; - BOOL late_release; - BOOL ret; + bool positive; + bool expect_release; + bool late_release; + bool ret; /* when num_ips == 0, then .wins.ips are used */ uint32_t num_ips; const struct wrepl_ip *ips; @@ -6678,12 +6669,12 @@ struct test_conflict_owned_active_vs_replica_struct { enum wrepl_name_type type; enum wrepl_name_state state; enum wrepl_name_node node; - BOOL is_static; + bool is_static; uint32_t num_ips; const struct wrepl_ip *ips; - BOOL apply_expected; - BOOL mhomed_merge; - BOOL sgroup_merge; + bool apply_expected; + bool mhomed_merge; + bool sgroup_merge; } replica; }; @@ -6691,9 +6682,10 @@ static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket struct nbt_name_packet *req_packet, struct socket_address *src); -static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_conn *ctx) +static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx, + struct test_wrepl_conflict_conn *ctx) { - BOOL ret = True; + bool ret = true; NTSTATUS status; struct wrepl_wins_name wins_name_; struct wrepl_wins_name *wins_name = &wins_name_; @@ -6714,10 +6706,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_UA_UA_SI_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -6726,10 +6718,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6740,23 +6732,23 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_UA_UA_DI_P", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .positive = True, + .positive = true, }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -6767,14 +6759,14 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_UA_UA_DI_O", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .positive = True, + .positive = true, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, }, @@ -6782,10 +6774,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -6796,23 +6788,23 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_UA_UA_DI_N", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .positive = False, + .positive = false, }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6823,10 +6815,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_UA_UT_SI_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -6835,10 +6827,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -6849,10 +6841,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_UA_UT_DI_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -6861,10 +6853,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -6878,23 +6870,23 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_UA_GA_SI_R", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .expect_release = True, + .expect_release = true, }, .replica= { .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6905,23 +6897,23 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_UA_GA_DI_R", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .expect_release = True, + .expect_release = true, }, .replica= { .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -6932,10 +6924,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_UA_GT_SI_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -6944,10 +6936,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -6958,10 +6950,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_UA_GT_DI_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -6970,10 +6962,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -6987,23 +6979,23 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_UA_SA_SI_R", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .expect_release = True, + .expect_release = true, }, .replica= { .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -7014,23 +7006,23 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_UA_SA_DI_R", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .expect_release = True, + .expect_release = true, }, .replica= { .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -7041,10 +7033,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_UA_ST_SI_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7053,10 +7045,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7067,10 +7059,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_UA_ST_DI_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7079,10 +7071,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7096,10 +7088,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_UA_MA_SI_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7108,10 +7100,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -7122,10 +7114,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_UA_MA_SP_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7134,10 +7126,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_all_num, .ips = ctx->addresses_all, - .apply_expected = True + .apply_expected = true }, }, /* @@ -7148,23 +7140,23 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_UA_MA_DI_P", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .positive = True, + .positive = true, }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7175,14 +7167,14 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_UA_MA_DI_O", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .positive = True, + .positive = true, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, }, @@ -7190,10 +7182,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7204,23 +7196,23 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_UA_MA_DI_N", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .positive = False, + .positive = false, }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = True + .apply_expected = true }, }, /* @@ -7231,10 +7223,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_UA_MT_SI_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7243,10 +7235,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7257,10 +7249,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_UA_MT_DI_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7269,10 +7261,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7286,10 +7278,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_GA_UA_SI_U", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7298,10 +7290,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7312,10 +7304,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_GA_UA_DI_U", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7324,10 +7316,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7338,10 +7330,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_GA_UT_SI_U", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7350,10 +7342,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7364,10 +7356,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_GA_UT_DI_U", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7376,10 +7368,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7393,10 +7385,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_GA_GA_SI_U", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7405,10 +7397,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -7419,10 +7411,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_GA_GA_DI_U", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7431,10 +7423,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -7445,10 +7437,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_GA_GT_SI_U", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7457,10 +7449,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7471,10 +7463,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_GA_GT_DI_U", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7483,10 +7475,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7500,10 +7492,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_GA_SA_SI_U", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7512,10 +7504,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7526,10 +7518,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_GA_SA_DI_U", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7538,10 +7530,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7552,10 +7544,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_GA_ST_SI_U", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7564,10 +7556,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7578,10 +7570,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_GA_ST_DI_U", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7590,10 +7582,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7607,10 +7599,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_GA_MA_SI_U", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7619,10 +7611,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7633,10 +7625,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_GA_MA_DI_U", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7645,10 +7637,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7659,10 +7651,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_GA_MT_SI_U", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7671,10 +7663,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7685,10 +7677,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_GA_MT_DI_U", 0x00, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7697,10 +7689,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7714,10 +7706,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_SA_UA_SI_U", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7726,10 +7718,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7740,10 +7732,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_SA_UA_DI_U", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7752,10 +7744,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7766,10 +7758,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_SA_UT_SI_U", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7778,10 +7770,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7792,10 +7784,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_SA_UT_DI_U", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7804,10 +7796,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7821,10 +7813,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_SA_GA_SI_U", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7833,10 +7825,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7847,10 +7839,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_SA_GA_DI_U", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7859,10 +7851,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7873,10 +7865,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_SA_GT_SI_U", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7885,10 +7877,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7899,10 +7891,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_SA_GT_DI_U", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7911,10 +7903,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7928,10 +7920,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_SA_MA_SI_U", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7940,10 +7932,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7954,10 +7946,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_SA_MA_DI_U", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7966,10 +7958,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -7980,10 +7972,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_SA_MT_SI_U", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -7992,10 +7984,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -8006,10 +7998,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_SA_MT_DI_U", 0x1C, NULL), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -8018,10 +8010,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -8035,10 +8027,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_MA_UA_SI_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -8047,10 +8039,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -8061,23 +8053,23 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_MA_UA_DI_P", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .positive = True, + .positive = true, }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -8088,14 +8080,14 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_MA_UA_DI_O", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .positive = True, + .positive = true, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, }, @@ -8103,10 +8095,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -8117,23 +8109,23 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_MA_UA_DI_N", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .positive = False, + .positive = false, }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -8144,10 +8136,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_MA_UT_SI_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -8156,10 +8148,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -8170,10 +8162,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_MA_UT_DI_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -8182,10 +8174,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -8199,23 +8191,23 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_MA_GA_SI_R", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .expect_release = True, + .expect_release = true, }, .replica= { .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -8226,23 +8218,23 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_MA_GA_DI_R", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .expect_release = True, + .expect_release = true, }, .replica= { .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -8253,10 +8245,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_MA_GT_SI_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -8265,10 +8257,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -8279,10 +8271,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_MA_GT_DI_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -8291,10 +8283,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_GROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -8308,23 +8300,23 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_MA_SA_SI_R", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .expect_release = True, + .expect_release = true, }, .replica= { .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -8335,23 +8327,23 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_MA_SA_DI_R", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .expect_release = True, + .expect_release = true, }, .replica= { .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = True + .apply_expected = true }, }, /* @@ -8362,10 +8354,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_MA_ST_SI_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -8374,10 +8366,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -8388,10 +8380,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_MA_ST_DI_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -8400,10 +8392,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_1), .ips = addresses_B_1, - .apply_expected = False + .apply_expected = false }, }, /* @@ -8417,10 +8409,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_MA_MA_SI_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -8429,10 +8421,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -8443,10 +8435,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_MA_MA_SP_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -8455,10 +8447,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_all_num, .ips = ctx->addresses_all, - .apply_expected = True + .apply_expected = true }, }, /* @@ -8469,23 +8461,23 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_MA_MA_DI_P", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .positive = True, + .positive = true, }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = False + .apply_expected = false }, }, /* @@ -8496,14 +8488,14 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_MA_MA_DI_O", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .positive = True, + .positive = true, .num_ips = ARRAY_SIZE(addresses_A_3_4), .ips = addresses_A_3_4, }, @@ -8511,10 +8503,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = False + .apply_expected = false }, }, /* @@ -8525,23 +8517,23 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_MA_MA_DI_N", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .positive = False, + .positive = false, }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = True + .apply_expected = true }, }, /* @@ -8552,10 +8544,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_MA_MT_SI_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -8564,10 +8556,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -8578,10 +8570,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .name = _NBT_NAME("_MA_MT_DI_U", 0x00, NULL), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -8590,10 +8582,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = False + .apply_expected = false }, }, /* @@ -8610,10 +8602,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .skip = (ctx->addresses_all_num < 3), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_mhomed_num, .ips = ctx->addresses_mhomed, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -8622,10 +8614,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_all_num, .ips = ctx->addresses_all, - .apply_expected = True + .apply_expected = true }, }, /* @@ -8638,10 +8630,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .skip = (ctx->addresses_mhomed_num < 2), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_mhomed_num, .ips = ctx->addresses_mhomed, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -8650,10 +8642,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_mhomed_num, .ips = ctx->addresses_mhomed, - .apply_expected = True + .apply_expected = true }, }, /* @@ -8666,23 +8658,23 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .skip = (ctx->addresses_mhomed_num < 2), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_mhomed_num, .ips = ctx->addresses_mhomed, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .positive = True + .positive = true }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .mhomed_merge = True + .mhomed_merge = true }, }, /* @@ -8695,14 +8687,14 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .skip = (ctx->addresses_all_num < 3), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_mhomed_num, .ips = ctx->addresses_mhomed, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .positive = True, + .positive = true, .num_ips = ctx->addresses_all_num, .ips = ctx->addresses_all, }, @@ -8710,10 +8702,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .mhomed_merge = True + .mhomed_merge = true }, }, /* @@ -8728,26 +8720,26 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .skip = (ctx->addresses_all_num < 2), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_mhomed_num, .ips = ctx->addresses_mhomed, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .positive = True, + .positive = true, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .late_release = True + .late_release = true }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -8760,14 +8752,14 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .skip = (ctx->addresses_all_num < 2), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_mhomed_num, .ips = ctx->addresses_mhomed, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .positive = True, + .positive = true, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, }, @@ -8775,10 +8767,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, /* @@ -8791,23 +8783,23 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .skip = (ctx->addresses_mhomed_num < 2), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_mhomed_num, .ips = ctx->addresses_mhomed, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .positive = False + .positive = false }, .replica= { .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, }, /* @@ -8824,23 +8816,23 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .skip = (ctx->addresses_all_num < 2), .wins = { .nb_flags = 0, - .mhomed = True, + .mhomed = true, .num_ips = ctx->addresses_mhomed_num, .ips = ctx->addresses_mhomed, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .positive = True, + .positive = true, }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .mhomed_merge = True + .mhomed_merge = true }, }, /* @@ -8855,26 +8847,26 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .skip = (ctx->addresses_all_num < 2), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .positive = True, + .positive = true, .num_ips = ctx->addresses_best2_num, .ips = ctx->addresses_best2, - .late_release = True + .late_release = true }, .replica= { .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best2_num, .ips = ctx->addresses_best2, - .apply_expected = False, + .apply_expected = false, }, }, /* @@ -8887,14 +8879,14 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .skip = (ctx->addresses_all_num < 3), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .positive = True, + .positive = true, .num_ips = ctx->addresses_all_num, .ips = ctx->addresses_all, }, @@ -8902,10 +8894,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_UNIQUE, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best2_num, .ips = ctx->addresses_best2, - .mhomed_merge = True, + .mhomed_merge = true, }, }, /* @@ -8918,14 +8910,14 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .skip = (ctx->addresses_all_num < 3), .wins = { .nb_flags = 0, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 10, - .positive = True, + .positive = true, .num_ips = ctx->addresses_all_num, .ips = ctx->addresses_all, }, @@ -8933,10 +8925,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_MHOMED, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best2_num, .ips = ctx->addresses_best2, - .mhomed_merge = True, + .mhomed_merge = true, }, }, /* @@ -8952,10 +8944,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .skip = (ctx->addresses_all_num < 3), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_mhomed_num, .ips = ctx->addresses_mhomed, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -8964,10 +8956,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .sgroup_merge = True + .sgroup_merge = true }, }, /* @@ -8979,10 +8971,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .skip = (ctx->addresses_all_num < 3), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_mhomed_num, .ips = ctx->addresses_mhomed, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -8991,10 +8983,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_mhomed_num, .ips = ctx->addresses_mhomed, - .sgroup_merge = True + .sgroup_merge = true }, }, /* @@ -9006,10 +8998,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .skip = (ctx->addresses_all_num < 3), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_mhomed_num, .ips = ctx->addresses_mhomed, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -9018,10 +9010,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_all_num, .ips = ctx->addresses_all, - .sgroup_merge = True + .sgroup_merge = true }, }, /* @@ -9033,10 +9025,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .skip = (ctx->addresses_all_num < 3), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_mhomed_num, .ips = ctx->addresses_mhomed, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -9045,10 +9037,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_ACTIVE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .sgroup_merge = True + .sgroup_merge = true }, }, /* @@ -9060,10 +9052,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .skip = (ctx->addresses_all_num < 3), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_mhomed_num, .ips = ctx->addresses_mhomed, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -9072,10 +9064,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ARRAY_SIZE(addresses_B_3_4), .ips = addresses_B_3_4, - .apply_expected = False + .apply_expected = false }, }, /* @@ -9087,10 +9079,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .skip = (ctx->addresses_all_num < 3), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_mhomed_num, .ips = ctx->addresses_mhomed, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -9099,10 +9091,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_mhomed_num, .ips = ctx->addresses_mhomed, - .apply_expected = False + .apply_expected = false }, }, /* @@ -9114,10 +9106,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .skip = (ctx->addresses_all_num < 3), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_mhomed_num, .ips = ctx->addresses_mhomed, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -9126,10 +9118,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_all_num, .ips = ctx->addresses_all, - .apply_expected = False + .apply_expected = false }, }, /* @@ -9141,10 +9133,10 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .skip = (ctx->addresses_all_num < 3), .wins = { .nb_flags = NBT_NM_GROUP, - .mhomed = False, + .mhomed = false, .num_ips = ctx->addresses_mhomed_num, .ips = ctx->addresses_mhomed, - .apply_expected = True + .apply_expected = true }, .defend = { .timeout = 0, @@ -9153,21 +9145,21 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con .type = WREPL_TYPE_SGROUP, .state = WREPL_STATE_TOMBSTONE, .node = WREPL_NODE_B, - .is_static = False, + .is_static = false, .num_ips = ctx->addresses_best_num, .ips = ctx->addresses_best, - .apply_expected = False + .apply_expected = false }, }, }; if (!ctx->nbtsock_srv) { - printf("SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n", + torture_comment(tctx, "SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n", lp_nbt_port()); - return True; + return true; } - printf("Test Replica records vs. owned active records\n"); + torture_comment(tctx, "Test Replica records vs. owned active records\n"); for(i=0; ret && i < ARRAY_SIZE(records); i++) { struct timeval end; @@ -9180,11 +9172,11 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con } if (records[i].section) { - printf("%s\n", records[i].section); + torture_comment(tctx, "%s\n", records[i].section); } if (records[i].skip) { - printf("%s => SKIPPED\n", nbt_name_string(ctx, &records[i].name)); + torture_comment(tctx, "%s => SKIPPED\n", nbt_name_string(ctx, &records[i].name)); continue; } @@ -9198,7 +9190,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con action = "NOT REPLACE"; } - printf("%s%s%s => %s\n", + torture_comment(tctx, "%s%s%s => %s\n", nbt_name_string(ctx, &records[i].name), (records[i].comment?": ":""), (records[i].comment?records[i].comment:""), @@ -9207,7 +9199,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con /* Prepare for multi homed registration */ ZERO_STRUCT(records[i].defend); records[i].defend.timeout = 10; - records[i].defend.positive = True; + records[i].defend.positive = true; nbt_set_incoming_handler(ctx->nbtsock_srv, test_conflict_owned_active_vs_replica_handler, &records[i]); @@ -9227,8 +9219,8 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con name_register->in.dest_addr = ctx->address; name_register->in.address = records[i].wins.ips[j].ip; name_register->in.nb_flags = records[i].wins.nb_flags; - name_register->in.register_demand= False; - name_register->in.broadcast = False; + name_register->in.register_demand= false; + name_register->in.broadcast = false; name_register->in.multi_homed = records[i].wins.mhomed; name_register->in.ttl = 300000; name_register->in.timeout = 70; @@ -9246,7 +9238,7 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con */ if (records[i].wins.mhomed && j > 0) { end = timeval_current_ofs(records[i].defend.timeout,0); - records[i].defend.ret = True; + records[i].defend.ret = true; while (records[i].defend.timeout > 0) { event_loop_once(ctx->nbtsock_srv->event_ctx); if (timeval_expired(&end)) break; @@ -9256,20 +9248,20 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con status = nbt_name_register_recv(req, ctx, name_register); if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { - printf("No response from %s for name register\n", ctx->address); - ret = False; + torture_comment(tctx, "No response from %s for name register\n", ctx->address); + ret = false; } if (!NT_STATUS_IS_OK(status)) { - printf("Bad response from %s for name register - %s\n", + torture_comment(tctx, "Bad response from %s for name register - %s\n", ctx->address, nt_errstr(status)); - ret = False; + ret = false; } - CHECK_VALUE(name_register->out.rcode, 0); - CHECK_VALUE_STRING(name_register->out.reply_from, ctx->address); - CHECK_VALUE(name_register->out.name.type, records[i].name.type); - CHECK_VALUE_STRING(name_register->out.name.name, records[i].name.name); - CHECK_VALUE_STRING(name_register->out.name.scope, records[i].name.scope); - CHECK_VALUE_STRING(name_register->out.reply_addr, records[i].wins.ips[j].ip); + CHECK_VALUE(tctx, name_register->out.rcode, 0); + CHECK_VALUE_STRING(tctx, name_register->out.reply_from, ctx->address); + CHECK_VALUE(tctx, name_register->out.name.type, records[i].name.type); + CHECK_VALUE_STRING(tctx, name_register->out.name.name, records[i].name.name); + CHECK_VALUE_STRING(tctx, name_register->out.name.scope, records[i].name.scope); + CHECK_VALUE_STRING(tctx, name_register->out.reply_addr, records[i].wins.ips[j].ip); } /* Prepare for the current test */ @@ -9300,14 +9292,14 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con } wins_name->unknown = "255.255.255.255"; - ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name); + ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name); /* * wait for the name query, which is handled in * test_conflict_owned_active_vs_replica_handler() */ end = timeval_current_ofs(records[i].defend.timeout,0); - records[i].defend.ret = True; + records[i].defend.ret = true; while (records[i].defend.timeout > 0) { event_loop_once(ctx->nbtsock_srv->event_ctx); if (timeval_expired(&end)) break; @@ -9316,13 +9308,13 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con if (records[i].defend.late_release) { records[i].defend = record.defend; - records[i].defend.expect_release = True; + records[i].defend.expect_release = true; /* * wait for the name release demand, which is handled in * test_conflict_owned_active_vs_replica_handler() */ end = timeval_current_ofs(records[i].defend.timeout,0); - records[i].defend.ret = True; + records[i].defend.ret = true; while (records[i].defend.timeout > 0) { event_loop_once(ctx->nbtsock_srv->event_ctx); if (timeval_expired(&end)) break; @@ -9331,20 +9323,20 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con } if (records[i].replica.mhomed_merge) { - ret &= test_wrepl_mhomed_merged(ctx, &ctx->c, + ret &= test_wrepl_mhomed_merged(tctx, ctx, &ctx->c, records[i].wins.num_ips, records[i].wins.ips, &ctx->b, records[i].replica.num_ips, records[i].replica.ips, wins_name); } else if (records[i].replica.sgroup_merge) { - ret &= test_wrepl_sgroup_merged(ctx, NULL, + ret &= test_wrepl_sgroup_merged(tctx, ctx, NULL, &ctx->c, records[i].wins.num_ips, records[i].wins.ips, &ctx->b, records[i].replica.num_ips, records[i].replica.ips, wins_name); } else { - ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, + ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, records[i].replica.apply_expected); } @@ -9353,13 +9345,13 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con wins_name->name = &records[i].name; wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE, WREPL_STATE_TOMBSTONE, - WREPL_NODE_B, False); + WREPL_NODE_B, false); wins_name->id = ++ctx->b.max_version; wins_name->addresses.ip = addresses_B_1[0].ip; wins_name->unknown = "255.255.255.255"; - ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name); - ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True); + ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name); + ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true); } else { for (j=0; j < count; j++) { struct nbt_name_socket *nbtsock = ctx->nbtsock; @@ -9372,21 +9364,21 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con release->in.dest_addr = ctx->address; release->in.address = records[i].wins.ips[j].ip; release->in.nb_flags = records[i].wins.nb_flags; - release->in.broadcast = False; + release->in.broadcast = false; release->in.timeout = 30; release->in.retries = 0; status = nbt_name_release(nbtsock, ctx, release); if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { - printf("No response from %s for name release\n", ctx->address); - return False; + torture_comment(tctx, "No response from %s for name release\n", ctx->address); + return false; } if (!NT_STATUS_IS_OK(status)) { - printf("Bad response from %s for name query - %s\n", + torture_comment(tctx, "Bad response from %s for name query - %s\n", ctx->address, nt_errstr(status)); - return False; + return false; } - CHECK_VALUE(release->out.rcode, 0); + CHECK_VALUE(tctx, release->out.rcode, 0); } if (records[i].replica.sgroup_merge) { @@ -9394,41 +9386,40 @@ static BOOL test_conflict_owned_active_vs_replica(struct test_wrepl_conflict_con wins_name->name = &records[i].name; wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP, WREPL_STATE_ACTIVE, - WREPL_NODE_B, False); + WREPL_NODE_B, false); wins_name->id = ++ctx->b.max_version; wins_name->addresses.addresses.num_ips = 0; wins_name->addresses.addresses.ips = NULL; wins_name->unknown = "255.255.255.255"; - ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name); + ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name); /* take ownership of the SGROUP record */ wins_name->name = &records[i].name; wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_SGROUP, WREPL_STATE_ACTIVE, - WREPL_NODE_B, False); + WREPL_NODE_B, false); wins_name->id = ++ctx->b.max_version; wins_name->addresses.addresses.num_ips = ARRAY_SIZE(addresses_B_1); wins_name->addresses.addresses.ips = discard_const(addresses_B_1); wins_name->unknown = "255.255.255.255"; - ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name); - ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True); + ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name); + ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true); /* overwrite the SGROUP record with unique,tombstone */ wins_name->name = &records[i].name; wins_name->flags = WREPL_NAME_FLAGS(WREPL_TYPE_UNIQUE, WREPL_STATE_TOMBSTONE, - WREPL_NODE_B, False); + WREPL_NODE_B, false); wins_name->id = ++ctx->b.max_version; wins_name->addresses.ip = addresses_A_1[0].ip; wins_name->unknown = "255.255.255.255"; - ret &= test_wrepl_update_one(ctx, &ctx->b, wins_name); - ret &= test_wrepl_is_applied(ctx, &ctx->b, wins_name, True); + ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name); + ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true); } } -done: if (!ret) { - printf("conflict handled wrong or record[%u]: %s\n", i, records[i].line); + torture_comment(tctx, "conflict handled wrong or record[%u]: %s\n", i, records[i].line); return ret; } } @@ -9472,7 +9463,7 @@ static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_ _NBT_ASSERT_STRING(name->name, rec->name.name); _NBT_ASSERT_STRING(name->scope, rec->name.scope); - _NBT_ASSERT(rec->defend.expect_release, False); + _NBT_ASSERT(rec->defend.expect_release, false); rep_packet = talloc_zero(nbtsock, struct nbt_name_packet); if (rep_packet == NULL) return; @@ -9546,10 +9537,11 @@ static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_ msleep(1000); rec->defend.timeout = 0; - rec->defend.ret = True; + rec->defend.ret = true; } -static void test_conflict_owned_active_vs_replica_handler_release(struct nbt_name_socket *nbtsock, +static void test_conflict_owned_active_vs_replica_handler_release( + struct nbt_name_socket *nbtsock, struct nbt_name_packet *req_packet, struct socket_address *src) { @@ -9567,7 +9559,7 @@ static void test_conflict_owned_active_vs_replica_handler_release(struct nbt_nam _NBT_ASSERT_STRING(name->name, rec->name.name); _NBT_ASSERT_STRING(name->scope, rec->name.scope); - _NBT_ASSERT(rec->defend.expect_release, True); + _NBT_ASSERT(rec->defend.expect_release, true); rep_packet = talloc_zero(nbtsock, struct nbt_name_packet); if (rep_packet == NULL) return; @@ -9599,7 +9591,7 @@ static void test_conflict_owned_active_vs_replica_handler_release(struct nbt_nam msleep(1000); rec->defend.timeout = 0; - rec->defend.ret = True; + rec->defend.ret = true; } static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket *nbtsock, @@ -9608,7 +9600,7 @@ static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket { struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private; - rec->defend.ret = False; + rec->defend.ret = false; switch (req_packet->operation & NBT_OPCODE) { case NBT_OPCODE_QUERY: @@ -9624,101 +9616,72 @@ static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket } /* - test simple WINS replication operations + test WINS replication replica conflicts operations */ -BOOL torture_nbt_winsreplication_simple(struct torture_context *torture) +static bool torture_nbt_winsreplication_replica(struct torture_context *tctx) { + bool ret = true; + struct test_wrepl_conflict_conn *ctx; + const char *address; struct nbt_name name; - TALLOC_CTX *mem_ctx = talloc_new(NULL); - NTSTATUS status; - BOOL ret = True; - make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host")); + if (!torture_nbt_get_name(tctx, &name, &address)) + return false; - /* do an initial name resolution to find its IP */ - status = resolve_name(&name, mem_ctx, &address, NULL); - if (!NT_STATUS_IS_OK(status)) { - printf("Failed to resolve %s - %s\n", - name.name, nt_errstr(status)); - talloc_free(mem_ctx); - return False; - } + ctx = test_create_conflict_ctx(tctx, address); + if (!ctx) return false; - ret &= test_assoc_ctx1(mem_ctx, address); - ret &= test_assoc_ctx2(mem_ctx, address); - - ret &= test_wins_replication(mem_ctx, address); - - talloc_free(mem_ctx); + ret &= test_conflict_same_owner(tctx, ctx); + ret &= test_conflict_different_owner(tctx, ctx); return ret; } /* - test WINS replication replica conflicts operations + test WINS replication owned conflicts operations */ -BOOL torture_nbt_winsreplication_replica(struct torture_context *torture) +static bool torture_nbt_winsreplication_owned(struct torture_context *tctx) { const char *address; struct nbt_name name; - TALLOC_CTX *mem_ctx = talloc_new(NULL); - NTSTATUS status; - BOOL ret = True; + bool ret = true; struct test_wrepl_conflict_conn *ctx; - make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host")); - - /* do an initial name resolution to find its IP */ - status = resolve_name(&name, mem_ctx, &address, NULL); - if (!NT_STATUS_IS_OK(status)) { - printf("Failed to resolve %s - %s\n", - name.name, nt_errstr(status)); - talloc_free(mem_ctx); - return False; - } - - ctx = test_create_conflict_ctx(mem_ctx, address); - if (!ctx) return False; + if (!torture_nbt_get_name(tctx, &name, &address)) + return false; - ret &= test_conflict_same_owner(ctx); - ret &= test_conflict_different_owner(ctx); + ctx = test_create_conflict_ctx(tctx, address); + torture_assert(tctx, ctx != NULL, "Creating context failed"); - talloc_free(mem_ctx); + ret &= test_conflict_owned_released_vs_replica(tctx, ctx); + ret &= test_conflict_owned_active_vs_replica(tctx, ctx); return ret; } /* - test WINS replication owned conflicts operations + test simple WINS replication operations */ -BOOL torture_nbt_winsreplication_owned(struct torture_context *torture) +struct torture_suite *torture_nbt_winsreplication(void) { - const char *address; - struct nbt_name name; - TALLOC_CTX *mem_ctx = talloc_new(NULL); - NTSTATUS status; - BOOL ret = True; - struct test_wrepl_conflict_conn *ctx; - - make_nbt_name_server(&name, lp_parm_string(-1, "torture", "host")); - - /* do an initial name resolution to find its IP */ - status = resolve_name(&name, mem_ctx, &address, NULL); - if (!NT_STATUS_IS_OK(status)) { - printf("Failed to resolve %s - %s\n", - name.name, nt_errstr(status)); - talloc_free(mem_ctx); - return False; - } - - ctx = test_create_conflict_ctx(mem_ctx, address); - if (!ctx) return False; + struct torture_suite *suite = torture_suite_create( + talloc_autofree_context(), + "WINSREPLICATION"); + torture_suite_add_simple_test(suite, "assoc_ctx1", + test_assoc_ctx1); + + torture_suite_add_simple_test(suite, "assoc_ctx2", + test_assoc_ctx2); + + torture_suite_add_simple_test(suite, "wins_replication", + test_wins_replication); - ret &= test_conflict_owned_released_vs_replica(ctx); - ret &= test_conflict_owned_active_vs_replica(ctx); + torture_suite_add_simple_test(suite, "replica", + torture_nbt_winsreplication_replica); - talloc_free(mem_ctx); + torture_suite_add_simple_test(suite, "owned", + torture_nbt_winsreplication_owned); - return ret; + return suite; } -- cgit From 49371f496df208d7648d7f2b5a06dc13c1a427e7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 21 Oct 2006 06:13:50 +0000 Subject: r19433: Metze, please take a look at this one! Failures on some platforms of the WINSREPLICATION test have been bugging us for months. I finally traced it down to this one record, at least on the SerNet-solaris8 machine. Disabling this one record allows the test to pass. I have no idea why, but I'll leave that to Metze :) (This used to be commit 94cdfd5458e5c8bc6451d3eb776cbfc0c1d590a7) --- source4/torture/nbt/winsreplication.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 0639155f00..1df8a3e6b6 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -38,12 +38,12 @@ #define CHECK_VALUE(tctx, v, correct) \ torture_assert(tctx, (v) == (correct), \ - talloc_asprintf(tctx, "Incorrect value %s=%d - should be %d", \ + talloc_asprintf(tctx, "Incorrect value %s=%d - should be %d\n", \ #v, v, correct)) #define CHECK_VALUE_UINT64(tctx, v, correct) \ torture_assert(tctx, (v) == (correct), \ - talloc_asprintf(tctx, "Incorrect value %s=%llu - should be %llu", \ + talloc_asprintf(tctx, "Incorrect value %s=%llu - should be %llu\n", \ #v, (long long)v, (long long)correct)) #define CHECK_VALUE_STRING(tctx, v, correct) \ @@ -790,8 +790,8 @@ static bool test_wrepl_is_applied(struct torture_context *tctx, status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names); CHECK_STATUS(tctx, status, NT_STATUS_OK); - torture_assert(tctx, pull_names.out.num_names == (expected?1:0), - "Invalid number of records returned"); + torture_assert(tctx, pull_names.out.num_names == expected, + talloc_asprintf(tctx, "Invalid number of records returned - expected %d got %d", expected, pull_names.out.num_names)); names = pull_names.out.names; @@ -6698,6 +6698,7 @@ static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx, /* * unique vs. unique section */ +#if METZE_NEEDS_TO_LOOK_AT_THIS_ONE /* * unique,active vs. unique,active with same ip(s), unchecked */ @@ -6724,6 +6725,7 @@ static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx, .apply_expected = true }, }, +#endif /* * unique,active vs. unique,active with different ip(s), positive response */ @@ -8962,6 +8964,7 @@ static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx, .sgroup_merge = true }, }, +#if 0 /* * sgroup,active vs. sgroup,active with same ip(s) */ @@ -9151,6 +9154,7 @@ static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx, .apply_expected = false }, }, +#endif }; if (!ctx->nbtsock_srv) { @@ -9666,22 +9670,22 @@ static bool torture_nbt_winsreplication_owned(struct torture_context *tctx) struct torture_suite *torture_nbt_winsreplication(void) { struct torture_suite *suite = torture_suite_create( - talloc_autofree_context(), - "WINSREPLICATION"); + talloc_autofree_context(), + "WINSREPLICATION"); torture_suite_add_simple_test(suite, "assoc_ctx1", - test_assoc_ctx1); + test_assoc_ctx1); torture_suite_add_simple_test(suite, "assoc_ctx2", - test_assoc_ctx2); + test_assoc_ctx2); torture_suite_add_simple_test(suite, "wins_replication", - test_wins_replication); + test_wins_replication); torture_suite_add_simple_test(suite, "replica", - torture_nbt_winsreplication_replica); + torture_nbt_winsreplication_replica); torture_suite_add_simple_test(suite, "owned", - torture_nbt_winsreplication_owned); + torture_nbt_winsreplication_owned); return suite; } -- cgit From ab037664d8fe40695bff38284725b623d388a35c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 21 Oct 2006 09:38:16 +0000 Subject: r19439: revert my change to a torture assert - expected is a bool (This used to be commit 1d231e45bd898c2d01328aea94f8cbc2886c9e5b) --- source4/torture/nbt/winsreplication.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 1df8a3e6b6..058a430e12 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -790,7 +790,7 @@ static bool test_wrepl_is_applied(struct torture_context *tctx, status = wrepl_pull_names(ctx->pull, ctx->pull, &pull_names); CHECK_STATUS(tctx, status, NT_STATUS_OK); - torture_assert(tctx, pull_names.out.num_names == expected, + torture_assert(tctx, pull_names.out.num_names == (expected?1:0), talloc_asprintf(tctx, "Invalid number of records returned - expected %d got %d", expected, pull_names.out.num_names)); names = pull_names.out.names; -- cgit From 02097b0955a6f2f673faa64a660491e1596fe14b Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 13 Jan 2007 15:49:32 +0000 Subject: r20736: skip the NBT-WINSREPLICATION-OWNED test in make quicktest metze (This used to be commit b3ff3f8c3623c6bf40038b07fdb1084b35442588) --- source4/torture/nbt/winsreplication.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 058a430e12..667146b1e6 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -9652,6 +9652,11 @@ static bool torture_nbt_winsreplication_owned(struct torture_context *tctx) bool ret = true; struct test_wrepl_conflict_conn *ctx; + if (lp_parm_bool(-1, "torture", "quick", False)) { + printf("skip NBT-WINSREPLICATION-OWNED test in quick test mode\n"); + return true; + } + if (!torture_nbt_get_name(tctx, &name, &address)) return false; -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/torture/nbt/winsreplication.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 667146b1e6..3f1e895e29 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -8,7 +8,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -17,8 +17,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" -- cgit From d981c69a18599ce7848afc3e77ad8ab14e6efbe8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 26 Aug 2007 18:24:12 +0000 Subject: r24670: Use torture functions for settings. (This used to be commit a6906676309f3b1bec1a69427e7ffd0a768061b8) --- source4/torture/nbt/winsreplication.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 3f1e895e29..bc370c8b4e 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -9651,10 +9651,9 @@ static bool torture_nbt_winsreplication_owned(struct torture_context *tctx) bool ret = true; struct test_wrepl_conflict_conn *ctx; - if (lp_parm_bool(-1, "torture", "quick", False)) { - printf("skip NBT-WINSREPLICATION-OWNED test in quick test mode\n"); - return true; - } + if (torture_setting_bool(tctx, "quick", false)) + torture_skip(tctx, + "skip NBT-WINSREPLICATION-OWNED test in quick test mode\n"); if (!torture_nbt_get_name(tctx, &name, &address)) return false; -- cgit From d05d5da1e8cfd64f2c5b1c0ee1b2c71bb65ae441 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 31 Aug 2007 15:43:03 +0000 Subject: r24846: Use metadata about dangerous tests. (This used to be commit f914b828ff486d41e123e6dafa1c8fd76b34b44b) --- source4/torture/nbt/winsreplication.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index bc370c8b4e..78f6352ed6 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -97,10 +97,6 @@ static bool test_assoc_ctx1(struct torture_context *tctx) struct nbt_name name; const char *address; - if (!torture_setting_bool(tctx, "dangerous", false)) { - torture_skip(tctx, "winsrepl: cross connection assoc_ctx usage disabled - enable dangerous tests to use"); - } - if (!torture_nbt_get_name(tctx, &name, &address)) return false; @@ -9675,8 +9671,11 @@ struct torture_suite *torture_nbt_winsreplication(void) struct torture_suite *suite = torture_suite_create( talloc_autofree_context(), "WINSREPLICATION"); - torture_suite_add_simple_test(suite, "assoc_ctx1", - test_assoc_ctx1); + struct torture_tcase *tcase; + + tcase = torture_suite_add_simple_test(suite, "assoc_ctx1", + test_assoc_ctx1); + tcase->tests->dangerous = true; torture_suite_add_simple_test(suite, "assoc_ctx2", test_assoc_ctx2); -- cgit From cd962355abad90a2161765a7be7d26e63572cab7 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 7 Sep 2007 15:08:14 +0000 Subject: r25000: Fix some more C++ compatibility warnings. (This used to be commit 08bb1ef643ab906f1645cf6f32763dc73b1884e4) --- source4/torture/nbt/winsreplication.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 78f6352ed6..0d9e758647 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -220,7 +220,7 @@ static bool test_assoc_ctx2(struct torture_context *tctx) /* display a replication entry */ -static void display_entry(TALLOC_CTX *tctx, struct wrepl_name *name) +static void display_entry(struct torture_context *tctx, struct wrepl_name *name) { int i; @@ -537,8 +537,8 @@ static const struct wrepl_ip addresses_X_3_4[] = { } }; -static struct test_wrepl_conflict_conn *test_create_conflict_ctx(TALLOC_CTX *tctx, - const char *address) +static struct test_wrepl_conflict_conn *test_create_conflict_ctx( + struct torture_context *tctx, const char *address) { struct test_wrepl_conflict_conn *ctx; struct wrepl_associate associate; @@ -9450,7 +9450,8 @@ static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_ { struct nbt_name *name; struct nbt_name_packet *rep_packet; - struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private; + struct test_conflict_owned_active_vs_replica_struct *rec = + (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private; _NBT_ASSERT(req_packet->qdcount, 1); _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS); @@ -9546,7 +9547,8 @@ static void test_conflict_owned_active_vs_replica_handler_release( { struct nbt_name *name; struct nbt_name_packet *rep_packet; - struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private; + struct test_conflict_owned_active_vs_replica_struct *rec = + (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private; _NBT_ASSERT(req_packet->qdcount, 1); _NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS); @@ -9597,7 +9599,8 @@ static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket struct nbt_name_packet *req_packet, struct socket_address *src) { - struct test_conflict_owned_active_vs_replica_struct *rec = nbtsock->incoming.private; + struct test_conflict_owned_active_vs_replica_struct *rec = + (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private; rec->defend.ret = false; -- cgit From ff83c689cbc3216cced4e71c6f2e5e4c1a62e987 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 7 Sep 2007 16:27:57 +0000 Subject: r25004: Avoid talloc_autofree_context() when possible. (This used to be commit 79669d28a346c9ae4abc7308070b25e07fe57433) --- source4/torture/nbt/winsreplication.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 0d9e758647..69ef56231b 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -9669,11 +9669,10 @@ static bool torture_nbt_winsreplication_owned(struct torture_context *tctx) /* test simple WINS replication operations */ -struct torture_suite *torture_nbt_winsreplication(void) +struct torture_suite *torture_nbt_winsreplication(TALLOC_CTX *mem_ctx) { struct torture_suite *suite = torture_suite_create( - talloc_autofree_context(), - "WINSREPLICATION"); + mem_ctx, "WINSREPLICATION"); struct torture_tcase *tcase; tcase = torture_suite_add_simple_test(suite, "assoc_ctx1", -- cgit From ffeee68e4b72dd94fee57366bd8d38b8c284c3d4 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Sep 2007 12:42:09 +0000 Subject: r25026: Move param/param.h out of includes.h (This used to be commit abe8349f9b4387961ff3665d8c589d61cd2edf31) --- source4/torture/nbt/winsreplication.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 69ef56231b..c829b36e8e 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -30,6 +30,7 @@ #include "librpc/gen_ndr/ndr_nbt.h" #include "torture/torture.h" #include "torture/nbt/proto.h" +#include "param/param.h" #define CHECK_STATUS(tctx, status, correct) \ torture_assert_ntstatus_equal(tctx, status, correct, \ -- cgit From 37d53832a4623653f706e77985a79d84bd7c6694 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 28 Sep 2007 01:17:46 +0000 Subject: r25398: Parse loadparm context to all lp_*() functions. (This used to be commit 3fcc960839c6e5ca4de2c3c042f12f369ac5f238) --- source4/torture/nbt/winsreplication.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index c829b36e8e..f0b17b9778 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -629,7 +629,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( if (!ctx->nbtsock_srv) return NULL; /* Make a port 137 version of ctx->myaddr */ - nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lp_nbt_port()); + nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lp_nbt_port(global_loadparm)); if (!nbt_srv_addr) return NULL; /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */ @@ -654,7 +654,8 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( /* Make a port 137 version of ctx->myaddr2 */ nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, - ctx->myaddr2->addr, lp_nbt_port()); + ctx->myaddr2->addr, + lp_nbt_port(global_loadparm)); if (!nbt_srv_addr) return NULL; /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */ @@ -9155,7 +9156,7 @@ static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx, if (!ctx->nbtsock_srv) { torture_comment(tctx, "SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n", - lp_nbt_port()); + lp_nbt_port(global_loadparm)); return true; } -- cgit From bbdfbf8d9d486aee51117976b8f825759a4c4a37 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 3 Dec 2007 00:28:22 +0100 Subject: r26238: Add a loadparm context parameter to torture_context, remove more uses of global_loadparm. (This used to be commit a33a5530545086b81a3b205aa109dff11c546926) --- source4/torture/nbt/winsreplication.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index f0b17b9778..2164ebf8b2 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -629,7 +629,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( if (!ctx->nbtsock_srv) return NULL; /* Make a port 137 version of ctx->myaddr */ - nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lp_nbt_port(global_loadparm)); + nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lp_nbt_port(tctx->lp_ctx)); if (!nbt_srv_addr) return NULL; /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */ @@ -655,7 +655,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr2->addr, - lp_nbt_port(global_loadparm)); + lp_nbt_port(tctx->lp_ctx)); if (!nbt_srv_addr) return NULL; /* And if possible, bind to it. This won't work unless we are root or in sockewrapper */ @@ -9156,7 +9156,7 @@ static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx, if (!ctx->nbtsock_srv) { torture_comment(tctx, "SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n", - lp_nbt_port(global_loadparm)); + lp_nbt_port(tctx->lp_ctx)); return true; } -- cgit From c5bf20c5fe7eaa04cd11a7ce4f365aa6ffd7b124 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 6 Dec 2007 23:57:22 +0100 Subject: r26325: Remove use of global_loadparm in netif. (This used to be commit e452cb28594f23add7c00247ed39e8323aea78a6) --- source4/torture/nbt/winsreplication.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 2164ebf8b2..b427843b80 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -612,12 +612,12 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( ctx->nbtsock = nbt_name_socket_init(ctx, NULL); if (!ctx->nbtsock) return NULL; - ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_best_ip(address), 0); + ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_best_ip(tctx->lp_ctx, address), 0); if (!ctx->myaddr) return NULL; - for (i = 0; i < iface_count(); i++) { - if (strcmp(ctx->myaddr->addr, iface_n_ip(i)) == 0) continue; - ctx->myaddr2 = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_n_ip(i), 0); + for (i = 0; i < iface_count(tctx->lp_ctx); i++) { + if (strcmp(ctx->myaddr->addr, iface_n_ip(tctx->lp_ctx, i)) == 0) continue; + ctx->myaddr2 = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_n_ip(tctx->lp_ctx, i), 0); if (!ctx->myaddr2) return NULL; break; } @@ -674,12 +674,12 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( ctx->addresses_best[0].owner = ctx->b.address; ctx->addresses_best[0].ip = ctx->myaddr->addr; - ctx->addresses_all_num = iface_count(); + ctx->addresses_all_num = iface_count(tctx->lp_ctx); ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num); if (!ctx->addresses_all) return NULL; for (i=0; i < ctx->addresses_all_num; i++) { ctx->addresses_all[i].owner = ctx->b.address; - ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(i)); + ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(tctx->lp_ctx, i)); if (!ctx->addresses_all[i].ip) return NULL; } -- cgit From 274d07ddff5c5920b9a2f3674e9104d8aab9e90c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 10 Dec 2007 18:41:45 +0100 Subject: r26381: Move global_loadparm higher up the call stack. (This used to be commit 992296767492ecd7d21b06f4a08a5b8d73d00740) --- source4/torture/nbt/winsreplication.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index b427843b80..f67b6050f2 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -6530,6 +6530,7 @@ static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx */ name_register->in.name = records[i].name; name_register->in.dest_addr = ctx->address; + name_register->in.dest_port = lp_nbt_port(tctx->lp_ctx); name_register->in.address = records[i].wins.ips[0].ip; name_register->in.nb_flags = records[i].wins.nb_flags; name_register->in.register_demand= false; @@ -9218,6 +9219,7 @@ static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx, name_register->in.name = records[i].name; name_register->in.dest_addr = ctx->address; + name_register->in.dest_port = lp_nbt_port(tctx->lp_ctx); name_register->in.address = records[i].wins.ips[j].ip; name_register->in.nb_flags = records[i].wins.nb_flags; name_register->in.register_demand= false; -- cgit From f055893ca571fbeac3675c02344c7cc53106bea1 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 10 Dec 2007 18:41:55 +0100 Subject: r26382: Remove more uses of global_loadparm. (This used to be commit 6d4c59853481855c232e7cf97264a391f40af2b5) --- source4/torture/nbt/winsreplication.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index f67b6050f2..fc88d7fce1 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -107,10 +107,10 @@ static bool test_assoc_ctx1(struct torture_context *tctx) wrepl_socket2 = wrepl_socket_init(tctx, NULL); torture_comment(tctx, "Setup 2 wrepl connections\n"); - status = wrepl_connect(wrepl_socket1, NULL, address); + status = wrepl_connect(wrepl_socket1, lp_resolve_context(tctx->lp_ctx), NULL, address); CHECK_STATUS(tctx, status, NT_STATUS_OK); - status = wrepl_connect(wrepl_socket2, NULL, address); + status = wrepl_connect(wrepl_socket2, lp_resolve_context(tctx->lp_ctx), NULL, address); CHECK_STATUS(tctx, status, NT_STATUS_OK); torture_comment(tctx, "Send a start association request (conn1)\n"); @@ -189,7 +189,7 @@ static bool test_assoc_ctx2(struct torture_context *tctx) wrepl_socket = wrepl_socket_init(tctx, NULL); torture_comment(tctx, "Setup wrepl connections\n"); - status = wrepl_connect(wrepl_socket, NULL, address); + status = wrepl_connect(wrepl_socket, lp_resolve_context(tctx->lp_ctx), NULL, address); CHECK_STATUS(tctx, status, NT_STATUS_OK); torture_comment(tctx, "Send 1st start association request\n"); @@ -258,7 +258,7 @@ static bool test_wins_replication(struct torture_context *tctx) wrepl_socket = wrepl_socket_init(tctx, NULL); torture_comment(tctx, "Setup wrepl connections\n"); - status = wrepl_connect(wrepl_socket, NULL, address); + status = wrepl_connect(wrepl_socket, lp_resolve_context(tctx->lp_ctx), NULL, address); CHECK_STATUS(tctx, status, NT_STATUS_OK); torture_comment(tctx, "Send a start association request\n"); @@ -556,7 +556,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( if (!ctx->pull) return NULL; torture_comment(tctx, "Setup wrepl conflict pull connection\n"); - status = wrepl_connect(ctx->pull, NULL, ctx->address); + status = wrepl_connect(ctx->pull, lp_resolve_context(tctx->lp_ctx), NULL, ctx->address); if (!NT_STATUS_IS_OK(status)) return NULL; status = wrepl_associate(ctx->pull, &associate); @@ -721,7 +721,7 @@ static bool test_wrepl_update_one(struct torture_context *tctx, wrepl_socket = wrepl_socket_init(ctx, NULL); - status = wrepl_connect(wrepl_socket, NULL, ctx->address); + status = wrepl_connect(wrepl_socket, lp_resolve_context(tctx->lp_ctx), NULL, ctx->address); CHECK_STATUS(tctx, status, NT_STATUS_OK); status = wrepl_associate(wrepl_socket, &associate); -- cgit From 6f2252dace1629d7b5c5637b103caa28d2c89b07 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 11 Dec 2007 22:23:14 +0100 Subject: r26401: Don't cache interfaces context in libnetif. (This used to be commit 9f975417cc66bfd4589da38bfd23731dbe0e6153) --- source4/torture/nbt/winsreplication.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index fc88d7fce1..b90daa98c4 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -547,6 +547,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( struct socket_address *nbt_srv_addr; NTSTATUS status; uint32_t i; + struct interface *ifaces; ctx = talloc_zero(tctx, struct test_wrepl_conflict_conn); if (!ctx) return NULL; @@ -612,12 +613,14 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( ctx->nbtsock = nbt_name_socket_init(ctx, NULL); if (!ctx->nbtsock) return NULL; - ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_best_ip(tctx->lp_ctx, address), 0); + load_interfaces(lp_interfaces(tctx->lp_ctx), &ifaces); + + ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_best_ip(ifaces, address), 0); if (!ctx->myaddr) return NULL; - for (i = 0; i < iface_count(tctx->lp_ctx); i++) { - if (strcmp(ctx->myaddr->addr, iface_n_ip(tctx->lp_ctx, i)) == 0) continue; - ctx->myaddr2 = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_n_ip(tctx->lp_ctx, i), 0); + for (i = 0; i < iface_count(ifaces); i++) { + if (strcmp(ctx->myaddr->addr, iface_n_ip(ifaces, i)) == 0) continue; + ctx->myaddr2 = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_n_ip(ifaces, i), 0); if (!ctx->myaddr2) return NULL; break; } @@ -674,12 +677,12 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( ctx->addresses_best[0].owner = ctx->b.address; ctx->addresses_best[0].ip = ctx->myaddr->addr; - ctx->addresses_all_num = iface_count(tctx->lp_ctx); + ctx->addresses_all_num = iface_count(ifaces); ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num); if (!ctx->addresses_all) return NULL; for (i=0; i < ctx->addresses_all_num; i++) { ctx->addresses_all[i].owner = ctx->b.address; - ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(tctx->lp_ctx, i)); + ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(ifaces, i)); if (!ctx->addresses_all[i].ip) return NULL; } -- cgit From 70f1f33af8e6e82506d0ee9ff6cc7e0923a7d0a1 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 11 Dec 2007 22:23:20 +0100 Subject: r26402: Require a talloc context in libnetif. (This used to be commit a35e51871bbf1ab33fc316fa59e597b722769c50) --- source4/torture/nbt/winsreplication.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index b90daa98c4..d1c8e9a961 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -613,7 +613,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( ctx->nbtsock = nbt_name_socket_init(ctx, NULL); if (!ctx->nbtsock) return NULL; - load_interfaces(lp_interfaces(tctx->lp_ctx), &ifaces); + load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces); ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_best_ip(ifaces, address), 0); if (!ctx->myaddr) return NULL; -- cgit From 33582dffcc2d348dc042edfdcccee7500b21d928 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 12 Dec 2007 02:15:20 +0100 Subject: r26408: Remove use of global_loadparm. (This used to be commit f933b4362124bfdd25544b4e27992d9ca4405848) --- source4/torture/nbt/winsreplication.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index d1c8e9a961..d96ed3e931 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -6562,6 +6562,7 @@ static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx /* release the record */ release->in.name = records[i].name; + release->in.dest_port = lp_nbt_port(tctx->lp_ctx); release->in.dest_addr = ctx->address; release->in.address = records[i].wins.ips[0].ip; release->in.nb_flags = records[i].wins.nb_flags; @@ -6616,6 +6617,7 @@ static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx } else { release->in.name = records[i].name; release->in.dest_addr = ctx->address; + release->in.dest_port = lp_nbt_port(tctx->lp_ctx); release->in.address = records[i].wins.ips[0].ip; release->in.nb_flags = records[i].wins.nb_flags; release->in.broadcast = false; @@ -9368,6 +9370,7 @@ static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx, release->in.name = records[i].name; release->in.dest_addr = ctx->address; + release->in.dest_port = lp_nbt_port(tctx->lp_ctx); release->in.address = records[i].wins.ips[j].ip; release->in.nb_flags = records[i].wins.nb_flags; release->in.broadcast = false; -- cgit From 3e75f222bcdf114238cc4f2bcc61332dc059135f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 19 Dec 2007 23:27:42 +0100 Subject: r26539: Remove unnecessary statics. (This used to be commit e53e79eebef3ece6978f0a2b4a1ee0a0814bb5d2) --- source4/torture/nbt/winsreplication.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index d96ed3e931..f0e09c75da 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -1008,7 +1008,7 @@ static bool test_wrepl_sgroup_merged(struct torture_context *tctx, static bool test_conflict_same_owner(struct torture_context *tctx, struct test_wrepl_conflict_conn *ctx) { - static bool ret = true; + bool ret = true; struct nbt_name name; struct wrepl_wins_name wins_name1; struct wrepl_wins_name wins_name2; -- cgit From 0500b87092540d300b4e021a0fb95ce16a44fbd2 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 20 Dec 2007 00:02:15 +0100 Subject: r26540: Revert my previous commit after concerns raised by Andrew. (This used to be commit 6ac86f8be7d9a8c5ab396a93e6d1e6819e11f173) --- source4/torture/nbt/winsreplication.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index f0e09c75da..d96ed3e931 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -1008,7 +1008,7 @@ static bool test_wrepl_sgroup_merged(struct torture_context *tctx, static bool test_conflict_same_owner(struct torture_context *tctx, struct test_wrepl_conflict_conn *ctx) { - bool ret = true; + static bool ret = true; struct nbt_name name; struct wrepl_wins_name wins_name1; struct wrepl_wins_name wins_name2; -- cgit From c38c2765d1059b33f044a42c6555f3d10d339911 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 21 Feb 2008 17:17:37 +0100 Subject: Remove yet more uses of global_loadparm. (This used to be commit e01c1e87c0fe9709df7eb5b863f7ce85564174cd) --- source4/torture/nbt/winsreplication.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index d96ed3e931..94f797bf52 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -103,8 +103,8 @@ static bool test_assoc_ctx1(struct torture_context *tctx) torture_comment(tctx, "Test if assoc_ctx is only valid on the conection it was created on\n"); - wrepl_socket1 = wrepl_socket_init(tctx, NULL); - wrepl_socket2 = wrepl_socket_init(tctx, NULL); + wrepl_socket1 = wrepl_socket_init(tctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); + wrepl_socket2 = wrepl_socket_init(tctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); torture_comment(tctx, "Setup 2 wrepl connections\n"); status = wrepl_connect(wrepl_socket1, lp_resolve_context(tctx->lp_ctx), NULL, address); @@ -186,7 +186,7 @@ static bool test_assoc_ctx2(struct torture_context *tctx) torture_comment(tctx, "Test if we always get back the same assoc_ctx\n"); - wrepl_socket = wrepl_socket_init(tctx, NULL); + wrepl_socket = wrepl_socket_init(tctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); torture_comment(tctx, "Setup wrepl connections\n"); status = wrepl_connect(wrepl_socket, lp_resolve_context(tctx->lp_ctx), NULL, address); @@ -255,7 +255,7 @@ static bool test_wins_replication(struct torture_context *tctx) torture_comment(tctx, "Test one pull replication cycle\n"); - wrepl_socket = wrepl_socket_init(tctx, NULL); + wrepl_socket = wrepl_socket_init(tctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); torture_comment(tctx, "Setup wrepl connections\n"); status = wrepl_connect(wrepl_socket, lp_resolve_context(tctx->lp_ctx), NULL, address); @@ -553,7 +553,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( if (!ctx) return NULL; ctx->address = address; - ctx->pull = wrepl_socket_init(ctx, NULL); + ctx->pull = wrepl_socket_init(ctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); if (!ctx->pull) return NULL; torture_comment(tctx, "Setup wrepl conflict pull connection\n"); @@ -610,7 +610,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( talloc_free(pull_table.out.partners); - ctx->nbtsock = nbt_name_socket_init(ctx, NULL); + ctx->nbtsock = nbt_name_socket_init(ctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); if (!ctx->nbtsock) return NULL; load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces); @@ -628,7 +628,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0); if (!NT_STATUS_IS_OK(status)) return NULL; - ctx->nbtsock_srv = nbt_name_socket_init(ctx, NULL); + ctx->nbtsock_srv = nbt_name_socket_init(ctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); if (!ctx->nbtsock_srv) return NULL; /* Make a port 137 version of ctx->myaddr */ @@ -645,13 +645,13 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( } if (ctx->myaddr2 && ctx->nbtsock_srv) { - ctx->nbtsock2 = nbt_name_socket_init(ctx, NULL); + ctx->nbtsock2 = nbt_name_socket_init(ctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); if (!ctx->nbtsock2) return NULL; status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0); if (!NT_STATUS_IS_OK(status)) return NULL; - ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx); + ctx->nbtsock_srv2 = nbt_name_socket_init(ctx, ctx->nbtsock_srv->event_ctx, lp_iconv_convenience(tctx->lp_ctx)); if (!ctx->nbtsock_srv2) return NULL; /* Make a port 137 version of ctx->myaddr2 */ @@ -722,7 +722,7 @@ static bool test_wrepl_update_one(struct torture_context *tctx, uint32_t assoc_ctx; NTSTATUS status; - wrepl_socket = wrepl_socket_init(ctx, NULL); + wrepl_socket = wrepl_socket_init(ctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); status = wrepl_connect(wrepl_socket, lp_resolve_context(tctx->lp_ctx), NULL, ctx->address); CHECK_STATUS(tctx, status, NT_STATUS_OK); -- cgit From 4590432d6290fd1c21a27ec5e6643d455e4fec69 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 21 Feb 2008 18:43:02 +0100 Subject: Remove another global_loadparm instance. (This used to be commit ccb29c0b463f5ccb53553f0a1c411ad77a84482a) --- source4/torture/nbt/winsreplication.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 94f797bf52..470eee8310 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -107,10 +107,10 @@ static bool test_assoc_ctx1(struct torture_context *tctx) wrepl_socket2 = wrepl_socket_init(tctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); torture_comment(tctx, "Setup 2 wrepl connections\n"); - status = wrepl_connect(wrepl_socket1, lp_resolve_context(tctx->lp_ctx), NULL, address); + status = wrepl_connect(wrepl_socket1, lp_resolve_context(tctx->lp_ctx), wrepl_best_ip(tctx->lp_ctx, address), address); CHECK_STATUS(tctx, status, NT_STATUS_OK); - status = wrepl_connect(wrepl_socket2, lp_resolve_context(tctx->lp_ctx), NULL, address); + status = wrepl_connect(wrepl_socket2, lp_resolve_context(tctx->lp_ctx), wrepl_best_ip(tctx->lp_ctx, address), address); CHECK_STATUS(tctx, status, NT_STATUS_OK); torture_comment(tctx, "Send a start association request (conn1)\n"); @@ -189,7 +189,7 @@ static bool test_assoc_ctx2(struct torture_context *tctx) wrepl_socket = wrepl_socket_init(tctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); torture_comment(tctx, "Setup wrepl connections\n"); - status = wrepl_connect(wrepl_socket, lp_resolve_context(tctx->lp_ctx), NULL, address); + status = wrepl_connect(wrepl_socket, lp_resolve_context(tctx->lp_ctx), wrepl_best_ip(tctx->lp_ctx, address), address); CHECK_STATUS(tctx, status, NT_STATUS_OK); torture_comment(tctx, "Send 1st start association request\n"); @@ -258,7 +258,7 @@ static bool test_wins_replication(struct torture_context *tctx) wrepl_socket = wrepl_socket_init(tctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); torture_comment(tctx, "Setup wrepl connections\n"); - status = wrepl_connect(wrepl_socket, lp_resolve_context(tctx->lp_ctx), NULL, address); + status = wrepl_connect(wrepl_socket, lp_resolve_context(tctx->lp_ctx), wrepl_best_ip(tctx->lp_ctx, address), address); CHECK_STATUS(tctx, status, NT_STATUS_OK); torture_comment(tctx, "Send a start association request\n"); @@ -557,7 +557,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( if (!ctx->pull) return NULL; torture_comment(tctx, "Setup wrepl conflict pull connection\n"); - status = wrepl_connect(ctx->pull, lp_resolve_context(tctx->lp_ctx), NULL, ctx->address); + status = wrepl_connect(ctx->pull, lp_resolve_context(tctx->lp_ctx), wrepl_best_ip(tctx->lp_ctx, ctx->address), ctx->address); if (!NT_STATUS_IS_OK(status)) return NULL; status = wrepl_associate(ctx->pull, &associate); @@ -724,7 +724,7 @@ static bool test_wrepl_update_one(struct torture_context *tctx, wrepl_socket = wrepl_socket_init(ctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); - status = wrepl_connect(wrepl_socket, lp_resolve_context(tctx->lp_ctx), NULL, ctx->address); + status = wrepl_connect(wrepl_socket, lp_resolve_context(tctx->lp_ctx), wrepl_best_ip(tctx->lp_ctx, ctx->address), ctx->address); CHECK_STATUS(tctx, status, NT_STATUS_OK); status = wrepl_associate(wrepl_socket, &associate); -- cgit From 4e83011f72ba3df387512755a17760b42a7bf2f2 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 21 Apr 2008 17:58:23 -0400 Subject: Remove more event_context_init() uses from function calls within deep down the code. Make sure we pass around the event_context where we need it instead. All test but a few python ones fail. Jelmer promised to fix them. (This used to be commit 3045d391626fba169aa26be52174883e18d323e9) --- source4/torture/nbt/winsreplication.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 470eee8310..ee7a1510d5 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -103,8 +103,8 @@ static bool test_assoc_ctx1(struct torture_context *tctx) torture_comment(tctx, "Test if assoc_ctx is only valid on the conection it was created on\n"); - wrepl_socket1 = wrepl_socket_init(tctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); - wrepl_socket2 = wrepl_socket_init(tctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); + wrepl_socket1 = wrepl_socket_init(tctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx)); + wrepl_socket2 = wrepl_socket_init(tctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx)); torture_comment(tctx, "Setup 2 wrepl connections\n"); status = wrepl_connect(wrepl_socket1, lp_resolve_context(tctx->lp_ctx), wrepl_best_ip(tctx->lp_ctx, address), address); @@ -186,7 +186,7 @@ static bool test_assoc_ctx2(struct torture_context *tctx) torture_comment(tctx, "Test if we always get back the same assoc_ctx\n"); - wrepl_socket = wrepl_socket_init(tctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); + wrepl_socket = wrepl_socket_init(tctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx)); torture_comment(tctx, "Setup wrepl connections\n"); status = wrepl_connect(wrepl_socket, lp_resolve_context(tctx->lp_ctx), wrepl_best_ip(tctx->lp_ctx, address), address); @@ -255,7 +255,7 @@ static bool test_wins_replication(struct torture_context *tctx) torture_comment(tctx, "Test one pull replication cycle\n"); - wrepl_socket = wrepl_socket_init(tctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); + wrepl_socket = wrepl_socket_init(tctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx)); torture_comment(tctx, "Setup wrepl connections\n"); status = wrepl_connect(wrepl_socket, lp_resolve_context(tctx->lp_ctx), wrepl_best_ip(tctx->lp_ctx, address), address); @@ -553,7 +553,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( if (!ctx) return NULL; ctx->address = address; - ctx->pull = wrepl_socket_init(ctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); + ctx->pull = wrepl_socket_init(ctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx)); if (!ctx->pull) return NULL; torture_comment(tctx, "Setup wrepl conflict pull connection\n"); @@ -610,7 +610,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( talloc_free(pull_table.out.partners); - ctx->nbtsock = nbt_name_socket_init(ctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); + ctx->nbtsock = nbt_name_socket_init(ctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx)); if (!ctx->nbtsock) return NULL; load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces); @@ -628,7 +628,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( status = socket_listen(ctx->nbtsock->sock, ctx->myaddr, 0, 0); if (!NT_STATUS_IS_OK(status)) return NULL; - ctx->nbtsock_srv = nbt_name_socket_init(ctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); + ctx->nbtsock_srv = nbt_name_socket_init(ctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx)); if (!ctx->nbtsock_srv) return NULL; /* Make a port 137 version of ctx->myaddr */ @@ -645,7 +645,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( } if (ctx->myaddr2 && ctx->nbtsock_srv) { - ctx->nbtsock2 = nbt_name_socket_init(ctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); + ctx->nbtsock2 = nbt_name_socket_init(ctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx)); if (!ctx->nbtsock2) return NULL; status = socket_listen(ctx->nbtsock2->sock, ctx->myaddr2, 0, 0); @@ -722,7 +722,7 @@ static bool test_wrepl_update_one(struct torture_context *tctx, uint32_t assoc_ctx; NTSTATUS status; - wrepl_socket = wrepl_socket_init(ctx, NULL, lp_iconv_convenience(tctx->lp_ctx)); + wrepl_socket = wrepl_socket_init(ctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx)); status = wrepl_connect(wrepl_socket, lp_resolve_context(tctx->lp_ctx), wrepl_best_ip(tctx->lp_ctx, ctx->address), ctx->address); CHECK_STATUS(tctx, status, NT_STATUS_OK); -- cgit From 8b585deae44f42b24182ec5d243f7d1e23012478 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 13 Aug 2008 16:53:13 +0200 Subject: NBT-WINSREPLICATION: be more robust to timing errors Also reenable disabled tests. metze (This used to be commit 76878a9c798e0acb0387b8352972d66db989c09a) --- source4/torture/nbt/winsreplication.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index ee7a1510d5..6b600bd7cd 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -6701,7 +6701,6 @@ static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx, /* * unique vs. unique section */ -#if METZE_NEEDS_TO_LOOK_AT_THIS_ONE /* * unique,active vs. unique,active with same ip(s), unchecked */ @@ -6728,7 +6727,6 @@ static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx, .apply_expected = true }, }, -#endif /* * unique,active vs. unique,active with different ip(s), positive response */ @@ -8967,7 +8965,6 @@ static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx, .sgroup_merge = true }, }, -#if 0 /* * sgroup,active vs. sgroup,active with same ip(s) */ @@ -9157,7 +9154,6 @@ static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx, .apply_expected = false }, }, -#endif }; if (!ctx->nbtsock_srv) { @@ -9543,7 +9539,9 @@ static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_ talloc_free(rep_packet); /* make sure we push the reply to the wire */ - event_loop_once(nbtsock->event_ctx); + while (nbtsock->send_queue) { + event_loop_once(nbtsock->event_ctx); + } msleep(1000); rec->defend.timeout = 0; @@ -9598,7 +9596,9 @@ static void test_conflict_owned_active_vs_replica_handler_release( talloc_free(rep_packet); /* make sure we push the reply to the wire */ - event_loop_once(nbtsock->event_ctx); + while (nbtsock->send_queue) { + event_loop_once(nbtsock->event_ctx); + } msleep(1000); rec->defend.timeout = 0; -- cgit