X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_lcm%2Ftests%2Ftest_db_descriptors.py;h=d02b011f6103ceb2745e75b3e9e6ea12d112a131;hb=afff693a2ae9757aee5f731ee12bca70cdb9a907;hp=457ea301f1d54ecb57fc38bd7d47cd4a71b98be6;hpb=dffa6217777142746ed9b5c9a7eaab7c0d8716be;p=osm%2FLCM.git diff --git a/osm_lcm/tests/test_db_descriptors.py b/osm_lcm/tests/test_db_descriptors.py index 457ea30..d02b011 100644 --- a/osm_lcm/tests/test_db_descriptors.py +++ b/osm_lcm/tests/test_db_descriptors.py @@ -316,6 +316,185 @@ db_nslcmops_text = """ operationState: COMPLETED startTime: 1575034637.0445576 statusEnteredTime: 1575034663.8484545 + +- _admin: + created: 1566823354.4148262 + modified: 1566823354.4148262 + projects_read: + - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4 + projects_write: + - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4 + worker: 86434c2948e2 + operations: + - member_vnf_index: '1' + primitive: touch + primitive_params: /home/ubuntu/last-touch-1 + operationState: COMPLETED + detailed-status: Done + _id: a639fac7-e0bb-4225-8ecb-c1f8efcc125f + detailed-status: done + id: a639fac7-e0bb-4225-8ecb-c1f8efcc125f + isAutomaticInvocation: false + isCancelPending: false + lcmOperationType: update + links: + nsInstance: /osm/nslcm/v1/ns_instances/f48163a6-c807-47bc-9682-f72caef5af85 + self: /osm/nslcm/v1/ns_lcm_op_occs/a639fac7-e0bb-4225-8ecb-c1f8efcc125f + nsInstanceId: f48163a6-c807-47bc-9682-f72caef5af85 + operationParams: + lcmOperationType: update + nsInstanceId: f48163a6-c807-47bc-9682-f72caef5af85 + removeVnfInstanceId: 88d90b0c-faff-4b9f-bccd-017f33985984 + updateType: REMOVE_VNF + operationState: FAILED + startTime: 1566823354.414689 + statusEnteredTime: 1566824534.5112448 + +- _id: 1bd4b60a-e15d-49e5-b75e-2b3224f15dda + id: 1bd4b60a-e15d-49e5-b75e-2b3224f15dda + operationState: COMPLETED + queuePosition: 0 + stage: '' + errorMessage: '' + detailedStatus: + statusEnteredTime: 1652349205.9499352 + nsInstanceId: 52f0b3ac-1574-481f-a48f-528fc02912f7 + lcmOperationType: update + startTime: 1652349205.7415159 + isAutomaticInvocation: false + operationParams: + updateType: OPERATE_VNF + operateVnfData: + vnfInstanceId: a6df8aa0-1271-4dfc-85a5-e0484fea303f + changeStateTo: start + additionalParam: + run-day1: false + vdu-id: mgmtVM + count-index: 0 + lcmOperationType: update + nsInstanceId: 52f0b3ac-1574-481f-a48f-528fc02912f7 + isCancelPending: false + links: + self: "/osm/nslcm/v1/ns_lcm_op_occs/1bd4b60a-e15d-49e5-b75e-2b3224f15dda" + nsInstance: "/osm/nslcm/v1/ns_instances/52f0b3ac-1574-481f-a48f-528fc02912f7" + _admin: + created: 1652349205.7415788 + modified: 1652349205.9499364 + projects_read: + - e38990e1-6724-4292-ab6f-2ecc109f9af4 + projects_write: + - e38990e1-6724-4292-ab6f-2ecc109f9af4 + worker: fbf6b5aa99e2 + detailed-status: Done + +- _id: 6eace44b-2ef4-4de5-b15f-63f2e8898bfb + id: 6eace44b-2ef4-4de5-b15f-63f2e8898bfb + operationState: Error + queuePosition: 0 + stage: '' + errorMessage: '' + detailedStatus: + statusEnteredTime: 1652349205.9499352 + nsInstanceId: 52f0b3ac-1574-481f-a48f-528fc02912f7 + lcmOperationType: update + startTime: 1652349205.7415159 + isAutomaticInvocation: false + operationParams: + updateType: OPERATE_VNF + operateVnfData: + vnfInstanceId: a6df8aa0-1271-4dfc-85a5-e0484fea303f + changeStateTo: stop + additionalParam: + run-day1: false + vdu-id: mgmtVM + count-index: 0 + lcmOperationType: update + nsInstanceId: 52f0b3ac-1574-481f-a48f-528fc02912f7 + isCancelPending: false + links: + self: "/osm/nslcm/v1/ns_lcm_op_occs/1bd4b60a-e15d-49e5-b75e-2b3224f15dda" + nsInstance: "/osm/nslcm/v1/ns_instances/52f0b3ac-1574-481f-a48f-528fc02912f7" + _admin: + created: 1652349205.7415788 + modified: 1652349205.9499364 + projects_read: + - e38990e1-6724-4292-ab6f-2ecc109f9af4 + projects_write: + - e38990e1-6724-4292-ab6f-2ecc109f9af4 + worker: fbf6b5aa99e2 + detailed-status: Done + +- _admin: + created: 1566823354.4148262 + modified: 1566823354.4148262 + projects_read: + - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4 + projects_write: + - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4 + worker: 86434c2948e2 + _id: 8b838aa8-53a3-4955-80bd-fbba6a7957ed + detailed-status: 'FAILED executing proxy charm initial primitives for member_vnf_index=1 + vdu_id=None: charm error executing primitive verify-ssh-credentials for member_vnf_index=1 + vdu_id=None: ''timeout after 600 seconds''' + id: 8b838aa8-53a3-4955-80bd-fbba6a7957ed + isAutomaticInvocation: false + isCancelPending: false + lcmOperationType: scale + links: + nsInstance: /osm/nslcm/v1/ns_instances/f48163a6-c807-47bc-9682-f72caef5af85 + self: /osm/nslcm/v1/ns_lcm_op_occs/8b838aa8-53a3-4955-80bd-fbba6a7957ed + nsInstanceId: f48163a6-c807-47bc-9682-f72caef5af85 + operationParams: + additionalParamsForVnf: + - additionalParams: + touch_filename: /home/ubuntu/first-touch-1 + touch_filename2: /home/ubuntu/second-touch-1 + member-vnf-index: '1' + lcmOperationType: instantiate + nsDescription: default description + nsInstanceId: f48163a6-c807-47bc-9682-f72caef5af85 + nsName: ALF + nsdId: 8c2f8b95-bb1b-47ee-8001-36dc090678da + vimAccountId: ea958ba5-4e58-4405-bf42-6e3be15d4c3a + operationState: FAILED + startTime: 1566823354.414689 + statusEnteredTime: 1566824534.5112448 + +- _admin: + created: 1566823354.4148262 + modified: 1566823354.4148262 + projects_read: + - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4 + projects_write: + - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4 + worker: 86434c2948e2 + _id: a21af1d4-7f1a-4f7b-b666-222315113a62 + detailed-status: 'FAILED executing proxy charm initial primitives for member_vnf_index=1 + vdu_id=None: charm error executing primitive verify-ssh-credentials for member_vnf_index=1 + vdu_id=None: ''timeout after 600 seconds''' + id: a21af1d4-7f1a-4f7b-b666-222315113a62 + isAutomaticInvocation: false + isCancelPending: false + lcmOperationType: scale + links: + nsInstance: /osm/nslcm/v1/ns_instances/f48163a6-c807-47bc-9682-f72caef5af85 + self: /osm/nslcm/v1/ns_lcm_op_occs/a21af1d4-7f1a-4f7b-b666-222315113a62 + nsInstanceId: f48163a6-c807-47bc-9682-f72caef5af85 + operationParams: + additionalParamsForVnf: + - additionalParams: + touch_filename: /home/ubuntu/first-touch-1 + touch_filename2: /home/ubuntu/second-touch-1 + member-vnf-index: '1' + lcmOperationType: instantiate + nsDescription: default description + nsInstanceId: f48163a6-c807-47bc-9682-f72caef5af85 + nsName: ALF + nsdId: 8c2f8b95-bb1b-47ee-8001-36dc090678da + vimAccountId: ea958ba5-4e58-4405-bf42-6e3be15d4c3a + operationState: COMPLETED + startTime: 1566823354.414689 + statusEnteredTime: 1566824534.5112448 """ db_nsrs_text = """ @@ -1056,6 +1235,254 @@ db_nsrs_text = """ vim-network-name: mgmt vnfd-id: - d96b1cdf-5ad6-49f7-bf65-907ada989293 + +- _id: b63aa1ba-996e-43a7-921a-1aca5ccbc63f + name: ha_charm-ns2 + name-ref: ha_charm-ns2 + short-name: ha_charm-ns2 + admin-status: ENABLED + nsState: BROKEN + currentOperation: IDLE + currentOperationID: + errorDescription: 'Operation: INSTANTIATING.8e72f2b5-f466-4382-88a4-4575c9e07eb8, + Stage 5/5: running Day-1 primitives for NS.' + deploymentStatus: + configurationStatus: + - elementType: VDU + elementUnderConfiguration: userVM-0 + status: READY + - elementType: VDU + elementUnderConfiguration: policyVM-0 + status: READY + - elementType: NS + elementUnderConfiguration: b63aa1ba-996e-43a7-921a-1aca5ccbc63f + status: BROKEN + vcaStatus: + nsd: + _id: a557cb0f-0dc9-494c-a9bd-69e8079767e7 + id: nscharm-ns + version: '1.0' + name: nscharm-ns + vnfd-id: + - nscharm-user-vnf + - nscharm-policy-vnf + virtual-link-desc: + - id: mgmtnet + mgmt-network: true + vim-network-name: osm-ext + df: + - id: default-df + vnf-profile: + - id: '1' + virtual-link-connectivity: + - constituent-cpd-id: + - constituent-base-element-id: '1' + constituent-cpd-id: vnf-mgmt-ext + virtual-link-profile-id: mgmtnet + vnfd-id: nscharm-user-vnf + - id: '2' + virtual-link-connectivity: + - constituent-cpd-id: + - constituent-base-element-id: '2' + constituent-cpd-id: vnf-mgmt-ext + virtual-link-profile-id: mgmtnet + vnfd-id: nscharm-policy-vnf + ns-configuration: + juju: + charm: ns_ubuntu-18.04-amd64.charm + config-primitive: + - name: add-user + parameter: + - name: username + data-type: STRING + initial-config-primitive: + - seq: '1' + name: config + parameter: + - name: juju-username + value: admin + - name: juju-password + value: a5611fc6452349cc6e45705d34c501d4 + - seq: '2' + name: add-user + parameter: + - name: username + value: root + description: NS with 2 VNFs + _admin: + userDefinedData: {} + revision: 1 + created: 1658868548.2641 + modified: 1658868548.89253 + projects_read: + - 51e0e80fe533469d98766caa16552a3e + projects_write: + - 51e0e80fe533469d98766caa16552a3e + onboardingState: ONBOARDED + operationalState: ENABLED + usageState: NOT_IN_USE + storage: + fs: mongo + path: "/app/storage/" + folder: a557cb0f-0dc9-494c-a9bd-69e8079767e7:1 + pkg-dir: nscharm_ns + descriptor: nscharm_ns/nscharm_nsd.yaml + zipfile: nscharm_ns.tar.gz + datacenter: bad7338b-ae46-43d4-a434-c3337a8054ac + resource-orchestrator: osmopenmano + description: default description + constituent-vnfr-ref: + - 303a6ccd-e6f2-4127-96a4-1e3b97956850 + - 0d0cd621-47db-4eef-a9e8-8edb71a34ea1 + operational-status: running + config-status: failed + orchestration-progress: {} + create-time: 1658868607.27119 + nsd-name-ref: nscharm-ns + operational-events: [] + nsd-ref: nscharm-ns + nsd-id: a557cb0f-0dc9-494c-a9bd-69e8079767e7 + vnfd-id: + - b5068dc9-a3cd-4a1e-b051-e36c3a9f10a4 + - 4aa63021-c816-456b-9998-804c5285a85d + instantiate_params: + nsdId: a557cb0f-0dc9-494c-a9bd-69e8079767e7 + nsName: ha_charm-ns2 + nsDescription: default description + vimAccountId: bad7338b-ae46-43d4-a434-c3337a8054ac + vld: + - name: mgmtnet + vim-network-name: osm-ext + additionalParamsForNs: + ns-instance-config-ref: b63aa1ba-996e-43a7-921a-1aca5ccbc63f + id: b63aa1ba-996e-43a7-921a-1aca5ccbc63f + ssh-authorized-key: + flavor: + - id: '0' + memory-mb: 1024 + name: userVM-flv + storage-gb: '10' + vcpu-count: 1 + vim_info: + vim:bad7338b-ae46-43d4-a434-c3337a8054ac: + vim_details: + vim_id: 17a9ba76-beb7-4ad4-a481-97de37174866 + vim_message: + vim_status: DONE + - id: '1' + memory-mb: 1024 + name: policyVM-flv + storage-gb: '10' + vcpu-count: 1 + vim_info: + vim:bad7338b-ae46-43d4-a434-c3337a8054ac: + vim_details: + vim_id: 17a9ba76-beb7-4ad4-a481-97de37174866 + vim_message: + vim_status: DONE + image: + - id: '0' + image: ubuntu18.04 + vim_info: + vim:bad7338b-ae46-43d4-a434-c3337a8054ac: + vim_details: + vim_id: 919fc71a-6acd-4ee3-8123-739a9abbc2e7 + vim_message: + vim_status: DONE + - image: ubuntu/images/hvm-ssd/ubuntu-artful-17.10-amd64-server-20180509 + vim-type: aws + id: '1' + - image: Canonical:UbuntuServer:18.04-LTS:latest + vim-type: azure + id: '2' + - image: ubuntu-os-cloud:image-family:ubuntu-1804-lts + vim-type: gcp + id: '3' + affinity-or-anti-affinity-group: [] + revision: 1 + vld: + - id: mgmtnet + mgmt-network: true + name: mgmtnet + type: + vim_info: + vim:bad7338b-ae46-43d4-a434-c3337a8054ac: + vim_account_id: bad7338b-ae46-43d4-a434-c3337a8054ac + vim_network_name: osm-ext + vim_details: | + {admin_state_up: true, availability_zone_hints: [], availability_zones: [nova], created_at: '2019-10-17T23:44:03Z', description: '', encapsulation: vlan, encapsulation_id: 2148, encapsulation_type: vlan, id: 21ea5d92-24f1-40ab-8d28-83230e277a49, ipv4_address_scope: null, + ipv6_address_scope: null, is_default: false, mtu: 1500, name: osm-ext, port_security_enabled: true, project_id: 456b6471010b4737b47a0dd599c920c5, 'provider:network_type': vlan, 'provider:physical_network': physnet1, 'provider:segmentation_id': 2148, revision_number: 1009, + 'router:external': true, segmentation_id: 2148, shared: true, status: ACTIVE, subnets: [{subnet: {allocation_pools: [{end: 172.21.249.255, start: 172.21.248.1}], cidr: 172.21.248.0/22, created_at: '2019-10-17T23:44:07Z', description: '', dns_nameservers: [], + enable_dhcp: true, gateway_ip: 172.21.251.254, host_routes: [], id: d14f68b7-8287-41fe-b533-dafb2240680a, ip_version: 4, ipv6_address_mode: null, ipv6_ra_mode: null, name: osm-ext-subnet, network_id: 21ea5d92-24f1-40ab-8d28-83230e277a49, project_id: 456b6471010b4737b47a0dd599c920c5, + revision_number: 5, service_types: [], subnetpool_id: null, tags: [], tenant_id: 456b6471010b4737b47a0dd599c920c5, updated_at: '2020-09-14T15:15:06Z'}}], tags: [], tenant_id: 456b6471010b4737b47a0dd599c920c5, type: data, updated_at: '2022-07-05T18:39:02Z'} + vim_id: 21ea5d92-24f1-40ab-8d28-83230e277a49 + vim_message: + vim_status: ACTIVE + _admin: + created: 1658868607.2804 + modified: 1658868966.10105 + projects_read: + - 51e0e80fe533469d98766caa16552a3e + projects_write: + - 51e0e80fe533469d98766caa16552a3e + nsState: INSTANTIATED + current-operation: + nslcmop: + operation-type: + deployed: + RO: + vnfd: [] + operational-status: running + VCA: + - target_element: vnf/1/vdu/userVM/0 + member-vnf-index: '1' + vdu_id: userVM + kdu_name: + vdu_count_index: 0 + operational-status: init + detailed-status: '' + step: initial-deploy + vnfd_id: nscharm-user-vnf + vdu_name: + type: lxc_proxy_charm + ee_descriptor_id: vnf-user-ee + ee_id: b63aa1ba-996e-43a7-921a-1aca5ccbc63f.app-vnf-3b97956850-z0-vdu-uservm-cnt-z0-eh2hc.2 + application: app-vnf-3b97956850-z0-vdu-uservm-cnt-z0-eh2hc + model: b63aa1ba-996e-43a7-921a-1aca5ccbc63f + config_sw_installed: true + - target_element: vnf/2/vdu/policyVM/0 + member-vnf-index: '2' + vdu_id: policyVM + kdu_name: + vdu_count_index: 0 + operational-status: init + detailed-status: '' + step: initial-deploy + vnfd_id: nscharm-policy-vnf + vdu_name: + type: lxc_proxy_charm + ee_descriptor_id: vnf-policy-ee + ee_id: b63aa1ba-996e-43a7-921a-1aca5ccbc63f.app-vnf-db71a34ea1-z0-vdu-policyvm-cnt-z0-tr1oc.0 + application: app-vnf-db71a34ea1-z0-vdu-policyvm-cnt-z0-tr1oc + model: b63aa1ba-996e-43a7-921a-1aca5ccbc63f + config_sw_installed: true + - target_element: ns + member-vnf-index: + vdu_id: + kdu_name: + vdu_count_index: 0 + operational-status: init + detailed-status: '' + step: initial-deploy + vnfd_id: + vdu_name: + type: lxc_proxy_charm + ee_descriptor_id: + ee_id: b63aa1ba-996e-43a7-921a-1aca5ccbc63f.app-qmfbp.1 + application: app-qmfbp + model: b63aa1ba-996e-43a7-921a-1aca5ccbc63f + config_sw_installed: true + K8s: [] """ ro_ns_text = """ @@ -2277,6 +2704,63 @@ db_vnfrs_text = """ vim-account-id: 74337dcb-ef54-41e7-bd2d-8c0d7fcd326f vnfd-id: d96b1cdf-5ad6-49f7-bf65-907ada989293 vnfd-ref: native-kdu_knf + +- _id: a6df8aa0-1271-4dfc-85a5-e0484fea303f + id: a6df8aa0-1271-4dfc-85a5-e0484fea303f + nsr-id-ref: 52f0b3ac-1574-481f-a48f-528fc02912f7 + member-vnf-index-ref: '1' + additionalParamsForVnf: + created-time: 1652105830.965044 + vnfd-ref: ha_proxy_charm-vnf + vnfd-id: 8b42078a-9d42-4def-8b5d-7dd0f041d078 + vim-account-id: dff4014e-bb5e-441a-a28d-6dd5d86c7175 + vca-id: + vdur: + - _id: 392e010d-3a39-4516-acc0-76993c19691f + alt-image-ids: + - '1' + - '2' + - '3' + cloud-init: 8b42078a-9d42-4def-8b5d-7dd0f041d078:file:cloud-config.txt + count-index: 0 + id: 392e010d-3a39-4516-acc0-76993c19691f + internal-connection-point: + - connection-point-id: mgmtVM-eth0-int + id: mgmtVM-eth0-int + name: mgmtVM-eth0-int + - connection-point-id: dataVM-xe0-int + id: dataVM-xe0-int + name: dataVM-xe0-int + ip-address: 10.45.28.134 + ns-flavor-id: '0' + ns-image-id: '0' + ssh-access-required: true + vdu-id-ref: mgmtVM + vdu-name: mgmtVM + vim_info: + vim:05357241-1a01-416f-9e02-af20f65f51cd: + vim_id: 1f8c18e3-b3aa-484c-a211-e88d6654f24a + vim_status: ACTIVE + vim_name: test_ns_ch-1-mgmtVM-0 + status: ACTIVE + vim-id: 1f8c18e3-b3aa-484c-a211-e88d6654f24a + name: test_ns_ch-1-mgmtVM-0 + vim_details: + vim_id: 1f8c18e3-b3aa-484c-a211-e88d6654f24a + vim_status: DONE + vim_message: + ip-address: 10.45.28.134 + _admin: + created: 1652105830.9652078 + modified: 1652105830.9652078 + projects_read: + - e38990e1-6724-4292-ab6f-2ecc109f9af4 + projects_write: + - e38990e1-6724-4292-ab6f-2ecc109f9af4 + nsState: INSTANTIATED + vdu: + status: DONE + vim-id: 1f8c18e3-b3aa-484c-a211-e88d6654f24a """ db_nslcmops_scale_text = """ @@ -2340,6 +2824,22 @@ db_nslcmops_scale_text = """ detailed-status: done """ +ro_update_action_text = """ +action_id: e62fc036-6e6f-4a6f-885e-bc12e2fbe75d +details: progress 1/1 +nsr_id: 31dbfa80-80a8-4f2a-a557-626904df3402 +status: DONE +tasks: +- action: DELETE + action_id: e62fc036-6e6f-4a6f-885e-bc12e2fbe75d + item: vdu + nsr_id: 31dbfa80-80a8-4f2a-a557-626904df3402 + status: FINISHED + target_record: vnfrs:5bbe7015-ae98-4e09-9316-76f3bf218353:vdur.0.vim_info.vim:2a3dc443-415b-4865-8420-f804b993c5a3 + target_record_id: vnfrs:5bbe7015-ae98-4e09-9316-76f3bf218353:vdur.e03e2281-c70e-44ef-ac3b-052b81efd31d + task_id: e62fc036-6e6f-4a6f-885e-bc12e2fbe75d:0 +""" + test_ids = { # contains the ids of ns and operations of every test "TEST-A": { @@ -2363,4 +2863,20 @@ test_ids = { "instantiate": "4013bbd2-b151-40ee-bcef-7e24ce5432f6", "terminate": None, }, + "TEST-UPDATE": { + "ns": "f48163a6-c807-47bc-9682-f72caef5af85", + "vnf": "88d90b0c-faff-4b9f-bccd-017f33985984", + "removeVnf": "a639fac7-e0bb-4225-8ecb-c1f8efcc125f", + }, + "TEST-OP-VNF": { + "ns": "f48163a6-c807-47bc-9682-f72caef5af85", + "nslcmops": "1bd4b60a-e15d-49e5-b75e-2b3224f15dda", + "nslcmops1": "6eace44b-2ef4-4de5-b15f-63f2e8898bfb", + "vnfrs": "a6df8aa0-1271-4dfc-85a5-e0484fea303f", + }, + "TEST-V-SCALE": { + "ns": "f48163a6-c807-47bc-9682-f72caef5af85", + "instantiate-1": "8b838aa8-53a3-4955-80bd-fbba6a7957ed", + "instantiate": "a21af1d4-7f1a-4f7b-b666-222315113a62", + }, }