1 # Copyright 2020 Canonical Ltd.
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
16 Documentation [K8s-09] Pebble Charm.
18 Library OperatingSystem
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
26 Resource %{ROBOT_DEVOPS_FOLDER}/lib/package_lib.robot
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
31 Force Tags k8s_09 cluster_k8s daily regression
33 Suite Teardown Run Keyword And Ignore Error Suite Cleanup
37 # NS and VNF descriptor package folder and ids
38 ${vnfd_pkg} charm-packages/pebble_charm_vnf
39 ${vnfd_name} pebble_charm-vnf
40 ${nsd_pkg} charm-packages/pebble_charm_ns
41 ${nsd_name} pebble_charm-ns
43 # NS instance name and configuration
44 ${ns_name} pebble-charm-k8s
45 ${ns_config} {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
49 ${vnf_member_index} pebble_charm-vnf
50 ${action_name} list-available-apps
52 ${application_name} onos
53 ${customtitle} Day 2 Action
56 Create Simple K8s VNF Descriptor
57 Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}'
59 Create Simple K8s Descriptor
60 Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}'
62 Network Service K8s Instance Test
63 ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey}
64 Set Suite Variable ${ns_id} ${id}
66 Execute Day 2 Operations
67 [Documentation] Performs one Day 2 operation per VNF that creates a new file.
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}
72 Delete NS K8s Instance Test
76 Delete NS Descriptor Test
78 Delete NSD ${nsd_name}
80 Delete VNF Descriptor Test
82 Delete VNFD ${vnfd_name}
84 Delete VNF NS Packages
86 Delete Package '%{PACKAGES_FOLDER}/${vnfd_pkg}'
87 Delete Package '%{PACKAGES_FOLDER}/${nsd_pkg}'
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}