Use case-sensitive keyword Log instead of log
[osm/tests.git] / robot-systest / testsuite / basic_26-secure_helm_execution_environment.robot
1 #   Licensed under the Apache License, Version 2.0 (the "License");
2 #   you may not use this file except in compliance with the License.
3 #   You may obtain a copy of the License at
4 #
5 #       http://www.apache.org/licenses/LICENSE-2.0
6 #
7 #   Unless required by applicable law or agreed to in writing, software
8 #   distributed under the License is distributed on an "AS IS" BASIS,
9 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 #   See the License for the specific language governing permissions and
11 #   limitations under the License.
12
13 *** Settings ***
14 Documentation   [BASIC-26] Secure connection to helm execution environments.
15
16 Library   OperatingSystem
17 Library   SSHLibrary
18
19 Resource   %{ROBOT_DEVOPS_FOLDER}/lib/vnfd_lib.robot
20 Resource   %{ROBOT_DEVOPS_FOLDER}/lib/nsd_lib.robot
21 Resource   %{ROBOT_DEVOPS_FOLDER}/lib/ns_lib.robot
22 Resource   %{ROBOT_DEVOPS_FOLDER}/lib/ssh_lib.robot
23
24 Force Tags   basic_26   cluster_ee_config   daily   regression
25
26 Suite Teardown   Run Keyword And Ignore Error   Suite Cleanup
27
28
29 *** Variables ***
30 # NS and VNF descriptor package folder and ids
31 ${vnfd_pkg}   simple_secure_ee_vnf
32 ${vnfd_name}   simple_secure_ee-vnf
33 ${nsd_pkg}   simple_secure_ee_ns
34 ${nsd_name}   simple_secure_ee-ns
35
36 # NS instance name and configuration
37 ${ns_name}   basic_26_secure_helm_ee_test
38 ${ns_config}   {vld: [ {name: mgmtnet, vim-network-name: %{VIM_MGMT_NET}} ] }
39
40 # SSH keys and username to be used
41 ${publickey}   %{HOME}/.ssh/id_rsa.pub
42 ${privatekey}   %{HOME}/.ssh/id_rsa
43 ${username}   ubuntu
44 ${password}   ${EMPTY}
45
46 ${action_name}   touch
47 ${new_action_name}   mkdir
48 ${vnf_member_index}   simple
49 ${day_1_file_name}   /home/ubuntu/first-touch
50 ${ns_timeout}   15min
51
52
53 *** Test Cases ***
54 Create VNF Descriptor
55
56     ${id}=   Create VNFD   '%{PACKAGES_FOLDER}/${vnfd_pkg}'
57     Set Suite Variable   ${vnfd_id}   ${id}
58
59
60 Create NS Descriptor
61
62     Create NSD   '%{PACKAGES_FOLDER}/${nsd_pkg}'
63
64
65 Instantiate Network Service
66
67     ${id}=   Create Network Service   ${nsd_name}   %{VIM_TARGET}   ${ns_name}   ${ns_config}   ${publickey}   ${ns_timeout}
68     Set Suite Variable   ${ns_id}   ${id}
69
70
71 Get Management Ip Address
72
73     ${ip_addr}   Get Vnf Management Ip Address   ${ns_id}   ${vnf_member_index}
74     Log   ${ip_addr}
75     Set Suite Variable   ${vnf_ip_addr}   ${ip_addr}
76
77
78 Test SSH Access
79
80     Variable Should Exist   ${vnf_ip_addr}   msg=IP address of the management VNF '${vnf_member_index}' is not available
81     Sleep   30s   Waiting ssh daemon to be up
82     Test SSH Connection   ${vnf_ip_addr}   ${username}   ${password}   ${privatekey}
83
84
85 Check Remote File Created Via Day 1 Operation
86     [Documentation]   Check whether the file created in the previous test via Day 1 operations exist or not.
87
88     Check If remote File Exists   ${vnf_ip_addr}   ${username}   ${password}   ${privatekey}   ${day_1_file_name}
89
90
91 Delete NS Instance
92     [Tags]   cleanup
93
94     Delete NS   ${ns_name}
95
96
97 Delete NS Descriptor
98     [Tags]   cleanup
99
100     Delete NSD   ${nsd_name}
101
102
103 Delete VNF Descriptor
104     [Tags]   cleanup
105
106     Delete VNFD   ${vnfd_name}
107
108
109 *** Keywords ***
110 Suite Cleanup
111     [Documentation]   Test Suite Cleanup: Deleting descriptors and NS instance
112
113     Run Keyword If Any Tests Failed   Delete NS   ${ns_name}
114
115     Run Keyword If Any Tests Failed   Delete NSD   ${nsd_name}
116
117     Run Keyword If Any Tests Failed   Delete VNFD   ${vnfd_name}
118