Deal with nfPackage 73/62273/1
authorbiancunkang <bian.cunkang@zte.com.cn>
Fri, 24 Aug 2018 07:46:06 +0000 (15:46 +0800)
committerbiancunkang <bian.cunkang@zte.com.cn>
Fri, 24 Aug 2018 07:46:06 +0000 (15:46 +0800)
Add vnfd_data in test

Change-Id: I93db1386f54b5e446116d3d5fad6431c43b0df7b
Issue-ID: VFC-1038
Signed-off-by: biancunkang <bian.cunkang@zte.com.cn>
catalog/packages/tests/test_vnf_package.py

index 923a3f3..f01ff7f 100644 (file)
@@ -36,6 +36,210 @@ class MockReq():
 class TestVnfPackage(TestCase):
     def setUp(self):
         self.client = APIClient()
+        self.vnfd_data = {
+            "volume_storages": [
+                {
+                    "properties": {
+                        "size_of_storage": {
+                            "factor": 10,
+                            "value": 10000000000,
+                            "unit": "GB",
+                            "unit_size": 1000000000
+                        },
+                        "type_of_storage": "volume",
+                        "rdma_enabled": False,
+                        "size": "10 GB"
+                    },
+                    "volume_storage_id": "vNAT_Storage_6wdgwzedlb6sq18uzrr41sof7",
+                    "description": ""
+                }
+            ],
+            "inputs": {},
+            "vdus": [
+                {
+                    "volume_storages": [
+                        "vNAT_Storage_6wdgwzedlb6sq18uzrr41sof7"
+                    ],
+                    "description": "",
+                    "dependencies": [],
+                    "vls": [],
+                    "properties": {
+                        "name": "vNat",
+                        "configurable_properties": {
+                            "test": {
+                                "additional_vnfc_configurable_properties": {
+                                    "aaa": "1",
+                                    "bbb": "2",
+                                    "ccc": "3"
+                                }
+                            }
+                        },
+                        "description": "the virtual machine of vNat",
+                        "nfvi_constraints": [
+                            "test"
+                        ],
+                        "boot_order": [
+                            "vNAT_Storage"
+                        ]
+                    },
+                    "vdu_id": "vdu_vNat",
+                    "artifacts": [
+                        {
+                            "artifact_name": "vNatVNFImage",
+                            "type": "tosca.artifacts.nfv.SwImage",
+                            "properties": {
+                                "operating_system": "linux",
+                                "sw_image": "/swimages/vRouterVNF_ControlPlane.qcow2",
+                                "name": "vNatVNFImage",
+                                "container_format": "bare",
+                                "min_ram": "1 GB",
+                                "disk_format": "qcow2",
+                                "supported_virtualisation_environments": [
+                                    "test_0"
+                                ],
+                                "version": "1.0",
+                                "checksum": "5000",
+                                "min_disk": "10 GB",
+                                "size": "10 GB"
+                            },
+                            "file": "/swimages/vRouterVNF_ControlPlane.qcow2"
+                        }
+                    ],
+                    "nfv_compute": {
+                        "flavor_extra_specs": {
+                            "hw:cpu_sockets": "2",
+                            "sw:ovs_dpdk": "true",
+                            "hw:cpu_threads": "2",
+                            "hw:numa_mem.1": "3072",
+                            "hw:numa_mem.0": "1024",
+                            "hw:numa_nodes": "2",
+                            "hw:numa_cpus.0": "0,1",
+                            "hw:numa_cpus.1": "2,3,4,5",
+                            "hw:cpu_cores": "2",
+                            "hw:cpu_threads_policy": "isolate"
+                        },
+                        "cpu_frequency": "2.4 GHz",
+                        "num_cpus": 2,
+                        "mem_size": "10 GB"
+                    },
+                    "local_storages": [],
+                    "image_file": "vNatVNFImage",
+                    "cps": []
+                }
+            ],
+            "image_files": [
+                {
+                    "properties": {
+                        "operating_system": "linux",
+                        "sw_image": "/swimages/vRouterVNF_ControlPlane.qcow2",
+                        "name": "vNatVNFImage",
+                        "container_format": "bare",
+                        "min_ram": "1 GB",
+                        "disk_format": "qcow2",
+                        "supported_virtualisation_environments": [
+                            "test_0"
+                        ],
+                        "version": "1.0",
+                        "checksum": "5000",
+                        "min_disk": "10 GB",
+                        "size": "10 GB"
+                    },
+                    "image_file_id": "vNatVNFImage",
+                    "description": ""
+                }
+            ],
+            "routers": [],
+            "local_storages": [],
+            "vnf_exposed": {
+                "external_cps": [
+                    {
+                        "key_name": "sriov_plane",
+                        "cp_id": "SRIOV_Port"
+                    }
+                ],
+                "forward_cps": []
+            },
+            "vls": [
+                {
+                    "route_id": "",
+                    "vl_id": "sriov_link",
+                    "route_external": False,
+                    "description": "",
+                    "properties": {
+                        "vl_flavours": {
+                            "vl_id": "aaaa"
+                        },
+                        "connectivity_type": {
+                            "layer_protocol": "ipv4",
+                            "flow_pattern": "flat"
+                        },
+                        "description": "sriov_link",
+                        "test_access": [
+                            "test"
+                        ]
+                    }
+                }
+            ],
+            "cps": [
+                {
+                    "vl_id": "sriov_link",
+                    "vdu_id": "vdu_vNat",
+                    "description": "",
+                    "cp_id": "SRIOV_Port",
+                    "properties": {
+                        "address_data": [
+                            {
+                                "address_type": "ip_address",
+                                "l3_address_data": {
+                                    "ip_address_type": "ipv4",
+                                    "floating_ip_activated": False,
+                                    "number_of_ip_address": 1,
+                                    "ip_address_assignment": True
+                                }
+                            }
+                        ],
+                        "description": "sriov port",
+                        "layer_protocol": "ipv4",
+                        "virtual_network_interface_requirements": [
+                            {
+                                "requirement": {
+                                    "SRIOV": "true"
+                                },
+                                "support_mandatory": False,
+                                "name": "sriov",
+                                "description": "sriov"
+                            },
+                            {
+                                "requirement": {
+                                    "SRIOV": "False"
+                                },
+                                "support_mandatory": False,
+                                "name": "normal",
+                                "description": "normal"
+                            }
+                        ],
+                        "role": "root",
+                        "bitrate_requirement": 10
+                    }
+                }
+            ],
+            "metadata": {
+                "vnfSoftwareVersion": "1.0.0",
+                "vnfProductName": "zte",
+                "localizationLanguage": [
+                    "english",
+                    "chinese"
+                ],
+                "vnfProvider": "zte",
+                "vnfmInfo": "zte",
+                "defaultLocalizationLanguage": "english",
+                "vnfdId": "zte-hss-1.0",
+                "id": "zte-hss-1.0",
+                "vnfProductInfoDescription": "hss",
+                "vnfdVersion": "1.0.0",
+                "vnfProductInfoName": "hss"
+            }
+        }
 
     def tearDown(self):
         pass