Browse Source

Merge "Add groups under topology_template in vnf_dict"

changes/33/806133/6
Zuul 8 months ago committed by Gerrit Code Review
parent
commit
69d13ce365
  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

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

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