Sending one more topology test. This one creates a M groups consisting N (N>=2) servers. First two servers in each group are used to connect with nearest four groups and also with the other servers inside the group (when N>2). Servers inside the group (not connecting to other groups) are connected with each other.

The patch set needs freeipa-dkupka-8{1,2,3} applied.

--
David Kupka
From a750706d1770fec233abc450ff751d57251a6c59 Mon Sep 17 00:00:00 2001
From: David Kupka <dku...@redhat.com>
Date: Wed, 10 Feb 2016 16:14:10 +0100
Subject: [PATCH 1/3] CI: Add double circle topology.

Every site consist of at least two replicas and is connected to two other
sites.
---
 ipatests/test_integration/tasks.py | 52 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index 77cba89825574f5354017bf184b106e94eb75c59..9d9a78bb10b463016c646aa921dde722e882da93 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -916,6 +916,58 @@ def two_connected_topo(master, replicas):
         return
 
 
+@_topo('double-circle')
+def double_circle_topo(master, replicas, site_size=6):
+    """
+                      R--R
+                      |\/|
+                      |/\|
+                      R--R
+                     /    \
+                     M -- R
+                    /|    |\
+                   / |    | \
+          R - R - R--|----|--R - R - R
+          | X |   |  |    |  |   | X |
+          R - R - R -|----|--R - R - R
+                   \ |    | /
+                    \|    |/
+                     R -- R
+                     \    /
+                      R--R
+                      |\/|
+                      |/\|
+                      R--R
+    """
+    # to provide redundancy there must be at least two replicas per site
+    assert site_size >= 2
+    # do not handle master other than the rest of the servers
+    servers = [master] + replicas
+
+    # split servers into sites
+    it = [iter(servers)] * site_size
+    sites = map(lambda x: (x[0], x[1], x[2:]), zip(*it))
+    num_sites = len(sites)
+
+    for i in range(num_sites):
+        (a, b, _ignore) = sites[i]
+        # create agreement inside the site
+        yield a, b
+
+        # create agreement to one server in two next sites
+        for (c, d, _ignore) in [sites[(i+n) % num_sites] for n in [1, 2]]:
+            yield b, c
+
+    if site_size > 2:
+        # deploy servers inside the site
+        for site in sites:
+            site_servers = list(site[2])
+            yield site[0], site_servers[0]
+            for edge in complete_topo(site_servers[0], site_servers[1:]):
+                yield edge
+            yield site[1], site_servers[-1]
+
+
 def install_topo(topo, master, replicas, clients,
                  skip_master=False, setup_replica_cas=True):
     """Install IPA servers and clients in the given topology"""
-- 
2.5.0

From 9cbbe2d4a8a84f8ac05edc1a4024f4be512a185e Mon Sep 17 00:00:00 2001
From: David Kupka <dku...@redhat.com>
Date: Wed, 10 Feb 2016 16:17:41 +0100
Subject: [PATCH 2/3] CI: Add replication test utilizing double-circle
 topology.

---
 ipatests/test_integration/test_replication_layouts.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/ipatests/test_integration/test_replication_layouts.py b/ipatests/test_integration/test_replication_layouts.py
index 4dd3fb51b638970139043e0b33f01864ee003192..9fd4ddca299ca99053aae17ae1d43d3c64650f40 100644
--- a/ipatests/test_integration/test_replication_layouts.py
+++ b/ipatests/test_integration/test_replication_layouts.py
@@ -103,3 +103,21 @@ class Test2ConnectedTopologyWithCA(LayoutsBaseTest):
         tasks.install_topo('2-connected', self.master, self.replicas, [],
                            setup_replica_cas=True)
         self.replication_is_working()
+
+
+class TestDoubleCircleTopologyWithoutCA(LayoutsBaseTest):
+    num_replicas = 29
+
+    def test_2_connected_topology_with_ca(self):
+        tasks.install_topo('double-circle', self.master, self.replicas, [],
+                           setup_replica_cas=False)
+        self.replication_is_working()
+
+
+class TestDoubleCircleTopologyWithCA(LayoutsBaseTest):
+    num_replicas = 29
+
+    def test_2_connected_topology_with_ca(self):
+        tasks.install_topo('double-circle', self.master, self.replicas, [],
+                           setup_replica_cas=True)
+        self.replication_is_working()
-- 
2.5.0

From 3a2ac0b19234f12c7f960512cc28406c362289b4 Mon Sep 17 00:00:00 2001
From: David Kupka <dku...@redhat.com>
Date: Wed, 10 Feb 2016 16:18:26 +0100
Subject: [PATCH 3/3] CI: Add test for double-circle topology generator.

---
 ipatests/test_integration/test_topologies.py | 63 ++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/ipatests/test_integration/test_topologies.py b/ipatests/test_integration/test_topologies.py
index e12d141391840cc7f9150a178875393a96dd469b..a0a1b9d6222779a9ce67b2fa8a29052747eae8f9 100644
--- a/ipatests/test_integration/test_topologies.py
+++ b/ipatests/test_integration/test_topologies.py
@@ -116,3 +116,66 @@ def test_topology_two_connected():
         (7, 8),
     ]
     assert list(topo('M', [])) == []
+
+
+def test_topology_double_circle_topo():
+    topo = tasks.get_topo('double-circle')
+    assert topo == tasks.double_circle_topo
+    assert list(topo('M', range(1, 30))) == [
+        ('M', 1),
+        (1, 6),
+        (1, 12),
+        (6, 7),
+        (7, 12),
+        (7, 18),
+        (12, 13),
+        (13, 18),
+        (13, 24),
+        (18, 19),
+        (19, 24),
+        (19, 'M'),
+        (24, 25),
+        (25, 'M'),
+        (25, 6),
+        ('M', 2),
+        (2, 3),
+        (2, 4),
+        (2, 5),
+        (3, 4),
+        (3, 5),
+        (4, 5),
+        (1, 5),
+        (6, 8),
+        (8, 9),
+        (8, 10),
+        (8, 11),
+        (9, 10),
+        (9, 11),
+        (10, 11),
+        (7, 11),
+        (12, 14),
+        (14, 15),
+        (14, 16),
+        (14, 17),
+        (15, 16),
+        (15, 17),
+        (16, 17),
+        (13, 17),
+        (18, 20),
+        (20, 21),
+        (20, 22),
+        (20, 23),
+        (21, 22),
+        (21, 23),
+        (22, 23),
+        (19, 23),
+        (24, 26),
+        (26, 27),
+        (26, 28),
+        (26, 29),
+        (27, 28),
+        (27, 29),
+        (28, 29),
+        (25, 29),
+    ]
+    assert list(topo('M', [])) == []
-- 
2.5.0

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to