r11119: add normal group vs. special group section
authorStefan Metzmacher <metze@samba.org>
Mon, 17 Oct 2005 14:32:16 +0000 (14:32 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:44:53 +0000 (13:44 -0500)
metze
(This used to be commit 13703b5c35e4473d0ab6b595f41f4cc35c18f81e)

source4/torture/nbt/winsreplication.c

index bb85cc0790212237a5e65d868124b8f00f88c4d4..b454ece49395c05893be1f34493f19e4211169da 100644 (file)
@@ -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