Browse Source

Add groups under topology_template in vnf_dict

This patch will include `groups` in `topology_template`
of `vnf_dict`.

Closes-Bug: #1929811
Change-Id: Ic05b58a2c4a605459822936b21a87a97b1899ce5
changes/61/797561/3
Navum Gupta 11 months ago committed by renu
parent
commit
9e9741b132
  1. 2
      tacker/common/csar_utils.py
  2. 3
      tacker/tests/unit/vnflcm/fakes.py
  3. 7
      tacker/tests/unit/vnflcm/test_utils.py

2
tacker/common/csar_utils.py

@ -175,6 +175,8 @@ def _populate_flavour_data(tosca):
# get from lower-vnfd data
tpl_dict['topology_template'] = dict()
tpl_dict['topology_template']['groups'] = \
tp.tpl.get('groups')
tpl_dict['topology_template']['policies'] = \
tp.tpl.get('policies')
tpl_dict['topology_template']['node_templates'] = \

3
tacker/tests/unit/vnflcm/fakes.py

@ -1074,7 +1074,7 @@ def vnf_dict():
' flavour for Sample VNF\n\nimports:\n' + \
' - etsi_nfv_sol001_common_types.yaml\n' + \
' - etsi_nfv_sol001_vnfd_types.yaml\n\n' + \
'topology_template:\n node_templates:\n' + \
'topology_template:\n groups:\n node_templates:\n' + \
' VNF:\n type: nec.ossmano.VNF\n' + \
' properties:\n' + \
' flavour_description: A simple flavour\n' + \
@ -1198,6 +1198,7 @@ def vnf_dict():
}
}
}
return vnf_dict

7
tacker/tests/unit/vnflcm/test_utils.py

@ -57,3 +57,10 @@ class VnfLcmUtilsTestCase(base.TestCase):
expected_flavour_description = 'A simple flavor'
self.assertEqual(expected_flavour_description,
param_value['flavour_description'])
def test_topology_template_param_of_vnf_dict(self):
vnf_dict = fakes.vnf_dict()
vnf_keys = vnf_dict['vnfd']['attributes']['vnfd_simple']
self.assertIn('node_templates', vnf_keys)
self.assertIn('policies', vnf_keys)
self.assertIn('groups', vnf_keys)

Loading…
Cancel
Save