diff options
author | hongyuzhao <zhao.hongyu@zte.com.cn> | 2019-07-15 15:22:28 +0800 |
---|---|---|
committer | hongyuzhao <zhao.hongyu@zte.com.cn> | 2019-07-15 17:09:27 +0800 |
commit | 89b6e7c193199259cda3f01b46082cc4e8cc9ffd (patch) | |
tree | 044656ea7cdf7ffe76334d1d975d1e3cffb9e99e /lcm/lcm/nf/tests/const.py | |
parent | 2b39c8d62f99cfa5084a70fe719ae3bc8cfca3ba (diff) |
improve code coverage rate (scale vnf) after vfclcm upgraded from python2 to python3
Change-Id: I7ce2ada651e5b8fe84deac87e82c8791cf6f5916
Issue-ID: VFC-1429
Signed-off-by: hongyuzhao <zhao.hongyu@zte.com.cn>
Diffstat (limited to 'lcm/lcm/nf/tests/const.py')
-rw-r--r-- | lcm/lcm/nf/tests/const.py | 265 |
1 files changed, 254 insertions, 11 deletions
diff --git a/lcm/lcm/nf/tests/const.py b/lcm/lcm/nf/tests/const.py index 7debe6bc..c9509513 100644 --- a/lcm/lcm/nf/tests/const.py +++ b/lcm/lcm/nf/tests/const.py @@ -18,14 +18,13 @@ instantiate_grant_result = { { "vimid": 'vim_1', "accessInfo": - { - "tenant": 'chinamobile' - } + { + "tenant": 'chinamobile' + } }, ], "vnfId": "413aa1fe-b4d1-11e8-8268-dff5aab95c63", - "vimAssets": - { + "vimAssets": { "computeResourceFlavours": [ { "resourceProviderId": "vgw", @@ -36,7 +35,6 @@ instantiate_grant_result = { } } - inst_req_data = { "flavourId": "flavour_1", "instantiationLevelId": "instantiationLevel_1", @@ -122,7 +120,6 @@ inst_req_data = { } } - vnfd_model_dict = { 'metadata': { 'vendor': 'zte', @@ -443,7 +440,6 @@ c1_data_get_tenant_id_1 = { ] } - # create_volume c2_data_create_volume = { "id": "4bd3e9eb-cd8b-456a-8589-910836a0ab31", @@ -835,7 +831,6 @@ vnfpackage_info = { } } - single_vnf_lcm_op = { "id": "99442b18-a5c7-11e8-998c-bf1755941f16", "operationState": "STARTING", @@ -860,7 +855,6 @@ single_vnf_lcm_op = { } } - vnflcmop_with_exclude_default = [{ "id": "99442b18-a5c7-11e8-998c-bf1755941f16", "operationState": "STARTING", @@ -880,7 +874,6 @@ vnflcmop_with_exclude_default = [{ } }] - multiple_vnf_lcm_op = [{ "id": "a6b9415c-ab99-11e8-9d37-dbb5e0378955", "operationState": "STARTING", @@ -1172,3 +1165,253 @@ multiple_vnf_lcm_op = [{ # } # } # } +vnfd_for_scale = { + "volume_storages": [], + "vnf": { + "type": "tosca.nodes.nfv.VNF", + "requirements": { + "virtual_link": [ + "ext_cp", + "virtual_link" + ] + }, + "properties": { + "descriptor_id": "b1bb0ce7-1234-4fa7-95ed-4840d70a1179", + "flavour_description": "simple", + "descriptor_verison": "1.0", + "software_version": "1.0.0", + "template_name": "test", + "vnfm_info": [ + "vnfm" + ], + "descriptor_version": "1.0.0", + "provider": "zte", + "flavour_id": "simple", + "product_name": "test" + }, + "capabilities": { + + }, + "metadata": { + "template_name": "test", + "template_version": "1.0", + "template_author": "ZTE" + } + }, + "vdus": [ + { + "description": "", + "virtual_storages": [ + + ], + "vdu_id": "sunshine", + "artifacts": [ + { + "artifact_name": "sw_image", + "type": "tosca.artifacts.nfv.SwImage", + "file": "sss.vmdk" + } + ], + "dependencies": [ + + ], + "virtual_compute": { + "virtual_cpu": { + "num_virtual_cpu": 2 + }, + "virtual_memory": { + "virtual_mem_size": "4096 MB" + }, + "virtual_local_storage": [ + { + "size_of_storage": "40 GB" + } + ] + }, + "vls": [ + + ], + "cps": [ + "ext_cp" + ], + "type": "tosca.nodes.nfv.Vdu.Compute", + "properties": { + "vdu_profile": { + "max_number_of_instances": 3, + "min_number_of_instances": 1 + }, + "name": "sunshine1234", + "sw_image_data": { + "operating_system": "linux", + "name": "ubuntu", + "checksum": { + "hash": "d0e7828293355a07c2dccaaa765c80b507e60e6167067c950dc2e6b0da0dbd34", + "algorithm": "SHA-256" + }, + "min_ram": "2 GB", + "disk_format": "qcow2", + "version": 16.04, + "container_format": "bare", + "min_disk": "2 GB", + "size": "2 GB" + }, + "description": "vdu test", + "location_info": { + "vimid": "", + "tenant": "", + "availability_zone": "", + "vnfId": "", + "vnfName": "", + "cloudOwner": "", + "cloudRegionId": "", + "vduInfo": [ + { + "vduName": "sunshine1234", + "flavorId": "12345", + "directive": "" + } + ] + } + } + } + ], + "description": "test", + "inputs": { + + }, + "graph": { + "sunshine": [ + "ext_cp" + ], + "ext_cp": [ + + ] + }, + "basepath": "/tmp/tmpil6wVG", + "vnf_exposed": { + "external_cps": [ + { + "key_name": "virtual_link", + "cpd_id": "ext_cp" + } + ], + "forward_cps": [ + + ] + }, + "policies": [ + { + "type": "tosca.policies.nfv.InstantiationLevels", + "targets": "", + "properties": { + "default_level": "instantiation_level_1", + "levels": { + "instantiation_level_1": { + "scale_info": { + "sunshine_aspect": { + "scale_level": 0 + } + }, + "description": "vnf test instantiation_level_1" + }, + "instantiation_level_2": { + "scale_info": { + "sunshine_aspect": { + "scale_level": 1 + } + }, + "description": "vnf test instantiation_level_2" + }, + "instantiation_level_3": { + "scale_info": { + "sunshine_aspect": { + "scale_level": 2 + } + }, + "description": "vnf test instantiation_level_3" + } + } + } + }, + { + "type": "tosca.policies.nfv.VduInstantiationLevels", + "targets": [ + "sunshine" + ], + "properties": { + "levels": { + "instantiation_level_1": { + "number_of_instances": 1 + }, + "instantiation_level_2": { + "number_of_instances": 2 + }, + "instantiation_level_3": { + "number_of_instances": 3 + } + } + } + }, + { + "type": "tosca.policies.nfv.ScalingAspects", + "targets": "", + "properties": { + "aspects": { + "sunshine_aspect": { + "max_scale_level": 2, + "description": "sunshine aspect", + "name": "sunshine_aspect", + "step_deltas": [ + "sunshine_delta" + ] + } + } + } + }, + { + "type": "tosca.policies.nfv.VduInitialDelta", + "targets": [ + "sunshine" + ], + "properties": { + "initial_delta": { + "number_of_instances": 1 + } + } + }, + { + "type": "tosca.policies.nfv.VduScalingAspectDeltas", + "targets": [ + "sunshine" + ], + "properties": { + "deltas": { + "sunshine_delta": { + "number_of_instances": 1 + } + }, + "aspect": "sunshine_aspect" + } + } + ], + "vls": [ + + ], + "cps": [ + { + "vl_id": "", + "description": "", + "vdu_id": "sunshine", + "properties": { + "trunk_mode": "false" + }, + "cp_id": "ext_cp", + "cpd_id": "ext_cp" + } + ], + "metadata": { + "template_name": "test", + "template_version": "1.0", + "template_author": "ZTE" + } +} |