2 # Copyright 2019 Tech Mahindra Limited
6 # Licensed under the Apache License, Version 2.0 (the "License"); you may
7 # not use this file except in compliance with the License. You may obtain
8 # a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 # License for the specific language governing permissions and limitations
20 # 1. Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 18-Dec-2019
24 Library OperatingSystem
27 Resource ../../lib/cli/vnfd_lib.robot
28 Resource ../../lib/cli/nsd_lib.robot
29 Resource ../../lib/cli/ns_lib.robot
30 Resource ../../lib/cli/vim_account_lib.robot
31 Library ../../lib/custom_lib.py
33 Suite Setup Prerequisite For Test
34 Suite Teardown Run Keyword And Ignore Error Test Cleanup
38 ${success_return_code} 0
45 ${vnfdPckg} hackfest_basic_vnf.tar.gz
46 ${nsdPckg} hackfest_basic_ns.tar.gz
47 ${vnfdftpPath} https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/hackfest_basic_vnf.tar.gz
48 ${nsdftpPath} https://osm-download.etsi.org/ftp/osm-5.0-five/6th-hackfest/packages/hackfest_basic_ns.tar.gz
52 Create VNF Descriptor Test
53 [Tags] comprehensive feature7921
55 ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../resource/' ${vnfdftpPath}
56 ${vnfd_id}= Create VNFD '${CURDIR}${/}../../resource${/}${vnfdPckg}'
57 Append To List ${vnfd_ids} ${vnfd_id}
60 Create NS Descriptor Test
61 [Tags] comprehensive feature7921
63 ${rc} ${stdout}= Run and Return RC and Output wget -P '${CURDIR}${/}../../resource/' ${nsdftpPath}
64 ${nsd_id}= Create VNFD '${CURDIR}${/}../../resource${/}${nsdPckg}'
65 Append To List ${nsd_ids} ${nsd_id}
68 Instanciate Network Service Test
69 [Tags] comprehensive feature7921
70 [Setup] Wait Until Keyword Succeeds 2x 30sec VIM Setup To Launch Network Services
72 :FOR ${vim_name} IN @{vim}
73 \ Launch Network Services and Return ${vim_name}
76 Delete NS Instance Test
77 [Tags] comprehensive feature7921
79 :FOR ${ns} IN @{ns_ids}
83 Delete NS Descriptor Test
84 [Tags] comprehensive feature7921
86 :FOR ${nsd} IN @{nsd_ids}
90 Delete VNF Descriptor Test
91 [Tags] comprehensive feature7921
93 :FOR ${vnfd_id} IN @{vnfd_ids}
94 \ Delete VNFD ${vnfd_id}
99 [Documentation] Update docker service to use mongodb as file system
106 ${rc} ${stdout}= Run and Return RC and Output docker service update osm_nbi --force --env-add OSMNBI_STORAGE_DRIVER=mongo --env-add OSMNBI_STORAGE_PATH=/app/storage --env-add OSMNBI_STORAGE_COLLECTION=files --env-add OSMNBI_STORAGE_URI=mongodb://mongo:27017
107 Should Be Equal As Integers ${rc} ${success_return_code}
108 Sleep 30s Wait for NBI service to be update
112 ${rc} ${stdout}= Run and Return RC and Output docker service update osm_lcm --force --env-add OSMLCM_STORAGE_DRIVER=mongo --env-add OSMLCM_STORAGE_PATH=/app/storage --env-add OSMLCM_STORAGE_COLLECTION=files --env-add OSMLCM_STORAGE_URI=mongodb://mongo:27017
113 Should Be Equal As Integers ${rc} ${success_return_code}
114 Sleep 30s Wait for LCM service to be update
118 # :FOR ${vim_id} IN @{vim}
119 # \ Delete Vim Account ${vim_id}
121 ${rc} ${stdout}= Run and Return RC and Output docker service rollback osm_nbi
122 Should Be Equal As Integers ${rc} ${success_return_code}
123 ${rc} ${stdout}= Run and Return RC and Output docker service rollback osm_lcm
124 Should Be Equal As Integers ${rc} ${success_return_code}