summaryrefslogtreecommitdiffstats
path: root/lcm
diff options
context:
space:
mode:
authorlaili <lai.li@zte.com.cn>2018-08-17 13:28:05 +0800
committerlaili <lai.li@zte.com.cn>2018-08-17 13:28:05 +0800
commit42a3fbcd245ae15d4fdd23ec1699c30d34a2a30e (patch)
tree68da199e9ac35ef218350817f5dc551d802771ad /lcm
parentb04be0ef54a804315289e34fa0676f60582a06fa (diff)
Dealing with test related stuffs.
Modify const and instantiation test. Change-Id: I218128ab7eaac785c58a3832ba3ab559a5ee5f27 Issue-ID: VFC-1012 Signed-off-by: laili <lai.li@zte.com.cn>
Diffstat (limited to 'lcm')
-rw-r--r--lcm/lcm/nf/const.py85
-rw-r--r--lcm/lcm/nf/tests/test_instantiate_vnf.py5
2 files changed, 78 insertions, 12 deletions
diff --git a/lcm/lcm/nf/const.py b/lcm/lcm/nf/const.py
index 7da4d859..c5ebf5d0 100644
--- a/lcm/lcm/nf/const.py
+++ b/lcm/lcm/nf/const.py
@@ -602,15 +602,6 @@ vnfdModel = {
"image_file": "test",
},
],
- "vdus": [
- ],
- "image_files": [],
- "routers": [],
- "local_storages": [],
- "vnf_exposed": {
- "external_cps": [],
- "forward_cps": []
- },
"vls": [
{
"vl_id": "test",
@@ -640,7 +631,81 @@ vnfdModel = {
"route_external": "test",
}
],
- "cps": [], # TODO
+ "cps": [
+ {
+ "vdu_id": "test",
+ "cp_id": "cp1",
+ "networkId": "", # TODO
+ "subnetId": "", # TODO
+ "vl_id": "test",
+ "properties": {
+ "name": "test",
+ "mac_address": "test",
+ "protocol_data": [
+ {
+ "address_data": {
+ "l3_address_data": {
+ "fixed_ip_address": "test"
+ },
+ },
+ },
+ ],
+ "vnic_type": "test",
+ }
+ }
+ ],
+ "vdus": [
+ {
+ "vdu_id": "test",
+ "properties": {
+ "location_info": {
+ "vimid": "test",
+ "tenant": "chinamobile",
+ "availability_zone": "test",
+ },
+ "name": "test",
+ "inject_files": [],
+ "user_data": "test",
+ "meta_data": {},
+ },
+ "cps": [],
+ "type": "tosca.nodes.nfv.Vdu.Compute",
+ "virtual_compute": {
+ "virtual_cpu": {
+ "num_virtual_cpu": "16",
+ },
+ "virtual_memory": {
+ "virtual_mem_size": "8000 MB",
+ "vdu_memory_requirements": {
+ "memoryPageSize": "8 MB",
+ },
+ },
+ },
+ "virtual_storage": {
+ "type_of_storage": "ephemeral",
+ "size_of_storage": "10 GB",
+ },
+ "type": "tosca.nodes.nfv.Vdu.Compute",
+ "artifacts": [
+ {
+ "artifact_name": "sw_image",
+ "file": "sss.vmdk",
+ },
+ ],
+ "volume_storages": [
+ {
+ "volume_storage_id": "test",
+ }
+ ],
+ },
+ ],
+ "image_files": [],
+ "routers": [],
+ "local_storages": [],
+ "vnf_exposed": {
+ "external_cps": [],
+ "forward_cps": []
+ },
"inputs": {
"pe1_id": {
"type": "string",
diff --git a/lcm/lcm/nf/tests/test_instantiate_vnf.py b/lcm/lcm/nf/tests/test_instantiate_vnf.py
index a599aed7..5801cb90 100644
--- a/lcm/lcm/nf/tests/test_instantiate_vnf.py
+++ b/lcm/lcm/nf/tests/test_instantiate_vnf.py
@@ -176,8 +176,9 @@ class TestNFInstantiate(TestCase):
create_time=now_time())
r1_get_vnfpackage_by_vnfdid = [0, json.JSONEncoder().encode(vnfpackage_info), '200']
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]
+ r3_all_aai_result = [1, json.JSONEncoder().encode(''), '404']
+ r4_lcm_notify_result = [0, json.JSONEncoder().encode(''), '200']
+ mock_call_req.side_effect = [r1_get_vnfpackage_by_vnfdid, r2_apply_grant_result, r3_all_aai_result, r4_lcm_notify_result]
mock_call.side_effect = [c1_data_get_tenant_id,
c2_data_create_volume, c3_data_get_volume,
c4_data_create_network,