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
This commit is contained in:
Navum Gupta 2021-06-23 05:18:33 +00:00 committed by renu
parent 67685f06bf
commit 9e9741b132
3 changed files with 11 additions and 1 deletions

View File

@ -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'] = \

View File

@ -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

View File

@ -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)