diff options
author | Nikita Zubkov <nzubkov@mirantis.com> | 2016-08-29 17:56:09 +0300 |
---|---|---|
committer | Nikita Zubkov <nzubkov@mirantis.com> | 2016-08-29 18:09:47 +0300 |
commit | 55422ddce7b0e9e1b9976504500de8a1688a99d7 (patch) | |
tree | 864481232b59eced1335ec795488c114cac1cf6a | |
parent | 0ae07c813ee42191caa24edf45b52b3e91f85182 (diff) |
Add test for vip transformer
Change-Id: I65124237604fe6718ad6c351825f192a98d470fb
Notes
Notes (review):
Code-Review+2: Yuriy Taraday <yorik.sar@gmail.com>
Code-Review+2: Ilya Kharin <akscram@gmail.com>
Workflow+1: Ilya Kharin <akscram@gmail.com>
Verified+2: Jenkins
Submitted-by: Jenkins
Submitted-at: Thu, 01 Sep 2016 20:31:03 +0000
Reviewed-on: https://review.openstack.org/362169
Project: openstack/fuel-nailgun-extension-cluster-upgrade
Branch: refs/heads/master
-rw-r--r-- | cluster_upgrade/tests/test_transformations.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/cluster_upgrade/tests/test_transformations.py b/cluster_upgrade/tests/test_transformations.py index 880ee2d..7186e1b 100644 --- a/cluster_upgrade/tests/test_transformations.py +++ b/cluster_upgrade/tests/test_transformations.py | |||
@@ -18,6 +18,7 @@ import six | |||
18 | 18 | ||
19 | from .. import transformations | 19 | from .. import transformations |
20 | from ..transformations import cluster | 20 | from ..transformations import cluster |
21 | from ..transformations import vip | ||
21 | 22 | ||
22 | 23 | ||
23 | class TestTransformations(nailgun_test_base.BaseUnitTest): | 24 | class TestTransformations(nailgun_test_base.BaseUnitTest): |
@@ -219,3 +220,37 @@ class TestClusterTransformers(nailgun_test_base.BaseUnitTest): | |||
219 | cluster.transform_ntp_list, | 220 | cluster.transform_ntp_list, |
220 | cluster.drop_generated_provision, | 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 | ) | ||