From: laili Date: Fri, 17 Aug 2018 01:47:41 +0000 (+0800) Subject: Dealing with test related stuffs. X-Git-Tag: 1.2.0~22^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=vfc%2Fgvnfm%2Fvnflcm.git;a=commitdiff_plain;h=bd0d55b02e197cacaf5063c1f4772e41c4fe45e7 Dealing with test related stuffs. Modify const and instantiation test. Change-Id: I94b07432b464873c05c044570f286fefea812aaf Issue-ID: VFC-1012 Signed-off-by: laili --- 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")