| calvinosanc1 | a352a93 | 2020-07-21 16:03:46 +0200 | [diff] [blame] | 1 | # Copyright 2020 Canonical Ltd. |
| 2 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | # you may not use this file except in compliance with the License. |
| 4 | # You may obtain 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, |
| 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | # See the License for the specific language governing permissions and |
| 12 | # limitations under the License. |
| 13 | |
| 14 | *** Settings *** |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 15 | Documentation [BASIC-12] NS Primitives |
| 16 | |
| calvinosanc1 | a352a93 | 2020-07-21 16:03:46 +0200 | [diff] [blame] | 17 | Library OperatingSystem |
| 18 | Library String |
| 19 | Library Collections |
| 20 | Library Process |
| 21 | |
| 22 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot |
| 23 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot |
| 24 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot |
| 25 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/packages_lib.robot |
| 26 | |
| 27 | Variables %{ROBOT_DEVOPS_FOLDER}/resources/basic_12-ns_primitives_data.py |
| 28 | |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 29 | Force Tags basic_12 cluster_ee_config daily regression |
| 30 | |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 31 | Suite Teardown Run Keyword And Ignore Error Suite Cleanup |
| calvinosanc1 | a352a93 | 2020-07-21 16:03:46 +0200 | [diff] [blame] | 32 | |
| 33 | |
| 34 | *** Variables *** |
| 35 | ${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } |
| 36 | ${publickey} ${EMPTY} |
| aguilarherna | 4de9096 | 2021-04-27 09:44:27 +0000 | [diff] [blame^] | 37 | ${success_return_code} 0 |
| 38 | |
| calvinosanc1 | a352a93 | 2020-07-21 16:03:46 +0200 | [diff] [blame] | 39 | |
| 40 | *** Test Cases *** |
| 41 | Change Juju Password |
| calvinosanc1 | a352a93 | 2020-07-21 16:03:46 +0200 | [diff] [blame] | 42 | [Documentation] NS package needs to be updated with the Juju credentials for your OSM installation |
| 43 | |
| aguilarherna | 4de9096 | 2021-04-27 09:44:27 +0000 | [diff] [blame^] | 44 | ${rc} ${stdout}= Run and Return RC and Output cp -r '%{PACKAGES_FOLDER}/${nsd_pkg}' '%{PACKAGES_FOLDER}/${new_nsd_pkg}' |
| 45 | Should Be Equal As Integers ${rc} ${success_return_code} |
| 46 | ${nsd_yaml}= Get File %{PACKAGES_FOLDER}/${new_nsd_pkg}/${nsd_file} |
| calvinosanc1 | a352a93 | 2020-07-21 16:03:46 +0200 | [diff] [blame] | 47 | ${changed_nsd_yaml}= Replace String ${nsd_yaml} ${old_juju_password} %{JUJU_PASSWORD} |
| aguilarherna | 4de9096 | 2021-04-27 09:44:27 +0000 | [diff] [blame^] | 48 | Create File %{PACKAGES_FOLDER}/${new_nsd_pkg}/${nsd_file} ${changed_nsd_yaml} |
| calvinosanc1 | a352a93 | 2020-07-21 16:03:46 +0200 | [diff] [blame] | 49 | |
| calvinosanc1 | a352a93 | 2020-07-21 16:03:46 +0200 | [diff] [blame] | 50 | Upload Vnfds |
| 51 | |
| garciadeblas | 55a5ec2 | 2020-10-07 15:33:05 +0000 | [diff] [blame] | 52 | Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg1}' |
| 53 | Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg2}' |
| calvinosanc1 | a352a93 | 2020-07-21 16:03:46 +0200 | [diff] [blame] | 54 | |
| 55 | Upload Nsd |
| 56 | |
| aguilarherna | 4de9096 | 2021-04-27 09:44:27 +0000 | [diff] [blame^] | 57 | Create NSD %{PACKAGES_FOLDER}/${new_nsd_pkg}/ |
| calvinosanc1 | a352a93 | 2020-07-21 16:03:46 +0200 | [diff] [blame] | 58 | |
| 59 | Instantiate NS |
| 60 | |
| calvinosanc1 | a352a93 | 2020-07-21 16:03:46 +0200 | [diff] [blame] | 61 | ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ns_launch_max_wait_time=40min |
| 62 | Set Suite Variable ${ns_id} ${id} |
| 63 | |
| 64 | # TODO: Check Initial Config Primitives Status |
| 65 | |
| 66 | Delete NS |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 67 | [Tags] cleanup |
| calvinosanc1 | a352a93 | 2020-07-21 16:03:46 +0200 | [diff] [blame] | 68 | |
| 69 | Delete NS ${ns_name} |
| 70 | |
| 71 | Delete NS Descriptor |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 72 | [Tags] cleanup |
| calvinosanc1 | a352a93 | 2020-07-21 16:03:46 +0200 | [diff] [blame] | 73 | |
| 74 | Delete NSD ${nsd_name} |
| aguilarherna | 4de9096 | 2021-04-27 09:44:27 +0000 | [diff] [blame^] | 75 | Delete Temporary Descriptor Folder '%{PACKAGES_FOLDER}/${new_nsd_pkg}' |
| calvinosanc1 | a352a93 | 2020-07-21 16:03:46 +0200 | [diff] [blame] | 76 | |
| 77 | Delete VNF Descriptors |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 78 | [Tags] cleanup |
| calvinosanc1 | a352a93 | 2020-07-21 16:03:46 +0200 | [diff] [blame] | 79 | |
| 80 | Delete VNFD ${vnfd_name1} |
| 81 | Delete VNFD ${vnfd_name2} |
| 82 | |
| 83 | |
| 84 | *** Keywords *** |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 85 | Suite Cleanup |
| calvinosanc1 | a352a93 | 2020-07-21 16:03:46 +0200 | [diff] [blame] | 86 | [Documentation] Test Suit Cleanup: Deleting Descriptor and instance |
| 87 | |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 88 | Run Keyword If Any Tests Failed Delete NS ${ns_name} |
| 89 | Run Keyword If Any Tests Failed Delete NSD ${nsd_name} |
| 90 | Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name1} |
| 91 | Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name2} |
| aguilarherna | 4de9096 | 2021-04-27 09:44:27 +0000 | [diff] [blame^] | 92 | Delete Temporary Descriptor Folder '%{PACKAGES_FOLDER}/${new_nsd_pkg}' |
| 93 | |
| 94 | |
| 95 | Delete Temporary Descriptor Folder |
| 96 | [Documentation] Removes the temporary package folder created for the test |
| 97 | [Arguments] ${folder_name} |
| 98 | |
| 99 | ${rc} ${stdout}= Run and Return RC and Output rm -rf '${folder_name}' |
| 100 | log ${stdout} |
| 101 | |
| 102 | |