eb13e456d9e040e5a239d5b5d62dd99a040a90ac
[osm/LCM.git] / osm_lcm / tests / test_ns.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
19 import asynctest # pip3 install asynctest --user
20 import asyncio
21 import yaml
22 # import logging
23 from os import getenv
24 from osm_lcm.ns import NsLcm
25 from osm_common.dbmongo import DbMongo
26 from osm_common.msgkafka import MsgKafka
27 from osm_common.fslocal import FsLocal
28 from osm_lcm.lcm_utils import TaskRegistry
29 from n2vc.vnf import N2VC
30 from uuid import uuid4
31
32 __author__ = "Alfonso Tierno <alfonso.tiernosepulveda@telefonica.com>"
33
34 """ Perform unittests using asynctest
35 It allows, if some testing ENV are supplied, testing without mocking some external libraries for debugging:
36 OSMLCMTEST_NS_PUBKEY: public ssh-key returned by N2VC to inject to VMs
37 OSMLCMTEST_PACKAGES_PATH: path where the vnf-packages are stored (de-compressed), each one on a 'vnfd_id' folder
38 OSMLCMTEST_NS_IPADDRESS: IP address where emulated VMs are reached. Comma separate list
39 OSMLCMTEST_VCA_NOMOCK: Do no mock the VCA, N2VC library, for debugging it
40 OSMLCMTEST_RO_NOMOCK: Do no mock the ROClient library, for debugging it
41 OSMLCMTEST_DB_NOMOCK: Do no mock the database library, for debugging it
42 OSMLCMTEST_FS_NOMOCK: Do no mock the File Sorage library, for debugging it
43 OSMLCMTEST_LOGGING_NOMOCK: Do no mock the logging
44 OSMLCM_VCA_XXX: configuration of N2VC
45 OSMLCM_RO_XXX: configuration of RO
46 """
47
48
49 vca_config = { # TODO replace with os.get_env to get other configurations
50 "host": getenv("OSMLCM_VCA_HOST", "vca"),
51 "port": 17070,
52 "user": "admin",
53 "secret": "secret",
54 }
55
56 ro_config = {
57 "endpoint_url": "http://{}:{}/openmano".format(getenv("OSMLCM_RO_HOST", "ro"), getenv("OSMLCM_RO_PORT", "9090")),
58 "tenant": getenv("OSMLCM_RO_TENANT", "osm"),
59 "logger_name": "lcm.ROclient",
60 "loglevel": "DEBUG",
61 }
62
63 db_vim_accounts_text = """
64 ---
65 - _admin:
66 created: 1566818150.3024442
67 current_operation: 0
68 deployed:
69 RO: dc51ce6c-c7f2-11e9-b9c0-02420aff0004
70 RO-account: dc5c67fa-c7f2-11e9-b9c0-02420aff0004
71 detailed-status: Done
72 modified: 1566818150.3024442
73 operationalState: ENABLED
74 operations:
75 - detailed-status: Done
76 lcmOperationType: create
77 operationParams: null
78 operationState: COMPLETED
79 startTime: 1566818150.3025382
80 statusEnteredTime: 1566818150.3025382
81 worker: 86434c2948e2
82 projects_read:
83 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
84 projects_write:
85 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
86 _id: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
87 description: Openstack site 2, based on Mirantis, also called DSS9000-1, with
88 tenant tid
89 name: ost2-mrt-tid
90 schema_version: '1.1'
91 vim_password: 5g0yGX86qIhprX86YTMcpg==
92 vim_tenant_name: osm
93 vim_type: openstack
94 vim_url: http://10.95.87.162:5000/v2.0
95 vim_user: osm
96 """
97
98 db_vnfds_text = """
99 ---
100 - _admin:
101 created: 1566823352.7154346
102 modified: 1566823353.9295402
103 onboardingState: ONBOARDED
104 operationalState: ENABLED
105 projects_read:
106 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
107 projects_write:
108 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
109 storage:
110 descriptor: hackfest_3charmed_vnfd/hackfest_3charmed_vnfd.yaml
111 folder: 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77
112 fs: local
113 path: /app/storage/
114 pkg-dir: hackfest_3charmed_vnfd
115 zipfile: package.tar.gz
116 type: vnfd
117 usageState: NOT_IN_USE
118 userDefinedData: {}
119 _id: 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77
120 connection-point:
121 - id: vnf-mgmt
122 name: vnf-mgmt
123 short-name: vnf-mgmt
124 type: VPORT
125 - id: vnf-data
126 name: vnf-data
127 short-name: vnf-data
128 type: VPORT
129 description: A VNF consisting of 2 VDUs connected to an internal VL, and one VDU
130 with cloud-init
131 id: hackfest3charmed-vnf
132 internal-vld:
133 - id: internal
134 internal-connection-point:
135 - id-ref: mgmtVM-internal
136 - id-ref: dataVM-internal
137 name: internal
138 short-name: internal
139 type: ELAN
140 logo: osm.png
141 mgmt-interface:
142 cp: vnf-mgmt
143 monitoring-param:
144 - aggregation-type: AVERAGE
145 id: monitor1
146 name: monitor1
147 vdu-monitoring-param:
148 vdu-monitoring-param-ref: dataVM_cpu_util
149 vdu-ref: dataVM
150 name: hackfest3charmed-vnf
151 scaling-group-descriptor:
152 - max-instance-count: 10
153 name: scale_dataVM
154 scaling-config-action:
155 - trigger: post-scale-out
156 vnf-config-primitive-name-ref: touch
157 - trigger: pre-scale-in
158 vnf-config-primitive-name-ref: touch
159 scaling-policy:
160 - cooldown-time: 60
161 name: auto_cpu_util_above_threshold
162 scaling-criteria:
163 - name: cpu_util_above_threshold
164 scale-in-relational-operation: LE
165 scale-in-threshold: '15.0000000000'
166 scale-out-relational-operation: GE
167 scale-out-threshold: '60.0000000000'
168 vnf-monitoring-param-ref: monitor1
169 scaling-type: automatic
170 threshold-time: 0
171 vdu:
172 - count: 1
173 vdu-id-ref: dataVM
174 short-name: hackfest3charmed-vnf
175 vdu:
176 - count: '1'
177 cloud-init-file: cloud-config.txt
178 id: mgmtVM
179 image: hackfest3-mgmt
180 interface:
181 - external-connection-point-ref: vnf-mgmt
182 name: mgmtVM-eth0
183 position: 1
184 type: EXTERNAL
185 virtual-interface:
186 type: VIRTIO
187 - internal-connection-point-ref: mgmtVM-internal
188 name: mgmtVM-eth1
189 position: 2
190 type: INTERNAL
191 virtual-interface:
192 type: VIRTIO
193 internal-connection-point:
194 - id: mgmtVM-internal
195 name: mgmtVM-internal
196 short-name: mgmtVM-internal
197 type: VPORT
198 name: mgmtVM
199 vm-flavor:
200 memory-mb: '1024'
201 storage-gb: '10'
202 vcpu-count: 1
203 - count: '1'
204 id: dataVM
205 image: hackfest3-mgmt
206 interface:
207 - internal-connection-point-ref: dataVM-internal
208 name: dataVM-eth0
209 position: 1
210 type: INTERNAL
211 virtual-interface:
212 type: VIRTIO
213 - external-connection-point-ref: vnf-data
214 name: dataVM-xe0
215 position: 2
216 type: EXTERNAL
217 virtual-interface:
218 type: VIRTIO
219 internal-connection-point:
220 - id: dataVM-internal
221 name: dataVM-internal
222 short-name: dataVM-internal
223 type: VPORT
224 monitoring-param:
225 - id: dataVM_cpu_util
226 nfvi-metric: cpu_utilization
227 name: dataVM
228 vm-flavor:
229 memory-mb: '1024'
230 storage-gb: '10'
231 vcpu-count: 1
232 version: '1.0'
233 vnf-configuration:
234 config-primitive:
235 - name: touch
236 parameter:
237 - data-type: STRING
238 default-value: <touch_filename2>
239 name: filename
240 initial-config-primitive:
241 - name: config
242 parameter:
243 - name: ssh-hostname
244 value: <rw_mgmt_ip>
245 - name: ssh-username
246 value: ubuntu
247 - name: ssh-password
248 value: osm4u
249 seq: '1'
250 - name: touch
251 parameter:
252 - name: filename
253 value: <touch_filename>
254 seq: '2'
255 juju:
256 charm: simple
257 """
258
259 db_nsds_text = """
260 ---
261 - _admin:
262 created: 1566823353.971486
263 modified: 1566823353.971486
264 onboardingState: ONBOARDED
265 operationalState: ENABLED
266 projects_read:
267 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
268 projects_write:
269 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
270 storage:
271 descriptor: hackfest_3charmed_nsd/hackfest_3charmed_nsd.yaml
272 folder: 8c2f8b95-bb1b-47ee-8001-36dc090678da
273 fs: local
274 path: /app/storage/
275 pkg-dir: hackfest_3charmed_nsd
276 zipfile: package.tar.gz
277 usageState: NOT_IN_USE
278 userDefinedData: {}
279 _id: 8c2f8b95-bb1b-47ee-8001-36dc090678da
280 constituent-vnfd:
281 - member-vnf-index: '1'
282 vnfd-id-ref: hackfest3charmed-vnf
283 - member-vnf-index: '2'
284 vnfd-id-ref: hackfest3charmed-vnf
285 description: NS with 2 VNFs hackfest3charmed-vnf connected by datanet and mgmtnet
286 VLs
287 id: hackfest3charmed-ns
288 logo: osm.png
289 name: hackfest3charmed-ns
290 short-name: hackfest3charmed-ns
291 version: '1.0'
292 vld:
293 - id: mgmt
294 mgmt-network: true
295 name: mgmt
296 short-name: mgmt
297 type: ELAN
298 vim-network-name: mgmt
299 vnfd-connection-point-ref:
300 - member-vnf-index-ref: '1'
301 vnfd-connection-point-ref: vnf-mgmt
302 vnfd-id-ref: hackfest3charmed-vnf
303 - member-vnf-index-ref: '2'
304 vnfd-connection-point-ref: vnf-mgmt
305 vnfd-id-ref: hackfest3charmed-vnf
306 - id: datanet
307 name: datanet
308 short-name: datanet
309 type: ELAN
310 vnfd-connection-point-ref:
311 - member-vnf-index-ref: '1'
312 vnfd-connection-point-ref: vnf-data
313 vnfd-id-ref: hackfest3charmed-vnf
314 - member-vnf-index-ref: '2'
315 vnfd-connection-point-ref: vnf-data
316 vnfd-id-ref: hackfest3charmed-vnf
317 """
318
319 db_nsrs_text = """
320 ---
321 - _admin:
322 created: 1566823354.3716335
323 deployed:
324 RO:
325 nsd_id: 876573b5-968d-40b9-b52b-91bf5c5844f7
326 nsr_id: c9fe9908-3180-430d-b633-fca2f68db008
327 nsr_status: ACTIVE
328 vnfd:
329 - id: 1ab2a418-9fe3-4358-bf17-411e5155535f
330 member-vnf-index: '1'
331 - id: 0de348e3-c201-4f6a-91cc-7f957e2d5504
332 member-vnf-index: '2'
333 VCA:
334 - application: alf-b-aa
335 detailed-status: Ready!
336 member-vnf-index: '1'
337 model: f48163a6-c807-47bc-9682-f72caef5af85
338 operational-status: active
339 primitive_id: null
340 ssh-public-key: ssh-rsa pub-key root@juju-145d3e-0
341 step: ssh-public-key-obtained
342 vdu_count_index: null
343 vdu_id: null
344 vdu_name: null
345 vnfd_id: hackfest3charmed-vnf
346 - application: alf-c-ab
347 detailed-status: Ready!
348 member-vnf-index: '2'
349 model: f48163a6-c807-47bc-9682-f72caef5af85
350 operational-status: active
351 primitive_id: null
352 ssh-public-key: ssh-rsa pub-key root@juju-145d3e-0
353 step: ssh-public-key-obtained
354 vdu_count_index: null
355 vdu_id: null
356 vdu_name: null
357 vnfd_id: hackfest3charmed-vnf
358 VCA-model-name: f48163a6-c807-47bc-9682-f72caef5af85
359 modified: 1566823354.3716335
360 nsState: INSTANTIATED
361 nslcmop: null
362 projects_read:
363 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
364 projects_write:
365 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
366 _id: f48163a6-c807-47bc-9682-f72caef5af85
367 additionalParamsForNs: null
368 admin-status: ENABLED
369 config-status: init
370 constituent-vnfr-ref:
371 - 88d90b0c-faff-4b9f-bccd-017f33985984
372 - 1ca3bb1a-b29b-49fe-bed6-5f3076d77434
373 create-time: 1566823354.36234
374 datacenter: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
375 description: default description
376 detailed-status: 'ERROR executing proxy charm initial primitives for member_vnf_index=1
377 vdu_id=None: charm error executing primitive verify-ssh-credentials for member_vnf_index=1
378 vdu_id=None: ''timeout after 600 seconds'''
379 id: f48163a6-c807-47bc-9682-f72caef5af85
380 instantiate_params:
381 nsDescription: default description
382 nsName: ALF
383 nsdId: 8c2f8b95-bb1b-47ee-8001-36dc090678da
384 vimAccountId: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
385 name: ALF
386 name-ref: ALF
387 ns-instance-config-ref: f48163a6-c807-47bc-9682-f72caef5af85
388 nsd:
389 _admin:
390 created: 1566823353.971486
391 modified: 1566823353.971486
392 onboardingState: ONBOARDED
393 operationalState: ENABLED
394 projects_read:
395 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
396 projects_write:
397 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
398 storage:
399 descriptor: hackfest_3charmed_nsd/hackfest_3charmed_nsd.yaml
400 folder: 8c2f8b95-bb1b-47ee-8001-36dc090678da
401 fs: local
402 path: /app/storage/
403 pkg-dir: hackfest_3charmed_nsd
404 zipfile: package.tar.gz
405 usageState: NOT_IN_USE
406 userDefinedData: {}
407 _id: 8c2f8b95-bb1b-47ee-8001-36dc090678da
408 constituent-vnfd:
409 - member-vnf-index: '1'
410 vnfd-id-ref: hackfest3charmed-vnf
411 - member-vnf-index: '2'
412 vnfd-id-ref: hackfest3charmed-vnf
413 description: NS with 2 VNFs hackfest3charmed-vnf connected by datanet and
414 mgmtnet VLs
415 id: hackfest3charmed-ns
416 logo: osm.png
417 name: hackfest3charmed-ns
418 short-name: hackfest3charmed-ns
419 version: '1.0'
420 vld:
421 - id: mgmt
422 mgmt-network: true
423 name: mgmt
424 short-name: mgmt
425 type: ELAN
426 vim-network-name: mgmt
427 vnfd-connection-point-ref:
428 - member-vnf-index-ref: '1'
429 vnfd-connection-point-ref: vnf-mgmt
430 vnfd-id-ref: hackfest3charmed-vnf
431 - member-vnf-index-ref: '2'
432 vnfd-connection-point-ref: vnf-mgmt
433 vnfd-id-ref: hackfest3charmed-vnf
434 - id: datanet
435 name: datanet
436 short-name: datanet
437 type: ELAN
438 vnfd-connection-point-ref:
439 - member-vnf-index-ref: '1'
440 vnfd-connection-point-ref: vnf-data
441 vnfd-id-ref: hackfest3charmed-vnf
442 - member-vnf-index-ref: '2'
443 vnfd-connection-point-ref: vnf-data
444 vnfd-id-ref: hackfest3charmed-vnf
445 nsd-id: 8c2f8b95-bb1b-47ee-8001-36dc090678da
446 nsd-name-ref: hackfest3charmed-ns
447 nsd-ref: hackfest3charmed-ns
448 operational-events: []
449 operational-status: failed
450 orchestration-progress: {}
451 resource-orchestrator: osmopenmano
452 short-name: ALF
453 ssh-authorized-key: null
454 vld:
455 - id: mgmt
456 name: null
457 status: ACTIVE
458 status-detailed: null
459 vim-id: f99ae780-0e2f-4985-af41-574eae6919c0
460 vim-network-name: mgmt
461 - id: datanet
462 name: ALF-datanet
463 status: ACTIVE
464 status-detailed: null
465 vim-id: c31364ba-f573-4ab6-bf1a-fed30ede39a8
466 vnfd-id:
467 - 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77
468 """
469
470 db_nslcmops_text = """
471 ---
472 - _admin:
473 created: 1566823354.4148262
474 modified: 1566823354.4148262
475 projects_read:
476 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
477 projects_write:
478 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
479 worker: 86434c2948e2
480 _id: a639fac7-e0bb-4225-8ecb-c1f8efcc125e
481 detailed-status: 'FAILED executing proxy charm initial primitives for member_vnf_index=1
482 vdu_id=None: charm error executing primitive verify-ssh-credentials for member_vnf_index=1
483 vdu_id=None: ''timeout after 600 seconds'''
484 id: a639fac7-e0bb-4225-8ecb-c1f8efcc125e
485 isAutomaticInvocation: false
486 isCancelPending: false
487 lcmOperationType: instantiate
488 links:
489 nsInstance: /osm/nslcm/v1/ns_instances/f48163a6-c807-47bc-9682-f72caef5af85
490 self: /osm/nslcm/v1/ns_lcm_op_occs/a639fac7-e0bb-4225-8ecb-c1f8efcc125e
491 nsInstanceId: f48163a6-c807-47bc-9682-f72caef5af85
492 operationParams:
493 additionalParamsForVnf:
494 - additionalParams:
495 touch_filename: /home/ubuntu/first-touch-1
496 touch_filename2: /home/ubuntu/second-touch-1
497 member-vnf-index: '1'
498 - additionalParams:
499 touch_filename: /home/ubuntu/first-touch-2
500 touch_filename2: /home/ubuntu/second-touch-2
501 member-vnf-index: '2'
502 lcmOperationType: instantiate
503 nsDescription: default description
504 nsInstanceId: f48163a6-c807-47bc-9682-f72caef5af85
505 nsName: ALF
506 nsdId: 8c2f8b95-bb1b-47ee-8001-36dc090678da
507 vimAccountId: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
508 operationState: FAILED
509 startTime: 1566823354.414689
510 statusEnteredTime: 1566824534.5112448
511 """
512
513 db_vnfrs_text = """
514 ---
515 - _admin:
516 created: 1566823354.3668208
517 modified: 1566823354.3668208
518 nsState: NOT_INSTANTIATED
519 projects_read:
520 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
521 projects_write:
522 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
523 _id: 88d90b0c-faff-4b9f-bccd-017f33985984
524 additionalParamsForVnf:
525 touch_filename: /home/ubuntu/first-touch-1
526 touch_filename2: /home/ubuntu/second-touch-1
527 connection-point:
528 - connection-point-id: vnf-mgmt
529 id: vnf-mgmt
530 name: vnf-mgmt
531 - connection-point-id: vnf-data
532 id: vnf-data
533 name: vnf-data
534 created-time: 1566823354.36234
535 id: 88d90b0c-faff-4b9f-bccd-017f33985984
536 ip-address: 10.205.1.46
537 member-vnf-index-ref: '1'
538 nsr-id-ref: f48163a6-c807-47bc-9682-f72caef5af85
539 vdur:
540 - _id: f0e7d7ce-2443-4dcb-ad0b-5ab9f3b13d37
541 count-index: 0
542 interfaces:
543 - ip-address: 10.205.1.46
544 mac-address: fa:16:3e:b4:3e:b1
545 mgmt-vnf: true
546 name: mgmtVM-eth0
547 ns-vld-id: mgmt
548 - ip-address: 192.168.54.2
549 mac-address: fa:16:3e:6e:7e:78
550 name: mgmtVM-eth1
551 vnf-vld-id: internal
552 internal-connection-point:
553 - connection-point-id: mgmtVM-internal
554 id: mgmtVM-internal
555 name: mgmtVM-internal
556 ip-address: 10.205.1.46
557 name: ALF-1-mgmtVM-1
558 status: ACTIVE
559 status-detailed: null
560 vdu-id-ref: mgmtVM
561 vim-id: c2538499-4c30-41c0-acd5-80cb92f48061
562 - _id: ab453219-2d9a-45c2-864d-2c0788385028
563 count-index: 0
564 interfaces:
565 - ip-address: 192.168.54.3
566 mac-address: fa:16:3e:d9:7a:5d
567 name: dataVM-eth0
568 vnf-vld-id: internal
569 - ip-address: 192.168.24.3
570 mac-address: fa:16:3e:d1:6c:0d
571 name: dataVM-xe0
572 ns-vld-id: datanet
573 internal-connection-point:
574 - connection-point-id: dataVM-internal
575 id: dataVM-internal
576 name: dataVM-internal
577 ip-address: null
578 name: ALF-1-dataVM-1
579 status: ACTIVE
580 status-detailed: null
581 vdu-id-ref: dataVM
582 vim-id: 87973c3f-365d-4227-95c2-7a8abc74349c
583 vim-account-id: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
584 vld:
585 - id: internal
586 name: ALF-internal
587 status: ACTIVE
588 status-detailed: null
589 vim-id: ff181e6d-2597-4244-b40b-bb0174bdfeb6
590 vnfd-id: 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77
591 vnfd-ref: hackfest3charmed-vnf
592 - _admin:
593 created: 1566823354.3703845
594 modified: 1566823354.3703845
595 nsState: NOT_INSTANTIATED
596 projects_read:
597 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
598 projects_write:
599 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
600 _id: 1ca3bb1a-b29b-49fe-bed6-5f3076d77434
601 additionalParamsForVnf:
602 touch_filename: /home/ubuntu/first-touch-2
603 touch_filename2: /home/ubuntu/second-touch-2
604 connection-point:
605 - connection-point-id: vnf-mgmt
606 id: vnf-mgmt
607 name: vnf-mgmt
608 - connection-point-id: vnf-data
609 id: vnf-data
610 name: vnf-data
611 created-time: 1566823354.36234
612 id: 1ca3bb1a-b29b-49fe-bed6-5f3076d77434
613 ip-address: 10.205.1.47
614 member-vnf-index-ref: '2'
615 nsr-id-ref: f48163a6-c807-47bc-9682-f72caef5af85
616 vdur:
617 - _id: 190b4a2c-4f85-4cfe-9406-4cef7ffb1e67
618 count-index: 0
619 interfaces:
620 - ip-address: 10.205.1.47
621 mac-address: fa:16:3e:cb:9f:c7
622 mgmt-vnf: true
623 name: mgmtVM-eth0
624 ns-vld-id: mgmt
625 - ip-address: 192.168.231.1
626 mac-address: fa:16:3e:1a:89:24
627 name: mgmtVM-eth1
628 vnf-vld-id: internal
629 internal-connection-point:
630 - connection-point-id: mgmtVM-internal
631 id: mgmtVM-internal
632 name: mgmtVM-internal
633 ip-address: 10.205.1.47
634 name: ALF-2-mgmtVM-1
635 status: ACTIVE
636 status-detailed: null
637 vdu-id-ref: mgmtVM
638 vim-id: 248077b2-e3b8-4a37-8b72-575abb8ed912
639 - _id: 889b874d-e1c3-4e75-aa45-53a9b0ddabd9
640 count-index: 0
641 interfaces:
642 - ip-address: 192.168.231.3
643 mac-address: fa:16:3e:7e:ba:8c
644 name: dataVM-eth0
645 vnf-vld-id: internal
646 - ip-address: 192.168.24.4
647 mac-address: fa:16:3e:d2:e1:f5
648 name: dataVM-xe0
649 ns-vld-id: datanet
650 internal-connection-point:
651 - connection-point-id: dataVM-internal
652 id: dataVM-internal
653 name: dataVM-internal
654 ip-address: null
655 name: ALF-2-dataVM-1
656 status: ACTIVE
657 status-detailed: null
658 vdu-id-ref: dataVM
659 vim-id: a4ce4372-e0ad-4ae3-8f9f-1c969f32e77b
660 vim-account-id: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
661 vld:
662 - id: internal
663 name: ALF-internal
664 status: ACTIVE
665 status-detailed: null
666 vim-id: ff181e6d-2597-4244-b40b-bb0174bdfeb6
667 vnfd-id: 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77
668 vnfd-ref: hackfest3charmed-vnf
669 """
670
671 ro_ns_text = """
672 datacenter_tenant_id: dc5c67fa-c7f2-11e9-b9c0-02420aff0004
673 description: null
674 name: ALF
675 nets:
676 - created: false
677 datacenter_id: dc51ce6c-c7f2-11e9-b9c0-02420aff0004
678 datacenter_tenant_id: dc5c67fa-c7f2-11e9-b9c0-02420aff0004
679 error_msg: null
680 ns_net_osm_id: mgmt
681 related: c6bac394-fa27-4c43-bb34-42f621a9d343
682 sce_net_id: 8f215bab-c35e-41e6-a035-42bfaa07af9f
683 sdn_net_id: null
684 status: ACTIVE
685 uuid: c6bac394-fa27-4c43-bb34-42f621a9d343
686 vim_info: "{vim_info: null}"
687 vim_name: null
688 vim_net_id: f99ae780-0e2f-4985-af41-574eae6919c0
689 vnf_net_id: null
690 vnf_net_osm_id: null
691 - created: true
692 datacenter_id: dc51ce6c-c7f2-11e9-b9c0-02420aff0004
693 datacenter_tenant_id: dc5c67fa-c7f2-11e9-b9c0-02420aff0004
694 error_msg: null
695 ns_net_osm_id: datanet
696 related: 509d576c-120f-493a-99a1-5fea99dfe041
697 sce_net_id: 3d766bbc-33a8-41aa-a986-2f35e8d25c16
698 sdn_net_id: null
699 status: ACTIVE
700 uuid: 509d576c-120f-493a-99a1-5fea99dfe041
701 vim_info: "{vim_info: null}"
702 vim_name: ALF-datanet
703 vim_net_id: c31364ba-f573-4ab6-bf1a-fed30ede39a8
704 vnf_net_id: null
705 vnf_net_osm_id: null
706 - created: true
707 datacenter_id: dc51ce6c-c7f2-11e9-b9c0-02420aff0004
708 datacenter_tenant_id: dc5c67fa-c7f2-11e9-b9c0-02420aff0004
709 error_msg: null
710 ns_net_osm_id: null
711 related: 277fed09-3220-4bfd-9052-b96b21a32daf
712 sce_net_id: null
713 sdn_net_id: null
714 status: ACTIVE
715 uuid: 277fed09-3220-4bfd-9052-b96b21a32daf
716 vim_info: "{vim_info: null}"
717 vim_name: ALF-internal
718 vim_net_id: ff181e6d-2597-4244-b40b-bb0174bdfeb6
719 vnf_net_id: 62e62fae-c12b-4ebc-9a9b-30031c6c16fa
720 vnf_net_osm_id: internal
721 - created: true
722 datacenter_id: dc51ce6c-c7f2-11e9-b9c0-02420aff0004
723 datacenter_tenant_id: dc5c67fa-c7f2-11e9-b9c0-02420aff0004
724 error_msg: null
725 ns_net_osm_id: null
726 related: 92534d1a-e697-4372-a84d-aa0aa643b68a
727 sce_net_id: null
728 sdn_net_id: null
729 status: ACTIVE
730 uuid: 92534d1a-e697-4372-a84d-aa0aa643b68a
731 vim_info: "{vim_info: null}"
732 vim_name: ALF-internal
733 vim_net_id: 09655387-b639-421a-b5f6-72b26d685fb4
734 vnf_net_id: 13c6c77d-86a5-4914-832c-990d4ec7b54e
735 vnf_net_osm_id: internal
736 nsd_osm_id: f48163a6-c807-47bc-9682-f72caef5af85.2.hackfest3charmed-ns
737 scenario_id: 876573b5-968d-40b9-b52b-91bf5c5844f7
738 scenario_name: hackfest3charmed-ns
739 sfis: []
740 sfps: []
741 sfs: []
742 tenant_id: 0ea38bd0-2729-47a9-ae07-c6ce76115eb2
743 uuid: c9fe9908-3180-430d-b633-fca2f68db008
744 vnfs:
745 - datacenter_id: dc51ce6c-c7f2-11e9-b9c0-02420aff0004
746 datacenter_tenant_id: dc5c67fa-c7f2-11e9-b9c0-02420aff0004
747 ip_address: 10.205.1.46
748 member_vnf_index: '1'
749 mgmt_access: '{interface_id: 61549ee3-cd6c-4930-8b90-eaad97fe345b, required: ''False'',
750 vm_id: 6cf4a48f-3b6c-4395-8221-119fa37de24a}
751
752 '
753 sce_vnf_id: 83be04a8-c513-42ba-9908-22728f686d31
754 uuid: 94724042-7576-4fb0-82ec-6a7ab642741c
755 vms:
756 - created_at: '2019-08-26T12:50:38'
757 error_msg: null
758 interfaces:
759 - external_name: vnf-mgmt
760 instance_net_id: c6bac394-fa27-4c43-bb34-42f621a9d343
761 internal_name: mgmtVM-eth0
762 ip_address: 10.205.1.46
763 mac_address: fa:16:3e:b4:3e:b1
764 sdn_port_id: null
765 type: mgmt
766 vim_info: "{vim_info: null}"
767 vim_interface_id: 4d3cb8fd-7040-4169-a0ad-2486d2b006a1
768 - external_name: null
769 instance_net_id: 277fed09-3220-4bfd-9052-b96b21a32daf
770 internal_name: mgmtVM-eth1
771 ip_address: 192.168.54.2
772 mac_address: fa:16:3e:6e:7e:78
773 sdn_port_id: null
774 type: bridge
775 vim_info: "{vim_info: null}"
776 vim_interface_id: 54ed68e2-9802-4dfe-b68a-280b3fc6e02d
777 ip_address: 10.205.1.46
778 name: mgmtVM
779 related: d0b91293-a91d-4f08-b15f-0bf841216dfe
780 status: ACTIVE
781 uuid: d0b91293-a91d-4f08-b15f-0bf841216dfe
782 vdu_osm_id: mgmtVM
783 vim_info: "{vim_info: null}"
784 vim_name: ALF-1-mgmtVM-1
785 vim_vm_id: c2538499-4c30-41c0-acd5-80cb92f48061
786 - created_at: '2019-08-26T12:50:38'
787 error_msg: null
788 interfaces:
789 - external_name: null
790 instance_net_id: 277fed09-3220-4bfd-9052-b96b21a32daf
791 internal_name: dataVM-eth0
792 ip_address: 192.168.54.3
793 mac_address: fa:16:3e:d9:7a:5d
794 sdn_port_id: null
795 type: bridge
796 vim_info: "{vim_info: null}"
797 vim_interface_id: 1637f350-8840-4241-8ed0-4616bdcecfcf
798 - external_name: vnf-data
799 instance_net_id: 509d576c-120f-493a-99a1-5fea99dfe041
800 internal_name: dataVM-xe0
801 ip_address: 192.168.24.3
802 mac_address: fa:16:3e:d1:6c:0d
803 sdn_port_id: null
804 type: bridge
805 vim_info: "{vim_info: null}"
806 vim_interface_id: 54c73e83-7059-41fe-83a9-4c4ae997b481
807 name: dataVM
808 related: 5c08253d-8a35-474f-b0d3-c5297d174c13
809 status: ACTIVE
810 uuid: 5c08253d-8a35-474f-b0d3-c5297d174c13
811 vdu_osm_id: dataVM
812 vim_info: "{vim_info: null}"
813 vim_name: ALF-1-dataVM-1
814 vim_vm_id: 87973c3f-365d-4227-95c2-7a8abc74349c
815 - created_at: '2019-08-26T13:40:54'
816 error_msg: null
817 interfaces:
818 - external_name: null
819 instance_net_id: 277fed09-3220-4bfd-9052-b96b21a32daf
820 internal_name: dataVM-eth0
821 ip_address: 192.168.54.5
822 mac_address: fa:16:3e:e4:17:45
823 sdn_port_id: null
824 type: bridge
825 vim_info: "{vim_info: null}"
826 vim_interface_id: 7e246e40-8710-4c33-9c95-78fc3c02bc5b
827 - external_name: vnf-data
828 instance_net_id: 509d576c-120f-493a-99a1-5fea99dfe041
829 internal_name: dataVM-xe0
830 ip_address: 192.168.24.5
831 mac_address: fa:16:3e:29:6f:a6
832 sdn_port_id: null
833 type: bridge
834 vim_info: "{vim_info: null}"
835 vim_interface_id: ce81af7a-9adf-494b-950e-6581fd04ecc4
836 name: dataVM
837 related: 1ae5a0a2-c15a-49a4-a77c-2991d97f6dbe
838 status: ACTIVE
839 uuid: 1ae5a0a2-c15a-49a4-a77c-2991d97f6dbe
840 vdu_osm_id: dataVM
841 vim_info: "{vim_info: null}"
842 vim_name: ALF-1-dataVM-2
843 vim_vm_id: 4916533e-36c6-4861-9fe3-366a8fb0a5f8
844 vnf_id: 1ab2a418-9fe3-4358-bf17-411e5155535f
845 vnf_name: hackfest3charmed-vnf.1
846 vnfd_osm_id: f48163a6-c807-47bc-9682-f72caef5af85.0.1
847 - datacenter_id: dc51ce6c-c7f2-11e9-b9c0-02420aff0004
848 datacenter_tenant_id: dc5c67fa-c7f2-11e9-b9c0-02420aff0004
849 ip_address: 10.205.1.47
850 member_vnf_index: '2'
851 mgmt_access: '{interface_id: 538604c3-5c5e-41eb-8f84-c0239c7fabcd, required: ''False'',
852 vm_id: dd04d792-05c9-4ecc-bf28-f77384d00311}
853
854 '
855 sce_vnf_id: c4f3607a-08ff-4f75-893c-fce507e2f240
856 uuid: 00020403-e80f-4ef2-bb7e-b29669643035
857 vms:
858 - created_at: '2019-08-26T12:50:38'
859 error_msg: null
860 interfaces:
861 - external_name: vnf-mgmt
862 instance_net_id: c6bac394-fa27-4c43-bb34-42f621a9d343
863 internal_name: mgmtVM-eth0
864 ip_address: 10.205.1.47
865 mac_address: fa:16:3e:cb:9f:c7
866 sdn_port_id: null
867 type: mgmt
868 vim_info: "{vim_info: null}"
869 vim_interface_id: dcd6d2de-3c68-481c-883e-e9d38c671dc4
870 - external_name: null
871 instance_net_id: 92534d1a-e697-4372-a84d-aa0aa643b68a
872 internal_name: mgmtVM-eth1
873 ip_address: 192.168.231.1
874 mac_address: fa:16:3e:1a:89:24
875 sdn_port_id: null
876 type: bridge
877 vim_info: "{vim_info: null}"
878 vim_interface_id: 50e538e3-aba0-4652-93bb-20487f3f28e1
879 ip_address: 10.205.1.47
880 name: mgmtVM
881 related: 4543ab5d-578c-427c-9df2-affd17e21b66
882 status: ACTIVE
883 uuid: 4543ab5d-578c-427c-9df2-affd17e21b66
884 vdu_osm_id: mgmtVM
885 vim_info: "{vim_info: null}"
886 vim_name: ALF-2-mgmtVM-1
887 vim_vm_id: 248077b2-e3b8-4a37-8b72-575abb8ed912
888 - created_at: '2019-08-26T12:50:38'
889 error_msg: null
890 interfaces:
891 - external_name: null
892 instance_net_id: 92534d1a-e697-4372-a84d-aa0aa643b68a
893 internal_name: dataVM-eth0
894 ip_address: 192.168.231.3
895 mac_address: fa:16:3e:7e:ba:8c
896 sdn_port_id: null
897 type: bridge
898 vim_info: "{vim_info: null}"
899 vim_interface_id: 15274862-14ea-4527-b405-101cae8bc1a0
900 - external_name: vnf-data
901 instance_net_id: 509d576c-120f-493a-99a1-5fea99dfe041
902 internal_name: dataVM-xe0
903 ip_address: 192.168.24.4
904 mac_address: fa:16:3e:d2:e1:f5
905 sdn_port_id: null
906 type: bridge
907 vim_info: "{vim_info: null}"
908 vim_interface_id: 253ebe4e-38d5-46be-8777-dbb57510a2ec
909 name: dataVM
910 related: 6f03f16b-295a-47a1-9a69-2d069d574a33
911 status: ACTIVE
912 uuid: 6f03f16b-295a-47a1-9a69-2d069d574a33
913 vdu_osm_id: dataVM
914 vim_info: "{vim_info: null}"
915 vim_name: ALF-2-dataVM-1
916 vim_vm_id: a4ce4372-e0ad-4ae3-8f9f-1c969f32e77b
917 vnf_id: 0de348e3-c201-4f6a-91cc-7f957e2d5504
918 vnf_name: hackfest3charmed-vnf.2
919 vnfd_osm_id: f48163a6-c807-47bc-9682-f72caef5af85.1.2
920 """
921
922
923 class TestMyNS(asynctest.TestCase):
924
925 def _db_get_one(self, table, q_filter=None, fail_on_empty=True, fail_on_more=True):
926 if table not in self.db_content:
927 self.assertTrue(False, "db.get_one called with table={}".format(table))
928 for db_item in self.db_content[table]:
929 if db_item["_id"] == q_filter["_id"]:
930 return db_item
931 else:
932 self.assertTrue(False, "db.get_one, table={}, not found _id={}".format(table, q_filter["_id"]))
933
934 def _db_get_list(self, table, q_filter=None):
935 if table not in self.db_content:
936 self.assertTrue(False, "db.get_list called with table={} not found".format(table))
937 return self.db_content[table]
938
939 def _db_set_one(self, table, q_filter, update_dict, fail_on_empty=True, unset=None, pull=None, push=None):
940 db_item = self._db_get_one(table, q_filter, fail_on_empty=fail_on_empty)
941 for k, v in update_dict.items():
942 db_nested = db_item
943 k_list = k.split(".")
944 for k_nested in k_list[0:-1]:
945 if isinstance(db_nested, list):
946 db_nested = db_nested[int(k_nested)]
947 else:
948 if k_nested not in db_nested:
949 db_nested[k_nested] = {}
950 db_nested = db_nested[k_nested]
951 k_nested = k_list[-1]
952 if isinstance(db_nested, list):
953 if int(k_nested) < len(db_nested):
954 db_nested[int(k_nested)] = v
955 else:
956 db_nested.insert(int(k_nested), v)
957 else:
958 db_nested[k_nested] = v
959
960 async def _n2vc_DeployCharms(self, model_name, application_name, vnfd, charm_path, params={}, machine_spec={},
961 callback=None, *callback_args):
962 if callback:
963 for status, message in (("maintenance", "installing sofwware"), ("active", "Ready!")):
964 # call callback after some time
965 asyncio.sleep(5, loop=self.loop)
966 callback(model_name, application_name, status, message, *callback_args)
967
968 @staticmethod
969 def _n2vc_FormatApplicationName(*args):
970 num_calls = 0
971 while True:
972 yield "app_name-{}".format(num_calls)
973 num_calls += 1
974
975 def _n2vc_CreateExecutionEnvironment(self, namespace):
976 k_list = namespace.split(".")
977 ee_id = k_list[1] + "."
978 if len(k_list) >= 2:
979 for k in k_list[2:4]:
980 ee_id += k[:8]
981 else:
982 ee_id += "_NS_"
983 return ee_id
984
985 def _ro_show(self, *args, **kwargs):
986 ro_ns_desc = yaml.load(ro_ns_text)
987
988 # if ip address provided, replace descriptor
989 ip_addresses = getenv("OSMLCMTEST_NS_IPADDRESS", "")
990 if ip_addresses:
991 ip_addresses_list = ip_addresses.split(",")
992 for vnf in ro_ns_desc["vnfs"]:
993 if not ip_addresses_list:
994 break
995 vnf["ip_address"] = ip_addresses_list[0]
996 for vm in vnf["vms"]:
997 if not ip_addresses_list:
998 break
999 vm["ip_address"] = ip_addresses_list.pop(0)
1000
1001 while True:
1002 yield ro_ns_desc
1003 for net in ro_ns_desc["nets"]:
1004 if net["status"] != "ACTIVE":
1005 net["status"] = "ACTIVE"
1006 break
1007 else:
1008 for vnf in ro_ns_desc["vnfs"]:
1009 for vm in vnf["vms"]:
1010 if vm["status"] != "ACTIVE":
1011 vm["status"] = "ACTIVE"
1012 break
1013
1014 def _ro_create(self, *args, **kwargs):
1015 while True:
1016 yield {"uuid": str(uuid4())}
1017
1018 def _return_uuid(self, *args, **kwargs):
1019 return str(uuid4())
1020
1021 async def setUp(self):
1022 # Mock DB
1023 if not getenv("OSMLCMTEST_DB_NOMOCK"):
1024 self.db = asynctest.Mock(DbMongo())
1025 self.db.get_one.side_effect = self._db_get_one
1026 self.db.get_list.side_effect = self._db_get_list
1027 self.db.set_one.side_effect = self._db_set_one
1028 self.db_content = {
1029 "nsrs": yaml.load(db_nsrs_text),
1030 "nslcmops": yaml.load(db_nslcmops_text),
1031 "vnfrs": yaml.load(db_vnfrs_text),
1032 "vnfds": yaml.load(db_vnfds_text),
1033 "vim_accounts": yaml.load(db_vim_accounts_text),
1034 }
1035 self.db_vim_accounts = yaml.load(db_vim_accounts_text)
1036
1037 # Mock kafka
1038 self.msg = asynctest.Mock(MsgKafka())
1039
1040 # Mock filesystem
1041 if not getenv("OSMLCMTEST_FS_NOMOCK"):
1042 self.fs = asynctest.Mock(FsLocal())
1043 self.fs.get_params.return_value = {"path": getenv("OSMLCMTEST_PACKAGES_PATH", "./test/temp/packages")}
1044 self.fs.file_open = asynctest.mock_open()
1045 # self.fs.file_open.return_value.__enter__.return_value = asynctest.MagicMock() # called on a python "with"
1046 # self.fs.file_open.return_value.__enter__.return_value.read.return_value = "" # empty file
1047
1048 # Mock TaskRegistry
1049 self.lcm_tasks = asynctest.Mock(TaskRegistry())
1050 self.lcm_tasks.lock_HA.return_value = True
1051 self.lcm_tasks.waitfor_related_HA.return_value = None
1052 self.lcm_tasks.lookfor_related.return_value = ("", [])
1053
1054 # Create NsLCM class
1055 self.my_ns = NsLcm(self.db, self.msg, self.fs, self.lcm_tasks, ro_config, vca_config, self.loop)
1056
1057 # Mock logging
1058 if not getenv("OSMLCMTEST_LOGGING_NOMOCK"):
1059 self.my_ns.logger = asynctest.Mock(self.my_ns.logger)
1060
1061 # Mock VCA - N2VC
1062 if not getenv("OSMLCMTEST_VCA_NOMOCK"):
1063 pub_key = getenv("OSMLCMTEST_NS_PUBKEY", "ssh-rsa test-pub-key t@osm.com")
1064 self.my_ns.n2vc = asynctest.Mock(N2VC())
1065 self.my_ns.n2vc.GetPublicKey.return_value = getenv("OSMLCM_VCA_PUBKEY", "public_key")
1066 # allow several versions of n2vc
1067 self.my_ns.n2vc.FormatApplicationName = asynctest.Mock(side_effect=self._n2vc_FormatApplicationName())
1068 self.my_ns.n2vc.DeployCharms = asynctest.CoroutineMock(side_effect=self._n2vc_DeployCharms)
1069 self.my_ns.n2vc.CreateExecutionEnvironment = asynctest.CoroutineMock(
1070 side_effect=self._n2vc_CreateExecutionEnvironment)
1071 self.my_ns.n2vc.InstallConfigurationSW = asynctest.CoroutineMock(return_value=pub_key)
1072 self.my_ns.n2vc.ExecutePrimitive = asynctest.CoroutineMock(side_effect=self._return_uuid)
1073 self.my_ns.n2vc.GetPrimitiveStatus = asynctest.CoroutineMock(return_value="completed")
1074 self.my_ns.n2vc.GetPrimitiveOutput = asynctest.CoroutineMock(return_value={"result": "ok",
1075 "pubkey": pub_key})
1076
1077 # Mock RO
1078 if not getenv("OSMLCMTEST_RO_NOMOCK"):
1079 # self.my_ns.RO = asynctest.Mock(ROclient.ROClient(self.loop, **ro_config))
1080 # TODO first time should be empty list, following should return a dict
1081 self.my_ns.RO.get_list = asynctest.CoroutineMock(self.my_ns.RO.get_list, return_value=[])
1082 self.my_ns.RO.create = asynctest.CoroutineMock(self.my_ns.RO.create, side_effect=self._ro_create())
1083 self.my_ns.RO.show = asynctest.CoroutineMock(self.my_ns.RO.show, side_effect=self._ro_show())
1084
1085 @asynctest.fail_on(active_handles=True) # all async tasks must be completed
1086 async def test_instantiate(self):
1087 nsr_id = self.db_content["nsrs"][0]["_id"]
1088 nslcmop_id = self.db_content["nslcmops"][0]["_id"]
1089 print("Test instantiate started")
1090
1091 # delete deployed information of database
1092 if not getenv("OSMLCMTEST_DB_NOMOCK"):
1093 if self.db_content["nsrs"][0]["_admin"].get("deployed"):
1094 del self.db_content["nsrs"][0]["_admin"]["deployed"]
1095 for db_vnfr in self.db_content["vnfrs"]:
1096 db_vnfr.pop("ip_address", None)
1097 for db_vdur in db_vnfr["vdur"]:
1098 db_vdur.pop("ip_address", None)
1099 db_vdur.pop("mac_address", None)
1100
1101 await self.my_ns.instantiate(nsr_id, nslcmop_id)
1102
1103 print("instantiate_result: {}".format(self._db_get_one("nslcmops", {"_id": nslcmop_id}).get("detailed-status")))
1104
1105 self.msg.aiowrite.assert_called_once_with("ns", "instantiated",
1106 {"nsr_id": nsr_id, "nslcmop_id": nslcmop_id,
1107 "operationState": "COMPLETED"},
1108 loop=self.loop)
1109 self.lcm_tasks.lock_HA.assert_called_once_with('ns', 'nslcmops', nslcmop_id)
1110 if not getenv("OSMLCMTEST_LOGGING_NOMOCK"):
1111 self.assertTrue(self.my_ns.logger.debug.called, "Debug method not called")
1112 self.my_ns.logger.error.assert_not_called()
1113 self.my_ns.logger.exception().assert_not_called()
1114
1115 if not getenv("OSMLCMTEST_DB_NOMOCK"):
1116 self.assertTrue(self.db.set_one.called, "db.set_one not called")
1117
1118 # TODO add more checks of called methods
1119 # TODO add a terminate
1120
1121 @asynctest.fail_on(active_handles=True) # all async tasks must be completed
1122 async def test_scale(self):
1123 pass
1124
1125
1126 if __name__ == '__main__':
1127 asynctest.main()