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