fix(model): adaptations to allow new configuration containers
[osm/NBI.git] / osm_nbi / tests / test_pkg_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 __author__ = "Pedro de la Cruz Ramos, pedro.delacruzramos@altran.com"
21 __date__ = "2019-11-20"
22
23 db_vnfds_text = """
24 ---
25 - _admin:
26 created: 1566823352.7154346
27 modified: 1566823352.7154346
28 onboardingState: ONBOARDED
29 operationalState: ENABLED
30 projects_read:
31 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
32 projects_write:
33 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
34 storage:
35 descriptor: hackfest_3charmed_vnfd/hackfest_3charmed_vnfd.yaml
36 folder: 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77
37 fs: local
38 path: /app/storage/
39 pkg-dir: hackfest_3charmed_vnfd
40 zipfile: package.tar.gz
41 type: vnfd
42 usageState: NOT_IN_USE
43 userDefinedData: {}
44 _id: 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77
45 id: hackfest3charmed-vnf
46 description: >-
47 A VNF consisting of 2 VDUs connected to an internal VL, and one VDU with
48 cloud-init
49 product-name: hackfest3charmed-vnf
50 version: '1.0'
51 mgmt-cp: vnf-mgmt-ext
52
53 virtual-compute-desc:
54 - id: mgmt-compute
55 virtual-cpu:
56 num-virtual-cpu: 2
57 virtual-memory:
58 size: '2'
59 - id: data-compute
60 virtual-cpu:
61 num-virtual-cpu: 2
62 virtual-memory:
63 size: '2'
64
65 virtual-storage-desc:
66 - id: mgmt-storage
67 size-of-storage: '20'
68 - id: data-storage
69 size-of-storage: '20'
70
71 sw-image-desc:
72 - id: hackfest3-mgmt
73 name: hackfest3-mgmt
74
75 vdu:
76 - id: mgmtVM
77 name: mgmtVM
78 cloud-init-file: cloud-config.txt
79 sw-image-desc: hackfest3-mgmt
80 virtual-compute-desc: mgmt-compute
81 virtual-storage-desc:
82 - mgmt-storage
83 int-cpd:
84 - id: vnf-mgmt
85 virtual-network-interface-requirement:
86 - name: mgmtVM-eth0
87 position: 1
88 virtual-interface:
89 type: VIRTIO
90 - id: mgmtVM-internal
91 int-virtual-link-desc: internal
92 virtual-network-interface-requirement:
93 - name: mgmtVM-eth1
94 position: 2
95 virtual-interface:
96 type: VIRTIO
97 - id: dataVM
98 name: dataVM
99 sw-image-desc: hackfest3-mgmt
100 virtual-compute-desc: data-compute
101 virtual-storage-desc:
102 - data-storage
103 int-cpd:
104 - id: dataVM-internal
105 int-virtual-link-desc: internal
106 virtual-network-interface-requirement:
107 - name: dataVM-eth1
108 position: 1
109 virtual-interface:
110 type: VIRTIO
111 - id: vnf-data
112 virtual-network-interface-requirement:
113 - name: dataVM-eth0
114 position: 2
115 virtual-interface:
116 type: VIRTIO
117 monitoring-parameter:
118 - id: dataVM_cpu_util
119 name: dataVM_cpu_util
120 performance-metric: cpu_utilization
121
122 int-virtual-link-desc:
123 - id: internal
124
125 ext-cpd:
126 - id: vnf-mgmt-ext
127 int-cpd: # Connection to int-cpd
128 vdu-id: mgmtVM
129 cpd: vnf-mgmt
130 - id: vnf-data-ext
131 int-cpd: # Connection to int-cpd
132 vdu-id: dataVM
133 cpd: vnf-data
134
135 df:
136 - id: hackfest_default
137 vdu-profile:
138 - id: mgmtVM
139 min-number-of-instances: 1
140 - id: dataVM
141 min-number-of-instances: 1
142 max-number-of-instances: 10
143 instantiation-level:
144 - id: default
145 vdu-level:
146 - vdu-id: mgmtVM
147 number-of-instances: 1
148 - vdu-id: dataVM
149 number-of-instances: 1
150 scaling-aspect:
151 - id: scale_dataVM
152 name: scale_dataVM
153 max-scale-level: 10
154 aspect-delta-details:
155 deltas:
156 - id: delta1
157 vdu-delta:
158 - id: vdudelta1
159 number-of-instances: 1
160 scaling-policy:
161 - name: auto_cpu_util_above_threshold
162 scaling-type: automatic
163 enabled: true
164 threshold-time: 0
165 cooldown-time: 60
166 scaling-criteria:
167 - name: cpu_util_above_threshold
168 scale-in-relational-operation: LE
169 scale-in-threshold: '15.0000000000'
170 scale-out-relational-operation: GE
171 scale-out-threshold: '60.0000000000'
172 vnf-monitoring-param-ref: dataVM_cpu_util
173 scaling-config-action:
174 - trigger: post-scale-out
175 vnf-config-primitive-name-ref: touch
176 - trigger: pre-scale-in
177 vnf-config-primitive-name-ref: touch
178 lcm-operations-configuration:
179 operate-vnf-op-config:
180 day1-2:
181 - id: hackfest3charmed-vnf
182 initial-config-primitive:
183 - seq: "1"
184 name: config
185 parameter:
186 - name: ssh-hostname
187 value: <rw_mgmt_ip>
188 - name: ssh-username
189 value: ubuntu
190 - name: ssh-password
191 value: osm4u
192 - seq: "2"
193 name: touch
194 parameter:
195 - name: filename
196 value: <touch_filename>
197 config-primitive:
198 - name: touch
199 parameter:
200 - data-type: STRING
201 default-value: <touch_filename2>
202 name: filename
203 juju:
204 charm: simple
205 """
206
207 db_nsds_text = """
208 ---
209 - _admin:
210 created: 1566823353.971486
211 modified: 1566823353.971486
212 onboardingState: ONBOARDED
213 operationalState: ENABLED
214 projects_read:
215 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
216 projects_write:
217 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
218 storage:
219 descriptor: hackfest_3charmed_nsd/hackfest_3charmed_nsd.yaml
220 folder: 8c2f8b95-bb1b-47ee-8001-36dc090678da
221 fs: local
222 path: /app/storage/
223 pkg-dir: hackfest_3charmed_nsd
224 zipfile: package.tar.gz
225 usageState: NOT_IN_USE
226 userDefinedData: {}
227 _id: 8c2f8b95-bb1b-47ee-8001-36dc090678da
228 id: hackfest3charmed-ns
229 name: hackfest3charmed-ns
230 description: NS with 2 VNFs hackfest3charmed-vnf connected by datanet and mgmtnet VLs
231 designer: OSM
232 version: '1.0'
233
234 vnfd-id:
235 - hackfest3charmed-vnf
236
237 virtual-link-desc:
238 - id: mgmt
239 mgmt-network: true
240 - id: datanet
241 mgmt-network: false
242
243 df:
244 - id: hackfest_charmed_DF
245 vnf-profile:
246 - id: hackfest_vnf1 # member-vnf-index-ref: 1
247 vnfd-id: hackfest3charmed-vnf
248 virtual-link-connectivity:
249 - virtual-link-profile-id: mgmt
250 constituent-cpd-id:
251 - constituent-base-element-id: hackfest_vnf1
252 constituent-cpd-id: vnf-mgmt-ext
253 - virtual-link-profile-id: datanet
254 constituent-cpd-id:
255 - constituent-base-element-id: hackfest_vnf1
256 constituent-cpd-id: vnf-data-ext
257 - id: hackfest_vnf2 # member-vnf-index-ref: 2
258 vnfd-id: hackfest3charmed-vnf
259 virtual-link-connectivity:
260 - virtual-link-profile-id: mgmt
261 constituent-cpd-id:
262 - constituent-base-element-id: hackfest_vnf2
263 constituent-cpd-id: vnf-mgmt-ext
264 - virtual-link-profile-id: datanet
265 constituent-cpd-id:
266 - constituent-base-element-id: hackfest_vnf2
267 constituent-cpd-id: vnf-data-ext
268 """