summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/nbt/winsreplication.c199
1 files changed, 196 insertions, 3 deletions
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;