DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Testing openstack. |
| 3 | Library OperatingSystem |
| 4 | Library Process |
| 5 | Library SSHLibrary |
| 6 | Library RequestsLibrary |
| 7 | Library JSONUtils |
| 8 | Library OpenstackLibrary |
| 9 | Library HEATUtils |
| 10 | Library Collections |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 11 | Library String |
DR695H | fcb0ee8 | 2019-05-22 17:21:38 -0400 | [diff] [blame] | 12 | Library ONAPLibrary.ServiceMapping |
| 13 | |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 14 | Resource ../openstack/keystone_interface.robot |
| 15 | Resource ../openstack/nova_interface.robot |
| 16 | Resource ../openstack/heat_interface.robot |
| 17 | Resource ../ssh/files.robot |
| 18 | Resource ../ssh/processes.robot |
| 19 | Resource ../demo_preload.robot |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 20 | Resource packet_generator_interface.robot |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 21 | Resource validate_common.robot |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 22 | Resource ../test_templates/vnf_orchestration_test_template.robot |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 23 | |
| 24 | |
| 25 | *** Variables *** |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 26 | |
| 27 | *** Keywords *** |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 28 | Policy Check FirewallCL Stack |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 29 | [Documentation] Executes the vFW policy closed loop test. |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 30 | [Arguments] ${stacknamemap} ${policy_rate} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 31 | Run Openstack Auth Request auth |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 32 | ${vsnk_stack_name}= Get From Dictionary ${stacknamemap} vFWSNK |
| 33 | ${vpkg_stack_name}= Get From Dictionary ${stacknamemap} vPKG |
| 34 | ${vsnk_stack_info}= Wait for Stack to Be Deployed auth ${vsnk_stack_name} |
| 35 | ${vpkg_stack_info}= Wait for Stack to Be Deployed auth ${vpkg_stack_name} |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 36 | ${server_list}= Get Openstack Servers auth |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 37 | Log ${server_list} |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 38 | ${vpkg_id}= Get From Dictionary ${vpkg_stack_info} vnf_id |
| 39 | ${status} ${generic_vnf}= Run Keyword And Ignore Error Get Generic VNF By ID ${vpkg_id} |
| 40 | Run Keyword If '${status}' == 'FAIL' FAIL VNF ID: ${vpkg_id} is not found. |
| 41 | ${invariantUUID} Get From Dictionary ${generic_vnf} persona-model-id |
| 42 | Update vVFWCL Policy ${invariantUUID} |
| 43 | |
Brian Freeman | ee02b31 | 2019-02-04 20:36:08 -0500 | [diff] [blame] | 44 | ${vpg_unprotected_ip}= Get From Dictionary ${vpkg_stack_info} vpg_int_unprotected_private_ip_0 |
| 45 | ${vsn_protected_ip}= Get From Dictionary ${vsnk_stack_info} vsn_int_protected_private_ip_0 |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 46 | ${vpg_public_ip}= Get Server Ip ${server_list} ${vpkg_stack_info} vpg_name_0 network_name=public |
| 47 | ${vsn_public_ip}= Get Server Ip ${server_list} ${vsnk_stack_info} vsn_name_0 network_name=public |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 48 | ${upper_bound}= Evaluate ${policy_rate}*2 |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 49 | Wait Until Keyword Succeeds 30m 2s Run VFW Policy Check ${vpg_public_ip} ${policy_rate} ${upper_bound} 1 |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 50 | |
| 51 | Run VFW Policy Check |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 52 | [Documentation] Push traffic above upper bound, wait for policy to fix it, push traffic to lower bound, wait for policy to fix it, |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 53 | [Arguments] ${vpg_public_ip} ${policy_rate} ${upper_bound} ${lower_bound} |
| 54 | # Force traffic above threshold |
| 55 | Check For Policy Enforcement ${vpg_public_ip} ${policy_rate} ${upper_bound} |
| 56 | # Force traffic below threshold |
| 57 | Check For Policy Enforcement ${vpg_public_ip} ${policy_rate} ${lower_bound} |
| 58 | |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 59 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 60 | Check For Policy Enforcement |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 61 | [Documentation] Push traffic above upper bound, wait for policy to fix it, push traffic to lower bound, wait for policy to fix it, |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 62 | [Arguments] ${vpg_public_ip} ${policy_rate} ${forced_rate} |
| 63 | Enable Streams ${vpg_public_ip} ${forced_rate} |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 64 | Wait Until Keyword Succeeds 20s 2s Test For Expected Rate ${vpg_public_ip} ${forced_rate} |
| 65 | Wait Until Keyword Succeeds 10m 2s Test For Expected Rate ${vpg_public_ip} ${policy_rate} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 66 | |
| 67 | Test For Expected Rate |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 68 | [Documentation] Ge the number of pg-streams from the PGN, and test to see if it is what we expect. |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 69 | [Arguments] ${vpg_public_ip} ${number_of_streams} |
| 70 | ${list}= Get List Of Enabled Streams ${vpg_public_ip} |
| 71 | ${list}= Evaluate ${list['sample-plugin']}['pg-streams']['pg-stream'] |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 72 | Length Should Be ${list} ${number_of_streams} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 73 | |
| 74 | |
| 75 | |
| 76 | Policy Check vLB Stack |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 77 | [Documentation] Executes the vLB policy closed loop test |
| 78 | [Arguments] ${stack_name} ${policy_rate} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 79 | Run Openstack Auth Request auth |
| 80 | ${stack_info}= Wait for Stack to Be Deployed auth ${stack_name} |
| 81 | ${stack_id}= Get From Dictionary ${stack_info} id |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 82 | ${server_list}= Get Openstack Servers auth |
| 83 | ${vlb_public_ip}= Get Server Ip ${server_list} ${stack_info} vlb_name_0 network_name=public |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 84 | ${upper_bound}= Evaluate ${policy_rate}*2 |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 85 | Start DNS Traffic ${vlb_public_ip} ${upper_bound} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 86 | |
| 87 | # Now wiat for the dnsscaling stack to be deployed |
| 88 | ${prefix}= Get DNSScaling Prefix |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 89 | ${dnsscaling}= Replace String Using Regexp ${stack_name} ^Vfmodule_ ${prefix} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 90 | ${dnsscaling_info}= Wait for Stack to Be Deployed auth ${dnsscaling} |
jf9860 | de6a6e2 | 2017-03-04 13:14:09 -0500 | [diff] [blame] | 91 | VLB Closed Loop Hack Update ${dnsscaling} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 92 | # TO DO: Log into vLB and cehck that traffic is flowing to the new DNS |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 93 | [Return] ${dnsscaling} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 94 | |
| 95 | Get DNSScaling Prefix |
DR695H | fcb0ee8 | 2019-05-22 17:21:38 -0400 | [diff] [blame] | 96 | Set Directory default ./demo/service_mapping |
| 97 | ${mapping}= Get Service Template Mapping default vLB vLB |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 98 | :FOR ${dict} IN @{mapping} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 99 | \ Return From Keyword If '${dict['isBase']}' == 'false' ${dict['prefix']} |
| 100 | [Return] None |
jf9860 | 99c6329 | 2017-03-09 15:28:42 -0500 | [diff] [blame] | 101 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 102 | |
| 103 | Start DNS Traffic |
| 104 | [Documentation] Run nslookups at rate per second. Run for 10 minutes or until it is called by the terminate process |
| 105 | [Arguments] ${vlb_public_ip} ${rate} |
| 106 | ${pid}= Start Process ./dnstraffic.sh ${vlb_public_ip} ${rate} ${GLOBAL_DNS_TRAFFIC_DURATION} |
Gary Wu | 76bc74f | 2018-03-22 13:25:49 -0700 | [diff] [blame] | 107 | [Return] ${pid} |