Dealing with test related stuffs. 95/60995/1
authorlaili <lai.li@zte.com.cn>
Fri, 17 Aug 2018 01:47:41 +0000 (09:47 +0800)
committerlaili <lai.li@zte.com.cn>
Fri, 17 Aug 2018 01:47:41 +0000 (09:47 +0800)
Modify const and instantiation test.

Change-Id: I94b07432b464873c05c044570f286fefea812aaf
Issue-ID: VFC-1012
Signed-off-by: laili <lai.li@zte.com.cn>
lcm/lcm/nf/const.py
lcm/lcm/nf/tests/test_instantiate_vnf.py

index 4159644..7da4d85 100644 (file)
@@ -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",
index 7ec2240..a599aed 100644 (file)
@@ -35,8 +35,8 @@ class TestNFInstantiate(TestCase):
     def setUp(self):\r
         self.client = APIClient()\r
         self.grant_result = {\r
-            "vimid": 'vimid_1',\r
-            "tenant": 'tenantname_1',\r
+            "vimid": 'vim_1',\r
+            "tenant": 'chinamobile',\r
         }\r
 \r
     def tearDown(self):\r
@@ -178,9 +178,13 @@ class TestNFInstantiate(TestCase):
         r2_apply_grant_result = [0, json.JSONEncoder().encode(self.grant_result), '200']\r
         r3_lcm_notify_result = [0, json.JSONEncoder().encode(''), '200']\r
         mock_call_req.side_effect = [r1_get_vnfpackage_by_vnfdid, r2_apply_grant_result, r3_lcm_notify_result]\r
-        mock_call.side_effect = [c1_data_get_tenant_id, c2_data_create_volume, c3_data_get_volume,\r
-                                 c4_data_create_network, c5_data_create_subnet, c6_data_create_port,\r
-                                 c7_data_create_flavor, c8_data_list_image, c9_data_create_vm, c10_data_get_vm]\r
+        mock_call.side_effect = [c1_data_get_tenant_id,\r
+                                 c2_data_create_volume, c3_data_get_volume,\r
+                                 c4_data_create_network,\r
+                                 c5_data_create_subnet,\r
+                                 c6_data_create_port,\r
+                                 c7_data_create_flavor,\r
+                                 c8_data_list_image, c9_data_create_vm, c10_data_get_vm]\r
         self.nf_inst_id = '1111'\r
         self.job_id = JobUtil.create_job('NF', 'CREATE', self.nf_inst_id)\r
         JobUtil.add_job_status(self.job_id, 0, "INST_VNF_READY")\r