blob: 40c4ddbb5efb1b0454fd74d0882f58486dff0d25 [file] [log] [blame]
garciadeblas7a9e0312023-12-11 22:24:46 +01001*** Comments ***
David Garcia88b9ab32021-08-20 14:24:38 +02002# Copyright 2020 Canonical Ltd.
3#
4# 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
David Garcia88b9ab32021-08-20 14:24:38 +020017*** Settings ***
garciadeblasf4ebaa82022-06-23 13:33:26 +020018Documentation [K8s-09] Pebble Charm.
David Garcia88b9ab32021-08-20 14:24:38 +020019
20Library 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
David Garcia88b9ab32021-08-20 14:24:38 +020033
garciadeblas7a9e0312023-12-11 22:24:46 +010034Test Tags k8s_09 cluster_k8s regression azure
David Garcia88b9ab32021-08-20 14:24:38 +020035
36Suite Teardown Run Keyword And Ignore Error Suite Cleanup
37
38
39*** Variables ***
David Garcia88b9ab32021-08-20 14:24:38 +020040# NS and VNF descriptor package folder and ids
garciadeblas7a9e0312023-12-11 22:24:46 +010041${VNFD_PKG} charm-packages/pebble_charm_vnf
42${VNFD_NAME} pebble_charm-vnf
43${NSD_PKG} charm-packages/pebble_charm_ns
44${NSD_NAME} pebble_charm-ns
David Garcia88b9ab32021-08-20 14:24:38 +020045
46# NS instance name and configuration
garciadeblas7a9e0312023-12-11 22:24:46 +010047${NS_NAME} pebble-charm-k8s
48${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
David Garcia88b9ab32021-08-20 14:24:38 +020049
garciadeblas7a9e0312023-12-11 22:24:46 +010050${NS_ID} ${EMPTY}
51${PUBLICKEY} ${EMPTY}
52${VNF_MEMBER_INDEX} pebble_charm-vnf
53${ACTION_NAME} list-available-apps
54${KDU_NAME} onos-kdu
55${APPLICATION_NAME} onos
56
David Garcia88b9ab32021-08-20 14:24:38 +020057
58*** Test Cases ***
59Create Simple K8s VNF Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010060 [Documentation] Upload VNF package for the testsuite.
61 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
David Garcia88b9ab32021-08-20 14:24:38 +020062
63Create Simple K8s Descriptor
garciadeblas7a9e0312023-12-11 22:24:46 +010064 [Documentation] Upload NS package for the testsuite.
65 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
David Garcia88b9ab32021-08-20 14:24:38 +020066
David Garcia88b9ab32021-08-20 14:24:38 +020067Network Service K8s Instance Test
garciadeblas7a9e0312023-12-11 22:24:46 +010068 [Documentation] Instantiate NS for the testsuite.
69 ${id}= Create Network Service ${NSD_NAME} %{VIM_TARGET} ${NS_NAME} ${NS_CONFIG} ${PUBLICKEY}
70 Set Suite Variable ${NS_ID} ${id}
David Garcia88b9ab32021-08-20 14:24:38 +020071
72Execute Day 2 Operations
garciadeblasf4ebaa82022-06-23 13:33:26 +020073 [Documentation] Performs one Day 2 operation per VNF that creates a new file.
David Garcia88b9ab32021-08-20 14:24:38 +020074
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}
77 Log ${ns_op_id}
David Garcia88b9ab32021-08-20 14:24:38 +020078
79Delete NS K8s Instance Test
garciadeblas7a9e0312023-12-11 22:24:46 +010080 [Documentation] Delete NS instance.
David Garcia88b9ab32021-08-20 14:24:38 +020081 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010082 Delete NS ${NS_NAME}
David Garcia88b9ab32021-08-20 14:24:38 +020083
David Garcia88b9ab32021-08-20 14:24:38 +020084Delete NS Descriptor Test
garciadeblas7a9e0312023-12-11 22:24:46 +010085 [Documentation] Delete the NS package.
David Garcia88b9ab32021-08-20 14:24:38 +020086 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010087 Delete NSD ${NSD_NAME}
David Garcia88b9ab32021-08-20 14:24:38 +020088
89Delete VNF Descriptor Test
garciadeblas7a9e0312023-12-11 22:24:46 +010090 [Documentation] Delete the VNF package.
David Garcia88b9ab32021-08-20 14:24:38 +020091 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010092 Delete VNFD ${VNFD_NAME}
David Garcia88b9ab32021-08-20 14:24:38 +020093
94Delete VNF NS Packages
garciadeblas7a9e0312023-12-11 22:24:46 +010095 [Documentation] Delete the tar.gz files associated to the VNF and NS packages.
David Garcia88b9ab32021-08-20 14:24:38 +020096 [Tags] cleanup
garciadeblas7a9e0312023-12-11 22:24:46 +010097 Delete Package '%{PACKAGES_FOLDER}/${VNFD_PKG}'
98 Delete Package '%{PACKAGES_FOLDER}/${NSD_PKG}'
David Garcia88b9ab32021-08-20 14:24:38 +020099
100
101*** Keywords ***
102Suite 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}