X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=osm_lcm%2Ftests%2Ftest_db_descriptors.py;h=2e001c0f877ef6c4f5bae5885bb662e7895c7012;hb=refs%2Fchanges%2F76%2F11876%2F14;hp=cc4f828a3e7ef7d177b02444a4e73b9c698150fd;hpb=5f75f10f2308aa6a8cf36cfdeeb20dc95316c5ce;p=osm%2FLCM.git diff --git a/osm_lcm/tests/test_db_descriptors.py b/osm_lcm/tests/test_db_descriptors.py index cc4f828..2e001c0 100644 --- a/osm_lcm/tests/test_db_descriptors.py +++ b/osm_lcm/tests/test_db_descriptors.py @@ -120,6 +120,38 @@ db_nsds_text = """ db_nslcmops_text = """ --- +- _admin: + created: 1651100375.77829 + modified: 1651100481.36625 + projects_read: + - 7f563445c74147f78e29b193a6da42bb + projects_write: + - 7f563445c74147f78e29b193a6da42bb + worker: a5adf5972b63 + detailed-status: success + _id: 6bd4362f-da74-4bd8-a825-fd00e610c644 + id: 6bd4362f-da74-4bd8-a825-fd00e610c644 + operationState: COMPLETED + queuePosition: 0 + stage: '' + errorMessage: '' + detailedStatus: + statusEnteredTime: 1651100481.36625 + nsInstanceId: 7e3ad9ce-39b8-4636-a661-7870f25bf800 + lcmOperationType: update + startTime: 1651100375.77823 + isAutomaticInvocation: false + operationParams: + updateType: CHANGE_VNFPKG + changeVnfPackageData: + vnfInstanceId: 6421c7c9-d865-4fb4-9a13-d4275d243e01 + vnfdId: 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77 + lcmOperationType: update + nsInstanceId: f48163a6-c807-47bc-9682-f72caef5af85 + isCancelPending: false + links: + self: "/osm/nslcm/v1/ns_lcm_op_occs/6bd4362f-da74-4bd8-a825-fd00e610c644" + nsInstance: "/osm/nslcm/v1/ns_instances/f48163a6-c807-47bc-9682-f72caef5af85" - _admin: created: 1566823354.4148262 modified: 1566823354.4148262 @@ -284,6 +316,39 @@ 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 """ db_nsrs_text = """ @@ -315,6 +380,7 @@ db_nsrs_text = """ vdu_count_index: null vdu_id: null vdu_name: null + type: lxc_proxy_charm vnfd_id: hackfest3charmed-vnf - application: alf-c-ab ee_id: f48163a6-c807-47bc-9682-f72caef5af85.alf-c-ab @@ -329,6 +395,7 @@ db_nsrs_text = """ vdu_count_index: null vdu_id: null vdu_name: null + type: lxc_proxy_charm vnfd_id: hackfest3charmed-vnf VCA-model-name: f48163a6-c807-47bc-9682-f72caef5af85 modified: 1566823354.3716335 @@ -861,12 +928,14 @@ db_nsrs_text = """ nsd-name-ref: hackfest3charmed-ns nsd-ref: hackfest3charmed-ns operational-events: [] - operational-status: failed + operational-status: running orchestration-progress: {} resource-orchestrator: osmopenmano + nsState: INSTANTIATED short-name: ALF ssh-authorized-key: null flavor : [{"vcpu-count":1,"memory-mb":1024,"storage-gb":"10","vim_info":[],"name":"mgmtVM-flv","id":"0"}] + affinity-or-anti-affinity-group : [] image : [ { "image" : "ubuntu16.04", "vim_info" : [ ], "id" : "0" } ] vld: - id: mgmt @@ -1411,6 +1480,196 @@ db_k8sclusters_text = """ vim_account: ea958ba5-4e58-4405-bf42-6e3be15d4c3a """ +db_vnfds_revisions_text = """ +--- +- _admin: + created: 1566823352.7154346 + modified: 1566823353.9295402 + onboardingState: ONBOARDED + operationalState: ENABLED + projects_read: + - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4 + projects_write: + - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4 + storage: + descriptor: hackfest_3charmed_vnfd/hackfest_3charmed_vnfd.yaml + folder: 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77 + fs: local + path: /app/storage/ + pkg-dir: hackfest_3charmed_vnfd + zipfile: package.tar.gz + type: vnfd + usageState: NOT_IN_USE + userDefinedData: {} + _id: 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77:1 + id: hackfest3charmed-vnf + description: >- + A VNF consisting of 2 VDUs connected to an internal VL, and one VDU + with cloud-init + product-name: hackfest3charmed-vnf + version: '1.0' + mgmt-cp: vnf-mgmt-ext + virtual-compute-desc: + - id: mgmt-compute + virtual-cpu: + num-virtual-cpu: 1 + virtual-memory: + size: 1 + - id: data-compute + virtual-cpu: + num-virtual-cpu: 1 + virtual-memory: + size: 1 + kdu: + - juju-bundle: stable/native-kdu + name: native-kdu + virtual-storage-desc: + - id: mgmt-storage + block-storage-data: + size-of-storage: 10 + - id: data-storage + block-storage-data: + size-of-storage: 10 + + sw-image-desc: + - id: hackfest3-mgmt + name: hackfest3-mgmt + + vdu: + - id: mgmtVM + name: mgmtVM + cloud-init-file: cloud-config.txt + sw-image-desc: hackfest3-mgmt + virtual-compute-desc: mgmt-compute + virtual-storage-desc: mgmt-storage + int-cpd: + - id: vnf-mgmt + order: 1 + virtual-network-interface-requirement: + - name: mgmtVM-eth0 + virtual-interface: + type: VIRTIO + - id: mgmtVM-internal + int-virtual-link-desc: internal + order: 2 + virtual-network-interface-requirement: + - name: mgmtVM-eth1 + virtual-interface: + type: VIRTIO + - id: dataVM + name: dataVM + sw-image-desc: hackfest3-mgmt + virtual-compute-desc: data-compute + virtual-storage-desc: data-storage + int-cpd: + - id: dataVM-internal + int-virtual-link-desc: internal + order: 1 + virtual-network-interface-requirement: + - name: dataVM-eth1 + virtual-interface: + type: VIRTIO + - id: vnf-data + order: 2 + virtual-network-interface-requirement: + - name: dataVM-eth0 + virtual-interface: + type: VIRTIO + monitoring-parameter: + - id: dataVM_cpu_util + name: dataVM_cpu_util + performance-metric: cpu_utilization + + int-virtual-link-desc: + - id: internal + + ext-cpd: + - id: vnf-mgmt-ext + int-cpd: # Connection to int-cpd + vdu-id: mgmtVM + cpd: vnf-mgmt + - id: vnf-data-ext + int-cpd: # Connection to int-cpd + vdu-id: dataVM + cpd: vnf-data + + df: + - id: hackfest_default + vdu-profile: + - id: mgmtVM + min-number-of-instances: 1 + - id: dataVM + min-number-of-instances: 1 + max-number-of-instances: 10 + instantiation-level: + - id: default + vdu-level: + - vdu-id: mgmtVM + number-of-instances: 1 + - vdu-id: dataVM + number-of-instances: 1 + scaling-aspect: + - id: scale_dataVM + name: scale_dataVM + max-scale-level: 10 + aspect-delta-details: + deltas: + - id: delta1 + vdu-delta: + - id: vdudelta1 + number-of-instances: 1 + scaling-policy: + - name: auto_cpu_util_above_threshold + scaling-type: automatic + enabled: true + threshold-time: 0 + cooldown-time: 60 + scaling-criteria: + - name: cpu_util_above_threshold + scale-in-relational-operation: LE + scale-in-threshold: '15.0000000000' + scale-out-relational-operation: GE + scale-out-threshold: '60.0000000000' + vnf-monitoring-param-ref: dataVM_cpu_util + scaling-config-action: + - trigger: post-scale-out + vnf-config-primitive-name-ref: touch + - trigger: pre-scale-in + vnf-config-primitive-name-ref: touch + lcm-operations-configuration: + operate-vnf-op-config: + day1-2: + - id: hackfest3charmed-vnf + execution-environment-list: + - id: simple-ee + juju: + charm: simple + initial-config-primitive: + - seq: "1" + execution-environment-ref: simple-ee + name: config + parameter: + - name: ssh-hostname + value: + - name: ssh-username + value: ubuntu + - name: ssh-password + value: osm4u + - seq: "2" + execution-environment-ref: simple-ee + name: touch + parameter: + - name: filename + value: + config-primitive: + - name: touch + execution-environment-ref: simple-ee + parameter: + - data-type: STRING + default-value: + name: filename +""" + db_vnfds_text = """ --- - _admin: @@ -1775,6 +2034,90 @@ db_vnfrs_text = """ vim-id: c2538499-4c30-41c0-acd5-80cb92f48061 ns-image-id: 0 ns-flavor-id: 0 + affinity-or-anti-affinity-group-id : [] + - _id: ab453219-2d9a-45c2-864d-2c0788385028 + count-index: 0 + interfaces: + - ip-address: 192.168.54.3 + mac-address: fa:16:3e:d9:7a:5d + name: dataVM-eth0 + vnf-vld-id: internal + - ip-address: 192.168.24.3 + mac-address: fa:16:3e:d1:6c:0d + name: dataVM-xe0 + ns-vld-id: datanet + internal-connection-point: + - connection-point-id: dataVM-internal + id: dataVM-internal + name: dataVM-internal + ip-address: null + name: ALF-1-dataVM-1 + status: ACTIVE + status-detailed: null + vdu-id-ref: dataVM + vim-id: 87973c3f-365d-4227-95c2-7a8abc74349c + ns-image-id: 0 + ns-flavor-id: 0 + affinity-or-anti-affinity-group-id : [] + vim-account-id: ea958ba5-4e58-4405-bf42-6e3be15d4c3a + vld: + - id: internal + name: ALF-internal + status: ACTIVE + status-detailed: null + vim-id: ff181e6d-2597-4244-b40b-bb0174bdfeb6 + vnfd-id: 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77 + vnfd-ref: hackfest3charmed-vnf +- _admin: + created: 1566823354.3668208 + modified: 1566823354.3668208 + nsState: NOT_INSTANTIATED + projects_read: + - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4 + projects_write: + - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4 + _id: 6421c7c9-d865-4fb4-9a13-d4275d243e01 + additionalParamsForVnf: + touch_filename: /home/ubuntu/first-touch-1 + touch_filename2: /home/ubuntu/second-touch-1 + connection-point: + - connection-point-id: vnf-mgmt + id: vnf-mgmt + name: vnf-mgmt + - connection-point-id: vnf-data + id: vnf-data + name: vnf-data + created-time: 1566823354.36234 + id: 6421c7c9-d865-4fb4-9a13-d4275d243e01 + ip-address: 10.205.1.46 + member-vnf-index-ref: '1' + nsr-id-ref: f48163a6-c807-47bc-9682-f72caef5af85 + vdur: + - _id: f0e7d7ce-2443-4dcb-ad0b-5ab9f3b13d37 + count-index: 0 + interfaces: + - ip-address: 10.205.1.46 + mac-address: fa:16:3e:b4:3e:b1 + mgmt-vnf: true + name: mgmtVM-eth0 + ns-vld-id: mgmt + - ip-address: 192.168.54.2 + mac-address: fa:16:3e:6e:7e:78 + name: mgmtVM-eth1 + vnf-vld-id: internal + internal-connection-point: + - connection-point-id: mgmtVM-internal + id: mgmtVM-internal + name: mgmtVM-internal + ip-address: 10.205.1.46 + name: ALF-1-mgmtVM-1 + status: ACTIVE + status-detailed: null + vdu-id-ref: mgmtVM + vim-id: c2538499-4c30-41c0-acd5-80cb92f48061 + ns-image-id: 0 + ns-flavor-id: 0 + affinity-or-anti-affinity-group-id : [] - _id: ab453219-2d9a-45c2-864d-2c0788385028 count-index: 0 interfaces: @@ -1798,6 +2141,7 @@ db_vnfrs_text = """ vim-id: 87973c3f-365d-4227-95c2-7a8abc74349c ns-image-id: 0 ns-flavor-id: 0 + affinity-or-anti-affinity-group-id : [] vim-account-id: ea958ba5-4e58-4405-bf42-6e3be15d4c3a vld: - id: internal @@ -1856,6 +2200,7 @@ db_vnfrs_text = """ vim-id: 248077b2-e3b8-4a37-8b72-575abb8ed912 ns-image-id: 0 ns-flavor-id: 0 + affinity-or-anti-affinity-group-id : [] - _id: 889b874d-e1c3-4e75-aa45-53a9b0ddabd9 count-index: 0 interfaces: @@ -1879,6 +2224,7 @@ db_vnfrs_text = """ vim-id: a4ce4372-e0ad-4ae3-8f9f-1c969f32e77b ns-image-id: 0 ns-flavor-id: 0 + affinity-or-anti-affinity-group-id : [] vim-account-id: ea958ba5-4e58-4405-bf42-6e3be15d4c3a vld: - id: internal @@ -2027,12 +2373,29 @@ 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": { "ns": "f48163a6-c807-47bc-9682-f72caef5af85", "instantiate": "a639fac7-e0bb-4225-8ecb-c1f8efcc125e", "terminate": "a639fac7-e0bb-4225-ffff-c1f8efcc125e", + "update": "6bd4362f-da74-4bd8-a825-fd00e610c644", }, "TEST-KDU": { "ns": "0bcb701c-ee4d-41ab-8ee6-f4156f7f114d", @@ -2049,4 +2412,9 @@ 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", + }, }