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 *** |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 19 | |
| 20 | *** Keywords *** |
| 21 | Wait For Server |
Jerry Flood | 9b5e79f | 2017-03-30 07:59:33 -0400 | [diff] [blame^] | 22 | [Documentation] Attempts to login to the passed server info and verify (??). Uses server info to get public ip and locate corresponding provate key file |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 23 | [Arguments] ${server_ip} ${timeout}=300s |
Jerry Flood | 9b5e79f | 2017-03-30 07:59:33 -0400 | [diff] [blame^] | 24 | ${file}= Catenate ${GLOBAL_VM_PRIVATE_KEY} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 25 | Wait Until Keyword Succeeds ${timeout} 5 sec Open Connection And Log In ${server_ip} root ${file} |
Jerry Flood | 9b5e79f | 2017-03-30 07:59:33 -0400 | [diff] [blame^] | 26 | ${lines}= Grep Local File "Accepted publickey" /var/log/auth.log |
| 27 | Log ${lines} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 28 | Should Not Be Empty ${lines} |
Jerry Flood | 9b5e79f | 2017-03-30 07:59:33 -0400 | [diff] [blame^] | 29 | |
| 30 | Get Server Ip |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 31 | [Arguments] ${server_list} ${stack_info} ${key_name} ${network_name}=public |
| 32 | ${server_name}= Get From Dictionary ${stack_info} ${key_name} |
| 33 | ${server}= Get From Dictionary ${server_list} ${server_name} |
| 34 | Log Entering Get Openstack Server Ip |
Jerry Flood | 9b5e79f | 2017-03-30 07:59:33 -0400 | [diff] [blame^] | 35 | ${ip}= Get Openstack Server Ip ${server} network_name=${network_name} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 36 | Log Returned Get Openstack Server Ip |
Jerry Flood | 9b5e79f | 2017-03-30 07:59:33 -0400 | [diff] [blame^] | 37 | [Return] ${ip} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 38 | |
| 39 | Find And Reboot The Server |
Jerry Flood | 9b5e79f | 2017-03-30 07:59:33 -0400 | [diff] [blame^] | 40 | [Documentation] Code to reboot the server by teh heat server name parameter value |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 41 | [Arguments] ${stack_info} ${server_list} ${server_name_parameter} |
| 42 | ${server_name}= Get From Dictionary ${stack_info} ${server_name_parameter} |
| 43 | ${vfw_server}= Get From Dictionary ${server_list} ${server_name} |
| 44 | ${vfw_server_id}= Get From Dictionary ${vfw_server} id |
| 45 | Reboot Server auth ${vfw_server_id} |
Jerry Flood | 9b5e79f | 2017-03-30 07:59:33 -0400 | [diff] [blame^] | 46 | |
| 47 | |