"num_virtual_cpu": "2",
"cpu_architecture": "generic"
},
- "virtual_storage": {
- "type_of_storage": "root",
- "size_of_storage": "40 GB"
- },
},
+ "virtual_storages": [{
+ "virtual_storage_id": "volume_storage1",
+ "type_of_storage": "root",
+ "size_of_storage": "\"40 GB\""
+ }],
"artifacts": [
{
"artifact_name": "sw_image",
"file": "ubuntu_16.04"
},
],
- "inject_files": [
- {
- "source_path": "artifacts/keys/authorized_keys",
- "dest_path": "/home/ubuntu/.ssh/authorized_keys"
- }
- ],
"image_file": "cirros.img",
"local_storages": [
"intel_local_storages_1"
"properties": {
"user_data": "just test user data",
"meta_data": "just test meta data",
+ "inject_files": [
+ {
+ "source_path": "artifacts/keys/authorized_keys",
+ "source_data_base64": "c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFER3g2U0tyQXVDejFWOEtHZXZa\ndWVrc0xkV29QV0pQNnozcjI5WjdUbVBWRU9qTSs3UElQZVNzMkJWUngzcm5IWkJBbGFzTXJaK2ZK\nQlMyNXRzOXZmQytJdGV6UWFoL2hyOXZya213eENSNTRMYjg0cG9XK3NUb1BlRjZpNWVaWTdXK2pX\nSmZMYUZTRng5ZDJ2cDR6ZXMvZk9sVDNOdllDWGJuLzNRZHJ5UW9HbDdWRkk4b2VtWnlwVmNpa1pY\nRWxKZWVLZ0FWZFN3bnJ6dXF0Ty90bWJYY0FlU2JZdlZqa2k4eXdZY3NXTVZNWVdVV2hoKzFCQUI2\na1huVHNJV3F6cnEwUGZ2eSs4MVdEd3RpcXNxbWQ5M0hZOGhFMHNjQnJYRkJaelFTL0FZZklGQmxF\ndUZOZExjemNobnRqYlowbjdkbURYazh6SHRDWllOazdrd2I4ay8gbHVsaWFuaGFvQGxsdS1udWMx\nCg==\n",
+ "dest_path": "/home/ubuntu/.ssh/authorized_keys"
+ }
+ ],
"configurable_properties": {
"test": {
"additional_vnfc_configurable_properties": {
"vimid": "f1e33529-4a88-4155-9d7a-893cf2c80527",
"tenant": "vnfm",
"availability_zone": "zone1",
- "host": "host1"
+ "host": "host1",
+ "vnfId": "",
+ "vnfName": "",
+ "cloudOwner": "",
+ "cloudRegionId": "",
+ "vduInfo": [
+ {
+ "vduName": "VDU_vbng_0",
+ "flavorId": "12345",
+ "directive": "",
+ },
+ ]
},
"descrption": "the virtual machine of vNat",
"boot_order": [
"volume_storage_id": "volume_storage1",
"description": "",
"properties": {
- "size": "100 GB",
+ "size_of_storage": "\"100 GB\"",
"volume_id": "",
"volume_name": "volumeStorage1",
"custom_volume_type": "type1",
- "disk_type": "data",
+ "type_of_storage": "root",
"delete_on_termination_vm": True,
"location_info": {
"vimid": "f1e33529-4a88-4155-9d7a-893cf2c80527",
"local_storage_id": "omp_local_disk1",
"description": "",
"properties": {
- "size": "100 GB",
+ "size": "\"100 GB\"",
"disk_type": "root",
},
}
"external_cps": [
{
"key_name": "sriov_plane",
- "cp_id": "SRIOV_Port"
+ "cp_id": "sriov-support"
}
],
"forward_cps": [
},
}
],
- "vnic_type": "normal",
+ "vnic_type": "direct",
"role": "root",
"virtual_network_interface_requirements": [
{
- "requirement": {
- "SRIOV": "true"
+ "network_interface_requirements": {
+ "interfaceType": '{"schemaVersion": "0", "schemaLocation":"", "platformId": "generic", "mandatory": false, "configurationValue": "SR-IOV"}'
},
"support_mandatory": False,
- "name": "sriov",
+ "name": "sriov-support",
"description": "sriov"
}
],
"nodeId": "",
"id": "456"
}
-
-c5_data_get_flavor = [{
- "flavors": {
- "flavor": [
- {
- "flavor-id": "111111",
- "hpa-capabilities": [
- {
- "hpa-capability-id": "1243",
- "hpa-feature-attributes": [
- {
- "hpa-attribute-key": "memoryPageSize",
- "hpa-attribute-value": {"value": 2, "unit": "MB"}
- }
- ]
- }
- ]
- }
- ]
- }
-}]
+c5_data_create_flavor = {
+ "vimId": "f1e33529-4a88-4155-9d7a-893cf2c80527",
+ "nodeId": "",
+ "id": "6456",
+}
c6_data_list_image = {
"images": [
r2_data_create_network = [0, json.JSONEncoder().encode(c2_data_create_network), '200']
r3_data_create_subnet = [0, json.JSONEncoder().encode(c3_data_create_subnet), '200']
r4_data_create_port = [0, json.JSONEncoder().encode(c4_data_create_port), '200']
- r5_data_get_flavor = [0, json.JSONEncoder().encode(c5_data_get_flavor), '200']
+ # r5_data_create_flavor = [0, json.JSONEncoder().encode(c5_data_create_flavor), '200']
r6_data_list_image = [0, json.JSONEncoder().encode(c6_data_list_image), '200']
r6_data_create_vm = [0, json.JSONEncoder().encode(c6_data_create_vm), '200']
r6_data_get_vm = [0, json.JSONEncoder().encode(c6_data_get_vm), '200']
r2_data_create_network,
r3_data_create_subnet,
r4_data_create_port,
- r5_data_get_flavor,
r6_data_list_image, r6_data_create_vm, r6_data_get_vm]
resp = self.client.post(inst_res_url, data=json.dumps(inst_res_data), content_type='application/json')
- self.failUnlessEqual(status.HTTP_204_NO_CONTENT, resp.status_code)
+ self.assertEqual(status.HTTP_204_NO_CONTENT, resp.status_code)
@mock.patch.object(restcall, 'call_req')
def test_term_res(self, mock_call_req):
r0_data_delete,
r0_data_delete]
resp = self.client.post(term_res_url, data=json.dumps(term_res_data), content_type='application/json')
- self.failUnlessEqual(status.HTTP_204_NO_CONTENT, resp.status_code)
+ self.assertEqual(status.HTTP_204_NO_CONTENT, resp.status_code)
+
+
+class HealthCheckViewTest(unittest.TestCase):
+ def setUp(self):
+ self.client = APIClient()
+
+ def tearDown(self):
+ pass
+
+ def test_health_check(self):
+ response = self.client.get("/api/vnflcm/v1/health_check")
+ self.assertEqual(status.HTTP_200_OK, response.status_code, response.content)
+ resp_data = json.loads(response.content)
+ self.assertEqual({"status": "active"}, resp_data)