2 # Copyright 2020 Canonical Ltd.
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
18 Documentation [K8s-09] Pebble Charm.
20 Library OperatingSystem
25 Resource ../lib/vnfd_lib.resource
26 Resource ../lib/nsd_lib.resource
27 Resource ../lib/ns_lib.resource
28 Resource ../lib/ns_operation_lib.resource
29 Resource ../lib/package_lib.resource
30 Resource ../lib/connectivity_lib.resource
31 Resource ../lib/ssh_lib.resource
32 Resource ../lib/k8scluster_lib.resource
34 Test Tags k8s_09 cluster_k8s regression azure
36 Suite Teardown Run Keyword And Ignore Error Suite Cleanup
40 # NS and VNF descriptor package folder and ids
41 ${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
46 # NS instance name and configuration
47 ${NS_NAME} pebble-charm-k8s
48 ${NS_CONFIG} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
52 ${VNF_MEMBER_INDEX} pebble_charm-vnf
53 ${ACTION_NAME} list-available-apps
55 ${APPLICATION_NAME} onos
59 Create Simple K8s VNF Descriptor
60 [Documentation] Upload VNF package for the testsuite.
61 Create VNFD '%{PACKAGES_FOLDER}/${VNFD_PKG}'
63 Create Simple K8s Descriptor
64 [Documentation] Upload NS package for the testsuite.
65 Create NSD '%{PACKAGES_FOLDER}/${NSD_PKG}'
67 Network Service K8s Instance Test
68 [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}
72 Execute Day 2 Operations
73 [Documentation] Performs one Day 2 operation per VNF that creates a new file.
75 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}
79 Delete NS K8s Instance Test
80 [Documentation] Delete NS instance.
84 Delete NS Descriptor Test
85 [Documentation] Delete the NS package.
87 Delete NSD ${NSD_NAME}
89 Delete VNF Descriptor Test
90 [Documentation] Delete the VNF package.
92 Delete VNFD ${VNFD_NAME}
94 Delete VNF NS Packages
95 [Documentation] Delete the tar.gz files associated to the VNF and NS packages.
97 Delete Package '%{PACKAGES_FOLDER}/${VNFD_PKG}'
98 Delete Package '%{PACKAGES_FOLDER}/${NSD_PKG}'
103 [Documentation] Test Suit Cleanup: Deleting Descriptor, instance and vim
104 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}