summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-10-17 12:40:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:44:52 -0500
commite7238b9306ac3854054ba5f1ef89e7a56bae2633 (patch)
tree14ddf93cbb1b063bae5fba951822fb2f5aa840fc
parentd73bd8f01aefe97f007a59f49698a5c7c9e97c29 (diff)
downloadsamba-e7238b9306ac3854054ba5f1ef89e7a56bae2633.tar.gz
samba-e7238b9306ac3854054ba5f1ef89e7a56bae2633.tar.bz2
samba-e7238b9306ac3854054ba5f1ef89e7a56bae2633.zip
r11115: add unique vs special group section
metze (This used to be commit 980e1a39eb039ebef3ca750eaf67bb87fd6f6980)
-rw-r--r--source4/torture/nbt/winsreplication.c145
1 files changed, 143 insertions, 2 deletions
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),