DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Testing openstack. |
| 3 | Library OperatingSystem |
| 4 | Library SSHLibrary |
| 5 | Library RequestsLibrary |
| 6 | Library JSONUtils |
| 7 | Library OpenstackLibrary |
| 8 | Library HEATUtils |
| 9 | Library Collections |
| 10 | Resource ../../resources/openstack/keystone_interface.robot |
| 11 | Resource ../../resources/openstack/nova_interface.robot |
| 12 | Resource ../../resources/openstack/heat_interface.robot |
| 13 | Resource ../../resources/ssh/files.robot |
| 14 | Resource ../../resources/ssh/processes.robot |
| 15 | Resource packet_generator_interface.robot |
| 16 | |
| 17 | |
| 18 | *** Variables *** |
| 19 | ${ASSETS} ${EXECDIR}/robot/assets/ |
| 20 | ${VFW_STACK_NAME} EcompETE_VFWStack |
| 21 | ${VLB_STACK_NAME} EcompETE_VLBStack |
| 22 | ${DNS_STACK_NAME} EcompETE_DNSStack |
| 23 | |
| 24 | *** Keywords *** |
| 25 | Wait For Server |
| 26 | [Documentation] Attempts to login to the passed server info and verify (??). Uses server info to get public ip and locate corresponding provate key file |
| 27 | [Arguments] ${server_ip} ${timeout}=300s |
| 28 | ${file}= Catenate ${ASSETS}keys/robot_ssh_private_key.pvt |
| 29 | Wait Until Keyword Succeeds ${timeout} 5 sec Open Connection And Log In ${server_ip} root ${file} |
| 30 | ${lines}= Grep Local File "Accepted publickey" /var/log/auth.log |
| 31 | Log ${lines} |
| 32 | Should Not Be Empty ${lines} |
| 33 | |
| 34 | Get Server Ip |
| 35 | [Arguments] ${server_list} ${stack_info} ${key_name} ${network_name}=public |
| 36 | ${server_name}= Get From Dictionary ${stack_info} ${key_name} |
| 37 | ${server}= Get From Dictionary ${server_list} ${server_name} |
| 38 | Log Entering Get Openstack Server Ip |
| 39 | ${ip}= Get Openstack Server Ip ${server} network_name=${network_name} |
| 40 | Log Returned Get Openstack Server Ip |
| 41 | [Return] ${ip} |
| 42 | |
| 43 | Find And Reboot The Server |
| 44 | [Documentation] Code to reboot the server by teh heat server name parameter value |
| 45 | [Arguments] ${stack_info} ${server_list} ${server_name_parameter} |
| 46 | ${server_name}= Get From Dictionary ${stack_info} ${server_name_parameter} |
| 47 | ${vfw_server}= Get From Dictionary ${server_list} ${server_name} |
| 48 | ${vfw_server_id}= Get From Dictionary ${vfw_server} id |
| 49 | Reboot Server auth ${vfw_server_id} |
| 50 | |
| 51 | |