Bug 2327 fix to verify ipaddress in sol003_02 testsuite
[osm/tests.git] / robot-systest / testsuite / k8s_09-pebble_charm_k8s.robot
1 *** Comments ***
2 #   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
16
17 *** Settings ***
18 Documentation   [K8s-09] Pebble Charm.
19
20 Library   OperatingSystem
21 Library   String
22 Library   Collections
23 Library   Process
24
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
33
34 Test Tags   k8s_09   cluster_k8s   regression   azure
35
36 Suite Teardown   Run Keyword And Ignore Error   Suite Cleanup
37
38
39 *** Variables ***
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
45
46 # NS instance name and configuration
47 ${NS_NAME}   pebble-charm-k8s
48 ${NS_CONFIG}   {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
49
50 ${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
57
58 *** Test Cases ***
59 Create Simple K8s VNF Descriptor
60     [Documentation]   Upload VNF package for the testsuite.
61     Create VNFD   '%{PACKAGES_FOLDER}/${VNFD_PKG}'
62
63 Create Simple K8s Descriptor
64     [Documentation]   Upload NS package for the testsuite.
65     Create NSD   '%{PACKAGES_FOLDER}/${NSD_PKG}'
66
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}
71
72 Execute Day 2 Operations
73     [Documentation]   Performs one Day 2 operation per VNF that creates a new file.
74
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}
77     Log   ${ns_op_id}
78
79 Delete NS K8s Instance Test
80     [Documentation]   Delete NS instance.
81     [Tags]   cleanup
82     Delete NS   ${NS_NAME}
83
84 Delete NS Descriptor Test
85     [Documentation]   Delete the NS package.
86     [Tags]   cleanup
87     Delete NSD   ${NSD_NAME}
88
89 Delete VNF Descriptor Test
90     [Documentation]   Delete the VNF package.
91     [Tags]   cleanup
92     Delete VNFD   ${VNFD_NAME}
93
94 Delete VNF NS Packages
95     [Documentation]   Delete the tar.gz files associated to the VNF and NS packages.
96     [Tags]   cleanup
97     Delete Package   '%{PACKAGES_FOLDER}/${VNFD_PKG}'
98     Delete Package   '%{PACKAGES_FOLDER}/${NSD_PKG}'
99
100
101 *** Keywords ***
102 Suite Cleanup
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}