blob: a6838eac490c0e5430a68cdbd77b038714e1cd40 [file] [log] [blame]
garciadeblas7a9e0312023-12-11 22:24:46 +01001*** Comments ***
calvinosanc179fcc852020-07-29 12:11:41 +02002# Copyright 2020 Canonical Ltd.
3#
Felipe Vicensf96bb452020-06-22 08:12:30 +02004# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
garciadeblas7a9e0312023-12-11 22:24:46 +010016
Felipe Vicensf96bb452020-06-22 08:12:30 +020017*** Settings ***
garciadeblasf4ebaa82022-06-23 13:33:26 +020018Documentation [K8s-03] Simple K8s.
garciadeblas4cf45d72021-04-08 13:52:22 +020019
Felipe Vicensf96bb452020-06-22 08:12:30 +020020Library OperatingSystem
21Library String
22Library Collections
23Library Process
24
garciadeblas7a9e0312023-12-11 22:24:46 +010025Resource ../lib/vnfd_lib.resource
26Resource ../lib/nsd_lib.resource
27Resource ../lib/ns_lib.resource
28Resource ../lib/ns_operation_lib.resource
29Resource ../lib/package_lib.resource
30Resource ../lib/connectivity_lib.resource
31Resource ../lib/ssh_lib.resource
32Resource ../lib/k8scluster_lib.resource
Felipe Vicensf96bb452020-06-22 08:12:30 +020033
garciadeblas7a9e0312023-12-11 22:24:46 +010034Test Tags k8s_03 cluster_k8s regression azure
garciadeblas4cf45d72021-04-08 13:52:22 +020035
garciadeblasd225e552020-10-02 16:10:14 +000036Suite Teardown Run Keyword And Ignore Error Suite Cleanup
Felipe Vicensf96bb452020-06-22 08:12:30 +020037
38
39*** Variables ***
almagiab4697d32021-05-25 08:56:17 +020040# NS and VNF descriptor package folder and ids
garciadeblas7a9e0312023-12-11 22:24:46 +010041${VNFD_PKG} charm-packages/native_k8s_charm_vnf
42${VNFD_NAME} native_k8s_charm-vnf
43${NSD_PKG} charm-packages/native_k8s_charm_ns
44${NSD_NAME} native_k8s_charm-ns
almagiab4697d32021-05-25 08:56:17 +020045
46# NS instance name and configuration
garciadeblas7a9e0312023-12-11 22:24:46 +010047${NS_NAME} native-k8s
48${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
almagiab4697d32021-05-25 08:56:17 +020049
garciadeblas7a9e0312023-12-11 22:24:46 +010050${NS_ID} ${EMPTY}
51${PUBLICKEY} ${EMPTY}
52${VNF_MEMBER_INDEX} native_k8s_charm-vnf
53${ACTION_NAME} changecontent
54${KDU_NAME} native-kdu
55${APPLICATION_NAME} nginx
56${CUSTOMTITLE} Day 2 Action
57
Felipe Vicensf96bb452020-06-22 08:12:30 +020058
59*** Test Cases ***
60Create Simple K8s VNF Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010061 [Documentation] Upload NF package for the testsuite.
62 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
Felipe Vicensf96bb452020-06-22 08:12:30 +020063
64Create Simple K8s Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010065 [Documentation] Upload NS package for the testsuite.
66 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
Felipe Vicensf96bb452020-06-22 08:12:30 +020067
Felipe Vicensf96bb452020-06-22 08:12:30 +020068Network Service K8s Instance Test
garciadeblas7a9e0312023-12-11 22:24:46 +010069 [Documentation] Instantiate NS for the testsuite.
70 ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY}
71 Set Suite Variable ${NS_ID} ${id}
Felipe Vicensf96bb452020-06-22 08:12:30 +020072
Dominik Fleischmanna07c2b32020-07-31 15:17:26 +020073Execute Day 2 Operations
garciadeblasf4ebaa82022-06-23 13:33:26 +020074 [Documentation] Performs one Day 2 operation per VNF that creates a new file.
garciadeblas7a9e0312023-12-11 22:24:46 +010075 Variable Should Exist ${NS_ID} msg=Network service instance is not available
76 ${ns_op_id}= Execute NS K8s Action ${NS_NAME} ${ACTION_NAME} ${VNF_MEMBER_INDEX} ${KDU_NAME} application-name=${APPLICATION_NAME} customtitle=${CUSTOMTITLE}
77 Log ${ns_op_id}
Dominik Fleischmanna07c2b32020-07-31 15:17:26 +020078
Felipe Vicensf96bb452020-06-22 08:12:30 +020079Delete NS K8s Instance Test
garciadeblas7a9e0312023-12-11 22:24:46 +010080 [Documentation] Delete NS instance.
garciadeblas4cf45d72021-04-08 13:52:22 +020081 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010082 Delete NS ${NS_NAME}
Felipe Vicensf96bb452020-06-22 08:12:30 +020083
Felipe Vicensf96bb452020-06-22 08:12:30 +020084Delete NS Descriptor Test
garciadeblas7a9e0312023-12-11 22:24:46 +010085 [Documentation] Delete NS package from OSM.
garciadeblas4cf45d72021-04-08 13:52:22 +020086 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010087 Delete NSD ${NSD_NAME}
Felipe Vicensf96bb452020-06-22 08:12:30 +020088
89Delete VNF Descriptor Test
garciadeblas7a9e0312023-12-11 22:24:46 +010090 [Documentation] Delete NF package from OSM.
garciadeblas4cf45d72021-04-08 13:52:22 +020091 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010092 Delete VNFD ${VNFD_NAME}
Felipe Vicensf96bb452020-06-22 08:12:30 +020093
Dominik Fleischmanna07c2b32020-07-31 15:17:26 +020094Delete VNF NS Packages
garciadeblas7a9e0312023-12-11 22:24:46 +010095 [Documentation] Delete tar.gz NF and NS package files.
garciadeblas4cf45d72021-04-08 13:52:22 +020096 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010097 Delete Package '%{PACKAGES_FOLDER}/${VNFD_PKG}'
98 Delete Package '%{PACKAGES_FOLDER}/${NSD_PKG}'
Dominik Fleischmanna07c2b32020-07-31 15:17:26 +020099
Felipe Vicensf96bb452020-06-22 08:12:30 +0200100
101*** Keywords ***
garciadeblasd225e552020-10-02 16:10:14 +0000102Suite Cleanup
garciadeblasf4ebaa82022-06-23 13:33:26 +0200103 [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim
garciadeblas7a9e0312023-12-11 22:24:46 +0100104 Run Keyword If Any Tests Failed Delete NS ${NS_NAME}
105 Run Keyword If Any Tests Failed Delete NSD ${NSD_NAME}
106 Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME}