| calvinosanc1 | 79fcc85 | 2020-07-29 12:11:41 +0200 | [diff] [blame] | 1 | # Copyright 2020 Canonical Ltd. |
| 2 | # |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | *** Settings *** |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 16 | Documentation [K8s-03] Simple K8s. |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 17 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 18 | Library OperatingSystem |
| 19 | Library String |
| 20 | Library Collections |
| 21 | Library Process |
| 22 | |
| 23 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot |
| 24 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot |
| 25 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot |
| Dominik Fleischmann | a07c2b3 | 2020-07-31 15:17:26 +0200 | [diff] [blame] | 26 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/package_lib.robot |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 27 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/connectivity_lib.robot |
| 28 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot |
| 29 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/k8scluster_lib.robot |
| 30 | |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 31 | Force Tags k8s_03 cluster_k8s daily regression sanity |
| 32 | |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 33 | Suite Teardown Run Keyword And Ignore Error Suite Cleanup |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 34 | |
| 35 | |
| 36 | *** Variables *** |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 37 | # NS and VNF descriptor package folder and ids |
| 38 | ${vnfd_pkg} charm-packages/native_k8s_charm_vnf |
| 39 | ${vnfd_name} native_k8s_charm-vnf |
| 40 | ${nsd_pkg} charm-packages/native_k8s_charm_ns |
| 41 | ${nsd_name} native_k8s_charm-ns |
| 42 | |
| 43 | # NS instance name and configuration |
| 44 | ${ns_name} native-k8s |
| aguilarherna | c0b3a8e | 2021-05-12 08:56:23 +0000 | [diff] [blame] | 45 | ${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } |
| almagia | b4697d3 | 2021-05-25 08:56:17 +0200 | [diff] [blame] | 46 | |
| 47 | ${ns_id} ${EMPTY} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 48 | ${publickey} ${EMPTY} |
| Dominik Fleischmann | a07c2b3 | 2020-07-31 15:17:26 +0200 | [diff] [blame] | 49 | ${vnf_member_index} native_k8s_charm-vnf |
| 50 | ${action_name} changecontent |
| 51 | ${kdu_name} native-kdu |
| 52 | ${application_name} nginx |
| 53 | ${customtitle} Day 2 Action |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 54 | |
| 55 | *** Test Cases *** |
| 56 | Create Simple K8s VNF Descriptor |
| garciadeblas | 58d8de1 | 2021-03-23 10:39:44 +0100 | [diff] [blame] | 57 | Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}' |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 58 | |
| 59 | Create Simple K8s Descriptor |
| garciadeblas | 58d8de1 | 2021-03-23 10:39:44 +0100 | [diff] [blame] | 60 | Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}' |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 61 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 62 | Network Service K8s Instance Test |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 63 | ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 64 | Set Suite Variable ${ns_id} ${id} |
| 65 | |
| Dominik Fleischmann | a07c2b3 | 2020-07-31 15:17:26 +0200 | [diff] [blame] | 66 | Execute Day 2 Operations |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 67 | [Documentation] Performs one Day 2 operation per VNF that creates a new file. |
| Dominik Fleischmann | a07c2b3 | 2020-07-31 15:17:26 +0200 | [diff] [blame] | 68 | |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 69 | Variable Should Exist ${ns_id} msg=Network service instance is not available |
| 70 | ${ns_op_id}= Execute NS K8s Action ${ns_name} ${action_name} ${vnf_member_index} ${kdu_name} application-name=${application_name} customtitle=${customtitle} |
| Dominik Fleischmann | a07c2b3 | 2020-07-31 15:17:26 +0200 | [diff] [blame] | 71 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 72 | Delete NS K8s Instance Test |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 73 | [Tags] cleanup |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 74 | Delete NS ${ns_name} |
| 75 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 76 | Delete NS Descriptor Test |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 77 | [Tags] cleanup |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 78 | Delete NSD ${nsd_name} |
| 79 | |
| 80 | Delete VNF Descriptor Test |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 81 | [Tags] cleanup |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 82 | Delete VNFD ${vnfd_name} |
| 83 | |
| Dominik Fleischmann | a07c2b3 | 2020-07-31 15:17:26 +0200 | [diff] [blame] | 84 | Delete VNF NS Packages |
| garciadeblas | 4cf45d7 | 2021-04-08 13:52:22 +0200 | [diff] [blame] | 85 | [Tags] cleanup |
| Dominik Fleischmann | a07c2b3 | 2020-07-31 15:17:26 +0200 | [diff] [blame] | 86 | Delete Package '%{PACKAGES_FOLDER}/${vnfd_pkg}' |
| 87 | Delete Package '%{PACKAGES_FOLDER}/${nsd_pkg}' |
| 88 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 89 | |
| 90 | *** Keywords *** |
| garciadeblas | d225e55 | 2020-10-02 16:10:14 +0000 | [diff] [blame] | 91 | Suite Cleanup |
| garciadeblas | f4ebaa8 | 2022-06-23 13:33:26 +0200 | [diff] [blame] | 92 | [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim |
| 93 | Run Keyword If Any Tests Failed Delete NS ${ns_name} |
| 94 | Run Keyword If Any Tests Failed Delete NSD ${nsd_name} |
| 95 | Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name} |