blob: 24f9fe3310e5ef4edcfc40f087a5bb7a6d176a87 [file] [log] [blame]
DR695Hccff30b2017-02-17 18:44:24 -05001*** Settings ***
2Documentation Testing openstack.
3Library OperatingSystem
4Library SSHLibrary
5Library RequestsLibrary
6Library JSONUtils
7Library OpenstackLibrary
8Library HEATUtils
9Library Collections
10Resource ../../resources/openstack/keystone_interface.robot
11Resource ../../resources/openstack/nova_interface.robot
12Resource ../../resources/openstack/heat_interface.robot
13Resource ../../resources/ssh/files.robot
14Resource ../../resources/ssh/processes.robot
15Resource packet_generator_interface.robot
16
17
18*** Variables ***
DR695Hccff30b2017-02-17 18:44:24 -050019
20*** Keywords ***
21Wait For Server
Jerry Flood9b5e79f2017-03-30 07:59:33 -040022 [Documentation] Attempts to login to the passed server info and verify (??). Uses server info to get public ip and locate corresponding provate key file
DR695Hccff30b2017-02-17 18:44:24 -050023 [Arguments] ${server_ip} ${timeout}=300s
Jerry Flood9b5e79f2017-03-30 07:59:33 -040024 ${file}= Catenate ${GLOBAL_VM_PRIVATE_KEY}
DR695Hccff30b2017-02-17 18:44:24 -050025 Wait Until Keyword Succeeds ${timeout} 5 sec Open Connection And Log In ${server_ip} root ${file}
Jerry Flood9b5e79f2017-03-30 07:59:33 -040026 ${lines}= Grep Local File "Accepted publickey" /var/log/auth.log
27 Log ${lines}
DR695Hccff30b2017-02-17 18:44:24 -050028 Should Not Be Empty ${lines}
Jerry Flood9b5e79f2017-03-30 07:59:33 -040029
30Get Server Ip
DR695Hccff30b2017-02-17 18:44:24 -050031 [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 Flood9b5e79f2017-03-30 07:59:33 -040035 ${ip}= Get Openstack Server Ip ${server} network_name=${network_name}
DR695Hccff30b2017-02-17 18:44:24 -050036 Log Returned Get Openstack Server Ip
Jerry Flood9b5e79f2017-03-30 07:59:33 -040037 [Return] ${ip}
DR695Hccff30b2017-02-17 18:44:24 -050038
39Find And Reboot The Server
Jerry Flood9b5e79f2017-03-30 07:59:33 -040040 [Documentation] Code to reboot the server by teh heat server name parameter value
DR695Hccff30b2017-02-17 18:44:24 -050041 [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 Flood9b5e79f2017-03-30 07:59:33 -040046
47