diff options
author | laili <lai.li@zte.com.cn> | 2018-08-17 09:47:41 +0800 |
---|---|---|
committer | laili <lai.li@zte.com.cn> | 2018-08-17 09:47:41 +0800 |
commit | bd0d55b02e197cacaf5063c1f4772e41c4fe45e7 (patch) | |
tree | 3fca301377c5b6a0110d406d368ce677823a00d7 /lcm | |
parent | 4e55eea171d9556802ca96410de7a737e568f94d (diff) |
Dealing with test related stuffs.
Modify const and instantiation test.
Change-Id: I94b07432b464873c05c044570f286fefea812aaf
Issue-ID: VFC-1012
Signed-off-by: laili <lai.li@zte.com.cn>
Diffstat (limited to 'lcm')
-rw-r--r-- | lcm/lcm/nf/const.py | 57 | ||||
-rw-r--r-- | lcm/lcm/nf/tests/test_instantiate_vnf.py | 14 |
2 files changed, 52 insertions, 19 deletions
diff --git a/lcm/lcm/nf/const.py b/lcm/lcm/nf/const.py index 41596442..7da4d859 100644 --- a/lcm/lcm/nf/const.py +++ b/lcm/lcm/nf/const.py @@ -422,7 +422,7 @@ c1_data_get_tenant_id = { "tenants": [ { "id": "1", - "name": "tenantname_1" + "name": "chinamobile" } ] } @@ -591,17 +591,56 @@ vnfdModel = { "volume_storage_id": "test", "properties": { "location_info": { - "vimid": "test", - "tenant": "tenantname_1", + "vimid": "vim_1", + "tenant": "chinamobile", "availability_zone": "test", }, "volume_name": "test", "custom_volume_type": "test", - "size": "1", + "size": "10 GB", }, "image_file": "test", }, ], + "vdus": [ + ], + "image_files": [], + "routers": [], + "local_storages": [], + "vnf_exposed": { + "external_cps": [], + "forward_cps": [] + }, + "vls": [ + { + "vl_id": "test", + "properties": { + "location_info": { + "vimid": "test", + "tenant": "chinamobile", + }, + "vl_profile": { + "networkName": "test", + "networkType": "test", + "physicalNetwork": "test", + "vlanTransparent": "test", + "segmentationId": "1", + "cidr": "test", + "dhcpEnabled": "test", + "gatewayIp": "test", + "startIp": "test", + "endIp": "test", + }, + "connectivity_type": { + "layer_protocol": "ipv4", + }, + "dns_nameservers": "test", + "host_routes": "test", + }, + "route_external": "test", + } + ], + "cps": [], # TODO "inputs": { "pe1_id": { "type": "string", @@ -664,16 +703,6 @@ vnfdModel = { "description": "Nameofunderlayervpn" } }, - "vdus": [], - "image_files": [], - "routers": [], - "local_storages": [], - "vnf_exposed": { - "external_cps": [], - "forward_cps": [] - }, - "vls": [], - "cps": [], "metadata": { "designer": "sdno", "name": "underlayervpn", diff --git a/lcm/lcm/nf/tests/test_instantiate_vnf.py b/lcm/lcm/nf/tests/test_instantiate_vnf.py index 7ec2240e..a599aed7 100644 --- a/lcm/lcm/nf/tests/test_instantiate_vnf.py +++ b/lcm/lcm/nf/tests/test_instantiate_vnf.py @@ -35,8 +35,8 @@ class TestNFInstantiate(TestCase): def setUp(self):
self.client = APIClient()
self.grant_result = {
- "vimid": 'vimid_1',
- "tenant": 'tenantname_1',
+ "vimid": 'vim_1',
+ "tenant": 'chinamobile',
}
def tearDown(self):
@@ -178,9 +178,13 @@ class TestNFInstantiate(TestCase): r2_apply_grant_result = [0, json.JSONEncoder().encode(self.grant_result), '200']
r3_lcm_notify_result = [0, json.JSONEncoder().encode(''), '200']
mock_call_req.side_effect = [r1_get_vnfpackage_by_vnfdid, r2_apply_grant_result, r3_lcm_notify_result]
- mock_call.side_effect = [c1_data_get_tenant_id, c2_data_create_volume, c3_data_get_volume,
- c4_data_create_network, c5_data_create_subnet, c6_data_create_port,
- c7_data_create_flavor, c8_data_list_image, c9_data_create_vm, c10_data_get_vm]
+ mock_call.side_effect = [c1_data_get_tenant_id,
+ c2_data_create_volume, c3_data_get_volume,
+ c4_data_create_network,
+ c5_data_create_subnet,
+ c6_data_create_port,
+ c7_data_create_flavor,
+ c8_data_list_image, c9_data_create_vm, c10_data_get_vm]
self.nf_inst_id = '1111'
self.job_id = JobUtil.create_job('NF', 'CREATE', self.nf_inst_id)
JobUtil.add_job_status(self.job_id, 0, "INST_VNF_READY")
|