Reverted kdur creation following the kdu modeling before SOL006
[osm/NBI.git] / 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 """Contains database content needed for tests"""
19
20
21 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 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 vnf-configuration-id: vnf-configuration-example
171 vdu-profile:
172 - id: mgmtVM
173 min-number-of-instances: 1
174 - id: dataVM
175 min-number-of-instances: 1
176 max-number-of-instances: 10
177 vdu-configuration-id: vdu-configuration-example
178 instantiation-level:
179 - id: default
180 vdu-level:
181 - vdu-id: mgmtVM
182 number-of-instances: 1
183 - vdu-id: dataVM
184 number-of-instances: 1
185 scaling-aspect:
186 - id: scale_dataVM
187 name: scale_dataVM
188 max-scale-level: 10
189 aspect-delta-details:
190 deltas:
191 - id: delta1
192 vdu-delta:
193 - id: vdudelta1
194 number-of-instances: 1
195 scaling-policy:
196 - name: auto_cpu_util_above_threshold
197 scaling-type: automatic
198 enabled: true
199 threshold-time: 0
200 cooldown-time: 60
201 scaling-criteria:
202 - name: cpu_util_above_threshold
203 scale-in-relational-operation: LE
204 scale-in-threshold: '15.0000000000'
205 scale-out-relational-operation: GE
206 scale-out-threshold: '60.0000000000'
207 vnf-monitoring-param-ref: dataVM_cpu_util
208 scaling-config-action:
209 - trigger: post-scale-out
210 vnf-config-primitive-name-ref: touch
211 - trigger: pre-scale-in
212 vnf-config-primitive-name-ref: touch
213
214 vnf-configuration:
215 - id: vnf-configuration-example
216 initial-config-primitive:
217 - seq: "1"
218 name: config
219 parameter:
220 - name: ssh-hostname
221 value: <rw_mgmt_ip>
222 - name: ssh-username
223 value: ubuntu
224 - name: ssh-password
225 value: osm4u
226 - seq: "2"
227 name: touch
228 parameter:
229 - name: filename
230 value: <touch_filename>
231 config-primitive:
232 - name: touch
233 parameter:
234 - data-type: STRING
235 default-value: <touch_filename2>
236 name: filename
237 juju:
238 charm: simple
239 """
240
241 db_nsds_text = """
242 ---
243 - _admin:
244 created: 1566823353.971486
245 modified: 1566823353.971486
246 onboardingState: ONBOARDED
247 operationalState: ENABLED
248 projects_read:
249 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
250 projects_write:
251 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
252 storage:
253 descriptor: hackfest_3charmed_nsd/hackfest_3charmed_nsd.yaml
254 folder: 8c2f8b95-bb1b-47ee-8001-36dc090678da
255 fs: local
256 path: /app/storage/
257 pkg-dir: hackfest_3charmed_nsd
258 zipfile: package.tar.gz
259 usageState: NOT_IN_USE
260 userDefinedData: {}
261 _id: 8c2f8b95-bb1b-47ee-8001-36dc090678da
262 id: hackfest3charmed-ns
263 name: hackfest3charmed-ns
264 description: NS with 2 VNFs hackfest3charmed-vnf connected by datanet and mgmtnet VLs
265 designer: OSM
266 version: '1.0'
267
268 vnfd-id:
269 - hackfest3charmed-vnf
270
271 virtual-link-desc:
272 - id: mgmt
273 mgmt-network: "true"
274 - id: datanet
275 mgmt-network: "false"
276
277 df:
278 - id: hackfest_charmed_DF
279 vnf-profile:
280 - id: hackfest_vnf1 # member-vnf-index-ref: 1
281 vnfd-id: hackfest3charmed-vnf
282 virtual-link-connectivity:
283 - virtual-link-profile-id: mgmt
284 constituent-cpd-id:
285 - constituent-base-element-id: hackfest_vnf1
286 constituent-cpd-id: vnf-mgmt-ext
287 - virtual-link-profile-id: datanet
288 constituent-cpd-id:
289 - constituent-base-element-id: hackfest_vnf1
290 constituent-cpd-id: vnf-data-ext
291 - id: hackfest_vnf2 # member-vnf-index-ref: 2
292 vnfd-id: hackfest3charmed-vnf
293 virtual-link-connectivity:
294 - virtual-link-profile-id: mgmt
295 constituent-cpd-id:
296 - constituent-base-element-id: hackfest_vnf2
297 constituent-cpd-id: vnf-mgmt-ext
298 - virtual-link-profile-id: datanet
299 constituent-cpd-id:
300 - constituent-base-element-id: hackfest_vnf2
301 constituent-cpd-id: vnf-data-ext
302 """
303
304 db_nsrs_text = """
305 ---
306 - _admin:
307 created: 1566823354.3716335
308 modified: 1566823354.3716335
309 nsState: NOT_INSTANTIATED
310 nslcmop: null
311 projects_read:
312 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
313 projects_write:
314 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
315 _id: f48163a6-c807-47bc-9682-f72caef5af85
316 additionalParamsForNs: null
317 admin-status: ENABLED
318 config-status: init
319 constituent-vnfr-ref:
320 - 88d90b0c-faff-4b9f-bccd-017f33985984
321 - 1ca3bb1a-b29b-49fe-bed6-5f3076d77434
322 create-time: 1566823354.36234
323 datacenter: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
324 description: default description
325 detailed-status: 'ERROR executing proxy charm initial primitives for member_vnf_index=1
326 vdu_id=None: charm error executing primitive verify-ssh-credentials for member_vnf_index=1
327 vdu_id=None: ''timeout after 600 seconds'''
328 id: f48163a6-c807-47bc-9682-f72caef5af85
329 instantiate_params:
330 nsDescription: default description
331 nsName: ALF
332 nsdId: 8c2f8b95-bb1b-47ee-8001-36dc090678da
333 vimAccountId: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
334 name: ALF
335 name-ref: ALF
336 ns-instance-config-ref: f48163a6-c807-47bc-9682-f72caef5af85
337 nsd:
338 _admin:
339 created: 1566823353.971486
340 modified: 1566823353.971486
341 onboardingState: ONBOARDED
342 operationalState: ENABLED
343 projects_read:
344 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
345 projects_write:
346 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
347 storage:
348 descriptor: hackfest_3charmed_nsd/hackfest_3charmed_nsd.yaml
349 folder: 8c2f8b95-bb1b-47ee-8001-36dc090678da
350 fs: local
351 path: /app/storage/
352 pkg-dir: hackfest_3charmed_nsd
353 zipfile: package.tar.gz
354 usageState: NOT_IN_USE
355 userDefinedData: {}
356 _id: 8c2f8b95-bb1b-47ee-8001-36dc090678da
357 id: hackfest3charmed-ns
358 name: hackfest3charmed-ns
359 description: NS with 2 VNFs hackfest3charmed-vnf connected by datanet and mgmtnet VLs
360 designer: OSM
361 version: '1.0'
362
363 vnfd-id:
364 - hackfest3charmed-vnf
365
366 virtual-link-desc:
367 - id: mgmt
368 mgmt-network: "true"
369 - id: datanet
370 mgmt-network: "false"
371
372 df:
373 - id: hackfest_charmed_DF
374 vnf-profile:
375 - id: hackfest_vnf1 # member-vnf-index-ref: 1
376 vnfd-id: hackfest3charmed-vnf
377 virtual-link-connectivity:
378 - virtual-link-profile-id: mgmt
379 constituent-cpd-id:
380 - constituent-base-element-id: hackfest_vnf1
381 constituent-cpd-id: vnf-mgmt-ext
382 - virtual-link-profile-id: datanet
383 constituent-cpd-id:
384 - constituent-base-element-id: hackfest_vnf1
385 constituent-cpd-id: vnf-data-ext
386 - id: hackfest_vnf2 # member-vnf-index-ref: 2
387 vnfd-id: hackfest3charmed-vnf
388 virtual-link-connectivity:
389 - virtual-link-profile-id: mgmt
390 constituent-cpd-id:
391 - constituent-base-element-id: hackfest_vnf2
392 constituent-cpd-id: vnf-mgmt-ext
393 - virtual-link-profile-id: datanet
394 constituent-cpd-id:
395 - constituent-base-element-id: hackfest_vnf2
396 constituent-cpd-id: vnf-data-ext
397 nsd-id: 8c2f8b95-bb1b-47ee-8001-36dc090678da
398 nsd-name-ref: hackfest3charmed-ns
399 nsd-ref: hackfest3charmed-ns
400 operational-events: []
401 operational-status: failed
402 orchestration-progress: {}
403 resource-orchestrator: osmopenmano
404 short-name: ALF
405 ssh-authorized-key: null
406 vld:
407 - id: mgmt
408 name: null
409 status: ACTIVE
410 status-detailed: null
411 vim-id: f99ae780-0e2f-4985-af41-574eae6919c0
412 vim-network-name: mgmt
413 - id: datanet
414 name: ALF-datanet
415 status: ACTIVE
416 status-detailed: null
417 vim-id: c31364ba-f573-4ab6-bf1a-fed30ede39a8
418 vnfd-id:
419 - 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77
420 """
421
422 db_nslcmops_text = """
423 ---
424 - _admin:
425 created: 1566823354.4148262
426 modified: 1566823354.4148262
427 projects_read:
428 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
429 projects_write:
430 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
431 worker: 86434c2948e2
432 _id: a639fac7-e0bb-4225-8ecb-c1f8efcc125e
433 detailed-status: 'FAILED executing proxy charm initial primitives for member_vnf_index=1
434 vdu_id=None: charm error executing primitive verify-ssh-credentials for member_vnf_index=1
435 vdu_id=None: ''timeout after 600 seconds'''
436 id: a639fac7-e0bb-4225-8ecb-c1f8efcc125e
437 isAutomaticInvocation: false
438 isCancelPending: false
439 lcmOperationType: instantiate
440 links:
441 nsInstance: /osm/nslcm/v1/ns_instances/f48163a6-c807-47bc-9682-f72caef5af85
442 self: /osm/nslcm/v1/ns_lcm_op_occs/a639fac7-e0bb-4225-8ecb-c1f8efcc125e
443 nsInstanceId: f48163a6-c807-47bc-9682-f72caef5af85
444 operationParams:
445 additionalParamsForVnf:
446 - additionalParams:
447 touch_filename: /home/ubuntu/first-touch-1
448 touch_filename2: /home/ubuntu/second-touch-1
449 member-vnf-index: '1'
450 - additionalParams:
451 touch_filename: /home/ubuntu/first-touch-2
452 touch_filename2: /home/ubuntu/second-touch-2
453 member-vnf-index: '2'
454 lcmOperationType: instantiate
455 nsDescription: default description
456 nsInstanceId: f48163a6-c807-47bc-9682-f72caef5af85
457 nsName: ALF
458 nsdId: 8c2f8b95-bb1b-47ee-8001-36dc090678da
459 vimAccountId: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
460 operationState: FAILED
461 startTime: 1566823354.414689
462 statusEnteredTime: 1566824534.5112448
463 """
464
465 db_vnfrs_text = """
466 ---
467 - _admin:
468 created: 1566823354.3668208
469 modified: 1566823354.3668208
470 nsState: NOT_INSTANTIATED
471 projects_read:
472 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
473 projects_write:
474 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
475 _id: 88d90b0c-faff-4b9f-bccd-017f33985984
476 additionalParamsForVnf:
477 touch_filename: /home/ubuntu/first-touch-1
478 touch_filename2: /home/ubuntu/second-touch-1
479 connection-point:
480 - connection-point-id: vnf-mgmt
481 id: vnf-mgmt
482 name: vnf-mgmt
483 - connection-point-id: vnf-data
484 id: vnf-data
485 name: vnf-data
486 created-time: 1566823354.36234
487 id: 88d90b0c-faff-4b9f-bccd-017f33985984
488 ip-address: 10.205.1.46
489 member-vnf-index-ref: '1'
490 nsr-id-ref: f48163a6-c807-47bc-9682-f72caef5af85
491 vdur:
492 - _id: f0e7d7ce-2443-4dcb-ad0b-5ab9f3b13d37
493 count-index: 0
494 interfaces:
495 - ip-address: 10.205.1.46
496 mac-address: fa:16:3e:b4:3e:b1
497 mgmt-vnf: true
498 name: mgmtVM-eth0
499 ns-vld-id: mgmt
500 - ip-address: 192.168.54.2
501 mac-address: fa:16:3e:6e:7e:78
502 name: mgmtVM-eth1
503 vnf-vld-id: internal
504 internal-connection-point:
505 - connection-point-id: mgmtVM-internal
506 id: mgmtVM-internal
507 name: mgmtVM-internal
508 ip-address: 10.205.1.46
509 name: ALF-1-mgmtVM-1
510 status: ACTIVE
511 status-detailed: null
512 vdu-id-ref: mgmtVM
513 vim-id: c2538499-4c30-41c0-acd5-80cb92f48061
514 - _id: ab453219-2d9a-45c2-864d-2c0788385028
515 count-index: 0
516 interfaces:
517 - ip-address: 192.168.54.3
518 mac-address: fa:16:3e:d9:7a:5d
519 name: dataVM-eth0
520 vnf-vld-id: internal
521 - ip-address: 192.168.24.3
522 mac-address: fa:16:3e:d1:6c:0d
523 name: dataVM-xe0
524 ns-vld-id: datanet
525 internal-connection-point:
526 - connection-point-id: dataVM-internal
527 id: dataVM-internal
528 name: dataVM-internal
529 ip-address: null
530 name: ALF-1-dataVM-1
531 status: ACTIVE
532 status-detailed: null
533 vdu-id-ref: dataVM
534 vim-id: 87973c3f-365d-4227-95c2-7a8abc74349c
535 vim-account-id: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
536 vld:
537 - id: internal
538 name: ALF-internal
539 status: ACTIVE
540 status-detailed: null
541 vim-id: ff181e6d-2597-4244-b40b-bb0174bdfeb6
542 vnfd-id: 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77
543 vnfd-ref: hackfest3charmed-vnf
544 - _admin:
545 created: 1566823354.3703845
546 modified: 1566823354.3703845
547 nsState: NOT_INSTANTIATED
548 projects_read:
549 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
550 projects_write:
551 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
552 _id: 1ca3bb1a-b29b-49fe-bed6-5f3076d77434
553 additionalParamsForVnf:
554 touch_filename: /home/ubuntu/first-touch-2
555 touch_filename2: /home/ubuntu/second-touch-2
556 connection-point:
557 - connection-point-id: vnf-mgmt
558 id: vnf-mgmt
559 name: vnf-mgmt
560 - connection-point-id: vnf-data
561 id: vnf-data
562 name: vnf-data
563 created-time: 1566823354.36234
564 id: 1ca3bb1a-b29b-49fe-bed6-5f3076d77434
565 ip-address: 10.205.1.47
566 member-vnf-index-ref: '2'
567 nsr-id-ref: f48163a6-c807-47bc-9682-f72caef5af85
568 vdur:
569 - _id: 190b4a2c-4f85-4cfe-9406-4cef7ffb1e67
570 count-index: 0
571 interfaces:
572 - ip-address: 10.205.1.47
573 mac-address: fa:16:3e:cb:9f:c7
574 mgmt-vnf: true
575 name: mgmtVM-eth0
576 ns-vld-id: mgmt
577 - ip-address: 192.168.231.1
578 mac-address: fa:16:3e:1a:89:24
579 name: mgmtVM-eth1
580 vnf-vld-id: internal
581 internal-connection-point:
582 - connection-point-id: mgmtVM-internal
583 id: mgmtVM-internal
584 name: mgmtVM-internal
585 ip-address: 10.205.1.47
586 name: ALF-2-mgmtVM-1
587 status: ACTIVE
588 status-detailed: null
589 vdu-id-ref: mgmtVM
590 vim-id: 248077b2-e3b8-4a37-8b72-575abb8ed912
591 - _id: 889b874d-e1c3-4e75-aa45-53a9b0ddabd9
592 count-index: 0
593 interfaces:
594 - ip-address: 192.168.231.3
595 mac-address: fa:16:3e:7e:ba:8c
596 name: dataVM-eth0
597 vnf-vld-id: internal
598 - ip-address: 192.168.24.4
599 mac-address: fa:16:3e:d2:e1:f5
600 name: dataVM-xe0
601 ns-vld-id: datanet
602 internal-connection-point:
603 - connection-point-id: dataVM-internal
604 id: dataVM-internal
605 name: dataVM-internal
606 ip-address: null
607 name: ALF-2-dataVM-1
608 status: ACTIVE
609 status-detailed: null
610 vdu-id-ref: dataVM
611 vim-id: a4ce4372-e0ad-4ae3-8f9f-1c969f32e77b
612 vim-account-id: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
613 vld:
614 - id: internal
615 name: ALF-internal
616 status: ACTIVE
617 status-detailed: null
618 vim-id: ff181e6d-2597-4244-b40b-bb0174bdfeb6
619 vnfd-id: 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77
620 vnfd-ref: hackfest3charmed-vnf
621 """