diff --git a/tacker/common/csar_utils.py b/tacker/common/csar_utils.py index 5af8e68f4..2825e5366 100644 --- a/tacker/common/csar_utils.py +++ b/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'] = \ diff --git a/tacker/tests/unit/vnflcm/fakes.py b/tacker/tests/unit/vnflcm/fakes.py index 02e63f7c6..3178aa8d4 100644 --- a/tacker/tests/unit/vnflcm/fakes.py +++ b/tacker/tests/unit/vnflcm/fakes.py @@ -1100,7 +1100,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' + \ @@ -1224,6 +1224,7 @@ def vnf_dict(): } } } + return vnf_dict diff --git a/tacker/tests/unit/vnflcm/test_utils.py b/tacker/tests/unit/vnflcm/test_utils.py index b0f729646..b0354715d 100644 --- a/tacker/tests/unit/vnflcm/test_utils.py +++ b/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)