Browse Source

Add test for vip transformer

Change-Id: I65124237604fe6718ad6c351825f192a98d470fb
(cherry picked from commit 55422ddce7)
Nikita Zubkov 2 years ago
parent
commit
d87125662f
1 changed files with 35 additions and 0 deletions
  1. 35
    0
      cluster_upgrade/tests/test_transformations.py

+ 35
- 0
cluster_upgrade/tests/test_transformations.py View File

@@ -18,6 +18,7 @@ import six
18 18
 
19 19
 from .. import transformations
20 20
 from ..transformations import cluster
21
+from ..transformations import vip
21 22
 
22 23
 
23 24
 class TestTransformations(nailgun_test_base.BaseUnitTest):
@@ -219,3 +220,37 @@ class TestClusterTransformers(nailgun_test_base.BaseUnitTest):
219 220
             cluster.transform_ntp_list,
220 221
             cluster.drop_generated_provision,
221 222
         ])])
223
+
224
+
225
+class TestVipTransformers(nailgun_test_base.BaseUnitTest):
226
+    def setUp(self):
227
+        ip = '0.0.0.0'
228
+
229
+        self.data = {
230
+            'management': {
231
+                'haproxy': ip,
232
+                'vrouter': ip,
233
+                'test': ip,
234
+            },
235
+            'public': {
236
+                'haproxy': ip,
237
+                'vrouter': ip,
238
+                'test': ip,
239
+            }
240
+        }
241
+
242
+    def test_vip_transform(self):
243
+        ip = '0.0.0.0'
244
+
245
+        data = vip.transform_vips(self.data)
246
+        self.assertEqual(
247
+            data, {
248
+                'management': {
249
+                    'management': ip,
250
+                    'vrouter': ip,
251
+                },
252
+                'public': {
253
+                    'public': ip,
254
+                    'vrouter_pub': ip,
255
+                }}
256
+        )

Loading…
Cancel
Save