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
5 # http://www.apache.org/licenses/LICENSE-2.0
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.
14 Documentation [BASIC-26] Secure connection to helm execution environments.
16 Library OperatingSystem
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
24 Force Tags basic_26 cluster_ee_config daily regression
26 Suite Teardown Run Keyword And Ignore Error Suite Cleanup
30 # NS and VNF descriptor package folder and ids
31 ${vnfd_pkg} simple_ee_vnf
32 ${vnfd_name} simple_ee-vnf
33 ${nsd_pkg} simple_ee_ns
34 ${nsd_name} simple_ee-ns
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}} ] }
41 # SSH keys and username to be used to connect to the VNF
44 ${publickey} %{HOME}/.ssh/id_rsa.pub
45 ${privatekey} %{OSM_RSA_FILE}
47 # SSH keys and username to be used to connect to OSM VM
48 ${osm_host} %{OSM_HOSTNAME}
49 ${osm_username} ubuntu
50 ${osm_password} ${EMPTY}
51 ${osm_privatekey} %{OSM_RSA_FILE}
53 # Variables related to day1 and day2
55 ${new_action_name} mkdir
56 ${vnf_member_index} simple
57 ${day_1_file_name} /home/ubuntu/first-touch
63 ${id}= Create VNFD '%{PACKAGES_FOLDER}/${vnfd_pkg}'
64 Set Suite Variable ${vnfd_id} ${id}
69 Create NSD '%{PACKAGES_FOLDER}/${nsd_pkg}'
72 Instantiate Network Service
74 ${id}= Create Network Service ${nsd_name} %{VIM_TARGET} ${ns_name} ${ns_config} ${publickey} ${ns_timeout}
75 Set Suite Variable ${ns_id} ${id}
78 Get Management Ip Address
80 ${ip_addr} Get Vnf Management Ip Address ${ns_id} ${vnf_member_index}
82 Set Suite Variable ${vnf_ip_addr} ${ip_addr}
87 Variable Should Exist ${vnf_ip_addr} msg=IP address of the management VNF '${vnf_member_index}' is not available
88 Sleep 30s Waiting ssh daemon to be up
89 Test SSH Connection ${vnf_ip_addr} ${username} ${password} ${privatekey}
92 Check Remote File Created Via Day 1 Operation
93 [Documentation] Check whether the file created in the previous test via Day 1 operations exist or not.
95 Check If remote File Exists ${vnf_ip_addr} ${username} ${password} ${privatekey} ${day_1_file_name}
100 Open Connection ${osm_host}
101 Login With Public Key ${osm_username} keyfile=${osm_privatekey}
102 ${pod}= Execute Remote Command Check Rc Return Output ${osm_host} ${osm_username} ${osm_password} ${osm_privatekey} kubectl get pod -n ${ns_id} --no-headers -o custom-columns=":metadata.name"
103 ${svc}= Execute Remote Command Check Rc Return Output ${osm_host} ${osm_username} ${osm_password} ${osm_privatekey} kubectl get svc -n ${ns_id} -l app.kubernetes.io/name=eechart -o jsonpath='{.items[0].spec.clusterIP}'
104 Set Suite Variable ${pod_name} ${pod}
105 Set Suite Variable ${svc_ip} ${svc}
108 Fail when trying to access gRPC server without TLS
110 ${command} = Catenate python3 osm_ee/frontend_client.py ${svc_ip} 50050 sleep
111 ${result}= Execute Remote Command Check Rc Return Output ${osm_host} ${osm_username} ${osm_password} ${osm_privatekey} kubectl exec -it -n ${ns_id} ${pod_name} -- ${command}
112 Should Contain ${result} Connection lost
124 Delete NSD ${nsd_name}
127 Delete VNF Descriptor
130 Delete VNFD ${vnfd_name}
135 [Documentation] Test Suite Cleanup: Deleting descriptors and NS instance
137 Run Keyword If Any Tests Failed Delete NS ${ns_name}
139 Run Keyword If Any Tests Failed Delete NSD ${nsd_name}
141 Run Keyword If Any Tests Failed Delete VNFD ${vnfd_name}