| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 1 | *** Comments *** |
| Dominik Fleischmann | b72faf3 | 2020-07-23 12:25:20 +0200 | [diff] [blame] | 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 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 14 | |
| Dominik Fleischmann | b72faf3 | 2020-07-23 12:25:20 +0200 | [diff] [blame] | 15 | *** Settings *** |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 16 | Documentation [BASIC-13] NS Relations |
| Dominik Fleischmann | b72faf3 | 2020-07-23 12:25:20 +0200 | [diff] [blame] | 17 | |
| 18 | Library OperatingSystem |
| 19 | Library SSHLibrary |
| 20 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 21 | Resource ../lib/vnfd_lib.resource |
| 22 | Resource ../lib/nsd_lib.resource |
| 23 | Resource ../lib/ns_lib.resource |
| 24 | Resource ../lib/ssh_lib.resource |
| Dominik Fleischmann | b72faf3 | 2020-07-23 12:25:20 +0200 | [diff] [blame] | 25 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 26 | Test Tags basic_13 cluster_ee_config cluster_relations regression azure |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 27 | |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 28 | Suite Teardown Run Keyword And Ignore Error Suite Cleanup |
| Dominik Fleischmann | b72faf3 | 2020-07-23 12:25:20 +0200 | [diff] [blame] | 29 | |
| 30 | |
| 31 | *** Variables *** |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 32 | # NS and VNF descriptor package folder and ids |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 33 | ${VNFD_PKG1} charm-packages/ns_relations_provides_vnf |
| 34 | ${VNFD_PKG2} charm-packages/ns_relations_requires_vnf |
| 35 | ${VNFD_NAME1} ns_relations_provides-vnf |
| 36 | ${VNFD_NAME2} ns_relations_requires-vnf |
| 37 | ${NSD_PKG} charm-packages/ns_relations_ns |
| 38 | ${NSD_NAME} ns_relations-ns |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 39 | |
| 40 | # NS instance name and configuration |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 41 | ${NS_NAME} basic_13_ns_relations_test |
| 42 | ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } |
| 43 | ${NS_TIMEOUT} 15min |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 44 | |
| 45 | # SSH keys and username to be used |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 46 | ${PUBLICKEY} %{HOME}/.ssh/id_rsa.pub |
| 47 | ${PRIVATEKEY} %{HOME}/.ssh/id_rsa |
| 48 | ${USERNAME} ubuntu |
| 49 | ${PASSWORD} ${EMPTY} |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 50 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 51 | ${ACTION_NAME} touch |
| 52 | ${VNF_MEMBER_INDEX_1} vnf1 |
| 53 | ${VNF_MEMBER_INDEX_2} vnf2 |
| 54 | ${DAY_1_FILE_NAME} /home/ubuntu/first-touch |
| 55 | ${DAY_2_FILE_NAME_1} /home/ubuntu/mytouch1 |
| 56 | ${DAY_2_FILE_NAME_2} /home/ubuntu/mytouch2 |
| Dominik Fleischmann | b72faf3 | 2020-07-23 12:25:20 +0200 | [diff] [blame] | 57 | |
| 58 | |
| 59 | *** Test Cases *** |
| 60 | Create Charm VNF Descriptor Provides |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 61 | [Documentation] Upload VNF package for the testsuite with a charm providing a relation. |
| 62 | Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG1}' |
| Dominik Fleischmann | b72faf3 | 2020-07-23 12:25:20 +0200 | [diff] [blame] | 63 | |
| 64 | Create Charm VNF Descriptor Requires |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 65 | [Documentation] Upload VNF package for the testsuite with a charm requiring a relation. |
| 66 | Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG2}' |
| Dominik Fleischmann | b72faf3 | 2020-07-23 12:25:20 +0200 | [diff] [blame] | 67 | |
| 68 | Create Charm NS Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 69 | [Documentation] Upload NS package for the testsuite. |
| 70 | Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}' |
| Dominik Fleischmann | b72faf3 | 2020-07-23 12:25:20 +0200 | [diff] [blame] | 71 | |
| 72 | Instantiate Charm Network Service |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 73 | [Documentation] Instantiate NS for the testsuite. |
| 74 | ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY} ${NS_TIMEOUT} |
| 75 | Set Suite Variable ${NS_ID} ${id} |
| Dominik Fleischmann | b72faf3 | 2020-07-23 12:25:20 +0200 | [diff] [blame] | 76 | |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 77 | # TODO: Check juju status for relations |
| Dominik Fleischmann | b72faf3 | 2020-07-23 12:25:20 +0200 | [diff] [blame] | 78 | |
| 79 | Delete NS Instance |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 80 | [Documentation] Delete NS instance. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 81 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 82 | Delete NS ${NS_NAME} |
| Dominik Fleischmann | b72faf3 | 2020-07-23 12:25:20 +0200 | [diff] [blame] | 83 | |
| 84 | Delete NS Descriptor |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 85 | [Documentation] Delete NS package from OSM. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 86 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 87 | Delete NSD ${NSD_NAME} |
| Dominik Fleischmann | b72faf3 | 2020-07-23 12:25:20 +0200 | [diff] [blame] | 88 | |
| 89 | Delete VNF Descriptor Provides |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 90 | [Documentation] Delete first VNF package from OSM. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 91 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 92 | Delete VNFD ${VNFD_NAME1} |
| Dominik Fleischmann | b72faf3 | 2020-07-23 12:25:20 +0200 | [diff] [blame] | 93 | |
| 94 | Delete VNF Descriptor Requires |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 95 | [Documentation] Delete second VNF package from OSM. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 96 | [Tags] cleanup |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 97 | Delete VNFD ${VNFD_NAME2} |
| Dominik Fleischmann | b72faf3 | 2020-07-23 12:25:20 +0200 | [diff] [blame] | 98 | |
| 99 | |
| 100 | *** Keywords *** |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 101 | Suite Cleanup |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 102 | [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance |
| garciadeblas | 7a9e031 | 2023-12-11 22:24:46 +0100 | [diff] [blame] | 103 | Run Keyword If Any Tests Failed Delete NS ${NS_NAME} |
| 104 | Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME} |
| 105 | Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME1} |
| 106 | Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME2} |