summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-09-01 20:31:03 +0000
committerGerrit Code Review <review@openstack.org>2016-09-01 20:31:03 +0000
commitd8e2b002c34358cfeaacf66cc142867061500fc2 (patch)
treea8865ada7a4e0deffd51006396fca50f4de2c365
parent5ead3bf1b7957c3e3d9e42be6a31e82ea4e17cfc (diff)
parent55422ddce7b0e9e1b9976504500de8a1688a99d7 (diff)
Merge "Add test for vip transformer"
-rw-r--r--cluster_upgrade/tests/test_transformations.py35
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
19from .. import transformations 19from .. import transformations
20from ..transformations import cluster 20from ..transformations import cluster
21from ..transformations import vip
21 22
22 23
23class TestTransformations(nailgun_test_base.BaseUnitTest): 24class 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
225class 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 )