blob: 10b2584353370f01b4c487ffabe53ede626d197f [file] [log] [blame]
DR695Hccff30b2017-02-17 18:44:24 -05001*** Settings ***
2Documentation Testing openstack.
3Library OperatingSystem
4Library Process
5Library SSHLibrary
6Library RequestsLibrary
7Library JSONUtils
8Library OpenstackLibrary
9Library HEATUtils
10Library Collections
11LIbrary String
12Resource ../../resources/openstack/keystone_interface.robot
13Resource ../../resources/openstack/nova_interface.robot
14Resource ../../resources/openstack/heat_interface.robot
15Resource ../../resources/ssh/files.robot
16Resource ../../resources/ssh/processes.robot
17Resource packet_generator_interface.robot
18Resource darkstat_interface.robot
19Resource validate_common.robot
jf9860de6a6e22017-03-04 13:14:09 -050020Resource ../../resources/test_templates/vnf_orchestration_test_template.robot
DR695Hccff30b2017-02-17 18:44:24 -050021
22
23*** Variables ***
24${ASSETS} ${EXECDIR}/robot/assets/
25
26*** Keywords ***
27Policy Check Firewall Stack
28 [Documentation] Identifies the firewall servers in the VFW Stack in the GLOBAL_OPENSTACK_SERVICE_REGION
29 [Arguments] ${stack_name} ${policy_rate}
30 Run Openstack Auth Request auth
31 ${stack_info}= Wait for Stack to Be Deployed auth ${stack_name}
32 ${stack_id}= Get From Dictionary ${stack_info} id
33 ${server_list}= Get Openstack Servers auth
34 Log ${server_list}
35 ${vpg_unprotected_ip}= Get From Dictionary ${stack_info} vpg_private_ip_0
36 ${vsn_protected_ip}= Get From Dictionary ${stack_info} vsn_private_ip_0
37 ${vpg_public_ip}= Get Server Ip ${server_list} ${stack_info} vpg_name_0 network_name=public
38 ${vsn_public_ip}= Get Server Ip ${server_list} ${stack_info} vsn_name_0 network_name=public
39 ${upper_bound}= Evaluate ${policy_rate}*2
40 Wait Until Keyword Succeeds 300s 1s Run VFW Policy Check ${vpg_public_ip} ${policy_rate} ${upper_bound} 1
41
42Run VFW Policy Check
43 [Documentation] Push traffic above upper bound, wait for policy to fix it, push traffic to lower bound, wait for policy to fix it,
44 [Arguments] ${vpg_public_ip} ${policy_rate} ${upper_bound} ${lower_bound}
45 # Force traffic above threshold
46 Check For Policy Enforcement ${vpg_public_ip} ${policy_rate} ${upper_bound}
47 # Force traffic below threshold
48 Check For Policy Enforcement ${vpg_public_ip} ${policy_rate} ${lower_bound}
49
50
51Check For Policy Enforcement
52 [Documentation] Push traffic above upper bound, wait for policy to fix it, push traffic to lower bound, wait for policy to fix it,
53 [Arguments] ${vpg_public_ip} ${policy_rate} ${forced_rate}
54 Enable Streams ${vpg_public_ip} ${forced_rate}
55 Wait Until Keyword Succeeds 20s 5s Test For Expected Rate ${vpg_public_ip} ${forced_rate}
56 Wait Until Keyword Succeeds 280s 5s Test For Expected Rate ${vpg_public_ip} ${policy_rate}
57
58Test For Expected Rate
59 [Documentation] Ge the number of pg-streams from the PGN, and test to see if it is what we expect.
60 [Arguments] ${vpg_public_ip} ${number_of_streams}
61 ${list}= Get List Of Enabled Streams ${vpg_public_ip}
62 ${list}= Evaluate ${list['sample-plugin']}['pg-streams']['pg-stream']
63 Length Should Be ${list} ${number_of_streams}
64
65
66
67Policy Check vLB Stack
68 [Documentation] Identifies the firewall servers in the VFW Stack in the GLOBAL_OPENSTACK_SERVICE_REGION
69 [Arguments] ${stack_name} ${policy_rate}
70 Run Openstack Auth Request auth
71 ${stack_info}= Wait for Stack to Be Deployed auth ${stack_name}
72 ${stack_id}= Get From Dictionary ${stack_info} id
73 ${server_list}= Get Openstack Servers auth
74 ${vlb_public_ip}= Get Server Ip ${server_list} ${stack_info} vlb_name_0 network_name=public
75 ${upper_bound}= Evaluate ${policy_rate}*2
76 Start DNS Traffic ${vlb_public_ip} ${upper_bound}
77
78 # Now wiat for the dnsscaling stack to be deployed
79 ${prefix}= Get DNSScaling Prefix
80 ${dnsscaling}= Replace String Using Regexp ${stack_name} ^Vfmodule_ ${prefix}
81 ${dnsscaling_info}= Wait for Stack to Be Deployed auth ${dnsscaling}
jf9860de6a6e22017-03-04 13:14:09 -050082 VLB Closed Loop Hack Update ${dnsscaling}
DR695Hccff30b2017-02-17 18:44:24 -050083 # TO DO: Log into vLB and cehck that traffic is flowing to the new DNS
84 [Return] ${dnsscaling}
85
86Get DNSScaling Prefix
87 ${mapping}= Get From Dictionary ${GLOBAL_SERVICE_TEMPLATE_MAPPING} vLB
88 :for ${dict} in @{mapping}
89 \ Return From Keyword If '${dict['isBase']}' == 'false' ${dict['prefix']}
90 [Return] None
91
92
93Start DNS Traffic
94 [Documentation] Run nslookups at rate per second. Run for 10 minutes or until it is called by the terminate process
95 [Arguments] ${vlb_public_ip} ${rate}
96 ${pid}= Start Process ./dnstraffic.sh ${vlb_public_ip} ${rate} ${GLOBAL_DNS_TRAFFIC_DURATION}
97 [Return] ${pid}