Code Coverage

Cobertura Coverage Report > osm_nbi.tests >

test_db_descriptors.py

Trend

File Coverage summary

NameClassesLinesConditionals
test_db_descriptors.py
100%
1/1
100%
8/8
100%
0/0

Coverage Breakdown by Class

NameLinesConditionals
test_db_descriptors.py
100%
8/8
N/A

Source

osm_nbi/tests/test_db_descriptors.py
1 #
2 # Licensed under the Apache License, Version 2.0 (the "License"); you may
3 # not use this file except in compliance with the License. You may obtain
4 # a copy of the License at
5 #
6 #         http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 # License for the specific language governing permissions and limitations
12 # under the License.
13 #
14 # For those usages not covered by the Apache License, Version 2.0 please
15 # contact: esousa@whitestack.com or alfonso.tiernosepulveda@telefonica.com
16 ##
17
18 1 """Contains database content needed for tests"""
19
20
21 1 db_vim_accounts_text = """
22 ---
23 -   _admin:
24         created: 1566818150.3024442
25         current_operation: 0
26         deployed:
27             RO: dc51ce6c-c7f2-11e9-b9c0-02420aff0004
28             RO-account: dc5c67fa-c7f2-11e9-b9c0-02420aff0004
29         detailed-status: Done
30         modified: 1566818150.3024442
31         operationalState: ENABLED
32         operations:
33         -   detailed-status: Done
34             lcmOperationType: create
35             operationParams: null
36             operationState: COMPLETED
37             startTime: 1566818150.3025382
38             statusEnteredTime: 1566818150.3025382
39             worker: 86434c2948e2
40         projects_read:
41         - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
42         projects_write:
43         - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
44     _id: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
45     description: Openstack site 2, based on Mirantis, also called DSS9000-1, with
46         tenant tid
47     name: ost2-mrt-tid
48     schema_version: '1.1'
49     vim_password: 5g0yGX86qIhprX86YTMcpg==
50     vim_tenant_name: osm
51     vim_type: openstack
52     vim_url: http://10.95.87.162:5000/v2.0
53     vim_user: osm
54 """
55
56 1 db_vnfds_text = """
57 ---
58 -   _admin:
59         created: 1566823352.7154346
60         modified: 1566823353.9295402
61         onboardingState: ONBOARDED
62         operationalState: ENABLED
63         projects_read:
64         - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
65         projects_write:
66         - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
67         storage:
68             descriptor: hackfest_3charmed_vnfd/hackfest_3charmed_vnfd.yaml
69             folder: 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77
70             fs: local
71             path: /app/storage/
72             pkg-dir: hackfest_3charmed_vnfd
73             zipfile: package.tar.gz
74         type: vnfd
75         usageState: NOT_IN_USE
76         userDefinedData: {}
77     _id: 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77
78     id: hackfest3charmed-vnf
79     description: >-
80       A VNF consisting of 2 VDUs connected to an internal VL, and one VDU with
81       cloud-init
82     product-name: hackfest3charmed-vnf
83     version: '1.0'
84     mgmt-cp: vnf-mgmt-ext
85   
86     virtual-compute-desc:
87       - id: mgmt-compute
88         virtual-cpu:
89           num-virtual-cpu: 1
90         virtual-memory:
91           size: 1
92       - id: data-compute
93         virtual-cpu:
94           num-virtual-cpu: 1
95         virtual-memory:
96           size: 1
97   
98     virtual-storage-desc:
99       - id: mgmt-storage
100         size-of-storage: 10
101       - id: data-storage
102         size-of-storage: 10
103   
104     sw-image-desc:
105       - id: hackfest3-mgmt
106         name: hackfest3-mgmt
107   
108     vdu:
109       - id: mgmtVM
110         name: mgmtVM
111         cloud-init-file: cloud-config.txt
112         sw-image-desc: hackfest3-mgmt
113         virtual-compute-desc: mgmt-compute
114         virtual-storage-desc:
115           - mgmt-storage
116         int-cpd:
117           - id: vnf-mgmt
118             virtual-network-interface-requirement:
119               - name: mgmtVM-eth0
120                 position: 1
121                 virtual-interface:
122                   type: VIRTIO
123           - id: mgmtVM-internal
124             int-virtual-link-desc: internal
125             virtual-network-interface-requirement:
126               - name: mgmtVM-eth1
127                 position: 2
128                 virtual-interface:
129                   type: VIRTIO
130       - id: dataVM
131         name: dataVM
132         sw-image-desc: hackfest3-mgmt
133         virtual-compute-desc: data-compute
134         virtual-storage-desc:
135           - data-storage
136         int-cpd:
137           - id: dataVM-internal
138             int-virtual-link-desc: internal
139             virtual-network-interface-requirement:
140               - name: dataVM-eth1
141                 position: 1
142                 virtual-interface:
143                   type: VIRTIO
144           - id: vnf-data
145             virtual-network-interface-requirement:
146               - name: dataVM-eth0
147                 position: 2
148                 virtual-interface:
149                   type: VIRTIO
150         monitoring-parameter:
151           - id: dataVM_cpu_util
152             name: dataVM_cpu_util
153             performance-metric: cpu_utilization
154   
155     int-virtual-link-desc:
156       - id: internal
157   
158     ext-cpd:
159       - id: vnf-mgmt-ext
160         int-cpd: # Connection to int-cpd
161           vdu-id: mgmtVM
162           cpd: vnf-mgmt
163       - id: vnf-data-ext
164         int-cpd: # Connection to int-cpd
165           vdu-id: dataVM
166           cpd: vnf-data
167   
168     df:
169       - id: hackfest_default
170         vdu-profile:
171           - id: mgmtVM
172             min-number-of-instances: 1
173           - id: dataVM
174             min-number-of-instances: 1
175             max-number-of-instances: 10
176         instantiation-level:
177           - id: default
178             vdu-level:
179               - vdu-id: mgmtVM
180                 number-of-instances: 1
181               - vdu-id: dataVM
182                 number-of-instances: 1
183         scaling-aspect:
184           - id: scale_dataVM
185             name: scale_dataVM
186             max-scale-level: 10
187             aspect-delta-details:
188               deltas:
189                 - id: delta1
190                   vdu-delta:
191                     - id: vdudelta1
192                       number-of-instances: 1
193             scaling-policy:
194               - name: auto_cpu_util_above_threshold
195                 scaling-type: automatic
196                 enabled: true
197                 threshold-time: 0
198                 cooldown-time: 60
199                 scaling-criteria:
200                   - name: cpu_util_above_threshold
201                     scale-in-relational-operation: LE
202                     scale-in-threshold: '15.0000000000'
203                     scale-out-relational-operation: GE
204                     scale-out-threshold: '60.0000000000'
205                     vnf-monitoring-param-ref: dataVM_cpu_util
206             scaling-config-action:
207               - trigger: post-scale-out
208                 vnf-config-primitive-name-ref: touch
209               - trigger: pre-scale-in
210                 vnf-config-primitive-name-ref: touch
211         lcm-operations-configuration:
212           operate-vnf-op-config:
213             day1-2:
214             - id: hackfest3charmed-vnf
215               execution-environment-list:
216                 - id: simple-ee
217                   juju:
218                     charm: simple
219               initial-config-primitive:
220                 - seq: "1"
221                   execution-environment-ref: simple-ee
222                   name: config
223                   parameter:
224                     - name: ssh-hostname
225                       value: <rw_mgmt_ip>
226                     - name: ssh-username
227                       value: ubuntu
228                     - name: ssh-password
229                       value: osm4u
230                 - seq: "2"
231                   execution-environment-ref: simple-ee
232                   name: touch
233                   parameter:
234                     - name: filename
235                       value: <touch_filename>
236               config-primitive:
237                 - name: touch
238                   execution-environment-ref: simple-ee
239                   parameter:
240                     - data-type: STRING
241                       default-value: <touch_filename2>
242                       name: filename
243 """
244
245 1 db_nsds_text = """
246 ---
247 -   _admin:
248         created: 1566823353.971486
249         modified: 1566823353.971486
250         onboardingState: ONBOARDED
251         operationalState: ENABLED
252         projects_read:
253         - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
254         projects_write:
255         - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
256         storage:
257             descriptor: hackfest_3charmed_nsd/hackfest_3charmed_nsd.yaml
258             folder: 8c2f8b95-bb1b-47ee-8001-36dc090678da
259             fs: local
260             path: /app/storage/
261             pkg-dir: hackfest_3charmed_nsd
262             zipfile: package.tar.gz
263         usageState: NOT_IN_USE
264         userDefinedData: {}
265     _id: 8c2f8b95-bb1b-47ee-8001-36dc090678da
266     id: hackfest3charmed-ns
267     name: hackfest3charmed-ns
268     description: NS with 2 VNFs hackfest3charmed-vnf connected by datanet and mgmtnet VLs
269     designer: OSM
270     version: '1.0'
271
272     vnfd-id:
273       - hackfest3charmed-vnf
274
275     virtual-link-desc:
276       - id: mgmt
277         mgmt-network: "true"
278       - id: datanet
279         mgmt-network: "false"
280
281     df:
282       - id: hackfest_charmed_DF
283         vnf-profile:
284           - id: hackfest_vnf1 # member-vnf-index-ref: 1
285             vnfd-id: hackfest3charmed-vnf
286             virtual-link-connectivity:
287               - virtual-link-profile-id: mgmt
288                 constituent-cpd-id:
289                   - constituent-base-element-id: hackfest_vnf1
290                     constituent-cpd-id: vnf-mgmt-ext
291               - virtual-link-profile-id: datanet
292                 constituent-cpd-id:
293                   - constituent-base-element-id: hackfest_vnf1
294                     constituent-cpd-id: vnf-data-ext
295           - id: hackfest_vnf2 # member-vnf-index-ref: 2
296             vnfd-id: hackfest3charmed-vnf
297             virtual-link-connectivity:
298               - virtual-link-profile-id: mgmt
299                 constituent-cpd-id:
300                   - constituent-base-element-id: hackfest_vnf2
301                     constituent-cpd-id: vnf-mgmt-ext
302               - virtual-link-profile-id: datanet
303                 constituent-cpd-id:
304                   - constituent-base-element-id: hackfest_vnf2
305                     constituent-cpd-id: vnf-data-ext
306 """
307
308 1 db_nsrs_text = """
309 ---
310 -   _admin:
311         created: 1566823354.3716335
312         modified: 1566823354.3716335
313         nsState: NOT_INSTANTIATED
314         nslcmop: null
315         projects_read:
316         - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
317         projects_write:
318         - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
319     _id: f48163a6-c807-47bc-9682-f72caef5af85
320     additionalParamsForNs: null
321     admin-status: ENABLED
322     config-status: init
323     constituent-vnfr-ref:
324     - 88d90b0c-faff-4b9f-bccd-017f33985984
325     - 1ca3bb1a-b29b-49fe-bed6-5f3076d77434
326     create-time: 1566823354.36234
327     datacenter: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
328     description: default description
329     detailed-status: 'ERROR executing proxy charm initial primitives for member_vnf_index=1
330         vdu_id=None: charm error executing primitive verify-ssh-credentials for member_vnf_index=1
331         vdu_id=None: ''timeout after 600 seconds'''
332     id: f48163a6-c807-47bc-9682-f72caef5af85
333     instantiate_params:
334         nsDescription: default description
335         nsName: ALF
336         nsdId: 8c2f8b95-bb1b-47ee-8001-36dc090678da
337         vimAccountId: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
338     name: ALF
339     name-ref: ALF
340     ns-instance-config-ref: f48163a6-c807-47bc-9682-f72caef5af85
341     nsd:
342         _admin:
343             created: 1566823353.971486
344             modified: 1566823353.971486
345             onboardingState: ONBOARDED
346             operationalState: ENABLED
347             projects_read:
348             - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
349             projects_write:
350             - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
351             storage:
352                 descriptor: hackfest_3charmed_nsd/hackfest_3charmed_nsd.yaml
353                 folder: 8c2f8b95-bb1b-47ee-8001-36dc090678da
354                 fs: local
355                 path: /app/storage/
356                 pkg-dir: hackfest_3charmed_nsd
357                 zipfile: package.tar.gz
358             usageState: NOT_IN_USE
359             userDefinedData: {}
360         _id: 8c2f8b95-bb1b-47ee-8001-36dc090678da
361         id: hackfest3charmed-ns
362         name: hackfest3charmed-ns
363         description: NS with 2 VNFs hackfest3charmed-vnf connected by datanet and mgmtnet VLs
364         designer: OSM
365         version: '1.0'
366
367         vnfd-id:
368           - hackfest3charmed-vnf
369
370         virtual-link-desc:
371           - id: mgmt
372             mgmt-network: "true"
373           - id: datanet
374             mgmt-network: "false"
375
376         df:
377           - id: hackfest_charmed_DF
378             vnf-profile:
379               - id: hackfest_vnf1 # member-vnf-index-ref: 1
380                 vnfd-id: hackfest3charmed-vnf
381                 virtual-link-connectivity:
382                   - virtual-link-profile-id: mgmt
383                     constituent-cpd-id:
384                       - constituent-base-element-id: hackfest_vnf1
385                         constituent-cpd-id: vnf-mgmt-ext
386                   - virtual-link-profile-id: datanet
387                     constituent-cpd-id:
388                       - constituent-base-element-id: hackfest_vnf1
389                         constituent-cpd-id: vnf-data-ext
390               - id: hackfest_vnf2 # member-vnf-index-ref: 2
391                 vnfd-id: hackfest3charmed-vnf
392                 virtual-link-connectivity:
393                   - virtual-link-profile-id: mgmt
394                     constituent-cpd-id:
395                       - constituent-base-element-id: hackfest_vnf2
396                         constituent-cpd-id: vnf-mgmt-ext
397                   - virtual-link-profile-id: datanet
398                     constituent-cpd-id:
399                       - constituent-base-element-id: hackfest_vnf2
400                         constituent-cpd-id: vnf-data-ext
401     nsd-id: 8c2f8b95-bb1b-47ee-8001-36dc090678da
402     nsd-name-ref: hackfest3charmed-ns
403     nsd-ref: hackfest3charmed-ns
404     operational-events: []
405     operational-status: failed
406     orchestration-progress: {}
407     resource-orchestrator: osmopenmano
408     short-name: ALF
409     ssh-authorized-key: null
410     vld:
411     -   id: mgmt
412         name: null
413         status: ACTIVE
414         status-detailed: null
415         vim-id: f99ae780-0e2f-4985-af41-574eae6919c0
416         vim-network-name: mgmt
417     -   id: datanet
418         name: ALF-datanet
419         status: ACTIVE
420         status-detailed: null
421         vim-id: c31364ba-f573-4ab6-bf1a-fed30ede39a8
422     vnfd-id:
423     - 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77
424 """
425
426 1 db_nslcmops_text = """
427 ---
428 -   _admin:
429         created: 1566823354.4148262
430         modified: 1566823354.4148262
431         projects_read:
432         - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
433         projects_write:
434         - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
435         worker: 86434c2948e2
436     _id: a639fac7-e0bb-4225-8ecb-c1f8efcc125e
437     detailed-status: 'FAILED executing proxy charm initial primitives for member_vnf_index=1
438         vdu_id=None: charm error executing primitive verify-ssh-credentials for member_vnf_index=1
439         vdu_id=None: ''timeout after 600 seconds'''
440     id: a639fac7-e0bb-4225-8ecb-c1f8efcc125e
441     isAutomaticInvocation: false
442     isCancelPending: false
443     lcmOperationType: instantiate
444     links:
445         nsInstance: /osm/nslcm/v1/ns_instances/f48163a6-c807-47bc-9682-f72caef5af85
446         self: /osm/nslcm/v1/ns_lcm_op_occs/a639fac7-e0bb-4225-8ecb-c1f8efcc125e
447     nsInstanceId: f48163a6-c807-47bc-9682-f72caef5af85
448     operationParams:
449         additionalParamsForVnf:
450         -   additionalParams:
451                 touch_filename: /home/ubuntu/first-touch-1
452                 touch_filename2: /home/ubuntu/second-touch-1
453             member-vnf-index: '1'
454         -   additionalParams:
455                 touch_filename: /home/ubuntu/first-touch-2
456                 touch_filename2: /home/ubuntu/second-touch-2
457             member-vnf-index: '2'
458         lcmOperationType: instantiate
459         nsDescription: default description
460         nsInstanceId: f48163a6-c807-47bc-9682-f72caef5af85
461         nsName: ALF
462         nsdId: 8c2f8b95-bb1b-47ee-8001-36dc090678da
463         vimAccountId: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
464     operationState: FAILED
465     startTime: 1566823354.414689
466     statusEnteredTime: 1566824534.5112448
467 """
468
469 1 db_vnfrs_text = """
470 ---
471 -   _admin:
472         created: 1566823354.3668208
473         modified: 1566823354.3668208
474         nsState: NOT_INSTANTIATED
475         projects_read:
476         - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
477         projects_write:
478         - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
479     _id: 88d90b0c-faff-4b9f-bccd-017f33985984
480     additionalParamsForVnf:
481         touch_filename: /home/ubuntu/first-touch-1
482         touch_filename2: /home/ubuntu/second-touch-1
483     connection-point:
484     -   connection-point-id: vnf-mgmt
485         id: vnf-mgmt
486         name: vnf-mgmt
487     -   connection-point-id: vnf-data
488         id: vnf-data
489         name: vnf-data
490     created-time: 1566823354.36234
491     id: 88d90b0c-faff-4b9f-bccd-017f33985984
492     ip-address: 10.205.1.46
493     member-vnf-index-ref: '1'
494     nsr-id-ref: f48163a6-c807-47bc-9682-f72caef5af85
495     vdur:
496     -   _id: f0e7d7ce-2443-4dcb-ad0b-5ab9f3b13d37
497         count-index: 0
498         interfaces:
499         -   ip-address: 10.205.1.46
500             mac-address: fa:16:3e:b4:3e:b1
501             mgmt-vnf: true
502             name: mgmtVM-eth0
503             ns-vld-id: mgmt
504             position: 1
505         -   ip-address: 192.168.54.2
506             mac-address: fa:16:3e:6e:7e:78
507             name: mgmtVM-eth1
508             vnf-vld-id: internal
509             position: 2
510         internal-connection-point:
511         -   connection-point-id: mgmtVM-internal
512             id: mgmtVM-internal
513             name: mgmtVM-internal
514         ip-address: 10.205.1.46
515         name: ALF-1-mgmtVM-1
516         status: ACTIVE
517         status-detailed: null
518         vdu-id-ref: mgmtVM
519         vim-id: c2538499-4c30-41c0-acd5-80cb92f48061
520     -   _id: ab453219-2d9a-45c2-864d-2c0788385028
521         count-index: 0
522         interfaces:
523         -   ip-address: 192.168.54.3
524             mac-address: fa:16:3e:d9:7a:5d
525             name: dataVM-eth0
526             vnf-vld-id: internal
527         -   ip-address: 192.168.24.3
528             mac-address: fa:16:3e:d1:6c:0d
529             name: dataVM-xe0
530             ns-vld-id: datanet
531         internal-connection-point:
532         -   connection-point-id: dataVM-internal
533             id: dataVM-internal
534             name: dataVM-internal
535         ip-address: null
536         name: ALF-1-dataVM-1
537         status: ACTIVE
538         status-detailed: null
539         vdu-id-ref: dataVM
540         vim-id: 87973c3f-365d-4227-95c2-7a8abc74349c
541     vim-account-id: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
542     vld:
543     -   id: internal
544         name: ALF-internal
545         status: ACTIVE
546         status-detailed: null
547         vim-id: ff181e6d-2597-4244-b40b-bb0174bdfeb6
548     vnfd-id: 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77
549     vnfd-ref: hackfest3charmed-vnf
550 -   _admin:
551         created: 1566823354.3703845
552         modified: 1566823354.3703845
553         nsState: NOT_INSTANTIATED
554         projects_read:
555         - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
556         projects_write:
557         - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
558     _id: 1ca3bb1a-b29b-49fe-bed6-5f3076d77434
559     additionalParamsForVnf:
560         touch_filename: /home/ubuntu/first-touch-2
561         touch_filename2: /home/ubuntu/second-touch-2
562     connection-point:
563     -   connection-point-id: vnf-mgmt
564         id: vnf-mgmt
565         name: vnf-mgmt
566     -   connection-point-id: vnf-data
567         id: vnf-data
568         name: vnf-data
569     created-time: 1566823354.36234
570     id: 1ca3bb1a-b29b-49fe-bed6-5f3076d77434
571     ip-address: 10.205.1.47
572     member-vnf-index-ref: '2'
573     nsr-id-ref: f48163a6-c807-47bc-9682-f72caef5af85
574     vdur:
575     -   _id: 190b4a2c-4f85-4cfe-9406-4cef7ffb1e67
576         count-index: 0
577         interfaces:
578         -   ip-address: 10.205.1.47
579             mac-address: fa:16:3e:cb:9f:c7
580             mgmt-vnf: true
581             name: mgmtVM-eth0
582             ns-vld-id: mgmt
583         -   ip-address: 192.168.231.1
584             mac-address: fa:16:3e:1a:89:24
585             name: mgmtVM-eth1
586             vnf-vld-id: internal
587         internal-connection-point:
588         -   connection-point-id: mgmtVM-internal
589             id: mgmtVM-internal
590             name: mgmtVM-internal
591         ip-address: 10.205.1.47
592         name: ALF-2-mgmtVM-1
593         status: ACTIVE
594         status-detailed: null
595         vdu-id-ref: mgmtVM
596         vim-id: 248077b2-e3b8-4a37-8b72-575abb8ed912
597     -   _id: 889b874d-e1c3-4e75-aa45-53a9b0ddabd9
598         count-index: 0
599         interfaces:
600         -   ip-address: 192.168.231.3
601             mac-address: fa:16:3e:7e:ba:8c
602             name: dataVM-eth0
603             vnf-vld-id: internal
604         -   ip-address: 192.168.24.4
605             mac-address: fa:16:3e:d2:e1:f5
606             name: dataVM-xe0
607             ns-vld-id: datanet
608         internal-connection-point:
609         -   connection-point-id: dataVM-internal
610             id: dataVM-internal
611             name: dataVM-internal
612         ip-address: null
613         name: ALF-2-dataVM-1
614         status: ACTIVE
615         status-detailed: null
616         vdu-id-ref: dataVM
617         vim-id: a4ce4372-e0ad-4ae3-8f9f-1c969f32e77b
618     vim-account-id: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
619     vld:
620     -   id: internal
621         name: ALF-internal
622         status: ACTIVE
623         status-detailed: null
624         vim-id: ff181e6d-2597-4244-b40b-bb0174bdfeb6
625     vnfd-id: 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77
626     vnfd-ref: hackfest3charmed-vnf
627 """
628
629 1 db_vnfm_vnfd_text = """
630 ---
631 -   _admin:
632         created: 1647529096.3635302
633         modified: 1650456936.518325
634         onboardingState: ONBOARDED
635         operationalState: ENABLED
636         projects_read:
637         - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
638         projects_write:
639         - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
640         storage:
641             descriptor: hackfest_basic_metrics_vnf/hackfest_basic_metrics_vnfd.yaml
642             folder: 70b47595-fafa-4f63-904b-fc3ada60eebb
643             fs: mongo
644             path: /app/storage/
645             pkg-dir: hackfest_basic_metrics_vnf
646             zipfile: package.tar.gz
647         type: vnfd
648         usageState: NOT_IN_USE
649         userDefinedData: {}
650     _id: 70b47595-fafa-4f63-904b-fc3ada60eebb
651     _links:
652         packageContent:
653             href: /vnfpkgm/v1/vnf_packages/70b47595-fafa-4f63-904b-fc3ada60eebb/package_content
654         self:
655             href: /vnfpkgm/v1/vnf_packages/70b47595-fafa-4f63-904b-fc3ada60eebb
656         vnfd:
657             href: /vnfpkgm/v1/vnf_packages/70b47595-fafa-4f63-904b-fc3ada60eebb/vnfd
658     description: A basic VNF descriptor with one VDU and VIM metrics
659     df:
660     -   id: default-df
661         instantiation-level:
662         -   id: default-instantiation-level
663             vdu-level:
664             -   number-of-instances: 1
665                 vdu-id: hackfest_basic_metrics-VM
666         scaling-aspect:
667         -   aspect-delta-details:
668                 deltas:
669                 -   id: vdu_autoscale-delta
670                     vdu-delta:
671                     -   id: hackfest_basic_metrics-VM
672                         number-of-instances: 1
673             id: vdu_autoscale
674             max-scale-level: 1
675             name: vdu_autoscale
676             scaling-policy:
677             -   cooldown-time: 120
678                 name: cpu_util_above_threshold
679                 scaling-criteria:
680                 -   name: cpu_util_above_threshold
681                     scale-in-relational-operation: LT
682                     scale-in-threshold: '10.0000000000'
683                     scale-out-relational-operation: GT
684                     scale-out-threshold: '60.0000000000'
685                     vnf-monitoring-param-ref: vnf_cpu_util
686                 scaling-type: automatic
687                 threshold-time: 10
688         vdu-profile:
689         -   id: hackfest_basic_metrics-VM
690             max-number-of-instances: 2
691             min-number-of-instances: 1
692     ext-cpd:
693     -   id: vnf-cp0-ext
694         int-cpd:
695             cpd: vdu-eth0-int
696             vdu-id: hackfest_basic_metrics-VM
697     id: hackfest_basic_metrics-vnf
698     mgmt-cp: vnf-cp0-ext
699     onboardingState: ONBOARDED
700     operationalState: ENABLED
701     product-name: hackfest_basic_metrics-vnf
702     sw-image-desc:
703     -   id: bionic
704         image: bionic
705         name: bionic
706     -   id: ubuntu18.04-aws
707         image: ubuntu/images/hvm-ssd/ubuntu-artful-17.10-amd64-server-20180509
708         name: ubuntu18.04-aws
709         vim-type: aws
710     -   id: ubuntu18.04-azure
711         image: Canonical:UbuntuServer:18.04-LTS:latest
712         name: ubuntu18.04-azure
713         vim-type: azure
714     -   id: ubuntu18.04-gcp
715         image: ubuntu-os-cloud:image-family:ubuntu-1804-lts
716         name: ubuntu18.04-gcp
717         vim-type: gcp
718     usageState: NOT_IN_USE
719     vdu:
720     -   alarm:
721         -   actions:
722                 alarm:
723                 -   url: https://webhook.site/b79f9bf9-4c19-429d-81ed-19be26a3d5d8
724                 insufficient-data:
725                 -   url: https://webhook.site/b79f9bf9-4c19-429d-81ed-19be26a3d5d8
726                 ok:
727                 -   url: https://webhook.site/b79f9bf9-4c19-429d-81ed-19be26a3d5d8
728             alarm-id: alarm-1
729             operation: LT
730             value: '20.0000'
731             vnf-monitoring-param-ref: vnf_cpu_util
732         alternative-sw-image-desc:
733         - ubuntu18.04-aws
734         - ubuntu18.04-azure
735         - ubuntu18.04-gcp
736         cloud-init-file: cloud-config
737         id: hackfest_basic_metrics-VM
738         int-cpd:
739         -   id: vdu-eth0-int
740             virtual-network-interface-requirement:
741             -   name: vdu-eth0
742                 virtual-interface:
743                     type: PARAVIRT
744         monitoring-parameter:
745         -   id: vnf_cpu_util
746             name: vnf_cpu_util
747             performance-metric: cpu_utilization
748         -   id: vnf_memory_util
749             name: vnf_memory_util
750             performance-metric: average_memory_utilization
751         -   id: vnf_packets_sent
752             name: vnf_packets_sent
753             performance-metric: packets_sent
754         -   id: vnf_packets_received
755             name: vnf_packets_received
756             performance-metric: packets_received
757         name: hackfest_basic_metrics-VM
758         sw-image-desc: bionic
759         virtual-compute-desc: hackfest_basic_metrics-VM-compute
760         virtual-storage-desc:
761         - hackfest_basic_metrics-VM-storage
762     version: '1.0'
763     virtual-compute-desc:
764     -   id: hackfest_basic_metrics-VM-compute
765         virtual-cpu:
766             num-virtual-cpu: 1
767         virtual-memory:
768             size: 1.0
769     virtual-storage-desc:
770     -   id: hackfest_basic_metrics-VM-storage
771         size-of-storage: '10'
772 """