| 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 *** |
| 16 | Library OperatingSystem |
| 17 | Library String |
| 18 | Library Collections |
| 19 | Library Process |
| 20 | |
| 21 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot |
| 22 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot |
| 23 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot |
| Dominik Fleischmann | a07c2b3 | 2020-07-31 15:17:26 +0200 | [diff] [blame] | 24 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/package_lib.robot |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 25 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/connectivity_lib.robot |
| 26 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot |
| 27 | Resource %{ROBOT_DEVOPS_FOLDER}/lib/k8scluster_lib.robot |
| 28 | |
| 29 | Variables %{ROBOT_DEVOPS_FOLDER}/resources/k8s_03-simple_k8s_data.py |
| 30 | |
| 31 | Suite Teardown Run Keyword And Ignore Error Test Cleanup |
| 32 | |
| 33 | |
| 34 | *** Variables *** |
| 35 | ${ns_id} ${EMPTY} |
| 36 | ${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] } |
| 37 | ${publickey} ${EMPTY} |
| Dominik Fleischmann | a07c2b3 | 2020-07-31 15:17:26 +0200 | [diff] [blame] | 38 | ${vnf_member_index} native_k8s_charm-vnf |
| 39 | ${action_name} changecontent |
| 40 | ${kdu_name} native-kdu |
| 41 | ${application_name} nginx |
| 42 | ${customtitle} Day 2 Action |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 43 | |
| 44 | *** Test Cases *** |
| 45 | Create Simple K8s VNF Descriptor |
| Dominik Fleischmann | b72faf3 | 2020-07-23 12:25:20 +0200 | [diff] [blame] | 46 | [Tags] simple_k8s charm sanity regression |
| Dominik Fleischmann | a07c2b3 | 2020-07-31 15:17:26 +0200 | [diff] [blame] | 47 | Upload Package '%{PACKAGES_FOLDER}/${vnfd_pkg}' |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 48 | |
| 49 | Create Simple K8s Descriptor |
| Dominik Fleischmann | b72faf3 | 2020-07-23 12:25:20 +0200 | [diff] [blame] | 50 | [Tags] simple_k8s charm sanity regression |
| Dominik Fleischmann | a07c2b3 | 2020-07-31 15:17:26 +0200 | [diff] [blame] | 51 | Upload Package '%{PACKAGES_FOLDER}/${nsd_pkg}' |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 52 | |
| 53 | Add K8s Cluster To OSM |
| calvinosanc1 | 79fcc85 | 2020-07-29 12:11:41 +0200 | [diff] [blame] | 54 | [Tags] simple_k8s charm sanity regression |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 55 | Create K8s Cluster %{K8S_CREDENTIALS} ${k8scluster_version} %{VIM_TARGET} %{VIM_MGMT_NET} ${k8scluster_name} |
| 56 | |
| 57 | Network Service K8s Instance Test |
| Dominik Fleischmann | b72faf3 | 2020-07-23 12:25:20 +0200 | [diff] [blame] | 58 | [Tags] simple_k8s charm sanity regression |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 59 | ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} |
| 60 | Set Suite Variable ${ns_id} ${id} |
| 61 | |
| Dominik Fleischmann | a07c2b3 | 2020-07-31 15:17:26 +0200 | [diff] [blame] | 62 | Execute Day 2 Operations |
| 63 | [Documentation] Performs one Day 2 operation per VNF that creates a new file. |
| 64 | [Tags] simple_k8s charm sanity regression |
| 65 | |
| 66 | Variable Should Exist ${ns_id} msg=Network service instance is not available |
| 67 | ${ns_op_id}= Execute NS K8s Action ${ns_name} ${action_name} ${vnf_member_index} ${kdu_name} application-name=${application_name} customtitle=${customtitle} |
| 68 | |
| 69 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 70 | Delete NS K8s Instance Test |
| Dominik Fleischmann | b72faf3 | 2020-07-23 12:25:20 +0200 | [diff] [blame] | 71 | [Tags] simple_k8s charm sanity regression cleanup |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 72 | Delete NS ${ns_name} |
| 73 | |
| 74 | Remove K8s Cluster from OSM |
| calvinosanc1 | 79fcc85 | 2020-07-29 12:11:41 +0200 | [diff] [blame] | 75 | [Tags] simple_k8s charm sanity regression |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 76 | Delete K8s Cluster ${k8scluster_name} |
| 77 | |
| 78 | Delete NS Descriptor Test |
| Dominik Fleischmann | b72faf3 | 2020-07-23 12:25:20 +0200 | [diff] [blame] | 79 | [Tags] simple_k8s charm sanity regression cleanup |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 80 | Delete NSD ${nsd_name} |
| 81 | |
| 82 | Delete VNF Descriptor Test |
| Dominik Fleischmann | b72faf3 | 2020-07-23 12:25:20 +0200 | [diff] [blame] | 83 | [Tags] simple_k8s charm sanity regression cleanup |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 84 | Delete VNFD ${vnfd_name} |
| 85 | |
| Dominik Fleischmann | a07c2b3 | 2020-07-31 15:17:26 +0200 | [diff] [blame] | 86 | Delete VNF NS Packages |
| 87 | [Tags] simple_k8s charm sanity regression cleanup |
| 88 | Delete Package '%{PACKAGES_FOLDER}/${vnfd_pkg}' |
| 89 | Delete Package '%{PACKAGES_FOLDER}/${nsd_pkg}' |
| 90 | |
| Felipe Vicens | f96bb45 | 2020-06-22 08:12:30 +0200 | [diff] [blame] | 91 | |
| 92 | *** Keywords *** |
| 93 | Test Cleanup |
| 94 | [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim |
| 95 | Run Keyword If Test Failed Delete NS ${ns_name} |
| 96 | Run Keyword If Test Failed Delete NSD ${nsd_name} |
| 97 | Run Keyword If Test Failed Delete VNFD ${vnfd_name} |
| calvinosanc1 | 79fcc85 | 2020-07-29 12:11:41 +0200 | [diff] [blame] | 98 | Run Keyword If Test Failed Delete K8s Cluster ${k8scluster_name} |