summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFu Jinhua <fu.jinhua@zte.com.cn>2018-08-20 00:48:24 +0000
committerGerrit Code Review <gerrit@onap.org>2018-08-20 00:48:24 +0000
commit48b79fc946cbe46df61796ab008b021c9b4e90f7 (patch)
tree4d49b97d89a36d4f6f1ef882041b80884ef7eeef
parent4f3cadd4ffcae700bc259a043b1d6c6c5a6bc98c (diff)
parentbd0d55b02e197cacaf5063c1f4772e41c4fe45e7 (diff)
Merge "Dealing with test related stuffs."
-rw-r--r--lcm/lcm/nf/const.py57
-rw-r--r--lcm/lcm/nf/tests/test_instantiate_vnf.py14
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")