blob: e16272027cd188ff5baeaf0fb647aa74a86c2ec9 [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 ../appc_interface.robot
16Resource packet_generator_interface.robot
17Resource validate_common.robot
18
19
20*** Variables ***
DR695Hccff30b2017-02-17 18:44:24 -050021
22*** Keywords ***
23Validate Firewall Stack
jf986099c63292017-03-09 15:28:42 -050024 [Documentation] Identifies and validates the firewall servers in the VFW Stack
jf98603b22a2d2017-03-01 19:43:28 -050025 [Arguments] ${STACK_NAME}
DR695Hccff30b2017-02-17 18:44:24 -050026 Run Openstack Auth Request auth
27 ${stack_info}= Wait for Stack to Be Deployed auth ${STACK_NAME}
28 ${stack_id}= Get From Dictionary ${stack_info} id
jf98603b22a2d2017-03-01 19:43:28 -050029 ${server_list}= Get Openstack Servers auth
DR695Hccff30b2017-02-17 18:44:24 -050030
31 ${vpg_unprotected_ip}= Get From Dictionary ${stack_info} vpg_private_ip_0
32 ${vsn_protected_ip}= Get From Dictionary ${stack_info} vsn_private_ip_0
33 ${vpg_name_0}= Get From Dictionary ${stack_info} vpg_name_0
jf98603b22a2d2017-03-01 19:43:28 -050034 ${vfw_public_ip}= Get Server Ip ${server_list} ${stack_info} vfw_name_0 network_name=public
35 ${vpg_public_ip}= Get Server Ip ${server_list} ${stack_info} vpg_name_0 network_name=public
36 ${vsn_public_ip}= Get Server Ip ${server_list} ${stack_info} vsn_name_0 network_name=public
37
DR695Hccff30b2017-02-17 18:44:24 -050038 Wait For Server ${vfw_public_ip}
39 Wait For Server ${vpg_public_ip}
40 Wait For Server ${vsn_public_ip}
41 Log Accessed all servers
jf98603b22a2d2017-03-01 19:43:28 -050042 Wait For Firewall ${vfw_public_ip}
43 Wait For Packet Generator ${vpg_public_ip}
44 Wait For Packet Sink ${vsn_public_ip}
DR695Hccff30b2017-02-17 18:44:24 -050045 Log All server processes up
jf9860b85b1642017-03-02 11:24:11 -050046 ${vpg_oam_ip}= Get From Dictionary ${stack_info} vpg_private_ip_1
47 ${appc}= Create Mount Point In APPC ${vpg_name_0} ${vpg_oam_ip}
DR695Hccff30b2017-02-17 18:44:24 -050048 Wait For Packets ${vpg_public_ip} ${vpg_unprotected_ip} ${vsn_protected_ip} ${vsn_public_ip}
jf98603b22a2d2017-03-01 19:43:28 -050049
DR695Hccff30b2017-02-17 18:44:24 -050050Wait For Packets
51 [Documentation] Final vfw validation that packets are flowing from the pgn VM to the snk VM
jf98603b22a2d2017-03-01 19:43:28 -050052 [Arguments] ${vpg_public_ip} ${vpg_unprotected_ip} ${vsn_protected_ip} ${vsn_public_ip}
DR695Hccff30b2017-02-17 18:44:24 -050053 ${resp}= Enable Stream ${vpg_public_ip}
54 Should Be Equal As Strings ${resp.status_code} 200
jf98603b22a2d2017-03-01 19:43:28 -050055 ${syslog_message}= Catenate UDP: short packet: From ${vpg_unprotected_ip}:.* to ${vsn_protected_ip}:.*
DR695Hccff30b2017-02-17 18:44:24 -050056 Tail File on Host Until ${vsn_public_ip} UDP: /var/log/syslog ${syslog_message} timeout=120s
jf98603b22a2d2017-03-01 19:43:28 -050057 Disable All Streams ${vpg_public_ip}
DR695Hccff30b2017-02-17 18:44:24 -050058
59
60Wait For Firewall
61 [Documentation] Wait for the defined firewall processes to come up
jf98603b22a2d2017-03-01 19:43:28 -050062 [Arguments] ${ip}
Jerry Flood81d33fb2017-11-21 16:21:21 -050063 ##Wait for Process on Host ./vpp_measurement_reporter ${ip}
jf98603b22a2d2017-03-01 19:43:28 -050064 Wait for Process on Host vpp -c /etc/vpp/startup.conf ${ip}
DR695Hccff30b2017-02-17 18:44:24 -050065
66Wait For Packet Generator
67 [Documentation] Wait for the defined packet generator processes to come up
jf98603b22a2d2017-03-01 19:43:28 -050068 [Arguments] ${ip}
69 Wait for Process on Host vpp -c /etc/vpp/startup.conf ${ip}
Jerry Flood81d33fb2017-11-21 16:21:21 -050070 ##Wait Until Keyword Succeeds 180s 5s Tail File on Host Until ${ip} Honeycomb /var/log/honeycomb/honeycomb.log - Honeycomb initialized options=-c +0 timeout=120s
jf98603b22a2d2017-03-01 19:43:28 -050071 Run Keyword And Ignore Error Wait for Process on Host run_traffic_fw_demo.sh ${ip} timeout=60s
DR695Hccff30b2017-02-17 18:44:24 -050072 Pkill Process On Host "/bin/bash ./run_traffic_fw_demo.sh" ${ip}
jf98603b22a2d2017-03-01 19:43:28 -050073
DR695Hccff30b2017-02-17 18:44:24 -050074Wait For Packet Sink
75 [Documentation] Wait for the defined packet sink processes to come up
76 [Arguments] ${ip}
Jerry Flood81d33fb2017-11-21 16:21:21 -050077 Wait for Process on Host /usr/sbin/darkstat ${ip}